Rapport-Mobileapp/dist/assets/index-DfDxGoFI.js

380 lines
3.1 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var BNe=Object.defineProperty;var VNe=(n,t,i)=>t in n?BNe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i;var sn=(n,t,i)=>(VNe(n,typeof t!="symbol"?t+"":t,i),i),A$=(n,t,i)=>{if(!t.has(n))throw TypeError("Cannot "+i)};var b=(n,t,i)=>(A$(n,t,"read from private field"),i?i.call(n):t.get(n)),J=(n,t,i)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,i)},te=(n,t,i,s)=>(A$(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i);var ea=(n,t,i,s)=>({set _(l){te(n,t,l,i)},get _(){return b(n,t,s)}}),fe=(n,t,i)=>(A$(n,t,"access private method"),i);function zNe(n,t){for(var i=0;i<t.length;i++){const s=t[i];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in n)){const d=Object.getOwnPropertyDescriptor(s,l);d&&Object.defineProperty(n,l,d.get?d:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const d of l)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(l){const d={};return l.integrity&&(d.integrity=l.integrity),l.referrerPolicy&&(d.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?d.credentials="include":l.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(l){if(l.ep)return;l.ep=!0;const d=i(l);fetch(l.href,d)}})();var Ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ty(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Sme(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var i=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(s){var l=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(i,s,l.get?l:{enumerable:!0,get:function(){return n[s]}})}),i}var bme={exports:{}},uU={},Cme={exports:{}},er={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var cP=Symbol.for("react.element"),HNe=Symbol.for("react.portal"),GNe=Symbol.for("react.fragment"),WNe=Symbol.for("react.strict_mode"),$Ne=Symbol.for("react.profiler"),KNe=Symbol.for("react.provider"),qNe=Symbol.for("react.context"),YNe=Symbol.for("react.forward_ref"),XNe=Symbol.for("react.suspense"),JNe=Symbol.for("react.memo"),QNe=Symbol.for("react.lazy"),Pde=Symbol.iterator;function ZNe(n){return n===null||typeof n!="object"?null:(n=Pde&&n[Pde]||n["@@iterator"],typeof n=="function"?n:null)}var Tme={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Rme=Object.assign,xme={};function hx(n,t,i){this.props=n,this.context=t,this.refs=xme,this.updater=i||Tme}hx.prototype.isReactComponent={};hx.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,t,"setState")};hx.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Ame(){}Ame.prototype=hx.prototype;function bJ(n,t,i){this.props=n,this.context=t,this.refs=xme,this.updater=i||Tme}var CJ=bJ.prototype=new Ame;CJ.constructor=bJ;Rme(CJ,hx.prototype);CJ.isPureReactComponent=!0;var Lde=Array.isArray,Ime=Object.prototype.hasOwnProperty,TJ={current:null},Nme={key:!0,ref:!0,__self:!0,__source:!0};function Ome(n,t,i){var s,l={},d=null,u=null;if(t!=null)for(s in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(d=""+t.key),t)Ime.call(t,s)&&!Nme.hasOwnProperty(s)&&(l[s]=t[s]);var p=arguments.length-2;if(p===1)l.children=i;else if(1<p){for(var m=Array(p),y=0;y<p;y++)m[y]=arguments[y+2];l.children=m}if(n&&n.defaultProps)for(s in p=n.defaultProps,p)l[s]===void 0&&(l[s]=p[s]);return{$$typeof:cP,type:n,key:d,ref:u,props:l,_owner:TJ.current}}function e5e(n,t){return{$$typeof:cP,type:n.type,key:t,ref:n.ref,props:n.props,_owner:n._owner}}function RJ(n){return typeof n=="object"&&n!==null&&n.$$typeof===cP}function t5e(n){var t={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(i){return t[i]})}var Dde=/\/+/g;function I$(n,t){return typeof n=="object"&&n!==null&&n.key!=null?t5e(""+n.key):t.toString(36)}function lM(n,t,i,s,l){var d=typeof n;(d==="undefined"||d==="boolean")&&(n=null);var u=!1;if(n===null)u=!0;else switch(d){case"string":case"number":u=!0;break;case"object":switch(n.$$typeof){case cP:case HNe:u=!0}}if(u)return u=n,l=l(u),n=s===""?"."+I$(u,0):s,Lde(l)?(i="",n!=null&&(i=n.replace(Dde,"$&/")+"/"),lM(l,t,i,"",function(y){return y})):l!=null&&(RJ(l)&&(l=e5e(l,i+(!l.key||u&&u.key===l.key?"":(""+l.key).replace(Dde,"$&/")+"/")+n)),t.push(l)),1;if(u=0,s=s===""?".":s+":",Lde(n))for(var p=0;p<n.length;p++){d=n[p];var m=s+I$(d,p);u+=lM(d,t,i,m,l)}else if(m=ZNe(n),typeof m=="function")for(n=m.call(n),p=0;!(d=n.next()).done;)d=d.value,m=s+I$(d,p++),u+=lM(d,t,i,m,l);else if(d==="object")throw t=String(n),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function A8(n,t,i){if(n==null)return n;var s=[],l=0;return lM(n,s,"","",function(d){return t.call(i,d,l++)}),s}function n5e(n){if(n._status===-1){var t=n._result;t=t(),t.then(function(i){(n._status===0||n._status===-1)&&(n._status=1,n._result=i)},function(i){(n._status===0||n._status===-1)&&(n._status=2,n._result=i)}),n._status===-1&&(n._status=0,n._result=t)}if(n._status===1)return n._result.default;throw n._result}var pc={current:null},cM={transition:null},i5e={ReactCurrentDispatcher:pc,ReactCurrentBatchConfig:cM,ReactCurrentOwner:TJ};er.Children={map:A8,forEach:function(n,t,i){A8(n,function(){t.apply(this,arguments)},i)},count:function(n){var t=0;return A8(n,function(){t++}),t},toArray:function(n){return A8(n,function(t){return t})||[]},only:function(n){if(!RJ(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};er.Component=hx;er.Fragment=GNe;er.Profiler=$Ne;er.PureComponent=bJ;er.StrictMode=WNe;er.Suspense=XNe;er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i5e;er.cloneElement=function(n,t,i){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var s=Rme({},n.props),l=n.key,d=n.ref,u=n._owner;if(t!=null){if(t.ref!==void 0&&(d=t.ref,u=TJ.current),t.key!==void 0&&(l=""+t.key),n.type&&n.type.defaultProps)var p=n.type.defaultProps;for(m in t)Ime.call(t,m)&&!Nme.hasOwnProperty(m)&&(s[m]=t[m]===void 0&&p!==void 0?p[m]:t[m])}var m=arguments.length-2;if(m===1)s.children=i;else if(1<m){p=Array(m);for(var y=0;y<m;y++)p[y]=arguments[y+2];s.children=p}return{$$typeof:cP,type:n.type,key:l,ref:d,props:s,_owner:u}};er.createContext=function(n){return n={$$typeof:qNe,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:KNe,_context:n},n.Consumer=n};er.createElement=Ome;er.createFactory=function(n){var t=Ome.bind(null,n);return t.type=n,t};er.createRef=function(){return{current:null}};er.forwardRef=function(n){return{$$typeof:YNe,render:n}};er.isValidElement=RJ;er.lazy=function(n){return{$$typeof:QNe,_payload:{_status:-1,_result:n},_init:n5e}};er.memo=function(n,t){return{$$typeof:JNe,type:n,compare:t===void 0?null:t}};er.startTransition=function(n){var t=cM.transition;cM.transition={};try{n()}finally{cM.transition=t}};er.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};er.useCallback=function(n,t){return pc.current.useCallback(n,t)};er.useContext=function(n){return pc.current.useContext(n)};er.useDebugValue=function(){};er.useDeferredValue=function(n){return pc.current.useDeferredValue(n)};er.useEffect=function(n,t){return pc.current.useEffect(n,t)};er.useId=function(){return pc.current.useId()};er.useImperativeHandle=function(n,t,i){return pc.current.useImperativeHandle(n,t,i)};er.useInsertionEffect=function(n,t){return pc.current.useInsertionEffect(n,t)};er.useLayoutEffect=function(n,t){return pc.current.useLayoutEffect(n,t)};er.useMemo=function(n,t){return pc.current.useMemo(n,t)};er.useReducer=function(n,t,i){return pc.current.useReducer(n,t,i)};er.useRef=function(n){return pc.current.useRef(n)};er.useState=function(n){return pc.current.useState(n)};er.useSyncExternalStore=function(n,t,i){return pc.current.useSyncExternalStore(n,t,i)};er.useTransition=function(){return pc.current.useTransition()};er.version="18.2.0";Cme.exports=er;var k=Cme.exports;const dn=ty(k),r5e=zNe({__proto__:null,default:dn},[k]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var s5e=k,a5e=Symbol.for("react.element"),o5e=Symbol.for("react.fragment"),l5e=Object.prototype.hasOwnProperty,c5e=s5e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d5e={key:!0,ref:!0,__self:!0,__source:!0};function Pme(n,t,i){var s,l={},d=null,u=null;i!==void 0&&(d=""+i),t.key!==void 0&&(d=""+t.key),t.ref!==void 0&&(u=t.ref);for(s in t)l5e.call(t,s)&&!d5e.hasOwnProperty(s)&&(l[s]=t[s]);if(n&&n.defaultProps)for(s in t=n.defaultProps,t)l[s]===void 0&&(l[s]=t[s]);return{$$typeof:a5e,type:n,key:d,ref:u,props:l,_owner:c5e.current}}uU.Fragment=o5e;uU.jsx=Pme;uU.jsxs=Pme;bme.exports=uU;var h=bme.exports,ZK={},Lme={exports:{}},su={},Dme={exports:{}},kme={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(n){function t(he,pe){var Oe=he.length;he.push(pe);e:for(;0<Oe;){var Fe=Oe-1>>>1,Ue=he[Fe];if(0<l(Ue,pe))he[Fe]=pe,he[Oe]=Ue,Oe=Fe;else break e}}function i(he){return he.length===0?null:he[0]}function s(he){if(he.length===0)return null;var pe=he[0],Oe=he.pop();if(Oe!==pe){he[0]=Oe;e:for(var Fe=0,Ue=he.length,Ve=Ue>>>1;Fe<Ve;){var Re=2*(Fe+1)-1,Be=he[Re],Xe=Re+1,we=he[Xe];if(0>l(Be,Oe))Xe<Ue&&0>l(we,Be)?(he[Fe]=we,he[Xe]=Oe,Fe=Xe):(he[Fe]=Be,he[Re]=Oe,Fe=Re);else if(Xe<Ue&&0>l(we,Oe))he[Fe]=we,he[Xe]=Oe,Fe=Xe;else break e}}return pe}function l(he,pe){var Oe=he.sortIndex-pe.sortIndex;return Oe!==0?Oe:he.id-pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var u=Date,p=u.now();n.unstable_now=function(){return u.now()-p}}var m=[],y=[],_=1,E=null,C=3,x=!1,N=!1,O=!1,D=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(he){for(var pe=i(y);pe!==null;){if(pe.callback===null)s(y);else if(pe.startTime<=he)s(y),pe.sortIndex=pe.expirationTime,t(m,pe);else break;pe=i(y)}}function V(he){if(O=!1,M(he),!N)if(i(m)!==null)N=!0,me(G);else{var pe=i(y);pe!==null&&Ce(V,pe.startTime-he)}}function G(he,pe){N=!1,O&&(O=!1,P(Y),Y=-1),x=!0;var Oe=C;try{for(M(pe),E=i(m);E!==null&&(!(E.expirationTime>pe)||he&&!ee());){var Fe=E.callback;if(typeof Fe=="function"){E.callback=null,C=E.priorityLevel;var Ue=Fe(E.expirationTime<=pe);pe=n.unstable_now(),typeof Ue=="function"?E.callback=Ue:E===i(m)&&s(m),M(pe)}else s(m);E=i(m)}if(E!==null)var Ve=!0;else{var Re=i(y);Re!==null&&Ce(V,Re.startTime-pe),Ve=!1}return Ve}finally{E=null,C=Oe,x=!1}}var $=!1,ne=null,Y=-1,le=5,re=-1;function ee(){return!(n.unstable_now()-re<le)}function de(){if(ne!==null){var he=n.unstable_now();re=he;var pe=!0;try{pe=ne(!0,he)}finally{pe?H():($=!1,ne=null)}}else $=!1}var H;if(typeof j=="function")H=function(){j(de)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,_e=ae.port2;ae.port1.onmessage=de,H=function(){_e.postMessage(null)}}else H=function(){D(de,0)};function me(he){ne=he,$||($=!0,H())}function Ce(he,pe){Y=D(function(){he(n.unstable_now())},pe)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(he){he.callback=null},n.unstable_continueExecution=function(){N||x||(N=!0,me(G))},n.unstable_forceFrameRate=function(he){0>he||125<he?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<he?Math.floor(1e3/he):5},n.unstable_getCurrentPriorityLevel=function(){return C},n.unstable_getFirstCallbackNode=function(){return i(m)},n.unstable_next=function(he){switch(C){case 1:case 2:case 3:var pe=3;break;default:pe=C}var Oe=C;C=pe;try{return he()}finally{C=Oe}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(he,pe){switch(he){case 1:case 2:case 3:case 4:case 5:break;default:he=3}var Oe=C;C=he;try{return pe()}finally{C=Oe}},n.unstable_scheduleCallback=function(he,pe,Oe){var Fe=n.unstable_now();switch(typeof Oe=="object"&&Oe!==null?(Oe=Oe.delay,Oe=typeof Oe=="number"&&0<Oe?Fe+Oe:Fe):Oe=Fe,he){case 1:var Ue=-1;break;case 2:Ue=250;break;case 5:Ue=1073741823;break;case 4:Ue=1e4;break;default:Ue=5e3}return Ue=Oe+Ue,he={id:_++,callback:pe,priorityLevel:he,startTime:Oe,expirationTime:Ue,sortIndex:-1},Oe>Fe?(he.sortIndex=Oe,t(y,he),i(m)===null&&he===i(y)&&(O?(P(Y),Y=-1):O=!0,Ce(V,Oe-Fe))):(he.sortIndex=Ue,t(m,he),N||x||(N=!0,me(G))),he},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(he){var pe=C;return function(){var Oe=C;C=pe;try{return he.apply(this,arguments)}finally{C=Oe}}}})(kme);Dme.exports=kme;var u5e=Dme.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Mme=k,nu=u5e;function on(n){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+n,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+n+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var jme=new Set,W4={};function tw(n,t){KR(n,t),KR(n+"Capture",t)}function KR(n,t){for(W4[n]=t,n=0;n<t.length;n++)jme.add(t[n])}var Gg=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eq=Object.prototype.hasOwnProperty,h5e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,kde={},Mde={};function f5e(n){return eq.call(Mde,n)?!0:eq.call(kde,n)?!1:h5e.test(n)?Mde[n]=!0:(kde[n]=!0,!1)}function p5e(n,t,i,s){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:i!==null?!i.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function m5e(n,t,i,s){if(t===null||typeof t>"u"||p5e(n,t,i,s))return!0;if(s)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function mc(n,t,i,s,l,d,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=l,this.mustUseProperty=i,this.propertyName=n,this.type=t,this.sanitizeURL=d,this.removeEmptyString=u}var el={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){el[n]=new mc(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var t=n[0];el[t]=new mc(t,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){el[n]=new mc(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){el[n]=new mc(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){el[n]=new mc(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){el[n]=new mc(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){el[n]=new mc(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){el[n]=new mc(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){el[n]=new mc(n,5,!1,n.toLowerCase(),null,!1,!1)});var xJ=/[\-:]([a-z])/g;function AJ(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var t=n.replace(xJ,AJ);el[t]=new mc(t,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var t=n.replace(xJ,AJ);el[t]=new mc(t,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var t=n.replace(xJ,AJ);el[t]=new mc(t,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){el[n]=new mc(n,1,!1,n.toLowerCase(),null,!1,!1)});el.xlinkHref=new mc("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){el[n]=new mc(n,1,!1,n.toLowerCase(),null,!0,!0)});function IJ(n,t,i,s){var l=el.hasOwnProperty(t)?el[t]:null;(l!==null?l.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(m5e(t,i,l,s)&&(i=null),s||l===null?f5e(t)&&(i===null?n.removeAttribute(t):n.setAttribute(t,""+i)):l.mustUseProperty?n[l.propertyName]=i===null?l.type===3?!1:"":i:(t=l.attributeName,s=l.attributeNamespace,i===null?n.removeAttribute(t):(l=l.type,i=l===3||l===4&&i===!0?"":""+i,s?n.setAttributeNS(s,t,i):n.setAttribute(t,i))))}var Yg=Mme.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I8=Symbol.for("react.element"),_C=Symbol.for("react.portal"),EC=Symbol.for("react.fragment"),NJ=Symbol.for("react.strict_mode"),tq=Symbol.for("react.profiler"),Ume=Symbol.for("react.provider"),Fme=Symbol.for("react.context"),OJ=Symbol.for("react.forward_ref"),nq=Symbol.for("react.suspense"),iq=Symbol.for("react.suspense_list"),PJ=Symbol.for("react.memo"),y1=Symbol.for("react.lazy"),Bme=Symbol.for("react.offscreen"),jde=Symbol.iterator;function I3(n){return n===null||typeof n!="object"?null:(n=jde&&n[jde]||n["@@iterator"],typeof n=="function"?n:null)}var Ks=Object.assign,N$;function q3(n){if(N$===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);N$=t&&t[1]||""}return`
`+N$+n}var O$=!1;function P$(n,t){if(!n||O$)return"";O$=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(y){var s=y}Reflect.construct(n,[],t)}else{try{t.call()}catch(y){s=y}n.call(t.prototype)}else{try{throw Error()}catch(y){s=y}n()}}catch(y){if(y&&s&&typeof y.stack=="string"){for(var l=y.stack.split(`
`),d=s.stack.split(`
`),u=l.length-1,p=d.length-1;1<=u&&0<=p&&l[u]!==d[p];)p--;for(;1<=u&&0<=p;u--,p--)if(l[u]!==d[p]){if(u!==1||p!==1)do if(u--,p--,0>p||l[u]!==d[p]){var m=`
`+l[u].replace(" at new "," at ");return n.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",n.displayName)),m}while(1<=u&&0<=p);break}}}finally{O$=!1,Error.prepareStackTrace=i}return(n=n?n.displayName||n.name:"")?q3(n):""}function g5e(n){switch(n.tag){case 5:return q3(n.type);case 16:return q3("Lazy");case 13:return q3("Suspense");case 19:return q3("SuspenseList");case 0:case 2:case 15:return n=P$(n.type,!1),n;case 11:return n=P$(n.type.render,!1),n;case 1:return n=P$(n.type,!0),n;default:return""}}function rq(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case EC:return"Fragment";case _C:return"Portal";case tq:return"Profiler";case NJ:return"StrictMode";case nq:return"Suspense";case iq:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case Fme:return(n.displayName||"Context")+".Consumer";case Ume:return(n._context.displayName||"Context")+".Provider";case OJ:var t=n.render;return n=n.displayName,n||(n=t.displayName||t.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case PJ:return t=n.displayName||null,t!==null?t:rq(n.type)||"Memo";case y1:t=n._payload,n=n._init;try{return rq(n(t))}catch{}}return null}function v5e(n){var t=n.type;switch(n.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=t.render,n=n.displayName||n.name||"",t.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rq(t);case 8:return t===NJ?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yv(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Vme(n){var t=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function y5e(n){var t=Vme(n)?"checked":"value",i=Object.getOwnPropertyDescriptor(n.constructor.prototype,t),s=""+n[t];if(!n.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var l=i.get,d=i.set;return Object.defineProperty(n,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){s=""+u,d.call(this,u)}}),Object.defineProperty(n,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(u){s=""+u},stopTracking:function(){n._valueTracker=null,delete n[t]}}}}function N8(n){n._valueTracker||(n._valueTracker=y5e(n))}function zme(n){if(!n)return!1;var t=n._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return n&&(s=Vme(n)?n.checked?"true":"false":n.value),n=s,n!==i?(t.setValue(n),!0):!1}function d7(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function sq(n,t){var i=t.checked;return Ks({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??n._wrapperState.initialChecked})}function Ude(n,t){var i=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;i=Yv(t.value!=null?t.value:i),n._wrapperState={initialChecked:s,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Hme(n,t){t=t.checked,t!=null&&IJ(n,"checked",t,!1)}function aq(n,t){Hme(n,t);var i=Yv(t.value),s=t.type;if(i!=null)s==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+i):n.value!==""+i&&(n.value=""+i);else if(s==="submit"||s==="reset"){n.removeAttribute("value");return}t.hasOwnProperty("value")?oq(n,t.type,i):t.hasOwnProperty("defaultValue")&&oq(n,t.type,Yv(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(n.defaultChecked=!!t.defaultChecked)}function Fde(n,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+n._wrapperState.initialValue,i||t===n.value||(n.value=t),n.defaultValue=t}i=n.name,i!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,i!==""&&(n.name=i)}function oq(n,t,i){(t!=="number"||d7(n.ownerDocument)!==n)&&(i==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+i&&(n.defaultValue=""+i))}var Y3=Array.isArray;function jC(n,t,i,s){if(n=n.options,t){t={};for(var l=0;l<i.length;l++)t["$"+i[l]]=!0;for(i=0;i<n.length;i++)l=t.hasOwnProperty("$"+n[i].value),n[i].selected!==l&&(n[i].selected=l),l&&s&&(n[i].defaultSelected=!0)}else{for(i=""+Yv(i),t=null,l=0;l<n.length;l++){if(n[l].value===i){n[l].selected=!0,s&&(n[l].defaultSelected=!0);return}t!==null||n[l].disabled||(t=n[l])}t!==null&&(t.selected=!0)}}function lq(n,t){if(t.dangerouslySetInnerHTML!=null)throw Error(on(91));return Ks({},t,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function Bde(n,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(on(92));if(Y3(i)){if(1<i.length)throw Error(on(93));i=i[0]}t=i}t==null&&(t=""),i=t}n._wrapperState={initialValue:Yv(i)}}function Gme(n,t){var i=Yv(t.value),s=Yv(t.defaultValue);i!=null&&(i=""+i,i!==n.value&&(n.value=i),t.defaultValue==null&&n.defaultValue!==i&&(n.defaultValue=i)),s!=null&&(n.defaultValue=""+s)}function Vde(n){var t=n.textContent;t===n._wrapperState.initialValue&&t!==""&&t!==null&&(n.value=t)}function Wme(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function cq(n,t){return n==null||n==="http://www.w3.org/1999/xhtml"?Wme(t):n==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var O8,$me=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,s,l){MSApp.execUnsafeLocalFunction(function(){return n(t,i,s,l)})}:n}(function(n,t){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=t;else{for(O8=O8||document.createElement("div"),O8.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=O8.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;t.firstChild;)n.appendChild(t.firstChild)}});function $4(n,t){if(t){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=t;return}}n.textContent=t}var I4={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_5e=["Webkit","ms","Moz","O"];Object.keys(I4).forEach(function(n){_5e.forEach(function(t){t=t+n.charAt(0).toUpperCase()+n.substring(1),I4[t]=I4[n]})});function Kme(n,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||I4.hasOwnProperty(n)&&I4[n]?(""+t).trim():t+"px"}function qme(n,t){n=n.style;for(var i in t)if(t.hasOwnProperty(i)){var s=i.indexOf("--")===0,l=Kme(i,t[i],s);i==="float"&&(i="cssFloat"),s?n.setProperty(i,l):n[i]=l}}var E5e=Ks({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dq(n,t){if(t){if(E5e[n]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(on(137,n));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(on(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(on(61))}if(t.style!=null&&typeof t.style!="object")throw Error(on(62))}}function uq(n,t){if(n.indexOf("-")===-1)return typeof t.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var hq=null;function LJ(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var fq=null,UC=null,FC=null;function zde(n){if(n=hP(n)){if(typeof fq!="function")throw Error(on(280));var t=n.stateNode;t&&(t=gU(t),fq(n.stateNode,n.type,t))}}function Yme(n){UC?FC?FC.push(n):FC=[n]:UC=n}function Xme(){if(UC){var n=UC,t=FC;if(FC=UC=null,zde(n),t)for(n=0;n<t.length;n++)zde(t[n])}}function Jme(n,t){return n(t)}function Qme(){}var L$=!1;function Zme(n,t,i){if(L$)return n(t,i);L$=!0;try{return Jme(n,t,i)}finally{L$=!1,(UC!==null||FC!==null)&&(Qme(),Xme())}}function K4(n,t){var i=n.stateNode;if(i===null)return null;var s=gU(i);if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(n=n.type,s=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!s;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(on(231,t,typeof i));return i}var pq=!1;if(Gg)try{var N3={};Object.defineProperty(N3,"passive",{get:function(){pq=!0}}),window.addEventListener("test",N3,N3),window.removeEventListener("test",N3,N3)}catch{pq=!1}function w5e(n,t,i,s,l,d,u,p,m){var y=Array.prototype.slice.call(arguments,3);try{t.apply(i,y)}catch(_){this.onError(_)}}var N4=!1,u7=null,h7=!1,mq=null,S5e={onError:function(n){N4=!0,u7=n}};function b5e(n,t,i,s,l,d,u,p,m){N4=!1,u7=null,w5e.apply(S5e,arguments)}function C5e(n,t,i,s,l,d,u,p,m){if(b5e.apply(this,arguments),N4){if(N4){var y=u7;N4=!1,u7=null}else throw Error(on(198));h7||(h7=!0,mq=y)}}function nw(n){var t=n,i=n;if(n.alternate)for(;t.return;)t=t.return;else{n=t;do t=n,t.flags&4098&&(i=t.return),n=t.return;while(n)}return t.tag===3?i:null}function ege(n){if(n.tag===13){var t=n.memoizedState;if(t===null&&(n=n.alternate,n!==null&&(t=n.memoizedState)),t!==null)return t.dehydrated}return null}function Hde(n){if(nw(n)!==n)throw Error(on(188))}function T5e(n){var t=n.alternate;if(!t){if(t=nw(n),t===null)throw Error(on(188));return t!==n?null:n}for(var i=n,s=t;;){var l=i.return;if(l===null)break;var d=l.alternate;if(d===null){if(s=l.return,s!==null){i=s;continue}break}if(l.child===d.child){for(d=l.child;d;){if(d===i)return Hde(l),n;if(d===s)return Hde(l),t;d=d.sibling}throw Error(on(188))}if(i.return!==s.return)i=l,s=d;else{for(var u=!1,p=l.child;p;){if(p===i){u=!0,i=l,s=d;break}if(p===s){u=!0,s=l,i=d;break}p=p.sibling}if(!u){for(p=d.child;p;){if(p===i){u=!0,i=d,s=l;break}if(p===s){u=!0,s=d,i=l;break}p=p.sibling}if(!u)throw Error(on(189))}}if(i.alternate!==s)throw Error(on(190))}if(i.tag!==3)throw Error(on(188));return i.stateNode.current===i?n:t}function tge(n){return n=T5e(n),n!==null?nge(n):null}function nge(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var t=nge(n);if(t!==null)return t;n=n.sibling}return null}var ige=nu.unstable_scheduleCallback,Gde=nu.unstable_cancelCallback,R5e=nu.unstable_shouldYield,x5e=nu.unstable_requestPaint,ya=nu.unstable_now,A5e=nu.unstable_getCurrentPriorityLevel,DJ=nu.unstable_ImmediatePriority,rge=nu.unstable_UserBlockingPriority,f7=nu.unstable_NormalPriority,I5e=nu.unstable_LowPriority,sge=nu.unstable_IdlePriority,hU=null,Hp=null;function N5e(n){if(Hp&&typeof Hp.onCommitFiberRoot=="function")try{Hp.onCommitFiberRoot(hU,n,void 0,(n.current.flags&128)===128)}catch{}}var mf=Math.clz32?Math.clz32:L5e,O5e=Math.log,P5e=Math.LN2;function L5e(n){return n>>>=0,n===0?32:31-(O5e(n)/P5e|0)|0}var P8=64,L8=4194304;function X3(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function p7(n,t){var i=n.pendingLanes;if(i===0)return 0;var s=0,l=n.suspendedLanes,d=n.pingedLanes,u=i&268435455;if(u!==0){var p=u&~l;p!==0?s=X3(p):(d&=u,d!==0&&(s=X3(d)))}else u=i&~l,u!==0?s=X3(u):d!==0&&(s=X3(d));if(s===0)return 0;if(t!==0&&t!==s&&!(t&l)&&(l=s&-s,d=t&-t,l>=d||l===16&&(d&4194240)!==0))return t;if(s&4&&(s|=i&16),t=n.entangledLanes,t!==0)for(n=n.entanglements,t&=s;0<t;)i=31-mf(t),l=1<<i,s|=n[i],t&=~l;return s}function D5e(n,t){switch(n){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function k5e(n,t){for(var i=n.suspendedLanes,s=n.pingedLanes,l=n.expirationTimes,d=n.pendingLanes;0<d;){var u=31-mf(d),p=1<<u,m=l[u];m===-1?(!(p&i)||p&s)&&(l[u]=D5e(p,t)):m<=t&&(n.expiredLanes|=p),d&=~p}}function gq(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function age(){var n=P8;return P8<<=1,!(P8&4194240)&&(P8=64),n}function D$(n){for(var t=[],i=0;31>i;i++)t.push(n);return t}function dP(n,t,i){n.pendingLanes|=t,t!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,t=31-mf(t),n[t]=i}function M5e(n,t){var i=n.pendingLanes&~t;n.pendingLanes=t,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=t,n.mutableReadLanes&=t,n.entangledLanes&=t,t=n.entanglements;var s=n.eventTimes;for(n=n.expirationTimes;0<i;){var l=31-mf(i),d=1<<l;t[l]=0,s[l]=-1,n[l]=-1,i&=~d}}function kJ(n,t){var i=n.entangledLanes|=t;for(n=n.entanglements;i;){var s=31-mf(i),l=1<<s;l&t|n[s]&t&&(n[s]|=t),i&=~l}}var Hr=0;function oge(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var lge,MJ,cge,dge,uge,vq=!1,D8=[],jv=null,Uv=null,Fv=null,q4=new Map,Y4=new Map,S1=[],j5e="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Wde(n,t){switch(n){case"focusin":case"focusout":jv=null;break;case"dragenter":case"dragleave":Uv=null;break;case"mouseover":case"mouseout":Fv=null;break;case"pointerover":case"pointerout":q4.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Y4.delete(t.pointerId)}}function O3(n,t,i,s,l,d){return n===null||n.nativeEvent!==d?(n={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:d,targetContainers:[l]},t!==null&&(t=hP(t),t!==null&&MJ(t)),n):(n.eventSystemFlags|=s,t=n.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),n)}function U5e(n,t,i,s,l){switch(t){case"focusin":return jv=O3(jv,n,t,i,s,l),!0;case"dragenter":return Uv=O3(Uv,n,t,i,s,l),!0;case"mouseover":return Fv=O3(Fv,n,t,i,s,l),!0;case"pointerover":var d=l.pointerId;return q4.set(d,O3(q4.get(d)||null,n,t,i,s,l)),!0;case"gotpointercapture":return d=l.pointerId,Y4.set(d,O3(Y4.get(d)||null,n,t,i,s,l)),!0}return!1}function hge(n){var t=Y_(n.target);if(t!==null){var i=nw(t);if(i!==null){if(t=i.tag,t===13){if(t=ege(i),t!==null){n.blockedOn=t,uge(n.priority,function(){cge(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function dM(n){if(n.blockedOn!==null)return!1;for(var t=n.targetContainers;0<t.length;){var i=yq(n.domEventName,n.eventSystemFlags,t[0],n.nativeEvent);if(i===null){i=n.nativeEvent;var s=new i.constructor(i.type,i);hq=s,i.target.dispatchEvent(s),hq=null}else return t=hP(i),t!==null&&MJ(t),n.blockedOn=i,!1;t.shift()}return!0}function $de(n,t,i){dM(n)&&i.delete(t)}function F5e(){vq=!1,jv!==null&&dM(jv)&&(jv=null),Uv!==null&&dM(Uv)&&(Uv=null),Fv!==null&&dM(Fv)&&(Fv=null),q4.forEach($de),Y4.forEach($de)}function P3(n,t){n.blockedOn===t&&(n.blockedOn=null,vq||(vq=!0,nu.unstable_scheduleCallback(nu.unstable_NormalPriority,F5e)))}function X4(n){function t(l){return P3(l,n)}if(0<D8.length){P3(D8[0],n);for(var i=1;i<D8.length;i++){var s=D8[i];s.blockedOn===n&&(s.blockedOn=null)}}for(jv!==null&&P3(jv,n),Uv!==null&&P3(Uv,n),Fv!==null&&P3(Fv,n),q4.forEach(t),Y4.forEach(t),i=0;i<S1.length;i++)s=S1[i],s.blockedOn===n&&(s.blockedOn=null);for(;0<S1.length&&(i=S1[0],i.blockedOn===null);)hge(i),i.blockedOn===null&&S1.shift()}var BC=Yg.ReactCurrentBatchConfig,m7=!0;function B5e(n,t,i,s){var l=Hr,d=BC.transition;BC.transition=null;try{Hr=1,jJ(n,t,i,s)}finally{Hr=l,BC.transition=d}}function V5e(n,t,i,s){var l=Hr,d=BC.transition;BC.transition=null;try{Hr=4,jJ(n,t,i,s)}finally{Hr=l,BC.transition=d}}function jJ(n,t,i,s){if(m7){var l=yq(n,t,i,s);if(l===null)G$(n,t,s,g7,i),Wde(n,s);else if(U5e(l,n,t,i,s))s.stopPropagation();else if(Wde(n,s),t&4&&-1<j5e.indexOf(n)){for(;l!==null;){var d=hP(l);if(d!==null&&lge(d),d=yq(n,t,i,s),d===null&&G$(n,t,s,g7,i),d===l)break;l=d}l!==null&&s.stopPropagation()}else G$(n,t,s,null,i)}}var g7=null;function yq(n,t,i,s){if(g7=null,n=LJ(s),n=Y_(n),n!==null)if(t=nw(n),t===null)n=null;else if(i=t.tag,i===13){if(n=ege(t),n!==null)return n;n=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;n=null}else t!==n&&(n=null);return g7=n,null}function fge(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(A5e()){case DJ:return 1;case rge:return 4;case f7:case I5e:return 16;case sge:return 536870912;default:return 16}default:return 16}}var Nv=null,UJ=null,uM=null;function pge(){if(uM)return uM;var n,t=UJ,i=t.length,s,l="value"in Nv?Nv.value:Nv.textContent,d=l.length;for(n=0;n<i&&t[n]===l[n];n++);var u=i-n;for(s=1;s<=u&&t[i-s]===l[d-s];s++);return uM=l.slice(n,1<s?1-s:void 0)}function hM(n){var t=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&t===13&&(n=13)):n=t,n===10&&(n=13),32<=n||n===13?n:0}function k8(){return!0}function Kde(){return!1}function au(n){function t(i,s,l,d,u){this._reactName=i,this._targetInst=l,this.type=s,this.nativeEvent=d,this.target=u,this.currentTarget=null;for(var p in n)n.hasOwnProperty(p)&&(i=n[p],this[p]=i?i(d):d[p]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?k8:Kde,this.isPropagationStopped=Kde,this}return Ks(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=k8)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=k8)},persist:function(){},isPersistent:k8}),t}var fx={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},FJ=au(fx),uP=Ks({},fx,{view:0,detail:0}),z5e=au(uP),k$,M$,L3,fU=Ks({},uP,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:BJ,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==L3&&(L3&&n.type==="mousemove"?(k$=n.screenX-L3.screenX,M$=n.screenY-L3.screenY):M$=k$=0,L3=n),k$)},movementY:function(n){return"movementY"in n?n.movementY:M$}}),qde=au(fU),H5e=Ks({},fU,{dataTransfer:0}),G5e=au(H5e),W5e=Ks({},uP,{relatedTarget:0}),j$=au(W5e),$5e=Ks({},fx,{animationName:0,elapsedTime:0,pseudoElement:0}),K5e=au($5e),q5e=Ks({},fx,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Y5e=au(q5e),X5e=Ks({},fx,{data:0}),Yde=au(X5e),J5e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q5e={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Z5e={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eOe(n){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(n):(n=Z5e[n])?!!t[n]:!1}function BJ(){return eOe}var tOe=Ks({},uP,{key:function(n){if(n.key){var t=J5e[n.key]||n.key;if(t!=="Unidentified")return t}return n.type==="keypress"?(n=hM(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Q5e[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:BJ,charCode:function(n){return n.type==="keypress"?hM(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?hM(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),nOe=au(tOe),iOe=Ks({},fU,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xde=au(iOe),rOe=Ks({},uP,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:BJ}),sOe=au(rOe),aOe=Ks({},fx,{propertyName:0,elapsedTime:0,pseudoElement:0}),oOe=au(aOe),lOe=Ks({},fU,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),cOe=au(lOe),dOe=[9,13,27,32],VJ=Gg&&"CompositionEvent"in window,O4=null;Gg&&"documentMode"in document&&(O4=document.documentMode);var uOe=Gg&&"TextEvent"in window&&!O4,mge=Gg&&(!VJ||O4&&8<O4&&11>=O4),Jde=" ",Qde=!1;function gge(n,t){switch(n){case"keyup":return dOe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vge(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var wC=!1;function hOe(n,t){switch(n){case"compositionend":return vge(t);case"keypress":return t.which!==32?null:(Qde=!0,Jde);case"textInput":return n=t.data,n===Jde&&Qde?null:n;default:return null}}function fOe(n,t){if(wC)return n==="compositionend"||!VJ&&gge(n,t)?(n=pge(),uM=UJ=Nv=null,wC=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return mge&&t.locale!=="ko"?null:t.data;default:return null}}var pOe={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Zde(n){var t=n&&n.nodeName&&n.nodeName.toLowerCase();return t==="input"?!!pOe[n.type]:t==="textarea"}function yge(n,t,i,s){Yme(s),t=v7(t,"onChange"),0<t.length&&(i=new FJ("onChange","change",null,i,s),n.push({event:i,listeners:t}))}var P4=null,J4=null;function mOe(n){Ige(n,0)}function pU(n){var t=CC(n);if(zme(t))return n}function gOe(n,t){if(n==="change")return t}var _ge=!1;if(Gg){var U$;if(Gg){var F$="oninput"in document;if(!F$){var eue=document.createElement("div");eue.setAttribute("oninput","return;"),F$=typeof eue.oninput=="function"}U$=F$}else U$=!1;_ge=U$&&(!document.documentMode||9<document.documentMode)}function tue(){P4&&(P4.detachEvent("onpropertychange",Ege),J4=P4=null)}function Ege(n){if(n.propertyName==="value"&&pU(J4)){var t=[];yge(t,J4,n,LJ(n)),Zme(mOe,t)}}function vOe(n,t,i){n==="focusin"?(tue(),P4=t,J4=i,P4.attachEvent("onpropertychange",Ege)):n==="focusout"&&tue()}function yOe(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return pU(J4)}function _Oe(n,t){if(n==="click")return pU(t)}function EOe(n,t){if(n==="input"||n==="change")return pU(t)}function wOe(n,t){return n===t&&(n!==0||1/n===1/t)||n!==n&&t!==t}var _f=typeof Object.is=="function"?Object.is:wOe;function Q4(n,t){if(_f(n,t))return!0;if(typeof n!="object"||n===null||typeof t!="object"||t===null)return!1;var i=Object.keys(n),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var l=i[s];if(!eq.call(t,l)||!_f(n[l],t[l]))return!1}return!0}function nue(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function iue(n,t){var i=nue(n);n=0;for(var s;i;){if(i.nodeType===3){if(s=n+i.textContent.length,n<=t&&s>=t)return{node:i,offset:t-n};n=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=nue(i)}}function wge(n,t){return n&&t?n===t?!0:n&&n.nodeType===3?!1:t&&t.nodeType===3?wge(n,t.parentNode):"contains"in n?n.contains(t):n.compareDocumentPosition?!!(n.compareDocumentPosition(t)&16):!1:!1}function Sge(){for(var n=window,t=d7();t instanceof n.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)n=t.contentWindow;else break;t=d7(n.document)}return t}function zJ(n){var t=n&&n.nodeName&&n.nodeName.toLowerCase();return t&&(t==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||t==="textarea"||n.contentEditable==="true")}function SOe(n){var t=Sge(),i=n.focusedElem,s=n.selectionRange;if(t!==i&&i&&i.ownerDocument&&wge(i.ownerDocument.documentElement,i)){if(s!==null&&zJ(i)){if(t=s.start,n=s.end,n===void 0&&(n=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(n,i.value.length);else if(n=(t=i.ownerDocument||document)&&t.defaultView||window,n.getSelection){n=n.getSelection();var l=i.textContent.length,d=Math.min(s.start,l);s=s.end===void 0?d:Math.min(s.end,l),!n.extend&&d>s&&(l=s,s=d,d=l),l=iue(i,d);var u=iue(i,s);l&&u&&(n.rangeCount!==1||n.anchorNode!==l.node||n.anchorOffset!==l.offset||n.focusNode!==u.node||n.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),n.removeAllRanges(),d>s?(n.addRange(t),n.extend(u.node,u.offset)):(t.setEnd(u.node,u.offset),n.addRange(t)))}}for(t=[],n=i;n=n.parentNode;)n.nodeType===1&&t.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)n=t[i],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var bOe=Gg&&"documentMode"in document&&11>=document.documentMode,SC=null,_q=null,L4=null,Eq=!1;function rue(n,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Eq||SC==null||SC!==d7(s)||(s=SC,"selectionStart"in s&&zJ(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),L4&&Q4(L4,s)||(L4=s,s=v7(_q,"onSelect"),0<s.length&&(t=new FJ("onSelect","select",null,t,i),n.push({event:t,listeners:s}),t.target=SC)))}function M8(n,t){var i={};return i[n.toLowerCase()]=t.toLowerCase(),i["Webkit"+n]="webkit"+t,i["Moz"+n]="moz"+t,i}var bC={animationend:M8("Animation","AnimationEnd"),animationiteration:M8("Animation","AnimationIteration"),animationstart:M8("Animation","AnimationStart"),transitionend:M8("Transition","TransitionEnd")},B$={},bge={};Gg&&(bge=document.createElement("div").style,"AnimationEvent"in window||(delete bC.animationend.animation,delete bC.animationiteration.animation,delete bC.animationstart.animation),"TransitionEvent"in window||delete bC.transitionend.transition);function mU(n){if(B$[n])return B$[n];if(!bC[n])return n;var t=bC[n],i;for(i in t)if(t.hasOwnProperty(i)&&i in bge)return B$[n]=t[i];return n}var Cge=mU("animationend"),Tge=mU("animationiteration"),Rge=mU("animationstart"),xge=mU("transitionend"),Age=new Map,sue="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ny(n,t){Age.set(n,t),tw(t,[n])}for(var V$=0;V$<sue.length;V$++){var z$=sue[V$],COe=z$.toLowerCase(),TOe=z$[0].toUpperCase()+z$.slice(1);ny(COe,"on"+TOe)}ny(Cge,"onAnimationEnd");ny(Tge,"onAnimationIteration");ny(Rge,"onAnimationStart");ny("dblclick","onDoubleClick");ny("focusin","onFocus");ny("focusout","onBlur");ny(xge,"onTransitionEnd");KR("onMouseEnter",["mouseout","mouseover"]);KR("onMouseLeave",["mouseout","mouseover"]);KR("onPointerEnter",["pointerout","pointerover"]);KR("onPointerLeave",["pointerout","pointerover"]);tw("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));tw("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));tw("onBeforeInput",["compositionend","keypress","textInput","paste"]);tw("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));tw("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));tw("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var J3="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ROe=new Set("cancel close invalid load scroll toggle".split(" ").concat(J3));function aue(n,t,i){var s=n.type||"unknown-event";n.currentTarget=i,C5e(s,t,void 0,n),n.currentTarget=null}function Ige(n,t){t=(t&4)!==0;for(var i=0;i<n.length;i++){var s=n[i],l=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var u=s.length-1;0<=u;u--){var p=s[u],m=p.instance,y=p.currentTarget;if(p=p.listener,m!==d&&l.isPropagationStopped())break e;aue(l,p,y),d=m}else for(u=0;u<s.length;u++){if(p=s[u],m=p.instance,y=p.currentTarget,p=p.listener,m!==d&&l.isPropagationStopped())break e;aue(l,p,y),d=m}}}if(h7)throw n=mq,h7=!1,mq=null,n}function Ss(n,t){var i=t[Tq];i===void 0&&(i=t[Tq]=new Set);var s=n+"__bubble";i.has(s)||(Nge(t,n,2,!1),i.add(s))}function H$(n,t,i){var s=0;t&&(s|=4),Nge(i,n,s,t)}var j8="_reactListening"+Math.random().toString(36).slice(2);function Z4(n){if(!n[j8]){n[j8]=!0,jme.forEach(function(i){i!=="selectionchange"&&(ROe.has(i)||H$(i,!1,n),H$(i,!0,n))});var t=n.nodeType===9?n:n.ownerDocument;t===null||t[j8]||(t[j8]=!0,H$("selectionchange",!1,t))}}function Nge(n,t,i,s){switch(fge(t)){case 1:var l=B5e;break;case 4:l=V5e;break;default:l=jJ}i=l.bind(null,t,i,n),l=void 0,!pq||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),s?l!==void 0?n.addEventListener(t,i,{capture:!0,passive:l}):n.addEventListener(t,i,!0):l!==void 0?n.addEventListener(t,i,{passive:l}):n.addEventListener(t,i,!1)}function G$(n,t,i,s,l){var d=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var u=s.tag;if(u===3||u===4){var p=s.stateNode.containerInfo;if(p===l||p.nodeType===8&&p.parentNode===l)break;if(u===4)for(u=s.return;u!==null;){var m=u.tag;if((m===3||m===4)&&(m=u.stateNode.containerInfo,m===l||m.nodeType===8&&m.parentNode===l))return;u=u.return}for(;p!==null;){if(u=Y_(p),u===null)return;if(m=u.tag,m===5||m===6){s=d=u;continue e}p=p.parentNode}}s=s.return}Zme(function(){var y=d,_=LJ(i),E=[];e:{var C=Age.get(n);if(C!==void 0){var x=FJ,N=n;switch(n){case"keypress":if(hM(i)===0)break e;case"keydown":case"keyup":x=nOe;break;case"focusin":N="focus",x=j$;break;case"focusout":N="blur",x=j$;break;case"beforeblur":case"afterblur":x=j$;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=qde;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=G5e;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=sOe;break;case Cge:case Tge:case Rge:x=K5e;break;case xge:x=oOe;break;case"scroll":x=z5e;break;case"wheel":x=cOe;break;case"copy":case"cut":case"paste":x=Y5e;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Xde}var O=(t&4)!==0,D=!O&&n==="scroll",P=O?C!==null?C+"Capture":null:C;O=[];for(var j=y,M;j!==null;){M=j;var V=M.stateNode;if(M.tag===5&&V!==null&&(M=V,P!==null&&(V=K4(j,P),V!=null&&O.push(eN(j,V,M)))),D)break;j=j.return}0<O.length&&(C=new x(C,N,null,i,_),E.push({event:C,listeners:O}))}}if(!(t&7)){e:{if(C=n==="mouseover"||n==="pointerover",x=n==="mouseout"||n==="pointerout",C&&i!==hq&&(N=i.relatedTarget||i.fromElement)&&(Y_(N)||N[Wg]))break e;if((x||C)&&(C=_.window===_?_:(C=_.ownerDocument)?C.defaultView||C.parentWindow:window,x?(N=i.relatedTarget||i.toElement,x=y,N=N?Y_(N):null,N!==null&&(D=nw(N),N!==D||N.tag!==5&&N.tag!==6)&&(N=null)):(x=null,N=y),x!==N)){if(O=qde,V="onMouseLeave",P="onMouseEnter",j="mouse",(n==="pointerout"||n==="pointerover")&&(O=Xde,V="onPointerLeave",P="onPointerEnter",j="pointer"),D=x==null?C:CC(x),M=N==null?C:CC(N),C=new O(V,j+"leave",x,i,_),C.target=D,C.relatedTarget=M,V=null,Y_(_)===y&&(O=new O(P,j+"enter",N,i,_),O.target=M,O.relatedTarget=D,V=O),D=V,x&&N)t:{for(O=x,P=N,j=0,M=O;M;M=$b(M))j++;for(M=0,V=P;V;V=$b(V))M++;for(;0<j-M;)O=$b(O),j--;for(;0<M-j;)P=$b(P),M--;for(;j--;){if(O===P||P!==null&&O===P.alternate)break t;O=$b(O),P=$b(P)}O=null}else O=null;x!==null&&oue(E,C,x,O,!1),N!==null&&D!==null&&oue(E,D,N,O,!0)}}e:{if(C=y?CC(y):window,x=C.nodeName&&C.nodeName.toLowerCase(),x==="select"||x==="input"&&C.type==="file")var G=gOe;else if(Zde(C))if(_ge)G=EOe;else{G=yOe;var $=vOe}else(x=C.nodeName)&&x.toLowerCase()==="input"&&(C.type==="checkbox"||C.type==="radio")&&(G=_Oe);if(G&&(G=G(n,y))){yge(E,G,i,_);break e}$&&$(n,C,y),n==="focusout"&&($=C._wrapperState)&&$.controlled&&C.type==="number"&&oq(C,"number",C.value)}switch($=y?CC(y):window,n){case"focusin":(Zde($)||$.contentEditable==="true")&&(SC=$,_q=y,L4=null);break;case"focusout":L4=_q=SC=null;break;case"mousedown":Eq=!0;break;case"contextmenu":case"mouseup":case"dragend":Eq=!1,rue(E,i,_);break;case"selectionchange":if(bOe)break;case"keydown":case"keyup":rue(E,i,_)}var ne;if(VJ)e:{switch(n){case"compositionstart":var Y="onCompositionStart";break e;case"compositionend":Y="onCompositionEnd";break e;case"compositionupdate":Y="onCompositionUpdate";break e}Y=void 0}else wC?gge(n,i)&&(Y="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Y="onCompositionStart");Y&&(mge&&i.locale!=="ko"&&(wC||Y!=="onCompositionStart"?Y==="onCompositionEnd"&&wC&&(ne=pge()):(Nv=_,UJ="value"in Nv?Nv.value:Nv.textContent,wC=!0)),$=v7(y,Y),0<$.length&&(Y=new Yde(Y,n,null,i,_),E.push({event:Y,listeners:$}),ne?Y.data=ne:(ne=vge(i),ne!==null&&(Y.data=ne)))),(ne=uOe?hOe(n,i):fOe(n,i))&&(y=v7(y,"onBeforeInput"),0<y.length&&(_=new Yde("onBeforeInput","beforeinput",null,i,_),E.push({event:_,listeners:y}),_.data=ne))}Ige(E,t)})}function eN(n,t,i){return{instance:n,listener:t,currentTarget:i}}function v7(n,t){for(var i=t+"Capture",s=[];n!==null;){var l=n,d=l.stateNode;l.tag===5&&d!==null&&(l=d,d=K4(n,i),d!=null&&s.unshift(eN(n,d,l)),d=K4(n,t),d!=null&&s.push(eN(n,d,l))),n=n.return}return s}function $b(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function oue(n,t,i,s,l){for(var d=t._reactName,u=[];i!==null&&i!==s;){var p=i,m=p.alternate,y=p.stateNode;if(m!==null&&m===s)break;p.tag===5&&y!==null&&(p=y,l?(m=K4(i,d),m!=null&&u.unshift(eN(i,m,p))):l||(m=K4(i,d),m!=null&&u.push(eN(i,m,p)))),i=i.return}u.length!==0&&n.push({event:t,listeners:u})}var xOe=/\r\n?/g,AOe=/\u0000|\uFFFD/g;function lue(n){return(typeof n=="string"?n:""+n).replace(xOe,`
`).replace(AOe,"")}function U8(n,t,i){if(t=lue(t),lue(n)!==t&&i)throw Error(on(425))}function y7(){}var wq=null,Sq=null;function bq(n,t){return n==="textarea"||n==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Cq=typeof setTimeout=="function"?setTimeout:void 0,IOe=typeof clearTimeout=="function"?clearTimeout:void 0,cue=typeof Promise=="function"?Promise:void 0,NOe=typeof queueMicrotask=="function"?queueMicrotask:typeof cue<"u"?function(n){return cue.resolve(null).then(n).catch(OOe)}:Cq;function OOe(n){setTimeout(function(){throw n})}function W$(n,t){var i=t,s=0;do{var l=i.nextSibling;if(n.removeChild(i),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(s===0){n.removeChild(l),X4(t);return}s--}else i!=="$"&&i!=="$?"&&i!=="$!"||s++;i=l}while(i);X4(t)}function Bv(n){for(;n!=null;n=n.nextSibling){var t=n.nodeType;if(t===1||t===3)break;if(t===8){if(t=n.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return n}function due(n){n=n.previousSibling;for(var t=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return n;t--}else i==="/$"&&t++}n=n.previousSibling}return null}var px=Math.random().toString(36).slice(2),Fp="__reactFiber$"+px,tN="__reactProps$"+px,Wg="__reactContainer$"+px,Tq="__reactEvents$"+px,POe="__reactListeners$"+px,LOe="__reactHandles$"+px;function Y_(n){var t=n[Fp];if(t)return t;for(var i=n.parentNode;i;){if(t=i[Wg]||i[Fp]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(n=due(n);n!==null;){if(i=n[Fp])return i;n=due(n)}return t}n=i,i=n.parentNode}return null}function hP(n){return n=n[Fp]||n[Wg],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function CC(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(on(33))}function gU(n){return n[tN]||null}var Rq=[],TC=-1;function iy(n){return{current:n}}function Cs(n){0>TC||(n.current=Rq[TC],Rq[TC]=null,TC--)}function hs(n,t){TC++,Rq[TC]=n.current,n.current=t}var Xv={},Tl=iy(Xv),rd=iy(!1),F2=Xv;function qR(n,t){var i=n.type.contextTypes;if(!i)return Xv;var s=n.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var l={},d;for(d in i)l[d]=t[d];return s&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=t,n.__reactInternalMemoizedMaskedChildContext=l),l}function sd(n){return n=n.childContextTypes,n!=null}function _7(){Cs(rd),Cs(Tl)}function uue(n,t,i){if(Tl.current!==Xv)throw Error(on(168));hs(Tl,t),hs(rd,i)}function Oge(n,t,i){var s=n.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return i;s=s.getChildContext();for(var l in s)if(!(l in t))throw Error(on(108,v5e(n)||"Unknown",l));return Ks({},i,s)}function E7(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Xv,F2=Tl.current,hs(Tl,n),hs(rd,rd.current),!0}function hue(n,t,i){var s=n.stateNode;if(!s)throw Error(on(169));i?(n=Oge(n,t,F2),s.__reactInternalMemoizedMergedChildContext=n,Cs(rd),Cs(Tl),hs(Tl,n)):Cs(rd),hs(rd,i)}var Wm=null,vU=!1,$$=!1;function Pge(n){Wm===null?Wm=[n]:Wm.push(n)}function DOe(n){vU=!0,Pge(n)}function ry(){if(!$$&&Wm!==null){$$=!0;var n=0,t=Hr;try{var i=Wm;for(Hr=1;n<i.length;n++){var s=i[n];do s=s(!0);while(s!==null)}Wm=null,vU=!1}catch(l){throw Wm!==null&&(Wm=Wm.slice(n+1)),ige(DJ,ry),l}finally{Hr=t,$$=!1}}return null}var RC=[],xC=0,w7=null,S7=0,ah=[],oh=0,B2=null,Fg=1,Bg="";function k_(n,t){RC[xC++]=S7,RC[xC++]=w7,w7=n,S7=t}function Lge(n,t,i){ah[oh++]=Fg,ah[oh++]=Bg,ah[oh++]=B2,B2=n;var s=Fg;n=Bg;var l=32-mf(s)-1;s&=~(1<<l),i+=1;var d=32-mf(t)+l;if(30<d){var u=l-l%5;d=(s&(1<<u)-1).toString(32),s>>=u,l-=u,Fg=1<<32-mf(t)+l|i<<l|s,Bg=d+n}else Fg=1<<d|i<<l|s,Bg=n}function HJ(n){n.return!==null&&(k_(n,1),Lge(n,1,0))}function GJ(n){for(;n===w7;)w7=RC[--xC],RC[xC]=null,S7=RC[--xC],RC[xC]=null;for(;n===B2;)B2=ah[--oh],ah[oh]=null,Bg=ah[--oh],ah[oh]=null,Fg=ah[--oh],ah[oh]=null}var eu=null,Xd=null,Ms=!1,hf=null;function Dge(n,t){var i=ch(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=n,t=n.deletions,t===null?(n.deletions=[i],n.flags|=16):t.push(i)}function fue(n,t){switch(n.tag){case 5:var i=n.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(n.stateNode=t,eu=n,Xd=Bv(t.firstChild),!0):!1;case 6:return t=n.pendingProps===""||t.nodeType!==3?null:t,t!==null?(n.stateNode=t,eu=n,Xd=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=B2!==null?{id:Fg,overflow:Bg}:null,n.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=ch(18,null,null,0),i.stateNode=t,i.return=n,n.child=i,eu=n,Xd=null,!0):!1;default:return!1}}function xq(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Aq(n){if(Ms){var t=Xd;if(t){var i=t;if(!fue(n,t)){if(xq(n))throw Error(on(418));t=Bv(i.nextSibling);var s=eu;t&&fue(n,t)?Dge(s,i):(n.flags=n.flags&-4097|2,Ms=!1,eu=n)}}else{if(xq(n))throw Error(on(418));n.flags=n.flags&-4097|2,Ms=!1,eu=n}}}function pue(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;eu=n}function F8(n){if(n!==eu)return!1;if(!Ms)return pue(n),Ms=!0,!1;var t;if((t=n.tag!==3)&&!(t=n.tag!==5)&&(t=n.type,t=t!=="head"&&t!=="body"&&!bq(n.type,n.memoizedProps)),t&&(t=Xd)){if(xq(n))throw kge(),Error(on(418));for(;t;)Dge(n,t),t=Bv(t.nextSibling)}if(pue(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(on(317));e:{for(n=n.nextSibling,t=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"){if(t===0){Xd=Bv(n.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}n=n.nextSibling}Xd=null}}else Xd=eu?Bv(n.stateNode.nextSibling):null;return!0}function kge(){for(var n=Xd;n;)n=Bv(n.nextSibling)}function YR(){Xd=eu=null,Ms=!1}function WJ(n){hf===null?hf=[n]:hf.push(n)}var kOe=Yg.ReactCurrentBatchConfig;function Yh(n,t){if(n&&n.defaultProps){t=Ks({},t),n=n.defaultProps;for(var i in n)t[i]===void 0&&(t[i]=n[i]);return t}return t}var b7=iy(null),C7=null,AC=null,$J=null;function KJ(){$J=AC=C7=null}function qJ(n){var t=b7.current;Cs(b7),n._currentValue=t}function Iq(n,t,i){for(;n!==null;){var s=n.alternate;if((n.childLanes&t)!==t?(n.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),n===i)break;n=n.return}}function VC(n,t){C7=n,$J=AC=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&t&&(id=!0),n.firstContext=null)}function uh(n){var t=n._currentValue;if($J!==n)if(n={context:n,memoizedValue:t,next:null},AC===null){if(C7===null)throw Error(on(308));AC=n,C7.dependencies={lanes:0,firstContext:n}}else AC=AC.next=n;return t}var X_=null;function YJ(n){X_===null?X_=[n]:X_.push(n)}function Mge(n,t,i,s){var l=t.interleaved;return l===null?(i.next=i,YJ(t)):(i.next=l.next,l.next=i),t.interleaved=i,$g(n,s)}function $g(n,t){n.lanes|=t;var i=n.alternate;for(i!==null&&(i.lanes|=t),i=n,n=n.return;n!==null;)n.childLanes|=t,i=n.alternate,i!==null&&(i.childLanes|=t),i=n,n=n.return;return i.tag===3?i.stateNode:null}var _1=!1;function XJ(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jge(n,t){n=n.updateQueue,t.updateQueue===n&&(t.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function zg(n,t){return{eventTime:n,lane:t,tag:0,payload:null,callback:null,next:null}}function Vv(n,t,i){var s=n.updateQueue;if(s===null)return null;if(s=s.shared,wr&2){var l=s.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),s.pending=t,$g(n,i)}return l=s.interleaved,l===null?(t.next=t,YJ(s)):(t.next=l.next,l.next=t),s.interleaved=t,$g(n,i)}function fM(n,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var s=t.lanes;s&=n.pendingLanes,i|=s,t.lanes=i,kJ(n,i)}}function mue(n,t){var i=n.updateQueue,s=n.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var l=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var u={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};d===null?l=d=u:d=d.next=u,i=i.next}while(i!==null);d===null?l=d=t:d=d.next=t}else l=d=t;i={baseState:s.baseState,firstBaseUpdate:l,lastBaseUpdate:d,shared:s.shared,effects:s.effects},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=t:n.next=t,i.lastBaseUpdate=t}function T7(n,t,i,s){var l=n.updateQueue;_1=!1;var d=l.firstBaseUpdate,u=l.lastBaseUpdate,p=l.shared.pending;if(p!==null){l.shared.pending=null;var m=p,y=m.next;m.next=null,u===null?d=y:u.next=y,u=m;var _=n.alternate;_!==null&&(_=_.updateQueue,p=_.lastBaseUpdate,p!==u&&(p===null?_.firstBaseUpdate=y:p.next=y,_.lastBaseUpdate=m))}if(d!==null){var E=l.baseState;u=0,_=y=m=null,p=d;do{var C=p.lane,x=p.eventTime;if((s&C)===C){_!==null&&(_=_.next={eventTime:x,lane:0,tag:p.tag,payload:p.payload,callback:p.callback,next:null});e:{var N=n,O=p;switch(C=t,x=i,O.tag){case 1:if(N=O.payload,typeof N=="function"){E=N.call(x,E,C);break e}E=N;break e;case 3:N.flags=N.flags&-65537|128;case 0:if(N=O.payload,C=typeof N=="function"?N.call(x,E,C):N,C==null)break e;E=Ks({},E,C);break e;case 2:_1=!0}}p.callback!==null&&p.lane!==0&&(n.flags|=64,C=l.effects,C===null?l.effects=[p]:C.push(p))}else x={eventTime:x,lane:C,tag:p.tag,payload:p.payload,callback:p.callback,next:null},_===null?(y=_=x,m=E):_=_.next=x,u|=C;if(p=p.next,p===null){if(p=l.shared.pending,p===null)break;C=p,p=C.next,C.next=null,l.lastBaseUpdate=C,l.shared.pending=null}}while(!0);if(_===null&&(m=E),l.baseState=m,l.firstBaseUpdate=y,l.lastBaseUpdate=_,t=l.shared.interleaved,t!==null){l=t;do u|=l.lane,l=l.next;while(l!==t)}else d===null&&(l.shared.lanes=0);z2|=u,n.lanes=u,n.memoizedState=E}}function gue(n,t,i){if(n=t.effects,t.effects=null,n!==null)for(t=0;t<n.length;t++){var s=n[t],l=s.callback;if(l!==null){if(s.callback=null,s=i,typeof l!="function")throw Error(on(191,l));l.call(s)}}}var Uge=new Mme.Component().refs;function Nq(n,t,i,s){t=n.memoizedState,i=i(s,t),i=i==null?t:Ks({},t,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var yU={isMounted:function(n){return(n=n._reactInternals)?nw(n)===n:!1},enqueueSetState:function(n,t,i){n=n._reactInternals;var s=uc(),l=Hv(n),d=zg(s,l);d.payload=t,i!=null&&(d.callback=i),t=Vv(n,d,l),t!==null&&(gf(t,n,l,s),fM(t,n,l))},enqueueReplaceState:function(n,t,i){n=n._reactInternals;var s=uc(),l=Hv(n),d=zg(s,l);d.tag=1,d.payload=t,i!=null&&(d.callback=i),t=Vv(n,d,l),t!==null&&(gf(t,n,l,s),fM(t,n,l))},enqueueForceUpdate:function(n,t){n=n._reactInternals;var i=uc(),s=Hv(n),l=zg(i,s);l.tag=2,t!=null&&(l.callback=t),t=Vv(n,l,s),t!==null&&(gf(t,n,s,i),fM(t,n,s))}};function vue(n,t,i,s,l,d,u){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(s,d,u):t.prototype&&t.prototype.isPureReactComponent?!Q4(i,s)||!Q4(l,d):!0}function Fge(n,t,i){var s=!1,l=Xv,d=t.contextType;return typeof d=="object"&&d!==null?d=uh(d):(l=sd(t)?F2:Tl.current,s=t.contextTypes,d=(s=s!=null)?qR(n,l):Xv),t=new t(i,d),n.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=yU,n.stateNode=t,t._reactInternals=n,s&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=l,n.__reactInternalMemoizedMaskedChildContext=d),t}function yue(n,t,i,s){n=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==n&&yU.enqueueReplaceState(t,t.state,null)}function Oq(n,t,i,s){var l=n.stateNode;l.props=i,l.state=n.memoizedState,l.refs=Uge,XJ(n);var d=t.contextType;typeof d=="object"&&d!==null?l.context=uh(d):(d=sd(t)?F2:Tl.current,l.context=qR(n,d)),l.state=n.memoizedState,d=t.getDerivedStateFromProps,typeof d=="function"&&(Nq(n,t,d,i),l.state=n.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&yU.enqueueReplaceState(l,l.state,null),T7(n,i,l,s),l.state=n.memoizedState),typeof l.componentDidMount=="function"&&(n.flags|=4194308)}function D3(n,t,i){if(n=i.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(on(309));var s=i.stateNode}if(!s)throw Error(on(147,n));var l=s,d=""+n;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===d?t.ref:(t=function(u){var p=l.refs;p===Uge&&(p=l.refs={}),u===null?delete p[d]:p[d]=u},t._stringRef=d,t)}if(typeof n!="string")throw Error(on(284));if(!i._owner)throw Error(on(290,n))}return n}function B8(n,t){throw n=Object.prototype.toString.call(t),Error(on(31,n==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":n))}function _ue(n){var t=n._init;return t(n._payload)}function Bge(n){function t(P,j){if(n){var M=P.deletions;M===null?(P.deletions=[j],P.flags|=16):M.push(j)}}function i(P,j){if(!n)return null;for(;j!==null;)t(P,j),j=j.sibling;return null}function s(P,j){for(P=new Map;j!==null;)j.key!==null?P.set(j.key,j):P.set(j.index,j),j=j.sibling;return P}function l(P,j){return P=Gv(P,j),P.index=0,P.sibling=null,P}function d(P,j,M){return P.index=M,n?(M=P.alternate,M!==null?(M=M.index,M<j?(P.flags|=2,j):M):(P.flags|=2,j)):(P.flags|=1048576,j)}function u(P){return n&&P.alternate===null&&(P.flags|=2),P}function p(P,j,M,V){return j===null||j.tag!==6?(j=Z$(M,P.mode,V),j.return=P,j):(j=l(j,M),j.return=P,j)}function m(P,j,M,V){var G=M.type;return G===EC?_(P,j,M.props.children,V,M.key):j!==null&&(j.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===y1&&_ue(G)===j.type)?(V=l(j,M.props),V.ref=D3(P,j,M),V.return=P,V):(V=_M(M.type,M.key,M.props,null,P.mode,V),V.ref=D3(P,j,M),V.return=P,V)}function y(P,j,M,V){return j===null||j.tag!==4||j.stateNode.containerInfo!==M.containerInfo||j.stateNode.implementation!==M.implementation?(j=eK(M,P.mode,V),j.return=P,j):(j=l(j,M.children||[]),j.return=P,j)}function _(P,j,M,V,G){return j===null||j.tag!==7?(j=P2(M,P.mode,V,G),j.return=P,j):(j=l(j,M),j.return=P,j)}function E(P,j,M){if(typeof j=="string"&&j!==""||typeof j=="number")return j=Z$(""+j,P.mode,M),j.return=P,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case I8:return M=_M(j.type,j.key,j.props,null,P.mode,M),M.ref=D3(P,null,j),M.return=P,M;case _C:return j=eK(j,P.mode,M),j.return=P,j;case y1:var V=j._init;return E(P,V(j._payload),M)}if(Y3(j)||I3(j))return j=P2(j,P.mode,M,null),j.return=P,j;B8(P,j)}return null}function C(P,j,M,V){var G=j!==null?j.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return G!==null?null:p(P,j,""+M,V);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case I8:return M.key===G?m(P,j,M,V):null;case _C:return M.key===G?y(P,j,M,V):null;case y1:return G=M._init,C(P,j,G(M._payload),V)}if(Y3(M)||I3(M))return G!==null?null:_(P,j,M,V,null);B8(P,M)}return null}function x(P,j,M,V,G){if(typeof V=="string"&&V!==""||typeof V=="number")return P=P.get(M)||null,p(j,P,""+V,G);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case I8:return P=P.get(V.key===null?M:V.key)||null,m(j,P,V,G);case _C:return P=P.get(V.key===null?M:V.key)||null,y(j,P,V,G);case y1:var $=V._init;return x(P,j,M,$(V._payload),G)}if(Y3(V)||I3(V))return P=P.get(M)||null,_(j,P,V,G,null);B8(j,V)}return null}function N(P,j,M,V){for(var G=null,$=null,ne=j,Y=j=0,le=null;ne!==null&&Y<M.length;Y++){ne.index>Y?(le=ne,ne=null):le=ne.sibling;var re=C(P,ne,M[Y],V);if(re===null){ne===null&&(ne=le);break}n&&ne&&re.alternate===null&&t(P,ne),j=d(re,j,Y),$===null?G=re:$.sibling=re,$=re,ne=le}if(Y===M.length)return i(P,ne),Ms&&k_(P,Y),G;if(ne===null){for(;Y<M.length;Y++)ne=E(P,M[Y],V),ne!==null&&(j=d(ne,j,Y),$===null?G=ne:$.sibling=ne,$=ne);return Ms&&k_(P,Y),G}for(ne=s(P,ne);Y<M.length;Y++)le=x(ne,P,Y,M[Y],V),le!==null&&(n&&le.alternate!==null&&ne.delete(le.key===null?Y:le.key),j=d(le,j,Y),$===null?G=le:$.sibling=le,$=le);return n&&ne.forEach(function(ee){return t(P,ee)}),Ms&&k_(P,Y),G}function O(P,j,M,V){var G=I3(M);if(typeof G!="function")throw Error(on(150));if(M=G.call(M),M==null)throw Error(on(151));for(var $=G=null,ne=j,Y=j=0,le=null,re=M.next();ne!==null&&!re.done;Y++,re=M.next()){ne.index>Y?(le=ne,ne=null):le=ne.sibling;var ee=C(P,ne,re.value,V);if(ee===null){ne===null&&(ne=le);break}n&&ne&&ee.alternate===null&&t(P,ne),j=d(ee,j,Y),$===null?G=ee:$.sibling=ee,$=ee,ne=le}if(re.done)return i(P,ne),Ms&&k_(P,Y),G;if(ne===null){for(;!re.done;Y++,re=M.next())re=E(P,re.value,V),re!==null&&(j=d(re,j,Y),$===null?G=re:$.sibling=re,$=re);return Ms&&k_(P,Y),G}for(ne=s(P,ne);!re.done;Y++,re=M.next())re=x(ne,P,Y,re.value,V),re!==null&&(n&&re.alternate!==null&&ne.delete(re.key===null?Y:re.key),j=d(re,j,Y),$===null?G=re:$.sibling=re,$=re);return n&&ne.forEach(function(de){return t(P,de)}),Ms&&k_(P,Y),G}function D(P,j,M,V){if(typeof M=="object"&&M!==null&&M.type===EC&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case I8:e:{for(var G=M.key,$=j;$!==null;){if($.key===G){if(G=M.type,G===EC){if($.tag===7){i(P,$.sibling),j=l($,M.props.children),j.return=P,P=j;break e}}else if($.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===y1&&_ue(G)===$.type){i(P,$.sibling),j=l($,M.props),j.ref=D3(P,$,M),j.return=P,P=j;break e}i(P,$);break}else t(P,$);$=$.sibling}M.type===EC?(j=P2(M.props.children,P.mode,V,M.key),j.return=P,P=j):(V=_M(M.type,M.key,M.props,null,P.mode,V),V.ref=D3(P,j,M),V.return=P,P=V)}return u(P);case _C:e:{for($=M.key;j!==null;){if(j.key===$)if(j.tag===4&&j.stateNode.containerInfo===M.containerInfo&&j.stateNode.implementation===M.implementation){i(P,j.sibling),j=l(j,M.children||[]),j.return=P,P=j;break e}else{i(P,j);break}else t(P,j);j=j.sibling}j=eK(M,P.mode,V),j.return=P,P=j}return u(P);case y1:return $=M._init,D(P,j,$(M._payload),V)}if(Y3(M))return N(P,j,M,V);if(I3(M))return O(P,j,M,V);B8(P,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,j!==null&&j.tag===6?(i(P,j.sibling),j=l(j,M),j.return=P,P=j):(i(P,j),j=Z$(M,P.mode,V),j.return=P,P=j),u(P)):i(P,j)}return D}var XR=Bge(!0),Vge=Bge(!1),fP={},Gp=iy(fP),nN=iy(fP),iN=iy(fP);function J_(n){if(n===fP)throw Error(on(174));return n}function JJ(n,t){switch(hs(iN,t),hs(nN,n),hs(Gp,fP),n=t.nodeType,n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cq(null,"");break;default:n=n===8?t.parentNode:t,t=n.namespaceURI||null,n=n.tagName,t=cq(t,n)}Cs(Gp),hs(Gp,t)}function JR(){Cs(Gp),Cs(nN),Cs(iN)}function zge(n){J_(iN.current);var t=J_(Gp.current),i=cq(t,n.type);t!==i&&(hs(nN,n),hs(Gp,i))}function QJ(n){nN.current===n&&(Cs(Gp),Cs(nN))}var Gs=iy(0);function R7(n){for(var t=n;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break;for(;t.sibling===null;){if(t.return===null||t.return===n)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var K$=[];function ZJ(){for(var n=0;n<K$.length;n++)K$[n]._workInProgressVersionPrimary=null;K$.length=0}var pM=Yg.ReactCurrentDispatcher,q$=Yg.ReactCurrentBatchConfig,V2=0,$s=null,Ya=null,Co=null,x7=!1,D4=!1,rN=0,MOe=0;function ml(){throw Error(on(321))}function eQ(n,t){if(t===null)return!1;for(var i=0;i<t.length&&i<n.length;i++)if(!_f(n[i],t[i]))return!1;return!0}function tQ(n,t,i,s,l,d){if(V2=d,$s=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,pM.current=n===null||n.memoizedState===null?BOe:VOe,n=i(s,l),D4){d=0;do{if(D4=!1,rN=0,25<=d)throw Error(on(301));d+=1,Co=Ya=null,t.updateQueue=null,pM.current=zOe,n=i(s,l)}while(D4)}if(pM.current=A7,t=Ya!==null&&Ya.next!==null,V2=0,Co=Ya=$s=null,x7=!1,t)throw Error(on(300));return n}function nQ(){var n=rN!==0;return rN=0,n}function cp(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Co===null?$s.memoizedState=Co=n:Co=Co.next=n,Co}function hh(){if(Ya===null){var n=$s.alternate;n=n!==null?n.memoizedState:null}else n=Ya.next;var t=Co===null?$s.memoizedState:Co.next;if(t!==null)Co=t,Ya=n;else{if(n===null)throw Error(on(310));Ya=n,n={memoizedState:Ya.memoizedState,baseState:Ya.baseState,baseQueue:Ya.baseQueue,queue:Ya.queue,next:null},Co===null?$s.memoizedState=Co=n:Co=Co.next=n}return Co}function sN(n,t){return typeof t=="function"?t(n):t}function Y$(n){var t=hh(),i=t.queue;if(i===null)throw Error(on(311));i.lastRenderedReducer=n;var s=Ya,l=s.baseQueue,d=i.pending;if(d!==null){if(l!==null){var u=l.next;l.next=d.next,d.next=u}s.baseQueue=l=d,i.pending=null}if(l!==null){d=l.next,s=s.baseState;var p=u=null,m=null,y=d;do{var _=y.lane;if((V2&_)===_)m!==null&&(m=m.next={lane:0,action:y.action,hasEagerState:y.hasEagerState,eagerState:y.eagerState,next:null}),s=y.hasEagerState?y.eagerState:n(s,y.action);else{var E={lane:_,action:y.action,hasEagerState:y.hasEagerState,eagerState:y.eagerState,next:null};m===null?(p=m=E,u=s):m=m.next=E,$s.lanes|=_,z2|=_}y=y.next}while(y!==null&&y!==d);m===null?u=s:m.next=p,_f(s,t.memoizedState)||(id=!0),t.memoizedState=s,t.baseState=u,t.baseQueue=m,i.lastRenderedState=s}if(n=i.interleaved,n!==null){l=n;do d=l.lane,$s.lanes|=d,z2|=d,l=l.next;while(l!==n)}else l===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function X$(n){var t=hh(),i=t.queue;if(i===null)throw Error(on(311));i.lastRenderedReducer=n;var s=i.dispatch,l=i.pending,d=t.memoizedState;if(l!==null){i.pending=null;var u=l=l.next;do d=n(d,u.action),u=u.next;while(u!==l);_f(d,t.memoizedState)||(id=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,s]}function Hge(){}function Gge(n,t){var i=$s,s=hh(),l=t(),d=!_f(s.memoizedState,l);if(d&&(s.memoizedState=l,id=!0),s=s.queue,iQ(Kge.bind(null,i,s,n),[n]),s.getSnapshot!==t||d||Co!==null&&Co.memoizedState.tag&1){if(i.flags|=2048,aN(9,$ge.bind(null,i,s,l,t),void 0,null),xo===null)throw Error(on(349));V2&30||Wge(i,t,l)}return l}function Wge(n,t,i){n.flags|=16384,n={getSnapshot:t,value:i},t=$s.updateQueue,t===null?(t={lastEffect:null,stores:null},$s.updateQueue=t,t.stores=[n]):(i=t.stores,i===null?t.stores=[n]:i.push(n))}function $ge(n,t,i,s){t.value=i,t.getSnapshot=s,qge(t)&&Yge(n)}function Kge(n,t,i){return i(function(){qge(t)&&Yge(n)})}function qge(n){var t=n.getSnapshot;n=n.value;try{var i=t();return!_f(n,i)}catch{return!0}}function Yge(n){var t=$g(n,1);t!==null&&gf(t,n,1,-1)}function Eue(n){var t=cp();return typeof n=="function"&&(n=n()),t.memoizedState=t.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sN,lastRenderedState:n},t.queue=n,n=n.dispatch=FOe.bind(null,$s,n),[t.memoizedState,n]}function aN(n,t,i,s){return n={tag:n,create:t,destroy:i,deps:s,next:null},t=$s.updateQueue,t===null?(t={lastEffect:null,stores:null},$s.updateQueue=t,t.lastEffect=n.next=n):(i=t.lastEffect,i===null?t.lastEffect=n.next=n:(s=i.next,i.next=n,n.next=s,t.lastEffect=n)),n}function Xge(){return hh().memoizedState}function mM(n,t,i,s){var l=cp();$s.flags|=n,l.memoizedState=aN(1|t,i,void 0,s===void 0?null:s)}function _U(n,t,i,s){var l=hh();s=s===void 0?null:s;var d=void 0;if(Ya!==null){var u=Ya.memoizedState;if(d=u.destroy,s!==null&&eQ(s,u.deps)){l.memoizedState=aN(t,i,d,s);return}}$s.flags|=n,l.memoizedState=aN(1|t,i,d,s)}function wue(n,t){return mM(8390656,8,n,t)}function iQ(n,t){return _U(2048,8,n,t)}function Jge(n,t){return _U(4,2,n,t)}function Qge(n,t){return _U(4,4,n,t)}function Zge(n,t){if(typeof t=="function")return n=n(),t(n),function(){t(null)};if(t!=null)return n=n(),t.current=n,function(){t.current=null}}function e0e(n,t,i){return i=i!=null?i.concat([n]):null,_U(4,4,Zge.bind(null,t,n),i)}function rQ(){}function t0e(n,t){var i=hh();t=t===void 0?null:t;var s=i.memoizedState;return s!==null&&t!==null&&eQ(t,s[1])?s[0]:(i.memoizedState=[n,t],n)}function n0e(n,t){var i=hh();t=t===void 0?null:t;var s=i.memoizedState;return s!==null&&t!==null&&eQ(t,s[1])?s[0]:(n=n(),i.memoizedState=[n,t],n)}function i0e(n,t,i){return V2&21?(_f(i,t)||(i=age(),$s.lanes|=i,z2|=i,n.baseState=!0),t):(n.baseState&&(n.baseState=!1,id=!0),n.memoizedState=i)}function jOe(n,t){var i=Hr;Hr=i!==0&&4>i?i:4,n(!0);var s=q$.transition;q$.transition={};try{n(!1),t()}finally{Hr=i,q$.transition=s}}function r0e(){return hh().memoizedState}function UOe(n,t,i){var s=Hv(n);if(i={lane:s,action:i,hasEagerState:!1,eagerState:null,next:null},s0e(n))a0e(t,i);else if(i=Mge(n,t,i,s),i!==null){var l=uc();gf(i,n,s,l),o0e(i,t,s)}}function FOe(n,t,i){var s=Hv(n),l={lane:s,action:i,hasEagerState:!1,eagerState:null,next:null};if(s0e(n))a0e(t,l);else{var d=n.alternate;if(n.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var u=t.lastRenderedState,p=d(u,i);if(l.hasEagerState=!0,l.eagerState=p,_f(p,u)){var m=t.interleaved;m===null?(l.next=l,YJ(t)):(l.next=m.next,m.next=l),t.interleaved=l;return}}catch{}finally{}i=Mge(n,t,l,s),i!==null&&(l=uc(),gf(i,n,s,l),o0e(i,t,s))}}function s0e(n){var t=n.alternate;return n===$s||t!==null&&t===$s}function a0e(n,t){D4=x7=!0;var i=n.pending;i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t}function o0e(n,t,i){if(i&4194240){var s=t.lanes;s&=n.pendingLanes,i|=s,t.lanes=i,kJ(n,i)}}var A7={readContext:uh,useCallback:ml,useContext:ml,useEffect:ml,useImperativeHandle:ml,useInsertionEffect:ml,useLayoutEffect:ml,useMemo:ml,useReducer:ml,useRef:ml,useState:ml,useDebugValue:ml,useDeferredValue:ml,useTransition:ml,useMutableSource:ml,useSyncExternalStore:ml,useId:ml,unstable_isNewReconciler:!1},BOe={readContext:uh,useCallback:function(n,t){return cp().memoizedState=[n,t===void 0?null:t],n},useContext:uh,useEffect:wue,useImperativeHandle:function(n,t,i){return i=i!=null?i.concat([n]):null,mM(4194308,4,Zge.bind(null,t,n),i)},useLayoutEffect:function(n,t){return mM(4194308,4,n,t)},useInsertionEffect:function(n,t){return mM(4,2,n,t)},useMemo:function(n,t){var i=cp();return t=t===void 0?null:t,n=n(),i.memoizedState=[n,t],n},useReducer:function(n,t,i){var s=cp();return t=i!==void 0?i(t):t,s.memoizedState=s.baseState=t,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:t},s.queue=n,n=n.dispatch=UOe.bind(null,$s,n),[s.memoizedState,n]},useRef:function(n){var t=cp();return n={current:n},t.memoizedState=n},useState:Eue,useDebugValue:rQ,useDeferredValue:function(n){return cp().memoizedState=n},useTransition:function(){var n=Eue(!1),t=n[0];return n=jOe.bind(null,n[1]),cp().memoizedState=n,[t,n]},useMutableSource:function(){},useSyncExternalStore:function(n,t,i){var s=$s,l=cp();if(Ms){if(i===void 0)throw Error(on(407));i=i()}else{if(i=t(),xo===null)throw Error(on(349));V2&30||Wge(s,t,i)}l.memoizedState=i;var d={value:i,getSnapshot:t};return l.queue=d,wue(Kge.bind(null,s,d,n),[n]),s.flags|=2048,aN(9,$ge.bind(null,s,d,i,t),void 0,null),i},useId:function(){var n=cp(),t=xo.identifierPrefix;if(Ms){var i=Bg,s=Fg;i=(s&~(1<<32-mf(s)-1)).toString(32)+i,t=":"+t+"R"+i,i=rN++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=MOe++,t=":"+t+"r"+i.toString(32)+":";return n.memoizedState=t},unstable_isNewReconciler:!1},VOe={readContext:uh,useCallback:t0e,useContext:uh,useEffect:iQ,useImperativeHandle:e0e,useInsertionEffect:Jge,useLayoutEffect:Qge,useMemo:n0e,useReducer:Y$,useRef:Xge,useState:function(){return Y$(sN)},useDebugValue:rQ,useDeferredValue:function(n){var t=hh();return i0e(t,Ya.memoizedState,n)},useTransition:function(){var n=Y$(sN)[0],t=hh().memoizedState;return[n,t]},useMutableSource:Hge,useSyncExternalStore:Gge,useId:r0e,unstable_isNewReconciler:!1},zOe={readContext:uh,useCallback:t0e,useContext:uh,useEffect:iQ,useImperativeHandle:e0e,useInsertionEffect:Jge,useLayoutEffect:Qge,useMemo:n0e,useReducer:X$,useRef:Xge,useState:function(){return X$(sN)},useDebugValue:rQ,useDeferredValue:function(n){var t=hh();return Ya===null?t.memoizedState=n:i0e(t,Ya.memoizedState,n)},useTransition:function(){var n=X$(sN)[0],t=hh().memoizedState;return[n,t]},useMutableSource:Hge,useSyncExternalStore:Gge,useId:r0e,unstable_isNewReconciler:!1};function QR(n,t){try{var i="",s=t;do i+=g5e(s),s=s.return;while(s);var l=i}catch(d){l=`
Error generating stack: `+d.message+`
`+d.stack}return{value:n,source:t,stack:l,digest:null}}function J$(n,t,i){return{value:n,source:null,stack:i??null,digest:t??null}}function Pq(n,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var HOe=typeof WeakMap=="function"?WeakMap:Map;function l0e(n,t,i){i=zg(-1,i),i.tag=3,i.payload={element:null};var s=t.value;return i.callback=function(){N7||(N7=!0,zq=s),Pq(n,t)},i}function c0e(n,t,i){i=zg(-1,i),i.tag=3;var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var l=t.value;i.payload=function(){return s(l)},i.callback=function(){Pq(n,t)}}var d=n.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(i.callback=function(){Pq(n,t),typeof s!="function"&&(zv===null?zv=new Set([this]):zv.add(this));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),i}function Sue(n,t,i){var s=n.pingCache;if(s===null){s=n.pingCache=new HOe;var l=new Set;s.set(t,l)}else l=s.get(t),l===void 0&&(l=new Set,s.set(t,l));l.has(i)||(l.add(i),n=iPe.bind(null,n,t,i),t.then(n,n))}function bue(n){do{var t;if((t=n.tag===13)&&(t=n.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return n;n=n.return}while(n!==null);return null}function Cue(n,t,i,s,l){return n.mode&1?(n.flags|=65536,n.lanes=l,n):(n===t?n.flags|=65536:(n.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=zg(-1,1),t.tag=2,Vv(i,t,1))),i.lanes|=1),n)}var GOe=Yg.ReactCurrentOwner,id=!1;function oc(n,t,i,s){t.child=n===null?Vge(t,null,i,s):XR(t,n.child,i,s)}function Tue(n,t,i,s,l){i=i.render;var d=t.ref;return VC(t,l),s=tQ(n,t,i,s,d,l),i=nQ(),n!==null&&!id?(t.updateQueue=n.updateQueue,t.flags&=-2053,n.lanes&=~l,Kg(n,t,l)):(Ms&&i&&HJ(t),t.flags|=1,oc(n,t,s,l),t.child)}function Rue(n,t,i,s,l){if(n===null){var d=i.type;return typeof d=="function"&&!hQ(d)&&d.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=d,d0e(n,t,d,s,l)):(n=_M(i.type,null,s,t,t.mode,l),n.ref=t.ref,n.return=t,t.child=n)}if(d=n.child,!(n.lanes&l)){var u=d.memoizedProps;if(i=i.compare,i=i!==null?i:Q4,i(u,s)&&n.ref===t.ref)return Kg(n,t,l)}return t.flags|=1,n=Gv(d,s),n.ref=t.ref,n.return=t,t.child=n}function d0e(n,t,i,s,l){if(n!==null){var d=n.memoizedProps;if(Q4(d,s)&&n.ref===t.ref)if(id=!1,t.pendingProps=s=d,(n.lanes&l)!==0)n.flags&131072&&(id=!0);else return t.lanes=n.lanes,Kg(n,t,l)}return Lq(n,t,i,s,l)}function u0e(n,t,i){var s=t.pendingProps,l=s.children,d=n!==null?n.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},hs(NC,$d),$d|=i;else{if(!(i&1073741824))return n=d!==null?d.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:n,cachePool:null,transitions:null},t.updateQueue=null,hs(NC,$d),$d|=n,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=d!==null?d.baseLanes:i,hs(NC,$d),$d|=s}else d!==null?(s=d.baseLanes|i,t.memoizedState=null):s=i,hs(NC,$d),$d|=s;return oc(n,t,l,i),t.child}function h0e(n,t){var i=t.ref;(n===null&&i!==null||n!==null&&n.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Lq(n,t,i,s,l){var d=sd(i)?F2:Tl.current;return d=qR(t,d),VC(t,l),i=tQ(n,t,i,s,d,l),s=nQ(),n!==null&&!id?(t.updateQueue=n.updateQueue,t.flags&=-2053,n.lanes&=~l,Kg(n,t,l)):(Ms&&s&&HJ(t),t.flags|=1,oc(n,t,i,l),t.child)}function xue(n,t,i,s,l){if(sd(i)){var d=!0;E7(t)}else d=!1;if(VC(t,l),t.stateNode===null)gM(n,t),Fge(t,i,s),Oq(t,i,s,l),s=!0;else if(n===null){var u=t.stateNode,p=t.memoizedProps;u.props=p;var m=u.context,y=i.contextType;typeof y=="object"&&y!==null?y=uh(y):(y=sd(i)?F2:Tl.current,y=qR(t,y));var _=i.getDerivedStateFromProps,E=typeof _=="function"||typeof u.getSnapshotBeforeUpdate=="function";E||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==s||m!==y)&&yue(t,u,s,y),_1=!1;var C=t.memoizedState;u.state=C,T7(t,s,u,l),m=t.memoizedState,p!==s||C!==m||rd.current||_1?(typeof _=="function"&&(Nq(t,i,_,s),m=t.memoizedState),(p=_1||vue(t,i,p,s,C,m,y))?(E||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=m),u.props=s,u.state=m,u.context=y,s=p):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{u=t.stateNode,jge(n,t),p=t.memoizedProps,y=t.type===t.elementType?p:Yh(t.type,p),u.props=y,E=t.pendingProps,C=u.context,m=i.contextType,typeof m=="object"&&m!==null?m=uh(m):(m=sd(i)?F2:Tl.current,m=qR(t,m));var x=i.getDerivedStateFromProps;(_=typeof x=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==E||C!==m)&&yue(t,u,s,m),_1=!1,C=t.memoizedState,u.state=C,T7(t,s,u,l);var N=t.memoizedState;p!==E||C!==N||rd.current||_1?(typeof x=="function"&&(Nq(t,i,x,s),N=t.memoizedState),(y=_1||vue(t,i,y,s,C,N,m)||!1)?(_||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(s,N,m),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(s,N,m)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||p===n.memoizedProps&&C===n.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===n.memoizedProps&&C===n.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=N),u.props=s,u.state=N,u.context=m,s=y):(typeof u.componentDidUpdate!="function"||p===n.memoizedProps&&C===n.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===n.memoizedProps&&C===n.memoizedState||(t.flags|=1024),s=!1)}return Dq(n,t,i,s,d,l)}function Dq(n,t,i,s,l,d){h0e(n,t);var u=(t.flags&128)!==0;if(!s&&!u)return l&&hue(t,i,!1),Kg(n,t,d);s=t.stateNode,GOe.current=t;var p=u&&typeof i.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,n!==null&&u?(t.child=XR(t,n.child,null,d),t.child=XR(t,null,p,d)):oc(n,t,p,d),t.memoizedState=s.state,l&&hue(t,i,!0),t.child}function f0e(n){var t=n.stateNode;t.pendingContext?uue(n,t.pendingContext,t.pendingContext!==t.context):t.context&&uue(n,t.context,!1),JJ(n,t.containerInfo)}function Aue(n,t,i,s,l){return YR(),WJ(l),t.flags|=256,oc(n,t,i,s),t.child}var kq={dehydrated:null,treeContext:null,retryLane:0};function Mq(n){return{baseLanes:n,cachePool:null,transitions:null}}function p0e(n,t,i){var s=t.pendingProps,l=Gs.current,d=!1,u=(t.flags&128)!==0,p;if((p=u)||(p=n!==null&&n.memoizedState===null?!1:(l&2)!==0),p?(d=!0,t.flags&=-129):(n===null||n.memoizedState!==null)&&(l|=1),hs(Gs,l&1),n===null)return Aq(t),n=t.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(t.mode&1?n.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(u=s.children,n=s.fallback,d?(s=t.mode,d=t.child,u={mode:"hidden",children:u},!(s&1)&&d!==null?(d.childLanes=0,d.pendingProps=u):d=SU(u,s,0,null),n=P2(n,s,i,null),d.return=t,n.return=t,d.sibling=n,t.child=d,t.child.memoizedState=Mq(i),t.memoizedState=kq,n):sQ(t,u));if(l=n.memoizedState,l!==null&&(p=l.dehydrated,p!==null))return WOe(n,t,u,s,p,l,i);if(d){d=s.fallback,u=t.mode,l=n.child,p=l.sibling;var m={mode:"hidden",children:s.children};return!(u&1)&&t.child!==l?(s=t.child,s.childLanes=0,s.pendingProps=m,t.deletions=null):(s=Gv(l,m),s.subtreeFlags=l.subtreeFlags&14680064),p!==null?d=Gv(p,d):(d=P2(d,u,i,null),d.flags|=2),d.return=t,s.return=t,s.sibling=d,t.child=s,s=d,d=t.child,u=n.child.memoizedState,u=u===null?Mq(i):{baseLanes:u.baseLanes|i,cachePool:null,transitions:u.transitions},d.memoizedState=u,d.childLanes=n.childLanes&~i,t.memoizedState=kq,s}return d=n.child,n=d.sibling,s=Gv(d,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=i),s.return=t,s.sibling=null,n!==null&&(i=t.deletions,i===null?(t.deletions=[n],t.flags|=16):i.push(n)),t.child=s,t.memoizedState=null,s}function sQ(n,t){return t=SU({mode:"visible",children:t},n.mode,0,null),t.return=n,n.child=t}function V8(n,t,i,s){return s!==null&&WJ(s),XR(t,n.child,null,i),n=sQ(t,t.pendingProps.children),n.flags|=2,t.memoizedState=null,n}function WOe(n,t,i,s,l,d,u){if(i)return t.flags&256?(t.flags&=-257,s=J$(Error(on(422))),V8(n,t,u,s)):t.memoizedState!==null?(t.child=n.child,t.flags|=128,null):(d=s.fallback,l=t.mode,s=SU({mode:"visible",children:s.children},l,0,null),d=P2(d,l,u,null),d.flags|=2,s.return=t,d.return=t,s.sibling=d,t.child=s,t.mode&1&&XR(t,n.child,null,u),t.child.memoizedState=Mq(u),t.memoizedState=kq,d);if(!(t.mode&1))return V8(n,t,u,null);if(l.data==="$!"){if(s=l.nextSibling&&l.nextSibling.dataset,s)var p=s.dgst;return s=p,d=Error(on(419)),s=J$(d,s,void 0),V8(n,t,u,s)}if(p=(u&n.childLanes)!==0,id||p){if(s=xo,s!==null){switch(u&-u){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(s.suspendedLanes|u)?0:l,l!==0&&l!==d.retryLane&&(d.retryLane=l,$g(n,l),gf(s,n,l,-1))}return uQ(),s=J$(Error(on(421))),V8(n,t,u,s)}return l.data==="$?"?(t.flags|=128,t.child=n.child,t=rPe.bind(null,n),l._reactRetry=t,null):(n=d.treeContext,Xd=Bv(l.nextSibling),eu=t,Ms=!0,hf=null,n!==null&&(ah[oh++]=Fg,ah[oh++]=Bg,ah[oh++]=B2,Fg=n.id,Bg=n.overflow,B2=t),t=sQ(t,s.children),t.flags|=4096,t)}function Iue(n,t,i){n.lanes|=t;var s=n.alternate;s!==null&&(s.lanes|=t),Iq(n.return,t,i)}function Q$(n,t,i,s,l){var d=n.memoizedState;d===null?n.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:l}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=s,d.tail=i,d.tailMode=l)}function m0e(n,t,i){var s=t.pendingProps,l=s.revealOrder,d=s.tail;if(oc(n,t,s.children,i),s=Gs.current,s&2)s=s&1|2,t.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=t.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Iue(n,i,t);else if(n.tag===19)Iue(n,i,t);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}s&=1}if(hs(Gs,s),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(i=t.child,l=null;i!==null;)n=i.alternate,n!==null&&R7(n)===null&&(l=i),i=i.sibling;i=l,i===null?(l=t.child,t.child=null):(l=i.sibling,i.sibling=null),Q$(t,!1,l,i,d);break;case"backwards":for(i=null,l=t.child,t.child=null;l!==null;){if(n=l.alternate,n!==null&&R7(n)===null){t.child=l;break}n=l.sibling,l.sibling=i,i=l,l=n}Q$(t,!0,i,null,d);break;case"together":Q$(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function gM(n,t){!(t.mode&1)&&n!==null&&(n.alternate=null,t.alternate=null,t.flags|=2)}function Kg(n,t,i){if(n!==null&&(t.dependencies=n.dependencies),z2|=t.lanes,!(i&t.childLanes))return null;if(n!==null&&t.child!==n.child)throw Error(on(153));if(t.child!==null){for(n=t.child,i=Gv(n,n.pendingProps),t.child=i,i.return=t;n.sibling!==null;)n=n.sibling,i=i.sibling=Gv(n,n.pendingProps),i.return=t;i.sibling=null}return t.child}function $Oe(n,t,i){switch(t.tag){case 3:f0e(t),YR();break;case 5:zge(t);break;case 1:sd(t.type)&&E7(t);break;case 4:JJ(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,l=t.memoizedProps.value;hs(b7,s._currentValue),s._currentValue=l;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(hs(Gs,Gs.current&1),t.flags|=128,null):i&t.child.childLanes?p0e(n,t,i):(hs(Gs,Gs.current&1),n=Kg(n,t,i),n!==null?n.sibling:null);hs(Gs,Gs.current&1);break;case 19:if(s=(i&t.childLanes)!==0,n.flags&128){if(s)return m0e(n,t,i);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),hs(Gs,Gs.current),s)break;return null;case 22:case 23:return t.lanes=0,u0e(n,t,i)}return Kg(n,t,i)}var g0e,jq,v0e,y0e;g0e=function(n,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};jq=function(){};v0e=function(n,t,i,s){var l=n.memoizedProps;if(l!==s){n=t.stateNode,J_(Gp.current);var d=null;switch(i){case"input":l=sq(n,l),s=sq(n,s),d=[];break;case"select":l=Ks({},l,{value:void 0}),s=Ks({},s,{value:void 0}),d=[];break;case"textarea":l=lq(n,l),s=lq(n,s),d=[];break;default:typeof l.onClick!="function"&&typeof s.onClick=="function"&&(n.onclick=y7)}dq(i,s);var u;i=null;for(y in l)if(!s.hasOwnProperty(y)&&l.hasOwnProperty(y)&&l[y]!=null)if(y==="style"){var p=l[y];for(u in p)p.hasOwnProperty(u)&&(i||(i={}),i[u]="")}else y!=="dangerouslySetInnerHTML"&&y!=="children"&&y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&y!=="autoFocus"&&(W4.hasOwnProperty(y)?d||(d=[]):(d=d||[]).push(y,null));for(y in s){var m=s[y];if(p=l!=null?l[y]:void 0,s.hasOwnProperty(y)&&m!==p&&(m!=null||p!=null))if(y==="style")if(p){for(u in p)!p.hasOwnProperty(u)||m&&m.hasOwnProperty(u)||(i||(i={}),i[u]="");for(u in m)m.hasOwnProperty(u)&&p[u]!==m[u]&&(i||(i={}),i[u]=m[u])}else i||(d||(d=[]),d.push(y,i)),i=m;else y==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,p=p?p.__html:void 0,m!=null&&p!==m&&(d=d||[]).push(y,m)):y==="children"?typeof m!="string"&&typeof m!="number"||(d=d||[]).push(y,""+m):y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&(W4.hasOwnProperty(y)?(m!=null&&y==="onScroll"&&Ss("scroll",n),d||p===m||(d=[])):(d=d||[]).push(y,m))}i&&(d=d||[]).push("style",i);var y=d;(t.updateQueue=y)&&(t.flags|=4)}};y0e=function(n,t,i,s){i!==s&&(t.flags|=4)};function k3(n,t){if(!Ms)switch(n.tailMode){case"hidden":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||n.tail===null?n.tail=null:n.tail.sibling=null:s.sibling=null}}function gl(n){var t=n.alternate!==null&&n.alternate.child===n.child,i=0,s=0;if(t)for(var l=n.child;l!==null;)i|=l.lanes|l.childLanes,s|=l.subtreeFlags&14680064,s|=l.flags&14680064,l.return=n,l=l.sibling;else for(l=n.child;l!==null;)i|=l.lanes|l.childLanes,s|=l.subtreeFlags,s|=l.flags,l.return=n,l=l.sibling;return n.subtreeFlags|=s,n.childLanes=i,t}function KOe(n,t,i){var s=t.pendingProps;switch(GJ(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(t),null;case 1:return sd(t.type)&&_7(),gl(t),null;case 3:return s=t.stateNode,JR(),Cs(rd),Cs(Tl),ZJ(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(F8(t)?t.flags|=4:n===null||n.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,hf!==null&&(Wq(hf),hf=null))),jq(n,t),gl(t),null;case 5:QJ(t);var l=J_(iN.current);if(i=t.type,n!==null&&t.stateNode!=null)v0e(n,t,i,s,l),n.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(on(166));return gl(t),null}if(n=J_(Gp.current),F8(t)){s=t.stateNode,i=t.type;var d=t.memoizedProps;switch(s[Fp]=t,s[tN]=d,n=(t.mode&1)!==0,i){case"dialog":Ss("cancel",s),Ss("close",s);break;case"iframe":case"object":case"embed":Ss("load",s);break;case"video":case"audio":for(l=0;l<J3.length;l++)Ss(J3[l],s);break;case"source":Ss("error",s);break;case"img":case"image":case"link":Ss("error",s),Ss("load",s);break;case"details":Ss("toggle",s);break;case"input":Ude(s,d),Ss("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!d.multiple},Ss("invalid",s);break;case"textarea":Bde(s,d),Ss("invalid",s)}dq(i,d),l=null;for(var u in d)if(d.hasOwnProperty(u)){var p=d[u];u==="children"?typeof p=="string"?s.textContent!==p&&(d.suppressHydrationWarning!==!0&&U8(s.textContent,p,n),l=["children",p]):typeof p=="number"&&s.textContent!==""+p&&(d.suppressHydrationWarning!==!0&&U8(s.textContent,p,n),l=["children",""+p]):W4.hasOwnProperty(u)&&p!=null&&u==="onScroll"&&Ss("scroll",s)}switch(i){case"input":N8(s),Fde(s,d,!0);break;case"textarea":N8(s),Vde(s);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(s.onclick=y7)}s=l,t.updateQueue=s,s!==null&&(t.flags|=4)}else{u=l.nodeType===9?l:l.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=Wme(i)),n==="http://www.w3.org/1999/xhtml"?i==="script"?(n=u.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof s.is=="string"?n=u.createElement(i,{is:s.is}):(n=u.createElement(i),i==="select"&&(u=n,s.multiple?u.multiple=!0:s.size&&(u.size=s.size))):n=u.createElementNS(n,i),n[Fp]=t,n[tN]=s,g0e(n,t,!1,!1),t.stateNode=n;e:{switch(u=uq(i,s),i){case"dialog":Ss("cancel",n),Ss("close",n),l=s;break;case"iframe":case"object":case"embed":Ss("load",n),l=s;break;case"video":case"audio":for(l=0;l<J3.length;l++)Ss(J3[l],n);l=s;break;case"source":Ss("error",n),l=s;break;case"img":case"image":case"link":Ss("error",n),Ss("load",n),l=s;break;case"details":Ss("toggle",n),l=s;break;case"input":Ude(n,s),l=sq(n,s),Ss("invalid",n);break;case"option":l=s;break;case"select":n._wrapperState={wasMultiple:!!s.multiple},l=Ks({},s,{value:void 0}),Ss("invalid",n);break;case"textarea":Bde(n,s),l=lq(n,s),Ss("invalid",n);break;default:l=s}dq(i,l),p=l;for(d in p)if(p.hasOwnProperty(d)){var m=p[d];d==="style"?qme(n,m):d==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,m!=null&&$me(n,m)):d==="children"?typeof m=="string"?(i!=="textarea"||m!=="")&&$4(n,m):typeof m=="number"&&$4(n,""+m):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(W4.hasOwnProperty(d)?m!=null&&d==="onScroll"&&Ss("scroll",n):m!=null&&IJ(n,d,m,u))}switch(i){case"input":N8(n),Fde(n,s,!1);break;case"textarea":N8(n),Vde(n);break;case"option":s.value!=null&&n.setAttribute("value",""+Yv(s.value));break;case"select":n.multiple=!!s.multiple,d=s.value,d!=null?jC(n,!!s.multiple,d,!1):s.defaultValue!=null&&jC(n,!!s.multiple,s.defaultValue,!0);break;default:typeof l.onClick=="function"&&(n.onclick=y7)}switch(i){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return gl(t),null;case 6:if(n&&t.stateNode!=null)y0e(n,t,n.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(on(166));if(i=J_(iN.current),J_(Gp.current),F8(t)){if(s=t.stateNode,i=t.memoizedProps,s[Fp]=t,(d=s.nodeValue!==i)&&(n=eu,n!==null))switch(n.tag){case 3:U8(s.nodeValue,i,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&U8(s.nodeValue,i,(n.mode&1)!==0)}d&&(t.flags|=4)}else s=(i.nodeType===9?i:i.ownerDocument).createTextNode(s),s[Fp]=t,t.stateNode=s}return gl(t),null;case 13:if(Cs(Gs),s=t.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ms&&Xd!==null&&t.mode&1&&!(t.flags&128))kge(),YR(),t.flags|=98560,d=!1;else if(d=F8(t),s!==null&&s.dehydrated!==null){if(n===null){if(!d)throw Error(on(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(on(317));d[Fp]=t}else YR(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),d=!1}else hf!==null&&(Wq(hf),hf=null),d=!0;if(!d)return t.flags&65536?t:null}return t.flags&128?(t.lanes=i,t):(s=s!==null,s!==(n!==null&&n.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(n===null||Gs.current&1?Ja===0&&(Ja=3):uQ())),t.updateQueue!==null&&(t.flags|=4),gl(t),null);case 4:return JR(),jq(n,t),n===null&&Z4(t.stateNode.containerInfo),gl(t),null;case 10:return qJ(t.type._context),gl(t),null;case 17:return sd(t.type)&&_7(),gl(t),null;case 19:if(Cs(Gs),d=t.memoizedState,d===null)return gl(t),null;if(s=(t.flags&128)!==0,u=d.rendering,u===null)if(s)k3(d,!1);else{if(Ja!==0||n!==null&&n.flags&128)for(n=t.child;n!==null;){if(u=R7(n),u!==null){for(t.flags|=128,k3(d,!1),s=u.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=i,i=t.child;i!==null;)d=i,n=s,d.flags&=14680066,u=d.alternate,u===null?(d.childLanes=0,d.lanes=n,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=u.childLanes,d.lanes=u.lanes,d.child=u.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=u.memoizedProps,d.memoizedState=u.memoizedState,d.updateQueue=u.updateQueue,d.type=u.type,n=u.dependencies,d.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),i=i.sibling;return hs(Gs,Gs.current&1|2),t.child}n=n.sibling}d.tail!==null&&ya()>ZR&&(t.flags|=128,s=!0,k3(d,!1),t.lanes=4194304)}else{if(!s)if(n=R7(u),n!==null){if(t.flags|=128,s=!0,i=n.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),k3(d,!0),d.tail===null&&d.tailMode==="hidden"&&!u.alternate&&!Ms)return gl(t),null}else 2*ya()-d.renderingStartTime>ZR&&i!==1073741824&&(t.flags|=128,s=!0,k3(d,!1),t.lanes=4194304);d.isBackwards?(u.sibling=t.child,t.child=u):(i=d.last,i!==null?i.sibling=u:t.child=u,d.last=u)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=ya(),t.sibling=null,i=Gs.current,hs(Gs,s?i&1|2:i&1),t):(gl(t),null);case 22:case 23:return dQ(),s=t.memoizedState!==null,n!==null&&n.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?$d&1073741824&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),null;case 24:return null;case 25:return null}throw Error(on(156,t.tag))}function qOe(n,t){switch(GJ(t),t.tag){case 1:return sd(t.type)&&_7(),n=t.flags,n&65536?(t.flags=n&-65537|128,t):null;case 3:return JR(),Cs(rd),Cs(Tl),ZJ(),n=t.flags,n&65536&&!(n&128)?(t.flags=n&-65537|128,t):null;case 5:return QJ(t),null;case 13:if(Cs(Gs),n=t.memoizedState,n!==null&&n.dehydrated!==null){if(t.alternate===null)throw Error(on(340));YR()}return n=t.flags,n&65536?(t.flags=n&-65537|128,t):null;case 19:return Cs(Gs),null;case 4:return JR(),null;case 10:return qJ(t.type._context),null;case 22:case 23:return dQ(),null;case 24:return null;default:return null}}var z8=!1,bl=!1,YOe=typeof WeakSet=="function"?WeakSet:Set,An=null;function IC(n,t){var i=n.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(s){ra(n,t,s)}else i.current=null}function Uq(n,t,i){try{i()}catch(s){ra(n,t,s)}}var Nue=!1;function XOe(n,t){if(wq=m7,n=Sge(),zJ(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var l=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var u=0,p=-1,m=-1,y=0,_=0,E=n,C=null;t:for(;;){for(var x;E!==i||l!==0&&E.nodeType!==3||(p=u+l),E!==d||s!==0&&E.nodeType!==3||(m=u+s),E.nodeType===3&&(u+=E.nodeValue.length),(x=E.firstChild)!==null;)C=E,E=x;for(;;){if(E===n)break t;if(C===i&&++y===l&&(p=u),C===d&&++_===s&&(m=u),(x=E.nextSibling)!==null)break;E=C,C=E.parentNode}E=x}i=p===-1||m===-1?null:{start:p,end:m}}else i=null}i=i||{start:0,end:0}}else i=null;for(Sq={focusedElem:n,selectionRange:i},m7=!1,An=t;An!==null;)if(t=An,n=t.child,(t.subtreeFlags&1028)!==0&&n!==null)n.return=t,An=n;else for(;An!==null;){t=An;try{var N=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(N!==null){var O=N.memoizedProps,D=N.memoizedState,P=t.stateNode,j=P.getSnapshotBeforeUpdate(t.elementType===t.type?O:Yh(t.type,O),D);P.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var M=t.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(on(163))}}catch(V){ra(t,t.return,V)}if(n=t.sibling,n!==null){n.return=t.return,An=n;break}An=t.return}return N=Nue,Nue=!1,N}function k4(n,t,i){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var l=s=s.next;do{if((l.tag&n)===n){var d=l.destroy;l.destroy=void 0,d!==void 0&&Uq(t,i,d)}l=l.next}while(l!==s)}}function EU(n,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&n)===n){var s=i.create;i.destroy=s()}i=i.next}while(i!==t)}}function Fq(n){var t=n.ref;if(t!==null){var i=n.stateNode;switch(n.tag){case 5:n=i;break;default:n=i}typeof t=="function"?t(n):t.current=n}}function _0e(n){var t=n.alternate;t!==null&&(n.alternate=null,_0e(t)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(t=n.stateNode,t!==null&&(delete t[Fp],delete t[tN],delete t[Tq],delete t[POe],delete t[LOe])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function E0e(n){return n.tag===5||n.tag===3||n.tag===4}function Oue(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||E0e(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Bq(n,t,i){var s=n.tag;if(s===5||s===6)n=n.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(n,t):i.insertBefore(n,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(n,i)):(t=i,t.appendChild(n)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=y7));else if(s!==4&&(n=n.child,n!==null))for(Bq(n,t,i),n=n.sibling;n!==null;)Bq(n,t,i),n=n.sibling}function Vq(n,t,i){var s=n.tag;if(s===5||s===6)n=n.stateNode,t?i.insertBefore(n,t):i.appendChild(n);else if(s!==4&&(n=n.child,n!==null))for(Vq(n,t,i),n=n.sibling;n!==null;)Vq(n,t,i),n=n.sibling}var Ko=null,uf=!1;function h1(n,t,i){for(i=i.child;i!==null;)w0e(n,t,i),i=i.sibling}function w0e(n,t,i){if(Hp&&typeof Hp.onCommitFiberUnmount=="function")try{Hp.onCommitFiberUnmount(hU,i)}catch{}switch(i.tag){case 5:bl||IC(i,t);case 6:var s=Ko,l=uf;Ko=null,h1(n,t,i),Ko=s,uf=l,Ko!==null&&(uf?(n=Ko,i=i.stateNode,n.nodeType===8?n.parentNode.removeChild(i):n.removeChild(i)):Ko.removeChild(i.stateNode));break;case 18:Ko!==null&&(uf?(n=Ko,i=i.stateNode,n.nodeType===8?W$(n.parentNode,i):n.nodeType===1&&W$(n,i),X4(n)):W$(Ko,i.stateNode));break;case 4:s=Ko,l=uf,Ko=i.stateNode.containerInfo,uf=!0,h1(n,t,i),Ko=s,uf=l;break;case 0:case 11:case 14:case 15:if(!bl&&(s=i.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){l=s=s.next;do{var d=l,u=d.destroy;d=d.tag,u!==void 0&&(d&2||d&4)&&Uq(i,t,u),l=l.next}while(l!==s)}h1(n,t,i);break;case 1:if(!bl&&(IC(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=i.memoizedProps,s.state=i.memoizedState,s.componentWillUnmount()}catch(p){ra(i,t,p)}h1(n,t,i);break;case 21:h1(n,t,i);break;case 22:i.mode&1?(bl=(s=bl)||i.memoizedState!==null,h1(n,t,i),bl=s):h1(n,t,i);break;default:h1(n,t,i)}}function Pue(n){var t=n.updateQueue;if(t!==null){n.updateQueue=null;var i=n.stateNode;i===null&&(i=n.stateNode=new YOe),t.forEach(function(s){var l=sPe.bind(null,n,s);i.has(s)||(i.add(s),s.then(l,l))})}}function Hh(n,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];try{var d=n,u=t,p=u;e:for(;p!==null;){switch(p.tag){case 5:Ko=p.stateNode,uf=!1;break e;case 3:Ko=p.stateNode.containerInfo,uf=!0;break e;case 4:Ko=p.stateNode.containerInfo,uf=!0;break e}p=p.return}if(Ko===null)throw Error(on(160));w0e(d,u,l),Ko=null,uf=!1;var m=l.alternate;m!==null&&(m.return=null),l.return=null}catch(y){ra(l,t,y)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)S0e(t,n),t=t.sibling}function S0e(n,t){var i=n.alternate,s=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Hh(t,n),rp(n),s&4){try{k4(3,n,n.return),EU(3,n)}catch(O){ra(n,n.return,O)}try{k4(5,n,n.return)}catch(O){ra(n,n.return,O)}}break;case 1:Hh(t,n),rp(n),s&512&&i!==null&&IC(i,i.return);break;case 5:if(Hh(t,n),rp(n),s&512&&i!==null&&IC(i,i.return),n.flags&32){var l=n.stateNode;try{$4(l,"")}catch(O){ra(n,n.return,O)}}if(s&4&&(l=n.stateNode,l!=null)){var d=n.memoizedProps,u=i!==null?i.memoizedProps:d,p=n.type,m=n.updateQueue;if(n.updateQueue=null,m!==null)try{p==="input"&&d.type==="radio"&&d.name!=null&&Hme(l,d),uq(p,u);var y=uq(p,d);for(u=0;u<m.length;u+=2){var _=m[u],E=m[u+1];_==="style"?qme(l,E):_==="dangerouslySetInnerHTML"?$me(l,E):_==="children"?$4(l,E):IJ(l,_,E,y)}switch(p){case"input":aq(l,d);break;case"textarea":Gme(l,d);break;case"select":var C=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!d.multiple;var x=d.value;x!=null?jC(l,!!d.multiple,x,!1):C!==!!d.multiple&&(d.defaultValue!=null?jC(l,!!d.multiple,d.defaultValue,!0):jC(l,!!d.multiple,d.multiple?[]:"",!1))}l[tN]=d}catch(O){ra(n,n.return,O)}}break;case 6:if(Hh(t,n),rp(n),s&4){if(n.stateNode===null)throw Error(on(162));l=n.stateNode,d=n.memoizedProps;try{l.nodeValue=d}catch(O){ra(n,n.return,O)}}break;case 3:if(Hh(t,n),rp(n),s&4&&i!==null&&i.memoizedState.isDehydrated)try{X4(t.containerInfo)}catch(O){ra(n,n.return,O)}break;case 4:Hh(t,n),rp(n);break;case 13:Hh(t,n),rp(n),l=n.child,l.flags&8192&&(d=l.memoizedState!==null,l.stateNode.isHidden=d,!d||l.alternate!==null&&l.alternate.memoizedState!==null||(lQ=ya())),s&4&&Pue(n);break;case 22:if(_=i!==null&&i.memoizedState!==null,n.mode&1?(bl=(y=bl)||_,Hh(t,n),bl=y):Hh(t,n),rp(n),s&8192){if(y=n.memoizedState!==null,(n.stateNode.isHidden=y)&&!_&&n.mode&1)for(An=n,_=n.child;_!==null;){for(E=An=_;An!==null;){switch(C=An,x=C.child,C.tag){case 0:case 11:case 14:case 15:k4(4,C,C.return);break;case 1:IC(C,C.return);var N=C.stateNode;if(typeof N.componentWillUnmount=="function"){s=C,i=C.return;try{t=s,N.props=t.memoizedProps,N.state=t.memoizedState,N.componentWillUnmount()}catch(O){ra(s,i,O)}}break;case 5:IC(C,C.return);break;case 22:if(C.memoizedState!==null){Due(E);continue}}x!==null?(x.return=C,An=x):Due(E)}_=_.sibling}e:for(_=null,E=n;;){if(E.tag===5){if(_===null){_=E;try{l=E.stateNode,y?(d=l.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(p=E.stateNode,m=E.memoizedProps.style,u=m!=null&&m.hasOwnProperty("display")?m.display:null,p.style.display=Kme("display",u))}catch(O){ra(n,n.return,O)}}}else if(E.tag===6){if(_===null)try{E.stateNode.nodeValue=y?"":E.memoizedProps}catch(O){ra(n,n.return,O)}}else if((E.tag!==22&&E.tag!==23||E.memoizedState===null||E===n)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===n)break e;for(;E.sibling===null;){if(E.return===null||E.return===n)break e;_===E&&(_=null),E=E.return}_===E&&(_=null),E.sibling.return=E.return,E=E.sibling}}break;case 19:Hh(t,n),rp(n),s&4&&Pue(n);break;case 21:break;default:Hh(t,n),rp(n)}}function rp(n){var t=n.flags;if(t&2){try{e:{for(var i=n.return;i!==null;){if(E0e(i)){var s=i;break e}i=i.return}throw Error(on(160))}switch(s.tag){case 5:var l=s.stateNode;s.flags&32&&($4(l,""),s.flags&=-33);var d=Oue(n);Vq(n,d,l);break;case 3:case 4:var u=s.stateNode.containerInfo,p=Oue(n);Bq(n,p,u);break;default:throw Error(on(161))}}catch(m){ra(n,n.return,m)}n.flags&=-3}t&4096&&(n.flags&=-4097)}function JOe(n,t,i){An=n,b0e(n)}function b0e(n,t,i){for(var s=(n.mode&1)!==0;An!==null;){var l=An,d=l.child;if(l.tag===22&&s){var u=l.memoizedState!==null||z8;if(!u){var p=l.alternate,m=p!==null&&p.memoizedState!==null||bl;p=z8;var y=bl;if(z8=u,(bl=m)&&!y)for(An=l;An!==null;)u=An,m=u.child,u.tag===22&&u.memoizedState!==null?kue(l):m!==null?(m.return=u,An=m):kue(l);for(;d!==null;)An=d,b0e(d),d=d.sibling;An=l,z8=p,bl=y}Lue(n)}else l.subtreeFlags&8772&&d!==null?(d.return=l,An=d):Lue(n)}}function Lue(n){for(;An!==null;){var t=An;if(t.flags&8772){var i=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:bl||EU(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!bl)if(i===null)s.componentDidMount();else{var l=t.elementType===t.type?i.memoizedProps:Yh(t.type,i.memoizedProps);s.componentDidUpdate(l,i.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var d=t.updateQueue;d!==null&&gue(t,d,s);break;case 3:var u=t.updateQueue;if(u!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}gue(t,u,i)}break;case 5:var p=t.stateNode;if(i===null&&t.flags&4){i=p;var m=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":m.autoFocus&&i.focus();break;case"img":m.src&&(i.src=m.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var y=t.alternate;if(y!==null){var _=y.memoizedState;if(_!==null){var E=_.dehydrated;E!==null&&X4(E)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(on(163))}bl||t.flags&512&&Fq(t)}catch(C){ra(t,t.return,C)}}if(t===n){An=null;break}if(i=t.sibling,i!==null){i.return=t.return,An=i;break}An=t.return}}function Due(n){for(;An!==null;){var t=An;if(t===n){An=null;break}var i=t.sibling;if(i!==null){i.return=t.return,An=i;break}An=t.return}}function kue(n){for(;An!==null;){var t=An;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{EU(4,t)}catch(m){ra(t,i,m)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var l=t.return;try{s.componentDidMount()}catch(m){ra(t,l,m)}}var d=t.return;try{Fq(t)}catch(m){ra(t,d,m)}break;case 5:var u=t.return;try{Fq(t)}catch(m){ra(t,u,m)}}}catch(m){ra(t,t.return,m)}if(t===n){An=null;break}var p=t.sibling;if(p!==null){p.return=t.return,An=p;break}An=t.return}}var QOe=Math.ceil,I7=Yg.ReactCurrentDispatcher,aQ=Yg.ReactCurrentOwner,dh=Yg.ReactCurrentBatchConfig,wr=0,xo=null,Pa=null,Qo=0,$d=0,NC=iy(0),Ja=0,oN=null,z2=0,wU=0,oQ=0,M4=null,td=null,lQ=0,ZR=1/0,zm=null,N7=!1,zq=null,zv=null,H8=!1,Ov=null,O7=0,j4=0,Hq=null,vM=-1,yM=0;function uc(){return wr&6?ya():vM!==-1?vM:vM=ya()}function Hv(n){return n.mode&1?wr&2&&Qo!==0?Qo&-Qo:kOe.transition!==null?(yM===0&&(yM=age()),yM):(n=Hr,n!==0||(n=window.event,n=n===void 0?16:fge(n.type)),n):1}function gf(n,t,i,s){if(50<j4)throw j4=0,Hq=null,Error(on(185));dP(n,i,s),(!(wr&2)||n!==xo)&&(n===xo&&(!(wr&2)&&(wU|=i),Ja===4&&b1(n,Qo)),ad(n,s),i===1&&wr===0&&!(t.mode&1)&&(ZR=ya()+500,vU&&ry()))}function ad(n,t){var i=n.callbackNode;k5e(n,t);var s=p7(n,n===xo?Qo:0);if(s===0)i!==null&&Gde(i),n.callbackNode=null,n.callbackPriority=0;else if(t=s&-s,n.callbackPriority!==t){if(i!=null&&Gde(i),t===1)n.tag===0?DOe(Mue.bind(null,n)):Pge(Mue.bind(null,n)),NOe(function(){!(wr&6)&&ry()}),i=null;else{switch(oge(s)){case 1:i=DJ;break;case 4:i=rge;break;case 16:i=f7;break;case 536870912:i=sge;break;default:i=f7}i=O0e(i,C0e.bind(null,n))}n.callbackPriority=t,n.callbackNode=i}}function C0e(n,t){if(vM=-1,yM=0,wr&6)throw Error(on(327));var i=n.callbackNode;if(zC()&&n.callbackNode!==i)return null;var s=p7(n,n===xo?Qo:0);if(s===0)return null;if(s&30||s&n.expiredLanes||t)t=P7(n,s);else{t=s;var l=wr;wr|=2;var d=R0e();(xo!==n||Qo!==t)&&(zm=null,ZR=ya()+500,O2(n,t));do try{tPe();break}catch(p){T0e(n,p)}while(!0);KJ(),I7.current=d,wr=l,Pa!==null?t=0:(xo=null,Qo=0,t=Ja)}if(t!==0){if(t===2&&(l=gq(n),l!==0&&(s=l,t=Gq(n,l))),t===1)throw i=oN,O2(n,0),b1(n,s),ad(n,ya()),i;if(t===6)b1(n,s);else{if(l=n.current.alternate,!(s&30)&&!ZOe(l)&&(t=P7(n,s),t===2&&(d=gq(n),d!==0&&(s=d,t=Gq(n,d))),t===1))throw i=oN,O2(n,0),b1(n,s),ad(n,ya()),i;switch(n.finishedWork=l,n.finishedLanes=s,t){case 0:case 1:throw Error(on(345));case 2:M_(n,td,zm);break;case 3:if(b1(n,s),(s&130023424)===s&&(t=lQ+500-ya(),10<t)){if(p7(n,0)!==0)break;if(l=n.suspendedLanes,(l&s)!==s){uc(),n.pingedLanes|=n.suspendedLanes&l;break}n.timeoutHandle=Cq(M_.bind(null,n,td,zm),t);break}M_(n,td,zm);break;case 4:if(b1(n,s),(s&4194240)===s)break;for(t=n.eventTimes,l=-1;0<s;){var u=31-mf(s);d=1<<u,u=t[u],u>l&&(l=u),s&=~d}if(s=l,s=ya()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*QOe(s/1960))-s,10<s){n.timeoutHandle=Cq(M_.bind(null,n,td,zm),s);break}M_(n,td,zm);break;case 5:M_(n,td,zm);break;default:throw Error(on(329))}}}return ad(n,ya()),n.callbackNode===i?C0e.bind(null,n):null}function Gq(n,t){var i=M4;return n.current.memoizedState.isDehydrated&&(O2(n,t).flags|=256),n=P7(n,t),n!==2&&(t=td,td=i,t!==null&&Wq(t)),n}function Wq(n){td===null?td=n:td.push.apply(td,n)}function ZOe(n){for(var t=n;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var s=0;s<i.length;s++){var l=i[s],d=l.getSnapshot;l=l.value;try{if(!_f(d(),l))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===n)break;for(;t.sibling===null;){if(t.return===null||t.return===n)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function b1(n,t){for(t&=~oQ,t&=~wU,n.suspendedLanes|=t,n.pingedLanes&=~t,n=n.expirationTimes;0<t;){var i=31-mf(t),s=1<<i;n[i]=-1,t&=~s}}function Mue(n){if(wr&6)throw Error(on(327));zC();var t=p7(n,0);if(!(t&1))return ad(n,ya()),null;var i=P7(n,t);if(n.tag!==0&&i===2){var s=gq(n);s!==0&&(t=s,i=Gq(n,s))}if(i===1)throw i=oN,O2(n,0),b1(n,t),ad(n,ya()),i;if(i===6)throw Error(on(345));return n.finishedWork=n.current.alternate,n.finishedLanes=t,M_(n,td,zm),ad(n,ya()),null}function cQ(n,t){var i=wr;wr|=1;try{return n(t)}finally{wr=i,wr===0&&(ZR=ya()+500,vU&&ry())}}function H2(n){Ov!==null&&Ov.tag===0&&!(wr&6)&&zC();var t=wr;wr|=1;var i=dh.transition,s=Hr;try{if(dh.transition=null,Hr=1,n)return n()}finally{Hr=s,dh.transition=i,wr=t,!(wr&6)&&ry()}}function dQ(){$d=NC.current,Cs(NC)}function O2(n,t){n.finishedWork=null,n.finishedLanes=0;var i=n.timeoutHandle;if(i!==-1&&(n.timeoutHandle=-1,IOe(i)),Pa!==null)for(i=Pa.return;i!==null;){var s=i;switch(GJ(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&_7();break;case 3:JR(),Cs(rd),Cs(Tl),ZJ();break;case 5:QJ(s);break;case 4:JR();break;case 13:Cs(Gs);break;case 19:Cs(Gs);break;case 10:qJ(s.type._context);break;case 22:case 23:dQ()}i=i.return}if(xo=n,Pa=n=Gv(n.current,null),Qo=$d=t,Ja=0,oN=null,oQ=wU=z2=0,td=M4=null,X_!==null){for(t=0;t<X_.length;t++)if(i=X_[t],s=i.interleaved,s!==null){i.interleaved=null;var l=s.next,d=i.pending;if(d!==null){var u=d.next;d.next=l,s.next=u}i.pending=s}X_=null}return n}function T0e(n,t){do{var i=Pa;try{if(KJ(),pM.current=A7,x7){for(var s=$s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}x7=!1}if(V2=0,Co=Ya=$s=null,D4=!1,rN=0,aQ.current=null,i===null||i.return===null){Ja=1,oN=t,Pa=null;break}e:{var d=n,u=i.return,p=i,m=t;if(t=Qo,p.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){var y=m,_=p,E=_.tag;if(!(_.mode&1)&&(E===0||E===11||E===15)){var C=_.alternate;C?(_.updateQueue=C.updateQueue,_.memoizedState=C.memoizedState,_.lanes=C.lanes):(_.updateQueue=null,_.memoizedState=null)}var x=bue(u);if(x!==null){x.flags&=-257,Cue(x,u,p,d,t),x.mode&1&&Sue(d,y,t),t=x,m=y;var N=t.updateQueue;if(N===null){var O=new Set;O.add(m),t.updateQueue=O}else N.add(m);break e}else{if(!(t&1)){Sue(d,y,t),uQ();break e}m=Error(on(426))}}else if(Ms&&p.mode&1){var D=bue(u);if(D!==null){!(D.flags&65536)&&(D.flags|=256),Cue(D,u,p,d,t),WJ(QR(m,p));break e}}d=m=QR(m,p),Ja!==4&&(Ja=2),M4===null?M4=[d]:M4.push(d),d=u;do{switch(d.tag){case 3:d.flags|=65536,t&=-t,d.lanes|=t;var P=l0e(d,m,t);mue(d,P);break e;case 1:p=m;var j=d.type,M=d.stateNode;if(!(d.flags&128)&&(typeof j.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(zv===null||!zv.has(M)))){d.flags|=65536,t&=-t,d.lanes|=t;var V=c0e(d,p,t);mue(d,V);break e}}d=d.return}while(d!==null)}A0e(i)}catch(G){t=G,Pa===i&&i!==null&&(Pa=i=i.return);continue}break}while(!0)}function R0e(){var n=I7.current;return I7.current=A7,n===null?A7:n}function uQ(){(Ja===0||Ja===3||Ja===2)&&(Ja=4),xo===null||!(z2&268435455)&&!(wU&268435455)||b1(xo,Qo)}function P7(n,t){var i=wr;wr|=2;var s=R0e();(xo!==n||Qo!==t)&&(zm=null,O2(n,t));do try{ePe();break}catch(l){T0e(n,l)}while(!0);if(KJ(),wr=i,I7.current=s,Pa!==null)throw Error(on(261));return xo=null,Qo=0,Ja}function ePe(){for(;Pa!==null;)x0e(Pa)}function tPe(){for(;Pa!==null&&!R5e();)x0e(Pa)}function x0e(n){var t=N0e(n.alternate,n,$d);n.memoizedProps=n.pendingProps,t===null?A0e(n):Pa=t,aQ.current=null}function A0e(n){var t=n;do{var i=t.alternate;if(n=t.return,t.flags&32768){if(i=qOe(i,t),i!==null){i.flags&=32767,Pa=i;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Ja=6,Pa=null;return}}else if(i=KOe(i,t,$d),i!==null){Pa=i;return}if(t=t.sibling,t!==null){Pa=t;return}Pa=t=n}while(t!==null);Ja===0&&(Ja=5)}function M_(n,t,i){var s=Hr,l=dh.transition;try{dh.transition=null,Hr=1,nPe(n,t,i,s)}finally{dh.transition=l,Hr=s}return null}function nPe(n,t,i,s){do zC();while(Ov!==null);if(wr&6)throw Error(on(327));i=n.finishedWork;var l=n.finishedLanes;if(i===null)return null;if(n.finishedWork=null,n.finishedLanes=0,i===n.current)throw Error(on(177));n.callbackNode=null,n.callbackPriority=0;var d=i.lanes|i.childLanes;if(M5e(n,d),n===xo&&(Pa=xo=null,Qo=0),!(i.subtreeFlags&2064)&&!(i.flags&2064)||H8||(H8=!0,O0e(f7,function(){return zC(),null})),d=(i.flags&15990)!==0,i.subtreeFlags&15990||d){d=dh.transition,dh.transition=null;var u=Hr;Hr=1;var p=wr;wr|=4,aQ.current=null,XOe(n,i),S0e(i,n),SOe(Sq),m7=!!wq,Sq=wq=null,n.current=i,JOe(i),x5e(),wr=p,Hr=u,dh.transition=d}else n.current=i;if(H8&&(H8=!1,Ov=n,O7=l),d=n.pendingLanes,d===0&&(zv=null),N5e(i.stateNode),ad(n,ya()),t!==null)for(s=n.onRecoverableError,i=0;i<t.length;i++)l=t[i],s(l.value,{componentStack:l.stack,digest:l.digest});if(N7)throw N7=!1,n=zq,zq=null,n;return O7&1&&n.tag!==0&&zC(),d=n.pendingLanes,d&1?n===Hq?j4++:(j4=0,Hq=n):j4=0,ry(),null}function zC(){if(Ov!==null){var n=oge(O7),t=dh.transition,i=Hr;try{if(dh.transition=null,Hr=16>n?16:n,Ov===null)var s=!1;else{if(n=Ov,Ov=null,O7=0,wr&6)throw Error(on(331));var l=wr;for(wr|=4,An=n.current;An!==null;){var d=An,u=d.child;if(An.flags&16){var p=d.deletions;if(p!==null){for(var m=0;m<p.length;m++){var y=p[m];for(An=y;An!==null;){var _=An;switch(_.tag){case 0:case 11:case 15:k4(8,_,d)}var E=_.child;if(E!==null)E.return=_,An=E;else for(;An!==null;){_=An;var C=_.sibling,x=_.return;if(_0e(_),_===y){An=null;break}if(C!==null){C.return=x,An=C;break}An=x}}}var N=d.alternate;if(N!==null){var O=N.child;if(O!==null){N.child=null;do{var D=O.sibling;O.sibling=null,O=D}while(O!==null)}}An=d}}if(d.subtreeFlags&2064&&u!==null)u.return=d,An=u;else e:for(;An!==null;){if(d=An,d.flags&2048)switch(d.tag){case 0:case 11:case 15:k4(9,d,d.return)}var P=d.sibling;if(P!==null){P.return=d.return,An=P;break e}An=d.return}}var j=n.current;for(An=j;An!==null;){u=An;var M=u.child;if(u.subtreeFlags&2064&&M!==null)M.return=u,An=M;else e:for(u=j;An!==null;){if(p=An,p.flags&2048)try{switch(p.tag){case 0:case 11:case 15:EU(9,p)}}catch(G){ra(p,p.return,G)}if(p===u){An=null;break e}var V=p.sibling;if(V!==null){V.return=p.return,An=V;break e}An=p.return}}if(wr=l,ry(),Hp&&typeof Hp.onPostCommitFiberRoot=="function")try{Hp.onPostCommitFiberRoot(hU,n)}catch{}s=!0}return s}finally{Hr=i,dh.transition=t}}return!1}function jue(n,t,i){t=QR(i,t),t=l0e(n,t,1),n=Vv(n,t,1),t=uc(),n!==null&&(dP(n,1,t),ad(n,t))}function ra(n,t,i){if(n.tag===3)jue(n,n,i);else for(;t!==null;){if(t.tag===3){jue(t,n,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(zv===null||!zv.has(s))){n=QR(i,n),n=c0e(t,n,1),t=Vv(t,n,1),n=uc(),t!==null&&(dP(t,1,n),ad(t,n));break}}t=t.return}}function iPe(n,t,i){var s=n.pingCache;s!==null&&s.delete(t),t=uc(),n.pingedLanes|=n.suspendedLanes&i,xo===n&&(Qo&i)===i&&(Ja===4||Ja===3&&(Qo&130023424)===Qo&&500>ya()-lQ?O2(n,0):oQ|=i),ad(n,t)}function I0e(n,t){t===0&&(n.mode&1?(t=L8,L8<<=1,!(L8&130023424)&&(L8=4194304)):t=1);var i=uc();n=$g(n,t),n!==null&&(dP(n,t,i),ad(n,i))}function rPe(n){var t=n.memoizedState,i=0;t!==null&&(i=t.retryLane),I0e(n,i)}function sPe(n,t){var i=0;switch(n.tag){case 13:var s=n.stateNode,l=n.memoizedState;l!==null&&(i=l.retryLane);break;case 19:s=n.stateNode;break;default:throw Error(on(314))}s!==null&&s.delete(t),I0e(n,i)}var N0e;N0e=function(n,t,i){if(n!==null)if(n.memoizedProps!==t.pendingProps||rd.current)id=!0;else{if(!(n.lanes&i)&&!(t.flags&128))return id=!1,$Oe(n,t,i);id=!!(n.flags&131072)}else id=!1,Ms&&t.flags&1048576&&Lge(t,S7,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;gM(n,t),n=t.pendingProps;var l=qR(t,Tl.current);VC(t,i),l=tQ(null,t,s,n,l,i);var d=nQ();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,sd(s)?(d=!0,E7(t)):d=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,XJ(t),l.updater=yU,t.stateNode=l,l._reactInternals=t,Oq(t,s,n,i),t=Dq(null,t,s,!0,d,i)):(t.tag=0,Ms&&d&&HJ(t),oc(null,t,l,i),t=t.child),t;case 16:s=t.elementType;e:{switch(gM(n,t),n=t.pendingProps,l=s._init,s=l(s._payload),t.type=s,l=t.tag=oPe(s),n=Yh(s,n),l){case 0:t=Lq(null,t,s,n,i);break e;case 1:t=xue(null,t,s,n,i);break e;case 11:t=Tue(null,t,s,n,i);break e;case 14:t=Rue(null,t,s,Yh(s.type,n),i);break e}throw Error(on(306,s,""))}return t;case 0:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Yh(s,l),Lq(n,t,s,l,i);case 1:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Yh(s,l),xue(n,t,s,l,i);case 3:e:{if(f0e(t),n===null)throw Error(on(387));s=t.pendingProps,d=t.memoizedState,l=d.element,jge(n,t),T7(t,s,null,i);var u=t.memoizedState;if(s=u.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){l=QR(Error(on(423)),t),t=Aue(n,t,s,i,l);break e}else if(s!==l){l=QR(Error(on(424)),t),t=Aue(n,t,s,i,l);break e}else for(Xd=Bv(t.stateNode.containerInfo.firstChild),eu=t,Ms=!0,hf=null,i=Vge(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(YR(),s===l){t=Kg(n,t,i);break e}oc(n,t,s,i)}t=t.child}return t;case 5:return zge(t),n===null&&Aq(t),s=t.type,l=t.pendingProps,d=n!==null?n.memoizedProps:null,u=l.children,bq(s,l)?u=null:d!==null&&bq(s,d)&&(t.flags|=32),h0e(n,t),oc(n,t,u,i),t.child;case 6:return n===null&&Aq(t),null;case 13:return p0e(n,t,i);case 4:return JJ(t,t.stateNode.containerInfo),s=t.pendingProps,n===null?t.child=XR(t,null,s,i):oc(n,t,s,i),t.child;case 11:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Yh(s,l),Tue(n,t,s,l,i);case 7:return oc(n,t,t.pendingProps,i),t.child;case 8:return oc(n,t,t.pendingProps.children,i),t.child;case 12:return oc(n,t,t.pendingProps.children,i),t.child;case 10:e:{if(s=t.type._context,l=t.pendingProps,d=t.memoizedProps,u=l.value,hs(b7,s._currentValue),s._currentValue=u,d!==null)if(_f(d.value,u)){if(d.children===l.children&&!rd.current){t=Kg(n,t,i);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var p=d.dependencies;if(p!==null){u=d.child;for(var m=p.firstContext;m!==null;){if(m.context===s){if(d.tag===1){m=zg(-1,i&-i),m.tag=2;var y=d.updateQueue;if(y!==null){y=y.shared;var _=y.pending;_===null?m.next=m:(m.next=_.next,_.next=m),y.pending=m}}d.lanes|=i,m=d.alternate,m!==null&&(m.lanes|=i),Iq(d.return,i,t),p.lanes|=i;break}m=m.next}}else if(d.tag===10)u=d.type===t.type?null:d.child;else if(d.tag===18){if(u=d.return,u===null)throw Error(on(341));u.lanes|=i,p=u.alternate,p!==null&&(p.lanes|=i),Iq(u,i,t),u=d.sibling}else u=d.child;if(u!==null)u.return=d;else for(u=d;u!==null;){if(u===t){u=null;break}if(d=u.sibling,d!==null){d.return=u.return,u=d;break}u=u.return}d=u}oc(n,t,l.children,i),t=t.child}return t;case 9:return l=t.type,s=t.pendingProps.children,VC(t,i),l=uh(l),s=s(l),t.flags|=1,oc(n,t,s,i),t.child;case 14:return s=t.type,l=Yh(s,t.pendingProps),l=Yh(s.type,l),Rue(n,t,s,l,i);case 15:return d0e(n,t,t.type,t.pendingProps,i);case 17:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Yh(s,l),gM(n,t),t.tag=1,sd(s)?(n=!0,E7(t)):n=!1,VC(t,i),Fge(t,s,l),Oq(t,s,l,i),Dq(null,t,s,!0,n,i);case 19:return m0e(n,t,i);case 22:return u0e(n,t,i)}throw Error(on(156,t.tag))};function O0e(n,t){return ige(n,t)}function aPe(n,t,i,s){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ch(n,t,i,s){return new aPe(n,t,i,s)}function hQ(n){return n=n.prototype,!(!n||!n.isReactComponent)}function oPe(n){if(typeof n=="function")return hQ(n)?1:0;if(n!=null){if(n=n.$$typeof,n===OJ)return 11;if(n===PJ)return 14}return 2}function Gv(n,t){var i=n.alternate;return i===null?(i=ch(n.tag,t,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=t,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&14680064,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,t=n.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i}function _M(n,t,i,s,l,d){var u=2;if(s=n,typeof n=="function")hQ(n)&&(u=1);else if(typeof n=="string")u=5;else e:switch(n){case EC:return P2(i.children,l,d,t);case NJ:u=8,l|=8;break;case tq:return n=ch(12,i,t,l|2),n.elementType=tq,n.lanes=d,n;case nq:return n=ch(13,i,t,l),n.elementType=nq,n.lanes=d,n;case iq:return n=ch(19,i,t,l),n.elementType=iq,n.lanes=d,n;case Bme:return SU(i,l,d,t);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Ume:u=10;break e;case Fme:u=9;break e;case OJ:u=11;break e;case PJ:u=14;break e;case y1:u=16,s=null;break e}throw Error(on(130,n==null?n:typeof n,""))}return t=ch(u,i,t,l),t.elementType=n,t.type=s,t.lanes=d,t}function P2(n,t,i,s){return n=ch(7,n,s,t),n.lanes=i,n}function SU(n,t,i,s){return n=ch(22,n,s,t),n.elementType=Bme,n.lanes=i,n.stateNode={isHidden:!1},n}function Z$(n,t,i){return n=ch(6,n,null,t),n.lanes=i,n}function eK(n,t,i){return t=ch(4,n.children!==null?n.children:[],n.key,t),t.lanes=i,t.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},t}function lPe(n,t,i,s,l){this.tag=t,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=D$(0),this.expirationTimes=D$(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D$(0),this.identifierPrefix=s,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function fQ(n,t,i,s,l,d,u,p,m){return n=new lPe(n,t,i,p,m),t===1?(t=1,d===!0&&(t|=8)):t=0,d=ch(3,null,null,t),n.current=d,d.stateNode=n,d.memoizedState={element:s,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},XJ(d),n}function cPe(n,t,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_C,key:s==null?null:""+s,children:n,containerInfo:t,implementation:i}}function P0e(n){if(!n)return Xv;n=n._reactInternals;e:{if(nw(n)!==n||n.tag!==1)throw Error(on(170));var t=n;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(sd(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(on(171))}if(n.tag===1){var i=n.type;if(sd(i))return Oge(n,i,t)}return t}function L0e(n,t,i,s,l,d,u,p,m){return n=fQ(i,s,!0,n,l,d,u,p,m),n.context=P0e(null),i=n.current,s=uc(),l=Hv(i),d=zg(s,l),d.callback=t??null,Vv(i,d,l),n.current.lanes=l,dP(n,l,s),ad(n,s),n}function bU(n,t,i,s){var l=t.current,d=uc(),u=Hv(l);return i=P0e(i),t.context===null?t.context=i:t.pendingContext=i,t=zg(d,u),t.payload={element:n},s=s===void 0?null:s,s!==null&&(t.callback=s),n=Vv(l,t,u),n!==null&&(gf(n,l,u,d),fM(n,l,u)),u}function L7(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function Uue(n,t){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<t?i:t}}function pQ(n,t){Uue(n,t),(n=n.alternate)&&Uue(n,t)}function dPe(){return null}var D0e=typeof reportError=="function"?reportError:function(n){console.error(n)};function mQ(n){this._internalRoot=n}CU.prototype.render=mQ.prototype.render=function(n){var t=this._internalRoot;if(t===null)throw Error(on(409));bU(n,t,null,null)};CU.prototype.unmount=mQ.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var t=n.containerInfo;H2(function(){bU(null,n,null,null)}),t[Wg]=null}};function CU(n){this._internalRoot=n}CU.prototype.unstable_scheduleHydration=function(n){if(n){var t=dge();n={blockedOn:null,target:n,priority:t};for(var i=0;i<S1.length&&t!==0&&t<S1[i].priority;i++);S1.splice(i,0,n),i===0&&hge(n)}};function gQ(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function TU(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function Fue(){}function uPe(n,t,i,s,l){if(l){if(typeof s=="function"){var d=s;s=function(){var y=L7(u);d.call(y)}}var u=L0e(t,s,n,0,null,!1,!1,"",Fue);return n._reactRootContainer=u,n[Wg]=u.current,Z4(n.nodeType===8?n.parentNode:n),H2(),u}for(;l=n.lastChild;)n.removeChild(l);if(typeof s=="function"){var p=s;s=function(){var y=L7(m);p.call(y)}}var m=fQ(n,0,!1,null,null,!1,!1,"",Fue);return n._reactRootContainer=m,n[Wg]=m.current,Z4(n.nodeType===8?n.parentNode:n),H2(function(){bU(t,m,i,s)}),m}function RU(n,t,i,s,l){var d=i._reactRootContainer;if(d){var u=d;if(typeof l=="function"){var p=l;l=function(){var m=L7(u);p.call(m)}}bU(t,u,n,l)}else u=uPe(i,t,n,l,s);return L7(u)}lge=function(n){switch(n.tag){case 3:var t=n.stateNode;if(t.current.memoizedState.isDehydrated){var i=X3(t.pendingLanes);i!==0&&(kJ(t,i|1),ad(t,ya()),!(wr&6)&&(ZR=ya()+500,ry()))}break;case 13:H2(function(){var s=$g(n,1);if(s!==null){var l=uc();gf(s,n,1,l)}}),pQ(n,1)}};MJ=function(n){if(n.tag===13){var t=$g(n,134217728);if(t!==null){var i=uc();gf(t,n,134217728,i)}pQ(n,134217728)}};cge=function(n){if(n.tag===13){var t=Hv(n),i=$g(n,t);if(i!==null){var s=uc();gf(i,n,t,s)}pQ(n,t)}};dge=function(){return Hr};uge=function(n,t){var i=Hr;try{return Hr=n,t()}finally{Hr=i}};fq=function(n,t,i){switch(t){case"input":if(aq(n,i),t=i.name,i.type==="radio"&&t!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==n&&s.form===n.form){var l=gU(s);if(!l)throw Error(on(90));zme(s),aq(s,l)}}}break;case"textarea":Gme(n,i);break;case"select":t=i.value,t!=null&&jC(n,!!i.multiple,t,!1)}};Jme=cQ;Qme=H2;var hPe={usingClientEntryPoint:!1,Events:[hP,CC,gU,Yme,Xme,cQ]},M3={findFiberByHostInstance:Y_,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},fPe={bundleType:M3.bundleType,version:M3.version,rendererPackageName:M3.rendererPackageName,rendererConfig:M3.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Yg.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=tge(n),n===null?null:n.stateNode},findFiberByHostInstance:M3.findFiberByHostInstance||dPe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var G8=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!G8.isDisabled&&G8.supportsFiber)try{hU=G8.inject(fPe),Hp=G8}catch{}}su.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hPe;su.createPortal=function(n,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gQ(t))throw Error(on(200));return cPe(n,t,null,i)};su.createRoot=function(n,t){if(!gQ(n))throw Error(on(299));var i=!1,s="",l=D0e;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=fQ(n,1,!1,null,null,i,!1,s,l),n[Wg]=t.current,Z4(n.nodeType===8?n.parentNode:n),new mQ(t)};su.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var t=n._reactInternals;if(t===void 0)throw typeof n.render=="function"?Error(on(188)):(n=Object.keys(n).join(","),Error(on(268,n)));return n=tge(t),n=n===null?null:n.stateNode,n};su.flushSync=function(n){return H2(n)};su.hydrate=function(n,t,i){if(!TU(t))throw Error(on(200));return RU(null,n,t,!0,i)};su.hydrateRoot=function(n,t,i){if(!gQ(n))throw Error(on(405));var s=i!=null&&i.hydratedSources||null,l=!1,d="",u=D0e;if(i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(u=i.onRecoverableError)),t=L0e(t,null,n,1,i??null,l,!1,d,u),n[Wg]=t.current,Z4(n),s)for(n=0;n<s.length;n++)i=s[n],l=i._getVersion,l=l(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,l]:t.mutableSourceEagerHydrationData.push(i,l);return new CU(t)};su.render=function(n,t,i){if(!TU(t))throw Error(on(200));return RU(null,n,t,!1,i)};su.unmountComponentAtNode=function(n){if(!TU(n))throw Error(on(40));return n._reactRootContainer?(H2(function(){RU(null,null,n,!1,function(){n._reactRootContainer=null,n[Wg]=null})}),!0):!1};su.unstable_batchedUpdates=cQ;su.unstable_renderSubtreeIntoContainer=function(n,t,i,s){if(!TU(i))throw Error(on(200));if(n==null||n._reactInternals===void 0)throw Error(on(38));return RU(n,t,i,!1,s)};su.version="18.2.0-next-9e3b772b8-20220608";function k0e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k0e)}catch(n){console.error(n)}}k0e(),Lme.exports=su;var vQ=Lme.exports;const OC=ty(vQ);var Bue=vQ;ZK.createRoot=Bue.createRoot,ZK.hydrateRoot=Bue.hydrateRoot;const Xo=globalThis||void 0||self;function pPe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var M0e={exports:{}},wa=M0e.exports={},up,hp;function $q(){throw new Error("setTimeout has not been defined")}function Kq(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?up=setTimeout:up=$q}catch{up=$q}try{typeof clearTimeout=="function"?hp=clearTimeout:hp=Kq}catch{hp=Kq}})();function j0e(n){if(up===setTimeout)return setTimeout(n,0);if((up===$q||!up)&&setTimeout)return up=setTimeout,setTimeout(n,0);try{return up(n,0)}catch{try{return up.call(null,n,0)}catch{return up.call(this,n,0)}}}function mPe(n){if(hp===clearTimeout)return clearTimeout(n);if((hp===Kq||!hp)&&clearTimeout)return hp=clearTimeout,clearTimeout(n);try{return hp(n)}catch{try{return hp.call(null,n)}catch{return hp.call(this,n)}}}var Vg=[],HC=!1,Q_,EM=-1;function gPe(){!HC||!Q_||(HC=!1,Q_.length?Vg=Q_.concat(Vg):EM=-1,Vg.length&&U0e())}function U0e(){if(!HC){var n=j0e(gPe);HC=!0;for(var t=Vg.length;t;){for(Q_=Vg,Vg=[];++EM<t;)Q_&&Q_[EM].run();EM=-1,t=Vg.length}Q_=null,HC=!1,mPe(n)}}wa.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];Vg.push(new F0e(n,t)),Vg.length===1&&!HC&&j0e(U0e)};function F0e(n,t){this.fun=n,this.array=t}F0e.prototype.run=function(){this.fun.apply(null,this.array)};wa.title="browser";wa.browser=!0;wa.env={};wa.argv=[];wa.version="";wa.versions={};function Xg(){}wa.on=Xg;wa.addListener=Xg;wa.once=Xg;wa.off=Xg;wa.removeListener=Xg;wa.removeAllListeners=Xg;wa.emit=Xg;wa.prependListener=Xg;wa.prependOnceListener=Xg;wa.listeners=function(n){return[]};wa.binding=function(n){throw new Error("process.binding is not supported")};wa.cwd=function(){return"/"};wa.chdir=function(n){throw new Error("process.chdir is not supported")};wa.umask=function(){return 0};var vPe=M0e.exports;const lc=pPe(vPe);var yQ={},xU={};xU.byteLength=EPe;xU.toByteArray=SPe;xU.fromByteArray=TPe;var Bp=[],$u=[],yPe=typeof Uint8Array<"u"?Uint8Array:Array,tK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Kb=0,_Pe=tK.length;Kb<_Pe;++Kb)Bp[Kb]=tK[Kb],$u[tK.charCodeAt(Kb)]=Kb;$u[45]=62;$u[95]=63;function B0e(n){var t=n.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=n.indexOf("=");i===-1&&(i=t);var s=i===t?0:4-i%4;return[i,s]}function EPe(n){var t=B0e(n),i=t[0],s=t[1];return(i+s)*3/4-s}function wPe(n,t,i){return(t+i)*3/4-i}function SPe(n){var t,i=B0e(n),s=i[0],l=i[1],d=new yPe(wPe(n,s,l)),u=0,p=l>0?s-4:s,m;for(m=0;m<p;m+=4)t=$u[n.charCodeAt(m)]<<18|$u[n.charCodeAt(m+1)]<<12|$u[n.charCodeAt(m+2)]<<6|$u[n.charCodeAt(m+3)],d[u++]=t>>16&255,d[u++]=t>>8&255,d[u++]=t&255;return l===2&&(t=$u[n.charCodeAt(m)]<<2|$u[n.charCodeAt(m+1)]>>4,d[u++]=t&255),l===1&&(t=$u[n.charCodeAt(m)]<<10|$u[n.charCodeAt(m+1)]<<4|$u[n.charCodeAt(m+2)]>>2,d[u++]=t>>8&255,d[u++]=t&255),d}function bPe(n){return Bp[n>>18&63]+Bp[n>>12&63]+Bp[n>>6&63]+Bp[n&63]}function CPe(n,t,i){for(var s,l=[],d=t;d<i;d+=3)s=(n[d]<<16&16711680)+(n[d+1]<<8&65280)+(n[d+2]&255),l.push(bPe(s));return l.join("")}function TPe(n){for(var t,i=n.length,s=i%3,l=[],d=16383,u=0,p=i-s;u<p;u+=d)l.push(CPe(n,u,u+d>p?p:u+d));return s===1?(t=n[i-1],l.push(Bp[t>>2]+Bp[t<<4&63]+"==")):s===2&&(t=(n[i-2]<<8)+n[i-1],l.push(Bp[t>>10]+Bp[t>>4&63]+Bp[t<<2&63]+"=")),l.join("")}var _Q={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */_Q.read=function(n,t,i,s,l){var d,u,p=l*8-s-1,m=(1<<p)-1,y=m>>1,_=-7,E=i?l-1:0,C=i?-1:1,x=n[t+E];for(E+=C,d=x&(1<<-_)-1,x>>=-_,_+=p;_>0;d=d*256+n[t+E],E+=C,_-=8);for(u=d&(1<<-_)-1,d>>=-_,_+=s;_>0;u=u*256+n[t+E],E+=C,_-=8);if(d===0)d=1-y;else{if(d===m)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,s),d=d-y}return(x?-1:1)*u*Math.pow(2,d-s)};_Q.write=function(n,t,i,s,l,d){var u,p,m,y=d*8-l-1,_=(1<<y)-1,E=_>>1,C=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=s?0:d-1,N=s?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(p=isNaN(t)?1:0,u=_):(u=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-u))<1&&(u--,m*=2),u+E>=1?t+=C/m:t+=C*Math.pow(2,1-E),t*m>=2&&(u++,m/=2),u+E>=_?(p=0,u=_):u+E>=1?(p=(t*m-1)*Math.pow(2,l),u=u+E):(p=t*Math.pow(2,E-1)*Math.pow(2,l),u=0));l>=8;n[i+x]=p&255,x+=N,p/=256,l-=8);for(u=u<<l|p,y+=l;y>0;n[i+x]=u&255,x+=N,u/=256,y-=8);n[i+x-N]|=O*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(n){const t=xU,i=_Q,s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=_,n.SlowBuffer=G,n.INSPECT_MAX_BYTES=50;const l=2147483647;n.kMaxLength=l;const{Uint8Array:d,ArrayBuffer:u,SharedArrayBuffer:p}=globalThis;_.TYPED_ARRAY_SUPPORT=m(),!_.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function m(){try{const ye=new d(1),Q={foo:function(){return 42}};return Object.setPrototypeOf(Q,d.prototype),Object.setPrototypeOf(ye,Q),ye.foo()===42}catch{return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.buffer}}),Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.byteOffset}});function y(ye){if(ye>l)throw new RangeError('The value "'+ye+'" is invalid for option "size"');const Q=new d(ye);return Object.setPrototypeOf(Q,_.prototype),Q}function _(ye,Q,ie){if(typeof ye=="number"){if(typeof Q=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return N(ye)}return E(ye,Q,ie)}_.poolSize=8192;function E(ye,Q,ie){if(typeof ye=="string")return O(ye,Q);if(u.isView(ye))return P(ye);if(ye==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ye);if(wt(ye,u)||ye&&wt(ye.buffer,u)||typeof p<"u"&&(wt(ye,p)||ye&&wt(ye.buffer,p)))return j(ye,Q,ie);if(typeof ye=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Se=ye.valueOf&&ye.valueOf();if(Se!=null&&Se!==ye)return _.from(Se,Q,ie);const je=M(ye);if(je)return je;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ye[Symbol.toPrimitive]=="function")return _.from(ye[Symbol.toPrimitive]("string"),Q,ie);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ye)}_.from=function(ye,Q,ie){return E(ye,Q,ie)},Object.setPrototypeOf(_.prototype,d.prototype),Object.setPrototypeOf(_,d);function C(ye){if(typeof ye!="number")throw new TypeError('"size" argument must be of type number');if(ye<0)throw new RangeError('The value "'+ye+'" is invalid for option "size"')}function x(ye,Q,ie){return C(ye),ye<=0?y(ye):Q!==void 0?typeof ie=="string"?y(ye).fill(Q,ie):y(ye).fill(Q):y(ye)}_.alloc=function(ye,Q,ie){return x(ye,Q,ie)};function N(ye){return C(ye),y(ye<0?0:V(ye)|0)}_.allocUnsafe=function(ye){return N(ye)},_.allocUnsafeSlow=function(ye){return N(ye)};function O(ye,Q){if((typeof Q!="string"||Q==="")&&(Q="utf8"),!_.isEncoding(Q))throw new TypeError("Unknown encoding: "+Q);const ie=$(ye,Q)|0;let Se=y(ie);const je=Se.write(ye,Q);return je!==ie&&(Se=Se.slice(0,je)),Se}function D(ye){const Q=ye.length<0?0:V(ye.length)|0,ie=y(Q);for(let Se=0;Se<Q;Se+=1)ie[Se]=ye[Se]&255;return ie}function P(ye){if(wt(ye,d)){const Q=new d(ye);return j(Q.buffer,Q.byteOffset,Q.byteLength)}return D(ye)}function j(ye,Q,ie){if(Q<0||ye.byteLength<Q)throw new RangeError('"offset" is outside of buffer bounds');if(ye.byteLength<Q+(ie||0))throw new RangeError('"length" is outside of buffer bounds');let Se;return Q===void 0&&ie===void 0?Se=new d(ye):ie===void 0?Se=new d(ye,Q):Se=new d(ye,Q,ie),Object.setPrototypeOf(Se,_.prototype),Se}function M(ye){if(_.isBuffer(ye)){const Q=V(ye.length)|0,ie=y(Q);return ie.length===0||ye.copy(ie,0,0,Q),ie}if(ye.length!==void 0)return typeof ye.length!="number"||Pt(ye.length)?y(0):D(ye);if(ye.type==="Buffer"&&Array.isArray(ye.data))return D(ye.data)}function V(ye){if(ye>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return ye|0}function G(ye){return+ye!=ye&&(ye=0),_.alloc(+ye)}_.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==_.prototype},_.compare=function(Q,ie){if(wt(Q,d)&&(Q=_.from(Q,Q.offset,Q.byteLength)),wt(ie,d)&&(ie=_.from(ie,ie.offset,ie.byteLength)),!_.isBuffer(Q)||!_.isBuffer(ie))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===ie)return 0;let Se=Q.length,je=ie.length;for(let tt=0,Te=Math.min(Se,je);tt<Te;++tt)if(Q[tt]!==ie[tt]){Se=Q[tt],je=ie[tt];break}return Se<je?-1:je<Se?1:0},_.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},_.concat=function(Q,ie){if(!Array.isArray(Q))throw new TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return _.alloc(0);let Se;if(ie===void 0)for(ie=0,Se=0;Se<Q.length;++Se)ie+=Q[Se].length;const je=_.allocUnsafe(ie);let tt=0;for(Se=0;Se<Q.length;++Se){let Te=Q[Se];if(wt(Te,d))tt+Te.length>je.length?(_.isBuffer(Te)||(Te=_.from(Te)),Te.copy(je,tt)):d.prototype.set.call(je,Te,tt);else if(_.isBuffer(Te))Te.copy(je,tt);else throw new TypeError('"list" argument must be an Array of Buffers');tt+=Te.length}return je};function $(ye,Q){if(_.isBuffer(ye))return ye.length;if(u.isView(ye)||wt(ye,u))return ye.byteLength;if(typeof ye!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ye);const ie=ye.length,Se=arguments.length>2&&arguments[2]===!0;if(!Se&&ie===0)return 0;let je=!1;for(;;)switch(Q){case"ascii":case"latin1":case"binary":return ie;case"utf8":case"utf-8":return dt(ye).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie*2;case"hex":return ie>>>1;case"base64":return Ge(ye).length;default:if(je)return Se?-1:dt(ye).length;Q=(""+Q).toLowerCase(),je=!0}}_.byteLength=$;function ne(ye,Q,ie){let Se=!1;if((Q===void 0||Q<0)&&(Q=0),Q>this.length||((ie===void 0||ie>this.length)&&(ie=this.length),ie<=0)||(ie>>>=0,Q>>>=0,ie<=Q))return"";for(ye||(ye="utf8");;)switch(ye){case"hex":return Ue(this,Q,ie);case"utf8":case"utf-8":return Ce(this,Q,ie);case"ascii":return Oe(this,Q,ie);case"latin1":case"binary":return Fe(this,Q,ie);case"base64":return me(this,Q,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ve(this,Q,ie);default:if(Se)throw new TypeError("Unknown encoding: "+ye);ye=(ye+"").toLowerCase(),Se=!0}}_.prototype._isBuffer=!0;function Y(ye,Q,ie){const Se=ye[Q];ye[Q]=ye[ie],ye[ie]=Se}_.prototype.swap16=function(){const Q=this.length;if(Q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ie=0;ie<Q;ie+=2)Y(this,ie,ie+1);return this},_.prototype.swap32=function(){const Q=this.length;if(Q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ie=0;ie<Q;ie+=4)Y(this,ie,ie+3),Y(this,ie+1,ie+2);return this},_.prototype.swap64=function(){const Q=this.length;if(Q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ie=0;ie<Q;ie+=8)Y(this,ie,ie+7),Y(this,ie+1,ie+6),Y(this,ie+2,ie+5),Y(this,ie+3,ie+4);return this},_.prototype.toString=function(){const Q=this.length;return Q===0?"":arguments.length===0?Ce(this,0,Q):ne.apply(this,arguments)},_.prototype.toLocaleString=_.prototype.toString,_.prototype.equals=function(Q){if(!_.isBuffer(Q))throw new TypeError("Argument must be a Buffer");return this===Q?!0:_.compare(this,Q)===0},_.prototype.inspect=function(){let Q="";const ie=n.INSPECT_MAX_BYTES;return Q=this.toString("hex",0,ie).replace(/(.{2})/g,"$1 ").trim(),this.length>ie&&(Q+=" ... "),"<Buffer "+Q+">"},s&&(_.prototype[s]=_.prototype.inspect),_.prototype.compare=function(Q,ie,Se,je,tt){if(wt(Q,d)&&(Q=_.from(Q,Q.offset,Q.byteLength)),!_.isBuffer(Q))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if(ie===void 0&&(ie=0),Se===void 0&&(Se=Q?Q.length:0),je===void 0&&(je=0),tt===void 0&&(tt=this.length),ie<0||Se>Q.length||je<0||tt>this.length)throw new RangeError("out of range index");if(je>=tt&&ie>=Se)return 0;if(je>=tt)return-1;if(ie>=Se)return 1;if(ie>>>=0,Se>>>=0,je>>>=0,tt>>>=0,this===Q)return 0;let Te=tt-je,Pe=Se-ie;const Ze=Math.min(Te,Pe),nt=this.slice(je,tt),$e=Q.slice(ie,Se);for(let rt=0;rt<Ze;++rt)if(nt[rt]!==$e[rt]){Te=nt[rt],Pe=$e[rt];break}return Te<Pe?-1:Pe<Te?1:0};function le(ye,Q,ie,Se,je){if(ye.length===0)return-1;if(typeof ie=="string"?(Se=ie,ie=0):ie>2147483647?ie=2147483647:ie<-2147483648&&(ie=-2147483648),ie=+ie,Pt(ie)&&(ie=je?0:ye.length-1),ie<0&&(ie=ye.length+ie),ie>=ye.length){if(je)return-1;ie=ye.length-1}else if(ie<0)if(je)ie=0;else return-1;if(typeof Q=="string"&&(Q=_.from(Q,Se)),_.isBuffer(Q))return Q.length===0?-1:re(ye,Q,ie,Se,je);if(typeof Q=="number")return Q=Q&255,typeof d.prototype.indexOf=="function"?je?d.prototype.indexOf.call(ye,Q,ie):d.prototype.lastIndexOf.call(ye,Q,ie):re(ye,[Q],ie,Se,je);throw new TypeError("val must be string, number or Buffer")}function re(ye,Q,ie,Se,je){let tt=1,Te=ye.length,Pe=Q.length;if(Se!==void 0&&(Se=String(Se).toLowerCase(),Se==="ucs2"||Se==="ucs-2"||Se==="utf16le"||Se==="utf-16le")){if(ye.length<2||Q.length<2)return-1;tt=2,Te/=2,Pe/=2,ie/=2}function Ze($e,rt){return tt===1?$e[rt]:$e.readUInt16BE(rt*tt)}let nt;if(je){let $e=-1;for(nt=ie;nt<Te;nt++)if(Ze(ye,nt)===Ze(Q,$e===-1?0:nt-$e)){if($e===-1&&($e=nt),nt-$e+1===Pe)return $e*tt}else $e!==-1&&(nt-=nt-$e),$e=-1}else for(ie+Pe>Te&&(ie=Te-Pe),nt=ie;nt>=0;nt--){let $e=!0;for(let rt=0;rt<Pe;rt++)if(Ze(ye,nt+rt)!==Ze(Q,rt)){$e=!1;break}if($e)return nt}return-1}_.prototype.includes=function(Q,ie,Se){return this.indexOf(Q,ie,Se)!==-1},_.prototype.indexOf=function(Q,ie,Se){return le(this,Q,ie,Se,!0)},_.prototype.lastIndexOf=function(Q,ie,Se){return le(this,Q,ie,Se,!1)};function ee(ye,Q,ie,Se){ie=Number(ie)||0;const je=ye.length-ie;Se?(Se=Number(Se),Se>je&&(Se=je)):Se=je;const tt=Q.length;Se>tt/2&&(Se=tt/2);let Te;for(Te=0;Te<Se;++Te){const Pe=parseInt(Q.substr(Te*2,2),16);if(Pt(Pe))return Te;ye[ie+Te]=Pe}return Te}function de(ye,Q,ie,Se){return bt(dt(Q,ye.length-ie),ye,ie,Se)}function H(ye,Q,ie,Se){return bt(it(Q),ye,ie,Se)}function ae(ye,Q,ie,Se){return bt(Ge(Q),ye,ie,Se)}function _e(ye,Q,ie,Se){return bt(Me(Q,ye.length-ie),ye,ie,Se)}_.prototype.write=function(Q,ie,Se,je){if(ie===void 0)je="utf8",Se=this.length,ie=0;else if(Se===void 0&&typeof ie=="string")je=ie,Se=this.length,ie=0;else if(isFinite(ie))ie=ie>>>0,isFinite(Se)?(Se=Se>>>0,je===void 0&&(je="utf8")):(je=Se,Se=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const tt=this.length-ie;if((Se===void 0||Se>tt)&&(Se=tt),Q.length>0&&(Se<0||ie<0)||ie>this.length)throw new RangeError("Attempt to write outside buffer bounds");je||(je="utf8");let Te=!1;for(;;)switch(je){case"hex":return ee(this,Q,ie,Se);case"utf8":case"utf-8":return de(this,Q,ie,Se);case"ascii":case"latin1":case"binary":return H(this,Q,ie,Se);case"base64":return ae(this,Q,ie,Se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,Q,ie,Se);default:if(Te)throw new TypeError("Unknown encoding: "+je);je=(""+je).toLowerCase(),Te=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(ye,Q,ie){return Q===0&&ie===ye.length?t.fromByteArray(ye):t.fromByteArray(ye.slice(Q,ie))}function Ce(ye,Q,ie){ie=Math.min(ye.length,ie);const Se=[];let je=Q;for(;je<ie;){const tt=ye[je];let Te=null,Pe=tt>239?4:tt>223?3:tt>191?2:1;if(je+Pe<=ie){let Ze,nt,$e,rt;switch(Pe){case 1:tt<128&&(Te=tt);break;case 2:Ze=ye[je+1],(Ze&192)===128&&(rt=(tt&31)<<6|Ze&63,rt>127&&(Te=rt));break;case 3:Ze=ye[je+1],nt=ye[je+2],(Ze&192)===128&&(nt&192)===128&&(rt=(tt&15)<<12|(Ze&63)<<6|nt&63,rt>2047&&(rt<55296||rt>57343)&&(Te=rt));break;case 4:Ze=ye[je+1],nt=ye[je+2],$e=ye[je+3],(Ze&192)===128&&(nt&192)===128&&($e&192)===128&&(rt=(tt&15)<<18|(Ze&63)<<12|(nt&63)<<6|$e&63,rt>65535&&rt<1114112&&(Te=rt))}}Te===null?(Te=65533,Pe=1):Te>65535&&(Te-=65536,Se.push(Te>>>10&1023|55296),Te=56320|Te&1023),Se.push(Te),je+=Pe}return pe(Se)}const he=4096;function pe(ye){const Q=ye.length;if(Q<=he)return String.fromCharCode.apply(String,ye);let ie="",Se=0;for(;Se<Q;)ie+=String.fromCharCode.apply(String,ye.slice(Se,Se+=he));return ie}function Oe(ye,Q,ie){let Se="";ie=Math.min(ye.length,ie);for(let je=Q;je<ie;++je)Se+=String.fromCharCode(ye[je]&127);return Se}function Fe(ye,Q,ie){let Se="";ie=Math.min(ye.length,ie);for(let je=Q;je<ie;++je)Se+=String.fromCharCode(ye[je]);return Se}function Ue(ye,Q,ie){const Se=ye.length;(!Q||Q<0)&&(Q=0),(!ie||ie<0||ie>Se)&&(ie=Se);let je="";for(let tt=Q;tt<ie;++tt)je+=en[ye[tt]];return je}function Ve(ye,Q,ie){const Se=ye.slice(Q,ie);let je="";for(let tt=0;tt<Se.length-1;tt+=2)je+=String.fromCharCode(Se[tt]+Se[tt+1]*256);return je}_.prototype.slice=function(Q,ie){const Se=this.length;Q=~~Q,ie=ie===void 0?Se:~~ie,Q<0?(Q+=Se,Q<0&&(Q=0)):Q>Se&&(Q=Se),ie<0?(ie+=Se,ie<0&&(ie=0)):ie>Se&&(ie=Se),ie<Q&&(ie=Q);const je=this.subarray(Q,ie);return Object.setPrototypeOf(je,_.prototype),je};function Re(ye,Q,ie){if(ye%1!==0||ye<0)throw new RangeError("offset is not uint");if(ye+Q>ie)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(Q,ie,Se){Q=Q>>>0,ie=ie>>>0,Se||Re(Q,ie,this.length);let je=this[Q],tt=1,Te=0;for(;++Te<ie&&(tt*=256);)je+=this[Q+Te]*tt;return je},_.prototype.readUintBE=_.prototype.readUIntBE=function(Q,ie,Se){Q=Q>>>0,ie=ie>>>0,Se||Re(Q,ie,this.length);let je=this[Q+--ie],tt=1;for(;ie>0&&(tt*=256);)je+=this[Q+--ie]*tt;return je},_.prototype.readUint8=_.prototype.readUInt8=function(Q,ie){return Q=Q>>>0,ie||Re(Q,1,this.length),this[Q]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,2,this.length),this[Q]|this[Q+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,2,this.length),this[Q]<<8|this[Q+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,4,this.length),(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,4,this.length),this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])},_.prototype.readBigUInt64LE=un(function(Q){Q=Q>>>0,gn(Q,"offset");const ie=this[Q],Se=this[Q+7];(ie===void 0||Se===void 0)&&It(Q,this.length-8);const je=ie+this[++Q]*2**8+this[++Q]*2**16+this[++Q]*2**24,tt=this[++Q]+this[++Q]*2**8+this[++Q]*2**16+Se*2**24;return BigInt(je)+(BigInt(tt)<<BigInt(32))}),_.prototype.readBigUInt64BE=un(function(Q){Q=Q>>>0,gn(Q,"offset");const ie=this[Q],Se=this[Q+7];(ie===void 0||Se===void 0)&&It(Q,this.length-8);const je=ie*2**24+this[++Q]*2**16+this[++Q]*2**8+this[++Q],tt=this[++Q]*2**24+this[++Q]*2**16+this[++Q]*2**8+Se;return(BigInt(je)<<BigInt(32))+BigInt(tt)}),_.prototype.readIntLE=function(Q,ie,Se){Q=Q>>>0,ie=ie>>>0,Se||Re(Q,ie,this.length);let je=this[Q],tt=1,Te=0;for(;++Te<ie&&(tt*=256);)je+=this[Q+Te]*tt;return tt*=128,je>=tt&&(je-=Math.pow(2,8*ie)),je},_.prototype.readIntBE=function(Q,ie,Se){Q=Q>>>0,ie=ie>>>0,Se||Re(Q,ie,this.length);let je=ie,tt=1,Te=this[Q+--je];for(;je>0&&(tt*=256);)Te+=this[Q+--je]*tt;return tt*=128,Te>=tt&&(Te-=Math.pow(2,8*ie)),Te},_.prototype.readInt8=function(Q,ie){return Q=Q>>>0,ie||Re(Q,1,this.length),this[Q]&128?(255-this[Q]+1)*-1:this[Q]},_.prototype.readInt16LE=function(Q,ie){Q=Q>>>0,ie||Re(Q,2,this.length);const Se=this[Q]|this[Q+1]<<8;return Se&32768?Se|4294901760:Se},_.prototype.readInt16BE=function(Q,ie){Q=Q>>>0,ie||Re(Q,2,this.length);const Se=this[Q+1]|this[Q]<<8;return Se&32768?Se|4294901760:Se},_.prototype.readInt32LE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,4,this.length),this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24},_.prototype.readInt32BE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,4,this.length),this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]},_.prototype.readBigInt64LE=un(function(Q){Q=Q>>>0,gn(Q,"offset");const ie=this[Q],Se=this[Q+7];(ie===void 0||Se===void 0)&&It(Q,this.length-8);const je=this[Q+4]+this[Q+5]*2**8+this[Q+6]*2**16+(Se<<24);return(BigInt(je)<<BigInt(32))+BigInt(ie+this[++Q]*2**8+this[++Q]*2**16+this[++Q]*2**24)}),_.prototype.readBigInt64BE=un(function(Q){Q=Q>>>0,gn(Q,"offset");const ie=this[Q],Se=this[Q+7];(ie===void 0||Se===void 0)&&It(Q,this.length-8);const je=(ie<<24)+this[++Q]*2**16+this[++Q]*2**8+this[++Q];return(BigInt(je)<<BigInt(32))+BigInt(this[++Q]*2**24+this[++Q]*2**16+this[++Q]*2**8+Se)}),_.prototype.readFloatLE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,4,this.length),i.read(this,Q,!0,23,4)},_.prototype.readFloatBE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,4,this.length),i.read(this,Q,!1,23,4)},_.prototype.readDoubleLE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,8,this.length),i.read(this,Q,!0,52,8)},_.prototype.readDoubleBE=function(Q,ie){return Q=Q>>>0,ie||Re(Q,8,this.length),i.read(this,Q,!1,52,8)};function Be(ye,Q,ie,Se,je,tt){if(!_.isBuffer(ye))throw new TypeError('"buffer" argument must be a Buffer instance');if(Q>je||Q<tt)throw new RangeError('"value" argument is out of bounds');if(ie+Se>ye.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(Q,ie,Se,je){if(Q=+Q,ie=ie>>>0,Se=Se>>>0,!je){const Pe=Math.pow(2,8*Se)-1;Be(this,Q,ie,Se,Pe,0)}let tt=1,Te=0;for(this[ie]=Q&255;++Te<Se&&(tt*=256);)this[ie+Te]=Q/tt&255;return ie+Se},_.prototype.writeUintBE=_.prototype.writeUIntBE=function(Q,ie,Se,je){if(Q=+Q,ie=ie>>>0,Se=Se>>>0,!je){const Pe=Math.pow(2,8*Se)-1;Be(this,Q,ie,Se,Pe,0)}let tt=Se-1,Te=1;for(this[ie+tt]=Q&255;--tt>=0&&(Te*=256);)this[ie+tt]=Q/Te&255;return ie+Se},_.prototype.writeUint8=_.prototype.writeUInt8=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,1,255,0),this[ie]=Q&255,ie+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,2,65535,0),this[ie]=Q&255,this[ie+1]=Q>>>8,ie+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,2,65535,0),this[ie]=Q>>>8,this[ie+1]=Q&255,ie+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,4,4294967295,0),this[ie+3]=Q>>>24,this[ie+2]=Q>>>16,this[ie+1]=Q>>>8,this[ie]=Q&255,ie+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,4,4294967295,0),this[ie]=Q>>>24,this[ie+1]=Q>>>16,this[ie+2]=Q>>>8,this[ie+3]=Q&255,ie+4};function Xe(ye,Q,ie,Se,je){Ht(Q,Se,je,ye,ie,7);let tt=Number(Q&BigInt(4294967295));ye[ie++]=tt,tt=tt>>8,ye[ie++]=tt,tt=tt>>8,ye[ie++]=tt,tt=tt>>8,ye[ie++]=tt;let Te=Number(Q>>BigInt(32)&BigInt(4294967295));return ye[ie++]=Te,Te=Te>>8,ye[ie++]=Te,Te=Te>>8,ye[ie++]=Te,Te=Te>>8,ye[ie++]=Te,ie}function we(ye,Q,ie,Se,je){Ht(Q,Se,je,ye,ie,7);let tt=Number(Q&BigInt(4294967295));ye[ie+7]=tt,tt=tt>>8,ye[ie+6]=tt,tt=tt>>8,ye[ie+5]=tt,tt=tt>>8,ye[ie+4]=tt;let Te=Number(Q>>BigInt(32)&BigInt(4294967295));return ye[ie+3]=Te,Te=Te>>8,ye[ie+2]=Te,Te=Te>>8,ye[ie+1]=Te,Te=Te>>8,ye[ie]=Te,ie+8}_.prototype.writeBigUInt64LE=un(function(Q,ie=0){return Xe(this,Q,ie,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeBigUInt64BE=un(function(Q,ie=0){return we(this,Q,ie,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeIntLE=function(Q,ie,Se,je){if(Q=+Q,ie=ie>>>0,!je){const Ze=Math.pow(2,8*Se-1);Be(this,Q,ie,Se,Ze-1,-Ze)}let tt=0,Te=1,Pe=0;for(this[ie]=Q&255;++tt<Se&&(Te*=256);)Q<0&&Pe===0&&this[ie+tt-1]!==0&&(Pe=1),this[ie+tt]=(Q/Te>>0)-Pe&255;return ie+Se},_.prototype.writeIntBE=function(Q,ie,Se,je){if(Q=+Q,ie=ie>>>0,!je){const Ze=Math.pow(2,8*Se-1);Be(this,Q,ie,Se,Ze-1,-Ze)}let tt=Se-1,Te=1,Pe=0;for(this[ie+tt]=Q&255;--tt>=0&&(Te*=256);)Q<0&&Pe===0&&this[ie+tt+1]!==0&&(Pe=1),this[ie+tt]=(Q/Te>>0)-Pe&255;return ie+Se},_.prototype.writeInt8=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,1,127,-128),Q<0&&(Q=255+Q+1),this[ie]=Q&255,ie+1},_.prototype.writeInt16LE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,2,32767,-32768),this[ie]=Q&255,this[ie+1]=Q>>>8,ie+2},_.prototype.writeInt16BE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,2,32767,-32768),this[ie]=Q>>>8,this[ie+1]=Q&255,ie+2},_.prototype.writeInt32LE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,4,2147483647,-2147483648),this[ie]=Q&255,this[ie+1]=Q>>>8,this[ie+2]=Q>>>16,this[ie+3]=Q>>>24,ie+4},_.prototype.writeInt32BE=function(Q,ie,Se){return Q=+Q,ie=ie>>>0,Se||Be(this,Q,ie,4,2147483647,-2147483648),Q<0&&(Q=4294967295+Q+1),this[ie]=Q>>>24,this[ie+1]=Q>>>16,this[ie+2]=Q>>>8,this[ie+3]=Q&255,ie+4},_.prototype.writeBigInt64LE=un(function(Q,ie=0){return Xe(this,Q,ie,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),_.prototype.writeBigInt64BE=un(function(Q,ie=0){return we(this,Q,ie,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function We(ye,Q,ie,Se,je,tt){if(ie+Se>ye.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("Index out of range")}function st(ye,Q,ie,Se,je){return Q=+Q,ie=ie>>>0,je||We(ye,Q,ie,4),i.write(ye,Q,ie,Se,23,4),ie+4}_.prototype.writeFloatLE=function(Q,ie,Se){return st(this,Q,ie,!0,Se)},_.prototype.writeFloatBE=function(Q,ie,Se){return st(this,Q,ie,!1,Se)};function pt(ye,Q,ie,Se,je){return Q=+Q,ie=ie>>>0,je||We(ye,Q,ie,8),i.write(ye,Q,ie,Se,52,8),ie+8}_.prototype.writeDoubleLE=function(Q,ie,Se){return pt(this,Q,ie,!0,Se)},_.prototype.writeDoubleBE=function(Q,ie,Se){return pt(this,Q,ie,!1,Se)},_.prototype.copy=function(Q,ie,Se,je){if(!_.isBuffer(Q))throw new TypeError("argument should be a Buffer");if(Se||(Se=0),!je&&je!==0&&(je=this.length),ie>=Q.length&&(ie=Q.length),ie||(ie=0),je>0&&je<Se&&(je=Se),je===Se||Q.length===0||this.length===0)return 0;if(ie<0)throw new RangeError("targetStart out of bounds");if(Se<0||Se>=this.length)throw new RangeError("Index out of range");if(je<0)throw new RangeError("sourceEnd out of bounds");je>this.length&&(je=this.length),Q.length-ie<je-Se&&(je=Q.length-ie+Se);const tt=je-Se;return this===Q&&typeof d.prototype.copyWithin=="function"?this.copyWithin(ie,Se,je):d.prototype.set.call(Q,this.subarray(Se,je),ie),tt},_.prototype.fill=function(Q,ie,Se,je){if(typeof Q=="string"){if(typeof ie=="string"?(je=ie,ie=0,Se=this.length):typeof Se=="string"&&(je=Se,Se=this.length),je!==void 0&&typeof je!="string")throw new TypeError("encoding must be a string");if(typeof je=="string"&&!_.isEncoding(je))throw new TypeError("Unknown encoding: "+je);if(Q.length===1){const Te=Q.charCodeAt(0);(je==="utf8"&&Te<128||je==="latin1")&&(Q=Te)}}else typeof Q=="number"?Q=Q&255:typeof Q=="boolean"&&(Q=Number(Q));if(ie<0||this.length<ie||this.length<Se)throw new RangeError("Out of range index");if(Se<=ie)return this;ie=ie>>>0,Se=Se===void 0?this.length:Se>>>0,Q||(Q=0);let tt;if(typeof Q=="number")for(tt=ie;tt<Se;++tt)this[tt]=Q;else{const Te=_.isBuffer(Q)?Q:_.from(Q,je),Pe=Te.length;if(Pe===0)throw new TypeError('The value "'+Q+'" is invalid for argument "value"');for(tt=0;tt<Se-ie;++tt)this[tt+ie]=Te[tt%Pe]}return this};const Qe={};function Je(ye,Q,ie){Qe[ye]=class extends ie{constructor(){super(),Object.defineProperty(this,"message",{value:Q.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ye}]`,this.stack,delete this.name}get code(){return ye}set code(je){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:je,writable:!0})}toString(){return`${this.name} [${ye}]: ${this.message}`}}}Je("ERR_BUFFER_OUT_OF_BOUNDS",function(ye){return ye?`${ye} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Je("ERR_INVALID_ARG_TYPE",function(ye,Q){return`The "${ye}" argument must be of type number. Received type ${typeof Q}`},TypeError),Je("ERR_OUT_OF_RANGE",function(ye,Q,ie){let Se=`The value of "${ye}" is out of range.`,je=ie;return Number.isInteger(ie)&&Math.abs(ie)>2**32?je=St(String(ie)):typeof ie=="bigint"&&(je=String(ie),(ie>BigInt(2)**BigInt(32)||ie<-(BigInt(2)**BigInt(32)))&&(je=St(je)),je+="n"),Se+=` It must be ${Q}. Received ${je}`,Se},RangeError);function St(ye){let Q="",ie=ye.length;const Se=ye[0]==="-"?1:0;for(;ie>=Se+4;ie-=3)Q=`_${ye.slice(ie-3,ie)}${Q}`;return`${ye.slice(0,ie)}${Q}`}function Xt(ye,Q,ie){gn(Q,"offset"),(ye[Q]===void 0||ye[Q+ie]===void 0)&&It(Q,ye.length-(ie+1))}function Ht(ye,Q,ie,Se,je,tt){if(ye>ie||ye<Q){const Te=typeof Q=="bigint"?"n":"";let Pe;throw tt>3?Q===0||Q===BigInt(0)?Pe=`>= 0${Te} and < 2${Te} ** ${(tt+1)*8}${Te}`:Pe=`>= -(2${Te} ** ${(tt+1)*8-1}${Te}) and < 2 ** ${(tt+1)*8-1}${Te}`:Pe=`>= ${Q}${Te} and <= ${ie}${Te}`,new Qe.ERR_OUT_OF_RANGE("value",Pe,ye)}Xt(Se,je,tt)}function gn(ye,Q){if(typeof ye!="number")throw new Qe.ERR_INVALID_ARG_TYPE(Q,"number",ye)}function It(ye,Q,ie){throw Math.floor(ye)!==ye?(gn(ye,ie),new Qe.ERR_OUT_OF_RANGE(ie||"offset","an integer",ye)):Q<0?new Qe.ERR_BUFFER_OUT_OF_BOUNDS:new Qe.ERR_OUT_OF_RANGE(ie||"offset",`>= ${ie?1:0} and <= ${Q}`,ye)}const xt=/[^+/0-9A-Za-z-_]/g;function mt(ye){if(ye=ye.split("=")[0],ye=ye.trim().replace(xt,""),ye.length<2)return"";for(;ye.length%4!==0;)ye=ye+"=";return ye}function dt(ye,Q){Q=Q||1/0;let ie;const Se=ye.length;let je=null;const tt=[];for(let Te=0;Te<Se;++Te){if(ie=ye.charCodeAt(Te),ie>55295&&ie<57344){if(!je){if(ie>56319){(Q-=3)>-1&&tt.push(239,191,189);continue}else if(Te+1===Se){(Q-=3)>-1&&tt.push(239,191,189);continue}je=ie;continue}if(ie<56320){(Q-=3)>-1&&tt.push(239,191,189),je=ie;continue}ie=(je-55296<<10|ie-56320)+65536}else je&&(Q-=3)>-1&&tt.push(239,191,189);if(je=null,ie<128){if((Q-=1)<0)break;tt.push(ie)}else if(ie<2048){if((Q-=2)<0)break;tt.push(ie>>6|192,ie&63|128)}else if(ie<65536){if((Q-=3)<0)break;tt.push(ie>>12|224,ie>>6&63|128,ie&63|128)}else if(ie<1114112){if((Q-=4)<0)break;tt.push(ie>>18|240,ie>>12&63|128,ie>>6&63|128,ie&63|128)}else throw new Error("Invalid code point")}return tt}function it(ye){const Q=[];for(let ie=0;ie<ye.length;++ie)Q.push(ye.charCodeAt(ie)&255);return Q}function Me(ye,Q){let ie,Se,je;const tt=[];for(let Te=0;Te<ye.length&&!((Q-=2)<0);++Te)ie=ye.charCodeAt(Te),Se=ie>>8,je=ie%256,tt.push(je),tt.push(Se);return tt}function Ge(ye){return t.toByteArray(mt(ye))}function bt(ye,Q,ie,Se){let je;for(je=0;je<Se&&!(je+ie>=Q.length||je>=ye.length);++je)Q[je+ie]=ye[je];return je}function wt(ye,Q){return ye instanceof Q||ye!=null&&ye.constructor!=null&&ye.constructor.name!=null&&ye.constructor.name===Q.name}function Pt(ye){return ye!==ye}const en=function(){const ye="0123456789abcdef",Q=new Array(256);for(let ie=0;ie<16;++ie){const Se=ie*16;for(let je=0;je<16;++je)Q[Se+je]=ye[ie]+ye[je]}return Q}();function un(ye){return typeof BigInt>"u"?an:ye}function an(){throw new Error("BigInt not supported")}})(yQ);const D7=yQ.Buffer,V0e=yQ.Buffer;/**
* @license agora-rtc-react
* @version 2.2.0
*
* Copyright (c) Agora, Inc.
*
* This source code is licensed under the MIT license.
*/var RPe=Object.create,EQ=Object.defineProperty,xPe=Object.getOwnPropertyDescriptor,APe=Object.getOwnPropertyNames,IPe=Object.getPrototypeOf,NPe=Object.prototype.hasOwnProperty,OPe=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),PPe=(n,t)=>{for(var i in t)EQ(n,i,{get:t[i],enumerable:!0})},z0e=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of APe(t))!NPe.call(n,l)&&l!==i&&EQ(n,l,{get:()=>t[l],enumerable:!(s=xPe(t,l))||s.enumerable});return n},LPe=(n,t,i)=>(z0e(n,t,"default"),i),iw=(n,t,i)=>(i=n!=null?RPe(IPe(n)):{},z0e(!n||!n.__esModule?EQ(i,"default",{value:n,enumerable:!0}):i,n)),rw=OPe((n,t)=>{(function(i,s){typeof n=="object"&&typeof t<"u"?t.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self).AgoraRTC=s()})(n,function(){function i(r,a){return a.forEach(function(o){o&&typeof o!="string"&&!Array.isArray(o)&&Object.keys(o).forEach(function(c){if(c!=="default"&&!(c in r)){var f=Object.getOwnPropertyDescriptor(o,c);Object.defineProperty(r,c,f.get?f:{enumerable:!0,get:function(){return o[c]}})}})}),Object.freeze(r)}var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Xo<"u"?Xo:typeof self<"u"?self:{};function l(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var d=function(r){try{return!!r()}catch{return!0}},u=!d(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),p=u,m=Function.prototype,y=m.call,_=p&&m.bind.bind(y,y),E=p?_:function(r){return function(){return y.apply(r,arguments)}},C=E({}.isPrototypeOf),x=function(r){return r&&r.Math==Math&&r},N=x(typeof globalThis=="object"&&globalThis)||x(typeof window=="object"&&window)||x(typeof self=="object"&&self)||x(typeof s=="object"&&s)||function(){return this}()||s||Function("return this")(),O=u,D=Function.prototype,P=D.apply,j=D.call,M=typeof Reflect=="object"&&Reflect.apply||(O?j.bind(P):function(){return j.apply(P,arguments)}),V=E,G=V({}.toString),$=V("".slice),ne=function(r){return $(G(r),8,-1)},Y=ne,le=E,re=function(r){if(Y(r)==="Function")return le(r)},ee=typeof document=="object"&&document.all,de={all:ee,IS_HTMLDDA:ee===void 0&&ee!==void 0},H=de.all,ae=de.IS_HTMLDDA?function(r){return typeof r=="function"||r===H}:function(r){return typeof r=="function"},_e={},me=!d(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Ce=u,he=Function.prototype.call,pe=Ce?he.bind(he):function(){return he.apply(he,arguments)},Oe={},Fe={}.propertyIsEnumerable,Ue=Object.getOwnPropertyDescriptor,Ve=Ue&&!Fe.call({1:2},1);Oe.f=Ve?function(r){var a=Ue(this,r);return!!a&&a.enumerable}:Fe;var Re,Be,Xe=function(r,a){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:a}},we=d,We=ne,st=Object,pt=E("".split),Qe=we(function(){return!st("z").propertyIsEnumerable(0)})?function(r){return We(r)=="String"?pt(r,""):st(r)}:st,Je=function(r){return r==null},St=Je,Xt=TypeError,Ht=function(r){if(St(r))throw Xt("Can't call method on "+r);return r},gn=Qe,It=Ht,xt=function(r){return gn(It(r))},mt=ae,dt=de.all,it=de.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:mt(r)||r===dt}:function(r){return typeof r=="object"?r!==null:mt(r)},Me={},Ge=Me,bt=N,wt=ae,Pt=function(r){return wt(r)?r:void 0},en=function(r,a){return arguments.length<2?Pt(Ge[r])||Pt(bt[r]):Ge[r]&&Ge[r][a]||bt[r]&&bt[r][a]},un=typeof navigator<"u"&&String(navigator.userAgent)||"",an=N,ye=un,Q=an.process,ie=an.Deno,Se=Q&&Q.versions||ie&&ie.version,je=Se&&Se.v8;je&&(Be=(Re=je.split("."))[0]>0&&Re[0]<4?1:+(Re[0]+Re[1])),!Be&&ye&&(!(Re=ye.match(/Edge\/(\d+)/))||Re[1]>=74)&&(Re=ye.match(/Chrome\/(\d+)/))&&(Be=+Re[1]);var tt=Be,Te=tt,Pe=d,Ze=N.String,nt=!!Object.getOwnPropertySymbols&&!Pe(function(){var r=Symbol();return!Ze(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Te&&Te<41}),$e=nt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",rt=en,yn=ae,Dt=C,nn=Object,Zt=$e?function(r){return typeof r=="symbol"}:function(r){var a=rt("Symbol");return yn(a)&&Dt(a.prototype,nn(r))},qt=String,Jt=function(r){try{return qt(r)}catch{return"Object"}},mn=ae,Kn=Jt,On=TypeError,Tn=function(r){if(mn(r))return r;throw On(Kn(r)+" is not a function")},Ui=Tn,xr=Je,bi=function(r,a){var o=r[a];return xr(o)?void 0:Ui(o)},Da=pe,Rl=ae,_c=it,cu=TypeError,Io={exports:{}},e0=N,t0=Object.defineProperty,Qa=function(r,a){try{t0(e0,r,{value:a,configurable:!0,writable:!0})}catch{e0[r]=a}return a},Ew="__core-js_shared__",uy=N[Ew]||Qa(Ew,{}),ww=uy;(Io.exports=function(r,a){return ww[r]||(ww[r]=a!==void 0?a:{})})("versions",[]).push({version:"3.31.1",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var bf=Io.exports,Ix=Ht,Nx=Object,No=function(r){return Nx(Ix(r))},Ox=No,n0=E({}.hasOwnProperty),ms=Object.hasOwn||function(r,a){return n0(Ox(r),a)},Px=E,Lx=0,Sw=Math.random(),bw=Px(1 .toString),i0=function(r){return"Symbol("+(r===void 0?"":r)+")_"+bw(++Lx+Sw,36)},Cw=bf,Tw=ms,Dx=i0,mh=nt,du=$e,Za=N.Symbol,Qp=Cw("wks"),hy=du?Za.for||Za:Za&&Za.withoutSetter||Dx,Xi=function(r){return Tw(Qp,r)||(Qp[r]=mh&&Tw(Za,r)?Za[r]:hy("Symbol."+r)),Qp[r]},fy=pe,gh=it,Cf=Zt,r0=bi,s0=function(r,a){var o,c;if(Rl(o=r.toString)&&!_c(c=Da(o,r))||Rl(o=r.valueOf)&&!_c(c=Da(o,r))||a!=="string")return c;throw cu("Can't convert object to primitive value")},py=TypeError,a0=Xi("toPrimitive"),Tf=function(r,a){if(!gh(r)||Cf(r))return r;var o,c=r0(r,a0);if(c){if(o=fy(c,r,a),!gh(o)||Cf(o))return o;throw py("Can't convert object to primitive value")}return s0(r,a)},Rf=Zt,uu=function(r){var a=Tf(r,"string");return Rf(a)?a:a+""},Zp=it,ld=N.document,o0=Zp(ld)&&Zp(ld.createElement),em=function(r){return o0?ld.createElement(r):{}},Rw=em,kx=!me&&!d(function(){return Object.defineProperty(Rw("div"),"a",{get:function(){return 7}}).a!=7}),FP=me,BP=pe,VP=Oe,VF=Xe,zF=xt,HF=uu,zP=ms,GF=kx,HP=Object.getOwnPropertyDescriptor;_e.f=FP?HP:function(r,a){if(r=zF(r),a=HF(a),GF)try{return HP(r,a)}catch{}if(zP(r,a))return VF(!BP(VP.f,r,a),r[a])};var WF=d,$F=ae,Mx=/#|\.prototype\./,my=function(r,a){var o=qF[KF(r)];return o==XF||o!=YF&&($F(a)?WF(a):!!a)},KF=my.normalize=function(r){return String(r).replace(Mx,".").toLowerCase()},qF=my.data={},YF=my.NATIVE="N",XF=my.POLYFILL="P",$r=my,Kr=Tn,JF=u,QF=re(re.bind),xf=function(r,a){return Kr(r),a===void 0?r:JF?QF(r,a):function(){return r.apply(a,arguments)}},Ec={},GP=me&&d(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),ZF=it,WP=String,eB=TypeError,dr=function(r){if(ZF(r))return r;throw eB(WP(r)+" is not an object")},jx=me,tm=kx,$P=GP,l0=dr,xl=uu,KP=TypeError,xw=Object.defineProperty,qP=Object.getOwnPropertyDescriptor,Aw="enumerable",Iw="configurable",Nw="writable";Ec.f=jx?$P?function(r,a,o){if(l0(r),a=xl(a),l0(o),typeof r=="function"&&a==="prototype"&&"value"in o&&Nw in o&&!o[Nw]){var c=qP(r,a);c&&c[Nw]&&(r[a]=o.value,o={configurable:Iw in o?o[Iw]:c[Iw],enumerable:Aw in o?o[Aw]:c[Aw],writable:!1})}return xw(r,a,o)}:xw:function(r,a,o){if(l0(r),a=xl(a),l0(o),tm)try{return xw(r,a,o)}catch{}if("get"in o||"set"in o)throw KP("Accessors not supported");return"value"in o&&(r[a]=o.value),r};var Al=Ec,tB=Xe,aa=me?function(r,a,o){return Al.f(r,a,tB(1,o))}:function(r,a,o){return r[a]=o,r},Ow=N,YP=M,Af=re,Pw=ae,Ux=_e.f,os=$r,Il=Me,Fx=xf,c0=aa,Lw=ms,nB=function(r){var a=function(o,c,f){if(this instanceof a){switch(arguments.length){case 0:return new r;case 1:return new r(o);case 2:return new r(o,c)}return new r(o,c,f)}return YP(r,this,arguments)};return a.prototype=r.prototype,a},Ii=function(r,a){var o,c,f,g,v,w,T,R,A,L=r.target,U=r.global,F=r.stat,Z=r.proto,W=U?Ow:F?Ow[L]:(Ow[L]||{}).prototype,K=U?Il:Il[L]||c0(Il,L,{})[L],oe=K.prototype;for(g in a)c=!(o=os(U?g:L+(F?".":"#")+g,r.forced))&&W&&Lw(W,g),w=K[g],c&&(T=r.dontCallGetSet?(A=Ux(W,g))&&A.value:W[g]),v=c&&T?T:a[g],c&&typeof w==typeof v||(R=r.bind&&c?Fx(v,Ow):r.wrap&&c?nB(v):Z&&Pw(v)?Af(v):v,(r.sham||v&&v.sham||w&&w.sham)&&c0(R,"sham",!0),c0(K,g,R),Z&&(Lw(Il,f=L+"Prototype")||c0(Il,f,{}),c0(Il[f],g,v),r.real&&oe&&(o||!oe[g])&&c0(oe,g,v)))},iB=Math.ceil,XP=Math.floor,Dw=Math.trunc||function(r){var a=+r;return(a>0?XP:iB)(a)},d0=Dw,Bx=function(r){var a=+r;return a!=a||a===0?0:d0(a)},JP=Bx,QP=Math.max,Vx=Math.min,gy=function(r,a){var o=JP(r);return o<0?QP(o+a,0):Vx(o,a)},ZP=Bx,rB=Math.min,kw=function(r){return r>0?rB(ZP(r),9007199254740991):0},zx=kw,vh=function(r){return zx(r.length)},e6=xt,Nl=gy,Hx=vh,u0=function(r){return function(a,o,c){var f,g=e6(a),v=Hx(g),w=Nl(c,v);if(r&&o!=o){for(;v>w;)if((f=g[w++])!=f)return!0}else for(;v>w;w++)if((r||w in g)&&g[w]===o)return r||w||0;return!r&&-1}},Mw={includes:u0(!0),indexOf:u0(!1)},t6=Mw.includes;Ii({target:"Array",proto:!0,forced:d(function(){return!Array(1).includes()})},{includes:function(r){return t6(this,r,arguments.length>1?arguments[1]:void 0)}});var sB=Me,wc=function(r){return sB[r+"Prototype"]},aB=wc("Array").includes,oB=it,lB=ne,h0=Xi("match"),n6=function(r){var a;return oB(r)&&((a=r[h0])!==void 0?!!a:lB(r)=="RegExp")},cB=n6,Gx=TypeError,Wx={};Wx[Xi("toStringTag")]="z";var hu=String(Wx)==="[object z]",jw=hu,dB=ae,Uw=ne,uB=Xi("toStringTag"),f0=Object,cd=Uw(function(){return arguments}())=="Arguments",dd=jw?Uw:function(r){var a,o,c;return r===void 0?"Undefined":r===null?"Null":typeof(o=function(f,g){try{return f[g]}catch{}}(a=f0(r),uB))=="string"?o:cd?Uw(a):(c=Uw(a))=="Object"&&dB(a.callee)?"Arguments":c},hB=dd,fB=String,Ol=function(r){if(hB(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return fB(r)},pB=Xi("match"),mB=Ii,p0=function(r){if(cB(r))throw Gx("The method doesn't accept regular expressions");return r},ot=Ht,Ot=Ol,_t=function(r){var a=/./;try{"/./"[r](a)}catch{try{return a[pB]=!1,"/./"[r](a)}catch{}}return!1},Cn=E("".indexOf);mB({target:"String",proto:!0,forced:!_t("includes")},{includes:function(r){return!!~Cn(Ot(ot(this)),Ot(p0(r)),arguments.length>1?arguments[1]:void 0)}});var di=wc("String").includes,ur=C,oa=aB,kr=di,vy=Array.prototype,$x=String.prototype,Sc=function(r){var a=r.includes;return r===vy||ur(vy,r)&&a===vy.includes?oa:typeof r=="string"||r===$x||ur($x,r)&&a===$x.includes?kr:a},Tt=l(Sc),gB=Tn,m0=No,Fw=Qe,Bw=vh,Tr=TypeError,i6=function(r){return function(a,o,c,f){gB(o);var g=m0(a),v=Fw(g),w=Bw(g),T=r?w-1:0,R=r?-1:1;if(c<2)for(;;){if(T in v){f=v[T],T+=R;break}if(T+=R,r?T<0:w<=T)throw Tr("Reduce of empty array with no initial value")}for(;r?T>=0:w>T;T+=R)T in v&&(f=o(f,v[T],T,g));return f}},r6={left:i6(!1),right:i6(!0)},Vw=d,zw=function(r,a){var o=[][r];return!!o&&Vw(function(){o.call(null,a||function(){return 1},1)})},yy=typeof lc<"u"&&ne(lc)=="process",vB=r6.left;Ii({target:"Array",proto:!0,forced:!yy&&tt>79&&tt<83||!zw("reduce")},{reduce:function(r){var a=arguments.length;return vB(this,r,a,a>1?arguments[1]:void 0)}});var Hw=wc("Array").reduce,If=C,Gw=Hw,Ww=Array.prototype,$w=function(r){var a=r.reduce;return r===Ww||If(Ww,r)&&a===Ww.reduce?Gw:a},Kx=$w,bc=l(Kx);let _y=!0,qx=!0;function Nf(r,a,o){let c=r.match(a);return c&&c.length>=o&&parseInt(c[o],10)}function Pl(r,a,o){if(!r.RTCPeerConnection)return;let c=r.RTCPeerConnection.prototype,f=c.addEventListener;c.addEventListener=function(v,w){if(v!==a)return f.apply(this,arguments);let T=R=>{let A=o(R);A&&(w.handleEvent?w.handleEvent(A):w(A))};return this._eventMap=this._eventMap||{},this._eventMap[a]||(this._eventMap[a]=new Map),this._eventMap[a].set(w,T),f.apply(this,[v,T])};let g=c.removeEventListener;c.removeEventListener=function(v,w){if(v!==a||!this._eventMap||!this._eventMap[a])return g.apply(this,arguments);if(!this._eventMap[a].has(w))return g.apply(this,arguments);let T=this._eventMap[a].get(w);return this._eventMap[a].delete(w),this._eventMap[a].size===0&&delete this._eventMap[a],Object.keys(this._eventMap).length===0&&delete this._eventMap,g.apply(this,[v,T])},Object.defineProperty(c,"on"+a,{get(){return this["_on"+a]},set(v){this["_on"+a]&&(this.removeEventListener(a,this["_on"+a]),delete this["_on"+a]),v&&this.addEventListener(a,this["_on"+a]=v)},enumerable:!0,configurable:!0})}function Kw(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(_y=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function yB(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(qx=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function s6(){if(typeof window=="object"){if(_y)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Yx(r,a){qx&&console.warn(r+" is deprecated, please use "+a+" instead.")}function Ey(r){return Object.prototype.toString.call(r)==="[object Object]"}function wy(r){var a;return Ey(r)?bc(a=Object.keys(r)).call(a,function(o,c){let f=Ey(r[c]),g=f?wy(r[c]):r[c],v=f&&!Object.keys(g).length;return g===void 0||v?o:Object.assign(o,{[c]:g})},{}):r}function Sy(r,a,o){a&&!o.has(a.id)&&(o.set(a.id,a),Object.keys(a).forEach(c=>{c.endsWith("Id")?Sy(r,r.get(a[c]),o):c.endsWith("Ids")&&a[c].forEach(f=>{Sy(r,r.get(f),o)})}))}function a6(r,a,o){let c=o?"outbound-rtp":"inbound-rtp",f=new Map;if(a===null)return f;let g=[];return r.forEach(v=>{v.type==="track"&&v.trackIdentifier===a.id&&g.push(v)}),g.forEach(v=>{r.forEach(w=>{w.type===c&&w.trackId===v.id&&Sy(r,w,f)})}),f}var o6=i0,l6=bf("keys"),qw=function(r){return l6[r]||(l6[r]=o6(r))},la=!d(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),eo=ms,_B=ae,EB=No,c6=la,d6=qw("IE_PROTO"),by=Object,Cy=by.prototype,Ty=c6?by.getPrototypeOf:function(r){var a=EB(r);if(eo(a,d6))return a[d6];var o=a.constructor;return _B(o)&&a instanceof o?o.prototype:a instanceof by?Cy:null},g0=E,Ry=Tn,xy=ae,Yw=String,v0=TypeError,wB=function(r,a,o){try{return g0(Ry(Object.getOwnPropertyDescriptor(r,a)[o]))}catch{}},SB=dr,bB=function(r){if(typeof r=="object"||xy(r))return r;throw v0("Can't set "+Yw(r)+" as a prototype")},CB=Object.setPrototypeOf||("__proto__"in{}?function(){var r,a=!1,o={};try{(r=wB(Object.prototype,"__proto__","set"))(o,[]),a=o instanceof Array}catch{}return function(c,f){return SB(c),bB(f),a?r(c,f):c.__proto__=f,c}}():void 0),Xw={},nm={},im=ms,u6=xt,be=Mw.indexOf,y0=nm,Ay=E([].push),Ll=function(r,a){var o,c=u6(r),f=0,g=[];for(o in c)!im(y0,o)&&im(c,o)&&Ay(g,o);for(;a.length>f;)im(c,o=a[f++])&&(~be(g,o)||Ay(g,o));return g},Fi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],TB=Ll,RB=Fi.concat("length","prototype");Xw.f=Object.getOwnPropertyNames||function(r){return TB(r,RB)};var Iy={};Iy.f=Object.getOwnPropertySymbols;var rm=en,xB=Xw,AB=Iy,IB=dr,NB=E([].concat),OB=rm("Reflect","ownKeys")||function(r){var a=xB.f(IB(r)),o=AB.f;return o?NB(a,o(r)):a},fu=ms,PB=OB,LB=_e,DB=Ec,Xx={},kB=Ll,yh=Fi,Jw=Object.keys||function(r){return kB(r,yh)},MB=me,jB=GP,UB=Ec,FB=dr,sm=xt,BB=Jw;Xx.f=MB&&!jB?Object.defineProperties:function(r,a){FB(r);for(var o,c=sm(a),f=BB(a),g=f.length,v=0;g>v;)UB.f(r,o=f[v++],c[o]);return r};var Qw,Cc=en("document","documentElement"),VB=dr,zB=Xx,h6=Fi,HB=nm,GB=Cc,f6=em,Zw="prototype",Jx="script",p6=qw("IE_PROTO"),Ny=function(){},_0=function(r){return"<"+Jx+">"+r+"</"+Jx+">"},Oy=function(r){r.write(_0("")),r.close();var a=r.parentWindow.Object;return r=null,a},eS=function(){try{Qw=new ActiveXObject("htmlfile")}catch{}var r,a,o;eS=typeof document<"u"?document.domain&&Qw?Oy(Qw):(a=f6("iframe"),o="java"+Jx+":",a.style.display="none",GB.appendChild(a),a.src=String(o),(r=a.contentWindow.document).open(),r.write(_0("document.F=Object")),r.close(),r.F):Oy(Qw);for(var c=h6.length;c--;)delete eS[Zw][h6[c]];return eS()};HB[p6]=!0;var E0=Object.create||function(r,a){var o;return r!==null?(Ny[Zw]=VB(r),o=new Ny,Ny[Zw]=null,o[p6]=r):o=eS(),a===void 0?o:zB.f(o,a)},WB=it,_h=aa,tS=Error,am=E("".replace),Tc=String(tS("zxcasd").stack),m6=/\n\s*at [^:]*:[^\n]*/,g6=m6.test(Tc),v6=Xe,Py=!d(function(){var r=Error("a");return!("stack"in r)||(Object.defineProperty(r,"stack",v6(1,7)),r.stack!==7)}),Of=aa,y6=function(r,a){if(g6&&typeof r=="string"&&!tS.prepareStackTrace)for(;a--;)r=am(r,m6,"");return r},$B=Py,Ly=Error.captureStackTrace,om={},_6=om,ka=Xi("iterator"),Qx=Array.prototype,Zx=function(r){return r!==void 0&&(_6.Array===r||Qx[ka]===r)},pu=dd,nS=bi,iS=Je,lm=om,E6=Xi("iterator"),Ca=function(r){if(!iS(r))return nS(r,E6)||nS(r,"@@iterator")||lm[pu(r)]},eA=pe,KB=Tn,qB=dr,YB=Jt,tA=Ca,XB=TypeError,cm=function(r,a){var o=arguments.length<2?tA(r):a;if(KB(o))return qB(eA(o,r));throw XB(YB(r)+" is not iterable")},w6=pe,S6=dr,JB=bi,w0=function(r,a,o){var c,f;S6(r);try{if(!(c=JB(r,"return"))){if(a==="throw")throw o;return o}c=w6(c,r)}catch(g){f=!0,c=g}if(a==="throw")throw o;if(f)throw c;return S6(c),o},QB=xf,ZB=pe,nA=dr,b6=Jt,eV=Zx,tV=vh,C6=C,T6=cm,iA=Ca,R6=w0,rA=TypeError,Dy=function(r,a){this.stopped=r,this.result=a},sA=Dy.prototype,S0=function(r,a,o){var c,f,g,v,w,T,R,A=o&&o.that,L=!(!o||!o.AS_ENTRIES),U=!(!o||!o.IS_RECORD),F=!(!o||!o.IS_ITERATOR),Z=!(!o||!o.INTERRUPTED),W=QB(a,A),K=function(ue){return c&&R6(c,"normal",ue),new Dy(!0,ue)},oe=function(ue){return L?(nA(ue),Z?W(ue[0],ue[1],K):W(ue[0],ue[1])):Z?W(ue,K):W(ue)};if(U)c=r.iterator;else if(F)c=r;else{if(!(f=iA(r)))throw rA(b6(r)+" is not iterable");if(eV(f)){for(g=0,v=tV(r);v>g;g++)if((w=oe(r[g]))&&C6(sA,w))return w;return new Dy(!1)}c=T6(r,f)}for(T=U?r.next:c.next;!(R=ZB(T,c)).done;){try{w=oe(R.value)}catch(ue){R6(c,"throw",ue)}if(typeof w=="object"&&w&&C6(sA,w))return w}return new Dy(!1)},rS=Ol,nV=Ii,x6=C,A6=Ty,sS=CB,I6=function(r,a,o){for(var c=PB(a),f=DB.f,g=LB.f,v=0;v<c.length;v++){var w=c[v];fu(r,w)||o&&fu(o,w)||f(r,w,g(a,w))}},N6=E0,ky=aa,aS=Xe,aA=function(r,a){WB(a)&&"cause"in a&&_h(r,"cause",a.cause)},iV=function(r,a,o,c){$B&&(Ly?Ly(r,a):Of(r,"stack",y6(o,c)))},oA=S0,Ni=function(r,a){return r===void 0?arguments.length<2?"":a:rS(r)},rV=Xi("toStringTag"),oS=Error,My=[].push,dm=function(r,a){var o,c=x6(lA,this);sS?o=sS(oS(),c?A6(this):lA):(o=c?this:N6(lA),ky(o,rV,"Error")),a!==void 0&&ky(o,"message",Ni(a)),iV(o,dm,o.stack,1),arguments.length>2&&aA(o,arguments[2]);var f=[];return oA(r,My,{that:f}),ky(o,"errors",f),o};sS?sS(dm,oS):I6(dm,oS,{name:!0});var lA=dm.prototype=N6(oS.prototype,{constructor:aS(1,dm),message:aS(1,""),name:aS(1,"AggregateError")});nV({global:!0,constructor:!0,arity:2},{AggregateError:dm});var lS,to,cS,dS=ae,uS=N.WeakMap,O6=dS(uS)&&/native code/.test(String(uS)),cA=N,Dl=it,Pf=aa,jy=ms,hS=uy,fS=qw,P6=nm,pS="Object already initialized",mS=cA.TypeError,dA=cA.WeakMap;if(O6||hS.state){var Rc=hS.state||(hS.state=new dA);Rc.get=Rc.get,Rc.has=Rc.has,Rc.set=Rc.set,lS=function(r,a){if(Rc.has(r))throw mS(pS);return a.facade=r,Rc.set(r,a),a},to=function(r){return Rc.get(r)||{}},cS=function(r){return Rc.has(r)}}else{var kl=fS("state");P6[kl]=!0,lS=function(r,a){if(jy(r,kl))throw mS(pS);return a.facade=r,Pf(r,kl,a),a},to=function(r){return jy(r,kl)?r[kl]:{}},cS=function(r){return jy(r,kl)}}var um,Eh,uA,Lf={set:lS,get:to,has:cS,enforce:function(r){return cS(r)?to(r):lS(r,{})},getterFor:function(r){return function(a){var o;if(!Dl(a)||(o=to(a)).type!==r)throw mS("Incompatible receiver, "+r+" required");return o}}},Uy=me,sV=ms,L6=Function.prototype,aV=Uy&&Object.getOwnPropertyDescriptor,gS=sV(L6,"name"),hA={EXISTS:gS,PROPER:gS&&(function(){}).name==="something",CONFIGURABLE:gS&&(!Uy||Uy&&aV(L6,"name").configurable)},oV=aa,wh=function(r,a,o,c){return c&&c.enumerable?r[a]=o:oV(r,a,o),r},D6=d,nl=ae,mu=it,lV=E0,k6=Ty,vS=wh,Df=Xi("iterator"),fA=!1;[].keys&&("next"in(uA=[].keys())?(Eh=k6(k6(uA)))!==Object.prototype&&(um=Eh):fA=!0);var M6=!mu(um)||D6(function(){var r={};return um[Df].call(r)!==r});nl((um=M6?{}:lV(um))[Df])||vS(um,Df,function(){return this});var j6={IteratorPrototype:um,BUGGY_SAFARI_ITERATORS:fA},U6=dd,b0=hu?{}.toString:function(){return"[object "+U6(this)+"]"},Fy=hu,cV=Ec.f,F6=aa,B6=ms,yS=b0,pA=Xi("toStringTag"),ud=function(r,a,o,c){if(r){var f=o?r:r.prototype;B6(f,pA)||cV(f,pA,{configurable:!0,value:a}),c&&!Fy&&F6(f,"toString",yS)}},mA=j6.IteratorPrototype,_S=E0,dV=Xe,V6=ud,ES=om,z6=function(){return this},By=function(r,a,o,c){var f=a+" Iterator";return r.prototype=_S(mA,{next:dV(+!c,o)}),V6(r,f,!1,!0),ES[f]=z6,r},uV=Ii,H6=pe,Sh=hA,G6=By,W6=Ty,hV=ud,gA=wh,$6=om,fV=j6,bh=Sh.PROPER,C0=fV.BUGGY_SAFARI_ITERATORS,Vy=Xi("iterator"),wS="keys",hm="values",fm="entries",Xn=function(){return this},zy=function(r,a,o,c,f,g,v){G6(o,a,c);var w,T,R,A=function(oe){if(oe===f&&W)return W;if(!C0&&oe in F)return F[oe];switch(oe){case wS:case hm:case fm:return function(){return new o(this,oe)}}return function(){return new o(this)}},L=a+" Iterator",U=!1,F=r.prototype,Z=F[Vy]||F["@@iterator"]||f&&F[f],W=!C0&&Z||A(f),K=a=="Array"&&F.entries||Z;if(K&&(w=W6(K.call(new r)))!==Object.prototype&&w.next&&(hV(w,L,!0,!0),$6[L]=Xn),bh&&f==hm&&Z&&Z.name!==hm&&(U=!0,W=function(){return H6(Z,this)}),f)if(T={values:A(hm),keys:g?W:A(wS),entries:A(fm)},v)for(R in T)(C0||U||!(R in F))&&gA(F,R,T[R]);else uV({target:a,proto:!0,forced:C0||U},T);return v&&F[Vy]!==W&&gA(F,Vy,W,{name:f}),$6[a]=W,T},Hy=function(r,a){return{value:r,done:a}},pm=xt,K6=om,SS=Lf;Ec.f;var q6=zy,Ma=Hy,Y6="Array Iterator",pV=SS.set,X6=SS.getterFor(Y6);q6(Array,"Array",function(r,a){pV(this,{type:Y6,target:pm(r),index:0,kind:a})},function(){var r=X6(this),a=r.target,o=r.kind,c=r.index++;return!a||c>=a.length?(r.target=void 0,Ma(void 0,!0)):Ma(o=="keys"?c:o=="values"?a[c]:[c,a[c]],!1)},"values"),K6.Arguments=K6.Array;var mV=Ec,Gy=function(r,a,o){return mV.f(r,a,o)},gV=en,vV=Gy,yV=me,gu=Xi("species"),Oo=C,vA=TypeError,yA=function(r,a){if(Oo(a,r))return r;throw vA("Incorrect invocation")},_A=ae,EA=uy,_V=E(Function.toString);_A(EA.inspectSource)||(EA.inspectSource=function(r){return _V(r)});var T0=EA.inspectSource,J6=E,Q6=d,Z6=ae,EV=dd,wV=T0,eL=function(){},tL=[],wA=en("Reflect","construct"),SA=/^\s*(?:class|function)\b/,bA=J6(SA.exec),nL=!SA.exec(eL),Ch=function(r){if(!Z6(r))return!1;try{return wA(eL,tL,r),!0}catch{return!1}},bS=function(r){if(!Z6(r))return!1;switch(EV(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return nL||!!bA(SA,wV(r))}catch{return!0}};bS.sham=!0;var R0,mm,Wy,CS,Ml=!wA||Q6(function(){var r;return Ch(Ch.call)||!Ch(Object)||!Ch(function(){r=!0})||r})?bS:Ch,gm=Ml,SV=Jt,iL=TypeError,rL=dr,bV=function(r){if(gm(r))return r;throw iL(SV(r)+" is not a constructor")},CV=Je,TV=Xi("species"),CA=function(r,a){var o,c=rL(r).constructor;return c===void 0||CV(o=rL(c)[TV])?a:bV(o)},TA=E([].slice),RV=TypeError,TS=function(r,a){if(r<a)throw RV("Not enough arguments");return r},sL=/(?:ipad|iphone|ipod).*applewebkit/i.test(un),jl=N,xV=M,aL=xf,RA=ae,oL=ms,lL=d,cL=Cc,AV=TA,xA=em,IV=TS,NV=sL,OV=yy,AA=jl.setImmediate,IA=jl.clearImmediate,PV=jl.process,il=jl.Dispatch,LV=jl.Function,dL=jl.MessageChannel,DV=jl.String,RS=0,$y={},uL="onreadystatechange";lL(function(){R0=jl.location});var NA=function(r){if(oL($y,r)){var a=$y[r];delete $y[r],a()}},OA=function(r){return function(){NA(r)}},xS=function(r){NA(r.data)},hL=function(r){jl.postMessage(DV(r),R0.protocol+"//"+R0.host)};AA&&IA||(AA=function(r){IV(arguments.length,1);var a=RA(r)?r:LV(r),o=AV(arguments,1);return $y[++RS]=function(){xV(a,void 0,o)},mm(RS),RS},IA=function(r){delete $y[r]},OV?mm=function(r){PV.nextTick(OA(r))}:il&&il.now?mm=function(r){il.now(OA(r))}:dL&&!NV?(CS=(Wy=new dL).port2,Wy.port1.onmessage=xS,mm=aL(CS.postMessage,CS)):jl.addEventListener&&RA(jl.postMessage)&&!jl.importScripts&&R0&&R0.protocol!=="file:"&&!lL(hL)?(mm=hL,jl.addEventListener("message",xS,!1)):mm=uL in xA("script")?function(r){cL.appendChild(xA("script"))[uL]=function(){cL.removeChild(this),NA(r)}}:function(r){setTimeout(OA(r),0)});var fL={set:AA,clear:IA},pL=function(){this.head=null,this.tail=null};pL.prototype={add:function(r){var a={item:r,next:null},o=this.tail;o?o.next=a:this.head=a,this.tail=a},get:function(){var r=this.head;if(r)return(this.head=r.next)===null&&(this.tail=null),r.item}};var x0,PA,LA,DA,mL,gL=pL,kV=/ipad|iphone|ipod/i.test(un)&&typeof Pebble<"u",MV=/web0s(?!.*chrome)/i.test(un),vm=N,vL=xf,jV=_e.f,kA=fL.set,UV=gL,FV=sL,BV=kV,VV=MV,MA=yy,AS=vm.MutationObserver||vm.WebKitMutationObserver,jA=vm.document,yL=vm.process,IS=vm.Promise,_L=jV(vm,"queueMicrotask"),UA=_L&&_L.value;if(!UA){var NS=new UV,OS=function(){var r,a;for(MA&&(r=yL.domain)&&r.exit();a=NS.get();)try{a()}catch(o){throw NS.head&&x0(),o}r&&r.enter()};FV||MA||VV||!AS||!jA?!BV&&IS&&IS.resolve?((DA=IS.resolve(void 0)).constructor=IS,mL=vL(DA.then,DA),x0=function(){mL(OS)}):MA?x0=function(){yL.nextTick(OS)}:(kA=vL(kA,vm),x0=function(){kA(OS)}):(PA=!0,LA=jA.createTextNode(""),new AS(OS).observe(LA,{characterData:!0}),x0=function(){LA.data=PA=!PA}),UA=function(r){NS.head||x0(),NS.add(r)}}var zV=UA,A0=function(r){try{return{error:!1,value:r()}}catch(a){return{error:!0,value:a}}},kf=N.Promise,EL=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",PS=!EL&&!yy&&typeof window=="object"&&typeof document=="object",HV=N,Ky=kf,GV=ae,WV=$r,$V=T0,KV=Xi,qV=PS,YV=EL,FA=tt,wL=Ky&&Ky.prototype,XV=KV("species"),SL=!1,bL=GV(HV.PromiseRejectionEvent),JV=WV("Promise",function(){var r=$V(Ky),a=r!==String(Ky);if(!a&&FA===66||!wL.catch||!wL.finally)return!0;if(!FA||FA<51||!/native code/.test(r)){var o=new Ky(function(f){f(1)}),c=function(f){f(function(){},function(){})};if((o.constructor={})[XV]=c,!(SL=o.then(function(){})instanceof c))return!0}return!a&&(qV||YV)&&!bL}),qy={CONSTRUCTOR:JV,REJECTION_EVENT:bL,SUBCLASSING:SL},vu={},BA=Tn,CL=TypeError,QV=function(r){var a,o;this.promise=new r(function(c,f){if(a!==void 0||o!==void 0)throw CL("Bad Promise constructor");a=c,o=f}),this.resolve=BA(a),this.reject=BA(o)};vu.f=function(r){return new QV(r)};var VA,TL,ZV=Ii,ym=yy,Mf=N,Yy=pe,ez=wh,tz=ud,nz=function(r){var a=gV(r);yV&&a&&!a[gu]&&vV(a,gu,{configurable:!0,get:function(){return this}})},iz=Tn,zA=ae,rz=it,sz=yA,az=CA,RL=fL.set,I0=zV,oz=function(r,a){try{arguments.length==1?console.error(r):console.error(r,a)}catch{}},xL=A0,AL=gL,LS=Lf,DS=kf,HA=qy,GA=vu,Xy="Promise",IL=HA.CONSTRUCTOR,lz=HA.REJECTION_EVENT,WA=LS.getterFor(Xy),kS=LS.set,MS=DS&&DS.prototype,Jy=DS,$A=MS,jS=Mf.TypeError,US=Mf.document,KA=Mf.process,qA=GA.f,cz=qA,dz=!!(US&&US.createEvent&&Mf.dispatchEvent),NL="unhandledrejection",OL=function(r){var a;return!(!rz(r)||!zA(a=r.then))&&a},PL=function(r,a){var o,c,f,g=a.value,v=a.state==1,w=v?r.ok:r.fail,T=r.resolve,R=r.reject,A=r.domain;try{w?(v||(a.rejection===2&&hz(a),a.rejection=1),w===!0?o=g:(A&&A.enter(),o=w(g),A&&(A.exit(),f=!0)),o===r.promise?R(jS("Promise-chain cycle")):(c=OL(o))?Yy(c,o,T,R):T(o)):R(g)}catch(L){A&&!f&&A.exit(),R(L)}},LL=function(r,a){r.notified||(r.notified=!0,I0(function(){for(var o,c=r.reactions;o=c.get();)PL(o,r);r.notified=!1,a&&!r.rejection&&uz(r)}))},DL=function(r,a,o){var c,f;dz?((c=US.createEvent("Event")).promise=a,c.reason=o,c.initEvent(r,!1,!0),Mf.dispatchEvent(c)):c={promise:a,reason:o},!lz&&(f=Mf["on"+r])?f(c):r===NL&&oz("Unhandled promise rejection",o)},uz=function(r){Yy(RL,Mf,function(){var a,o=r.facade,c=r.value;if(kL(r)&&(a=xL(function(){ym?KA.emit("unhandledRejection",c,o):DL(NL,o,c)}),r.rejection=ym||kL(r)?2:1,a.error))throw a.value})},kL=function(r){return r.rejection!==1&&!r.parent},hz=function(r){Yy(RL,Mf,function(){var a=r.facade;ym?KA.emit("rejectionHandled",a):DL("rejectionhandled",a,r.value)})},no=function(r,a,o){return function(c){r(a,c,o)}},N0=function(r,a,o){r.done||(r.done=!0,o&&(r=o),r.value=a,r.state=2,LL(r,!0))},YA=function(r,a,o){if(!r.done){r.done=!0,o&&(r=o);try{if(r.facade===a)throw jS("Promise can't be resolved itself");var c=OL(a);c?I0(function(){var f={done:!1};try{Yy(c,a,no(YA,f,r),no(N0,f,r))}catch(g){N0(f,g,r)}}):(r.value=a,r.state=1,LL(r,!1))}catch(f){N0({done:!1},f,r)}}};IL&&($A=(Jy=function(r){sz(this,$A),iz(r),Yy(VA,this);var a=WA(this);try{r(no(YA,a),no(N0,a))}catch(o){N0(a,o)}}).prototype,(VA=function(r){kS(this,{type:Xy,done:!1,notified:!1,parent:!1,reactions:new AL,rejection:!1,state:0,value:void 0})}).prototype=ez($A,"then",function(r,a){var o=WA(this),c=qA(az(this,Jy));return o.parent=!0,c.ok=!zA(r)||r,c.fail=zA(a)&&a,c.domain=ym?KA.domain:void 0,o.state==0?o.reactions.add(c):I0(function(){PL(c,o)}),c.promise}),TL=function(){var r=new VA,a=WA(r);this.promise=r,this.resolve=no(YA,a),this.reject=no(N0,a)},GA.f=qA=function(r){return r===Jy||r===void 0?new TL(r):cz(r)}),ZV({global:!0,constructor:!0,wrap:!0,forced:IL},{Promise:Jy}),tz(Jy,Xy,!1,!0),nz(Xy);var jf=Xi("iterator"),ui=!1;try{var fz=0,Po={next:function(){return{done:!!fz++}},return:function(){ui=!0}};Po[jf]=function(){return this},Array.from(Po,function(){throw 2})}catch{}var js=kf,pz=function(r,a){if(!ui)return!1;var o=!1;try{var c={};c[jf]=function(){return{next:function(){return{done:o=!0}}}},r(c)}catch{}return o},hd=qy.CONSTRUCTOR||!pz(function(r){js.all(r).then(void 0,function(){})}),mz=pe,gz=Tn,vz=vu,yz=A0,_z=S0;Ii({target:"Promise",stat:!0,forced:hd},{all:function(r){var a=this,o=vz.f(a),c=o.resolve,f=o.reject,g=yz(function(){var v=gz(a.resolve),w=[],T=0,R=1;_z(r,function(A){var L=T++,U=!1;R++,mz(v,a,A).then(function(F){U||(U=!0,w[L]=F,--R||c(w))},f)}),--R||c(w)});return g.error&&f(g.value),o.promise}});var XA=Ii,Ez=qy.CONSTRUCTOR;kf&&kf.prototype,XA({target:"Promise",proto:!0,forced:Ez,real:!0},{catch:function(r){return this.then(void 0,r)}});var Th=pe,ML=Tn,FS=vu,gs=A0,Rs=S0;Ii({target:"Promise",stat:!0,forced:hd},{race:function(r){var a=this,o=FS.f(a),c=o.reject,f=gs(function(){var g=ML(a.resolve);Rs(r,function(v){Th(g,a,v).then(o.resolve,c)})});return f.error&&c(f.value),o.promise}});var jL=pe,wz=vu;Ii({target:"Promise",stat:!0,forced:qy.CONSTRUCTOR},{reject:function(r){var a=wz.f(this);return jL(a.reject,void 0,r),a.promise}});var Sz=dr,bz=it,Cz=vu,UL=function(r,a){if(Sz(r),bz(a)&&a.constructor===r)return a;var o=Cz.f(r);return(0,o.resolve)(a),o.promise},Tz=Ii,FL=kf,Qy=qy.CONSTRUCTOR,JA=UL,Rz=en("Promise"),BL=!Qy;Tz({target:"Promise",stat:!0,forced:!0},{resolve:function(r){return JA(BL&&this===Rz?FL:this,r)}});var BS=pe,Ul=Tn,O0=vu,xz=A0,Az=S0;Ii({target:"Promise",stat:!0,forced:hd},{allSettled:function(r){var a=this,o=O0.f(a),c=o.resolve,f=o.reject,g=xz(function(){var v=Ul(a.resolve),w=[],T=0,R=1;Az(r,function(A){var L=T++,U=!1;R++,BS(v,a,A).then(function(F){U||(U=!0,w[L]={status:"fulfilled",value:F},--R||c(w))},function(F){U||(U=!0,w[L]={status:"rejected",reason:F},--R||c(w))})}),--R||c(w)});return g.error&&f(g.value),o.promise}});var Iz=pe,Nz=Tn,Oz=en,VL=vu,Rh=A0,wi=S0,QA="No one promise resolved";Ii({target:"Promise",stat:!0,forced:hd},{any:function(r){var a=this,o=Oz("AggregateError"),c=VL.f(a),f=c.resolve,g=c.reject,v=Rh(function(){var w=Nz(a.resolve),T=[],R=0,A=1,L=!1;wi(r,function(U){var F=R++,Z=!1;A++,Iz(w,a,U).then(function(W){Z||L||(L=!0,f(W))},function(W){Z||L||(Z=!0,T[F]=W,--A||g(new o(T,QA)))})}),--A||g(new o(T,QA))});return v.error&&g(v.value),c.promise}});var xc=Ii,VS=kf,Pz=d,Sr=en,Lz=ae,zL=CA,Zy=UL,Dz=VS&&VS.prototype;xc({target:"Promise",proto:!0,real:!0,forced:!!VS&&Pz(function(){Dz.finally.call({then:function(){}},function(){})})},{finally:function(r){var a=zL(this,Sr("Promise")),o=Lz(r);return this.then(o?function(c){return Zy(a,r()).then(function(){return c})}:r,o?function(c){return Zy(a,r()).then(function(){throw c})}:r)}});var ZA=E,kz=Bx,Mz=Ol,jz=Ht,Uz=ZA("".charAt),HL=ZA("".charCodeAt),Fz=ZA("".slice),GL=function(r){return function(a,o){var c,f,g=Mz(jz(a)),v=kz(o),w=g.length;return v<0||v>=w?r?"":void 0:(c=HL(g,v))<55296||c>56319||v+1===w||(f=HL(g,v+1))<56320||f>57343?r?Uz(g,v):c:r?Fz(g,v,v+2):f-56320+(c-55296<<10)+65536}},eI={codeAt:GL(!1),charAt:GL(!0)},Bz=eI.charAt,Vz=Ol,WL=Lf,tI=zy,$L=Hy,zS="String Iterator",zz=WL.set,Hz=WL.getterFor(zS);tI(String,"String",function(r){zz(this,{type:zS,string:Vz(r),index:0})},function(){var r,a=Hz(this),o=a.string,c=a.index;return c>=o.length?$L(void 0,!0):(r=Bz(o,c),a.index+=r.length,$L(r,!1))});var Gz=Me.Promise,Ta={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},rl=N,Wz=dd,$z=aa,KL=om,nI=Xi("toStringTag");for(var iI in Ta){var qL=rl[iI],rI=qL&&qL.prototype;rI&&Wz(rI)!==nI&&$z(rI,nI,iI),KL[iI]=KL.Array}var sI=Gz,Ct=l(sI);let YL=s6;function XL(r,a){let o=r&&r.navigator;if(!o.mediaDevices)return;let c=function(v){if(typeof v!="object"||v.mandatory||v.optional)return v;let w={};return Object.keys(v).forEach(T=>{if(T==="require"||T==="advanced"||T==="mediaSource")return;let R=typeof v[T]=="object"?v[T]:{ideal:v[T]};R.exact!==void 0&&typeof R.exact=="number"&&(R.min=R.max=R.exact);let A=function(L,U){return L?L+U.charAt(0).toUpperCase()+U.slice(1):U==="deviceId"?"sourceId":U};if(R.ideal!==void 0){w.optional=w.optional||[];let L={};typeof R.ideal=="number"?(L[A("min",T)]=R.ideal,w.optional.push(L),L={},L[A("max",T)]=R.ideal,w.optional.push(L)):(L[A("",T)]=R.ideal,w.optional.push(L))}R.exact!==void 0&&typeof R.exact!="number"?(w.mandatory=w.mandatory||{},w.mandatory[A("",T)]=R.exact):["min","max"].forEach(L=>{R[L]!==void 0&&(w.mandatory=w.mandatory||{},w.mandatory[A(L,T)]=R[L])})}),v.advanced&&(w.optional=(w.optional||[]).concat(v.advanced)),w},f=function(v,w){if(a.version>=61)return w(v);if((v=JSON.parse(JSON.stringify(v)))&&typeof v.audio=="object"){let T=function(R,A,L){A in R&&!(L in R)&&(R[L]=R[A],delete R[A])};T((v=JSON.parse(JSON.stringify(v))).audio,"autoGainControl","googAutoGainControl"),T(v.audio,"noiseSuppression","googNoiseSuppression"),v.audio=c(v.audio)}if(v&&typeof v.video=="object"){let T=v.video.facingMode;T=T&&(typeof T=="object"?T:{ideal:T});let R=a.version<66;if(T&&(T.exact==="user"||T.exact==="environment"||T.ideal==="user"||T.ideal==="environment")&&(!o.mediaDevices.getSupportedConstraints||!o.mediaDevices.getSupportedConstraints().facingMode||R)){let A;if(delete v.video.facingMode,T.exact==="environment"||T.ideal==="environment"?A=["back","rear"]:T.exact!=="user"&&T.ideal!=="user"||(A=["front"]),A)return o.mediaDevices.enumerateDevices().then(L=>{let U=(L=L.filter(F=>F.kind==="videoinput")).find(F=>A.some(Z=>{var W;return Tt(W=F.label.toLowerCase()).call(W,Z)}));return!U&&L.length&&Tt(A).call(A,"back")&&(U=L[L.length-1]),U&&(v.video.deviceId=T.exact?{exact:U.deviceId}:{ideal:U.deviceId}),v.video=c(v.video),YL("chrome: "+JSON.stringify(v)),w(v)})}v.video=c(v.video)}return YL("chrome: "+JSON.stringify(v)),w(v)},g=function(v){return a.version>=64?v:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[v.name]||v.name,message:v.message,constraint:v.constraint||v.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(o.getUserMedia=(function(v,w,T){f(v,R=>{o.webkitGetUserMedia(R,w,A=>{T&&T(g(A))})})}).bind(o),o.mediaDevices.getUserMedia){let v=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(w){return f(w,T=>v(T).then(R=>{if(T.audio&&!R.getAudioTracks().length||T.video&&!R.getVideoTracks().length)throw R.getTracks().forEach(A=>{A.stop()}),new DOMException("","NotFoundError");return R},R=>Ct.reject(g(R))))}}}function aI(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function oI(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(o){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=o)},enumerable:!0,configurable:!0});let a=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=o=>{o.stream.addEventListener("addtrack",c=>{let f;f=r.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(v=>v.track&&v.track.id===c.track.id):{track:c.track};let g=new Event("track");g.track=c.track,g.receiver=f,g.transceiver={receiver:f},g.streams=[o.stream],this.dispatchEvent(g)}),o.stream.getTracks().forEach(c=>{let f;f=r.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(v=>v.track&&v.track.id===c.id):{track:c};let g=new Event("track");g.track=c,g.receiver=f,g.transceiver={receiver:f},g.streams=[o.stream],this.dispatchEvent(g)})},this.addEventListener("addstream",this._ontrackpoly)),a.apply(this,arguments)}}else Pl(r,"track",a=>(a.transceiver||Object.defineProperty(a,"transceiver",{value:{receiver:a.receiver}}),a))}function JL(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){let a=function(f,g){return{track:g,get dtmf(){return this._dtmf===void 0&&(g.kind==="audio"?this._dtmf=f.createDTMFSender(g):this._dtmf=null),this._dtmf},_pc:f}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};let f=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(v,w){let T=f.apply(this,arguments);return T||(T=a(this,v),this._senders.push(T)),T};let g=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(v){g.apply(this,arguments);let w=this._senders.indexOf(v);w!==-1&&this._senders.splice(w,1)}}let o=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(f){this._senders=this._senders||[],o.apply(this,[f]),f.getTracks().forEach(g=>{this._senders.push(a(this,g))})};let c=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(f){this._senders=this._senders||[],c.apply(this,[f]),f.getTracks().forEach(g=>{let v=this._senders.find(w=>w.track===g);v&&this._senders.splice(this._senders.indexOf(v),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){let a=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){let o=a.apply(this,[]);return o.forEach(c=>c._pc=this),o},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function QL(r){if(!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){let[o,c,f]=arguments;if(arguments.length>0&&typeof o=="function")return a.apply(this,arguments);if(a.length===0&&(arguments.length===0||typeof o!="function"))return a.apply(this,[]);let g=function(w){let T={};return w.result().forEach(R=>{let A={id:R.id,timestamp:R.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[R.type]||R.type};R.names().forEach(L=>{A[L]=R.stat(L)}),T[A.id]=A}),T},v=function(w){return new Map(Object.keys(w).map(T=>[T,w[T]]))};if(arguments.length>=2){let w=function(T){c(v(g(T)))};return a.apply(this,[w,o])}return new Ct((w,T)=>{a.apply(this,[function(R){w(v(g(R)))},T])}).then(c,f)}}function ZL(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){let o=r.RTCPeerConnection.prototype.getSenders;o&&(r.RTCPeerConnection.prototype.getSenders=function(){let f=o.apply(this,[]);return f.forEach(g=>g._pc=this),f});let c=r.RTCPeerConnection.prototype.addTrack;c&&(r.RTCPeerConnection.prototype.addTrack=function(){let f=c.apply(this,arguments);return f._pc=this,f}),r.RTCRtpSender.prototype.getStats=function(){let f=this;return this._pc.getStats().then(g=>a6(g,f.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){let o=r.RTCPeerConnection.prototype.getReceivers;o&&(r.RTCPeerConnection.prototype.getReceivers=function(){let c=o.apply(this,[]);return c.forEach(f=>f._pc=this),c}),Pl(r,"track",c=>(c.receiver._pc=c.srcElement,c)),r.RTCRtpReceiver.prototype.getStats=function(){let c=this;return this._pc.getStats().then(f=>a6(f,c.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype)||!("getStats"in r.RTCRtpReceiver.prototype))return;let a=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){let o=arguments[0],c,f,g;return this.getSenders().forEach(v=>{v.track===o&&(c?g=!0:c=v)}),this.getReceivers().forEach(v=>(v.track===o&&(f?g=!0:f=v),v.track===o)),g||c&&f?Ct.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):c?c.getStats():f?f.getStats():Ct.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.apply(this,arguments)}}function eD(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(g=>this._shimmedLocalStreams[g][0])};let a=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(g,v){if(!v)return a.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};let w=a.apply(this,arguments);return this._shimmedLocalStreams[v.id]?this._shimmedLocalStreams[v.id].indexOf(w)===-1&&this._shimmedLocalStreams[v.id].push(w):this._shimmedLocalStreams[v.id]=[v,w],w};let o=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(g){this._shimmedLocalStreams=this._shimmedLocalStreams||{},g.getTracks().forEach(T=>{if(this.getSenders().find(R=>R.track===T))throw new DOMException("Track already exists.","InvalidAccessError")});let v=this.getSenders();o.apply(this,arguments);let w=this.getSenders().filter(T=>v.indexOf(T)===-1);this._shimmedLocalStreams[g.id]=[g].concat(w)};let c=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(g){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[g.id],c.apply(this,arguments)};let f=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(g){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},g&&Object.keys(this._shimmedLocalStreams).forEach(v=>{let w=this._shimmedLocalStreams[v].indexOf(g);w!==-1&&this._shimmedLocalStreams[v].splice(w,1),this._shimmedLocalStreams[v].length===1&&delete this._shimmedLocalStreams[v]}),f.apply(this,arguments)}}function _m(r,a){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&a.version>=65)return eD(r);let o=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){let T=o.apply(this);return this._reverseStreams=this._reverseStreams||{},T.map(R=>this._reverseStreams[R.id])};let c=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(T){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},T.getTracks().forEach(R=>{if(this.getSenders().find(A=>A.track===R))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[T.id]){let R=new r.MediaStream(T.getTracks());this._streams[T.id]=R,this._reverseStreams[R.id]=T,T=R}c.apply(this,[T])};let f=r.RTCPeerConnection.prototype.removeStream;function g(T,R){let A=R.sdp;return Object.keys(T._reverseStreams||[]).forEach(L=>{let U=T._reverseStreams[L],F=T._streams[U.id];A=A.replace(new RegExp(F.id,"g"),U.id)}),new RTCSessionDescription({type:R.type,sdp:A})}r.RTCPeerConnection.prototype.removeStream=function(T){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},f.apply(this,[this._streams[T.id]||T]),delete this._reverseStreams[this._streams[T.id]?this._streams[T.id].id:T.id],delete this._streams[T.id]},r.RTCPeerConnection.prototype.addTrack=function(T,R){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");let A=[].slice.call(arguments,1);if(A.length!==1||!A[0].getTracks().find(U=>U===T))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(U=>U.track===T))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};let L=this._streams[R.id];if(L)L.addTrack(T),Ct.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{let U=new r.MediaStream([T]);this._streams[R.id]=U,this._reverseStreams[U.id]=R,this.addStream(U)}return this.getSenders().find(U=>U.track===T)},["createOffer","createAnswer"].forEach(function(T){let R=r.RTCPeerConnection.prototype[T],A={[T](){let L=arguments;return arguments.length&&typeof arguments[0]=="function"?R.apply(this,[U=>{let F=g(this,U);L[0].apply(null,[F])},U=>{L[1]&&L[1].apply(null,U)},arguments[2]]):R.apply(this,arguments).then(U=>g(this,U))}};r.RTCPeerConnection.prototype[T]=A[T]});let v=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(T,R){let A=R.sdp;return Object.keys(T._reverseStreams||[]).forEach(L=>{let U=T._reverseStreams[L],F=T._streams[U.id];A=A.replace(new RegExp(U.id,"g"),F.id)}),new RTCSessionDescription({type:R.type,sdp:A})}(this,arguments[0]),v.apply(this,arguments)):v.apply(this,arguments)};let w=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){let T=w.get.apply(this);return T.type===""?T:g(this,T)}}),r.RTCPeerConnection.prototype.removeTrack=function(T){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!T._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(T._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let R;this._streams=this._streams||{},Object.keys(this._streams).forEach(A=>{this._streams[A].getTracks().find(L=>T.track===L)&&(R=this._streams[A])}),R&&(R.getTracks().length===1?this.removeStream(this._reverseStreams[R.id]):R.removeTrack(T.track),this.dispatchEvent(new Event("negotiationneeded")))}}function lI(r,a){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&a.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(o){let c=r.RTCPeerConnection.prototype[o],f={[o](){return arguments[0]=new(o==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),c.apply(this,arguments)}};r.RTCPeerConnection.prototype[o]=f[o]})}function tD(r,a){Pl(r,"negotiationneeded",o=>{let c=o.target;if(!(a.version<72||c.getConfiguration&&c.getConfiguration().sdpSemantics==="plan-b")||c.signalingState==="stable")return o})}var nD=Object.freeze({__proto__:null,fixNegotiationNeeded:tD,shimAddTrackRemoveTrack:_m,shimAddTrackRemoveTrackWithNative:eD,shimGetDisplayMedia:function(r,a){r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices||r.navigator.mediaDevices&&(typeof a=="function"?r.navigator.mediaDevices.getDisplayMedia=function(o){return a(o).then(c=>{let f=o.video&&o.video.width,g=o.video&&o.video.height,v=o.video&&o.video.frameRate;return o.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:c,maxFrameRate:v||3}},f&&(o.video.mandatory.maxWidth=f),g&&(o.video.mandatory.maxHeight=g),r.navigator.mediaDevices.getUserMedia(o)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))},shimGetSendersWithDtmf:JL,shimGetStats:QL,shimGetUserMedia:XL,shimMediaStream:aI,shimOnTrack:oI,shimPeerConnection:lI,shimSenderReceiverGetStats:ZL});function iD(r,a){let o=r&&r.navigator,c=r&&r.MediaStreamTrack;if(o.getUserMedia=function(f,g,v){Yx("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),o.mediaDevices.getUserMedia(f).then(g,v)},!(a.version>55&&"autoGainControl"in o.mediaDevices.getSupportedConstraints())){let f=function(v,w,T){w in v&&!(T in v)&&(v[T]=v[w],delete v[w])},g=o.mediaDevices.getUserMedia.bind(o.mediaDevices);if(o.mediaDevices.getUserMedia=function(v){return typeof v=="object"&&typeof v.audio=="object"&&(v=JSON.parse(JSON.stringify(v)),f(v.audio,"autoGainControl","mozAutoGainControl"),f(v.audio,"noiseSuppression","mozNoiseSuppression")),g(v)},c&&c.prototype.getSettings){let v=c.prototype.getSettings;c.prototype.getSettings=function(){let w=v.apply(this,arguments);return f(w,"mozAutoGainControl","autoGainControl"),f(w,"mozNoiseSuppression","noiseSuppression"),w}}if(c&&c.prototype.applyConstraints){let v=c.prototype.applyConstraints;c.prototype.applyConstraints=function(w){return this.kind==="audio"&&typeof w=="object"&&(w=JSON.parse(JSON.stringify(w)),f(w,"autoGainControl","mozAutoGainControl"),f(w,"noiseSuppression","mozNoiseSuppression")),v.apply(this,[w])}}}}function rD(r){typeof r=="object"&&r.RTCTrackEvent&&"receiver"in r.RTCTrackEvent.prototype&&!("transceiver"in r.RTCTrackEvent.prototype)&&Object.defineProperty(r.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function HS(r,a){if(typeof r!="object"||!r.RTCPeerConnection&&!r.mozRTCPeerConnection)return;!r.RTCPeerConnection&&r.mozRTCPeerConnection&&(r.RTCPeerConnection=r.mozRTCPeerConnection),a.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(f){let g=r.RTCPeerConnection.prototype[f],v={[f](){return arguments[0]=new(f==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),g.apply(this,arguments)}};r.RTCPeerConnection.prototype[f]=v[f]});let o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},c=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){let[f,g,v]=arguments;return c.apply(this,[f||null]).then(w=>{if(a.version<53&&!g)try{w.forEach(T=>{T.type=o[T.type]||T.type})}catch(T){if(T.name!=="TypeError")throw T;w.forEach((R,A)=>{w.set(A,Object.assign({},R,{type:o[R.type]||R.type}))})}return w}).then(g,v)}}function cI(r){if(typeof r!="object"||!r.RTCPeerConnection||!r.RTCRtpSender||r.RTCRtpSender&&"getStats"in r.RTCRtpSender.prototype)return;let a=r.RTCPeerConnection.prototype.getSenders;a&&(r.RTCPeerConnection.prototype.getSenders=function(){let c=a.apply(this,[]);return c.forEach(f=>f._pc=this),c});let o=r.RTCPeerConnection.prototype.addTrack;o&&(r.RTCPeerConnection.prototype.addTrack=function(){let c=o.apply(this,arguments);return c._pc=this,c}),r.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Ct.resolve(new Map)}}function sD(r){if(typeof r!="object"||!r.RTCPeerConnection||!r.RTCRtpSender||r.RTCRtpSender&&"getStats"in r.RTCRtpReceiver.prototype)return;let a=r.RTCPeerConnection.prototype.getReceivers;a&&(r.RTCPeerConnection.prototype.getReceivers=function(){let o=a.apply(this,[]);return o.forEach(c=>c._pc=this),o}),Pl(r,"track",o=>(o.receiver._pc=o.srcElement,o)),r.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function aD(r){r.RTCPeerConnection&&!("removeStream"in r.RTCPeerConnection.prototype)&&(r.RTCPeerConnection.prototype.removeStream=function(a){Yx("removeStream","removeTrack"),this.getSenders().forEach(o=>{var c;o.track&&Tt(c=a.getTracks()).call(c,o.track)&&this.removeTrack(o)})})}function oD(r){r.DataChannel&&!r.RTCDataChannel&&(r.RTCDataChannel=r.DataChannel)}function lD(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.addTransceiver;a&&(r.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let o=arguments[1]&&arguments[1].sendEncodings;o===void 0&&(o=[]),o=[...o];let c=o.length>0;c&&o.forEach(g=>{if("rid"in g&&!/^[a-z0-9]{0,16}$/i.test(g.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in g&&!(parseFloat(g.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in g&&!(parseFloat(g.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});let f=a.apply(this,arguments);if(c){let{sender:g}=f,v=g.getParameters();(!("encodings"in v)||v.encodings.length===1&&Object.keys(v.encodings[0]).length===0)&&(v.encodings=o,g.sendEncodings=o,this.setParametersPromises.push(g.setParameters(v).then(()=>{delete g.sendEncodings}).catch(()=>{delete g.sendEncodings})))}return f})}function cD(r){if(typeof r!="object"||!r.RTCRtpSender)return;let a=r.RTCRtpSender.prototype.getParameters;a&&(r.RTCRtpSender.prototype.getParameters=function(){let o=a.apply(this,arguments);return"encodings"in o||(o.encodings=[].concat(this.sendEncodings||[{}])),o})}function dD(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.createOffer;r.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Ct.all(this.setParametersPromises).then(()=>a.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):a.apply(this,arguments)}}function uD(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.createAnswer;r.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Ct.all(this.setParametersPromises).then(()=>a.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):a.apply(this,arguments)}}var hD=Object.freeze({__proto__:null,shimAddTransceiver:lD,shimCreateAnswer:uD,shimCreateOffer:dD,shimGetDisplayMedia:function(r,a){r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices||r.navigator.mediaDevices&&(r.navigator.mediaDevices.getDisplayMedia=function(o){if(!o||!o.video){let c=new DOMException("getDisplayMedia without video constraints is undefined");return c.name="NotFoundError",c.code=8,Ct.reject(c)}return o.video===!0?o.video={mediaSource:a}:o.video.mediaSource=a,r.navigator.mediaDevices.getUserMedia(o)})},shimGetParameters:cD,shimGetUserMedia:iD,shimOnTrack:rD,shimPeerConnection:HS,shimRTCDataChannel:oD,shimReceiverGetStats:sD,shimRemoveStream:aD,shimSenderGetStats:cI});function fD(r){if(typeof r=="object"&&r.RTCPeerConnection){if("getLocalStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in r.RTCPeerConnection.prototype)){let a=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addStream=function(o){var c;this._localStreams||(this._localStreams=[]),Tt(c=this._localStreams).call(c,o)||this._localStreams.push(o),o.getAudioTracks().forEach(f=>a.call(this,f,o)),o.getVideoTracks().forEach(f=>a.call(this,f,o))},r.RTCPeerConnection.prototype.addTrack=function(o){for(var c=arguments.length,f=new Array(c>1?c-1:0),g=1;g<c;g++)f[g-1]=arguments[g];return f&&f.forEach(v=>{var w;this._localStreams?Tt(w=this._localStreams).call(w,v)||this._localStreams.push(v):this._localStreams=[v]}),a.apply(this,arguments)}}"removeStream"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.removeStream=function(a){this._localStreams||(this._localStreams=[]);let o=this._localStreams.indexOf(a);if(o===-1)return;this._localStreams.splice(o,1);let c=a.getTracks();this.getSenders().forEach(f=>{Tt(c).call(c,f.track)&&this.removeTrack(f)})})}}function pD(r){if(typeof r=="object"&&r.RTCPeerConnection&&("getRemoteStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in r.RTCPeerConnection.prototype))){Object.defineProperty(r.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(o){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=o),this.addEventListener("track",this._onaddstreampoly=c=>{c.streams.forEach(f=>{var g;if(this._remoteStreams||(this._remoteStreams=[]),Tt(g=this._remoteStreams).call(g,f))return;this._remoteStreams.push(f);let v=new Event("addstream");v.stream=f,this.dispatchEvent(v)})})}});let a=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){let o=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(c){c.streams.forEach(f=>{if(o._remoteStreams||(o._remoteStreams=[]),o._remoteStreams.indexOf(f)>=0)return;o._remoteStreams.push(f);let g=new Event("addstream");g.stream=f,o.dispatchEvent(g)})}),a.apply(o,arguments)}}}function mD(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype,o=a.createOffer,c=a.createAnswer,f=a.setLocalDescription,g=a.setRemoteDescription,v=a.addIceCandidate;a.createOffer=function(T,R){let A=arguments.length>=2?arguments[2]:arguments[0],L=o.apply(this,[A]);return R?(L.then(T,R),Ct.resolve()):L},a.createAnswer=function(T,R){let A=arguments.length>=2?arguments[2]:arguments[0],L=c.apply(this,[A]);return R?(L.then(T,R),Ct.resolve()):L};let w=function(T,R,A){let L=f.apply(this,[T]);return A?(L.then(R,A),Ct.resolve()):L};a.setLocalDescription=w,w=function(T,R,A){let L=g.apply(this,[T]);return A?(L.then(R,A),Ct.resolve()):L},a.setRemoteDescription=w,w=function(T,R,A){let L=v.apply(this,[T]);return A?(L.then(R,A),Ct.resolve()):L},a.addIceCandidate=w}function gD(r){let a=r&&r.navigator;if(a.mediaDevices&&a.mediaDevices.getUserMedia){let o=a.mediaDevices,c=o.getUserMedia.bind(o);a.mediaDevices.getUserMedia=f=>c(vD(f))}!a.getUserMedia&&a.mediaDevices&&a.mediaDevices.getUserMedia&&(a.getUserMedia=(function(o,c,f){a.mediaDevices.getUserMedia(o).then(c,f)}).bind(a))}function vD(r){return r&&r.video!==void 0?Object.assign({},r,{video:wy(r.video)}):r}function yD(r){if(!r.RTCPeerConnection)return;let a=r.RTCPeerConnection;r.RTCPeerConnection=function(o,c){if(o&&o.iceServers){let f=[];for(let g=0;g<o.iceServers.length;g++){let v=o.iceServers[g];!v.hasOwnProperty("urls")&&v.hasOwnProperty("url")?(Yx("RTCIceServer.url","RTCIceServer.urls"),v=JSON.parse(JSON.stringify(v)),v.urls=v.url,delete v.url,f.push(v)):f.push(o.iceServers[g])}o.iceServers=f}return new a(o,c)},r.RTCPeerConnection.prototype=a.prototype,"generateCertificate"in a&&Object.defineProperty(r.RTCPeerConnection,"generateCertificate",{get:()=>a.generateCertificate})}function _D(r){typeof r=="object"&&r.RTCTrackEvent&&"receiver"in r.RTCTrackEvent.prototype&&!("transceiver"in r.RTCTrackEvent.prototype)&&Object.defineProperty(r.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ED(r){let a=r.RTCPeerConnection.prototype.createOffer;r.RTCPeerConnection.prototype.createOffer=function(o){if(o){o.offerToReceiveAudio!==void 0&&(o.offerToReceiveAudio=!!o.offerToReceiveAudio);let c=this.getTransceivers().find(g=>g.receiver.track.kind==="audio");o.offerToReceiveAudio===!1&&c?c.direction==="sendrecv"?c.setDirection?c.setDirection("sendonly"):c.direction="sendonly":c.direction==="recvonly"&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive"):o.offerToReceiveAudio!==!0||c||this.addTransceiver("audio",{direction:"recvonly"}),o.offerToReceiveVideo!==void 0&&(o.offerToReceiveVideo=!!o.offerToReceiveVideo);let f=this.getTransceivers().find(g=>g.receiver.track.kind==="video");o.offerToReceiveVideo===!1&&f?f.direction==="sendrecv"?f.setDirection?f.setDirection("sendonly"):f.direction="sendonly":f.direction==="recvonly"&&(f.setDirection?f.setDirection("inactive"):f.direction="inactive"):o.offerToReceiveVideo!==!0||f||this.addTransceiver("video",{direction:"recvonly"})}return a.apply(this,arguments)}}function wD(r){typeof r!="object"||r.AudioContext||(r.AudioContext=r.webkitAudioContext)}var SD=Object.freeze({__proto__:null,shimAudioContext:wD,shimCallbacksAPI:mD,shimConstraints:vD,shimCreateOfferLegacy:ED,shimGetUserMedia:gD,shimLocalStreamsAPI:fD,shimRTCIceServerUrls:yD,shimRemoteStreamsAPI:pD,shimTrackEventTransceiver:_D}),bD=`
\v\f\r                 \u2028\u2029\uFEFF`,Kz=Ht,qz=Ol,dI=bD,CD=E("".replace),Yz=RegExp("^["+dI+"]+"),Xz=RegExp("(^|[^"+dI+"])["+dI+"]+$"),e_=function(r){return function(a){var o=qz(Kz(a));return 1&r&&(o=CD(o,Yz,"")),2&r&&(o=CD(o,Xz,"$1")),o}},TD={start:e_(1),end:e_(2),trim:e_(3)},RD=hA.PROPER,Jz=d,xD=bD,Qz=TD.trim;Ii({target:"String",proto:!0,forced:function(r){return Jz(function(){return!!xD[r]()||"​…᠎"[r]()!=="​…᠎"||RD&&xD[r].name!==r})}("trim")},{trim:function(){return Qz(this)}});var uI=wc("String").trim,Zz=C,eH=uI,hI=String.prototype,sl=function(r){var a=r.trim;return typeof r=="string"||r===hI||Zz(hI,r)&&a===hI.trim?eH:a},Us=l(sl),AD={exports:{}};(function(r){let a={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};a.localCName=a.generateIdentifier(),a.splitLines=function(o){return o.trim().split(`
`).map(c=>c.trim())},a.splitSections=function(o){return o.split(`
m=`).map((c,f)=>(f>0?"m="+c:c).trim()+`\r
`)},a.getDescription=function(o){let c=a.splitSections(o);return c&&c[0]},a.getMediaSections=function(o){let c=a.splitSections(o);return c.shift(),c},a.matchPrefix=function(o,c){return a.splitLines(o).filter(f=>f.indexOf(c)===0)},a.parseCandidate=function(o){let c;c=o.indexOf("a=candidate:")===0?o.substring(12).split(" "):o.substring(10).split(" ");let f={foundation:c[0],component:{1:"rtp",2:"rtcp"}[c[1]]||c[1],protocol:c[2].toLowerCase(),priority:parseInt(c[3],10),ip:c[4],address:c[4],port:parseInt(c[5],10),type:c[7]};for(let g=8;g<c.length;g+=2)switch(c[g]){case"raddr":f.relatedAddress=c[g+1];break;case"rport":f.relatedPort=parseInt(c[g+1],10);break;case"tcptype":f.tcpType=c[g+1];break;case"ufrag":f.ufrag=c[g+1],f.usernameFragment=c[g+1];break;default:f[c[g]]===void 0&&(f[c[g]]=c[g+1])}return f},a.writeCandidate=function(o){let c=[];c.push(o.foundation);let f=o.component;f==="rtp"?c.push(1):f==="rtcp"?c.push(2):c.push(f),c.push(o.protocol.toUpperCase()),c.push(o.priority),c.push(o.address||o.ip),c.push(o.port);let g=o.type;return c.push("typ"),c.push(g),g!=="host"&&o.relatedAddress&&o.relatedPort&&(c.push("raddr"),c.push(o.relatedAddress),c.push("rport"),c.push(o.relatedPort)),o.tcpType&&o.protocol.toLowerCase()==="tcp"&&(c.push("tcptype"),c.push(o.tcpType)),(o.usernameFragment||o.ufrag)&&(c.push("ufrag"),c.push(o.usernameFragment||o.ufrag)),"candidate:"+c.join(" ")},a.parseIceOptions=function(o){return o.substring(14).split(" ")},a.parseRtpMap=function(o){let c=o.substring(9).split(" "),f={payloadType:parseInt(c.shift(),10)};return c=c[0].split("/"),f.name=c[0],f.clockRate=parseInt(c[1],10),f.channels=c.length===3?parseInt(c[2],10):1,f.numChannels=f.channels,f},a.writeRtpMap=function(o){let c=o.payloadType;o.preferredPayloadType!==void 0&&(c=o.preferredPayloadType);let f=o.channels||o.numChannels||1;return"a=rtpmap:"+c+" "+o.name+"/"+o.clockRate+(f!==1?"/"+f:"")+`\r
`},a.parseExtmap=function(o){let c=o.substring(9).split(" ");return{id:parseInt(c[0],10),direction:c[0].indexOf("/")>0?c[0].split("/")[1]:"sendrecv",uri:c[1],attributes:c.slice(2).join(" ")}},a.writeExtmap=function(o){return"a=extmap:"+(o.id||o.preferredId)+(o.direction&&o.direction!=="sendrecv"?"/"+o.direction:"")+" "+o.uri+(o.attributes?" "+o.attributes:"")+`\r
`},a.parseFmtp=function(o){let c={},f,g=o.substring(o.indexOf(" ")+1).split(";");for(let v=0;v<g.length;v++)f=g[v].trim().split("="),c[f[0].trim()]=f[1];return c},a.writeFmtp=function(o){let c="",f=o.payloadType;if(o.preferredPayloadType!==void 0&&(f=o.preferredPayloadType),o.parameters&&Object.keys(o.parameters).length){let g=[];Object.keys(o.parameters).forEach(v=>{o.parameters[v]!==void 0?g.push(v+"="+o.parameters[v]):g.push(v)}),c+="a=fmtp:"+f+" "+g.join(";")+`\r
`}return c},a.parseRtcpFb=function(o){let c=o.substring(o.indexOf(" ")+1).split(" ");return{type:c.shift(),parameter:c.join(" ")}},a.writeRtcpFb=function(o){let c="",f=o.payloadType;return o.preferredPayloadType!==void 0&&(f=o.preferredPayloadType),o.rtcpFeedback&&o.rtcpFeedback.length&&o.rtcpFeedback.forEach(g=>{c+="a=rtcp-fb:"+f+" "+g.type+(g.parameter&&g.parameter.length?" "+g.parameter:"")+`\r
`}),c},a.parseSsrcMedia=function(o){let c=o.indexOf(" "),f={ssrc:parseInt(o.substring(7,c),10)},g=o.indexOf(":",c);return g>-1?(f.attribute=o.substring(c+1,g),f.value=o.substring(g+1)):f.attribute=o.substring(c+1),f},a.parseSsrcGroup=function(o){let c=o.substring(13).split(" ");return{semantics:c.shift(),ssrcs:c.map(f=>parseInt(f,10))}},a.getMid=function(o){let c=a.matchPrefix(o,"a=mid:")[0];if(c)return c.substring(6)},a.parseFingerprint=function(o){let c=o.substring(14).split(" ");return{algorithm:c[0].toLowerCase(),value:c[1].toUpperCase()}},a.getDtlsParameters=function(o,c){return{role:"auto",fingerprints:a.matchPrefix(o+c,"a=fingerprint:").map(a.parseFingerprint)}},a.writeDtlsParameters=function(o,c){let f="a=setup:"+c+`\r
`;return o.fingerprints.forEach(g=>{f+="a=fingerprint:"+g.algorithm+" "+g.value+`\r
`}),f},a.parseCryptoLine=function(o){let c=o.substring(9).split(" ");return{tag:parseInt(c[0],10),cryptoSuite:c[1],keyParams:c[2],sessionParams:c.slice(3)}},a.writeCryptoLine=function(o){return"a=crypto:"+o.tag+" "+o.cryptoSuite+" "+(typeof o.keyParams=="object"?a.writeCryptoKeyParams(o.keyParams):o.keyParams)+(o.sessionParams?" "+o.sessionParams.join(" "):"")+`\r
`},a.parseCryptoKeyParams=function(o){if(o.indexOf("inline:")!==0)return null;let c=o.substring(7).split("|");return{keyMethod:"inline",keySalt:c[0],lifeTime:c[1],mkiValue:c[2]?c[2].split(":")[0]:void 0,mkiLength:c[2]?c[2].split(":")[1]:void 0}},a.writeCryptoKeyParams=function(o){return o.keyMethod+":"+o.keySalt+(o.lifeTime?"|"+o.lifeTime:"")+(o.mkiValue&&o.mkiLength?"|"+o.mkiValue+":"+o.mkiLength:"")},a.getCryptoParameters=function(o,c){return a.matchPrefix(o+c,"a=crypto:").map(a.parseCryptoLine)},a.getIceParameters=function(o,c){let f=a.matchPrefix(o+c,"a=ice-ufrag:")[0],g=a.matchPrefix(o+c,"a=ice-pwd:")[0];return f&&g?{usernameFragment:f.substring(12),password:g.substring(10)}:null},a.writeIceParameters=function(o){let c="a=ice-ufrag:"+o.usernameFragment+`\r
a=ice-pwd:`+o.password+`\r
`;return o.iceLite&&(c+=`a=ice-lite\r
`),c},a.parseRtpParameters=function(o){let c={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},f=a.splitLines(o)[0].split(" ");c.profile=f[2];for(let v=3;v<f.length;v++){let w=f[v],T=a.matchPrefix(o,"a=rtpmap:"+w+" ")[0];if(T){let R=a.parseRtpMap(T),A=a.matchPrefix(o,"a=fmtp:"+w+" ");switch(R.parameters=A.length?a.parseFmtp(A[0]):{},R.rtcpFeedback=a.matchPrefix(o,"a=rtcp-fb:"+w+" ").map(a.parseRtcpFb),c.codecs.push(R),R.name.toUpperCase()){case"RED":case"ULPFEC":c.fecMechanisms.push(R.name.toUpperCase())}}}a.matchPrefix(o,"a=extmap:").forEach(v=>{c.headerExtensions.push(a.parseExtmap(v))});let g=a.matchPrefix(o,"a=rtcp-fb:* ").map(a.parseRtcpFb);return c.codecs.forEach(v=>{g.forEach(w=>{v.rtcpFeedback.find(T=>T.type===w.type&&T.parameter===w.parameter)||v.rtcpFeedback.push(w)})}),c},a.writeRtpDescription=function(o,c){let f="";f+="m="+o+" ",f+=c.codecs.length>0?"9":"0",f+=" "+(c.profile||"UDP/TLS/RTP/SAVPF")+" ",f+=c.codecs.map(v=>v.preferredPayloadType!==void 0?v.preferredPayloadType:v.payloadType).join(" ")+`\r
`,f+=`c=IN IP4 0.0.0.0\r
`,f+=`a=rtcp:9 IN IP4 0.0.0.0\r
`,c.codecs.forEach(v=>{f+=a.writeRtpMap(v),f+=a.writeFmtp(v),f+=a.writeRtcpFb(v)});let g=0;return c.codecs.forEach(v=>{v.maxptime>g&&(g=v.maxptime)}),g>0&&(f+="a=maxptime:"+g+`\r
`),c.headerExtensions&&c.headerExtensions.forEach(v=>{f+=a.writeExtmap(v)}),f},a.parseRtpEncodingParameters=function(o){let c=[],f=a.parseRtpParameters(o),g=f.fecMechanisms.indexOf("RED")!==-1,v=f.fecMechanisms.indexOf("ULPFEC")!==-1,w=a.matchPrefix(o,"a=ssrc:").map(U=>a.parseSsrcMedia(U)).filter(U=>U.attribute==="cname"),T=w.length>0&&w[0].ssrc,R,A=a.matchPrefix(o,"a=ssrc-group:FID").map(U=>U.substring(17).split(" ").map(F=>parseInt(F,10)));A.length>0&&A[0].length>1&&A[0][0]===T&&(R=A[0][1]),f.codecs.forEach(U=>{if(U.name.toUpperCase()==="RTX"&&U.parameters.apt){let F={ssrc:T,codecPayloadType:parseInt(U.parameters.apt,10)};T&&R&&(F.rtx={ssrc:R}),c.push(F),g&&(F=JSON.parse(JSON.stringify(F)),F.fec={ssrc:T,mechanism:v?"red+ulpfec":"red"},c.push(F))}}),c.length===0&&T&&c.push({ssrc:T});let L=a.matchPrefix(o,"b=");return L.length&&(L=L[0].indexOf("b=TIAS:")===0?parseInt(L[0].substring(7),10):L[0].indexOf("b=AS:")===0?1e3*parseInt(L[0].substring(5),10)*.95-16e3:void 0,c.forEach(U=>{U.maxBitrate=L})),c},a.parseRtcpParameters=function(o){let c={},f=a.matchPrefix(o,"a=ssrc:").map(w=>a.parseSsrcMedia(w)).filter(w=>w.attribute==="cname")[0];f&&(c.cname=f.value,c.ssrc=f.ssrc);let g=a.matchPrefix(o,"a=rtcp-rsize");c.reducedSize=g.length>0,c.compound=g.length===0;let v=a.matchPrefix(o,"a=rtcp-mux");return c.mux=v.length>0,c},a.writeRtcpParameters=function(o){let c="";return o.reducedSize&&(c+=`a=rtcp-rsize\r
`),o.mux&&(c+=`a=rtcp-mux\r
`),o.ssrc!==void 0&&o.cname&&(c+="a=ssrc:"+o.ssrc+" cname:"+o.cname+`\r
`),c},a.parseMsid=function(o){let c,f=a.matchPrefix(o,"a=msid:");if(f.length===1)return c=f[0].substring(7).split(" "),{stream:c[0],track:c[1]};let g=a.matchPrefix(o,"a=ssrc:").map(v=>a.parseSsrcMedia(v)).filter(v=>v.attribute==="msid");return g.length>0?(c=g[0].value.split(" "),{stream:c[0],track:c[1]}):void 0},a.parseSctpDescription=function(o){let c=a.parseMLine(o),f=a.matchPrefix(o,"a=max-message-size:"),g;f.length>0&&(g=parseInt(f[0].substring(19),10)),isNaN(g)&&(g=65536);let v=a.matchPrefix(o,"a=sctp-port:");if(v.length>0)return{port:parseInt(v[0].substring(12),10),protocol:c.fmt,maxMessageSize:g};let w=a.matchPrefix(o,"a=sctpmap:");if(w.length>0){let T=w[0].substring(10).split(" ");return{port:parseInt(T[0],10),protocol:T[1],maxMessageSize:g}}},a.writeSctpDescription=function(o,c){let f=[];return f=o.protocol!=="DTLS/SCTP"?["m="+o.kind+" 9 "+o.protocol+" "+c.protocol+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctp-port:"+c.port+`\r
`]:["m="+o.kind+" 9 "+o.protocol+" "+c.port+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctpmap:"+c.port+" "+c.protocol+` 65535\r
`],c.maxMessageSize!==void 0&&f.push("a=max-message-size:"+c.maxMessageSize+`\r
`),f.join("")},a.generateSessionId=function(){return Math.random().toString().substr(2,22)},a.writeSessionBoilerplate=function(o,c,f){let g,v=c!==void 0?c:2;return g=o||a.generateSessionId(),`v=0\r
o=`+(f||"thisisadapterortc")+" "+g+" "+v+` IN IP4 127.0.0.1\r
s=-\r
t=0 0\r
`},a.getDirection=function(o,c){let f=a.splitLines(o);for(let g=0;g<f.length;g++)switch(f[g]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return f[g].substring(2)}return c?a.getDirection(c):"sendrecv"},a.getKind=function(o){return a.splitLines(o)[0].split(" ")[0].substring(2)},a.isRejected=function(o){return o.split(" ",2)[1]==="0"},a.parseMLine=function(o){let c=a.splitLines(o)[0].substring(2).split(" ");return{kind:c[0],port:parseInt(c[1],10),protocol:c[2],fmt:c.slice(3).join(" ")}},a.parseOLine=function(o){let c=a.matchPrefix(o,"o=")[0].substring(2).split(" ");return{username:c[0],sessionId:c[1],sessionVersion:parseInt(c[2],10),netType:c[3],addressType:c[4],address:c[5]}},a.isValidSDP=function(o){if(typeof o!="string"||o.length===0)return!1;let c=a.splitLines(o);for(let f=0;f<c.length;f++)if(c[f].length<2||c[f].charAt(1)!=="=")return!1;return!0},r.exports=a})(AD);var ID=AD.exports,P0=l(ID),tH=i({__proto__:null,default:P0},[ID]);function L0(r){if(!r.RTCIceCandidate||r.RTCIceCandidate&&"foundation"in r.RTCIceCandidate.prototype)return;let a=r.RTCIceCandidate;r.RTCIceCandidate=function(o){if(typeof o=="object"&&o.candidate&&o.candidate.indexOf("a=")===0&&((o=JSON.parse(JSON.stringify(o))).candidate=o.candidate.substr(2)),o.candidate&&o.candidate.length){let c=new a(o),f=P0.parseCandidate(o.candidate),g=Object.assign(c,f);return g.toJSON=function(){return{candidate:g.candidate,sdpMid:g.sdpMid,sdpMLineIndex:g.sdpMLineIndex,usernameFragment:g.usernameFragment}},g}return new a(o)},r.RTCIceCandidate.prototype=a.prototype,Pl(r,"icecandidate",o=>(o.candidate&&Object.defineProperty(o,"candidate",{value:new r.RTCIceCandidate(o.candidate),writable:"false"}),o))}function fI(r){!r.RTCIceCandidate||r.RTCIceCandidate&&"relayProtocol"in r.RTCIceCandidate.prototype||Pl(r,"icecandidate",a=>{if(a.candidate){let o=P0.parseCandidate(a.candidate.candidate);o.type==="relay"&&(a.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[o.priority>>24])}return a})}function D0(r,a){if(!r.RTCPeerConnection)return;"sctp"in r.RTCPeerConnection.prototype||Object.defineProperty(r.RTCPeerConnection.prototype,"sctp",{get(){return this._sctp===void 0?null:this._sctp}});let o=function(w){if(!w||!w.sdp)return!1;let T=P0.splitSections(w.sdp);return T.shift(),T.some(R=>{let A=P0.parseMLine(R);return A&&A.kind==="application"&&A.protocol.indexOf("SCTP")!==-1})},c=function(w){let T=w.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(T===null||T.length<2)return-1;let R=parseInt(T[1],10);return R!=R?-1:R},f=function(w){let T=65536;return a.browser==="firefox"&&(T=a.version<57?w===-1?16384:2147483637:a.version<60?a.version===57?65535:65536:2147483637),T},g=function(w,T){let R=65536;a.browser==="firefox"&&a.version===57&&(R=65535);let A=P0.matchPrefix(w.sdp,"a=max-message-size:");return A.length>0?R=parseInt(A[0].substr(19),10):a.browser==="firefox"&&T!==-1&&(R=2147483637),R},v=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,a.browser==="chrome"&&a.version>=76){let{sdpSemantics:w}=this.getConfiguration();w==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(o(arguments[0])){let w=c(arguments[0]),T=f(w),R=g(arguments[0],w),A;A=T===0&&R===0?Number.POSITIVE_INFINITY:T===0||R===0?Math.max(T,R):Math.min(T,R);let L={};Object.defineProperty(L,"maxMessageSize",{get:()=>A}),this._sctp=L}return v.apply(this,arguments)}}function GS(r){if(!r.RTCPeerConnection||!("createDataChannel"in r.RTCPeerConnection.prototype))return;function a(c,f){let g=c.send;c.send=function(){let v=arguments[0],w=v.length||v.size||v.byteLength;if(c.readyState==="open"&&f.sctp&&w>f.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+f.sctp.maxMessageSize+" bytes)");return g.apply(c,arguments)}}let o=r.RTCPeerConnection.prototype.createDataChannel;r.RTCPeerConnection.prototype.createDataChannel=function(){let c=o.apply(this,arguments);return a(c,this),c},Pl(r,"datachannel",c=>(a(c.channel,c.target),c))}function pI(r){if(!r.RTCPeerConnection||"connectionState"in r.RTCPeerConnection.prototype)return;let a=r.RTCPeerConnection.prototype;Object.defineProperty(a,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(a,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(o){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),o&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=o)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(o=>{let c=a[o];a[o]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=f=>{let g=f.target;if(g._lastConnectionState!==g.connectionState){g._lastConnectionState=g.connectionState;let v=new Event("connectionstatechange",f);g.dispatchEvent(v)}return f},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),c.apply(this,arguments)}})}function mI(r,a){if(!r.RTCPeerConnection||a.browser==="chrome"&&a.version>=71||a.browser==="safari"&&a.version>=605)return;let o=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(c){if(c&&c.sdp&&c.sdp.indexOf(`
a=extmap-allow-mixed`)!==-1){let f=c.sdp.split(`
`).filter(g=>Us(g).call(g)!=="a=extmap-allow-mixed").join(`
`);r.RTCSessionDescription&&c instanceof r.RTCSessionDescription?arguments[0]=new r.RTCSessionDescription({type:c.type,sdp:f}):c.sdp=f}return o.apply(this,arguments)}}function WS(r,a){if(!r.RTCPeerConnection||!r.RTCPeerConnection.prototype)return;let o=r.RTCPeerConnection.prototype.addIceCandidate;o&&o.length!==0&&(r.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(a.browser==="chrome"&&a.version<78||a.browser==="firefox"&&a.version<68||a.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Ct.resolve():o.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Ct.resolve())})}function t_(r,a){if(!r.RTCPeerConnection||!r.RTCPeerConnection.prototype)return;let o=r.RTCPeerConnection.prototype.setLocalDescription;o&&o.length!==0&&(r.RTCPeerConnection.prototype.setLocalDescription=function(){let c=arguments[0]||{};if(typeof c!="object"||c.type&&c.sdp)return o.apply(this,arguments);if(c={type:c.type,sdp:c.sdp},!c.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":c.type="offer";break;default:c.type="answer"}return c.sdp||c.type!=="offer"&&c.type!=="answer"?o.apply(this,[c]):(c.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(f=>o.apply(this,[f]))})}var nH=Object.freeze({__proto__:null,removeExtmapAllowMixed:mI,shimAddIceCandidateNullOrEmpty:WS,shimConnectionState:pI,shimMaxMessageSize:D0,shimParameterlessSetLocalDescription:t_,shimRTCIceCandidate:L0,shimRTCIceCandidateRelayProtocol:fI,shimSendThrowTypeError:GS});(function(){let{window:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0},o=s6,c=function(g){let v={browser:null,version:null};if(g===void 0||!g.navigator)return v.browser="Not a browser.",v;let{navigator:w}=g;if(w.mozGetUserMedia)v.browser="firefox",v.version=Nf(w.userAgent,/Firefox\/(\d+)\./,1);else if(w.webkitGetUserMedia||g.isSecureContext===!1&&g.webkitRTCPeerConnection)v.browser="chrome",v.version=Nf(w.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!g.RTCPeerConnection||!w.userAgent.match(/AppleWebKit\/(\d+)\./))return v.browser="Not a supported browser.",v;v.browser="safari",v.version=Nf(w.userAgent,/AppleWebKit\/(\d+)\./,1),v.supportsUnifiedPlan=g.RTCRtpTransceiver&&"currentDirection"in g.RTCRtpTransceiver.prototype}return v}(r),f={browserDetails:c,commonShim:nH,extractVersion:Nf,disableLog:Kw,disableWarnings:yB,sdp:tH};switch(c.browser){case"chrome":if(!nD||!lI||!a.shimChrome)return o("Chrome shim is not included in this adapter release."),f;if(c.version===null)return o("Chrome shim can not determine version, not shimming."),f;o("adapter.js shimming chrome."),f.browserShim=nD,WS(r,c),t_(r),XL(r,c),aI(r),lI(r,c),oI(r),_m(r,c),JL(r),QL(r),ZL(r),tD(r,c),L0(r),fI(r),pI(r),D0(r,c),GS(r),mI(r,c);break;case"firefox":if(!hD||!HS||!a.shimFirefox)return o("Firefox shim is not included in this adapter release."),f;o("adapter.js shimming firefox."),f.browserShim=hD,WS(r,c),t_(r),iD(r,c),HS(r,c),rD(r),aD(r),cI(r),sD(r),oD(r),lD(r),cD(r),dD(r),uD(r),L0(r),pI(r),D0(r,c),GS(r);break;case"safari":if(!SD||!a.shimSafari)return o("Safari shim is not included in this adapter release."),f;o("adapter.js shimming safari."),f.browserShim=SD,WS(r,c),t_(r),yD(r),ED(r),mD(r),fD(r),pD(r),_D(r),gD(r),wD(r),L0(r),fI(r),D0(r,c),GS(r),mI(r,c);break;default:o("Unsupported browser!")}})({window:typeof window>"u"?void 0:window});var iH=wc("Array").keys,rH=dd,gI=ms,vI=C,sH=iH,yI=Array.prototype,aH={DOMTokenList:!0,NodeList:!0},oH=function(r){var a=r.keys;return r===yI||vI(yI,r)&&a===yI.keys||gI(aH,rH(r))?sH:a},al=l(oH),ND=Jt,lH=TypeError,cH=uu,dH=Ec,uH=Xe,$S=function(r,a,o){var c=cH(a);c in r?dH.f(r,c,uH(0,o)):r[c]=o},OD=gy,hH=vh,fH=$S,pH=Array,mH=Math.max,_I=function(r,a,o){for(var c=hH(r),f=OD(a,c),g=OD(o===void 0?c:o,c),v=pH(mH(g-f,0)),w=0;f<g;f++,w++)fH(v,w,r[f]);return v.length=w,v},PD=_I,gH=Math.floor,EI=function(r,a){var o=r.length,c=gH(o/2);return o<8?vH(r,a):S(r,EI(PD(r,0,c),a),EI(PD(r,c),a),a)},vH=function(r,a){for(var o,c,f=r.length,g=1;g<f;){for(c=g,o=r[g];c&&a(r[c-1],o)>0;)r[c]=r[--c];c!==g++&&(r[c]=o)}return r},S=function(r,a,o,c){for(var f=a.length,g=o.length,v=0,w=0;v<f||w<g;)r[v+w]=v<f&&w<g?c(a[v],o[w])<=0?a[v++]:o[w++]:v<f?a[v++]:o[w++];return r},I=EI,B=un.match(/firefox\/(\d+)/i),se=!!B&&+B[1],ge=/MSIE|Trident/.test(un),Ie=un.match(/AppleWebKit\/(\d+)\./),ze=!!Ie&&+Ie[1],Ye=Ii,ct=E,jt=Tn,Ft=No,Yt=vh,vn=function(r,a){if(!delete r[a])throw lH("Cannot delete property "+ND(a)+" of "+ND(r))},Pn=Ol,qn=d,Ci=I,ei=zw,Bi=se,Yi=ge,ol=tt,io=ze,qs=[],xs=ct(qs.sort),fd=ct(qs.push),xh=qn(function(){qs.sort(void 0)}),LD=qn(function(){qs.sort(null)}),Qbe=ei("sort"),Oee=!qn(function(){if(ol)return ol<70;if(!(Bi&&Bi>3)){if(Yi)return!0;if(io)return io<603;var r,a,o,c,f="";for(r=65;r<76;r++){switch(a=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:o=3;break;case 68:case 71:o=4;break;default:o=2}for(c=0;c<47;c++)qs.push({k:a+c,v:o})}for(qs.sort(function(g,v){return v.v-g.v}),c=0;c<qs.length;c++)a=qs[c].k.charAt(0),f.charAt(f.length-1)!==a&&(f+=a);return f!=="DGBEFHACIJK"}});Ye({target:"Array",proto:!0,forced:xh||!LD||!Qbe||!Oee},{sort:function(r){r!==void 0&&jt(r);var a=Ft(this);if(Oee)return r===void 0?xs(a):xs(a,r);var o,c,f=[],g=Yt(a);for(c=0;c<g;c++)c in a&&fd(f,a[c]);for(Ci(f,function(v){return function(w,T){return T===void 0?-1:w===void 0?1:v!==void 0?+v(w,T)||0:Pn(w)>Pn(T)?1:-1}}(r)),o=Yt(f),c=0;c<o;)a[c]=f[c++];for(;c<g;)vn(a,c++);return a}});var Zbe=wc("Array").sort,eCe=C,tCe=Zbe,yH=Array.prototype,nCe=function(r){var a=r.sort;return r===yH||eCe(yH,r)&&a===yH.sort?tCe:a},wI=l(nCe),_H={exports:{}};(function(r,a){(function(o,c){var f="function",g="undefined",v="object",w="string",T="major",R="model",A="name",L="type",U="vendor",F="version",Z="architecture",W="console",K="mobile",oe="tablet",ue="smarttv",xe="wearable",Ne="embedded",ke="Amazon",He="Apple",lt="ASUS",ut="BlackBerry",ft="Browser",zt="Chrome",$n="Firefox",hi="Google",Gi="Huawei",Fr="LG",mr="Microsoft",Uu="Motorola",at="Opera",yt="Samsung",Vt="Sharp",Rn="Sony",oi="Xiaomi",Rt="Zebra",q="Facebook",Ee="Chromium OS",Ae="Mac OS",gt=function(Pr){for(var Qr={},Qi=0;Qi<Pr.length;Qi++)Qr[Pr[Qi].toUpperCase()]=Pr[Qi];return Qr},bn=function(Pr,Qr){return typeof Pr===w&&Mi(Qr).indexOf(Mi(Pr))!==-1},Mi=function(Pr){return Pr.toLowerCase()},cs=function(Pr,Qr){if(typeof Pr===w)return Pr=Pr.replace(/^\s\s*/,""),typeof Qr===g?Pr:Pr.substring(0,350)},fl=function(Pr,Qr){for(var Qi,Gl,ip,Lr,li,pl,u1=0;u1<Qr.length&&!li;){var zh=Qr[u1],Ode=Qr[u1+1];for(Qi=Gl=0;Qi<zh.length&&!li&&zh[Qi];)if(li=zh[Qi++].exec(Pr))for(ip=0;ip<Ode.length;ip++)pl=li[++Gl],typeof(Lr=Ode[ip])===v&&Lr.length>0?Lr.length===2?typeof Lr[1]==f?this[Lr[0]]=Lr[1].call(this,pl):this[Lr[0]]=Lr[1]:Lr.length===3?typeof Lr[1]!==f||Lr[1].exec&&Lr[1].test?this[Lr[0]]=pl?pl.replace(Lr[1],Lr[2]):c:this[Lr[0]]=pl?Lr[1].call(this,pl,Lr[2]):c:Lr.length===4&&(this[Lr[0]]=pl?Lr[3].call(this,pl.replace(Lr[1],Lr[2])):c):this[Lr]=pl||c;u1+=2}},km=function(Pr,Qr){for(var Qi in Qr)if(typeof Qr[Qi]===v&&Qr[Qi].length>0){for(var Gl=0;Gl<Qr[Qi].length;Gl++)if(bn(Qr[Qi][Gl],Pr))return Qi==="?"?c:Qi}else if(bn(Qr[Qi],Pr))return Qi==="?"?c:Qi;return Pr},R8={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},x8={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[F,[A,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[F,[A,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[A,F],[/opios[\/ ]+([\w\.]+)/i],[F,[A,at+" Mini"]],[/\bopr\/([\w\.]+)/i],[F,[A,at]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[A,F],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[F,[A,"UC"+ft]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[F,[A,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[F,[A,"WeChat"]],[/konqueror\/([\w\.]+)/i],[F,[A,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[F,[A,"IE"]],[/yabrowser\/([\w\.]+)/i],[F,[A,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[A,/(.+)/,"$1 Secure "+ft],F],[/\bfocus\/([\w\.]+)/i],[F,[A,$n+" Focus"]],[/\bopt\/([\w\.]+)/i],[F,[A,at+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[F,[A,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[F,[A,"Dolphin"]],[/coast\/([\w\.]+)/i],[F,[A,at+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[F,[A,"MIUI "+ft]],[/fxios\/([-\w\.]+)/i],[F,[A,$n]],[/\bqihu|(qi?ho?o?|360)browser/i],[[A,"360 "+ft]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[A,/(.+)/,"$1 "+ft],F],[/(comodo_dragon)\/([\w\.]+)/i],[[A,/_/g," "],F],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[A,F],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[A],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[A,q],F],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[A,F],[/\bgsa\/([\w\.]+) .*safari\//i],[F,[A,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[F,[A,zt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[A,zt+" WebView"],F],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[F,[A,"Android "+ft]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[A,F],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[F,[A,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[F,A],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[A,[F,km,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[A,F],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[A,"Netscape"],F],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[F,[A,$n+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[A,F],[/(cobalt)\/([\w\.]+)/i],[A,[F,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[Z,"amd64"]],[/(ia32(?=;))/i],[[Z,Mi]],[/((?:i[346]|x)86)[;\)]/i],[[Z,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[Z,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[Z,"armhf"]],[/windows (ce|mobile); ppc;/i],[[Z,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[Z,/ower/,"",Mi]],[/(sun4\w)[;\)]/i],[[Z,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[Z,Mi]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[R,[U,yt],[L,oe]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[R,[U,yt],[L,K]],[/\((ip(?:hone|od)[\w ]*);/i],[R,[U,He],[L,K]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[R,[U,He],[L,oe]],[/(macintosh);/i],[R,[U,He]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[R,[U,Vt],[L,K]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[R,[U,Gi],[L,oe]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[R,[U,Gi],[L,K]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[R,/_/g," "],[U,oi],[L,K]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[R,/_/g," "],[U,oi],[L,oe]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[R,[U,"OPPO"],[L,K]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[R,[U,"Vivo"],[L,K]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[R,[U,"Realme"],[L,K]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[R,[U,Uu],[L,K]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[R,[U,Uu],[L,oe]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[R,[U,Fr],[L,oe]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[R,[U,Fr],[L,K]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[R,[U,"Lenovo"],[L,oe]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[R,/_/g," "],[U,"Nokia"],[L,K]],[/(pixel c)\b/i],[R,[U,hi],[L,oe]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[R,[U,hi],[L,K]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[R,[U,Rn],[L,K]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[R,"Xperia Tablet"],[U,Rn],[L,oe]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[R,[U,"OnePlus"],[L,K]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[R,[U,ke],[L,oe]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[R,/(.+)/g,"Fire Phone $1"],[U,ke],[L,K]],[/(playbook);[-\w\),; ]+(rim)/i],[R,U,[L,oe]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[R,[U,ut],[L,K]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[R,[U,lt],[L,oe]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[R,[U,lt],[L,K]],[/(nexus 9)/i],[R,[U,"HTC"],[L,oe]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[U,[R,/_/g," "],[L,K]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[R,[U,"Acer"],[L,oe]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[R,[U,"Meizu"],[L,K]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[U,R,[L,K]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[U,R,[L,oe]],[/(surface duo)/i],[R,[U,mr],[L,oe]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[R,[U,"Fairphone"],[L,K]],[/(u304aa)/i],[R,[U,"AT&T"],[L,K]],[/\bsie-(\w*)/i],[R,[U,"Siemens"],[L,K]],[/\b(rct\w+) b/i],[R,[U,"RCA"],[L,oe]],[/\b(venue[\d ]{2,7}) b/i],[R,[U,"Dell"],[L,oe]],[/\b(q(?:mv|ta)\w+) b/i],[R,[U,"Verizon"],[L,oe]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[R,[U,"Barnes & Noble"],[L,oe]],[/\b(tm\d{3}\w+) b/i],[R,[U,"NuVision"],[L,oe]],[/\b(k88) b/i],[R,[U,"ZTE"],[L,oe]],[/\b(nx\d{3}j) b/i],[R,[U,"ZTE"],[L,K]],[/\b(gen\d{3}) b.+49h/i],[R,[U,"Swiss"],[L,K]],[/\b(zur\d{3}) b/i],[R,[U,"Swiss"],[L,oe]],[/\b((zeki)?tb.*\b) b/i],[R,[U,"Zeki"],[L,oe]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[U,"Dragon Touch"],R,[L,oe]],[/\b(ns-?\w{0,9}) b/i],[R,[U,"Insignia"],[L,oe]],[/\b((nxa|next)-?\w{0,9}) b/i],[R,[U,"NextBook"],[L,oe]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[U,"Voice"],R,[L,K]],[/\b(lvtel\-)?(v1[12]) b/i],[[U,"LvTel"],R,[L,K]],[/\b(ph-1) /i],[R,[U,"Essential"],[L,K]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[R,[U,"Envizen"],[L,oe]],[/\b(trio[-\w\. ]+) b/i],[R,[U,"MachSpeed"],[L,oe]],[/\btu_(1491) b/i],[R,[U,"Rotor"],[L,oe]],[/(shield[\w ]+) b/i],[R,[U,"Nvidia"],[L,oe]],[/(sprint) (\w+)/i],[U,R,[L,K]],[/(kin\.[onetw]{3})/i],[[R,/\./g," "],[U,mr],[L,K]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[R,[U,Rt],[L,oe]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[R,[U,Rt],[L,K]],[/smart-tv.+(samsung)/i],[U,[L,ue]],[/hbbtv.+maple;(\d+)/i],[[R,/^/,"SmartTV"],[U,yt],[L,ue]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[U,Fr],[L,ue]],[/(apple) ?tv/i],[U,[R,He+" TV"],[L,ue]],[/crkey/i],[[R,zt+"cast"],[U,hi],[L,ue]],[/droid.+aft(\w)( bui|\))/i],[R,[U,ke],[L,ue]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[R,[U,Vt],[L,ue]],[/(bravia[\w ]+)( bui|\))/i],[R,[U,Rn],[L,ue]],[/(mitv-\w{5}) bui/i],[R,[U,oi],[L,ue]],[/Hbbtv.*(technisat) (.*);/i],[U,R,[L,ue]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[U,cs],[R,cs],[L,ue]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[L,ue]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[U,R,[L,W]],[/droid.+; (shield) bui/i],[R,[U,"Nvidia"],[L,W]],[/(playstation [345portablevi]+)/i],[R,[U,Rn],[L,W]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[R,[U,mr],[L,W]],[/((pebble))app/i],[U,R,[L,xe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[R,[U,He],[L,xe]],[/droid.+; (glass) \d/i],[R,[U,hi],[L,xe]],[/droid.+; (wt63?0{2,3})\)/i],[R,[U,Rt],[L,xe]],[/(quest( 2| pro)?)/i],[R,[U,q],[L,xe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[U,[L,Ne]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[R,[L,K]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[R,[L,oe]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[L,oe]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[L,K]],[/(android[-\w\. ]{0,9});.+buil/i],[R,[U,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[F,[A,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[F,[A,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[A,F],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[F,A]],os:[[/microsoft (windows) (vista|xp)/i],[A,F],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[A,[F,km,R8]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[A,"Windows"],[F,km,R8]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[F,/_/g,"."],[A,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[A,Ae],[F,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[F,A],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[A,F],[/\(bb(10);/i],[F,[A,ut]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[F,[A,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[F,[A,$n+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[F,[A,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[F,[A,"watchOS"]],[/crkey\/([\d\.]+)/i],[F,[A,zt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[A,Ee],F],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[A,F],[/(sunos) ?([\w\.\d]*)/i],[[A,"Solaris"],F],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[A,F]]},bd=function(Pr,Qr){if(typeof Pr===v&&(Qr=Pr,Pr=c),!(this instanceof bd))return new bd(Pr,Qr).getResult();var Qi=typeof o!==g&&o.navigator?o.navigator:c,Gl=Pr||(Qi&&Qi.userAgent?Qi.userAgent:""),ip=Qi&&Qi.userAgentData?Qi.userAgentData:c,Lr=Qr?function(li,pl){var u1={};for(var zh in li)pl[zh]&&pl[zh].length%2==0?u1[zh]=pl[zh].concat(li[zh]):u1[zh]=li[zh];return u1}(x8,Qr):x8;return this.getBrowser=function(){var li={};return li[A]=c,li[F]=c,fl.call(li,Gl,Lr.browser),li[T]=function(pl){return typeof pl===w?pl.replace(/[^\d\.]/g,"").split(".")[0]:c}(li[F]),Qi&&Qi.brave&&typeof Qi.brave.isBrave==f&&(li[A]="Brave"),li},this.getCPU=function(){var li={};return li[Z]=c,fl.call(li,Gl,Lr.cpu),li},this.getDevice=function(){var li={};return li[U]=c,li[R]=c,li[L]=c,fl.call(li,Gl,Lr.device),!li[L]&&ip&&ip.mobile&&(li[L]=K),li[R]=="Macintosh"&&Qi&&typeof Qi.standalone!==g&&Qi.maxTouchPoints&&Qi.maxTouchPoints>2&&(li[R]="iPad",li[L]=oe),li},this.getEngine=function(){var li={};return li[A]=c,li[F]=c,fl.call(li,Gl,Lr.engine),li},this.getOS=function(){var li={};return li[A]=c,li[F]=c,fl.call(li,Gl,Lr.os),!li[A]&&ip&&ip.platform!="Unknown"&&(li[A]=ip.platform.replace(/chrome os/i,Ee).replace(/macos/i,Ae)),li},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Gl},this.setUA=function(li){return Gl=typeof li===w&&li.length>350?cs(li,350):li,this},this.setUA(Gl),this};bd.VERSION="0.7.34",bd.BROWSER=gt([A,F,T]),bd.CPU=gt([Z]),bd.DEVICE=gt([R,U,L,W,K,ue,oe,xe,Ne]),bd.ENGINE=bd.OS=gt([A,F]),r.exports&&(a=r.exports=bd),a.UAParser=bd;var d1=typeof o!==g&&(o.jQuery||o.Zepto);if(d1&&!d1.ua){var Wb=new bd;d1.ua=Wb.getResult(),d1.ua.get=function(){return Wb.getUA()},d1.ua.set=function(Pr){Wb.setUA(Pr);var Qr=Wb.getResult();for(var Qi in Qr)d1.ua[Qi]=Qr[Qi]}}})(typeof window=="object"?window:s)})(_H,_H.exports);var iCe=l(_H.exports),rCe=dd,sCe=ms,aCe=Je,oCe=om,lCe=Xi("iterator"),cCe=Object,dCe=function(r){if(aCe(r))return!1;var a=cCe(r);return a[lCe]!==void 0||"@@iterator"in a||sCe(oCe,rCe(a))},uCe=l(dCe),EH=N;Ii({global:!0,forced:EH.globalThis!==EH},{globalThis:EH});var Pee=l(N);function Lee(r,a){return function(){return r.apply(a,arguments)}}let{toString:hCe}=Object.prototype,{getPrototypeOf:wH}=Object,DD=(SH=Object.create(null),r=>{let a=hCe.call(r);return SH[a]||(SH[a]=a.slice(8,-1).toLowerCase())});var SH;let Uf=r=>(r=r.toLowerCase(),a=>DD(a)===r),kD=r=>a=>typeof a===r,{isArray:KS}=Array,SI=kD("undefined"),Dee=Uf("ArrayBuffer"),fCe=kD("string"),yu=kD("function"),kee=kD("number"),MD=r=>r!==null&&typeof r=="object",jD=r=>{if(DD(r)!=="object")return!1;let a=wH(r);return!(a!==null&&a!==Object.prototype&&Object.getPrototypeOf(a)!==null||Symbol.toStringTag in r||uCe(r))},pCe=Uf("Date"),mCe=Uf("File"),gCe=Uf("Blob"),vCe=Uf("FileList"),yCe=Uf("URLSearchParams");function bI(r,a){let o,c,{allOwnKeys:f=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(r!=null)if(typeof r!="object"&&(r=[r]),KS(r))for(o=0,c=r.length;o<c;o++)a.call(null,r[o],o,r);else{let g=f?Object.getOwnPropertyNames(r):Object.keys(r),v=g.length,w;for(o=0;o<v;o++)w=g[o],a.call(null,r[w],w,r)}}function Mee(r,a){a=a.toLowerCase();let o=Object.keys(r),c,f=o.length;for(;f-- >0;)if(c=o[f],a===c.toLowerCase())return c;return null}let jee=Pee!==void 0?Pee:typeof self<"u"?self:typeof window<"u"?window:Xo,Uee=r=>!SI(r)&&r!==jee,_Ce=(bH=typeof Uint8Array<"u"&&wH(Uint8Array),r=>bH&&r instanceof bH);var bH;let ECe=Uf("HTMLFormElement"),Fee=(r=>{let{hasOwnProperty:a}=r;return(o,c)=>a.call(o,c)})(Object.prototype),wCe=Uf("RegExp"),Bee=(r,a)=>{let o=Object.getOwnPropertyDescriptors(r),c={};bI(o,(f,g)=>{let v;(v=a(f,g,r))!==!1&&(c[g]=v||f)}),Object.defineProperties(r,c)},CH="abcdefghijklmnopqrstuvwxyz",Vee="0123456789",zee={DIGIT:Vee,ALPHA:CH,ALPHA_DIGIT:CH+CH.toUpperCase()+Vee},SCe=Uf("AsyncFunction");var Bt={isArray:KS,isArrayBuffer:Dee,isBuffer:function(r){return r!==null&&!SI(r)&&r.constructor!==null&&!SI(r.constructor)&&yu(r.constructor.isBuffer)&&r.constructor.isBuffer(r)},isFormData:r=>{let a;return r&&(typeof FormData=="function"&&r instanceof FormData||yu(r.append)&&((a=DD(r))==="formdata"||a==="object"&&yu(r.toString)&&r.toString()==="[object FormData]"))},isArrayBufferView:function(r){let a;return a=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer&&Dee(r.buffer),a},isString:fCe,isNumber:kee,isBoolean:r=>r===!0||r===!1,isObject:MD,isPlainObject:jD,isUndefined:SI,isDate:pCe,isFile:mCe,isBlob:gCe,isRegExp:wCe,isFunction:yu,isStream:r=>MD(r)&&yu(r.pipe),isURLSearchParams:yCe,isTypedArray:_Ce,isFileList:vCe,forEach:bI,merge:function r(){let{caseless:a}=Uee(this)&&this||{},o={},c=(f,g)=>{let v=a&&Mee(o,g)||g;jD(o[v])&&jD(f)?o[v]=r(o[v],f):jD(f)?o[v]=r({},f):KS(f)?o[v]=f.slice():o[v]=f};for(let f=0,g=arguments.length;f<g;f++)arguments[f]&&bI(arguments[f],c);return o},extend:function(r,a,o){let{allOwnKeys:c}=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return bI(a,(f,g)=>{o&&yu(f)?r[g]=Lee(f,o):r[g]=f},{allOwnKeys:c}),r},trim:r=>Us(r)?Us(r).call(r):r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),inherits:(r,a,o,c)=>{r.prototype=Object.create(a.prototype,c),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:a.prototype}),o&&Object.assign(r.prototype,o)},toFlatObject:(r,a,o,c)=>{let f,g,v,w={};if(a=a||{},r==null)return a;do{for(f=Object.getOwnPropertyNames(r),g=f.length;g-- >0;)v=f[g],c&&!c(v,r,a)||w[v]||(a[v]=r[v],w[v]=!0);r=o!==!1&&wH(r)}while(r&&(!o||o(r,a))&&r!==Object.prototype);return a},kindOf:DD,kindOfTest:Uf,endsWith:(r,a,o)=>{r=String(r),(o===void 0||o>r.length)&&(o=r.length),o-=a.length;let c=r.indexOf(a,o);return c!==-1&&c===o},toArray:r=>{if(!r)return null;if(KS(r))return r;let a=r.length;if(!kee(a))return null;let o=new Array(a);for(;a-- >0;)o[a]=r[a];return o},forEachEntry:(r,a)=>{let o=(r&&r[Symbol.iterator]).call(r),c;for(;(c=o.next())&&!c.done;){let f=c.value;a.call(r,f[0],f[1])}},matchAll:(r,a)=>{let o,c=[];for(;(o=r.exec(a))!==null;)c.push(o);return c},isHTMLForm:ECe,hasOwnProperty:Fee,hasOwnProp:Fee,reduceDescriptors:Bee,freezeMethods:r=>{Bee(r,(a,o)=>{if(yu(r)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let c=r[o];yu(c)&&(a.enumerable=!1,"writable"in a?a.writable=!1:a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))})},toObjectSet:(r,a)=>{let o={},c=f=>{f.forEach(g=>{o[g]=!0})};return KS(r)?c(r):c(String(r).split(a)),o},toCamelCase:r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,o,c){return o.toUpperCase()+c}),noop:()=>{},toFiniteNumber:(r,a)=>(r=+r,Number.isFinite(r)?r:a),findKey:Mee,global:jee,isContextDefined:Uee,ALPHABET:zee,generateString:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zee.ALPHA_DIGIT,o="",{length:c}=a;for(;r--;)o+=a[Math.random()*c|0];return o},isSpecCompliantForm:function(r){return!!(r&&yu(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])},toJSONObject:r=>{let a=new Array(10),o=(c,f)=>{if(MD(c)){if(a.indexOf(c)>=0)return;if(!("toJSON"in c)){a[f]=c;let g=KS(c)?[]:{};return bI(c,(v,w)=>{let T=o(v,f+1);!SI(T)&&(g[w]=T)}),a[f]=void 0,g}}return c};return o(r,0)},isAsyncFn:SCe,isThenable:r=>r&&(MD(r)||yu(r))&&yu(r.then)&&yu(r.catch)};function hr(r,a,o,c,f){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",a&&(this.code=a),o&&(this.config=o),c&&(this.request=c),f&&(this.response=f)}Bt.inherits(hr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Bt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let Hee=hr.prototype,Gee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Gee[r]={value:r}}),Object.defineProperties(hr,Gee),Object.defineProperty(Hee,"isAxiosError",{value:!0}),hr.from=(r,a,o,c,f,g)=>{let v=Object.create(Hee);return Bt.toFlatObject(r,v,function(w){return w!==Error.prototype},w=>w!=="isAxiosError"),hr.call(v,r.message,a,o,c,f),v.cause=r,v.name=r.name,g&&Object.assign(v,g),v};function TH(r){return Bt.isPlainObject(r)||Bt.isArray(r)}function Wee(r){return Bt.endsWith(r,"[]")?r.slice(0,-2):r}function $ee(r,a,o){return r?r.concat(a).map(function(c,f){return c=Wee(c),!o&&f?"["+c+"]":c}).join(o?".":""):a}let bCe=Bt.toFlatObject(Bt,{},null,function(r){return/^is[A-Z]/.test(r)});function UD(r,a,o){if(!Bt.isObject(r))throw new TypeError("target must be an object");a=a||new FormData;let c=(o=Bt.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(U,F){return!Bt.isUndefined(F[U])})).metaTokens,f=o.visitor||R,g=o.dots,v=o.indexes,w=(o.Blob||typeof Blob<"u"&&Blob)&&Bt.isSpecCompliantForm(a);if(!Bt.isFunction(f))throw new TypeError("visitor must be a function");function T(U){if(U===null)return"";if(Bt.isDate(U))return U.toISOString();if(!w&&Bt.isBlob(U))throw new hr("Blob is not supported. Use a Buffer instead.");return Bt.isArrayBuffer(U)||Bt.isTypedArray(U)?w&&typeof Blob=="function"?new Blob([U]):D7.from(U):U}function R(U,F,Z){let W=U;if(U&&!Z&&typeof U=="object"){if(Bt.endsWith(F,"{}"))F=c?F:F.slice(0,-2),U=JSON.stringify(U);else if(Bt.isArray(U)&&function(K){return Bt.isArray(K)&&!K.some(TH)}(U)||(Bt.isFileList(U)||Bt.endsWith(F,"[]"))&&(W=Bt.toArray(U)))return F=Wee(F),W.forEach(function(K,oe){!Bt.isUndefined(K)&&K!==null&&a.append(v===!0?$ee([F],oe,g):v===null?F:F+"[]",T(K))}),!1}return!!TH(U)||(a.append($ee(Z,F,g),T(U)),!1)}let A=[],L=Object.assign(bCe,{defaultVisitor:R,convertValue:T,isVisitable:TH});if(!Bt.isObject(r))throw new TypeError("data must be an object");return function U(F,Z){if(!Bt.isUndefined(F)){if(A.indexOf(F)!==-1)throw Error("Circular reference detected in "+Z.join("."));A.push(F),Bt.forEach(F,function(W,K){(!(Bt.isUndefined(W)||W===null)&&f.call(a,W,Bt.isString(K)?Us(K).call(K):K,Z,L))===!0&&U(W,Z?Z.concat(K):[K])}),A.pop()}}(r),a}function Kee(r){let a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(o){return a[o]})}function RH(r,a){this._pairs=[],r&&UD(r,this,a)}let qee=RH.prototype;function CCe(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Yee(r,a,o){if(!a)return r;let c=o&&o.encode||CCe,f=o&&o.serialize,g;if(g=f?f(a,o):Bt.isURLSearchParams(a)?a.toString():new RH(a,o).toString(c),g){let v=r.indexOf("#");v!==-1&&(r=r.slice(0,v)),r+=(r.indexOf("?")===-1?"?":"&")+g}return r}qee.append=function(r,a){this._pairs.push([r,a])},qee.toString=function(r){let a=r?function(o){return r.call(this,o,Kee)}:Kee;return this._pairs.map(function(o){return a(o[0])+"="+a(o[1])},"").join("&")};var Xee=class{constructor(){this.handlers=[]}use(r,a,o){return this.handlers.push({fulfilled:r,rejected:a,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Bt.forEach(this.handlers,function(a){a!==null&&r(a)})}},Jee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qee={exports:{}},TCe=Ii,RCe=me,Zee=Ec.f;TCe({target:"Object",stat:!0,forced:Object.defineProperty!==Zee,sham:!RCe},{defineProperty:Zee});var ete=Me.Object,xCe=Qee.exports=function(r,a,o){return ete.defineProperty(r,a,o)};ete.defineProperty.sham&&(xCe.sham=!0);var tte=l(Qee.exports),ACe=ne,CI=Array.isArray||function(r){return ACe(r)=="Array"},ICe=TypeError,nte=CI,NCe=Ml,OCe=it,PCe=Xi("species"),ite=Array,LCe=function(r){var a;return nte(r)&&(a=r.constructor,(NCe(a)&&(a===ite||nte(a.prototype))||OCe(a)&&(a=a[PCe])===null)&&(a=void 0)),a===void 0?ite:a},rte=function(r,a){return new(LCe(r))(a===0?0:a)},DCe=d,kCe=tt,MCe=Xi("species"),ste=function(r){return kCe>=51||!DCe(function(){var a=[];return(a.constructor={})[MCe]=function(){return{foo:1}},a[r](Boolean).foo!==1})},jCe=Ii,UCe=d,FCe=CI,BCe=it,VCe=No,zCe=vh,ate=function(r){if(r>9007199254740991)throw ICe("Maximum allowed index exceeded");return r},ote=$S,HCe=rte,GCe=ste,WCe=tt,lte=Xi("isConcatSpreadable"),$Ce=WCe>=51||!UCe(function(){var r=[];return r[lte]=!1,r.concat()[0]!==r}),KCe=function(r){if(!BCe(r))return!1;var a=r[lte];return a!==void 0?!!a:FCe(r)};jCe({target:"Array",proto:!0,arity:1,forced:!$Ce||!GCe("concat")},{concat:function(r){var a,o,c,f,g,v=VCe(this),w=HCe(v,0),T=0;for(a=-1,c=arguments.length;a<c;a++)if(KCe(g=a===-1?v:arguments[a]))for(f=zCe(g),ate(T+f),o=0;o<f;o++,T++)o in g&&ote(w,T,g[o]);else ate(T+1),ote(w,T++,g);return w.length=T,w}});var cte={},qCe=ne,YCe=xt,dte=Xw.f,XCe=_I,ute=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];cte.f=function(r){return ute&&qCe(r)=="Window"?function(a){try{return dte(a)}catch{return XCe(ute)}}(r):dte(YCe(r))};var qS={},JCe=Xi;qS.f=JCe;var hte=Me,QCe=ms,ZCe=qS,eTe=Ec.f,Ys=function(r){var a=hte.Symbol||(hte.Symbol={});QCe(a,r)||eTe(a,r,{value:ZCe.f(r)})},tTe=pe,nTe=en,iTe=Xi,rTe=wh,fte=function(){var r=nTe("Symbol"),a=r&&r.prototype,o=a&&a.valueOf,c=iTe("toPrimitive");a&&!a[c]&&rTe(a,c,function(f){return tTe(o,this)},{arity:1})},sTe=xf,aTe=Qe,oTe=No,lTe=vh,cTe=rte,pte=E([].push),k0=function(r){var a=r==1,o=r==2,c=r==3,f=r==4,g=r==6,v=r==7,w=r==5||g;return function(T,R,A,L){for(var U,F,Z=oTe(T),W=aTe(Z),K=sTe(R,A),oe=lTe(W),ue=0,xe=L||cTe,Ne=a?xe(T,oe):o||v?xe(T,0):void 0;oe>ue;ue++)if((w||ue in W)&&(F=K(U=W[ue],ue,Z),r))if(a)Ne[ue]=F;else if(F)switch(r){case 3:return!0;case 5:return U;case 6:return ue;case 2:pte(Ne,U)}else switch(r){case 4:return!1;case 7:pte(Ne,U)}return g?-1:c||f?f:Ne}},mte={forEach:k0(0),map:k0(1),filter:k0(2),some:k0(3),every:k0(4),find:k0(5),findIndex:k0(6),filterReject:k0(7)},FD=Ii,xH=N,AH=pe,dTe=E,YS=me,XS=nt,uTe=d,ro=ms,hTe=C,IH=dr,BD=xt,NH=uu,fTe=Ol,OH=Xe,TI=E0,gte=Jw,pTe=Xw,vte=cte,mTe=Iy,yte=_e,_te=Ec,gTe=Xx,Ete=Oe,wte=wh,vTe=Gy,PH=bf,Ste=nm,bte=i0,yTe=Xi,_Te=qS,ETe=Ys,wTe=fte,STe=ud,Cte=Lf,VD=mte.forEach,Ac=qw("hidden"),zD="Symbol",RI="prototype",bTe=Cte.set,Tte=Cte.getterFor(zD),Ah=Object[RI],n_=xH.Symbol,HD=n_&&n_[RI],CTe=xH.TypeError,LH=xH.QObject,Rte=yte.f,i_=_te.f,xte=vte.f,TTe=Ete.f,Ate=dTe([].push),Em=PH("symbols"),xI=PH("op-symbols"),RTe=PH("wks"),DH=!LH||!LH[RI]||!LH[RI].findChild,kH=YS&&uTe(function(){return TI(i_({},"a",{get:function(){return i_(this,"a",{value:7}).a}})).a!=7})?function(r,a,o){var c=Rte(Ah,a);c&&delete Ah[a],i_(r,a,o),c&&r!==Ah&&i_(Ah,a,c)}:i_,MH=function(r,a){var o=Em[r]=TI(HD);return bTe(o,{type:zD,tag:r,description:a}),YS||(o.description=a),o},GD=function(r,a,o){r===Ah&&GD(xI,a,o),IH(r);var c=NH(a);return IH(o),ro(Em,c)?(o.enumerable?(ro(r,Ac)&&r[Ac][c]&&(r[Ac][c]=!1),o=TI(o,{enumerable:OH(0,!1)})):(ro(r,Ac)||i_(r,Ac,OH(1,{})),r[Ac][c]=!0),kH(r,c,o)):i_(r,c,o)},jH=function(r,a){IH(r);var o=BD(a),c=gte(o).concat(Pte(o));return VD(c,function(f){YS&&!AH(Ite,o,f)||GD(r,f,o[f])}),r},Ite=function(r){var a=NH(r),o=AH(TTe,this,a);return!(this===Ah&&ro(Em,a)&&!ro(xI,a))&&(!(o||!ro(this,a)||!ro(Em,a)||ro(this,Ac)&&this[Ac][a])||o)},Nte=function(r,a){var o=BD(r),c=NH(a);if(o!==Ah||!ro(Em,c)||ro(xI,c)){var f=Rte(o,c);return!f||!ro(Em,c)||ro(o,Ac)&&o[Ac][c]||(f.enumerable=!0),f}},Ote=function(r){var a=xte(BD(r)),o=[];return VD(a,function(c){ro(Em,c)||ro(Ste,c)||Ate(o,c)}),o},Pte=function(r){var a=r===Ah,o=xte(a?xI:BD(r)),c=[];return VD(o,function(f){!ro(Em,f)||a&&!ro(Ah,f)||Ate(c,Em[f])}),c};XS||(n_=function(){if(hTe(HD,this))throw CTe("Symbol is not a constructor");var r=arguments.length&&arguments[0]!==void 0?fTe(arguments[0]):void 0,a=bte(r),o=function(c){this===Ah&&AH(o,xI,c),ro(this,Ac)&&ro(this[Ac],a)&&(this[Ac][a]=!1),kH(this,a,OH(1,c))};return YS&&DH&&kH(Ah,a,{configurable:!0,set:o}),MH(a,r)},wte(HD=n_[RI],"toString",function(){return Tte(this).tag}),wte(n_,"withoutSetter",function(r){return MH(bte(r),r)}),Ete.f=Ite,_te.f=GD,gTe.f=jH,yte.f=Nte,pTe.f=vte.f=Ote,mTe.f=Pte,_Te.f=function(r){return MH(yTe(r),r)},YS&&vTe(HD,"description",{configurable:!0,get:function(){return Tte(this).description}})),FD({global:!0,constructor:!0,wrap:!0,forced:!XS,sham:!XS},{Symbol:n_}),VD(gte(RTe),function(r){ETe(r)}),FD({target:zD,stat:!0,forced:!XS},{useSetter:function(){DH=!0},useSimple:function(){DH=!1}}),FD({target:"Object",stat:!0,forced:!XS,sham:!YS},{create:function(r,a){return a===void 0?TI(r):jH(TI(r),a)},defineProperty:GD,defineProperties:jH,getOwnPropertyDescriptor:Nte}),FD({target:"Object",stat:!0,forced:!XS},{getOwnPropertyNames:Ote}),wTe(),STe(n_,zD),Ste[Ac]=!0;var Lte=nt&&!!Symbol.for&&!!Symbol.keyFor,xTe=Ii,ATe=en,ITe=ms,NTe=Ol,Dte=bf,OTe=Lte,UH=Dte("string-to-symbol-registry"),PTe=Dte("symbol-to-string-registry");xTe({target:"Symbol",stat:!0,forced:!OTe},{for:function(r){var a=NTe(r);if(ITe(UH,a))return UH[a];var o=ATe("Symbol")(a);return UH[a]=o,PTe[o]=a,o}});var LTe=Ii,DTe=ms,kTe=Zt,MTe=Jt,jTe=Lte,kte=bf("symbol-to-string-registry");LTe({target:"Symbol",stat:!0,forced:!jTe},{keyFor:function(r){if(!kTe(r))throw TypeError(MTe(r)+" is not a symbol");if(DTe(kte,r))return kte[r]}});var Mte=CI,UTe=ae,jte=ne,FTe=Ol,Ute=E([].push),BTe=Ii,Fte=en,Bte=M,VTe=pe,AI=E,Vte=d,zte=ae,Hte=Zt,Gte=TA,zTe=function(r){if(UTe(r))return r;if(Mte(r)){for(var a=r.length,o=[],c=0;c<a;c++){var f=r[c];typeof f=="string"?Ute(o,f):typeof f!="number"&&jte(f)!="Number"&&jte(f)!="String"||Ute(o,FTe(f))}var g=o.length,v=!0;return function(w,T){if(v)return v=!1,T;if(Mte(this))return T;for(var R=0;R<g;R++)if(o[R]===w)return T}}},HTe=nt,GTe=String,M0=Fte("JSON","stringify"),WD=AI(/./.exec),Wte=AI("".charAt),WTe=AI("".charCodeAt),$Te=AI("".replace),KTe=AI(1 .toString),qTe=/[\uD800-\uDFFF]/g,$te=/^[\uD800-\uDBFF]$/,Kte=/^[\uDC00-\uDFFF]$/,qte=!HTe||Vte(function(){var r=Fte("Symbol")();return M0([r])!="[null]"||M0({a:r})!="{}"||M0(Object(r))!="{}"}),Yte=Vte(function(){return M0("\uDF06\uD834")!=='"\\udf06\\ud834"'||M0("\uDEAD")!=='"\\udead"'}),YTe=function(r,a){var o=Gte(arguments),c=zTe(a);if(zte(c)||r!==void 0&&!Hte(r))return o[1]=function(f,g){if(zte(c)&&(g=VTe(c,this,GTe(f),g)),!Hte(g))return g},Bte(M0,null,o)},XTe=function(r,a,o){var c=Wte(o,a-1),f=Wte(o,a+1);return WD($te,r)&&!WD(Kte,f)||WD(Kte,r)&&!WD($te,c)?"\\u"+KTe(WTe(r,0),16):r};M0&&BTe({target:"JSON",stat:!0,arity:3,forced:qte||Yte},{stringify:function(r,a,o){var c=Gte(arguments),f=Bte(qte?YTe:M0,null,c);return Yte&&typeof f=="string"?$Te(f,qTe,XTe):f}});var Xte=Iy,JTe=No;Ii({target:"Object",stat:!0,forced:!nt||d(function(){Xte.f(1)})},{getOwnPropertySymbols:function(r){var a=Xte.f;return a?a(JTe(r)):[]}}),Ys("asyncIterator"),Ys("hasInstance"),Ys("isConcatSpreadable"),Ys("iterator"),Ys("match"),Ys("matchAll"),Ys("replace"),Ys("search"),Ys("species"),Ys("split");var QTe=fte;Ys("toPrimitive"),QTe();var ZTe=en,eRe=ud;Ys("toStringTag"),eRe(ZTe("Symbol"),"Symbol"),Ys("unscopables"),ud(N.JSON,"JSON",!0);var tRe=Me.Symbol,nRe=Xi,iRe=Ec.f,Jte=nRe("metadata"),Qte=Function.prototype;Qte[Jte]===void 0&&iRe(Qte,Jte,{value:null}),Ys("dispose"),Ys("metadata");var rRe=tRe;Ys("asyncDispose");var sRe=E,FH=en("Symbol"),aRe=FH.keyFor,oRe=sRe(FH.prototype.valueOf),Zte=FH.isRegisteredSymbol||function(r){try{return aRe(oRe(r))!==void 0}catch{return!1}};Ii({target:"Symbol",stat:!0},{isRegisteredSymbol:Zte});for(var lRe=bf,ene=en,cRe=E,dRe=Zt,uRe=Xi,$D=ene("Symbol"),tne=$D.isWellKnownSymbol,nne=ene("Object","getOwnPropertyNames"),hRe=cRe($D.prototype.valueOf),ine=lRe("wks"),BH=0,rne=nne($D),fRe=rne.length;BH<fRe;BH++)try{var sne=rne[BH];dRe($D[sne])&&uRe(sne)}catch{}var ane=function(r){if(tne&&tne(r))return!0;try{for(var a=hRe(r),o=0,c=nne(ine),f=c.length;o<f;o++)if(ine[c[o]]==a)return!0}catch{}return!1};Ii({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:ane}),Ys("matcher"),Ys("observable"),Ii({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:Zte}),Ii({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:ane}),Ys("metadataKey"),Ys("patternMatch"),Ys("replaceAll");var JS=l(rRe),one=l(qS.f("iterator"));function II(r){return II=typeof JS=="function"&&typeof one=="symbol"?function(a){return typeof a}:function(a){return a&&typeof JS=="function"&&a.constructor===JS&&a!==JS.prototype?"symbol":typeof a},II(r)}var pRe=l(qS.f("toPrimitive"));function mRe(r){var a=function(o,c){if(II(o)!=="object"||o===null)return o;var f=o[pRe];if(f!==void 0){var g=f.call(o,c||"default");if(II(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(o)}(r,"string");return II(a)==="symbol"?a:String(a)}function X(r,a,o){return(a=mRe(a))in r?tte(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}var gRe=d,vRe=Xi("iterator"),VH=!gRe(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),a=r.searchParams,o=new URLSearchParams("a=1&a=2"),c="";return r.pathname="c%20d",a.forEach(function(f,g){a.delete("b"),c+=g+f}),o.delete("a",2),!r.toJSON||!o.has("a",1)||o.has("a",2)||!a.size&&!0||!a.sort||r.href!=="http://a/c%20d?a=1&c=3"||a.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!a[vRe]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||c!=="a1c3"||new URL("http://x",void 0).host!=="x"}),yRe=wh,zH=Ii,QS=N,KD=pe,Ff=E,ZS=me,lne=VH,cne=wh,_Re=Gy,ERe=function(r,a,o){for(var c in a)o&&o.unsafe&&r[c]?r[c]=a[c]:yRe(r,c,a[c],o);return r},wRe=ud,SRe=By,HH=Lf,dne=yA,GH=ae,bRe=ms,CRe=xf,TRe=dd,RRe=dr,une=it,Fl=Ol,xRe=E0,hne=Xe,WH=cm,ARe=Ca,eb=TS,IRe=I,NRe=Xi("iterator"),NI="URLSearchParams",fne=NI+"Iterator",pne=HH.set,_u=HH.getterFor(NI),ORe=HH.getterFor(fne),PRe=Object.getOwnPropertyDescriptor,$H=function(r){if(!ZS)return QS[r];var a=PRe(QS,r);return a&&a.value},mne=$H("fetch"),qD=$H("Request"),OI=$H("Headers"),KH=qD&&qD.prototype,gne=OI&&OI.prototype,LRe=QS.RegExp,DRe=QS.TypeError,vne=QS.decodeURIComponent,kRe=QS.encodeURIComponent,MRe=Ff("".charAt),yne=Ff([].join),r_=Ff([].push),qH=Ff("".replace),jRe=Ff([].shift),_ne=Ff([].splice),Ene=Ff("".split),URe=Ff("".slice),FRe=/\+/g,wne=Array(4),BRe=function(r){return wne[r-1]||(wne[r-1]=LRe("((?:%[\\da-f]{2}){"+r+"})","gi"))},VRe=function(r){try{return vne(r)}catch{return r}},Sne=function(r){var a=qH(r,FRe," "),o=4;try{return vne(a)}catch{for(;o;)a=qH(a,BRe(o--),VRe);return a}},zRe=/[!'()~]|%20/g,HRe={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},GRe=function(r){return HRe[r]},bne=function(r){return qH(kRe(r),zRe,GRe)},YH=SRe(function(r,a){pne(this,{type:fne,iterator:WH(_u(r).entries),kind:a})},"Iterator",function(){var r=ORe(this),a=r.kind,o=r.iterator.next(),c=o.value;return o.done||(o.value=a==="keys"?c.key:a==="values"?c.value:[c.key,c.value]),o},!0),Cne=function(r){this.entries=[],this.url=null,r!==void 0&&(une(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?MRe(r,0)==="?"?URe(r,1):r:Fl(r)))};Cne.prototype={type:NI,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var a,o,c,f,g,v,w,T=ARe(r);if(T)for(o=(a=WH(r,T)).next;!(c=KD(o,a)).done;){if(g=(f=WH(RRe(c.value))).next,(v=KD(g,f)).done||(w=KD(g,f)).done||!KD(g,f).done)throw DRe("Expected sequence with length 2");r_(this.entries,{key:Fl(v.value),value:Fl(w.value)})}else for(var R in r)bRe(r,R)&&r_(this.entries,{key:R,value:Fl(r[R])})},parseQuery:function(r){if(r)for(var a,o,c=Ene(r,"&"),f=0;f<c.length;)(a=c[f++]).length&&(o=Ene(a,"="),r_(this.entries,{key:Sne(jRe(o)),value:Sne(yne(o,"="))}))},serialize:function(){for(var r,a=this.entries,o=[],c=0;c<a.length;)r=a[c++],r_(o,bne(r.key)+"="+bne(r.value));return yne(o,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var YD=function(){dne(this,tb);var r=pne(this,new Cne(arguments.length>0?arguments[0]:void 0));ZS||(this.size=r.entries.length)},tb=YD.prototype;if(ERe(tb,{append:function(r,a){var o=_u(this);eb(arguments.length,2),r_(o.entries,{key:Fl(r),value:Fl(a)}),ZS||this.length++,o.updateURL()},delete:function(r){for(var a=_u(this),o=eb(arguments.length,1),c=a.entries,f=Fl(r),g=o<2?void 0:arguments[1],v=g===void 0?g:Fl(g),w=0;w<c.length;){var T=c[w];if(T.key!==f||v!==void 0&&T.value!==v)w++;else if(_ne(c,w,1),v!==void 0)break}ZS||(this.size=c.length),a.updateURL()},get:function(r){var a=_u(this).entries;eb(arguments.length,1);for(var o=Fl(r),c=0;c<a.length;c++)if(a[c].key===o)return a[c].value;return null},getAll:function(r){var a=_u(this).entries;eb(arguments.length,1);for(var o=Fl(r),c=[],f=0;f<a.length;f++)a[f].key===o&&r_(c,a[f].value);return c},has:function(r){for(var a=_u(this).entries,o=eb(arguments.length,1),c=Fl(r),f=o<2?void 0:arguments[1],g=f===void 0?f:Fl(f),v=0;v<a.length;){var w=a[v++];if(w.key===c&&(g===void 0||w.value===g))return!0}return!1},set:function(r,a){var o=_u(this);eb(arguments.length,1);for(var c,f=o.entries,g=!1,v=Fl(r),w=Fl(a),T=0;T<f.length;T++)(c=f[T]).key===v&&(g?_ne(f,T--,1):(g=!0,c.value=w));g||r_(f,{key:v,value:w}),ZS||(this.size=f.length),o.updateURL()},sort:function(){var r=_u(this);IRe(r.entries,function(a,o){return a.key>o.key?1:-1}),r.updateURL()},forEach:function(r){for(var a,o=_u(this).entries,c=CRe(r,arguments.length>1?arguments[1]:void 0),f=0;f<o.length;)c((a=o[f++]).value,a.key,this)},keys:function(){return new YH(this,"keys")},values:function(){return new YH(this,"values")},entries:function(){return new YH(this,"entries")}},{enumerable:!0}),cne(tb,NRe,tb.entries,{name:"entries"}),cne(tb,"toString",function(){return _u(this).serialize()},{enumerable:!0}),ZS&&_Re(tb,"size",{get:function(){return _u(this).entries.length},configurable:!0,enumerable:!0}),wRe(YD,NI),zH({global:!0,constructor:!0,forced:!lne},{URLSearchParams:YD}),!lne&&GH(OI)){var WRe=Ff(gne.has),$Re=Ff(gne.set),Tne=function(r){if(une(r)){var a,o=r.body;if(TRe(o)===NI)return a=r.headers?new OI(r.headers):new OI,WRe(a,"content-type")||$Re(a,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),xRe(r,{body:hne(0,Fl(o)),headers:hne(0,a)})}return r};if(GH(mne)&&zH({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(r){return mne(r,arguments.length>1?Tne(arguments[1]):{})}}),GH(qD)){var XH=function(r){return dne(this,KH),new qD(r,arguments.length>1?Tne(arguments[1]):{})};KH.constructor=XH,XH.prototype=KH,zH({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:XH})}}var KRe={URLSearchParams:YD,getState:_u},Rne=l(Me.URLSearchParams),qRe={isBrowser:!0,classes:{URLSearchParams:Rne!==void 0?Rne:RH,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]};let xne=typeof window<"u"&&typeof document<"u",YRe=(Ane=typeof navigator<"u"&&navigator.product,xne&&["ReactNative","NativeScript","NS"].indexOf(Ane)<0);var Ane;let XRe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";function Ine(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Nne(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Ine(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Ine(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}var Bf=Nne(Nne({},Object.freeze({__proto__:null,hasBrowserEnv:xne,hasStandardBrowserEnv:YRe,hasStandardBrowserWebWorkerEnv:XRe})),qRe),JRe=dr,QRe=pe,ZRe=ms,exe=C,txe=function(){var r=JRe(this),a="";return r.hasIndices&&(a+="d"),r.global&&(a+="g"),r.ignoreCase&&(a+="i"),r.multiline&&(a+="m"),r.dotAll&&(a+="s"),r.unicode&&(a+="u"),r.unicodeSets&&(a+="v"),r.sticky&&(a+="y"),a},One=RegExp.prototype,Pne=function(r){var a=r.flags;return a!==void 0||"flags"in One||ZRe(r,"flags")||!exe(One,r)?a:QRe(txe,r)},nxe=eI.charAt,Lne=pe,ixe=dr,rxe=ae,sxe=ne,axe=/./.exec,oxe=TypeError,lxe=Ii,Dne=pe,kne=re,cxe=By,XD=Hy,Mne=Ht,jne=kw,PI=Ol,dxe=dr,uxe=Je,hxe=ne,fxe=n6,Une=Pne,pxe=bi,mxe=d,gxe=CA,vxe=function(r,a,o){return a+(o?nxe(r,a).length:1)},yxe=function(r,a){var o=r.exec;if(rxe(o)){var c=Lne(o,r,a);return c!==null&&ixe(c),c}if(sxe(r)==="RegExp")return Lne(axe,r,a);throw oxe("RegExp#exec called on incompatible receiver")},Fne=Lf,_xe=Xi("matchAll"),Bne="RegExp String",Vne=Bne+" Iterator",Exe=Fne.set,wxe=Fne.getterFor(Vne),Sxe=TypeError,JH=kne("".indexOf),JD=kne("".matchAll),QH=!!JD&&!mxe(function(){JD("a",/./)}),bxe=cxe(function(r,a,o,c){Exe(this,{type:Vne,regexp:r,string:a,global:o,unicode:c,done:!1})},Bne,function(){var r=wxe(this);if(r.done)return XD(void 0,!0);var a=r.regexp,o=r.string,c=yxe(a,o);return c===null?(r.done=!0,XD(void 0,!0)):r.global?(PI(c[0])===""&&(a.lastIndex=vxe(o,jne(a.lastIndex),r.unicode)),XD(c,!1)):(r.done=!0,XD(c,!1))}),zne=function(r){var a,o,c,f=dxe(this),g=PI(r),v=gxe(f,RegExp),w=PI(Une(f));return a=new v(v===RegExp?f.source:f,w),o=!!~JH(w,"g"),c=!!~JH(w,"u"),a.lastIndex=jne(f.lastIndex),new bxe(a,g,o,c)};lxe({target:"String",proto:!0,forced:QH},{matchAll:function(r){var a,o,c,f,g=Mne(this);if(uxe(r)){if(QH)return JD(g,r)}else{if(fxe(r)&&(a=PI(Mne(Une(r))),!~JH(a,"g")))throw Sxe("`.matchAll` does not allow non-global regexes");if(QH)return JD(g,r);if((c=pxe(r,_xe))===void 0&&hxe(r)=="RegExp"&&(c=zne),c)return Dne(c,r,g)}return o=PI(g),f=new RegExp(r,"g"),Dne(zne,f,o)}});var Cxe=wc("String").matchAll,Txe=C,Rxe=Cxe,ZH=String.prototype,xxe=function(r){var a=r.matchAll;return typeof r=="string"||r===ZH||Txe(ZH,r)&&a===ZH.matchAll?Rxe:a},Axe=l(xxe);function Hne(r){function a(o,c,f,g){let v=o[g++];if(v==="__proto__")return!0;let w=Number.isFinite(+v),T=g>=o.length;return v=!v&&Bt.isArray(f)?f.length:v,T?(Bt.hasOwnProp(f,v)?f[v]=[f[v],c]:f[v]=c,!w):(f[v]&&Bt.isObject(f[v])||(f[v]=[]),a(o,c,f[v],g)&&Bt.isArray(f[v])&&(f[v]=function(R){let A={},L=Object.keys(R),U,F=L.length,Z;for(U=0;U<F;U++)Z=L[U],A[Z]=R[Z];return A}(f[v])),!w)}if(Bt.isFormData(r)&&Bt.isFunction(r.entries)){let o={};return Bt.forEachEntry(r,(c,f)=>{a(function(g){return Axe(Bt).call(Bt,/\w+|\[(\w*)]/g,g).map(v=>v[0]==="[]"?"":v[1]||v[0])}(c),f,o,0)}),o}return null}let eG={transitional:Jee,adapter:["xhr","http"],transformRequest:[function(r,a){let o=a.getContentType()||"",c=o.indexOf("application/json")>-1,f=Bt.isObject(r);if(f&&Bt.isHTMLForm(r)&&(r=new FormData(r)),Bt.isFormData(r))return c?JSON.stringify(Hne(r)):r;if(Bt.isArrayBuffer(r)||Bt.isBuffer(r)||Bt.isStream(r)||Bt.isFile(r)||Bt.isBlob(r))return r;if(Bt.isArrayBufferView(r))return r.buffer;if(Bt.isURLSearchParams(r))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let g;if(f){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(v,w){return UD(v,new Bf.classes.URLSearchParams,Object.assign({visitor:function(T,R,A,L){return Bf.isNode&&Bt.isBuffer(T)?(this.append(R,T.toString("base64")),!1):L.defaultVisitor.apply(this,arguments)}},w))}(r,this.formSerializer).toString();if((g=Bt.isFileList(r))||o.indexOf("multipart/form-data")>-1){let v=this.env&&this.env.FormData;return UD(g?{"files[]":r}:r,v&&new v,this.formSerializer)}}return f||c?(a.setContentType("application/json",!1),function(v,w,T){if(Bt.isString(v))try{return(w||JSON.parse)(v),Us(Bt).call(Bt,v)}catch(R){if(R.name!=="SyntaxError")throw R}return(0,JSON.stringify)(v)}(r)):r}],transformResponse:[function(r){let a=this.transitional||eG.transitional,o=a&&a.forcedJSONParsing,c=this.responseType==="json";if(r&&Bt.isString(r)&&(o&&!this.responseType||c)){let f=!(a&&a.silentJSONParsing)&&c;try{return JSON.parse(r)}catch(g){if(f)throw g.name==="SyntaxError"?hr.from(g,hr.ERR_BAD_RESPONSE,this,null,this.response):g}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bf.classes.FormData,Blob:Bf.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Bt.forEach(["delete","get","head","post","put","patch"],r=>{eG.headers[r]={}});var tG=eG;let Ixe=Bt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Gne=Symbol("internals");function LI(r){var a;return r&&Us(a=String(r)).call(a).toLowerCase()}function QD(r){return r===!1||r==null?r:Bt.isArray(r)?r.map(QD):String(r)}function nG(r,a,o,c,f){return Bt.isFunction(c)?c.call(this,a,o):(f&&(a=o),Bt.isString(a)?Bt.isString(c)?a.indexOf(c)!==-1:Bt.isRegExp(c)?c.test(a):void 0:void 0)}class ZD{constructor(a){a&&this.set(a)}set(a,o,c){let f=this;function g(T,R,A){let L=LI(R);if(!L)throw new Error("header name must be a non-empty string");let U=Bt.findKey(f,L);(!U||f[U]===void 0||A===!0||A===void 0&&f[U]!==!1)&&(f[U||R]=QD(T))}let v=(T,R)=>Bt.forEach(T,(A,L)=>g(A,L,R));var w;return Bt.isPlainObject(a)||a instanceof this.constructor?v(a,o):Bt.isString(a)&&(a=Us(a).call(a))&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Us(w=a).call(w))?v((T=>{let R={},A,L,U;return T&&T.split(`
`).forEach(function(F){var Z,W;U=F.indexOf(":"),A=Us(Z=F.substring(0,U)).call(Z).toLowerCase(),L=Us(W=F.substring(U+1)).call(W),!A||R[A]&&Ixe[A]||(A==="set-cookie"?R[A]?R[A].push(L):R[A]=[L]:R[A]=R[A]?R[A]+", "+L:L)}),R})(a),o):a!=null&&g(o,a,c),this}get(a,o){if(a=LI(a)){let c=Bt.findKey(this,a);if(c){let f=this[c];if(!o)return f;if(o===!0)return function(g){let v=Object.create(null),w=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,T;for(;T=w.exec(g);)v[T[1]]=T[2];return v}(f);if(Bt.isFunction(o))return o.call(this,f,c);if(Bt.isRegExp(o))return o.exec(f);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,o){if(a=LI(a)){let c=Bt.findKey(this,a);return!(!c||this[c]===void 0||o&&!nG(0,this[c],c,o))}return!1}delete(a,o){let c=this,f=!1;function g(v){if(v=LI(v)){let w=Bt.findKey(c,v);!w||o&&!nG(0,c[w],w,o)||(delete c[w],f=!0)}}return Bt.isArray(a)?a.forEach(g):g(a),f}clear(a){let o=Object.keys(this),c=o.length,f=!1;for(;c--;){let g=o[c];a&&!nG(0,this[g],g,a,!0)||(delete this[g],f=!0)}return f}normalize(a){let o=this,c={};return Bt.forEach(this,(f,g)=>{var v;let w=Bt.findKey(c,g);if(w)return o[w]=QD(f),void delete o[g];let T=a?function(R){return Us(R).call(R).toLowerCase().replace(/([a-z\d])(\w*)/g,(A,L,U)=>L.toUpperCase()+U)}(g):Us(v=String(g)).call(v);T!==g&&delete o[g],o[T]=QD(f),c[T]=!0}),this}concat(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return this.constructor.concat(this,...o)}toJSON(a){let o=Object.create(null);return Bt.forEach(this,(c,f)=>{c!=null&&c!==!1&&(o[f]=a&&Bt.isArray(c)?c.join(", "):c)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(a=>{let[o,c]=a;return o+": "+c}).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a){let o=new this(a);for(var c=arguments.length,f=new Array(c>1?c-1:0),g=1;g<c;g++)f[g-1]=arguments[g];return f.forEach(v=>o.set(v)),o}static accessor(a){let o=(this[Gne]=this[Gne]={accessors:{}}).accessors,c=this.prototype;function f(g){let v=LI(g);o[v]||(function(w,T){let R=Bt.toCamelCase(" "+T);["get","set","has"].forEach(A=>{Object.defineProperty(w,A+R,{value:function(L,U,F){return this[A].call(this,T,L,U,F)},configurable:!0})})}(c,g),o[v]=!0)}return Bt.isArray(a)?a.forEach(f):f(a),this}}ZD.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Bt.reduceDescriptors(ZD.prototype,(r,a)=>{let{value:o}=r,c=a[0].toUpperCase()+a.slice(1);return{get:()=>o,set(f){this[c]=f}}}),Bt.freezeMethods(ZD);var wm=ZD;function iG(r,a){let o=this||tG,c=a||o,f=wm.from(c.headers),g=c.data;return Bt.forEach(r,function(v){g=v.call(o,g,f.normalize(),a?a.status:void 0)}),f.normalize(),g}function Wne(r){return!(!r||!r.__CANCEL__)}function DI(r,a,o){hr.call(this,r??"canceled",hr.ERR_CANCELED,a,o),this.name="CanceledError"}Bt.inherits(DI,hr,{__CANCEL__:!0});var Nxe=Bf.hasStandardBrowserEnv?{write(r,a,o,c,f,g){let v=[r+"="+encodeURIComponent(a)];Bt.isNumber(o)&&v.push("expires="+new Date(o).toGMTString()),Bt.isString(c)&&v.push("path="+c),Bt.isString(f)&&v.push("domain="+f),g===!0&&v.push("secure"),document.cookie=v.join("; ")},read(r){let a=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $ne(r,a){return r&&!function(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}(a)?function(o,c){return c?o.replace(/\/?\/$/,"")+"/"+c.replace(/^\/+/,""):o}(r,a):a}var Oxe=Bf.hasStandardBrowserEnv?function(){let r=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a"),o;function c(f){let g=f;return r&&(a.setAttribute("href",g),g=a.href),a.setAttribute("href",g),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return o=c(window.location.href),function(f){let g=Bt.isString(f)?c(f):f;return g.protocol===o.protocol&&g.host===o.host}}():function(){return!0};function Kne(r,a){let o=0,c=function(f,g){f=f||10;let v=new Array(f),w=new Array(f),T,R=0,A=0;return g=g!==void 0?g:1e3,function(L){let U=Date.now(),F=w[A];T||(T=U),v[R]=L,w[R]=U;let Z=A,W=0;for(;Z!==R;)W+=v[Z++],Z%=f;if(R=(R+1)%f,R===A&&(A=(A+1)%f),U-T<g)return;let K=F&&U-F;return K?Math.round(1e3*W/K):void 0}}(50,250);return f=>{let g=f.loaded,v=f.lengthComputable?f.total:void 0,w=g-o,T=c(w);o=g;let R={loaded:g,total:v,progress:v?g/v:void 0,bytes:w,rate:T||void 0,estimated:T&&v&&g<=v?(v-g)/T:void 0,event:f};R[a?"download":"upload"]=!0,r(R)}}var Pxe=typeof XMLHttpRequest<"u"&&function(r){return new Ct(function(a,o){let c=r.data,f=wm.from(r.headers).normalize(),g,v,{responseType:w,withXSRFToken:T}=r;function R(){r.cancelToken&&r.cancelToken.unsubscribe(g),r.signal&&r.signal.removeEventListener("abort",g)}if(Bt.isFormData(c)){if(Bf.hasStandardBrowserEnv||Bf.hasStandardBrowserWebWorkerEnv)f.setContentType(!1);else if((v=f.getContentType())!==!1){let[Z,...W]=v?v.split(";").map(K=>Us(K).call(K)).filter(Boolean):[];f.setContentType([Z||"multipart/form-data",...W].join("; "))}}let A=new XMLHttpRequest;if(r.auth){let Z=r.auth.username||"",W=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";f.set("Authorization","Basic "+btoa(Z+":"+W))}let L=$ne(r.baseURL,r.url);function U(){if(!A)return;let Z=wm.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders());(function(W,K,oe){let ue=oe.config.validateStatus;oe.status&&ue&&!ue(oe.status)?K(new hr("Request failed with status code "+oe.status,[hr.ERR_BAD_REQUEST,hr.ERR_BAD_RESPONSE][Math.floor(oe.status/100)-4],oe.config,oe.request,oe)):W(oe)})(function(W){a(W),R()},function(W){o(W),R()},{data:w&&w!=="text"&&w!=="json"?A.response:A.responseText,status:A.status,statusText:A.statusText,headers:Z,config:r,request:A}),A=null}if(A.open(r.method.toUpperCase(),Yee(L,r.params,r.paramsSerializer),!0),A.timeout=r.timeout,"onloadend"in A?A.onloadend=U:A.onreadystatechange=function(){A&&A.readyState===4&&(A.status!==0||A.responseURL&&A.responseURL.indexOf("file:")===0)&&setTimeout(U)},A.onabort=function(){A&&(o(new hr("Request aborted",hr.ECONNABORTED,r,A)),A=null)},A.onerror=function(){o(new hr("Network Error",hr.ERR_NETWORK,r,A)),A=null},A.ontimeout=function(){let Z=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",W=r.transitional||Jee;r.timeoutErrorMessage&&(Z=r.timeoutErrorMessage),o(new hr(Z,W.clarifyTimeoutError?hr.ETIMEDOUT:hr.ECONNABORTED,r,A)),A=null},Bf.hasStandardBrowserEnv&&(T&&Bt.isFunction(T)&&(T=T(r)),T||T!==!1&&Oxe(L))){let Z=r.xsrfHeaderName&&r.xsrfCookieName&&Nxe.read(r.xsrfCookieName);Z&&f.set(r.xsrfHeaderName,Z)}c===void 0&&f.setContentType(null),"setRequestHeader"in A&&Bt.forEach(f.toJSON(),function(Z,W){A.setRequestHeader(W,Z)}),Bt.isUndefined(r.withCredentials)||(A.withCredentials=!!r.withCredentials),w&&w!=="json"&&(A.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&A.addEventListener("progress",Kne(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&A.upload&&A.upload.addEventListener("progress",Kne(r.onUploadProgress)),(r.cancelToken||r.signal)&&(g=Z=>{A&&(o(!Z||Z.type?new DI(null,r,A):Z),A.abort(),A=null)},r.cancelToken&&r.cancelToken.subscribe(g),r.signal&&(r.signal.aborted?g():r.signal.addEventListener("abort",g)));let F=function(Z){let W=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Z);return W&&W[1]||""}(L);F&&Bf.protocols.indexOf(F)===-1?o(new hr("Unsupported protocol "+F+":",hr.ERR_BAD_REQUEST,r)):A.send(c||null)})};let rG={http:null,xhr:Pxe};Bt.forEach(rG,(r,a)=>{if(r){try{Object.defineProperty(r,"name",{value:a})}catch{}Object.defineProperty(r,"adapterName",{value:a})}});let qne=r=>"- ".concat(r),Lxe=r=>Bt.isFunction(r)||r===null||r===!1;var Yne={getAdapter:r=>{r=Bt.isArray(r)?r:[r];let{length:a}=r,o,c,f={};for(let g=0;g<a;g++){let v;if(o=r[g],c=o,!Lxe(o)&&(c=rG[(v=String(o)).toLowerCase()],c===void 0))throw new hr("Unknown adapter '".concat(v,"'"));if(c)break;f[v||"#"+g]=c}if(!c){let g=Object.entries(f).map(v=>{let[w,T]=v;return"adapter ".concat(w," ")+(T===!1?"is not supported by the environment":"is not available in the build")});throw new hr("There is no suitable adapter to dispatch the request "+(a?g.length>1?`since :
`+g.map(qne).join(`
`):" "+qne(g[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return c},adapters:rG};function sG(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new DI(null,r)}function Xne(r){return sG(r),r.headers=wm.from(r.headers),r.data=iG.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Yne.getAdapter(r.adapter||tG.adapter)(r).then(function(a){return sG(r),a.data=iG.call(r,r.transformResponse,a),a.headers=wm.from(a.headers),a},function(a){return Wne(a)||(sG(r),a&&a.response&&(a.response.data=iG.call(r,r.transformResponse,a.response),a.response.headers=wm.from(a.response.headers))),Ct.reject(a)})}function Jne(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}let Qne=r=>r instanceof wm?function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o]!=null?arguments[o]:{};o%2?Jne(Object(c),!0).forEach(function(f){X(a,f,c[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):Jne(Object(c)).forEach(function(f){Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(c,f))})}return a}({},r):r;function nb(r,a){a=a||{};let o={};function c(R,A,L){return Bt.isPlainObject(R)&&Bt.isPlainObject(A)?Bt.merge.call({caseless:L},R,A):Bt.isPlainObject(A)?Bt.merge({},A):Bt.isArray(A)?A.slice():A}function f(R,A,L){return Bt.isUndefined(A)?Bt.isUndefined(R)?void 0:c(void 0,R,L):c(R,A,L)}function g(R,A){if(!Bt.isUndefined(A))return c(void 0,A)}function v(R,A){return Bt.isUndefined(A)?Bt.isUndefined(R)?void 0:c(void 0,R):c(void 0,A)}function w(R,A,L){return L in a?c(R,A):L in r?c(void 0,R):void 0}let T={url:g,method:g,data:g,baseURL:v,transformRequest:v,transformResponse:v,paramsSerializer:v,timeout:v,timeoutMessage:v,withCredentials:v,withXSRFToken:v,adapter:v,responseType:v,xsrfCookieName:v,xsrfHeaderName:v,onUploadProgress:v,onDownloadProgress:v,decompress:v,maxContentLength:v,maxBodyLength:v,beforeRedirect:v,transport:v,httpAgent:v,httpsAgent:v,cancelToken:v,socketPath:v,responseEncoding:v,validateStatus:w,headers:(R,A)=>f(Qne(R),Qne(A),!0)};return Bt.forEach(Object.keys(Object.assign({},r,a)),function(R){let A=T[R]||f,L=A(r[R],a[R],R);Bt.isUndefined(L)&&A!==w||(o[R]=L)}),o}let Zne="1.6.8",aG={};["object","boolean","number","function","string","symbol"].forEach((r,a)=>{aG[r]=function(o){return typeof o===r||"a"+(a<1?"n ":" ")+r}});let eie={};aG.transitional=function(r,a,o){function c(f,g){return"[Axios v"+Zne+"] Transitional option '"+f+"'"+g+(o?". "+o:"")}return(f,g,v)=>{if(r===!1)throw new hr(c(g," has been removed"+(a?" in "+a:"")),hr.ERR_DEPRECATED);return a&&!eie[g]&&(eie[g]=!0,console.warn(c(g," has been deprecated since v"+a+" and will be removed in the near future"))),!r||r(f,g,v)}};var oG={assertOptions:function(r,a,o){if(typeof r!="object")throw new hr("options must be an object",hr.ERR_BAD_OPTION_VALUE);let c=Object.keys(r),f=c.length;for(;f-- >0;){let g=c[f],v=a[g];if(v){let w=r[g],T=w===void 0||v(w,g,r);if(T!==!0)throw new hr("option "+g+" must be "+T,hr.ERR_BAD_OPTION_VALUE)}else if(o!==!0)throw new hr("Unknown option "+g,hr.ERR_BAD_OPTION)}},validators:aG};let j0=oG.validators,ek=class{constructor(r){this.defaults=r,this.interceptors={request:new Xee,response:new Xee}}async request(r,a){try{return await this._request(r,a)}catch(o){if(o instanceof Error){let c;Error.captureStackTrace?Error.captureStackTrace(c={}):c=new Error;let f=c.stack?c.stack.replace(/^.+\n/,""):"";o.stack?f&&!String(o.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(o.stack+=`
`+f):o.stack=f}throw o}}_request(r,a){typeof r=="string"?(a=a||{}).url=r:a=r||{},a=nb(this.defaults,a);let{transitional:o,paramsSerializer:c,headers:f}=a;o!==void 0&&oG.assertOptions(o,{silentJSONParsing:j0.transitional(j0.boolean),forcedJSONParsing:j0.transitional(j0.boolean),clarifyTimeoutError:j0.transitional(j0.boolean)},!1),c!=null&&(Bt.isFunction(c)?a.paramsSerializer={serialize:c}:oG.assertOptions(c,{encode:j0.function,serialize:j0.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let g=f&&Bt.merge(f.common,f[a.method]);f&&Bt.forEach(["delete","get","head","post","put","patch","common"],F=>{delete f[F]}),a.headers=wm.concat(g,f);let v=[],w=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(a)===!1||(w=w&&F.synchronous,v.unshift(F.fulfilled,F.rejected))});let T=[],R;this.interceptors.response.forEach(function(F){T.push(F.fulfilled,F.rejected)});let A,L=0;if(!w){let F=[Xne.bind(this),void 0];for(F.unshift.apply(F,v),F.push.apply(F,T),A=F.length,R=Ct.resolve(a);L<A;)R=R.then(F[L++],F[L++]);return R}A=v.length;let U=a;for(L=0;L<A;){let F=v[L++],Z=v[L++];try{U=F(U)}catch(W){Z.call(this,W);break}}try{R=Xne.call(this,U)}catch(F){return Ct.reject(F)}for(L=0,A=T.length;L<A;)R=R.then(T[L++],T[L++]);return R}getUri(r){return Yee($ne((r=nb(this.defaults,r)).baseURL,r.url),r.params,r.paramsSerializer)}};Bt.forEach(["delete","get","head","options"],function(r){ek.prototype[r]=function(a,o){return this.request(nb(o||{},{method:r,url:a,data:(o||{}).data}))}}),Bt.forEach(["post","put","patch"],function(r){function a(o){return function(c,f,g){return this.request(nb(g||{},{method:r,headers:o?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}ek.prototype[r]=a(),ek.prototype[r+"Form"]=a(!0)});var tk=ek;class lG{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Ct(function(f){o=f});let c=this;this.promise.then(f=>{if(!c._listeners)return;let g=c._listeners.length;for(;g-- >0;)c._listeners[g](f);c._listeners=null}),this.promise.then=f=>{let g,v=new Ct(w=>{c.subscribe(w),g=w}).then(f);return v.cancel=function(){c.unsubscribe(g)},v},a(function(f,g,v){c.reason||(c.reason=new DI(f,g,v),o(c.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){this.reason?a(this.reason):this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;let o=this._listeners.indexOf(a);o!==-1&&this._listeners.splice(o,1)}static source(){let a;return{token:new lG(function(o){a=o}),cancel:a}}}var Dxe=lG;let cG={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cG).forEach(r=>{let[a,o]=r;cG[o]=a});var kxe=cG;let Ra=function r(a){let o=new tk(a),c=Lee(tk.prototype.request,o);return Bt.extend(c,tk.prototype,o,{allOwnKeys:!0}),Bt.extend(c,o,null,{allOwnKeys:!0}),c.create=function(f){return r(nb(a,f))},c}(tG);Ra.Axios=tk,Ra.CanceledError=DI,Ra.CancelToken=Dxe,Ra.isCancel=Wne,Ra.VERSION=Zne,Ra.toFormData=UD,Ra.AxiosError=hr,Ra.Cancel=Ra.CanceledError,Ra.all=function(r){return Ct.all(r)},Ra.spread=function(r){return function(a){return r.apply(null,a)}},Ra.isAxiosError=function(r){return Bt.isObject(r)&&r.isAxiosError===!0},Ra.mergeConfig=nb,Ra.AxiosHeaders=wm,Ra.formToJSON=r=>Hne(Bt.isHTMLForm(r)?new FormData(r):r),Ra.getAdapter=Yne.getAdapter,Ra.HttpStatusCode=kxe,Ra.default=Ra;var Lo=Ra;let Mxe=()=>{};function kI(){let r={promise:void 0,isResolved:!1,isRejected:!1,isFinished:!1,resolve:void 0,reject:void 0,cancel:Mxe};return r.promise=new Ct((a,o)=>{r.resolve=c=>{r.isFinished||(r.isResolved=!0,r.isFinished=!0,a(c),r.value=c)},r.reject=c=>{r.isFinished||(r.isRejected=!0,r.isFinished=!0,o(c))}}),r}let nk=new Map,ik=new Map,Vf=new Map,vs=function(r){return r.WIN_10="Windows 10",r.WIN_81="Windows 8.1",r.WIN_8="Windows 8",r.WIN_7="Windows 7",r.WIN_VISTA="Windows Vista",r.WIN_SERVER_2003="Windows Server 2003",r.WIN_XP="Windows XP",r.WIN_2000="Windows 2000",r.ANDROID="Android",r.HARMONY_OS="HarmonyOS",r.OPEN_BSD="Open BSD",r.SUN_OS="Sun OS",r.LINUX="Linux",r.IOS="iOS",r.MAC_OS="Mac OS",r.CHROMIUM_OS="Chromium OS",r.QNX="QNX",r.UNIX="UNIX",r.BEOS="BeOS",r.OS_2="OS/2",r.SEARCH_BOT="Search Bot",r}({}),pi=function(r){return r.CHROME="Chrome",r.SAFARI="Safari",r.EDGE="Edge",r.FIREFOX="Firefox",r.OPERA="OPR",r.QQ="QQBrowser",r.WECHAT="MicroMessenger",r}({}),tie=new iCe,Ih=tie.getResult(),dG=null;function ni(r){if(!dG){Ih=tie.getResult();let a=function(w){if(w.engine.name==="Blink"&&w.browser.name!=="WeChat")return pi.CHROME;switch(w.browser.name){case"Chrome Headless":case"Chrome":case"Chromium":return pi.CHROME;case"Safari":case"Mobile Safari":return pi.SAFARI;case"Edge":return pi.EDGE;case"Firefox":return pi.FIREFOX;case"QQ":case"QQBrowser":return pi.QQ;case"Opera":return pi.OPERA;case"WeChat":return pi.WECHAT;default:return w.browser.name||""}}(Ih),o=nie(Ih),c=function(w){return w.os.name==="Windows"?w.os.version?w.os.name+" "+w.os.version:w.os.name:w.os.name||""}(Ih),f=Ih.os.version,g=nie(Ih,!1),v=Ih.device.type;if(!(a&&o&&c&&f))return{name:a,version:o,os:c,osVersion:f,browserVersion:g,deviceType:v};dG={name:a,version:o,os:c,osVersion:f,browserVersion:g,deviceType:v}}return dG}function nie(r){let a,o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return a=r.engine.name==="Blink"?r.engine.version||"":r.browser.version||"",o?a.split(".")[0]:a}function rk(){return ni().os}function iie(){let r=ni();return"".concat(r.os," ").concat(r.osVersion)}function sk(){let r=ni();return!!(Ih.engine.name==="WebKit"&&r.os===vs.MAC_OS&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0&&r.name!==pi.SAFARI||ca()&&r.name!==pi.SAFARI)}function U0(){return ni().name===pi.CHROME}function ys(){return ni().name===pi.SAFARI}function rie(){return ni().name===pi.EDGE}function Oi(){return ni().name===pi.FIREFOX}function ca(){return ni().os===vs.IOS}function uG(r){let a=ni();return!(a.name!==pi.CHROME||!a.osVersion)&&Number(a.version)>=r}function sie(r){let a=ni();return!(a.name!==pi.EDGE||!a.osVersion)&&Number(a.version)>=r}function aie(r){let a=ni();return!(a.name!==pi.SAFARI||!a.osVersion)&&Number(a.version)>=r}function oie(r,a,o){let c=ni();if(c.os!==vs.IOS||!c.osVersion)return!1;let f=c.osVersion.split(".");return a&&Number(f[0])===r&&Number(f[1])<a||Number(f[0])<r}function lie(r,a,o){let c=ni();if(c.name!==pi.SAFARI||!c.osVersion||!c.browserVersion)return!1;let f=c.browserVersion.split(".");return a&&Number(f[0])===r&&Number(f[1])<a||Number(f[0])<r}function cie(r){let a=ni();return!(a.name!==pi.OPERA||!a.osVersion)&&Number(a.version)>=r}function die(){let r=ni();return!(r.name!==pi.CHROME||!r.osVersion)&&Number(r.version)<=90}function uie(){let r=ni();if(r.os!==vs.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])<14||Number(a[0])===14&&Number(a[1])<=6}function ib(){let r=ni();if(r.os!==vs.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])===15}function hG(){let r=ni();if(r.os!==vs.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])===16}function hie(){let r=ni();if(r.os!==vs.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])===15&&Number(a[1])>=1}function Eu(){return ys()&&navigator.maxTouchPoints>0}function fie(){return ni().name===pi.WECHAT}function pie(){return window.navigator.appVersion&&window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)!==null&&window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)[1]<=35}function fG(){let r=rk();return function(){let{deviceType:a}=ni();return a==="mobile"||a==="tablet"}()||r===vs.ANDROID||r===vs.IOS||r===vs.HARMONY_OS}function F0(){let r=ni();return r.name!==pi.EDGE&&r.name!==pi.SAFARI&&!!navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]./i)}function ak(){return rk()===vs.ANDROID}function MI(){let r=ni();return ak()&&(r.name===pi.CHROME||r.name===pi.WECHAT||/chrome|chromium/i.test(navigator.userAgent))}function mie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Kt(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?mie(Object(o),!0).forEach(function(c){Ji(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):mie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function Ji(r,a,o){return(a=function(c){var f=function(g,v){if(typeof g!="object"||g===null)return g;var w=g[Symbol.toPrimitive];if(w!==void 0){var T=w.call(g,"string");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}(c);return typeof f=="symbol"?f:String(f)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}let ce=function(r){return r.UNEXPECTED_ERROR="UNEXPECTED_ERROR",r.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",r.TIMEOUT="TIMEOUT",r.INVALID_PARAMS="INVALID_PARAMS",r.NOT_READABLE="NOT_READABLE",r.NOT_SUPPORTED="NOT_SUPPORTED",r.INVALID_OPERATION="INVALID_OPERATION",r.OPERATION_ABORTED="OPERATION_ABORTED",r.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",r.EXCHANGE_SDP_FAILED="EXCHANGE_SDP_FAILED",r.ADD_CANDIDATE_FAILED="ADD_CANDIDATE_FAILED",r.DATACHANNEL_FAILED="DATACHANNEL_FAILED",r.NETWORK_ERROR="NETWORK_ERROR",r.NETWORK_TIMEOUT="NETWORK_TIMEOUT",r.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",r.API_INVOKE_TIMEOUT="API_INVOKE_TIMEOUT",r.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",r.DEVICE_NOT_FOUND="DEVICE_NOT_FOUND",r.ELECTRON_IS_NULL="ELECTRON_IS_NULL",r.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR="ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",r.CHROME_PLUGIN_NO_RESPONSE="CHROME_PLUGIN_NO_RESPONSE",r.CHROME_PLUGIN_NOT_INSTALL="CHROME_PLUGIN_NOT_INSTALL",r.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",r.PERMISSION_DENIED="PERMISSION_DENIED",r.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",r.TRACK_IS_DISABLED="TRACK_IS_DISABLED",r.GET_VIDEO_ELEMENT_VISIBLE_ERROR="GET_VIDEO_ELEMENT_VISIBLE_ERROR",r.SHARE_AUDIO_NOT_ALLOWED="SHARE_AUDIO_NOT_ALLOWED",r.LOW_STREAM_ENCODING_ERROR="LOW_STREAM_ENCODING_ERROR",r.SET_ENCODING_PARAMETER_ERROR="SET_ENCODING_PARAMETER_ERROR",r.TRACK_STATE_UNREACHABLE="TRACK_STATE_UNREACHABLE",r.INVALID_UINT_UID_FROM_STRING_UID="INVALID_UINT_UID_FROM_STRING_UID",r.CAN_NOT_GET_PROXY_SERVER="CAN_NOT_GET_PROXY_SERVER",r.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",r.VOID_GATEWAY_ADDRESS="VOID_GATEWAY_ADDRESS",r.UID_CONFLICT="UID_CONFLICT",r.MULTI_UNILBS_RESPONSE_ERROR="MULTI_UNILBS_RESPONSE_ERROR",r.UPDATE_TICKET_FAILED="UPDATE_TICKET_FAILED",r.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",r.INVALID_TRACK="INVALID_TRACK",r.SENDER_NOT_FOUND="SENDER_NOT_FOUND",r.CREATE_OFFER_FAILED="CREATE_OFFER_FAILED",r.SET_ANSWER_FAILED="SET_ANSWER_FAILED",r.ICE_FAILED="ICE_FAILED",r.PC_CLOSED="PC_CLOSED",r.SENDER_REPLACE_FAILED="SENDER_REPLACE_FAILED",r.GET_LOCAL_CAPABILITIES_FAILED="GET_LOCAL_CAPABILITIES_FAILED",r.GET_LOCAL_CONNECTION_PARAMS_FAILED="GET_LOCAL_CONNECTION_PARAMS_FAILED",r.SUBSCRIBE_FAILED="SUBSCRIBE_FAILED",r.UNSUBSCRIBE_FAILED="UNSUBSCRIBE_FAILED",r.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",r.NO_ICE_CANDIDATE="NO_ICE_CANDIDATE",r.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",r.EXIST_DISABLED_VIDEO_TRACK="EXIST_DISABLED_VIDEO_TRACK",r.INVALID_REMOTE_USER="INVALID_REMOTE_USER",r.REMOTE_USER_IS_NOT_PUBLISHED="REMOTE_USER_IS_NOT_PUBLISHED",r.CUSTOM_REPORT_SEND_FAILED="CUSTOM_REPORT_SEND_FAILED",r.CUSTOM_REPORT_FREQUENCY_TOO_HIGH="CUSTOM_REPORT_FREQUENCY_TOO_HIGH",r.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",r.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",r.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",r.WS_ABORT="WS_ABORT",r.WS_DISCONNECT="WS_DISCONNECT",r.WS_ERR="WS_ERR",r.EXTERNAL_SIGNAL_ABORT="EXTERNAL_SIGNAL_ABORT",r.LIVE_STREAMING_TASK_CONFLICT="LIVE_STREAMING_TASK_CONFLICT",r.LIVE_STREAMING_INVALID_ARGUMENT="LIVE_STREAMING_INVALID_ARGUMENT",r.LIVE_STREAMING_INTERNAL_SERVER_ERROR="LIVE_STREAMING_INTERNAL_SERVER_ERROR",r.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED="LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED",r.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED="LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED",r.LIVE_STREAMING_CDN_ERROR="LIVE_STREAMING_CDN_ERROR",r.LIVE_STREAMING_INVALID_RAW_STREAM="LIVE_STREAMING_INVALID_RAW_STREAM",r.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT="LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT",r.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE="LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE",r.LIVE_STREAMING_WARN_FREQUENT_REQUEST="LIVE_STREAMING_WARN_FREQUENT_REQUEST",r.WEBGL_INTERNAL_ERROR="WEBGL_INTERNAL_ERROR",r.BEAUTY_PROCESSOR_INTERNAL_ERROR="BEAUTY_PROCESSOR_INTERNAL_ERROR",r.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",r.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SEC",r.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",r.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",r.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE",r.METADATA_OUT_OF_RANGE="METADATA_OUT_OF_RANGE",r.LOCAL_AEC_ERROR="LOCAL_AEC_ERROR",r.INVALID_PLUGIN="INVALID_PLUGIN",r.DISCONNECT_P2P="DISCONNECT_P2P",r.INIT_WEBSOCKET_TIMEOUT="INIT_WEBSOCKET_TIMEOUT",r.CONVERTING_IMAGEDATA_TO_BLOB_FAILED="CONVERTING_IMAGEDATA_TO_BLOB_FAILED",r.CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED="CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED",r.INIT_DATACHANNEL_TIMEOUT="INIT_DATACHANNEL_TIMEOUT",r.CREATE_DATACHANNEL_ERROR="CREATE_DATACHANNEL_ERROR",r.DATACHANNEL_CONNECTION_TIMEOUT="DATACHANNEL_CONNECTION_TIMEOUT",r.PROHIBITED_OPERATION="PROHIBITED_OPERATION",r.IMAGE_MODERATION_UPLOAD_FAILED="IMAGE_MODERATION_UPLOAD_FAILED",r.P2P_MESSAGE_FAILED="P2P_MESSAGE_FAILED",r}({});class Ke extends Error{constructor(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",c=arguments.length>2?arguments[2]:void 0;super(o),Ji(this,"code",void 0),Ji(this,"message",void 0),Ji(this,"data",void 0),Ji(this,"name","AgoraRTCException"),this.code=a,this.message="AgoraRTCError ".concat(this.code,": ").concat(o),this.data=c}toString(){return this.data?"data: ".concat(JSON.stringify(this.data),`
`).concat(this.stack):"".concat(this.stack)}print(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"error",o=arguments.length>1?arguments[1]:void 0;return a==="error"&&(o||console).error(this.toString()),a==="warning"&&(o||console).warn(this.toString()),this}throw(a){throw this.print("error",a),this}}function Sm(r,a){if(typeof r!="boolean")throw new Ke(ce.INVALID_PARAMS,"Invalid ".concat(a,": The value is of the boolean type."))}function ls(r,a,o){if(!Tt(o).call(o,r))throw new Ke(ce.INVALID_PARAMS,"".concat(a," can only be set as ").concat(JSON.stringify(o)))}function Ti(r,a){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e4;if(r<o||r>c||(!(arguments.length>4&&arguments[4]!==void 0)||arguments[4])&&!function(f){return typeof f=="number"&&f%1==0}(r))throw new Ke(ce.INVALID_PARAMS,"invalid ".concat(a,": the value range is [").concat(o,", ").concat(c,"]. integer only"))}function pG(r,a){if(typeof r!="number"){if(!(r.min||r.max||r.ideal||r.exact))throw new Ke(ce.INVALID_PARAMS,"".concat(a," is not a valid ConstrainLong"));r.min!==void 0&&Ti(r.min,"".concat(a,".min"),0,1/0),r.max!==void 0&&Ti(r.max,"".concat(a,".max"),1,1/0),r.exact!==void 0&&Ti(r.exact,"".concat(a,".exact"),1,1/0),r.ideal!==void 0&&Ti(r.ideal,"".concat(a,".ideal"),1,1/0)}else Ti(r,a,1,1/0)}function Fs(r,a){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:255,f=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(r==null)throw new Ke(ce.INVALID_PARAMS,"".concat(a||"param"," cannot be empty"));if(!gie(r,o,c,f))throw new Ke(ce.INVALID_PARAMS,"Invalid ".concat(a||"string param",": Length of the string: [").concat(o,",").concat(c,"].").concat(f?" ASCII characters only.":""))}function bm(r,a){if(!Array.isArray(r))throw new Ke(ce.INVALID_PARAMS,"".concat(a," should be an array"))}function gr(r){return r==null}function gie(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:255,c=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];return typeof r=="string"&&r.length<=o&&r.length>=a&&(!c||function(f){if(typeof f!="string")return!1;for(let g=0;g<f.length;g+=1){let v=f.charCodeAt(g);if(v<0||v>255)return!1}return!0}(r))}function vie(r,a,o){if("getBigUint64"in DataView.prototype)return r.getBigUint64(a,o);let c=r.getUint32(a,o),f=r.getUint32(a+4,o),g=+!!o,v=+!o;return BigInt(c*v+f*g)<<BigInt(32)|BigInt(c*g+f*v)}function yie(r,a,o,c){if("setBigUint64"in DataView.prototype)return r.setBigUint64(a,o,c);let f=Number(o>>BigInt(32)),g=Number(o&BigInt(4294967295));r.setUint32(a,f,c),r.setUint32(a+4,g,c)}var jI=function(r){return r.COVERED="COVERED",r.POSITION="POSITION",r.SIZE="SIZE",r.STYLE="STYLE",r}(jI||{}),mG=function(r){return r.UNMOUNTED="UNMOUNTED",r.INVALID_HTML_ELEMENT="INVALID_HTML_ELEMENT",r}(mG||{});let _ie=new class{constructor(){Ji(this,"_clientSize",null),Ji(this,"getClientWidth",()=>document.documentElement?document.documentElement.clientWidth:document.body.clientWidth),Ji(this,"getClientHeight",()=>document.documentElement?document.documentElement.clientHeight:document.body.clientHeight),Ji(this,"getStyle",r=>window.getComputedStyle(r,null)),Ji(this,"checkCssVisibleProperty",r=>{var a;let o=!0,c=this.getStyle(r),{display:f,visibility:g,opacity:v,filter:w}=c;return(f==="none"||Tt(a=["hidden","collapse"]).call(a,g)||Number(v)<.1)&&(o=!1),!!o&&(w&&w.split(" ").filter(T=>{var R;let A=T.split("(")[0];return Tt(R=["brightness","blur","opacity"]).call(R,A)}).map(T=>{let[R,A]=T.split(/\(|\)/);return[R,Number(A.match(/^[0-9\.]+/))]}).forEach(T=>{let[R,A]=T;switch(R){case"brightness":(A<.1||A>3)&&(o=!1);break;case"blur":A>3&&(o=!1);break;case"opacity":A<.1&&(o=!1)}}),o)}),Ji(this,"checkPropertyUpToAllParentNodes",(r,a)=>{let o=!0,c=!0,f=v=>a(v),g=r;for(;g&&c;)f(g)||(o=!1,c=!1),g=g.parentElement,g||(c=!1);return o}),Ji(this,"checkActualCssVisibleIncludeInherit",r=>this.checkPropertyUpToAllParentNodes(r,this.checkCssVisibleProperty)),Ji(this,"getSizeAboutClient",r=>{let{width:a,height:o,left:c,right:f,top:g,bottom:v}=r.getBoundingClientRect(),w=this.getClientWidth(),T=this.getClientHeight();return{width:a,height:o,left:c,right:f,top:g,bottom:v,clientWidth:w,clientHeight:T,clientMin:Math.min(w,T)}}),Ji(this,"checkActualSize",()=>{let{width:r,height:a,clientMin:o}=this._clientSize;return this.checkSizeIsVisible(r,a,o)}),Ji(this,"elementFromPoint",(r,a)=>document.elementFromPoint?document.elementFromPoint(r,a):null),Ji(this,"checkCoverForAPoint",(r,a,o)=>{let c=this.elementFromPoint(r,a);return c!==null&&c!==o}),Ji(this,"getPointPositionList",()=>{let{width:r,height:a,left:o,top:c}=this._clientSize,f=r/6,g=a/6,v=[],w=10**6;for(let T=0;T<5;T++)for(let R=0;R<5;R++){let A=(o*w+(T===0?.1:T===4?(f*T*w-1e5)/w:f*T)*w)/w,L=(c*w+(R===0?.1:R===4?(g*R*w-1e5)/w:g*R)*w)/w;v.push({x:A,y:L})}return[...v]}),Ji(this,"checkElementCover",r=>this.getPointPositionList().map(a=>this.checkCoverForAPoint(a.x,a.y,r)).filter(a=>!!a).length>6),Ji(this,"checkSizeIsVisible",(r,a,o)=>(r>50||o/r<=10)&&(a>50||o/a<=10)),Ji(this,"checkSizeOfPartInClient",()=>{let{left:r,right:a,top:o,bottom:c,clientHeight:f,clientWidth:g,clientMin:v}=this._clientSize,w,T,R,A;if(r<0)w=0;else{if(!(r<g))return!1;w=r}if(a<0)return!1;if(T=a<g?a:g,o<0)R=0;else{if(!(o<f))return!1;R=o}if(c<0)return!1;A=c<f?c:f;let L=T-w,U=A-R;return this.checkSizeIsVisible(L,U,v)}),Ji(this,"returnHiddenResult",r=>(this._clientSize=null,{visible:!1,reason:r})),Ji(this,"checkOneElementVisible",r=>{if(r instanceof HTMLElement){if(this.checkElementIsMountedOnDom(r)){if(this.checkActualCssVisibleIncludeInherit(r)){if(this._clientSize=this.getSizeAboutClient(r),this.checkElementCover(r))return this.returnHiddenResult(jI.COVERED);{let a=this.checkActualSize(),o=this.checkSizeOfPartInClient();return a&&!o?this.returnHiddenResult(jI.POSITION):a?(this._clientSize=null,{visible:!0}):this.returnHiddenResult(jI.SIZE)}}return this.returnHiddenResult(jI.STYLE)}return this.returnHiddenResult(mG.UNMOUNTED)}return this.returnHiddenResult(mG.INVALID_HTML_ELEMENT)}),Ji(this,"checkElementIsMountedOnDom",r=>this.checkPropertyUpToAllParentNodes(r,a=>a.nodeName.toUpperCase()!=="HTML"?a.parentElement!==null:!!document.documentElement))}};function gG(r){return new TextEncoder().encode(r)}let Eie=function(r,a){let o=new Uint8Array(r.byteLength+a.byteLength);return o.set(new Uint8Array(r),0),o.set(new Uint8Array(a),r.byteLength),o},vG=async r=>function(a,o){let c="";return new Uint8Array(a).forEach(f=>{c+=f.toString(o).padStart(2,"0")}),c}(await crypto.subtle.digest("SHA-256",gG(r)),16),tr=class{constructor(){Ji(this,"_events",{}),Ji(this,"addListener",this.on)}getListeners(r){return this._events[r]?this._events[r].map(a=>a.listener):[]}on(r,a){this._events[r]||(this._events[r]=[]);let o=this._events[r];this._indexOfListener(o,a)===-1&&o.push({listener:a,once:!1})}once(r,a){this._events[r]||(this._events[r]=[]);let o=this._events[r];this._indexOfListener(o,a)===-1&&o.push({listener:a,once:!0})}off(r,a){if(!this._events[r])return;let o=this._events[r],c=this._indexOfListener(o,a);c!==-1&&o.splice(c,1),this._events[r].length===0&&delete this._events[r]}removeAllListeners(r){r?delete this._events[r]:this._events={}}emit(r){this._events[r]||(this._events[r]=[]);let a=this._events[r].map(g=>g);for(var o=arguments.length,c=new Array(o>1?o-1:0),f=1;f<o;f++)c[f-1]=arguments[f];for(let g=0;g<a.length;g+=1){let v=a[g];v.once&&this.off(r,v.listener),v.listener.apply(this,c||[])}}safeEmit(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),c=1;c<a;c++)o[c-1]=arguments[c];[...this._events[r]||[]].forEach(f=>{f.once&&this.off(r,f.listener);try{f.listener.apply(this,o)}catch(g){console.error("safeEmit event:".concat(r," error ").concat(g==null?void 0:g.toString()))}})}_indexOfListener(r,a){let o=r.length;for(;o--;)if(r[o].listener===a)return o;return-1}},UI=null;function wie(){if(UI)return UI;if(window.electron)return UI=window.electron;if(!window.require)return null;try{return UI=window.require("electron"),UI}catch{return null}}let qr=function(r){return r.CREATE_CLIENT="createClient",r.CHECK_SYSTEM_REQUIREMENTS="checkSystemRequirements",r.SET_AREA="setArea",r.PRELOAD="PRELOAD",r.CHECK_VIDEO_TRACK_IS_ACTIVE="checkVideoTrackIsActive",r.CHECK_AUDIO_TRACK_IS_ACTIVE="checkAudioTrackIsActive",r.CREATE_MIC_AUDIO_TRACK="createMicrophoneAudioTrack",r.CREATE_CUSTOM_AUDIO_TRACK="createCustomAudioTrack",r.CREATE_BUFFER_AUDIO_TRACK="createBufferSourceAudioTrack",r.CREATE_CAM_VIDEO_TRACK="createCameraVideoTrack",r.CREATE_CUSTOM_VIDEO_TRACK="createCustomVideoTrack",r.CREATE_MIC_AND_CAM_TRACKS="createMicrophoneAndCameraTracks",r.CREATE_SCREEN_VIDEO_TRACK="createScreenVideoTrack",r.SET_ENCRYPTION_CONFIG="Client.setEncryptionConfig",r.START_PROXY_SERVER="Client.startProxyServer",r.STOP_PROXY_SERVER="Client.stopProxyServer",r.SET_PROXY_SERVER="Client.setProxyServer",r.SET_TURN_SERVER="Client.setTurnServer",r.SET_CLIENT_ROLE="Client.setClientRole",r.SET_LOW_STREAM_PARAMETER="Client.setLowStreamParameter",r.ENABLE_DUAL_STREAM="Client.enableDualStream",r.DISABLE_DUAL_STREAM="Client.disableDualStream",r.JOIN="Client.join",r.LEAVE="Client.leave",r.PUBLISH="Client.publish",r.UNPUBLISH="Client.unpublish",r.SUBSCRIBE="Client.subscribe",r.MASS_SUBSCRIBE="Client.massSubscribe",r.MASS_UNSUBSCRIBE="Client.massUnsubscribe",r.UNSUBSCRIBE="Client.unsubscribe",r.RENEW_TOKEN="Client.renewToken",r.SET_REMOTE_VIDEO_STREAM_TYPE="Client.setRemoteVideoStreamType",r.SET_STREAM_FALLBACK_OPTION="Client.setStreamFallbackOption",r.ENABLE_AUDIO_VOLUME_INDICATOR="Client.enableAudioVolumeIndicator",r.SEND_CUSTOM_REPORT_MESSAGE="Client.sendCustomReportMessage",r.INSPECT_VIDEO_CONTENT="Client.inspectVideoContent",r.STOP_INSPECT_VIDEO_CONTENT="Client.stopInspectVideoContent",r.JOIN_FALLBACK_TO_PROXY="Client._joinFallbackToProxy",r.DATACHANNEL_FAILBACK="Client._datachannelFailback",r.ON_LIVE_STREAM_WARNING="Client.onLiveStreamWarning",r.ON_LIVE_STREAM_ERROR="Client.onLiveStreamingError",r.START_LIVE_STREAMING="Client.startLiveStreaming",r.SET_LIVE_TRANSCODING="Client.setLiveTranscoding",r.STOP_LIVE_STREAMING="Client.stopLiveStreaming",r.START_CHANNEL_MEDIA_RELAY="Client.startChannelMediaRelay",r.UPDATE_CHANNEL_MEDIA_RELAY="Client.updateChannelMediaRelay",r.STOP_CHANNEL_MEDIA_RELAY="Client.stopChannelMediaRelay",r.REQUEST_CONFIG_DISTRIBUTE="_config-distribute-request",r.SET_CONFIG_DISTRIBUTE="_configDistribute",r.LOCAL_TRACK_SET_MUTED="LocalTrack.setMute",r.LOCAL_AUDIO_TRACK_PLAY="LocalAudioTrack.play",r.LOCAL_AUDIO_TRACK_PLAY_IN_ELEMENT="LocalAudioTrack.playInElement",r.LOCAL_AUDIO_TRACK_STOP="LocalAudioTrack.stop",r.LOCAL_AUDIO_TRACK_SET_VOLUME="LocalAudioTrack.setVolume",r.MIC_AUDIO_TRACK_SET_DEVICE="MicrophoneAudioTrack.setDevice",r.BUFFER_AUDIO_TRACK_START="BufferSourceAudioTrack.startProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_STOP="BufferSourceAudioTrack.stopProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_PAUSE="BufferSourceAudioTrack.pauseProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_RESUME="BufferSourceAudioTrack.resumeProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_SEEK="BufferSourceAudioTrack.seekAudioBuffer",r.LOCAL_VIDEO_TRACK_PLAY="LocalVideoTrack.play",r.LOCAL_VIDEO_TRACK_STOP="LocalVideoTrack.stop",r.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE="LocalVideoTrack.getVideoElementVisibleStatus",r.LOCAL_VIDEO_TRACK_BEAUTY="LocalVideoTrack.setBeautyEffect",r.LOCAL_VIDEO_SEND_SEI_DATA="LocalVideoTrack.sendSeiData",r.CAM_VIDEO_TRACK_SET_DEVICE="CameraVideoTrack.setDevice",r.CAM_VIDEO_TRACK_SET_ENCODER_CONFIG="CameraVideoTrack.setEncoderConfiguration",r.REMOTE_VIDEO_TRACK_PLAY="RemoteVideoTrack.play",r.REMOTE_VIDEO_TRACK_STOP="RemoteVideoTrack.stop",r.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE="RemoteVideoTrack.getVideoElementVisibleStatus",r.REMOTE_AUDIO_TRACK_PLAY="RemoteAudioTrack.play",r.REMOTE_AUDIO_TRACK_STOP="RemoteAudioTrack.stop",r.REMOTE_AUDIO_SET_VOLUME="RemoteAudioTrack.setVolume",r.REMOTE_AUDIO_SET_OUTPUT_DEVICE="RemoteAudioTrack.setOutputDevice",r.GET_MEDIA_STREAM_TRACK="Track.getMediaStreamTrack",r.STREAM_TYPE_CHANGE="streamTypeChange",r.CONNECTION_STATE_CHANGE="connectionStateChange",r.LOAD_CONFIG_FROM_LOCALSTORAGE="loadConfigFromLocalStorage",r.IMAGE_MODERATION_UPLOAD="imageModerationUpload",r}({}),vr=function(r){return r.TRACER="tracer",r}({});function Sie(r){return Ti(r.timeout,"config.timeout",0,1e5),Ti(r.timeoutFactor,"config.timeoutFactor",0,100,!1),Ti(r.maxRetryCount,"config.maxRetryConfig",0,1/0),Ti(r.maxRetryTimeout,"config.maxRetryTimeout",0,1/0),!0}let jxe=function(r){return r[r.AUDIENCE_LEVEL_LOW_LATENCY=1]="AUDIENCE_LEVEL_LOW_LATENCY",r[r.AUDIENCE_LEVEL_ULTRA_LOW_LATENCY=2]="AUDIENCE_LEVEL_ULTRA_LOW_LATENCY",r[r.AUDIENCE_LEVEL_SYNC_LATENCY=3]="AUDIENCE_LEVEL_SYNC_LATENCY",r}({}),Hn=function(r){return r.LEAVE="LEAVE",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.UID_BANNED="UID_BANNED",r.IP_BANNED="IP_BANNED",r.CHANNEL_BANNED="CHANNEL_BANNED",r.FALLBACK="FALLBACK",r.LICENSE_MISSING="LICENSE_MISSING",r.LICENSE_EXPIRED="LICENSE_EXPIRED",r.LICENSE_MINUTES_EXCEEDED="LICENSE_MINUTES_EXCEEDED",r.LICENSE_PERIOD_INVALID="LICENSE_PERIOD_INVALID",r.LICENSE_MULTIPLE_SDK_SERVICE="LICENSE_MULTIPLE_SDK_SERVICE",r.LICENSE_ILLEGAL="LICENSE_ILLEGAL",r.TOKEN_EXPIRE="TOKEN_EXPIRE",r}({});function rb(r){if(!Array.isArray(r)||r.length<1)return!1;try{r.forEach(a=>{if(!a.urls)throw Error()})}catch{return!1}return!0}function bie(r){return Fs(r.turnServerURL,"turnServerURL"),Fs(r.username,"username"),Fs(r.password,"password"),r.udpport&&Ti(r.udpport,"udpport",1,99999,!0),r.forceturn&&Sm(r.forceturn,"forceturn"),r.security&&Sm(r.security,"security"),r.tcpport&&Ti(r.tcpport,"tcpport",1,99999,!0),!0}function Cie(r){return r.level!==void 0&&ls(r.level,"level",[1,2,3]),r.delay!==void 0&&Ti(r.delay,"delay",0,3e3,!0),!0}let Gn=function(r){return r.CONNECTION_STATE_CHANGE="connection-state-change",r.MEDIA_RECONNECT_START="media-reconnect-start",r.MEDIA_RECONNECT_END="media-reconnect-end",r.IS_USING_CLOUD_PROXY="is-using-cloud-proxy",r.USER_JOINED="user-joined",r.USER_LEAVED="user-left",r.USER_PUBLISHED="user-published",r.USER_UNPUBLISHED="user-unpublished",r.USER_INFO_UPDATED="user-info-updated",r.CLIENT_BANNED="client-banned",r.CHANNEL_MEDIA_RELAY_STATE="channel-media-relay-state",r.CHANNEL_MEDIA_RELAY_EVENT="channel-media-relay-event",r.VOLUME_INDICATOR="volume-indicator",r.CRYPT_ERROR="crypt-error",r.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="token-privilege-will-expire",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="token-privilege-did-expire",r.NETWORK_QUALITY="network-quality",r.STREAM_TYPE_CHANGED="stream-type-changed",r.STREAM_FALLBACK="stream-fallback",r.RECEIVE_METADATA="receive-metadata",r.STREAM_MESSAGE="stream-message",r.LIVE_STREAMING_ERROR="live-streaming-error",r.LIVE_STREAMING_WARNING="live-streaming-warning",r.INJECT_STREAM_STATUS="stream-inject-status",r.EXCEPTION="exception",r.ERROR="error",r.P2P_LOST="p2p_lost",r.JOIN_FALLBACK_TO_PROXY="join-fallback-to-proxy",r.CHANNEL_FALLBACK_TO_WEBSOCKET="channel-fallback-to-websocket",r.MEDIA_CONNECTION_TYPE_CHANGE="media-connection-type-change",r.PUBLISHED_USER_LIST="published-user-list",r.CONTENT_INSPECT_CONNECTION_STATE_CHANGE="content-inspect-connection-state-change",r.CONTENT_INSPECT_ERROR="content-inspect-error",r.CONTENT_INSPECT_RESULT="content-inspect-result",r.IMAGE_MODERATION_CONNECTION_STATE_CHANGE="image-moderation-connection-state-change",r}({}),Xs=function(r){return r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.MULTI_IP="MULTI_IP",r.TIMEOUT="TIMEOUT",r.OFFLINE="OFFLINE",r.LEAVE="LEAVE",r.P2P_FAILED="P2P_FAILED",r.FALLBACK="FALLBACK",r}({}),so=function(r){return r.ONLINE="ONLINE",r.OFFLINE="OFFLINE",r}({}),s_=function(r){return r.NETWORK_STATE_CHANGE="NETWORK_STATE_CHANGE",r.ONLINE="ONLINE",r.OFFLINE="OFFLINE",r}({});function Yr(r,a){for(var o=arguments.length,c=new Array(o>2?o-2:0),f=2;f<o;f++)c[f-2]=arguments[f];return r.getListeners(a).length===0?Ct.reject(new Ke(ce.UNEXPECTED_ERROR,"can not emit promise")):new Ct((g,v)=>{r.emit(a,...c,g,v)})}function Pi(r,a){if(r.getListeners(a).length===0)return Ct.resolve();for(var o=arguments.length,c=new Array(o>2?o-2:0),f=2;f<o;f++)c[f-2]=arguments[f];return Yr(r,a,...c)}function Bl(r,a){if(r.getListeners(a).length===0)return null;for(var o=arguments.length,c=new Array(o>2?o-2:0),f=2;f<o;f++)c[f-2]=arguments[f];return a_(r,a,...c)}function a_(r,a){let o=null,c=null;for(var f=arguments.length,g=new Array(f>2?f-2:0),v=2;v<f;v++)g[v-2]=arguments[v];if(r.emit(a,...g,w=>{o=w},w=>{c=w}),c!==null)throw c;if(o===null)throw new Ke(ce.UNEXPECTED_ERROR,"handler is not sync");return o}let yr=new class extends tr{set networkState(r){this.emit(s_.NETWORK_STATE_CHANGE,r,this._networkState),r===so.ONLINE?this.emit(s_.ONLINE):r===so.OFFLINE&&(this.onlineWaiter=new Ct(a=>{this.once(s_.ONLINE,()=>{this.onlineWaiter=void 0,a(so.ONLINE)})}),this.emit(s_.OFFLINE)),this._networkState=r}get networkState(){return this._networkState}get isOnline(){return this._networkState===so.ONLINE}constructor(){super(),Ji(this,"_moduleName","network-indicator"),Ji(this,"_networkState",so.ONLINE),Ji(this,"onlineWaiter",void 0),window.addEventListener("online",()=>{this.networkState=so.ONLINE}),window.addEventListener("offline",()=>{this.networkState=so.OFFLINE})}};function ok(r,a){let o=r.indexOf(a);o!==-1&&r.splice(o,1)}function sb(r){let a=[];return r.forEach(o=>{a.indexOf(o)===-1&&a.push(o)}),a}function lk(r){Ct!==void 0?Ct.resolve().then(r):setTimeout(r,0)}function zi(r){return JSON.parse(JSON.stringify(r))}function o_(r){try{return zi(r)}catch{return r}}let Tie={};function B0(r,a){Tie[a]||(Tie[a]=!0,r())}function l_(r){let a=window.atob(r),o=new Uint8Array(new ArrayBuffer(a.length));for(let c=0;c<a.length;c+=1)o[c]=a.charCodeAt(c);return o}function V0(r){let a="";for(let o=0;o<r.length;o+=1)a+=String.fromCharCode(r[o]);return window.btoa(a)}function Rie(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,o=new TextEncoder().encode(r);if(o.length>a)o=o.slice(0,a);else if(o.length<a){let c=new Uint8Array(a);c.set(o),o=c}return o}function xie(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=bc(a).call(a,(v,w)=>v+w.length,0),f=new Uint8Array(new ArrayBuffer(c)),g=0;return a.forEach(v=>{f.set(v,g),g+=v.length}),f}function zf(r){return window.TextEncoder?new TextEncoder().encode(r).length:r.length}function Aie(r){let a=0;return(/DingTalk/i.test(navigator.userAgent)||/AliApp/i.test(navigator.userAgent))&&r.realFormData&&(r=r.realFormData),r.forEach(o=>{a+=typeof o=="string"?zf(o):o.size}),a+138}function Uxe(r){let a=new Ke(ce.TIMEOUT,"timeout");return new Ct((o,c)=>{window.setTimeout(()=>c(a),r)})}function _s(r){return new Ct(a=>{window.setTimeout(a,r)})}function Li(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:7,a=arguments.length>1?arguments[1]:void 0,o=Math.random().toString(16).substr(2,r).toLowerCase();return o.length===r?"".concat(a).concat(o):"".concat(a).concat(o)+Li(r-o.length,"")}function FI(){return Li(32,"").toUpperCase()}let ck=()=>{},Iie=new class{constructor(){Ji(this,"fnMap",new Map)}throttleByKey(r,a,o,c){for(var f=arguments.length,g=new Array(f>4?f-4:0),v=4;v<f;v++)g[v-4]=arguments[v];if(this.fnMap.has(a)){let w=this.fnMap.get(a);if(w.threshold!==o){w.fn(...w.args),clearTimeout(w.timer);let T=window.setTimeout(()=>{let R=this.fnMap.get(a);R&&R.fn(...R.args),this.fnMap.delete(a)},o);this.fnMap.set(a,{fn:r,threshold:o,timer:T,args:g,skipFn:c})}else w.skipFn&&w.skipFn(...w.args),this.fnMap.set(a,Kt(Kt({},w),{},{fn:r,args:g,skipFn:c}))}else{let w=window.setTimeout(()=>{let T=this.fnMap.get(a);T&&T.fn(...T.args),this.fnMap.delete(a)},o);this.fnMap.set(a,{fn:r,threshold:o,timer:w,args:g,skipFn:c})}}},Nie=Iie.throttleByKey.bind(Iie);function Oie(r){return typeof r=="object"&&r!==null&&!(r instanceof RegExp)}function yG(r,a){if(!Oie(r)||!Oie(a)||Array.isArray(r)&&!Array.isArray(a)||!Array.isArray(r)&&Array.isArray(a))return a;if(Array.isArray(a)&&Array.isArray(r)){let o=[...r];for(let c=0;c<a.length;c++)o[c]=yG(r[c],a[c]);return o}{let o=Kt({},r);for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(Object.prototype.hasOwnProperty.call(r,c)?o[c]=yG(r[c],a[c]):o[c]=a[c]);return o}}function Pie(r,a){let o=[0];if(o=new Array(a).fill(0),r===0)return o;let c=0;for(;r>0&&(o[c]=255&r,r>>=8,c++,c!==a););return o}function _G(r){return typeof r=="number"?r:r.exact||r.ideal||r.max||r.min||0}function Lie(r){let a="0123456789abcdef";function o(xe){let Ne,ke="";for(Ne=0;Ne<=3;Ne++)ke+=a.charAt(xe>>8*Ne+4&15)+a.charAt(xe>>8*Ne&15);return ke}function c(xe,Ne){let ke=(65535&xe)+(65535&Ne);return(xe>>16)+(Ne>>16)+(ke>>16)<<16|65535&ke}function f(xe,Ne,ke,He,lt,ut){return c(function(ft,zt){return ft<<zt|ft>>>32-zt}(c(c(Ne,xe),c(He,ut)),lt),ke)}function g(xe,Ne,ke,He,lt,ut,ft){return f(Ne&ke|~Ne&He,xe,Ne,lt,ut,ft)}function v(xe,Ne,ke,He,lt,ut,ft){return f(Ne&He|ke&~He,xe,Ne,lt,ut,ft)}function w(xe,Ne,ke,He,lt,ut,ft){return f(Ne^ke^He,xe,Ne,lt,ut,ft)}function T(xe,Ne,ke,He,lt,ut,ft){return f(ke^(Ne|~He),xe,Ne,lt,ut,ft)}let R=function(xe){let Ne,ke=1+(xe.length+8>>6),He=new Array(16*ke);for(Ne=0;Ne<16*ke;Ne++)He[Ne]=0;for(Ne=0;Ne<xe.length;Ne++)He[Ne>>2]|=xe.charCodeAt(Ne)<<Ne%4*8;return He[Ne>>2]|=128<<Ne%4*8,He[16*ke-2]=8*xe.length,He}(r),A,L,U,F,Z,W=1732584193,K=-271733879,oe=-1732584194,ue=271733878;for(A=0;A<R.length;A+=16)L=W,U=K,F=oe,Z=ue,W=g(W,K,oe,ue,R[A+0],7,-680876936),ue=g(ue,W,K,oe,R[A+1],12,-389564586),oe=g(oe,ue,W,K,R[A+2],17,606105819),K=g(K,oe,ue,W,R[A+3],22,-1044525330),W=g(W,K,oe,ue,R[A+4],7,-176418897),ue=g(ue,W,K,oe,R[A+5],12,1200080426),oe=g(oe,ue,W,K,R[A+6],17,-1473231341),K=g(K,oe,ue,W,R[A+7],22,-45705983),W=g(W,K,oe,ue,R[A+8],7,1770035416),ue=g(ue,W,K,oe,R[A+9],12,-1958414417),oe=g(oe,ue,W,K,R[A+10],17,-42063),K=g(K,oe,ue,W,R[A+11],22,-1990404162),W=g(W,K,oe,ue,R[A+12],7,1804603682),ue=g(ue,W,K,oe,R[A+13],12,-40341101),oe=g(oe,ue,W,K,R[A+14],17,-1502002290),K=g(K,oe,ue,W,R[A+15],22,1236535329),W=v(W,K,oe,ue,R[A+1],5,-165796510),ue=v(ue,W,K,oe,R[A+6],9,-1069501632),oe=v(oe,ue,W,K,R[A+11],14,643717713),K=v(K,oe,ue,W,R[A+0],20,-373897302),W=v(W,K,oe,ue,R[A+5],5,-701558691),ue=v(ue,W,K,oe,R[A+10],9,38016083),oe=v(oe,ue,W,K,R[A+15],14,-660478335),K=v(K,oe,ue,W,R[A+4],20,-405537848),W=v(W,K,oe,ue,R[A+9],5,568446438),ue=v(ue,W,K,oe,R[A+14],9,-1019803690),oe=v(oe,ue,W,K,R[A+3],14,-187363961),K=v(K,oe,ue,W,R[A+8],20,1163531501),W=v(W,K,oe,ue,R[A+13],5,-1444681467),ue=v(ue,W,K,oe,R[A+2],9,-51403784),oe=v(oe,ue,W,K,R[A+7],14,1735328473),K=v(K,oe,ue,W,R[A+12],20,-1926607734),W=w(W,K,oe,ue,R[A+5],4,-378558),ue=w(ue,W,K,oe,R[A+8],11,-2022574463),oe=w(oe,ue,W,K,R[A+11],16,1839030562),K=w(K,oe,ue,W,R[A+14],23,-35309556),W=w(W,K,oe,ue,R[A+1],4,-1530992060),ue=w(ue,W,K,oe,R[A+4],11,1272893353),oe=w(oe,ue,W,K,R[A+7],16,-155497632),K=w(K,oe,ue,W,R[A+10],23,-1094730640),W=w(W,K,oe,ue,R[A+13],4,681279174),ue=w(ue,W,K,oe,R[A+0],11,-358537222),oe=w(oe,ue,W,K,R[A+3],16,-722521979),K=w(K,oe,ue,W,R[A+6],23,76029189),W=w(W,K,oe,ue,R[A+9],4,-640364487),ue=w(ue,W,K,oe,R[A+12],11,-421815835),oe=w(oe,ue,W,K,R[A+15],16,530742520),K=w(K,oe,ue,W,R[A+2],23,-995338651),W=T(W,K,oe,ue,R[A+0],6,-198630844),ue=T(ue,W,K,oe,R[A+7],10,1126891415),oe=T(oe,ue,W,K,R[A+14],15,-1416354905),K=T(K,oe,ue,W,R[A+5],21,-57434055),W=T(W,K,oe,ue,R[A+12],6,1700485571),ue=T(ue,W,K,oe,R[A+3],10,-1894986606),oe=T(oe,ue,W,K,R[A+10],15,-1051523),K=T(K,oe,ue,W,R[A+1],21,-2054922799),W=T(W,K,oe,ue,R[A+8],6,1873313359),ue=T(ue,W,K,oe,R[A+15],10,-30611744),oe=T(oe,ue,W,K,R[A+6],15,-1560198380),K=T(K,oe,ue,W,R[A+13],21,1309151649),W=T(W,K,oe,ue,R[A+4],6,-145523070),ue=T(ue,W,K,oe,R[A+11],10,-1120210379),oe=T(oe,ue,W,K,R[A+2],15,718787259),K=T(K,oe,ue,W,R[A+9],21,-343485551),W=c(W,L),K=c(K,U),oe=c(oe,F),ue=c(ue,Z);return o(W)+o(K)+o(oe)+o(ue)}let Fxe=1,dk=console,As=class{static setLogger(r){dk=r}constructor(r){Ji(this,"lockingPromise",Ct.resolve()),Ji(this,"locks",0),Ji(this,"name",""),Ji(this,"lockId",void 0),this.lockId=Fxe++,r&&(this.name=r),dk.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is created."))}get isLocked(){return this.locks>0}lock(r){let a;this.locks+=1,dk.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is locked, current queue ").concat(this.locks,". ").concat(typeof r=="string"?r:""));let o=new Ct(f=>{a=()=>{this.locks-=1,dk.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is not locked, current queue ").concat(this.locks,". ").concat(typeof r=="string"?r:"")),f()}}),c=this.lockingPromise.then(()=>a);return this.lockingPromise=this.lockingPromise.then(()=>o),c}};function ab(r,a){return function(o,c,f){let g=f.value;if(typeof g!="function")throw new Error("Cannot use mutex on object property.");return f.value=async function(){let v=this[a];if(!v)throw new Error("mutex property key ".concat(a," doesn't exist on ").concat(r));let w=await v.lock("From ".concat(r,".").concat(c));try{for(var T=arguments.length,R=new Array(T),A=0;A<T;A++)R[A]=arguments[A];return await g.apply(this,R)}finally{w()}},f}}let Mr={timeout:500,timeoutFactor:1.5,maxRetryCount:1/0,maxRetryTimeout:1e4};function uk(r,a){let o=Math.floor(a.timeout*Math.pow(a.timeoutFactor,r));return Math.min(a.maxRetryTimeout,o)}function Nh(r,a,o,c){let f=Object.assign({},Mr,c),g=f.timeout,v=async()=>{await function(R){return new Ct(A=>{window.setTimeout(A,R)})}(g),g*=f.timeoutFactor,g=Math.min(f.maxRetryTimeout,g)},w=!1,T=new Ct(async(R,A)=>{a=a||(()=>!1),o=o||(()=>!0);for(let L=0;L<f.maxRetryCount;L+=1){if(w)return A(new Ke(ce.OPERATION_ABORTED));try{let U=await r();if(!a(U,L)||L+1===f.maxRetryCount)return R(U);await v()}catch(U){if(!o(U,L)||L+1===f.maxRetryCount)return A(U);await v()}}});return T.cancel=()=>w=!0,T}class EG{constructor(a){Ji(this,"input",[]),Ji(this,"size",void 0),this.size=a}add(a){this.input.push(a),this.input.length>this.size&&this.input.splice(0,1)}mean(){var a;return this.input.length===0?0:bc(a=this.input).call(a,(o,c)=>o+c)/this.input.length}}let hk,fk=0,wG=0;function SG(r,a,o,c){return new Ct((f,g)=>{a.responseType=a.responseType||"json",a.data&&!o?(a.data=JSON.stringify(a.data),fk+=zf(a.data)):o&&(a.data.size?fk+=a.data.size:a.data instanceof FormData?fk+=Aie(a.data):fk+=zf(JSON.stringify(a.data))),a.headers=a.headers||{},a.headers["Content-Type"]=a.headers["Content-Type"]||"application/json",a.method="POST",a.url=r,Lo.request(a).then(v=>{typeof v.data=="string"?wG+=zf(v.data):v.data instanceof ArrayBuffer||v.data instanceof Uint8Array?wG+=v.data.byteLength:wG+=zf(JSON.stringify(v.data)),f(v.data)}).catch(v=>{Lo.isCancel(v)?g(new Ke(ce.OPERATION_ABORTED,"cancel token canceled")):v.code==="ECONNABORTED"?g(new Ke(ce.NETWORK_TIMEOUT,v.message)):v.response?g(new Ke(ce.NETWORK_RESPONSE_ERROR,v.response.status)):g(new Ke(ce.NETWORK_ERROR,v.message))})})}async function Bxe(r,a){let o=new Blob([a.data],{type:"buffer"});return await SG(r,Kt(Kt({},a),{},{data:o,headers:{"Content-Type":"application/octet-stream"}}),!0)}let Die=()=>window.isSecureContext!==void 0,pd=function(r){if(r.match(/[0-9]+\.[0-9]+\.[0-9]+$/))return r;let a=r.match(/([0-9]+\.[0-9]+\.[0-9]+)\-alpha\.([0-9]+)/);if(a&&a[1]&&a[2]){let c=a[1],f=a[2];return"".concat(c,".").concat(f)}let o=r.match(/([0-9]+\.[0-9]+\.[0-9]+)\-special\.([0-9]+)/);if(o&&o[1]&&o[2]){let c=o[1],f=o[2];return"".concat(c,".").concat(100*(Number(f)+1))}return"4.0.0.999"}("4.21.0"),bG=function(){try{return JSON.parse("true")===!0}catch{return!0}}(),c_=function(r){return r.Default="default",r.Auto="auto",r.Relay="relay",r.SdRtn="sd-rtn",r}({}),CG={MIN_FRAME_RATE:1,MAX_FRAME_RATE:30,MAX_THRESHOLD_FRAMERATE:30,BITRATE_MIN_THRESHOLD:100,BITRATE_MAX_THRESHOLD:100,MAX_SCALE:5,BWE_SCALE_UP_THRESHOLD:.6,BWE_SCALE_DOWN_THRESHOLD:.6,PERF_SCALE_UP_THRESHOLD:.7,PERF_SCALE_DOWN_THRESHOLD:.6,MOTION_RESOLUTION_FACTOR:.8,MOTION_BITRATE_FACTOR:.6,DETAIL_FRAMERATE_FACTOR:.8,DETAIL_BITRATE_FACTOR:.6,BALANCE_RESOLUTION_FACTOR:.9,BALANCE_FRAMERATE_FACTOR:.9,BALANCE_BITRATE_FACTOR:.6,OVERUSE_TIMES_THRESHOLD:10,UNDERUSE_TIMES_THRESHOLD:40},TG="v4.21.0-0-g16fdae2c-dirty(6/3/2024, 2:55:18 PM)",is={PROCESS_ID:"",ENCRYPT_AES:!0,AREAS:["CHINA","GLOBAL"],WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io","webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io","webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-web-2.ap.sd-rtn.com","cds-ap-web-3.agora.io","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-web-2.ap.sd-rtn.com","sua-ap-web-3.agora.io","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-ap-web-1.agora.io","uap-web-2.ap.sd-rtn.com","uap-ap-web-3.agora.io","uap-web-4.ap.sd-rtn.com"],LOG_UPLOAD_SERVER:"logservice.agora.io",EVENT_REPORT_DOMAIN:"statscollector-1.agora.io",EVENT_REPORT_BACKUP_DOMAIN:"web-2.statscollector.sd-rtn.com",ENABLE_EVENT_REPORT:!0,GATEWAY_ADDRESS:[],GATEWAY_WSS_ADDRESS:"",LIVE_STREAMING_ADDRESS:"",HTTP_CONNECT_TIMEOUT:5e3,SIGNAL_REQUEST_TIMEOUT:1e4,REPORT_STATS:!0,UPLOAD_LOG:!1,NOT_REPORT_EVENT:[],SUBSCRIBE_TWCC:!0,PUBLISH_TWCC:!1,PING_PONG_TIME_OUT:10,WEBSOCKET_TIMEOUT_MIN:1e4,EVENT_REPORT_SEND_INTERVAL:3e3,CONFIG_DISTRIBUTE_INTERVAL:3e5,ENABLE_CONFIG_DISTRIBUTE:!0,CANDIDATE_TIMEOUT:5e3,SHOW_REPORT_INVOKER_LOG:!1,JOIN_EXTEND:"",PUB_EXTEND:"",SUB_EXTEND:"",FORCE_TURN:!1,TURN_ENABLE_TCP:!0,TURN_ENABLE_UDP:!0,MAX_UPLOAD_CACHE:50,UPLOAD_CACHE_INTERVAL:2e3,AJAX_REQUEST_CONCURRENT:3,REPORT_APP_SCENARIO:void 0,GATEWAY_DOMAINS:["edge.agora.io","edge.sd-rtn.com"],CONNECT_GATEWAY_WITHOUT_DOMAIN:!1,WORKER_DOMAIN:"edge.agora.io",TURN_DOMAIN:"edge.agora.io",EVENT_REPORT_RETRY:!0,CHROME_FORCE_PLAN_B:!1,AUDIO_SOURCE_VOLUME_UPDATE_INTERVAL:400,AUDIO_SOURCE_AVG_VOLUME_DURATION:3e3,AUDIO_VOLUME_INDICATION_INTERVAL:2e3,VOLUME_VOICE_WEIGHT:10,GET_VOLUME_OF_MUTED_AUDIO_TRACK:!1,STATS_UPDATE_INTERVAL:250,NORMAL_EVENT_QUEUE_CAPACITY:100,CUSTOM_REPORT:!0,CUSTOM_REPORT_LIMIT:20,PROXY_SERVER_TYPE2:"webnginx-proxy.agora.io",PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com","webrtc-cloud-proxy.agora.io"],CUSTOM_PUB_ANSWER_MODIFIER:null,CUSTOM_SUB_ANSWER_MODIFIER:null,CUSTOM_PUB_OFFER_MODIFIER:null,CUSTOM_SUB_OFFER_MODIFIER:null,DSCP_TYPE:"high",REMOVE_NEW_CODECS:!0,FRAGEMENT_LENGTH:3,WEBSOCKET_COMPRESS:!1,SIMULCAST:!1,PRELOAD_MEDIA_COUNT:0,USE_PUB_RTX:!0,USE_SUB_RTX:!0,USE_XR:!0,ENABLE_LOSSBASED_BWE:!0,ENABLE_AUT_CC:void 0,ENABLE_CC_FALLBACK:void 0,CHECK_VIDEO_VISIBLE_INTERVAL:3e4,CHECK_LOCAL_STATS_INTERVAL:250,PROFILE_SWITCH_INTERVAL:2e3,UNSUPPORTED_VIDEO_CODEC:[],ENUMERATE_DEVICES_INTERVAL:!1,ENUMERATE_DEVICES_INTERVAL_TIME:1e4,USE_NEW_TOKEN:!1,CLOSE_AFB_FOR_LOCAL_AP:!0,JOIN_MAX_CONCURRENCY:6,JOIN_WITH_FALLBACK_SIGNAL_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE:!1,JOIN_GATEWAY_TRY_443PORT_DURATION:2e3,JOIN_GATEWAY_USE_443PORT_ONLY:!1,JOIN_GATEWAY_USE_DUAL_DOMAIN:!0,JOIN_GATEWAY_FALLBACK_PORT:443,USE_TURN_SERVER_OF_GATEWAY:!1,H264_PROFILE_LEVEL_ID:"",USE_NEW_LOG:!1,LOG_VERSION:3,MEDIA_DEVICE_CONSTRAINTS:null,ENCRYPT_PROXY_USERNAME_AND_PSW:!0,SDP_LOGGING:!1,CSP_DETECTED_HOSTNAME_LIST:["agora.io","sd-rtn.com"],REMOTE_AUDIO_TRACK_USES_WEB_AUDIO:!1,LOCAL_AUDIO_TRACK_USES_WEB_AUDIO:!1,BITRATE_ADAPTER_TYPE:"STANDARD_BITRATE",AI_DENOISER_PARAMETERS:{excludedLinks:[]},ADJUST_3A_FROM_PLUGINS:!0,RAISE_H264_BASELINE_PRIORITY:!0,FILTER_SEND_H264_BASELINE:!1,ENABLE_PUBLISHED_USER_LIST:!0,MAX_SUBSCRIPTION:50,X_GOOGLE_START_BITRATE:void 0,NEW_REPORT_SERVER:!1,NEW_REPORT_SERVER_DOMAINS:["data-reporting.agora.io","data-reporting.agora.io"],VIDEO_INSPECT_WORKER_MESSAGE_LENGTH_LIMIT:3e5,VIDEO_INSPECT_INTERVAL_MINIMUM:1e3,VIDEO_INSPECT_QUALITY_RATIO:.9,VIDEO_INSPECT_WORKER_MANAGER_HOST:"edge.agora.io",VIDEO_INSPECT_WORKER_MANAGER_PORT:"",VIDEO_INSPECT_WORKER_PORT:"",SHOW_VIDEO_INSPECT_WORKER_MESSAGE:!1,STATS_COLLECTOR_PORT:443,FORCE_TURN_TCP:!1,SUBSCRIBE_AUDIO_FILTER_TOPN:void 0,ENABLE_PUBLISH_AUDIO_FILTER:void 0,DISABLE_FEC:void 0,WEBAUDIO_INIT_OPTIONS:void 0,FILTER_VIDEO_FEC:!0,FILTER_AUDIO_FEC:!1,CHROME_DUAL_STREAM_USE_ENCODING:!0,DISABLE_DUAL_STREAM_USE_ENCODING:!1,EXTENSION_USAGE_UPLOAD_INTERVAL:1e4,ICE_RESTART:!0,ICE_RESTART_INTERVAL:1e4,NEW_ICE_RESTART:!1,ENABLE_USER_LICENSE_CHECK:!0,SIGNAL_CHANNEL:0,TRANSMITTER_INITIAL_RTT:30,TRANSMITTER_INITIAL_RTO:30,TRANSMITTER_MAX_BATCH_ACK_COUNT:2,TRANSMITTER_MAX_RTO:500,DATACHANNEL_COMPRESS:!1,FINGERPRINT:null,DC_JOIN_WITH_FAILBACK:5e3,ENABLE_VIDEO_FRAME_CALLBACK:!0,VIDEO_FREEZE_DURATION:500,SPATIALIZER_PARAMETERS:{},UPLOAD_LOG_INTERVAL:3e3,UPLOAD_LOG_REQUEST_RETRY_INTERVAL:2e3,UPLOAD_LOG_REQUEST_MAX_RETRY_INTERVAL:2e4,UPLOAD_LOG_TRY_INTERVAL_WHILE_OFF:5e3,UPLOAD_LOG_RETRY_INTERVAL_V1:1e4,UPLOAD_LOG_TWICE_RETRY_INTERVAL_V1:200,UPLOAD_LOG_LENGTH_EACH_TIME:10,APP_TYPE:0,DISABLE_WEBAUDIO:!1,CHANNEL_MEDIA_RELAY_SERVERS:void 0,KEEP_LAST_FRAME:!0,FORWARD_P2P_CREATION:!0,SYNC_GROUP:!0,BLOCK_LOCAL_CLIENT:!1,AP_AREA:!0,SVC:[],ENABLE_ENCODED_TRANSFORM:!1,ENABLE_VIDEO_SEI:!1,IMAGE_MODERATION_WORKER_HOST:"edge.agora.io",IMAGE_MODERATION_WORKER_MESSAGE_LENGTH_LIMIT:3e5,IMAGE_MODERATION_INTERVAL_MINIMUM:1e3,SHOW_IMAGE_MODERATION_WORKER_MESSAGE:!1,IMAGE_MODERATION_QUALITY_RATIO:.9,IMAGE_MODERATION_UPLOAD_REPORT_INTERVAL:5e3,SHOW_GLOBAL_CLIENT_LIST:!1,ENABLE_DATASTREAM_2:!1,DATASTREAM_MAX_RETRANSMITS:10,ENABLE_USER_AUTO_REBALANCE_CHECK:!0,ENABLE_INSTANT_VIDEO:!1,ENABLE_NTP_REPORT:!1,TCP_CANDIDATE_ONLY:!1,EXTERNAL_SIGNAL_REQUEST_TIMEOUT:3e3,SHOW_P2P_LOG:!1,MAX_P2P_TIMEOUT:3e4,P2P_TOKEN_INTERVAL:1e3,SHOW_DATASTREAM2_LOG:!1,RESTRICTION_SET_PLAYBACK_DEVICE:!0,USE_PURE_ENCRYPTION_MASTER_KEY:!1,ACCOUNT_REGISTER_RETRY_TIMEOUT:1,ACCOUNT_REGISTER_RETRY_RATIO:2,ACCOUNT_REGISTER_RETRY_TIMEOUT_MAX:6e4,ACCOUNT_REGISTER_RETRY_COUNT_MAX:1e5,AUDIO_CONTEXT:null,WEBCS_BACKUP_CONNECT_TIMEOUT:6e3,PLAYER_STATE_DEFER:2e3,SIGNAL_REQUEST_WATCH_INTERVAL:1e3,FILEPATH_LENMAX:255,DUALSTREAM_OPERATION_CHECK:!0,MEDIA_ELEMENT_EXISTS_DEPTH:3,SHIM_CANDIDATE:!1,LEAVE_MSG_TIMEOUT:2e3,STATS_FILTER:{transportId:!0,googTrackId:!0},FILTER_VIDEO_CODEC:[],USE_NEW_NETWORK_CONFIG:!1,AUTO_RESET_AUDIO_ROUTE:!1,PLUGIN_INFO:[],OVERUSE_DETECTOR_PARAMS:CG,ENABLE_AG_ADAPTATION:!0,FORCE_AG_HIGH_FRAMERATE:!1,FORCE_SUPPORT_AG_ADAPTATION:!1,CUSTOM_ADAPTATION_DEFAULT_MODE:"",ENCODER_CONFIG_LIMIT:{},CAMERA_CAPTURE_CONFIG:void 0,HIDE_NO_POSTER:!1,AP_CACHE_NUM:10,AP_UPDATE_INTERVAL:12e4,AP_CACHE_LIFETIME:12e4,MAX_PRELOAD_ASYNC_LENGTH:3,ENABLE_PRELOAD:!0};function Ri(r,a,o){var c,f,g;Tt(c=Object.keys(is)).call(c,r)&&(!o&&Tt(f=Object.keys(z0)).call(f,r)||(is[r]=a,r==="ENABLE_VIDEO_SEI"&&a===!0&&(is.ENABLE_ENCODED_TRANSFORM=!0),r==="USE_NEW_NETWORK_CONFIG"&&a&&(g=!!a,is.USE_NEW_NETWORK_CONFIG=g,g&&(is.WEBCS_DOMAIN=["webrtc2-2.ap.sd-rtn.com"],is.WEBCS_DOMAIN_BACKUP_LIST=["webrtc2-4.ap.sd-rtn.com"],is.CDS_AP=["cds-web-2.ap.sd-rtn.com","cds-web-4.ap.sd-rtn.com"],is.ACCOUNT_REGISTER=["sua-web-2.ap.sd-rtn.com","sua-web-4.ap.sd-rtn.com"],is.EVENT_REPORT_DOMAIN="web-2.statscollector.sd-rtn.com",is.EVENT_REPORT_BACKUP_DOMAIN="statscollector-1.agora.io",is.GATEWAY_DOMAINS=["edge.sd-rtn.com"]))))}function ve(r){return is[r]}let z0={};var Vn=function(r){return r.SET_SESSION_ID="SET_SESSION_ID",r.SET_P2P_ID="SET_P2P_id",r.SET_DC_ID="SET_DC_id",r.SET_UID="SET_UID",r.SET_INT_UID="SET_INT_UID",r.SET_PUB_ID="SET_PUB_ID",r.SET_CLOUD_PROXY_SERVER_MODE="SET_CLOUD_PROXY_SERVER_MODE",r.KEY_METRIC_CLIENT_CREATED="KEY_METRIC_CLIENT_CREATED",r.KEY_METRIC_JOIN_START="KEY_METRIC_JOIN_START",r.AVOID_JOIN_START="AVOID_JOIN_START",r.KEY_METRIC_JOIN_END="KEY_METRIC_JOIN_END",r.KEY_METRIC_REQUEST_AP_START="KEY_METRIC_REQUEST_AP_START",r.KEY_METRIC_REQUEST_AP_END="KEY_METRIC_REQUEST_AP_END",r.KEY_METRIC_JOIN_GATEWAY_START="KEY_METRIC_JOIN_GATEWAY_START",r.KEY_METRIC_JOIN_GATEWAY_END="KEY_METRIC_JOIN_GATEWAY_END",r.KEY_METRIC_PEER_CONNECTION_START="KEY_METRIC_PEER_CONNECTION_START",r.KEY_METRIC_PEER_CONNECTION_END="KEY_METRIC_PEER_CONNECTION_END",r.KEY_METRIC_DESCRIPTION_START="KEY_METRIC_DESCRIPTION_START",r.KEY_METRIC_ICE_CONNECTION_END="KEY_METRIC_ICE_CONNECTION_END",r.KEY_METRIC_SIGNAL_CHANNEL_OPEN="KEY_METRIC_SIGNAL_CHANNEL_OPEN",r.KEY_METRIC_PUBLISH="KEY_METRIC_PUBLISH",r.KEY_METRIC_SUBSCRIBE="KEY_METRIC_SUBSCRIBE",r.RECORD_JOIN_CHANNEL_SERVICE="RECORD_JOIN_CHANNEL_SERVICE",r.RESET_JOIN_CHANNEL_SERVICE_RECORDS="RESET_JOIN_CHANNEL_SERVICE_RECORDS",r.RESET_KEY_METRICS="RESET_KEY_METRICS",r.SET_USE_DATACHANNEL="SET_USE_DATACHANNEL",r.SET_USE_P2P="SET_USE_P2P",r.SET_TRANSPORT_TYPE="SET_TRANSPORT_TYPE",r}(Vn||{});class Vxe{constructor(a,o,c,f){Ji(this,"state",void 0),this.state={codec:a,audioCodec:o,mode:c,clientId:f,sessionId:null,p2pId:0,dcId:0,pubId:0,subId:0,avoidJoinStart:0,keyMetrics:{publish:[],subscribe:[]},joinChannelServiceRecords:[],cloudProxyServerMode:"disabled",useDataChannel:!1,useP2P:!1,p2pTransport:c_.Default}}dispatch(a){this.state=function(o,c){switch(c.type){case Vn.SET_SESSION_ID:return Kt(Kt({},o),{},{sessionId:c.sessionId});case Vn.SET_P2P_ID:return Kt(Kt({},o),{},{p2pId:c.p2pId});case Vn.SET_UID:return Kt(Kt({},o),{},{uid:c.uid});case Vn.SET_INT_UID:return Kt(Kt({},o),{},{intUid:c.intUid});case Vn.SET_PUB_ID:return Kt(Kt({},o),{},{pubId:c.pubId});case Vn.KEY_METRIC_CLIENT_CREATED:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{clientCreated:c.metric})});case Vn.KEY_METRIC_JOIN_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinStart:c.metric})});case Vn.AVOID_JOIN_START:return Kt(Kt({},o),{},{avoidJoinStart:c.avoidJoinStart});case Vn.KEY_METRIC_JOIN_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinEnd:c.metric})});case Vn.KEY_METRIC_REQUEST_AP_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{requestAPStart:c.metric})});case Vn.KEY_METRIC_REQUEST_AP_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{requestAPEnd:c.metric})});case Vn.KEY_METRIC_JOIN_GATEWAY_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinGatewayStart:c.metric})});case Vn.KEY_METRIC_JOIN_GATEWAY_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinGatewayEnd:c.metric})});case Vn.KEY_METRIC_PEER_CONNECTION_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{peerConnectionStart:c.metric})});case Vn.KEY_METRIC_PEER_CONNECTION_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{peerConnectionEnd:c.metric})});case Vn.KEY_METRIC_DESCRIPTION_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{descriptionStart:c.metric})});case Vn.KEY_METRIC_SIGNAL_CHANNEL_OPEN:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{signalChannelOpen:c.metric})});case Vn.KEY_METRIC_ICE_CONNECTION_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{iceConnectionEnd:c.metric})});case Vn.KEY_METRIC_PUBLISH:{let f=o.keyMetrics.publish,g=f.findIndex(v=>v.trackId===c.metric.trackId);return g!==-1?(f[g]=Kt(Kt({},f[g]),c.metric),Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{publish:[...f]})})):Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{publish:[...o.keyMetrics.publish,c.metric]})})}case Vn.KEY_METRIC_SUBSCRIBE:{let f=o.keyMetrics.subscribe,g=f.findIndex(v=>v.userId===c.metric.userId&&v.type===c.metric.type);return g!==-1?(f[g]=Kt(Kt({},f[g]),c.metric),Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{subscribe:[...f]})})):Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{subscribe:[...o.keyMetrics.subscribe,c.metric]})})}case Vn.SET_CLOUD_PROXY_SERVER_MODE:return o.cloudProxyServerMode=c.mode,o;case Vn.RECORD_JOIN_CHANNEL_SERVICE:return typeof c.index!="number"?o.joinChannelServiceRecords=[...o.joinChannelServiceRecords,c.record]:(o.joinChannelServiceRecords[c.index]=Kt(Kt({},o.joinChannelServiceRecords[c.index]),c.record),o.joinChannelServiceRecords=[...o.joinChannelServiceRecords]),o;case Vn.RESET_JOIN_CHANNEL_SERVICE_RECORDS:return o.joinChannelServiceRecords=[],o;case Vn.RESET_KEY_METRICS:return o.keyMetrics={publish:[],subscribe:[]},o;case Vn.SET_USE_DATACHANNEL:return Kt(Kt({},o),{},{useDataChannel:c.val});case Vn.SET_USE_P2P:return Kt(Kt({},o),{},{useP2P:c.val});case Vn.SET_TRANSPORT_TYPE:return Kt(Kt({},o),{},{p2pTransport:c.val});default:return o}}(this.state,a)}set sessionId(a){this.dispatch({type:Vn.SET_SESSION_ID,sessionId:a})}get sessionId(){return this.state.sessionId}set codec(a){this.state.codec=a}get codec(){return this.state.codec}get mode(){return this.state.mode}get audioCodec(){return this.state.audioCodec}get clientId(){return this.state.clientId}set p2pId(a){this.dispatch({type:Vn.SET_P2P_ID,p2pId:a})}get p2pId(){return this.state.p2pId}set dcId(a){this.dispatch({type:Vn.SET_DC_ID,dcId:a})}get dcId(){return this.state.dcId}set uid(a){this.dispatch({type:Vn.SET_UID,uid:a})}get uid(){return this.state.uid}set intUid(a){this.dispatch({type:Vn.SET_INT_UID,intUid:a})}get intUid(){return this.state.intUid}set pubId(a){this.dispatch({type:Vn.SET_PUB_ID,pubId:a})}get pubId(){return this.state.pubId}set cloudProxyServerMode(a){this.dispatch({type:Vn.SET_CLOUD_PROXY_SERVER_MODE,mode:a})}get cloudProxyServerMode(){return this.state.cloudProxyServerMode}set useDataChannel(a){this.dispatch({type:Vn.SET_USE_DATACHANNEL,val:a})}get useDataChannel(){return this.state.useDataChannel}set useP2P(a){this.dispatch({type:Vn.SET_USE_P2P,val:a})}get useP2P(){return this.state.useP2P}set p2pTransport(a){this.dispatch({type:Vn.SET_TRANSPORT_TYPE,val:a})}get p2pTransport(){return this.state.p2pTransport}clientCreated(){this.dispatch({type:Vn.KEY_METRIC_CLIENT_CREATED,metric:Date.now()})}joinStart(){this.dispatch({type:Vn.KEY_METRIC_JOIN_START,metric:Date.now()})}joinEnd(){this.dispatch({type:Vn.KEY_METRIC_JOIN_END,metric:Date.now()})}requestAPStart(){this.dispatch({type:Vn.KEY_METRIC_REQUEST_AP_START,metric:Date.now()})}requestAPEnd(){this.dispatch({type:Vn.KEY_METRIC_REQUEST_AP_END,metric:Date.now()})}joinGatewayStart(){this.dispatch({type:Vn.KEY_METRIC_JOIN_GATEWAY_START,metric:Date.now()})}joinGatewayEnd(){this.dispatch({type:Vn.KEY_METRIC_JOIN_GATEWAY_END,metric:Date.now()})}peerConnectionStart(){this.dispatch({type:Vn.KEY_METRIC_PEER_CONNECTION_START,metric:Date.now()})}peerConnectionEnd(){this.dispatch({type:Vn.KEY_METRIC_PEER_CONNECTION_END,metric:Date.now()})}descriptionStart(){this.dispatch({type:Vn.KEY_METRIC_DESCRIPTION_START,metric:Date.now()})}signalChannelOpen(){this.dispatch({type:Vn.KEY_METRIC_SIGNAL_CHANNEL_OPEN,metric:Date.now()})}iceConnectionEnd(){this.dispatch({type:Vn.KEY_METRIC_ICE_CONNECTION_END,metric:Date.now()})}publish(a,o,c,f){this.dispatch({type:Vn.KEY_METRIC_PUBLISH,metric:Kt(Kt({trackId:a,type:o},c&&{publishStart:c}),f&&{publishEnd:f})})}subscribe(a,o,c,f,g,v,w){this.dispatch({type:Vn.KEY_METRIC_SUBSCRIBE,metric:Kt(Kt(Kt(Kt(Kt({userId:a,type:o},c&&{subscribeStart:c}),f&&{subscribeEnd:f}),g&&{firstFrame:g}),v&&{streamAdded:v}),w&&{firstDecoded:w})})}massSubscribe(a,o,c,f){a.forEach(g=>{this.dispatch({type:Vn.KEY_METRIC_SUBSCRIBE,metric:Kt(Kt(Kt({userId:g.userId,type:g.type},o&&{subscribeStart:o}),c&&{subscribeEnd:c}),f&&{firstFrame:f})})})}get keyMetrics(){return this.state.keyMetrics}recordJoinChannelService(a,o){a.service==="gateway"&&Array.isArray(a.urls)&&(a.urls=a.urls.map(c=>c.replace(/(\d+)-\d+-\d+-(\d+)/,"$1-*-*-$2")));try{return typeof o!="number"?(this.dispatch({type:Vn.RECORD_JOIN_CHANNEL_SERVICE,record:Kt(Kt({},a),{},{sessionId:this.sessionId,cloudProxyMode:this.cloudProxyServerMode,uid:this.uid})}),this.state.joinChannelServiceRecords.length-1):(o<0||o>=this.state.joinChannelServiceRecords.length||this.dispatch({type:Vn.RECORD_JOIN_CHANNEL_SERVICE,record:a,index:o}),o)}catch{return 0}}resetJoinChannelServiceRecords(){this.dispatch({type:Vn.RESET_JOIN_CHANNEL_SERVICE_RECORDS})}resetKeyMetrics(){this.dispatch({type:Vn.RESET_KEY_METRICS})}get joinChannelServiceRecords(){try{return this.state.joinChannelServiceRecords}catch{return[]}}get avoidJoinStart(){return this.state.avoidJoinStart}set avoidJoinStart(a){this.dispatch({type:Vn.AVOID_JOIN_START,avoidJoinStart:a})}}let ob=function(r){return r.h264="h264",r.h265="h265",r.vp8="vp8",r.vp9="vp9",r.av1="av1",r}({});(function(r){r.opus="opus",r.pcma="pcma",r.pcmu="pcmu",r.g722="g722"})({});let kie=128,zxe=96,Mie=1e3,lb=10,Hxe=0;function jie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Ln(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?jie(Object(o),!0).forEach(function(c){Ar(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):jie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function Ar(r,a,o){return(a=function(c){var f=function(g,v){if(typeof g!="object"||g===null)return g;var w=g[Symbol.toPrimitive];if(w!==void 0){var T=w.call(g,"string");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}(c);return typeof f=="symbol"?f:String(f)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}let Uie=new class extends tr{constructor(){super(...arguments),Ar(this,"currentUploadLogID",0)}reportLogUploadError(r){let{errorRange:a}=r;a[a.length-1]&&a[a.length-1]>this.currentUploadLogID&&(this.currentUploadLogID=a[a.length-1],this.emit("REPORT_LOG_UPLOAD",r))}};class Gxe{constructor(a){Ar(this,"logger",void 0),Ar(this,"prefixLists",[]),this.logger=a}debug(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.debug(...this.prefixLists,...o)}info(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.info(...this.prefixLists,...o)}warning(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.warning(...this.prefixLists,...o)}error(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.error(...this.prefixLists,...o)}prefix(a){return this.prefixLists.push(a),this}popPrefix(){return this.prefixLists.pop(),this}}function RG(){let r=new Date;return r.toTimeString().split(" ")[0]+":"+r.getMilliseconds()}function Fie(){let r=new Date,a=/((\d+:){2}\d+)/.exec(new Date().toUTCString());return a?(a==null?void 0:a[0])+":"+r.getUTCMilliseconds():r.toTimeString().split(" ")[0]+":"+r.getMilliseconds()}let md={DEBUG:0,INFO:1,WARNING:2,ERROR:3,NONE:4},pk=Date.now(),BI=r=>{for(let a in md)if(Object.prototype.hasOwnProperty.call(md,a)&&md[a]===r)return a;return"DEFAULT"},z=new class{constructor(){Ar(this,"proxyServerURL",void 0),Ar(this,"logLevel",md.DEBUG),Ar(this,"uploadState","collecting"),Ar(this,"uploadLogWaitingList",[]),Ar(this,"uploadLogUploadingList",[]),Ar(this,"uploadErrorCount",0),Ar(this,"currentLogID",0),Ar(this,"url",void 0),Ar(this,"extLog",(r,a)=>{this.appendLogToWaitingList(r,...a)})}debug(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[md.DEBUG].concat(a);this.log.apply(this,c)}info(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[md.INFO].concat(a);this.log.apply(this,c)}warning(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[md.WARNING].concat(a);this.log.apply(this,c)}warn(){this.warning(...arguments)}error(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[md.ERROR].concat(a);this.log.apply(this,c)}upload(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[md.DEBUG].concat(a);this.uploadLog.apply(this,c)}setLogLevel(r){r=Math.min(Math.max(0,r),4),this.logLevel=r}enableLogUpload(){Ri("UPLOAD_LOG",!0)}disableLogUpload(){Ri("UPLOAD_LOG",!1),this.uploadLogUploadingList=[],this.uploadLogWaitingList=[]}setProxyServer(r){this.proxyServerURL=r}prefix(r){return new Gxe(this).prefix(r)}log(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];if(Date.now()-pk<100)return void setTimeout(()=>{this.log(...a)},Date.now()-pk);let c=Math.max(0,Math.min(4,a[0]));if(a[0]=RG()+" Agora-SDK [".concat(BI(c),"]:"),this.appendLogToWaitingList(c,...a),c<this.logLevel)return;let f=RG()+" %cAgora-SDK [".concat(BI(c),"]:"),g=[];if(!ve("USE_NEW_LOG"))switch(c){case md.DEBUG:g=[f,"color: #64B5F6;"].concat(a.slice(1)),console.log.apply(console,g);break;case md.INFO:g=[f,"color: #1E88E5; font-weight: bold;"].concat(a.slice(1)),console.log.apply(console,g);break;case md.WARNING:g=[f,"color: #FB8C00; font-weight: bold;"].concat(a.slice(1)),console.warn.apply(console,g);break;case md.ERROR:g=[f,"color: #B00020; font-weight: bold;"].concat(a.slice(1)),console.error.apply(console,g)}}uploadLog(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];if(Date.now()-pk<100)return void setTimeout(()=>{this.uploadLog(...a)},Date.now()-pk);let c=Math.max(0,Math.min(4,a[0]));a[0]=RG()+" Agora-SDK [".concat(BI(c),"]:"),this.appendLogToWaitingList(c,...a)}appendLogToWaitingList(r){if(!ve("UPLOAD_LOG"))return;for(var a=arguments.length,o=new Array(a>1?a-1:0),c=1;c<a;c++)o[c-1]=arguments[c];Array.isArray(o[0])?o[0][0]=Fie()+" Agora-SDK [".concat(BI(r),"]:"):o[0]=Fie()+" Agora-SDK [".concat(BI(r),"]:");let f="";o.forEach(g=>{typeof g=="object"&&(g=JSON.stringify(g)),f+="".concat(g," ")}),this.uploadLogWaitingList.push({payload_str:f,log_level:r,log_item_id:this.currentLogID++}),this.uploadState==="uploading"&&this.uploadLogUploadingList.length===0&&this.uploadLogInterval()}startUpload(){this.uploadState="uploading",this.uploadLogUploadingList.length===0&&this.uploadLogInterval()}async uploadLogs(){let r=this.uploadLogUploadingList,a={sdk_version:pd,process_id:ve("PROCESS_ID"),payload:JSON.stringify(r)};return Nh(async()=>{let o=await Lo.post(this.url||(this.proxyServerURL?"https://".concat(this.proxyServerURL,"/ls/?h=").concat(ve("LOG_UPLOAD_SERVER"),"&p=443&d=upload/v1"):"https://".concat(ve("LOG_UPLOAD_SERVER"),"/upload/v1")),a,{responseType:"text"});if(o.data!=="OK"){let c=new Error("unexpected upload log response");throw c.response=o,c}},()=>(this.uploadLogUploadingList=[],!1),o=>{let c={status:-1,message:o.message,errorRange:r.map(f=>f.log_item_id)};return o.response?(c.status=o.response.status,c.data=o.response.data,c.headers=o.response.headers):o.request&&(c.status=o.request.status),Uie.reportLogUploadError(c),!0},{timeout:ve("UPLOAD_LOG_REQUEST_RETRY_INTERVAL"),maxRetryTimeout:ve("UPLOAD_LOG_REQUEST_MAX_RETRY_INTERVAL")})}uploadLogInterval(){this.uploadLogUploadingList.length===0&&this.uploadLogWaitingList.length===0||(this.uploadLogUploadingList.length===0&&(this.uploadLogUploadingList=this.uploadLogWaitingList.splice(0,ve("UPLOAD_LOG_LENGTH_EACH_TIME"))),this.uploadLogs().then(()=>{this.uploadErrorCount=0,this.uploadLogWaitingList.length>0&&window.setTimeout(()=>this.uploadLogInterval(),ve("UPLOAD_LOG_INTERVAL"))}).catch(r=>{this.uploadErrorCount+=1,this.uploadErrorCount<2?window.setTimeout(()=>this.uploadLogInterval(),ve("UPLOAD_LOG_TWICE_RETRY_INTERVAL_V1")):window.setTimeout(()=>this.uploadLogInterval(),ve("UPLOAD_LOG_RETRY_INTERVAL_V1"))}))}};var Bie;function Wxe(r){return Fs(r.reportId,"params.reportId",0,100,!1),Fs(r.category,"params.category",0,100,!1),Fs(r.event,"params.event",0,100,!1),Fs(r.label,"params.label",0,100,!1),Ti(r.value,"params.value",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,!1),!0}(Bie={}).FREE="free",Bie.UPLOADING="uploading",function(r){r[r.MISC=0]="MISC",r[r.INTERNAL_EVENT=1]="INTERNAL_EVENT",r[r.PUBLIC_EVENT=2]="PUBLIC_EVENT",r[r.WEB_EVENT=3]="WEB_EVENT",r[r.INTERNAL_API=4]="INTERNAL_API",r[r.WEB_API=5]="WEB_API",r[r.PUBLIC_API=6]="PUBLIC_API"}({});let $xe={sid:"",lts:0,success:null,cname:null,uid:null,peer:null,cid:null,elapse:null,extend:null,vid:0},Is=function(r){return r.PUBLISH="publish",r.SUBSCRIBE="subscribe",r.WS_COMPRESSOR_INIT="ws_compressor_init",r.SESSION_INIT="session_init",r.JOIN_CHOOSE_SERVER="join_choose_server",r.REQ_USER_ACCOUNT="req_user_account",r.JOIN_GATEWAY="join_gateway",r.REJOIN_GATEWAY="rejoin_gateway",r.STREAM_SWITCH="stream_switch",r.REQUEST_PROXY_WORKER_MANAGER="request_proxy_worker_manager",r.REQUEST_PROXY_APPCENTER="request_proxy_appcenter",r.FIRST_VIDEO_RECEIVED="first_video_received",r.FIRST_AUDIO_RECEIVED="first_audio_received",r.FIRST_VIDEO_DECODE="first_video_decode",r.FIRST_AUDIO_DECODE="first_audio_decode",r.ON_ADD_AUDIO_STREAM="on_add_audio_stream",r.ON_ADD_VIDEO_STREAM="on_add_video_stream",r.ON_UPDATE_STREAM="on_update_stream",r.ON_REMOVE_STREAM="on_remove_stream",r.USER_ANALYTICS="req_user_analytics",r.PC_STATS="pc_stats",r.UPDATE_REMOTE_RTPCAPABILITIES="update_remote_rtpCapabilities",r}({}),fr=function(r){return r.SESSION="io.agora.pb.Wrtc.Session",r.JOIN_CHOOSE_SERVER="io.agora.pb.Wrtc.JoinChooseServer",r.REQ_USER_ACCOUNT="io.agora.pb.Wrtc.ReqUserAccount",r.JOIN_GATEWAY="io.agora.pb.Wrtc.JoinGateway",r.RE_JOIN_GATEWAY="io.agora.pb.Wrtc.ReJoinGateway",r.PUBLISH="io.agora.pb.Wrtc.Publish",r.SUBSCRIBE="io.agora.pb.Wrtc.Subscribe",r.WS_COMPRESSOR_INIT="io.agora.pb.Wrtc.WsCompressorInit",r.STREAM_SWITCH="io.agora.pb.Wrtc.StreamSwitch",r.AUDIO_SENDING_STOPPED="io.agora.pb.Wrtc.AudioSendingStopped",r.VIDEO_SENDING_STOPPED="io.agora.pb.Wrtc.VideoSendingStopped",r.REQUEST_PROXY_APPCENTER="io.agora.pb.Wrtc.RequestProxyAppCenter",r.REQUEST_PROXY_WORKER_MANAGER="io.agora.pb.Wrtc.RequestProxyWorkerManager",r.API_INVOKE="io.agora.pb.Wrtc.ApiInvoke",r.FIRST_VIDEO_RECEIVED="io.agora.pb.Wrtc.FirstVideoReceived",r.FIRST_AUDIO_RECEIVED="io.agora.pb.Wrtc.FirstAudioReceived",r.FIRST_VIDEO_DECODE="io.agora.pb.Wrtc.FirstVideoDecode",r.FIRST_AUDIO_DECODE="io.agora.pb.Wrtc.FirstAudioDecode",r.ON_ADD_AUDIO_STREAM="io.agora.pb.Wrtc.OnAddAudioStream",r.ON_ADD_VIDEO_STREAM="io.agora.pb.Wrtc.OnAddVideoStream",r.ON_UPDATE_STREAM="io.agora.pb.Wrtc.OnUpdateStream",r.ON_REMOVE_STREAM="io.agora.pb.Wrtc.OnRemoveStream",r.JOIN_CHANNEL_TIMEOUT="io.agora.pb.Wrtc.JoinChannelTimeout",r.PEER_PUBLISH_STATUS="io.agora.pb.Wrtc.PeerPublishStatus",r.WORKER_EVENT="io.agora.pb.Wrtc.WorkerEvent",r.AP_WORKER_EVENT="io.agora.pb.Wrtc.APWorkerEvent",r.JOIN_WEB_PROXY_AP="io.agora.pb.Wrtc.JoinWebProxyAP",r.WEBSOCKET_QUIT="io.agora.pb.Wrtc.WebSocketQuit",r.USER_ANALYTICS="io.agora.pb.Wrtc.UserAnalytics",r.AUTOPLAY_FAILED="io.agora.pb.Wrtc.AutoplayFailed",r.PC_STATS="io.agora.pb.Wrtc.PCStats",r.UPDATE_REMOTE_RTPCAPABILITIES="io.agora.pb.Wrtc.UpdateRemoteRTPCapabilities",r}({});(function(r){r[r.WORKER_EVENT=156]="WORKER_EVENT",r[r.AP_WORKER_EVENT=160]="AP_WORKER_EVENT"})({}),function(r){r[r.SESSION=26]="SESSION",r[r.JOIN_CHOOSE_SERVER=27]="JOIN_CHOOSE_SERVER",r[r.REQ_USER_ACCOUNT=196]="REQ_USER_ACCOUNT",r[r.JOIN_GATEWAY=28]="JOIN_GATEWAY",r[r.PUBLISH=30]="PUBLISH",r[r.SUBSCRIBE=29]="SUBSCRIBE",r[r.WS_COMPRESSOR_INIT=9430]="WS_COMPRESSOR_INIT",r[r.STREAM_SWITCH=32]="STREAM_SWITCH",r[r.AUDIO_SENDING_STOPPED=33]="AUDIO_SENDING_STOPPED",r[r.VIDEO_SENDING_STOPPED=34]="VIDEO_SENDING_STOPPED",r[r.REQUEST_PROXY_APPCENTER=35]="REQUEST_PROXY_APPCENTER",r[r.REQUEST_PROXY_WORKER_MANAGER=36]="REQUEST_PROXY_WORKER_MANAGER",r[r.API_INVOKE=41]="API_INVOKE",r[r.FIRST_VIDEO_RECEIVED=348]="FIRST_VIDEO_RECEIVED",r[r.FIRST_AUDIO_RECEIVED=349]="FIRST_AUDIO_RECEIVED",r[r.FIRST_VIDEO_DECODE=350]="FIRST_VIDEO_DECODE",r[r.FIRST_AUDIO_DECODE=351]="FIRST_AUDIO_DECODE",r[r.ON_ADD_AUDIO_STREAM=352]="ON_ADD_AUDIO_STREAM",r[r.ON_ADD_VIDEO_STREAM=353]="ON_ADD_VIDEO_STREAM",r[r.ON_UPDATE_STREAM=356]="ON_UPDATE_STREAM",r[r.ON_REMOVE_STREAM=355]="ON_REMOVE_STREAM",r[r.JOIN_CHANNEL_TIMEOUT=407]="JOIN_CHANNEL_TIMEOUT",r[r.PEER_PUBLISH_STATUS=408]="PEER_PUBLISH_STATUS",r[r.WORKER_EVENT=156]="WORKER_EVENT",r[r.AP_WORKER_EVENT=160]="AP_WORKER_EVENT",r[r.JOIN_WEB_PROXY_AP=700]="JOIN_WEB_PROXY_AP",r[r.WEBSOCKET_QUIT=671]="WEBSOCKET_QUIT",r[r.USER_ANALYTICS=1e4]="USER_ANALYTICS",r[r.AUTOPLAY_FAILED=9178]="AUTOPLAY_FAILED"}({});class VI{constructor(){Ar(this,"baseInfoMap",new Map),Ar(this,"proxyServer",void 0),Ar(this,"eventUploadTimer",void 0),Ar(this,"setSessionIdTimer",void 0),Ar(this,"url",void 0),Ar(this,"backupUrl",void 0),Ar(this,"_appId",void 0),Ar(this,"keyEventUploadPendingItems",[]),Ar(this,"normalEventUploadPendingItems",[]),Ar(this,"apiInvokeUploadPendingItems",[]),Ar(this,"apiInvokeCount",0),Ar(this,"ltsList",[]),Ar(this,"lastSendNormalEventTime",Date.now()),Ar(this,"customReportCounterTimer",void 0),Ar(this,"customReportCount",0),Ar(this,"extApiInvoke",async a=>{for(let o of a){let c=Ln(Ln({},o),{},{sid:null,invokeId:++this.apiInvokeCount,tag:vr.TRACER});this.sendApiInvoke(c)}}),this.eventUploadTimer=window.setInterval(this.doSend.bind(this),ve("EVENT_REPORT_SEND_INTERVAL")),this.setSessionIdTimer=window.setInterval(this.appendSessionId.bind(this),ve("EVENT_REPORT_SEND_INTERVAL"))}getBaseInfoBySessionId(a){return this.baseInfoMap.get(a)}adjustSessionStartTime(a){if(!this.baseInfoMap.has(a)&&!this.baseInfoMap.get(a))return void z.error("adjust session ".concat(a," start time, sid is not exist or info is undefined"));let o=this.baseInfoMap.get(a),c=Date.now(),f=o.startTime;o.startTime=c,z.debug("rewrite session ".concat(a," startTime: ").concat(c," , ").concat(c-f,"ms")),this.baseInfoMap.set(a,o)}setAppId(a){this._appId=a}reportApiInvoke(a,o,c){o.timeout=o.timeout||6e4,o.reportResult=o.reportResult===void 0||o.reportResult;let f=Date.now();this.apiInvokeCount+=1;let g=this.apiInvokeCount,v=()=>({tag:o.tag,invokeId:g,sid:a,name:o.name,apiInvokeTime:f,options:o.options,states:o.states||null}),w=!!ve("SHOW_REPORT_INVOKER_LOG");w&&z.info("".concat(o.name," start"),o.options);let T=!1;_s(o.timeout).then(()=>{T||(this.sendApiInvoke(Ln(Ln({},v()),{},{error:ce.API_INVOKE_TIMEOUT,success:!1})),z.debug("".concat(o.name," timeout")))});let R=new Ke(ce.UNEXPECTED_ERROR,"".concat(o.name,": this api invoke is end"));return{onSuccess:A=>{let L=()=>{if(T)throw R;return T=!0,this.sendApiInvoke(Ln(Ln({},v()),{},{success:!0},o.reportResult&&{result:A})),w&&z.info("".concat(o.name," onSuccess")),A};return c?Nie(L,o.name+"Success",c,()=>T=!0):L()},onError:A=>{let L=()=>{if(T)throw A;T=!0,this.sendApiInvoke(Ln(Ln({},v()),{},{success:!1,error:A})),w&&z.info("".concat(o.name," onFailure"),A.toString())};return c?Nie(L,o.name+"Error",c,()=>T=!0):L()}}}sessionInit(a,o){if(this.baseInfoMap.has(a))return;let c=Date.now(),f=this.createBaseInfo(a,c);f.cname=o.cname;let g=Object.assign({},{willUploadConsoleLog:ve("UPLOAD_LOG"),maxTouchPoints:navigator.maxTouchPoints,areaVersion:bG?"global":"oversea",areas:ve("AREAS")&&ve("AREAS").join(",")},o.extend),{stringUid:v,channelProfile:w,channelMode:T,isABTestSuccess:R,lsid:A,clientRole:L}=o,U=Date.now(),F=Ln(Ln({},f),{},{eventType:Is.SESSION_INIT,appid:o.appid,browser:navigator.userAgent,buildFormat:o.buildFormat,build:TG,lts:U,elapse:U-c,extend:JSON.stringify(g),mode:o.mode,process:ve("PROCESS_ID"),appType:ve("APP_TYPE"),success:!0,version:pd,stringUid:v,channelProfile:w,channelMode:T,isABTestSuccess:R,lsid:A,clientType:20,clientRole:L,serviceId:ve("PROCESS_ID"),extensionID:ve("PLUGIN_INFO").join(",")||"",preload:o.preload?1:0});this.send({type:fr.SESSION,data:F},!0)}joinChooseServer(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln({},f),{},{eventType:Is.JOIN_CHOOSE_SERVER,lts:g,eventElapse:o.elapse||g-o.lts,chooseServerAddr:o.csAddr,errorCode:o.ec,elapse:g-c.startTime,success:o.succ,chooseServerAddrList:JSON.stringify(o.serverList),uid:o.uid?parseInt(o.uid):null,cid:o.cid?parseInt(o.cid):null,chooseServerIp:o.csIp||"",opid:o.opid,unilbsServerIds:o.unilbsServerIds,extend:o.extend||void 0,isHttp3:o.isHttp3});this.send({type:fr.JOIN_CHOOSE_SERVER,data:v},!0)}reqUserAccount(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln({},f),{},{eventType:Is.REQ_USER_ACCOUNT,lts:g,success:o.success,serverAddress:o.serverAddr,stringUid:o.stringUid,uid:o.uid,errorCode:o.errorCode,elapse:o.elapse||g-c.startTime,eventElapse:g-o.lts,extend:JSON.stringify(o.extend)});this.send({type:fr.REQ_USER_ACCOUNT,data:v},!0)}joinGateway(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info;o.vid&&(f.vid=o.vid),f.uid=o.uid,f.cid=o.cid;let g=Date.now(),{firstSuccess:v,avoidJoinStartTime:w,isProxy:T,addr:R}=o,A=g-(v&&w?w:c.startTime),L=Ln(Ln({},f),{},{eventType:Is.JOIN_GATEWAY,lts:g,gatewayAddr:o.addr,success:o.succ,errorCode:o.ec,elapse:A,eventElapse:g-o.lts,firstSuccess:v,signalChannel:o.signalChannel}),U=L.success?1:0;if(o.succ&&(c.lastJoinSuccessTime=g),v)this.send({type:fr.JOIN_GATEWAY,data:L},!0);else{let F;if(R)if(T){let W=R.match(/h=(\d{1,3}-){3}\d{1,3}/g),K=R.match(/p=[0-9]{1,6}/g);F={isSuccess:U,gatewayIp:W&&W.length?W[0].split("=")[1].replace(/-/g,"."):"",port:K&&K.length?K[0].split("=")[1]:"",isProxy:T?1:0}}else{let W=R.match(/wss:\/\/(\d{1,3}-){3}\d{1,3}/g),K=R.match(/(:|p=)[0-9]{1,6}/g);F={isSuccess:U,gatewayIp:W&&W.length?W[0].split("//")[1].replace(/-/g,"."):"",port:K&&K.length?K[0].split(/:|p=/g)[1]:"",isProxy:T?1:0}}else F={isSuccess:U,gatewayIp:"",port:"",isProxy:T?1:0};delete L.success,delete L.eventType,delete L.firstSuccess,L.vid=Number(L.vid);let Z=Object.assign({},L,F,{eventType:Is.REJOIN_GATEWAY});this.send({type:fr.RE_JOIN_GATEWAY,data:Z},!0)}}joinChannelTimeout(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=Date.now(),g=Ln(Ln({},c.info),{},{lts:f,timeout:o,elapse:f-c.startTime});this.send({type:fr.JOIN_CHANNEL_TIMEOUT,data:g},!0)}publish(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln({},f),{},{eventType:Is.PUBLISH,lts:g,eventElapse:o.eventElapse,elapse:g-c.startTime,success:o.succ,errorCode:o.ec,videoName:o.videoName,audioName:o.audioName,screenName:o.screenName,screenshare:o.screenshare,audio:o.audio,video:o.video,p2pid:o.p2pid,publishRequestid:o.publishRequestid});this.send({type:fr.PUBLISH,data:v},!0)}subscribe(a,o,c){let f=this.baseInfoMap.get(a);if(!f)return;let g=f.info,v=Date.now(),w=Ln(Ln({},g),{},{eventType:Is.SUBSCRIBE,lts:v,eventElapse:o.eventElapse,elapse:v-f.startTime,success:o.succ,errorCode:o.ec,video:o.video,audio:o.audio,subscribeRequestid:o.subscribeRequestid,p2pid:o.p2pid},c&&{extend:JSON.stringify({isMassSubscribe:!0})});typeof o.peerid=="string"?w.peerSuid=o.peerid:w.peer=o.peerid,this.send({type:fr.SUBSCRIBE,data:w},!0)}wsCompressorInit(a){var o;let c=[...al(o=this.baseInfoMap).call(o)],f=c.length?c[0]:"UnableToGetSid",g=this.baseInfoMap.get(f);if(!g)return;let v=g.info,w=Date.now(),T=Ln(Ln({},v),{},{eventType:Is.WS_COMPRESSOR_INIT,lts:w,eventElapse:a.eventElapse,elapse:w-g.startTime,status:a.status?1:2});this.send({type:fr.WS_COMPRESSOR_INIT,data:T},!0)}firstRemoteVideoDecode(a,o,c,f){let g=this.baseInfoMap.get(a);if(!g)return;let v=g.info,w=Date.now(),T=Ln(Ln(Ln({},v),f),{},{elapse:w-g.startTime,eventType:o,lts:w,firstDecodeFrame:Math.max(w-g.startTime,0),apEnd:Math.max(f.apEnd-g.startTime,0),apStart:Math.max(f.apStart-g.startTime,0),joinGwEnd:Math.max(f.joinGwEnd-g.startTime,0),joinGwStart:Math.max(f.joinGwStart-g.startTime,0),pcEnd:Math.max(f.pcEnd-g.startTime,0),pcStart:Math.max(f.pcStart-g.startTime,0),subscriberEnd:Math.max(f.subscriberEnd-g.startTime,0),subscriberStart:Math.max(f.subscriberStart-g.startTime,0),videoAddNotify:Math.max(f.videoAddNotify-g.startTime,0)});this.send({type:c,data:T},!0)}firstRemoteFrame(a,o,c,f){let g=this.baseInfoMap.get(a);if(!g)return;let v=g.info,w=Date.now(),T=Ln(Ln(Ln({},v),f),{},{elapse:w-g.startTime,eventType:o,lts:w});this.send({type:c,data:T},!0)}pcStats(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln(Ln({},f),o),{},{vid:f.vid===void 0?0:Number(f.vid),elapse:g-c.startTime,eventType:Is.PC_STATS,lts:g});this.send({type:fr.PC_STATS,data:v},!0)}updateRemoteRTPCapabilities(a,o){if(a){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln(Ln({},f),o),{},{vid:f.vid===void 0?0:Number(f.vid),eventType:Is.UPDATE_REMOTE_RTPCAPABILITIES,lts:g});this.send({type:fr.UPDATE_REMOTE_RTPCAPABILITIES,data:v},!0)}}onGatewayStream(a,o,c,f){let g=this.baseInfoMap.get(a);if(!g)return;let v=g.info,w=Date.now(),T=Ln(Ln(Ln({},v),f),{},{eventType:o,lts:w});this.send({type:c,data:T},!0)}streamSwitch(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln({},f),{},{eventType:Is.STREAM_SWITCH,lts:g,isDual:o.isdual,elapse:g-c.startTime,success:o.succ});this.send({type:fr.STREAM_SWITCH,data:v},!0)}requestProxyAppCenter(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln({},f),{},{eventType:Is.REQUEST_PROXY_APPCENTER,lts:g,eventElapse:g-o.lts,elapse:g-c.startTime,APAddr:o.APAddr,workerManagerList:o.workerManagerList,response:o.response,errorCode:o.ec,success:o.succ});this.send({type:fr.REQUEST_PROXY_APPCENTER,data:v},!0)}requestProxyWorkerManager(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln({},f),{},{eventType:Is.REQUEST_PROXY_WORKER_MANAGER,lts:g,eventElapse:g-o.lts,elapse:g-c.startTime,workerManagerAddr:o.workerManagerAddr,response:o.response,errorCode:o.ec,success:o.succ});this.send({type:fr.REQUEST_PROXY_WORKER_MANAGER,data:v},!0)}setProxyServer(a){this.proxyServer=a,a?z.debug("reportProxyServerurl: ".concat(a)):z.debug("disable reportProxyServerurl: ".concat(a))}peerPublishStatus(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln({},f),{},{subscribeElapse:o.subscribeElapse,peer:o.peer,peerPublishDuration:Math.max(o.audioPublishDuration,o.videoPublishDuration),audiotag:o.audioPublishDuration>0?1:-1,videotag:o.videoPublishDuration>0?1:-1,lts:g,elapse:g-c.startTime,joinChannelSuccessElapse:g-(c.lastJoinSuccessTime||g),peerPublishDurationVideo:o.videoPublishDuration,peerPublishDurationAudio:o.audioPublishDuration});this.send({type:fr.PEER_PUBLISH_STATUS,data:v},!0)}workerEvent(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now();(function(v,w,T){let R=v[w];if(!R||typeof R!="string")return[v];v[w]="";let A=zf(JSON.stringify(v)),L=0,U=[],F=0;for(let Z=0;Z<R.length;Z++)F+=R.charCodeAt(Z)<=127?1:3,F<=T-A||(U[U.length]=Kt(Kt({},v),{},{[w]:R.substring(L,Z)}),L=Z,F=R.charCodeAt(Z)<=127?1:3);return L!==R.length-1&&(U[U.length]=Kt(Kt({},v),{},{[w]:R.substring(L)})),U})(Ln(Ln(Ln({},f),o),{},{elapse:g-c.startTime,lts:g,productType:"WebRTC"}),"payload",1300).forEach(v=>this.send({type:fr.WORKER_EVENT,data:v},!0))}apworkerEvent(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln(Ln({},f),o),{},{elapse:g-c.startTime,lts:g});this.send({type:fr.AP_WORKER_EVENT,data:v},!0)}joinWebProxyAP(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln(Ln({},f),o),{},{elapse:g-c.startTime,lts:g,extend:o.extend||void 0});this.send({type:fr.JOIN_WEB_PROXY_AP,data:v},!0)}WebSocketQuit(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,g=Date.now(),v=Ln(Ln(Ln({},f),o),{},{elapse:g-c.startTime,lts:g});this.send({type:fr.WEBSOCKET_QUIT,data:v},!0)}async sendCustomReportMessage(a,o){if(this.customReportCount+=o.length,this.customReportCount>ve("CUSTOM_REPORT_LIMIT"))throw new Ke(ce.CUSTOM_REPORT_FREQUENCY_TOO_HIGH);this.customReportCounterTimer||(this.customReportCounterTimer=window.setInterval(()=>{this.customReportCount=0},5e3));let c=Date.now(),f=o.map(g=>({type:fr.USER_ANALYTICS,data:Ln(Ln({sid:a},g),{},{lts:c})}));try{ve("NEW_REPORT_SERVER")?await this.postDataToStatsCollector2(f):await this.postDataToStatsCollector(f)}catch(g){throw z.error("send custom report message failed",g.toString()),new Ke(ce.CUSTOM_REPORT_SEND_FAILED,g.message)}}sendApiInvoke(a){let o=ve("NOT_REPORT_EVENT");if(a.tag&&Tt(o)&&Tt(o).call(o,a.tag))return!1;if(a.sid===null)return this.apiInvokeUploadPendingItems.push(a),!1;let c=this.baseInfoMap.get(a.sid);if(!c)return this.apiInvokeUploadPendingItems.push(a),!1;let{cname:f,uid:g,cid:v}=c.info,w;if(a.lts=a.lts||Date.now(),a.error)if(a.error instanceof Ke){let{code:R,message:A}=a.error;w=R||A||a.error.toString()}else w=a.error.toString();let T={invokeId:a.invokeId,sid:a.sid,cname:f,cid:v,uid:g,lts:a.lts,success:a.success,elapse:a.lts-c.startTime,execElapse:a.lts-a.apiInvokeTime,apiName:a.name,options:a.options?JSON.stringify(a.options):void 0,execStates:a.states?JSON.stringify(a.states):void 0,execResult:a.result?JSON.stringify(a.result):void 0,errorCode:a.error?w:void 0,errorMsg:a.error?JSON.stringify(a.error):void 0};return this.send({type:fr.API_INVOKE,data:T},!1),!0}appendSessionId(){VI.__CLIENT_LIST__.forEach(a=>{if(a._sessionId){let o=this.apiInvokeUploadPendingItems.length;for(let c=0;c<o;c++){let f=this.apiInvokeUploadPendingItems.shift();f&&(f.sid=a._sessionId,this.sendApiInvoke(Object.assign({},f)))}}})}send(a,o){if(o)return this.keyEventUploadPendingItems.push(a),void this.sendItems(this.keyEventUploadPendingItems,!0);this.normalEventUploadPendingItems.push(a),this.normalEventUploadPendingItems.length>ve("NORMAL_EVENT_QUEUE_CAPACITY")&&this.normalEventUploadPendingItems.splice(0,1),this.normalEventUploadPendingItems.length>=10&&this.sendItems(this.normalEventUploadPendingItems,!1)}doSend(){this.keyEventUploadPendingItems.length>0&&this.sendItems(this.keyEventUploadPendingItems,!0),this.normalEventUploadPendingItems.length>0&&Date.now()-this.lastSendNormalEventTime>=5e3&&this.sendItems(this.normalEventUploadPendingItems,!1)}sendItems(a,o){let c=[],f=[];for(;a.length;){let v=a.shift();c.length<20?c.push(v):f.push(v)}a.push(...f);for(let v of[...c]){var g;this.ltsList.indexOf(v.data.lts)!==-1?(v.data.lts=this.ltsList[this.ltsList.length-1]+1,this.ltsList.push(v.data.lts)):(this.ltsList.push(v.data.lts),wI(g=this.ltsList).call(g,(w,T)=>w-T))}return o||(this.lastSendNormalEventTime=Date.now()),ve("ENABLE_EVENT_REPORT")&&c.length&&(ve("NEW_REPORT_SERVER")?this.postDataToStatsCollector2(c):this.postDataToStatsCollector(c)).catch((v=>w=>{ve("EVENT_REPORT_RETRY")&&(o?this.keyEventUploadPendingItems=this.keyEventUploadPendingItems.concat(v):(this.normalEventUploadPendingItems=this.normalEventUploadPendingItems.concat(v),this.normalEventUploadPendingItems.length>ve("NORMAL_EVENT_QUEUE_CAPACITY")&&(this.normalEventUploadPendingItems.splice(0,this.normalEventUploadPendingItems.length-ve("NORMAL_EVENT_QUEUE_CAPACITY")),z.warning("report: drop normal events"))))})(c)),a}async postDataToStatsCollector2(a){yr.networkState===so.OFFLINE&&await Ct.race([yr.onlineWaiter,_s(2*Mr.maxRetryTimeout)]);let o=g=>{let v=new Uint8Array;return g.forEach(w=>{let T=gG(JSON.stringify(w.data)),R=new ArrayBuffer(5),A=(U=>{let F=0;return Object.entries(fr).forEach(Z=>{let[W,K]=Z;K===U.type&&(F=EventNameToID[W])}),F})(w),L=new DataView(R);L.setUint16(0,T.byteLength,!0),L.setUint8(2,255&A),L.setUint8(3,A>>>8&255),L.setUint8(4,A>>>16&255),v=Eie(v,new Uint8Array(R)),v=Eie(v,T)}),v},c="event",f=this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("NEW_REPORT_SERVER_DOMAINS")[0],"&p=443&d=").concat(c):"https://".concat(ve("NEW_REPORT_SERVER_DOMAINS")[0],"/").concat(c);for(let g=0;g<2;g+=1){g===1&&(f=this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("NEW_REPORT_SERVER_DOMAINS")[1],"&p=443&d=").concat(c):"https://".concat(ve("NEW_REPORT_SERVER_DOMAINS")[1],"/").concat(c));try{await SG(f,{timeout:1e4,data:o(a),headers:Ln(Ln({biz:"webrtc",sendts:Math.round(Date.now()/1e3),debug:"false"},this._appId&&{appid:this._appId}),{},{"Content-Type":"application/octet-stream"})},!0)}catch(v){if(g===1)throw v;continue}return}}async postDataToStatsCollector(a){let o=arguments.length>1&&arguments[1]!==void 0&&arguments[1],c={msgType:"EventMessages",sentTs:Math.round(Date.now()/1e3),payloads:a.map(v=>JSON.stringify(v)),vid:(v=>{let w=v&&v.data.sid&&this.baseInfoMap.get(v.data.sid);return w&&w.info.vid&&+w.info.vid||0})(a[0])};yr.networkState===so.OFFLINE&&await Ct.race([yr.onlineWaiter,_s(2*Mr.maxRetryTimeout)]);let f=o?"/events/proto-raws":"/events/messages",g=this.url||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("EVENT_REPORT_DOMAIN"),"&p=").concat(ve("STATS_COLLECTOR_PORT"),"&d=").concat(f):"https://".concat(ve("EVENT_REPORT_DOMAIN"),":").concat(ve("STATS_COLLECTOR_PORT")).concat(f));for(let v=0;v<2;v+=1){v===1&&(g=this.backupUrl||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("EVENT_REPORT_BACKUP_DOMAIN"),"&p=").concat(ve("STATS_COLLECTOR_PORT"),"&d=").concat(f):"https://".concat(ve("EVENT_REPORT_BACKUP_DOMAIN"),":").concat(ve("STATS_COLLECTOR_PORT")).concat(f)));try{o?await Bxe(g,{timeout:1e4,data:c}):await SG(g,{timeout:1e4,data:c})}catch(w){if(v===1)throw w;continue}return}}createBaseInfo(a,o){let c=Object.assign({},$xe);return c.sid=a,this.baseInfoMap.set(a,{info:c,startTime:o}),c}reportResourceTiming(a,o){let c=performance.getEntriesByName(a),f=c[c.length-1];f&&this.reportApiInvoke(o,{name:"Client.resourceTiming",options:f,tag:vr.TRACER}).onSuccess()}}function hn(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(a,o,c){let f=c.value;if(typeof f=="function"){let g=r.className||a.__className__||(a.constructor.name==="AgoraRTCClient"?"Client":a.constructor.name);c.value=function(){for(var v=arguments.length,w=new Array(v),T=0;T<v;T++)w[T]=arguments[T];let R=w;if(r.argsMap)try{R=r.argsMap(this,...w)}catch(L){z.warning(L),R=[]}try{JSON.stringify(R)}catch{z.warning("arguments for method ".concat(g,".").concat(String(o)," not serializable for apiInvoke.")),R=[]}let A=(r.report||$t).reportApiInvoke(this._sessionId||null,{name:"".concat(g,".").concat(String(o)),options:R,tag:vr.TRACER,reportResult:r.reportResult},r.throttleTime);try{let L=f.apply(this,w);return L instanceof Ct?L.then(U=>(A.onSuccess(r.reportResult&&U),U)).catch(U=>{throw A.onError(U),U}):(A.onSuccess(r.reportResult&&L),L)}catch(L){throw A.onError(L),L}}}return c}}Ar(VI,"__CLIENT_LIST__",[]);let $t=new VI;Uie.on("REPORT_LOG_UPLOAD",r=>{r.networkState=yr.networkState,$t.reportApiInvoke(null,{name:"logUploadError",options:r,tag:vr.TRACER}).onSuccess("logUploadError")});let Kxe=["CHINA","GLOBAL"],Js=function(){let r="us".concat("erna","me"),a="pa".concat("sswo","rd"),o=["t","s","t"];o.splice(1,0,"e");let c=o.join(""),f=[];for(let w=0;w<6;w++)f.push("1");let g=f.join(""),v={};return v[r]=c,v[a]=g,Object.assign(v,{turnServerURL:"",tcpport:3433,udpport:3478,forceturn:!1})}();window.DEFAULT_TURN_CONFIG=Js,bG||(is.WEBCS_DOMAIN=["ap-web-1-oversea.agora.io","ap-web-1-north-america.agora.io"],is.WEBCS_DOMAIN_BACKUP_LIST=["ap-web-2-oversea.agora.io","ap-web-2-north-america.agora.io"],is.PROXY_CS=["proxy-ap-web-oversea.agora.io","proxy-ap-web-america.agora.io"],is.CDS_AP=["cds-ap-web-oversea.agora.io","cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],is.ACCOUNT_REGISTER=["sua-ap-web-oversea.agora.io","sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],is.UAP_AP=["uap-ap-web-oversea.agora.io","uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],is.LOG_UPLOAD_SERVER="logservice-oversea.agora.io",is.EVENT_REPORT_DOMAIN="statscollector-1-oversea.agora.io",is.EVENT_REPORT_BACKUP_DOMAIN="statscollector-2-oversea.agora.io",is.PROXY_SERVER_TYPE3="webrtc-cloud-proxy.agora.io",is.AREAS=["NORTH_AMERICA","OVERSEA"]);let Vie=[[0,1,2,3,4,5,5],[0,2,2,3,4,5,5],[0,3,3,3,4,5,5],[0,4,4,4,4,5,5],[0,5,5,5,5,5,5]],H0=[];function d_(r,a){return!!a&&H0.some(o=>o.uid===r&&o.channelName===a)}VI.__CLIENT_LIST__=H0;var qxe=mte.forEach,zie=zw("forEach")?[].forEach:function(r){return qxe(this,r,arguments.length>1?arguments[1]:void 0)};Ii({target:"Array",proto:!0,forced:[].forEach!=zie},{forEach:zie});var Yxe=wc("Array").forEach,Xxe=dd,Jxe=ms,Qxe=C,Zxe=Yxe,xG=Array.prototype,eAe={DOMTokenList:!0,NodeList:!0},tAe=function(r){var a=r.forEach;return r===xG||Qxe(xG,r)&&a===xG.forEach||Jxe(eAe,Xxe(r))?Zxe:a},nAe=l(tAe),iAe=No,Hie=Jw;Ii({target:"Object",stat:!0,forced:d(function(){Hie(1)})},{keys:function(r){return Hie(iAe(r))}});var Gie=l(Me.Object.keys),rAe=l(Kx),sAe=Ii,aAe=CI,oAe=E([].reverse),Wie=[1,2];sAe({target:"Array",proto:!0,forced:String(Wie)===String(Wie.reverse())},{reverse:function(){return aAe(this)&&(this.length=this.length),oAe(this)}});var lAe=wc("Array").reverse,cAe=C,dAe=lAe,AG=Array.prototype,uAe=function(r){var a=r.reverse;return r===AG||cAe(AG,r)&&a===AG.reverse?dAe:a},$ie=uAe,hAe=l($ie),fAe=Ii,Kie=CI,pAe=Ml,mAe=it,qie=gy,gAe=vh,vAe=xt,yAe=$S,_Ae=Xi,EAe=TA,wAe=ste("slice"),SAe=_Ae("species"),IG=Array,bAe=Math.max;fAe({target:"Array",proto:!0,forced:!wAe},{slice:function(r,a){var o,c,f,g=vAe(this),v=gAe(g),w=qie(r,v),T=qie(a===void 0?v:a,v);if(Kie(g)&&(o=g.constructor,(pAe(o)&&(o===IG||Kie(o.prototype))||mAe(o)&&(o=o[SAe])===null)&&(o=void 0),o===IG||o===void 0))return EAe(g,w,T);for(c=new(o===void 0?IG:o)(bAe(T-w,0)),f=0;w<T;w++,f++)w in g&&yAe(c,f,g[w]);return c.length=f,c}});var CAe=wc("Array").slice,TAe=C,RAe=CAe,NG=Array.prototype,xAe=function(r){var a=r.slice;return r===NG||TAe(NG,r)&&a===NG.slice?RAe:a},AAe=l(xAe);function vt(r,a,o,c,f){var g,v,w,T={};return nAe(g=Gie(c)).call(g,function(R){T[R]=c[R]}),T.enumerable=!!T.enumerable,T.configurable=!!T.configurable,("value"in T||T.initializer)&&(T.writable=!0),T=rAe(v=hAe(w=AAe(o).call(o)).call(w)).call(v,function(R,A){return A(r,a,R)||R},T),f&&T.initializer!==void 0&&(T.value=T.initializer?T.initializer.call(f):void 0,T.initializer=void 0),T.initializer===void 0&&(tte(r,a,T),T=null),T}var IAe=wc("Array").values,NAe=dd,OAe=ms,PAe=C,LAe=IAe,OG=Array.prototype,DAe={DOMTokenList:!0,NodeList:!0},kAe=function(r){var a=r.values;return r===OG||PAe(OG,r)&&a===OG.values||OAe(DAe,NAe(r))?LAe:a},Oh=l(kAe);let MAe=function(r){return r.L1T1="L1T1",r.L1T2="L1T2",r.L1T3="L1T3",r.L2T1_KEY="L2T1_KEY",r.L2T2_KEY="L2T2_KEY",r.L2T3_KEY="L2T3_KEY",r.L3T1_KEY="L3T1_KEY",r.L3T2_KEY="L3T2_KEY",r.L3T3_KEY="L3T3_KEY",r}({}),Ic=function(r){return r.CERTIFICATE="certificate",r.CODEC="codec",r.CANDIDATE_PAIR="candidate-pair",r.LOCAL_CANDIDATE="local-candidate",r.REMOTE_CANDIDATE="remote-candidate",r.INBOUND="inbound-rtp",r.TRACK="track",r.OUTBOUND="outbound-rtp",r.PC="peer-connection",r.REMOTE_INBOUND="remote-inbound-rtp",r.REMOTE_OUTBOUND="remote-outbound-rtp",r.TRANSPORT="transport",r.CSRC="csrc",r.DATA_CHANNEL="data-channel",r.STREAM="stream",r.SENDER="sender",r.RECEIVER="receiver",r}({}),mk=function(r){return r[r.ACCESS_POINT=101]="ACCESS_POINT",r[r.UNILBS=201]="UNILBS",r[r.STRING_UID_ALLOCATOR=901]="STRING_UID_ALLOCATOR",r}({}),PG=function(r){return r[r.IIIEGAL_APPID=1]="IIIEGAL_APPID",r[r.IIIEGAL_UID=2]="IIIEGAL_UID",r[r.INTERNAL_ERROR=3]="INTERNAL_ERROR",r}({}),wu=function(r){return r[r.INVALID_VENDOR_KEY=5]="INVALID_VENDOR_KEY",r[r.INVALID_CHANNEL_NAME=7]="INVALID_CHANNEL_NAME",r[r.INTERNAL_ERROR=8]="INTERNAL_ERROR",r[r.NO_AUTHORIZED=9]="NO_AUTHORIZED",r[r.DYNAMIC_KEY_TIMEOUT=10]="DYNAMIC_KEY_TIMEOUT",r[r.NO_ACTIVE_STATUS=11]="NO_ACTIVE_STATUS",r[r.DYNAMIC_KEY_EXPIRED=13]="DYNAMIC_KEY_EXPIRED",r[r.STATIC_USE_DYNAMIC_KEY=14]="STATIC_USE_DYNAMIC_KEY",r[r.DYNAMIC_USE_STATIC_KEY=15]="DYNAMIC_USE_STATIC_KEY",r[r.USER_OVERLOAD=16]="USER_OVERLOAD",r[r.FORBIDDEN_REGION=18]="FORBIDDEN_REGION",r[r.CANNOT_MEET_AREA_DEMAND=19]="CANNOT_MEET_AREA_DEMAND",r}({}),ao=function(r){return r[r.NO_FLAG_SET=100]="NO_FLAG_SET",r[r.FLAG_SET_BUT_EMPTY=101]="FLAG_SET_BUT_EMPTY",r[r.INVALID_FALG_SET=102]="INVALID_FALG_SET",r[r.FLAG_SET_BUT_NO_RE=103]="FLAG_SET_BUT_NO_RE",r[r.INVALID_SERVICE_ID=104]="INVALID_SERVICE_ID",r[r.NO_SERVICE_AVAILABLE=200]="NO_SERVICE_AVAILABLE",r[r.NO_SERVICE_AVAILABLE_P2P=201]="NO_SERVICE_AVAILABLE_P2P",r[r.NO_SERVICE_AVAILABLE_VOICE=202]="NO_SERVICE_AVAILABLE_VOICE",r[r.NO_SERVICE_AVAILABLE_WEBRTC=203]="NO_SERVICE_AVAILABLE_WEBRTC",r[r.NO_SERVICE_AVAILABLE_CDS=204]="NO_SERVICE_AVAILABLE_CDS",r[r.NO_SERVICE_AVAILABLE_CDN=205]="NO_SERVICE_AVAILABLE_CDN",r[r.NO_SERVICE_AVAILABLE_TDS=206]="NO_SERVICE_AVAILABLE_TDS",r[r.NO_SERVICE_AVAILABLE_REPORT=207]="NO_SERVICE_AVAILABLE_REPORT",r[r.NO_SERVICE_AVAILABLE_APP_CENTER=208]="NO_SERVICE_AVAILABLE_APP_CENTER",r[r.NO_SERVICE_AVAILABLE_ENV0=209]="NO_SERVICE_AVAILABLE_ENV0",r[r.NO_SERVICE_AVAILABLE_VOET=210]="NO_SERVICE_AVAILABLE_VOET",r[r.NO_SERVICE_AVAILABLE_STRING_UID=211]="NO_SERVICE_AVAILABLE_STRING_UID",r[r.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS=212]="NO_SERVICE_AVAILABLE_WEBRTC_UNILBS",r[r.NO_SERVICE_AVAILABLE_UNILBS_FLV=213]="NO_SERVICE_AVAILABLE_UNILBS_FLV",r}({}),ln=function(r){return r[r.K_TIMESTAMP_EXPIRED=2]="K_TIMESTAMP_EXPIRED",r[r.K_CHANNEL_PERMISSION_INVALID=3]="K_CHANNEL_PERMISSION_INVALID",r[r.K_CERTIFICATE_INVALID=4]="K_CERTIFICATE_INVALID",r[r.K_CHANNEL_NAME_EMPTY=5]="K_CHANNEL_NAME_EMPTY",r[r.K_CHANNEL_NOT_FOUND=6]="K_CHANNEL_NOT_FOUND",r[r.K_TICKET_INVALID=7]="K_TICKET_INVALID",r[r.K_CHANNEL_CONFLICTED=8]="K_CHANNEL_CONFLICTED",r[r.K_SERVICE_NOT_READY=9]="K_SERVICE_NOT_READY",r[r.K_SERVICE_TOO_HEAVY=10]="K_SERVICE_TOO_HEAVY",r[r.K_UID_BANNED=14]="K_UID_BANNED",r[r.K_IP_BANNED=15]="K_IP_BANNED",r[r.K_CHANNEL_BANNED=16]="K_CHANNEL_BANNED",r[r.K_AUTO_REBALANCE=28]="K_AUTO_REBALANCE",r[r.WARN_NO_AVAILABLE_CHANNEL=103]="WARN_NO_AVAILABLE_CHANNEL",r[r.WARN_LOOKUP_CHANNEL_TIMEOUT=104]="WARN_LOOKUP_CHANNEL_TIMEOUT",r[r.WARN_LOOKUP_CHANNEL_REJECTED=105]="WARN_LOOKUP_CHANNEL_REJECTED",r[r.WARN_OPEN_CHANNEL_TIMEOUT=106]="WARN_OPEN_CHANNEL_TIMEOUT",r[r.WARN_OPEN_CHANNEL_REJECTED=107]="WARN_OPEN_CHANNEL_REJECTED",r[r.WARN_REQUEST_DEFERRED=108]="WARN_REQUEST_DEFERRED",r[r.ERR_DYNAMIC_KEY_TIMEOUT=109]="ERR_DYNAMIC_KEY_TIMEOUT",r[r.ERR_NO_AUTHORIZED=110]="ERR_NO_AUTHORIZED",r[r.ERR_VOM_SERVICE_UNAVAILABLE=111]="ERR_VOM_SERVICE_UNAVAILABLE",r[r.ERR_NO_CHANNEL_AVAILABLE_CODE=112]="ERR_NO_CHANNEL_AVAILABLE_CODE",r[r.ERR_MASTER_VOCS_UNAVAILABLE=114]="ERR_MASTER_VOCS_UNAVAILABLE",r[r.ERR_INTERNAL_ERROR=115]="ERR_INTERNAL_ERROR",r[r.ERR_NO_ACTIVE_STATUS=116]="ERR_NO_ACTIVE_STATUS",r[r.ERR_INVALID_UID=117]="ERR_INVALID_UID",r[r.ERR_DYNAMIC_KEY_EXPIRED=118]="ERR_DYNAMIC_KEY_EXPIRED",r[r.ERR_STATIC_USE_DYANMIC_KE=119]="ERR_STATIC_USE_DYANMIC_KE",r[r.ERR_DYNAMIC_USE_STATIC_KE=120]="ERR_DYNAMIC_USE_STATIC_KE",r[r.ERR_NO_VOCS_AVAILABLE=2e3]="ERR_NO_VOCS_AVAILABLE",r[r.ERR_NO_VOS_AVAILABLE=2001]="ERR_NO_VOS_AVAILABLE",r[r.ERR_JOIN_CHANNEL_TIMEOUT=2002]="ERR_JOIN_CHANNEL_TIMEOUT",r[r.ERR_REPEAT_JOIN_CHANNEL=2003]="ERR_REPEAT_JOIN_CHANNEL",r[r.ERR_JOIN_BY_MULTI_IP=2004]="ERR_JOIN_BY_MULTI_IP",r[r.ERR_NOT_JOINED=2011]="ERR_NOT_JOINED",r[r.ERR_REPEAT_JOIN_REQUEST=2012]="ERR_REPEAT_JOIN_REQUEST",r[r.ERR_INVALID_VENDOR_KEY=2013]="ERR_INVALID_VENDOR_KEY",r[r.ERR_INVALID_CHANNEL_NAME=2014]="ERR_INVALID_CHANNEL_NAME",r[r.ERR_INVALID_STRINGUID=2015]="ERR_INVALID_STRINGUID",r[r.ERR_TOO_MANY_USERS=2016]="ERR_TOO_MANY_USERS",r[r.ERR_SET_CLIENT_ROLE_TIMEOUT=2017]="ERR_SET_CLIENT_ROLE_TIMEOUT",r[r.ERR_SET_CLIENT_ROLE_NO_PERMISSION=2018]="ERR_SET_CLIENT_ROLE_NO_PERMISSION",r[r.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE=2019]="ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",r[r.ERR_PUBLISH_REQUEST_INVALID=2020]="ERR_PUBLISH_REQUEST_INVALID",r[r.ERR_SUBSCRIBE_REQUEST_INVALID=2021]="ERR_SUBSCRIBE_REQUEST_INVALID",r[r.ERR_NOT_SUPPORTED_MESSAGE=2022]="ERR_NOT_SUPPORTED_MESSAGE",r[r.ERR_ILLEAGAL_PLUGIN=2023]="ERR_ILLEAGAL_PLUGIN",r[r.ERR_REJOIN_TOKEN_INVALID=2024]="ERR_REJOIN_TOKEN_INVALID",r[r.ERR_REJOIN_USER_NOT_JOINED=2025]="ERR_REJOIN_USER_NOT_JOINED",r[r.ERR_INVALID_OPTIONAL_INFO=2027]="ERR_INVALID_OPTIONAL_INFO",r[r.ILLEGAL_AES_PASSWORD=2028]="ILLEGAL_AES_PASSWORD",r[r.ILLEGAL_CLIENT_ROLE_LEVEL=2029]="ILLEGAL_CLIENT_ROLE_LEVEL",r[r.ERR_TOO_MANY_BROADCASTERS=2031]="ERR_TOO_MANY_BROADCASTERS",r[r.ERR_TOO_MANY_SUBSCRIBERS=2032]="ERR_TOO_MANY_SUBSCRIBERS",r[r.ERR_LICENSE_MISSING=32769]="ERR_LICENSE_MISSING",r[r.ERR_LICENSE_EXPIRED=32771]="ERR_LICENSE_EXPIRED",r[r.ERR_LICENSE_MINUTES_EXCEEDED=32773]="ERR_LICENSE_MINUTES_EXCEEDED",r[r.ERR_LICENSE_PERIOD_INVALID=32774]="ERR_LICENSE_PERIOD_INVALID",r[r.ERR_LICENSE_MULTIPLE_SDK_SERVICE=32778]="ERR_LICENSE_MULTIPLE_SDK_SERVICE",r[r.ERR_LICENSE_ILLEGAL=32783]="ERR_LICENSE_ILLEGAL",r[r.ERR_TEST_RECOVER=9e3]="ERR_TEST_RECOVER",r[r.ERR_TEST_TRYNEXT=9001]="ERR_TEST_TRYNEXT",r[r.ERR_TEST_RETRY=9002]="ERR_TEST_RETRY",r}({}),zn=function(r){return r.CONNECTING="connecting",r.CONNECTED="connected",r.RECONNECTING="reconnecting",r.CLOSED="closed",r}({}),Ut=function(r){return r.WS_CONNECTED="ws_connected",r.WS_RECONNECTING="ws_reconnecting",r.WS_CLOSED="ws_closed",r.WS_RECONNECT_WAITTING_FINISH="ws_reconnect_waitting_finish",r.WS_RECONNECT_CREATE_CONNECTION="ws_reconnect_create_connection",r.ON_BINARY_DATA="on_binary_data",r.REQUEST_RECOVER="request_recover",r.REQUEST_JOIN_INFO="request_join_info",r.REQUEST_REJOIN_INFO="req_rejoin_info",r.IS_P2P_DISCONNECTED="is_p2p_dis",r.DISCONNECT_P2P="dis_p2p",r.ABORT_P2P_EXECUTION="abort_p2p_execution",r.NEED_RENEW_SESSION="need-sid",r.REPORT_JOIN_GATEWAY="report_join_gateway",r.REQUEST_TIMEOUT="request_timeout",r.REQUEST_SUCCESS="request_success",r.JOIN_RESPONSE="join_response",r.DATACHANNEL_PRECONNECT="datachannel_preconnect",r.DATACHANNEL_CONNECTING="datachannel_connecting",r.DATACHANNEL_FAILBACK="datachannel_failback",r.P2P_CONNECTION="p2p_connection",r.P2P_REMOTE_CANDIDATE_UPDATE="p2p_remote_candidate_update",r.P2P_SUBSCRIBE="p2p_subscribe",r.P2P_UNSUBSCRIBE="p2p_unsubscribe",r.P2P_EXCHANGE_SDP="p2p_exchange_sdp",r.P2P_ON_ADD_VIDEO_STREAM="p2p_on_add_video_stream",r.P2P_ON_ADD_AUDIO_STREAM="p2p_on_add_audio_stream",r}({}),rn=function(r){return r.PING="ping",r.PING_BACK="ping_back",r.JOIN="join_v3",r.REJOIN="rejoin_v3",r.LEAVE="leave",r.SET_CLIENT_ROLE="set_client_role",r.PUBLISH="publish",r.PUBLISH_DATASTREAM="publish_datastream",r.UNPUBLISH="unpublish",r.UNPUBLISH_DATASTREAM="unpublish_datastream",r.SUBSCRIBE="subscribe",r.PRE_SUBSCRIBE="pre_subscribe",r.SUBSCRIBE_DATASTREAM="subscribe_datastream",r.SUBSCRIBE_STREAMS="subscribe_streams",r.UNSUBSCRIBE="unsubscribe",r.UNSUBSCRIBE_DATASTREAM="unsubscribe_datastream",r.UNSUBSCRIBE_STREAMS="unsubscribe_streams",r.SUBSCRIBE_CHANGE="subscribe_change",r.TRAFFIC_STATS="traffic_stats",r.RENEW_TOKEN="renew_token",r.SWITCH_VIDEO_STREAM="switch_video_stream",r.DEFAULT_VIDEO_STREAM="default_video_stream",r.SET_FALLBACK_OPTION="set_fallback_option",r.GATEWAY_INFO="gateway_info",r.CONTROL="control",r.SEND_METADATA="send_metadata",r.DATA_STREAM="data_stream",r.PICK_SVC_LAYER="pick_svc_layer",r.RESTART_ICE="restart_ice",r.CONNECT_PC="connect_pc",r.SET_VIDEO_PROFILE="set_video_profile",r.SET_PARAMETER="set_parameter",r.SET_RTM2_FLAG="set_rtm2_flag",r}({}),u_=function(r){return r.WRTC_STATS="wrtc_stats",r.WS_INFLATE_DATA_LENGTH="ws_inflate_data_length",r.DENOISER_STATS="denoiser_stats",r.EXTENSION_USAGE_STATS="extension_usage_stats",r}({}),Sn=function(r){return r.ON_USER_ONLINE="on_user_online",r.ON_USER_OFFLINE="on_user_offline",r.ON_STREAM_FALLBACK_UPDATE="on_stream_fallback_update",r.ON_PUBLISH_STREAM="on_publish_stream",r.ON_UPLINK_STATS="on_uplink_stats",r.ON_P2P_LOST="on_p2p_lost",r.ON_REMOVE_STREAM="on_remove_stream",r.ON_ADD_AUDIO_STREAM="on_add_audio_stream",r.ON_ADD_VIDEO_STREAM="on_add_video_stream",r.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="on_token_privilege_will_expire",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="on_token_privilege_did_expire",r.ON_USER_BANNED="on_user_banned",r.ON_USER_LICENSE_BANNED="on_user_license_banned",r.ON_NOTIFICATION="on_notification",r.ON_CRYPT_ERROR="on_crypt_error",r.MUTE_AUDIO="mute_audio",r.MUTE_VIDEO="mute_video",r.UNMUTE_AUDIO="unmute_audio",r.UNMUTE_VIDEO="unmute_video",r.ON_P2P_OK="on_p2p_ok",r.RECEIVE_METADATA="receive_metadata",r.ON_DATA_STREAM="on_data_stream",r.ON_RTP_CAPABILITY_CHANGE="on_rtp_capability_change",r.ON_REMOTE_DATASTREAM_UPDATE="on_remote_datastream_update",r.ON_REMOTE_FULL_DATASTREAM_INFO="on_remote_full_datastream_info",r.ENABLE_LOCAL_VIDEO="enable_local_video",r.DISABLE_LOCAL_VIDEO="disable_local_video",r.ENABLE_LOCAL_AUDIO="enable_local_audio",r.DISABLE_LOCAL_AUDIO="disable_local_audio",r.ON_PUBLISHED_USER_LIST="on_published_user_list",r}({}),oo=function(r){return r.SEND_ONLY="SEND_ONLY",r.RECEIVE_ONLY="RECEIVE_ONLY",r}({}),_n=function(r){return r.CONNECTED="websocket:connected",r.RECONNECTING="websocket:reconnecting",r.WILL_RECONNECT="websocket:will_reconnect",r.CLOSED="websocket:closed",r.FAILED="websocket:failed",r.ON_MESSAGE="websocket:on_message",r.REQUEST_NEW_URLS="websocket:request_new_urls",r.RECONNECT_WAITTING_FINISH="websocket:reconnect_waitting_finish",r.RECONNECT_CREATE_CONNECTION="websocket:reconnect_create_connection",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="websocket:on_token_privilege_did_expire",r}({});class De extends Ke{constructor(a){super(a,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",arguments.length>2?arguments[2]:void 0),X(this,"name","AgoraRTCException")}print(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"error";return super.print(a,z)}throw(){super.throw(z)}}function gk(r){if(typeof r!="string"||!/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/.test(r))throw z.error("Invalid Channel Name ".concat(r)),new De(ce.INVALID_PARAMS,"The length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,")}function vk(r){if(!function(a){return typeof a=="number"&&Math.floor(a)===a&&0<=a&&a<=4294967295}(r)&&!gie(r,1,255))throw new De(ce.INVALID_PARAMS,"[String uid] Length of the string: [1,255]. ASCII characters only. [Number uid] The value range is [0,10000]");typeof r=="string"&&z.warn("You input a string as the user ID, to ensure better end-user experience, Agora highly suggests not using a string as the user ID.")}let Ns=function(r){return r.TRANSCODE="mix_streaming",r.RAW="raw_streaming",r.INJECT="inject_streaming",r}({}),cb=function(r){return r[r.INJECT_STREAM_STATUS_START_SUCCESS=0]="INJECT_STREAM_STATUS_START_SUCCESS",r[r.INJECT_STREAM_STATUS_START_ALREADY_EXISTS=1]="INJECT_STREAM_STATUS_START_ALREADY_EXISTS",r[r.INJECT_STREAM_STATUS_START_UNAUTHORIZED=2]="INJECT_STREAM_STATUS_START_UNAUTHORIZED",r[r.INJECT_STREAM_STATUS_START_TIMEOUT=3]="INJECT_STREAM_STATUS_START_TIMEOUT",r[r.INJECT_STREAM_STATUS_START_FAILED=4]="INJECT_STREAM_STATUS_START_FAILED",r[r.INJECT_STREAM_STATUS_STOP_SUCCESS=5]="INJECT_STREAM_STATUS_STOP_SUCCESS",r[r.INJECT_STREAM_STATUS_STOP_NOT_FOUND=6]="INJECT_STREAM_STATUS_STOP_NOT_FOUND",r[r.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED=7]="INJECT_STREAM_STATUS_STOP_UNAUTHORIZED",r[r.INJECT_STREAM_STATUS_STOP_TIMEOUT=8]="INJECT_STREAM_STATUS_STOP_TIMEOUT",r[r.INJECT_STREAM_STATUS_STOP_FAILED=9]="INJECT_STREAM_STATUS_STOP_FAILED",r[r.INJECT_STREAM_STATUS_BROKEN=10]="INJECT_STREAM_STATUS_BROKEN",r}({}),jAe={alpha:1,height:640,width:360,x:0,y:0,zOrder:0,audioChannel:0},LG={x:0,y:0,width:160,height:160,zOrder:255,alpha:1};function DG(r,a){Fs(r.url,"".concat(a,".url"),1,1e3,!1),gr(r.x)||Ti(r.x,"".concat(a,".x"),0,1e4),gr(r.y)||Ti(r.y,"".concat(a,".y"),0,1e4),gr(r.width)||Ti(r.width,"".concat(a,".width"),0,1e4),gr(r.height)||Ti(r.height,"".concat(a,".height"),0,1e4),gr(r.zOrder)||Ti(r.zOrder,"".concat(a,".zOrder"),0,255),gr(r.alpha)||Ti(r.alpha,"".concat(a,".alpha"),0,1,!1)}let UAe={audioBitrate:48,audioChannels:1,audioSampleRate:48e3,backgroundColor:0,height:360,lowLatency:!1,videoBitrate:400,videoCodecProfile:100,videoCodecType:1,videoFrameRate:15,videoGop:30,width:640,images:[],userConfigs:[],userConfigExtraInfo:""},FAe={audioBitrate:48,audioChannels:2,audioVolume:100,audioSampleRate:48e3,height:0,width:0,videoBitrate:400,videoFramerate:15,videoGop:30},Hf=function(r){return r.WARNING="@live_uap-warning",r.ERROR="@line_uap-error",r.PUBLISH_STREAM_STATUS="@live_uap-publish-status",r.INJECT_STREAM_STATUS="@live_uap-inject-status",r.WORKER_STATUS="@live_uap-worker-status",r.REQUEST_NEW_ADDRESS="@live_uap-request-address",r}({}),yk=function(r){return r.REQUEST_WORKER_MANAGER_LIST="@live_req_worker_manager",r}({}),rs=function(r){return r[r.LIVE_STREAM_RESPONSE_SUCCEED=200]="LIVE_STREAM_RESPONSE_SUCCEED",r[r.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM=454]="LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM",r[r.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR=450]="LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR",r[r.LIVE_STREAM_RESPONSE_BAD_STREAM=451]="LIVE_STREAM_RESPONSE_BAD_STREAM",r[r.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR=400]="LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR",r[r.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST=404]="LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST",r[r.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED=456]="LIVE_STREAM_RESPONSE_NOT_AUTHORIZED",r[r.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE=457]="LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE",r[r.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN=429]="LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN",r[r.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH=452]="LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH",r[r.LIVE_STREAM_RESPONSE_NOT_SUPPORTED=453]="LIVE_STREAM_RESPONSE_NOT_SUPPORTED",r[r.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM=455]="LIVE_STREAM_RESPONSE_MAX_STREAM_NUM",r[r.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR=500]="LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR",r[r.LIVE_STREAM_RESPONSE_WORKER_LOST=501]="LIVE_STREAM_RESPONSE_WORKER_LOST",r[r.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT=502]="LIVE_STREAM_RESPONSE_RESOURCE_LIMIT",r[r.LIVE_STREAM_RESPONSE_WORKER_QUIT=503]="LIVE_STREAM_RESPONSE_WORKER_QUIT",r[r.ERROR_FAIL_SEND_MESSAGE=504]="ERROR_FAIL_SEND_MESSAGE",r[r.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE=30]="PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE",r[r.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT=31]="PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT",r[r.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH=32]="PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH",r[r.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN=33]="PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN",r}({});function Yie(r){if(!r.channelName)throw new De(ce.INVALID_PARAMS,"invalid channelName in info");if(typeof r.uid!="number")throw new De(ce.INVALID_PARAMS,"invalid uid in info, uid must be a number");return r.token&&Fs(r.token,"info.token",1,2047),vk(r.uid),gk(r.channelName),!0}let lo=function(r){return r[r.SetSdkProfile=0]="SetSdkProfile",r[r.SetSourceChannel=1]="SetSourceChannel",r[r.SetSourceUserId=2]="SetSourceUserId",r[r.SetDestChannel=3]="SetDestChannel",r[r.StartPacketTransfer=4]="StartPacketTransfer",r[r.StopPacketTransfer=5]="StopPacketTransfer",r[r.UpdateDestChannel=6]="UpdateDestChannel",r[r.Reconnect=7]="Reconnect",r[r.SetVideoProfile=8]="SetVideoProfile",r}({}),Cm=function(r){return r.NETWORK_DISCONNECTED="NETWORK_DISCONNECTED",r.NETWORK_CONNECTED="NETWORK_CONNECTED",r.PACKET_JOINED_SRC_CHANNEL="PACKET_JOINED_SRC_CHANNEL",r.PACKET_JOINED_DEST_CHANNEL="PACKET_JOINED_DEST_CHANNEL",r.PACKET_SENT_TO_DEST_CHANNEL="PACKET_SENT_TO_DEST_CHANNEL",r.PACKET_RECEIVED_VIDEO_FROM_SRC="PACKET_RECEIVED_VIDEO_FROM_SRC",r.PACKET_RECEIVED_AUDIO_FROM_SRC="PACKET_RECEIVED_AUDIO_FROM_SRC",r.PACKET_UPDATE_DEST_CHANNEL="PACKET_UPDATE_DEST_CHANNEL",r.PACKET_UPDATE_DEST_CHANNEL_REFUSED="PACKET_UPDATE_DEST_CHANNEL_REFUSED",r.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",r}({}),ll=function(r){return r.RELAY_STATE_IDLE="RELAY_STATE_IDLE",r.RELAY_STATE_CONNECTING="RELAY_STATE_CONNECTING",r.RELAY_STATE_RUNNING="RELAY_STATE_RUNNING",r.RELAY_STATE_FAILURE="RELAY_STATE_FAILURE",r}({}),db=function(r){return r.RELAY_OK="RELAY_OK",r.SERVER_CONNECTION_LOST="SERVER_CONNECTION_LOST",r.SRC_TOKEN_EXPIRED="SRC_TOKEN_EXPIRED",r.DEST_TOKEN_EXPIRED="DEST_TOKEN_EXPIRED",r}({}),mi=function(r){return r.High="high",r.Low="low",r.Audio="audio",r.Screen="screen",r.ScreenLow="screen_low",r}({}),Ir=function(r){return r.DISCONNECT="disconnect",r.CONNECTION_STATE_CHANGE="connection-state-change",r.NETWORK_QUALITY="network-quality",r.STREAM_TYPE_CHANGE="stream-type-change",r.IS_P2P_DISCONNECTED="is-p2p-dis",r.DISCONNECT_P2P="dis-p2p",r.REQUEST_NEW_GATEWAY_LIST="req-gate-url",r.NEED_RENEW_SESSION="need-sid",r.REQUEST_P2P_CONNECTION_PARAMS="request-p2p-connection-params",r.JOIN_RESPONSE="join-response",r.REQUEST_DC_CONNECTION_PARAMS="request-dc-connection-params",r.RESET_CONNECTION_EVENTS="reset-connection-events",r.DATACHANNEL_PRECONNECT="datachannel_preconnect",r.DATACHANNEL_FAILBACK="datachannel_failback",r.RESET_SIGNAL="reset-signal",r}({}),zI=function(r){return r.P2P_DISCONNECTED="P2P_DISCONNECTED",r.A_ROUND_WS_FAILED="A_ROUND_WS_FAILED",r.TIMEOUT="TIMEOUT",r.UNKNOWN_REASON="UNKNOWN_REASON",r}({}),Es=function(r){return r[r.Nothing=0]="Nothing",r[r.Audio=1]="Audio",r[r.LwoVideo=2]="LwoVideo",r[r.Video=4]="Video",r[r.Data=8]="Data",r[r.DataStream0=256]="DataStream0",r[r.DataStream1=512]="DataStream1",r[r.DataStream2=1024]="DataStream2",r[r.DataStream3=2048]="DataStream3",r[r.DataStream4=4096]="DataStream4",r[r.DataStream5=8192]="DataStream5",r[r.DataStream6=16384]="DataStream6",r[r.DataStream7=32768]="DataStream7",r}({}),Xie=function(r){return r[r.websocket=0]="websocket",r[r.datachannel=1]="datachannel",r}({}),ai=function(r){return r.CHINA="CHINA",r.ASIA="ASIA",r.NORTH_AMERICA="NORTH_AMERICA",r.EUROPE="EUROPE",r.JAPAN="JAPAN",r.INDIA="INDIA",r.KOREA="KOREA",r.HKMC="HKMC",r.US="US",r.OCEANIA="OCEANIA",r.SOUTH_AMERICA="SOUTH_AMERICA",r.AFRICA="AFRICA",r.OVERSEA="OVERSEA",r.GLOBAL="GLOBAL",r.EXTENSIONS="EXTENSIONS",r}({}),Jie=[ai.AFRICA,ai.ASIA,ai.CHINA,ai.EUROPE,ai.GLOBAL,ai.INDIA,ai.JAPAN,ai.NORTH_AMERICA,ai.OCEANIA,ai.OVERSEA,ai.SOUTH_AMERICA],da=function(r){return r.CHINA="CN",r.ASIA="AS",r.NORTH_AMERICA="NA",r.EUROPE="EU",r.JAPAN="JP",r.INDIA="IN",r.KOREA="KR",r.HKMC="HK",r.US="US",r.OCEANIA="OC",r.SOUTH_AMERICA="SA",r.AFRICA="AF",r.OVERSEA="OVERSEA",r.GLOBAL="GLOBAL",r.EXTENSIONS="GLOBAL",r}({}),_k={CHINA:{},ASIA:{CODE:da.ASIA,WEBCS_DOMAIN:["ap-web-1-asia.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-asia.agora.io"],PROXY_CS:["proxy-ap-web-asia.agora.io"],CDS_AP:["cds-ap-web-asia.agora.io","cds-ap-web-asia2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-asia.agora.io","sua-ap-web-asia2.agora.io"],UAP_AP:["uap-ap-web-asia.agora.io","uap-ap-web-asia2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-asia.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-asia.agora.io"],LOG_UPLOAD_SERVER:["logservice-asia.agora.io"],PROXY_SERVER_TYPE3:["southeast-asia.webrtc-cloud-proxy.sd-rtn.com"]},NORTH_AMERICA:{CODE:da.NORTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-north-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-north-america.agora.io"],PROXY_CS:["proxy-ap-web-america.agora.io"],CDS_AP:["cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],UAP_AP:["uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-north-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-north-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-north-america.agora.io"],PROXY_SERVER_TYPE3:["east-usa.webrtc-cloud-proxy.sd-rtn.com"]},EUROPE:{CODE:da.EUROPE,WEBCS_DOMAIN:["ap-web-1-europe.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-europe.agora.io"],PROXY_CS:["proxy-ap-web-europe.agora.io"],CDS_AP:["cds-ap-web-europe.agora.io","cds-ap-web-europe2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-europe.agora.io","sua-ap-web-europe.agora.io"],UAP_AP:["uap-ap-web-europe.agora.io","uap-ap-web-europe2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-europe.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-europe.agora.io"],LOG_UPLOAD_SERVER:["logservice-europe.agora.io"],PROXY_SERVER_TYPE3:["europe.webrtc-cloud-proxy.sd-rtn.com"]},JAPAN:{CODE:da.JAPAN,WEBCS_DOMAIN:["ap-web-1-japan.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-japan.agora.io"],PROXY_CS:["proxy-ap-web-japan.agora.io"],CDS_AP:["cds-ap-web-japan.agora.io","cds-ap-web-japan2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-japan.agora.io","sua-ap-web-japan2.agora.io"],UAP_AP:["uap-ap-web-japan.agora.io","uap-ap-web-japan2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-japan.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-japan.agora.io"],LOG_UPLOAD_SERVER:["logservice-japan.agora.io"],PROXY_SERVER_TYPE3:["japan.webrtc-cloud-proxy.sd-rtn.com"]},INDIA:{CODE:da.INDIA,WEBCS_DOMAIN:["ap-web-1-india.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-india.agora.io"],PROXY_CS:["proxy-ap-web-india.agora.io"],CDS_AP:["cds-ap-web-india.agora.io","cds-ap-web-india2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-india.agora.io","sua-ap-web-india2.agora.io"],UAP_AP:["uap-ap-web-india.agora.io","uap-ap-web-india2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-india.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-india.agora.io"],LOG_UPLOAD_SERVER:["logservice-india.agora.io"],PROXY_SERVER_TYPE3:["india.webrtc-cloud-proxy.sd-rtn.com"]},KOREA:{CODE:da.KOREA,WEBCS_DOMAIN:["ap-web-1-korea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-korea.agora.io"],PROXY_CS:["proxy-ap-web-korea.agora.io"],CDS_AP:["cds-ap-web-korea.agora.io","cds-ap-web-korea2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-korea.agora.io","sua-ap-web-korea2.agora.io"],UAP_AP:["uap-ap-web-korea.agora.io","uap-ap-web-korea2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-korea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-korea.agora.io"],LOG_UPLOAD_SERVER:["logservice-korea.agora.io"],PROXY_SERVER_TYPE3:["korea.webrtc-cloud-proxy.sd-rtn.com"]},HKMC:{CODE:da.HKMC,WEBCS_DOMAIN:["ap-web-1-hkmc.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-hkmc.agora.io"],PROXY_CS:["proxy-ap-web-hkmc.agora.io"],CDS_AP:["cds-ap-web-hkmc.agora.io","cds-ap-web-hkmc2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-hkmc.agora.io","sua-ap-web-hkmc2.agora.io"],UAP_AP:["uap-ap-web-hkmc.agora.io","uap-ap-web-hkmc2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-hkmc.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-hkmc.agora.io"],LOG_UPLOAD_SERVER:["logservice-hkmc.agora.io"],PROXY_SERVER_TYPE3:["hkmc.webrtc-cloud-proxy.sd-rtn.com"]},US:{CODE:da.US,WEBCS_DOMAIN:["ap-web-1-us.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-us.agora.io"],PROXY_CS:["proxy-ap-web-us.agora.io"],CDS_AP:["cds-ap-web-us.agora.io","cds-ap-web-us2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-us.agora.io","sua-ap-web-us2.agora.io"],UAP_AP:["uap-ap-web-us.agora.io","uap-ap-web-us2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-us.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-us.agora.io"],LOG_UPLOAD_SERVER:["logservice-us.agora.io"],PROXY_SERVER_TYPE3:["us.webrtc-cloud-proxy.sd-rtn.com"]},OVERSEA:{CODE:da.OVERSEA,WEBCS_DOMAIN:["ap-web-1-oversea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oversea.agora.io"],PROXY_CS:["proxy-ap-web-oversea.agora.io"],CDS_AP:["cds-ap-web-oversea.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oversea.agora.io"],UAP_AP:["uap-ap-web-oversea.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oversea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oversea.agora.io"],LOG_UPLOAD_SERVER:["logservice-oversea.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.agora.io"]},GLOBAL:{CODE:da.GLOBAL,WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-ap-web-3.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-ap-web-3.agora.io"],UAP_AP:["uap-ap-web-1.agora.io","uap-ap-web-3.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2.agora.io"],LOG_UPLOAD_SERVER:["logservice.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com"]},OCEANIA:{CODE:da.OCEANIA,WEBCS_DOMAIN:["ap-web-1-oceania.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oceania.agora.io"],PROXY_CS:["proxy-ap-web-oceania.agora.io"],CDS_AP:["cds-ap-web-oceania.agora.io","cds-ap-web-oceania2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oceania.agora.io","sua-ap-web-oceania2.agora.io"],UAP_AP:["uap-ap-web-oceania.agora.io","uap-ap-web-oceania2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oceania.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oceania.agora.io"],LOG_UPLOAD_SERVER:["logservice-oceania.agora.io"],PROXY_SERVER_TYPE3:["oceania.webrtc-cloud-proxy.sd-rtn.com"]},SOUTH_AMERICA:{CODE:da.SOUTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-south-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-south-america.agora.io"],PROXY_CS:["proxy-ap-web-south-america.agora.io"],CDS_AP:["cds-ap-web-south-america.agora.io","cds-ap-web-south-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-south-america.agora.io","sua-ap-web-south-america2.agora.io"],UAP_AP:["uap-ap-web-south-america.agora.io","uap-ap-web-south-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-south-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-south-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-america.agora.io"],PROXY_SERVER_TYPE3:["south-america.webrtc-cloud-proxy.sd-rtn.com"]},AFRICA:{CODE:da.AFRICA,WEBCS_DOMAIN:["ap-web-1-africa.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-africa.agora.io"],PROXY_CS:["proxy-ap-web-africa.agora.io"],CDS_AP:["cds-ap-web-africa.agora.io","cds-ap-web-africa2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-africa.agora.io","sua-ap-web-africa2.agora.io"],UAP_AP:["uap-ap-web-africa.agora.io","uap-ap-web-africa2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-africa.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-africa.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-africa.agora.io"],PROXY_SERVER_TYPE3:["africa.webrtc-cloud-proxy.sd-rtn.com"]},EXTENSIONS:{}};bG&&(_k.CHINA={CODE:da.CHINA,WEBCS_DOMAIN:["webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["proxy-web.ap.sd-rtn.com"],CDS_AP:["cds-web-2.ap.sd-rtn.com","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-web-2.ap.sd-rtn.com","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-web-2.ap.sd-rtn.com","uap-web-4.ap.sd-rtn.com"],EVENT_REPORT_DOMAIN:["web-3.statscollector.sd-rtn.com"],EVENT_REPORT_BACKUP_DOMAIN:["web-4.statscollector.sd-rtn.com"],LOG_UPLOAD_SERVER:["logservice-china.agora.io"],PROXY_SERVER_TYPE3:["east-cn.webrtc-cloud-proxy.sd-rtn.com"]});let kG=function(r){return r.UPDATE_BITRATE_LIMIT="update_bitrate_limit",r}({});class Qie extends tr{constructor(a,o){super(),X(this,"onICEConnectionStateChange",void 0),X(this,"onConnectionStateChange",void 0),X(this,"onDTLSTransportStateChange",void 0),X(this,"onDTLSTransportError",void 0),X(this,"onICETransportStateChange",void 0),X(this,"onFirstAudioReceived",void 0),X(this,"onFirstVideoReceived",void 0),X(this,"onFirstAudioDecoded",void 0),X(this,"onFirstVideoDecoded",void 0),X(this,"onFirstVideoDecodedTimeout",void 0),X(this,"onSelectedLocalCandidateChanged",void 0),X(this,"onSelectedRemoteCandidateChanged",void 0),X(this,"getLocalVideoStats",void 0)}}class Ek extends Qie{constructor(a,o){super(a,o),X(this,"establishPromise",void 0)}}let Wt=function(r){return r.VIDEO="video",r.AUDIO="audio",r}({}),ja=function(r){return r[r.UDP=0]="UDP",r[r.TCP=1]="TCP",r[r.RELAY=2]="RELAY",r}({}),Tm=function(r){return r[r.FIRST_CONNECTION=0]="FIRST_CONNECTION",r[r.TCP_RESTART=1]="TCP_RESTART",r[r.RELAY_RESTART=2]="RELAY_RESTART",r[r.OLD_FIRST_CONNECTION=10]="OLD_FIRST_CONNECTION",r[r.OLD_RESTART=11]="OLD_RESTART",r[r.DISCONNECTED_OR_FAILED=20]="DISCONNECTED_OR_FAILED",r}({}),ht=function(r){return r.LocalVideoTrack="videoTrack",r.LocalAudioTrack="audioTrack",r.LocalVideoLowTrack="videoLowTrack",r}({}),vi=function(r){return r.New="new",r.Connected="connected",r.Reconnecting="reconnecting",r.Disconnected="disconnected",r}({}),pn=function(r){return r.StateChange="stateChange",r.IceConnectionStateChange="iceConnectionStateChange",r.RequestMuteLocal="requestMuteLocal",r.RequestUnmuteLocal="requestUnmuteLocal",r.RequestRePublish="requestRePublish",r.RequestRePublishDataChannel="requestRePublishDataChannel",r.RequestReSubscribe="requestReSubscribe",r.RequestUploadStats="requestUploadStats",r.RequestUpload="requestUpload",r.MediaReconnectStart="MediaReconnectStart",r.MediaReconnectEnd="MediaReconnectEnd",r.NeedSignalRTT="NeedSignalRTT",r.RequestRestartICE="RequestRestartIce",r.PeerConnectionStateChange="PeerConnectionStateChange",r.RequestReconnect="RequestReconnect",r.RequestReconnectPC="RequestReconnectPC",r.RequestUnpublishForReconnectPC="RequestUnpublishForReconnectPC",r.P2PLost="P2PLost",r.UpdateVideoEncoder="UpdateVideoEncoder",r.ConnectionTypeChange="ConnectionTypeChange",r.RequestLowStreamParameter="RequestLowStreamParameter",r.QueryClientConnectionState="QueryClientConnectionState",r.LocalCandidate="LocalCandidate",r.RequestP2PMuteLocal="requestP2PMuteLocal",r.RequestP2PUnPublish="RequestP2PUnPublish",r.RequestP2PUnmuteRemote="RequestP2PUnmuteRemote",r.RequestP2PMuteRemote="RequestP2PMuteRemote",r.RequestP2PRestartICE="RequestP2PRestartICE",r}({}),Su=function(r){return r.CONNECTING="CONNECTING",r.RECONNECTING="RECONNECTING",r.CONNECTED="CONNECTED",r.CLOSED="CLOSED",r}({}),bu=function(r){return r[r.CONNECT_AP=0]="CONNECT_AP",r[r.AP_CONNECTED=1]="AP_CONNECTED",r[r.CONNECT_WORKER_MANAGER=2]="CONNECT_WORKER_MANAGER",r[r.WORKER_MANAGER_CONNECTED=3]="WORKER_MANAGER_CONNECTED",r[r.GET_WORKER_MANAGER_RESPONSE=4]="GET_WORKER_MANAGER_RESPONSE",r[r.CONNECT_WORKER=5]="CONNECT_WORKER",r[r.WORKER_CONNECTED=6]="WORKER_CONNECTED",r[r.CLOSED=7]="CLOSED",r}({}),Os=function(r){return r.CONNECTION_STATE_CHANGE="connection-state-change",r.STATE_CHANGE="state-change",r.INSPECT_RESULT="inspect-result",r.CLIENT_LOCAL_VIDEO_TRACK="client-local-video-track",r.REQUEST_NEW_WORKER_URL="request-new-worker-url",r}({}),G0=function(r){return r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.MULTI_IP="MULTI_IP",r.TIMEOUT="TIMEOUT",r.OFFLINE="OFFLINE",r.LEAVE="LEAVE",r.P2P_FAILED="P2P_FAILED",r.FALLBACK="FALLBACK",r}({}),Xr=function(r){return r.CONNECTED="transmitter:connected",r.RECONNECTING="transmitter:reconnecting",r.WILL_RECONNECT="transmitter:will_reconnect",r.CLOSED="transmitter:closed",r.FAILED="transmitter:failed",r.ON_MESSAGE="transmitter:on_message",r.REQUEST_NEW_URLS="transmitter:request_new_urls",r.RECONNECT_WAITTING_FINISH="transmitter:reconnect_waitting_finish",r.RECONNECT_CREATE_CONNECTION="transmitter:reconnect_create_connection",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="transmitter:on_token_privilege_did_expire",r.TO_CONNECT_DATACHANNEL="transmitter:to_connect_datachannel",r.FAILBACK="transmitter:failback",r}({}),Gf=function(r){return r.CAMERA_CHANGED="camera-changed",r.MICROPHONE_CHANGED="microphone-changed",r.PLAYBACK_DEVICE_CHANGED="playback-device-changed",r.AUDIO_AUTOPLAY_FAILED="audio-autoplay-failed",r.AUTOPLAY_FAILED="autoplay-failed",r.AUDIO_CONTEXT_STATE_CHANGED="audio-context-state-changed",r.SECURITY_POLICY_VIOLATION="security-policy-violation",r}({}),gd=function(r){return r.CONNECTING="CONNECTING",r.RECONNECTING="RECONNECTING",r.CONNECTED="CONNECTED",r.CLOSED="CLOSED",r}({}),Ph=function(r){return r.CONNECTION_STATE_CHANGE="connection-state-change",r.STATE_CHANGE="state-change",r.INSPECT_RESULT="inspect-result",r.CLIENT_LOCAL_VIDEO_TRACK="client-local-video-track",r.REQUEST_NEW_WORKER_URL="request-new-worker-url",r}({}),ub=function(r){return r[r.CONNECT_AP=0]="CONNECT_AP",r[r.AP_CONNECTED=1]="AP_CONNECTED",r[r.CONNECT_WORKER_MANAGER=2]="CONNECT_WORKER_MANAGER",r[r.WORKER_MANAGER_CONNECTED=3]="WORKER_MANAGER_CONNECTED",r[r.GET_WORKER_MANAGER_RESPONSE=4]="GET_WORKER_MANAGER_RESPONSE",r[r.CONNECT_WORKER=5]="CONNECT_WORKER",r[r.WORKER_CONNECTED=6]="WORKER_CONNECTED",r[r.CLOSED=7]="CLOSED",r}({}),Nr=function(r){return r.CALL="call",r.CANDIDATE="candidate",r.PUBLISH="publish",r.UNPUBLISH="unpublish",r.CONTROL="control",r.RESTART_ICE="restart_ice",r.ACK="ack",r.RESPONSE="response",r.JOIN="join",r.CHECK="check",r}({}),hb=function(r){return r.ABORT="abort",r}({}),W0=function(r){return r.MUTE_LOCAL_AUDIO="mute_local_audio",r.MUTE_LOCAL_VIDEO="mute_local_video",r.UNMUTE_LOCAL_AUDIO="unmute_local_audio",r.UNMUTE_LOCAL_VIDEO="unmute_local_video",r}({}),BAe=function(r){return r.P2P_TOKEN_TIMEOUT="p2p_token_timeout",r.P2P_TOKEN_CHANGED="p2p_token_changed",r}({}),VAe={[mk.ACCESS_POINT]:{[ao.NO_FLAG_SET]:{desc:"flag is zero",retry:!1},[ao.FLAG_SET_BUT_EMPTY]:{desc:"flag is empty",retry:!1},[ao.INVALID_FALG_SET]:{desc:"invalid flag",retry:!1},[ao.FLAG_SET_BUT_NO_RE]:{desc:"flag set unilbs but no request",retry:!1},[ao.INVALID_SERVICE_ID]:{desc:"invalid service id",retry:!1},[ao.NO_SERVICE_AVAILABLE]:{desc:"no service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_P2P]:{desc:"no unilbs p2p service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_VOICE]:{desc:"no unilbs voice service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_WEBRTC]:{desc:"no unilbs webrtc service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_CDS]:{desc:"no cds service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_CDN]:{desc:"no cdn dispatcher service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_TDS]:{desc:"no tds service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_REPORT]:{desc:"no unilbs report service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_APP_CENTER]:{desc:"no app center service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_ENV0]:{desc:"no unilbs sig env0 service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_VOET]:{desc:"no unilbs voet service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_STRING_UID]:{desc:"no string uid service available",retry:!0},[ao.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS]:{desc:"no webrtc unilbs service available",retry:!0}},[mk.UNILBS]:{[wu.INVALID_VENDOR_KEY]:{desc:"invalid vendor key, can not find appid",retry:!1},[wu.INVALID_CHANNEL_NAME]:{desc:"invalid channel name",retry:!1},[wu.INTERNAL_ERROR]:{desc:"unilbs internal error",retry:!1},[wu.NO_AUTHORIZED]:{desc:"invalid token, authorized failed",retry:!1},[wu.DYNAMIC_KEY_TIMEOUT]:{desc:"dynamic key or token timeout",retry:!1},[wu.NO_ACTIVE_STATUS]:{desc:"no active status",retry:!1},[wu.DYNAMIC_KEY_EXPIRED]:{desc:"dynamic key expired",retry:!1},[wu.STATIC_USE_DYNAMIC_KEY]:{desc:"static use dynamic key",retry:!1},[wu.DYNAMIC_USE_STATIC_KEY]:{desc:"dynamic use static key",retry:!1},[wu.USER_OVERLOAD]:{desc:"amount of users over load",retry:!1},[wu.FORBIDDEN_REGION]:{desc:"the request is forbidden in this area",retry:!1},[wu.CANNOT_MEET_AREA_DEMAND]:{desc:"unable to allocate services in this area",retry:!1}},[mk.STRING_UID_ALLOCATOR]:{[PG.IIIEGAL_APPID]:{desc:"invalid appid",retry:!1},[PG.IIIEGAL_UID]:{desc:"invalid string uid",retry:!1},[PG.INTERNAL_ERROR]:{desc:"string uid allocator internal error",retry:!0}}};function fb(r){let a=VAe[Math.floor(r/1e4)];if(!a)return{desc:"unknown error",retry:!1};let o=a[r%1e4];if(!o){if(Math.floor(r/1e4)===mk.ACCESS_POINT){let c=r%1e4;if(c.toString()[0]==="1")return{desc:r.toString(),retry:!1};if(c.toString()[0]==="2")return{desc:r.toString(),retry:!0}}return{desc:"unknown error",retry:!1}}return o}let zAe={[ln.K_TIMESTAMP_EXPIRED]:{desc:"K_TIMESTAMP_EXPIRED",action:"failed"},[ln.K_CHANNEL_PERMISSION_INVALID]:{desc:"K_CHANNEL_PERMISSION_INVALID",action:"failed"},[ln.K_CERTIFICATE_INVALID]:{desc:"K_CERTIFICATE_INVALID",action:"failed"},[ln.K_CHANNEL_NAME_EMPTY]:{desc:"K_CHANNEL_NAME_EMPTY",action:"failed"},[ln.K_CHANNEL_NOT_FOUND]:{desc:"K_CHANNEL_NOT_FOUND",action:"failed"},[ln.K_TICKET_INVALID]:{desc:"K_TICKET_INVALID",action:"failed"},[ln.K_CHANNEL_CONFLICTED]:{desc:"K_CHANNEL_CONFLICTED",action:"failed"},[ln.K_SERVICE_NOT_READY]:{desc:"K_SERVICE_NOT_READY",action:"tryNext"},[ln.K_SERVICE_TOO_HEAVY]:{desc:"K_SERVICE_TOO_HEAVY",action:"tryNext"},[ln.K_UID_BANNED]:{desc:"K_UID_BANNED",action:"failed"},[ln.K_IP_BANNED]:{desc:"K_IP_BANNED",action:"failed"},[ln.K_AUTO_REBALANCE]:{desc:"k_AUTO_REBALANCE",action:"recover"},[ln.ERR_INVALID_VENDOR_KEY]:{desc:"ERR_INVALID_VENDOR_KEY",action:"failed"},[ln.ERR_INVALID_CHANNEL_NAME]:{desc:"ERR_INVALID_CHANNEL_NAME",action:"failed"},[ln.WARN_NO_AVAILABLE_CHANNEL]:{desc:"WARN_NO_AVAILABLE_CHANNEL",action:"failed"},[ln.WARN_LOOKUP_CHANNEL_TIMEOUT]:{desc:"WARN_LOOKUP_CHANNEL_TIMEOUT",action:"tryNext"},[ln.WARN_LOOKUP_CHANNEL_REJECTED]:{desc:"WARN_LOOKUP_CHANNEL_REJECTED",action:"failed"},[ln.WARN_OPEN_CHANNEL_TIMEOUT]:{desc:"WARN_OPEN_CHANNEL_TIMEOUT",action:"tryNext"},[ln.WARN_OPEN_CHANNEL_REJECTED]:{desc:"WARN_OPEN_CHANNEL_REJECTED",action:"failed"},[ln.WARN_REQUEST_DEFERRED]:{desc:"WARN_REQUEST_DEFERRED",action:"failed"},[ln.ERR_DYNAMIC_KEY_TIMEOUT]:{desc:"ERR_DYNAMIC_KEY_TIMEOUT",action:"failed"},[ln.ERR_NO_AUTHORIZED]:{desc:"ERR_NO_AUTHORIZED",action:"failed"},[ln.ERR_VOM_SERVICE_UNAVAILABLE]:{desc:"ERR_VOM_SERVICE_UNAVAILABLE",action:"tryNext"},[ln.ERR_NO_CHANNEL_AVAILABLE_CODE]:{desc:"ERR_NO_CHANNEL_AVAILABLE_CODE",action:"failed"},[ln.ERR_MASTER_VOCS_UNAVAILABLE]:{desc:"ERR_MASTER_VOCS_UNAVAILABLE",action:"tryNext"},[ln.ERR_INTERNAL_ERROR]:{desc:"ERR_INTERNAL_ERROR",action:"tryNext"},[ln.ERR_NO_ACTIVE_STATUS]:{desc:"ERR_NO_ACTIVE_STATUS",action:"failed"},[ln.ERR_INVALID_UID]:{desc:"ERR_INVALID_UID",action:"failed"},[ln.ERR_DYNAMIC_KEY_EXPIRED]:{desc:"ERR_DYNAMIC_KEY_EXPIRED",action:"failed"},[ln.ERR_STATIC_USE_DYANMIC_KE]:{desc:"ERR_STATIC_USE_DYANMIC_KE",action:"failed"},[ln.ERR_DYNAMIC_USE_STATIC_KE]:{desc:"ERR_DYNAMIC_USE_STATIC_KE",action:"failed"},[ln.ERR_NO_VOCS_AVAILABLE]:{desc:"ERR_NO_VOCS_AVAILABLE",action:"tryNext"},[ln.ERR_NO_VOS_AVAILABLE]:{desc:"ERR_NO_VOS_AVAILABLE",action:"tryNext"},[ln.ERR_JOIN_CHANNEL_TIMEOUT]:{desc:"ERR_JOIN_CHANNEL_TIMEOUT",action:"tryNext"},[ln.ERR_JOIN_BY_MULTI_IP]:{desc:"ERR_JOIN_BY_MULTI_IP",action:"recover"},[ln.ERR_NOT_JOINED]:{desc:"ERR_NOT_JOINED",action:"failed"},[ln.ERR_REPEAT_JOIN_REQUEST]:{desc:"ERR_REPEAT_JOIN_REQUEST",action:"quit"},[ln.ERR_REPEAT_JOIN_CHANNEL]:{desc:"ERR_REPEAT_JOIN_CHANNEL",action:"quit"},[ln.ERR_INVALID_STRINGUID]:{desc:"ERR_INVALID_STRINGUID",action:"failed"},[ln.ERR_TOO_MANY_USERS]:{desc:"ERR_TOO_MANY_USERS",action:"tryNext"},[ln.ERR_SET_CLIENT_ROLE_TIMEOUT]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[ln.ERR_SET_CLIENT_ROLE_NO_PERMISSION]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[ln.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE]:{desc:"ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",action:"success"},[ln.ERR_PUBLISH_REQUEST_INVALID]:{desc:"ERR_PUBLISH_REQUEST_INVALID",action:"failed"},[ln.ERR_SUBSCRIBE_REQUEST_INVALID]:{desc:"ERR_SUBSCRIBE_REQUEST_INVALID",action:"failed"},[ln.ERR_NOT_SUPPORTED_MESSAGE]:{desc:"ERR_NOT_SUPPORTED_MESSAGE",action:"failed"},[ln.ERR_ILLEAGAL_PLUGIN]:{desc:"ERR_ILLEAGAL_PLUGIN",action:"failed"},[ln.ILLEGAL_CLIENT_ROLE_LEVEL]:{desc:"ILLEGAL_CLIENT_ROLE_LEVEL",action:"failed"},[ln.ERR_REJOIN_TOKEN_INVALID]:{desc:"ERR_REJOIN_TOKEN_INVALID",action:"failed"},[ln.ERR_REJOIN_USER_NOT_JOINED]:{desc:"ERR_REJOIN_NOT_JOINED",action:"failed"},[ln.ERR_INVALID_OPTIONAL_INFO]:{desc:"ERR_INVALID_OPTIONAL_INFO",action:"quit"},[ln.ERR_TEST_RECOVER]:{desc:"ERR_TEST_RECOVER",action:"recover"},[ln.ERR_TEST_TRYNEXT]:{desc:"ERR_TEST_TRYNEXT",action:"recover"},[ln.ERR_TEST_RETRY]:{desc:"ERR_TEST_RETRY",action:"recover"},[ln.ILLEGAL_AES_PASSWORD]:{desc:"ERR_TEST_RETRY",action:"failed"},[ln.ERR_TOO_MANY_BROADCASTERS]:{desc:"ERR_TOO_MANY_BROADCASTERS",action:"failed"},[ln.ERR_TOO_MANY_SUBSCRIBERS]:{desc:"ERR_TOO_MANY_SUBSCRIBERS",action:"failed"},[ln.ERR_LICENSE_ILLEGAL]:{desc:"ERR_LICENSE_ILLEGAL",action:"quit"},[ln.ERR_LICENSE_MISSING]:{desc:"ERR_LICENSE_MISSING",action:"quit"},[ln.ERR_LICENSE_EXPIRED]:{desc:"ERR_LICENSE_EXPIRED",action:"quit"},[ln.ERR_LICENSE_MINUTES_EXCEEDED]:{desc:"ERR_LICENSE_MINUTES_EXCEEDED",action:"quit"},[ln.ERR_LICENSE_PERIOD_INVALID]:{desc:"ERR_LICENSE_PERIOD_INVALID",action:"quit"},[ln.ERR_LICENSE_MULTIPLE_SDK_SERVICE]:{desc:"ERR_LICENSE_MULTIPLE_SDK_SERVICE",action:"quit"}};function h_(r){return zAe[r]||{desc:"UNKNOW_ERROR_".concat(r),action:"failed"}}function Zie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function MG(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Zie(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Zie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function ere(r){return r.every(a=>a.readyState===WebSocket.CLOSED||a.readyState===WebSocket.CLOSING)}function tre(r,a){if(typeof r=="string")return r;let{proxy:o,host:c,port:f}=r;if(a){let g=ve("JOIN_GATEWAY_FALLBACK_PORT")||443;return g===443?"wss://".concat(c,"/ws/?p=").concat(Number(f)+150):"wss://".concat(c,":").concat(g,"/ws/?p=").concat(Number(f)+150)}return o?"wss://".concat(o,"/ws/?h=").concat(c,"&p=").concat(f):"wss://".concat(c,":").concat(f)}let HAe=/wss:\/\/(.+)\/ws\/\?h=(.+)&p=([0-9]+)\/?/,GAe=/wss:\/\/(.+)\/ws\/\?p=([0-9]+)\/?/,WAe=/wss:\/\/(.+):([0-9]+)\/?/,$Ae=/wss:\/\/(.[^\/]+)\/?/,KAe=0;class qAe{constructor(a,o){X(this,"id",0),X(this,"store",void 0),X(this,"recordIndex",void 0),X(this,"websockets",[]),X(this,"try443PortDuration",2e3),X(this,"forceCloseWSDuration",5e3),X(this,"try443PortTimeout",null),X(this,"forceCloseTimeout",null),X(this,"isTry443PortFailed",!1),X(this,"isNormalPortFailed",!1),X(this,"useDoubleDomain",!1),X(this,"useProxy",!1),X(this,"startTime",Date.now()),this.id=++KAe,this.try443PortDuration=ve("JOIN_GATEWAY_TRY_443PORT_DURATION")||2e3,this.forceCloseWSDuration=a||5e3,this.store=o}closeAllWebsockets(){this.websockets.forEach(a=>{a.onopen=null,a.onclose=null,a.onmessage=null,a.close()}),this.websockets.length=0}clearTimeout(){this.forceCloseTimeout&&clearTimeout(this.forceCloseTimeout),this.try443PortTimeout&&clearTimeout(this.try443PortTimeout)}logger(){var a;let o=Date.now()-this.startTime;for(var c=arguments.length,f=new Array(c),g=0;g<c;g++)f[g]=arguments[g];z.debug("[choose-best-ws ".concat((a=this.store)===null||a===void 0?void 0:a.clientId," ").concat(this.id,"] ").concat(o,"ms:"),...f)}createWebSocket(a,o,c){this.logger("createWebSocket:",a,{isTry443Port:o,hasTimeoutDetection:c});let f=ve("GATEWAY_DOMAINS"),g=Date.now(),v=[],w=f.find(A=>{var L;return Tt(L=a.host).call(L,A)});w||(this.useDoubleDomain=!1);let T=[];if(this.useDoubleDomain)f.forEach(A=>{T.push(tre(MG(MG({},a),{},{host:a.host.replace(w,A)}),o))});else{let A=MG({},a);if(o&&w){let L=f.find(U=>U!==w);L&&(A.host=A.host.replace(w,L))}T.push(tre(A,o))}try{T.forEach(A=>{let L=new WebSocket(A);L.binaryType="arraybuffer",v.push(L),this.logger("ws is connecting:",L.url)})}catch(A){if(this.logger("ws create failed"),v.forEach(L=>L.close()),v.length=0,this.useDoubleDomain)return this.useDoubleDomain=!1,this.createWebSocket(a,o,c);if(!o&&Number(a.port)!==443)return this.createWebSocket(a,!0,c);throw new De(ce.WS_ERR,"init websocket failed! Error: ".concat(A.toString()))}let R=kI();return this.store&&this.store.recordJoinChannelService({urls:v.map(A=>A.url),service:"gateway"},this.recordIndex),v.forEach(A=>{A.onopen=()=>{this.logger("onopen: ws ".concat(A.url," open cost ").concat(Date.now()-g,"ms")),this.websockets.forEach(L=>{L!==A&&(L.onopen=null,L.onclose=null,L.onmessage=null,L.close(),this.logger("close backup websocket: ".concat(L.url)))}),this.websockets.length=0,R.resolve(A)},A.onclose=L=>{this.logger("onclose: ws ".concat(A.url," closed cost ").concat(Date.now()-g,"ms state: ").concat(A.readyState)),o?this.isTry443PortFailed=ere(v):this.isNormalPortFailed=ere(v),this.logger("443: ".concat(this.useProxy?"not try":this.isTry443PortFailed?"failed":"trying"," 47xx: ").concat(this.isNormalPortFailed?"failed":"trying")),(o&&this.isTry443PortFailed||!o&&(this.isTry443PortFailed||this.useProxy)&&this.isNormalPortFailed)&&(this.logger("onclose: all websocket is closed, ".concat(L.reason)),R.reject({code:L.code,reason:zI.A_ROUND_WS_FAILED}))},A.onmessage=L=>this.logger("".concat(A.url," onmessage: ").concat(L.data))}),this.websockets.push(...v),c||(()=>{let A=()=>{this.logger("5s timeout close un-opens, isWebsocket created: ",R.isResolved),this.websockets.forEach(L=>L.readyState!==WebSocket.OPEN&&L.close())};if(o||this.useProxy)return this.logger("add 5s timeout at ".concat(o?"try-443":"proxy"," condition")),this.forceCloseTimeout=window.setTimeout(A,this.forceCloseWSDuration);this.try443PortTimeout=window.setTimeout(()=>{if(this.logger("2s timeout, isWebsocket created: ",R.isResolved),R.isResolved)return A();ni().os===vs.MAC_OS&&Oi()&&A(),this.createWebSocket(a,!0,!0).then(L=>R.resolve(L)).catch(L=>{this.isNormalPortFailed&&R.reject(L),this.logger("try 443 port to create ws failed")}),this.forceCloseTimeout=window.setTimeout(A,this.forceCloseWSDuration)},this.try443PortDuration)})(),R.promise}chooseBestWebsocket(a,o,c,f){return this.useDoubleDomain=!!o,typeof a=="string"&&(a=function(g){let v,w,T;return[,v,w,T]=g.match(HAe)||[],v||([,w,T]=g.match(GAe)||[]),w&&T||([,w,T]=g.match(WAe)||[]),w&&T||([,w]=g.match($Ae)||[]),w||z.warning("un-destructible url: ",g),{proxy:v,host:w,port:T||"443"}}(a)),this.recordIndex=f,this.useProxy=!!a.proxy,c&&this.useProxy&&(z.warn("cannot use 443 only when use proxy"),c=!1),this.createWebSocket(a,!!c,!1).finally(()=>this.clearTimeout())}}function nre(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}class ire extends tr{get url(){return this.websocket&&this.websocket.url||null}get reconnectMode(){return this._reconnectMode}set reconnectMode(a){var o;Tt(o=["tryNext","recover"]).call(o,a)&&this.resetReconnectCount(a),this._reconnectMode=a}get state(){return this._state}set state(a){a!==this._state&&(this._state=a,this._state==="reconnecting"?this.emit(_n.RECONNECTING,this.reconnectReason):this._state==="connected"?this.emit(_n.CONNECTED):this._state==="closed"?this.emit(_n.CLOSED):this._state==="failed"&&this.emit(_n.FAILED))}resetReconnectCount(a){z.debug("websocket reset reconnect count, reason: "+a),this.reconnectCount=0}constructor(a,o){let c=arguments.length>2&&arguments[2]!==void 0&&arguments[2],f=arguments.length>3&&arguments[3]!==void 0&&arguments[3],g=arguments.length>4&&arguments[4]!==void 0&&arguments[4],v=arguments.length>5?arguments[5]:void 0;super(),X(this,"connectionID",0),X(this,"currentURLIndex",0),X(this,"urls",[]),X(this,"_reconnectMode","tryNext"),X(this,"reconnectReason",void 0),X(this,"_initMutex",new As("websocket")),X(this,"name",void 0),X(this,"_state","closed"),X(this,"reconnectInterrupter",void 0),X(this,"websocket",void 0),X(this,"retryConfig",void 0),X(this,"reconnectCount",0),X(this,"forceCloseTimeout",5e3),X(this,"onlineReconnectListener",void 0),X(this,"useCompress",void 0),X(this,"tryDoubleDomain",!1),X(this,"use443PortOnly",!1),X(this,"wsInflateLength",0),X(this,"wsDeflateLength",0),X(this,"closeEstablishingWs",()=>{}),X(this,"store",void 0),X(this,"joinGatewayRecordIndex",void 0),this.store=v,this.name=a,this.retryConfig=function(L){for(var U=1;U<arguments.length;U++){var F=arguments[U]!=null?arguments[U]:{};U%2?nre(Object(F),!0).forEach(function(Z){X(L,Z,F[Z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(F)):nre(Object(F)).forEach(function(Z){Object.defineProperty(L,Z,Object.getOwnPropertyDescriptor(F,Z))})}return L}({},o),this.useCompress=c,this.tryDoubleDomain=f,this.use443PortOnly=g;let{timeout:w,timeoutFactor:T}=o,R=Math.max(300,Math.floor(3*w/5)),A=Math.max(1.2,Math.floor(8*T)/10);so.ONLINE&&(this.retryConfig.timeout=R,this.retryConfig.timeoutFactor=A),yr.on(s_.NETWORK_STATE_CHANGE,(L,U)=>{L!==U&&(this.resetReconnectCount("network state change: ".concat(U," -> ").concat(L)),L===so.ONLINE?(this.retryConfig.timeout=R,this.retryConfig.timeoutFactor=A):(this.retryConfig.timeout=w,this.retryConfig.timeoutFactor=T))})}getConnection(){return this.websocket||void 0}async init(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3,c=await this._initMutex.lock();this.forceCloseTimeout=o,this.urls=a,this.state="connecting";try{let f=kI(),g=this.urls[this.currentURLIndex];this.createWebSocketConnection(g).then(f.resolve).catch(f.reject),this.once(_n.CLOSED,()=>{f.reject(new Ke(ce.WS_DISCONNECT))}),this.once(_n.CONNECTED,f.resolve),await f.promise}catch{}finally{c()}}close(a,o){if(this.currentURLIndex=0,this.resetReconnectCount("close"),this.reconnectInterrupter&&this.reconnectInterrupter(),this.websocket){this.websocket.onclose=null,this.websocket.onopen=null,this.websocket.onmessage=null;let c=this.websocket;o?setTimeout(()=>c.close(),500):c.close(),this.websocket=void 0}this.state=a?"failed":"closed",this.closeEstablishingWs&&this.closeEstablishingWs()}reconnect(a,o){if(!this.websocket)return void z.warning("[".concat(this.name,"] can not reconnect, no websocket"));a!==void 0&&(this.reconnectMode=a),z.debug("[".concat(this.name,"] reconnect is triggered initiative")),typeof this.joinGatewayRecordIndex=="number"&&this.store&&this.store.recordJoinChannelService({status:"error",errors:[new Error(o)]},this.joinGatewayRecordIndex);let c=this.websocket.onclose;this.websocket.onclose=null,this.websocket.close(),c&&c.bind(this.websocket)({code:9999,reason:o})}sendMessage(a){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new Ke(ce.WS_ABORT,"websocket is not ready");try{o||(a=JSON.stringify(a)),this.websocket.send(a)}catch(c){throw new Ke(ce.WS_ERR,"send websocket message error"+c.toString())}}setWsInflateData(a){this.wsDeflateLength=this.wsDeflateLength+a.originLength,this.wsInflateLength=this.wsInflateLength+a.compressedLength}getWsInflateData(){let a=this.wsInflateLength,o=this.wsDeflateLength;return this.clearWsInflateData(),{wsInflateLength:a,wsDeflateLength:o}}clearWsInflateData(){this.wsInflateLength=0,this.wsDeflateLength=0}async createWebSocketConnection(a){var o;let c=kI();this.connectionID+=1,this.joinGatewayRecordIndex=void 0;let f=A=>{var L;(L=this.store)===null||L===void 0||L.signalChannelOpen(),z.debug("[".concat(this.name,"] websocket opened:"),A),this.reconnectMode="retry",this.state="connected",this.resetReconnectCount("opened"),c.resolve()},g=async A=>{var L;if(z.debug("[".concat(this.name,"] websocket close ").concat((L=this.websocket)===null||L===void 0?void 0:L.url,", code: ").concat(A.code,", reason: ").concat(A.reason,", current mode: ").concat(this.reconnectMode)),this.reconnectCount>=this.retryConfig.maxRetryCount)c.reject(new Ke(ce.WS_DISCONNECT,"websocket close: ".concat(A.code))),this.close();else{this.state==="connected"&&(this.reconnectReason=A.reason,this.state="reconnecting");let U=Bl(this,_n.WILL_RECONNECT,this.reconnectMode,A.reason)||this.reconnectMode,F=await this.reconnectWithAction(U);if(this.state==="closed")return void z.debug("[".concat(this.connectionID,"] ws is closed, no need to reconnect"));if(!F)return c.reject(new Ke(ce.WS_DISCONNECT,"websocket reconnect failed: ".concat(A.code))),this.close(!0);c.resolve()}},v=A=>{this.emit(_n.ON_MESSAGE,A)},w=A=>{z.warn("[".concat(this.connectionID,"] ws open error ").concat(A))};this.websocket&&(this.websocket.onclose=null,this.websocket.close()),ve("GATEWAY_WSS_ADDRESS")&&this.name.startsWith("gateway")&&(a=ve("GATEWAY_WSS_ADDRESS")),z.debug("[".concat(this.name,"] start connect, url:"),a);let T=(o=this.store)===null||o===void 0?void 0:o.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"gateway"});try{var R;let A=await this.chooseBestWebsocketConnection(a);this.websocket=A,f&&f(this.websocket.url),this.websocket.onclose=g,this.websocket.onmessage=v,this.websocket.onerror=w,(R=this.store)===null||R===void 0||R.recordJoinChannelService({endTs:Date.now(),status:"success"},T),this.joinGatewayRecordIndex=T}catch(A){let L=this.state==="closed",U=A instanceof Ke,F=U&&A.code===ce.WS_ABORT,Z=U&&A.code===ce.WS_ERR,W=U?A.message:A&&(A.reason||A.toString());z.warning("[choose-best-ws] chooseBestWebsocket error: ".concat(W)),this.store&&this.store.recordJoinChannelService({endTs:Date.now(),status:F?"aborted":"error",errors:[A]},T),L||Z?(c.reject(L?new Ke(ce.WS_DISCONNECT,"websocket is closed: ".concat(W)):new Ke(ce.WS_ERR,"init websocket failed: ".concat(W))),Z&&z.error("[".concat(this.name,"] init websocket failed: ").concat(W))):g&&g(A)}return c.promise}async reconnectWithAction(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(this.reconnectCount>=this.retryConfig.maxRetryCount||this.urls.length===0||this.state==="closed")return!1;z.warning("[choose-best-ws] action: =>",a),this.onlineReconnectListener||yr.isOnline||!yr.onlineWaiter||(this.onlineReconnectListener=yr.onlineWaiter.then(()=>{this.onlineReconnectListener=void 0}));let c=!0;if(this.reconnectInterrupter=()=>c=!1,o){let v=uk(this.reconnectCount,this.retryConfig);z.debug("[".concat(this.name,"] wait ").concat(v,"ms to reconnect websocket, mode: ").concat(a)),await Ct.race([_s(v),this.onlineReconnectListener||new Ct(()=>{})])}if(this._state==="closed"||!c)return!1;this.reconnectCount+=1;let f=async(v,w)=>{this.emit(_n.RECONNECT_CREATE_CONNECTION,w),await this.createWebSocketConnection(v)};try{if(a==="retry")this.emit(_n.RECONNECT_WAITTING_FINISH,a),await f(this.urls[this.currentURLIndex],a);else if(a==="tryNext"){if(this.currentURLIndex+=1,this.currentURLIndex>=this.urls.length)return this.reconnectWithAction("recover",!1);z.debug("[".concat(this.name,"] websocket url length: ").concat(this.urls.length," current index: ").concat(this.currentURLIndex)),this.emit(_n.RECONNECT_WAITTING_FINISH,a),await f(this.urls[this.currentURLIndex],a)}else a==="recover"&&(z.debug("[".concat(this.name,"] request new urls")),this.resetReconnectCount("recover mode"),this.emit(_n.RECONNECT_WAITTING_FINISH,a),this.urls=await Yr(this,_n.REQUEST_NEW_URLS),this.currentURLIndex=0,await f(this.urls[this.currentURLIndex],a))}catch(v){var g;z.error("[".concat(this.name,"] reconnect failed ").concat(v&&v.toString()));let w=v==null||(g=v.data)===null||g===void 0?void 0:g.desc;return Array.isArray(w)&&Tt(w).call(w,"dynamic key expired")?(this.emit(_n.ON_TOKEN_PRIVILEGE_DID_EXPIRE),!1):this.reconnectWithAction(a,o)}return!0}}class HI extends ire{constructor(a,o){super(a,o,arguments.length>2&&arguments[2]!==void 0&&arguments[2],arguments.length>3&&arguments[3]!==void 0&&arguments[3],arguments.length>4&&arguments[4]!==void 0&&arguments[4],arguments.length>5?arguments[5]:void 0)}async chooseBestWebsocketConnection(a,o){let c=kI(),f=function(v,w){return new qAe(v,w)}(this.forceCloseTimeout,this.store);this.closeEstablishingWs=()=>{z.debug("[choose-best-ws] close establishing websockets"),f.closeAllWebsockets(),c.reject(new Ke(ce.WS_ABORT,"choose best websocket aborted"))};let g=ve("GATEWAY_DOMAINS");return z.debug("[choose-best-ws] currentDomain: ",a,", domains: ",g,"total: ".concat(this.urls.length),"current: ".concat(this.currentURLIndex+1)),f.chooseBestWebsocket(a,this.tryDoubleDomain,this.use443PortOnly,o).then(c.resolve).catch(c.reject),c.promise.finally(()=>{this.closeEstablishingWs=void 0})}}class GI extends ire{constructor(a,o){super(a,o,arguments.length>2&&arguments[2]!==void 0&&arguments[2],arguments.length>3&&arguments[3]!==void 0&&arguments[3],arguments.length>4&&arguments[4]!==void 0&&arguments[4],arguments.length>5?arguments[5]:void 0)}async chooseBestWebsocketConnection(a,o){return new Ct((c,f)=>{let g=!1,v=[];this.closeEstablishingWs=()=>{z.debug("[choose-best-ws] close establishing websockets"),v.forEach(Z=>{Z.onclose=null,Z.onopen=null,Z.onmessage=null,Z.close()}),f(new Ke(ce.WS_ABORT,"choose best websocket aborted"))};let w=ve("GATEWAY_DOMAINS"),T,R=a.indexOf("?h="),A=w.find(Z=>R!==-1?Tt(a).call(a,Z,R):Tt(a).call(a,Z));z.debug("[choose-best-ws] currentDomain: ",A,", domains: ",w);let L=!this.tryDoubleDomain||!A;if(!L&&A){var U;let Z=Date.now();try{w.forEach(W=>{let K=R===-1?a.replace(A,W):a.substr(0,R)+a.substr(R).replace(A,W),oe=new WebSocket(K);oe.binaryType="arraybuffer",v.push(oe),z.debug("[choose-best-ws] ws is connecting:",oe.url)})}catch{for(z.debug("[choose-best-ws] ws create failed, fallback to single url"),v.forEach(W=>W.close());v.length;)v.pop();L=!0}(U=this.store)===null||U===void 0||U.recordJoinChannelService({urls:v.map(W=>W.url),service:"gateway"},o),v.forEach(W=>{W.onopen=()=>{if(g)return;let K=Date.now()-Z;z.debug("[choose-best-ws] ws open cost ".concat(K,"ms")),v.filter(oe=>oe!==W).forEach(oe=>{z.debug("[choose-best-ws]close backup websocket: ".concat(oe.url)),oe.close()}),g=!0,c(W)},W.onclose=K=>{T=K,!g&&(v.find(oe=>!(oe.readyState===WebSocket.CLOSED||oe.readyState===WebSocket.CLOSING))||(z.debug("[choose-best-ws] all websocket is closed"),g=!0,f(T)))},W.onmessage=K=>{z.debug("[choose-best-ws]".concat(W.url," onmessage: ").concat(K.data))}}),_s(this.forceCloseTimeout).then(()=>{v.forEach(W=>{W.readyState!==WebSocket.OPEN&&W.close()})})}if(L){var F;let Z;z.debug("[choose-best-ws] use single url: ",a),(F=this.store)===null||F===void 0||F.recordJoinChannelService({urls:[a],service:"gateway"},o);try{Z=new WebSocket(a),v.push(Z),Z.binaryType="arraybuffer"}catch(W){let K=new Ke(ce.WS_ERR,"init websocket failed! Error: ".concat(W.toString()));return z.error("[".concat(this.name,"]").concat(K)),void f(K)}Z.onopen=()=>{c(Z)},Z.onclose=W=>{f(W)},Z.onmessage=W=>{z.debug("[choose-best-ws]".concat(Z.url," onmessage: ").concat(W.data))},_s(this.forceCloseTimeout).then(()=>{Z&&Z.readyState!==WebSocket.OPEN&&Z.close()})}}).then(c=>(this.closeEstablishingWs=void 0,c)).catch(c=>{throw this.closeEstablishingWs=void 0,c})}}class rre extends tr{get connectionState(){return this._connectionState}set connectionState(a){a!==this._connectionState&&(this._connectionState=a,a===zn.CONNECTED?this.emit(Ut.WS_CONNECTED):a===zn.RECONNECTING?this.emit(Ut.WS_RECONNECTING,this._websocketReconnectReason):a===zn.CLOSED&&this.emit(Ut.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket&&this.websocket.url||null}get rtt(){return this.rttRolling.mean()}constructor(a,o){super(),X(this,"_disconnectedReason",void 0),X(this,"_websocketReconnectReason",void 0),X(this,"_connectionState",zn.CLOSED),X(this,"reconnectToken",void 0),X(this,"websocket",void 0),X(this,"openConnectionTime",void 0),X(this,"clientId",void 0),X(this,"lastMsgTime",Date.now()),X(this,"uploadCache",[]),X(this,"uploadCacheInterval",void 0),X(this,"rttRolling",new EG(5)),X(this,"pingpongTimer",void 0),X(this,"wsInflateDataTimer",void 0),X(this,"pingpongTimeoutCount",0),X(this,"joinResponse",void 0),X(this,"multiIpOption",void 0),X(this,"initError",void 0),X(this,"spec",void 0),X(this,"store",void 0),X(this,"onWebsocketMessage",c=>{if(c.data instanceof ArrayBuffer)return void this.emit(Ut.ON_BINARY_DATA,c.data);let f=JSON.parse(c.data);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(f,"_id")){let g="res-@".concat(f._id);this.emit(g,f._result,f._message)}else if(Object.prototype.hasOwnProperty.call(f,"_type")){if(this.emit(f._type,f._message),f._type===Sn.ON_NOTIFICATION&&this.handleNotification(f._message),f._type===Sn.ON_USER_BANNED)switch(f._message.error_code){case 14:this.close(Hn.UID_BANNED);break;case 15:this.close(Hn.IP_BANNED);break;case 16:this.close(Hn.CHANNEL_BANNED)}if(f._type===Sn.ON_USER_LICENSE_BANNED)switch(f._message.error_code){case ln.ERR_LICENSE_MISSING:this.close(Hn.LICENSE_MISSING);break;case ln.ERR_LICENSE_EXPIRED:this.close(Hn.LICENSE_EXPIRED);break;case ln.ERR_LICENSE_MINUTES_EXCEEDED:this.close(Hn.LICENSE_MINUTES_EXCEEDED);break;case ln.ERR_LICENSE_PERIOD_INVALID:this.close(Hn.LICENSE_PERIOD_INVALID);break;case ln.ERR_LICENSE_MULTIPLE_SDK_SERVICE:this.close(Hn.LICENSE_MULTIPLE_SDK_SERVICE);break;case ln.ERR_LICENSE_ILLEGAL:this.close(Hn.LICENSE_ILLEGAL);break;default:this.close()}}}),this.clientId=a.clientId,this.spec=a,this.store=o,this.websocket=new HI("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),o),this.handleWebsocketEvents(),window.addEventListener("offline",()=>{this.connectionState===zn.CONNECTED&&this.reconnect("retry",Xs.OFFLINE)})}async request(a,o,c,f){let g=Li(6,""),v={_id:g,_type:a,_message:o},w=this.websocket.connectionID,T=()=>new Ct((Z,W)=>{if(this.connectionState===zn.CONNECTED)return Z();let K=()=>{this.off(Ut.WS_CLOSED,oe),Z()},oe=()=>{this.off(Ut.WS_CONNECTED,K),W(new De(ce.WS_ABORT))};this.once(Ut.WS_CONNECTED,K),this.once(Ut.WS_CLOSED,oe),a!==rn.PUBLISH&&a!==rn.PUBLISH_DATASTREAM&&a!==rn.SUBSCRIBE&&a!==rn.SUBSCRIBE_DATASTREAM&&a!==rn.UNSUBSCRIBE&&a!==rn.UNSUBSCRIBE_DATASTREAM&&a!==rn.UNPUBLISH&&a!==rn.UNPUBLISH_DATASTREAM&&a!==rn.CONTROL&&a!==rn.RESTART_ICE||this.once(Ut.DISCONNECT_P2P,()=>{W(new De(ce.DISCONNECT_P2P))}),a!==rn.PUBLISH&&a!==rn.RESTART_ICE||this.once(Ut.ABORT_P2P_EXECUTION,()=>{W(new De(ce.DISCONNECT_P2P))})});if(this.connectionState!==zn.CONNECTING&&this.connectionState!==zn.RECONNECTING||a===rn.JOIN||a===rn.REJOIN||await T(),this.websocket.sendMessage(v,!0),f)return;let R=new Ct((Z,W)=>{let K=!1,oe=(xe,Ne)=>{K=!0,Z({isSuccess:xe==="success",message:Ne||{}}),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.emit(Ut.REQUEST_SUCCESS,a,o)};this.once("res-@".concat(g),oe);let ue=()=>{W(new De(ce.WS_ABORT,"type: ".concat(a))),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.off("res-@".concat(g),oe)};this.once(Ut.WS_CLOSED,ue),this.once(Ut.WS_RECONNECTING,ue),_s(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{this.websocket.connectionID!==w||K||(z.warning("[".concat(this.clientId,"] ws request timeout, type: ").concat(a)),this.emit(Ut.REQUEST_TIMEOUT,a,o))})}),A=null;try{A=await R}catch(Z){if(this.connectionState===zn.CLOSED||a===rn.LEAVE)throw new De(ce.WS_ABORT);return!this.spec.forceWaitGatewayResponse||c?Z.throw():a===rn.JOIN||a===rn.REJOIN?null:(await T(),await this.request(a,o))}if(A.isSuccess)return A.message;let L=Number(A.message.error_code||A.message.code),U=h_(L),F=new De(ce.UNEXPECTED_RESPONSE,"".concat(U.desc,": ").concat(A.message.error_str),{code:L,data:A.message});return U.action==="success"?A.message:(z.warning("[".concat(this.clientId,"] [").concat(this.websocket.connectionID,"] unexpected response from type ").concat(a,", error_code: ").concat(L,", message: ").concat(U.desc,", action: ").concat(U.action)),L===ln.ERR_TOO_MANY_BROADCASTERS?((a===rn.JOIN||a===rn.REJOIN)&&(this.initError=F,this.close()),F.throw()):U.action==="failed"?F.throw():U.action==="quit"?(this.initError=F,this.close(),F.throw()):(L===ln.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=A.message.option,z.warning("[".concat(this.clientId,"] detect multi ip, recover")),this.reconnect("recover",Xs.MULTI_IP)):this.reconnect(U.action,Xs.SERVER_ERROR),a===rn.JOIN||a===rn.REJOIN?null:await this.request(a,o)))}waitMessage(a,o){return new Ct(c=>{let f=g=>{(!o||o(g))&&(this.off(a,f),c(g))};this.on(a,f)})}uploadWRTCStats(a){if(!this.store.sessionId)return void z.warn("[".concat(this.clientId,"] no session id when upload wrtc stats"));let o={lts:Date.now(),sid:this.store.sessionId,uid:this.store.intUid,stats:a};this.upload(u_.WRTC_STATS,o)}upload(a,o){let c={_type:a,_message:o};try{this.websocket.sendMessage(c)}catch{let f=ve("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(c),this.uploadCache.length>f&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval(()=>{if(this.connectionState!==zn.CONNECTED)return;let g=this.uploadCache.splice(0,1)[0];this.uploadCache.length===0&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(g._type,g._message)},ve("UPLOAD_CACHE_INTERVAL")||2e3))}}send(a,o){let c={_type:a,_message:o};this.websocket.sendMessage(c)}init(a,o){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Ct((c,f)=>{this.once(Ut.WS_CONNECTED,()=>c(this.joinResponse)),this.once(Ut.WS_CLOSED,()=>f(this.initError||new De(ce.WS_ABORT))),this.connectionState=zn.CONNECTING,this.websocket.init(a).catch(f),this.wsInflateDataTimer&&window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=window.setInterval(()=>{this.handleWsInflateData()},2e4)})}close(a){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.wsInflateDataTimer&&(this.handleWsInflateData(),window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._disconnectedReason=a||Hn.LEAVE,this.connectionState=zn.CLOSED,z.debug("[".concat(this.clientId,"] ")+"will close websocket in signal"),this.websocket.close(),a===Hn.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new HI("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),this.store),this.handleWebsocketEvents())}async join(){if(!this.joinResponse){this.emit(Ut.ABORT_P2P_EXECUTION);let a=await Yr(this,Ut.REQUEST_JOIN_INFO),o=await this.request(rn.JOIN,a);if(!o)return this.emit(Ut.REPORT_JOIN_GATEWAY,zI.TIMEOUT,this.url||""),!1;this.joinResponse=o,this.emit(Ut.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=zn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}async rejoin(){if(!this.reconnectToken)throw new De(ce.UNEXPECTED_ERROR,"can not rejoin, no rejoin token");let a=a_(this,Ut.REQUEST_REJOIN_INFO);a.token=this.reconnectToken;let o=await this.request(rn.REJOIN,a);return!!o&&(this.connectionState=zn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),o.peers&&o.peers.forEach(c=>{this.emit(Sn.ON_USER_ONLINE,{uid:c.uid}),c.audio&&this.emit(Sn.ON_ADD_AUDIO_STREAM,{uid:c.uid,uint_id:c.uint_id,audio:!0,ssrcId:c.audio_ssrc}),c.video&&this.emit(Sn.ON_ADD_VIDEO_STREAM,{uid:c.uid,uint_id:c.uint_id,video:!0,ssrcId:c.video_ssrc}),c.audio_mute?this.emit(Sn.MUTE_AUDIO,{uid:c.uid}):this.emit(Sn.UNMUTE_AUDIO,{uid:c.uid}),c.video_mute?this.emit(Sn.MUTE_VIDEO,{uid:c.uid}):this.emit(Sn.UNMUTE_VIDEO,{uid:c.uid}),c.audio_enable_local?this.emit(Sn.ENABLE_LOCAL_AUDIO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_AUDIO,{uid:c.uid}),c.video_enable_local?this.emit(Sn.ENABLE_LOCAL_VIDEO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_VIDEO,{uid:c.uid}),c.audio||c.video||this.emit(Sn.ON_REMOVE_STREAM,{uid:c.uid,uint_id:c.uint_id})}),!0)}reconnect(a,o){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(a,o)}handleNotification(a){z.debug("[".concat(this.clientId,"] receive notification: "),a);let o=h_(a.code);if(o.action!=="success"){if(o.action!=="failed")return o.action==="quit"?(o.desc==="ERR_REPEAT_JOIN_CHANNEL"&&this.close(Hn.UID_BANNED),void this.close()):void this.reconnect(o.action,Xs.SERVER_ERROR);z.error("[".concat(this.clientId,"] ignore error: "),o.desc)}}handlePingPong(){if(!this.websocket||this.websocket.state!=="connected")return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;let a=ve("PING_PONG_TIME_OUT"),o=Date.now();this.pingpongTimeoutCount>=a&&(z.warning("[".concat(this.clientId,"] PING-PONG Timeout. Last Socket Message: ").concat(o-this.lastMsgTime,"ms")),o-this.lastMsgTime>ve("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",Xs.TIMEOUT):this.request(rn.PING,void 0,!0).then(()=>{this.pingpongTimeoutCount=0;let c=Date.now()-o;this.rttRolling.add(c),ve("REPORT_STATS")&&this.send(rn.PING_BACK,{pingpongElapse:c})}).catch(c=>{})}handleWsInflateData(){let{wsInflateLength:a,wsDeflateLength:o}=this.websocket.getWsInflateData();a!==0&&o!==0&&this.upload(u_.WS_INFLATE_DATA_LENGTH,{ws_deflate_length:o,ws_inflate_length:a})}handleWebsocketEvents(){this.websocket.on(_n.RECONNECT_WAITTING_FINISH,a=>{this.emit(Ut.WS_RECONNECT_WAITTING_FINISH,a)}),this.websocket.on(_n.RECONNECT_CREATE_CONNECTION,a=>{this.emit(Ut.WS_RECONNECT_CREATE_CONNECTION,a)}),this.websocket.on(_n.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(_n.CLOSED,()=>{this.connectionState=zn.CLOSED}),this.websocket.on(_n.FAILED,()=>{this._disconnectedReason=Hn.NETWORK_ERROR,this.connectionState=zn.CLOSED}),this.websocket.on(_n.RECONNECTING,a=>{this._websocketReconnectReason=a,this.joinResponse=void 0,this.connectionState===zn.CONNECTED?this.connectionState=zn.RECONNECTING:this.connectionState=zn.CONNECTING}),this.websocket.on(_n.WILL_RECONNECT,(a,o,c)=>{let f=a_(this,Ut.IS_P2P_DISCONNECTED),g=f||a!=="retry";f&&a==="retry"&&(z.debug("".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),a="tryNext",o=zI.P2P_DISCONNECTED),g&&(z.debug("".concat(this.clientId," will renewSession, reconnect mode: ").concat(a)),this.emit(Ut.REPORT_JOIN_GATEWAY,o||zI.UNKNOWN_REASON,this.url||""),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION,this.websocket.currentURLIndex>=this.websocket.urls.length-1?"recover":a),this.emit(Ut.DISCONNECT_P2P)),c(a)}),this.websocket.on(_n.CONNECTED,()=>{this.openConnectionTime=Date.now(),this.reconnectToken?this.rejoin().catch(a=>{z.warning("[".concat(this.clientId,"] rejoin failed ").concat(a)),this.reconnect("tryNext",Xs.SERVER_ERROR)}):this.join().catch(a=>{if(this.emit(Ut.REPORT_JOIN_GATEWAY,a.message||a.code||zI.UNKNOWN_REASON,this.url||""),a instanceof De){if(a.code===ce.UNEXPECTED_RESPONSE&&a.data.code===ln.ERR_NO_AUTHORIZED)return this.initError=new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired"),z.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),void this.reconnect("recover",Xs.SERVER_ERROR);z.error("[".concat(this.clientId,"] join gateway request failed"),a.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",Xs.SERVER_ERROR):(this.initError=a,this.close())}})}),this.websocket.on(_n.REQUEST_NEW_URLS,(a,o)=>{Yr(this,Ut.REQUEST_RECOVER,this.multiIpOption).then(a).catch(o)}),this.websocket.on(_n.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{this.emit(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE)})}}let jr=function(r){return r[r.CHOOSE_SERVER=11]="CHOOSE_SERVER",r[r.CLOUD_PROXY=18]="CLOUD_PROXY",r[r.CLOUD_PROXY_5=20]="CLOUD_PROXY_5",r[r.CLOUD_PROXY_FALLBACK=26]="CLOUD_PROXY_FALLBACK",r}({});function sre(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function wk(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?sre(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):sre(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function $0(r){return r.match(/^[\.\:\d]+$/)?"".concat(r.replace(/[^\d]/g,"-"),".").concat(ve("TURN_DOMAIN")):(z.info("Unidentified as ip: ".concat(r,", use as host")),r)}function jG(r,a){r.addresses||(r.addresses=[]);let o=function(g,v){if(ve("CONNECT_GATEWAY_WITHOUT_DOMAIN"))return g.map(R=>{let{ip:A,port:L}=R;return{address:"".concat(A,":").concat(L)}});let w=ve("GATEWAY_DOMAINS"),T=w[1]&&Tt(v).call(v,w[1])?1:0;return g.map(R=>{let{domain_prefix:A,port:L,ip:U}=R;if(A)return{address:"".concat(A,".").concat(w[T++%w.length],":").concat(L)};let F=/^[\.\:\d]+$/.test(U),Z=F?"".concat(U.replace(/[^\d]/g,"-"),".").concat(w[T++%w.length],":").concat(L):"".concat(U,":").concat(L);return F||z.info("Unidentified as ip: ".concat(U,", use as host")),{ip:U,port:L,address:Z}})}(r.addresses,a),c=Array.isArray(r.detail)&&r.detail[18];if(c&&typeof c=="string"){let g=c.split(";");for(let v=0;v<g.length;v++){var f;let w=Us(f=g[v]).call(f);o[v]&&w&&(o[v].ip6=w)}}return{gatewayAddrs:o,uid:r.uid,cid:r.cid,cert:r.cert,vid:r.detail&&r.detail[8],uni_lbs_ip:r.detail&&r.detail[1],res:r,csIp:r.detail&&r.detail[502]}}function cl(r){return typeof r=="number"?r:r.exact||r.ideal||r.max||r.min||0}function are(r){let a=r._encoderConfig;if(!a)return{};let o={resolution:a.width&&a.height?"".concat(cl(a.width),"x").concat(cl(a.height)):void 0,maxVideoBW:a.bitrateMax,minVideoBW:a.bitrateMin};return typeof a.frameRate=="number"?(o.maxFrameRate=a.frameRate,o.minFrameRate=a.frameRate):a.frameRate&&(o.maxFrameRate=a.frameRate.max||a.frameRate.ideal||a.frameRate.exact||a.frameRate.min,o.minFrameRate=a.frameRate.min||a.frameRate.ideal||a.frameRate.exact||a.frameRate.max),o}function ore(r){return r>=0&&r<.17?1:r>=.17&&r<.36?2:r>=.36&&r<.59?3:r>=.59&&r<=1?4:r>1?5:0}function WI(r,a){let o,c,f;switch(a){case jr.CHOOSE_SERVER:c=4096,f="choose server";break;case jr.CLOUD_PROXY:c=1048576,f="proxy";break;case jr.CLOUD_PROXY_5:c=4194304,f="proxy5";break;case jr.CLOUD_PROXY_FALLBACK:c=4194310,f="proxy fallback";break;default:throw new De(ce.UNEXPECTED_ERROR,"multi unlibs response transformer get unknown service id",{csIp:r.detail&&r.detail[502],retry:!1})}if(r.response_body.forEach(g=>{g.buffer&&g.buffer.flag===c&&(o={code:g.buffer.code,addresses:(g.buffer.edges_services||[]).map(v=>wk(wk({},v),{},{ticket:g.buffer.cert})),server_ts:r.enter_ts,uid:g.buffer.uid,cid:g.buffer.cid,cname:g.buffer.cname,detail:wk(wk({},g.buffer.detail),r.detail),flag:g.buffer.flag,opid:r.opid,cert:g.buffer.cert})}),!o)throw new De(ce.MULTI_UNILBS_RESPONSE_ERROR,"cannot parse response ".concat(f," from multi unilbs response"),{csIp:r.detail&&r.detail[502]});return o}async function lre(r,a){return await Ct.all(r.addresses.map(async o=>({address:$0(o.ip),tcpport:o.port,udpport:o.port,username:a&&ve("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?a.toString():Js.username,password:a&&ve("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?await vG(a.toString()):Js.password})))}function UG(r,a){let o=a.getMediaStreamTrack(!0).getSettings(),c=a.videoHeight||o.height,f=a.videoWidth||o.width;return c&&f?Math.max(Math.min(c,f)/Math.min(cl(r.height),cl(r.width)),1):(z.warning("can't get ori-track's height, default scale down 4 times for low stream"),4)}function K0(r){let{candidateType:a,relayProtocol:o,type:c,address:f,port:g,protocol:v}=r;return c==="local-candidate"?{candidateType:a,relayProtocol:o,protocol:v}:{candidateType:a,relayProtocol:o,address:f,port:g,protocol:v}}function cre(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}class YAe extends tr{get url(){return this._url?this._url:null}get reconnectMode(){return this._reconnectMode}set reconnectMode(a){var o;Tt(o=["tryNext","recover"]).call(o,a)&&this.resetReconnectCount(a),this._reconnectMode=a}get state(){return this._state}set state(a){a!==this._state&&(this._state=a,this._state==="reconnecting"?this.emit(Xr.RECONNECTING,this.reconnectReason):this._state==="connected"?this.emit(Xr.CONNECTED):this._state==="closed"?this.emit(Xr.CLOSED):this._state==="failed"&&this.emit(Xr.FAILED))}constructor(a,o,c,f){super(),X(this,"connectionID",0),X(this,"currentURLIndex",0),X(this,"reconnectReason",void 0),X(this,"_reconnectMode","tryNext"),X(this,"_initMutex",void 0),X(this,"_name",void 0),X(this,"_state","closed"),X(this,"_reconnectInterrupter",void 0),X(this,"_url",void 0),X(this,"_retryConfig",void 0),X(this,"_reconnectCount",0),X(this,"_forceCloseTimeout",5e3),X(this,"_onlineReconnectListener",void 0),X(this,"_closeEstablishingTransmitter",()=>{}),X(this,"_store",void 0),X(this,"_joinChannelServiceRecordIndex",void 0),X(this,"_transmitter",void 0),X(this,"_useCompress",void 0),X(this,"_inflateLength",0),X(this,"_deflateLength",0),this._store=f,this._name=a,this._retryConfig=function(g){for(var v=1;v<arguments.length;v++){var w=arguments[v]!=null?arguments[v]:{};v%2?cre(Object(w),!0).forEach(function(T){X(g,T,w[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(w)):cre(Object(w)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(w,T))})}return g}({},o),this._useCompress=c}resetReconnectCount(a){z.debug("".concat(this._name," reset reconnect count, reason: ").concat(a)),this._reconnectCount=0}close(a,o){if(this.currentURLIndex=0,this.resetReconnectCount("close"),this._reconnectInterrupter&&this._reconnectInterrupter(),this._transmitter){this._transmitter.onclose=null,this._transmitter.onopen=null,this._transmitter.onmessage=null;let c=this._transmitter;o?setTimeout(()=>c.close(),500):c.close(),this._transmitter=void 0}this.state=a?"failed":"closed",this._closeEstablishingTransmitter&&this._closeEstablishingTransmitter()}reconnect(a,o){if(!this._transmitter)return void z.warning("[".concat(this._name,"] can not reconnect, no websocket"));var c;a!==void 0&&(this.reconnectMode=a),z.debug("[".concat(this._name,"] reconnect is triggered initiative")),typeof this._joinChannelServiceRecordIndex=="number"&&((c=this._store)===null||c===void 0||c.recordJoinChannelService({status:"error",errors:[new Error(o)]},this._joinChannelServiceRecordIndex));let f=this._transmitter.onclose;this._transmitter.onclose=null,this._transmitter.close(),f&&f.bind(this._transmitter)({code:9999,reason:o})}getInflateData(){let a=this._inflateLength,o=this._deflateLength;return this.clearInflateData(),{inflateLength:a,deflateLength:o}}setInflateData(a){this._deflateLength=this._deflateLength+a.originLength,this._inflateLength=this._inflateLength+a.compressedLength}clearInflateData(){this._inflateLength=0,this._deflateLength=0}}let Lh=function(r){return r[r.Default=0]="Default",r[r.Ack=1]="Ack",r}({});class XAe{constructor(a,o,c){X(this,"version",1),X(this,"initialRTO",void 0),X(this,"maxBatchAckCount",void 0),X(this,"maxRTO",void 0),X(this,"initialRTT",void 0),X(this,"ID",void 0),X(this,"rtt",void 0),X(this,"packetNumber",1),X(this,"rtoRatioMap",new Map),X(this,"timeoutMap",new Map),X(this,"unorderedPacketQueue",[]),X(this,"batchAckPacketQueue",[]),X(this,"lastOrderedPacketNumber",0),X(this,"batchAckTimer",void 0),X(this,"sendImpl",void 0),X(this,"receiveImpl",void 0),this.sendImpl=a,this.receiveImpl=o,this.ID=Li(7,"transmitter-"),this.initialRTO=(c==null?void 0:c.initialRTO)!==void 0?c.initialRTO:ve("TRANSMITTER_INITIAL_RTO"),this.initialRTT=(c==null?void 0:c.initialRTT)!==void 0?c.initialRTT:ve("TRANSMITTER_INITIAL_RTT"),this.rtt=(c==null?void 0:c.initialRTT)!==void 0?c.initialRTT:ve("TRANSMITTER_INITIAL_RTT"),this.maxBatchAckCount=(c==null?void 0:c.maxBatchAckCount)!==void 0?c.maxBatchAckCount:ve("TRANSMITTER_MAX_BATCH_ACK_COUNT"),this.maxRTO=(c==null?void 0:c.maxRTO)!==void 0?c.maxRTO:ve("TRANSMITTER_MAX_RTO")}packetize(a,o){return{type:Lh.Default,version:this.version,packetNumber:o,payload:a}}serialize(a){switch(a.type){case Lh.Default:{let o;typeof a.payload=="string"?o=new TextEncoder().encode(a.payload):o=a.payload;let c=new ArrayBuffer(o.length+15),f=new DataView(c);return f.setUint16(0,a.version),f.setUint8(2,a.type),f.setUint32(3,a.packetNumber),yie(f,7,BigInt(a.sendTs)),new Uint8Array(f.buffer).set(o,15),c}case Lh.Ack:{let o=new ArrayBuffer(16),c=new DataView(o);return c.setUint16(0,a.version),c.setUint8(2,a.type),c.setUint32(3,a.maxAckPacketNumber),c.setUint8(7,a.shift),yie(c,8,BigInt(a.ackSendTs)),o}}}deserialize(a){let o=new DataView(a),c=o.getUint16(0),f=o.getUint8(2);switch(f){case Lh.Default:{let g=o.getUint32(3),v=vie(o,7),w=a.slice(15),T=new TextDecoder().decode(w);return{version:c,type:f,packetNumber:g,sendTs:Number(v),payload:T}}case Lh.Ack:{let g=o.getUint32(3),v=o.getUint8(7),w=vie(o,8);return{version:c,type:f,maxAckPacketNumber:g,shift:v,ackSendTs:Number(w)}}default:throw z.error("[".concat(this.ID,"] Unrecognized packet type ").concat(f)),new Error("Unrecognized packet type ".concat(f))}}sendMessage(a){let o=this.packetize(a,this.packetNumber);this.packetNumber=this.packetNumber===4294967295?1:this.packetNumber+1;let c=this.calculateRTO(o),f=window.setTimeout(()=>{this.resendMessage(o)},c);this.timeoutMap.set(o.packetNumber,f),this.sendPacket(o)}onData(a){let o=this.deserialize(a);o.type===Lh.Default?this.ack(o):o.type===Lh.Ack&&(this.updateRTT(o,Math.round(performance.now())),this.clearRTO(o))}close(){this.rtt=this.initialRTT,this.packetNumber=1,Array.from(this.timeoutMap.entries()).forEach(a=>{let[o,c]=a;window.clearTimeout(c)}),this.timeoutMap=new Map,this.rtoRatioMap=new Map,this.unorderedPacketQueue=[],this.batchAckPacketQueue=[],this.lastOrderedPacketNumber=0,this.batchAckTimer!==void 0&&window.clearTimeout(this.batchAckTimer)}resendMessage(a){let o=this.calculateRTO(a),c=window.setTimeout(()=>{this.resendMessage(a)},o);this.timeoutMap.set(a.packetNumber,c),this.sendPacket(a)}calculateRTO(a){let o=this.rtoRatioMap.get(a.packetNumber);if(o===void 0)return this.rtoRatioMap.set(a.packetNumber,1),this.initialRTO;{let c=9*this.rtt/8*o;return this.rtoRatioMap.set(a.packetNumber,o+1),c>this.maxRTO?this.maxRTO:c}}updateRTT(a,o){let c=a.ackSendTs;this.rtt=this.rtt*(7/8)+(o-c-this.rtt)/8}ack(a){if(a.packetNumber===this.lastOrderedPacketNumber+1)for(this.batchAckPacketQueue.length>=this.maxBatchAckCount&&this.batchAck(),this.batchAckTimer?this.batchAckPacketQueue.push(a):(this.batchAckPacketQueue.push(a),this.batchAckTimer=window.setTimeout(()=>{this.batchAck()},this.rtt/8)),this.lastOrderedPacketNumber+=1,this.receiveImpl(a.payload);;){let o=this.unorderedPacketQueue[0];if(!o){this.unorderedPacketQueue.shift();break}this.batchAckTimer&&this.batchAck(),this.receiveImpl(o.payload),this.unorderedPacketQueue.shift(),this.lastOrderedPacketNumber+=1}else if(a.packetNumber<=this.lastOrderedPacketNumber){let o={ackSendTs:a.sendTs,maxAckPacketNumber:a.packetNumber,shift:0,type:Lh.Ack,version:this.version};this.sendPacket(o)}else if(a.packetNumber>this.lastOrderedPacketNumber){this.unorderedPacketQueue[a.packetNumber-this.lastOrderedPacketNumber-2]=a;let o={ackSendTs:a.sendTs,maxAckPacketNumber:a.packetNumber,shift:0,type:Lh.Ack,version:this.version};this.sendPacket(o)}}batchAck(){window.clearTimeout(this.batchAckTimer),this.batchAckTimer=void 0;let a={ackSendTs:this.batchAckPacketQueue[this.batchAckPacketQueue.length-1].sendTs,maxAckPacketNumber:this.batchAckPacketQueue[this.batchAckPacketQueue.length-1].packetNumber,shift:this.batchAckPacketQueue.length-1,type:Lh.Ack,version:this.version};this.sendPacket(a),this.batchAckPacketQueue=[]}sendPacket(a){a.type===Lh.Default&&(a.sendTs=Math.round(performance.now()));let o=this.serialize(a);this.sendImpl(o)}clearRTO(a){for(let o=a.maxAckPacketNumber-a.shift;o<=a.maxAckPacketNumber;o++){let c=this.timeoutMap.get(o);c!==void 0&&window.clearTimeout(c),this.timeoutMap.delete(o),this.rtoRatioMap.delete(o)}}}class dre extends YAe{constructor(a,o){super(a,o,arguments.length>2&&arguments[2]!==void 0&&arguments[2],arguments.length>3?arguments[3]:void 0),X(this,"_initMutex",void 0),X(this,"_reconnectInterrupter",void 0),X(this,"_url",void 0),X(this,"_transmitter",void 0),X(this,"_addresses",void 0),X(this,"_reliableTransmission",void 0),this._initMutex=new As("datachannel");let{timeout:c,timeoutFactor:f}=o,g=Math.max(300,Math.floor(3*c/5)),v=Math.max(1.2,Math.floor(8*f)/10);so.ONLINE&&(this._retryConfig.timeout=g,this._retryConfig.timeoutFactor=v),yr.on(s_.NETWORK_STATE_CHANGE,(w,T)=>{w!==T&&(this.resetReconnectCount("network state change: ".concat(T," -> ").concat(w)),w===so.ONLINE?(this._retryConfig.timeout=g,this._retryConfig.timeoutFactor=v):(this._retryConfig.timeout=c,this._retryConfig.timeoutFactor=f))})}getConnection(){if(this._reliableTransmission)return this._reliableTransmission}async init(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3;this._forceCloseTimeout=o;let c=(f,g)=>{this._addresses=a,this.currentURLIndex=this._addresses.findIndex(w=>w.fingerprint||ve("FINGERPRINT"));let v=this._addresses[this.currentURLIndex];this.state="connecting",this.createTransmitterConnection(v).then(f).catch(g),this.once(Xr.CLOSED,()=>g(new De(ce.WS_DISCONNECT))),this.once(Xr.CONNECTED,()=>f())};return this._initMutex.lock().then(f=>new Ct((g,v)=>{c(g,v)}).then(()=>{f()}).catch(()=>{f()}))}sendMessage(a){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!this._transmitter||!this._reliableTransmission)throw new De(ce.WS_ABORT,"datachannel is not ready");try{o||(a=JSON.stringify(a)),this._reliableTransmission.sendMessage(a)}catch(c){throw new De(ce.WS_ERR,"send datachannel signal message error"+c.toString())}}unbindDcCloseEventListener(){this._transmitter&&(this._transmitter.onclose=null)}sendMessageWithJSON(a){let o=JSON.stringify(a);return{compressed:o,compressedLength:o.length,origin:a}}sendMessageWithUint8Array(a){return{compressed:a,compressedLength:a.byteLength,origin:a}}createTransmitterConnection(a){return this.connectionID+=1,this._joinChannelServiceRecordIndex=void 0,this._url="dc://".concat(a.ip,":").concat(a.port),new Ct((o,c)=>{var f;let g=()=>{z.debug("[".concat(this._name,"] datachannel opened:"),this._url),this.reconnectMode="retry",this.state="connected",this.resetReconnectCount("opened"),o()},v=async A=>{var L;if((L=this._closeEstablishingTransmitter)===null||L===void 0||L.call(this),z.debug("[".concat(this._name,"] datachannel close ").concat(this._url,", code: ").concat(A.code,", reason: ").concat(A.reason,", current mode: ").concat(this.reconnectMode)),this._reconnectCount<this._retryConfig.maxRetryCount){this.state==="connected"&&(this.reconnectReason=A.reason,this.state="reconnecting");let U=Bl(this,Xr.WILL_RECONNECT,this.reconnectMode)||this.reconnectMode,F=await this.reconnectWithAction(U);if(this.state==="closed")return void z.debug("[".concat(this.connectionID,"] dc is closed, no need to reconnect"));if(!F)return c(new De(ce.WS_DISCONNECT,"datachannel reconnect failed: ".concat(A.code))),void this.close(!0);o()}else c(new De(ce.WS_DISCONNECT,"datachannel close: ".concat(A.code))),this.close()},w=A=>{var L;(L=this._reliableTransmission)===null||L===void 0||L.onData(A.data)};this._transmitter&&(this._transmitter.onclose=null,this._transmitter.close()),this._reliableTransmission&&(this._reliableTransmission.close(),this._reliableTransmission=void 0),z.debug("[".concat(this._name,"] start connect, address: ").concat(JSON.stringify(a)));let T=(f=this._store)===null||f===void 0?void 0:f.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"gateway"}),R=Date.now();Yr(this,Xr.TO_CONNECT_DATACHANNEL,a).then(A=>{var L,U;if(!A)throw new Error("transmissonInfo not exist yet");let{transmitter:F,close:Z}=A;this._transmitter=F,(L=this._store)===null||L===void 0||L.signalChannelOpen();let W=Date.now()-R;z.debug("[choose dc] dc open cost ".concat(W,"ms")),this._reliableTransmission=new XAe(K=>{var oe;this._transmitter&&this._transmitter.readyState==="open"&&((oe=this._transmitter)===null||oe===void 0||oe.send(K))},K=>{typeof K=="string"&&this.emit(Xr.ON_MESSAGE,K)}),this._closeEstablishingTransmitter=()=>{var K;(K=this._reliableTransmission)===null||K===void 0||K.close(),this._reliableTransmission=void 0,Z()},g&&g(),F.onclose=v,F.onmessage=w,(U=this._store)===null||U===void 0||U.recordJoinChannelService({endTs:Date.now(),status:"success"},T),this._joinChannelServiceRecordIndex=T}).catch(A=>{var L;if((L=this._store)===null||L===void 0||L.recordJoinChannelService({endTs:Date.now(),status:A instanceof De&&A.code===ce.WS_ABORT?"aborted":"error",errors:[A]},T),this.state!=="closed"){if(A instanceof De&&A.code===ce.WS_ERR){let U=new De(ce.WS_ERR,"init datachannel failed! Error: ".concat(A.toString()));return z.error("[".concat(this._name,"]").concat(U)),void c(U)}v&&v(A)}else c(new De(ce.WS_DISCONNECT,"datachannel is closed: ".concat(A.toString())))})})}async reconnectWithAction(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(this._reconnectCount>=this._retryConfig.maxRetryCount||!this._addresses||this.state==="closed")return!1;this._onlineReconnectListener||yr.networkState!==so.OFFLINE||(this._onlineReconnectListener=yr.onlineWaiter&&yr.onlineWaiter.then(()=>{this._onlineReconnectListener=void 0}));let c=!0;if(this._reconnectInterrupter=()=>{c=!1},o){let w=uk(this._reconnectCount,this._retryConfig);z.debug("[".concat(this._name,"] wait ").concat(w,"ms to reconnect datachannel, mode: ").concat(a)),await Ct.race([_s(w),this._onlineReconnectListener||new Ct(()=>{})])}if(this.state==="closed"||!c)return!1;this._reconnectCount+=1;let f=async(w,T)=>{this.emit(Xr.RECONNECT_CREATE_CONNECTION,T),await this.createTransmitterConnection(w)};try{if(a==="retry"){let w=this._addresses[this.currentURLIndex];this.emit(Xr.RECONNECT_WAITTING_FINISH,a),await f(w,a)}else if(a==="tryNext"){this.currentURLIndex+=1;for(let T=this.currentURLIndex;T<this._addresses.length;T++){if(this._addresses[T].fingerprint||ve("FINGERPRINT")){this.currentURLIndex=T;break}this.currentURLIndex+=1}if(this.currentURLIndex>=this._addresses.length)return z.debug("[".concat(this._name,"] the available addresses are exhausted, change to recover")),await this.reconnectWithAction("recover",!1);z.debug("[".concat(this._name,"] datachannel url length: ").concat(this._addresses.length," current index: ").concat(this.currentURLIndex));let w=this._addresses[this.currentURLIndex];this.emit(Xr.RECONNECT_WAITTING_FINISH,a),await f(w,a)}else a==="recover"&&(z.debug("[".concat(this._name,"] start to failback to websocket")),this.resetReconnectCount("recover mode"),this.emit(Xr.RECONNECT_WAITTING_FINISH,a),this.emit(Xr.FAILBACK));return!0}catch(w){var g,v;return z.error("[".concat(this._name,"] reconnect failed"),w.toString()),w!=null&&(g=w.data)!==null&&g!==void 0&&g.desc&&Array.isArray(w.data.desc)&&w.data.desc.length&&Tt(v=w.data.desc).call(v,"dynamic key expired")?(this.emit(Xr.ON_TOKEN_PRIVILEGE_DID_EXPIRE),!1):await this.reconnectWithAction(a,o)}}}class Rm extends tr{get connectionState(){return this._connectionState}set connectionState(a){a!==this._connectionState&&(this._connectionState=a,a===zn.CONNECTED?this.emit(Ut.WS_CONNECTED):a===zn.RECONNECTING?this.emit(Ut.WS_RECONNECTING,this._websocketReconnectReason):a===zn.CLOSED&&this.emit(Ut.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket?this.websocket.url:null}get rtt(){return this.rttRolling.mean()}constructor(a,o){super(),X(this,"_disconnectedReason",void 0),X(this,"_websocketReconnectReason",void 0),X(this,"_connectionState",zn.CLOSED),X(this,"reconnectToken",void 0),X(this,"websocket",void 0),X(this,"openConnectionTime",void 0),X(this,"clientId",void 0),X(this,"lastMsgTime",Date.now()),X(this,"uploadCache",[]),X(this,"uploadCacheInterval",void 0),X(this,"rttRolling",new EG(5)),X(this,"pingpongTimer",void 0),X(this,"inflateDataTimer",void 0),X(this,"pingpongTimeoutCount",0),X(this,"joinResponse",void 0),X(this,"multiIpOption",void 0),X(this,"initError",void 0),X(this,"spec",void 0),X(this,"store",void 0),X(this,"onWebsocketMessage",c=>{if(c instanceof ArrayBuffer)return void this.emit(Ut.ON_BINARY_DATA,c);let f=JSON.parse(c);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(f,"_id")){let g="res-@".concat(f._id);this.emit(g,f._result,f._message)}else if(Object.prototype.hasOwnProperty.call(f,"_type")&&(this.emit(f._type,f._message),f._type===Sn.ON_NOTIFICATION&&this.handleNotification(f._message),f._type===Sn.ON_USER_BANNED))switch(f._message.error_code){case 14:this.close(Hn.UID_BANNED);break;case 15:this.close(Hn.IP_BANNED);break;case 16:this.close(Hn.CHANNEL_BANNED)}}),this.clientId=a.clientId,this.spec=a,this.store=o,this.websocket=new dre("gateway-".concat(this.clientId),this.spec.retryConfig,!0,o),this.handleWebsocketEvents(),window.addEventListener("offline",()=>{this.connectionState===zn.CONNECTED&&this.reconnect("retry",G0.OFFLINE)})}async request(a,o,c,f){let g=Li(6,""),v={_id:g,_type:a,_message:o},w=this.websocket.connectionID,T=()=>new Ct((Z,W)=>{if(this.connectionState===zn.CONNECTED)return Z();let K=()=>{this.off(Ut.WS_CLOSED,oe),Z()},oe=()=>{this.off(Ut.WS_CONNECTED,K),W(new De(ce.WS_ABORT))};this.once(Ut.WS_CONNECTED,K),this.once(Ut.WS_CLOSED,oe),a!==rn.PUBLISH&&a!==rn.SUBSCRIBE&&a!==rn.UNSUBSCRIBE&&a!==rn.UNPUBLISH&&a!==rn.CONTROL&&a!==rn.RESTART_ICE||this.once(Ut.DISCONNECT_P2P,()=>{W(new De(ce.DISCONNECT_P2P))}),a!==rn.PUBLISH&&a!==rn.RESTART_ICE||this.once(Ut.ABORT_P2P_EXECUTION,()=>{W(new De(ce.DISCONNECT_P2P))})});if(this.connectionState!==zn.CONNECTING&&this.connectionState!==zn.RECONNECTING||a===rn.JOIN||a===rn.REJOIN||await T(),a===rn.LEAVE&&(this.websocket.unbindDcCloseEventListener(),f=!0),this.websocket.sendMessage(v,!0,!1),f)return;let R=new Ct((Z,W)=>{let K=!1,oe=(xe,Ne)=>{K=!0,Z({isSuccess:xe==="success",message:Ne||{}}),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.emit(Ut.REQUEST_SUCCESS,a,o)};this.once("res-@".concat(g),oe);let ue=()=>{W(new De(ce.WS_ABORT,"type: ".concat(a))),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.off("res-@".concat(g),oe)};this.once(Ut.WS_CLOSED,ue),this.once(Ut.WS_RECONNECTING,ue),_s(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{this.websocket.connectionID!==w||K||(z.warning("dc request timeout, type: ".concat(a)),this.emit(Ut.REQUEST_TIMEOUT,a,o))})}),A=null;try{A=await R}catch(Z){if(this.connectionState===zn.CLOSED||a===rn.LEAVE)throw new De(ce.WS_ABORT);return!this.spec.forceWaitGatewayResponse||c?Z.throw():a===rn.JOIN||a===rn.REJOIN?null:(await T(),await this.request(a,o))}if(A.isSuccess)return A.message;let L=Number(A.message.error_code||A.message.code),U=h_(L),F=new De(ce.UNEXPECTED_RESPONSE,"".concat(U.desc,": ").concat(A.message.error_str),{code:L,data:A.message});return U.action==="success"?A.message:(z.warning("[".concat(this.websocket.connectionID,"] unexpected response from type ").concat(a,", error_code: ").concat(L,", message: ").concat(U.desc,", action: ").concat(U.action)),L===ln.ERR_TOO_MANY_BROADCASTERS?((a===rn.JOIN||a===rn.REJOIN)&&(this.initError=F,this.close()),F.throw()):U.action==="failed"?F.throw():U.action==="quit"?(this.initError=F,this.close(),F.throw()):(L===ln.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=A.message.option,z.warning("[".concat(this.clientId,"] detect multi ip, recover")),this.reconnect("recover",G0.MULTI_IP)):this.reconnect(U.action,G0.SERVER_ERROR),a===rn.JOIN||a===rn.REJOIN?null:await this.request(a,o)))}waitMessage(a,o){return new Ct(c=>{let f=g=>{(!o||o(g))&&(this.off(a,f),c(g))};this.on(a,f)})}uploadWRTCStats(a){if(!this.store.sessionId)return void z.warn("[".concat(this.clientId,"] no session id when upload wrtc stats"));let o={lts:Date.now(),sid:this.store.sessionId,uid:this.store.intUid,stats:a};this.upload(u_.WRTC_STATS,o)}upload(a,o){let c={_type:a,_message:o};try{this.websocket.sendMessage(c)}catch{let f=ve("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(c),this.uploadCache.length>f&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval(()=>{if(this.connectionState!==zn.CONNECTED)return;let g=this.uploadCache.splice(0,1)[0];this.uploadCache.length===0&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(g._type,g._message)},ve("UPLOAD_CACHE_INTERVAL")||2e3))}}send(a,o){let c={_type:a,_message:o};this.websocket.sendMessage(c)}init(a,o){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Ct((c,f)=>{this.once(Ut.WS_CONNECTED,()=>c(this.joinResponse)),this.once(Ut.WS_CLOSED,()=>f(this.initError||new De(ce.WS_ABORT))),this.connectionState=zn.CONNECTING,this.websocket.init(a).catch(f),this.websocket.once(Xr.FAILBACK,()=>{this.openConnectionTime===void 0&&f(new De(ce.INIT_DATACHANNEL_TIMEOUT))}),this.inflateDataTimer&&window.clearInterval(this.inflateDataTimer),this.inflateDataTimer=window.setInterval(()=>{this.handleInflateData()},2e4),setTimeout(()=>{o&&this.openConnectionTime===void 0&&(z.debug("[".concat(this.clientId,"] init datachannel timeout while join with failback to websocket")),f(new De(ce.INIT_DATACHANNEL_TIMEOUT)))},ve("DC_JOIN_WITH_FAILBACK"))})}close(a){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.inflateDataTimer&&(this.handleInflateData(),window.clearInterval(this.inflateDataTimer),this.inflateDataTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._disconnectedReason=a||Hn.LEAVE,this.connectionState=zn.CLOSED,z.debug("[".concat(this.clientId,"] ")+"will close datachannel in signal"),this.websocket.close(),a===Hn.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new dre("gateway-".concat(this.clientId),this.spec.retryConfig,!0,this.store),this.handleWebsocketEvents())}async join(){if(!this.joinResponse){this.emit(Ut.ABORT_P2P_EXECUTION);let a=await Yr(this,Ut.DATACHANNEL_CONNECTING),o=await this.request(rn.JOIN,a);if(!o)return this.emit(Ut.REPORT_JOIN_GATEWAY,ce.TIMEOUT,this.url||""),!1;this.joinResponse=o,this.emit(Ut.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=zn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}async rejoin(){if(!this.reconnectToken)throw new De(ce.UNEXPECTED_ERROR,"can not rejoin, no rejoin token");let a=a_(this,Ut.REQUEST_REJOIN_INFO);a.token=this.reconnectToken;let o=await this.request(rn.REJOIN,a);return!!o&&(this.connectionState=zn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),o.peers&&o.peers.forEach(c=>{this.emit(Sn.ON_USER_ONLINE,{uid:c.uid}),c.audio&&this.emit(Sn.ON_ADD_AUDIO_STREAM,{uid:c.uid,uint_id:c.uint_id,audio:!0,ssrcId:c.audio_ssrc}),c.video&&this.emit(Sn.ON_ADD_VIDEO_STREAM,{uid:c.uid,uint_id:c.uint_id,video:!0,ssrcId:c.video_ssrc}),c.audio_mute?this.emit(Sn.MUTE_AUDIO,{uid:c.uid}):this.emit(Sn.UNMUTE_AUDIO,{uid:c.uid}),c.video_mute?this.emit(Sn.MUTE_VIDEO,{uid:c.uid}):this.emit(Sn.UNMUTE_VIDEO,{uid:c.uid}),c.audio_enable_local?this.emit(Sn.ENABLE_LOCAL_AUDIO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_AUDIO,{uid:c.uid}),c.video_enable_local?this.emit(Sn.ENABLE_LOCAL_VIDEO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_VIDEO,{uid:c.uid}),c.audio||c.video||this.emit(Sn.ON_REMOVE_STREAM,{uid:c.uid,uint_id:c.uint_id})}),!0)}reconnect(a,o){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(a,o)}handleNotification(a){z.debug("[".concat(this.clientId,"] receive notification: "),a);let o=h_(a.code);if(o.action!=="success"){if(o.action!=="failed")return o.action==="quit"?(o.desc==="ERR_REPEAT_JOIN_CHANNEL"&&this.close(Hn.UID_BANNED),void this.close()):void this.reconnect(o.action,G0.SERVER_ERROR);z.error("[".concat(this.clientId,"] ignore error: "),o.desc)}}handlePingPong(){if(!this.websocket||this.websocket.state!=="connected")return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;let a=ve("PING_PONG_TIME_OUT"),o=Date.now();this.pingpongTimeoutCount>=a&&(z.warning("PINGPONG Timeout. Last Socket Message: ".concat(o-this.lastMsgTime,"ms")),o-this.lastMsgTime>ve("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",G0.TIMEOUT):this.request(rn.PING,void 0,!0).then(()=>{this.pingpongTimeoutCount=0;let c=Date.now()-o;this.rttRolling.add(c),ve("REPORT_STATS")&&this.send(rn.PING_BACK,{pingpongElapse:c})}).catch(c=>{})}handleInflateData(){let{inflateLength:a,deflateLength:o}=this.websocket.getInflateData();a!==0&&o!==0&&this.upload(u_.WS_INFLATE_DATA_LENGTH,{ws_deflate_length:o,ws_inflate_length:a})}handleWebsocketEvents(){this.websocket.on(Xr.RECONNECT_WAITTING_FINISH,a=>{this.emit(Ut.WS_RECONNECT_WAITTING_FINISH,a)}),this.websocket.on(Xr.RECONNECT_CREATE_CONNECTION,a=>{this.emit(Ut.WS_RECONNECT_CREATE_CONNECTION,a)}),this.websocket.on(Xr.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(Xr.CLOSED,()=>{this.connectionState=zn.CLOSED}),this.websocket.on(Xr.FAILED,()=>{this._disconnectedReason=Hn.NETWORK_ERROR,this.connectionState=zn.CLOSED}),this.websocket.on(Xr.RECONNECTING,a=>{this._websocketReconnectReason=a,this.joinResponse=void 0,this.connectionState===zn.CONNECTED?this.connectionState=zn.RECONNECTING:this.connectionState=zn.CONNECTING}),this.websocket.on(Xr.WILL_RECONNECT,(a,o)=>{if(a_(this,Ut.IS_P2P_DISCONNECTED)&&a==="retry")return z.debug("".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION),this.emit(Ut.DISCONNECT_P2P),o("tryNext");a!=="retry"&&(z.debug("".concat(this.clientId," websockt will_connect event, renewSession reconnectMode is ").concat(a)),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION),this.emit(Ut.DISCONNECT_P2P)),o(a)}),this.websocket.on(Xr.CONNECTED,()=>{this.openConnectionTime=Date.now(),this.reconnectToken?this.rejoin().catch(a=>{z.warning("[".concat(this.clientId,"] rejoin failed ").concat(a)),this.reconnect("tryNext",G0.SERVER_ERROR)}):this.join().catch(a=>{if(this.emit(Ut.REPORT_JOIN_GATEWAY,a.message||a.code,this.url||""),a instanceof De&&a.code===ce.UNEXPECTED_RESPONSE&&a.data.code===ln.ERR_NO_AUTHORIZED)return z.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),void this.reconnect("recover",G0.SERVER_ERROR);z.error("[".concat(this.clientId,"] join gateway request failed"),a.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",G0.SERVER_ERROR):(this.initError=a,this.close())})}),this.websocket.on(Xr.REQUEST_NEW_URLS,(a,o)=>{Yr(this,Ut.REQUEST_RECOVER,this.multiIpOption).then(a).catch(o)}),this.websocket.on(Xr.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{this.emit(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE)}),this.websocket.on(Xr.TO_CONNECT_DATACHANNEL,async(a,o,c)=>Yr(this,Ut.DATACHANNEL_PRECONNECT,a).then(o).catch(c)),this.websocket.on(Xr.FAILBACK,()=>{this.openConnectionTime!==void 0&&this.emit(Ut.DATACHANNEL_FAILBACK)})}}class f_ extends tr{constructor(a,o){super(),X(this,"signal",void 0),X(this,"token",void 0),X(this,"tokenTimeout",void 0),X(this,"tokenInterval",void 0),X(this,"_sequence",0),X(this,"userMap",new Map),X(this,"encoder",new TextEncoder),this.signal=a,this.token=o;let c=()=>{this.signal.connectionState===zn.CONNECTED&&this.check(),this.userMap.size===0?this.tokenInterval=window.setTimeout(c,1e3):this.tokenInterval=window.setTimeout(c,3*ve("P2P_TOKEN_INTERVAL"))};c()}async send(a,o,c,f,g){var v,w,T;if(this.userMap.size===0)return;let R=Array.from(Oh(v=this.userMap).call(v))[0].token;typeof o!="string"&&(o=JSON.stringify(o)),f=(w=f)!==null&&w!==void 0?w:Li(6,""),g=(T=g)!==null&&T!==void 0?T:this._sequence++;let A={_id:f,_type:a,_seq:g,_message:o,token:"".concat(this.token,"_").concat(R)};ve("SHOW_P2P_LOG")&&z.debug("send message",A,"noNeedResponse : ".concat(c)),this.splitMessage(JSON.stringify(A)).forEach(U=>{this.signal.request(rn.DATA_STREAM,{payload:V0(this.encoder.encode(U))})});let L=new Ct((U,F)=>{let Z=window.setTimeout(()=>{this.off("res-@".concat(f,"_ack"),W),this.off("res-@".concat(f),oe),this.off(hb.ABORT,K),z.debug("[external-signal] request timeout, type: ".concat(a,", requestId: ").concat(f)),this.userMap.size===0?F(new Ke(ce.INVALID_REMOTE_USER)):F(new Ke(ce.TIMEOUT))},ve("EXTERNAL_SIGNAL_REQUEST_TIMEOUT")),W=()=>{Z&&window.clearTimeout(Z),this.off(hb.ABORT,K),c&&U()},K=()=>{Z&&window.clearTimeout(Z),this.off("res-@".concat(f,"_ack"),W),this.off("res-@".concat(f),oe),F(new Ke(ce.EXTERNAL_SIGNAL_ABORT,"type: ".concat(a,", requestId: ").concat(f)))};this.once(hb.ABORT,K),this.once("res-@".concat(f,"_ack"),W);let oe=(xe,Ne)=>{ue=!0,Z&&window.clearTimeout(Z),this.off("res-@".concat(f,"_ack"),W),this.off(hb.ABORT,K),xe==="success"?U(Ne):F(new Ke(ce.P2P_MESSAGE_FAILED,"request ".concat(a," failed, requestId: ").concat(f)))},ue=!1;c||(this.once("res-@".concat(f),oe),_s(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{ue||z.warning("external_signal request timeout, type: ".concat(a,", requestId: ").concat(f,", ").concat(A))}))});try{return await L}catch(U){if(U.code===ce.TIMEOUT)return await this.send(a,o,c,f,g);throw U}}onMessage(a){var o;let{_uid:c}=a,f,g=this.userMap.get(c);if(g)f=g.splitMessageMap;else{if(this.userMap.size>0||!("_type"in a)||a._type!==Nr.CHECK)return;let{token:R}=a;f=new Map,g={uid:c,isStart:!0,token:R,splitMessageMap:f,nextExpectedSequenceNumber:0,receivedMessagesMap:new Map},this.userMap.set(c,g),this.signal.emit(Sn.ON_USER_ONLINE,{uid:c}),this.handleUserOnline()}if("id"in a&&"total"in a){var v;let{id:R,total:A}=a,L=(v=f.get(R))!==null&&v!==void 0?v:[];if(L.push(a),f.has(R)||f.set(R,L),L.length!==A)return;{let U=wI(L).call(L,(F,Z)=>F.index-Z.index).map(F=>F.payload).join("");f.delete(R),(a=JSON.parse(U))._uid=c}}let{_type:w,token:T}=a;if(Tt(o=[Nr.ACK,Nr.CHECK]).call(o,w))return w===Nr.CHECK&&this.handleCheckToken(g,T),void this.receiveMessage(a);T==="".concat(g.token,"_").concat(this.token)?this.handleReceivedMessage(a):z.debug('Receive unexpected message", '.concat(T,", cur_token: ").concat(g.token,"_").concat(this.token),a)}check(){let a={_id:Li(6,""),token:this.token,_type:Nr.CHECK};ve("SHOW_P2P_LOG")&&z.debug("send message",a),this.signal.request(rn.DATA_STREAM,{payload:V0(this.encoder.encode(JSON.stringify(a)))})}ack(a){let o={_id:a,_type:Nr.ACK,token:this.token};ve("SHOW_P2P_LOG")&&z.debug("send message",o),this.signal.request(rn.DATA_STREAM,{payload:V0(this.encoder.encode(JSON.stringify(o)))})}response(a,o,c){this.send(Nr.RESPONSE,JSON.stringify({success:!c,message:o}),!0,a)}handleReceivedMessage(a){let o=()=>{this.userMap.forEach(R=>{let{receivedMessagesMap:A,nextExpectedSequenceNumber:L}=R;for(;A.has(L);){let U=A.get(L);A.delete(L),this.receiveMessage(U),R.nextExpectedSequenceNumber++}})};if(!a)return void o();let{_uid:c,_seq:f}=a,g=this.userMap.get(c),{receivedMessagesMap:v,isStart:w,nextExpectedSequenceNumber:T}=g;if(f<T)return this.ack(a._id),void z.debug("[external-signal] receive old message, seq: ".concat(f,", ").concat(a._message));v.set(f,a),w&&f===T&&(this.receiveMessage(a),v.delete(T),g.nextExpectedSequenceNumber++,o())}receiveMessage(a){let{_id:o,_type:c,_message:f,_uid:g}=a;if(ve("SHOW_P2P_LOG")&&z.debug("receive message",a),o){let v;switch(a._type!==Nr.ACK&&(f&&(v=JSON.parse(f)),this.ack(a._id)),a._type){case Nr.CANDIDATE:case Nr.CONTROL:this.signal.emit(c,v,g);break;case Nr.PUBLISH:case Nr.UNPUBLISH:case Nr.RESTART_ICE:case Nr.CALL:v.uid=g,Yr(this.signal,c,v).then(w=>{this.response(a._id,w)}).catch(()=>{this.response(a._id,void 0,!0)});break;case Nr.ACK:this.getListeners("res-@".concat(o,"_ack")).length>0&&this.emit("res-@".concat(o,"_ack"));break;case Nr.RESPONSE:{let{success:w,message:T}=v;this.emit("res-@".concat(o),w?"success":"failed",T);break}}}}splitMessage(a){if(a.length<f_.MAX_MESSAGE_SIZE)return[a];let o=[],{remoteToken:c}=JSON.parse(a),f=Li(6,""),g=0,v=800,w=Math.ceil(a.length/v);for(;a.length>0;){g++;let T={id:f,index:g,total:w,payload:a.slice(0,v),token:"".concat(this.token,"_").concat(c)};JSON.stringify(T).length>f_.MAX_MESSAGE_SIZE?v-=50:(o.push(T),a=a.slice(v))}return o.map(T=>JSON.stringify(T))}handleCheckToken(a,o){return a.token!==o?(z.debug("token changed, from ".concat(a.token," to ").concat(o)),this.reset(a.uid,o),!1):(this.tokenTimeout&&(window.clearTimeout(this.tokenTimeout),this.tokenTimeout=void 0),this.tokenTimeout=window.setTimeout(()=>{z.debug("token timeout, ".concat(o)),this.reset(a.uid)},ve("MAX_P2P_TIMEOUT")),!0)}async handleUserOnline(){let a=await Yr(this.signal,Nr.CALL,void 0),o=await this.send(Nr.CALL,a);this.signal.emit(Ut.P2P_CONNECTION,o,!0)}async reset(a,o){let c=this.userMap.get(a);c&&(this.emit(hb.ABORT),this.signal.emit(Sn.ON_USER_OFFLINE,{uid:c.uid,reason:BAe.P2P_TOKEN_CHANGED}),this._sequence=0,this.userMap.clear(),o||(z.debug("change local token from ".concat(o," to ").concat(o)),this.token=Li(6,"")))}clear(){this._sequence=0,this.userMap.clear(),this.tokenInterval&&window.clearTimeout(this.tokenInterval),this.tokenInterval=void 0,this.tokenTimeout&&window.clearTimeout(this.tokenTimeout),this.tokenTimeout=void 0,this.emit(hb.ABORT)}}X(f_,"MAX_SIZE",1),X(f_,"MAX_MESSAGE_SIZE",1024);class ure extends tr{get connectionState(){return this._connectionState}set connectionState(a){a!==this._connectionState&&(this._connectionState=a,a===zn.CONNECTED?this.emit(Ut.WS_CONNECTED):a===zn.RECONNECTING?this.emit(Ut.WS_RECONNECTING,this._websocketReconnectReason):a===zn.CLOSED&&this.emit(Ut.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket&&this.websocket.url||null}get rtt(){return this.rttRolling.mean()}constructor(a,o){super(),X(this,"_disconnectedReason",void 0),X(this,"_websocketReconnectReason",void 0),X(this,"_connectionState",zn.CLOSED),X(this,"reconnectToken",void 0),X(this,"p2pToken",void 0),X(this,"websocket",void 0),X(this,"openConnectionTime",void 0),X(this,"clientId",void 0),X(this,"lastMsgTime",Date.now()),X(this,"uploadCache",[]),X(this,"uploadCacheInterval",void 0),X(this,"rttRolling",new EG(5)),X(this,"pingpongTimer",void 0),X(this,"pingpongTimeoutCount",0),X(this,"joinResponse",void 0),X(this,"multiIpOption",void 0),X(this,"initError",void 0),X(this,"spec",void 0),X(this,"store",void 0),X(this,"_external_signal",void 0),X(this,"onWebsocketMessage",c=>{if(c.data instanceof ArrayBuffer)return void this.emit(Ut.ON_BINARY_DATA,c.data);let f=JSON.parse(c.data);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(f,"_id")){let g="res-@".concat(f._id);this.emit(g,f._result,f._message)}else if(Object.prototype.hasOwnProperty.call(f,"_type")){switch(f._type){case Sn.ON_DATA_STREAM:return void this.handleDataStream(f._message);case Sn.MUTE_AUDIO:case Sn.MUTE_VIDEO:case Sn.ON_P2P_LOST:case Sn.ON_USER_ONLINE:return;case Sn.ON_USER_OFFLINE:let{uid:g}=f._message;return z.debug("[".concat(this.clientId,"] user-offline uid: ").concat(g)),void this._external_signal.reset(g)}if(this.emit(f._type,f._message),f._type===Sn.ON_NOTIFICATION&&this.handleNotification(f._message),f._type===Sn.ON_USER_BANNED)switch(f._message.error_code){case 14:this.close(Hn.UID_BANNED);break;case 15:this.close(Hn.IP_BANNED);break;case 16:this.close(Hn.CHANNEL_BANNED)}if(f._type===Sn.ON_USER_LICENSE_BANNED)switch(f._message.error_code){case ln.ERR_LICENSE_MISSING:this.close(Hn.LICENSE_MISSING);break;case ln.ERR_LICENSE_EXPIRED:this.close(Hn.LICENSE_EXPIRED);break;case ln.ERR_LICENSE_MINUTES_EXCEEDED:this.close(Hn.LICENSE_MINUTES_EXCEEDED);break;case ln.ERR_LICENSE_PERIOD_INVALID:this.close(Hn.LICENSE_PERIOD_INVALID);break;case ln.ERR_LICENSE_MULTIPLE_SDK_SERVICE:this.close(Hn.LICENSE_MULTIPLE_SDK_SERVICE);break;case ln.ERR_LICENSE_ILLEGAL:this.close(Hn.LICENSE_ILLEGAL);break;default:this.close()}}}),this.clientId=a.clientId,this.spec=a,this.store=o,this.websocket=new HI("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),o),this.handleWebsocketEvents(),window.addEventListener("offline",()=>{this.connectionState===zn.CONNECTED&&this.reconnect("retry",Xs.OFFLINE)}),this.p2pToken=Li(6,""),this._external_signal=new f_(this,this.p2pToken)}async request(a,o,c,f){let g=Li(6,""),v={_id:g,_type:a,_message:o},w=this.websocket.connectionID,T=()=>new Ct((Z,W)=>{if(this.connectionState===zn.CONNECTED)return Z();let K=()=>{this.off(Ut.WS_CLOSED,oe),Z()},oe=()=>{this.off(Ut.WS_CONNECTED,K),W(new Ke(ce.WS_ABORT))};this.once(Ut.WS_CONNECTED,K),this.once(Ut.WS_CLOSED,oe)});if(this.connectionState!==zn.CONNECTING&&this.connectionState!==zn.RECONNECTING||a===rn.JOIN||a===rn.REJOIN||await T(),this.websocket.sendMessage(v,!0),f)return;let R=new Ct((Z,W)=>{let K=!1,oe=(xe,Ne)=>{K=!0,Z({isSuccess:xe==="success",message:Ne||{}}),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.emit(Ut.REQUEST_SUCCESS,a,o)};this.once("res-@".concat(g),oe);let ue=()=>{W(new Ke(ce.WS_ABORT,"type: ".concat(a))),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.off("res-@".concat(g),oe)};this.once(Ut.WS_CLOSED,ue),this.once(Ut.WS_RECONNECTING,ue),_s(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{this.websocket.connectionID!==w||K||(z.warning("[".concat(this.clientId,"] ws request timeout, type: ").concat(a)),this.emit(Ut.REQUEST_TIMEOUT,a,o))})}),A=null;try{A=await R}catch(Z){if(this.connectionState===zn.CLOSED||a===rn.LEAVE)throw new Ke(ce.WS_ABORT);return!this.spec.forceWaitGatewayResponse||c?Z.throw():a===rn.JOIN||a===rn.REJOIN?null:(await T(),await this.request(a,o))}if(A.isSuccess)return A.message;let L=Number(A.message.error_code||A.message.code),U=h_(L),F=new Ke(ce.UNEXPECTED_RESPONSE,"".concat(U.desc,": ").concat(A.message.error_str),{code:L,data:A.message});return U.action==="success"?A.message:(z.warning("[".concat(this.clientId,"] [").concat(this.websocket.connectionID,"] unexpected response from type ").concat(a,", error_code: ").concat(L,", message: ").concat(U.desc,", action: ").concat(U.action)),L===ln.ERR_TOO_MANY_BROADCASTERS?((a===rn.JOIN||a===rn.REJOIN)&&(this.initError=F,this.close()),F.throw()):U.action==="failed"?F.throw():U.action==="quit"?(this.initError=F,this.close(),F.throw()):(L===ln.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=A.message.option,z.warning("[".concat(this.clientId,"] detect multi ip, recover")),this.reconnect("recover",Xs.MULTI_IP)):this.reconnect(U.action,Xs.SERVER_ERROR),a===rn.JOIN||a===rn.REJOIN?null:await this.request(a,o)))}waitMessage(a,o){return new Ct(c=>{let f=g=>{(!o||o(g))&&(this.off(a,f),c(g))};this.on(a,f)})}uploadWRTCStats(a){if(!this.store.sessionId)return void z.warn("[".concat(this.clientId,"] no session id when upload wrtc stats"));let o={lts:Date.now(),sid:this.store.sessionId,uid:this.store.intUid,stats:a};this.upload(u_.WRTC_STATS,o)}upload(a,o){let c={_type:a,_message:o};try{this.websocket.sendMessage(c)}catch{let f=ve("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(c),this.uploadCache.length>f&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval(()=>{if(this.connectionState!==zn.CONNECTED)return;let g=this.uploadCache.splice(0,1)[0];this.uploadCache.length===0&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(g._type,g._message)},ve("UPLOAD_CACHE_INTERVAL")||2e3))}}send(a,o){let c={_type:a,_message:o};this.websocket.sendMessage(c)}async sendExtensionMessage(a,o,c){return await this._external_signal.send(a,o,c)}init(a){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Ct((o,c)=>{this.once(Ut.WS_CONNECTED,()=>o(this.joinResponse)),this.once(Ut.WS_CLOSED,()=>c(this.initError||new Ke(ce.WS_ABORT))),this.connectionState=zn.CONNECTING,this.websocket.init(a).catch(c)})}close(a){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._external_signal.clear(),this._disconnectedReason=a||Hn.LEAVE,this.connectionState=zn.CLOSED,z.debug("[".concat(this.clientId,"] ")+"will close websocket in signal"),this.websocket.close(),a===Hn.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new HI("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),this.store),this.handleWebsocketEvents()),this.p2pToken=Li(6,""),this._external_signal.clear(),this._external_signal=new f_(this,this.p2pToken)}async join(){if(!this.joinResponse){this.emit(Ut.ABORT_P2P_EXECUTION);let a=await Yr(this,Ut.REQUEST_JOIN_INFO),o=await this.request(rn.JOIN,a);if(!o)return this.emit(Ut.REPORT_JOIN_GATEWAY,ce.TIMEOUT,this.url||""),!1;this.joinResponse=o,this.emit(Ut.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=zn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}reconnect(a,o){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(a,o)}handleDataStream(a){try{var o;let c=l_(a.payload),f=new TextDecoder().decode(c),g=JSON.parse(f);"total"in g&&"id"in g||Tt(o=Object.values(Nr)).call(o,g._type)?(g._uid=a.uid,this._external_signal.onMessage(g)):this.emit(Sn.ON_DATA_STREAM,a)}catch{this.emit(Sn.ON_DATA_STREAM,a)}}handleNotification(a){z.debug("[".concat(this.clientId,"] receive notification: "),a);let o=h_(a.code);if(o.action!=="success"){if(o.action!=="failed")return o.action==="quit"?(o.desc==="ERR_REPEAT_JOIN_CHANNEL"&&this.close(Hn.UID_BANNED),void this.close()):void this.reconnect(o.action,Xs.SERVER_ERROR);z.error("[".concat(this.clientId,"] ignore error: "),o.desc)}}handlePingPong(){if(!this.websocket||this.websocket.state!=="connected")return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;let a=ve("PING_PONG_TIME_OUT"),o=Date.now();this.pingpongTimeoutCount>=a&&(z.warning("[".concat(this.clientId,"] PINGPONG Timeout. Last Socket Message: ").concat(o-this.lastMsgTime,"ms")),o-this.lastMsgTime>ve("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",Xs.TIMEOUT):this.request(rn.PING,void 0,!0).then(()=>{this.pingpongTimeoutCount=0;let c=Date.now()-o;this.rttRolling.add(c),ve("REPORT_STATS")&&this.send(rn.PING_BACK,{pingpongElapse:c})}).catch(c=>{})}handleWebsocketEvents(){this.websocket.on(_n.RECONNECT_WAITTING_FINISH,a=>{this.emit(Ut.WS_RECONNECT_WAITTING_FINISH,a)}),this.websocket.on(_n.RECONNECT_CREATE_CONNECTION,a=>{this.emit(Ut.WS_RECONNECT_CREATE_CONNECTION,a)}),this.websocket.on(_n.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(_n.CLOSED,()=>{this.connectionState=zn.CLOSED}),this.websocket.on(_n.FAILED,()=>{this._disconnectedReason=Hn.NETWORK_ERROR,this.connectionState=zn.CLOSED}),this.websocket.on(_n.RECONNECTING,a=>{this._websocketReconnectReason=a,this.joinResponse=void 0,this.connectionState===zn.CONNECTED?this.connectionState=zn.RECONNECTING:this.connectionState=zn.CONNECTING}),this.websocket.on(_n.WILL_RECONNECT,(a,o,c)=>{a!=="retry"?(z.debug("".concat(this.clientId," websocket will_connect event, renewSession reconnectMode is ").concat(a)),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION)):z.debug("".concat(this.clientId," reconnect mode is retry, no need to renew session")),c(a)}),this.websocket.on(_n.CONNECTED,()=>{this.openConnectionTime=Date.now(),this.join().catch(a=>{if(this.emit(Ut.REPORT_JOIN_GATEWAY,a.message||a.code,this.url||""),a instanceof Ke&&a.code===ce.UNEXPECTED_RESPONSE&&a.data.code===ln.ERR_NO_AUTHORIZED)return z.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),void this.reconnect("recover",Xs.SERVER_ERROR);z.error("[".concat(this.clientId,"] join gateway request failed"),a.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",Xs.SERVER_ERROR):(this.initError=a,this.close())})}),this.websocket.on(_n.REQUEST_NEW_URLS,(a,o)=>{Yr(this,Ut.REQUEST_RECOVER,this.multiIpOption).then(a).catch(o)}),this.websocket.on(_n.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{this.emit(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE)})}}function hre(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Cu(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?hre(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):hre(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let FG=new Map;class JAe extends tr{get state(){return this._state}set state(a){if(a===this._state)return;let o=this._state;this._state=a,a==="DISCONNECTED"&&this._disconnectedReason?this.emit(Ir.CONNECTION_STATE_CHANGE,a,o,this._disconnectedReason):this.emit(Ir.CONNECTION_STATE_CHANGE,a,o)}get joinGatewayStartTime(){return this._joinGatewayStartTime}set joinGatewayStartTime(a){z.debug("[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(a)),this._joinGatewayStartTime=a}constructor(a,o){super(),X(this,"store",void 0),X(this,"joinInfo",void 0),X(this,"key",void 0),X(this,"ntpOffset",0),X(this,"signal",void 0),X(this,"role",void 0),X(this,"inChannelInfo",{joinAt:null,duration:0}),X(this,"spec",void 0),X(this,"_state","DISCONNECTED"),X(this,"_statsCollector",void 0),X(this,"_disconnectedReason",void 0),X(this,"isSignalRecover",!1),X(this,"hasChangeBGPAddress",!1),X(this,"trafficStatsInterval",void 0),X(this,"networkQualityInterval",void 0),X(this,"_joinGatewayStartTime",0),X(this,"_signalTimeout",!1),X(this,"_clientRoleOptions",void 0),X(this,"_isProactiveJoin",!1),this.store=a,this.spec=o,this.signal=this.store.useP2P?new ure(Cu(Cu({},o),{},{retryConfig:o.websocketRetryConfig}),a):this.store.useDataChannel?new Rm(Cu(Cu({},o),{},{retryConfig:o.websocketRetryConfig}),a):new rre(Cu(Cu({},o),{},{retryConfig:o.websocketRetryConfig}),a),this._statsCollector=o.statsCollector,this.role=o.role||"audience",this._clientRoleOptions=o.clientRoleOptions,this.handleSignalEvents()}async join(a,o,c){if(this.signal instanceof Rm){let T=!1;a.cloudProxyServer!=="disabled"?(z.debug("[".concat(this.store.clientId,"] Dc is not supported, because cloudProxyServer are not supported (").concat(a.cloudProxyServer,")")),T=!0):"".concat(a.apResponse.cid,"_").concat(a.apResponse.cert).length>255||"".concat(a.apResponse.cid,"_").concat(a.apResponse.cert).length<22?(z.debug("[".concat(this.store.clientId,"] Dc is not supported, because ticket length is incorrect, it has to be between 22 and 255")),T=!0):a.apResponse.addresses.some(R=>R.fingerprint)||ve("FINGERPRINT")||(z.debug("[".concat(this.store.clientId,"] Dc is not supported, because fingerprint does not exist")),T=!0),T&&this.resetSignal()}this.store.joinGatewayStart(),a.cloudProxyServer!=="disabled"&&(this.hasChangeBGPAddress=!0);let f=Date.now(),g=FG.get(a.cname);if(g||(g=new Map,FG.set(a.cname,g)),this._isProactiveJoin=!0,g.has(a.uid)){let T=new De(ce.UID_CONFLICT);throw $t.joinGateway(a.sid,{lts:f,succ:!1,ec:T.message,addr:null,uid:a.uid,cid:a.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!a.proxyServer,signalChannel:this.signal instanceof Rm?"1":"0"}),this._isProactiveJoin=!1,T}g.set(a.uid,!0),this.joinInfo=a,this.key=o;let v=0;this.joinGatewayStartTime=f;let w=a.proxyServer;try{let T;if(z.debug("[".concat(this.store.clientId,"] use ").concat(this.signal instanceof Rm?"datachannel":"websocket"," join uid ").concat(v)),this.signal instanceof Rm)T=await this.signal.init(a.apResponse.addresses,c);else{let R=a.gatewayAddrs.map(A=>{let{address:L}=A,[U,F]=L.split(":"),Z={host:U,port:F};return a.proxyServer&&(Z.proxy=a.proxyServer),Z});T=await this.signal.init(R,c)}v=T.uid,z.debug("[".concat(this.store.clientId,"] ").concat(this.signal instanceof Rm?"datachannel":"websocket"," join uid ").concat(v," cost ").concat(Date.now()-this.joinGatewayStartTime))}catch(T){throw T&&T.code===ce.INIT_WEBSOCKET_TIMEOUT?(z.warning("[".concat(this.store.clientId,"] User join failed"),T.toString()),T):T&&T.code===ce.INIT_DATACHANNEL_TIMEOUT?(z.warning("[".concat(this.store.clientId,"] User join datachannel failed"),T.toString()),this.resetSignal(),T):(z.error("[".concat(this.store.clientId,"] User join failed"),T.toString()),$t.joinGateway(a.sid,{lts:f,succ:!1,ec:T.message,addr:this.signal.url,uid:a.uid,cid:a.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!w,signalChannel:this.signal instanceof Rm?"1":"0"}),this._isProactiveJoin=!1,g.delete(a.uid),this.signal.close(),T)}return this.state="CONNECTED",this.inChannelInfo.joinAt=Date.now(),z.debug("[".concat(this.store.clientId,"] Connected to gateway server")),this.trafficStatsInterval=window.setInterval(()=>{this.updateTrafficStats().catch(T=>{z.warning("[".concat(this.store.clientId,"] get traffic stats error"),T.toString())})},3e3),this.networkQualityInterval=window.setInterval(()=>{navigator&&navigator.onLine!==void 0&&!navigator.onLine?this.emit(Ir.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6}):this._signalTimeout?this.emit(Ir.NETWORK_QUALITY,{downlinkNetworkQuality:5,uplinkNetworkQuality:5}):this.state==="CONNECTED"&&this._statsCollector.trafficStats?this.emit(Ir.NETWORK_QUALITY,{uplinkNetworkQuality:ore(this._statsCollector.trafficStats.B_unq),downlinkNetworkQuality:ore(this._statsCollector.trafficStats.B_dnq)}):this.emit(Ir.NETWORK_QUALITY,{uplinkNetworkQuality:0,downlinkNetworkQuality:0})},2e3),this.store.joinGatewayEnd(),v}async leave(){let a=arguments.length>0&&arguments[0]!==void 0&&arguments[0],o=arguments.length>1?arguments[1]:void 0;if(this.state!=="DISCONNECTED"){o!==Hn.FALLBACK&&(this.state="DISCONNECTING");try{a||this.signal.connectionState!==zn.CONNECTED||await function(c,f){return f===1/0?c:Ct.race([c,Uxe(f)])}(this.signal.request(rn.LEAVE,void 0,!0),3e3)}catch(c){z.warning("[".concat(this.store.clientId,"] leave request failed, ignore"),c)}this.signal.close(o),o!==Hn.FALLBACK&&(this.state="DISCONNECTED"),this.reset()}}async publish(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));let f={state:"offer",p2p_id:this.store.p2pId,ortc:o,mode:this.spec.mode,extend:ve("PUB_EXTEND"),twcc:!!ve("PUBLISH_TWCC"),rtx:!!ve("USE_PUB_RTX")};try{return(await this.signal.request(rn.PUBLISH,f,!0))._message}catch(g){if(c&&g.data&&g.data.code===ln.ERR_PUBLISH_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receive publish error code, retry"),g.toString()),await this.tryUnpubBeforeRepub(a,o),this.publish(a,o,!1);throw g}}async publishDataChannel(a,o,c){var f;if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));let g={stream_id:o.streamId,ordered:o.ordered?1:0,max_retrans_times:(f=o.maxRetransmits)!==null&&f!==void 0?f:10,channel_id:o.channelId,metadata:o.metadata};try{await this.signal.request(rn.PUBLISH_DATASTREAM,g,!0)}catch(v){if(c&&v.data&&v.data.code===ln.ERR_PUBLISH_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receive publish datachannels error code, retry"),v.toString()),await this.tryUnpubDataChannelBeforeRepub(a,o),this.publishDataChannel(a,o,!1);throw v}}async unpublish(a,o){try{if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await this.signal.request(rn.UNPUBLISH,{stream_id:o,ortc:a},!0)}catch(c){z.warning("[".concat(this.store.clientId,"] unpublish warning: "),c)}}async unpublishDataChannel(a){try{if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await Ct.all(a.map(o=>this.signal.request(rn.UNPUBLISH_DATASTREAM,{channel_id:o},!0)))}catch(o){z.warning("unpublish datachannels warning: ",o)}}async presubscribe(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not presubscribe when connection state is ".concat(this.state));let f={stream_id:a,stream_type:o,mode:this.spec.mode,codec:this.spec.codec,p2p_id:this.store.p2pId,twcc:!!ve("SUBSCRIBE_TWCC"),rtx:!!ve("USE_SUB_RTX")||void 0,extend:ve("SUB_EXTEND"),svc:Array.isArray(ve("SVC"))&&ve("SVC").length!==0?ve("SVC"):void 0};try{return await this.signal.request(rn.PRE_SUBSCRIBE,f,!0)}catch(g){if(c&&g.data&&g.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] pre-subscribe error, retry"),g.toString()),this.presubscribe(a,o,!1);throw g}}async subscribe(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not subscribe when connection state is ".concat(this.state));let f={stream_id:a,stream_type:o.stream_type,mode:this.spec.mode,codec:this.spec.codec,p2p_id:this.store.p2pId,twcc:!!ve("SUBSCRIBE_TWCC"),rtx:!!ve("USE_SUB_RTX"),extend:ve("SUB_EXTEND"),ssrcId:o.ssrcId,svc:Array.isArray(ve("SVC"))&&ve("SVC").length!==0?ve("SVC"):void 0};try{return(await this.signal.request(rn.SUBSCRIBE,f,!0))._message}catch(g){if(c&&g.data&&g.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receiver subscribe error code, retry"),g.toString()),await this.tryUnsubBeforeResub(a,o),await this.subscribe(a,o,!1);throw g}}async subscribeDataChannel(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not subscribe datachannel when connection state is ".concat(this.state));let f={uid:a,stream_id:o.id,channel_id:o.datachannelId};try{return void await this.signal.request(rn.SUBSCRIBE_DATASTREAM,f,!0)}catch(g){if(c&&g.data&&g.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receiver subscribe datachannel error code, retry"),g.toString()),await this.tryUnsubDataChannelBeforeResub(a,o),await this.subscribeDataChannel(a,o,!1);throw g}}async subscribeAll(a,o){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not massSubscribe when connection state is ".concat(this.state));let c={p2p_id:this.store.p2pId,users:a,dtx:!1,rtx:!!ve("USE_SUB_RTX"),twcc:!!ve("SUBSCRIBE_TWCC"),svc:Array.isArray(ve("SVC"))&&ve("SVC").length!==0?ve("SVC"):void 0};try{return await this.signal.request(rn.SUBSCRIBE_STREAMS,c,!0)}catch(f){if(o&&f.data&&f.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receiver massSubscribe error code, retry"),f.toString()),await this.tryMassUnsubBeforeResub(a),await this.subscribeAll(a,!1);throw f}}async setVideoProfile(a){let o=function(c){if(!(c.bitrateMax&&c.bitrateMin&&c.frameRate&&c.height&&c.width))return;let f=c.frameRate,g=c.width,v=c.height,w=!0;return typeof f!="number"&&(f=f.exact||f.ideal||f.max||f.min||0,f||(w=!1)),typeof g!="number"&&(g=g.exact||g.ideal||g.max||g.min||0,g||(w=!1)),typeof v!="number"&&(v=v.exact||v.ideal||v.max||v.min||0,f||(w=!1)),w?{stream_type:0,width:g,height:v,fps:f,start_bps:1e3*c.bitrateMax,min_bps:1e3*c.bitrateMin,target_bps:1e3*c.bitrateMax}:void 0}(a);if(o)return this.signal.request(rn.SET_VIDEO_PROFILE,o);z.debug("[".concat(this.store.clientId,"] encoder config is not complete, do not report to gateway"))}async unsubscribe(a,o){try{await this.signal.request(rn.UNSUBSCRIBE,{p2p_id:this.store.p2pId,ortc:a,stream_id:o},!0)}catch(c){z.warning("[".concat(this.store.clientId,"] unsubscribe warning: "),c)}}async unsubscribeDataChannel(a,o){try{if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await Ct.all(a.map(c=>this.signal.request(rn.UNSUBSCRIBE_DATASTREAM,{stream_id:c,uid:o},!0)))}catch(c){z.warning("unsubscribeDataChannel warning: ",c)}}async massUnsubscribe(a){try{await this.signal.request(rn.UNSUBSCRIBE_STREAMS,a,!0)}catch(o){z.warning("[".concat(this.store.clientId,"] massUnsubscribeAll warning: "),o)}}async reconnectPC(a){let{iceParameters:o,dtlsParameters:c,rtpCapabilities:f}=a;return{gatewayEstablishParams:await this.signal.request(rn.CONNECT_PC,{p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:{iceParameters:o,dtlsParameters:c,rtpCapabilities:f}},!0),gatewayAddress:this.getCurrentGatewayAddress()}}getGatewayInfo(){return this.signal.request(rn.GATEWAY_INFO)}async renewToken(a){await this.signal.request(rn.RENEW_TOKEN,a),this.key=a.token}async setClientRole(a,o){if(o&&(this._clientRoleOptions=Object.assign({},o)),this.state!=="CONNECTED")return void(this.role=a);let c,f=0;a==="audience"?this._clientRoleOptions&&this._clientRoleOptions.delay?(c=this._clientRoleOptions.delay,f=1):f=this._clientRoleOptions&&this._clientRoleOptions.level?this._clientRoleOptions.level:2:f=0,await this.signal.request(rn.SET_CLIENT_ROLE,{role:a,level:f,delay:c,client_ts:Date.now()}),this.role=a}async setRemoteVideoStreamType(a,o){await this.signal.request(rn.SWITCH_VIDEO_STREAM,{stream_id:a,stream_type:o})}async setDefaultRemoteVideoStreamType(a){await this.signal.request(rn.DEFAULT_VIDEO_STREAM,{stream_type:a})}async setStreamFallbackOption(a,o){await this.signal.request(rn.SET_FALLBACK_OPTION,{stream_id:a,fallback_type:o})}async pickSVCLayer(a,o){await this.signal.request(rn.PICK_SVC_LAYER,{stream_id:a,spatial_layer:o.spatialLayer,temporal_layer:o.temporalLayer})}async setRTM2Flag(a){await this.signal.request(rn.SET_RTM2_FLAG,{rtm2_flag:a})}async sendExtensionMessage(a,o,c){if(this.signal instanceof ure)return this.signal.sendExtensionMessage(a,o,c)}getInChannelInfo(){return this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt),Cu({},this.inChannelInfo)}async getGatewayVersion(){return(await this.signal.request(rn.GATEWAY_INFO)).version}reset(){if(this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt,this.inChannelInfo.joinAt=null),this.trafficStatsInterval&&(window.clearInterval(this.trafficStatsInterval),this.trafficStatsInterval=void 0),this.joinInfo){let a=FG.get(this.joinInfo.cname);a&&a.delete(this.joinInfo.uid)}this.joinInfo=void 0,this.key=void 0,this.networkQualityInterval&&(window.clearInterval(this.networkQualityInterval),this.networkQualityInterval=void 0)}updateTurnConfigFromSignal(){if(!this.joinInfo)return;let a=function(o){let c;return c=o.startsWith("dc")?o.match(/(dc\:\/\/)?([^:]+):(\d+)/):o.match(/(wss\:\/\/)?([^:]+):(\d+)/),c?{username:Js.username,password:Js.password,turnServerURL:c[2],tcpport:parseInt(c[3])+30,udpport:parseInt(c[3])+30,forceturn:!1}:null}((this.joinInfo.cloudProxyServer==="disabled"?this.signal.url:this.joinInfo.gatewayAddrs[this.signal.currentURLIndex].address)||"");this.joinInfo.turnServer.serversFromGateway=[],a&&this.joinInfo.turnServer.mode!=="off"&&this.joinInfo.cloudProxyServer==="disabled"&&this.joinInfo.turnServer.serversFromGateway.push(Cu(Cu({},Js),{},{turnServerURL:a.turnServerURL,tcpport:a.tcpport,udpport:a.udpport,username:this.joinInfo.uid.toString(),password:this.joinInfo.token}))}async updateTrafficStats(){if(this.state!=="CONNECTED")return;let a=await this.signal.request(rn.TRAFFIC_STATS,void 0,!0);a.timestamp=Date.now(),a.ntp_offset!=null&&(this.ntpOffset=a.ntp_offset),a.peer_delay.forEach(o=>{let c=this._statsCollector.trafficStats&&this._statsCollector.trafficStats.peer_delay.find(f=>f.peer_uid===o.peer_uid);c&&c.B_st!==o.B_st&&lk(()=>{this.emit(Ir.STREAM_TYPE_CHANGE,o.peer_uid,o.B_st)})}),this._statsCollector.updateTrafficStats(a)}getJoinMessage(a){if(!this.joinInfo||!this.key)throw new De(ce.UNEXPECTED_ERROR,"can not generate join message, no join info");let o=Object.assign({},this.joinInfo.apResponse),c=ve("REPORT_APP_SCENARIO");if(typeof c!="string")try{c=JSON.stringify(c)}catch{c=void 0}c&&c.length>128&&(c=void 0);let f=Cu({license:this.joinInfo.license,p2p_id:this.store.p2pId,session_id:this.joinInfo.sid,app_id:this.joinInfo.appId,channel_key:this.key,channel_name:this.joinInfo.cname,sdk_version:pd,browser:navigator.userAgent,process_id:ve("PROCESS_ID"),mode:this.store.useP2P?"p2p":this.spec.mode,codec:this.spec.codec,role:this.role,has_changed_gateway:this.hasChangeBGPAddress,ap_response:o,extend:ve("JOIN_EXTEND"),details:{6:this.joinInfo.stringUid,cservice_map:this.joinInfo.cloudProxyServer==="proxy3"?"1":this.joinInfo.cloudProxyServer==="proxy5"?"2":void 0},features:{rejoin:!0},optionalInfo:this.joinInfo.optionalInfo,appScenario:c,attributes:{userAttributes:{enablePublishedUserList:ve("ENABLE_PUBLISHED_USER_LIST"),maxSubscription:ve("MAX_SUBSCRIPTION"),subscribeAudioFilterTopN:typeof ve("SUBSCRIBE_AUDIO_FILTER_TOPN")=="number"?ve("SUBSCRIBE_AUDIO_FILTER_TOPN"):void 0,enablePublishAudioFilter:typeof ve("ENABLE_PUBLISH_AUDIO_FILTER")=="boolean"?ve("ENABLE_PUBLISH_AUDIO_FILTER"):void 0,enableUserLicenseCheck:typeof ve("ENABLE_USER_LICENSE_CHECK")=="boolean"?ve("ENABLE_USER_LICENSE_CHECK"):void 0,enableRTX:ve("USE_PUB_RTX")===!0||ve("USE_SUB_RTX")===!0||void 0,disableFEC:ve("DISABLE_FEC"),enableNTPReport:!!ve("ENABLE_NTP_REPORT")||void 0,enableInstantVideo:!!ve("ENABLE_INSTANT_VIDEO")||void 0,enableDataStream2:typeof ve("ENABLE_DATASTREAM_2")=="boolean"?ve("ENABLE_DATASTREAM_2"):void 0,rtm2Flag:typeof this.joinInfo.rtmFlag=="number"?this.joinInfo.rtmFlag:void 0,enableUserAutoRebalanceCheck:!!ve("ENABLE_USER_AUTO_REBALANCE_CHECK"),enableXR:typeof ve("USE_XR")=="boolean"?ve("USE_XR"):void 0,enableLossbasedBwe:typeof ve("ENABLE_LOSSBASED_BWE")=="boolean"?ve("ENABLE_LOSSBASED_BWE"):void 0,enableAutCC:typeof ve("ENABLE_AUT_CC")=="boolean"?ve("ENABLE_AUT_CC"):void 0,enableCCFallback:typeof ve("ENABLE_CC_FALLBACK")=="boolean"?ve("ENABLE_CC_FALLBACK"):void 0}},join_ts:this.joinGatewayStartTime},a);return this.joinInfo.stringUid&&(f.string_uid=this.joinInfo.stringUid),this.joinInfo.aesmode&&this.joinInfo.aespassword&&(f.aes_mode=this.joinInfo.aesmode,ve("ENCRYPT_AES")?(f.aes_secret=this.joinInfo.aespassword,f.aes_encrypt=!0):f.aes_secret=this.joinInfo.aespassword,this.joinInfo.aessalt&&(f.aes_salt=this.joinInfo.aessalt)),o.addresses[this.signal.websocket.currentURLIndex]&&(f.ap_response.ticket=o.addresses[this.signal.websocket.currentURLIndex].ticket,delete o.addresses),this.joinInfo.defaultVideoStream!==void 0&&(f.default_video_stream=this.joinInfo.defaultVideoStream),f}getRejoinMessage(){if(!this.joinInfo)throw new De(ce.UNEXPECTED_ERROR,"can not generate rejoin message, no join info");return{session_id:this.joinInfo.sid,channel_name:this.joinInfo.cname,cid:this.joinInfo.cid,uid:this.joinInfo.uid,vid:Number(this.joinInfo.vid)}}handleSignalEvents(){this.signal.on(Ut.WS_RECONNECT_WAITTING_FINISH,a=>{var o;Tt(o=["tryNext","recover"]).call(o,a)&&this.joinInfo&&$t.adjustSessionStartTime(this.joinInfo.sid)}),this.signal.on(Ut.WS_RECONNECT_CREATE_CONNECTION,a=>{this.joinGatewayStartTime=Date.now()}),this.signal.on(Ut.WS_RECONNECTING,a=>{this.joinInfo&&$t.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:a||Xs.NETWORK_ERROR}),this.joinInfo&&(this.state="RECONNECTING",$t.sessionInit(this.joinInfo.sid,{lts:new Date().getTime(),extend:this.isSignalRecover?{recover:!0}:{rejoin:!0},cname:this.joinInfo.cname,appid:this.joinInfo.appId,mode:this.spec.mode,stringUid:this.joinInfo.stringUid,channelProfile:this.spec.mode==="live"?1:0,channelMode:0,lsid:this.joinInfo.sid,clientRole:this.role==="audience"?2:1,buildFormat:1}),this.isSignalRecover=!1,this.joinGatewayStartTime=Date.now())}),this.signal.on(Ut.WS_CLOSED,a=>{let o;switch(a){case Hn.LEAVE:o=Xs.LEAVE;break;case Hn.UID_BANNED:case Hn.IP_BANNED:case Hn.CHANNEL_BANNED:case Hn.SERVER_ERROR:o=Xs.SERVER_ERROR;break;case Hn.FALLBACK:o=Xs.FALLBACK;break;case Hn.LICENSE_MISSING:case Hn.LICENSE_EXPIRED:case Hn.LICENSE_MINUTES_EXCEEDED:case Hn.LICENSE_PERIOD_INVALID:case Hn.LICENSE_MULTIPLE_SDK_SERVICE:case Hn.LICENSE_ILLEGAL:case Hn.TOKEN_EXPIRE:o=a;break;default:o=Xs.NETWORK_ERROR}z.debug("[".concat(this.store.clientId,"] [signal] websocket closed, reason: ").concat(o||"undefined -> "+Xs.NETWORK_ERROR)),this.joinInfo&&$t.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:a===Hn.LEAVE?1:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:o}),this._disconnectedReason=a,a!==Hn.FALLBACK&&(this.state="DISCONNECTED"),this.reset()}),this.signal.on(Ut.WS_CONNECTED,()=>{if(this.updateTurnConfigFromSignal(),this.state="CONNECTED",this.joinInfo&&(this.role==="audience"&&this._clientRoleOptions&&(this._clientRoleOptions.level||this._clientRoleOptions.delay)&&(z.debug("[".concat(this.store.clientId,"] patch to send set client role, role: ").concat(this.role,", mode: ").concat(this.spec.mode,", level: ").concat(this._clientRoleOptions.level,", delay: ").concat(this._clientRoleOptions.delay)),this.setClientRole(this.role,this._clientRoleOptions)),$t.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!0,ec:null,vid:this.joinInfo.vid,addr:this.signal.url,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer,signalChannel:this.signal instanceof Rm?"1":"0"}),this._isProactiveJoin=!1,this.joinInfo.useLocalAccessPoint&&this.joinInfo.setLocalAPVersion===1)){let a=this.signal.url&&this.signal.url.match(/wss\:\/\/([^:]+):(\d+)/);if(!a)return void z.error("[".concat(this.store.clientId,"] set local access point after joined failed: ").concat(a));Ri("EVENT_REPORT_DOMAIN",a[1]),Ri("EVENT_REPORT_BACKUP_DOMAIN",a[1]),Ri("LOG_UPLOAD_SERVER","".concat(a[1],":6444"))}}),this.signal.on(Sn.ON_UPLINK_STATS,a=>{this._statsCollector.updateUplinkStats(a)}),this.signal.on(Ut.REQUEST_RECOVER,(a,o,c)=>{if(!this.joinInfo)return c(new De(ce.UNEXPECTED_ERROR,"gateway: can not recover, no join info"));a&&(this.joinInfo.multiIP=a,this.hasChangeBGPAddress=!0),this.isSignalRecover=!0,Yr(this,Ir.REQUEST_NEW_GATEWAY_LIST).then(o).catch(c)}),this.signal.on(Ut.REQUEST_JOIN_INFO,async a=>{var o;if(this.updateTurnConfigFromSignal(),this.store.useP2P)return void a(this.getJoinMessage({ortc:{}}));let{iceParameters:c,dtlsParameters:f,rtpCapabilities:g}=await Yr(this,Ir.REQUEST_P2P_CONNECTION_PARAMS,{turnServer:(o=this.joinInfo)===null||o===void 0?void 0:o.turnServer});a(this.getJoinMessage({ortc:{iceParameters:c,dtlsParameters:f,rtpCapabilities:g,version:"2"}}))}),this.signal.on(Ut.REQUEST_REJOIN_INFO,a=>{a(this.getRejoinMessage())}),this.signal.on(Ut.REPORT_JOIN_GATEWAY,(a,o)=>{this.joinInfo&&($t.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!1,ec:a,addr:o,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer,signalChannel:this.signal instanceof Rm?"1":"0"}),this._isProactiveJoin=!1)}),this.signal.on(Ut.IS_P2P_DISCONNECTED,a=>{a(a_(this,Ir.IS_P2P_DISCONNECTED))}),this.signal.on(Ut.DISCONNECT_P2P,()=>{this.emit(Ir.DISCONNECT_P2P)}),this.signal.on(Ut.NEED_RENEW_SESSION,a=>{this.emit(Ir.NEED_RENEW_SESSION,a)}),this.signal.on(Ut.REQUEST_SUCCESS,()=>{this._signalTimeout=!1}),this.signal.on(Ut.REQUEST_TIMEOUT,()=>{this._signalTimeout=!0}),this.signal.on(Ut.JOIN_RESPONSE,a=>{let o=this.getCurrentGatewayAddress();this.emit(Ir.JOIN_RESPONSE,a,o)}),this.signal.on(Ut.DATACHANNEL_PRECONNECT,async(a,o,c)=>{this.updateTurnConfigFromSignal();let f=this.getCurrentGatewayAddress();return Yr(this,Ir.DATACHANNEL_PRECONNECT,a,f).then(o).catch(c)}),this.signal.on(Ut.DATACHANNEL_CONNECTING,async a=>{let{iceParameters:o,dtlsParameters:c,rtpCapabilities:f}=await Yr(this,Ir.REQUEST_DC_CONNECTION_PARAMS);a(this.getJoinMessage({ortc:{iceParameters:o,dtlsParameters:c,rtpCapabilities:f,version:"2"}}))}),this.signal.on(Ut.DATACHANNEL_FAILBACK,()=>{z.warning("[".concat(this.store.clientId,"] User join datachannel failed")),this.reset(),this.resetSignal(),this.emit(Ir.DATACHANNEL_FAILBACK)})}async tryUnsubBeforeResub(a,o){try{await this.signal.request(rn.UNSUBSCRIBE,{p2p_id:this.store.p2pId,stream_id:a,ortc:[o]},!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] tryUnsubBeforeResub warning"),c),c}}async tryUnsubDataChannelBeforeResub(a,o){try{await this.signal.request(rn.UNSUBSCRIBE,{stream_id:o.id},!0)}catch(c){throw z.warning("unsubscribe datachannel warning",c),c}}async tryUnpubBeforeRepub(a,o){try{await this.signal.request(rn.UNPUBLISH,{stream_id:a,ortc:o},!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] tryUnpubBeforeRepub warning: "),c),c}}async tryUnpubDataChannelBeforeRepub(a,o){try{await this.signal.request(rn.UNPUBLISH_DATASTREAM,{channnel_id:o.channelId},!0)}catch(c){throw z.warning("unpublish datastream warning: ",c),c}}async tryMassUnsubBeforeResub(a){let o={users:a.map(c=>({stream_id:c.stream_id,stream_type:c.stream_type}))};try{await this.signal.request(rn.UNSUBSCRIBE_STREAMS,o,!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] tryMassUnsubBeforeResub warning"),c),c}}async muteLocal(a,o){let c={action:a.find(f=>f.stream_type===mi.Audio)?"mute_local_audio":"mute_local_video",p2p_id:this.store.p2pId,ortc:a,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway muteLocal warning: "),f),f}}async unmuteLocal(a,o){let c={action:a.find(f=>f.stream_type===mi.Audio)?"unmute_local_audio":"unmute_local_video",p2p_id:this.store.p2pId,ortc:a,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway unmuteLocal warning: "),f),f}}async muteRemote(a,o){let c={action:a===Wt.AUDIO?"mute_remote_audio":"mute_remote_video",p2p_id:this.store.p2pId,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway muteRemote warning: "),f),f}}async unmuteRemote(a,o){let c={action:a===Wt.AUDIO?"unmute_remote_audio":"unmute_remote_video",p2p_id:this.store.p2pId,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway unmuteRemote warning: "),f),f}}uploadWRTCStats(a){this.signal.uploadWRTCStats(a)}upload(a,o){this.signal.upload(a,o)}getSignalRTT(){return this.signal.rtt}async restartICE(a){let o={p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:a};try{return await this.signal.request(rn.RESTART_ICE,o,!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] P2PChannel.restartICE warning: "),c),c}}reconnect(){this.state==="CONNECTED"&&this.signal.reconnect(void 0,Xs.P2P_FAILED)}getCurrentGatewayAddress(){var a;if(!ve("GATEWAY_WSS_ADDRESS"))return(a=this.joinInfo)!==null&&a!==void 0&&a.gatewayAddrs?this.joinInfo.gatewayAddrs[this.signal.currentURLIndex]:void 0}async setPublishAudioFilterEnabled(a){await this.signal.request(rn.SET_PARAMETER,{enablePublishAudioFilter:a})}resetSignal(){this.signal&&(this.signal.removeAllListeners(),this.signal.close(Hn.FALLBACK)),this.store.useDataChannel=!1,this.signal=new rre(Cu(Cu({},this.spec),{},{retryConfig:this.spec.websocketRetryConfig}),this.store),this.handleSignalEvents(),this.emit(Ir.RESET_SIGNAL,Xie.websocket)}}let Sk=0,BG=0;function Dh(r,a,o,c){return new Ct((f,g)=>{a.timeout=a.timeout||ve("HTTP_CONNECT_TIMEOUT"),a.responseType=a.responseType||"json",a.data&&!o?(a.data=JSON.stringify(a.data),Sk+=zf(a.data)):o&&(a.data.size?Sk+=a.data.size:a.data instanceof FormData?Sk+=Aie(a.data):Sk+=zf(JSON.stringify(a.data))),a.headers=a.headers||{},a.headers["Content-Type"]=a.headers["Content-Type"]||"application/json",a.method="POST",a.url=r,Lo.request(a).then(v=>{typeof v.data=="string"?BG+=zf(v.data):v.data instanceof ArrayBuffer||v.data instanceof Uint8Array?BG+=v.data.byteLength:BG+=zf(JSON.stringify(v.data)),c&&f({data:v.data,headers:v.headers}),f(v.data)}).catch(v=>{Lo.isCancel(v)?g(new De(ce.OPERATION_ABORTED,"cancel token canceled")):v.code==="ECONNABORTED"?g(new De(ce.NETWORK_TIMEOUT,v.message)):v.response?g(new De(ce.NETWORK_RESPONSE_ERROR,v.response.status)):g(new De(ce.NETWORK_ERROR,v.message))})})}(function(){var r;function a(at){var yt=0;return function(){return yt<at.length?{done:!1,value:at[yt++]}:{done:!0}}}var o=typeof Object.defineProperties=="function"?Object.defineProperty:function(at,yt,Vt){return at==Array.prototype||at==Object.prototype||(at[yt]=Vt.value),at},c,f=function(at){at=[typeof globalThis=="object"&&globalThis,at,typeof window=="object"&&window,typeof self=="object"&&self,typeof s=="object"&&s];for(var yt=0;yt<at.length;++yt){var Vt=at[yt];if(Vt&&Vt.Math==Math)return Vt}throw Error("Cannot find global object")}(this);function g(at,yt){if(yt)e:{var Vt=f;at=at.split(".");for(var Rn=0;Rn<at.length-1;Rn++){var oi=at[Rn];if(!(oi in Vt))break e;Vt=Vt[oi]}(yt=yt(Rn=Vt[at=at[at.length-1]]))!=Rn&&yt!=null&&o(Vt,at,{configurable:!0,writable:!0,value:yt})}}function v(at){return(at={next:at})[Symbol.iterator]=function(){return this},at}function w(at){var yt=typeof Symbol<"u"&&Symbol.iterator&&at[Symbol.iterator];return yt?yt.call(at):{next:a(at)}}if(g("Symbol",function(at){function yt(oi,Rt){this.A=oi,o(this,"description",{configurable:!0,writable:!0,value:Rt})}if(at)return at;yt.prototype.toString=function(){return this.A};var Vt="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",Rn=0;return function oi(Rt){if(this instanceof oi)throw new TypeError("Symbol is not a constructor");return new yt(Vt+(Rt||"")+"_"+Rn++,Rt)}}),g("Symbol.iterator",function(at){if(at)return at;at=Symbol("Symbol.iterator");for(var yt="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),Vt=0;Vt<yt.length;Vt++){var Rn=f[yt[Vt]];typeof Rn=="function"&&typeof Rn.prototype[at]!="function"&&o(Rn.prototype,at,{configurable:!0,writable:!0,value:function(){return v(a(this))}})}return at}),typeof Object.setPrototypeOf=="function")c=Object.setPrototypeOf;else{var T;e:{var R={};try{R.__proto__={a:!0},T=R.a;break e}catch{}T=!1}c=T?function(at,yt){if(at.__proto__=yt,at.__proto__!==yt)throw new TypeError(at+" is not extensible");return at}:null}var A=c;function L(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function U(at){if(at.m)throw new TypeError("Generator is already running");at.m=!0}function F(at,yt){return at.h=3,{value:yt}}function Z(at){this.g=new L,this.G=at}function W(at,yt,Vt,Rn){try{var oi=yt.call(at.g.j,Vt);if(!(oi instanceof Object))throw new TypeError("Iterator result "+oi+" is not an object");if(!oi.done)return at.g.m=!1,oi;var Rt=oi.value}catch(q){return at.g.j=null,at.g.s(q),K(at)}return at.g.j=null,Rn.call(at.g,Rt),K(at)}function K(at){for(;at.g.h;)try{var yt=at.G(at.g);if(yt)return at.g.m=!1,{value:yt.value,done:!1}}catch(Vt){at.g.v=void 0,at.g.s(Vt)}if(at.g.m=!1,at.g.l){if(yt=at.g.l,at.g.l=null,yt.F)throw yt.D;return{value:yt.return,done:!0}}return{value:void 0,done:!0}}function oe(at){this.next=function(yt){return at.o(yt)},this.throw=function(yt){return at.s(yt)},this.return=function(yt){return function(Vt,Rn){U(Vt.g);var oi=Vt.g.j;return oi?W(Vt,"return"in oi?oi.return:function(Rt){return{value:Rt,done:!0}},Rn,Vt.g.return):(Vt.g.return(Rn),K(Vt))}(at,yt)},this[Symbol.iterator]=function(){return this}}function ue(at,yt){return yt=new oe(new Z(yt)),A&&at.prototype&&A(yt,at.prototype),yt}if(L.prototype.o=function(at){this.v=at},L.prototype.s=function(at){this.l={D:at,F:!0},this.h=this.C||this.u},L.prototype.return=function(at){this.l={return:at},this.h=this.u},Z.prototype.o=function(at){return U(this.g),this.g.j?W(this,this.g.j.next,at,this.g.o):(this.g.o(at),K(this))},Z.prototype.s=function(at){return U(this.g),this.g.j?W(this,this.g.j.throw,at,this.g.o):(this.g.s(at),K(this))},g("Array.prototype.entries",function(at){return at||function(){return function(yt,Vt){yt instanceof String&&(yt+="");var Rn=0,oi=!1,Rt={next:function(){if(!oi&&Rn<yt.length){var q=Rn++;return{value:Vt(q,yt[q]),done:!1}}return oi=!0,{done:!0,value:void 0}}};return Rt[Symbol.iterator]=function(){return Rt},Rt}(this,function(yt,Vt){return[yt,Vt]})}}),typeof Blob<"u"&&(typeof FormData>"u"||!FormData.prototype.keys)){var xe=function(at,yt){for(var Vt=0;Vt<at.length;Vt++)yt(at[Vt])},Ne=function(at){return at.replace(/\r?\n|\r/g,`\r
`)},ke=function(at,yt,Vt){return yt instanceof Blob?(Vt=Vt!==void 0?Vt+"":typeof yt.name=="string"?yt.name:"blob",yt.name===Vt&&Object.prototype.toString.call(yt)!=="[object Blob]"||(yt=new File([yt],Vt)),[String(at),yt]):[String(at),String(yt)]},He=function(at,yt){if(at.length<yt)throw new TypeError(yt+" argument required, but only "+at.length+" present.")},lt=typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:this,ut=lt.FormData,ft=lt.XMLHttpRequest&&lt.XMLHttpRequest.prototype.send,zt=lt.Request&&lt.fetch,$n=lt.navigator&&lt.navigator.sendBeacon,hi=lt.Element&&lt.Element.prototype,Gi=lt.Symbol&&Symbol.toStringTag;Gi&&(Blob.prototype[Gi]||(Blob.prototype[Gi]="Blob"),"File"in lt&&!File.prototype[Gi]&&(File.prototype[Gi]="File"));try{new File([],"")}catch{lt.File=function(at,yt,Vt){return at=new Blob(at,Vt||{}),Object.defineProperties(at,{name:{value:yt},lastModified:{value:+(Vt&&Vt.lastModified!==void 0?new Date(Vt.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),Gi&&Object.defineProperty(at,Gi,{value:"File"}),at}}var Fr=function(at){return at.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},mr=function(at){this.i=[];var yt=this;at&&xe(at.elements,function(Vt){if(Vt.name&&!Vt.disabled&&Vt.type!=="submit"&&Vt.type!=="button"&&!Vt.matches("form fieldset[disabled] *"))if(Vt.type==="file"){var Rn=Vt.files&&Vt.files.length?Vt.files:[new File([],"",{type:"application/octet-stream"})];xe(Rn,function(oi){yt.append(Vt.name,oi)})}else Vt.type==="select-multiple"||Vt.type==="select-one"?xe(Vt.options,function(oi){!oi.disabled&&oi.selected&&yt.append(Vt.name,oi.value)}):Vt.type==="checkbox"||Vt.type==="radio"?Vt.checked&&yt.append(Vt.name,Vt.value):(Rn=Vt.type==="textarea"?Ne(Vt.value):Vt.value,yt.append(Vt.name,Rn))})};if((r=mr.prototype).append=function(at,yt,Vt){He(arguments,2),this.i.push(ke(at,yt,Vt))},r.delete=function(at){He(arguments,1);var yt=[];at=String(at),xe(this.i,function(Vt){Vt[0]!==at&&yt.push(Vt)}),this.i=yt},r.entries=function at(){var yt,Vt=this;return ue(at,function(Rn){if(Rn.h==1&&(yt=0),Rn.h!=3)return yt<Vt.i.length?Rn=F(Rn,Vt.i[yt]):(Rn.h=0,Rn=void 0),Rn;yt++,Rn.h=2})},r.forEach=function(at,yt){He(arguments,1);for(var Vt=w(this),Rn=Vt.next();!Rn.done;Rn=Vt.next()){var oi=w(Rn.value);Rn=oi.next().value,oi=oi.next().value,at.call(yt,oi,Rn,this)}},r.get=function(at){He(arguments,1);var yt=this.i;at=String(at);for(var Vt=0;Vt<yt.length;Vt++)if(yt[Vt][0]===at)return yt[Vt][1];return null},r.getAll=function(at){He(arguments,1);var yt=[];return at=String(at),xe(this.i,function(Vt){Vt[0]===at&&yt.push(Vt[1])}),yt},r.has=function(at){He(arguments,1),at=String(at);for(var yt=0;yt<this.i.length;yt++)if(this.i[yt][0]===at)return!0;return!1},r.keys=function at(){var yt,Vt,Rn,oi,Rt=this;return ue(at,function(q){if(q.h==1&&(yt=w(Rt),Vt=yt.next()),q.h!=3)return Vt.done?void(q.h=0):(Rn=Vt.value,oi=w(Rn),F(q,oi.next().value));Vt=yt.next(),q.h=2})},r.set=function(at,yt,Vt){He(arguments,2),at=String(at);var Rn=[],oi=ke(at,yt,Vt),Rt=!0;xe(this.i,function(q){q[0]===at?Rt&&(Rt=!Rn.push(oi)):Rn.push(q)}),Rt&&Rn.push(oi),this.i=Rn},r.values=function at(){var yt,Vt,Rn,oi,Rt=this;return ue(at,function(q){if(q.h==1&&(yt=w(Rt),Vt=yt.next()),q.h!=3)return Vt.done?void(q.h=0):(Rn=Vt.value,(oi=w(Rn)).next(),F(q,oi.next().value));Vt=yt.next(),q.h=2})},mr.prototype._asNative=function(){for(var at=new ut,yt=w(this),Vt=yt.next();!Vt.done;Vt=yt.next()){var Rn=w(Vt.value);Vt=Rn.next().value,Rn=Rn.next().value,at.append(Vt,Rn)}return at},mr.prototype._blob=function(){var at="----formdata-polyfill-"+Math.random(),yt=[],Vt="--"+at+`\r
Content-Disposition: form-data; name="`;return this.forEach(function(Rn,oi){return typeof Rn=="string"?yt.push(Vt+Fr(Ne(oi))+`"\r
\r
`+Ne(Rn)+`\r
`):yt.push(Vt+Fr(Ne(oi))+'"; filename="'+Fr(Rn.name)+`"\r
Content-Type: `+(Rn.type||"application/octet-stream")+`\r
\r
`,Rn,`\r
`)}),yt.push("--"+at+"--"),new Blob(yt,{type:"multipart/form-data; boundary="+at})},mr.prototype[Symbol.iterator]=function(){return this.entries()},mr.prototype.toString=function(){return"[object FormData]"},hi&&!hi.matches&&(hi.matches=hi.matchesSelector||hi.mozMatchesSelector||hi.msMatchesSelector||hi.oMatchesSelector||hi.webkitMatchesSelector||function(at){for(var yt=(at=(this.document||this.ownerDocument).querySelectorAll(at)).length;0<=--yt&&at.item(yt)!==this;);return-1<yt}),Gi&&(mr.prototype[Gi]="FormData"),ft){var Uu=lt.XMLHttpRequest.prototype.setRequestHeader;lt.XMLHttpRequest.prototype.setRequestHeader=function(at,yt){Uu.call(this,at,yt),at.toLowerCase()==="content-type"&&(this.B=!0)},lt.XMLHttpRequest.prototype.send=function(at){at instanceof mr?(at=at._blob(),this.B||this.setRequestHeader("Content-Type",at.type),ft.call(this,at)):ft.call(this,at)}}zt&&(lt.fetch=function(at,yt){return yt&&yt.body&&yt.body instanceof mr&&(yt.body=yt.body._blob()),zt.call(this,at,yt)}),$n&&(lt.navigator.sendBeacon=function(at,yt){return yt instanceof mr&&(yt=yt._asNative()),$n.call(this,at,yt)}),lt.FormData=mr}})();let $I=()=>{let r=ve("AREAS");return r.length===0&&r.push(ai.GLOBAL),bc(r).call(r,(a,o,c)=>{let f=fre(o);return f?c===0?f:"".concat(a,",").concat(f):a},"")},fre=r=>r===ai.OVERSEA?"".concat(da.ASIA,",").concat(da.EUROPE,",").concat(da.AFRICA,",").concat(da.NORTH_AMERICA,",").concat(da.SOUTH_AMERICA,",").concat(da.OCEANIA):da[r],QAe=r=>{let a={CODE:"",WEBCS_DOMAIN:[],WEBCS_DOMAIN_BACKUP_LIST:[],PROXY_CS:[],CDS_AP:[],ACCOUNT_REGISTER:[],UAP_AP:[],EVENT_REPORT_DOMAIN:[],EVENT_REPORT_BACKUP_DOMAIN:[],LOG_UPLOAD_SERVER:[],PROXY_SERVER_TYPE3:[]};return r.map(o=>{let c=_k[o],f=Object.keys(c);f&&f.map(g=>{g!=="CODE"&&(a[g]=a[g].concat(c[g]))})}),a},bk={GLOBAL:{ASIA:[ai.CHINA,ai.JAPAN,ai.INDIA,ai.KOREA,ai.HKMC],EUROPE:[],NORTH_AMERICA:[ai.US],SOUTH_AMERICA:[],OCEANIA:[],AFRICA:[]}},Ck=Object.keys(bk[ai.GLOBAL]),VG=[ai.CHINA,ai.NORTH_AMERICA,ai.EUROPE,ai.ASIA,ai.JAPAN,ai.INDIA,ai.OCEANIA,ai.SOUTH_AMERICA,ai.AFRICA,ai.KOREA,ai.HKMC,ai.US],ZAe=function(r,a){let o=[];if(Tt(r).call(r,ai.GLOBAL)){let g=[ai.GLOBAL,ai.OVERSEA],v=Object.keys(_k);if(a===ai.GLOBAL)throw new De(ce.INVALID_PARAMS,"GLOBAL is an invalid excludedArea value");if(a===ai.CHINA)o=[ai.OVERSEA];else if(f=a,Tt(Ck).call(Ck,f)){let w=(c=a,bk[ai.GLOBAL][c]||[]),T=[...g,a,...w];o=v.filter(R=>!Tt(T).call(T,R))}else if(function(w){let T=!1;return Ck.forEach(R=>{var A;Tt(A=bk[ai.GLOBAL][R]).call(A,w)&&(T=!0)}),T}(a)){let w=function(R){let A;return Ck.forEach(L=>{var U;Tt(U=bk[ai.GLOBAL][L]).call(U,R)&&(A=L)}),A}(a),T=[...g,w,a];o=v.filter(R=>!Tt(T).call(T,R))}else o=r;o=function(w){let T=[];return VG.forEach(R=>{Tt(w).call(w,R)&&T.push(R)}),T.concat(w.filter(R=>!Tt(VG).call(VG,R)))}(o)}else o=r;var c,f;return o};function pre(r){var a,o;if(!r&&Tt(a=ve("AREAS")).call(a,ai.EXTENSIONS))return z.debug("update area from ap : reset"),void zG(Kxe,!0);if(!Tt(o=ve("AREAS")).call(o,ai.GLOBAL)||!r)return;let c=_k.EXTENSIONS;c&&(c={CODE:fre(ai.EXTENSIONS),WEBCS_DOMAIN:["ap-web-1-".concat(r,".agora.io")],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-".concat(r,".ap.sd-rtn.com")],PROXY_CS:["proxy-ap-web-".concat(r,".agora.io")],CDS_AP:["cds-ap-web-1-".concat(r,".agora.io"),"cds-ap-web-2-".concat(r,".ap.sd-rtn.com")],ACCOUNT_REGISTER:["sua-ap-web-1-".concat(r,".agora.io"),"sua-ap-web-2-".concat(r,".ap.sd-rtn.com")],UAP_AP:["uap-ap-web-1-".concat(r,".agora.io"),"uap-ap-web-2-".concat(r,".ap.sd-rtn.com")],EVENT_REPORT_DOMAIN:["statscollector-1-".concat(r,".agora.io")],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-".concat(r,".agora.io")],LOG_UPLOAD_SERVER:["logservice-".concat(r,".agora.io")],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy-".concat(r,".agora.io")]},z.debug("update area from ap success: ".concat(r,",config is "),c),Ri("AREAS",[ai.EXTENSIONS],!0),Object.keys(c).map(f=>{f==="LOG_UPLOAD_SERVER"||f==="EVENT_REPORT_DOMAIN"||f==="EVENT_REPORT_BACKUP_DOMAIN"||f==="PROXY_SERVER_TYPE3"?Ri(f,c[f][0]):Ri(f,c[f])}))}function zG(r){let a=arguments.length>1&&arguments[1]!==void 0&&arguments[1],o=$t.reportApiInvoke(null,{name:qr.SET_AREA,options:r,tag:vr.TRACER});try{let c=[];if(typeof r=="string"&&(c=[r]),Array.isArray(r)&&(r.forEach(g=>{if(!Tt(Jie).call(Jie,g))throw new De(ce.INVALID_PARAMS,"invalid area code")}),c=r),Object.prototype.toString.call(r)==="[object Object]"){let{areaCode:g,excludedArea:v}=r;if(!g)throw new De(ce.INVALID_PARAMS,"area code is needed");let w=g;typeof g=="string"&&(w=[g]),c=v?ZAe(w,v):w}if(!a){if(z0.AREAS){let g=new De(ce.PROHIBITED_OPERATION,"setArea is prohibited because of config-distribute");return o.onError(g),void z.warning("setArea is prohibited because of config-distribute")}if(Tt(c).call(c,ai.GLOBAL)&&ve("AREAS")===ai.EXTENSIONS){let g=new De(ce.PROHIBITED_OPERATION,"setArea is prohibited because of ap extensions");return o.onError(g),void z.warning("setArea is prohibited because of ap extensions")}}Ri("AREAS",c,a);let f=QAe(c);Object.keys(f).map(g=>{g==="LOG_UPLOAD_SERVER"||g==="EVENT_REPORT_DOMAIN"||g==="EVENT_REPORT_BACKUP_DOMAIN"||g==="PROXY_SERVER_TYPE3"?Ri(g,f[g][0]):Ri(g,f[g])}),z.debug("set area success:",c.join(","))}catch(c){throw o.onError(c),c}o.onSuccess()}function mre(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function HG(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?mre(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):mre(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let GG=1;function eIe(r,a,o,c,f){GG+=1;let g={sid:o.sid,command:"convergeAllocateEdge",uid:"666",appId:o.appId,ts:Math.floor(Date.now()/1e3),seq:GG,requestId:GG,version:pd,cname:o.cname},v={service_name:a,json_body:JSON.stringify(g)},w,T,R=r[0];return Nh(async()=>{w=Date.now();let A=await Dh(R,{data:v,cancelToken:c,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"}});if(T=Date.now()-w,A.code!==0){let F=new De(ce.UNEXPECTED_RESPONSE,"live streaming ap error, code"+A.code,{retry:!0,responseTime:T});throw z.error(F.toString()),F}let L=JSON.parse(A.json_body);if(L.code!==200){let F=new De(ce.UNEXPECTED_RESPONSE,"live streaming app center error, code: ".concat(L.code,", reason: ").concat(L.reason),{code:L.code,responseTime:T});throw z.error(F.toString()),F}if(!L.servers||L.servers.length===0){let F=new De(ce.UNEXPECTED_RESPONSE,"live streaming app center empty server",{code:L.code,responseTime:T});throw z.error(F.toString()),F}let U=function(F,Z){return{addressList:F.servers.map(W=>"wss://".concat(W.address.replace(/\./g,"-"),".").concat(ve("WORKER_DOMAIN"),":").concat(W.wss,"?serviceName=").concat(encodeURIComponent(Z))),workerToken:F.workerToken,vid:F.vid}}(L,a);return ve("LIVE_STREAMING_ADDRESS")&&(U.addressList=ve("LIVE_STREAMING_ADDRESS")instanceof Array?ve("LIVE_STREAMING_ADDRESS"):[ve("LIVE_STREAMING_ADDRESS")]),HG(HG({},U),{},{responseTime:T})},(A,L)=>($t.apworkerEvent(o.sid,{success:!0,sc:200,serviceName:a,responseDetail:JSON.stringify(A.addressList),firstSuccess:L===0,responseTime:T,serverIp:r[L%r.length]}),!1),(A,L)=>($t.apworkerEvent(o.sid,{success:!1,sc:A.data&&A.data.code||200,serviceName:a,responseTime:T,serverIp:r[L%r.length]}),!!(A.code!==ce.OPERATION_ABORTED&&A.code!==ce.UNEXPECTED_RESPONSE||A.data&&A.data.retry)&&(R=r[(L+1)%r.length],!0)),f)}let WG=1;function gre(r,a,o,c){let{url:f,areaCode:g}=r,{clientId:v,sid:w}=a,T=Date.now(),R,[A,L]=KG(a,g,[jr.CHOOSE_SERVER]),U=yr.networkState;return Nh(async()=>{U&&yr.networkState===so.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,_s(c&&c.maxRetryTimeout||Mr.maxRetryTimeout)]),U=yr.networkState;let{data:F,headers:Z}=await Dh(f,{data:A,cancelToken:o,headers:{"Content-Type":"multipart/form-data;"}},!0,!0);R=Z.http3==="1"?1:-1,$t.reportResourceTiming(f,w),yre(F,f,a,T,[jr.CHOOSE_SERVER],R);let W=WI(F,jr.CHOOSE_SERVER);return $G(W),jG(W,f)},F=>(F&&$t.joinChooseServer(w,{lts:T,succ:!0,csAddr:f,opid:L,serverList:F.gatewayAddrs.map(Z=>Z.address),ec:null,cid:F.cid.toString(),uid:F.uid.toString(),csIp:F.csIp,unilbsServerIds:[jr.CHOOSE_SERVER].toString(),isHttp3:R}),!1),F=>F.code!==ce.OPERATION_ABORTED&&(F.code===ce.CAN_NOT_GET_GATEWAY_SERVER?F.data.retry:($t.joinChooseServer(w,{lts:T,succ:!1,csAddr:f,serverList:null,opid:L,ec:F.code,csIp:F.data&&F.data.csIp,unilbsServerIds:[jr.CHOOSE_SERVER].toString(),extend:JSON.stringify({networkState:U}),isHttp3:R}),z.warning("[".concat(v||"sid-".concat(w.slice(0,6)),"] Choose server network error, retry"),F),!0)),c)}function vre(r,a,o,c){let f,{url:g,areaCode:v,serviceIds:w}=r,T=Date.now(),[R,A]=KG(a,v,w),L;return Nh(async()=>{L&&yr.networkState===so.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,_s(c&&c.maxRetryTimeout||Mr.maxRetryTimeout)]),L=yr.networkState;let{data:U,headers:F}=await Dh(g,{data:R,cancelToken:o,headers:{"Content-Type":"multipart/form-data;"}},!0,!0);f=F.http3==="1"?1:-1,$t.reportResourceTiming(g,a.sid),yre(U,g,a,T,w,f);let Z=WI(U,jr.CHOOSE_SERVER),W=WI(U,a.cloudProxyServer==="proxy5"?jr.CLOUD_PROXY_5:a.cloudProxyServer==="proxy3"||a.cloudProxyServer==="proxy4"?jr.CLOUD_PROXY:jr.CLOUD_PROXY_FALLBACK);return $G(Z),{gatewayInfo:jG(Z,g),proxyInfo:W,url:g}},U=>(U.gatewayInfo&&$t.joinChooseServer(a.sid,{lts:T,succ:!0,csAddr:g,serverList:U.gatewayInfo.gatewayAddrs.map(F=>F.address),ec:null,opid:A,cid:U.gatewayInfo.cid.toString(),uid:U.gatewayInfo.uid.toString(),csIp:U.gatewayInfo.csIp,unilbsServerIds:w.toString(),isHttp3:f}),U.proxyInfo&&$t.joinWebProxyAP(a.sid,{lts:T,sucess:1,apServerAddr:g,turnServerAddrList:U.proxyInfo.addresses.map(F=>F.ip).join(","),errorCode:null,eventType:a.cloudProxyServer,unilbsServerIds:w.toString()}),!1),U=>U.code!==ce.OPERATION_ABORTED&&(U.code===ce.CAN_NOT_GET_GATEWAY_SERVER?U.data.retry:($t.joinWebProxyAP(a.sid,{lts:T,sucess:0,apServerAddr:g,turnServerAddrList:null,errorCode:U.code,eventType:a.cloudProxyServer,unilbsServerIds:w.toString(),extend:JSON.stringify({networkState:L})}),z.warning("[".concat(a.clientId,"] multi unilbs network error, retry"),U),!0)),c)}let yre=(r,a,o,c,f,g)=>{let{sid:v,clientId:w,cloudProxyServer:T}=o,R=[],A=L=>{L.flag===4096?$t.joinChooseServer(v,{lts:c,succ:!1,csAddr:a,opid:r.opid,serverList:null,ec:L.error.message,csIp:L.error.data&&L.error.data.csIp,unilbsServerIds:f.toString(),isHttp3:g}):L.flag!==1048576&&L.flag!==4194304&&L.flag!==4194310||$t.joinWebProxyAP(v,{lts:c,sucess:0,apServerAddr:a,turnServerAddrList:null,errorCode:L.error.code,eventType:T,unilbsServerIds:f.toString()})};if(r.response_body.forEach(L=>{let U=L.buffer.code;if(L.uri===23&&U===0&&!L.buffer.edges_services)if(L.buffer.flag===4194310)z.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers"),L.buffer.edges_services=[];else{let F={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"no edge services in ap response",{retry:!0,csIp:r.detail[502]}),flag:L.buffer.flag};R.push(F),A(F)}if(U!==0){let F=fb(U),Z={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,F.desc,{desc:F.desc,retry:F.retry,csIp:r.detail[502]}),flag:L.buffer.flag};L.buffer.flag===4194310?z.warning(Z.error.toString()):R.push(Z),A(Z)}}),R.length)throw z.warning("[".concat(w||"sid-".concat(v.slice(0,6)),"] multi unilbs ").concat(a," failed, ").concat(R.map(L=>"flag: ".concat(L.flag,", message: ").concat(L.error.message,", retry: ").concat(L.error.data.retry)).join(" | "))),new De(ce.CAN_NOT_GET_GATEWAY_SERVER,R.map(L=>"flag: ".concat(L.flag,", message: ").concat(L.error.message)).join(" | "),{retry:!!R.find(L=>L.error.data.retry),csIp:r.detail[502],desc:[...new Set(R.map(L=>{var U;return L==null||(U=L.error)===null||U===void 0||(U=U.data)===null||U===void 0?void 0:U.desc}).filter(L=>!!L))]})},$G=r=>{var a,o,c,f;if(r.addresses&&r.addresses.length===0&&r.code===0)throw new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"void gateway address",{retry:!0,csIp:r.detail&&r.detail[502]});if(ve("AP_AREA")&&((c=r.detail)!==null&&c!==void 0&&c[23]&&typeof((f=r.detail)===null||f===void 0?void 0:f[23])=="string"?pre(r.detail[23].toLowerCase()):pre()),(a=r.detail)!==null&&a!==void 0&&a[19]&&typeof((o=r.detail)===null||o===void 0?void 0:o[19])=="string"){let v=r.detail[19],w=v==null?void 0:v.split(";");for(let T=0;T<w.length;T++){var g;let R=Us(g=w[T]).call(g);r.addresses[T]&&w&&(r.addresses[T].fingerprint=R)}}if(ve("GATEWAY_ADDRESS")&&ve("GATEWAY_ADDRESS").length>0){z.debug("assign gateway address to",ve("GATEWAY_ADDRESS"));let v=ve("GATEWAY_ADDRESS").map(w=>{var T,R;let A=(T=(R=r.addresses.find(L=>L.ip===w.ip&&L.port===w.port))===null||R===void 0?void 0:R.fingerprint)!==null&&T!==void 0?T:"";return{ip:w.ip,port:w.port,ticket:r.addresses[0]&&r.addresses[0].ticket,fingerprint:A}});r.addresses=v}},tIe=(r,a)=>{if(r.response_body&&r.response_body.length){let o=r.response_body[0];if(o.buffer.code!==0){let c=fb(o.buffer.code);throw new De(ce.UPDATE_TICKET_FAILED,"[".concat(o.buffer.code,"]: ").concat(c.desc),{retry:c.retry})}return o.buffer.ticket}throw z.debug("update ticket request received ap response without response body:",a),new De(ce.UPDATE_TICKET_FAILED,"cannot find response body from ap response",{retry:!1})},KG=(r,a,o)=>{let c=Math.floor(Math.random()*1e12),f={appid:r.appId,client_ts:Date.now(),opid:c,sid:r.sid,request_bodies:[{uri:22,buffer:{cname:r.cname,detail:HG({6:r.stringUid,11:a,12:ve("USE_NEW_TOKEN")?"1":void 0,22:a},r.apRTM?{26:"RTM2"}:{}),key:r.token,service_ids:o,uid:r.uid||0}}]};f.request_bodies.forEach(v=>{r.multiIP&&r.multiIP.gateway_ip&&(v.buffer.detail[5]=JSON.stringify({vocs_ip:[r.multiIP.uni_lbs_ip],vos_ip:[r.multiIP.gateway_ip]}))});let g=new FormData;return g.append("request",JSON.stringify(f)),[g,c]},nIe=(r,a)=>{let o=Math.floor(Math.random()*1e12),c={appid:r.appId,client_ts:Date.now(),opid:o,sid:r.sid,request_bodies:[{uri:28,buffer:{cname:r.cname,detail:{1:"",6:r.stringUid,12:"1"},token:r.token,service_ids:a,uid:r.uid||0,edges_services:r.apResponse.addresses.map(g=>({ip:g.ip,port:g.port}))}}]},f=new FormData;return f.append("request",JSON.stringify(c)),[f,o]},pb=0;function mb(r){return Ct.all(r.map(a=>a.then(o=>{throw o},o=>o))).then(a=>{throw a},a=>a)}let KI=async r=>{let{fragementLength:a,referenceList:o,asyncMapHandler:c,allFailedhandler:f,promisesCollector:g}=r,v=0,w=a,T,R=0,A=async()=>{let L=(()=>{let U=v*w,F=U+w;return o.slice(U,F).map(c)})();g&&g.push(...L);try{T=await mb(L)}catch(U){if(R+=w,v++,!(R>=o.length))return void await A();f(U)}L.forEach(U=>U.cancel())};return await A(),T},_re=async r=>{let{referenceList:a,asyncMapHandler:o,closeFn:c}=r,f=a.length,g=0,v=async()=>{let w=o(a.shift());try{return await w}catch(T){if(g++,g>=f||c!=null&&c(T))throw T;return v()}};return v()};async function qG(r,a,o,c){return{gatewayInfo:await async function(f,g,v,w){let T=null,R=[],A=async()=>{let U=ve("WEBCS_DOMAIN").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(W=>({url:f.proxyServer?"https://".concat(f.proxyServer,"/ap/?url=").concat(W+"/api/v2/transpond/webrtc?v=2"):"https://".concat(W,"/api/v2/transpond/webrtc?v=2"),areaCode:$I()})),F=w.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"chooseServer",urls:U.map(W=>W.url)}),Z=await KI({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:U,asyncMapHandler:W=>(z.debug("[".concat(f.clientId,"] Connect to choose_server:"),W.url),gre(W,f,g,v)),allFailedhandler:W=>{throw w.recordJoinChannelService({endTs:Date.now(),status:"error",errors:W},F),W[0]},promisesCollector:R});return w.recordJoinChannelService({endTs:Date.now(),status:"success"},F),Z},L=async()=>{if(await _s(1e3),T!==null)return T;let U=ve("WEBCS_DOMAIN_BACKUP_LIST").map(W=>({url:f.proxyServer?"https://".concat(f.proxyServer,"/ap/?url=").concat(W+"/api/v2/transpond/webrtc?v=2"):"https://".concat(W,"/api/v2/transpond/webrtc?v=2"),areaCode:$I()})),F=w.recordJoinChannelService({endTs:void 0,startTs:Date.now(),status:"pending",service:"chooseServer",urls:U.map(W=>W.url)}),Z=await KI({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:U,asyncMapHandler:W=>(z.debug("[".concat(f.clientId,"] Connect to backup choose_server:"),W.url),gre(W,f,g,v)),allFailedhandler:W=>{throw w.recordJoinChannelService({endTs:Date.now(),status:"error",errors:W},F),W[0]},promisesCollector:R});return w.recordJoinChannelService({endTs:Date.now(),status:"success"},F),Z};try{return T=await mb([A(),L()]),R.length&&R.forEach(U=>U.cancel&&typeof U.cancel=="function"&&U.cancel()),T}catch(U){throw U[0]}}(r,a,o,c)}}async function Ere(r,a,o,c,f){let g=r.cloudProxyServer;if(g==="disabled"){if(r.useLocalAccessPoint)return await qG(r,a,o,f);if(ve("JOIN_WITH_FALLBACK_MEDIA_PROXY")){let{gatewayInfo:U,proxyInfo:F}=await bre(r,a,o,f);if(r.turnServer&&r.turnServer.mode!=="auto")return{gatewayInfo:U};let Z=F.map(W=>({turnServerURL:W.address,tcpport:W.tcpport||Js.tcpport,udpport:W.udpport||Js.udpport,username:W.username||Js.username,password:W.password||Js.password,forceturn:!1,security:!0}));if(f.useP2P){var v;let W=(v=r.uid)!==null&&v!==void 0?v:U.uid,K="glb:".concat(W.toString()),oe=await vG(K),ue=F.map(xe=>({turnServerURL:xe.address,tcpport:xe.tcpport||Js.tcpport,udpport:xe.udpport||Js.udpport,username:K,password:oe,forceturn:!1,security:!0}));Z.push(...ue)}return r.turnServer={mode:"manual",servers:Z},{gatewayInfo:U}}return await qG(r,a,o,f)}let{proxyInfo:w,gatewayInfo:T}=await bre(r,a,o,f),R={gatewayInfo:T},A=w.map(U=>({turnServerURL:U.address,tcpport:g==="proxy3"?void 0:U.tcpport?U.tcpport:Js.tcpport,udpport:g==="proxy4"?void 0:U.udpport?U.udpport:Js.udpport,username:U.username||Js.username,password:U.password||Js.password,forceturn:g!=="proxy4",security:g==="proxy5"}));if(f.useP2P){var L;let U=(L=r.uid)!==null&&L!==void 0?L:T.uid,F="glb:".concat(U.toString()),Z=await vG(F),W=w.map(K=>({turnServerURL:K.address,tcpport:g==="proxy3"?void 0:K.tcpport||Js.tcpport,udpport:g==="proxy4"?void 0:K.udpport||Js.udpport,username:F,password:Z,forceturn:g!=="proxy4",security:g==="proxy5"}));A.push(...W)}return r.turnServer={mode:"manual",servers:A},z.debug("[".concat(r.clientId,"] set proxy server: ").concat(r.proxyServer,", mode: ").concat(g)),R}async function wre(r,a,o,c,f){let g=ve("ACCOUNT_REGISTER").slice(0,ve("AJAX_REQUEST_CONCURRENT")),v=[];v=a.proxyServer?g.map(T=>"https://".concat(a.proxyServer,"/ap/?url=").concat(T+"/api/v1")):g.map(T=>"https://".concat(T,"/api/v1"));let w=f==null?void 0:f.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"stringUID",urls:v});try{let T=await async function(R,A,L,U,F){let Z=Date.now(),W={sid:L.sid,opid:10,appid:L.appId,string_uid:A},K=R[0],oe=await Nh(()=>Dh(K+"".concat(K.indexOf("?")===-1?"?":"&","action=stringuid"),{data:W,cancelToken:U,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":72}}),(ue,xe)=>{if(ue.code===0){if(ue.uid<=0||ue.uid>=Math.pow(2,32))throw z.error("Invalid Uint Uid ".concat(A," => ").concat(ue.uid),ue),$t.reqUserAccount(W.sid,{lts:Z,success:!1,serverAddr:K,stringUid:W.string_uid,uid:ue.uid,errorCode:ce.INVALID_UINT_UID_FROM_STRING_UID,extend:W}),new De(ce.INVALID_UINT_UID_FROM_STRING_UID);return $t.reqUserAccount(W.sid,{lts:Z,success:!0,serverAddr:K,stringUid:W.string_uid,uid:ue.uid,errorCode:null,extend:W}),!1}let Ne=fb(ue.code);return Ne.retry&&(K=R[(xe+1)%R.length]),$t.reqUserAccount(W.sid,{lts:Z,success:!1,serverAddr:K,stringUid:W.string_uid,uid:ue.uid,errorCode:Ne.desc,extend:W}),Ne.retry},(ue,xe)=>ue.code!==ce.OPERATION_ABORTED&&($t.reqUserAccount(W.sid,{lts:Z,success:!1,serverAddr:K,stringUid:W.string_uid,uid:null,errorCode:ue.code,extend:W}),K=R[(xe+1)%R.length],!0),F);if(oe.code!==0){let ue=fb(oe.code);throw new De(ce.UNEXPECTED_RESPONSE,ue.desc)}return oe}(v,r,a,o,c);return f==null||f.recordJoinChannelService({status:"success",endTs:Date.now()},w),T.uid}catch(T){throw f==null||f.recordJoinChannelService({status:"error",endTs:Date.now(),errors:[T]},w),T}}async function iIe(r,a,o){let c=ve("ACCOUNT_REGISTER"),f=[];f=a.proxyServer?c.map(g=>"https://".concat(a.proxyServer,"/ap/?url=").concat(g+"/api/v1")):c.map(g=>"https://".concat(g,"/api/v1"));try{return await _re({referenceList:f,asyncMapHandler:g=>async function(v,w,T,R){let A=Date.now(),L={sid:T.sid,opid:10,appid:T.appId,string_uid:w};try{let U=await Dh(v+"".concat(v.indexOf("?")===-1?"?":"&","action=stringuid"),{data:L,cancelToken:R,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":72}});if(U.code!==0){let F=fb(U.code);throw new De(ce.UNEXPECTED_RESPONSE,"preload sua error:".concat(F.desc),F)}if(U.uid<=0||U.uid>=Math.pow(2,32))throw new De(ce.INVALID_UINT_UID_FROM_STRING_UID);return{requestTime:A,url:v,req:L,uid:U.uid,elapse:Date.now()-A}}catch(U){throw U}}(g,r,a,o),closeFn:g=>g.code===ce.OPERATION_ABORTED||g.code===ce.UNEXPECTED_RESPONSE&&!g.data.retry})}catch(g){throw g}}async function rIe(r,a,o){let c=ve("CDS_AP").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(T=>r.proxyServer?"https://".concat(r.proxyServer,"/ap/?url=").concat(T+"/api/v1"):"https://".concat(T,"/api/v1?action=config")),f=c.map(T=>function(R,A,L,U){let F=ni(),Z={flag:64,cipher_method:0,features:{device:F.name,system:F.os,system_general:navigator.userAgent,vendor:A.appId,version:pd,cname:A.cname,sid:A.sid,session_id:A.sid,detail:"",proxyServer:A.proxyServer}};return Nh(()=>Dh(R,{data:Z,timeout:1e3,cancelToken:L,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":54}}),void 0,W=>W.code!==ce.OPERATION_ABORTED,U)}(T,r,a,o)),g=null,v=null,w={};try{g=await mb(f)}catch(T){if(T.code===ce.OPERATION_ABORTED)throw T;v=T}if(f.forEach(T=>T.cancel()),$t.reportApiInvoke(r.sid,{name:qr.REQUEST_CONFIG_DISTRIBUTE,options:{error:v,res:g}}).onSuccess(),g&&g.test_tags)try{w=function(T){if(!T.test_tags)return{};let R=T.test_tags,A=Object.keys(R),L={};return A.forEach(U=>{var F;let Z=Us(F=U.slice(4)).call(F),W=JSON.parse(R[U])[1];L[Z]=W}),L}(g)}catch{}return w}async function Sre(r,a){let o=ve("WEBCS_DOMAIN").concat(ve("WEBCS_DOMAIN_BACKUP_LIST")).map(c=>({url:"https://".concat(c,"/api/v2/transpond/webrtc?v=2"),areaCode:$I(),serviceIds:[jr.CHOOSE_SERVER,jr.CLOUD_PROXY_FALLBACK]}));try{return await _re({referenceList:o,asyncMapHandler:c=>async function(f,g,v){let w,{url:T,areaCode:R,serviceIds:A}=f,L=Date.now(),[U,F]=KG(g,R,A),Z=yr.networkState;try{Z&&yr.networkState===so.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,_s(Mr.maxRetryTimeout)]),Z=yr.networkState;let{data:W,headers:K}=await Dh(T,{data:U,cancelToken:v,headers:{"Content-Type":"multipart/form-data;"}},!0,!0);w=K.http3==="1"?1:-1,(xe=>{let Ne=[];if(xe.response_body.forEach(ke=>{let He=ke.buffer.code;if(ke.uri===23&&He===0&&!ke.buffer.edges_services)if(ke.buffer.flag===4194310)ke.buffer.edges_services=[];else{let lt={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"no edge services in ap response",{retry:!0,csIp:xe.detail[502]}),flag:ke.buffer.flag};Ne.push(lt)}if(He!==0){let lt=fb(He),ut={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,lt.desc,{desc:lt.desc,retry:lt.retry,csIp:xe.detail[502]}),flag:ke.buffer.flag};ke.buffer.flag===4194310?z.warning(ut.error.toString()):Ne.push(ut)}}),Ne.length)throw new De(ce.CAN_NOT_GET_GATEWAY_SERVER,Ne.map(ke=>"flag: ".concat(ke.flag,", message: ").concat(ke.error.message)).join(" | "),{retry:!!Ne.find(ke=>ke.error.data.retry),csIp:xe.detail[502],desc:[...new Set(Ne.map(ke=>{var He;return ke==null||(He=ke.error)===null||He===void 0||(He=He.data)===null||He===void 0?void 0:He.desc}).filter(ke=>!!ke))]})})(W);let oe=WI(W,jr.CHOOSE_SERVER),ue=WI(W,jr.CLOUD_PROXY_FALLBACK);return $G(oe),{gatewayInfo:jG(oe,T),proxyInfo:ue,opid:F,requestTime:L,url:T,isHttp3:w,elapse:Date.now()-L}}catch(W){throw W}}(c,r,a),closeFn:c=>c.code===ce.OPERATION_ABORTED||c.code===ce.CAN_NOT_GET_GATEWAY_SERVER&&!c.data.retry})}catch(c){throw c}}async function bre(r,a,o,c){let f=ve("PROXY_SERVER_TYPE3"),g=(F,Z,W)=>{let K=W||f;return Array.isArray(K)&&(K=Z%2==0?f[1]:f[0]),"https://".concat(K,"/ap/?url=").concat(F)},v=null,w=[],T=async()=>{let F=ve("WEBCS_DOMAIN").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map((K,oe)=>{let ue;return ue=r.cloudProxyServer==="disabled"&&r.proxyServer?g("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe,r.proxyServer):r.cloudProxyServer==="disabled"||r.cloudProxyServer==="fallback"?"https://".concat(K,"/api/v2/transpond/webrtc?v=2"):g("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe),{url:ue,areaCode:$I(),serviceIds:[jr.CHOOSE_SERVER,r.cloudProxyServer==="proxy5"?jr.CLOUD_PROXY_5:r.cloudProxyServer==="proxy3"||r.cloudProxyServer==="proxy4"?jr.CLOUD_PROXY:jr.CLOUD_PROXY_FALLBACK]}}),Z=c.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"chooseServer",urls:F.map(K=>K.url)}),W=await KI({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:F,asyncMapHandler:K=>(z.debug("[".concat(r.clientId,"] Connect to choose_server:"),K.url),vre(K,r,a,o)),allFailedhandler:K=>{throw c.recordJoinChannelService({endTs:Date.now(),status:"error",errors:K},Z),K[0]},promisesCollector:w});return c.recordJoinChannelService({endTs:Date.now(),status:"success"},Z),W},R=async()=>{if(await _s(1e3),v!==null)return v;let F=ve("WEBCS_DOMAIN_BACKUP_LIST").map((K,oe)=>{let ue;return ue=r.cloudProxyServer==="disabled"&&r.proxyServer?g("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe,r.proxyServer):r.cloudProxyServer==="disabled"||r.cloudProxyServer==="fallback"?"https://".concat(K,"/api/v2/transpond/webrtc?v=2"):g("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe),{url:ue,areaCode:$I(),serviceIds:[jr.CHOOSE_SERVER,r.cloudProxyServer==="proxy5"?jr.CLOUD_PROXY_5:r.cloudProxyServer==="proxy3"||r.cloudProxyServer==="proxy4"?jr.CLOUD_PROXY:jr.CLOUD_PROXY_FALLBACK]}}),Z=c.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"chooseServer",urls:F.map(K=>K.url)}),W=await KI({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:F,asyncMapHandler:K=>(z.debug("[".concat(r.clientId,"] Connect to backup choose_server:"),K.url),vre(K,r,a,o)),allFailedhandler:K=>{throw c.recordJoinChannelService({endTs:Date.now(),status:"error",errors:K},Z),K[0]},promisesCollector:w});return c.recordJoinChannelService({endTs:Date.now(),status:"success"},Z),W},A,L,U;try{({gatewayInfo:A,proxyInfo:L,url:U}=await mb([T(),R()]))}catch(F){throw F[0]}if(w.length&&w.forEach(F=>F.cancel&&typeof F.cancel=="function"&&F.cancel()),!A||!L)throw new De(ce.UNEXPECTED_ERROR,"missing gateway or proxy response").print();if(r.apUrl=U,r.cloudProxyServer!=="disabled"&&Array.isArray(f)&&U){let F=/^https?:\/\/(.+?)(\/.*)?$/.exec(U)[1];Tt(f).call(f,F)&&(r.proxyServer=F,z.setProxyServer(F),$t.setProxyServer(F))}return v={gatewayInfo:A,proxyInfo:await lre(L,A.uid)},v}async function Cre(r,a,o,c){let f=ve("UAP_AP").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(g=>a.proxyServer?"https://".concat(a.proxyServer,"/ap/?url=").concat(g+"/api/v1?action=uap"):"https://".concat(g,"/api/v1?action=uap"));return await eIe(f,r,a,o,c)}async function sIe(r,a,o){let c=ve("UAP_AP").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(g=>r.proxyServer?"https://".concat(r.proxyServer,"/ap/?url=").concat(g+"/api/v1?action=uap"):"https://".concat(g,"/api/v1?action=uap")),f=c.map(g=>function(v,w,T,R){let A={command:"convergeAllocateEdge",sid:w.sid,appId:w.appId,token:w.token,ts:Date.now(),version:pd,cname:w.cname,uid:w.uid.toString(),requestId:WG,seq:WG};WG+=1;let L={service_name:"tele_channel",json_body:JSON.stringify(A)};return Nh(async()=>{let U=await Dh(v,{data:L,cancelToken:T,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":61}});if(U.code!==0){let Z=new De(ce.UNEXPECTED_RESPONSE,"cross channel ap error, code"+U.code,{retry:!0});throw z.error(Z.toString()),Z}let F=JSON.parse(U.json_body);if(F.code!==200){let Z=new De(ce.UNEXPECTED_RESPONSE,"cross channel app center error, code: ".concat(F.code,", reason: ").concat(F.reason));throw z.error(Z.toString()),Z}if(!F.servers||F.servers.length===0){let Z=new De(ce.UNEXPECTED_RESPONSE,"cross channel app center empty server");throw z.error(Z.toString()),Z}return{vid:F.vid,workerToken:F.workerToken,addressList:(ve("CHANNEL_MEDIA_RELAY_SERVERS")||F.servers).map(Z=>"wss://".concat(Z.address.replace(/\./g,"-"),".").concat(ve("WORKER_DOMAIN"),":").concat(Z.wss))}},void 0,U=>!!(U.code!==ce.OPERATION_ABORTED&&U.code!==ce.UNEXPECTED_RESPONSE||U.data&&U.data.retry),R)}(g,r,a,o));try{let g=await mb(f);return f.forEach(v=>v.cancel()),g}catch(g){throw g[0]}}async function aIe(r,a,o){let c=null,f=[],g=async v=>{let w=ve(v?"WEBCS_DOMAIN_BACKUP_LIST":"WEBCS_DOMAIN").map(T=>r.proxyServer?"https://".concat(r.proxyServer,"/ap/?url=").concat(T+"/api/v2/transpond/webrtc?v=2"):"https://".concat(T,"/api/v2/transpond/webrtc?v=2"));return v&&(await _s(1e3),c!==null)?c:await KI({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:w,asyncMapHandler:T=>(z.debug("[".concat(r.clientId,"] update ticket, Connect to ").concat(v?"backup":""," choose_server:"),T),function(R,A,L,U){let[F]=nIe(A,[jr.CHOOSE_SERVER]),Z=yr.networkState;return Nh(async()=>{Z&&yr.networkState===so.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,_s(U&&U.maxRetryTimeout||Mr.maxRetryTimeout)]),Z=yr.networkState;let W=await Dh(R,{data:F,cancelToken:L,headers:{"Content-Type":"multipart/form-data;"}},!0);return tIe(W,R)},()=>!1,W=>W.code!==ce.OPERATION_ABORTED&&(W.code===ce.UPDATE_TICKET_FAILED?W.data.retry:(z.warning("[".concat(A.clientId,"] update ticket network error, retry"),W),!0)),U)}(T,r,a,o)),allFailedhandler:T=>{throw T[0]},promisesCollector:f})};try{return c=await mb([g(!1),g(!0)]),f.length&&f.forEach(v=>v.cancel&&typeof v.cancel=="function"&&v.cancel()),c}catch(v){throw v[0]}}function Tre(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Rre(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Tre(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Tre(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class oIe extends tr{get isSuccess(){return!!this.configs}constructor(){super(),X(this,"configs",void 0),X(this,"joinInfo",void 0),X(this,"cancelToken",void 0),X(this,"retryConfig",{timeout:3e3,timeoutFactor:1.5,maxRetryCount:1,maxRetryTimeout:1e4}),X(this,"interval",void 0),X(this,"mutex",new As("config-distribute")),X(this,"mutableParamsRead",!1)}startGetConfigDistribute(a,o){this.joinInfo=a,this.cancelToken=o,this.interval&&this.stopGetConfigDistribute(),ve("ENABLE_CONFIG_DISTRIBUTE")&&(this.updateConfigDistribute(),this.interval=window.setInterval(()=>{this.updateConfigDistribute()},ve("CONFIG_DISTRIBUTE_INTERVAL")))}stopGetConfigDistribute(){this.interval&&clearInterval(this.interval),this.interval=void 0,this.joinInfo=void 0,this.cancelToken=void 0}async awaitConfigDistributeComplete(){this.mutex.isLocked&&(await this.mutex.lock())()}async updateConfigDistribute(){if(this.mutableParamsRead||(this.mutableParamsRead=!0,$t.reportApiInvoke(null,{options:void 0,name:qr.LOAD_CONFIG_FROM_LOCALSTORAGE,tag:vr.TRACER}).onSuccess(JSON.stringify(z0))),!this.joinInfo||!this.cancelToken||!this.retryConfig)return void z.debug("[config-distribute] get config distribute interrupted have no joininfo");let a,o=await this.mutex.lock();try{a=await rIe(this.joinInfo,this.cancelToken,this.retryConfig),z.debug("[config-distribute] get config distribute",JSON.stringify(a)),a.limit_bitrate&&this.handleBitrateLimit(a.limit_bitrate),this.cacheGlobalParameterConfig(a),this.configs=a}catch(c){let f=new De(ce.NETWORK_RESPONSE_ERROR,c);z.warning("[config-distribute] ".concat(f.toString()))}finally{o()}}getBitrateLimit(){return this.configs?this.configs.limit_bitrate:void 0}handleBitrateLimit(a){var o;(o=a)&&o.uplink&&o.id&&o.uplink.max_bitrate!==void 0&&o.uplink.min_bitrate!==void 0&&(this.configs&&this.configs.limit_bitrate?this.configs&&this.configs.limit_bitrate&&this.configs.limit_bitrate.id!==a.id&&this.emit(kG.UPDATE_BITRATE_LIMIT,a):this.emit(kG.UPDATE_BITRATE_LIMIT,a))}getLowStreamConfigDistribute(){return this.configs&&this.configs.limit_bitrate&&Rre({},this.configs.limit_bitrate.low_stream_uplink)}cacheGlobalParameterConfig(a){var o;let c=wI(o=Object.keys(a).filter(g=>/^webrtc_ng_global_parameter/.test(g))).call(o);for(let g=0;g<c.length;g++)for(let v=c.length-1;v>g;v--){let w=c[v];if(typeof a[w].__priority=="number"){let T=a[w].__priority,R=c[v-1];if(typeof a[R].__priority=="number"){if(!(T>a[R].__priority))continue;{let A=w;c[v]=c[v-1],c[v-1]=A}}else{let A=w;c[v]=c[v-1],c[v-1]=A}}}let f={};c.forEach(g=>{let v=a[g],w=v.__expires;Object.keys(v).forEach(T=>{T==="__priority"||T==="__expires"||Object.prototype.hasOwnProperty.call(f,T)||(f[T]=Rre({value:v[T]},w&&{expires:w}))})});try{(function(w){try{let T=Date.now();Object.keys(w).forEach(R=>{switch(R){case"ENABLE_EVENT_REPORT":case"UPLOAD_LOG":case"ENABLE_AG_ADAPTATION":case"FORCE_AG_HIGH_FRAMERATE":case"FORCE_SUPPORT_AG_ADAPTATION":case"ENCODER_CONFIG_LIMIT":case"CAMERA_CAPTURE_CONFIG":case"ENABLE_PRELOAD":if(Object.prototype.hasOwnProperty.call(is,R)){let{value:A,expires:L}=w[R];if(L&&L<=T)return;z0[R]=A,is[R]=A,z.debug("Update global parameters from config distribute",R,A)}}})}catch(T){z.error("Error update config immediately: ".concat(w),T.message)}})(f);let g=JSON.stringify(f),v=window.btoa(g);window.localStorage.setItem("websdk_ng_global_parameter",v),z.debug("Caching global parameters ".concat(g))}catch(g){z.error("Error caching global parameters:",g.message)}}}var Tu,lIe=l($ie),xre=me,cIe=E,dIe=pe,uIe=d,YG=Jw,hIe=Iy,fIe=Oe,pIe=No,mIe=Qe,gb=Object.assign,Are=Object.defineProperty,gIe=cIe([].concat),vIe=!gb||uIe(function(){if(xre&&gb({b:1},gb(Are({},"a",{enumerable:!0,get:function(){Are(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},a={},o=Symbol(),c="abcdefghijklmnopqrst";return r[o]=7,c.split("").forEach(function(f){a[f]=f}),gb({},r)[o]!=7||YG(gb({},a)).join("")!=c})?function(r,a){for(var o=pIe(r),c=arguments.length,f=1,g=hIe.f,v=fIe.f;c>f;)for(var w,T=mIe(arguments[f++]),R=g?gIe(YG(T),g(T)):YG(T),A=R.length,L=0;A>L;)w=R[L++],xre&&!dIe(v,T,w)||(o[w]=T[w]);return o}:gb,yIe=dr,_Ie=w0,EIe=xf,wIe=pe,SIe=No,bIe=function(r,a,o,c){try{return c?a(yIe(o)[0],o[1]):a(o)}catch(f){_Ie(r,"throw",f)}},CIe=Zx,TIe=Ml,RIe=vh,Ire=$S,xIe=cm,AIe=Ca,Nre=Array,p_=E,XG=2147483647,IIe=/[^\0-\u007E]/,Ore=/[.\u3002\uFF0E\uFF61]/g,Pre="Overflow: input needs wider integers to process",Lre=RangeError,NIe=p_(Ore.exec),vb=Math.floor,JG=String.fromCharCode,Dre=p_("".charCodeAt),kre=p_([].join),q0=p_([].push),OIe=p_("".replace),PIe=p_("".split),LIe=p_("".toLowerCase),Mre=function(r){return r+22+75*(r<26)},DIe=function(r,a,o){var c=0;for(r=o?vb(r/700):r>>1,r+=vb(r/a);r>455;)r=vb(r/35),c+=36;return vb(c+36*r/(r+38))},kIe=function(r){var a=[];r=function(oe){for(var ue=[],xe=0,Ne=oe.length;xe<Ne;){var ke=Dre(oe,xe++);if(ke>=55296&&ke<=56319&&xe<Ne){var He=Dre(oe,xe++);(64512&He)==56320?q0(ue,((1023&ke)<<10)+(1023&He)+65536):(q0(ue,ke),xe--)}else q0(ue,ke)}return ue}(r);var o,c,f=r.length,g=128,v=0,w=72;for(o=0;o<r.length;o++)(c=r[o])<128&&q0(a,JG(c));var T=a.length,R=T;for(T&&q0(a,"-");R<f;){var A=XG;for(o=0;o<r.length;o++)(c=r[o])>=g&&c<A&&(A=c);var L=R+1;if(A-g>vb((XG-v)/L))throw Lre(Pre);for(v+=(A-g)*L,g=A,o=0;o<r.length;o++){if((c=r[o])<g&&++v>XG)throw Lre(Pre);if(c==g){for(var U=v,F=36;;){var Z=F<=w?1:F>=w+26?26:F-w;if(U<Z)break;var W=U-Z,K=36-Z;q0(a,JG(Mre(Z+W%K))),U=vb(W/K),F+=36}q0(a,JG(Mre(U))),w=DIe(v,L,R==T),v=0,R++}}v++,g++}return kre(a,"")},MIe=Ii,QG=me,jIe=VH,ZG=N,jre=xf,Ru=E,Tk=wh,xu=Gy,UIe=yA,eW=ms,tW=vIe,yb=function(r){var a=SIe(r),o=TIe(this),c=arguments.length,f=c>1?arguments[1]:void 0,g=f!==void 0;g&&(f=EIe(f,c>2?arguments[2]:void 0));var v,w,T,R,A,L,U=AIe(a),F=0;if(!U||this===Nre&&CIe(U))for(v=RIe(a),w=o?new this(v):Nre(v);v>F;F++)L=g?f(a[F],F):a[F],Ire(w,F,L);else for(A=(R=xIe(a,U)).next,w=o?new this:[];!(T=wIe(A,R)).done;F++)L=g?bIe(R,f,[T.value,F],!0):T.value,Ire(w,F,L);return w.length=F,w},kh=_I,FIe=eI.codeAt,BIe=function(r){var a,o,c=[],f=PIe(OIe(LIe(r),Ore,"."),".");for(a=0;a<f.length;a++)o=f[a],q0(c,NIe(IIe,o)?"xn--"+kIe(o):o);return kre(c,".")},xm=Ol,VIe=ud,zIe=TS,Ure=KRe,Fre=Lf,HIe=Fre.set,Rk=Fre.getterFor("URL"),GIe=Ure.URLSearchParams,WIe=Ure.getState,qI=ZG.URL,nW=ZG.TypeError,xk=ZG.parseInt,$Ie=Math.floor,Bre=Math.pow,Au=Ru("".charAt),Mh=Ru(/./.exec),YI=Ru([].join),KIe=Ru(1 .toString),qIe=Ru([].pop),_b=Ru([].push),iW=Ru("".replace),YIe=Ru([].shift),XIe=Ru("".split),XI=Ru("".slice),Ak=Ru("".toLowerCase),JIe=Ru([].unshift),rW="Invalid scheme",JI="Invalid host",Vre="Invalid port",zre=/[a-z]/i,QIe=/[\d+-.a-z]/i,sW=/\d/,ZIe=/^0x/i,e3e=/^[0-7]+$/,t3e=/^\d+$/,Hre=/^[\da-f]+$/i,n3e=/[\0\t\n\r #%/:<>?@[\\\]^|]/,i3e=/[\0\t\n\r #/:<>?@[\\\]^|]/,r3e=/^[\u0000-\u0020]+/,s3e=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,a3e=/[\t\n\r]/g,QI=function(r){var a,o,c,f;if(typeof r=="number"){for(a=[],o=0;o<4;o++)JIe(a,r%256),r=$Ie(r/256);return YI(a,".")}if(typeof r=="object"){for(a="",c=function(g){for(var v=null,w=1,T=null,R=0,A=0;A<8;A++)g[A]!==0?(R>w&&(v=T,w=R),T=null,R=0):(T===null&&(T=A),++R);return R>w&&(v=T,w=R),v}(r),o=0;o<8;o++)f&&r[o]===0||(f&&(f=!1),c===o?(a+=o?":":"::",f=!0):(a+=KIe(r[o],16),o<7&&(a+=":")));return"["+a+"]"}return r},Ik={},Gre=tW({},Ik,{" ":1,'"':1,"<":1,">":1,"`":1}),Wre=tW({},Gre,{"#":1,"?":1,"{":1,"}":1}),aW=tW({},Wre,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Y0=function(r,a){var o=FIe(r,0);return o>32&&o<127&&!eW(a,r)?r:encodeURIComponent(r)},Nk={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ZI=function(r,a){var o;return r.length==2&&Mh(zre,Au(r,0))&&((o=Au(r,1))==":"||!a&&o=="|")},$re=function(r){var a;return r.length>1&&ZI(XI(r,0,2))&&(r.length==2||(a=Au(r,2))==="/"||a==="\\"||a==="?"||a==="#")},o3e=function(r){return r==="."||Ak(r)==="%2e"},oW={},Kre={},lW={},qre={},Yre={},cW={},Xre={},Jre={},Ok={},Pk={},dW={},uW={},hW={},fW={},Qre={},pW={},Eb={},Wf={},Zre={},m_={},Am={},mW=function(r,a,o){var c,f,g,v=xm(r);if(a){if(f=this.parse(v))throw nW(f);this.searchParams=null}else{if(o!==void 0&&(c=new mW(o,!0)),f=this.parse(v,null,c))throw nW(f);(g=WIe(new GIe)).bindURL(this),this.searchParams=g}};mW.prototype={type:"URL",parse:function(r,a,o){var c,f,g,v,w,T=this,R=a||oW,A=0,L="",U=!1,F=!1,Z=!1;for(r=xm(r),a||(T.scheme="",T.username="",T.password="",T.host=null,T.port=null,T.path=[],T.query=null,T.fragment=null,T.cannotBeABaseURL=!1,r=iW(r,r3e,""),r=iW(r,s3e,"$1")),r=iW(r,a3e,""),c=yb(r);A<=c.length;){switch(f=c[A],R){case oW:if(!f||!Mh(zre,f)){if(a)return rW;R=lW;continue}L+=Ak(f),R=Kre;break;case Kre:if(f&&(Mh(QIe,f)||f=="+"||f=="-"||f=="."))L+=Ak(f);else{if(f!=":"){if(a)return rW;L="",R=lW,A=0;continue}if(a&&(T.isSpecial()!=eW(Nk,L)||L=="file"&&(T.includesCredentials()||T.port!==null)||T.scheme=="file"&&!T.host))return;if(T.scheme=L,a)return void(T.isSpecial()&&Nk[T.scheme]==T.port&&(T.port=null));L="",T.scheme=="file"?R=fW:T.isSpecial()&&o&&o.scheme==T.scheme?R=qre:T.isSpecial()?R=Jre:c[A+1]=="/"?(R=Yre,A++):(T.cannotBeABaseURL=!0,_b(T.path,""),R=Zre)}break;case lW:if(!o||o.cannotBeABaseURL&&f!="#")return rW;if(o.cannotBeABaseURL&&f=="#"){T.scheme=o.scheme,T.path=kh(o.path),T.query=o.query,T.fragment="",T.cannotBeABaseURL=!0,R=Am;break}R=o.scheme=="file"?fW:cW;continue;case qre:if(f!="/"||c[A+1]!="/"){R=cW;continue}R=Ok,A++;break;case Yre:if(f=="/"){R=Pk;break}R=Wf;continue;case cW:if(T.scheme=o.scheme,f==Tu)T.username=o.username,T.password=o.password,T.host=o.host,T.port=o.port,T.path=kh(o.path),T.query=o.query;else if(f=="/"||f=="\\"&&T.isSpecial())R=Xre;else if(f=="?")T.username=o.username,T.password=o.password,T.host=o.host,T.port=o.port,T.path=kh(o.path),T.query="",R=m_;else{if(f!="#"){T.username=o.username,T.password=o.password,T.host=o.host,T.port=o.port,T.path=kh(o.path),T.path.length--,R=Wf;continue}T.username=o.username,T.password=o.password,T.host=o.host,T.port=o.port,T.path=kh(o.path),T.query=o.query,T.fragment="",R=Am}break;case Xre:if(!T.isSpecial()||f!="/"&&f!="\\"){if(f!="/"){T.username=o.username,T.password=o.password,T.host=o.host,T.port=o.port,R=Wf;continue}R=Pk}else R=Ok;break;case Jre:if(R=Ok,f!="/"||Au(L,A+1)!="/")continue;A++;break;case Ok:if(f!="/"&&f!="\\"){R=Pk;continue}break;case Pk:if(f=="@"){U&&(L="%40"+L),U=!0,g=yb(L);for(var W=0;W<g.length;W++){var K=g[W];if(K!=":"||Z){var oe=Y0(K,aW);Z?T.password+=oe:T.username+=oe}else Z=!0}L=""}else if(f==Tu||f=="/"||f=="?"||f=="#"||f=="\\"&&T.isSpecial()){if(U&&L=="")return"Invalid authority";A-=yb(L).length+1,L="",R=dW}else L+=f;break;case dW:case uW:if(a&&T.scheme=="file"){R=pW;continue}if(f!=":"||F){if(f==Tu||f=="/"||f=="?"||f=="#"||f=="\\"&&T.isSpecial()){if(T.isSpecial()&&L=="")return JI;if(a&&L==""&&(T.includesCredentials()||T.port!==null))return;if(v=T.parseHost(L))return v;if(L="",R=Eb,a)return;continue}f=="["?F=!0:f=="]"&&(F=!1),L+=f}else{if(L=="")return JI;if(v=T.parseHost(L))return v;if(L="",R=hW,a==uW)return}break;case hW:if(!Mh(sW,f)){if(f==Tu||f=="/"||f=="?"||f=="#"||f=="\\"&&T.isSpecial()||a){if(L!=""){var ue=xk(L,10);if(ue>65535)return Vre;T.port=T.isSpecial()&&ue===Nk[T.scheme]?null:ue,L=""}if(a)return;R=Eb;continue}return Vre}L+=f;break;case fW:if(T.scheme="file",f=="/"||f=="\\")R=Qre;else{if(!o||o.scheme!="file"){R=Wf;continue}if(f==Tu)T.host=o.host,T.path=kh(o.path),T.query=o.query;else if(f=="?")T.host=o.host,T.path=kh(o.path),T.query="",R=m_;else{if(f!="#"){$re(YI(kh(c,A),""))||(T.host=o.host,T.path=kh(o.path),T.shortenPath()),R=Wf;continue}T.host=o.host,T.path=kh(o.path),T.query=o.query,T.fragment="",R=Am}}break;case Qre:if(f=="/"||f=="\\"){R=pW;break}o&&o.scheme=="file"&&!$re(YI(kh(c,A),""))&&(ZI(o.path[0],!0)?_b(T.path,o.path[0]):T.host=o.host),R=Wf;continue;case pW:if(f==Tu||f=="/"||f=="\\"||f=="?"||f=="#"){if(!a&&ZI(L))R=Wf;else if(L==""){if(T.host="",a)return;R=Eb}else{if(v=T.parseHost(L))return v;if(T.host=="localhost"&&(T.host=""),a)return;L="",R=Eb}continue}L+=f;break;case Eb:if(T.isSpecial()){if(R=Wf,f!="/"&&f!="\\")continue}else if(a||f!="?")if(a||f!="#"){if(f!=Tu&&(R=Wf,f!="/"))continue}else T.fragment="",R=Am;else T.query="",R=m_;break;case Wf:if(f==Tu||f=="/"||f=="\\"&&T.isSpecial()||!a&&(f=="?"||f=="#")){if((w=Ak(w=L))===".."||w==="%2e."||w===".%2e"||w==="%2e%2e"?(T.shortenPath(),f=="/"||f=="\\"&&T.isSpecial()||_b(T.path,"")):o3e(L)?f=="/"||f=="\\"&&T.isSpecial()||_b(T.path,""):(T.scheme=="file"&&!T.path.length&&ZI(L)&&(T.host&&(T.host=""),L=Au(L,0)+":"),_b(T.path,L)),L="",T.scheme=="file"&&(f==Tu||f=="?"||f=="#"))for(;T.path.length>1&&T.path[0]==="";)YIe(T.path);f=="?"?(T.query="",R=m_):f=="#"&&(T.fragment="",R=Am)}else L+=Y0(f,Wre);break;case Zre:f=="?"?(T.query="",R=m_):f=="#"?(T.fragment="",R=Am):f!=Tu&&(T.path[0]+=Y0(f,Ik));break;case m_:a||f!="#"?f!=Tu&&(f=="'"&&T.isSpecial()?T.query+="%27":T.query+=f=="#"?"%23":Y0(f,Ik)):(T.fragment="",R=Am);break;case Am:f!=Tu&&(T.fragment+=Y0(f,Gre))}A++}},parseHost:function(r){var a,o,c;if(Au(r,0)=="["){if(Au(r,r.length-1)!="]"||(a=function(f){var g,v,w,T,R,A,L,U=[0,0,0,0,0,0,0,0],F=0,Z=null,W=0,K=function(){return Au(f,W)};if(K()==":"){if(Au(f,1)!=":")return;W+=2,Z=++F}for(;K();){if(F==8)return;if(K()!=":"){for(g=v=0;v<4&&Mh(Hre,K());)g=16*g+xk(K(),16),W++,v++;if(K()=="."){if(v==0||(W-=v,F>6))return;for(w=0;K();){if(T=null,w>0){if(!(K()=="."&&w<4))return;W++}if(!Mh(sW,K()))return;for(;Mh(sW,K());){if(R=xk(K(),10),T===null)T=R;else{if(T==0)return;T=10*T+R}if(T>255)return;W++}U[F]=256*U[F]+T,++w!=2&&w!=4||F++}if(w!=4)return;break}if(K()==":"){if(W++,!K())return}else if(K())return;U[F++]=g}else{if(Z!==null)return;W++,Z=++F}}if(Z!==null)for(A=F-Z,F=7;F!=0&&A>0;)L=U[F],U[F--]=U[Z+A-1],U[Z+--A]=L;else if(F!=8)return;return U}(XI(r,1,-1)),!a))return JI;this.host=a}else if(this.isSpecial()){if(r=BIe(r),Mh(n3e,r)||(a=function(f){var g,v,w,T,R,A,L,U=XIe(f,".");if(U.length&&U[U.length-1]==""&&U.length--,(g=U.length)>4)return f;for(v=[],w=0;w<g;w++){if((T=U[w])=="")return f;if(R=10,T.length>1&&Au(T,0)=="0"&&(R=Mh(ZIe,T)?16:8,T=XI(T,R==8?1:2)),T==="")A=0;else{if(!Mh(R==10?t3e:R==8?e3e:Hre,T))return f;A=xk(T,R)}_b(v,A)}for(w=0;w<g;w++)if(A=v[w],w==g-1){if(A>=Bre(256,5-g))return null}else if(A>255)return null;for(L=qIe(v),w=0;w<v.length;w++)L+=v[w]*Bre(256,3-w);return L}(r),a===null))return JI;this.host=a}else{if(Mh(i3e,r))return JI;for(a="",o=yb(r),c=0;c<o.length;c++)a+=Y0(o[c],Ik);this.host=a}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return eW(Nk,this.scheme)},shortenPath:function(){var r=this.path,a=r.length;!a||this.scheme=="file"&&a==1&&ZI(r[0],!0)||r.length--},serialize:function(){var r=this,a=r.scheme,o=r.username,c=r.password,f=r.host,g=r.port,v=r.path,w=r.query,T=r.fragment,R=a+":";return f!==null?(R+="//",r.includesCredentials()&&(R+=o+(c?":"+c:"")+"@"),R+=QI(f),g!==null&&(R+=":"+g)):a=="file"&&(R+="//"),R+=r.cannotBeABaseURL?v[0]:v.length?"/"+YI(v,"/"):"",w!==null&&(R+="?"+w),T!==null&&(R+="#"+T),R},setHref:function(r){var a=this.parse(r);if(a)throw nW(a);this.searchParams.update()},getOrigin:function(){var r=this.scheme,a=this.port;if(r=="blob")try{return new wb(r.path[0]).origin}catch{return"null"}return r!="file"&&this.isSpecial()?r+"://"+QI(this.host)+(a!==null?":"+a:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(xm(r)+":",oW)},getUsername:function(){return this.username},setUsername:function(r){var a=yb(xm(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var o=0;o<a.length;o++)this.username+=Y0(a[o],aW)}},getPassword:function(){return this.password},setPassword:function(r){var a=yb(xm(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var o=0;o<a.length;o++)this.password+=Y0(a[o],aW)}},getHost:function(){var r=this.host,a=this.port;return r===null?"":a===null?QI(r):QI(r)+":"+a},setHost:function(r){this.cannotBeABaseURL||this.parse(r,dW)},getHostname:function(){var r=this.host;return r===null?"":QI(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,uW)},getPort:function(){var r=this.port;return r===null?"":xm(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||((r=xm(r))==""?this.port=null:this.parse(r,hW))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+YI(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,Eb))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){(r=xm(r))==""?this.query=null:(Au(r,0)=="?"&&(r=XI(r,1)),this.query="",this.parse(r,m_)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){(r=xm(r))!=""?(Au(r,0)=="#"&&(r=XI(r,1)),this.fragment="",this.parse(r,Am)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var wb=function(r){var a=UIe(this,Vl),o=zIe(arguments.length,1)>1?arguments[1]:void 0,c=HIe(a,new mW(r,!1,o));QG||(a.href=c.serialize(),a.origin=c.getOrigin(),a.protocol=c.getProtocol(),a.username=c.getUsername(),a.password=c.getPassword(),a.host=c.getHost(),a.hostname=c.getHostname(),a.port=c.getPort(),a.pathname=c.getPathname(),a.search=c.getSearch(),a.searchParams=c.getSearchParams(),a.hash=c.getHash())},Vl=wb.prototype,Iu=function(r,a){return{get:function(){return Rk(this)[r]()},set:a&&function(o){return Rk(this)[a](o)},configurable:!0,enumerable:!0}};if(QG&&(xu(Vl,"href",Iu("serialize","setHref")),xu(Vl,"origin",Iu("getOrigin")),xu(Vl,"protocol",Iu("getProtocol","setProtocol")),xu(Vl,"username",Iu("getUsername","setUsername")),xu(Vl,"password",Iu("getPassword","setPassword")),xu(Vl,"host",Iu("getHost","setHost")),xu(Vl,"hostname",Iu("getHostname","setHostname")),xu(Vl,"port",Iu("getPort","setPort")),xu(Vl,"pathname",Iu("getPathname","setPathname")),xu(Vl,"search",Iu("getSearch","setSearch")),xu(Vl,"searchParams",Iu("getSearchParams")),xu(Vl,"hash",Iu("getHash","setHash"))),Tk(Vl,"toJSON",function(){return Rk(this).serialize()},{enumerable:!0}),Tk(Vl,"toString",function(){return Rk(this).serialize()},{enumerable:!0}),qI){var ese=qI.createObjectURL,tse=qI.revokeObjectURL;ese&&Tk(wb,"createObjectURL",jre(ese,qI)),tse&&Tk(wb,"revokeObjectURL",jre(tse,qI))}VIe(wb,"URL"),MIe({global:!0,constructor:!0,forced:!jIe,sham:!QG},{URL:wb});var l3e=Ii,c3e=d,d3e=TS,nse=Ol,u3e=VH,ise=en("URL");l3e({target:"URL",stat:!0,forced:!(u3e&&c3e(function(){ise.canParse()}))},{canParse:function(r){var a=d3e(arguments.length,1),o=nse(r),c=a<2||arguments[1]===void 0?void 0:nse(arguments[1]);try{return!!new ise(o,c)}catch{return!1}}});var rse=l(Me.URL),h3e=C,f3e=Pne,sse=RegExp.prototype,p3e=function(r){return r===sse||h3e(sse,r)?f3e(r):r.flags},Ua=l(p3e);function Sb(r){let a=r.length;for(;--a>=0;)r[a]=0}let gW=256,ase=286,e3=30,t3=15,vW=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Lk=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),m3e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ose=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Im=new Array(576);Sb(Im);let n3=new Array(60);Sb(n3);let i3=new Array(512);Sb(i3);let r3=new Array(256);Sb(r3);let yW=new Array(29);Sb(yW);let Dk=new Array(e3);function _W(r,a,o,c,f){this.static_tree=r,this.extra_bits=a,this.extra_base=o,this.elems=c,this.max_length=f,this.has_stree=r&&r.length}let lse,cse,dse;function EW(r,a){this.dyn_tree=r,this.max_code=0,this.stat_desc=a}Sb(Dk);let use=r=>r<256?i3[r]:i3[256+(r>>>7)],s3=(r,a)=>{r.pending_buf[r.pending++]=255&a,r.pending_buf[r.pending++]=a>>>8&255},Nc=(r,a,o)=>{r.bi_valid>16-o?(r.bi_buf|=a<<r.bi_valid&65535,s3(r,r.bi_buf),r.bi_buf=a>>16-r.bi_valid,r.bi_valid+=o-16):(r.bi_buf|=a<<r.bi_valid&65535,r.bi_valid+=o)},$f=(r,a,o)=>{Nc(r,o[2*a],o[2*a+1])},hse=(r,a)=>{let o=0;do o|=1&r,r>>>=1,o<<=1;while(--a>0);return o>>>1},fse=(r,a,o)=>{let c=new Array(16),f,g,v=0;for(f=1;f<=t3;f++)v=v+o[f-1]<<1,c[f]=v;for(g=0;g<=a;g++){let w=r[2*g+1];w!==0&&(r[2*g]=hse(c[w]++,w))}},pse=r=>{let a;for(a=0;a<ase;a++)r.dyn_ltree[2*a]=0;for(a=0;a<e3;a++)r.dyn_dtree[2*a]=0;for(a=0;a<19;a++)r.bl_tree[2*a]=0;r.dyn_ltree[512]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},mse=r=>{r.bi_valid>8?s3(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},gse=(r,a,o,c)=>{let f=2*a,g=2*o;return r[f]<r[g]||r[f]===r[g]&&c[a]<=c[o]},wW=(r,a,o)=>{let c=r.heap[o],f=o<<1;for(;f<=r.heap_len&&(f<r.heap_len&&gse(a,r.heap[f+1],r.heap[f],r.depth)&&f++,!gse(a,c,r.heap[f],r.depth));)r.heap[o]=r.heap[f],o=f,f<<=1;r.heap[o]=c},vse=(r,a,o)=>{let c,f,g,v,w=0;if(r.sym_next!==0)do c=255&r.pending_buf[r.sym_buf+w++],c+=(255&r.pending_buf[r.sym_buf+w++])<<8,f=r.pending_buf[r.sym_buf+w++],c===0?$f(r,f,a):(g=r3[f],$f(r,g+gW+1,a),v=vW[g],v!==0&&(f-=yW[g],Nc(r,f,v)),c--,g=use(c),$f(r,g,o),v=Lk[g],v!==0&&(c-=Dk[g],Nc(r,c,v)));while(w<r.sym_next);$f(r,256,a)},SW=(r,a)=>{let o=a.dyn_tree,c=a.stat_desc.static_tree,f=a.stat_desc.has_stree,g=a.stat_desc.elems,v,w,T,R=-1;for(r.heap_len=0,r.heap_max=573,v=0;v<g;v++)o[2*v]!==0?(r.heap[++r.heap_len]=R=v,r.depth[v]=0):o[2*v+1]=0;for(;r.heap_len<2;)T=r.heap[++r.heap_len]=R<2?++R:0,o[2*T]=1,r.depth[T]=0,r.opt_len--,f&&(r.static_len-=c[2*T+1]);for(a.max_code=R,v=r.heap_len>>1;v>=1;v--)wW(r,o,v);T=g;do v=r.heap[1],r.heap[1]=r.heap[r.heap_len--],wW(r,o,1),w=r.heap[1],r.heap[--r.heap_max]=v,r.heap[--r.heap_max]=w,o[2*T]=o[2*v]+o[2*w],r.depth[T]=(r.depth[v]>=r.depth[w]?r.depth[v]:r.depth[w])+1,o[2*v+1]=o[2*w+1]=T,r.heap[1]=T++,wW(r,o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],((A,L)=>{let U=L.dyn_tree,F=L.max_code,Z=L.stat_desc.static_tree,W=L.stat_desc.has_stree,K=L.stat_desc.extra_bits,oe=L.stat_desc.extra_base,ue=L.stat_desc.max_length,xe,Ne,ke,He,lt,ut,ft=0;for(He=0;He<=t3;He++)A.bl_count[He]=0;for(U[2*A.heap[A.heap_max]+1]=0,xe=A.heap_max+1;xe<573;xe++)Ne=A.heap[xe],He=U[2*U[2*Ne+1]+1]+1,He>ue&&(He=ue,ft++),U[2*Ne+1]=He,Ne>F||(A.bl_count[He]++,lt=0,Ne>=oe&&(lt=K[Ne-oe]),ut=U[2*Ne],A.opt_len+=ut*(He+lt),W&&(A.static_len+=ut*(Z[2*Ne+1]+lt)));if(ft!==0){do{for(He=ue-1;A.bl_count[He]===0;)He--;A.bl_count[He]--,A.bl_count[He+1]+=2,A.bl_count[ue]--,ft-=2}while(ft>0);for(He=ue;He!==0;He--)for(Ne=A.bl_count[He];Ne!==0;)ke=A.heap[--xe],ke>F||(U[2*ke+1]!==He&&(A.opt_len+=(He-U[2*ke+1])*U[2*ke],U[2*ke+1]=He),Ne--)}})(r,a),fse(o,R,r.bl_count)},yse=(r,a,o)=>{let c,f,g=-1,v=a[1],w=0,T=7,R=4;for(v===0&&(T=138,R=3),a[2*(o+1)+1]=65535,c=0;c<=o;c++)f=v,v=a[2*(c+1)+1],++w<T&&f===v||(w<R?r.bl_tree[2*f]+=w:f!==0?(f!==g&&r.bl_tree[2*f]++,r.bl_tree[32]++):w<=10?r.bl_tree[34]++:r.bl_tree[36]++,w=0,g=f,v===0?(T=138,R=3):f===v?(T=6,R=3):(T=7,R=4))},_se=(r,a,o)=>{let c,f,g=-1,v=a[1],w=0,T=7,R=4;for(v===0&&(T=138,R=3),c=0;c<=o;c++)if(f=v,v=a[2*(c+1)+1],!(++w<T&&f===v)){if(w<R)do $f(r,f,r.bl_tree);while(--w!=0);else f!==0?(f!==g&&($f(r,f,r.bl_tree),w--),$f(r,16,r.bl_tree),Nc(r,w-3,2)):w<=10?($f(r,17,r.bl_tree),Nc(r,w-3,3)):($f(r,18,r.bl_tree),Nc(r,w-11,7));w=0,g=f,v===0?(T=138,R=3):f===v?(T=6,R=3):(T=7,R=4)}},Ese=!1,wse=(r,a,o,c)=>{Nc(r,0+(c?1:0),3),mse(r),s3(r,o),s3(r,~o),o&&r.pending_buf.set(r.window.subarray(a,a+o),r.pending),r.pending+=o};var g3e=r=>{Ese||((()=>{let a,o,c,f,g,v=new Array(16);for(c=0,f=0;f<28;f++)for(yW[f]=c,a=0;a<1<<vW[f];a++)r3[c++]=f;for(r3[c-1]=f,g=0,f=0;f<16;f++)for(Dk[f]=g,a=0;a<1<<Lk[f];a++)i3[g++]=f;for(g>>=7;f<e3;f++)for(Dk[f]=g<<7,a=0;a<1<<Lk[f]-7;a++)i3[256+g++]=f;for(o=0;o<=t3;o++)v[o]=0;for(a=0;a<=143;)Im[2*a+1]=8,a++,v[8]++;for(;a<=255;)Im[2*a+1]=9,a++,v[9]++;for(;a<=279;)Im[2*a+1]=7,a++,v[7]++;for(;a<=287;)Im[2*a+1]=8,a++,v[8]++;for(fse(Im,287,v),a=0;a<e3;a++)n3[2*a+1]=5,n3[2*a]=hse(a,5);lse=new _W(Im,vW,257,ase,t3),cse=new _W(n3,Lk,0,e3,t3),dse=new _W(new Array(0),m3e,0,19,7)})(),Ese=!0),r.l_desc=new EW(r.dyn_ltree,lse),r.d_desc=new EW(r.dyn_dtree,cse),r.bl_desc=new EW(r.bl_tree,dse),r.bi_buf=0,r.bi_valid=0,pse(r)},v3e=(r,a,o,c)=>{let f,g,v=0;r.level>0?(r.strm.data_type===2&&(r.strm.data_type=(w=>{let T,R=4093624447;for(T=0;T<=31;T++,R>>>=1)if(1&R&&w.dyn_ltree[2*T]!==0)return 0;if(w.dyn_ltree[18]!==0||w.dyn_ltree[20]!==0||w.dyn_ltree[26]!==0)return 1;for(T=32;T<gW;T++)if(w.dyn_ltree[2*T]!==0)return 1;return 0})(r)),SW(r,r.l_desc),SW(r,r.d_desc),v=(w=>{let T;for(yse(w,w.dyn_ltree,w.l_desc.max_code),yse(w,w.dyn_dtree,w.d_desc.max_code),SW(w,w.bl_desc),T=18;T>=3&&w.bl_tree[2*ose[T]+1]===0;T--);return w.opt_len+=3*(T+1)+5+5+4,T})(r),f=r.opt_len+3+7>>>3,g=r.static_len+3+7>>>3,g<=f&&(f=g)):f=g=o+5,o+4<=f&&a!==-1?wse(r,a,o,c):r.strategy===4||g===f?(Nc(r,2+(c?1:0),3),vse(r,Im,n3)):(Nc(r,4+(c?1:0),3),((w,T,R,A)=>{let L;for(Nc(w,T-257,5),Nc(w,R-1,5),Nc(w,A-4,4),L=0;L<A;L++)Nc(w,w.bl_tree[2*ose[L]+1],3);_se(w,w.dyn_ltree,T-1),_se(w,w.dyn_dtree,R-1)})(r,r.l_desc.max_code+1,r.d_desc.max_code+1,v+1),vse(r,r.dyn_ltree,r.dyn_dtree)),pse(r),c&&mse(r)},y3e=(r,a,o)=>(r.pending_buf[r.sym_buf+r.sym_next++]=a,r.pending_buf[r.sym_buf+r.sym_next++]=a>>8,r.pending_buf[r.sym_buf+r.sym_next++]=o,a===0?r.dyn_ltree[2*o]++:(r.matches++,a--,r.dyn_ltree[2*(r3[o]+gW+1)]++,r.dyn_dtree[2*use(a)]++),r.sym_next===r.sym_end),_3e=r=>{Nc(r,2,3),$f(r,256,Im),(a=>{a.bi_valid===16?(s3(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)})(r)},E3e={_tr_init:g3e,_tr_stored_block:wse,_tr_flush_block:v3e,_tr_tally:y3e,_tr_align:_3e},a3=(r,a,o,c)=>{let f=65535&r|0,g=r>>>16&65535|0,v=0;for(;o!==0;){v=o>2e3?2e3:o,o-=v;do f=f+a[c++]|0,g=g+f|0;while(--v);f%=65521,g%=65521}return f|g<<16|0};let w3e=new Uint32Array((()=>{let r,a=[];for(var o=0;o<256;o++){r=o;for(var c=0;c<8;c++)r=1&r?3988292384^r>>>1:r>>>1;a[o]=r}return a})());var co=(r,a,o,c)=>{let f=w3e,g=c+o;r^=-1;for(let v=c;v<g;v++)r=r>>>8^f[255&(r^a[v])];return-1^r},g_={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},bb={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};let{_tr_init:S3e,_tr_stored_block:bW,_tr_flush_block:b3e,_tr_tally:X0,_tr_align:C3e}=E3e,{Z_NO_FLUSH:J0,Z_PARTIAL_FLUSH:T3e,Z_FULL_FLUSH:R3e,Z_FINISH:Nu,Z_BLOCK:Sse,Z_OK:Do,Z_STREAM_END:bse,Z_STREAM_ERROR:Kf,Z_DATA_ERROR:x3e,Z_BUF_ERROR:CW,Z_DEFAULT_COMPRESSION:A3e,Z_FILTERED:I3e,Z_HUFFMAN_ONLY:kk,Z_RLE:N3e,Z_FIXED:O3e,Z_DEFAULT_STRATEGY:P3e,Z_UNKNOWN:L3e,Z_DEFLATED:Mk}=bb,TW=286,D3e=30,k3e=19,M3e=2*TW+1,j3e=15,v_=258,qf=262,Cb=42,y_=113,o3=666,__=(r,a)=>(r.msg=g_[a],a),Cse=r=>2*r-(r>4?9:0),Q0=r=>{let a=r.length;for(;--a>=0;)r[a]=0},U3e=r=>{let a,o,c,f=r.w_size;a=r.hash_size,c=a;do o=r.head[--c],r.head[c]=o>=f?o-f:0;while(--a);a=f,c=a;do o=r.prev[--c],r.prev[c]=o>=f?o-f:0;while(--a)},Z0=(r,a,o)=>(a<<r.hash_shift^o)&r.hash_mask,vd=r=>{let a=r.state,o=a.pending;o>r.avail_out&&(o=r.avail_out),o!==0&&(r.output.set(a.pending_buf.subarray(a.pending_out,a.pending_out+o),r.next_out),r.next_out+=o,a.pending_out+=o,r.total_out+=o,r.avail_out-=o,a.pending-=o,a.pending===0&&(a.pending_out=0))},yd=(r,a)=>{b3e(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,a),r.block_start=r.strstart,vd(r.strm)},Rr=(r,a)=>{r.pending_buf[r.pending++]=a},l3=(r,a)=>{r.pending_buf[r.pending++]=a>>>8&255,r.pending_buf[r.pending++]=255&a},RW=(r,a,o,c)=>{let f=r.avail_in;return f>c&&(f=c),f===0?0:(r.avail_in-=f,a.set(r.input.subarray(r.next_in,r.next_in+f),o),r.state.wrap===1?r.adler=a3(r.adler,a,f,o):r.state.wrap===2&&(r.adler=co(r.adler,a,f,o)),r.next_in+=f,r.total_in+=f,f)},Tse=(r,a)=>{let o,c,f=r.max_chain_length,g=r.strstart,v=r.prev_length,w=r.nice_match,T=r.strstart>r.w_size-qf?r.strstart-(r.w_size-qf):0,R=r.window,A=r.w_mask,L=r.prev,U=r.strstart+v_,F=R[g+v-1],Z=R[g+v];r.prev_length>=r.good_match&&(f>>=2),w>r.lookahead&&(w=r.lookahead);do if(o=a,R[o+v]===Z&&R[o+v-1]===F&&R[o]===R[g]&&R[++o]===R[g+1]){g+=2,o++;do;while(R[++g]===R[++o]&&R[++g]===R[++o]&&R[++g]===R[++o]&&R[++g]===R[++o]&&R[++g]===R[++o]&&R[++g]===R[++o]&&R[++g]===R[++o]&&R[++g]===R[++o]&&g<U);if(c=v_-(U-g),g=U-v_,c>v){if(r.match_start=a,v=c,c>=w)break;F=R[g+v-1],Z=R[g+v]}}while((a=L[a&A])>T&&--f!=0);return v<=r.lookahead?v:r.lookahead},Tb=r=>{let a=r.w_size,o,c,f;do{if(c=r.window_size-r.lookahead-r.strstart,r.strstart>=a+(a-qf)&&(r.window.set(r.window.subarray(a,a+a-c),0),r.match_start-=a,r.strstart-=a,r.block_start-=a,r.insert>r.strstart&&(r.insert=r.strstart),U3e(r),c+=a),r.strm.avail_in===0)break;if(o=RW(r.strm,r.window,r.strstart+r.lookahead,c),r.lookahead+=o,r.lookahead+r.insert>=3)for(f=r.strstart-r.insert,r.ins_h=r.window[f],r.ins_h=Z0(r,r.ins_h,r.window[f+1]);r.insert&&(r.ins_h=Z0(r,r.ins_h,r.window[f+3-1]),r.prev[f&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=f,f++,r.insert--,!(r.lookahead+r.insert<3)););}while(r.lookahead<qf&&r.strm.avail_in!==0)},Rse=(r,a)=>{let o,c,f,g=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,v=0,w=r.strm.avail_in;do{if(o=65535,f=r.bi_valid+42>>3,r.strm.avail_out<f||(f=r.strm.avail_out-f,c=r.strstart-r.block_start,o>c+r.strm.avail_in&&(o=c+r.strm.avail_in),o>f&&(o=f),o<g&&(o===0&&a!==Nu||a===J0||o!==c+r.strm.avail_in)))break;v=a===Nu&&o===c+r.strm.avail_in?1:0,bW(r,0,0,v),r.pending_buf[r.pending-4]=o,r.pending_buf[r.pending-3]=o>>8,r.pending_buf[r.pending-2]=~o,r.pending_buf[r.pending-1]=~o>>8,vd(r.strm),c&&(c>o&&(c=o),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+c),r.strm.next_out),r.strm.next_out+=c,r.strm.avail_out-=c,r.strm.total_out+=c,r.block_start+=c,o-=c),o&&(RW(r.strm,r.strm.output,r.strm.next_out,o),r.strm.next_out+=o,r.strm.avail_out-=o,r.strm.total_out+=o)}while(v===0);return w-=r.strm.avail_in,w&&(w>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=w&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-w,r.strm.next_in),r.strstart),r.strstart+=w,r.insert+=w>r.w_size-r.insert?r.w_size-r.insert:w),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),v?4:a!==J0&&a!==Nu&&r.strm.avail_in===0&&r.strstart===r.block_start?2:(f=r.window_size-r.strstart,r.strm.avail_in>f&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,f+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),f>r.strm.avail_in&&(f=r.strm.avail_in),f&&(RW(r.strm,r.window,r.strstart,f),r.strstart+=f,r.insert+=f>r.w_size-r.insert?r.w_size-r.insert:f),r.high_water<r.strstart&&(r.high_water=r.strstart),f=r.bi_valid+42>>3,f=r.pending_buf_size-f>65535?65535:r.pending_buf_size-f,g=f>r.w_size?r.w_size:f,c=r.strstart-r.block_start,(c>=g||(c||a===Nu)&&a!==J0&&r.strm.avail_in===0&&c<=f)&&(o=c>f?f:c,v=a===Nu&&r.strm.avail_in===0&&o===c?1:0,bW(r,r.block_start,o,v),r.block_start+=o,vd(r.strm)),v?3:1)},xW=(r,a)=>{let o,c;for(;;){if(r.lookahead<qf){if(Tb(r),r.lookahead<qf&&a===J0)return 1;if(r.lookahead===0)break}if(o=0,r.lookahead>=3&&(r.ins_h=Z0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),o!==0&&r.strstart-o<=r.w_size-qf&&(r.match_length=Tse(r,o)),r.match_length>=3)if(c=X0(r,r.strstart-r.match_start,r.match_length-3),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=3){r.match_length--;do r.strstart++,r.ins_h=Z0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!=0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Z0(r,r.ins_h,r.window[r.strstart+1]);else c=X0(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(c&&(yd(r,!1),r.strm.avail_out===0))return 1}return r.insert=r.strstart<2?r.strstart:2,a===Nu?(yd(r,!0),r.strm.avail_out===0?3:4):r.sym_next&&(yd(r,!1),r.strm.avail_out===0)?1:2},Rb=(r,a)=>{let o,c,f;for(;;){if(r.lookahead<qf){if(Tb(r),r.lookahead<qf&&a===J0)return 1;if(r.lookahead===0)break}if(o=0,r.lookahead>=3&&(r.ins_h=Z0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=2,o!==0&&r.prev_length<r.max_lazy_match&&r.strstart-o<=r.w_size-qf&&(r.match_length=Tse(r,o),r.match_length<=5&&(r.strategy===I3e||r.match_length===3&&r.strstart-r.match_start>4096)&&(r.match_length=2)),r.prev_length>=3&&r.match_length<=r.prev_length){f=r.strstart+r.lookahead-3,c=X0(r,r.strstart-1-r.prev_match,r.prev_length-3),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=f&&(r.ins_h=Z0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!=0);if(r.match_available=0,r.match_length=2,r.strstart++,c&&(yd(r,!1),r.strm.avail_out===0))return 1}else if(r.match_available){if(c=X0(r,0,r.window[r.strstart-1]),c&&yd(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return 1}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(c=X0(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<2?r.strstart:2,a===Nu?(yd(r,!0),r.strm.avail_out===0?3:4):r.sym_next&&(yd(r,!1),r.strm.avail_out===0)?1:2};function Yf(r,a,o,c,f){this.good_length=r,this.max_lazy=a,this.nice_length=o,this.max_chain=c,this.func=f}let c3=[new Yf(0,0,0,0,Rse),new Yf(4,4,8,4,xW),new Yf(4,5,16,8,xW),new Yf(4,6,32,32,xW),new Yf(4,4,16,16,Rb),new Yf(8,16,32,32,Rb),new Yf(8,16,128,128,Rb),new Yf(8,32,128,256,Rb),new Yf(32,128,258,1024,Rb),new Yf(32,258,258,4096,Rb)];function F3e(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Mk,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*M3e),this.dyn_dtree=new Uint16Array(2*(2*D3e+1)),this.bl_tree=new Uint16Array(2*(2*k3e+1)),Q0(this.dyn_ltree),Q0(this.dyn_dtree),Q0(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(j3e+1),this.heap=new Uint16Array(2*TW+1),Q0(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*TW+1),Q0(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}let d3=r=>{if(!r)return 1;let a=r.state;return!a||a.strm!==r||a.status!==Cb&&a.status!==57&&a.status!==69&&a.status!==73&&a.status!==91&&a.status!==103&&a.status!==y_&&a.status!==o3?1:0},xse=r=>{if(d3(r))return __(r,Kf);r.total_in=r.total_out=0,r.data_type=L3e;let a=r.state;return a.pending=0,a.pending_out=0,a.wrap<0&&(a.wrap=-a.wrap),a.status=a.wrap===2?57:a.wrap?Cb:y_,r.adler=a.wrap===2?0:1,a.last_flush=-2,S3e(a),Do},Ase=r=>{let a=xse(r);return a===Do&&(o=>{o.window_size=2*o.w_size,Q0(o.head),o.max_lazy_match=c3[o.level].max_lazy,o.good_match=c3[o.level].good_length,o.nice_match=c3[o.level].nice_length,o.max_chain_length=c3[o.level].max_chain,o.strstart=0,o.block_start=0,o.lookahead=0,o.insert=0,o.match_length=o.prev_length=2,o.match_available=0,o.ins_h=0})(r.state),a},Ise=(r,a,o,c,f,g)=>{if(!r)return Kf;let v=1;if(a===A3e&&(a=6),c<0?(v=0,c=-c):c>15&&(v=2,c-=16),f<1||f>9||o!==Mk||c<8||c>15||a<0||a>9||g<0||g>O3e||c===8&&v!==1)return __(r,Kf);c===8&&(c=9);let w=new F3e;return r.state=w,w.strm=r,w.status=Cb,w.wrap=v,w.gzhead=null,w.w_bits=c,w.w_size=1<<w.w_bits,w.w_mask=w.w_size-1,w.hash_bits=f+7,w.hash_size=1<<w.hash_bits,w.hash_mask=w.hash_size-1,w.hash_shift=~~((w.hash_bits+3-1)/3),w.window=new Uint8Array(2*w.w_size),w.head=new Uint16Array(w.hash_size),w.prev=new Uint16Array(w.w_size),w.lit_bufsize=1<<f+6,w.pending_buf_size=4*w.lit_bufsize,w.pending_buf=new Uint8Array(w.pending_buf_size),w.sym_buf=w.lit_bufsize,w.sym_end=3*(w.lit_bufsize-1),w.level=a,w.strategy=g,w.method=o,Ase(r)};var B3e=(r,a)=>{if(d3(r)||a>Sse||a<0)return r?__(r,Kf):Kf;let o=r.state;if(!r.output||r.avail_in!==0&&!r.input||o.status===o3&&a!==Nu)return __(r,r.avail_out===0?CW:Kf);let c=o.last_flush;if(o.last_flush=a,o.pending!==0){if(vd(r),r.avail_out===0)return o.last_flush=-1,Do}else if(r.avail_in===0&&Cse(a)<=Cse(c)&&a!==Nu)return __(r,CW);if(o.status===o3&&r.avail_in!==0)return __(r,CW);if(o.status===Cb&&o.wrap===0&&(o.status=y_),o.status===Cb){let f=Mk+(o.w_bits-8<<4)<<8,g=-1;if(g=o.strategy>=kk||o.level<2?0:o.level<6?1:o.level===6?2:3,f|=g<<6,o.strstart!==0&&(f|=32),f+=31-f%31,l3(o,f),o.strstart!==0&&(l3(o,r.adler>>>16),l3(o,65535&r.adler)),r.adler=1,o.status=y_,vd(r),o.pending!==0)return o.last_flush=-1,Do}if(o.status===57){if(r.adler=0,Rr(o,31),Rr(o,139),Rr(o,8),o.gzhead)Rr(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),Rr(o,255&o.gzhead.time),Rr(o,o.gzhead.time>>8&255),Rr(o,o.gzhead.time>>16&255),Rr(o,o.gzhead.time>>24&255),Rr(o,o.level===9?2:o.strategy>=kk||o.level<2?4:0),Rr(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(Rr(o,255&o.gzhead.extra.length),Rr(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(r.adler=co(r.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=69;else if(Rr(o,0),Rr(o,0),Rr(o,0),Rr(o,0),Rr(o,0),Rr(o,o.level===9?2:o.strategy>=kk||o.level<2?4:0),Rr(o,3),o.status=y_,vd(r),o.pending!==0)return o.last_flush=-1,Do}if(o.status===69){if(o.gzhead.extra){let f=o.pending,g=(65535&o.gzhead.extra.length)-o.gzindex;for(;o.pending+g>o.pending_buf_size;){let w=o.pending_buf_size-o.pending;if(o.pending_buf.set(o.gzhead.extra.subarray(o.gzindex,o.gzindex+w),o.pending),o.pending=o.pending_buf_size,o.gzhead.hcrc&&o.pending>f&&(r.adler=co(r.adler,o.pending_buf,o.pending-f,f)),o.gzindex+=w,vd(r),o.pending!==0)return o.last_flush=-1,Do;f=0,g-=w}let v=new Uint8Array(o.gzhead.extra);o.pending_buf.set(v.subarray(o.gzindex,o.gzindex+g),o.pending),o.pending+=g,o.gzhead.hcrc&&o.pending>f&&(r.adler=co(r.adler,o.pending_buf,o.pending-f,f)),o.gzindex=0}o.status=73}if(o.status===73){if(o.gzhead.name){let f,g=o.pending;do{if(o.pending===o.pending_buf_size){if(o.gzhead.hcrc&&o.pending>g&&(r.adler=co(r.adler,o.pending_buf,o.pending-g,g)),vd(r),o.pending!==0)return o.last_flush=-1,Do;g=0}f=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,Rr(o,f)}while(f!==0);o.gzhead.hcrc&&o.pending>g&&(r.adler=co(r.adler,o.pending_buf,o.pending-g,g)),o.gzindex=0}o.status=91}if(o.status===91){if(o.gzhead.comment){let f,g=o.pending;do{if(o.pending===o.pending_buf_size){if(o.gzhead.hcrc&&o.pending>g&&(r.adler=co(r.adler,o.pending_buf,o.pending-g,g)),vd(r),o.pending!==0)return o.last_flush=-1,Do;g=0}f=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,Rr(o,f)}while(f!==0);o.gzhead.hcrc&&o.pending>g&&(r.adler=co(r.adler,o.pending_buf,o.pending-g,g))}o.status=103}if(o.status===103){if(o.gzhead.hcrc){if(o.pending+2>o.pending_buf_size&&(vd(r),o.pending!==0))return o.last_flush=-1,Do;Rr(o,255&r.adler),Rr(o,r.adler>>8&255),r.adler=0}if(o.status=y_,vd(r),o.pending!==0)return o.last_flush=-1,Do}if(r.avail_in!==0||o.lookahead!==0||a!==J0&&o.status!==o3){let f=o.level===0?Rse(o,a):o.strategy===kk?((g,v)=>{let w;for(;;){if(g.lookahead===0&&(Tb(g),g.lookahead===0)){if(v===J0)return 1;break}if(g.match_length=0,w=X0(g,0,g.window[g.strstart]),g.lookahead--,g.strstart++,w&&(yd(g,!1),g.strm.avail_out===0))return 1}return g.insert=0,v===Nu?(yd(g,!0),g.strm.avail_out===0?3:4):g.sym_next&&(yd(g,!1),g.strm.avail_out===0)?1:2})(o,a):o.strategy===N3e?((g,v)=>{let w,T,R,A,L=g.window;for(;;){if(g.lookahead<=v_){if(Tb(g),g.lookahead<=v_&&v===J0)return 1;if(g.lookahead===0)break}if(g.match_length=0,g.lookahead>=3&&g.strstart>0&&(R=g.strstart-1,T=L[R],T===L[++R]&&T===L[++R]&&T===L[++R])){A=g.strstart+v_;do;while(T===L[++R]&&T===L[++R]&&T===L[++R]&&T===L[++R]&&T===L[++R]&&T===L[++R]&&T===L[++R]&&T===L[++R]&&R<A);g.match_length=v_-(A-R),g.match_length>g.lookahead&&(g.match_length=g.lookahead)}if(g.match_length>=3?(w=X0(g,1,g.match_length-3),g.lookahead-=g.match_length,g.strstart+=g.match_length,g.match_length=0):(w=X0(g,0,g.window[g.strstart]),g.lookahead--,g.strstart++),w&&(yd(g,!1),g.strm.avail_out===0))return 1}return g.insert=0,v===Nu?(yd(g,!0),g.strm.avail_out===0?3:4):g.sym_next&&(yd(g,!1),g.strm.avail_out===0)?1:2})(o,a):c3[o.level].func(o,a);if(f!==3&&f!==4||(o.status=o3),f===1||f===3)return r.avail_out===0&&(o.last_flush=-1),Do;if(f===2&&(a===T3e?C3e(o):a!==Sse&&(bW(o,0,0,!1),a===R3e&&(Q0(o.head),o.lookahead===0&&(o.strstart=0,o.block_start=0,o.insert=0))),vd(r),r.avail_out===0))return o.last_flush=-1,Do}return a!==Nu?Do:o.wrap<=0?bse:(o.wrap===2?(Rr(o,255&r.adler),Rr(o,r.adler>>8&255),Rr(o,r.adler>>16&255),Rr(o,r.adler>>24&255),Rr(o,255&r.total_in),Rr(o,r.total_in>>8&255),Rr(o,r.total_in>>16&255),Rr(o,r.total_in>>24&255)):(l3(o,r.adler>>>16),l3(o,65535&r.adler)),vd(r),o.wrap>0&&(o.wrap=-o.wrap),o.pending!==0?Do:bse)},V3e=(r,a)=>{let o=a.length;if(d3(r))return Kf;let c=r.state,f=c.wrap;if(f===2||f===1&&c.status!==Cb||c.lookahead)return Kf;if(f===1&&(r.adler=a3(r.adler,a,o,0)),c.wrap=0,o>=c.w_size){f===0&&(Q0(c.head),c.strstart=0,c.block_start=0,c.insert=0);let T=new Uint8Array(c.w_size);T.set(a.subarray(o-c.w_size,o),0),a=T,o=c.w_size}let g=r.avail_in,v=r.next_in,w=r.input;for(r.avail_in=o,r.next_in=0,r.input=a,Tb(c);c.lookahead>=3;){let T=c.strstart,R=c.lookahead-2;do c.ins_h=Z0(c,c.ins_h,c.window[T+3-1]),c.prev[T&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=T,T++;while(--R);c.strstart=T,c.lookahead=2,Tb(c)}return c.strstart+=c.lookahead,c.block_start=c.strstart,c.insert=c.lookahead,c.lookahead=0,c.match_length=c.prev_length=2,c.match_available=0,r.next_in=v,r.input=w,r.avail_in=g,c.wrap=f,Do},u3={deflateInit:(r,a)=>Ise(r,a,Mk,15,8,P3e),deflateInit2:Ise,deflateReset:Ase,deflateResetKeep:xse,deflateSetHeader:(r,a)=>d3(r)||r.state.wrap!==2?Kf:(r.state.gzhead=a,Do),deflate:B3e,deflateEnd:r=>{if(d3(r))return Kf;let a=r.state.status;return r.state=null,a===y_?__(r,x3e):Do},deflateSetDictionary:V3e,deflateInfo:"pako deflate (from Nodeca project)"};let z3e=(r,a)=>Object.prototype.hasOwnProperty.call(r,a);var jk={assign:function(r){let a=Array.prototype.slice.call(arguments,1);for(;a.length;){let o=a.shift();if(o){if(typeof o!="object")throw new TypeError(o+"must be non-object");for(let c in o)z3e(o,c)&&(r[c]=o[c])}}return r},flattenChunks:r=>{let a=0;for(let c=0,f=r.length;c<f;c++)a+=r[c].length;let o=new Uint8Array(a);for(let c=0,f=0,g=r.length;c<g;c++){let v=r[c];o.set(v,f),f+=v.length}return o}};let Nse=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Nse=!1}let h3=new Uint8Array(256);for(let r=0;r<256;r++)h3[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;h3[254]=h3[254]=1;var f3={string2buf:r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let a,o,c,f,g,v=r.length,w=0;for(f=0;f<v;f++)o=r.charCodeAt(f),(64512&o)==55296&&f+1<v&&(c=r.charCodeAt(f+1),(64512&c)==56320&&(o=65536+(o-55296<<10)+(c-56320),f++)),w+=o<128?1:o<2048?2:o<65536?3:4;for(a=new Uint8Array(w),g=0,f=0;g<w;f++)o=r.charCodeAt(f),(64512&o)==55296&&f+1<v&&(c=r.charCodeAt(f+1),(64512&c)==56320&&(o=65536+(o-55296<<10)+(c-56320),f++)),o<128?a[g++]=o:o<2048?(a[g++]=192|o>>>6,a[g++]=128|63&o):o<65536?(a[g++]=224|o>>>12,a[g++]=128|o>>>6&63,a[g++]=128|63&o):(a[g++]=240|o>>>18,a[g++]=128|o>>>12&63,a[g++]=128|o>>>6&63,a[g++]=128|63&o);return a},buf2string:(r,a)=>{let o=a||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,a));let c,f,g=new Array(2*o);for(f=0,c=0;c<o;){let v=r[c++];if(v<128){g[f++]=v;continue}let w=h3[v];if(w>4)g[f++]=65533,c+=w-1;else{for(v&=w===2?31:w===3?15:7;w>1&&c<o;)v=v<<6|63&r[c++],w--;w>1?g[f++]=65533:v<65536?g[f++]=v:(v-=65536,g[f++]=55296|v>>10&1023,g[f++]=56320|1023&v)}}return((v,w)=>{if(w<65534&&v.subarray&&Nse)return String.fromCharCode.apply(null,v.length===w?v:v.subarray(0,w));let T="";for(let R=0;R<w;R++)T+=String.fromCharCode(v[R]);return T})(g,f)},utf8border:(r,a)=>{(a=a||r.length)>r.length&&(a=r.length);let o=a-1;for(;o>=0&&(192&r[o])==128;)o--;return o<0||o===0?a:o+h3[r[o]]>a?o:a}},Ose=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};let Pse=Object.prototype.toString,{Z_NO_FLUSH:H3e,Z_SYNC_FLUSH:G3e,Z_FULL_FLUSH:W3e,Z_FINISH:$3e,Z_OK:Uk,Z_STREAM_END:K3e,Z_DEFAULT_COMPRESSION:q3e,Z_DEFAULT_STRATEGY:Y3e,Z_DEFLATED:X3e}=bb;function p3(r){this.options=jk.assign({level:q3e,method:X3e,chunkSize:16384,windowBits:15,memLevel:8,strategy:Y3e},r||{});let a=this.options;a.raw&&a.windowBits>0?a.windowBits=-a.windowBits:a.gzip&&a.windowBits>0&&a.windowBits<16&&(a.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ose,this.strm.avail_out=0;let o=u3.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(o!==Uk)throw new Error(g_[o]);if(a.header&&u3.deflateSetHeader(this.strm,a.header),a.dictionary){let c;if(c=typeof a.dictionary=="string"?f3.string2buf(a.dictionary):Pse.call(a.dictionary)==="[object ArrayBuffer]"?new Uint8Array(a.dictionary):a.dictionary,o=u3.deflateSetDictionary(this.strm,c),o!==Uk)throw new Error(g_[o]);this._dict_set=!0}}function AW(r,a){let o=new p3(a);if(o.push(r,!0),o.err)throw o.msg||g_[o.err];return o.result}p3.prototype.push=function(r,a){let o=this.strm,c=this.options.chunkSize,f,g;if(this.ended)return!1;for(g=a===~~a?a:a===!0?$3e:H3e,typeof r=="string"?o.input=f3.string2buf(r):Pse.call(r)==="[object ArrayBuffer]"?o.input=new Uint8Array(r):o.input=r,o.next_in=0,o.avail_in=o.input.length;;)if(o.avail_out===0&&(o.output=new Uint8Array(c),o.next_out=0,o.avail_out=c),(g===G3e||g===W3e)&&o.avail_out<=6)this.onData(o.output.subarray(0,o.next_out)),o.avail_out=0;else{if(f=u3.deflate(o,g),f===K3e)return o.next_out>0&&this.onData(o.output.subarray(0,o.next_out)),f=u3.deflateEnd(this.strm),this.onEnd(f),this.ended=!0,f===Uk;if(o.avail_out!==0){if(g>0&&o.next_out>0)this.onData(o.output.subarray(0,o.next_out)),o.avail_out=0;else if(o.avail_in===0)break}else this.onData(o.output)}return!0},p3.prototype.onData=function(r){this.chunks.push(r)},p3.prototype.onEnd=function(r){r===Uk&&(this.result=jk.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};var J3e={Deflate:p3,deflate:AW,deflateRaw:function(r,a){return(a=a||{}).raw=!0,AW(r,a)},gzip:function(r,a){return(a=a||{}).gzip=!0,AW(r,a)},constants:bb};let Fk=16209;var Q3e=function(r,a){let o,c,f,g,v,w,T,R,A,L,U,F,Z,W,K,oe,ue,xe,Ne,ke,He,lt,ut,ft,zt=r.state;o=r.next_in,ut=r.input,c=o+(r.avail_in-5),f=r.next_out,ft=r.output,g=f-(a-r.avail_out),v=f+(r.avail_out-257),w=zt.dmax,T=zt.wsize,R=zt.whave,A=zt.wnext,L=zt.window,U=zt.hold,F=zt.bits,Z=zt.lencode,W=zt.distcode,K=(1<<zt.lenbits)-1,oe=(1<<zt.distbits)-1;e:do{F<15&&(U+=ut[o++]<<F,F+=8,U+=ut[o++]<<F,F+=8),ue=Z[U&K];t:for(;;){if(xe=ue>>>24,U>>>=xe,F-=xe,xe=ue>>>16&255,xe===0)ft[f++]=65535&ue;else{if(!(16&xe)){if(!(64&xe)){ue=Z[(65535&ue)+(U&(1<<xe)-1)];continue t}if(32&xe){zt.mode=16191;break e}r.msg="invalid literal/length code",zt.mode=Fk;break e}Ne=65535&ue,xe&=15,xe&&(F<xe&&(U+=ut[o++]<<F,F+=8),Ne+=U&(1<<xe)-1,U>>>=xe,F-=xe),F<15&&(U+=ut[o++]<<F,F+=8,U+=ut[o++]<<F,F+=8),ue=W[U&oe];n:for(;;){if(xe=ue>>>24,U>>>=xe,F-=xe,xe=ue>>>16&255,!(16&xe)){if(!(64&xe)){ue=W[(65535&ue)+(U&(1<<xe)-1)];continue n}r.msg="invalid distance code",zt.mode=Fk;break e}if(ke=65535&ue,xe&=15,F<xe&&(U+=ut[o++]<<F,F+=8,F<xe&&(U+=ut[o++]<<F,F+=8)),ke+=U&(1<<xe)-1,ke>w){r.msg="invalid distance too far back",zt.mode=Fk;break e}if(U>>>=xe,F-=xe,xe=f-g,ke>xe){if(xe=ke-xe,xe>R&&zt.sane){r.msg="invalid distance too far back",zt.mode=Fk;break e}if(He=0,lt=L,A===0){if(He+=T-xe,xe<Ne){Ne-=xe;do ft[f++]=L[He++];while(--xe);He=f-ke,lt=ft}}else if(A<xe){if(He+=T+A-xe,xe-=A,xe<Ne){Ne-=xe;do ft[f++]=L[He++];while(--xe);if(He=0,A<Ne){xe=A,Ne-=xe;do ft[f++]=L[He++];while(--xe);He=f-ke,lt=ft}}}else if(He+=A-xe,xe<Ne){Ne-=xe;do ft[f++]=L[He++];while(--xe);He=f-ke,lt=ft}for(;Ne>2;)ft[f++]=lt[He++],ft[f++]=lt[He++],ft[f++]=lt[He++],Ne-=3;Ne&&(ft[f++]=lt[He++],Ne>1&&(ft[f++]=lt[He++]))}else{He=f-ke;do ft[f++]=ft[He++],ft[f++]=ft[He++],ft[f++]=ft[He++],Ne-=3;while(Ne>2);Ne&&(ft[f++]=ft[He++],Ne>1&&(ft[f++]=ft[He++]))}break}}break}}while(o<c&&f<v);Ne=F>>3,o-=Ne,F-=Ne<<3,U&=(1<<F)-1,r.next_in=o,r.next_out=f,r.avail_in=o<c?c-o+5:5-(o-c),r.avail_out=f<v?v-f+257:257-(f-v),zt.hold=U,zt.bits=F};let Bk=15,Z3e=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),e4e=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),t4e=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),n4e=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var m3=(r,a,o,c,f,g,v,w)=>{let T=w.bits,R,A,L,U,F,Z,W=0,K=0,oe=0,ue=0,xe=0,Ne=0,ke=0,He=0,lt=0,ut=0,ft=null,zt=new Uint16Array(16),$n=new Uint16Array(16),hi,Gi,Fr,mr=null;for(W=0;W<=Bk;W++)zt[W]=0;for(K=0;K<c;K++)zt[a[o+K]]++;for(xe=T,ue=Bk;ue>=1&&zt[ue]===0;ue--);if(xe>ue&&(xe=ue),ue===0)return f[g++]=20971520,f[g++]=20971520,w.bits=1,0;for(oe=1;oe<ue&&zt[oe]===0;oe++);for(xe<oe&&(xe=oe),He=1,W=1;W<=Bk;W++)if(He<<=1,He-=zt[W],He<0)return-1;if(He>0&&(r===0||ue!==1))return-1;for($n[1]=0,W=1;W<Bk;W++)$n[W+1]=$n[W]+zt[W];for(K=0;K<c;K++)a[o+K]!==0&&(v[$n[a[o+K]]++]=K);if(r===0?(ft=mr=v,Z=20):r===1?(ft=Z3e,mr=e4e,Z=257):(ft=t4e,mr=n4e,Z=0),ut=0,K=0,W=oe,F=g,Ne=xe,ke=0,L=-1,lt=1<<xe,U=lt-1,r===1&&lt>852||r===2&&lt>592)return 1;for(;;){hi=W-ke,v[K]+1<Z?(Gi=0,Fr=v[K]):v[K]>=Z?(Gi=mr[v[K]-Z],Fr=ft[v[K]-Z]):(Gi=96,Fr=0),R=1<<W-ke,A=1<<Ne,oe=A;do A-=R,f[F+(ut>>ke)+A]=hi<<24|Gi<<16|Fr|0;while(A!==0);for(R=1<<W-1;ut&R;)R>>=1;if(R!==0?(ut&=R-1,ut+=R):ut=0,K++,--zt[W]==0){if(W===ue)break;W=a[o+v[K]]}if(W>xe&&(ut&U)!==L){for(ke===0&&(ke=xe),F+=oe,Ne=W-ke,He=1<<Ne;Ne+ke<ue&&(He-=zt[Ne+ke],!(He<=0));)Ne++,He<<=1;if(lt+=1<<Ne,r===1&&lt>852||r===2&&lt>592)return 1;L=ut&U,f[L]=xe<<24|Ne<<16|F-g|0}}return ut!==0&&(f[F+ut]=W-ke<<24|64<<16|0),w.bits=xe,0};let{Z_FINISH:Lse,Z_BLOCK:i4e,Z_TREES:Vk,Z_OK:E_,Z_STREAM_END:r4e,Z_NEED_DICT:s4e,Z_STREAM_ERROR:Ou,Z_DATA_ERROR:Dse,Z_MEM_ERROR:kse,Z_BUF_ERROR:a4e,Z_DEFLATED:Mse}=bb,zk=16180,Hk=16190,Nm=16191,IW=16192,NW=16194,Gk=16199,Wk=16200,OW=16206,Ps=16209,jse=r=>(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24);function o4e(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}let w_=r=>{if(!r)return 1;let a=r.state;return!a||a.strm!==r||a.mode<zk||a.mode>16211?1:0},Use=r=>{if(w_(r))return Ou;let a=r.state;return r.total_in=r.total_out=a.total=0,r.msg="",a.wrap&&(r.adler=1&a.wrap),a.mode=zk,a.last=0,a.havedict=0,a.flags=-1,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new Int32Array(852),a.distcode=a.distdyn=new Int32Array(592),a.sane=1,a.back=-1,E_},Fse=r=>{if(w_(r))return Ou;let a=r.state;return a.wsize=0,a.whave=0,a.wnext=0,Use(r)},Bse=(r,a)=>{let o;if(w_(r))return Ou;let c=r.state;return a<0?(o=0,a=-a):(o=5+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?Ou:(c.window!==null&&c.wbits!==a&&(c.window=null),c.wrap=o,c.wbits=a,Fse(r))},Vse=(r,a)=>{if(!r)return Ou;let o=new o4e;r.state=o,o.strm=r,o.window=null,o.mode=zk;let c=Bse(r,a);return c!==E_&&(r.state=null),c},PW,LW,zse=!0,l4e=r=>{if(zse){PW=new Int32Array(512),LW=new Int32Array(32);let a=0;for(;a<144;)r.lens[a++]=8;for(;a<256;)r.lens[a++]=9;for(;a<280;)r.lens[a++]=7;for(;a<288;)r.lens[a++]=8;for(m3(1,r.lens,0,288,PW,0,r.work,{bits:9}),a=0;a<32;)r.lens[a++]=5;m3(2,r.lens,0,32,LW,0,r.work,{bits:5}),zse=!1}r.lencode=PW,r.lenbits=9,r.distcode=LW,r.distbits=5},Hse=(r,a,o,c)=>{let f,g=r.state;return g.window===null&&(g.wsize=1<<g.wbits,g.wnext=0,g.whave=0,g.window=new Uint8Array(g.wsize)),c>=g.wsize?(g.window.set(a.subarray(o-g.wsize,o),0),g.wnext=0,g.whave=g.wsize):(f=g.wsize-g.wnext,f>c&&(f=c),g.window.set(a.subarray(o-c,o-c+f),g.wnext),(c-=f)?(g.window.set(a.subarray(o-c,o),0),g.wnext=c,g.whave=g.wsize):(g.wnext+=f,g.wnext===g.wsize&&(g.wnext=0),g.whave<g.wsize&&(g.whave+=f))),0};var c4e=(r,a)=>{let o,c,f,g,v,w,T,R,A,L,U,F,Z,W,K,oe,ue,xe,Ne,ke,He,lt,ut=0,ft=new Uint8Array(4),zt,$n,hi=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(w_(r)||!r.output||!r.input&&r.avail_in!==0)return Ou;o=r.state,o.mode===Nm&&(o.mode=IW),v=r.next_out,f=r.output,T=r.avail_out,g=r.next_in,c=r.input,w=r.avail_in,R=o.hold,A=o.bits,L=w,U=T,lt=E_;e:for(;;)switch(o.mode){case zk:if(o.wrap===0){o.mode=IW;break}for(;A<16;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(2&o.wrap&&R===35615){o.wbits===0&&(o.wbits=15),o.check=0,ft[0]=255&R,ft[1]=R>>>8&255,o.check=co(o.check,ft,2,0),R=0,A=0,o.mode=16181;break}if(o.head&&(o.head.done=!1),!(1&o.wrap)||(((255&R)<<8)+(R>>8))%31){r.msg="incorrect header check",o.mode=Ps;break}if((15&R)!==Mse){r.msg="unknown compression method",o.mode=Ps;break}if(R>>>=4,A-=4,He=8+(15&R),o.wbits===0&&(o.wbits=He),He>15||He>o.wbits){r.msg="invalid window size",o.mode=Ps;break}o.dmax=1<<o.wbits,o.flags=0,r.adler=o.check=1,o.mode=512&R?16189:Nm,R=0,A=0;break;case 16181:for(;A<16;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(o.flags=R,(255&Ua(o))!==Mse){r.msg="unknown compression method",o.mode=Ps;break}if(57344&Ua(o)){r.msg="unknown header flags set",o.mode=Ps;break}o.head&&(o.head.text=R>>8&1),512&Ua(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,o.check=co(o.check,ft,2,0)),R=0,A=0,o.mode=16182;case 16182:for(;A<32;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}o.head&&(o.head.time=R),512&Ua(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,ft[2]=R>>>16&255,ft[3]=R>>>24&255,o.check=co(o.check,ft,4,0)),R=0,A=0,o.mode=16183;case 16183:for(;A<16;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}o.head&&(o.head.xflags=255&R,o.head.os=R>>8),512&Ua(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,o.check=co(o.check,ft,2,0)),R=0,A=0,o.mode=16184;case 16184:if(1024&Ua(o)){for(;A<16;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}o.length=R,o.head&&(o.head.extra_len=R),512&Ua(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,o.check=co(o.check,ft,2,0)),R=0,A=0}else o.head&&(o.head.extra=null);o.mode=16185;case 16185:if(1024&Ua(o)&&(F=o.length,F>w&&(F=w),F&&(o.head&&(He=o.head.extra_len-o.length,o.head.extra||(o.head.extra=new Uint8Array(o.head.extra_len)),o.head.extra.set(c.subarray(g,g+F),He)),512&Ua(o)&&4&o.wrap&&(o.check=co(o.check,c,F,g)),w-=F,g+=F,o.length-=F),o.length))break e;o.length=0,o.mode=16186;case 16186:if(2048&Ua(o)){if(w===0)break e;F=0;do He=c[g+F++],o.head&&He&&o.length<65536&&(o.head.name+=String.fromCharCode(He));while(He&&F<w);if(512&Ua(o)&&4&o.wrap&&(o.check=co(o.check,c,F,g)),w-=F,g+=F,He)break e}else o.head&&(o.head.name=null);o.length=0,o.mode=16187;case 16187:if(4096&Ua(o)){if(w===0)break e;F=0;do He=c[g+F++],o.head&&He&&o.length<65536&&(o.head.comment+=String.fromCharCode(He));while(He&&F<w);if(512&Ua(o)&&4&o.wrap&&(o.check=co(o.check,c,F,g)),w-=F,g+=F,He)break e}else o.head&&(o.head.comment=null);o.mode=16188;case 16188:if(512&Ua(o)){for(;A<16;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(4&o.wrap&&R!==(65535&o.check)){r.msg="header crc mismatch",o.mode=Ps;break}R=0,A=0}o.head&&(o.head.hcrc=Ua(o)>>9&1,o.head.done=!0),r.adler=o.check=0,o.mode=Nm;break;case 16189:for(;A<32;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}r.adler=o.check=jse(R),R=0,A=0,o.mode=Hk;case Hk:if(o.havedict===0)return r.next_out=v,r.avail_out=T,r.next_in=g,r.avail_in=w,o.hold=R,o.bits=A,s4e;r.adler=o.check=1,o.mode=Nm;case Nm:if(a===i4e||a===Vk)break e;case IW:if(o.last){R>>>=7&A,A-=7&A,o.mode=OW;break}for(;A<3;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}switch(o.last=1&R,R>>>=1,A-=1,3&R){case 0:o.mode=16193;break;case 1:if(l4e(o),o.mode=Gk,a===Vk){R>>>=2,A-=2;break e}break;case 2:o.mode=16196;break;case 3:r.msg="invalid block type",o.mode=Ps}R>>>=2,A-=2;break;case 16193:for(R>>>=7&A,A-=7&A;A<32;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if((65535&R)!=(R>>>16^65535)){r.msg="invalid stored block lengths",o.mode=Ps;break}if(o.length=65535&R,R=0,A=0,o.mode=NW,a===Vk)break e;case NW:o.mode=16195;case 16195:if(F=o.length,F){if(F>w&&(F=w),F>T&&(F=T),F===0)break e;f.set(c.subarray(g,g+F),v),w-=F,g+=F,T-=F,v+=F,o.length-=F;break}o.mode=Nm;break;case 16196:for(;A<14;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(o.nlen=257+(31&R),R>>>=5,A-=5,o.ndist=1+(31&R),R>>>=5,A-=5,o.ncode=4+(15&R),R>>>=4,A-=4,o.nlen>286||o.ndist>30){r.msg="too many length or distance symbols",o.mode=Ps;break}o.have=0,o.mode=16197;case 16197:for(;o.have<o.ncode;){for(;A<3;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}o.lens[hi[o.have++]]=7&R,R>>>=3,A-=3}for(;o.have<19;)o.lens[hi[o.have++]]=0;if(o.lencode=o.lendyn,o.lenbits=7,zt={bits:o.lenbits},lt=m3(0,o.lens,0,19,o.lencode,0,o.work,zt),o.lenbits=zt.bits,lt){r.msg="invalid code lengths set",o.mode=Ps;break}o.have=0,o.mode=16198;case 16198:for(;o.have<o.nlen+o.ndist;){for(;ut=o.lencode[R&(1<<o.lenbits)-1],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(K<=A);){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(ue<16)R>>>=K,A-=K,o.lens[o.have++]=ue;else{if(ue===16){for($n=K+2;A<$n;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(R>>>=K,A-=K,o.have===0){r.msg="invalid bit length repeat",o.mode=Ps;break}He=o.lens[o.have-1],F=3+(3&R),R>>>=2,A-=2}else if(ue===17){for($n=K+3;A<$n;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}R>>>=K,A-=K,He=0,F=3+(7&R),R>>>=3,A-=3}else{for($n=K+7;A<$n;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}R>>>=K,A-=K,He=0,F=11+(127&R),R>>>=7,A-=7}if(o.have+F>o.nlen+o.ndist){r.msg="invalid bit length repeat",o.mode=Ps;break}for(;F--;)o.lens[o.have++]=He}}if(o.mode===Ps)break;if(o.lens[256]===0){r.msg="invalid code -- missing end-of-block",o.mode=Ps;break}if(o.lenbits=9,zt={bits:o.lenbits},lt=m3(1,o.lens,0,o.nlen,o.lencode,0,o.work,zt),o.lenbits=zt.bits,lt){r.msg="invalid literal/lengths set",o.mode=Ps;break}if(o.distbits=6,o.distcode=o.distdyn,zt={bits:o.distbits},lt=m3(2,o.lens,o.nlen,o.ndist,o.distcode,0,o.work,zt),o.distbits=zt.bits,lt){r.msg="invalid distances set",o.mode=Ps;break}if(o.mode=Gk,a===Vk)break e;case Gk:o.mode=Wk;case Wk:if(w>=6&&T>=258){r.next_out=v,r.avail_out=T,r.next_in=g,r.avail_in=w,o.hold=R,o.bits=A,Q3e(r,U),v=r.next_out,f=r.output,T=r.avail_out,g=r.next_in,c=r.input,w=r.avail_in,R=o.hold,A=o.bits,o.mode===Nm&&(o.back=-1);break}for(o.back=0;ut=o.lencode[R&(1<<o.lenbits)-1],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(K<=A);){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(oe&&!(240&oe)){for(xe=K,Ne=oe,ke=ue;ut=o.lencode[ke+((R&(1<<xe+Ne)-1)>>xe)],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(xe+K<=A);){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}R>>>=xe,A-=xe,o.back+=xe}if(R>>>=K,A-=K,o.back+=K,o.length=ue,oe===0){o.mode=16205;break}if(32&oe){o.back=-1,o.mode=Nm;break}if(64&oe){r.msg="invalid literal/length code",o.mode=Ps;break}o.extra=15&oe,o.mode=16201;case 16201:if(o.extra){for($n=o.extra;A<$n;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}o.length+=R&(1<<o.extra)-1,R>>>=o.extra,A-=o.extra,o.back+=o.extra}o.was=o.length,o.mode=16202;case 16202:for(;ut=o.distcode[R&(1<<o.distbits)-1],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(K<=A);){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(!(240&oe)){for(xe=K,Ne=oe,ke=ue;ut=o.distcode[ke+((R&(1<<xe+Ne)-1)>>xe)],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(xe+K<=A);){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}R>>>=xe,A-=xe,o.back+=xe}if(R>>>=K,A-=K,o.back+=K,64&oe){r.msg="invalid distance code",o.mode=Ps;break}o.offset=ue,o.extra=15&oe,o.mode=16203;case 16203:if(o.extra){for($n=o.extra;A<$n;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}o.offset+=R&(1<<o.extra)-1,R>>>=o.extra,A-=o.extra,o.back+=o.extra}if(o.offset>o.dmax){r.msg="invalid distance too far back",o.mode=Ps;break}o.mode=16204;case 16204:if(T===0)break e;if(F=U-T,o.offset>F){if(F=o.offset-F,F>o.whave&&o.sane){r.msg="invalid distance too far back",o.mode=Ps;break}F>o.wnext?(F-=o.wnext,Z=o.wsize-F):Z=o.wnext-F,F>o.length&&(F=o.length),W=o.window}else W=f,Z=v-o.offset,F=o.length;F>T&&(F=T),T-=F,o.length-=F;do f[v++]=W[Z++];while(--F);o.length===0&&(o.mode=Wk);break;case 16205:if(T===0)break e;f[v++]=o.length,T--,o.mode=Wk;break;case OW:if(o.wrap){for(;A<32;){if(w===0)break e;w--,R|=c[g++]<<A,A+=8}if(U-=T,r.total_out+=U,o.total+=U,4&o.wrap&&U&&(r.adler=o.check=Ua(o)?co(o.check,f,U,v-U):a3(o.check,f,U,v-U)),U=T,4&o.wrap&&(Ua(o)?R:jse(R))!==o.check){r.msg="incorrect data check",o.mode=Ps;break}R=0,A=0}o.mode=16207;case 16207:if(o.wrap&&Ua(o)){for(;A<32;){if(w===0)break e;w--,R+=c[g++]<<A,A+=8}if(4&o.wrap&&R!==(4294967295&o.total)){r.msg="incorrect length check",o.mode=Ps;break}R=0,A=0}o.mode=16208;case 16208:lt=r4e;break e;case Ps:lt=Dse;break e;case 16210:return kse;default:return Ou}return r.next_out=v,r.avail_out=T,r.next_in=g,r.avail_in=w,o.hold=R,o.bits=A,(o.wsize||U!==r.avail_out&&o.mode<Ps&&(o.mode<OW||a!==Lse))&&Hse(r,r.output,r.next_out,U-r.avail_out),L-=r.avail_in,U-=r.avail_out,r.total_in+=L,r.total_out+=U,o.total+=U,4&o.wrap&&U&&(r.adler=o.check=Ua(o)?co(o.check,f,U,r.next_out-U):a3(o.check,f,U,r.next_out-U)),r.data_type=o.bits+(o.last?64:0)+(o.mode===Nm?128:0)+(o.mode===Gk||o.mode===NW?256:0),(L===0&&U===0||a===Lse)&&lt===E_&&(lt=a4e),lt},Om={inflateReset:Fse,inflateReset2:Bse,inflateResetKeep:Use,inflateInit:r=>Vse(r,15),inflateInit2:Vse,inflate:c4e,inflateEnd:r=>{if(w_(r))return Ou;let a=r.state;return a.window&&(a.window=null),r.state=null,E_},inflateGetHeader:(r,a)=>{if(w_(r))return Ou;let o=r.state;return 2&o.wrap?(o.head=a,a.done=!1,E_):Ou},inflateSetDictionary:(r,a)=>{let o=a.length,c,f,g;return w_(r)?Ou:(c=r.state,c.wrap!==0&&c.mode!==Hk?Ou:c.mode===Hk&&(f=1,f=a3(f,a,o,0),f!==c.check)?Dse:(g=Hse(r,a,o,o),g?(c.mode=16210,kse):(c.havedict=1,E_)))},inflateInfo:"pako inflate (from Nodeca project)"},d4e=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};let Gse=Object.prototype.toString,{Z_NO_FLUSH:u4e,Z_FINISH:h4e,Z_OK:g3,Z_STREAM_END:DW,Z_NEED_DICT:kW,Z_STREAM_ERROR:f4e,Z_DATA_ERROR:Wse,Z_MEM_ERROR:p4e}=bb;function v3(r){this.options=jk.assign({chunkSize:65536,windowBits:15,to:""},r||{});let a=this.options;a.raw&&a.windowBits>=0&&a.windowBits<16&&(a.windowBits=-a.windowBits,a.windowBits===0&&(a.windowBits=-15)),!(a.windowBits>=0&&a.windowBits<16)||r&&r.windowBits||(a.windowBits+=32),a.windowBits>15&&a.windowBits<48&&!(15&a.windowBits)&&(a.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ose,this.strm.avail_out=0;let o=Om.inflateInit2(this.strm,a.windowBits);if(o!==g3)throw new Error(g_[o]);if(this.header=new d4e,Om.inflateGetHeader(this.strm,this.header),a.dictionary&&(typeof a.dictionary=="string"?a.dictionary=f3.string2buf(a.dictionary):Gse.call(a.dictionary)==="[object ArrayBuffer]"&&(a.dictionary=new Uint8Array(a.dictionary)),a.raw&&(o=Om.inflateSetDictionary(this.strm,a.dictionary),o!==g3)))throw new Error(g_[o])}function MW(r,a){let o=new v3(a);if(o.push(r),o.err)throw o.msg||g_[o.err];return o.result}v3.prototype.push=function(r,a){let o=this.strm,c=this.options.chunkSize,f=this.options.dictionary,g,v,w;if(this.ended)return!1;for(v=a===~~a?a:a===!0?h4e:u4e,Gse.call(r)==="[object ArrayBuffer]"?o.input=new Uint8Array(r):o.input=r,o.next_in=0,o.avail_in=o.input.length;;){for(o.avail_out===0&&(o.output=new Uint8Array(c),o.next_out=0,o.avail_out=c),g=Om.inflate(o,v),g===kW&&f&&(g=Om.inflateSetDictionary(o,f),g===g3?g=Om.inflate(o,v):g===Wse&&(g=kW));o.avail_in>0&&g===DW&&o.state.wrap>0&&r[o.next_in]!==0;)Om.inflateReset(o),g=Om.inflate(o,v);switch(g){case f4e:case Wse:case kW:case p4e:return this.onEnd(g),this.ended=!0,!1}if(w=o.avail_out,o.next_out&&(o.avail_out===0||g===DW))if(this.options.to==="string"){let T=f3.utf8border(o.output,o.next_out),R=o.next_out-T,A=f3.buf2string(o.output,T);o.next_out=R,o.avail_out=c-R,R&&o.output.set(o.output.subarray(T,T+R),0),this.onData(A)}else this.onData(o.output.length===o.next_out?o.output:o.output.subarray(0,o.next_out));if(g!==g3||w!==0){if(g===DW)return g=Om.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,!0;if(o.avail_in===0)break}}return!0},v3.prototype.onData=function(r){this.chunks.push(r)},v3.prototype.onEnd=function(r){r===g3&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=jk.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};var m4e={Inflate:v3,inflate:MW,inflateRaw:function(r,a){return(a=a||{}).raw=!0,MW(r,a)},ungzip:MW,constants:bb};let{Deflate:vat,deflate:g4e,deflateRaw:yat,gzip:_at}=J3e,{Inflate:Eat,inflate:v4e,inflateRaw:wat,ungzip:Sat}=m4e;var y4e=g4e,_4e=v4e;let Qs={getDisplayMedia:!1,getStreamFromExtension:!1,supportUnifiedPlan:!1,supportMinBitrate:!1,supportSetRtpSenderParameters:!1,supportDualStream:!0,webAudioMediaStreamDest:!1,supportReplaceTrack:!1,supportWebGL:!1,webAudioWithAEC:!1,supportRequestFrame:!1,supportShareAudio:!1,supportDualStreamEncoding:!1,supportDataChannel:!1,supportPCSetConfiguration:!1,supportWebRTCEncodedTransform:!1,supportWebRTCInsertableStream:!1,supportRequestVideoFrameCallback:!1,supportWebCrypto:!1};function Jn(){return Qs}function $se(){return"setSinkId"in HTMLAudioElement.prototype&&(!ve("RESTRICTION_SET_PLAYBACK_DEVICE")||(U0()||rie())&&!fG())}let Bs=function(r){return r.IOS_15_16_INTERRUPTION_START="ios15_16-interruption-start",r.IOS_15_16_INTERRUPTION_END="ios15_16-interruption-end",r.IOS_INTERRUPTION_START="ios-interruption-start",r.IOS_INTERRUPTION_END="ios-interruption-end",r.STATE_CHANGE="state-change",r}({});function xb(r,a,o){return{sampleRate:r,stereo:a,bitrate:o}}function ti(r,a,o,c,f){return{width:r,height:a,frameRate:o,bitrateMin:c,bitrateMax:f}}function Pu(r,a,o,c,f){return{width:{max:r},height:{max:a},frameRate:o,bitrateMin:c,bitrateMax:f}}function jW(r,a){return{numSpatialLayers:r,numTemporalLayers:a}}let E4e={"90p":ti(160,90),"90p_1":ti(160,90),"120p":ti(160,120,15,30,65),"120p_1":ti(160,120,15,30,65),"120p_3":ti(120,120,15,30,50),"120p_4":ti(212,120),"180p":ti(320,180,15,30,140),"180p_1":ti(320,180,15,30,140),"180p_3":ti(180,180,15,30,100),"180p_4":ti(240,180,15,30,120),"240p":ti(320,240,15,40,200),"240p_1":ti(320,240,15,40,200),"240p_3":ti(240,240,15,40,140),"240p_4":ti(424,240,15,40,220),"360p":ti(640,360,15,80,400),"360p_1":ti(640,360,15,80,400),"360p_3":ti(360,360,15,80,260),"360p_4":ti(640,360,30,80,600),"360p_6":ti(360,360,30,80,400),"360p_7":ti(480,360,15,80,320),"360p_8":ti(480,360,30,80,490),"360p_9":ti(640,360,15,80,800),"360p_10":ti(640,360,24,80,800),"360p_11":ti(640,360,24,80,1e3),"480p":ti(640,480,15,100,500),"480p_1":ti(640,480,15,100,500),"480p_2":ti(640,480,30,100,1e3),"480p_3":ti(480,480,15,100,400),"480p_4":ti(640,480,30,100,750),"480p_6":ti(480,480,30,100,600),"480p_8":ti(848,480,15,100,610),"480p_9":ti(848,480,30,100,930),"480p_10":ti(640,480,10,100,400),"720p":ti(1280,720,15,120,1130),"720p_auto":ti(1280,720,30,900,3e3),"720p_1":ti(1280,720,15,120,1130),"720p_2":ti(1280,720,30,120,2e3),"720p_3":ti(1280,720,30,120,1710),"720p_5":ti(960,720,15,120,910),"720p_6":ti(960,720,30,120,1380),"1080p":ti(1920,1080,15,120,2080),"1080p_1":ti(1920,1080,15,120,2080),"1080p_2":ti(1920,1080,30,120,3e3),"1080p_3":ti(1920,1080,30,120,3150),"1080p_5":ti(1920,1080,60,120,4780),"1440p":ti(2560,1440,30,120,4850),"1440p_1":ti(2560,1440,30,120,4850),"1440p_2":ti(2560,1440,60,120,7350),"4k":ti(3840,2160,30,120,8910),"4k_1":ti(3840,2160,30,120,8910),"4k_3":ti(3840,2160,60,120,13500)},$k=[{scaleResolutionDownBy:2,width:1280,height:720,frameRate:30,bitrateMin:300,bitrateMax:900},{scaleResolutionDownBy:1.333333,width:1280,height:720,frameRate:30,bitrateMin:600,bitrateMax:2e3},{scaleResolutionDownBy:1,width:1280,height:720,frameRate:30,bitrateMin:900,bitrateMax:3e3}],w4e={"480p":Pu(640,480,5),"480p_1":Pu(640,480,5),"480p_2":Pu(640,480,30),"480p_3":Pu(640,480,15),"720p":Pu(1280,720,5),"720p_auto":ti(1280,720,30,900,3e3),"720p_1":Pu(1280,720,5),"720p_2":Pu(1280,720,30),"720p_3":Pu(1280,720,15),"1080p":Pu(1920,1080,5),"1080p_1":Pu(1920,1080,5),"1080p_2":Pu(1920,1080,30),"1080p_3":Pu(1920,1080,15)},S4e={"1SL1TL":jW(1,1),"3SL3TL":jW(3,3),"2SL3TL":jW(2,3)};function Xf(r){return r||(r="480p_1"),typeof r=="string"?Object.assign({},E4e[r]):r}function UW(r){return typeof r=="string"?Object.assign({},w4e[r]):r}function Kk(r){return typeof r=="string"?Object.assign({},S4e[r]):r}let b4e={speech_low_quality:xb(16e3,!1),speech_standard:xb(32e3,!1,18),music_standard:xb(48e3,!1),standard_stereo:xb(48e3,!0,56),high_quality:xb(48e3,!1,128),high_quality_stereo:xb(48e3,!0,192)};function qk(r){return typeof r=="string"?Object.assign({},b4e[r]):r}let Ab=[];function Kse(r){return ls(r,"mediaSource",["screen","window","application"]),!0}let Mt=function(r){return r.NEED_RENEGOTIATE="@need_renegotiate",r.NEED_REPLACE_TRACK="@need_replace_track",r.NEED_REPLACE_MIXING_TRACK="@need_replace_mixing_track",r.NEED_CLOSE="@need_close",r.NEED_ENABLE_TRACK="@need_enable_track",r.NEED_DISABLE_TRACK="@need_disable_track",r.NEED_SESSION_ID="@need_sid",r.SET_OPTIMIZATION_MODE="@set_optimization_mode",r.GET_STATS="@get_stats",r.GET_RTC_STATS="@get_rtc_stats",r.GET_LOW_VIDEO_TRACK="@get_low_video_track",r.NEED_RESET_REMOTE_SDP="@need_reset_remote_sdp",r.NEED_UPDATE_VIDEO_ENCODER="@need_update_video_encoder",r.NEED_UPDATE_VIDEO_SEND_PARAMETERS="@need_update_video_send_parameters",r.NEED_MUTE_TRACK="@need_mute_track",r.NEED_UNMUTE_TRACK="@need_unmute_track",r}({}),Hi=function(r){return r.SCREEN_TRACK="screen_track",r.CUSTOM_TRACK="custome_track",r.LOW_STREAM="low_stream",r}({}),Ib=function(r){return r[r.HIGH_STREAM=0]="HIGH_STREAM",r[r.LOW_STREAM=1]="LOW_STREAM",r}({}),C4e=function(r){return r[r.HIGH_STREAM=0]="HIGH_STREAM",r[r.LOW_STREAM=1]="LOW_STREAM",r}({}),T4e=function(r){return r[r.DISABLE=0]="DISABLE",r[r.LOW_STREAM=1]="LOW_STREAM",r[r.AUDIO_ONLY=2]="AUDIO_ONLY",r}({}),S_=function(r){return r.TRANSCEIVER_UPDATED="transceiver-updated",r.SEI_TO_SEND="sei-to-send",r.SEI_RECEIVED="sei-received",r.TRACK_UPDATED="track-updated",r}({}),Nb=function(r){return r.SOURCE_STATE_CHANGE="source-state-change",r.TRACK_ENDED="track-ended",r.BEAUTY_EFFECT_OVERLOAD="beauty-effect-overload",r.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status",r.CLOSED="closed",r}({}),Ob=function(r){return r.FIRST_FRAME_DECODED="first-frame-decoded",r.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status",r.VIDEO_STATE_CHANGED="video-state-changed",r}({}),Oc=function(r){return r.AUDIO_SOURCE_STATE_CHANGE="audio_source_state_change",r.RECEIVE_TRACK_BUFFER="receive_track_buffer",r.ON_AUDIO_BUFFER="on_audio_buffer",r.UPDATE_SOURCE="update_source",r}({});(function(r){r.UPDATE_TRACK_SOURCE="update-track-source"})({});let FW={sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0,sendJitterMs:0,sendRttMs:0,currentPacketLossRate:0},BW={sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendJitterMs:0,sendRttMs:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0,currentPacketLossRate:0},qse={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveLevel:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1},R4e={uplinkNetworkQuality:0,downlinkNetworkQuality:0},Yse={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1},uo=function(r){return r.ON_TRACK="on_track",r.ON_NODE="on_node",r}({}),Pc=function(r){return r.REQUEST_UPDATE_CONSTRAINTS="request_update_constraints",r.REQUEST_CONSTRAINTS="request_constraints",r}({}),y3=function(r){return r.IDLE="IDLE",r.INITING="INITING",r.INITEND="INITEND",r}({}),b_=function(r){return r.STATE_CHANGE="state_change",r.RECORDING_DEVICE_CHANGED="recordingDeviceChanged",r.PLAYOUT_DEVICE_CHANGED="playoutDeviceChanged",r.CAMERA_DEVICE_CHANGED="cameraDeviceChanged",r}({}),Fa=function(r){return r.NONE="none",r.INIT="init",r.CANPLAY="canplay",r.PLAYING="playing",r.PAUSED="paused",r.SUSPEND="suspend",r.STALLED="stalled",r.WAITING="waiting",r.ERROR="error",r.DESTROYED="destroyed",r.ABORT="abort",r.ENDED="ended",r.EMPTIED="emptied",r.LOADEDDATA="loadeddata",r}({}),Jf=function(r){return r[r.VideoStateStopped=0]="VideoStateStopped",r[r.VideoStateStarting=1]="VideoStateStarting",r[r.VideoStateDecoding=2]="VideoStateDecoding",r[r.VideoStateFrozen=3]="VideoStateFrozen",r}({}),VW={uninit:100,none:110,init:120,loadeddata:130,canplay:200,playing:210,paused:220,suspend:300,stalled:310,waiting:320,error:330,destroyed:340,abort:350,ended:360,emptied:370},Yk=function(r){return r.OPEN="open",r.MESSAGE="message",r.CLOSE="close",r.CLOSING="closing",r.ERROR="error",r}({});function Xse(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function nr(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Xse(Object(o),!0).forEach(function(c){qe(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Xse(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function qe(r,a,o){return(a=function(c){var f=function(g,v){if(typeof g!="object"||g===null)return g;var w=g[Symbol.toPrimitive];if(w!==void 0){var T=w.call(g,"string");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}(c);return typeof f=="symbol"?f:String(f)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}function Qn(r,a,o,c,f){var g,v,w={};return Object.keys(c).forEach(function(T){w[T]=c[T]}),w.enumerable=!!w.enumerable,w.configurable=!!w.configurable,("value"in w||w.initializer)&&(w.writable=!0),w=bc(g=lIe(v=o.slice()).call(v)).call(g,function(T,R){return R(r,a,T)||T},w),f&&w.initializer!==void 0&&(w.value=w.initializer?w.initializer.call(f):void 0,w.initializer=void 0),w.initializer===void 0&&(Object.defineProperty(r,a,w),w=null),w}class Jse extends tr{set _mediaStreamTrack(a){a!==this.mediaStreamTrack&&(this.safeEmit(S_.TRACK_UPDATED,a),this.mediaStreamTrack=a)}get _mediaStreamTrack(){return this.mediaStreamTrack}constructor(a,o){super(),qe(this,"trackMediaType",void 0),qe(this,"_ID",void 0),qe(this,"_rtpTransceiver",void 0),qe(this,"_lowRtpTransceiver",void 0),qe(this,"_hints",[]),qe(this,"_isClosed",!1),qe(this,"_originMediaStreamTrack",void 0),qe(this,"mediaStreamTrack",void 0),qe(this,"_external",{}),this._ID=o||Li(8,"track-"),this._originMediaStreamTrack=a,this.mediaStreamTrack=a,function(c){Tt(Ab).call(Ab,c)||Ab.push(c)}(this)}toString(){return this._ID}getTrackId(){return this._ID}getMediaStreamTrack(a){return a||B0(()=>{var o;$t.reportApiInvoke(null,{name:qr.GET_MEDIA_STREAM_TRACK,options:[],tag:vr.TRACER}).onSuccess(((o=this._mediaStreamTrack)===null||o===void 0?void 0:o.label)||"")},this.mediaStreamTrack.id||this.getTrackId()),this._mediaStreamTrack}getRTCRtpTransceiver(a){return a===Ib.LOW_STREAM?this._lowRtpTransceiver:this._rtpTransceiver}getMediaStreamTrackSettings(){return this.getMediaStreamTrack(!0).getSettings()}close(){this._isClosed=!0,this._lowRtpTransceiver=void 0,this._rtpTransceiver=void 0,function(a){let o=Ab.indexOf(a);o!==-1&&Ab.splice(o,1)}(this),this.emit(Nb.CLOSED),this.removeAllListeners(S_.SEI_RECEIVED)}_updateRtpTransceiver(a,o){if(o===Ib.LOW_STREAM){if(this._lowRtpTransceiver===a)return;this._lowRtpTransceiver=a}else{if(this._rtpTransceiver===a)return;this._rtpTransceiver=a}this.emit(S_.TRANSCEIVER_UPDATED,a,o)}}class Pb extends Jse{get isExternalTrack(){return this._isExternalTrack}get muted(){return this._muted}get enabled(){return this._enabled}get processorContext(){return this._processorContext}constructor(a,o){super(a,o),qe(this,"_enabled",!0),qe(this,"_muted",!1),qe(this,"_isExternalTrack",!1),qe(this,"_isClosed",!1),qe(this,"_enabledMutex",void 0),qe(this,"processor",void 0),qe(this,"_processorContext",void 0),qe(this,"_handleTrackEnded",()=>{this.onTrackEnded()}),this._enabledMutex=new As("".concat(this.getTrackId())),a.addEventListener("ended",this._handleTrackEnded)}getTrackLabel(){var a,o;return(a=(o=this._originMediaStreamTrack)===null||o===void 0?void 0:o.label)!==null&&a!==void 0?a:""}close(){this._isClosed||(this.stop(),this._originMediaStreamTrack.stop(),this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack.stop(),this._mediaStreamTrack=null),this._originMediaStreamTrack=null,this._enabledMutex=null,z.debug("[".concat(this.getTrackId(),"] close")),this.emit(Mt.NEED_CLOSE),super.close())}async _updateOriginMediaStreamTrack(a,o){let c=arguments.length>2&&arguments[2]!==void 0&&arguments[2];this._isExternalTrack=c,a!==this._originMediaStreamTrack&&(this._originMediaStreamTrack&&(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),o&&this._originMediaStreamTrack.stop()),a.addEventListener("ended",this._handleTrackEnded),this._originMediaStreamTrack=a,this._muted&&(this._originMediaStreamTrack.enabled=!1),this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Pi(this,Mt.NEED_REPLACE_TRACK,this),this.processor&&this._processorContext&&this.processor.updateInput({track:this._originMediaStreamTrack,context:this._processorContext}))}_getDefaultPlayerConfig(){return{}}onTrackEnded(){z.debug("[".concat(this.getTrackId(),"] track ended")),this.safeEmit(Nb.TRACK_ENDED)}stateCheck(a,o){if(z.debug("check track state, [muted: ".concat(this._muted,", enabled: ").concat(this._enabled,"] to [").concat(a,": ").concat(o,"]")),Sm(o,a),this._enabled&&this._muted&&a==="enabled"&&o===!1)throw new Ke(ce.TRACK_STATE_UNREACHABLE,"cannot set enabled while the track is muted").print("error",z);if(!this._enabled&&!this._muted&&a==="muted"&&o===!0)throw new Ke(ce.TRACK_STATE_UNREACHABLE,"cannot set muted while the track is disabled").print("error",z)}getProcessorStats(){return this._processorContext&&this._processorContext.gatherStats()||[]}getProcessorUsage(){return this._processorContext?this._processorContext.gatherUsage():Ct.resolve([])}}let Qse=window.AudioContext||window.webkitAudioContext,Lc=null,Si=new class extends tr{constructor(){super(...arguments),qe(this,"prevState",void 0),qe(this,"curState",void 0),qe(this,"currentTime",void 0),qe(this,"currentTimeStuckAt",void 0),qe(this,"interruptDetectorTrack",void 0),qe(this,"onLocalAudioTrackMute",()=>{z.info("ios15-interruption-start"),this.emit(Bs.IOS_15_16_INTERRUPTION_START)}),qe(this,"onLocalAudioTrackUnmute",async()=>{z.info("ios15-interruption-end"),this.curState!=="running"||this.duringInterruption?z.info("ios15-interruption-end-canceled"):(Lc&&await Lc.suspend(),this.emit(Bs.IOS_15_16_INTERRUPTION_END))})}get duringInterruption(){return this.prevState==="running"&&this.curState==="interrupted"}bindInterruptDetectorTrack(r){z.debug("webaudio bindInterruptDetectorTrack ".concat(r.getTrackId())),this.interruptDetectorTrack||(this.interruptDetectorTrack=r,this.interruptDetectorTrack._mediaStreamTrack.onmute=this.onLocalAudioTrackMute,this.interruptDetectorTrack._mediaStreamTrack.onunmute=this.onLocalAudioTrackUnmute)}unbindInterruptDetectorTrack(r){z.debug("webaudio unbindInterruptDetectorTrack ".concat(r.getTrackId())),this.interruptDetectorTrack&&this.interruptDetectorTrack===r&&(this.interruptDetectorTrack._mediaStreamTrack&&(this.interruptDetectorTrack._mediaStreamTrack.onmute=null,this.interruptDetectorTrack._mediaStreamTrack.onunmute=null),this.interruptDetectorTrack=void 0)}};function Lb(){if(!Lc){if(function(){if(!Qse)return void z.error("your browser is not support web audio");z.info("create audio context");let r=nr({},ve("WEBAUDIO_INIT_OPTIONS"));z.debug("audio context init option:",JSON.stringify(r)),Lc=new Qse(r),Si.curState=Lc.state,Lc.onstatechange=()=>{Si.prevState=Si.curState,Si.curState=Lc?Lc.state:void 0;let{prevState:a,curState:o}=Si,c=o==="running",f=o==="interrupted",g=a==="running",v=a==="suspended",w=a==="interrupted",T=ni().osVersion;(ca()||Eu())&&g&&f&&(z.info("ios".concat(T,"-interruption-start")),Si.emit(Bs.IOS_INTERRUPTION_START)),(ca()||Eu())&&(v||w)&&c&&(z.info("ios".concat(T,"-interruption-end")),Si.emit(Bs.IOS_INTERRUPTION_END)),a!==o&&Si.emit(Bs.STATE_CHANGE,o,a)},setInterval(()=>{var a;let o=(a=Lc)===null||a===void 0?void 0:a.currentTime;Si.currentTime!==o?(Si.currentTimeStuckAt&&(z.debug("AudioContext current time resume at ".concat(o)),Si.currentTimeStuckAt=void 0),Si.currentTime=o):(o!==Si.currentTimeStuckAt&&($t.reportApiInvoke(null,{name:"WEB_AUDIO_CURRENT_TIME_STUCK",options:{currentTime:o},tag:vr.TRACER}).onSuccess(),z.warning("AudioContext current time stuck at ".concat(o))),Si.currentTimeStuckAt=o)},5e3),async function(a){let o=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","touchend","keydown","keyup"],c,f=!1,g=!1,v=!1;function w(W){a.state==="running"?T(!1):ca()||Eu()?a.state==="suspended"&&(T(!0),W&&a.resume().then(R,R)):a.state!=="closed"&&(T(!0),W&&a.resume().then(R,R))}function T(W){if(f!==W){f=W;for(let K=0,oe=o;K<oe.length;K+=1){let ue=oe[K];W?window.addEventListener(ue,A,{capture:!0,passive:!0}):window.removeEventListener(ue,A,{capture:!0,passive:!0})}}}function R(){w(!1)}function A(){w(!0)}function L(W){if(!v)if(c.paused)if(W){let K;U(!1),v=!0;try{K=c.play(),K?K.then(F,F):(c.addEventListener("playing",F),c.addEventListener("abort",F),c.addEventListener("error",F))}catch{F()}}else U(!0);else U(!1)}function U(W){if(g!==W){g=W;for(let K=0,oe=o;K<oe.length;K++){let ue=oe[K];W?window.addEventListener(ue,Z,{capture:!0,passive:!0}):window.removeEventListener(ue,Z,{capture:!0,passive:!0})}}}function F(){c.removeEventListener("playing",F),c.removeEventListener("abort",F),c.removeEventListener("error",F),v=!1,L(!1)}function Z(){L(!0)}if(ca()){let W=a.createMediaStreamDestination(),K=document.createElement("div");K.innerHTML="<audio x-webkit-airplay='deny'></audio>",c=K.children.item(0),c.controls=!1,c.disableRemotePlayback=!0,c.preload="auto",c.srcObject=W.stream,L(!0)}Si.on(Bs.STATE_CHANGE,function(){w(!0)}),w(!1)}(Lc)}(),!Lc)throw new Ke(ce.NOT_SUPPORTED,"can not create audio context");return Lc}return Lc}function C_(r){if(function(){if(zW!==null)return zW;let c=Lb(),f=c.createBufferSource(),g=c.createGain(),v=c.createGain();f.connect(g),f.connect(v),f.disconnect(g);let w=!1;try{f.disconnect(g)}catch{w=!0}return f.disconnect(),zW=w,w}())return;let a=r.connect,o=r.disconnect;r.connect=(c,f,g)=>{var v;return r._inputNodes||(r._inputNodes=[]),Tt(v=r._inputNodes).call(v,c)||(c instanceof AudioNode?(r._inputNodes.push(c),a.call(r,c,f,g)):a.call(r,c,f)),r},r.disconnect=(c,f,g)=>{o.call(r),c?ok(r._inputNodes,c):r._inputNodes=[];for(let v of r._inputNodes)a.call(r,v)}}let zW=null;function HW(r,a){let o=!1,c=1/a;if(ve("DISABLE_WEBAUDIO")){let f=window.setInterval(()=>{o?window.clearInterval(f):r(performance.now()/1e3)},1e3*c)}else{let f=Lb(),g=f.createGain();g.gain.value=0,g.connect(f.destination);let v=()=>{if(o)return void(g=null);let w=f.createOscillator();w.onended=v,w.connect(g),w.start(0),w.stop(f.currentTime+c),r(f.currentTime)};v()}return()=>{o=!0}}class Zse{constructor(){qe(this,"context",void 0),qe(this,"analyserNode",void 0),qe(this,"sourceNode",void 0),this.context=Lb(),this.analyserNode=this.context.createAnalyser(),this.analyserNode.fftSize=2048,this.analyserNode.smoothingTimeConstant=.4}updateSource(a){if(a!==this.sourceNode){if(this.sourceNode)try{this.sourceNode.disconnect(this.analyserNode)}catch{}this.sourceNode=a,a==null||a.connect(this.analyserNode)}}getVolumeLevel(){if(!this.sourceNode||(!this.context||ca()||Eu()||this.context.state!=="running"&&this.context.resume(),!this.analyserNode))return 0;let a=new Float32Array(this.analyserNode.fftSize);if(this.analyserNode.getFloatTimeDomainData)this.analyserNode.getFloatTimeDomainData(a);else{let c=new Uint8Array(this.analyserNode.fftSize);this.analyserNode.getByteTimeDomainData(c);for(let f=0;f<a.length;++f)a[f]=c[f]/128-1}let o=bc(a).call(a,(c,f)=>c+f*f,0)/a.length;return Math.max(10*Math.log10(o)+100,0)/100}getAnalyserNode(){return this.analyserNode}rebuildAnalyser(){try{var a,o;(a=this.sourceNode)===null||a===void 0||a.disconnect(this.analyserNode),this.analyserNode=this.context.createAnalyser(),this.analyserNode.fftSize=2048,this.analyserNode.smoothingTimeConstant=.4,(o=this.sourceNode)===null||o===void 0||o.connect(this.analyserNode)}catch{z.warning("rebuild analyser node failed.")}}destroy(){this.updateSource(void 0)}}class eae extends tr{get processSourceNode(){return this.sourceNode}set processedNode(a){var o;if(!this.isDestroyed&&this._processedNode!==a){try{var c;(c=this.sourceNode)===null||c===void 0||c.disconnect(this.outputNode)}catch{}(o=this._processedNode)===null||o===void 0||o.disconnect(),this._processedNode=a,this.connect()}}get processedNode(){return this._processedNode}constructor(){super(),qe(this,"outputNode",void 0),qe(this,"outputTrack",void 0),qe(this,"isPlayed",!1),qe(this,"sourceNode",void 0),qe(this,"context",void 0),qe(this,"audioBufferNode",void 0),qe(this,"destNode",void 0),qe(this,"audioOutputLevel",0),qe(this,"volumeLevelAnalyser",void 0),qe(this,"_processedNode",void 0),qe(this,"playNode",void 0),qe(this,"isDestroyed",!1),qe(this,"onNoAudioInput",void 0),qe(this,"isNoAudioInput",!1),qe(this,"_noAudioInputCount",0),this.context=Lb(),this.playNode=this.context.destination,this.outputNode=this.context.createGain(),C_(this.outputNode),this.volumeLevelAnalyser=new Zse}startGetAudioBuffer(a){this.audioBufferNode||(this.audioBufferNode=this.context.createScriptProcessor(a),this.outputNode.connect(this.audioBufferNode),this.audioBufferNode.connect(this.context.destination),this.audioBufferNode.onaudioprocess=o=>{this.emit(Oc.ON_AUDIO_BUFFER,function(c){for(let f=0;f<c.outputBuffer.numberOfChannels;f+=1){let g=c.outputBuffer.getChannelData(f);for(let v=0;v<g.length;v+=1)g[v]=0}return c.inputBuffer}(o))})}stopGetAudioBuffer(){this.audioBufferNode&&(this.audioBufferNode.onaudioprocess=null,this.outputNode.disconnect(this.audioBufferNode),this.audioBufferNode=void 0)}createOutputTrack(){if(!Jn().webAudioMediaStreamDest)throw new Ke(ce.NOT_SUPPORTED,"your browser is not support audio processor");return this.destNode&&this.outputTrack||(this.destNode=this.context.createMediaStreamDestination(),this.outputNode.connect(this.destNode),this.outputTrack=this.destNode.stream.getAudioTracks()[0]),this.outputTrack}play(a){this.context.state!=="running"&&lk(()=>{Si.emit("autoplay-failed")}),this.isPlayed=!0,this.playNode=a||this.context.destination,this.outputNode.connect(this.playNode)}stop(){if(this.isPlayed)try{this.outputNode.disconnect(this.playNode)}catch{}this.isPlayed=!1}getAccurateVolumeLevel(){return this.volumeLevelAnalyser.getVolumeLevel()}async checkHasAudioInput(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;if(a>5)return this.isNoAudioInput=!0,this.onNoAudioInput&&this.onNoAudioInput(),!1;ca()||Eu()?this.context.state==="suspended"&&this.context.resume():this.context.state!=="running"&&this.context.resume();let o=this.volumeLevelAnalyser.getAnalyserNode(),c;o.getFloatTimeDomainData?(c=new Float32Array(o.fftSize),o.getFloatTimeDomainData(c)):(c=new Uint8Array(o.fftSize),o.getByteTimeDomainData(c));let f=!1;for(let g=0;g<c.length;g++)c[g]!==0&&(f=!0);return f?(this.isNoAudioInput=!1,!0):(await _s(200),await this.checkHasAudioInput(a?a+1:1)&&f)}getAudioVolume(){return this.outputNode.gain.value}setVolume(a){this.outputNode.gain.setValueAtTime(a,this.context.currentTime)}destroy(){this.disconnect(),this.stop(),this.isDestroyed=!0,this.onNoAudioInput=void 0}disconnect(){var a,o;(a=this.processedNode)===null||a===void 0||a.disconnect(),(o=this.sourceNode)===null||o===void 0||o.disconnect(),this.outputNode&&this.outputNode.disconnect()}connect(){var a;this.processedNode?(a=this.processedNode)===null||a===void 0||a.connect(this.outputNode):this.sourceNode&&this.sourceNode.connect(this.outputNode),this.volumeLevelAnalyser.updateSource(this.outputNode)}}class tae extends eae{get isFreeze(){return!1}constructor(a,o,c){var f;if(super(),qe(this,"sourceNode",void 0),qe(this,"track",void 0),qe(this,"clonedTrack",void 0),qe(this,"audioElement",void 0),qe(this,"isCurrentTrackCloned",!1),qe(this,"isRemoteTrack",!1),qe(this,"originVolumeLevelAnalyser",void 0),qe(this,"rebuildWebAudio",async()=>{if(z.debug("ready to rebuild web audio, state:",this.context.state),this.isNoAudioInput&&await this.checkHasAudioInput(),!this.isNoAudioInput||this.isDestroyed)return document.body.removeEventListener("click",this.rebuildWebAudio,!0),void z.debug("rebuild web audio success, current volume status",this.getAccurateVolumeLevel());this.context.resume().then(()=>z.info("resume success")),z.debug("rebuild web audio because of ios 12 bugs"),this.disconnect();let w=this.track;this.track=this.track.clone(),this.isCurrentTrackCloned?w.stop():this.isCurrentTrackCloned=!0;let T=new MediaStream([this.track]);this.sourceNode=this.context.createMediaStreamSource(T),C_(this.sourceNode),this.volumeLevelAnalyser.rebuildAnalyser();let R=this.outputNode.gain.value;this.outputNode=this.context.createGain(),this.outputNode.gain.setValueAtTime(R,this.context.currentTime),C_(this.outputNode),this.emit(Oc.UPDATE_SOURCE),this.connect(),this.audioElement.srcObject=T,this.isPlayed&&this.play(this.playNode),this.checkHasAudioInput()}),a.kind!=="audio")throw new Ke(ce.UNEXPECTED_ERROR);this.track=a;let g=new MediaStream([this.track]);if(this.isRemoteTrack=!!o,this.sourceNode=this.context.createMediaStreamSource(g),C_(this.sourceNode),c){let w=c.clone();w.enabled=!0,this.clonedTrack=w,z.debug("create an unmuted track ".concat(w.id," from the original track ").concat(c.id," to get the volume"));let T=this.context.createMediaStreamSource(new MediaStream([w]));C_(T),this.originVolumeLevelAnalyser=new Zse,this.originVolumeLevelAnalyser.updateSource(T)}this.connect(),this.audioElement=document.createElement("audio"),this.audioElement.srcObject=g;let v=ni();o&&v.os===vs.IOS&&Number((f=v.osVersion)===null||f===void 0?void 0:f.split(".")[0])<15&&(Si.on(Bs.STATE_CHANGE,()=>{this.context.state==="suspended"?document.body.addEventListener("click",this.rebuildWebAudio,!0):this.context.state==="running"&&this.rebuildWebAudio()}),this.checkHasAudioInput().then(w=>{w||document.body.addEventListener("click",this.rebuildWebAudio,!0)}))}updateTrack(a){this.sourceNode.disconnect(),this.track=a,this.isCurrentTrackCloned=!1;let o=new MediaStream([a]);this.sourceNode=this.context.createMediaStreamSource(o),C_(this.sourceNode),this.processedNode||this.sourceNode.connect(this.outputNode),this.emit(Oc.UPDATE_SOURCE),this.audioElement.srcObject=o}destroy(){var a;this.audioElement.srcObject=null,this.audioElement.remove(),Si.off("state-change",this.rebuildWebAudio),(a=this.originVolumeLevelAnalyser)===null||a===void 0||a.destroy(),this.clonedTrack=void 0,super.destroy()}createMediaStreamSourceNode(a){return this.context.createMediaStreamSource(new MediaStream([a]))}updateOriginTrack(a){let o=a.clone();o.enabled=!0,this.clonedTrack&&(this.clonedTrack.stop(),this.clonedTrack=o),z.debug("create an unmuted track ".concat(o.id," from the original track ").concat(a.id," to get the volume"));let c=this.context.createMediaStreamSource(new MediaStream([o]));C_(c),this.originVolumeLevelAnalyser&&this.originVolumeLevelAnalyser.updateSource(c)}getOriginVolumeLevel(){return this.originVolumeLevelAnalyser?this.originVolumeLevelAnalyser.getVolumeLevel():this.getAccurateVolumeLevel()}}async function nae(r,a,o){let c=(g,v)=>g?typeof g!="number"?g.max||g.exact||g.ideal||g.min||v:g:v,f={audio:!!o&&{mandatory:{chromeMediaSource:"desktop"}},video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:r,maxHeight:c(a.height,1080),maxWidth:c(a.width,1920)}}};return a.frameRate&&typeof a.frameRate!="number"?(f.video.mandatory.maxFrameRate=a.frameRate.max,f.video.mandatory.minFrameRate=a.frameRate.min):typeof a.frameRate=="number"&&(f.video.mandatory.maxFrameRate=a.frameRate),await navigator.mediaDevices.getUserMedia(f)}async function x4e(r,a){let o=await iae(r.mediaSource),{sourceId:c,audio:f}=await function(g){let v=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return new Ct((w,T)=>{let R=document.createElement("div");R.innerText="share screen",R.setAttribute("style","text-align: center; height: 25px; line-height: 25px; border-radius: 4px 4px 0 0; background: #D4D2D4; border-bottom: solid 1px #B9B8B9;");let A=document.createElement("div");A.setAttribute("style","width: 100%; height: 500px; padding: 15px 25px ; box-sizing: border-box;");let L=document.createElement("div");L.innerText="Agora Web Screensharing wants to share the contents of your screen with webdemo.agorabeckon.com. Choose what you'd like to share.",L.setAttribute("style","height: 12%;");let U=document.createElement("div");U.setAttribute("style","width: 100%; height: 80%; background: #FFF; border: solid 1px #CBCBCB; display: flex; flex-wrap: wrap; justify-content: space-around; overflow-y: scroll; padding: 0 15px; box-sizing: border-box;");let F=document.createElement("div");F.setAttribute("style","display: flex; justify-content: space-between; padding: 16px 0;");let Z=document.createElement("button");Z.innerHTML="cancel",Z.setAttribute("style","width: 85px;"),Z.onclick=()=>{document.body.removeChild(oe);let ue=new Error("NotAllowedError");ue.name="NotAllowedError",T(ue)};let W=v,K=document.createElement("div");if(v){let ue=document.createElement("input");ue.setAttribute("type","checkbox");let xe=document.createElement("span");ue.setAttribute("style","margin-right: 6px;"),xe.innerText="Share audio",ue.checked=W,ue.onchange=()=>{W=ue.checked},K.appendChild(ue),K.appendChild(xe)}F.appendChild(K),F.appendChild(Z),A.appendChild(L),A.appendChild(U),A.appendChild(F);let oe=document.createElement("div");oe.setAttribute("style","position: fixed; z-index: 99999999; top: 50%; left: 50%; width: 620px; height: 525px; background: #ECECEC; border-radius: 4px; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);"),oe.appendChild(R),oe.appendChild(A),document.body.appendChild(oe),g.map(ue=>{if(ue.id){let xe=document.createElement("div");xe.setAttribute("style","width: 30%; height: 160px; padding: 20px 0; text-align: center;box-sizing: content-box;");let Ne=ue.thumbnail;try{let{width:ke}=Ne.getSize();ke>1920&&(Ne=Ne.resize({width:1920}))}catch(ke){throw ke&&ke.message.startsWith("Illegal invocation")&&console.error("Operate thumbnail error, please try to set contextIsolation: false. (https://github.com/electron/electron/issues/34953)"),ke}xe.innerHTML='<div style="height: 120px; display: table-cell; vertical-align: middle;"><img style="width: 100%; background: #333333; box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.2);" src='+Ne.toDataURL()+' /></div><span style=" height: 40px; line-height: 40px; display: inline-block; width: 70%; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">'+ue.name.replace(/[\u00A0-\u9999<>\&]/g,function(ke){return"&#"+ke.charCodeAt(0)+";"})+"</span>",xe.onclick=()=>{document.body.removeChild(oe),w({sourceId:ue.id,audio:W})},U.appendChild(xe)}})})}(o,a);return await nae(c,r,f)}async function iae(r){let a=["window","screen"];r!=="application"&&r!=="window"||(a=["window"]),r==="screen"&&(a=["screen"]);let o=wie();if(!o)throw console.error("failed to fetch electron, please mount it to window"),new Ke(ce.ELECTRON_IS_NULL);let c=null;try{var f;c=((f=o.desktopCapturer)===null||f===void 0?void 0:f.getSources({types:a}))||o.ipcRenderer.invoke("DESKTOP_CAPTURER_GET_SOURCES",{types:a})}catch{c=null}c&&c.then||(c=new Ct((g,v)=>{o.desktopCapturer.getSources({types:a},(w,T)=>{w?v(w):g(T)})}));try{return await c}catch(g){throw new Ke(ce.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR,g.toString())}}let GW=new As("safari"),rae=!1,sae=!1;async function Dc(r,a){let o=0,c=null;for(;o<2;)try{c=await A4e(r,a,o>0);break}catch(f){if(f instanceof Ke)throw z.error("[".concat(a,"] ").concat(f.toString())),f;let g=Xk(f.name||f.code||f,f.message);if(g.code===ce.MEDIA_OPTION_INVALID){z.debug("[".concat(a,"] detect media option invalid, retry")),o+=1,await _s(500);continue}throw z.error("[".concat(a,"] ").concat(g.toString())),g}if(!c)throw new Ke(ce.UNEXPECTED_ERROR,"can not find stream after getUserMedia");return c}async function A4e(r,a,o){if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new Ke(ce.NOT_SUPPORTED,"can not find getUserMedia");o&&(r.video&&(delete r.video.width,delete r.video.height),r.screen&&(delete r.screen.width,delete r.screen.height));let c=Jn(),f=new MediaStream;if(r.audioSource&&f.addTrack(r.audioSource),r.videoSource&&f.addTrack(r.videoSource),!r.audio&&!r.video&&!r.screen)return z.debug("Using Video Source/ Audio Source"),f;if(r.screen)if(wie())r.screen.sourceId?Db(f,await nae(r.screen.sourceId,r.screen,r.screenAudio)):Db(f,await x4e(r.screen,r.screenAudio));else if(U0()&&r.screen.extensionId&&r.screen.mandatory){if(!c.getStreamFromExtension)throw new Ke(ce.NOT_SUPPORTED,"This browser does not support screen sharing");z.debug("[".concat(a,'] Screen access on chrome stable, looking for extension"'));let U=await(v=r.screen.extensionId,w=a,new Ct((F,Z)=>{try{chrome.runtime.sendMessage(v,{getStream:!0},W=>{if(!W||!W.streamId)return z.error("[".concat(w,"] No response from Chrome Plugin. Plugin not installed properly"),W),void Z(new Ke(ce.CHROME_PLUGIN_NO_RESPONSE,"No response from Chrome Plugin. Plugin not installed properly"));F(W.streamId)})}catch(W){z.error("[".concat(w,"] AgoraRTC screensharing plugin is not accessible(").concat(v,")"),W.toString()),Z(new Ke(ce.CHROME_PLUGIN_NOT_INSTALL))}}));r.screen.mandatory.chromeMediaSourceId=U,Db(f,await navigator.mediaDevices.getUserMedia({video:{mandatory:r.screen.mandatory}}))}else if(c.getDisplayMedia){var g;r.screen.mediaSource&&Kse(r.screen.mediaSource);let U={width:r.screen.width,height:r.screen.height,frameRate:r.screen.frameRate,displaySurface:(g=r.screen.displaySurface)!==null&&g!==void 0?g:r.screen.mediaSource==="screen"?"monitor":r.screen.mediaSource},{selfBrowserSurface:F,surfaceSwitching:Z,systemAudio:W}=r.screen,K={selfBrowserSurface:F,surfaceSwitching:Z,systemAudio:W};!F&&delete K.selfBrowserSurface,!Z&&delete K.surfaceSwitching,!W&&delete K.systemAudio,z.debug("[".concat(a,"] getDisplayMedia:"),JSON.stringify({video:U,audio:!!r.screenAudio,controls:K})),Db(f,await navigator.mediaDevices.getDisplayMedia(nr({video:U,audio:!!r.screenAudio},K)))}else{if(!Oi())throw z.error("[".concat(a,"] This browser does not support screenSharing")),new Ke(ce.NOT_SUPPORTED,"This browser does not support screen sharing");{r.screen.mediaSource&&Kse(r.screen.mediaSource);let U={video:{mediaSource:r.screen.mediaSource,width:r.screen.width,height:r.screen.height,frameRate:r.screen.frameRate}};z.debug("[".concat(a,"] getUserMedia: ").concat(JSON.stringify(U))),Db(f,await navigator.mediaDevices.getUserMedia(U))}}var v,w;if(!r.video&&!r.audio)return f;let T={video:r.video,audio:r.audio},R=ve("MEDIA_DEVICE_CONSTRAINTS");if(R)try{typeof R=="string"&&(R=JSON.parse(R)),T=yG(T,R)}catch{}z.debug("[".concat(a,"] GetUserMedia"),JSON.stringify(T)),ni();let A,L=null;(ys()||ca()||sk())&&(L=await GW.lock());try{A=await navigator.mediaDevices.getUserMedia(T)}catch(U){throw L&&L(),U}return T.audio&&(rae=!0),T.video&&(sae=!0),Db(f,A),L&&L(),f}function Xk(r,a){switch(r){case"Starting video failed":case"OverconstrainedError":case"TrackStartError":return new Ke(ce.MEDIA_OPTION_INVALID,"".concat(r,": ").concat(a));case"NotFoundError":case"DevicesNotFoundError":return new Ke(ce.DEVICE_NOT_FOUND,"".concat(r,": ").concat(a));case"NotSupportedError":return new Ke(ce.NOT_SUPPORTED,"".concat(r,": ").concat(a));case"NotReadableError":return new Ke(ce.NOT_READABLE,"".concat(r,": ").concat(a));case"InvalidStateError":case"NotAllowedError":case"PERMISSION_DENIED":case"PermissionDeniedError":return new Ke(ce.PERMISSION_DENIED,"".concat(r,": ").concat(a));case"ConstraintNotSatisfiedError":return new Ke(ce.CONSTRAINT_NOT_SATISFIED,"".concat(r,": ").concat(a));default:return z.error("getUserMedia unexpected error",r),new Ke(ce.UNEXPECTED_ERROR,"".concat(r,": ").concat(a))}}function Db(r,a){let o=r.getVideoTracks()[0],c=r.getAudioTracks()[0],f=a.getVideoTracks()[0],g=a.getAudioTracks()[0];g&&(c&&r.removeTrack(c),r.addTrack(g)),f&&(o&&r.removeTrack(o),r.addTrack(f))}let kc=new class extends tr{get state(){return this._state}set state(r){r!==this._state&&(this.emit(b_.STATE_CHANGE,r),this._state=r)}constructor(){super(),qe(this,"_state",y3.IDLE),qe(this,"isAccessMicrophonePermission",!1),qe(this,"isAccessCameraPermission",!1),qe(this,"lastAccessMicrophonePermission",!1),qe(this,"lastAccessCameraPermission",!1),qe(this,"checkdeviceMatched",!1),qe(this,"deviceInfoMap",new Map),this.init().then(()=>{navigator.mediaDevices.addEventListener&&navigator.mediaDevices.addEventListener("devicechange",this.updateDevicesInfo.bind(this)),window.setInterval(()=>{(ve("ENUMERATE_DEVICES_INTERVAL")||(ak()||rk()===vs.HARMONY_OS)&&F0())&&this.updateDevicesInfo()},ve("ENUMERATE_DEVICES_INTERVAL_TIME"))}).catch(r=>z.error(r.toString()))}async enumerateDevices(r,a){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return new Ke(ce.NOT_SUPPORTED,"enumerateDevices() not supported.").throw();let c=await navigator.mediaDevices.enumerateDevices(),f=this.checkMediaDeviceInfoIsOk(c),g=!this.isAccessMicrophonePermission&&r,v=!this.isAccessCameraPermission&&a;f.audio&&(g=!1),f.video&&(v=!1);let w=null,T=null,R=null;if(!o&&(g||v)){if(GW.isLocked&&(z.debug("[device manager] wait GUM lock"),(await GW.lock())(),z.debug("[device manager] GUM unlock")),rae&&(g=!1,this.isAccessMicrophonePermission=!0),sae&&(v=!1,this.isAccessCameraPermission=!0),z.debug("[device manager] check media device permissions",r,a,g,v),g&&v){try{R=await navigator.mediaDevices.getUserMedia({audio:!0,video:!0})}catch(A){let L=Xk(A.name||A.code||A,A.message);if(L.code===ce.PERMISSION_DENIED)throw L;z.warning("getUserMedia failed in getDevices",L)}this.isAccessCameraPermission=!0,this.isAccessMicrophonePermission=!0}else if(g){try{w=await navigator.mediaDevices.getUserMedia({audio:r})}catch(A){let L=Xk(A.name||A.code||A,A.message);if(L.code===ce.PERMISSION_DENIED)throw L;z.warning("getUserMedia failed in getDevices",L)}this.isAccessMicrophonePermission=!0}else if(v){try{T=await navigator.mediaDevices.getUserMedia({video:a})}catch(A){let L=Xk(A.name||A.code||A,A.message);if(L.code===ce.PERMISSION_DENIED)throw L;z.warning("getUserMedia failed in getDevices",L)}this.isAccessCameraPermission=!0}z.debug("[device manager] mic permission",r,"cam permission",a)}try{let A=await navigator.mediaDevices.enumerateDevices();return w&&w.getTracks().forEach(L=>L.stop()),T&&T.getTracks().forEach(L=>L.stop()),R&&R.getTracks().forEach(L=>L.stop()),w=null,T=null,R=null,A}catch(A){return w&&w.getTracks().forEach(L=>L.stop()),T&&T.getTracks().forEach(L=>L.stop()),R&&R.getTracks().forEach(L=>L.stop()),w=null,T=null,R=null,new Ke(ce.ENUMERATE_DEVICES_FAILED,A.toString()).throw()}}async getRecordingDevices(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return(await this.enumerateDevices(!0,!1,r)).filter(a=>a.kind==="audioinput")}async getCamerasDevices(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return(await this.enumerateDevices(!1,!0,r)).filter(a=>a.kind==="videoinput")}async getSpeakers(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return(await this.enumerateDevices(!0,!1,r)).filter(a=>a.kind==="audiooutput")}searchDeviceIdByName(r){let a=null;return this.deviceInfoMap.forEach(o=>{o.device.label===r&&(a=o.device.deviceId)}),a}async getDeviceById(r){let a=(await this.enumerateDevices(!0,!0,!0)).find(o=>o.deviceId===r);if(!a)throw new Ke(ce.DEVICE_NOT_FOUND,"deviceId: ".concat(r));return a}async init(){this.state=y3.INITING;try{await this.updateDevicesInfo(),this.state=y3.INITEND}catch(r){throw z.warning("Device Detection functionality cannot start properly.",r.toString()),this.state=y3.IDLE,(typeof isSecureContext=="boolean"?isSecureContext:location.protocol==="https:"||location.protocol==="file:"||location.hostname==="localhost"||location.hostname==="127.0.0.1"||location.hostname==="::1")||new Ke(ce.WEB_SECURITY_RESTRICT,"Your context is limited by web security, please try using https protocol or localhost.").throw(),r}}async updateDevicesInfo(){let r=await this.enumerateDevices(!0,!0,!0),a=Date.now(),o=[];if(r[0]&&r[0].label&&this.checkdeviceMatched===!1){this.checkdeviceMatched=!0;let f=r.find(v=>v.kind==="audioinput"&&v.deviceId==="default"),g=r.find(v=>v.kind==="audiooutput"&&v.deviceId==="default");f&&g?g.groupId===f.groupId?z.debug("[device-check] default input ".concat(f.label," and output ").concat(g.label," is the same group")):z.warning("[device-check] default input ".concat(f.label," and output ").concat(g.label," is not the same group")):z.debug("[device-check] default input or output not found")}let c=this.checkMediaDeviceInfoIsOk(r);if(r.forEach(f=>{if(!f.deviceId)return;let g=this.deviceInfoMap.get("".concat(f.kind,"_").concat(f.deviceId));if((g?g.state:"INACTIVE")!=="ACTIVE"){let v={initAt:a,updateAt:a,device:f,state:"ACTIVE"};this.deviceInfoMap.set("".concat(f.kind,"_").concat(f.deviceId),v),o.push(v)}g&&(g.updateAt=a)}),this.deviceInfoMap.forEach((f,g)=>{f.state==="ACTIVE"&&f.updateAt!==a&&(f.state="INACTIVE",o.push(f))}),this.state!==y3.INITEND)return c.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),void(c.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0));o.forEach(f=>{switch(f.device.kind){case"audioinput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(b_.RECORDING_DEVICE_CHANGED,f);break;case"videoinput":this.lastAccessCameraPermission&&this.isAccessCameraPermission&&this.emit(b_.CAMERA_DEVICE_CHANGED,f);break;case"audiooutput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(b_.PLAYOUT_DEVICE_CHANGED,f)}}),c.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),c.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0)}checkMediaDeviceInfoIsOk(r){let a=r.filter(f=>f.kind==="audioinput"),o=r.filter(f=>f.kind==="videoinput"),c={audio:!1,video:!1};for(let f of a)if(f.label&&f.deviceId){c.audio=!0;break}for(let f of o)if(f.label&&f.deviceId){c.video=!0;break}return c}},WW=!1,Mc=new class extends tr{constructor(){super(...arguments),qe(this,"onAutoplayFailed",void 0),qe(this,"onAudioAutoplayFailed",void 0)}};function aae(){if(ni(),!WW){let r=a=>{a.preventDefault(),WW=!1,MI()?document.body.removeEventListener("click",r,!0):(document.body.removeEventListener("touchstart",r,!0),document.body.removeEventListener("mousedown",r,!0))};WW=!0,MI()?document.body.addEventListener("click",r,!0):(document.body.addEventListener("touchstart",r,!0),document.body.addEventListener("mousedown",r,!0)),z.info("detect media autoplay failed, document: https://docs.agora.io/cn/Voice/autoplay_policy_web_ng?platform=Web"),Mc.onAutoplayFailed?Mc.onAutoplayFailed():Mc.onAudioAutoplayFailed?z.warning(`AgoraRTC.onAudioAutoplayFailed has been deprecated in favor of AgoraRTC.onAutoplayFailed.
Please refer to the Agora document to migrate the newer API, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`):z.warning(`We have detected a media autoplay failed event, and found out that you haven't implemented AgoraRTC.onAutoplayFailed callback yet.
It will cause audio/video element not playing automatically on some browsers without user interaction, possibly hurting user experiences.
Please refer to the Agora document to properly handle autoplay failed event, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`),Mc.emit("autoplay-failed")}}function oae(r,a,o,c){if(!r)return;let f=$t.getBaseInfoBySessionId(r);if(!f)return;let g=f.info,v=Date.now(),w=nr(nr({},g),{},{vid:g.vid===void 0?0:Number(g.vid),lts:v,elapse:v-f.startTime,cbRegistered:Mc.onAutoplayFailed||Mc.onAudioAutoplayFailed?1:-1,errorMsg:o,mediaType:a,trackId:c,extend:void 0});$t.send({type:fr.AUTOPLAY_FAILED,data:w},!0)}let I4e=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","error"],ko=new class{constructor(){qe(this,"onAutoplayFailed",void 0),qe(this,"elementMap",new Map),qe(this,"elementStateMap",new Map),qe(this,"elementsNeedToResume",[]),qe(this,"sinkIdMap",new Map),qe(this,"autoResumeAfterInterruption",r=>{Array.from(this.elementMap.entries()).forEach(a=>{let[o,c]=a,f=this.elementStateMap.get(o),g=c.srcObject.getAudioTracks()[0],v=g&&g.readyState;if(z.debug("resume after interrupted, ele: ".concat(f," audio: ").concat(v," ").concat(r)),v==="live"){if(r)return c.pause(),void c.play();if(Si.curState==="running")return ib()?(c.pause(),void c.play()):void(f&&f==="paused"&&c.play())}})}),qe(this,"autoResumeAfterInterruptionOnIOS15_16",()=>{Array.from(this.elementMap.entries()).forEach(r=>{let[a,o]=r,c=o.srcObject.getAudioTracks()[0];c&&c.readyState==="live"&&(z.debug("auto resume after interruption inside autoResumeAfterInterruptionOnIOS15"),o.pause(),o.play())})}),this.autoResumeAudioElement(),Si.on(Bs.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Si.on(Bs.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16),Si.on(Bs.STATE_CHANGE,()=>{ca()&&Si.prevState==="suspended"&&Si.curState==="running"&&this.autoResumeAfterInterruption()})}async setSinkID(r,a){let o=this.elementMap.get(r);if(this.sinkIdMap.set(r,a),o)try{await o.setSinkId(a)}catch(c){throw new Ke(ce.PERMISSION_DENIED,"can not set sink id: "+c.toString())}}play(r,a,o,c){if(this.elementMap.has(a))return;let f=document.createElement("audio");f.autoplay=!0,f.srcObject=new MediaStream([r]),this.bindAudioElementEvents(a,f),this.elementMap.set(a,f),this.elementStateMap.set(a,Fa.INIT),this.setVolume(a,o);let g=this.sinkIdMap.get(a);if(g)try{f.setSinkId(g).catch(w=>{z.warning("[".concat(a,"] set sink id failed"),w.toString())})}catch(w){z.warning("[".concat(a,"] set sink id failed"),w.toString())}let v=f.play();v&&v.then&&v.catch(w=>{c&&oae(c,"audio",w.message,a),z.warning("audio element play warning",w.toString()),this.elementMap.has(a)&&w.name==="NotAllowedError"&&(z.warning("detected audio element autoplay failed"),this.elementsNeedToResume.push(f),lk(()=>{this.onAutoplayFailed&&this.onAutoplayFailed(),aae()}))})}updateTrack(r,a){let o=this.elementMap.get(r);o&&(o.srcObject=new MediaStream([a]))}isPlaying(r){return this.elementMap.has(r)&&this.elementStateMap.get(r)==="playing"}setVolume(r,a){let o=this.elementMap.get(r);o&&(a=Math.max(0,Math.min(100,a)),o.volume=a/100)}stop(r){let a=this.elementMap.get(r);if(this.sinkIdMap.delete(r),!a)return;let o=this.elementsNeedToResume.indexOf(a);this.elementsNeedToResume.splice(o,1),a.srcObject=null,a.remove(),this.elementMap.delete(r),this.elementStateMap.delete(r)}bindAudioElementEvents(r,a){I4e.forEach(o=>{a.addEventListener(o,c=>{let f=this.elementStateMap.get(r),g=c.type==="pause"?"paused":c.type;if(z.debug("[".concat(r,"] audio-element-status change ").concat(f," => ").concat(g)),c.type==="error"){let v=a==null?void 0:a.error;v&&z.error("[".concat(r,"] media error, code: ").concat(v.code,", message: ").concat(v.message))}this.elementStateMap.set(r,g)})})}getPlayerState(r){return this.elementStateMap.get(r)||"uninit"}autoResumeAudioElement(){let r=()=>{this.elementsNeedToResume.forEach(a=>{a.play().then(o=>{z.debug("Auto resume audio element success")}).catch(o=>{z.warning("Auto resume audio element failed!",o)})}),this.elementsNeedToResume=[]};new Ct(a=>{document.body?a():window.addEventListener("load",()=>a())}).then(()=>{MI()?document.body.addEventListener("click",r,!0):(document.body.addEventListener("touchstart",r,!0),document.body.addEventListener("mousedown",r,!0))})}};function Or(){return function(r,a,o){let c=o.value;return typeof c=="function"&&(o.value=function(){this._isClosed&&new Ke(ce.INVALID_OPERATION,"[".concat(this.getTrackId(),"] cannot operate a closed track")).print("warning",z);for(var f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];let w=c.apply(this,g);return w instanceof Ct?new Ct((T,R)=>{w.then(T).catch(R)}):w}),o}}class lae extends tr{constructor(a){super(),qe(this,"name","VideoProcessorDestination"),qe(this,"ID","0"),qe(this,"_source",void 0),qe(this,"videoContext",void 0),qe(this,"inputTrack",void 0),this.videoContext=a}get kind(){return"video"}get enabled(){return!0}pipe(){throw new Ke(ce.NOT_SUPPORTED,"VideoProcessor cannot pipe to any other Processor")}unpipe(){throw new Ke(ce.NOT_SUPPORTED,"VideoProcessor cannot unpipe to any other Processor")}enable(){}disable(){}updateInput(a){if(a.context!==this.videoContext)throw new Error(`ProcessorContext passed to VideoTrack.processorDestination doesn't match it's belonging VideoTrack's context.
Probably you are making pipeline like this:
videoTrack1.pipe(processor).pipe(videoTrack2.processorDestination).`);a.track&&a.track!==this.inputTrack&&(this.videoContext.chained=!0,this.inputTrack=a.track,this.emit(uo.ON_TRACK,a.track))}reset(){this.inputTrack=void 0,this.videoContext.chained=!1,this.emit(uo.ON_TRACK,void 0)}}class cae extends tr{set chained(a){this._chained=a}get chained(){return this._chained}constructor(a,o){super(),qe(this,"constraintsMap",new Map),qe(this,"statsRegistry",[]),qe(this,"usageRegistry",[]),qe(this,"trackId",void 0),qe(this,"direction",void 0),qe(this,"_chained",!1),this.trackId=a,this.direction=o}async getConstraints(){return await Yr(this,Pc.REQUEST_CONSTRAINTS)}async requestApplyConstraints(a,o){var c;return z.info("processor ".concat(o.name," requestApplyConstraints for ").concat(this.trackId)),a&&this.constraintsMap.set(o,a),Pi(this,Pc.REQUEST_UPDATE_CONSTRAINTS,Array.from(Oh(c=this.constraintsMap).call(c)))}async requestRevertConstraints(a){var o;if(this.constraintsMap.has(a))return z.info("processor ".concat(a.name," requestRevertConstraints for ").concat(this.trackId)),this.constraintsMap.delete(a),Pi(this,Pc.REQUEST_UPDATE_CONSTRAINTS,Array.from(Oh(o=this.constraintsMap).call(o)))}registerStats(a,o,c){this.statsRegistry.find(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o)||this.statsRegistry.push({processorName:a.name,processorID:a.ID,type:o,cb:c})}unregisterStats(a,o){let c=this.statsRegistry.findIndex(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o);c!==-1&&this.statsRegistry.splice(c,1)}gatherStats(){let a=[];for(let{processorID:o,processorName:c,type:f,cb:g}of this.statsRegistry)try{let v=g();a.push({processorID:o,processorName:c,type:f,stats:v})}catch(v){z.error(new Ke(ce.UNEXPECTED_ERROR,v.message))}return a}registerUsage(a,o){this.usageRegistry.find(c=>c.processorID===a.ID&&c.processorName===a.name)||this.usageRegistry.push({processorID:a.ID,processorName:a.name,cb:o})}unregisterUsage(a){let o=this.usageRegistry.findIndex(c=>c.processorID===a.ID&&c.processorName===a.name);o!==-1&&this.usageRegistry.splice(o,1)}async gatherUsage(){let a=[];if(!this.chained)return[];for(let{cb:o}of this.usageRegistry)try{let c=o();c instanceof Ct&&(c=await c),a.push(nr(nr({},c),{},{direction:this.direction}))}catch(c){z.error("gather extension usage error",c)}return a}getDirection(){return this.direction}}class dae extends tr{constructor(a){super(),qe(this,"name","AudioProcessorDestination"),qe(this,"ID","0"),qe(this,"inputTrack",void 0),qe(this,"inputNode",void 0),qe(this,"audioProcessorContext",void 0),qe(this,"_source",void 0),this.audioProcessorContext=a}get kind(){return"audio"}get enabled(){return!0}pipe(){throw new Ke(ce.NOT_SUPPORTED,"AudioProcessorDestination cannot pipe to any other Processor")}unpipe(){throw new Ke(ce.NOT_SUPPORTED,"AudioProcessor cannot unpipe to any other Processor")}enable(){}disable(){}reset(){this.inputTrack=void 0,this.inputNode=void 0,this.audioProcessorContext.chained=!1,this.emit(uo.ON_TRACK,void 0),this.emit(uo.ON_NODE,void 0)}updateInput(a){if(a.context!==this.audioProcessorContext)throw new Error(`ProcessorContext passed to AudioTrack.processorDestination doesn't match it's belonging AudioTrack's context.
Probably you are making pipeline like this: audioTrack1.pipe(processor).pipe(audioTrack2.processorDestination).`);a.track&&this.inputTrack!==a.track&&(this.audioProcessorContext.chained=!0,this.inputTrack=a.track,this.emit(uo.ON_TRACK,this.inputTrack)),a.node&&this.inputNode!==a.node&&(this.audioProcessorContext.chained=!0,this.inputNode=a.node,this.emit(uo.ON_NODE,this.inputNode))}}class uae extends tr{set chained(a){this._chained=a}get chained(){return this._chained}constructor(a,o,c){super(),qe(this,"constraintsMap",new Map),qe(this,"statsRegistry",[]),qe(this,"audioContext",void 0),qe(this,"trackId",void 0),qe(this,"direction",void 0),qe(this,"usageRegistry",[]),qe(this,"_chained",!1),this.audioContext=a,this.trackId=o,this.direction=c}async getConstraints(){return Yr(this,Pc.REQUEST_CONSTRAINTS)}getAudioContext(){return this.audioContext}async requestApplyConstraints(a,o){var c;return z.info("processor ".concat(o.name," requestApplyConstraints for ").concat(this.trackId)),a&&this.constraintsMap.set(o,a),Pi(this,Pc.REQUEST_UPDATE_CONSTRAINTS,Array.from(Oh(c=this.constraintsMap).call(c)))}async requestRevertConstraints(a){var o;if(this.constraintsMap.has(a))return this.constraintsMap.delete(a),Pi(this,Pc.REQUEST_UPDATE_CONSTRAINTS,Array.from(Oh(o=this.constraintsMap).call(o)))}registerStats(a,o,c){this.statsRegistry.find(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o)||this.statsRegistry.push({processorName:a.name,processorID:a.ID,type:o,cb:c})}unregisterStats(a,o){let c=this.statsRegistry.findIndex(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o);c!==-1&&this.statsRegistry.splice(c,1)}gatherStats(){let a=[];for(let{processorID:o,processorName:c,type:f,cb:g}of this.statsRegistry)try{let v=g();a.push({processorID:o,processorName:c,type:f,stats:v})}catch(v){z.error(new Ke(ce.UNEXPECTED_ERROR,v.message))}return a}registerUsage(a,o){this.usageRegistry.find(c=>c.processorID===a.ID&&c.processorName===a.name)||this.usageRegistry.push({processorID:a.ID,processorName:a.name,cb:o})}unregisterUsage(a){let o=this.usageRegistry.findIndex(c=>c.processorID===a.ID&&c.processorName===a.name);o!==-1&&this.usageRegistry.splice(o,1)}async gatherUsage(){let a=[];if(!this.chained)return[];for(let{cb:o}of this.usageRegistry)try{let c=o();c instanceof Ct&&(c=await c),a.push(nr(nr({},c),{},{direction:this.direction}))}catch(c){z.error("gather extension usage error",c)}return a}getDirection(){return this.direction}}class $W extends tr{get isPlayed(){return!0}get isFreeze(){return!1}constructor(){super(),qe(this,"context",void 0),qe(this,"processSourceNode",void 0),qe(this,"outputTrack",void 0),qe(this,"processedNode",void 0),qe(this,"clonedTrack",void 0),qe(this,"outputNode",void 0),this.outputNode=new N4e}setVolume(){}createOutputTrack(){throw new Ke(ce.NOT_SUPPORTED,"can not create output MediaStreamTrack when WebAudio disabled")}getOriginVolumeLevel(){return 0}getAccurateVolumeLevel(){return 0}stopGetAudioBuffer(){}startGetAudioBuffer(){}play(){}stop(){}destroy(){}updateTrack(){}updateOriginTrack(){}createMediaStreamSourceNode(){}}class N4e{disconnect(){}connect(){}}function hae(r){return new Ct((a,o)=>{let c=!1,f=document.createElement("video");f.setAttribute("autoplay",""),f.setAttribute("muted",""),f.muted=!0,f.autoplay=!0,f.setAttribute("playsinline",""),f.setAttribute("style","position: fixed; top: 0; left: 0; width: 1px; height: 1px"),document.body.appendChild(f);let g=ca()?"canplay":"playing";f.addEventListener(g,()=>{let v=f.videoWidth,w=f.videoHeight;!v&&Oi()||(c=!0,f.srcObject=null,f.remove(),a([v,w]))}),f.srcObject=new MediaStream([r]),f.play().catch(ck),setTimeout(()=>{c||(f.srcObject=null,f.remove(),a([f.videoWidth,f.videoHeight]))},4e3)})}function Jk(r){let a={};r.facingMode&&(a.facingMode=r.facingMode),r.cameraId&&(a.deviceId={exact:r.cameraId});let o=Xf(r.encoderConfig);return o.width!=null&&(a.width=o.width),o.height!=null&&(a.height=o.height),!pie()&&o.frameRate&&(a.frameRate=o.frameRate),rie()&&typeof a.frameRate=="object"&&(a.frameRate.max=60),Oi()&&(a.frameRate={ideal:30,max:30}),a}function fae(r){let a={};if(pie()||(r.AGC!==void 0&&(a.autoGainControl=r.AGC),r.AEC!==void 0&&(a.echoCancellation=r.AEC),r.ANS!==void 0&&(a.noiseSuppression=r.ANS,U0()&&r.ANS&&(a.googHighpassFilter=r.ANS))),r.encoderConfig){let o=qk(r.encoderConfig);a.channelCount=o.stereo?2:1,a.sampleRate=o.sampleRate,a.sampleSize=o.sampleSize}return r.microphoneId&&(a.deviceId={exact:r.microphoneId}),ak()&&(a.sampleRate=void 0),a}let O4e=r=>{let a=r._encoderConfig;if(!a)return;let{frameRate:o,width:c,height:f}=r.getMediaStreamTrackSettings(),{frameRate:g=o,width:v=c,height:w=f}=a;if(!g||!v||!w)return;v=_G(v),w=_G(w),g=_G(g);let{max:T,min:R}=function(F,Z,W){let K=200*Math.pow(W/15,.6)*Math.pow(F*Z/640/360,.75);return{min:Math.floor(K),max:Math.floor(4*K)}}(v,w,g),{bitrateMax:A,bitrateMin:L}=a||{};A||z.debug("calculate bitrate: [w: ".concat(v,", h: ").concat(w,", fps: ").concat(g,"] => [brMax: ").concat(A,", brMin: ").concat(L,"]"));let{maxFramerate:U}=ve("ENCODER_CONFIG_LIMIT");return U&&typeof U=="number"&&(g=Math.min(g,U)),{frameRate:g,bitrateMax:A||T,bitrateMin:L||R,scaleResolutionDownBy:1,scale:0}},pae=async(r,a,o)=>await(async(c,f,g)=>{let v=function(R){let A=[];for(let L=0;L<R.length;L+=2)A.push(parseInt(R.slice(L,L+2),16));return Uint8Array.from(A)}(Lie(""+f+g)).slice(0,16),w=v.slice(0,12),T=await window.crypto.subtle.importKey("raw",v,"AES-GCM",!0,["encrypt"]);return new Uint8Array(await window.crypto.subtle.encrypt({name:"AES-GCM",iv:w},T,c))})(r.buffer,a,o),KW=r=>{let a=document.createElement("canvas");return a.width=2,a.height=2,new Ct((o,c)=>{a.toBlob(async f=>{if(a.remove(),f){let g=await mae(f);o({buffer:g,width:a.width,height:a.height})}else c(new Ke(ce.CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED))},r,1)})},mae=async r=>{let a=await r.arrayBuffer();return new Uint8Array(a)};var gae,vae,yae,_ae,Eae,wae,Sae,bae,Cae,Tae,Rae,xae,Aae,Iae,Nae,Oae,Pae,Lae,pr,Dae,kae,Mae,jae,Uae,Fae,Qf,Bae,Vae,zae,Hae,Gae,Wae,$ae,Kae,qae,Yae,Xae,Jae,Qae,Zs;let br=(gae=hn({argsMap:(r,a)=>[r.getTrackId(),a],throttleTime:300}),vae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),yae=Or(),_ae=ab("LocalAudioTrack","_enabledMutex"),Eae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),wae=Or(),Sae=ab("LocalAudioTrack","_enabledMutex"),bae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Cae=Or(),Tae=Or(),Rae=Or(),xae=hn({argsMap:r=>[r.getTrackId()]}),Aae=Or(),Iae=hn({argsMap:r=>[r.getTrackId()]}),Nae=Or(),Oae=hn({argsMap:r=>[r.getTrackId()]}),Pae=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),Lae=hn({argsMap:r=>[r.getTrackId()]}),Qn((pr=class extends Pb{get _source(){return this.initWebAudio()}set _source(r){this._trackSource=r}get processorContext(){return this._processorContext||(this._processorContext=this.initProcessor().processorContext),this._processorContext}get processorDestination(){return this._processorDestination||(this._processorDestination=this.initProcessor().processorDestination),this._processorDestination}get isPlaying(){return this._useAudioElement?ko.isPlaying(this.getTrackId()):this._source.isPlayed}get __className__(){return"LocalAudioTrack"}constructor(r,a,o,c){super(r,o),qe(this,"trackMediaType","audio"),qe(this,"_encoderConfig",void 0),qe(this,"_trackSource",void 0),qe(this,"_enabled",!0),qe(this,"_volume",100),qe(this,"_useAudioElement",!0),qe(this,"_bypassWebAudio",!1),qe(this,"processor",void 0),qe(this,"_processorContext",void 0),qe(this,"_processorDestination",void 0),qe(this,"_getOriginVolumeLevel",void 0),this._encoderConfig=a,this._getOriginVolumeLevel=!!c,this._trackSource=new $W,ve("DISABLE_WEBAUDIO")&&(this._bypassWebAudio=!0),ve("LOCAL_AUDIO_TRACK_USES_WEB_AUDIO")&&(this._useAudioElement=!1),ys()&&!Lc?setTimeout(()=>this.initWebAudio()):this.initWebAudio()}setVolume(r){Ti(r,"volume",0,1e3),this._volume=r,this._source.setVolume(r/100),this._useAudioElement&&ko.setVolume(this.getTrackId(),r);try{if(this._bypassWebAudio)return void z.debug("[".concat(this.getTrackId(),"] setVolume returned because no pass through WebAudio."));let a=this._source.createOutputTrack();this._mediaStreamTrack!==a&&(this._mediaStreamTrack=a,Pi(this,Mt.NEED_REPLACE_TRACK,this).then(()=>{z.debug("[".concat(this.getTrackId(),"] replace web audio track success"))}).catch(o=>{z.warning("[".concat(this.getTrackId(),"] replace web audio track failed"),o)}))}catch{}}getVolumeLevel(){return this._muted&&this.enabled&&this._getOriginVolumeLevel?this._source.getOriginVolumeLevel():this._source.getAccurateVolumeLevel()}async setPlaybackDevice(r){if(!this._useAudioElement||!$se())throw new Ke(ce.NOT_SUPPORTED,"your browser does not support setting the audio output device");await ko.setSinkID(this.getTrackId(),r)}async setEnabled(r,a,o){return this._setEnabled(r,a,o)}async _setEnabled(r,a,o){if(!o){if(r===this._enabled)return;this.stateCheck("enabled",r)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),r),r){this._originMediaStreamTrack.enabled=!0;try{o||(this._enabled=!0),await Pi(this,Mt.NEED_ENABLE_TRACK,this),z.info("[".concat(this.getTrackId(),"] setEnabled to ").concat(r," success"))}catch(c){throw o||(this._enabled=!1),z.error("[".concat(this.getTrackId(),"] setEnabled to true error"),c.toString()),c}}else{this._originMediaStreamTrack.enabled=!1,o||(this._enabled=!1);try{await Pi(this,Mt.NEED_DISABLE_TRACK,this)}catch(c){throw o||(this._enabled=!0),z.error("[".concat(this.getTrackId(),"] setEnabled to false error"),c.toString()),c}}}async setMuted(r){r!==this._muted&&(this.stateCheck("muted",r),this._muted=r,this._originMediaStreamTrack.enabled=!r,z.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(r)),r?await Pi(this,Mt.NEED_MUTE_TRACK,this):await Pi(this,Mt.NEED_UNMUTE_TRACK,this))}getStats(){return B0(()=>{z.warning("[deprecated] LocalAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalAudioStats instead")},"localAudioTrackGetStatsWarning"),Bl(this,Mt.GET_STATS)||nr({},FW)}setAudioFrameCallback(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4096;if(!r)return this._source.removeAllListeners(Oc.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(a),this._source.removeAllListeners(Oc.ON_AUDIO_BUFFER),this._source.on(Oc.ON_AUDIO_BUFFER,o=>r(o))}play(){z.debug("[".concat(this.getTrackId(),"] start audio playback")),this._useAudioElement?(z.debug("[".concat(this.getTrackId(),"] start audio playback in element")),ko.play(this._mediaStreamTrack,this.getTrackId(),this._volume)):this._source.play()}stop(){z.debug("[".concat(this.getTrackId(),"] stop audio playback")),this._useAudioElement?ko.stop(this.getTrackId()):this._source.stop()}close(){super.close(),this._processorDestination&&this.unbindProcessorDestinationEvents(this._processorDestination),this._processorContext&&this.unbindProcessorContextEvents(this._processorContext),this.unpipe(),this._processorDestination&&this._processorDestination._source&&this._processorDestination._source.unpipe(),this._source.destroy()}_updatePlayerSource(){let r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];z.debug("[".concat(this.getTrackId(),"] update player source track")),r&&this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&ko.updateTrack(this.getTrackId(),this._mediaStreamTrack)}async _updateOriginMediaStreamTrack(r,a){this._originMediaStreamTrack!==r&&(this._originMediaStreamTrack&&(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),a&&this._originMediaStreamTrack.stop()),r.addEventListener("ended",this._handleTrackEnded),this._originMediaStreamTrack=r,this._muted&&(this._originMediaStreamTrack.enabled=!1),this.processor&&this._processorContext&&this.processor.updateInput({track:r,context:this._processorContext}),this._mediaStreamTrack!==this._source.outputTrack?(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Pi(this,Mt.NEED_REPLACE_TRACK,this)):this._source.updateTrack(this._originMediaStreamTrack),this._getOriginVolumeLevel&&this._source.updateOriginTrack(r))}renewMediaStreamTrack(r){return Ct.resolve(void 0)}pipe(r){if(this._bypassWebAudio)throw new Ke(ce.INVALID_OPERATION,"Can not process AudioTrack when bypassWebAudio set to true.");if(this.processor===r)return r;if(r._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(r.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=r,this.processor._source=this,r.updateInput({track:this._originMediaStreamTrack,node:this._source.processSourceNode,context:this.processorContext}),r}unpipe(){var r;if(!this.processor)return;let a=this.processor;(r=this._source.processSourceNode)===null||r===void 0||r.disconnect(),this.processor._source=!1,this.processor=void 0,a.reset()}bindProcessorDestinationEvents(r){r.on(uo.ON_TRACK,async a=>{a?a!==this._mediaStreamTrack&&(this._mediaStreamTrack=a,this._updatePlayerSource(!1),this._source.processedNode=this._source.createMediaStreamSourceNode(a),await Pi(this,Mt.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Pi(this,Mt.NEED_REPLACE_TRACK,this))}),r.on(uo.ON_NODE,a=>{this._source.processedNode=a})}unbindProcessorDestinationEvents(r){r.removeAllListeners(uo.ON_TRACK),r.removeAllListeners(uo.ON_NODE)}bindProcessorContextEvents(r){r.on(Pc.REQUEST_CONSTRAINTS,async a=>{a(this._originMediaStreamTrack.getSettings())})}unbindProcessorContextEvents(r){r.removeAllListeners(Pc.REQUEST_CONSTRAINTS)}initWebAudio(){return this._trackSource instanceof $W&&(this._trackSource=new tae(this._mediaStreamTrack,!1,this._getOriginVolumeLevel?this._mediaStreamTrack:void 0)),this._trackSource}initProcessor(){let r=new uae(this._source.context,this.getTrackId(),"local"),a=new dae(r);return this._processorContext=r,this._processorDestination=a,this.bindProcessorContextEvents(r),this.bindProcessorDestinationEvents(a),this._source.on(Oc.UPDATE_SOURCE,()=>{this.processor&&this.processor.updateInput({node:this._source.processSourceNode,context:r})}),this._useAudioElement&&(this._useAudioElement=!1,this.isPlaying&&(ko.stop(this.getTrackId()),this._source.play()),Pi(this,Mt.NEED_REPLACE_MIXING_TRACK,this).then(()=>{z.debug("[".concat(this.getTrackId(),"] replace from origin track to web audio track success"))}).catch(o=>{z.warning("[".concat(this.getTrackId(),"] replace from origin track to web audio track failed"),o)})),{processorContext:r,processorDestination:a}}}).prototype,"setVolume",[gae],Object.getOwnPropertyDescriptor(pr.prototype,"setVolume"),pr.prototype),Qn(pr.prototype,"setPlaybackDevice",[vae,yae],Object.getOwnPropertyDescriptor(pr.prototype,"setPlaybackDevice"),pr.prototype),Qn(pr.prototype,"setEnabled",[_ae,Eae,wae],Object.getOwnPropertyDescriptor(pr.prototype,"setEnabled"),pr.prototype),Qn(pr.prototype,"setMuted",[Sae,bae,Cae],Object.getOwnPropertyDescriptor(pr.prototype,"setMuted"),pr.prototype),Qn(pr.prototype,"getStats",[Tae],Object.getOwnPropertyDescriptor(pr.prototype,"getStats"),pr.prototype),Qn(pr.prototype,"setAudioFrameCallback",[Rae],Object.getOwnPropertyDescriptor(pr.prototype,"setAudioFrameCallback"),pr.prototype),Qn(pr.prototype,"play",[xae,Aae],Object.getOwnPropertyDescriptor(pr.prototype,"play"),pr.prototype),Qn(pr.prototype,"stop",[Iae,Nae],Object.getOwnPropertyDescriptor(pr.prototype,"stop"),pr.prototype),Qn(pr.prototype,"close",[Oae],Object.getOwnPropertyDescriptor(pr.prototype,"close"),pr.prototype),Qn(pr.prototype,"pipe",[Pae],Object.getOwnPropertyDescriptor(pr.prototype,"pipe"),pr.prototype),Qn(pr.prototype,"unpipe",[Lae],Object.getOwnPropertyDescriptor(pr.prototype,"unpipe"),pr.prototype),pr),Qk=(Dae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),kae=Or(),Mae=ab("MicrophoneAudioTrack","_enabledMutex"),jae=hn({argsMap:(r,a,o)=>[r.getTrackId(),a,o]}),Uae=Or(),Fae=hn({argsMap:r=>[r.getTrackId()]}),Qn((Qf=class extends br{get __className__(){return"MicrophoneAudioTrack"}constructor(r,a,o,c){super(r,a.encoderConfig?qk(a.encoderConfig):{},c,ve("GET_VOLUME_OF_MUTED_AUDIO_TRACK")),qe(this,"_config",void 0),qe(this,"_deviceName","default"),qe(this,"_constraints",void 0),qe(this,"_originalConstraints",void 0),qe(this,"_enabled",!0),this._config=a,this._constraints=o,this._originalConstraints=o,this._deviceName=r.label,typeof a.bypassWebAudio=="boolean"&&(this._bypassWebAudio=a.bypassWebAudio),(ib()||hG())&&Si.bindInterruptDetectorTrack(this)}async setDevice(r){if(z.info("[".concat(this.getTrackId(),"] start set device to ").concat(r)),this._enabled)try{let a=await kc.getDeviceById(r),o={};o.audio=nr({},this._constraints),o.audio.deviceId={exact:r},this._originMediaStreamTrack.stop();let c=null;try{c=await Dc(o,this.getTrackId())}catch(f){throw z.error("[".concat(this.getTrackId(),"] setDevice failed"),f.toString()),c=await Dc({audio:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(c.getAudioTracks()[0],!1),f}await this._updateOriginMediaStreamTrack(c.getAudioTracks()[0],!1),this._deviceName=a.label,this._config.microphoneId=r,this._constraints.deviceId={exact:r}}catch(a){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),a.toString()),a}else try{let a=await kc.getDeviceById(r);this._deviceName=a.label,this._config.microphoneId=r,this._constraints.deviceId={exact:r}}catch(a){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),a.toString()),a}z.info("[".concat(this.getTrackId(),"] set device to ").concat(r," success"))}async setEnabled(r,a,o){if(a)return z.debug("[".concat(this.getTrackId(),"] setEnabled false (do not close microphone)")),await super._setEnabled(r);if(!o){if(r===this._enabled)return;this.stateCheck("enabled",r)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),r),ve("AUTO_RESET_AUDIO_ROUTE")&&(ca()||Eu())){let v=navigator.audioSession;v&&(r||(v.type="playback"),v.type="auto")}if(!r){var c;this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),(c=this._source.clonedTrack)===null||c===void 0||c.stop(),o||(this._enabled=!1);try{await Pi(this,Mt.NEED_DISABLE_TRACK,this)}catch(v){throw z.error("[".concat(this.getTrackId(),"] setEnabled false failed"),v.toString()),v}return}let f=nr({},this._constraints),g=kc.searchDeviceIdByName(this._deviceName);g&&!f.deviceId&&(f.deviceId=g);try{o||(this._enabled=!0);let v=await Dc({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(v.getAudioTracks()[0],!1),await Pi(this,Mt.NEED_ENABLE_TRACK,this)}catch(v){throw o||(this._enabled=!1),z.error("[".concat(this.getTrackId(),"] setEnabled true failed"),v.toString()),v}z.info("[".concat(this.getTrackId(),"] setEnabled success"))}close(){super.close(),(ib()||hG())&&Si.unbindInterruptDetectorTrack(this)}onTrackEnded(){if((ca()||Eu())&&this._enabled&&!this._isClosed&&Si.duringInterruption){let r=async()=>{Si.off(Bs.IOS_INTERRUPTION_END,r),this._enabled&&!this._isClosed&&(z.debug("[".concat(this.getTrackId(),"] try capture microphone media device for interrupted iOS device.")),await this.setEnabled(!1),await this.setEnabled(!0))};Si.on(Bs.IOS_INTERRUPTION_END,r)}else z.debug("[".concat(this.getTrackId(),"] track ended")),this.safeEmit(Nb.TRACK_ENDED)}async renewMediaStreamTrack(r){let a=r||this._constraints,o=kc.searchDeviceIdByName(this._deviceName);if(o&&!a.deviceId&&(a.deviceId=o),this._constraints=a,this._enabled){this._originMediaStreamTrack.stop();let c=await Dc({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(c.getAudioTracks()[0],!0)}}bindProcessorContextEvents(r){super.bindProcessorContextEvents(r),r.on(Pc.REQUEST_UPDATE_CONSTRAINTS,async(a,o,c)=>{try{let f=Object.assign({},this._originalConstraints,...a);await this.renewMediaStreamTrack(f),o()}catch(f){c(f)}})}unbindProcessorContextEvents(r){super.unbindProcessorContextEvents(r),r.removeAllListeners(Pc.REQUEST_UPDATE_CONSTRAINTS)}}).prototype,"setDevice",[Dae,kae],Object.getOwnPropertyDescriptor(Qf.prototype,"setDevice"),Qf.prototype),Qn(Qf.prototype,"setEnabled",[Mae,jae,Uae],Object.getOwnPropertyDescriptor(Qf.prototype,"setEnabled"),Qf.prototype),Qn(Qf.prototype,"close",[Fae],Object.getOwnPropertyDescriptor(Qf.prototype,"close"),Qf.prototype),Qf),P4e=(Bae=hn({argsMap:(r,a)=>[r.getTrackId(),a,r.duration]}),Vae=Or(),zae=hn({argsMap:r=>[r.getTrackId()]}),Hae=Or(),Gae=hn({argsMap:r=>[r.getTrackId()]}),Wae=Or(),$ae=hn({argsMap:r=>[r.getTrackId()]}),Kae=Or(),qae=hn({argsMap:r=>[r.getTrackId()]}),Yae=Or(),Xae=hn({argsMap:r=>[r.getTrackId()]}),Jae=hn({argsMap:r=>[r.getTrackId()]}),Qae=Or(),Qn((Zs=class extends br{get __className__(){return"BufferSourceAudioTrack"}constructor(r,a,o,c){super(a.createOutputTrack(),o,c),qe(this,"source",void 0),qe(this,"_bufferSource",void 0),this._useAudioElement=!1,this.source=r,this._bufferSource=a,this._bufferSource.on(Oc.AUDIO_SOURCE_STATE_CHANGE,f=>{this.safeEmit(Nb.SOURCE_STATE_CHANGE,f)});try{this._mediaStreamTrack=this._source.createOutputTrack()}catch{}}get currentState(){return this._bufferSource.currentState}get duration(){return this._bufferSource.duration}get playbackSpeed(){return this._bufferSource.playbackSpeed}getCurrentTime(){return this._bufferSource.currentTime}startProcessAudioBuffer(r){r&&this._bufferSource.updateOptions(r),this._bufferSource.startProcessAudioBuffer()}pauseProcessAudioBuffer(){this._bufferSource.pauseProcessAudioBuffer()}seekAudioBuffer(r){this._bufferSource.seekAudioBuffer(r)}resumeProcessAudioBuffer(){this._bufferSource.resumeProcessAudioBuffer()}stopProcessAudioBuffer(){this._bufferSource.stopProcessAudioBuffer()}close(){this.source=null,this._bufferSource.destroy(),super.close()}setAudioBufferPlaybackSpeed(r){Ti(r,"speed",0),this._bufferSource.setAudioBufferPlaybackSpeed(r)}}).prototype,"startProcessAudioBuffer",[Bae,Vae],Object.getOwnPropertyDescriptor(Zs.prototype,"startProcessAudioBuffer"),Zs.prototype),Qn(Zs.prototype,"pauseProcessAudioBuffer",[zae,Hae],Object.getOwnPropertyDescriptor(Zs.prototype,"pauseProcessAudioBuffer"),Zs.prototype),Qn(Zs.prototype,"seekAudioBuffer",[Gae,Wae],Object.getOwnPropertyDescriptor(Zs.prototype,"seekAudioBuffer"),Zs.prototype),Qn(Zs.prototype,"resumeProcessAudioBuffer",[$ae,Kae],Object.getOwnPropertyDescriptor(Zs.prototype,"resumeProcessAudioBuffer"),Zs.prototype),Qn(Zs.prototype,"stopProcessAudioBuffer",[qae,Yae],Object.getOwnPropertyDescriptor(Zs.prototype,"stopProcessAudioBuffer"),Zs.prototype),Qn(Zs.prototype,"close",[Xae],Object.getOwnPropertyDescriptor(Zs.prototype,"close"),Zs.prototype),Qn(Zs.prototype,"setAudioBufferPlaybackSpeed",[Jae,Qae],Object.getOwnPropertyDescriptor(Zs.prototype,"setAudioBufferPlaybackSpeed"),Zs.prototype),Zs);class ss extends br{get __className__(){return"MixingAudioTrack"}get isActive(){for(let a of this.trackList)if(a._enabled&&!a._isClosed&&!a.muted)return!0;return!1}constructor(){let a=Lb().createMediaStreamDestination();super(a.stream.getAudioTracks()[0],void 0,Li(8,"track-mix-")),qe(this,"trackList",void 0),qe(this,"destNode",void 0),this._useAudioElement=!1;try{this._mediaStreamTrack=this._source.createOutputTrack()}catch{}this.destNode=a,this.trackList=[]}hasAudioTrack(a){return this.trackList.indexOf(a)!==-1}addAudioTrack(a){this.trackList.indexOf(a)===-1?(z.debug("add ".concat(a.getTrackId()," to mixing track")),a._source.outputNode.connect(this.destNode),this.trackList.push(a),this.updateEncoderConfig()):z.debug("track ".concat(a.getTrackId()," is already added"))}removeAudioTrack(a){if(this.trackList.indexOf(a)!==-1){z.debug("remove ".concat(a.getTrackId()," from mixing track"));try{a._source.outputNode.disconnect(this.destNode)}catch{}ok(this.trackList,a),this.updateEncoderConfig()}}updateEncoderConfig(){let a={};this.trackList.forEach(o=>{o._encoderConfig&&((o._encoderConfig.bitrate||0)>(a.bitrate||0)&&(a.bitrate=o._encoderConfig.bitrate),(o._encoderConfig.sampleRate||0)>(a.sampleRate||0)&&(a.sampleRate=o._encoderConfig.sampleRate),(o._encoderConfig.sampleSize||0)>(a.sampleSize||0)&&(a.sampleSize=o._encoderConfig.sampleSize),o._encoderConfig.stereo&&(a.stereo=!0))}),this._encoderConfig=a}_updateRtpTransceiver(a){this._rtpTransceiver!==a&&(this._rtpTransceiver=a,this.trackList.forEach(o=>{o instanceof ss?o.emit(S_.TRANSCEIVER_UPDATED,a):o._updateRtpTransceiver(a)}))}}class L4e extends eae{set currentState(a){a!==this._currentState&&(this._currentState=a,this.safeEmit(Oc.AUDIO_SOURCE_STATE_CHANGE,this._currentState))}get currentState(){return this._currentState}constructor(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),qe(this,"audioBuffer",void 0),qe(this,"sourceNode",void 0),qe(this,"startPlayTime",0),qe(this,"startPlayOffset",0),qe(this,"pausePlayTime",0),qe(this,"options",void 0),qe(this,"currentLoopCount",0),qe(this,"currentPlaybackSpeed",100),qe(this,"_currentState","stopped"),this.audioBuffer=a,this.options=o,this.startPlayOffset=this.options.startPlayTime||0}createWebAudioDiagram(){return this.context.createGain()}get duration(){return this.audioBuffer?this.audioBuffer.duration:0}get playbackSpeed(){return this.currentPlaybackSpeed}get currentTime(){return this.audioBuffer?this.currentState==="stopped"?0:this.currentState==="paused"?this.pausePlayTime:((this.context.currentTime-this.startPlayTime)*(this.playbackSpeed/100)+this.startPlayOffset)%this.audioBuffer.duration:0}updateOptions(a){this.currentState==="stopped"?(this.options=a,this.startPlayOffset=this.options.startPlayTime||0):z.warning("can not set audio source options")}startProcessAudioBuffer(){this.sourceNode&&this.stopProcessAudioBuffer(),this.sourceNode=this.createSourceNode(),this.startSourceNode(),this.currentState="playing"}pauseProcessAudioBuffer(){this.sourceNode&&this.currentState==="playing"&&(this.pausePlayTime=this.currentTime,this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode.buffer=null,this.sourceNode=this.createSourceNode(),this.currentState="paused")}seekAudioBuffer(a){this.sourceNode&&(this.sourceNode.onended=null,this.currentState==="playing"&&this.sourceNode.stop(),this.sourceNode=this.createSourceNode(),this.currentState==="playing"?(this.startPlayOffset=a,this.startSourceNode()):this.currentState==="paused"&&(this.pausePlayTime=a))}resumeProcessAudioBuffer(){this.currentState==="paused"&&this.sourceNode&&(this.startPlayOffset=this.pausePlayTime,this.pausePlayTime=0,this.startSourceNode(),this.currentState="playing")}stopProcessAudioBuffer(){if(this.sourceNode){this.sourceNode.onended=null;try{this.sourceNode.stop()}catch{}this.reset()}}destroy(){this.audioBuffer=null,super.destroy()}setAudioBufferPlaybackSpeed(a){this.sourceNode&&(this.currentState==="playing"&&(this.startPlayOffset=this.currentTime,this.startPlayTime=this.context.currentTime),this.sourceNode.playbackRate.value=a/100),this.currentPlaybackSpeed=a}startSourceNode(){this.sourceNode&&this.sourceNode.buffer&&(this.sourceNode.start(0,this.startPlayOffset),this.startPlayTime=this.context.currentTime,this.sourceNode.onended=this.handleSourceNodeEnded.bind(this))}createSourceNode(){let a=this.context.createBufferSource();return a.buffer=this.audioBuffer,a.loop=!!this.options.loop,a.connect(this.outputNode),a.playbackRate.value=this.currentPlaybackSpeed/100,a}handleSourceNodeEnded(){if(this.currentLoopCount+=1,this.options.cycle&&this.options.cycle>this.currentLoopCount)return this.startPlayOffset=0,this.sourceNode=void 0,void this.startProcessAudioBuffer();this.reset()}reset(){this.startPlayOffset=this.options.startPlayTime||0,this.currentState="stopped",this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),this.currentLoopCount=0}}let Zae=new Map;class qW{get rendFrameRate(){if(this.renderStats&&this.renderStats.curTs!==this.renderStats.lastTs){let a=this.renderStats.curTs-this.renderStats.lastTs,o=(this.renderStats.renderNum-this.renderStats.lastRenderNum)/a;return this.renderStats.lastRenderNum=this.renderStats.renderNum,this.renderStats.lastTs=this.renderStats.curTs,o}return 0}get videoElementStatus(){return this._videoElementStatus}set videoElementStatus(a){a!==this._videoElementStatus&&(z.debug("[".concat(this.trackId,"] video-element-status change ").concat(this._videoElementStatus," => ").concat(a)),this._videoElementStatus=a)}get videoState(){return this._videoState}set videoState(a){var o;a!==this._videoState&&(this._videoState=a,(o=this.onVideoStateChanged)===null||o===void 0||o.call(this,this.videoState))}constructor(a){qe(this,"trackId",void 0),qe(this,"config",void 0),qe(this,"onFirstVideoFrameDecoded",void 0),qe(this,"onVideoStateChanged",void 0),qe(this,"freezeTimeCounterList",[]),qe(this,"renderFreezeAccTime",0),qe(this,"isKeepLastFrame",!1),qe(this,"timeUpdatedCount",0),qe(this,"freezeTime",0),qe(this,"playbackTime",0),qe(this,"lastTimeUpdatedTime",0),qe(this,"autoplayFailed",!1),qe(this,"videoTrack",void 0),qe(this,"videoElement",void 0),qe(this,"cacheVideoElement",void 0),qe(this,"renderStats",void 0),qe(this,"_videoState",Jf.VideoStateStopped),qe(this,"videoElementCheckInterval",void 0),qe(this,"videoElementFreezeTimeout",void 0),qe(this,"_videoElementStatus",Fa.NONE),qe(this,"isGettingVideoDimensions",!1),qe(this,"startGetVideoDimensions",()=>{let o=()=>{if(this.isGettingVideoDimensions=!0,this.videoElement.videoWidth*this.videoElement.videoHeight>4)return z.debug("[".concat(this.trackId,"] current video dimensions:"),this.videoElement.videoWidth,this.videoElement.videoHeight),void(this.isGettingVideoDimensions=!1);setTimeout(o,500)};!this.isGettingVideoDimensions&&o()}),qe(this,"autoResumeAfterInterruption",()=>{this.videoTrack&&this.videoTrack.readyState==="live"&&Si.curState==="running"&&(z.debug("[track-".concat(this.trackId,"] video element paused, auto resume for ").concat(iie())),hie()?(this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):(this.videoElement.pause(),this.videoElement.play()))}),qe(this,"handleVideoEvents",o=>{switch(o.type){case"play":case"playing":this.startGetVideoDimensions(),this.videoElementStatus=Fa.PLAYING;break;case"loadeddata":if(this.videoState=Jf.VideoStateStarting,this.onFirstVideoFrameDecoded&&this.onFirstVideoFrameDecoded(),this.cacheVideoElement){try{this.cacheVideoElement.srcObject=null,this.cacheVideoElement.remove()}catch{}this.cacheVideoElement=void 0}break;case"canplay":this.videoElementStatus=Fa.CANPLAY;break;case"stalled":this.videoElementStatus=Fa.STALLED;break;case"suspend":this.videoElementStatus=Fa.SUSPEND;break;case"pause":this.videoElementStatus=Fa.PAUSED,ca()||Eu()||ys()&&this.autoplayFailed||!this.videoTrack||this.videoTrack.readyState!=="live"||(z.debug("[track-".concat(this.trackId,"] video element paused, auto resume")),this.videoElement.play());break;case"waiting":this.videoElementStatus=Fa.WAITING;break;case"abort":this.videoElementStatus=Fa.ABORT;break;case"ended":this.videoElementStatus=Fa.ENDED;break;case"emptied":this.videoElementStatus=Fa.EMPTIED;break;case"error":{let c=this.videoElement.error;c?(this.videoElementStatus=Fa.ERROR,z.error("[".concat(this.trackId,"] media error: ").concat(c.message," (").concat(c.code,")"))):z.debug("[".concat(this.trackId,"] media not been an error."));break}case"timeupdate":{let c=performance.now();if(this.timeUpdatedCount+=1,this.timeUpdatedCount<10)return void(this.lastTimeUpdatedTime=c);let f=c-this.lastTimeUpdatedTime,g=this.lastTimeUpdatedTime;if(this.lastTimeUpdatedTime=c,Pm.lastVisibleTime<Pm.lastHiddenTime||g<Pm.lastHiddenTime||g<Pm.lastVisibleTime)return;for(f>ve("VIDEO_FREEZE_DURATION")&&(this.freezeTime+=f),this.playbackTime+=f;this.playbackTime>=6e3;){this.playbackTime-=6e3;let v=Math.min(6e3,this.freezeTime);this.freezeTimeCounterList.push(v),this.freezeTime=Math.max(0,this.freezeTime-6e3)}break}}}),qe(this,"autoResumeAfterInterruptionOnIOS15_16",()=>{this.videoTrack&&this.videoTrack.readyState==="live"&&(z.debug("[track-".concat(this.trackId,"] video element paused, auto resume for ").concat(iie())),hie()?(this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):(this.videoElement.pause(),this.videoElement.play()))}),this.trackId=a.trackId,this.config=a,a.element instanceof HTMLVideoElement?this.videoElement=a.element:this.videoElement=document.createElement("video"),Si.on(Bs.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Si.on(Bs.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16)}getVideoElement(){return this.videoElement}getContainerElement(){var a;return(a=this.videoElement.parentElement)!==null&&a!==void 0?a:void 0}updateConfig(a){this.config=a,this.trackId=a.trackId,a.element!==this.videoElement&&(this.destroy(),this.videoElement=a.element),this.videoTrack&&this.initVideoElement()}updateVideoTrack(a){this.videoTrack!==a&&(this.videoTrack=a,this.initVideoElement())}play(a){let o=this.videoElement.play();o&&o.catch&&o.catch(f=>{a&&oae(a,"video",f.message,this.trackId),f.name==="NotAllowedError"?(z.warning("detected video element autoplay failed",f),this.autoplayFailed=!0,this.handleAutoPlayFailed()):z.warning("[".concat(this.trackId,"] play warning: "),f)});let c=ni();if((c.name==="Safari"&&Number(c.version)===15||ib())&&o&&o.then){let f=()=>{this.config.mirror&&(this.videoElement.style.transform="rotateY(180deg)")};o.then(f).catch(f)}}getCurrentFrame(){let a=document.createElement("canvas");a.width=this.videoElement.videoWidth,a.height=this.videoElement.videoHeight;let o=a.getContext("2d");if(!o)return z.error("create canvas context failed!"),new ImageData(2,2);o.drawImage(this.videoElement,0,0,a.width,a.height);let c=o.getImageData(0,0,a.width,a.height);return a.remove(),c}async getCurrentFrameToUint8Array(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,c=document.createElement("canvas");c.width=this.videoElement.videoWidth,c.height=this.videoElement.videoHeight;let f=c.getContext("2d");return f?(f.drawImage(this.videoElement,0,0,c.width,c.height),new Ct((g,v)=>{c.toBlob(async w=>{if(c.remove(),w){let T=await mae(w);g({buffer:T,width:c.width,height:c.height})}else v(new Ke(ce.CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED))},a,o<0?.1:o>1?1:o)})):await KW(a)}destroy(){this.renderStats=void 0,Si.off(Bs.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Si.off(Bs.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16),this.videoElement.srcObject=null,this.resetVideoElement(),this.freezeTimeCounterList=[],this.videoState=Jf.VideoStateStopped}initVideoElement(){if(this.videoElementStatus=Fa.INIT,!this.videoElementCheckInterval&&(eoe.forEach(g=>{this.videoElement.addEventListener(g,this.handleVideoEvents)}),this.videoElementCheckInterval=window.setInterval(()=>{(function(g){return g!==document.body&&document.body.contains(g)})(this.videoElement)||(this.videoElementStatus=Fa.DESTROYED)},1e3),ve("ENABLE_VIDEO_FRAME_CALLBACK"))){var a,o;let g,v=()=>{document.visibilityState==="visible"&&(document.removeEventListener("visibilitychange",v),this.videoElementFreezeTimeout=window.setTimeout(w,ve("VIDEO_FREEZE_DURATION")))},w=()=>{this.videoElementFreezeTimeout=void 0,this.videoState===Jf.VideoStateDecoding&&(document.visibilityState==="visible"?this.videoState=Jf.VideoStateFrozen:document.addEventListener("visibilitychange",v))},T=(R,A)=>{if(this.videoElementStatus===Fa.PLAYING){if(this.renderStats?(this.renderStats.renderNum++,this.renderStats.curTs=A.mediaTime):this.renderStats={lastTs:A.mediaTime,curTs:A.mediaTime,lastRenderNum:0,renderNum:0},g){let F=A.presentationTime-g.presentationTime;this.videoState===Jf.VideoStateStarting&&(this.videoState=Jf.VideoStateDecoding),this.videoState===Jf.VideoStateDecoding&&this.onVideoStateChanged&&(this.videoElementFreezeTimeout&&window.clearTimeout(this.videoElementFreezeTimeout),this.videoElementFreezeTimeout=window.setTimeout(w,ve("VIDEO_FREEZE_DURATION"))),F<ve("VIDEO_FREEZE_DURATION")&&this.videoState===Jf.VideoStateFrozen&&(this.videoState=Jf.VideoStateDecoding),F>ve("VIDEO_FREEZE_DURATION")&&Pm.lastVisibleTime>=Pm.lastHiddenTime&&g.timestamp>Pm.lastVisibleTime&&g.timestamp>Pm.lastHiddenTime&&(this.renderFreezeAccTime+=F)}g=nr(nr({},A),{},{timestamp:R})}var L,U;ve("ENABLE_VIDEO_FRAME_CALLBACK")&&((L=(U=this.videoElement).requestVideoFrameCallback)===null||L===void 0||L.call(U,T))};(a=(o=this.videoElement).requestVideoFrameCallback)===null||a===void 0||a.call(o,T)}this.videoElement.controls=!1,this.videoElement.setAttribute("playsinline",""),ak()&&!ve("HIDE_NO_POSTER")&&(this.videoElement.poster="noposter");let c=ni();c.name==="Safari"&&Number(c.version)===15||ib()||!this.config.mirror||(this.videoElement.style.transform="rotateY(180deg)"),this.config.fit?this.videoElement.style.objectFit=this.config.fit:this.videoElement.style.objectFit="cover",this.videoElement.setAttribute("muted",""),this.videoElement.muted=!0,this.videoElement.srcObject&&this.videoElement.srcObject instanceof MediaStream?this.videoElement.srcObject.getVideoTracks()[0]!==this.videoTrack&&(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,Oi()&&this.videoElement.load()):(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,Oi()&&this.videoElement.load());let f=this.videoElement.play();f!==void 0&&f.catch(g=>{z.debug("[".concat(this.trackId,"] playback interrupted"),g.toString())})}resetVideoElement(){eoe.forEach(a=>{this.videoElement&&this.videoElement.removeEventListener(a,this.handleVideoEvents)}),this.videoElementCheckInterval&&(window.clearInterval(this.videoElementCheckInterval),this.videoElementCheckInterval=void 0),this.videoElementStatus=Fa.NONE}handleAutoPlayFailed(){let a=o=>{o.preventDefault(),this.videoElement.play().then(()=>{z.debug("[".concat(this.trackId,"] Video element for trackId:").concat(this.trackId," autoplay resumed."))}).catch(c=>{z.error(c)}),this.autoplayFailed=!1,MI()?document.body.removeEventListener("click",a,!0):(document.body.removeEventListener("touchstart",a,!0),document.body.removeEventListener("mousedown",a,!0))};MI()?document.body.addEventListener("click",a,!0):(document.body.addEventListener("touchstart",a,!0),document.body.addEventListener("mousedown",a,!0)),aae()}}let eoe=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","timeupdate","error"];class toe extends qW{constructor(a){super(a),qe(this,"container",void 0),qe(this,"slot",void 0),this.slot=a.element,this.updateConfig(a)}updateConfig(a){this.config=a,this.trackId=a.trackId;let o=a.element;o!==this.slot&&(this.destroy(),this.slot=o),this.createElements()}updateVideoTrack(a){this.videoTrack!==a&&(this.videoTrack=a,this.createElements())}play(a){var o;(o=this.container)!==null&&o!==void 0&&o.contains(this.videoElement)&&super.play(a)}getCurrentFrame(){var a;return(a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)?super.getCurrentFrame():new ImageData(2,2)}async getCurrentFrameToUint8Array(a){var o;let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return(o=this.container)!==null&&o!==void 0&&o.contains(this.videoElement)?await super.getCurrentFrameToUint8Array(a,c):await KW(a)}destroy(){if(super.destroy(),this.videoElement.remove(),this.videoElement=document.createElement("video"),this.container){try{this.container.remove(),this.slot.removeChild(this.container)}catch{}this.container=void 0}}createElements(){this.container||(this.container=document.createElement("div")),this.container.id="agora-video-player-".concat(this.trackId),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="relative",this.container.style.overflow="hidden",this.videoTrack?(this.container.style.backgroundColor="black",ve("KEEP_LAST_FRAME")&&this.isKeepLastFrame&&this.videoElement.paused&&this.resetVideoElement(),this.mountedVideoElement()):this.unmountedVideoElement(),this.slot.appendChild(this.container)}mountedVideoElement(){var a;!this.container||(a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)||this.container.appendChild(this.videoElement),super.initVideoElement(),this.videoElement.id="video_".concat(this.trackId),this.videoElement.className="agora_video_player",this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.style.left="0",this.videoElement.style.top="0"}unmountedVideoElement(){var a;if((a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)){super.resetVideoElement();try{this.container&&this.container.removeChild(this.videoElement)}catch{}this.videoElement=document.createElement("video")}}resetVideoElement(){var a;(a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)&&(super.resetVideoElement(),this.cacheVideoElement=this.videoElement,this.videoElement=document.createElement("video"))}getContainerElement(){return this.container}}var noe,ioe,roe,soe,aoe,ooe,loe,coe,doe,uoe,hoe,foe,poe,moe,goe,voe,yoe,_oe,Eoe,woe,Soe,boe,Coe,Toe,Roe,Wn,xoe,Aoe,Ioe,Noe,Ooe,Poe,Loe,Doe,jc;let Di=(noe=hn({argsMap:(r,a,o)=>[r.getTrackId(),typeof a=="string"?a:a instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement",o]}),ioe=Or(),roe=hn({argsMap:r=>[r.getTrackId()]}),soe=ab("LocalVideoTrack","_enabledMutex"),aoe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),ooe=Or(),loe=ab("LocalVideoTrack","_enabledMutex"),coe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),doe=Or(),uoe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),hoe=Or(),foe=Or(),poe=hn({argsMap:(r,a,o)=>[r.getTrackId(),a,o]}),moe=Or(),goe=Or(),voe=Or(),yoe=Or(),_oe=Or(),Eoe=Or(),woe=Or(),Soe=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),boe=hn({argsMap:r=>[r.getTrackId()]}),Coe=hn({argsMap:r=>[r.getTrackId()]}),Toe=hn({argsMap:(r,a,o)=>[r.getTrackId(),a.label,o]}),Roe=hn(),Wn=class H0e extends Pb{get videoHeight(){if(ys()){let{height:a}=this._mediaStreamTrack.getSettings();return this._videoHeight=a,this._videoHeight}return this._videoHeight}get videoWidth(){if(ys()){let{width:a}=this._mediaStreamTrack.getSettings();return this._videoWidth=a,this._videoWidth}return this._videoWidth}get isPlaying(){return!(!this._player||this._player.videoElementStatus!==Fa.PLAYING)}get processorDestination(){return this._processorDestination}get processorContext(){return this._processorContext}set processorContext(a){this._processorContext=a}get __className__(){return"LocalVideoTrack"}constructor(a,o,c,f,g,v){if(super(a,g),qe(this,"trackMediaType","video"),qe(this,"_player",void 0),qe(this,"isUseScaleResolutionDownBy",!1),qe(this,"_videoVisibleTimer",null),qe(this,"_statsTimer",null),qe(this,"_previousVideoVisibleStatus",void 0),qe(this,"_clearPreviousVideoVisibleStatus",()=>this._previousVideoVisibleStatus=void 0),qe(this,"_encoderConfig",void 0),qe(this,"_scalabilityMode",{numSpatialLayers:1,numTemporalLayers:1}),qe(this,"_optimizationMode",void 0),qe(this,"_videoHeight",void 0),qe(this,"_videoWidth",void 0),qe(this,"_forceBitrateLimit",void 0),qe(this,"_enabled",!0),qe(this,"_processorDestination",void 0),qe(this,"_processorContext",void 0),ys()){let{width:w,height:T}=a.getSettings();this._videoWidth=w,this._videoHeight=T}else this.updateMediaStreamTrackResolution();if(this._encoderConfig=o,this._scalabilityMode=c,this._optimizationMode=f,this._hints=v||[],this._hints.indexOf(Hi.SCREEN_TRACK)===-1)this.updateBitrateFromProfile();else if(function(w,T,R){let A=ni();return!(A.name!==w||!A.osVersion)&&Number(A.version)===T}(pi.CHROME,115)&&rk().indexOf("Windows")!==-1){let w=function(T,R){if("VideoFrame"in window&&"TransformStream"in window&&Jn().supportWebRTCInsertableStream){let A=new MediaStreamTrackProcessor(T),L=new MediaStreamTrackGenerator({kind:"video"}),U,F,Z=Date.now(),W=()=>{K&&(clearInterval(K),K=void 0),U&&(U.close(),U=void 0),T.stop(),F=void 0,L.removeEventListener("ended",W)},K=window.setInterval(()=>{if(F&&U&&Date.now()-Z>1e3)try{L.readyState==="live"?F.enqueue(U.clone()):W()}catch{W()}},1e3),oe=new TransformStream({transform:(ue,xe)=>{L.readyState==="live"?(F=xe,Z=Date.now(),U===void 0?(U=ue,xe.enqueue(ue.clone())):(xe.enqueue(U),U=ue)):ue.close()}});return L.addEventListener("ended",W),A.readable.pipeThrough(oe).pipeTo(L.writable),L}}(a);w&&(z.info("local screen video track begin to inject frame"),this._mediaStreamTrack=w)}o&&this._hints.indexOf(Hi.CUSTOM_TRACK)!==-1&&this.setEncoderConfiguration(o),this._processorContext=new cae(this.getTrackId(),"local"),this._processorDestination=new lae(this.processorContext),this.bindProcessorDestinationEvents()}play(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof a=="string"){let f=document.getElementById(a);f?a=f:(z.warning("[".concat(this.getTrackId(),'] can not find "#').concat(a,'" element, use document.body')),a=document.body)}z.debug("[".concat(this.getTrackId(),"] start video playback in ").concat(a instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement"),JSON.stringify(o));let c=nr(nr(nr({},this._getDefaultPlayerConfig()),o),{},{trackId:this.getTrackId(),element:a});this._player?this._player.updateConfig(c):(a instanceof HTMLVideoElement?this._player=new qW(c):this._player=new toe(c),this._player.updateVideoTrack(this._mediaStreamTrack)),this._player.play(),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval(()=>{try{let f=this.getVideoElementVisibleStatus();this.safeEmit(Nb.VIDEO_ELEMENT_VISIBLE_STATUS,f)}catch{}},ve("CHECK_VIDEO_VISIBLE_INTERVAL"))}stop(){this._player&&(this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._statsTimer&&(this.isUseScaleResolutionDownBy=!1,window.clearInterval(this._statsTimer),this._statsTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,z.debug("[".concat(this.getTrackId(),"] stop video playback")))}async setEnabled(a,o){if(!o){if(a===this._enabled)return;this.stateCheck("enabled",a)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),a),!a){this._originMediaStreamTrack.enabled=!1;try{await Pi(this,Mt.NEED_DISABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled to false error"),c.toString()),c}return o||(this._enabled=!1),void z.info("[".concat(this.getTrackId(),"] setEnabled to false success"))}this._originMediaStreamTrack.enabled=!0;try{await Pi(this,Mt.NEED_ENABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled to true error"),c.toString()),c}z.info("[".concat(this.getTrackId(),"] setEnabled to true success")),o||(this._enabled=!0)}async setMuted(a){a!==this._muted&&(this.stateCheck("muted",a),this._muted=a,this._originMediaStreamTrack.enabled=!a,z.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(a)),a?await Pi(this,Mt.NEED_MUTE_TRACK,this):await Pi(this,Mt.NEED_UNMUTE_TRACK,this))}async setEncoderConfiguration(a,o){if(!this._enabled)throw new Ke(ce.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");if(a==="720p_auto"?this.startMonitorStats():this._statsTimer&&(window.clearInterval(this._statsTimer),this._statsTimer=null),a=Xf(a),this._forceBitrateLimit&&(a.bitrateMax=this._forceBitrateLimit.max_bitrate?this._forceBitrateLimit.max_bitrate:a.bitrateMax,a.bitrateMin=this._forceBitrateLimit.min_bitrate?this._forceBitrateLimit.min_bitrate:a.bitrateMin),a.width||a.height||a.frameRate){let c=Jk({encoderConfig:a});(ys()||ca()||Eu())&&(c.deviceId=void 0),z.debug("[".concat(this.getTrackId(),"] setEncoderConfiguration applyConstraints"),JSON.stringify(a),JSON.stringify(c));try{await this._originMediaStreamTrack.applyConstraints(c),this.updateMediaStreamTrackResolution()}catch(f){let g=new Ke(ce.UNEXPECTED_ERROR,f.toString());throw z.error("[".concat(this.getTrackId(),"] applyConstraints error"),g.toString()),g}}this._encoderConfig=a,this._hints.indexOf(Hi.SCREEN_TRACK)===-1&&this.updateBitrateFromProfile();try{await Pi(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(c){return c.throw(z)}}getStats(){return B0(()=>{z.warning("[deprecated] LocalVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalVideoStats instead")},"localVideoTrackGetStatsWarning"),Bl(this,Mt.GET_STATS)||nr({},BW)}async setBeautyEffect(a){z.error("LocalVideoTrack.setBeautyEffect was deprecated, please migrate to agora-extension-beauty-effect")}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}async getCurrentFrameImage(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return this._player?this._player.getCurrentFrameToUint8Array(a,o):await KW(a)}async setBitrateLimit(a){if(z.debug("[".concat(this.getTrackId(),"] set bitrate limit, ").concat(JSON.stringify(a))),a){this._forceBitrateLimit=a,this._encoderConfig&&(this._encoderConfig.bitrateMax?this._encoderConfig.bitrateMax=this._encoderConfig.bitrateMax<a.max_bitrate?this._encoderConfig.bitrateMax:a.max_bitrate:this._encoderConfig.bitrateMax=a.max_bitrate,this._encoderConfig.bitrateMin,this._encoderConfig.bitrateMin=a.min_bitrate);try{await Pi(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(o){return o.throw(z)}}}async setOptimizationMode(a){if(a!=="motion"&&a!=="detail"&&a!=="balanced")return void z.error(ce.INVALID_PARAMS,"optimization mode must be motion, detail or balanced");let o=this._optimizationMode;try{this._optimizationMode=a,await Pi(this,Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this)}catch(c){throw this._optimizationMode=o,z.error("[".concat(this.getTrackId(),"] set optimization mode failed"),c.toString()),c}z.info("[".concat(this.getTrackId(),"] set optimization mode success (").concat(a,")"))}setScalabiltyMode(a){if(a.numSpatialLayers===1&&a.numTemporalLayers!==1)return z.error(ce.INVALID_PARAMS,"scalability mode currently not supported, no SVC."),void(this._scalabilityMode={numSpatialLayers:1,numTemporalLayers:1});this._scalabilityMode=a,z.info("[".concat(this.getTrackId(),"] set scalability mode success (").concat(a,")"))}updateMediaStreamTrackResolution(){hae(this._originMediaStreamTrack).then(a=>{let[o,c]=a;this._videoHeight=c,this._videoWidth=o}).catch(ck)}_updatePlayerSource(){this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}_getDefaultPlayerConfig(){return{fit:"contain"}}async setSenderConfiguration(a){if(!this._enabled)throw new Ke(ce.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");z.debug("[".concat(this.getTrackId(),"] setSenderConfiguration applyConstraints"),JSON.stringify(a)),a=Xf(a),this._forceBitrateLimit&&(a.bitrateMax=this._forceBitrateLimit.max_bitrate?this._forceBitrateLimit.max_bitrate:a.bitrateMax,a.bitrateMin=this._forceBitrateLimit.min_bitrate?this._forceBitrateLimit.min_bitrate:a.bitrateMin),this._encoderConfig=a,this._hints.indexOf(Hi.SCREEN_TRACK)===-1&&this.updateBitrateFromProfile();try{await Pi(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(o){return o.throw(z)}}updateBitrateFromProfile(){if(!this._encoderConfig)return;let{width:a,height:o,frameRate:c}=this.getMediaStreamTrackSettings();if(!a||!o||!c)return;let{bitrateMax:f,bitrateMin:g}=this._encoderConfig;if(g==null||f==null){let{max:v,min:w}=function(T,R,A,L,U){let F=ve("BITRATE_ADAPTER_TYPE");if(F==="DEFAULT_BITRATE")return{min:L,max:U};if(U===void 0){var Z;let K=Math.floor(200*Math.pow(A/15,.6)*Math.pow(T*R/640/360,.75));U=F==="STANDARD_BITRATE"?4*K:2*K,L=(Z=L)!==null&&Z!==void 0?Z:K}else{var W;L=(W=L)!==null&&W!==void 0?W:Math.floor(U/10)}return{min:L,max:U}}(a,o,c,g,f);this._encoderConfig.bitrateMin=w,this._encoderConfig.bitrateMax=v,z.debug("[".concat(this.getTrackId(),"] update bitrate from profile, [w: ").concat(a,", h: ").concat(o,", fps: ").concat(c,"] => [brMax: ").concat(v,", brMin: ").concat(w,"]"))}}getVideoElementVisibleStatus(){try{var a,o;let c=this==null||(a=this._player)===null||a===void 0?void 0:a.getContainerElement(),f={track:this,element:this==null||(o=this._player)===null||o===void 0?void 0:o.getVideoElement(),slot:c==null?void 0:c.parentElement},{element:g,slot:v}=f;if(this.isPlaying&&g instanceof HTMLVideoElement&&v instanceof HTMLElement){let w=_ie.checkOneElementVisible(g),T=Object.assign({},w);if(T.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=T.visible;let R=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});T.visible?R.onSuccess("Video is visible"):R.onSuccess("Invisible because of ".concat(T.reason))}return T}return}catch(c){throw new Ke(ce.GET_VIDEO_ELEMENT_VISIBLE_ERROR,c.message)}}async renewMediaStreamTrack(a){}pipe(a){if(this.processor===a)return a;if(a._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(a.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=a,this.processor._source=this,a.updateInput({track:this._originMediaStreamTrack,context:this.processorContext}),a}unpipe(){if(!this.processor)return;let a=this.processor;this.processor._source=void 0,this.processor=void 0,a.reset()}close(){super.close(),this.unbindProcessorDestinationEvents(),this.unbindProcessorContextEvents(),this.unpipe(),this.processorDestination._source&&this.processorDestination._source.unpipe()}clone(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],c=this._encoderConfig;a&&(c=nr(nr({},c),Xf(a))),c=o_(c);let f=Li(8,"track-video-cloned-"),g=new H0e(o?this._mediaStreamTrack.clone():this._mediaStreamTrack,c,o_(this._scalabilityMode),this._optimizationMode,f,o_(this._hints));return a&&c&&g.setEncoderConfiguration(c),z.debug("clone video track from ".concat(this.getTrackId()," to ").concat(f,", clone ").concat(o)),g}async replaceTrack(a,o){if(!(a instanceof MediaStreamTrack))throw new Ke(ce.INVALID_PARAMS,"track should be an instance of MediaStreamTrack");if(a.kind!=="video")throw new Ke(ce.INVALID_PARAMS,"track should be a video MediaStreamTrack");await this._updateOriginMediaStreamTrack(a,o,!0),this.updateMediaStreamTrackResolution()}startMonitorStats(){if(!ys()&&!ca())return;this._statsTimer&&window.clearInterval(this._statsTimer);let a=2,o=$k[a],c=-1,f=Date.now(),g=v=>{v>2||v<0||(f=Date.now(),o=$k[v],this.setSenderConfiguration(o))};this.isUseScaleResolutionDownBy=!0,this._statsTimer=window.setInterval(()=>{let v=this.getStats(),w=Bl(this,Mt.GET_RTC_STATS);if(v.sendPackets>0&&w){c===-1&&(c=Date.now());let T=Date.now();if(T-c<1e3||T-f<ve("PROFILE_SWITCH_INTERVAL"))return;let R=v.sendFrameRate,A=.6*o.frameRate,L=.9*o.frameRate;typeof R=="number"&&R>0&&R<A?a>0&&(a--,g(a),z.debug("[".concat(this.getTrackId(),"] step down for fps ").concat(R,", switchProfile to ").concat(a))):w.OutgoingAvailableBandwidth<o.bitrateMin?a>0&&(a--,g(a),z.debug("[".concat(this.getTrackId(),"] step down for OutgoingAvailableBandwidth ").concat(w.OutgoingAvailableBandwidth,", bitrateMin ").concat(o.bitrateMin,", switchProfile to ").concat(a))):typeof R=="number"&&R>L&&a<$k.length-1&&w.OutgoingAvailableBandwidth>1.2*$k[a+1].bitrateMin&&(a++,g(a),z.debug("[".concat(this.getTrackId(),"] step up for fps ").concat(R,", OutgoingAvailableBandwidth ").concat(w.OutgoingAvailableBandwidth,", switchProfile to ").concat(a)))}},ve("CHECK_LOCAL_STATS_INTERVAL"))}sendSeiData(a){if(B0(()=>{$t.reportApiInvoke(null,{name:qr.LOCAL_VIDEO_SEND_SEI_DATA,options:[],tag:vr.TRACER}).onSuccess("")},this._mediaStreamTrack.id||this.getTrackId()),!ve("ENABLE_VIDEO_SEI")||!ve("ENABLE_ENCODED_TRANSFORM"))return void z.warning('To send/receive SEI, please call AgoraRTC.setParameter("ENABLE_VIDEO_SEI", true) before instantiate IAgoraRtcClient');if(a instanceof Uint8Array==0)return new Ke(ce.INVALID_PARAMS,"Invalid argument type, ILocalVideoTrack.sendSeiData() only accept Uint8Array argument.").throw();let o=this.getRTCRtpTransceiver();if(!o)return void z.warning("Video track is not published, SEI can not be send");let c=o.sender.getParameters();if(c.codecs.length===0)return;let f=c.codecs[0].mimeType.toLocaleLowerCase();f==="video/h264"?this.safeEmit("sei-to-send",a):z.warning("SEI is not supported by ".concat(f))}bindProcessorDestinationEvents(){this.processorDestination.on(uo.ON_TRACK,async a=>{a?a!==this._mediaStreamTrack&&(this._mediaStreamTrack=a,this._updatePlayerSource(),await Pi(this,Mt.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Pi(this,Mt.NEED_REPLACE_TRACK,this))})}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(uo.ON_TRACK)}unbindProcessorContextEvents(){this.processorContext.removeAllListeners(Pc.REQUEST_UPDATE_CONSTRAINTS),this.processorContext.removeAllListeners(Pc.REQUEST_CONSTRAINTS)}},Qn(Wn.prototype,"play",[noe,ioe],Object.getOwnPropertyDescriptor(Wn.prototype,"play"),Wn.prototype),Qn(Wn.prototype,"stop",[roe],Object.getOwnPropertyDescriptor(Wn.prototype,"stop"),Wn.prototype),Qn(Wn.prototype,"setEnabled",[soe,aoe,ooe],Object.getOwnPropertyDescriptor(Wn.prototype,"setEnabled"),Wn.prototype),Qn(Wn.prototype,"setMuted",[loe,coe,doe],Object.getOwnPropertyDescriptor(Wn.prototype,"setMuted"),Wn.prototype),Qn(Wn.prototype,"setEncoderConfiguration",[uoe,hoe],Object.getOwnPropertyDescriptor(Wn.prototype,"setEncoderConfiguration"),Wn.prototype),Qn(Wn.prototype,"getStats",[foe],Object.getOwnPropertyDescriptor(Wn.prototype,"getStats"),Wn.prototype),Qn(Wn.prototype,"setBeautyEffect",[poe,moe],Object.getOwnPropertyDescriptor(Wn.prototype,"setBeautyEffect"),Wn.prototype),Qn(Wn.prototype,"getCurrentFrameData",[goe],Object.getOwnPropertyDescriptor(Wn.prototype,"getCurrentFrameData"),Wn.prototype),Qn(Wn.prototype,"getCurrentFrameImage",[voe],Object.getOwnPropertyDescriptor(Wn.prototype,"getCurrentFrameImage"),Wn.prototype),Qn(Wn.prototype,"setBitrateLimit",[yoe],Object.getOwnPropertyDescriptor(Wn.prototype,"setBitrateLimit"),Wn.prototype),Qn(Wn.prototype,"setOptimizationMode",[_oe],Object.getOwnPropertyDescriptor(Wn.prototype,"setOptimizationMode"),Wn.prototype),Qn(Wn.prototype,"setScalabiltyMode",[Eoe],Object.getOwnPropertyDescriptor(Wn.prototype,"setScalabiltyMode"),Wn.prototype),Qn(Wn.prototype,"updateMediaStreamTrackResolution",[woe],Object.getOwnPropertyDescriptor(Wn.prototype,"updateMediaStreamTrackResolution"),Wn.prototype),Qn(Wn.prototype,"pipe",[Soe],Object.getOwnPropertyDescriptor(Wn.prototype,"pipe"),Wn.prototype),Qn(Wn.prototype,"unpipe",[boe],Object.getOwnPropertyDescriptor(Wn.prototype,"unpipe"),Wn.prototype),Qn(Wn.prototype,"close",[Coe],Object.getOwnPropertyDescriptor(Wn.prototype,"close"),Wn.prototype),Qn(Wn.prototype,"replaceTrack",[Toe],Object.getOwnPropertyDescriptor(Wn.prototype,"replaceTrack"),Wn.prototype),Qn(Wn.prototype,"startMonitorStats",[Roe],Object.getOwnPropertyDescriptor(Wn.prototype,"startMonitorStats"),Wn.prototype),Wn),YW=(xoe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Aoe=Or(),Ioe=ab("CameraVideoTrack","_enabledMutex"),Noe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Ooe=Or(),Poe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Loe=Or(),Doe=hn({argsMap:r=>[r.getTrackId()]}),jc=class G0e extends Di{get __className__(){return"CameraVideoTrack"}constructor(a,o,c,f,g,v){super(a,Xf(o.encoderConfig),f,g,v),qe(this,"_config",void 0),qe(this,"_originalConstraints",void 0),qe(this,"_constraints",void 0),qe(this,"_enabled",!0),qe(this,"_deviceName","default"),qe(this,"tryResumeVideoForIOS15_16WeChat",async()=>{(ib()||hG())&&!function(){let w=ni();if(w.os!==vs.IOS||!w.osVersion)return!1;let T=w.osVersion.split(".");return Number(T[0])===15&&Number(T[1])>=2}()&&fie()&&this._enabled&&!this._isClosed&&(z.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS 15 device on WeChat.")),await this.renewMediaStreamTrack())}),this._config=o,this._originalConstraints=c,this._constraints=c,this._deviceName=a.label,this._encoderConfig=Xf(this._config.encoderConfig),Si.on(Bs.IOS_15_16_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat),Si.on(Bs.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat),this.bindProcessorContextEvents()}async setDevice(a){return typeof a=="string"?this._setDeviceById(a):a.deviceId?this._setDeviceById(a.deviceId):a.facingMode?this._setDeviceByFacingModel(a.facingMode):void 0}async _setDeviceById(a){if(z.info("[".concat(this.getTrackId(),"] set device to ").concat(a)),this._enabled)try{let o=await kc.getDeviceById(a),c={};c.video=nr({},this._constraints),c.video.deviceId={exact:a},c.video.facingMode=void 0,this._originMediaStreamTrack.stop();let f=null;try{f=await Dc(c,this.getTrackId())}catch(g){throw z.error("[".concat(this.getTrackId(),"] setDevice failed"),g.toString()),f=await Dc({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(f.getVideoTracks()[0],!1),g}await this._updateOriginMediaStreamTrack(f.getVideoTracks()[0],!1),this.updateMediaStreamTrackResolution(),this._deviceName=o.label,this._config.cameraId=a,this._constraints.deviceId={exact:a}}catch(o){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),o.toString()),o}else try{let o=await kc.getDeviceById(a);this._deviceName=o.label,this._config.cameraId=a,this._constraints.deviceId={exact:a}}catch(o){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),o.toString()),o}z.info("[".concat(this.getTrackId(),"] setDevice success"))}async _setDeviceByFacingModel(a){z.info("[".concat(this.getTrackId(),"] set facingMode ").concat(a));let o={video:nr(nr({},this._constraints),{},{deviceId:void 0,facingMode:{exact:a}})};if(this._enabled){this._originMediaStreamTrack.stop();let c=null;try{c=await Dc(o,this.getTrackId())}catch(f){throw z.error("[".concat(this.getTrackId(),"] setDeviceByFacingModel failed"),f.toString()),c=await Dc({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(c.getVideoTracks()[0],!1),f}await this._updateOriginMediaStreamTrack(c.getVideoTracks()[0],!1),this.updateMediaStreamTrackResolution()}this._deviceName="",this._config.facingMode=a,this._config.cameraId=void 0,this._constraints=nr({},o.video),z.info("[".concat(this.getTrackId(),"] setDeviceByFacingModel success"))}async setEnabled(a,o){if(!o){if(a===this._enabled)return;this.stateCheck("enabled",a)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),a),a){try{if(this.isExternalTrack)this._originMediaStreamTrack.enabled=!0;else{let c=await Dc({video:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(c.getVideoTracks()[0],!1)}await Pi(this,Mt.NEED_ENABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled true error"),c.toString()),c}this.updateMediaStreamTrackResolution(),z.info("[".concat(this.getTrackId(),"] setEnabled to true success")),o||(this._enabled=!0)}else{this.isExternalTrack?this._originMediaStreamTrack.enabled=!1:(this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop()),o||(this._enabled=!1);try{await Pi(this,Mt.NEED_DISABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled to false error"),c.toString()),c}z.info("[".concat(this.getTrackId(),"] setEnabled to false success"))}}async setEncoderConfiguration(a,o){if(!this._enabled)throw new Ke(ce.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");a==="720p_auto"?this.startMonitorStats():this._statsTimer&&(window.clearInterval(this._statsTimer),this._statsTimer=null),a=Xf(a),this._forceBitrateLimit&&(a.bitrateMax=this._forceBitrateLimit.max_bitrate||a.bitrateMax,a.bitrateMin=this._forceBitrateLimit.min_bitrate||a.bitrateMin);let c=zi(this._config);c.encoderConfig=a;let f=Jk(c);(ys()||ca()||Eu())&&(f.deviceId=void 0),z.debug("[".concat(this.getTrackId(),"] setEncoderConfiguration applyConstraints"),JSON.stringify(a),JSON.stringify(f));try{await this._originMediaStreamTrack.applyConstraints(f),this.updateMediaStreamTrackResolution()}catch(g){let v=new Ke(ce.UNEXPECTED_ERROR,g.toString());throw z.error("[".concat(this.getTrackId(),"] applyConstraints error"),v.toString()),v}this._config=c,this._constraints=f,this._originalConstraints=f,this._encoderConfig=a,this._hints.indexOf(Hi.SCREEN_TRACK)===-1&&this.updateBitrateFromProfile();try{await Pi(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(g){return g.throw(z)}}_getDefaultPlayerConfig(){return{mirror:!0,fit:"cover"}}onTrackEnded(){if((ca()||Eu())&&this._enabled&&!this._isClosed&&Si.duringInterruption){let a=async()=>{Si.off(Bs.IOS_INTERRUPTION_END,a),this._enabled&&!this._isClosed&&(z.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS device.")),await this.setEnabled(!1),await this.setEnabled(!0))};Si.on(Bs.IOS_INTERRUPTION_END,a)}else z.debug("[".concat(this.getTrackId(),"] track ended")),this.safeEmit(Nb.TRACK_ENDED)}async renewMediaStreamTrack(a){let o=a||this._constraints,c=kc.searchDeviceIdByName(this._deviceName);if(c&&!o.deviceId&&(o.deviceId={exact:c}),this._enabled){let f=await Dc({video:o},this.getTrackId());this._constraints=o,await this._updateOriginMediaStreamTrack(f.getVideoTracks()[0],!0),this.updateMediaStreamTrackResolution()}}close(){super.close(),Si.off(Bs.IOS_15_16_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat),Si.off(Bs.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat)}clone(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],c=this._encoderConfig;a&&(c=nr(nr({},c),Xf(a))),c=o_(c);let f=Li(8,"track-cam-cloned-"),g=new G0e(o?this._mediaStreamTrack.clone():this._mediaStreamTrack,o_(nr(nr({},this._config),{},{encoderConfig:c})),o_(this._constraints),o_(this._scalabilityMode),this._optimizationMode,f);return a&&c&&g.setEncoderConfiguration(c),z.debug("clone track from ".concat(this.getTrackId()," to ").concat(f,", clone ").concat(o)),g}bindProcessorContextEvents(){this.processorContext.on(Pc.REQUEST_UPDATE_CONSTRAINTS,async(a,o,c)=>{try{let f=Object.assign({},this._originalConstraints,...a);await this.renewMediaStreamTrack(f),o()}catch(f){c(f)}}),this.processorContext.on(Pc.REQUEST_CONSTRAINTS,async a=>{a(this._originMediaStreamTrack.getSettings())})}},Qn(jc.prototype,"setDevice",[xoe,Aoe],Object.getOwnPropertyDescriptor(jc.prototype,"setDevice"),jc.prototype),Qn(jc.prototype,"setEnabled",[Ioe,Noe,Ooe],Object.getOwnPropertyDescriptor(jc.prototype,"setEnabled"),jc.prototype),Qn(jc.prototype,"setEncoderConfiguration",[Poe,Loe],Object.getOwnPropertyDescriptor(jc.prototype,"setEncoderConfiguration"),jc.prototype),Qn(jc.prototype,"close",[Doe],Object.getOwnPropertyDescriptor(jc.prototype,"close"),jc.prototype),jc);function XW(r,a,o,c){o.optimizationMode&&(c&&c.width&&c.height?(o.encoderConfig=nr(nr({},c),{},{bitrateMin:c.bitrateMin,bitrateMax:c.bitrateMax}),o.optimizationMode!=="motion"&&o.optimizationMode!=="detail"||(a.contentHint=o.optimizationMode,a.contentHint===o.optimizationMode?z.debug("[".concat(r,"] set content hint to"),o.optimizationMode):z.debug("[".concat(r,"] set content hint failed")))):z.warning("[".concat(r,"] can not apply optimization mode bitrate config, no encoderConfig")))}var koe,Moe,joe,Uoe,_d,Foe,Boe,Voe,zoe,Hoe,Goe,Ba;class Woe extends Jse{getUserId(){return this._userId}constructor(a,o,c,f){super(a,"track-".concat(a.kind,"-").concat(o,"-").concat(f.clientId,"_").concat(Li(5,""))),qe(this,"_userId",void 0),qe(this,"_uintId",void 0),qe(this,"_isDestroyed",!1),qe(this,"store",void 0),qe(this,"processor",void 0),qe(this,"processorContext",void 0),this._userId=o,this._uintId=c,this.store=f}_updateOriginMediaStreamTrack(a){this._originMediaStreamTrack=a,this._mediaStreamTrack=a,this._updatePlayerSource(),this.processor&&this.processor.updateInput({track:this._originMediaStreamTrack,context:this.processorContext})}_destroy(){this._isDestroyed=!0,z.info("[".concat(this.getTrackId(),"] is destroyed")),this.stop(),super.close()}getProcessorStats(){return this.processorContext.gatherStats()}getProcessorUsage(){return this.processorContext.gatherUsage()}}let kb=(koe=hn({argsMap:(r,a,o)=>[r.getTrackId(),typeof a=="string"?a:a instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement",o]}),Moe=hn({argsMap:r=>[r.getTrackId()]}),joe=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),Uoe=hn({argsMap:r=>[r.getTrackId()]}),Qn((_d=class extends Woe{get isPlaying(){return!(!this._player||this._player.videoElementStatus!==Fa.PLAYING)}get __className__(){return"RemoteVideoTrack"}constructor(r,a,o,c){super(r,a,o,c),qe(this,"_videoVisibleTimer",null),qe(this,"_previousVideoVisibleStatus",void 0),qe(this,"_clearPreviousVideoVisibleStatus",()=>this._previousVideoVisibleStatus=void 0),qe(this,"trackMediaType","video"),qe(this,"_videoWidth",void 0),qe(this,"_videoHeight",void 0),qe(this,"_player",void 0),qe(this,"processorDestination",void 0),qe(this,"processorContext",void 0),this.updateMediaStreamTrackResolution(),this.processorContext=new cae(this.getTrackId(),"remote"),this.processorDestination=new lae(this.processorContext),this.bindProcessorDestinationEvents()}getStats(){return B0(()=>{z.warning("[deprecated] RemoteVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteVideoStats instead")},"remoteVideoTrackGetStatsWarning"),Bl(this,Mt.GET_STATS)||nr({},Yse)}play(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof r=="string"){let c=document.getElementById(r);c?r=c:(z.warning("[".concat(this.getTrackId(),'] can not find "#').concat(r,'" element, use document.body')),r=document.body)}z.debug("[".concat(this.getTrackId(),"] start video playback in ").concat(r instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement"),JSON.stringify(a));let o=nr(nr({fit:"cover"},a),{},{trackId:this.getTrackId(),element:r});this._player?this._player.updateConfig(o):(r instanceof HTMLVideoElement?this._player=new qW(o):this._player=new toe(o),this._player.updateVideoTrack(this._mediaStreamTrack),this._player.onFirstVideoFrameDecoded=()=>{this.store.subscribe(this.getUserId(),"video",void 0,void 0,Date.now()),this.safeEmit(Ob.FIRST_FRAME_DECODED)},this._player.onVideoStateChanged=c=>{this.safeEmit(Ob.VIDEO_STATE_CHANGED,c)}),this._player.play(this.store.sessionId||void 0),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval(()=>{try{let c=this.getVideoElementVisibleStatus();this.safeEmit(Ob.VIDEO_ELEMENT_VISIBLE_STATUS,c)}catch{}},ve("CHECK_VIDEO_VISIBLE_INTERVAL"))}stop(){this._player&&(this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,z.debug("[".concat(this.getTrackId(),"] stop video playback")))}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}updateMediaStreamTrackResolution(){hae(this._originMediaStreamTrack).then(r=>{let[a,o]=r;this._videoHeight=o,this._videoWidth=a}).catch(ck)}_updatePlayerSource(){z.debug("[".concat(this.getTrackId(),"] update player source track")),this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}getVideoElementVisibleStatus(){try{var r,a;let o=this==null||(r=this._player)===null||r===void 0?void 0:r.getContainerElement(),c={track:this,element:this==null||(a=this._player)===null||a===void 0?void 0:a.getVideoElement(),slot:o==null?void 0:o.parentElement},{element:f,slot:g}=c;if(this.isPlaying&&f instanceof HTMLVideoElement&&g instanceof HTMLElement){let v=_ie.checkOneElementVisible(f),w=Object.assign({},v);if(w.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=w.visible;let T=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});w.visible?T.onSuccess("Video is visible"):T.onSuccess("Invisible because of ".concat(w.reason))}return w}return}catch(o){throw new Ke(ce.GET_VIDEO_ELEMENT_VISIBLE_ERROR,o.message)}}pipe(r){if(this.processor===r)return r;if(r._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(r.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=r,this.processor._source=this,r.updateInput({track:this._originMediaStreamTrack,context:this.processorContext}),r}unpipe(){if(!this.processor)return;let r=this.processor;this.processor._source=void 0,this.processor=void 0,r.reset()}bindProcessorDestinationEvents(){this.processorDestination.on(uo.ON_TRACK,async r=>{r?r!==this._mediaStreamTrack&&(this._mediaStreamTrack=r,this._updatePlayerSource()):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource())})}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(uo.ON_TRACK)}_destroy(){super._destroy(),this.unbindProcessorDestinationEvents()}_onSei(r){this.emit(S_.SEI_RECEIVED,r)}}).prototype,"play",[koe],Object.getOwnPropertyDescriptor(_d.prototype,"play"),_d.prototype),Qn(_d.prototype,"stop",[Moe],Object.getOwnPropertyDescriptor(_d.prototype,"stop"),_d.prototype),Qn(_d.prototype,"pipe",[joe],Object.getOwnPropertyDescriptor(_d.prototype,"pipe"),_d.prototype),Qn(_d.prototype,"unpipe",[Uoe],Object.getOwnPropertyDescriptor(_d.prototype,"unpipe"),_d.prototype),_d),Mb=(Foe=hn({argsMap:(r,a)=>[r.getTrackId(),a],throttleTime:300}),Boe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Voe=hn({argsMap:r=>[r.getTrackId()]}),zoe=hn({argsMap:r=>[r.getTrackId()]}),Hoe=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),Goe=hn({argsMap:r=>[r.getTrackId()]}),Qn((Ba=class extends Woe{get isPlaying(){return this._useAudioElement?ko.isPlaying(this.getTrackId()):this._source.isPlayed}get __className__(){return"RemoteAudioTrack"}constructor(r,a,o,c){super(r,a,o,c),qe(this,"trackMediaType","audio"),qe(this,"_source",void 0),qe(this,"_useAudioElement",!0),qe(this,"_volume",100),qe(this,"processorContext",void 0),qe(this,"processorDestination",void 0),qe(this,"_played",!1),qe(this,"_bypassWebAudio",!1),ve("DISABLE_WEBAUDIO")?(this._source=new $W,this._bypassWebAudio=!0,this._useAudioElement=!0):(this._source=new tae(r,!0),ve("REMOTE_AUDIO_TRACK_USES_WEB_AUDIO")&&(this._useAudioElement=!1)),this._source.once(Oc.RECEIVE_TRACK_BUFFER,()=>{this.safeEmit(Ob.FIRST_FRAME_DECODED)}),this.processorContext=new uae(this._source.context,this.getTrackId(),"remote"),this.processorDestination=new dae(this.processorContext),this.bindProcessorDestinationEvents(),this._source.on(Oc.UPDATE_SOURCE,()=>{this.processor&&this.processor.updateInput({node:this._source.processSourceNode,context:this.processorContext})})}setAudioFrameCallback(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4096;if(!r)return this._source.removeAllListeners(Oc.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(a),this._source.removeAllListeners(Oc.ON_AUDIO_BUFFER),this._source.on(Oc.ON_AUDIO_BUFFER,o=>r(o))}setVolume(r){this._volume=r,this._useAudioElement?ko.setVolume(this.getTrackId(),r):this._source.setVolume(r/100)}async setPlaybackDevice(r){if(!this._useAudioElement||!$se())throw new Ke(ce.NOT_SUPPORTED,"your browser does not support setting the audio output device");await ko.setSinkID(this.getTrackId(),r)}getVolumeLevel(){return this._source.getAccurateVolumeLevel()}getStats(){return B0(()=>{z.warning("[deprecated] RemoteAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteAudioStats instead")},"remoteAudioTrackGetStatsWarning"),Bl(this,Mt.GET_STATS)||nr({},qse)}play(){z.debug("[".concat(this.getTrackId(),"] start audio playback")),this._played=!0,this._useAudioElement?(z.debug("[".concat(this.getTrackId(),"] use audio element to play")),ko.play(this._mediaStreamTrack,this.getTrackId(),this._volume,this.store.sessionId||void 0)):this._source.play()}stop(){z.debug("[".concat(this.getTrackId(),"] stop audio playback")),this._played=!1,this._useAudioElement?ko.stop(this.getTrackId()):this._source.stop()}_destroy(){super._destroy(),this._played=!1,this.unbindProcessorDestinationEvents(),this._source.destroy()}_isFreeze(){return this._source.isFreeze}_updatePlayerSource(){let r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];z.debug("[".concat(this.getTrackId(),"] update player source track")),r&&this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&ko.updateTrack(this.getTrackId(),this._mediaStreamTrack)}pipe(r){if(this._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"can not pipe extension when WebAudio disabled");if(this.processor===r)return r;if(r._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(r.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=r,this.processor._source=this,r.updateInput({track:this._originMediaStreamTrack,node:this._source.processSourceNode,context:this.processorContext}),r}unpipe(){var r;if(this._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"can not unpipe extension when WebAudio disabled");if(!this.processor)return;let a=this.processor;(r=this._source.processSourceNode)===null||r===void 0||r.disconnect(),this.processor._source=!1,this.processor=void 0,a.reset()}bindProcessorDestinationEvents(){this.processorDestination.on(uo.ON_TRACK,async r=>{r?r!==this._mediaStreamTrack&&(this._mediaStreamTrack=r,this._updatePlayerSource(!1),this._source.processedNode=this._source.createMediaStreamSourceNode(r)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource())}),this.processorDestination.on(uo.ON_NODE,r=>{this._source.processedNode=r;let a=!r;this._useAudioElement!==a&&(this._played?(this.stop(),this._useAudioElement=a,this.play()):this._useAudioElement=a)})}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(uo.ON_TRACK),this.processorDestination.removeAllListeners(uo.ON_NODE)}}).prototype,"setVolume",[Foe],Object.getOwnPropertyDescriptor(Ba.prototype,"setVolume"),Ba.prototype),Qn(Ba.prototype,"setPlaybackDevice",[Boe],Object.getOwnPropertyDescriptor(Ba.prototype,"setPlaybackDevice"),Ba.prototype),Qn(Ba.prototype,"play",[Voe],Object.getOwnPropertyDescriptor(Ba.prototype,"play"),Ba.prototype),Qn(Ba.prototype,"stop",[zoe],Object.getOwnPropertyDescriptor(Ba.prototype,"stop"),Ba.prototype),Qn(Ba.prototype,"pipe",[Hoe],Object.getOwnPropertyDescriptor(Ba.prototype,"pipe"),Ba.prototype),Qn(Ba.prototype,"unpipe",[Goe],Object.getOwnPropertyDescriptor(Ba.prototype,"unpipe"),Ba.prototype),Ba),Pm=new class extends tr{get visibility(){return document.visibilityState}get lastHiddenTime(){return this._lastHiddenTime}get lastVisibleTime(){return this._lastVisibleTime}constructor(){super(),qe(this,"_lastHiddenTime",0),qe(this,"_lastVisibleTime",0),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this._lastHiddenTime=performance.now():this._lastVisibleTime=performance.now(),z.debug("document visibility went ".concat(document.visibilityState)),this.emit("VISIBILITY_CHANGE",document.visibilityState)})}};var $oe=function(r){return r[r.ONE_BYTE=0]="ONE_BYTE",r[r.TWO_BYTE=1]="TWO_BYTE",r}($oe||{});class D4e{constructor(){qe(this,"_sequence",0),qe(this,"_startTime",Date.now()),qe(this,"isUseOneByte",!0)}get startTime(){let a=Date.now()-this._startTime;return a<Math.pow(2,16)?a:(this._startTime+=Math.pow(2,16),this.startTime)}get sequence(){return this._sequence<Math.pow(2,32)?this._sequence++:(this._sequence-=Math.pow(2,32),this.sequence)}serialize(a){let o={commonPacketHeader:{length:0,reserved:0,extension:0,sequence:this.sequence},commonStreamHeader:this.startTime,extension:void 0,payload:a};if(a.byteLength>128){let w=new Uint8Array(4);w.set([1,0,0,0]);let T={id:0,length:4,data:w.buffer},R={profile:this.isUseOneByte?0:1,length:this.isUseOneByte?5:6,datas:[T]};o.commonPacketHeader.extension=1,o.extension=R,o.payload=this.compress(a),o.commonPacketHeader.length=8+(o.extension.length+2)+o.payload.byteLength}else o.commonPacketHeader.length=8+o.payload.byteLength;ve("SHOW_DATASTREAM2_LOG")&&z.debug("send data header: ".concat(JSON.stringify(o.commonPacketHeader)));let c=new ArrayBuffer(o.commonPacketHeader.length),f=new Uint8Array(c),g=new DataView(c),v=0;if(g.setUint16(v,o.commonPacketHeader.extension<<15|o.commonPacketHeader.reserved<<14|o.commonPacketHeader.length,!0),v+=2,g.setUint32(v,o.commonPacketHeader.sequence,!0),v+=4,g.setUint16(v,o.commonStreamHeader,!0),v+=2,o.extension){let w=this.serializeExtension(o.extension);f.set(new Uint8Array(w),v),v+=w.byteLength}if(f.set(new Uint8Array(o.payload),v),v+=o.payload.byteLength,v!==o.commonPacketHeader.length)throw Error("serialize error!");return c}deserialize(a){if(a.byteLength<4)return new ArrayBuffer(0);let o=new DataView(a),c=0,f=o.getUint16(c,!0);c+=2;let g={length:16383&f,reserved:(16384&f)>>14,extension:(32768&f)>>15,sequence:o.getUint16(c+2,!0)<<16|o.getUint16(c,!0)},v,w;if(c+=4,ve("SHOW_DATASTREAM2_LOG")&&z.debug("receive data header: ".concat(JSON.stringify(g))),o.getUint16(c,!0),c+=2,g.extension){w=this.deserializeExtension(a.slice(c)),c+=2+w.length,v=a.slice(c);let T=!1;if(w.datas.length>0){let R=w.datas.find(A=>A.id===0);R&&(T=(1&new DataView(R.data).getUint32(0,!0))==1)}v=T?this.decompress(v):v}else v=a.slice(8);return v}serializeExtension(a){let{profile:o,length:c,datas:f}=a,g=new ArrayBuffer(c+2),v=new Uint8Array(g),w=new DataView(g),T=0;if(w.setUint8(T++,o),w.setUint8(T++,c),f.forEach(R=>{o?(w.setUint8(T++,R.id),w.setUint8(T++,R.length),v.set(new Uint8Array(R.data),T),T+=R.data.byteLength):(w.setUint8(T++,R.id|R.length<<4),v.set(new Uint8Array(R.data),T),T+=R.data.byteLength)}),T!==c+2)throw Error("serialize extension error, is ".concat(T,"!==").concat(c+2));return g}deserializeExtension(a){let o=new DataView(a),c=0,f=o.getUint8(c);c++;let g=o.getUint8(c);c++;let v=f===$oe.TWO_BYTE,w=[],T=new DataView(a,2),R=0;for(;R<g;){let A=0,L=0,U=new ArrayBuffer(0);v?(A=T.getUint8(R),R++,L=T.getUint8(R),R++):(A=15&T.getUint8(R),L=T.getUint8(R)>>4,R++),L>0&&(U=T.buffer.slice(R+2,R+2+L),R+=U.byteLength),w.push({id:A,length:L,data:U})}if(R!==g)throw Error("parse error");return{profile:f,length:g,datas:w}}decompress(a){return _4e(new Uint8Array(a))}compress(a){return y4e(new Uint8Array(a))}}class Koe extends tr{constructor(a,o){super(),qe(this,"_version",1),qe(this,"_type",3),qe(this,"_config",void 0),qe(this,"_originDataChannel",void 0),qe(this,"_dataStreamPacketHeader",new ArrayBuffer(4)),qe(this,"_dataStreamPacketHandler",void 0),qe(this,"_datachannelEventMap",new Map),this._config=a,o&&(this._originDataChannel=o,this._bandDataChannelEvents(o)),this._initPacketHeader(),this._dataStreamPacketHandler=new D4e}get id(){return this._config.id}get ordered(){return this._config.ordered}get maxRetransmits(){return ve("DATASTREAM_MAX_RETRANSMITS")}get metadata(){return this._config.metadata}get readyState(){var a,o;return(a=(o=this._originDataChannel)===null||o===void 0?void 0:o.readyState)!==null&&a!==void 0?a:"connecting"}get _originDataChannelId(){var a,o;return(a=(o=this._originDataChannel)===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null}getChannelId(){return this.id}getConfig(){return this._config}_close(){this._originDataChannel&&(this._unbindDataChannelEvents(this._originDataChannel),this._originDataChannel=void 0)}async _waitTillOpen(){return new Ct((a,o)=>{if(this._originDataChannel){this._originDataChannel.readyState==="open"&&a();let c=setTimeout(()=>{var f;o(new Ke(ce.DATACHANNEL_CONNECTION_TIMEOUT,"Cannot create datachannel, id: ".concat((f=this._originDataChannel)===null||f===void 0?void 0:f.id)))},1e4);this._originDataChannel.onopen=()=>{clearTimeout(c),this._originDataChannel&&this._bandDataChannelEvents(this._originDataChannel),a()},this._originDataChannel.onerror=()=>{throw clearTimeout(c),new Ke(ce.DATACHANNEL_CONNECTION_TIMEOUT)}}else o(new Ke(ce.DATACHANNEL_CONNECTION_TIMEOUT,"cannot find dataChannel"))})}_updateOriginDataChannel(a){this._originDataChannel=a,this._bandDataChannelEvents(a)}_initPacketHeader(){let a=new DataView(this._dataStreamPacketHeader);a.setUint16(0,this._version),a.setUint8(2,this._type),a.setUint8(3,this._config.id)}_bandDataChannelEvents(a){this._unbindDataChannelEvents(a),[Yk.OPEN,Yk.CLOSE,Yk.ERROR].forEach(o=>{let c=()=>{this.emit(o)};this._datachannelEventMap.set(o,c),a.addEventListener(o,c)})}_unbindDataChannelEvents(a){Array.from(this._datachannelEventMap.entries()).forEach(o=>{let[c,f]=o;a.removeEventListener(c,f)}),this._datachannelEventMap.clear()}}class k4e extends Koe{constructor(a){super(a),qe(this,"_messageListener",void 0),this._messageListener=o=>{if(o.data.byteLength<this._dataStreamPacketHeader.byteLength)throw Error("invalid byteLength: the byte length must exceed "+this._dataStreamPacketHeader.byteLength);let c=o.data.slice(0,this._dataStreamPacketHeader.byteLength),f=new DataView(c).getUint8(3);if(f!==this.id)return void(ve("SHOW_DATASTREAM2_LOG")&&z.debug("invalid datachannel id: ".concat(f," !== ").concat(this.id)));let g=o.data.slice(this._dataStreamPacketHeader.byteLength);g=this._dataStreamPacketHandler.deserialize(g),this.emit(Yk.MESSAGE,g)}}_updateOriginDataChannel(a){super._updateOriginDataChannel(a),this._bandRemoteDataChannelEvents()}_close(){this._originDataChannel&&(this._originDataChannel.removeEventListener("message",this._messageListener),super._close())}_bandRemoteDataChannelEvents(){this._originDataChannel&&this._originDataChannel.addEventListener("message",this._messageListener)}}class qoe extends Koe{send(a){if(this._originDataChannel){let o=a;o=this._dataStreamPacketHandler.serialize(a);let c=new Uint8Array(this._dataStreamPacketHeader.byteLength+o.byteLength);c.set(new Uint8Array(this._dataStreamPacketHeader),0),c.set(new Uint8Array(o),this._dataStreamPacketHeader.byteLength),this._originDataChannel.send(c.buffer)}}}function Zk(){let r=new Blob([atob("ZnVuY3Rpb24gZShlKXtjb25zdCB0PW5ldyBEYXRhVmlldyhlLmRhdGEpO2lmKDA9PT10LmdldFVpbnQ4KDApJiYwPT09dC5nZXRVaW50OCgxKSYmMD09PXQuZ2V0VWludDgoMikmJjE9PT10LmdldFVpbnQ4KDMpJiY2PT09dC5nZXRVaW50OCg0KSl7bGV0IG49NixyPTAsbz0wO2Zvcig7MjU1PT09KG89dC5nZXRVaW50OChuKyspKTspcis9MjU1O3IrPW87Y29uc3QgYT1mdW5jdGlvbihlLHQsbil7bGV0IHI9bmV3IFVpbnQ4QXJyYXkoZSx0LG4pLG89W10sYT0wO2Zvcig7YTxuOylhKzM8biYmMD09PXJbYV0mJjA9PT1yW2ErMV0mJjM9PT1yW2ErMl0mJigwPT09clthKzNdfHwxPT09clthKzNdfHwyPT09clthKzNdfHwzPT09clthKzNdKT8oby5wdXNoKHJbYV0sclthKzFdLHJbYSszXSksYSs9NCk6KG8ucHVzaChyW2FdKSxhKyspO3JldHVybiBuZXcgVWludDhBcnJheShvKX0oZS5kYXRhLG4scik7cmV0dXJuIG5ldyBVaW50OEFycmF5KGEpfXJldHVybiBudWxsfWZ1bmN0aW9uIHQoZSx0KXtjb25zdCBuPWZ1bmN0aW9uKGUpe2NvbnN0IHQ9ZS5sZW5ndGg7bGV0IG49W10scj0wO2Zvcig7cjx0OylyKzI8dCYmMD09PWVbcl0mJjA9PT1lW3IrMV0mJigwPT09ZVtyKzJdfHwxPT09ZVtyKzJdfHwyPT09ZVtyKzJdfHwzPT09ZVtyKzJdKT8obi5wdXNoKGVbcl0sZVtyKzFdLDMsZVtyKzJdKSxyKz0zKToobi5wdXNoKGVbcl0pLHIrKyk7cmV0dXJuIG5ldyBVaW50OEFycmF5KG4pfSh0KSxyPW4ubGVuZ3RoLG89TWF0aC5mbG9vcihyLzI1NSksYT1yJTI1NSxzPW5ldyBVaW50OEFycmF5KDYrbysxK3IrZS5ieXRlTGVuZ3RoKTtzWzBdPTAsc1sxXT0wLHNbMl09MCxzWzNdPTEsc1s0XT02LHNbNV09MTAxO2xldCBpPTA7Zm9yKDtpPG87KXNbNitpXT0yNTUsaSsrO3JldHVybiBzWzYraV09YSxpKysscy5zZXQobiw2K2kpLHMuc2V0KG5ldyBVaW50OEFycmF5KGUpLDYraStyKSxzLmJ1ZmZlcn1uYXZpZ2F0b3IudXNlckFnZW50LmluZGV4T2YoIlNhZmFyaSIpPi0xJiYtMT09PW5hdmlnYXRvci51c2VyQWdlbnQuaW5kZXhPZigiQ2hyb21lIikmJihzZWxmLm9ucnRjdHJhbnNmb3JtPW49Pntjb25zdCByPW4udHJhbnNmb3JtZXI7bGV0IG89W107ci5vcHRpb25zLnBvcnQub25tZXNzYWdlPWU9PntlLmRhdGEuc2VpJiZvLnB1c2goZS5kYXRhLnNlaSl9LHNlbGYucG9zdE1lc3NhZ2UoInN0YXJ0ZWQiKTtjb25zdCBhPXIucmVhZGFibGUuZ2V0UmVhZGVyKCkscz1yLndyaXRhYmxlLmdldFdyaXRlcigpOyJyeCI9PT1yLm9wdGlvbnMubmFtZT9mdW5jdGlvbiB0KG4pe2EucmVhZCgpLnRoZW4oKHI9PntpZighci5kb25lKXtpZihyLnZhbHVlIGluc3RhbmNlb2YgUlRDRW5jb2RlZFZpZGVvRnJhbWUpe2NvbnN0IHQ9ZShyLnZhbHVlKTt0JiZuLm9wdGlvbnMucG9ydC5wb3N0TWVzc2FnZSh7c2VpOnR9KX1zLndyaXRlKHIudmFsdWUpLG4ub3B0aW9ucy5wb3J0LnBvc3RNZXNzYWdlKHt0cmFuc2Zvcm1lZDohMH0pLHQobil9fSkpfShyKToidHgiPT09ci5vcHRpb25zLm5hbWUmJmZ1bmN0aW9uIGUobil7YS5yZWFkKCkudGhlbigocj0+e2lmKCFyLmRvbmUpe2lmKHIudmFsdWUgaW5zdGFuY2VvZiBSVENFbmNvZGVkVmlkZW9GcmFtZSl7Y29uc3QgZT1vLnNoaWZ0KCk7ZSYmKHIudmFsdWUuZGF0YT10KHIudmFsdWUuZGF0YSxlKSl9cy53cml0ZShyLnZhbHVlKSxuLm9wdGlvbnMucG9ydC5wb3N0TWVzc2FnZSh7dHJhbnNmb3JtZWQ6ITB9KSxlKG4pfX0pKX0ocil9LHNlbGYucG9zdE1lc3NhZ2UoInJlZ2lzdGVyZWQiKSk7Cg==")],{type:"text/javascript"});return setTimeout(()=>rse.revokeObjectURL(r),0),new Worker(rse.createObjectURL(r))}let e8=new Map,t8=new Map,n8=new Map;async function M4e(r,a){if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support video encoded transform");if(n8.has(r)||!r.track)return;let o={track:r.track};if(U0()){if(!r.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let f=null;try{f=r.createEncodedStreams()}catch(w){return void z.error("create video-encoded-streams error",w&&w.message)}let g=[];a.on("sei-to-send",w=>{g.push(w)});let v=new TransformStream({transform(w,T){o.controller||(o.controller=T),r.track&&r.track.id!==o.track.id&&(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c));let R=g.shift();R&&(w.data=function(A,L){let U=function(ue){let xe=ue.length,Ne=[],ke=0;for(;ke<xe;)ke+2<xe&&ue[ke]===0&&ue[ke+1]===0&&(ue[ke+2]===0||ue[ke+2]===1||ue[ke+2]===2||ue[ke+2]===3)?(Ne.push(ue[ke],ue[ke+1],3,ue[ke+2]),ke+=3):(Ne.push(ue[ke]),ke++);return new Uint8Array(Ne)}(L),F=U.length,Z=Math.floor(F/255),W=F%255,K=new Uint8Array(6+Z+1+F+A.byteLength);K[0]=0,K[1]=0,K[2]=0,K[3]=1,K[4]=6,K[5]=101;let oe=0;for(;oe<Z;)K[6+oe]=255,oe++;return K[6+oe]=W,oe++,K.set(U,6+oe),K.set(new Uint8Array(A),6+oe+F),K.buffer}(w.data,R)),T.enqueue(w)}});f.readable.pipeThrough(v).pipeTo(f.writable)}else{if(!ys())return;{if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let f=Zk(),g=new MessageChannel;await new Ct(w=>f.onmessage=T=>{T.data==="registered"&&w(void 0)});let v=new RTCRtpScriptTransform(f,{name:"tx",port:g.port2},[g.port2]);r.transform=v,await new Ct(w=>f.onmessage=T=>{T.data==="started"&&w(void 0)}),a.on("sei-to-send",w=>{g.port1.postMessage({sei:w})}),g.port1.onmessage=w=>{var T;w.data.transformed&&r.track&&((T=r.track)===null||T===void 0?void 0:T.id)!==o.track.id&&(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c))},o.worker=f}}function c(){if(r.track){if(this.id!==r.track.id)return;r.track.removeEventListener("ended",c)}let f=n8.get(r);if(f){n8.delete(r);try{var g,v;(g=f.controller)===null||g===void 0||g.terminate(),(v=f.worker)===null||v===void 0||v.terminate()}catch(w){z.warning(w&&w.message)}}}n8.set(r,o),r.track.addEventListener("ended",c)}let _3=new Map;async function j4e(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support video encoded transform");if(!r.track)return;if(_3.has(r)){let f=_3.get(r);return void(f&&(f.onSei=a.onSei))}let o={track:r.track,onSei:a.onSei};if(U0()){if(!r.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let f=null;try{f=r.createEncodedStreams()}catch(v){return void z.error("create video-encoded-streams error",v&&v.message)}let g=new TransformStream({transform(v,w){o.controller||(o.controller=w),r.track&&r.track.id!==o.track.id&&(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c));let T=function(R){let A=new DataView(R.data);if(A.getUint8(0)===0&&A.getUint8(1)===0&&A.getUint8(2)===0&&A.getUint8(3)===1&&A.getUint8(4)===6){let L=6,U=0,F=0;for(;(F=A.getUint8(L++))===255;)U+=255;U+=F;let Z=function(W,K,oe){let ue=new Uint8Array(W,K,oe),xe=[],Ne=0;for(;Ne<oe;)Ne+3<oe&&ue[Ne]===0&&ue[Ne+1]===0&&ue[Ne+2]===3&&(ue[Ne+3]===0||ue[Ne+3]===1||ue[Ne+3]===2||ue[Ne+3]===3)?(xe.push(ue[Ne],ue[Ne+1],ue[Ne+3]),Ne+=4):(xe.push(ue[Ne]),Ne++);return new Uint8Array(xe)}(R.data,L,U);return new Uint8Array(Z)}return null}(v);T&&o.onSei&&o.onSei(T),w.enqueue(v)}});f.readable.pipeThrough(g).pipeTo(f.writable)}else if(ys()){if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let f=Zk(),g=new MessageChannel;await new Ct(w=>f.onmessage=T=>{T.data==="registered"&&w(void 0)});let v=new RTCRtpScriptTransform(f,{name:"rx",port:g.port2},[g.port2]);r.transform=v,await new Ct(w=>f.onmessage=T=>{T.data==="started"&&w(void 0)}),g.port1.onmessage=w=>{var T;w.data.transformed&&r.track&&((T=r.track)===null||T===void 0?void 0:T.id)!==o.track.id?(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c)):w.data.sei&&o.onSei&&o.onSei(w.data.sei)},o.worker=f}function c(){if(r.track){if(this.id!==r.track.id)return;r.track.removeEventListener("ended",c)}(function(f){let g=_3.get(f);if(g){_3.delete(f);try{var v,w;(v=g.controller)===null||v===void 0||v.terminate(),(w=g.worker)===null||w===void 0||w.terminate()}catch(T){z.warning(T&&T.message)}}})(r)}_3.set(r,o),r.track.addEventListener("ended",c)}(function(){let r=ni();Qs.getDisplayMedia=!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia),Qs.getStreamFromExtension=r.name===pi.CHROME&&Number(r.version)>34,Qs.supportUnifiedPlan=function(){if(!window.RTCRtpTransceiver||!("currentDirection"in RTCRtpTransceiver.prototype))return!1;let a=new RTCPeerConnection,o=!1;try{a.addTransceiver("audio"),o=!0}catch{}return a.close(),o}(),Qs.supportMinBitrate=r.name===pi.CHROME||r.name===pi.EDGE,Qs.supportSetRtpSenderParameters=function(){let a=ni();return!!(window.RTCRtpSender&&window.RTCRtpSender.prototype.setParameters&&window.RTCRtpSender.prototype.getParameters)&&(!!F0()||!(!ys()&&!sk())||a.name===pi.FIREFOX&&Number(a.version)>=64)}(),r.name===pi.SAFARI&&(Number(r.version)>=14?Qs.supportDualStream=!0:Qs.supportDualStream=!1),Qs.webAudioMediaStreamDest=function(){let a=ni();return!(a.name===pi.SAFARI&&Number(a.version)<12)}(),Qs.supportReplaceTrack=!!window.RTCRtpSender&&typeof RTCRtpSender.prototype.replaceTrack=="function",Qs.supportWebGL=typeof WebGLRenderingContext<"u",Qs.supportRequestFrame=!!window.CanvasCaptureMediaStreamTrack,F0()||(Qs.webAudioWithAEC=!0),Qs.supportShareAudio=function(){let a=ni();return(a.os===vs.WIN_10||a.os===vs.WIN_81||a.os===vs.WIN_7||a.os===vs.LINUX||a.os===vs.MAC_OS||a.os===vs.CHROMIUM_OS)&&a.name===pi.CHROME&&Number(a.version)>=74}(),Qs.supportDataChannel=!!(uG(76)||function(a){let o=ni();return!(o.name!==pi.FIREFOX||!o.osVersion)&&Number(o.version)>=a}(68)||aie(14)),Qs.supportPCSetConfiguration=function(){let a=window.RTCPeerConnection;return!Oi()&&!!a&&a.prototype.setConfiguration instanceof Function}(),Qs.supportWebRTCEncodedTransform=function(){let a=ni();return a.name==="Chrome"&&Number(a.version)>=86||a.name==="Safari"&&Number(a.version)>=15}(),Qs.supportWebRTCInsertableStream=function(){let a=ni();return(a.name===pi.CHROME||a.name===pi.EDGE)&&Number(a.version)>=94&&"MediaStreamTrackGenerator"in window&&"MediaStreamTrackProcessor"in window}(),Qs.supportRequestVideoFrameCallback="requestVideoFrameCallback"in HTMLVideoElement.prototype,Qs.supportWebCrypto=typeof window<"u"&&window.crypto!==void 0&&window.crypto.subtle!==void 0,lk(()=>{Qs.supportDualStreamEncoding=function(){let a=ni();return!!ve("DISABLE_WEBAUDIO")||a.name==="Safari"&&Number(a.version)>=14||!!(a.name==="Chrome"&&/Windows/i.test(a.os||"")&&Number(a.version)>=100&&ve("CHROME_DUAL_STREAM_USE_ENCODING"))}(),z.info("browser compatibility",JSON.stringify(Qs),JSON.stringify(r))})})();class U4e extends tr{constructor(){super(...arguments),X(this,"resultStorage",new Map)}setLocalAudioStats(a,o,c){this.record("AUDIO_INPUT_LEVEL_TOO_LOW",a,this.checkAudioInputLevel(c,o)),this.record("SEND_AUDIO_BITRATE_TOO_LOW",a,this.checkSendAudioBitrate(c,o))}setLocalVideoStats(a,o,c){this.record("SEND_VIDEO_BITRATE_TOO_LOW",a,this.checkSendVideoBitrate(c,o)),this.record("FRAMERATE_INPUT_TOO_LOW",a,this.checkFramerateInput(c,o)),this.record("FRAMERATE_SENT_TOO_LOW",a,this.checkFramerateSent(c))}setRemoteAudioStats(a,o){let c=a.getUserId();this.record("AUDIO_OUTPUT_LEVEL_TOO_LOW",c,this.checkAudioOutputLevel(o))}setRemoteVideoStats(a,o){let c=a.getUserId();this.record("RECV_VIDEO_DECODE_FAILED",c,this.checkVideoDecode(o))}record(a,o,c){if(ve("STATS_UPDATE_INTERVAL")>500)return;this.resultStorage.has(a)||this.resultStorage.set(a,{result:[],isPrevNormal:!0});let f=this.resultStorage.get(a);if(f&&(f.result.push(c),f.result.length>=5)){var g;let v=Tt(g=f.result).call(g,!0);f.isPrevNormal&&!v&&this.emit("exception",Yoe[a],a,o),!f.isPrevNormal&&v&&this.emit("exception",Yoe[a]+2e3,a+"_RECOVER",o),f.isPrevNormal=v,f.result=[]}}checkAudioOutputLevel(a){return!(a.receiveBitrate>0&&a.receiveLevel===0)}checkAudioInputLevel(a,o){return o instanceof ss&&!o.isActive||!!o.muted||a.sendVolumeLevel!==0}checkFramerateInput(a,o){let c=null;o._encoderConfig&&o._encoderConfig.frameRate&&(c=cl(o._encoderConfig.frameRate));let f=a.captureFrameRate;return!c||!f||!(c>10&&f<5||c<10&&c>=5&&f<=1)}checkFramerateSent(a){return!(a.captureFrameRate&&a.sendFrameRate&&a.captureFrameRate>5&&a.sendFrameRate<=1)}checkSendVideoBitrate(a,o){return!!o.muted||a.sendBitrate!==0}checkSendAudioBitrate(a,o){return o instanceof ss&&!o.isActive||!!o.muted||a.sendBitrate!==0}checkVideoDecode(a){return a.receiveBitrate===0||a.decodeFrameRate!==0}}let Yoe={FRAMERATE_INPUT_TOO_LOW:1001,FRAMERATE_SENT_TOO_LOW:1002,SEND_VIDEO_BITRATE_TOO_LOW:1003,RECV_VIDEO_DECODE_FAILED:1005,AUDIO_INPUT_LEVEL_TOO_LOW:2001,AUDIO_OUTPUT_LEVEL_TOO_LOW:2002,SEND_AUDIO_BITRATE_TOO_LOW:2003},ua=new class{markSubscribeStart(r,a){performance.mark("agora-web-sdk/".concat(r,"/subscribe-").concat(a))}markPublishStart(r,a){performance.mark("agora-web-sdk/".concat(r,"/publish-").concat(a))}measureFromSubscribeStart(r,a){let o=performance.getEntriesByName("agora-web-sdk/".concat(r,"/subscribe-").concat(a));if(o.length>0){let c=o[o.length-1];return Math.round(performance.now()-c.startTime)}return 0}measureFromPublishStart(r,a){let o=performance.getEntriesByName("agora-web-sdk/".concat(r,"/publish-").concat(a));if(o.length>0){let c=o[o.length-1];return Math.round(performance.now()-c.startTime)}return 0}};function JW(r,a){this.v=r,this.k=a}function Dn(r){return new JW(r,0)}var F4e=sI,B4e=vu;Ii({target:"Promise",stat:!0,forced:!0},{withResolvers:function(){var r=B4e.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}});var V4e=vu,z4e=A0;Ii({target:"Promise",stat:!0,forced:!0},{try:function(r){var a=V4e.f(this),o=z4e(r);return(o.error?a.reject:a.resolve)(o.value),a.promise}});var QW=l(F4e),Xoe=qS.f("asyncIterator"),H4e=l(Xoe);function E3(r){var a,o;function c(g,v){try{var w=r[g](v),T=w.value,R=T instanceof JW;QW.resolve(R?T.v:T).then(function(A){if(R){var L=g==="return"?"return":"next";if(!T.k||A.done)return c(L,A);A=r[L](A).value}f(w.done?"return":"normal",A)},function(A){c("throw",A)})}catch(A){f("throw",A)}}function f(g,v){switch(g){case"return":a.resolve({value:v,done:!0});break;case"throw":a.reject(v);break;default:a.resolve({value:v,done:!1})}(a=a.next)?c(a.key,a.arg):o=null}this._invoke=function(g,v){return new QW(function(w,T){var R={key:g,arg:v,resolve:w,reject:T,next:null};o?o=o.next=R:(a=o=R,c(g,v))})},typeof r.return!="function"&&(this.return=void 0)}function zl(r){return function(){return new E3(r.apply(this,arguments))}}E3.prototype[typeof JS=="function"&&H4e||"@@asyncIterator"]=function(){return this},E3.prototype.next=function(r){return this._invoke("next",r)},E3.prototype.throw=function(r){return this._invoke("throw",r)},E3.prototype.return=function(r){return this._invoke("return",r)};var Joe=l(Me.Object.getOwnPropertySymbols),G4e=Ii,W4e=Mw.indexOf,$4e=zw,ZW=re([].indexOf),Qoe=!!ZW&&1/ZW([1],1,-0)<0;G4e({target:"Array",proto:!0,forced:Qoe||!$4e("indexOf")},{indexOf:function(r){var a=arguments.length>1?arguments[1]:void 0;return Qoe?ZW(this,r,a)||0:W4e(this,r,a)}});var K4e=wc("Array").indexOf,q4e=C,Y4e=K4e,e$=Array.prototype,X4e=function(r){var a=r.indexOf;return r===e$||q4e(e$,r)&&a===e$.indexOf?Y4e:a},Zoe=l(X4e);function J4e(r,a){if(r==null)return{};var o,c,f=function(v,w){if(v==null)return{};var T,R,A={},L=Gie(v);for(R=0;R<L.length;R++)T=L[R],Zoe(w).call(w,T)>=0||(A[T]=v[T]);return A}(r,a);if(Joe){var g=Joe(r);for(c=0;c<g.length;c++)o=g[c],Zoe(a).call(a,o)>=0||Object.prototype.propertyIsEnumerable.call(r,o)&&(f[o]=r[o])}return f}var ele={exports:{}};(function(r,a){r.exports=(()=>{var o={8:(g,v,w)=>{w.r(v),w.d(v,{Parser:()=>$n,Printer:()=>Uu,parse:()=>Rn,print:()=>oi});let T=`
`,R="".concat("\r").concat(T),A=" ",L;function U(Rt){return Rt>="0"&&Rt<="9"}function F(Rt){return Rt>="!"&&Rt<="~"}function Z(Rt){return F(Rt)||Rt>="€"&&Rt<="ÿ"}function W(Rt){return Rt==="!"||Rt>="#"&&Rt<="'"||Rt>="*"&&Rt<="+"||Rt>="-"&&Rt<="."||Rt>="0"&&Rt<="9"||Rt>="A"&&Rt<="Z"||Rt>="^"&&Rt<="~"}function K(Rt){return Rt>="1"&&Rt<="9"}function oe(Rt){return Rt>="A"&&Rt<="Z"||Rt>="a"&&Rt<="z"}function ue(Rt){return Rt==="d"||Rt==="h"||Rt==="m"||Rt==="s"}function xe(Rt){return Rt>""&&Rt<" "||Rt>"\v"&&Rt<"\f"||Rt>""&&Rt<"ÿ"}function Ne(Rt){return oe(Rt)||U(Rt)||Rt==="+"||Rt==="/"}function ke(Rt){return U(Rt)||oe(Rt)||Rt==="+"||Rt==="/"||Rt==="-"||Rt==="_"}function He(Rt){return oe(Rt)||U(Rt)||Rt==="+"||Rt==="/"}function lt(Rt,q){var Ee=Object.keys(Rt);if(Object.getOwnPropertySymbols){var Ae=Object.getOwnPropertySymbols(Rt);q&&(Ae=Ae.filter(function(gt){return Object.getOwnPropertyDescriptor(Rt,gt).enumerable})),Ee.push.apply(Ee,Ae)}return Ee}function ut(Rt){for(var q=1;q<arguments.length;q++){var Ee=arguments[q]!=null?arguments[q]:{};q%2?lt(Object(Ee),!0).forEach(function(Ae){ft(Rt,Ae,Ee[Ae])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Rt,Object.getOwnPropertyDescriptors(Ee)):lt(Object(Ee)).forEach(function(Ae){Object.defineProperty(Rt,Ae,Object.getOwnPropertyDescriptor(Ee,Ae))})}return Rt}function ft(Rt,q,Ee){return q in Rt?Object.defineProperty(Rt,q,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):Rt[q]=Ee,Rt}(function(Rt){Rt.VERSION="v",Rt.ORIGIN="o",Rt.SESSION_NAME="s",Rt.INFORMATION="i",Rt.URI="u",Rt.EMAIL="e",Rt.PHONE="p",Rt.CONNECTION="c",Rt.BANDWIDTH="b",Rt.TIME="t",Rt.REPEAT="r",Rt.ZONE_ADJUSTMENTS="z",Rt.KEY="k",Rt.ATTRIBUTE="a",Rt.MEDIA="m"})(L||(L={}));class zt{consumeText(q,Ee){let Ae=Ee;for(;Ae<q.length;){let gt=q[Ae];if(gt==="\0"||gt==="\r"||gt===T)break;Ae+=1}if(Ae-Ee==0)throw new Error("Invalid text, at ".concat(q));return Ae}consumeUnicastAddress(q,Ee,Ae){return this.consumeTill(q,Ee,A)}consumeOneOrMore(q,Ee,Ae){let gt=Ee;for(;Ae(q[gt]);)gt++;if(gt-Ee==0)throw new Error("Invalid rule at ".concat(Ee,"."));return gt}consumeSpace(q,Ee){if(q[Ee]===A)return Ee+1;throw new Error("Invalid space at ".concat(Ee,"."))}consumeIP4Address(q,Ee){let Ae=Ee;for(let gt=0;gt<4;gt++)if(Ae=this.consumeDecimalUChar(q,Ae),gt!==3){if(q[Ae]!==".")throw new Error("Invalid IP4 address.");Ae++}return Ae}consumeDecimalUChar(q,Ee){let Ae=Ee;for(let bn=0;bn<3&&U(q[Ae]);bn++,Ae++);if(Ae-Ee==0)throw new Error("Invalid decimal uchar.");let gt=parseInt(q.slice(Ee,Ae));if(gt>=0&&gt<=255)return Ae;throw new Error("Invalid decimal uchar")}consumeIP6Address(q,Ee){let Ae=this.consumeHexpart(q,Ee);return q[Ae]===":"&&(Ae+=1,Ae=this.consumeIP4Address(q,Ae)),Ae}consumeHexpart(q,Ee){let Ae=Ee;if(q[Ae]===":"&&q[Ae+1]===":"){Ae+=2;try{Ae=this.consumeHexseq(q,Ae)}catch{}return Ae}if(Ae=this.consumeHexseq(q,Ae),q[Ae]===":"&&q[Ae+1]===":"){Ae+=2;try{Ae=this.consumeHexseq(q,Ae)}catch{}return Ae}return Ae}consumeHexseq(q,Ee){let Ae=Ee;for(;Ae=this.consumeHex4(q,Ae),q[Ae]===":"&&q[Ae+1]!==":";)Ae+=1;return Ae}consumeHex4(q,Ee){let Ae=0;for(;Ae<4;Ae++)if(!((gt=q[Ee+Ae])>="0"&&gt<="9"||gt>="a"&&gt<="f"||gt>="A"&&gt<="F")){if(Ae===0)throw new Error("Invalid hex 4");break}var gt;return Ee+Ae}consumeFQDN(q,Ee){let Ae=Ee;for(;U(q[Ae])||oe(q[Ae])||q[Ae]==="-"||q[Ae]===".";)Ae+=1;if(Ae-Ee<4)throw new Error("Invalid FQDN");return Ae}consumeExtnAddr(q,Ee){return this.consumeOneOrMore(q,Ee,Z)}consumeMulticastAddress(q,Ee,Ae){switch(Ae){case"IP4":case"ip4":return this.consumeIP4MulticastAddress(q,Ee);case"IP6":case"ip6":return this.consumeIP6MulticastAddress(q,Ee);default:try{return this.consumeFQDN(q,Ee)}catch{return this.consumeExtnAddr(q,Ee)}}}consumeIP6MulticastAddress(q,Ee){let Ae=this.consumeHexpart(q,Ee);return q[Ae]==="/"?this.consumeInteger(q,Ae+1):Ae}consumeIP4MulticastAddress(q,Ee){let Ae=Ee+3,gt=q.slice(Ee,Ae),bn=parseInt(gt);if(bn<224||bn>239)throw new Error("Invalid IP4 multicast address, IPv4 multicast addresses may be in the range 224.0.0.0 to 239.255.255.255.");for(let Mi=0;Mi<3;Mi++){if(q[Ae]!==".")throw new Error("Invalid IP4 multicast address.");Ae+=1,Ae=this.consumeDecimalUChar(q,Ae)}return q[Ae]==="/"&&(Ae+=1),Ae=this.consumeTTL(q,Ae),q[Ae]==="/"&&(Ae=this.consumeInteger(q,Ae)),Ae}consumeInteger(q,Ee){if(!K(q[Ee]))throw new Error("Invalid integer.");for(Ee+=1;U(q[Ee]);)Ee+=1;return Ee}consumeTTL(q,Ee){if(q[Ee]==="0")return Ee+1;if(!K(q[Ee]))throw new Error("Invalid TTL.");Ee+=1;for(let Ae=0;Ae<2&&U(q[Ee]);Ae++)Ee+=1;return Ee}consumeToken(q,Ee){return this.consumeOneOrMore(q,Ee,W)}consumeTime(q,Ee){let Ae=Ee;if(q[Ae]==="0")return Ae+1;for(K(q[Ae])&&(Ae+=1);U(q[Ae]);)Ae++;if(Ae-Ee<10)throw new Error("Invalid time");return Ae}consumeAddress(q,Ee){return this.consumeTill(q,Ee,A)}consumeTypedTime(q,Ee){let Ae=Ee;return Ae=this.consumeOneOrMore(q,Ae,U),ue(q[Ae])?Ae+1:Ae}consumeRepeatInterval(q,Ee){if(!K(q[Ee]))throw new Error("Invalid repeat interval");for(Ee+=1;U(q[Ee]);)Ee+=1;return ue(q[Ee])&&(Ee+=1),Ee}consumePort(q,Ee){return this.consumeOneOrMore(q,Ee,U)}consume(q,Ee,Ae){for(let gt=0;gt<Ae.length;gt++){if(Ee+gt>=q.length)throw new Error("consume exceeding value length");if(q[Ee+gt]!==Ae[gt])throw new Error("consume ".concat(Ae," failed at ").concat(gt))}return Ee+Ae.length}consumeTill(q,Ee,Ae){let gt=Ee;for(;gt<q.length&&(typeof Ae!="string"||q[gt]!==Ae)&&(typeof Ae!="function"||!Ae(q[gt]));)gt++;return gt}}class $n extends zt{constructor(){super(),ft(this,"records",[]),ft(this,"currentLine",0)}parse(q){let Ee=this.probeEOL(q);this.records=q.split(Ee).filter(Qr=>!!Us(Qr).call(Qr)).map(this.parseLine),this.currentLine=0;let Ae=this.parseVersion(),gt=this.parseOrigin(),bn=this.parseSessionName(),Mi=this.parseInformation(),cs=this.parseUri(),fl=this.parseEmail(),km=this.parsePhone(),R8=this.parseConnection(),x8=this.parseBandWidth(),bd=this.parseTimeFields(),d1=this.parseKey(),Wb=this.parseSessionAttribute(),Pr=this.parseMediaDescription();if(this.currentLine!==this.records.length)throw new Error("parsing failed, non exhaustive sdp lines.");return{version:Ae,origin:gt,sessionName:bn,information:Mi,uri:cs,emails:fl,phones:km,connection:R8,bandwidths:x8,timeFields:bd,key:d1,attributes:Wb,mediaDescriptions:Pr}}getCurrentRecord(){let q=this.records[this.currentLine];if(!q)throw new Error("Record doesn't exit.");return q}probeEOL(q){for(let Ee=0;Ee<q.length;Ee++)if(q[Ee]===T)return q[Ee-1]==="\r"?R:T;throw new Error("Invalid newline character.")}parseLine(q,Ee){if(q.length<2)throw new Error("Invalid sdp line, sdp line should be of form <type>=<value>.");let Ae=q[0];if(q[1]!=="=")throw new Error('Invalid sdp line, <type> should be a single character followed by an "=" sign.');return{type:Ae,value:q.slice(2),line:Ee,cur:0}}parseSessionAttribute(){let q=new Gi;for(;this.currentLine<this.records.length;){let Ee=this.getCurrentRecord();if(Ee.type!==L.ATTRIBUTE)break;let Ae={attField:this.extractOneOrMore(Ee,gt=>W(gt)&&gt!==":"),_cur:0};Ee.value[Ee.cur]===":"&&(Ee.cur+=1,Ae.attValue=this.extractOneOrMore(Ee,xe)),q.parse(Ae),this.currentLine++}return q.digest()}parseMediaAttributes(q){let Ee=new Fr(q);for(;this.currentLine<this.records.length;){let Ae=this.getCurrentRecord();if(Ae.type!==L.ATTRIBUTE)break;let gt={attField:this.extractOneOrMore(Ae,bn=>W(bn)&&bn!==":"),_cur:0};Ae.value[Ae.cur]===":"&&(Ae.cur+=1,gt.attValue=this.extractOneOrMore(Ae,xe)),Ee.parse(gt),this.currentLine++}return Ee.digest()}parseKey(){let q=this.getCurrentRecord();if(q.type===L.KEY){if(q.value==="prompt"||q.value==="clear:"||q.value==="base64:"||q.value==="uri:")return q.value;throw this.currentLine++,new Error("Invalid key.")}}parseZone(){let q=this.getCurrentRecord();if(q.type===L.ZONE_ADJUSTMENTS){let Ee=[];for(;;)try{let Ae=this.extract(q,this.consumeTime);this.consumeSpaceForRecord(q);let gt=!1;q.value[q.cur]==="-"&&(gt=!0,q.cur+=1);let bn=this.extract(q,this.consumeTypedTime);Ee.push({time:Ae,typedTime:bn,back:gt})}catch{break}if(Ee.length===0)throw new Error("Invalid zone adjustments");return this.currentLine++,Ee}return[]}parseRepeat(){let q=[];for(;;){let Ee=this.getCurrentRecord();if(Ee.type!==L.REPEAT)break;{let Ae=this.extract(Ee,this.consumeRepeatInterval),gt=this.parseTypedTime(Ee);q.push({repeatInterval:Ae,typedTimes:gt}),this.currentLine++}}return q}parseTypedTime(q){let Ee=[];for(;;)try{this.consumeSpaceForRecord(q),Ee.push(this.extract(q,this.consumeTypedTime))}catch{break}if(Ee.length===0)throw new Error("Invalid typed time.");return Ee}parseTime(){let q=this.getCurrentRecord(),Ee=this.extract(q,this.consumeTime);this.consumeSpaceForRecord(q);let Ae=this.extract(q,this.consumeTime);return this.currentLine++,{startTime:Ee,stopTime:Ae}}parseBandWidth(){let q=[];for(;this.currentLine<this.records.length;){let Ee=this.getCurrentRecord();if(Ee.type!==L.BANDWIDTH)break;{let Ae=this.extractOneOrMore(Ee,W);if(Ee.value[Ee.cur]!==":")throw new Error("Invalid bandwidth field.");Ee.cur++;let gt=this.extractOneOrMore(Ee,U);q.push({bwtype:Ae,bandwidth:gt}),this.currentLine++}}return q}parseVersion(){let q=this.getCurrentRecord();if(q.type!==L.VERSION)throw new Error("first sdp record must be version");let Ee=q.value.slice(0,this.consumeOneOrMore(q.value,0,U));if(Ee.length!==q.value.length)throw new Error('invalid proto version, "v='.concat(q.value,'"'));return this.currentLine++,Ee}parseOrigin(){let q=this.getCurrentRecord();if(q.type!==L.ORIGIN)throw new Error("second line of sdp must be origin");let Ee=this.extractOneOrMore(q,Z);this.consumeSpaceForRecord(q);let Ae=this.extractOneOrMore(q,U);this.consumeSpaceForRecord(q);let gt=this.extractOneOrMore(q,U);this.consumeSpaceForRecord(q);let bn=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let Mi=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let cs=this.extract(q,this.consumeUnicastAddress);return this.currentLine++,{username:Ee,sessId:Ae,sessVersion:gt,nettype:bn,addrtype:Mi,unicastAddress:cs}}parseSessionName(){let q=this.getCurrentRecord();if(q.type===L.SESSION_NAME){let Ee=this.extract(q,this.consumeText);return this.currentLine++,Ee}}parseInformation(){let q=this.getCurrentRecord();if(q.type!==L.INFORMATION)return;let Ee=this.extract(q,this.consumeText);return this.currentLine++,Ee}parseUri(){let q=this.getCurrentRecord();if(q.type===L.URI)return this.currentLine++,q.value}parseEmail(){let q=[];for(;;){let Ee=this.getCurrentRecord();if(Ee.type!==L.EMAIL)break;q.push(Ee.value),this.currentLine++}return q}parsePhone(){let q=[];for(;;){let Ee=this.getCurrentRecord();if(Ee.type!==L.PHONE)break;q.push(Ee.value),this.currentLine++}return q}parseConnection(){let q=this.getCurrentRecord();if(q.type===L.CONNECTION){let Ee=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let Ae=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let gt=this.extract(q,this.consumeAddress);return this.currentLine++,{nettype:Ee,addrtype:Ae,address:gt}}}parseMedia(){let q=this.getCurrentRecord(),Ee=this.extract(q,this.consumeToken);this.consumeSpaceForRecord(q);let Ae=this.extract(q,this.consumePort);q.value[q.cur]==="/"&&(q.cur+=1,Ae+=this.extract(q,this.consumeInteger)),this.consumeSpaceForRecord(q);let gt=[];for(gt.push(this.extract(q,this.consumeToken));q.value[q.cur]==="/";)q.cur+=1,gt.push(this.extract(q,this.consumeToken));if(gt.length===0)throw new Error("Invalid proto");let bn=this.parseFmt(q);return this.currentLine++,{mediaType:Ee,port:Ae,protos:gt,fmts:bn}}parseTimeFields(){let q=[];for(;this.getCurrentRecord().type===L.TIME;){let Ee=this.parseTime(),Ae=this.parseRepeat(),gt=this.parseZone();q.push({time:Ee,repeats:Ae,zones:gt})}return q}parseMediaDescription(){let q=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===L.MEDIA;){let Ee=this.parseMedia(),Ae=this.parseInformation(),gt=this.parseConnections(),bn=this.parseBandWidth(),Mi=this.parseKey(),cs=this.parseMediaAttributes(Ee);q.push({media:Ee,information:Ae,connections:gt,bandwidths:bn,key:Mi,attributes:cs})}return q}parseConnections(){let q=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===L.CONNECTION;)q.push(this.parseConnection());return q}parseFmt(q){let Ee=[];for(;;)try{this.consumeSpaceForRecord(q),Ee.push(this.extract(q,this.consumeToken))}catch{break}if(Ee.length===0)throw new Error("Invalid fmts");return Ee}extract(q,Ee){for(var Ae=arguments.length,gt=new Array(Ae>2?Ae-2:0),bn=2;bn<Ae;bn++)gt[bn-2]=arguments[bn];let Mi=Ee.call(this,q.value,q.cur,...gt),cs=q.value.slice(q.cur,Mi);return q.cur=Mi,cs}extractOneOrMore(q,Ee){let Ae=this.consumeOneOrMore(q.value,q.cur,Ee),gt=q.value.slice(q.cur,Ae);return q.cur=Ae,gt}consumeSpaceForRecord(q){if(q.value[q.cur]!==A)throw new Error("Invalid space at ".concat(q.cur,"."));q.cur+=1}}class hi extends zt{constructor(){super(...arguments),ft(this,"attributes",void 0),ft(this,"digested",!1)}extractOneOrMore(q,Ee,Ae){let gt=this.consumeOneOrMore(q.attValue,q._cur,Ee),bn=q.attValue.slice(q._cur,gt),[Mi,cs]=Ae||[];if(typeof Mi=="number"&&bn.length<Mi)throw new Error("error in length, should be more or equal than ".concat(Mi," characters."));if(typeof cs=="number"&&bn.length>cs)throw new Error("error in length, should be less or equal than ".concat(cs," characters."));return q._cur=gt,bn}consumeAttributeSpace(q){if(q.attValue[q._cur]!==A)throw new Error("Invalid space at ".concat(q._cur,"."));q._cur+=1}extract(q,Ee){if(!q.attValue)throw new Error("Nothing to extract from attValue.");for(var Ae=arguments.length,gt=new Array(Ae>2?Ae-2:0),bn=2;bn<Ae;bn++)gt[bn-2]=arguments[bn];let Mi=Ee.call(this,q.attValue,q._cur,...gt),cs=q.attValue.slice(q._cur,Mi);return q._cur=Mi,cs}atEnd(q){if(!q.attValue)throw new Error;return q._cur>=q.attValue.length}peekChar(q){if(!q.attValue)throw new Error;return q.attValue[q._cur]}peek(q,Ee){if(!q.attValue)throw new Error;for(let Ae=0;Ae<Ee.length;Ae++)if(Ee[Ae]!==q.attValue[q._cur+Ae])return!1;return!0}parseIceUfrag(q){if(this.attributes.iceUfrag)throw new Error("Invalid ice-ufrag, should be only a single line if 'a=ice-ufrag'");this.attributes.iceUfrag=this.extractOneOrMore(q,Ne,[4,256])}parseIcePwd(q){if(this.attributes.icePwd)throw new Error("Invalid ice-pwd, should be only a single line if 'a=ice-pwd'");this.attributes.icePwd=this.extractOneOrMore(q,Ne,[22,256])}parseIceOptions(q){if(this.attributes.iceOptions)throw new Error("Invalid ice-options, should be only one 'ice-options' line");let Ee=[];for(;!this.atEnd(q);){Ee.push(this.extractOneOrMore(q,Ne));try{this.consumeAttributeSpace(q)}catch(Ae){if(this.atEnd(q))break;throw Ae}}this.attributes.iceOptions=Ee}parseFingerprint(q){let Ee=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill);this.attributes.fingerprints.push({hashFunction:Ee,fingerprint:Ae})}parseExtmap(q){let Ee=this.extractOneOrMore(q,U),Ae;this.peekChar(q)==="/"&&(this.extract(q,this.consume,"/"),Ae=this.extract(q,this.consumeToken)),this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeTill,A),bn=ut(ut({entry:parseInt(Ee,10)},Ae&&{direction:Ae}),{},{extensionName:gt});this.peekChar(q)===A&&(this.consumeAttributeSpace(q),bn.extensionAttributes=this.extract(q,this.consumeTill)),this.attributes.extmaps.push(bn)}parseSetup(q){if(this.attributes.setup)throw new Error("must only be one single 'a=setup' line.");let Ee=this.extract(q,this.consumeTill);if(Ee!=="active"&&Ee!=="passive"&&Ee!=="actpass"&&Ee!=="holdconn")throw new Error("role must be one of 'active', 'passive', 'actpass', 'holdconn'.");this.attributes.setup=Ee}}class Gi extends hi{constructor(){super(...arguments),ft(this,"attributes",{unrecognized:[],groups:[],extmaps:[],fingerprints:[],identities:[]})}parse(q){if(this.digested)throw new Error("already digested");try{switch(q.attField){case"group":this.parseGroup(q);break;case"ice-lite":this.parseIceLite();break;case"ice-ufrag":this.parseIceUfrag(q);break;case"ice-pwd":this.parseIcePwd(q);break;case"ice-options":this.parseIceOptions(q);break;case"fingerprint":this.parseFingerprint(q);break;case"setup":this.parseSetup(q);break;case"tls-id":this.parseTlsId(q);break;case"identity":this.parseIdentity(q);break;case"extmap":this.parseExtmap(q);break;case"msid-semantic":this.parseMsidSemantic(q);break;default:q.ignored=!0,this.attributes.unrecognized.push(q)}}catch(Ee){throw console.error("parsing session attribute ".concat(q.attField,' error, "a=').concat(q.attField,":").concat(q.attValue,'"')),Ee}if(!q.ignored&&q.attValue&&!this.atEnd(q))throw new Error("attribute parsing error")}digest(){return this.digested=!0,this.attributes}parseGroup(q){let Ee=this.extract(q,this.consumeToken),Ae=[];for(;!this.atEnd(q)&&this.peekChar(q)===A;)this.consumeAttributeSpace(q),Ae.push(this.extract(q,this.consumeToken));this.attributes.groups.push({semantic:Ee,identificationTag:Ae})}parseIceLite(){if(this.attributes.iceLite)throw new Error("Invalid ice-lite, should be only a single line of 'a=ice-lite'");this.attributes.iceLite=!0}parseTlsId(q){if(this.attributes.tlsId)throw new Error("must be only one tld-id line");this.attributes.tlsId=this.extractOneOrMore(q,ke)}parseIdentity(q){let Ee=this.extractOneOrMore(q,He),Ae=[];for(;!this.atEnd(q)&&this.peekChar(q)===A;){this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeToken);this.extract(q,this.consume,"=");let bn=this.extractOneOrMore(q,Mi=>Mi!==A&&xe(Mi));Ae.push({name:gt,value:bn})}this.attributes.identities.push({assertionValue:Ee,extensions:Ae})}parseMsidSemantic(q){this.peekChar(q)===A&&this.consumeAttributeSpace(q);let Ee={semantic:this.extract(q,this.consumeToken),identifierList:[]};for(;;){try{this.consumeAttributeSpace(q)}catch{break}if(this.peekChar(q)==="*"){this.extract(q,this.consume,"*"),Ee.applyForAll=!0;break}{let Ae=this.extract(q,this.consumeTill,A);Ee.identifierList.push(Ae)}}this.attributes.msidSemantic=Ee}}class Fr extends hi{constructor(q){super(),ft(this,"attributes",void 0),q.protos.indexOf("RTP")!==-1||q.protos.indexOf("rtp"),this.attributes={unrecognized:[],candidates:[],extmaps:[],fingerprints:[],imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[]}}parse(q){if(this.digested)throw new Error("already digested");try{switch(q.attField){case"extmap":this.parseExtmap(q);break;case"setup":this.parseSetup(q);break;case"ice-ufrag":this.parseIceUfrag(q);break;case"ice-pwd":this.parseIcePwd(q);break;case"ice-options":this.parseIceOptions(q);break;case"candidate":this.parseCandidate(q);break;case"remote-candidate":this.parseRemoteCandidate(q);break;case"end-of-candidates":this.parseEndOfCandidates();break;case"fingerprint":this.parseFingerprint(q);break;case"rtpmap":this.parseRtpmap(q);break;case"ptime":this.parsePtime(q);break;case"maxptime":this.parseMaxPtime(q);break;case"sendrecv":case"recvonly":case"sendonly":case"inactive":this.parseDirection(q);break;case"ssrc":this.parseSSRC(q);break;case"fmtp":this.parseFmtp(q);break;case"rtcp-fb":this.parseRtcpFb(q);break;case"rtcp-mux":this.parseRTCPMux();break;case"rtcp-mux-only":this.parseRTCPMuxOnly();break;case"rtcp-rsize":this.parseRTCPRsize();break;case"rtcp":this.parseRTCP(q);break;case"mid":this.parseMid(q);break;case"msid":this.parseMsid(q);break;case"imageattr":this.parseImageAttr(q);break;case"rid":this.parseRid(q);break;case"simulcast":this.parseSimulcast(q);break;case"sctp-port":this.parseSctpPort(q);break;case"max-message-size":this.parseMaxMessageSize(q);break;case"ssrc-group":this.parseSSRCGroup(q);break;default:q.ignored=!0,this.attributes.unrecognized.push(q)}}catch(Ee){throw console.error("parsing media attribute ".concat(q.attField,' error, "a=').concat(q.attField,":").concat(q.attValue,'"')),Ee}if(!q.ignored&&q.attValue&&!this.atEnd(q))throw new Error("attribute parsing error")}parseCandidate(q){let Ee=this.extractOneOrMore(q,Ne,[1,32]);this.consumeAttributeSpace(q);let Ae=this.extractOneOrMore(q,U,[1,5]);this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q);let bn=this.extractOneOrMore(q,U,[1,10]);this.consumeAttributeSpace(q);let Mi=this.extract(q,this.consumeAddress);this.consumeAttributeSpace(q);let cs=this.extract(q,this.consumePort);this.consumeAttributeSpace(q),this.extract(q,this.consume,"typ"),this.consumeAttributeSpace(q);let fl={foundation:Ee,componentId:Ae,transport:gt,priority:bn,connectionAddress:Mi,port:cs,type:this.extract(q,this.consumeToken),extension:{}};for(this.peek(q," raddr")&&(this.extract(q,this.consume," raddr"),this.consumeAttributeSpace(q),fl.relAddr=this.extract(q,this.consumeAddress)),this.peek(q," rport")&&(this.extract(q,this.consume," rport"),this.consumeAttributeSpace(q),fl.relPort=this.extract(q,this.consumePort));this.peekChar(q)===A;){this.consumeAttributeSpace(q);let km=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q),fl.extension[km]=this.extractOneOrMore(q,F)}this.attributes.candidates.push(fl)}parseRemoteCandidate(q){let Ee=[];for(;;){let Ae=this.extractOneOrMore(q,U,[1,5]);this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeAddress);this.consumeAttributeSpace(q);let bn=this.extract(q,this.consumePort);Ee.push({componentId:Ae,connectionAddress:gt,port:bn});try{this.consumeAttributeSpace(q)}catch{break}}this.attributes.remoteCandidatesList.push(Ee)}parseEndOfCandidates(){if(this.attributes.endOfCandidates)throw new Error("must be only one line of end-of-candidates");this.attributes.endOfCandidates=!0}parseRtpmap(q){let Ee=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill,"/");this.extract(q,this.consume,"/");let gt={encodingName:Ae,clockRate:this.extractOneOrMore(q,U)};this.atEnd(q)||this.peekChar(q)!=="/"||(this.extract(q,this.consume,"/"),gt.encodingParameters=parseInt(this.extract(q,this.consumeTill),10));let bn=this.attributes.payloads.find(Mi=>Mi.payloadType===parseInt(Ee,10));bn?bn.rtpMap=gt:this.attributes.payloads.push({payloadType:parseInt(Ee,10),rtpMap:gt,rtcpFeedbacks:[]})}parsePtime(q){if(this.attributes.ptime)throw new Error("must be only one line of ptime");this.attributes.ptime=this.extract(q,this.consumeTill)}parseMaxPtime(q){if(this.attributes.maxPtime)throw new Error("must be only one line of ptime");this.attributes.maxPtime=this.extract(q,this.consumeTill)}parseDirection(q){if(this.attributes.direction)throw new Error("must be only one line of direction info");this.attributes.direction=q.attField}parseSSRC(q){let Ee=this.extractOneOrMore(q,U);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill,":"),gt;this.peekChar(q)===":"&&(this.extract(q,this.consume,":"),gt=this.extract(q,this.consumeTill));let bn=this.attributes.ssrcs.find(Mi=>Mi.ssrcId===parseInt(Ee,10));bn?bn.attributes[Ae]=gt:this.attributes.ssrcs.push({ssrcId:parseInt(Ee,10),attributes:{[Ae]:gt}})}parseFmtp(q){let Ee=this.extract(q,this.consumeTill,A);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill),gt={};Ae.split(";").forEach(Mi=>{let[cs,fl]=Mi.split("=");cs=Us(cs).call(cs);let km=typeof fl=="string"?Us(fl).call(fl):null;typeof cs=="string"&&cs.length>0&&(gt[cs]=km)});let bn=this.attributes.payloads.find(Mi=>Mi.payloadType===parseInt(Ee,10));bn?bn.fmtp={parameters:gt}:this.attributes.payloads.push({payloadType:parseInt(Ee,10),rtcpFeedbacks:[],fmtp:{parameters:gt}})}parseFmtParameters(q){let Ee={},Ae=this.extract(q,this.consumeTill,"=");q._cur++;let gt=this.extract(q,this.consumeTill,";");for(Ee[Ae]=gt;q.attValue[q._cur]===";";){let bn=this.extract(q,this.consumeTill,"=");q._cur++;let Mi=this.extract(q,this.consumeTill,";");Ee[bn]=Mi}return Ee}parseRtcpFb(q){let Ee="";Ee=this.peekChar(q)==="*"?this.extract(q,this.consume,"*"):this.extract(q,this.consumeTill,A),this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill,A),gt;if(Ae==="trr-int")gt={type:Ae,interval:this.extract(q,this.consumeTill)};else{let bn={type:Ae};this.peekChar(q)===A&&(this.consumeAttributeSpace(q),bn.parameter=this.extract(q,this.consumeToken),this.peekChar(q)===A&&(bn.additional=this.extract(q,this.consumeTill))),gt=bn}if(Ee==="*")this.attributes.rtcpFeedbackWildcards.push(gt);else{let bn=this.attributes.payloads.find(Mi=>Mi.payloadType===parseInt(Ee,10));bn?bn.rtcpFeedbacks.push(gt):this.attributes.payloads.push({payloadType:parseInt(Ee,10),rtcpFeedbacks:[gt]})}}parseRTCPMux(){if(this.attributes.rtcpMux)throw new Error("must be single line of rtcp-mux");this.attributes.rtcpMux=!0}parseRTCPMuxOnly(){if(this.attributes.rtcpMuxOnly)throw new Error("must be single line of rtcp-only");this.attributes.rtcpMuxOnly=!0}parseRTCPRsize(){if(this.attributes.rtcpRsize)throw new Error("must be single line of rtcp-rsize");this.attributes.rtcpRsize=!0}parseRTCP(q){if(this.attributes.rtcp)throw new Error("must be single line of rtcp");let Ee={port:this.extract(q,this.consumePort)};this.peekChar(q)===A&&(this.consumeAttributeSpace(q),Ee.netType=this.extractOneOrMore(q,W),this.consumeAttributeSpace(q),Ee.addressType=this.extractOneOrMore(q,W),this.consumeAttributeSpace(q),Ee.address=this.extract(q,this.consumeAddress)),this.attributes.rtcp=Ee}parseMsid(q){let Ee={id:this.extractOneOrMore(q,W,[1,64])};this.peekChar(q)===A&&(this.consumeAttributeSpace(q),Ee.appdata=this.extractOneOrMore(q,W,[1,64])),this.attributes.msids.push(Ee)}parseImageAttr(q){this.attributes.imageattr.push(q.attValue)}parseRid(q){let Ee=this.extractOneOrMore(q,gt=>oe(gt)||U(gt)||gt==="_"||gt==="-");this.consumeAttributeSpace(q);let Ae={id:Ee,direction:this.extract(q,this.consumeToken),params:[]};if(this.peekChar(q)===A){if(this.consumeAttributeSpace(q),this.peek(q,"pt=")){this.extract(q,this.consume,"pt=");let gt=[];for(;;){let bn=this.extract(q,this.consumeToken);gt.push(bn);try{this.extract(q,this.consume,",")}catch{break}}Ae.payloads=gt,this.peekChar(q)===A&&this.extract(q,this.consume,A)}for(;;){let gt=this.extract(q,this.consumeToken);switch(gt){case"depend":{let bn={type:gt,rids:this.extract(q,this.consume,"=").split(",")};Ae.params.push(bn);break}default:{let bn={type:gt};this.peekChar(q)==="="&&(this.extract(q,this.consume,"="),bn.val=this.extract(q,this.consumeTill,";")),Ae.params.push(bn)}}try{this.extract(q,this.consume,";")}catch{break}}}this.attributes.rids.push(Ae)}parseSimulcast(q){if(this.attributes.simulcast)throw new Error("must be single line of simulcast");this.attributes.simulcast=q.attValue,this.extract(q,this.consumeTill)}parseSctpPort(q){this.attributes.sctpPort=this.extractOneOrMore(q,U,[1,5])}parseMaxMessageSize(q){this.attributes.maxMessageSize=this.extractOneOrMore(q,U,[1,void 0])}digest(){return this.digested=!0,this.attributes}parseMid(q){this.attributes.mid=this.extract(q,this.consumeToken)}parseSSRCGroup(q){let Ee=this.extract(q,this.consumeToken),Ae=[];for(;;)try{this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeInteger);Ae.push(parseInt(gt,10))}catch{break}this.attributes.ssrcGroups.push({semantic:Ee,ssrcIds:Ae})}}function mr(Rt,q,Ee){return q in Rt?Object.defineProperty(Rt,q,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):Rt[q]=Ee,Rt}class Uu{constructor(){mr(this,"eol",R)}print(q,Ee){let Ae="";return Ee&&(this.eol=Ee),Ae+=this.printVersion(q.version),Ae+=this.printOrigin(q.origin),Ae+=this.printSessionName(q.sessionName),Ae+=this.printInformation(q.information),Ae+=this.printUri(q.uri),Ae+=this.printEmail(q.emails),Ae+=this.printPhone(q.phones),Ae+=this.printConnection(q.connection),Ae+=this.printBandwidth(q.bandwidths),Ae+=this.printTimeFields(q.timeFields),Ae+=this.printKey(q.key),Ae+=this.printSessionAttributes(q.attributes),Ae+=this.printMediaDescription(q.mediaDescriptions),Ae}printVersion(q){return"v=".concat(q).concat(this.eol)}printOrigin(q){return"o=".concat(q.username," ").concat(q.sessId," ").concat(q.sessVersion," ").concat(q.nettype," ").concat(q.addrtype," ").concat(q.unicastAddress).concat(this.eol)}printSessionName(q){return q?"s=".concat(q).concat(this.eol):""}printInformation(q){return q?"i=".concat(q).concat(this.eol):""}printUri(q){return q?"u=".concat(q).concat(this.eol):""}printEmail(q){let Ee="";for(let Ae of q)Ee+="e=".concat(Ae).concat(this.eol);return Ee}printPhone(q){let Ee="";for(let Ae of q)Ee+="e=".concat(Ae).concat(this.eol);return Ee}printConnection(q){return q?"c=".concat(q.nettype," ").concat(q.addrtype," ").concat(q.address).concat(this.eol):""}printBandwidth(q){let Ee="";for(let Ae of q)Ee+="b=".concat(Ae.bwtype,":").concat(Ae.bandwidth).concat(this.eol);return Ee}printTimeFields(q){let Ee="";for(let Ae of q){Ee+="t=".concat(Ae.time.startTime," ").concat(Ae.time.startTime).concat(this.eol);for(let gt of Ae.repeats)Ee+="r=".concat(gt.repeatInterval," ").concat(gt.typedTimes.join(" ")).concat(this.eol);Ae.zoneAdjustments&&(Ee+="z=",Ee+="z=".concat(Ae.zoneAdjustments.map(gt=>"".concat(gt.time," ").concat(gt.back?"-":""," ").concat(gt.typedTime)).join(" ")).concat(this.eol),Ee+=this.eol)}return Ee}printKey(q){return q?"k=".concat(q).concat(this.eol):""}printAttributes(q){let Ee="";for(let Ae of q)Ee+="a=".concat(Ae.attField).concat(Ae.attValue?":".concat(Ae.attValue):"").concat(this.eol);return Ee}printMediaDescription(q){let Ee="";for(let Ae of q)Ee+=this.printMedia(Ae.media),Ee+=this.printInformation(Ae.information),Ee+=this.printConnections(Ae.connections),Ee+=this.printBandwidth(Ae.bandwidths),Ee+=this.printKey(Ae.key),Ee+=this.printMediaAttributes(Ae);return Ee}printConnections(q){let Ee="";for(let Ae of q)Ee+=this.printConnection(Ae);return Ee}printMedia(q){return"m=".concat(q.mediaType," ").concat(q.port," ").concat(q.protos.join("/")," ").concat(q.fmts.join(" ")).concat(this.eol)}printSessionAttributes(q){return new yt(this.eol).print(q)}printMediaAttributes(q){return new Vt(this.eol).print(q)}}class at{constructor(q){mr(this,"eol",void 0),this.eol=q}printIceUfrag(q){return q===void 0?"":"a=ice-ufrag:".concat(q).concat(this.eol)}printIcePwd(q){return q===void 0?"":"a=ice-pwd:".concat(q).concat(this.eol)}printIceOptions(q){return q===void 0?"":"a=ice-options:".concat(q.join(A)).concat(this.eol)}printFingerprints(q){return q.length>0?q.map(Ee=>"a=fingerprint:".concat(Ee.hashFunction).concat(A).concat(Ee.fingerprint)).join(this.eol)+this.eol:""}printExtmap(q){return q.map(Ee=>"a=extmap:".concat(Ee.entry).concat(Ee.direction?"/".concat(Ee.direction):"").concat(A).concat(Ee.extensionName).concat(Ee.extensionAttributes?"".concat(A).concat(Ee.extensionAttributes):"").concat(this.eol)).join("")}printSetup(q){return q===void 0?"":"a=setup:".concat(q).concat(this.eol)}printUnrecognized(q){return q.map(Ee=>"a=".concat(Ee.attField).concat(Ee.attValue?":".concat(Ee.attValue):"").concat(this.eol)).join("")}}class yt extends at{print(q){let Ee="";return Ee+=this.printGroups(q.groups),Ee+=this.printMsidSemantic(q.msidSemantic),Ee+=this.printIceLite(q.iceLite),Ee+=this.printIceUfrag(q.iceUfrag),Ee+=this.printIcePwd(q.icePwd),Ee+=this.printIceOptions(q.iceOptions),Ee+=this.printFingerprints(q.fingerprints),Ee+=this.printSetup(q.setup),Ee+=this.printTlsId(q.tlsId),Ee+=this.printIdentity(q.identities),Ee+=this.printExtmap(q.extmaps),Ee+=this.printUnrecognized(q.unrecognized),Ee}printGroups(q){let Ee="";return q.length>0&&(Ee+=q.map(Ae=>"a=group:".concat(Ae.semantic).concat(Ae.identificationTag.map(gt=>"".concat(A).concat(gt)).join("")).concat(this.eol)).join("")),Ee}printIceLite(q){return q===void 0?"":"a=ice-lite"+this.eol}printTlsId(q){return q?"a=tls-id:".concat(q).concat(this.eol):""}printIdentity(q){return q.length===0?"":q.map(Ee=>"a=identity:".concat(Ee.assertionValue).concat(Ee.extensions.map(Ae=>"".concat(A).concat(Ae.name).concat(Ae.value?"=".concat(Ae.value):"")))).join(this.eol)+this.eol}printMsidSemantic(q){if(!q)return"";let Ee="a=msid-semantic:".concat(q.semantic);return q.applyForAll?Ee+="".concat(A,"*"):q.identifierList.length>0&&(Ee+=q.identifierList.map(Ae=>"".concat(A).concat(Ae))),Ee+this.eol}}class Vt extends at{print(q){let Ee=q.attributes,Ae="";return Ae+=this.printRTCP(Ee.rtcp),Ae+=this.printIceUfrag(Ee.iceUfrag),Ae+=this.printIcePwd(Ee.icePwd),Ae+=this.printIceOptions(Ee.iceOptions),Ae+=this.printCandidates(Ee.candidates),Ae+=this.printRemoteCandidatesList(Ee.remoteCandidatesList),Ae+=this.printEndOfCandidates(Ee.endOfCandidates),Ae+=this.printFingerprints(Ee.fingerprints),Ae+=this.printSetup(Ee.setup),Ae+=this.printMid(Ee.mid),Ae+=this.printExtmap(Ee.extmaps),Ae+=this.printRTPRelated(Ee),Ae+=this.printPtime(Ee.ptime),Ae+=this.printMaxPtime(Ee.maxPtime),Ae+=this.printDirection(Ee.direction),Ae+=this.printSSRCGroups(Ee.ssrcGroups),Ae+=this.printSSRC(Ee.ssrcs),Ae+=this.printRTCPMux(Ee.rtcpMux),Ae+=this.printRTCPMuxOnly(Ee.rtcpMuxOnly),Ae+=this.printRTCPRsize(Ee.rtcpRsize),Ae+=this.printMSId(Ee.msids),Ae+=this.printImageattr(Ee.imageattr),Ae+=this.printRid(Ee.rids),Ae+=this.printSimulcast(Ee.simulcast),Ae+=this.printSCTPPort(Ee.sctpPort),Ae+=this.printMaxMessageSize(Ee.maxMessageSize),Ae+=this.printUnrecognized(Ee.unrecognized),Ae}printCandidates(q){return q.map(Ee=>"a=candidate:".concat(Ee.foundation).concat(A).concat(Ee.componentId).concat(A).concat(Ee.transport).concat(A).concat(Ee.priority).concat(A).concat(Ee.connectionAddress).concat(A).concat(Ee.port).concat(A,"typ").concat(A).concat(Ee.type).concat(Ee.relAddr?"".concat(A,"raddr").concat(A).concat(Ee.relAddr):"").concat(Ee.relPort?"".concat(A,"rport").concat(A).concat(Ee.relPort):"").concat(Object.keys(Ee.extension).map(Ae=>"".concat(A).concat(Ae).concat(A).concat(Ee.extension[Ae])).join("")).concat(this.eol)).join("")}printRemoteCandidatesList(q){return q.map(Ee=>"a=remote-candidates:".concat(Ee.join(A)).concat(this.eol)).join("")}printEndOfCandidates(q){return q===void 0?"":"a=end-of-candidates"+this.eol}printRTPRelated(q){if(!q.payloads)return"";let Ee=q.payloads,Ae="";Ae+=q.rtcpFeedbackWildcards.map(gt=>this.printRTCPFeedback("*",gt)).join("");for(let gt of Ee)Ae+=this.printRtpMap(gt.payloadType,gt.rtpMap),Ae+=this.printFmtp(gt.payloadType,gt.fmtp),Ae+=gt.rtcpFeedbacks.map(bn=>this.printRTCPFeedback(gt.payloadType,bn)).join("");return Ae}printFmtp(q,Ee){if(!Ee)return"";let Ae=Object.keys(Ee.parameters);return Ae.length===1&&Ee.parameters[Ae[0]]===null?"a=fmtp:".concat(q).concat(A).concat(Ae[0]).concat(this.eol):"a=fmtp:".concat(q).concat(A).concat(Object.keys(Ee.parameters).map(gt=>"".concat(gt,"=").concat(Ee.parameters[gt])).join(";")).concat(this.eol)}printRtpMap(q,Ee){return Ee?"a=rtpmap:".concat(q).concat(A).concat(Ee.encodingName,"/").concat(Ee.clockRate).concat(Ee.encodingParameters?"/".concat(Ee.encodingParameters):"").concat(this.eol):""}printRTCPFeedback(q,Ee){let Ae="a=rtcp-fb:".concat(q).concat(A),gt=Ee;return gt.type==="trr-int"?Ae+="ttr-int".concat(A).concat(gt.interval):(Ae+="".concat(gt.type),gt.parameter&&(Ae+="".concat(A).concat(gt.parameter),gt.additional&&(Ae+="".concat(A).concat(gt.additional)))),Ae+this.eol}printPtime(q){return q===void 0?"":"a=ptime:".concat(q).concat(this.eol)}printMaxPtime(q){return q===void 0?"":"a=maxptime:".concat(q).concat(this.eol)}printDirection(q){return q===void 0?"":"a=".concat(q).concat(this.eol)}printSSRC(q){return q.map(Ee=>Object.keys(Ee.attributes).map(Ae=>"a=ssrc:".concat(Ee.ssrcId.toString(10)).concat(A).concat(Ae).concat(Ee.attributes[Ae]?":".concat(Ee.attributes[Ae]):"").concat(this.eol)).join("")).join("")}printRTCPMux(q){return q===void 0?"":"a=rtcp-mux".concat(this.eol)}printRTCPMuxOnly(q){return q===void 0?"":"a=rtcp-mux-only".concat(this.eol)}printRTCPRsize(q){return q===void 0?"":"a=rtcp-rsize".concat(this.eol)}printRTCP(q){if(q===void 0)return"";let Ee="a=rtcp:".concat(q.port);return q.netType&&(Ee+="".concat(A).concat(q.netType)),q.addressType&&(Ee+="".concat(A).concat(q.addressType)),q.address&&(Ee+="".concat(A).concat(q.address)),Ee+this.eol}printMSId(q){return q.map(Ee=>"a=msid:".concat(Ee.id).concat(Ee.appdata?"".concat(A).concat(Ee.appdata):"").concat(this.eol)).join("")}printImageattr(q){return q.map(Ee=>"a=imageattr:".concat(Ee).concat(this.eol)).join("")}printRid(q){return q.map(Ee=>{let Ae="a=rid:".concat(Ee.id).concat(A).concat(Ee.direction);return Ee.payloads&&(Ae+="".concat(A,"pt=").concat(Ee.payloads.join(","))),Ee.params.length>0&&(Ae+="".concat(A).concat(Ee.params.map(gt=>gt.type==="depend"?"depend=".concat(gt.rids.join(",")):"".concat(gt.type,"=").concat(gt.val)).join(";"))),Ae+this.eol}).join("")}printSimulcast(q){return q===void 0?"":"a=simulcast:".concat(q).concat(this.eol)}printSCTPPort(q){return q===void 0?"":"a=sctp-port:".concat(q).concat(this.eol)}printMaxMessageSize(q){return q===void 0?"":"a=max-message-size:".concat(q).concat(this.eol)}printMid(q){return q===void 0?"":"a=mid:".concat(q).concat(this.eol)}printSSRCGroups(q){return q.map(Ee=>"a=ssrc-group:".concat(Ee.semantic).concat(Ee.ssrcIds.map(Ae=>"".concat(A).concat(Ae.toString(10))).join("")).concat(this.eol)).join("")}}function Rn(Rt){return new $n().parse(Rt)}function oi(Rt,q){return new Uu().print(Rt,q)}}},c={};function f(g){if(c[g])return c[g].exports;var v=c[g]={exports:{}};return o[g](v,v.exports,f),v.exports}return f.d=(g,v)=>{for(var w in v)f.o(v,w)&&!f.o(g,w)&&Object.defineProperty(g,w,{enumerable:!0,get:v[w]})},f.o=(g,v)=>Object.prototype.hasOwnProperty.call(g,v),f.r=g=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})},f(8)})()})(ele);var ir=ele.exports;function Lu(r){if(Array.isArray(r))return r.map(o=>o);if(!tle(r))return r;let a={};for(let o in r){let c=r[o];tle(c)||Array.isArray(c)?a[o]=Lu(c):a[o]=c}return a}function tle(r){return!(typeof r!="object"||Array.isArray(r)||!r)}class t${constructor(a){X(this,"input",[]),X(this,"size",void 0),this.size=a}add(a){this.input.push(a),this.input.length>this.size&&this.input.splice(0,1)}diffMean(){return this.input.length===0?0:(this.input[this.input.length-1]-this.input[0])/this.input.length}}let Zf={address:"unknown",candidateType:"unknown",id:"unknown",port:0,priority:0,protocol:"unknown",type:"unknown"},w3={timestamp:0,bitrate:{actualEncoded:0,transmit:0},sendPacketLossRate:0,recvPacketLossRate:0,videoRecv:[],videoSend:[],audioRecv:[],audioSend:[],selectedCandidatePair:{id:"unknown",localCandidate:Zf,remoteCandidate:Zf}},nle={firsCount:0,nacksCount:0,plisCount:0,framesDecodeCount:0,framesDecodeInterval:0,framesDecodeFreezeTime:0,decodeFrameRate:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,qpSumPerFrame:0,framesDroppedCount:0,outputFrameRate:0},ile={firsCount:0,nacksCount:0,plisCount:0,frameCount:0,bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0,jitterMs:0,qpSumPerFrame:0},rle={bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0,jitterMs:0},sle={jitterBufferMs:0,jitterMs:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,receivedFrames:0,droppedFrames:0,concealedSamples:0};function ale(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function ole(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?ale(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ale(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class n${constructor(a,o){X(this,"onFirstVideoReceived",void 0),X(this,"onFirstVideoDecoded",void 0),X(this,"onFirstAudioReceived",void 0),X(this,"onFirstVideoDecodedTimeout",void 0),X(this,"onFirstAudioDecoded",void 0),X(this,"onSelectedLocalCandidateChanged",void 0),X(this,"onSelectedRemoteCandidateChanged",void 0),X(this,"videoIsReady",!1),X(this,"videoIsReady2",{}),X(this,"pc",void 0),X(this,"options",void 0),X(this,"intervalTimer",void 0),X(this,"stats",Lu(w3)),X(this,"isFirstVideoReceived",{}),X(this,"isFirstVideoDecoded",{}),X(this,"isFirstAudioReceived",{}),X(this,"isFirstAudioDecoded",{}),X(this,"isFirstVideoDecodedTimeout",{}),X(this,"lossRateWindowStats",[]),this.pc=a,this.options=o,this.intervalTimer=window.setInterval(async()=>{this.updateStats()},this.options.updateInterval)}getStats(){return this.stats}getSelectedCandidatePair(){return new Ct(a=>{a({local:ole({},Zf),remote:ole({},Zf)})})}setVideoIsReady(a){this.videoIsReady=a}setVideoIsReady2(a,o){this.videoIsReady2[a]=o}getVideoIsReady(a){return this.videoIsReady2[a]||!1}setIsFirstAudioDecoded(a){}destroy(){window.clearInterval(this.intervalTimer),this.pc=void 0}calcLossRate(a){this.lossRateWindowStats.push(a),this.lossRateWindowStats.length>this.options.lossRateInterval&&this.lossRateWindowStats.splice(0,1);let o=this.lossRateWindowStats.length,c=["videoSend","audioSend","videoRecv","audioRecv"],f=0,g=0,v=0,w=0;for(let T of c)a[T].forEach((R,A)=>{if(!this.lossRateWindowStats[o-1][T][A]||!this.lossRateWindowStats[0][T][A])return;let L=this.lossRateWindowStats[o-1][T][A].packets-this.lossRateWindowStats[0][T][A].packets,U=this.lossRateWindowStats[o-1][T][A].packetsLost-this.lossRateWindowStats[0][T][A].packetsLost;T==="videoSend"||T==="audioSend"?(f+=L,v+=U):(g+=L,w+=U),Number.isNaN(L)||Number.isNaN(L)?R.packetLostRate=0:R.packetLostRate=L<=0||U<=0?0:U/(L+U)});a.sendPacketLossRate=f<=0||v<=0?0:v/(f+v),a.recvPacketLossRate=g<=0||w<=0?0:w/(g+w)}}function lle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Q4e(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?lle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):lle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class Z4e extends n${constructor(){super(...arguments),X(this,"_stats",w3),X(this,"lastDecodeVideoReceiverStats",new Map)}async updateStats(){let a=await this._getStats(),o=this.statsResponsesToObjects(a);this._stats=Lu(w3);let c=o.filter(g=>g.type==="ssrc");this.processSSRCStats(c);let f=o.find(g=>g.type==="VideoBwe");f&&this.processBandwidthStats(f),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats}processBandwidthStats(a){this._stats.bitrate={actualEncoded:Number(a.googActualEncBitrate),targetEncoded:Number(a.googTargetEncBitrate),retransmit:Number(a.googRetransmitBitrate),transmit:Number(a.googTransmitBitrate)},this._stats.sendBandwidth=Number(a.googAvailableSendBandwidth)}processSSRCStats(a){a.forEach(o=>{var c;let f=Tt(c=o.id).call(c,"send");switch("".concat(o.mediaType,"_").concat(f?"send":"recv")){case"video_send":{let g=Lu(ile);g.codec=o.googCodecName,g.adaptionChangeReason="none",o.googCpuLimitedResolution&&(g.adaptionChangeReason="cpu"),o.googBandwidthLimitedResolution&&(g.adaptionChangeReason="bandwidth"),g.avgEncodeMs=Number(o.googAvgEncodeMs),g.inputFrame={width:Number(o.googFrameWidthInput)||Number(o.googFrameWidthSent),height:Number(o.googFrameHeightInput)||Number(o.googFrameHeightSent),frameRate:Number(o.googFrameRateInput)},g.sentFrame={width:Number(o.googFrameWidthSent),height:Number(o.googFrameHeightSent),frameRate:Number(o.googFrameRateInput)},g.firsCount=Number(o.googFirReceived),g.nacksCount=Number(o.googNacksReceived),g.plisCount=Number(o.googPlisReceived),g.frameCount=Number(o.framesEncoded),g.bytes=Number(o.bytesSent),g.packets=Number(o.packetsSent),g.packetsLost=Number(o.packetsLost),g.ssrc=Number(o.ssrc),g.rttMs=Number(o.googRtt||0),this._stats.videoSend.push(g),this._stats.rtt=g.rttMs;break}case"video_recv":{let g=Lu(nle),v=this.lastDecodeVideoReceiverStats.get(Number(o.ssrc));if(g.codec=o.googCodecName,g.targetDelayMs=Number(o.googTargetDelayMs),g.renderDelayMs=Number(o.googRenderDelayMs),g.currentDelayMs=Number(o.googCurrentDelayMs),g.minPlayoutDelayMs=Number(o.googMinPlayoutDelayMs),g.decodeMs=Number(o.googDecodeMs),g.maxDecodeMs=Number(o.googMaxDecodeMs),g.receivedFrame={width:Number(o.googFrameWidthReceived),height:Number(o.googFrameHeightReceived),frameRate:Number(o.googFrameRateReceived)},g.decodedFrame={width:Number(o.googFrameWidthReceived),height:Number(o.googFrameHeightReceived),frameRate:Number(o.googFrameRateDecoded)},g.decodeFrameRate=Number(o.googFrameRateDecoded),g.outputFrame={width:Number(o.googFrameWidthReceived),height:Number(o.googFrameHeightReceived),frameRate:Number(o.googFrameRateOutput)},g.jitterBufferMs=Number(o.googJitterBufferMs),g.firsCount=Number(o.googFirsSent),g.nacksCount=Number(o.googNacksSent),g.plisCount=Number(o.googPlisSent),g.framesDecodeCount=Number(o.framesDecoded),g.bytes=Number(o.bytesReceived),g.packets=Number(o.packetsReceived),g.packetsLost=Number(o.packetsLost),g.ssrc=Number(o.ssrc),g.packets>0&&!this.isFirstVideoReceived[g.ssrc]&&(this.onFirstVideoReceived&&this.onFirstVideoReceived(g.ssrc),this.isFirstVideoReceived[g.ssrc]=!0),g.framesDecodeCount>0&&!this.isFirstVideoDecoded[g.ssrc]&&(this.onFirstVideoDecoded&&this.onFirstVideoDecoded(g.ssrc,g.decodedFrame.width,g.decodedFrame.height),this.isFirstVideoDecoded[g.ssrc]=!0),v){let w=v.stats,T=Date.now()-v.lts;g.framesDecodeFreezeTime=w.framesDecodeFreezeTime,g.framesDecodeInterval=w.framesDecodeInterval,g.framesDecodeCount>w.framesDecodeCount&&this.isFirstVideoDecoded[g.ssrc]?(v.lts=Date.now(),g.framesDecodeInterval=T,g.framesDecodeInterval>=this.options.freezeRateLimit&&(this.getVideoIsReady(parseInt(o.ssrc,10))?g.framesDecodeFreezeTime+=g.framesDecodeInterval:this.setVideoIsReady2(parseInt(o.ssrc,10),!0))):g.framesDecodeCount<v.stats.framesDecodeCount&&(g.framesDecodeInterval=0)}this.lastDecodeVideoReceiverStats.set(g.ssrc,{stats:Q4e({},g),lts:Date.now()}),this._stats.videoRecv.push(g);break}case"audio_recv":{let g=Lu(sle);g.codec=o.googCodecName,g.outputLevel=Math.abs(Number(o.audioOutputLevel))/32767,g.decodingCNG=Number(o.googDecodingCNG),g.decodingCTN=Number(o.googDecodingCTN),g.decodingCTSG=Number(o.googDecodingCTSG),g.decodingNormal=Number(o.googDecodingNormal),g.decodingPLC=Number(o.googDecodingPLC),g.decodingPLCCNG=Number(o.googDecodingPLCCNG),g.expandRate=Number(o.googExpandRate),g.accelerateRate=Number(o.googAccelerateRate),g.preemptiveExpandRate=Number(o.googPreemptiveExpandRate),g.secondaryDecodedRate=Number(o.googSecondaryDecodedRate),g.speechExpandRate=Number(o.googSpeechExpandRate),g.preferredJitterBufferMs=Number(o.googPreferredJitterBufferMs),g.jitterBufferMs=Number(o.googJitterBufferMs),g.jitterMs=Number(o.googJitterReceived),g.bytes=Number(o.bytesReceived),g.packets=Number(o.packetsReceived),g.packetsLost=Number(o.packetsLost),g.ssrc=Number(o.ssrc),g.receivedFrames=Number(o.googDecodingCTN)||Number(o.packetsReceived),g.droppedFrames=Number(o.googDecodingPLC)+Number(o.googDecodingPLCCNG)||Number(o.packetsLost),g.receivedFrames>0&&!this.isFirstAudioReceived[g.ssrc]&&(this.onFirstAudioReceived&&this.onFirstAudioReceived(g.ssrc),this.isFirstAudioReceived[g.ssrc]=!0),g.decodingNormal>0&&!this.isFirstAudioDecoded[g.ssrc]&&(this.onFirstAudioDecoded&&this.onFirstAudioDecoded(g.ssrc),this.isFirstAudioDecoded[g.ssrc]=!0),this._stats.audioRecv.push(g);break}case"audio_send":{let g=Lu(rle);g.codec=o.googCodecName,g.inputLevel=Math.abs(Number(o.audioInputLevel))/32767,g.aecReturnLoss=Number(o.googEchoCancellationReturnLoss||0),g.aecReturnLossEnhancement=Number(o.googEchoCancellationReturnLossEnhancement||0),g.residualEchoLikelihood=Number(o.googResidualEchoLikelihood||0),g.residualEchoLikelihoodRecentMax=Number(o.googResidualEchoLikelihoodRecentMax||0),g.bytes=Number(o.bytesSent),g.packets=Number(o.packetsSent),g.packetsLost=Number(o.packetsLost),g.ssrc=Number(o.ssrc),g.rttMs=Number(o.googRtt||0),this._stats.rtt=g.rttMs,this._stats.audioSend.push(g);break}}})}_getStats(){return new Ct((a,o)=>{this.pc.getStats(a,o)})}statsResponsesToObjects(a){let o=[];return a.result().forEach(c=>{let f={id:c.id,timestamp:c.timestamp.valueOf().toString(),type:c.type};c.names().forEach(g=>{f[g]=c.stat(g)}),o.push(f)}),o}}function cle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function T_(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?cle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):cle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class dle extends n${constructor(){super(...arguments),X(this,"_stats",w3),X(this,"report",void 0),X(this,"lastDecodeVideoReceiverStats",new Map),X(this,"lastVideoFramesRecv",new Map),X(this,"lastVideoFramesSent",new Map),X(this,"lastVideoFramesDecode",new Map),X(this,"lastVideoFramesOutput",new Map),X(this,"lastVideoJBDelay",new Map),X(this,"lastAudioJBDelay",new Map),X(this,"mediaBytesSent",new Map),X(this,"mediaBytesRetransmit",new Map),X(this,"mediaBytesTargetEncode",new Map),X(this,"lastEncoderMs",new Map)}async updateStats(){this.report=await this.pc.getStats(),this._stats=Lu(w3),this.report.forEach(a=>{switch(a.type){case Ic.OUTBOUND:case Ic.INBOUND:{let o=a.mediaType||a.kind,c=!o&&"frameWidth"in a,f=!o&&!("frameWidth"in a);a.type===Ic.OUTBOUND?o==="audio"||f?this.processAudioOutboundStats(a):(o==="video"||c)&&this.processVideoOutboundStats(a):a.type===Ic.INBOUND&&(o==="audio"||f?this.processAudioInboundStats(a):(o==="video"||c)&&this.processVideoInboundStats(a));break}case Ic.TRANSPORT:{let o=this.report.get(a.selectedCandidatePairId);o&&this.processCandidatePairStats(o);break}case Ic.CANDIDATE_PAIR:a.selected&&this.processCandidatePairStats(a)}}),this.updateSendBitrate(),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats}async getSelectedCandidatePair(){let a=await this.pc.getStats(),o={local:T_({},Zf),remote:T_({},Zf)};return a.forEach(c=>{let f;if(c.type===Ic.TRANSPORT&&(f=a.get(c.selectedCandidatePairId)),c.type===Ic.CANDIDATE_PAIR&&c.selected&&(f=c),f){let g=(v,w)=>{v.type=w.type,v.id=w.id,w.address&&(v.address=w.address),w.candidateType&&(v.candidateType=w.candidateType),w.port&&(v.port=w.port),w.priority&&(v.priority=w.priority),w.protocol&&(v.protocol=w.protocol),w.relayProtocol&&(v.relayProtocol=w.relayProtocol)};if(f.localCandidateId){let v=a.get(f.localCandidateId);v&&g(o.local,v)}if(f.remoteCandidateId){let v=a.get(f.remoteCandidateId);v&&g(o.remote,v)}}}),o}processCandidatePairStats(a){if(this._stats.sendBandwidth=a.availableOutgoingBitrate||0,a.currentRoundTripTime&&(this._stats.rtt=1e3*a.currentRoundTripTime),this._stats.videoSend.forEach(o=>{a.currentRoundTripTime&&(o.rttMs=1e3*a.currentRoundTripTime)}),this._stats.audioSend.forEach(o=>{a.currentRoundTripTime&&(o.rttMs=1e3*a.currentRoundTripTime)}),this._stats.selectedCandidatePair.id=a.id,a.localCandidateId){let o=this.report.get(a.localCandidateId);o&&this.processCandidateStats(o)}if(a.remoteCandidateId){let o=this.report.get(a.remoteCandidateId);o&&this.processCandidateStats(o)}}processCandidateStats(a){let o;a.type===Ic.LOCAL_CANDIDATE&&(o=this._stats.selectedCandidatePair.localCandidate),a.type===Ic.REMOTE_CANDIDATE&&(o=this._stats.selectedCandidatePair.remoteCandidate),o&&(o.type=a.type,o.id=a.id,a.address&&(o.address=a.address),a.candidateType&&(o.candidateType=a.candidateType),a.port&&(o.port=a.port),a.priority&&(o.priority=a.priority),a.protocol&&(o.protocol=a.protocol),a.relayProtocol&&(o.relayProtocol=a.relayProtocol),a.type===Ic.LOCAL_CANDIDATE&&this.stats.selectedCandidatePair.localCandidate.id!==o.id&&this.onSelectedLocalCandidateChanged&&this.onSelectedLocalCandidateChanged(T_({},o),T_({},this.stats.selectedCandidatePair.localCandidate)),a.type===Ic.REMOTE_CANDIDATE&&this.stats.selectedCandidatePair.remoteCandidate.id!==o.id&&this.onSelectedRemoteCandidateChanged&&this.onSelectedRemoteCandidateChanged(T_({},o),T_({},this.stats.selectedCandidatePair.remoteCandidate)))}processAudioInboundStats(a){let o=this._stats.audioRecv.find(c=>c.ssrc===a.ssrc);o||(o=Lu(sle),this._stats.audioRecv.push(o)),o.ssrc=a.ssrc,o.packets=a.packetsReceived,o.packetsLost=a.packetsLost,o.bytes=a.bytesReceived,o.jitterMs=1e3*a.jitter,this.processAudioTrackReceiverStats(a,a.trackId,o),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),o.receivedFrames||(o.receivedFrames=a.packetsReceived),o.droppedFrames||(o.droppedFrames=a.packetsLost),o.receivedFrames>0&&!this.isFirstAudioReceived[o.ssrc]&&(this.onFirstAudioReceived&&this.onFirstAudioReceived(o.ssrc),this.isFirstAudioReceived[o.ssrc]=!0),o.outputLevel&&o.outputLevel>0&&!this.isFirstAudioDecoded[o.ssrc]&&(this.onFirstAudioDecoded&&this.onFirstAudioDecoded(o.ssrc),this.isFirstAudioDecoded[o.ssrc]=!0),typeof a.concealedSamples=="number"&&(o.concealedSamples=a.concealedSamples)}processVideoInboundStats(a){let o=this._stats.videoRecv.find(w=>w.ssrc===a.ssrc);o||(o=Lu(nle),this._stats.videoRecv.push(o)),o.ssrc=a.ssrc,o.packets=a.packetsReceived,o.packetsLost=a.packetsLost,o.bytes=a.bytesReceived,o.firsCount=a.firCount,o.nacksCount=a.nackCount,o.plisCount=a.pliCount,o.framesDecodeCount=a.framesDecoded,o.framesDroppedCount=a.framesDropped,o.totalInterFrameDelay=a.totalInterFrameDelay,o.totalSquaredInterFrameDelay=a.totalSquaredInterFrameDelay,o.totalFreezesDuration=a.totalFreezesDuration;let c=this.lastDecodeVideoReceiverStats.get(o.ssrc),f=this.lastVideoFramesDecode.get(o.ssrc),g=this.lastVideoFramesOutput.get(o.ssrc),v=Date.now();if(o.framesDecodeCount>0&&!this.isFirstVideoDecoded[o.ssrc]){let w=o.decodedFrame?o.decodedFrame.width:0,T=o.decodedFrame?o.decodedFrame.height:0;this.onFirstVideoDecoded&&this.onFirstVideoDecoded(o.ssrc,w,T),this.isFirstVideoDecoded[o.ssrc]=!0}if(c){let w=c.stats,T=v-c.lts;o.framesDecodeFreezeTime=w.framesDecodeFreezeTime,o.framesDecodeInterval=w.framesDecodeInterval,!this.isFirstVideoDecoded[o.ssrc]&&T>this.options.firstVideoDecodedTimeout&&!this.isFirstVideoDecodedTimeout[o.ssrc]&&(this.onFirstVideoDecodedTimeout&&this.onFirstVideoDecodedTimeout(o.ssrc),this.isFirstVideoDecodedTimeout[o.ssrc]=!0),o.framesDecodeCount>w.framesDecodeCount&&this.isFirstVideoDecoded[o.ssrc]?(c.lts=Date.now(),o.framesDecodeInterval=T,o.framesDecodeInterval>=this.options.freezeRateLimit&&(this.getVideoIsReady(parseInt(a.ssrc))?o.framesDecodeFreezeTime+=o.framesDecodeInterval:this.setVideoIsReady2(parseInt(a.ssrc,10),!0))):o.framesDecodeCount<w.framesDecodeCount&&(o.framesDecodeInterval=0),a.framesDecoded&&a.qpSum&&(c.stats.framesDecodeCount>a.framesDecoded?o.qpSumPerFrame=a.qpSum/a.framesDecoded:o.qpSumPerFrame=(a.qpSum-c.qpSum)/(a.framesDecoded-c.stats.framesDecodeCount))}f&&v-f.lts>=800?(o.decodeFrameRate=Math.round((o.framesDecodeCount-f.count)/((v-f.lts)/1e3)),this.lastVideoFramesDecode.set(o.ssrc,{count:o.framesDecodeCount,lts:v,rate:o.decodeFrameRate})):f?o.decodeFrameRate=f.rate:this.lastVideoFramesDecode.set(o.ssrc,{count:o.framesDecodeCount,lts:v,rate:0}),o.framesDroppedCount&&a.framesReceived&&(g&&v-g.lts>=800?(o.outputFrameRate=Math.round((a.framesReceived-o.framesDroppedCount-g.count)/((v-g.lts)/1e3)),this.lastVideoFramesOutput.set(o.ssrc,{count:a.framesReceived-o.framesDroppedCount,lts:v,rate:Math.max(o.outputFrameRate,0)})):g?o.outputFrameRate=g.rate:this.lastVideoFramesOutput.set(o.ssrc,{count:a.framesReceived-o.framesDroppedCount,lts:v,rate:0})),a.totalDecodeTime&&(o.decodeMs=1e3*a.totalDecodeTime),this.processVideoTrackReceiverStats(a,a.trackId,o),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),a.framerateMean&&(o.framesRateFirefox=a.framerateMean),o.packets>0&&!this.isFirstVideoReceived[o.ssrc]&&(this.onFirstVideoReceived&&this.onFirstVideoReceived(o.ssrc),this.isFirstVideoReceived[o.ssrc]=!0),this.lastDecodeVideoReceiverStats.set(o.ssrc,{stats:T_({},o),lts:c?c.lts:Date.now(),qpSum:a.qpSum})}processVideoOutboundStats(a){let o=this._stats.videoSend.find(f=>f.ssrc===a.ssrc);o||(o=Lu(ile),this._stats.videoSend.push(o));let c=this.mediaBytesSent.get(a.ssrc);if(c)c.add(a.bytesSent);else{let f=new t$(10);f.add(a.bytesSent),this.mediaBytesSent.set(a.ssrc,f)}if(a.retransmittedBytesSent!==void 0){let f=this.mediaBytesRetransmit.get(a.ssrc);if(f)f.add(a.retransmittedBytesSent);else{let g=new t$(10);g.add(a.retransmittedBytesSent),this.mediaBytesRetransmit.set(a.ssrc,g)}}if(a.totalEncodedBytesTarget){let f=this.mediaBytesTargetEncode.get(a.ssrc);if(f)f.add(a.totalEncodedBytesTarget);else{let g=new t$(10);g.add(a.totalEncodedBytesTarget),this.mediaBytesTargetEncode.set(a.ssrc,g)}}if(o.ssrc=a.ssrc,o.bytes=a.bytesSent,o.packets=a.packetsSent,o.firsCount=a.firCount,o.nacksCount=a.nackCount,o.plisCount=a.pliCount,o.frameCount=a.framesEncoded,o.adaptionChangeReason=a.qualityLimitationReason,o.scalabilityMode=a.scalabilityMode,a.totalEncodeTime&&a.framesEncoded){let f=this.lastEncoderMs.get(a.ssrc);if(!f||f.lastFrameCount>a.framesEncoded)o.avgEncodeMs=1e3*a.totalEncodeTime/a.framesEncoded;else{let g=a.framesEncoded-f.lastFrameCount,v=a.totalEncodeTime-f.lastEncoderTime;o.avgEncodeMs=1e3*v/g}}if(a.framesEncoded&&a.qpSum){let f=this.lastEncoderMs.get(a.ssrc);!f||f.lastFrameCount>a.framesEncoded?o.qpSumPerFrame=a.qpSum/a.framesEncoded:o.qpSumPerFrame=(a.qpSum-f.lastQpSum)/(a.framesEncoded-f.lastFrameCount)}if(this.lastEncoderMs.set(a.ssrc,{lastFrameCount:a.framesEncoded,lastEncoderTime:a.totalEncodeTime,lastQpSum:a.qpSum,lts:Date.now()}),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),a.mediaSourceId&&this.processVideoMediaSource(a.mediaSourceId,o),this.processVideoTrackSenderStats(a,a.trackId,o),a.remoteId)this.processRemoteInboundStats(a.remoteId,o);else{let f=this.findRemoteStatsId(a.ssrc,Ic.REMOTE_INBOUND);f&&this.processRemoteInboundStats(f,o)}}processAudioOutboundStats(a){let o=this._stats.audioSend.find(c=>c.ssrc===a.ssrc);if(o||(o=Lu(rle),this._stats.audioSend.push(o)),o.ssrc=a.ssrc,o.packets=a.packetsSent,o.bytes=a.bytesSent,a.mediaSourceId&&this.processAudioMediaSource(a.mediaSourceId,o),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),this.processAudioTrackSenderStats(a,a.trackId,o),a.remoteId)this.processRemoteInboundStats(a.remoteId,o);else{let c=this.findRemoteStatsId(a.ssrc,Ic.REMOTE_INBOUND);c&&this.processRemoteInboundStats(c,o)}}findRemoteStatsId(a,o){var c;let f=Array.from(Oh(c=this.report).call(c)).find(g=>g.type===o&&g.ssrc===a);return f?f.id:null}processVideoMediaSource(a,o){let c=this.report.get(a);c&&c.width&&c.height&&c.framesPerSecond&&(o.inputFrame={width:c.width,height:c.height,frameRate:c.framesPerSecond})}processAudioMediaSource(a,o){let c=this.report.get(a);c&&(o.inputLevel=c.audioLevel)}processVideoTrackSenderStats(a,o,c){var f,g,v,w;let T=o?this.report.get(o):void 0,R=(f=T==null?void 0:T.framesSent)!==null&&f!==void 0?f:a.framesSent;if(typeof R!="number")return;let A=(g=T==null?void 0:T.frameWidth)!==null&&g!==void 0?g:a.frameWidth,L=(v=T==null?void 0:T.frameHeight)!==null&&v!==void 0?v:a.frameHeight,U=(w=T==null?void 0:T.framesPerSecond)!==null&&w!==void 0?w:a.framesPerSecond;if(typeof A=="number"&&typeof L=="number"||(A=0,L=0),U==null){let F=Date.now(),Z=this.lastVideoFramesSent.get(c.ssrc);Z&&F-Z.lts>=800?(U=Math.round((R-Z.count)/((F-Z.lts)/1e3)),this.lastVideoFramesSent.set(c.ssrc,{count:R,lts:F,rate:U})):Z?U=Z.rate:this.lastVideoFramesSent.set(c.ssrc,{count:R,lts:F,rate:0})}c.sentFrame={width:A,height:L,frameRate:Math.max(0,U)}}processVideoTrackReceiverStats(a,o,c){var f,g,v,w,T;let R=o?this.report.get(o):void 0,A=(f=R==null?void 0:R.framesReceived)!==null&&f!==void 0?f:a.framesReceived,L=(g=R==null?void 0:R.frameWidth)!==null&&g!==void 0?g:a.frameWidth,U=(v=R==null?void 0:R.frameHeight)!==null&&v!==void 0?v:a.frameHeight,F=(w=R==null?void 0:R.jitterBufferDelay)!==null&&w!==void 0?w:a.jitterBufferDelay,Z=(T=R==null?void 0:R.jitterBufferEmittedCount)!==null&&T!==void 0?T:a.jitterBufferEmittedCount;if(typeof A=="number"){let W=this.lastVideoFramesRecv.get(c.ssrc),K=Date.now();c.framesReceivedCount=A;let oe=0;W&&K-W.lts>=800?(oe=Math.round((A-W.count)/((K-W.lts)/1e3)),this.lastVideoFramesRecv.set(c.ssrc,{count:A,lts:K,rate:oe})):W?oe=W.rate:this.lastVideoFramesRecv.set(c.ssrc,{count:A,lts:K,rate:0}),c.receivedFrame={width:L||0,height:U||0,frameRate:oe||0},c.decodedFrame={width:L||0,height:U||0,frameRate:c.decodeFrameRate||0},c.outputFrame={width:L||0,height:U||0,frameRate:c.outputFrameRate||c.decodeFrameRate||0}}if(F&&Z){let W=this.lastVideoJBDelay.get(c.ssrc)||{jitterBufferDelay:0,jitterBufferEmittedCount:0,jitterBufferMs:0},K=W.jitterBufferMs,oe=Z-W.jitterBufferEmittedCount;oe>0&&(K=1e3*(F-W.jitterBufferDelay)/oe),c.jitterBufferMs=K,c.currentDelayMs=Math.round(K),this.lastVideoJBDelay.set(c.ssrc,{jitterBufferDelay:F,jitterBufferEmittedCount:Z,jitterBufferMs:c.currentDelayMs})}}processAudioTrackSenderStats(a,o,c){var f,g,v,w;let T=o?this.report.get(o):void 0,R=(f=(g=T==null?void 0:T.echoReturnLoss)!==null&&g!==void 0?g:a.echoReturnLoss)!==null&&f!==void 0?f:0,A=(v=(w=T==null?void 0:T.echoReturnLossEnhancement)!==null&&w!==void 0?w:a.echoReturnLossEnhancement)!==null&&v!==void 0?v:0;c.aecReturnLoss=R,c.aecReturnLossEnhancement=A}processAudioTrackReceiverStats(a,o,c){var f,g,v,w,T,R,A;let L=o?this.report.get(o):void 0,U=(f=L==null?void 0:L.removedSamplesForAcceleration)!==null&&f!==void 0?f:a.removedSamplesForAcceleration,F=(g=L==null?void 0:L.totalSamplesReceived)!==null&&g!==void 0?g:a.totalSamplesReceived,Z=(v=L==null?void 0:L.jitterBufferDelay)!==null&&v!==void 0?v:a.jitterBufferDelay,W=(w=L==null?void 0:L.jitterBufferEmittedCount)!==null&&w!==void 0?w:a.jitterBufferEmittedCount,K=(T=L==null?void 0:L.audioLevel)!==null&&T!==void 0?T:a==null?void 0:a.audioLevel,oe=(R=L==null?void 0:L.totalSamplesDuration)!==null&&R!==void 0?R:a==null?void 0:a.totalSamplesDuration,ue=(A=L==null?void 0:L.concealedSamples)!==null&&A!==void 0?A:a.concealedSamples;if(U&&F&&(c.accelerateRate=U/F),Z&&W){let Ne=this.lastAudioJBDelay.get(c.ssrc)||{jitterBufferDelay:0,jitterBufferEmittedCount:0,jitterBufferMs:0},ke=Ne.jitterBufferMs,He=W-Ne.jitterBufferEmittedCount;He>0&&(ke=1e3*(Z-Ne.jitterBufferDelay)/He),c.jitterBufferMs=Math.round(ke),this.lastAudioJBDelay.set(c.ssrc,{jitterBufferDelay:Z,jitterBufferEmittedCount:W,jitterBufferMs:c.jitterBufferMs})}c.outputLevel=K;let xe=1920;oe&&F&&(xe=F/oe/50,c.receivedFrames=Math.round(F/xe)),ue&&(c.droppedFrames=Math.round(ue/xe))}processRemoteInboundStats(a,o){let c=this.report.get(a);c&&(o.packetsLost=c.packetsLost,c.roundTripTime&&(o.rttMs=1e3*c.roundTripTime),c.jitter&&(o.jitterMs=1e3*c.jitter),c.timestamp&&(o.timestamp=c.timestamp))}getCodecFromCodecStats(a){let o=this.report.get(a);if(!o)return"";let c=o.mimeType.match(/\/(.*)$/);return c&&c[1]?c[1]:""}updateSendBitrate(){let a=0,o=null,c=null;this.mediaBytesSent.forEach(g=>{a+=g.diffMean()}),this.mediaBytesRetransmit.forEach(g=>{o=o===null?g.diffMean():o+g.diffMean()}),this.mediaBytesTargetEncode.forEach(g=>{c=c===null?g.diffMean():c+g.diffMean()});let f=o!==null?a-o:a;this._stats.bitrate={actualEncoded:8*f/(this.options.updateInterval/1e3),transmit:8*a/(this.options.updateInterval/1e3)},o!==null&&(this._stats.bitrate.retransmit=8*o/(this.options.updateInterval/1e3)),c!==null&&(this._stats.bitrate.targetEncoded=8*c/(this.options.updateInterval/1e3))}}class eNe extends n${updateStats(){return Ct.resolve()}}function i8(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:8,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:500,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1e4,g=function(){let v=navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]*/i);return v&&v[0]?Number(v[0].split("/")[1]):null}();return g?g<76?new Z4e(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f}):new dle(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f}):function(v){return!!window.RTCStatsReport&&v.getStats()instanceof Ct}(r)?new dle(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f}):new eNe(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f})}function ule(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function hle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?ule(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ule(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function S3(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0,{filterRTX:f,filterVideoFec:g,filterAudioFec:v,filterAudioCodec:w,filterVideoCodec:T}=a,{useXR:R}=o,A=[],L=[],U=[],F=[],Z=!1,W=!1;if(ir.parse(r).mediaDescriptions.forEach(oe=>{c&&c!==oe.attributes.direction||(oe.media.mediaType!=="video"||Z||(L=oe.attributes.payloads,F=oe.attributes.extmaps,Z=!0),oe.media.mediaType!=="audio"||W||(A=oe.attributes.payloads,U=oe.attributes.extmaps,W=!0))}),!F||L.length===0)throw new Error("Cannot get video capabilities from SDP.");if(!U||A.length===0)throw new Error("Cannot get audio capabilities from SDP.");if(L.forEach(oe=>{var ue;(ue=oe.rtpMap)!==null&&ue!==void 0&&ue.clockRate&&(oe.rtpMap.clockRate=parseInt(oe.rtpMap.clockRate)),R&&oe.rtcpFeedbacks.push({type:"rrtr"})}),A.forEach(oe=>{var ue;(ue=oe.rtpMap)!==null&&ue!==void 0&&ue.clockRate&&(oe.rtpMap.clockRate=parseInt(oe.rtpMap.clockRate)),R&&oe.rtcpFeedbacks.push({type:"rrtr"})}),f&&(A=A.filter(oe=>{var ue;return((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLowerCase())!=="rtx"}),L=L.filter(oe=>{var ue;return((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLowerCase())!=="rtx"})),g&&(L=L.filter(oe=>{var ue;return!/(red)|(ulpfec)|(flexfec)/i.test(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName)||"")})),v&&(A=A.filter(oe=>{var ue;return!/(red)|(ulpfec)|(flexfec)/i.test(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName)||"")})),w&&(w==null?void 0:w.length)>0&&(A=A.filter(oe=>{var ue;return Tt(w).call(w,((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLowerCase())||"")})),T&&(T==null?void 0:T.length)>0){let oe=L.filter(ue=>{var xe;return Tt(T).call(T,((xe=ue.rtpMap)===null||xe===void 0?void 0:xe.encodingName.toLowerCase())||"")});L=oe.concat(f?[]:o$(oe,L))}let K=ve("UNSUPPORTED_VIDEO_CODEC");return K&&K.length>0&&(L=L.filter(oe=>!(oe.rtpMap&&Tt(K).call(K,oe.rtpMap.encodingName.toLowerCase())))),{audioCodecs:A,videoCodecs:L,audioExtensions:U,videoExtensions:F}}function jh(r){let a=ir.parse(r),o,c;for(let f of a.mediaDescriptions){if(!o){let g=f.attributes.iceUfrag,v=f.attributes.icePwd;if(!g||!v)throw new Error("Cannot get iceUfrag or icePwd from SDP.");o={iceUfrag:g,icePwd:v}}if(!c){let g=f.attributes.fingerprints;g.length>0&&(c={fingerprints:g})}}if(!c&&a.attributes.fingerprints.length>0&&(c={fingerprints:a.attributes.fingerprints}),!c||!o)throw new Error("Cannot get iceParameters or dtlsParameters from SDP.");return{iceParameters:o,dtlsParameters:c}}function i$(r,a){let o=[],c=r.attributes.ssrcGroups.filter(v=>v.semantic==="FID"),f=r.attributes.ssrcGroups.find(v=>v.semantic==="SIM"),g=r.attributes.ssrcs;if(f)f.ssrcIds.forEach(v=>{var w;let T=(w=c.find(R=>R.ssrcIds[0]===v))===null||w===void 0?void 0:w.ssrcIds[1];o.push({ssrcId:v,rtx:a?T:void 0})});else if(c.length>0){let v=c[0].ssrcIds[0],w=c[0].ssrcIds[1];o.push({ssrcId:v,rtx:a?w:void 0})}else{if(g.length===0)throw new Error("No ssrcs found on local media description.");o.push({ssrcId:g[0].ssrcId})}return o}function fle(r,a){let{cname:o}=r,c;a&&a.ip&&typeof a.port=="number"?(c=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:a.ip,port:a.port.toString(),type:"host",extension:{}}],z.debug("Using remote candidate from AP ".concat(a.ip,":").concat(a.port)),a.ip6&&(c.push({foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:a.ip6,port:a.port.toString(),type:"host",extension:{}}),z.debug("Using IPV6 remote candidate from AP ".concat(a.ip6,":").concat(a.port)))):c=r.iceParameters.candidates.map(w=>({foundation:w.foundation,componentId:"1",transport:w.protocol,priority:w.priority.toString(),connectionAddress:w.ip,port:w.port.toString(),type:w.type,extension:{}}));let f={fingerprints:r.dtlsParameters.fingerprints.map(w=>({hashFunction:w.algorithm,fingerprint:w.fingerprint}))},g={iceUfrag:r.iceParameters.iceUfrag,icePwd:r.iceParameters.icePwd},v;switch(r.dtlsParameters.role){case"server":v="passive";break;case"client":v="active";break;case"auto":v="actpass"}return{dtlsParameters:f,iceParameters:g,candidates:c,rtpCapabilities:Ub(r.rtpCapabilities),setup:v,cname:o}}function Uc(r,a,o){let c=[],f=[];return r.forEach(g=>{let{ssrcId:v,rtx:w}=g,T=Li(8,"track-"),R={ssrcId:v,attributes:hle({label:T,mslabel:o=o||Li(10,""),msid:"".concat(o," ").concat(T)},a&&{cname:a})};if(c.push(R),w!==void 0){let A={ssrcId:w,attributes:hle({label:T,mslabel:o,msid:"".concat(o," ").concat(T)},a&&{cname:a})};c.push(A),f.push({semantic:"FID",ssrcIds:[v,w]})}}),r.length>1&&f.push({semantic:"SIM",ssrcIds:r.map(g=>{let{ssrcId:v}=g;return v})}),{ssrcs:c,ssrcGroups:f}}function e1(r,a){a instanceof br&&r.attributes.payloads.forEach(o=>{var c;let f=(c=o.rtpMap)===null||c===void 0?void 0:c.encodingName.toLowerCase();if(!f||["opus","pcmu","pcma","g722"].indexOf(f)===-1)return;o.fmtp||(o.fmtp={parameters:{}}),o.fmtp.parameters.minptime="10",o.fmtp.parameters.useinbandfec="1";let g=a._encoderConfig;g&&f!=="pcmu"&&f!=="pcma"&&f!=="g722"&&(g.bitrate&&!Oi()&&(o.fmtp.parameters.maxaveragebitrate="".concat(Math.floor(1e3*g.bitrate))),g.sampleRate&&(o.fmtp.parameters.maxplaybackrate="".concat(g.sampleRate),o.fmtp.parameters["sprop-maxcapturerate"]="".concat(g.sampleRate)),g.stereo&&(o.fmtp.parameters.stereo="1",o.fmtp.parameters["sprop-stereo"]="1"))})}function r8(r){let a=r.attributes.unrecognized.findIndex(o=>o.attField==="x-google-flag"&&o.attValue==="conference");a!==-1&&r.attributes.unrecognized.splice(a,1)}function s8(r,a){var o;if(!(a instanceof Di&&a._encoderConfig&&a._hints.indexOf(Hi.SCREEN_TRACK)===-1))return;let c=a._encoderConfig;Jn().supportMinBitrate&&c.bitrateMin&&r.attributes.payloads.forEach(f=>{var g,v;Tt(g=["h264","h265","vp8","vp9","av1"]).call(g,((v=f.rtpMap)===null||v===void 0?void 0:v.encodingName.toLowerCase())||"")&&(f.fmtp||(f.fmtp={parameters:{}}),f.fmtp.parameters["x-google-min-bitrate"]="".concat(c.bitrateMin))}),Jn().supportMinBitrate&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&c.bitrateMax&&r.attributes.payloads.forEach(f=>{var g,v;Tt(g=["h264","h265","vp8","vp9","av1"]).call(g,((v=f.rtpMap)===null||v===void 0?void 0:v.encodingName.toLowerCase())||"")&&(f.fmtp||(f.fmtp={parameters:{}}),f.fmtp.parameters["x-google-start-bitrate"]="".concat(ve("X_GOOGLE_START_BITRATE")||Math.floor(c.bitrateMax)))})}function r$(r){if(r.media.mediaType!=="video")return;let a=ni();if(a.name!==pi.SAFARI&&a.os!==vs.IOS)return;let o=r.attributes.extmaps.findIndex(c=>/video-orientation/g.test(c.extensionName));o!==-1&&r.attributes.extmaps.splice(o,1)}function jb(r,a,o){if(!a)return;let c,f;if(r.media.mediaType==="video"?(c=o.videoExtensions,f=o.videoCodecs):(c=o.audioExtensions,f=o.audioCodecs),a.twcc===!0){let g=c.find(v=>v.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01");g&&(r.attributes.extmaps.find(v=>v.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01")||r.attributes.extmaps.push({entry:g.entry,extensionName:"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"}),function(v,w){return w.filter(T=>!!v.find(R=>R.payloadType===T.payloadType&&!!R.rtcpFeedbacks.find(A=>A.type==="transport-cc")))}(f,r.attributes.payloads).forEach(v=>{v.rtcpFeedbacks.find(w=>w.type==="transport-cc")||v.rtcpFeedbacks.push({type:"transport-cc"})}))}else if(a.twcc===!1){let g=r.attributes.extmaps.findIndex(v=>v.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01");g!==-1&&r.attributes.extmaps.splice(g,1),r.attributes.payloads.forEach(v=>{let w=v.rtcpFeedbacks.findIndex(T=>T.type==="transport-cc");w!==-1&&v.rtcpFeedbacks.splice(w,1)})}if(a.remb===!0){let g=c.find(v=>v.extensionName==="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time");g&&(r.attributes.extmaps.find(v=>v.extensionName==="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time")||r.attributes.extmaps.push({entry:g.entry,extensionName:"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"}),function(v,w){return w.filter(T=>!!v.find(R=>R.payloadType===T.payloadType&&!!R.rtcpFeedbacks.find(A=>A.type==="goog-remb")))}(f,r.attributes.payloads).forEach(v=>{v.rtcpFeedbacks.find(w=>w.type==="goog-remb")||v.rtcpFeedbacks.push({type:"goog-remb"})}))}else if(a.remb===!1){let g=r.attributes.extmaps.findIndex(v=>v.extensionName==="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time");g!==-1&&r.attributes.extmaps.splice(g,1),r.attributes.payloads.forEach(v=>{let w=v.rtcpFeedbacks.findIndex(T=>T.type==="goog-remb");w!==-1&&v.rtcpFeedbacks.splice(w,1)})}}function s$(r,a,o){if(Oi()||r.media.mediaType!=="video"||!(a instanceof Di)||o!=="vp9"&&o!=="vp8"||o==="vp8"&&!ve("SIMULCAST")||a._scalabilityMode===void 0||a._scalabilityMode.numSpatialLayers<=1)return;let c=o==="vp8"?2:a._scalabilityMode.numSpatialLayers,f=r.attributes.ssrcs[0],g=r.attributes.ssrcGroups.find(w=>w.semantic==="FID"&&w.ssrcIds[0]===f.ssrcId),v={semantic:"SIM",ssrcIds:[f.ssrcId]};for(let w=1;w<c;w++)r.attributes.ssrcs.push({ssrcId:f.ssrcId+w,attributes:zi(f.attributes)}),v.ssrcIds.push(f.ssrcId+w),g&&(r.attributes.ssrcs.push({ssrcId:g.ssrcIds[1]+w,attributes:zi(f.attributes)}),r.attributes.ssrcGroups.push({semantic:"FID",ssrcIds:[f.ssrcId+w,g.ssrcIds[1]+w]}));r.attributes.ssrcGroups.unshift(v)}async function a$(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=new RTCPeerConnection;o.addTransceiver("video",{direction:"sendonly"}),o.addTransceiver("audio",{direction:"sendonly"}),o.addTransceiver("video",{direction:"recvonly"}),o.addTransceiver("audio",{direction:"recvonly"});let c=(await o.createOffer()).sdp,{send:f,recv:g,sendrecv:v}=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=arguments.length>2?arguments[2]:void 0,A=S3(R,w,T,"sendonly"),L=S3(R,w,T,"recvonly"),U={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},F={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},Z={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(Du(A,L,"videoExtensions",U,F,Z),Du(A,L,"videoCodecs",U,F,Z),Du(A,L,"audioExtensions",U,F,Z),Du(A,L,"audioCodecs",U,F,Z),ve("RAISE_H264_BASELINE_PRIORITY")){let W=Z.videoCodecs.findIndex(K=>{var oe,ue;return((oe=K.rtpMap)===null||oe===void 0?void 0:oe.encodingName.toLocaleLowerCase())==="h264"&&((ue=K.fmtp)===null||ue===void 0?void 0:ue.parameters["profile-level-id"])==="42001f"});if(W!==-1){let K=Z.videoCodecs.findIndex(oe=>{var ue;return((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLocaleLowerCase())==="h264"});if(K<W){z.debug("raising H264 baseline profile priority");let oe=Z.videoCodecs[W];Z.videoCodecs.splice(W,1),Z.videoCodecs.splice(K,0,oe)}K!==-1&&(F.videoCodecs=F.videoCodecs.filter(oe=>{var ue,xe;return!(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLocaleLowerCase())==="h264"&&((xe=oe.fmtp)===null||xe===void 0?void 0:xe.parameters["profile-level-id"])!=="42001f")})),K!==-1&&ve("FILTER_SEND_H264_BASELINE")&&(U.videoCodecs=U.videoCodecs.filter(oe=>{var ue,xe;return!(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLocaleLowerCase())==="h264"&&((xe=oe.fmtp)===null||xe===void 0?void 0:xe.parameters["profile-level-id"])!=="42001f")}))}}return{send:U,recv:F,sendrecv:Z}}(r,a,c);try{o.close()}catch{}return{send:f,recv:g,sendrecv:v}}function ple(){let r={audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]},a=S3(arguments.length>2?arguments[2]:void 0,arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},"recvonly"),o={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},c={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},f={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(Du(r,a,"videoExtensions",o,c,f),Du(r,a,"videoCodecs",o,c,f),Du(r,a,"audioExtensions",o,c,f),Du(r,a,"audioCodecs",o,c,f),ve("RAISE_H264_BASELINE_PRIORITY")){let g=f.videoCodecs.findIndex(v=>v.rtpMap&&v.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&v.fmtp&&v.fmtp.parameters["profile-level-id"]==="42001f");if(g!==-1){let v=f.videoCodecs.findIndex(w=>w.rtpMap&&w.rtpMap.encodingName.toLocaleLowerCase()==="h264");if(v<g){z.debug("raising H264 baseline profile priority");let w=f.videoCodecs[g];f.videoCodecs.splice(g,1),f.videoCodecs.splice(v,0,w)}v!==-1&&(c.videoCodecs=c.videoCodecs.filter(w=>!(w.rtpMap&&w.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&w.fmtp&&w.fmtp.parameters["profile-level-id"]!=="42001f")))}}return{send:o,recv:c,sendrecv:f}}function Du(r,a,o,c,f,g){if(o==="videoExtensions"||o==="audioExtensions"){let v=[];return r[o].forEach(w=>{a[o].some((T,R)=>{if(w.entry===T.entry&&w.extensionName===T.extensionName)return v.push(R),!0})?g[o].push(w):c[o].push(w)}),void a[o].forEach((w,T)=>{v.indexOf(T)===-1&&f[o].push(w)})}if(o==="videoCodecs"||o==="audioCodecs"){let v=[];return r[o].forEach(w=>{a[o].some((T,R)=>{if(w.payloadType===T.payloadType&&JSON.stringify(w)===JSON.stringify(T))return v.push(R),!0})?g[o].push(w):c[o].push(w)}),void a[o].forEach((w,T)=>{v.indexOf(T)===-1&&f[o].push(w)})}}function Ub(r){let{send:a,recv:o,sendrecv:c}=r;if(!c){if(!a||!o)throw new Error("cannot merge rtp capabilities because one of send or recv is empty!");return{send:a,recv:o}}let f,g;return a?(f={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},f.audioCodecs=[...a.audioCodecs,...c.audioCodecs],f.videoCodecs=[...a.videoCodecs,...c.videoCodecs],f.audioExtensions=[...a.audioExtensions,...c.audioExtensions],f.videoExtensions=[...a.videoExtensions,...c.videoExtensions]):f=c,o?(g={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},g.audioCodecs=[...o.audioCodecs,...c.audioCodecs],g.videoCodecs=[...o.videoCodecs,...c.videoCodecs],g.audioExtensions=[...o.audioExtensions,...c.audioExtensions],g.videoExtensions=[...o.videoExtensions,...c.videoExtensions]):g=c,{send:f,recv:g}}function Uh(r){r.media.mediaType==="audio"&&r.attributes.payloads.filter(a=>{var o;return((o=a.rtpMap)===null||o===void 0?void 0:o.encodingName.toLowerCase())==="opus"}).forEach(a=>{a.fmtp||(a.fmtp={parameters:{}}),a.fmtp.parameters.stereo="1",a.fmtp.parameters["sprop-stereo"]="1"})}function a8(r){r.mediaDescriptions.forEach(a=>{a.media.mediaType!=="video"&&a.media.mediaType!=="audio"||a.attributes.payloads.forEach(o=>{o.rtcpFeedbacks.findIndex(c=>c.type==="rrtr")===-1&&o.rtcpFeedbacks.push({type:"rrtr"})})})}function R_(r,a,o,c){let f=[];if(r===Wt.VIDEO){if(ve("H264_PROFILE_LEVEL_ID")&&c==="h264"&&(f=a.videoCodecs.filter(g=>{var v;return Tt(v=g.rtpMap&&g.rtpMap.encodingName.toLowerCase()||"").call(v,c)&&g&&g.fmtp&&g.fmtp.parameters["profile-level-id"]===ve("H264_PROFILE_LEVEL_ID")})),!Array.isArray(f)||f.length===0){let g=[],v=[],w=[],T=[];if(o.videoCodecs.forEach(R=>{let A=R.rtpMap&&R.rtpMap.encodingName.toLowerCase()||"";Tt(A).call(A,c)?g.push(R):Tt(A).call(A,"vp9")?v.push(R):Tt(A).call(A,"vp8")?w.push(R):Tt(A).call(A,"h264")&&T.push(R)}),g.length===0){let R="";v.length!==0?(g=v,R="vp9"):w.length!==0?(g=w,R="vp8"):T.length!==0&&(g=T,R="h264"),z.warning("codec ".concat(c," not included in rtpCapabilities, fallback to default payloads: ").concat(R))}g.length!==0&&(f=a.videoCodecs.filter(R=>g.some(A=>A.payloadType===R.payloadType)))}if(f.length===0&&(z.warning("codec ".concat(c," not included in rtpCapabilities, fallback to default payloads: ").concat(a.videoCodecs[0].rtpMap&&a.videoCodecs[0].rtpMap.encodingName)),f=a.videoCodecs),ve("USE_PUB_RTX")||ve("USE_SUB_RTX")){let g=o$(f,a.videoCodecs);f=[...f,...g]}}else f=a.audioCodecs.filter(g=>{var v;return Tt(v=g.rtpMap&&g.rtpMap.encodingName.toLowerCase()||"").call(v,c)}),f.length===0&&(z.warning("codec ".concat(c," not included in rtpCapabilities, fallback to opus")),f=a.audioCodecs.filter(g=>{var v;return Tt(v=g.rtpMap&&g.rtpMap.encodingName.toLowerCase()||"").call(v,"opus")}));return f}function o$(r,a){let o=r.map(c=>c.payloadType.toString());return a.filter(c=>c.rtpMap&&c.rtpMap.encodingName==="rtx"&&c.fmtp&&c.fmtp.parameters.apt&&Tt(o).call(o,c.fmtp&&c.fmtp.parameters.apt))}let mle=class{get localCapabilities(){return zi(this._localCapabilities)}get rtpCapabilities(){return zi(this._rtpCapabilities)}get candidates(){return zi(this._candidates)}get iceParameters(){return zi(this._iceParameters)}get dtlsParameters(){return zi(this._dtlsParameters)}constructor(r){X(this,"sessionDesc",void 0),X(this,"_localCapabilities",void 0),X(this,"_rtpCapabilities",void 0),X(this,"_candidates",void 0),X(this,"_iceParameters",void 0),X(this,"_dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname","o/i14u9pJrxRKAsu"),X(this,"firefoxSsrcMidMap",new Map),r=zi(r);let{remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f,localCapabilities:g,direction:v,setup:w,videoCodec:T,audioCodec:R}=r,A;this.setup=w,A=v===oo.RECEIVE_ONLY?ir.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`):ir.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`),this._rtpCapabilities=f,this._candidates=c,this._iceParameters=a,this._dtlsParameters=o,this._localCapabilities=g;let L=v===oo.RECEIVE_ONLY?this.rtpCapabilities.send:this.rtpCapabilities.recv,U=v===oo.RECEIVE_ONLY?this._localCapabilities.recv:this._localCapabilities.send,F=v===oo.RECEIVE_ONLY?f.send.videoCodecs:R_(Wt.VIDEO,L,U,T),Z=v===oo.RECEIVE_ONLY?f.send.audioCodecs:R_(Wt.AUDIO,L,U,R);for(let W of A.mediaDescriptions)W.attributes.iceUfrag=a.iceUfrag,W.attributes.icePwd=a.icePwd,W.attributes.fingerprints=o.fingerprints,W.attributes.candidates=c,W.attributes.setup=this.setup,W.media.mediaType==="application"&&(W.attributes.sctpPort="5000"),W.media.mediaType==="video"&&(W.media.fmts=F.map(K=>K.payloadType.toString(10)),W.attributes.payloads=F,W.attributes.extmaps=L.videoExtensions),W.media.mediaType==="audio"&&(W.media.fmts=Z.map(K=>K.payloadType.toString(10)),W.attributes.payloads=Z,W.attributes.extmaps=L.audioExtensions,Uh(W));this.sessionDesc=A,this.currentMidIndex=A.mediaDescriptions.length-1}toString(){return ir.print(this.sessionDesc)}hasMid(r){return Array.isArray(r)?r.every(a=>this.hasMid(a)):this.sessionDesc.mediaDescriptions.some(a=>a.attributes.mid===r)}send(r,a,o,c,f){o=o.replace(/ /g,"-");let{ssrcs:g,ssrcGroups:v}=Uc(a,this.cname,ve("SYNC_GROUP")?o:void 0),w=this.findPreloadMediaDesc(g);if(w){if(Oi()&&this.firefoxSsrcMidMap.set(g[0].ssrcId,w.attributes.mid),f&&(f.twcc||f.remb)){let T=this.sessionDesc.mediaDescriptions.indexOf(w);return this.sessionDesc.mediaDescriptions[T]=this.mungSendMediaDesc(w,f),{mid:w.attributes.mid,needExchangeSDP:!0}}return{mid:w.attributes.mid,needExchangeSDP:!1}}{let T=this.findAvailableMediaIndex(r,g,c),R;return T===-1?(R=this.createOrRecycleSendMedia(r,g,v,"sendonly",c,f),this.updateBundleMids()):(R=zi(this.sessionDesc.mediaDescriptions[T]),R.attributes.direction="sendonly",R.attributes.ssrcs=g,R.attributes.ssrcGroups=v,this.sessionDesc.mediaDescriptions[T]=this.mungSendMediaDesc(R,f)),Oi()&&this.firefoxSsrcMidMap.set(g[0].ssrcId,R.attributes.mid),{needExchangeSDP:!0,mid:R.attributes.mid}}}stopSending(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>o.attributes.mid&&r.indexOf(o.attributes.mid)!==-1);if(a.length!==r.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");a.forEach(o=>{o.attributes.ssrcs=[]}),this.updateBundleMids()}receive(r,a,o){let c=[];return r.forEach(f=>{let g=f._mediaStreamTrack.kind,v=this.findAvailableRecvMediaIndex(g),w,T=!1;v===-1?(T=!0,w=this.createOrRecycleRecvMedia(f,[],"recvonly",a,o),this.updateBundleMids()):(w=zi(this.sessionDesc.mediaDescriptions[v]),w.attributes.direction="recvonly"),c.push({mid:w.attributes.mid,needCreateTransceiver:T})}),c}stopReceiving(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>r.indexOf(o.attributes.mid)!==-1);if(a.length!==r.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");a.forEach(o=>{o.media.port="0",o.attributes.direction="inactive"}),this.updateBundleMids()}addRemoteCandidate(r){let{foundation:a,protocol:o,address:c,port:f,type:g,relatedAddress:v,relatedPort:w,priority:T}=new RTCIceCandidate(r),R={foundation:a??"",componentId:"1",transport:o??"",priority:T?T+"":"",connectionAddress:c??"",port:f?f+"":"",type:g?g+"":"",relAddr:v??"",relPort:w?w+"":"",extension:{}};this.candidates.some(A=>A.priority===R.priority&&A.connectionAddress===R.connectionAddress&&A.port===R.port)||(this._candidates.push(R),this.sessionDesc.mediaDescriptions.forEach(A=>{A.attributes.candidates=this.candidates}))}clearRemoteCandidate(){this._candidates=[],this.sessionDesc.mediaDescriptions[0].attributes.candidates=this._candidates}createOrRecycleRecvMedia(r,a,o,c,f){let g=r._mediaStreamTrack.kind,v=this.rtpCapabilities.recv,w=R_(g,v,this.localCapabilities.send,g===Wt.AUDIO?f:c),T=g===Wt.VIDEO?v.videoExtensions:v.audioExtensions,R="".concat(++this.currentMidIndex),A={media:{mediaType:g,port:"9",protos:["UDP","TLS","RTP","SAVPF"],fmts:w.map(U=>U.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:[],extmaps:T,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:a,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:w,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:o,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(R)}};A=this.mungRecvMediaDsec(A,r);let L=this.findFirstClosedMedia(g);if(L){let U=this.sessionDesc.mediaDescriptions.indexOf(L);this.sessionDesc.mediaDescriptions[U]=A}else this.sessionDesc.mediaDescriptions.push(A);return A}muteRemote(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>Tt(r).call(r,o.attributes.mid||""));if(a.length!==r.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");a.forEach(o=>{o.attributes.direction="inactive"})}unmuteRemote(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>Tt(r).call(r,o.attributes.mid||""));if(a.length!==r.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");a.forEach(o=>{o.attributes.direction="recvonly"})}findAvailableMediaIndex(r,a,o){return this.sessionDesc.mediaDescriptions.findIndex(c=>{let f=c.media.mediaType===r&&c.media.port!=="0"&&(c.attributes.direction==="sendonly"||c.attributes.direction==="sendrecv")&&c.attributes.ssrcs.length===0;if(Oi()){if(f){let g=this.firefoxSsrcMidMap.get(a[0].ssrcId);return!(g||c.attributes.mid!=="0"&&c.attributes.mid!=="1")||!(!g||g!==c.attributes.mid)}return!1}return f&&c.attributes.mid===o})}findAvailableRecvMediaIndex(r){return this.sessionDesc.mediaDescriptions.findIndex(a=>{let o=a.media.mediaType===r&&a.media.port!=="0"&&(a.attributes.direction==="recvonly"||a.attributes.direction==="sendrecv");return a.attributes.mid!=="0"&&a.attributes.mid!=="1"&&o})}predictReceivingMids(r){let a=[];for(let o=0;o<r;o++)a.push((this.currentMidIndex+o+1).toString(10));return a}restartICE(r){r=zi(r),this._iceParameters=r,this.sessionDesc.mediaDescriptions.forEach(a=>{a.attributes.iceUfrag=r.iceUfrag,a.attributes.icePwd=r.icePwd})}createOrRecycleSendMedia(r,a,o,c,f,g){let v=this.rtpCapabilities.send,w=r===Wt.VIDEO?v.videoCodecs:v.audioCodecs,T=r===Wt.VIDEO?v.videoExtensions:v.audioExtensions;Oi()&&(f="".concat(++this.currentMidIndex));let R={media:{mediaType:r,port:"9",protos:["UDP","TLS","RTP","SAVPF"],fmts:w.map(L=>L.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:[],extmaps:T,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:a,ssrcGroups:o,rtcpFeedbackWildcards:[],payloads:w,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:c,rtcpMux:!0,rtcpRsize:!0,mid:f}};R=this.mungSendMediaDesc(R,g);let A=this.findFirstClosedMedia(r);if(A){let L=this.sessionDesc.mediaDescriptions.indexOf(A);this.sessionDesc.mediaDescriptions[L]=R}else this.sessionDesc.mediaDescriptions.push(R);return R}mungRecvMediaDsec(r,a,o){let c=zi(r);return r8(c),e1(c,a),s8(c,a),r$(c),jb(c,o,this.localCapabilities.send),c}mungSendMediaDesc(r,a){let o=zi(r);return jb(o,a,this.localCapabilities.recv),Uh(o),o}updateRecvMedia(r,a){let o=this.sessionDesc.mediaDescriptions.findIndex(c=>c.attributes.mid===r);if(o!==-1){let c=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[o],a);this.sessionDesc.mediaDescriptions[o]=c}}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter(r=>r.media.port!=="0").map(r=>r.attributes.mid)}findPreloadMediaDesc(r){return this.sessionDesc.mediaDescriptions.find(a=>{var o;return((o=a.attributes)===null||o===void 0||(o=o.ssrcs[0])===null||o===void 0?void 0:o.ssrcId)===r[0].ssrcId})}findFirstClosedMedia(r){return this.sessionDesc.mediaDescriptions.find(a=>Oi()?a.media.port==="0"&&a.media.mediaType===r:a.media.port==="0")}},tNe=["sdp"];var Wi;function gle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function t1(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?gle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):gle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let vle=(Wi=class lC extends Qie{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get dtlsTransportState(){var a,o;return(a=(o=this.peerConnection.getReceivers()[0])===null||o===void 0||(o=o.transport)===null||o===void 0?void 0:o.state)!==null&&a!==void 0?a:null}get localCodecs(){return[]}set isInRestartIce(a){this._isInRestartIce=a}get isInRestartIce(){return this._isInRestartIce}constructor(a,o,c){super(a,o),X(this,"direction",void 0),X(this,"name",void 0),X(this,"store",void 0),X(this,"spec",void 0),X(this,"peerConnection",void 0),X(this,"initialOffer",void 0),X(this,"transport",void 0),X(this,"statsFilter",void 0),X(this,"localCandidateCount",0),X(this,"_isInRestartIce",!1),X(this,"mutex",new As("P2PConnection-mutex")),X(this,"onLocalCandidate",void 0),X(this,"remoteSDP",void 0),X(this,"pendingCandidates",[]),X(this,"localCapabilities",void 0),X(this,"isReady",!1),X(this,"restartCnt",0),X(this,"curTurnServerIndex",0),this.store=o,this.spec=a,this.peerConnection=new RTCPeerConnection(lC.resolvePCConfiguration(a,o.p2pTransport),{optional:[{googDscp:!0}]}),this.direction=c??oo.SEND_ONLY,this.name=this.direction===oo.SEND_ONLY?"sendP2PConnection":"recvP2PConnection",this.statsFilter=i8(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Oi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1}async establish(a){try{let o=await a$();if(this.localCapabilities=Ub(o),a){let{sdp:c}=a,f=J4e(a,tNe),g=function(){let A={audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]},L=S3(arguments.length>2?arguments[2]:void 0,arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},"sendonly"),U={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},F={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},Z={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(Du(L,A,"videoExtensions",U,F,Z),Du(L,A,"videoCodecs",U,F,Z),Du(L,A,"audioExtensions",U,F,Z),Du(L,A,"audioCodecs",U,F,Z),ve("RAISE_H264_BASELINE_PRIORITY")){let W=Z.videoCodecs.findIndex(K=>K.rtpMap&&K.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&K.fmtp&&K.fmtp.parameters["profile-level-id"]==="42001f");if(W!==-1){let K=Z.videoCodecs.findIndex(oe=>oe.rtpMap&&oe.rtpMap.encodingName.toLocaleLowerCase()==="h264");if(K<W){z.debug("raising H264 baseline profile priority");let oe=Z.videoCodecs[W];Z.videoCodecs.splice(W,1),Z.videoCodecs.splice(K,0,oe)}K!==-1&&ve("FILTER_SEND_H264_BASELINE")&&(U.videoCodecs=U.videoCodecs.filter(oe=>!(oe.rtpMap&&oe.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&oe.fmtp&&oe.fmtp.parameters["profile-level-id"]!=="42001f")))}}return{send:U,recv:F,sendrecv:Z}}({},{},c);this.remoteSDP=new mle({remoteIceParameters:f.iceParameters,remoteDtlsParameters:f.dtlsParameters,candidates:[],remoteRTPCapabilities:g,localCapabilities:this.localCapabilities,direction:this.direction,setup:"actpass",videoCodec:this.store.codec,audioCodec:this.store.audioCodec}),await this.setRemoteDescription({type:"offer",sdp:this.remoteSDP.toString()}),this.isReady=!0;let v=await this.peerConnection.createAnswer();if(!v.sdp)throw new Error("Cannot get answer sdp when trying to establish PeerConnection.");let w=jh(v.sdp);await this.peerConnection.setLocalDescription(v);let T=await ple({},{},v.sdp);this.localCapabilities=Ub(T);let R=this.peerConnection.getTransceivers()[0];return R!=null&&R.receiver&&R.receiver.transport&&this.tryBindTransportEvents(R.receiver.transport),t1(t1({},w),{},{sdp:v.sdp})}{this.peerConnection.addTransceiver("video",{direction:"sendonly"}),this.peerConnection.addTransceiver("audio",{direction:"sendonly"});let c=await this.peerConnection.createOffer();if(!c.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let f=jh(c.sdp);return this.initialOffer=c,t1(t1({},f),{},{sdp:c.sdp})}}catch(o){throw new Ke(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,o.toString())}}async connect(a){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");await this.peerConnection.setLocalDescription(this.initialOffer);let{sdp:o,iceParameters:c,dtlsParameters:f}=a,g=await ple({},{},o);this.remoteSDP=new mle({remoteIceParameters:c,remoteDtlsParameters:f,candidates:[],remoteRTPCapabilities:g,localCapabilities:this.localCapabilities,direction:this.direction,setup:"active",videoCodec:this.store.codec,audioCodec:this.store.audioCodec}),await this.setRemoteDescription({type:"answer",sdp:this.remoteSDP.toString()});let v=this.peerConnection.getTransceivers()[0];v!=null&&v.sender&&v.sender.transport&&this.tryBindTransportEvents(v.sender.transport)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(o.toString()))}}async addRemoteCandidate(a){try{a&&this.pendingCandidates.push(a),this.peerConnection.remoteDescription&&this.isReady&&(this.pendingCandidates.forEach(o=>{this.peerConnection.addIceCandidate(o)}),this.pendingCandidates=[])}catch(o){throw new Ke(ce.ADD_CANDIDATE_FAILED,"P2PConnection.addRemoteCandidate failed; ".concat(o.toString()))}}send(a,o,c){var f=this;return zl(function*(){let g=yield Dn(f.mutex.lock("From P2PConnection.send"));try{if(!f.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");let v=[],w=f.remoteSDP.receive(a,o,c);a.forEach((K,oe)=>{if(w[oe].needCreateTransceiver){let ue=f.peerConnection.addTransceiver(K._mediaStreamTrack,{direction:"sendonly"});v.push(ue),K._updateRtpTransceiver(ue)}else{let ue=f.peerConnection.getTransceivers().find(xe=>xe.mid===w[oe].mid);if(!ue)throw new Error("cannot find transceiver when sendPeerconnection send, mid is ".concat(w[oe].mid));v.push(ue),K._updateRtpTransceiver(ue)}}),Oi()&&ve("SIMULCAST")===!0&&(yield Dn(f.applySimulcastForFirefox(v,a)));let T=w.map(K=>K.mid),R=yield Dn(f.peerConnection.createOffer()),A=f.mungSendOfferSDP(R.sdp,a,T),L=ir.parse(A),U=T.map(K=>{let oe=L.mediaDescriptions.find(ue=>ue.attributes.mid===K);if(!oe)throw new Error("Cannot extract ssrc from mediaDescription.");return i$(oe,ve("USE_PUB_RTX"))}),F=v.map((K,oe)=>{let ue=T[oe];return{localSSRC:U[oe],id:ue}});yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:A}));try{yield F}catch(K){let oe=f.remoteSDP.toString();throw yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:A})),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:oe})),yield Dn(f.stopSending(T,!0)),K}yield Dn(f.applySimulcastEncodings(v,a)),yield Dn(f.applySendEncodings(v,a));let Z=f.remoteSDP.toString(),W=f.logSDPExchange(A,"offer","local","send");return W==null||W(Z),yield Dn(f.setRemoteDescription({type:"answer",sdp:Z})),v.map((K,oe)=>{let ue=T[oe];return{localSSRC:U[oe],id:ue}})}catch(v){throw v instanceof Ke?v:new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(v.toString()))}finally{g()}})()}async stopSending(a,o){let c=o?void 0:await this.mutex.lock("From P2PConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");let f=this.peerConnection.getTransceivers().filter(T=>a.indexOf(T.mid)!==-1);if(f.length!==a.length)throw new Error("Transceivers' length (".concat(f.length,") doesn't match mids' length (").concat(a.length,") when trying to call P2PConnection.stopSending."));f.map(T=>{var R;T.direction="inactive",(R=T.stop)===null||R===void 0||R.call(T)});let g=await this.peerConnection.createOffer(),v=this.logSDPExchange(g.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(g),this.remoteSDP.stopReceiving(a);let w=this.remoteSDP.toString();v==null||v(w),await this.setRemoteDescription({type:"answer",sdp:w})}catch(f){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(f.toString()))}finally{c&&c()}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{mid:g,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let T=this.remoteSDP.toString(),R=this.logSDPExchange(T,"offer","remote","receive");await this.setRemoteDescription({type:"offer",sdp:T});let A=await this.peerConnection.createAnswer(),L=this.mungReceiveAnswerSDP(A.sdp,g,a);R==null||R(L||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:L}),z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," no need to exchange SDP."));let w=this.peerConnection.getTransceivers().find(T=>T.mid===g);if(!w||w.mid===null)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:w.receiver.track,mid:w.mid,transceiver:w}}catch(g){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(g.toString()))}}async mockReceive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{mid:g,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let w=this.remoteSDP.toString(),T=this.logSDPExchange(w,"offer","remote","receive");await this.setRemoteDescription({type:"offer",sdp:w});let R=await this.peerConnection.createAnswer(),A=this.mungReceiveAnswerSDP(R.sdp,g,a);T==null||T(A||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:A}),z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," no need to exchange SDP."))}catch(g){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(g.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","stopReceiving");await this.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}async restartICE(a){try{if(this.store.p2pTransport===c_.Auto&&(this.store.p2pTransport=c_.SdRtn,Jn().supportPCSetConfiguration&&this.peerConnection.setConfiguration(lC.resolvePCConfiguration(this.spec,this.store.p2pTransport))),this.restartCnt>3&&(this.restartCnt=0,Jn().supportPCSetConfiguration&&this.peerConnection.setConfiguration(lC.resolvePCConfiguration(this.spec,this.store.p2pTransport,++this.curTurnServerIndex))),!a){this.restartCnt++,this.isReady=!1;let o=await this.peerConnection.createOffer({iceRestart:!0});if(!o.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let{iceParameters:c}=jh(o.sdp);return this.store.descriptionStart(),this.direction===oo.SEND_ONLY&&await this.peerConnection.setLocalDescription(o),c}if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");if(this.remoteSDP.restartICE(a),this.store.descriptionStart(),this.direction===oo.RECEIVE_ONLY){this.restartCnt++,await this.setRemoteDescription({type:"offer",sdp:this.remoteSDP.toString()});let o=await this.peerConnection.createAnswer();if(!o.sdp)throw new Error("Cannot get answer sdp when trying to iceRestart.");let{iceParameters:c}=jh(o.sdp);return await this.peerConnection.setLocalDescription(o),c}await this.setRemoteDescription({type:"answer",sdp:this.remoteSDP.toString()}),this.isReady=!0}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}close(){var a;this.peerConnection.close(),this.peerConnection.onicecandidate=null,(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.tryUnbindTransportEvents(),this.unbindPCEvents(),this.unbindStatsEvents(),this.transport=void 0,this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o],[a]);this.remoteSDP.updateRecvMedia(a,o);let g=this.remoteSDP.toString(),v=this.logSDPExchange(f,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),v==null||v(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(c){throw new Ke(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getTransceivers().filter(f=>f.mid===a);c.length===1&&(this.isVP8Simulcast(o)?Oi()||await this.applySimulcastEncodings(c,[o]):await this.applySendEncodings(c,[o]))}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getTransceivers().find(f=>f.mid===o);c&&await c.sender.replaceTrack(a._mediaStreamTrack)}async getSelectedCandidatePair(){let a=this.peerConnection.getReceivers();if(a.length>0&&a[0].transport&&a[0].transport.iceTransport&&a[0].transport.iceTransport.getSelectedCandidatePair&&a[0].transport.iceTransport.getSelectedCandidatePair()){let o=a[0].transport.iceTransport,{local:c,remote:f}=o.getSelectedCandidatePair();return{local:t1(t1({},Zf),{},{candidateType:c.type,protocol:c.protocol,address:c.address,port:c.port}),remote:t1(t1({},Zf),{},{candidateType:f.type,protocol:f.protocol,address:f.address,port:f.port})}}return this.statsFilter.getSelectedCandidatePair()}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a,o;Tt(a=["connected","completed"]).call(a,this.peerConnection.iceConnectionState)&&(this.isReady=!1),(o=this.onICEConnectionStateChange)===null||o===void 0||o.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;this.peerConnection.connectionState==="connected"&&(this.restartCnt=0),(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.startICECandidate()}startICECandidate(){this.peerConnection.onicecandidate||(this.localCandidateCount=0,this.peerConnection.onicecandidate=a=>{if(a.candidate){var o;a.candidate.candidate&&((o=this.onLocalCandidate)===null||o===void 0||o.call(this,a.candidate.toJSON())),this.localCandidateCount+=1}else z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount)})}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a,o){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,f={iceServers:[]};var g;return a.iceServers?f.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(rb(a.turnServer.servers)?f.iceServers=a.turnServer.servers:(f.iceServers&&f.iceServers.push(...lC.turnServerConfigToIceServers(a.turnServer.servers,o,c)),ve("USE_TURN_SERVER_OF_GATEWAY")&&f.iceServers&&a.turnServer.serversFromGateway&&f.iceServers.push(...lC.turnServerConfigToIceServers(a.turnServer.serversFromGateway,o,c)),Tt(g=[c_.Relay,c_.SdRtn]).call(g,o)&&(f.iceTransportPolicy="relay"),ve("FORCE_TURN_TCP")?f.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(v=>{v.forceturn&&(f.iceTransportPolicy="relay")}))),ve("ENABLE_ENCODED_TRANSFORM")&&Jn().supportWebRTCEncodedTransform&&(f.encodedInsertableStreams=!0),z.debug("P2PConnection p2pTransport is ".concat(o)),f}static turnServerConfigToIceServers(a,o){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,f=[],g=a.filter(w=>w.tcpport);z.debug("P2PConnection turnServers is ".concat(g,", current index is ").concat(c));let v=g.length>c?g[c]:g[0];switch(o){case c_.SdRtn:let w=a.filter(R=>{var A;return Tt(A=R.username).call(A,"glb:")&&R.turnServerURL==R.turnServerURL}),T=w.length>c?w[c]:w[0];T&&(f.push({username:T.username,credential:T.password,credentialType:"password",urls:"turn:".concat($0(T.turnServerURL),":").concat(T.tcpport,"?transport=udp")}),f.push({username:T.username,credential:T.password,credentialType:"password",urls:"turns:".concat($0(T.turnServerURL),":").concat(T.tcpport,"?transport=tcp")}));break;case c_.Relay:v&&(f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turn:".concat(v.turnServerURL,":").concat(v.tcpport,"?transport=udp")}),f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turns:".concat($0(v.turnServerURL),":").concat(v.tcpport,"?transport=tcp")}));break;default:v&&(f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turn:".concat(v.turnServerURL,":").concat(v.tcpport,"?transport=udp")}),f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turns:".concat($0(v.turnServerURL),":").concat(v.tcpport,"?transport=tcp")}),f.push({username:v.username,credential:v.password,credentialType:"password",urls:"stun:".concat(v.turnServerURL,":").concat(v.tcpport)}))}return f}tryBindTransportEvents(a){if(a){this.transport=a,a.onstatechange=()=>{var c;a!=null&&a.state&&((c=this.onDTLSTransportStateChange)===null||c===void 0||c.call(this,a.state))},a.onerror=c=>{var f;(f=this.onDTLSTransportError)===null||f===void 0||f.call(this,"error"in c?c.error:c)};let o=a.iceTransport;o&&(o.onstatechange=()=>{let c=a==null?void 0:a.iceTransport.state;var f;c&&((f=this.onICETransportStateChange)===null||f===void 0||f.call(this,c))},o.getSelectedCandidatePair&&(o.onselectedcandidatepairchange=()=>{if(o.getSelectedCandidatePair()){let{local:c,remote:f}=o.getSelectedCandidatePair();z.info("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] selectedcandidatepairchange: local ").concat(JSON.stringify({candidateType:c.type,protocol:c.protocol}),", remote ").concat(JSON.stringify({candidateType:f.type,protocol:f.protocol,address:f.address,port:f.port})," )"))}}))}}tryUnbindTransportEvents(){this.transport&&(this.transport.onstatechange=null,this.transport.onerror=null,this.transport.iceTransport&&(this.transport.iceTransport.onstatechange=null))}async updateRtpSenderEncodings(a,o){var c;if(o||(o=this.peerConnection.getSenders().find(A=>A.track===a._mediaStreamTrack)),!o)return z.warn("[".concat(a.getTrackId(),"] no rtpSender found}"));if(this.isVP8Simulcast(a))return z.warn("[updateRtpSenderEncodings] Track is VP8 simulcast, please apply simulcast encodings");if(!Jn().supportSetRtpSenderParameters)return z.warn("[updateRtpSenderEncodings] Browser not support set rtp-sender parameters");let f={},g={};switch(a._optimizationMode){case"motion":f.degradationPreference="maintain-framerate";break;case"detail":f.degradationPreference="maintain-resolution";break;default:f.degradationPreference="balanced"}if(a._encoderConfig){var v;let{bitrateMax:A,frameRate:L,scaleResolutionDownBy:U}=a._encoderConfig;A&&(g.maxBitrate=1e3*A),Tt(v=a._hints).call(v,Hi.LOW_STREAM)&&(L&&(g.maxFramerate=cl(L)),U&&U>=1&&(g.scaleResolutionDownBy=U))}if(ve("DSCP_TYPE")&&F0()){var w;let A=ve("DSCP_TYPE");Tt(w=["very-low","low","medium","high"]).call(w,A)&&(g.networkPriority=A)}let T=o.getParameters(),R=(c=T.encodings)===null||c===void 0?void 0:c[0];Oi()&&!R&&(f.encodings=[g]),R&&Object.assign(R,g),Object.assign(T,f),z.debug("[".concat(a.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(T.encodings))),await o.setParameters(T)}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let c=0;c<a.length;c++){let f=a[c],g=o[c];g instanceof Di&&!this.isVP8Simulcast(g)&&await this.updateRtpSenderEncodings(g,f.sender)}}catch{z.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}}mungSendOfferSDP(a,o,c){let f=ir.parse(a);return o.forEach((g,v)=>{let w=c[v],T=f.mediaDescriptions.find(R=>R.attributes.mid===w);T&&(e1(T,g),s$(T,g,this.store.codec))}),ir.print(f)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onFirstVideoDecodedTimeout=a=>{var o;(o=this.onFirstVideoDecodedTimeout)===null||o===void 0||o.call(this,a)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0,this.statsFilter.onFirstVideoDecodedTimeout=void 0}async applySimulcastForFirefox(a,o){if(a.length===o.length)for(let T=0;T<a.length;T++){var c,f,g,v,w;let R=a[T],A=o[T];if(A instanceof Di&&!Tt(c=A._hints).call(c,Hi.LOW_STREAM)&&(f=A._encoderConfig)!==null&&f!==void 0&&f.bitrateMax&&((g=A._encoderConfig)===null||g===void 0?void 0:g.bitrateMax)>200&&(v=A._scalabilityMode)!==null&&v!==void 0&&v.numSpatialLayers&&((w=A._scalabilityMode)===null||w===void 0?void 0:w.numSpatialLayers)>1&&this.store.codec==="vp8"){let L={},U={high:1e3*(A._encoderConfig.bitrateMax-50),medium:5e4};L.encodings=[{rid:"m",active:!0,maxBitrate:U.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:U.high}];let F=R.sender.getParameters();await R.sender.setParameters(Object.assign(F,L))}}}async applySimulcastEncodings(a,o){if(!Oi()&&a.length===o.length)for(let c=0;c<a.length;c++){let f=o[c];if(f instanceof Di&&this.isVP8Simulcast(f)){let g=a[c],v={},w={high:1e3*(f._encoderConfig.bitrateMax-50),medium:5e4};v.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:w.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:w.medium,scaleResolutionDownBy:4}];let T=g.sender.getParameters();await g.sender.setParameters(Object.assign(T,v))}}}isVP8Simulcast(a){var o,c,f,g,v;return!!(a instanceof Di&&ve("SIMULCAST")&&this.store.codec==="vp8"&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&(c=a._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&((f=a._encoderConfig)===null||f===void 0?void 0:f.bitrateMax)>200&&(g=a._scalabilityMode)!==null&&g!==void 0&&g.numSpatialLayers&&((v=a._scalabilityMode)===null||v===void 0?void 0:v.numSpatialLayers)>1)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("[".concat(this.store.clientId,"] exchanging ").concat(c," ").concat(o," SDP during P2PConnection.").concat(f,`
`),a),o==="offer"?g=>{this.logSDPExchange(g,"answer",c==="local"?"remote":"local",f)}:void 0}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(v=>{v.direction="inactive"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.muteRemote(a);let g=this.remoteSDP.toString();f==null||f(g),await this.setRemoteDescription({type:"answer",sdp:g})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(async v=>{v.direction="sendonly"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.unmuteRemote(a);let g=this.remoteSDP.toString();f==null||f(g),await this.setRemoteDescription({type:"answer",sdp:g})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(o.toString()))}}async getRemoteSSRC(a,o){var c,f;if(o=(c=o)!==null&&c!==void 0?c:(f=this.currentRemoteDescription)===null||f===void 0?void 0:f.sdp){var g;let v=(g=ir.parse(o).mediaDescriptions.find(w=>w.attributes.mid===a))===null||g===void 0?void 0:g.attributes.ssrcs;return v==null?void 0:v[0].ssrcId}}async setRemoteDescription(a){var o;await this.peerConnection.setRemoteDescription(a),Tt(o=["connected","completed"]).call(o,this.peerConnection.iceConnectionState)||(this.isReady=!0,this.addRemoteCandidate())}mungReceiveAnswerSDP(a,o,c){let f=ir.parse(a),g=f.mediaDescriptions.find(v=>v.attributes.mid===o);return g&&c===Wt.AUDIO&&g.media.mediaType==="audio"&&Uh(g),ir.print(f)}},vt(Wi.prototype,"establish",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"establish"),Wi.prototype),vt(Wi.prototype,"connect",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"connect"),Wi.prototype),vt(Wi.prototype,"receive",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"receive"),Wi.prototype),vt(Wi.prototype,"mockReceive",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"mockReceive"),Wi.prototype),vt(Wi.prototype,"stopReceiving",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"stopReceiving"),Wi.prototype),vt(Wi.prototype,"restartICE",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"restartICE"),Wi.prototype),vt(Wi.prototype,"close",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"close"),Wi.prototype),vt(Wi.prototype,"updateEncoderConfig",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"updateEncoderConfig"),Wi.prototype),vt(Wi.prototype,"updateSendParameters",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"updateSendParameters"),Wi.prototype),vt(Wi.prototype,"replaceTrack",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"replaceTrack"),Wi.prototype),vt(Wi.prototype,"muteLocal",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"muteLocal"),Wi.prototype),vt(Wi.prototype,"unmuteLocal",[ku],Object.getOwnPropertyDescriptor(Wi.prototype,"unmuteLocal"),Wi.prototype),Wi);function ku(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,g=await f.lock("From P2PConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),T=0;T<v;T++)w[T]=arguments[T];return await c.apply(this,w)}finally{g()}},o}function l$(r,a){let o=document.createElement("video"),c=document.createElement("canvas");o.setAttribute("style","display:none"),c.setAttribute("style","display:none"),o.setAttribute("muted",""),o.muted=!0,o.setAttribute("autoplay",""),o.autoplay=!0,o.setAttribute("playsinline",""),c.width=cl(a.width),c.height=cl(a.height);let f=cl(a.framerate||15);document.body.append(o),document.body.append(c);let g=r._mediaStreamTrack;o.srcObject=new MediaStream([g]),o.play();let v=c.getContext("2d");if(!v)throw new De(ce.UNEXPECTED_ERROR,"can not get canvas context");let w=Jn(),T=c.captureStream(w.supportRequestFrame?0:f).getVideoTracks()[0];T.canvas||(T.canvas=c),c.startCapture=()=>{if(!o)return c.stopCapture&&c.stopCapture();if(o.paused&&o.play(),o.videoHeight>2&&o.videoWidth>2){let A=o.videoWidth,L=o.videoHeight/A,U=c.width*L;Math.abs(U-c.height)>=2&&(z.debug("adjust low stream resolution","".concat(c.width,"x").concat(c.height," -> ").concat(c.width,"x").concat(U)),c.height=U)}v.drawImage(o,0,0,c.width,c.height),T.requestFrame&&T.requestFrame(),g!==r._mediaStreamTrack&&(g=r._mediaStreamTrack,o.srcObject=new MediaStream([g]))},c.stopCapture=HW(()=>c.startCapture&&c.startCapture(),f);let R=T.stop;return T.stop=()=>{R.call(T),o&&(o.remove(),o.srcObject=null,o=null),c&&(c.width=0,c.remove(),c.stopCapture&&c.stopCapture(),c.startCapture=void 0,c.stopCapture=void 0,c=null),z.debug("clean low stream renderer")},T}var o8=function(r){return r[r.HEIGHT=2033]="HEIGHT",r[r.FRAME_RATE=2034]="FRAME_RATE",r[r.WIDTH=2035]="WIDTH",r}(o8||{}),ws=function(r){return r[r.FRAME_RATE=2002]="FRAME_RATE",r[r.WIDTH=2003]="WIDTH",r[r.HEIGHT=2004]="HEIGHT",r[r.PACKAGE_LOST=2005]="PACKAGE_LOST",r[r.AVG_ENCODE=2007]="AVG_ENCODE",r[r.NACKS=2009]="NACKS",r[r.PLIS=2010]="PLIS",r[r.FIRS=2011]="FIRS",r[r.BITRATE=2012]="BITRATE",r[r.PACKAGE_RATE=2031]="PACKAGE_RATE",r[r.ADAPTATION=2032]="ADAPTATION",r[r.ACTUAL_ENCODED=2060]="ACTUAL_ENCODED",r[r.BANDWIDTH=2061]="BANDWIDTH",r[r.RETRANSMIT=2062]="RETRANSMIT",r[r.TARGET_ENCODED=2064]="TARGET_ENCODED",r[r.TRANSMIT=2066]="TRANSMIT",r[r.FREEZE=2082]="FREEZE",r[r.DISABLED=2095]="DISABLED",r[r.PLAYER_STATUS=2128]="PLAYER_STATUS",r[r.QP_SUM=2143]="QP_SUM",r}(ws||{}),x_=function(r){return r[r.BITRATE=2069]="BITRATE",r[r.PACKAGE_LOST=2070]="PACKAGE_LOST",r[r.PACKAGE_RATE=2071]="PACKAGE_RATE",r[r.HEIGHT=2073]="HEIGHT",r[r.FRAME_RATE=2075]="FRAME_RATE",r[r.WIDTH=2077]="WIDTH",r}(x_||{}),xa=function(r){return r[r.JITTER=-1]="JITTER",r[r.PACKAGE_LOST=2014]="PACKAGE_LOST",r[r.WIDTH=2018]="WIDTH",r[r.HEIGHT=2019]="HEIGHT",r[r.FRAME_RATE=2020]="FRAME_RATE",r[r.JITTER_BUFFER=2023]="JITTER_BUFFER",r[r.CURRENT_DELAY=2024]="CURRENT_DELAY",r[r.NACKS=2026]="NACKS",r[r.PLIS=2027]="PLIS",r[r.FIRS=2028]="FIRS",r[r.BITRATE=2029]="BITRATE",r[r.PACKAGE_RATE=2078]="PACKAGE_RATE",r[r.FREEZE=2084]="FREEZE",r[r.DISABLED=2101]="DISABLED",r[r.PLAYER_STATUS=2129]="PLAYER_STATUS",r[r.QP_SUM=2144]="QP_SUM",r[r.I_FRAME_DELAY=2149]="I_FRAME_DELAY",r}(xa||{}),A_=function(r){return r[r.FRAME_RATE_DECODE=2021]="FRAME_RATE_DECODE",r[r.FRAME_RATE_RENDER=2022]="FRAME_RATE_RENDER",r[r.FRAME_RATE_OUTPUT=2155]="FRAME_RATE_OUTPUT",r[r.FREEZE_TIME=2109]="FREEZE_TIME",r[r.FREEZE_TIME_RENDER=2147]="FREEZE_TIME_RENDER",r[r.FREEZE_DURATION=2156]="FREEZE_DURATION",r}(A_||{}),yle=function(r){return r[r.PCM_LEVEL=2104]="PCM_LEVEL",r}(yle||{}),n1=function(r){return r[r.PACKAGE_LOST=-1]="PACKAGE_LOST",r[r.LEVEL=2038]="LEVEL",r[r.BITRATE=2039]="BITRATE",r[r.PACKAGE_RATE=2040]="PACKAGE_RATE",r[r.AEC_RETURN_LOSS=2041]="AEC_RETURN_LOSS",r[r.AEC_RETURN_LOSS_ENH=2042]="AEC_RETURN_LOSS_ENH",r[r.FREEZE=2081]="FREEZE",r[r.DISABLED=2096]="DISABLED",r}(n1||{}),Mu=function(r){return r[r.BITRATE=2044]="BITRATE",r[r.PACKAGE_LOST=2045]="PACKAGE_LOST",r[r.PACKAGE_RATE=2046]="PACKAGE_RATE",r[r.CURRENT_DELAY=2047]="CURRENT_DELAY",r[r.JITTER_BUFFER=2054]="JITTER_BUFFER",r[r.JITTER=2055]="JITTER",r[r.FREEZE=2083]="FREEZE",r[r.DISABLED=2102]="DISABLED",r[r.PCM_LEVEL=2105]="PCM_LEVEL",r[r.PLAYER_STATUS=2130]="PLAYER_STATUS",r[r.CONCEALED_SAMPLES=2148]="CONCEALED_SAMPLES",r}(Mu||{}),_le=function(r){return r[r.FREEZE_TIME=-1]="FREEZE_TIME",r[r.LEVEL=2043]="LEVEL",r}(_le||{}),Ed=function(r){return r[r.RTT=2006]="RTT",r[r.CONN_TYPE=801]="CONN_TYPE",r}(Ed||{});let Lm=1e3,I_=3;function jn(r,a,o){o!=null&&Number.isFinite(o)&&(r[a]=Math.round(Math.max(0,o)))}function Ele(r){let a={[Ed.CONN_TYPE]:0,[Ed.RTT]:r.rtt};switch(r.selectedCandidatePair.localCandidate.candidateType){case"relay":{let o=r.selectedCandidatePair.localCandidate.relayProtocol;o==="udp"&&(a[Ed.CONN_TYPE]=1),o==="tcp"&&(a[Ed.CONN_TYPE]=3),o==="tls"&&(a[Ed.CONN_TYPE]=4);break}case"srflx":a[Ed.CONN_TYPE]=2}return a}function wle(r){let a=0;switch(r){case"none":a=0;break;case"cpu":a=1;break;case"bandwidth":a=2;break;case"other":a=3}return a}class Sle extends tr{constructor(a){super(),X(this,"store",void 0),X(this,"uploadWRTCStatsTimer",void 0),X(this,"uploadOutboundDenoiserStatsTimer",void 0),X(this,"uploadExtStatsTimer",void 0),X(this,"uploadExtUsageStatsTimer",void 0),X(this,"uploadInboundExtStatsTimer",void 0),X(this,"requestStats",void 0),X(this,"requestTransportStats",void 0),X(this,"requestLocalMedia",void 0),X(this,"requestRemoteMedia",void 0),X(this,"requestAllTracks",void 0),X(this,"requestVideoIsReady",void 0),X(this,"requestUploadStats",void 0),X(this,"requestUpload",void 0),X(this,"uploadOutboundStarted",!1),X(this,"uploadInboundStarted",!1),X(this,"uploadTransportStarted",!1),X(this,"uploadExtensionUsageStarted",!1),X(this,"lastRecvStats",void 0),X(this,"lastSendStats",void 0),X(this,"lastFullRecvStats",void 0),X(this,"lastFullSendStats",void 0),X(this,"needUploadRenderFreezeTime",!0),this.store=a}uploadWRTCStats(a){if(!this.requestStats||!this.requestUploadStats)return;let o,c;if(this.uploadTransportStarted&&(o=this.requestStats(),this.store.useP2P&&(c=this.requestStats(!0))),!o&&this.uploadOutboundStarted&&(o=this.requestStats()),!c&&this.uploadInboundStarted&&(c=this.requestStats(!0)),o||c){let f={};if(this.uploadTransportStarted&&o){let g=this.getTransportStats(o,c,a);g&&(f.misc=[g])}if(this.uploadOutboundStarted&&o){let g=this.getOutboundStats(o,a?this.lastSendStats:this.lastFullSendStats,a);g&&(f.outbound=[g])}if(this.uploadInboundStarted&&c){let g=this.getInboundStats(c,a?this.lastRecvStats:this.lastFullRecvStats,a);g&&(f.inbound=g)}this.requestUploadStats(f)}this.lastRecvStats=c,this.lastSendStats=o,a||(this.lastFullRecvStats=c,this.lastFullSendStats=o)}startUploadWRTCStats(){if(this.uploadWRTCStatsTimer)return;let a=1;this.uploadWRTCStatsTimer=window.setInterval(()=>{if(!this.uploadTransportStarted&&!this.uploadInboundStarted&&!this.uploadOutboundStarted)return this.stopUploadWRTCStats();this.uploadWRTCStats(a!==I_),++a===I_+1&&(a=1)},Lm)}stopUploadWRTCStats(){window.clearInterval(this.uploadWRTCStatsTimer),this.uploadWRTCStatsTimer=void 0,this.lastSendStats&&(this.lastSendStats.videoSend=[],this.lastSendStats.audioSend=[],this.lastSendStats=void 0),this.lastRecvStats&&(this.lastRecvStats.videoRecv=[],this.lastRecvStats.audioRecv=[],this.lastRecvStats=void 0)}getTransportStats(a,o,c){if(!this.requestStats)return;if(c)return a.rtt==null?void 0:{addition:{[Ed.RTT]:a.rtt,[Ed.CONN_TYPE]:void 0}};let f=Ele(a);if(this.store.useP2P){if(o){let g=Ele(o);f[Ed.CONN_TYPE]+=g[Ed.CONN_TYPE]<<3}f[Ed.CONN_TYPE]+=110}else f[Ed.CONN_TYPE]+=100;return{addition:f}}getOutboundStats(a,o,c){if(!this.requestUploadStats||!this.requestLocalMedia)return;let f=this.requestLocalMedia();if(!f||f.length===0)return;let g,v,w;return f.forEach(T=>{let[R,{track:A,ssrcs:L}]=T;switch(R){case ht.LocalVideoLowTrack:case ht.LocalVideoTrack:if(R===ht.LocalVideoTrack){let U=function(W,K,oe,ue,xe){let Ne=K.videoSend.find(zt=>zt.ssrc===W);if(!Ne)return;let ke={},{sentFrame:He,inputFrame:lt}=Ne;if(lt&&He){let zt=lt.frameRate,$n=He.frameRate;ke[ws.FREEZE]=function(hi,Gi){let Fr=!0;return Fr=!(hi<=5)&&(hi<=10?Gi<3:hi<=20?Gi<4:Gi<5),Fr}(zt,$n)?1:0}if(jn(ke,ws.QP_SUM,Ne.qpSumPerFrame),xe)return ke;switch(He&&(jn(ke,ws.HEIGHT,He.height),jn(ke,ws.WIDTH,He.width),jn(ke,ws.FRAME_RATE,He.frameRate)),ke[ws.DISABLED]=ue._originMediaStreamTrack&&!ue._originMediaStreamTrack.enabled||ue._mediaStreamTrack&&!ue._mediaStreamTrack.enabled?1:0,Ne.adaptionChangeReason){case"none":ke[ws.ADAPTATION]=0;break;case"cpu":ke[ws.ADAPTATION]=1;break;case"bandwidth":ke[ws.ADAPTATION]=2;break;case"other":ke[ws.ADAPTATION]=3}let ut=0;Ne.adaptionChangeReason&&(ut+=wle(Ne.adaptionChangeReason)),K.qualityLimitationReason&&(ut+=wle(K.qualityLimitationReason)<<3),ke[ws.ADAPTATION]=ut,ke[ws.PLAYER_STATUS]=VW[ue._player?ue._player.videoElementStatus:"uninit"],jn(ke,ws.NACKS,Ne.nacksCount),jn(ke,ws.PLIS,Ne.plisCount),jn(ke,ws.FIRS,Ne.firsCount),jn(ke,ws.AVG_ENCODE,Ne.avgEncodeMs);let ft=oe&&oe.videoSend.find(zt=>zt.ssrc===W);if(ft){let zt=xe?Lm:Lm*I_;ft.timestamp&&Ne.timestamp&&(zt=Ne.timestamp-ft.timestamp),ft.packets!=null&&Ne.packets!=null&&jn(ke,ws.PACKAGE_RATE,1e3*(Ne.packets-ft.packets)/zt),Ne.packetsLost!=null&&ft.packetsLost!=null&&jn(ke,ws.PACKAGE_LOST,Ne.packetsLost-ft.packetsLost),ft.bytes!=null&&Ne.bytes!=null&&jn(ke,ws.BITRATE,8*(Ne.bytes-ft.bytes)/zt)}return ke}(L[0].ssrcId,a,o,A,c),F=c?null:function(W,K,oe){let ue=K.videoSend.find(ut=>ut.ssrc===W);if(!ue)return null;let xe={},Ne=ue.inputFrame,ke=Ne&&Ne.height||oe&&oe.videoHeight||0,He=Ne&&Ne.width||oe&&oe.videoWidth||0,lt=Ne&&Ne.frameRate||0;return jn(xe,o8.HEIGHT,ke),jn(xe,o8.WIDTH,He),jn(xe,o8.FRAME_RATE,lt),xe}(L[0].ssrcId,a,A),Z=c?null:function(W){let K={};return jn(K,ws.RETRANSMIT,W.bitrate.retransmit),jn(K,ws.TARGET_ENCODED,W.bitrate.targetEncoded),jn(K,ws.ACTUAL_ENCODED,W.bitrate.actualEncoded),jn(K,ws.TRANSMIT,W.bitrate.transmit),jn(K,ws.BANDWIDTH,W.sendBandwidth),K}(a);v=Object.assign({},U,F,Z)}else w=c?void 0:function(U,F,Z){let W=F.videoSend.find(ue=>ue.ssrc===U);if(!W)return;let K={},oe=W.sentFrame;if(oe&&(jn(K,x_.HEIGHT,oe.height),jn(K,x_.WIDTH,oe.width),jn(K,x_.FRAME_RATE,oe.frameRate)),Z){let ue=Z.videoSend.find(xe=>xe.ssrc===U);if(ue){let xe=Lm*I_;ue.timestamp&&W.timestamp&&(xe=W.timestamp-ue.timestamp),ue.packets!=null&&W.packets!=null&&jn(K,x_.PACKAGE_RATE,1e3*(W.packets-ue.packets)/xe),W.packetsLost!=null&&ue.packetsLost!=null&&jn(K,x_.PACKAGE_LOST,W.packetsLost-ue.packetsLost),ue.bytes!=null&&W.bytes!=null&&jn(K,x_.BITRATE,8*(W.bytes-ue.bytes)/xe)}}return K}(L[0].ssrcId,a,o);break;case ht.LocalAudioTrack:g=c?void 0:function(U,F,Z,W){let K=F.audioSend.find(ke=>ke.ssrc===U);if(!K)return;let oe={};oe[n1.DISABLED]=W._originMediaStreamTrack&&!W._originMediaStreamTrack.enabled||W._mediaStreamTrack&&!W._mediaStreamTrack.enabled?1:0;let ue=100*W._source.getAccurateVolumeLevel(),xe=K.inputLevel;if(xe!=null){let ke=Math.ceil(50*Math.log10(100*xe+1));jn(oe,n1.LEVEL,ke)}jn(oe,yle.PCM_LEVEL,ue),jn(oe,n1.AEC_RETURN_LOSS,K.aecReturnLoss),jn(oe,n1.AEC_RETURN_LOSS_ENH,K.aecReturnLossEnhancement),oe[n1.FREEZE]=0;let Ne=Z&&Z.audioSend.find(ke=>ke.ssrc===U);if(Ne){let ke=Lm*I_;Ne.timestamp&&K.timestamp&&(ke=K.timestamp-Ne.timestamp),Ne.bytes!=null&&K.bytes!=null&&jn(oe,n1.BITRATE,8*(K.bytes-Ne.bytes)/ke),Ne.packets!=null&&K.packets!=null&&jn(oe,n1.PACKAGE_RATE,1e3*(K.packets-Ne.packets)/ke)}return oe}(L[0].ssrcId,a,o,A)}}),{high:v,low:w,audio:g}}getInboundStats(a,o,c){if(!this.requestRemoteMedia)return;let f=this.requestRemoteMedia()||[],g=[];return f.forEach(v=>{let[w,T]=v,R={peer:w.uid};if(T.has(Wt.VIDEO)&&w.videoTrack){let A=w._videoSSRC&&this.requestVideoIsReady&&this.requestVideoIsReady(w._videoSSRC)||!1,L=w.videoTrack?function(U,F,Z,W,K,oe,ue){var xe;let Ne=F.videoRecv.find($n=>$n.ssrc===U);if(!Ne)return;let ke={},{receivedFrame:He,outputFrame:lt,decodeFrameRate:ut}=Ne,ft=Z&&Z.videoRecv.find($n=>$n.ssrc===U);if(ke[xa.FREEZE]=K&&b3.isRemoteVideoFreeze(W,Ne,ft)?1:0,jn(ke,A_.FRAME_RATE_DECODE,ut),jn(ke,xa.QP_SUM,Ne.qpSumPerFrame),Ne.framesRateFirefox&&jn(ke,xa.FRAME_RATE,Ne.framesRateFirefox),He&&jn(ke,xa.FRAME_RATE,He.frameRate),ft){let $n=F.timestamp-Z.timestamp||(ue?Lm:I_*Lm);Ne.packetsLost!=null&&ft.packetsLost!=null&&jn(ke,xa.PACKAGE_LOST,Ne.packetsLost-ft.packetsLost),ft.bytes!=null&&Ne.bytes!=null&&jn(ke,xa.BITRATE,8*(Ne.bytes-ft.bytes)/$n),ft.packets!=null&&Ne.packets!=null&&jn(ke,xa.PACKAGE_RATE,1e3*(Ne.packets-ft.packets)/$n)}if(ue)return ke;He?(jn(ke,xa.HEIGHT,He.height),jn(ke,xa.WIDTH,He.width)):W&&(jn(ke,xa.HEIGHT,W._videoHeight||0),jn(ke,xa.WIDTH,W._videoWidth||0)),lt&&jn(ke,A_.FRAME_RATE_OUTPUT,lt.frameRate);let zt=(xe=W._player)===null||xe===void 0?void 0:xe.rendFrameRate.toFixed(0);if(zt&&jn(ke,A_.FRAME_RATE_RENDER,+zt),jn(ke,xa.JITTER_BUFFER,Ne.jitterBufferMs),jn(ke,xa.CURRENT_DELAY,Ne.currentDelayMs),jn(ke,xa.FIRS,Ne.firsCount),jn(ke,xa.NACKS,Ne.nacksCount),jn(ke,xa.PLIS,Ne.plisCount),W){ke[xa.DISABLED]=W._originMediaStreamTrack.enabled&&W._mediaStreamTrack.enabled?0:1;let $n=W._player;if($n){let{freezeTimeCounterList:hi,renderFreezeAccTime:Gi,videoElementStatus:Fr}=$n;if(hi&&hi.length>0&&jn(ke,A_.FREEZE_TIME,hi.splice(0,1)[0]),oe&&Pm.visibility==="visible"&&Fr===Fa.PLAYING&&Jn().supportRequestVideoFrameCallback){let mr=Math.min(6e3,Gi);$n.renderFreezeAccTime=Math.max(0,Gi-mr),jn(ke,A_.FREEZE_TIME_RENDER,mr)}if(typeof Ne.totalFreezesDuration=="number"){let mr=ft&&ft.totalFreezesDuration?Ne.totalFreezesDuration-ft.totalFreezesDuration:Ne.totalFreezesDuration;jn(ke,A_.FREEZE_DURATION,1e3*mr)}}}if(ke[xa.PLAYER_STATUS]=VW[W._player?W._player.videoElementStatus:"uninit"],ft&&Ne.totalInterFrameDelay!==void 0&&Ne.totalSquaredInterFrameDelay!==void 0&&ft.totalInterFrameDelay!==void 0&&ft.totalSquaredInterFrameDelay!==void 0){let $n=Ne.totalInterFrameDelay-ft.totalInterFrameDelay,hi=Ne.totalSquaredInterFrameDelay-ft.totalSquaredInterFrameDelay,Gi=Ne.framesDecodeCount-ft.framesDecodeCount,Fr=$n/Gi*1e3,mr=Math.round(1e3*Math.sqrt((hi-Math.pow($n,2)/Gi)/Gi));!isNaN(mr)&&Fr+mr>Math.max(3*Fr,Fr+150)&&(ke[xa.I_FRAME_DELAY]=mr)}return ke}(w._videoSSRC,a,o,w.videoTrack,A===!0,this.needUploadRenderFreezeTime,c):void 0;L&&(R.video=L)}if(T.has(Wt.AUDIO)&&w.audioTrack){let A=w.audioTrack?function(L,U,F,Z,W){let K=U.audioRecv.find(ft=>ft.ssrc===L);if(!K)return;let oe={},ue=F&&F.audioRecv.find(ft=>ft.ssrc===L),{receivedFrames:xe,droppedFrames:Ne}=K;var ke,He;if(jn(oe,Mu.JITTER,K.jitterMs),xe!=null&&Ne!=null&&(oe[Mu.FREEZE]=(He=Ne,(ke=xe)===0||100*He/ke>20?1:0)),ue){let ft=U.timestamp-F.timestamp||(W?Lm:Lm*I_);K.packets!=null&&ue.packets!=null&&jn(oe,Mu.PACKAGE_RATE,1e3*(K.packets-ue.packets)/ft),ue.bytes!=null&&K.bytes!=null&&jn(oe,Mu.BITRATE,8*(K.bytes-ue.bytes)/ft),K.packetsLost!=null&&ue.packetsLost!=null&&jn(oe,Mu.PACKAGE_LOST,K.packetsLost-ue.packetsLost)}if(W)return oe;let lt=100*Z._source.getAccurateVolumeLevel(),ut=K.outputLevel;if(ut!=null){let ft=Math.ceil(50*Math.log10(100*ut+1));jn(oe,_le.LEVEL,ft)}if(jn(oe,Mu.PCM_LEVEL,lt),Z&&(oe[Mu.DISABLED]=Z._originMediaStreamTrack.enabled&&Z._mediaStreamTrack.enabled?0:1),jn(oe,Mu.JITTER_BUFFER,K.jitterBufferMs),jn(oe,Mu.CURRENT_DELAY,K.jitterBufferMs),oe[Mu.PLAYER_STATUS]=VW[ko.getPlayerState(Z.getTrackId())],ue){let ft=K.concealedSamples-ue.concealedSamples;ft>0&&jn(oe,Mu.CONCEALED_SAMPLES,ft)}return oe}(w._audioSSRC,a,o,w.audioTrack,c):void 0;A&&(R.audio=A)}(R.video||R.audio)&&g.push(R)}),this.needUploadRenderFreezeTime=!this.needUploadRenderFreezeTime,g}startUploadTransportStats(){this.uploadTransportStarted=!0,this.uploadWRTCStatsTimer||this.startUploadWRTCStats()}stopUploadTransportStats(){this.uploadTransportStarted=!1}startUploadOutboundStats(){this.uploadOutboundStarted||(this.uploadOutboundStarted=!0,this.uploadWRTCStatsTimer||this.startUploadWRTCStats(),this.uploadOutboundDenoiserStatsTimer&&window.clearInterval(this.uploadOutboundDenoiserStatsTimer),this.uploadOutboundDenoiserStatsTimer=window.setInterval(()=>{if(!this.requestAllTracks||!this.requestUpload)return;let a=(this.requestAllTracks()||[]).find(o=>o instanceof Qk);if(a&&a._external.getDenoiserStats){let o=a._external.getDenoiserStats();o&&this.requestUpload(u_.DENOISER_STATS,o)}},2e3),this.uploadExtStatsTimer&&window.clearInterval(this.uploadExtStatsTimer),this.uploadExtStatsTimer=window.setInterval(()=>{!this.requestAllTracks||!this.requestUpload||this.requestAllTracks().forEach(a=>{a.getProcessorStats().forEach(o=>{this.requestUpload&&this.requestUpload(o.type,o.stats)})})},2e3))}stopUploadOutboundStats(){this.uploadOutboundStarted&&(this.uploadOutboundStarted=!1,this.lastSendStats&&(this.lastSendStats.videoSend=[],this.lastSendStats.audioSend=[],this.lastSendStats=void 0),this.uploadOutboundDenoiserStatsTimer&&window.clearInterval(this.uploadOutboundDenoiserStatsTimer),this.uploadOutboundDenoiserStatsTimer=void 0)}startUploadInboundStats(){this.uploadInboundStarted||(this.uploadInboundStarted=!0,this.uploadWRTCStatsTimer||this.startUploadWRTCStats(),this.uploadInboundExtStatsTimer&&window.clearInterval(this.uploadInboundExtStatsTimer),this.uploadInboundExtStatsTimer=window.setInterval(()=>{!this.requestUpload||!this.requestRemoteMedia||(this.requestRemoteMedia()||[]).forEach(a=>{let[o,c]=a;c.has(Wt.VIDEO)&&o.videoTrack&&o.videoTrack.getProcessorStats().forEach(f=>{this.requestUpload&&this.requestUpload(f.type,f.stats)}),c.has(Wt.AUDIO)&&o.audioTrack&&o.audioTrack.getProcessorStats().forEach(f=>{this.requestUpload&&this.requestUpload(f.type,f.stats)})})},2e3))}stopUploadInboundStats(){this.uploadInboundStarted&&(this.uploadInboundStarted=!1,this.lastRecvStats&&(this.lastRecvStats.videoRecv=[],this.lastRecvStats.audioRecv=[],this.lastRecvStats=void 0))}startUploadExtensionUsageStats(){if(this.uploadExtensionUsageStarted)return;this.uploadExtensionUsageStarted=!0,this.uploadExtUsageStatsTimer&&window.clearInterval(this.uploadExtUsageStatsTimer);let a=new Map;this.uploadExtUsageStatsTimer=window.setInterval(async()=>{let o=Date.now(),c={connectionInterval:ve("EXTENSION_USAGE_UPLOAD_INTERVAL")/1e3,details:[],lts:o},f=[],g=this.requestAllTracks&&this.requestAllTracks()||[];for(let R of g)!R.muted&&R.enabled&&(f=f.concat(await R.getProcessorUsage()));let v=this.requestRemoteMedia&&this.requestRemoteMedia()||[];for(let[R,A]of v)A.has(Wt.VIDEO)&&R.videoTrack&&(f=f.concat(await R.videoTrack.getProcessorUsage())),A.has(Wt.AUDIO)&&R.audioTrack&&(f=f.concat(await R.audioTrack.getProcessorUsage()));if(f.length===0)return;c.details=function(R,A){let L={};for(let{id:W,value:K,level:oe,direction:ue}of R){var U;let xe=(U=A.get(W))!==null&&U!==void 0?U:0,Ne=K===2?xe+ve("EXTENSION_USAGE_UPLOAD_INTERVAL")/1e3:xe;var F,Z;A.set(W,Ne),L[W]?(K===2&&(L[W].value=K),oe>L[W].level&&(L[W].level=oe),ue==="remote"&&(L[W].remoteUidCount+=1),L[W].totalTs=(F=A.get(W))!==null&&F!==void 0?F:0):L[W]={value:K,level:oe,remoteUidCount:ue==="local"?0:1,totalTs:(Z=A.get(W))!==null&&Z!==void 0?Z:0}}return Object.keys(L).map(W=>{let{level:K,value:oe,totalTs:ue}=L[W];return{id:W,level:K,value:oe,totalTs:ue}})}(f,a);let w=Date.now(),T=w>o?w:o+1;this.requestUpload&&this.requestUpload(u_.EXTENSION_USAGE_STATS,{usageStats:c,sendTs:T})},ve("EXTENSION_USAGE_UPLOAD_INTERVAL"))}stopUploadExtensionUsageStats(){this.uploadExtensionUsageStarted&&(this.uploadExtensionUsageStarted=!1,this.uploadExtUsageStatsTimer&&window.clearInterval(this.uploadExtUsageStatsTimer),this.uploadExtUsageStatsTimer=void 0)}}class i1{get hasVideo(){return this._video_enabled_&&!this._video_muted_&&this._video_added_}get hasAudio(){return this._audio_enabled_&&!this._audio_muted_&&this._audio_added_}get audioTrack(){if(this.hasAudio||this._audio_pre_subscribed)return this._audioTrack}get videoTrack(){if(this.hasVideo||this._video_pre_subscribed)return this._videoTrack}get dataChannels(){return this._dataChannels}constructor(a,o){X(this,"uid",void 0),X(this,"_uintid",void 0),X(this,"_trust_in_room_",!0),X(this,"_trust_audio_enabled_state_",!0),X(this,"_trust_video_enabled_state_",!0),X(this,"_trust_audio_mute_state_",!0),X(this,"_trust_video_mute_state_",!0),X(this,"_audio_muted_",!1),X(this,"_video_muted_",!1),X(this,"_audio_enabled_",!0),X(this,"_video_enabled_",!0),X(this,"_audio_added_",!1),X(this,"_video_added_",!1),X(this,"_is_pre_created",!1),X(this,"_video_pre_subscribed",!1),X(this,"_audio_pre_subscribed",!1),X(this,"_trust_video_stream_added_state_",!0),X(this,"_trust_audio_stream_added_state_",!0),X(this,"_audioTrack",void 0),X(this,"_videoTrack",void 0),X(this,"_dataChannels",[]),X(this,"_audioSSRC",void 0),X(this,"_videoSSRC",void 0),X(this,"_audioOrtc",void 0),X(this,"_videoOrtc",void 0),X(this,"_cname",void 0),X(this,"_rtxSsrcId",void 0),X(this,"_videoMid",void 0),X(this,"_audioMid",void 0),this.uid=a,this._uintid=o}}let Fh=function(r){return r.SEND_ONLY="SEND_ONLY",r.RECEIVE_ONLY="RECEIVE_ONLY",r}({});function nNe(r,a){var o;let c;switch(a){case ht.LocalAudioTrack:c=mi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=r._hints).call(o,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalVideoLowTrack:c=mi.Low}return c}function c$(r){let a=Jn();if(r.some(o=>o._bypassWebAudio))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");if(!a.webAudioMediaStreamDest)throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks because your browser does not support audio mixing")}function d$(r,a){c$(r);let o=new ss;return r.forEach(c=>o.addAudioTrack(c)),o}var ble,Cle,Tle,Rle,xle,Ale,Ile,Nle,Ole,Ple,Lle,rr;function Dle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function l8(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Dle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Dle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Hl=(ble=Bh(Fh.SEND_ONLY),Cle=Bh(Fh.SEND_ONLY),Tle=Bh(),Rle=Bh(Fh.RECEIVE_ONLY),xle=Bh(Fh.RECEIVE_ONLY),Ale=Bh(Fh.RECEIVE_ONLY),Ile=Bh(Fh.RECEIVE_ONLY),Nle=Bh(Fh.RECEIVE_ONLY),Ole=Bh(Fh.RECEIVE_ONLY),Ple=Bh(),Lle=Bh(Fh.RECEIVE_ONLY),rr=class extends tr{get state(){return this._state}set state(r){let a=this._state;this._state=r,this.emit(pn.StateChange,a,this._state)}constructor(r,a){super(),X(this,"store",void 0),X(this,"statsUploader",void 0),X(this,"sendConnection",void 0),X(this,"recvConnection",void 0),X(this,"localTrackMap",new Map),X(this,"remoteUserMap",new Map),X(this,"localDataChannels",[]),X(this,"pendingLocalTracks",[]),X(this,"pendingRemoteTracks",[]),X(this,"statsCollector",void 0),X(this,"dtlsFailedCount",0),X(this,"sendMutex",new As("P2PChannel2-send-mutex")),X(this,"recvMutex",new As("P2PChannel2-recv-mutex")),X(this,"_state",vi.Disconnected),X(this,"_restartStates",["disconnected","failed"]),X(this,"reconnectInterval",void 0),X(this,"uploadUnplinkStarted",!1),X(this,"uploadDownlinkStarted",!1),X(this,"uplinkStateUploadInterval",void 0),X(this,"downlinkStatsUploadInterval",void 0),X(this,"handleMuteLocalTrack",async(o,c,f)=>{let g=await this.sendMutex.lock("Locking from P2PChannel2.handleMuteLocalTrack");try{if(!this.sendConnection||this.state!==vi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleMuteLocalTrack before sendConnection established."));let T=this.filterTobeMutedTracks(o);if(T.length===0)return void c();let R=T.find(F=>F[0]==="videoLowTrack");R&&R[1].track._originMediaStreamTrack.stop(),await this.sendConnection.muteLocal(T.map(F=>{let[,{id:Z}]=F;return Z}));let A=!1;var v,w;o.trackMediaType==="video"?A=!((v=this.localTrackMap.get(ht.LocalAudioTrack))===null||v===void 0||!v.track._muted):A=((w=this.localTrackMap.get(ht.LocalVideoTrack))===null||w===void 0?void 0:w.id)===void 0;let L=this.createMuteMessage(T);await Pi(this,pn.RequestMuteLocal,L);let U=o.trackMediaType==="video"?W0.MUTE_LOCAL_VIDEO:W0.MUTE_LOCAL_AUDIO;await Pi(this,pn.RequestP2PMuteLocal,{action:U,message:L,isMuteAll:A}),c()}catch(T){f(T)}finally{g()}}),X(this,"handleUnmuteLocalTrack",async(o,c,f)=>{let g=await this.sendMutex.lock("Locking from P2PChannel2.handleUnmuteLocalTrack");try{if(!this.sendConnection||this.state!==vi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleUnmuteLocalTrack before sendConnection established."));let v=this.filterTobeUnmutedTracks(o);if(v.length===0)return void c();await this.sendConnection.unmuteLocal(v.map(R=>{let[,{id:A}]=R;return A}));let w=this.createUnmuteMessage(v),T=o.trackMediaType==="video"?W0.UNMUTE_LOCAL_VIDEO:W0.UNMUTE_LOCAL_AUDIO;await Pi(this,pn.RequestP2PMuteLocal,{action:T,message:w}),c()}catch(v){f(v)}finally{g()}}),X(this,"handleUpdateVideoEncoder",async(o,c,f)=>{let g=await this.sendMutex.lock("Locking from P2PChannel2.handleSetVideoEncoder");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.sendConnection||!v||v.track!==o||this.state!==vi.Connected)return void c();let{id:w,track:T}=v;w&&(await this.sendConnection.updateSendParameters(w,T),await this.sendConnection.updateEncoderConfig(w,T),this.emit(pn.UpdateVideoEncoder,T)),c()}catch(v){f(v)}finally{g()}}),X(this,"handleUpdateVideoSendParameters",async(o,c,f)=>{let g=await this.sendMutex.lock("Locking from P2PChannel2.handleUpdateVideoSendParameters");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.sendConnection||!v||v.track!==o||this.state!==vi.Connected)return void c();let{id:w,track:T}=v;w&&await this.sendConnection.updateSendParameters(w,T),c()}catch(v){f(v)}finally{g()}}),X(this,"handleReplaceTrack",async(o,c,f,g)=>{let v;z.debug("[".concat(this.store.clientId,"] P2PChannel2 handleReplaceTrack for [track-id-").concat(o.getTrackId(),"]")),typeof g=="boolean"&&g||(v=await this.sendMutex.lock("From P2PChannel2.handleReplaceTrack"));try{var w;let R=Array.from(this.localTrackMap.entries()).find(A=>{let[,{track:L}]=A;return o===L});if(!this.sendConnection||!R||R[1].id===void 0||this.state!==vi.Connected)return void c();if(await((w=this.sendConnection)===null||w===void 0?void 0:w.replaceTrack(o,R[1].id)),R[0]===ht.LocalVideoTrack&&Jn().supportDualStreamEncoding){let A=this.localTrackMap.get(ht.LocalVideoLowTrack);if(A){let L=o._mediaStreamTrack.clone();A.track._originMediaStreamTrack.stop(),A.track._mediaStreamTrack=L,A.track._originMediaStreamTrack=L,await new Ct((U,F)=>{this.handleReplaceTrack(A.track,U,F,!0)})}}c()}catch(R){f(R)}finally{var T;(T=v)===null||T===void 0||T()}}),X(this,"handleGetLocalVideoStats",o=>{o(this.statsCollector.getLocalVideoTrackStats())}),X(this,"handleGetLocalAudioStats",o=>{o(this.statsCollector.getLocalAudioTrackStats())}),X(this,"handleGetRemoteVideoStats",o=>this.statsCollector.getRemoteVideoTrackStats(o.uid)[o.uid]),X(this,"handleGetRemoteAudioStats",o=>this.statsCollector.getRemoteAudioTrackStats(o.uid)[o.uid]),this.store=r,this.statsCollector=a,this.statsCollector.addP2PChannel(this),this.statsUploader=new Sle(r),this.bindStatsUploaderEvents(),this.reconnectInterval=window.setInterval(()=>{[this.sendConnection,this.recvConnection].forEach(o=>{o&&(o.iceConnectionState!=="disconnected"&&o.iceConnectionState!=="failed"||this.handleDisconnect(o.direction))})},ve("ICE_RESTART_INTERVAL"))}async startP2PConnection(r,a){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support startP2PConnection.")}async connect(r,a,o,c,f,g){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support connect.")}async startP2P(r,a){let o;try{if(a){this.recvConnection&&(z.warning("[".concat(this.store.clientId,"] P2PChannel.startP2P reset recvConnection.")),this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection)),o=await this.recvMutex.lock("From P2PChannel.startP2P"),this.recvConnection=new vle(r,this.store,oo.RECEIVE_ONLY),this.bindConnectionEvents(this.recvConnection);let c=await this.recvConnection.establish(a);return{iceParameters:c.iceParameters,dtlsParameters:c.dtlsParameters,sdp:c.sdp}}{this.state=vi.New,this.sendConnection&&(z.warning("[".concat(this.store.clientId,"] P2PChannel.startP2P reset sendConnection.")),this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection)),o=await this.sendMutex.lock("From P2PChannel.startP2P"),this.sendConnection=new vle(r,this.store),this.store.peerConnectionStart(),this.bindConnectionEvents(this.sendConnection);let c=await this.sendConnection.establish();return{iceParameters:c.iceParameters,dtlsParameters:c.dtlsParameters,sdp:c.sdp}}}finally{o&&o()}}async p2pConnect(r){if(!this.sendConnection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel2.p2pConnect before P2PChannel2.startP2PConnection .");this.store.peerConnectionStart(),await this.sendConnection.connect(r),this.statsUploader.startUploadTransportStats(),this.statsUploader.startUploadExtensionUsageStats(),this.state=vi.Connected}async addRemoteCandidate(r,a){if(a===oo.RECEIVE_ONLY){if(!this.sendConnection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel2.connect before P2PChannel2.addRemoteCandidate .");await this.sendConnection.addRemoteCandidate(r)}else{if(!this.recvConnection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel2.connect before P2PChannel2.addRemoteCandidate .");await this.recvConnection.addRemoteCandidate(r)}}publish(r,a,o){var c=this;return zl(function*(){let f=yield Dn(c.sendMutex.lock("From P2PChannel.publish"));try{if(!c.sendConnection||c.state!==vi.Connected){c.throwIfTrackTypeNotMatch(r);let R=r.filter(A=>c.pendingLocalTracks.indexOf(A)===-1);return void(c.pendingLocalTracks=c.pendingLocalTracks.concat(R))}c.store.pubId=c.store.pubId+1,ua.markPublishStart(c.store.clientId,c.store.pubId);let g=c.filterTobePublishedTracks(r,a,o);if(g.length===0)return void(yield Dn(c.tryToUnmuteAudio(r)));g.forEach(R=>{let{track:A,type:L}=R,U=Date.now();c.store.publish(A.getTrackId(),L===ht.LocalAudioTrack?"audio":"video",U)}),c.bindLocalTrackEvents(g);let v=yield Dn(c.sendConnection.send(g.map(R=>{let{track:A}=R;return A}),c.store.codec,c.store.audioCodec)),w=(yield Dn(v.next())).value,T=c.createGatewayPublishMessage(g,w);try{yield T}catch(R){throw v.throw(R),(R==null?void 0:R.code)===ce.WS_ABORT&&g.forEach(A=>{let{track:L}=A;c.pendingLocalTracks.indexOf(L)===-1&&c.pendingLocalTracks.push(L)}),c.unbindLocalTrackEvents(g),R}yield Dn(v.next()),g.forEach(R=>{let{type:A}=R;c.statsCollector.addLocalStats(A)}),c.statsUploader.startUploadOutboundStats(),c.assignLocalTracks(g,w),g.forEach(R=>{let{track:A,type:L}=R,U=Date.now();c.store.publish(A.getTrackId(),L===ht.LocalAudioTrack?"audio":"video",void 0,U)}),c.startUploadUplinkState()}finally{f()}})()}async unpublish(r){if(!this.sendConnection||this.state!==vi.Connected)return void(r.length===0?this.pendingLocalTracks.length=0:this.pendingLocalTracks=this.pendingLocalTracks.filter(f=>!Tt(r).call(r,f)));let a=this.filterTobeUnpublishedTracks(r);if(a.length===0)return;let o=a.find(f=>f[0]==="videoLowTrack");o&&o[1].track.close();let c=this.createGatewayUnpublishMessage(a);if(await this.sendConnection.stopSending(a.map(f=>{let[,{id:g}]=f;return g})),this.withdrawLocalTracks(a),this.unbindLocalTrackEvents(a.map(f=>{let[g,{track:v}]=f;return{type:g,track:v}})),a.forEach(f=>{let[g]=f;this.statsCollector.removeLocalStats(g)}),this.localTrackMap.size===0&&(this.statsUploader.stopUploadOutboundStats(),this.stopUploadUplinkState()),this.sendConnection&&this.state===vi.Connected)return o&&o[1].track.close(),c;r.forEach(f=>{let g=this.pendingLocalTracks.indexOf(f);g!==-1&&this.pendingLocalTracks.splice(g,1)})}startUploadUplinkState(){if(this.uploadUnplinkStarted)return;this.uploadUnplinkStarted=!0,this.uplinkStateUploadInterval&&window.clearInterval(this.uplinkStateUploadInterval);let r=()=>{let a=[],o=[];Array.from(this.localTrackMap.entries()).forEach(c=>{let[f,{track:g,ssrcs:v}]=c,w={stream_type:nNe(g,f),ssrcs:v};g._muted||!g._enabled?a.push(w):o.push(w)}),a.length>0&&a.forEach(c=>{Pi(this,pn.RequestMuteLocal,[c])}),o.length>0&&o.forEach(c=>{Pi(this,pn.RequestUnmuteLocal,[c])})};r(),this.uplinkStateUploadInterval=window.setInterval(()=>{r()},3e3)}stopUploadUplinkState(){this.uploadUnplinkStarted&&(this.uploadUnplinkStarted=!1,this.uplinkStateUploadInterval&&window.clearInterval(this.uplinkStateUploadInterval))}publishLowStream(r){return zl(function*(){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support publishLowStream.")})()}async republish(){this.pendingLocalTracks.length>0&&(z.debug("[".concat(this.store.clientId,"] Emit P2PChannelEvents.RequestRePublish to republish tracks.")),await Yr(this,pn.RequestRePublish,this.pendingLocalTracks),this.emit(pn.MediaReconnectEnd,this.store.uid),this.pendingLocalTracks=[])}async unpublishLowStream(){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support unpublishLowStream.")}async subscribe(r,a,o,c){var f;if(!this.recvConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when recvConnection disconnected.");if((f=this.remoteUserMap.get(r))!==null&&f!==void 0&&f.has(a))return;let{track:g,mid:v,transceiver:w}=await this.recvConnection.receive(a,[{ssrcId:o}],String(r.uid),c);a===Wt.AUDIO?(r._audioTrack?r._audioTrack._updateOriginMediaStreamTrack(g):(r._audioTrack=new Mb(g,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote audio track: ").concat(r._audioTrack.getTrackId()))),w&&r._audioTrack._updateRtpTransceiver(w),this.bindRemoteTrackEvents(r,r._audioTrack)):(r._videoSSRC=o,r._videoTrack?r._videoTrack._updateOriginMediaStreamTrack(g):(r._videoTrack=new kb(g,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote video track: ").concat(r._videoTrack.getTrackId()))),w&&r._videoTrack._updateRtpTransceiver(w),this.bindRemoteTrackEvents(r,r._videoTrack));let T=this.remoteUserMap.get(r);T?T.set(a,v):this.remoteUserMap.set(r,new Map([[a,v]])),this.statsCollector.addRemoteStats(r.uid),this.statsUploader.startUploadInboundStats(),this.startUploadDownlinkState();let R=this.pendingRemoteTracks.findIndex(A=>{let{user:L,kind:U}=A;return L.uid===r.uid&&a===U});R!==-1&&(this.pendingRemoteTracks.splice(R,1),this.emit(pn.MediaReconnectEnd,r.uid))}async mockSubscribe(r,a,o,c){if(!this.recvConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when recvConnection disconnected.");await this.recvConnection.mockReceive(a,[{ssrcId:o}],String(r.uid),c)}async unsubscribe(r,a,o){let c=this.pendingRemoteTracks.filter(g=>{let{user:v,kind:w}=g;return a!==void 0?v.uid===r.uid&&a===w:v.uid===r.uid});if(c.forEach(g=>{let v=this.pendingRemoteTracks.indexOf(g);this.pendingRemoteTracks.splice(v,1)}),this.recvConnection||o||c.forEach(g=>{let{kind:v}=g;var w;if(v===Wt.AUDIO)(w=r._audioTrack)===null||w===void 0||w._destroy(),r._audioTrack=void 0;else if(v===Wt.VIDEO){var T;(T=r._videoTrack)===null||T===void 0||T._destroy(),r._videoTrack=void 0}}),!this.recvConnection)return;let f=this.filterTobeUnSubscribedTracks(r,a);f.length!==0&&(await this.recvConnection.stopReceiving(f.map(g=>{let[,{id:v}]=g;return v})),this.withdrawRemoteTracks(f),this.remoteUserMap.size===0&&(this.statsUploader.stopUploadInboundStats(),this.stopUploadDownlinkState()),f.forEach(g=>{let[v,{kind:w}]=g;var T,R;if(w===Wt.VIDEO&&v._videoSSRC&&((T=this.recvConnection)===null||T===void 0||T.setStatsRemoteVideoIsReady(v._videoSSRC,!1)),w===Wt.VIDEO)this.unbindRemoteTrackEvents(v._videoTrack),o||((R=v._videoTrack)===null||R===void 0||R._destroy(),v._videoTrack=void 0);else if(w===Wt.AUDIO){var A;this.unbindRemoteTrackEvents(v._audioTrack),!o&&((A=v._audioTrack)===null||A===void 0||A._destroy(),v._audioTrack=void 0)}}),f.forEach(g=>{let[,{kind:v}]=g;Pi(this,pn.RequestP2PMuteRemote,v)}))}startUploadDownlinkState(){if(this.uploadDownlinkStarted)return;this.uploadDownlinkStarted=!0,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval);let r=()=>Array.from(this.remoteUserMap.entries()).forEach(a=>{let[,o]=a;[Wt.VIDEO,Wt.AUDIO].forEach(c=>{o.has(c)?Pi(this,pn.RequestP2PUnmuteRemote,c):Pi(this,pn.RequestP2PMuteRemote,c)})});r(),this.downlinkStatsUploadInterval=window.setInterval(()=>{r()},3e3)}stopUploadDownlinkState(){this.uploadDownlinkStarted&&(this.uploadDownlinkStarted=!1,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval))}getAllDataChannels(){return this.localDataChannels}async massSubscribe(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massSubscribe.")}async massSubscribeNoLock(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massSubscribeNoLock.")}async massUnsubscribe(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massUnsubscribe.")}async massUnsubscribeNoLock(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massUnsubscribeNoLock.")}async muteRemote(r,a){if(!this.recvConnection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel2.muteRemote has no remote user ").concat(r.uid,"."));if(!o.get(a))return void z.warning("[".concat(this.store.clientId,"] P2PChannel2.muteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."));let c=a===Wt.VIDEO?r._videoSSRC:r._audioSSRC;c!==void 0&&this.recvConnection.setStatsRemoteVideoIsReady(c,!1)}async unmuteRemote(r,a){return this.unmuteRemoteNoLock(r,a)}async unmuteRemoteNoLock(r,a){if(!this.recvConnection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel2.unmuteRemote has no remote user ").concat(r.uid,"."));o.get(a)||z.warning("[".concat(this.store.clientId,"] P2PChannel2.unmuteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."))}getAllTracks(r){let a=this.localTrackMap.get(ht.LocalAudioTrack);if((a==null?void 0:a.track)instanceof ss){let o=a.track;return Array.from(this.localTrackMap.entries()).filter(c=>{let[f]=c;return f!==ht.LocalAudioTrack}).filter(c=>{let[f]=c;return!(r&&f===ht.LocalVideoLowTrack)}).map(c=>{let[,{track:f}]=c;return f}).concat(o.trackList)}return Array.from(this.localTrackMap.entries()).filter(o=>{let[c]=o;return!(r&&c===ht.LocalVideoLowTrack)}).map(o=>{let[,{track:c}]=o;return c})}reportPublishEvent(r,a,o,c,f){if(r){let v=this.localTrackMap.get(ht.LocalAudioTrack),w=c?this.localTrackMap.get(ht.LocalVideoLowTrack):this.localTrackMap.get(ht.LocalVideoTrack);$t.publish(this.store.sessionId,{eventElapse:ua.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.track.getTrackLabel(),videoName:w==null?void 0:w.track.getTrackLabel(),screenshare:(w==null?void 0:w.track._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}else{var g;o||(o=[]);let v=o.find(T=>T instanceof br),w=c?(g=this.localTrackMap.get(ht.LocalVideoTrack))===null||g===void 0?void 0:g.track:o.find(T=>T instanceof Di);$t.publish(this.store.sessionId,{eventElapse:ua.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.getTrackLabel(),videoName:w==null?void 0:w.getTrackLabel(),screenshare:(w==null?void 0:w._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}}reportSubscribeEvent(r,a,o,c){let f=c===Wt.VIDEO?o._videoSSRC:o._audioSSRC;f&&$t.subscribe(this.store.sessionId,{succ:r,ec:a,video:c===Wt.VIDEO,audio:c===Wt.AUDIO,peerid:o.uid,subscribeRequestid:c===Wt.VIDEO?o._videoSSRC:o._audioSSRC,p2pid:this.store.p2pId,eventElapse:ua.measureFromSubscribeStart(this.store.clientId,f)})}reset(){z.debug("[".concat(this.store.clientId,"] P2PChannel2.reset")),this.sendMutex=new As("P2PChannel2-send-mutex"),this.sendMutex=new As("P2PChannel2-recv-mutex"),this.sendConnection&&(this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection),this.sendConnection=void 0),this.recvConnection&&(this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection),this.recvConnection=void 0),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),this.statsUploader.stopUploadExtensionUsageStats(),this.stopUploadUplinkState(),this.stopUploadDownlinkState(),this.unbindLocalTrackEvents(),this.unbindAllRemoteTrackEvents(),this.unbindRtpTransceiver();let r=this.localTrackMap.get(ht.LocalAudioTrack);if((r==null?void 0:r.track)instanceof ss){if(r.track.trackList.length>0){let a=r.track;r.track.trackList.forEach(o=>{a.removeAudioTrack(o)})}r.track.close()}this.localTrackMap.clear(),this.remoteUserMap.clear(),this.statsCollector.removeRemoteStats(),this.statsCollector.removeLocalStats(),this.dtlsFailedCount=0,this.pendingLocalTracks=[],this.pendingRemoteTracks=[],this.reconnectInterval&&(window.clearInterval(this.reconnectInterval),this.reconnectInterval=void 0),this.state=vi.Disconnected}getStats(r){var a,o;return r?(o=this.recvConnection)===null||o===void 0?void 0:o.getStats():(a=this.sendConnection)===null||a===void 0?void 0:a.getStats()}getRemoteVideoIsReady(r){var a;return((a=this.recvConnection)===null||a===void 0?void 0:a.getRemoteVideoIsReady(r))||!1}getLocalAudioVolume(){let r=this.localTrackMap.get(ht.LocalAudioTrack);if(r)return r.track.getVolumeLevel()}getLocalVideoSize(){let r=this.localTrackMap.get(ht.LocalVideoTrack);if(r)return{width:r.track.videoWidth||0,height:r.track.videoHeight||0}}getEncoderConfig(r){let a=this.localTrackMap.get(r);return a&&a.track instanceof Di||a&&a.track instanceof br?a.track._encoderConfig:void 0}getLocalMedia(r){return this.localTrackMap.get(r)}hasLocalMedia(){return this.localTrackMap.size>0}hasRemoteMedia(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}async hasRemoteMediaWithLock(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}getRemoteMedia(r){var a;let o=Array.from(al(a=this.remoteUserMap).call(a)).find(c=>c.uid===r);return o?{audioTrack:o.audioTrack,audioSSRC:o._audioSSRC,videoTrack:o.videoTrack,videoSSRC:o._videoSSRC}:{}}getAudioLevels(){let r=Array.from(this.remoteUserMap.entries()).map(o=>{let[c]=o;return{uid:c.uid,level:c.audioTrack?100*c.audioTrack._source.getAccurateVolumeLevel():0}}),a=this.localTrackMap.get(ht.LocalAudioTrack);return a&&r.push({level:100*a.track._source.getAccurateVolumeLevel(),uid:this.store.uid}),r=wI(r).call(r,(o,c)=>o.level-c.level),r}async disconnectForReconnect(){this.sendConnection&&this.recvConnection&&(z.debug("[".concat(this.store.clientId,"] P2PChannel2.disconnectForReconnect closing P2PConnection")),this.state=vi.Reconnecting,ve("KEEP_LAST_FRAME")&&this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a]=r;var o;a._videoTrack&&a._videoTrack._player&&((o=a._videoTrack._player.getVideoElement())===null||o===void 0||o.pause(),a._videoTrack._player.isKeepLastFrame=!0,a._videoTrack._originMediaStreamTrack.stop())}),this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection),this.sendConnection=void 0,this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection),this.recvConnection=void 0,this.localTrackMap.size!==0&&(Array.from(this.localTrackMap.entries()).forEach(r=>{var a;let[o,{track:c}]=r;switch(o){case ht.LocalVideoTrack:Tt(a=c._hints).call(a,Hi.LOW_STREAM)?c.close():this.pendingLocalTracks.push(c);break;case ht.LocalAudioTrack:c instanceof ss?this.pendingLocalTracks=this.pendingLocalTracks.concat(c.trackList):this.pendingLocalTracks.push(c);case ht.LocalVideoLowTrack:}}),this.emit(pn.MediaReconnectStart,this.store.uid)),this.unbindLocalTrackEvents(),this.localTrackMap.clear(),this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;Array.from(al(o).call(o)).forEach(c=>{this.setPendingRemoteMedia(a,c)}),this.emit(pn.MediaReconnectStart,a.uid)}),this.unbindAllRemoteTrackEvents(),this.remoteUserMap.clear(),this.stopUploadUplinkState(),this.stopUploadDownlinkState(),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),z.debug("[".concat(this.store.clientId,"] P2PChannel2 disconnected, waiting to reconnect.")))}hasPendingRemoteMedia(r,a){for(let o of this.pendingRemoteTracks){let{user:c,kind:f}=o;if((r instanceof i1?r.uid:r)===c.uid&&a===f)return!0}return!1}setPendingRemoteMedia(r,a){this.hasPendingRemoteMedia(r,a)||this.pendingRemoteTracks.push({user:r,kind:a})}async restartICE(r,a){let o,c;if(r===oo.SEND_ONLY){if(!this.sendConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleMuteLocalTrack before sendConnection established.");o=await this.sendMutex.lock("From P2PChannel.restartICE"),c=this.sendConnection}else{if(!this.recvConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleMuteLocalTrack before recvConnection established.");o=await this.recvMutex.lock("From P2PChannel.restartICE"),c=this.recvConnection}try{if(a){let f=await c.restartICE(a);return c.isInRestartIce=!1,f}{let f=await c.restartICE();if(f){let g=await Yr(this,pn.RequestP2PRestartICE,{direction:oo.RECEIVE_ONLY,iceParameter:f});await c.restartICE(g),c.isInRestartIce=!1}}}finally{o()}}getUplinkNetworkQuality(){if(!this.sendConnection)return 0;let r=this.sendConnection.getStats(),a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalAudioTrack),c=r.videoSend.find(F=>{var Z;return F.ssrc===(a==null||(Z=a.ssrcs)===null||Z===void 0?void 0:Z[0].ssrcId)}),f=r.audioSend.find(F=>{var Z;return F.ssrc===(o==null||(Z=o.ssrcs)===null||Z===void 0?void 0:Z[0].ssrcId)});if(!c||!f)return 1;let g=Bl(this,pn.NeedSignalRTT),v=c?c.rttMs:void 0,w=f?f.rttMs:void 0,T=v&&w?(v+w)/2:v||w,R=(T&&g?(T+g)/2:T||g)||0,A=100*r.sendPacketLossRate*.7/50+.3*R/1500,L=A<.17?1:A<.36?2:A<.59?3:A<.1?4:5,U=a==null?void 0:a.track;if(U&&U._encoderConfig&&U._hints.indexOf(Hi.SCREEN_TRACK)===-1){let F=U._encoderConfig.bitrateMax,Z=r.bitrate.actualEncoded;if(F&&Z){let W=(1e3*F-Z)/(1e3*F);return Vie[W<.15?0:W<.3?1:W<.45?2:W<.6?3:4][L]}}return L}getDownlinkNetworkQuality(){if(!this.recvConnection)return 0;let r=this.recvConnection.getStats(),a=0;return Array.from(this.remoteUserMap.entries()).forEach(o=>{let[c]=o,f=c._audioSSRC,g=c._videoSSRC,v=r.audioRecv.find(Z=>Z.ssrc===f),w=r.videoRecv.find(Z=>Z.ssrc===g);if(!v&&!w)return void(a+=1);let T=Bl(this,pn.NeedSignalRTT),R=r.rtt,A=(R&&T?(R+T)/2:R||T)||0,L=v?v.jitterMs:void 0,U=r.recvPacketLossRate,F=.7*U*100/50+.3*A/1500;L&&(F=.6*U*100/50+.2*A/1500+.2*L/400),a+=F<.1?1:F<.17?2:F<.36?3:F<.59?4:5}),this.remoteUserMap.size>0?Math.round(a/this.remoteUserMap.size):a}async muteLocalTrack(r){return new Ct((a,o)=>{this.handleMuteLocalTrack(r,a,o)})}filterTobePublishedTracks(r,a,o){let c=[],f=Jn(),g=this.getAllTracks();r=sb(r=r.filter(T=>g.indexOf(T)===-1));let v=!1,w=!1;for(let T of r){if(T instanceof Di&&(this.localTrackMap.has(ht.LocalVideoTrack)||v?new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS).throw():(c.push({track:T,type:ht.LocalVideoTrack}),v=!0),a)){let R=this.getLowVideoTrack(T,o);c.push({track:R,type:ht.LocalVideoLowTrack})}if(T instanceof br){let R=this.localTrackMap.get(ht.LocalAudioTrack);if(R){if(!(R.track instanceof ss))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(T._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");R.track.addAudioTrack(T),this.bindLocalAudioTrackEvents(T,!0)}else if(w){let A=c.find(L=>{let{type:U}=L;return U===ht.LocalAudioTrack});if(!(A.track instanceof ss))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(T._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");A.track.addAudioTrack(T)}else{if(!f.webAudioMediaStreamDest||T instanceof ss||T._bypassWebAudio)c.push({track:T,type:ht.LocalAudioTrack});else{let A=new ss;A.addAudioTrack(T),c.push({track:A,type:ht.LocalAudioTrack})}w=!0}}}return c}filterTobeUnpublishedTracks(r){let a=[],o=this.getAllTracks();r=sb(r=r.filter(c=>o.indexOf(c)!==-1));for(let c of r){if(c instanceof br){let f=this.localTrackMap.get(ht.LocalAudioTrack);if(!f)continue;f.track instanceof ss?(f.track.removeAudioTrack(c),this.unbindLocalAudioTrackEvents(c),f.track.trackList.length===0&&(a.push([ht.LocalAudioTrack,f]),f.track.close())):a.push([ht.LocalAudioTrack,f])}if(c instanceof Di){let f=this.localTrackMap.get(ht.LocalVideoTrack);if(!f)continue;a.push([ht.LocalVideoTrack,f]);let g=this.localTrackMap.get(ht.LocalVideoLowTrack);g&&a.push([ht.LocalVideoLowTrack,g])}}return a}bindLocalTrackEvents(r){r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.addListener(Mt.GET_STATS,this.handleGetLocalVideoStats),o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.addListener(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.bindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}bindLocalAudioTrackEvents(r,a){r instanceof ss?r.trackList.forEach(o=>{o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),r.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack),a||r.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack))}unbindLocalTrackEvents(r){r||(r=Array.from(this.localTrackMap.entries()).map(a=>{let[o,{track:c}]=a;return{track:c,type:o}})),r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.off(Mt.GET_STATS,this.handleGetLocalVideoStats),o.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.off(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.off(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.unbindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}unbindLocalAudioTrackEvents(r){r instanceof ss?r.trackList.forEach(a=>{a.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),a.off(Mt.GET_STATS,this.handleGetLocalAudioStats),a.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.off(Mt.GET_STATS,this.handleGetLocalAudioStats),r.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),r.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack))}bindRemoteTrackEvents(r,a){a instanceof kb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteVideoStats(r))}),a instanceof Mb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteAudioStats(r))})}unbindRemoteTrackEvents(r){r&&r.removeAllListeners(Mt.GET_STATS)}unbindAllRemoteTrackEvents(){Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;o.has(Wt.AUDIO)&&this.unbindRemoteTrackEvents(a._audioTrack),o.has(Wt.VIDEO)&&this.unbindRemoteTrackEvents(a._videoTrack)})}createGatewayPublishMessage(r,a){return r.map((o,c)=>{var f;let g,{track:v,type:w}=o;switch(w){case ht.LocalAudioTrack:g=mi.Audio;break;case ht.LocalVideoTrack:g=Tt(f=v._hints).call(f,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalVideoLowTrack:g=mi.Low}return{kind:w===ht.LocalAudioTrack?Wt.AUDIO:Wt.VIDEO,stream_type:g,mid:a[c].id,ssrcs:a[c].localSSRC,isMuted:v.muted||!v.enabled}})}createGatewayUnpublishMessage(r){return r.map(a=>{var o;let c,[f,{track:g,ssrcs:v,id:w}]=a;switch(f){case ht.LocalVideoTrack:c=Tt(o=g._hints).call(o,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalAudioTrack:c=mi.Audio;break;case ht.LocalVideoLowTrack:c=mi.Low}return{stream_type:c,ssrcs:v,mid:w}})}assignLocalTracks(r,a){r.forEach((o,c)=>{let{track:f,type:g}=o;this.localTrackMap.set(g,{track:f,id:a[c].id,ssrcs:a[c].localSSRC})})}withdrawLocalTracks(r){r.forEach(a=>{let[o]=a;this.localTrackMap.delete(o)})}bindConnectionEvents(r){r.onConnectionStateChange=async a=>{var o;z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: ").concat(r.name,".onConnectionStateChange(").concat(a,")")),this.emit(pn.PeerConnectionStateChange,a),a!=="connected"||this.store.keyMetrics.peerConnectionEnd||this.store.peerConnectionEnd(),a==="connected"&&(r.isInRestartIce=!1),Tt(o=this._restartStates).call(o,a)&&!r.isInRestartIce&&(a==="disconnected"&&await _s(800),r.iceConnectionState!=="disconnected"&&r.iceConnectionState!=="failed"||this.handleDisconnect(r.direction))},r.onICEConnectionStateChange=a=>{a!=="connected"||this.store.keyMetrics.iceConnectionEnd||this.store.iceConnectionEnd(),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICEConnectionStateChange(").concat(a,")")),$t.reportApiInvoke(this.store.sessionId,{name:"ICEConnectionStateChange",options:a,tag:vr.TRACER}).onSuccess(),this.emit(pn.IceConnectionStateChange,a)},r.onICETransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICETransportStateChange(").concat(a,")"))},r.onDTLSTransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportStateChange(").concat(a,")"))},r.onDTLSTransportError=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportError(").concat(a,")"))},r.onFirstAudioDecoded=a=>{var o;let c=Array.from(al(o=this.remoteUserMap).call(o)).find(g=>g._audioSSRC===a);var f;c&&(this.store.subscribe(c.uid,"audio",void 0,void 0,void 0,Date.now()),(f=c.audioTrack)===null||f===void 0||f.emit(Ob.FIRST_FRAME_DECODED),$t.firstRemoteFrame(this.store.sessionId,Is.FIRST_AUDIO_DECODE,fr.FIRST_AUDIO_DECODE,{peer:c._uintid,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId}))},r.onFirstAudioReceived=a=>{var o;let c=Array.from(al(o=this.remoteUserMap).call(o)).find(f=>f._audioSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Is.FIRST_AUDIO_RECEIVED,fr.FIRST_AUDIO_RECEIVED,{peer:c._uintid,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onFirstVideoDecoded=(a,o,c)=>{this.reportVideoFirstFrameDecoded(a,o,c)},r.onFirstVideoReceived=a=>{var o;let c=Array.from(al(o=this.remoteUserMap).call(o)).find(f=>f._videoSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Is.FIRST_VIDEO_RECEIVED,fr.FIRST_VIDEO_RECEIVED,{peer:c._uintid,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onSelectedLocalCandidateChanged=(a,o)=>{let c=a.candidateType==="relay",f=o.candidateType==="relay";o.candidateType!=="unknown"&&c===f||this.emit(pn.ConnectionTypeChange,c),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedLocalCandidateChanged(").concat(JSON.stringify(K0(o))," -> ").concat(JSON.stringify(K0(a)),")"))},r.onSelectedRemoteCandidateChanged=(a,o)=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedRemoteCandidateChanged(").concat(JSON.stringify(K0(o))," -> ").concat(JSON.stringify(K0(a)),")"))},r.onFirstVideoDecodedTimeout=a=>{this.reportVideoFirstFrameDecoded(a,void 0,void 0,!0)},r.onLocalCandidate=a=>{this.emit(pn.LocalCandidate,{candidate:a,direction:r.direction})}}unbindConnectionEvents(r){r.onConnectionStateChange=void 0,r.onICEConnectionStateChange=void 0,r.onICETransportStateChange=void 0,r.onDTLSTransportStateChange=void 0,r.onDTLSTransportError=void 0,r.onFirstAudioDecoded=void 0,r.onFirstAudioReceived=void 0,r.onFirstVideoDecoded=void 0,r.onFirstVideoReceived=void 0,r.onSelectedLocalCandidateChanged=void 0,r.onSelectedRemoteCandidateChanged=void 0,r.onFirstVideoDecodedTimeout=void 0,r.onLocalCandidate=void 0}async handleDisconnect(r){let a=r===oo.SEND_ONLY?this.sendConnection:this.recvConnection;a&&!a.isInRestartIce&&(a.isInRestartIce=!0,z.debug("[".concat(this.store.clientId,"] [P2PChannel-").concat(a.name,"] start use restartICE")),r===oo.SEND_ONLY?this.restartICE(r):Yr(this,pn.RequestP2PRestartICE,{direction:oo.SEND_ONLY}))}filterTobeMutedTracks(r){let a=[];if(this.getAllTracks().indexOf(r)===-1)return a;let o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ss)return o.track.isActive||a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:g}]=f;return r===g});if(c&&(a.push(c),c[0]===ht.LocalVideoTrack)){let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}return a}filterTobeUnmutedTracks(r){let a=[],o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ss)return o.track.isActive&&a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:g}]=f;return r===g});if(c)if(c[0]===ht.LocalVideoTrack){a.push(c);let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}else a.push(c);return a}createMuteMessage(r){return r.map(a=>{var o;let c,[f,{track:g,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=mi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=g._hints).call(o,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalVideoLowTrack:c=mi.Low}return{stream_type:c,ssrcs:v,mid:w}})}createUnmuteMessage(r){return r.map(a=>{var o;let c,[f,{track:g,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=mi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=g._hints).call(o,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalVideoLowTrack:c=mi.Low}return{stream_type:c,ssrcs:v,mid:w}})}filterTobeUnSubscribedTracks(r,a){let o=[],c=this.remoteUserMap.get(r);if(!c)return o;if(a){let f=c.get(a);if(!f)return o;o.push([r,{kind:a,id:f}])}else Array.from(c.entries()).forEach(f=>{let[g,v]=f;o.push([r,{kind:g,id:v}])});return o}createUnsubscribeMessage(r){let a=[];return r.forEach(o=>{let[c,{kind:f,id:g}]=o;switch(f){case Wt.VIDEO:return void(c._videoSSRC&&a.push({stream_type:Wt.VIDEO,ssrcId:c._videoSSRC}));case Wt.AUDIO:return void(c._audioSSRC&&a.push({stream_type:Wt.AUDIO,ssrcId:c._audioSSRC}))}}),a}withdrawRemoteTracks(r){r.forEach(a=>{let[o,{kind:c}]=a,f=this.remoteUserMap.get(o);f&&(f.delete(c),Array.from(f.entries()).length===0&&this.remoteUserMap.delete(o))})}async updateBitrateLimit(r){let a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalVideoLowTrack);a&&await a.track.setBitrateLimit(r.uplink),o&&r.low_stream_uplink&&await o.track.setBitrateLimit({max_bitrate:r.low_stream_uplink.bitrate,min_bitrate:r.low_stream_uplink.bitrate||0})}isP2PDisconnected(){if(this.sendConnection&&this.recvConnection){let r=this.sendConnection.peerConnectionState,a=this.recvConnection.peerConnectionState;return r!=="connected"&&a!=="connected"}return!0}async tryToUnmuteAudio(r){for(let a=0;a<r.length;a++)if(r[a]instanceof br){let o=this.filterTobeUnmutedTracks(r[a]);if(o.length===0)continue;let c=this.createUnmuteMessage(o);return void await Pi(this,pn.RequestUnmuteLocal,c)}}bindStatsUploaderEvents(){this.statsUploader.requestStats=r=>this.getStats(r),this.statsUploader.requestLocalMedia=()=>Array.from(this.localTrackMap.entries()).filter(r=>{let[,{ssrcs:a}]=r;return!!a}),this.statsUploader.requestRemoteMedia=()=>Array.from(this.remoteUserMap.entries()),this.statsUploader.requestVideoIsReady=r=>{var a;return!((a=this.recvConnection)===null||a===void 0||!a.getRemoteVideoIsReady(r))},this.statsUploader.requestUpload=(r,a)=>this.emit(pn.RequestUpload,r,a),this.statsUploader.requestUploadStats=r=>this.emit(pn.RequestUploadStats,r),this.statsUploader.requestAllTracks=()=>this.getAllTracks()}unbindStatsUploaderEvents(){this.statsUploader.requestStats=void 0,this.statsUploader.requestLocalMedia=void 0,this.statsUploader.requestRemoteMedia=void 0,this.statsUploader.requestVideoIsReady=void 0}async requestReconnect(){this.dtlsFailedCount+=1,await _s(uk(this.dtlsFailedCount,Mr)),this.emit(pn.RequestReconnect)}async reconnectP2P(){}canPublishLowStream(){return this.localTrackMap.has(ht.LocalVideoTrack)||this.pendingLocalTracks.some(r=>r instanceof Di)}throwIfTrackTypeNotMatch(r){if(r.filter(a=>a instanceof Di).length>1)throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(r.filter(a=>a instanceof br).length>1&&(r.some(a=>a instanceof br&&a._bypassWebAudio)||!Jn().webAudioMediaStreamDest))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode");for(let a of r){if(a instanceof Di&&this.pendingLocalTracks.some(o=>o instanceof Di))throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(a instanceof br&&this.pendingLocalTracks.some(o=>o instanceof br)&&(!Jn().webAudioMediaStreamDest||a._bypassWebAudio||this.pendingLocalTracks.some(o=>o instanceof br&&o._bypassWebAudio)))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode")}}getLowVideoTrack(r,a){let o=!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding,c=l8(l8({},{width:160,height:120,framerate:15,bitrate:50}),a),f;f=o?r._mediaStreamTrack.clone():l$(r,c);let g=Li(8,"track-low-"),v=new Di(f,l8(l8({},o&&{scaleResolutionDownBy:UG(c,r)}),{},{frameRate:c.framerate,bitrateMax:c.bitrate,bitrateMin:c.bitrate}),void 0,void 0,g);return v.on(S_.TRANSCEIVER_UPDATED,w=>{r._updateRtpTransceiver(w,Ib.LOW_STREAM)}),v._hints.push(Hi.LOW_STREAM),r.addListener(Mt.NEED_CLOSE,()=>{v.close()}),v}async globalLock(){return this.recvMutex.lock("From P2PChannel2.globalLock")}reportVideoFirstFrameDecoded(r,a,o,c){var f;let g=Array.from(al(f=this.remoteUserMap).call(f)).find(v=>v._videoSSRC===r);if(g){c||this.store.subscribe(g.uid,"video",void 0,void 0,void 0,void 0,Date.now());let v=this.store.keyMetrics,w=v.subscribe.find(T=>T.userId===g.uid&&T.type==="video");$t.firstRemoteVideoDecode(this.store.sessionId,Is.FIRST_VIDEO_DECODE,fr.FIRST_VIDEO_DECODE,{peer:g._uintid,videowidth:a,videoheight:o,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,r),subscribeRequestid:r,p2pid:this.store.p2pId,apEnd:v.requestAPEnd||0,apStart:v.requestAPStart||0,joinGwEnd:v.joinGatewayEnd||0,joinGwStart:v.joinGatewayStart||0,pcEnd:v.peerConnectionEnd||0,pcStart:v.peerConnectionStart||0,subscriberEnd:(w==null?void 0:w.subscribeEnd)||0,subscriberStart:(w==null?void 0:w.subscribeStart)||0,videoAddNotify:(w==null?void 0:w.streamAdded)||0,state:c?1:0})}}async remoteMediaSsrcChanged(r,a,o){if(!this.recvConnection)return!1;let c=this.remoteUserMap.get(r);if(!c)return!1;let f=c.get(a);if(!f)return!1;let g=await this.recvConnection.getRemoteSSRC(f);return g!==void 0&&g!==o}resetConnection(r){z.debug("[".concat(this.store.clientId,"] [P2PChannel2] reset connection to ").concat(r)),this.state===vi.Connected?(z.debug("[".concat(this.store.clientId,"] [P2PChannel2] fallback to websocket but P2PChannel2 state still connected, disconnect first")),this.disconnectForReconnect()):(this.sendConnection&&(this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection),this.sendConnection=void 0),this.recvConnection&&(this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection),this.recvConnection=void 0))}async publishDataChannel(r){throw new Ke(ce.NOT_SUPPORTED)}async unpublishDataChannel(r){throw new Ke(ce.NOT_SUPPORTED)}async subscribeDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}async unsubscribeDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}hasPendingRemoteDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}setPendingRemoteDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}async preConnect(r,a,o,c,f,g){throw new Ke(ce.NOT_SUPPORTED)}getEstablishParams(){throw new Ke(ce.NOT_SUPPORTED)}async reSubscribe(r){throw new Ke(ce.NOT_SUPPORTED)}async updateVideoStreamParameter(r,a){throw new Ke(ce.NOT_SUPPORTED)}unbindRtpTransceiver(){this.localTrackMap.size!==0&&Array.from(this.localTrackMap.entries()).forEach(r=>{let[a,{track:o}]=r;a===ht.LocalVideoLowTrack?o._updateRtpTransceiver(void 0,Ib.LOW_STREAM):o._updateRtpTransceiver(void 0)})}},vt(rr.prototype,"p2pConnect",[ble],Object.getOwnPropertyDescriptor(rr.prototype,"p2pConnect"),rr.prototype),vt(rr.prototype,"unpublish",[Cle],Object.getOwnPropertyDescriptor(rr.prototype,"unpublish"),rr.prototype),vt(rr.prototype,"unpublishLowStream",[Tle],Object.getOwnPropertyDescriptor(rr.prototype,"unpublishLowStream"),rr.prototype),vt(rr.prototype,"subscribe",[Rle],Object.getOwnPropertyDescriptor(rr.prototype,"subscribe"),rr.prototype),vt(rr.prototype,"mockSubscribe",[xle],Object.getOwnPropertyDescriptor(rr.prototype,"mockSubscribe"),rr.prototype),vt(rr.prototype,"unsubscribe",[Ale],Object.getOwnPropertyDescriptor(rr.prototype,"unsubscribe"),rr.prototype),vt(rr.prototype,"muteRemote",[Ile],Object.getOwnPropertyDescriptor(rr.prototype,"muteRemote"),rr.prototype),vt(rr.prototype,"unmuteRemote",[Nle],Object.getOwnPropertyDescriptor(rr.prototype,"unmuteRemote"),rr.prototype),vt(rr.prototype,"hasRemoteMediaWithLock",[Ole],Object.getOwnPropertyDescriptor(rr.prototype,"hasRemoteMediaWithLock"),rr.prototype),vt(rr.prototype,"disconnectForReconnect",[Ple],Object.getOwnPropertyDescriptor(rr.prototype,"disconnectForReconnect"),rr.prototype),vt(rr.prototype,"remoteMediaSsrcChanged",[Lle],Object.getOwnPropertyDescriptor(rr.prototype,"remoteMediaSsrcChanged"),rr.prototype),rr);function Bh(r){return function(a,o,c){let f=a[o];if(typeof f!="function")throw new Error("Cannot use mutex on object property.");return c.value=async function(){for(var g=arguments.length,v=new Array(g),w=0;w<g;w++)v[w]=arguments[w];switch(r){case Fh.SEND_ONLY:{let T=await this.sendMutex.lock("From P2PChannel2.".concat(o));try{return await f.apply(this,v)}finally{T()}}case Fh.RECEIVE_ONLY:{let T=await this.recvMutex.lock("From P2PChannel2.".concat(o));try{return await f.apply(this,v)}finally{T()}}default:{let T=await this.sendMutex.lock("From P2PChannel2.".concat(o)),R=await this.recvMutex.lock("From P2PChannel2.".concat(o));try{return await f.apply(this,v)}finally{T(),R()}}}},c}}function kle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function N_(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?kle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):kle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class b3{constructor(a){X(this,"store",void 0),X(this,"onStatsException",void 0),X(this,"onUploadPublishDuration",void 0),X(this,"onStatsChanged",void 0),X(this,"localStats",new Map),X(this,"remoteStats",new Map),X(this,"updateStatsInterval",void 0),X(this,"trafficStats",void 0),X(this,"trafficStatsPeerList",[]),X(this,"uplinkStats",void 0),X(this,"exceptionMonitor",void 0),X(this,"p2pChannel",void 0),X(this,"scalabilityMode",MAe.L1T1),X(this,"updateStats",()=>{this.p2pChannel&&(this.updateRemoteStats(this.p2pChannel),this.updateLocalStats(this.p2pChannel))}),this.store=a,this.exceptionMonitor=new U4e,this.exceptionMonitor.on("exception",(o,c,f)=>{this.onStatsException&&this.onStatsException(o,c,f)})}startUpdateStats(){this.updateStatsInterval||(this.updateStatsInterval=window.setInterval(this.updateStats,1e3))}stopUpdateStats(){this.updateStatsInterval&&(window.clearInterval(this.updateStatsInterval),this.updateStatsInterval=void 0)}reset(){this.localStats=new Map,this.remoteStats=new Map,this.trafficStats=void 0,this.trafficStatsPeerList=[],this.uplinkStats=void 0}getLocalAudioTrackStats(){return this.localStats.get(ht.LocalAudioTrack)||N_({},FW)}getLocalVideoTrackStats(){return this.localStats.get(ht.LocalVideoTrack)||N_({},BW)}getRemoteAudioTrackStats(a){let o=(g,v)=>{if(!this.trafficStats)return v;let w=this.trafficStats.peer_delay.find(T=>T.peer_uid===g);return w&&(v.publishDuration=w.B_ppad+(Date.now()-this.trafficStats.timestamp)),v},c={};if(a){var f;let g=(f=this.remoteStats.get(a))===null||f===void 0?void 0:f.audioStats;g&&(c[a]=o(a,g))}else Array.from(this.remoteStats.entries()).forEach(g=>{let[v,{audioStats:w}]=g;w&&(c[v]=o(v,w))});return c}getRemoteNetworkQualityStats(a){let o={};if(a){var c;let f=(c=this.remoteStats.get(a))===null||c===void 0?void 0:c.networkStats;f&&(o[a]=f)}else Array.from(this.remoteStats.entries()).forEach(f=>{let[g,{networkStats:v}]=f;v&&(o[g]=v)});return o}getRemoteVideoTrackStats(a){let o=(g,v)=>{if(!this.trafficStats)return v;let w=this.trafficStats.peer_delay.find(T=>T.peer_uid===g);return w&&(v.publishDuration=w.B_ppvd+(Date.now()-this.trafficStats.timestamp)),v},c={};if(a){var f;let g=(f=this.remoteStats.get(a))===null||f===void 0?void 0:f.videoStats;g&&(c[a]=o(a,g))}else Array.from(this.remoteStats.entries()).forEach(g=>{let[v,{videoStats:w}]=g;w&&(c[v]=o(v,w))});return c}getRTCStats(){let a=0,o=0,c=0,f=0,g=this.localStats.get(ht.LocalAudioTrack);g&&(a+=g.sendBytes,o+=g.sendBitrate);let v=this.localStats.get(ht.LocalVideoTrack);v&&(a+=v.sendBytes,o+=v.sendBitrate);let w=this.localStats.get(ht.LocalVideoLowTrack);w&&(a+=w.sendBytes,o+=w.sendBitrate),this.remoteStats.forEach(R=>{let{audioStats:A,videoStats:L}=R;A&&(c+=A.receiveBytes,f+=A.receiveBitrate),L&&(c+=L.receiveBytes,f+=L.receiveBitrate)});let T=1;return this.trafficStats&&(T+=this.trafficStats.peer_delay.length),{Duration:0,UserCount:T,SendBitrate:o,SendBytes:a,RecvBytes:c,RecvBitrate:f,OutgoingAvailableBandwidth:this.uplinkStats?this.uplinkStats.B_uab/1e3:0,RTT:this.trafficStats?2*this.trafficStats.B_acd:0}}addLocalStats(a){this.localStats.set(a,void 0)}removeLocalStats(a){a?this.localStats.delete(a):this.localStats.clear()}addRemoteStats(a){this.remoteStats.set(a,{})}removeRemoteStats(a){a?this.remoteStats.delete(a):this.remoteStats.clear()}addP2PChannel(a){this.p2pChannel=a}updateTrafficStats(a){a.peer_delay=a.peer_delay.filter(o=>o.B_ppad!==void 0||o.B_ppvd!==void 0),a.peer_delay.filter(o=>this.trafficStatsPeerList.indexOf(o.peer_uid)===-1).forEach(o=>{var c;let f=(c=this.p2pChannel)===null||c===void 0?void 0:c.getRemoteMedia(o.peer_uid),g=f!=null&&f.videoSSRC?ua.measureFromSubscribeStart(this.store.clientId,f.videoSSRC):0,v=f!=null&&f.audioSSRC?ua.measureFromSubscribeStart(this.store.clientId,f.audioSSRC):0;o.B_ppad!==void 0&&o.B_ppvd!==void 0&&(this.onUploadPublishDuration&&this.onUploadPublishDuration(o.peer_uid,o.B_ppad,o.B_ppvd,g>v?g:v),this.trafficStatsPeerList.push(o.peer_uid))}),this.trafficStats=a}updateUplinkStats(a){this.uplinkStats&&this.uplinkStats.B_fir!==a.B_fir&&z.debug("[".concat(this.store.clientId,"]: Period fir changes to ").concat(a.B_fir)),this.uplinkStats=a}static isRemoteVideoFreeze(a,o,c){if(!a)return!1;let f=!!c&&o.framesDecodeFreezeTime>c.framesDecodeFreezeTime,g=!c||o.framesDecodeCount>c.framesDecodeCount;return f||!g}static isRemoteAudioFreeze(a){return!!a&&a._isFreeze()}isLocalVideoFreeze(a){return!(!a.inputFrame||!a.sentFrame)&&a.inputFrame.frameRate>5&&a.sentFrame.frameRate<3}updateLocalStats(a){Array.from(this.localStats.entries()).forEach(o=>{let[c,f]=o;switch(c){case ht.LocalVideoTrack:case ht.LocalVideoLowTrack:{let v=f,w=N_({},BW),T=a.getStats(),R=a.getLocalMedia(c);if(T){let A=T.videoSend.find(L=>L.ssrc===(R==null?void 0:R.ssrcs[0].ssrcId));if(A){let L=a.getLocalVideoSize(),U=a.getEncoderConfig(ht.LocalVideoTrack);A.codec!=="H264"&&A.codec!=="H265"&&A.codec!=="VP8"&&A.codec!=="VP9"&&A.codec!=="AV1X"&&A.codec!=="AV1"||(w.codecType=A.codec),w.sendBytes=A.bytes,w.sendBitrate=v?8*Math.max(0,w.sendBytes-v.sendBytes):0,A.inputFrame?(w.captureFrameRate=A.inputFrame.frameRate,w.captureResolutionHeight=A.inputFrame.height,w.captureResolutionWidth=A.inputFrame.width):L&&(w.captureResolutionWidth=L.width,w.captureResolutionHeight=L.height),A.sentFrame?(w.sendFrameRate=A.sentFrame.frameRate,w.sendResolutionHeight=A.sentFrame.height,w.sendResolutionWidth=A.sentFrame.width):L&&(w.sendResolutionWidth=L.width,w.sendResolutionHeight=L.height),A.avgEncodeMs&&(w.encodeDelay=A.avgEncodeMs),U&&U.bitrateMax&&(w.targetSendBitrate=1e3*U.bitrateMax),w.sendPackets=A.packets,w.sendPacketsLost=A.packetsLost,w.sendJitterMs=A.jitterMs,w.sendRttMs=A.rttMs,w.totalDuration=v?v.totalDuration+1:1,w.totalFreezeTime=v?v.totalFreezeTime:0,this.isLocalVideoFreeze(A)&&(w.totalFreezeTime+=1),A.scalabilityMode&&this.scalabilityMode!==A.scalabilityMode&&(z.debug("[".concat(this.store.clientId,"]: The scalabilityMode of the video sending stream is ").concat(A.scalabilityMode)),this.scalabilityMode=A.scalabilityMode)}this.trafficStats&&(w.currentPacketLossRate=(this.trafficStats.B_pvlr4||0)/100)}var g;this.localStats.set(c,w),((v==null?void 0:v.sendResolutionWidth)!==w.sendResolutionWidth||(v==null?void 0:v.sendResolutionHeight)!==w.sendResolutionHeight)&&((g=this.onStatsChanged)===null||g===void 0||g.call(this,"resolution",{width:w.sendResolutionWidth,height:w.sendResolutionHeight})),w&&R&&this.exceptionMonitor.setLocalVideoStats(this.store.uid,R.track,w);break}case ht.LocalAudioTrack:{let v=f,w=N_({},FW),T=a.getStats(),R=a.getLocalMedia(c);if(T){let A=T.audioSend.find(L=>L.ssrc===(R==null?void 0:R.ssrcs[0].ssrcId));if(A){if(A.codec!=="opus"&&A.codec!=="aac"&&A.codec!=="PCMU"&&A.codec!=="PCMA"&&A.codec!=="G722"||(w.codecType=A.codec),A.inputLevel)w.sendVolumeLevel=Math.round(32767*A.inputLevel);else{let L=a.getLocalAudioVolume();L&&(w.sendVolumeLevel=Math.round(32767*L))}w.sendBytes=A.bytes,w.sendPackets=A.packets,w.sendPacketsLost=A.packetsLost,w.sendJitterMs=A.jitterMs,w.sendRttMs=A.rttMs,w.sendBitrate=v?8*Math.max(0,w.sendBytes-v.sendBytes):0}}this.trafficStats&&(w.currentPacketLossRate=(this.trafficStats.B_palr4||0)/100),this.localStats.set(ht.LocalAudioTrack,w),w&&R&&this.exceptionMonitor.setLocalAudioStats(this.store.uid,R.track,w);break}}})}updateRemoteStats(a){Array.from(this.remoteStats.entries()).forEach(o=>{var c,f;let[g,{videoStats:v,audioStats:w,videoPcStats:T}]=o,R=w,A=v,L=T,U=N_({},qse),F=N_({},Yse),Z=N_({},R4e),{audioTrack:W,videoTrack:K,audioSSRC:oe,videoSSRC:ue}=a.getRemoteMedia(g),xe;xe=a instanceof Hl?a.getStats(!0):a.getStats();let Ne=(c=xe)===null||c===void 0?void 0:c.audioRecv.find(lt=>lt.ssrc===oe),ke=(f=xe)===null||f===void 0?void 0:f.videoRecv.find(lt=>lt.ssrc===ue),He=this.trafficStats&&this.trafficStats.peer_delay.find(lt=>lt.peer_uid===g);if(Ne&&(Ne.codec!=="opus"&&Ne.codec!=="aac"&&Ne.codec!=="PCMU"&&Ne.codec!=="PCMA"&&Ne.codec!=="G722"||(U.codecType=Ne.codec),Ne.outputLevel?U.receiveLevel=Math.round(32767*Ne.outputLevel):W&&(U.receiveLevel=Math.round(32767*W.getVolumeLevel())),U.receiveBytes=Ne.bytes,U.receivePackets=Ne.packets,U.receivePacketsLost=Ne.packetsLost,U.packetLossRate=U.receivePacketsLost/(U.receivePackets+U.receivePacketsLost),U.receiveBitrate=R?8*Math.max(0,U.receiveBytes-R.receiveBytes):0,U.totalDuration=R?R.totalDuration+1:1,U.totalFreezeTime=R?R.totalFreezeTime:0,U.freezeRate=U.totalFreezeTime/U.totalDuration,U.receiveDelay=Ne.jitterBufferMs,U.totalDuration>10&&b3.isRemoteAudioFreeze(W)&&(U.totalFreezeTime+=1)),ke){ke.codec!=="H264"&&ke.codec!=="H265"&&ke.codec!=="VP8"&&ke.codec!=="VP9"&&ke.codec!=="AV1X"&&ke.codec!=="AV1"||(F.codecType=ke.codec),F.receiveBytes=ke.bytes,F.receiveBitrate=A?8*Math.max(0,F.receiveBytes-A.receiveBytes):0,F.decodeFrameRate=ke.decodeFrameRate<0?0:ke.decodeFrameRate,F.renderFrameRate=ke.decodeFrameRate<0?0:ke.decodeFrameRate,ke.outputFrame&&(F.renderFrameRate=ke.outputFrame.frameRate),ke.receivedFrame?(F.receiveFrameRate=ke.receivedFrame.frameRate,F.receiveResolutionHeight=ke.receivedFrame.height,F.receiveResolutionWidth=ke.receivedFrame.width):K&&(F.receiveResolutionHeight=K._videoHeight||0,F.receiveResolutionWidth=K._videoWidth||0),ke.framesRateFirefox!==void 0&&(F.receiveFrameRate=Math.round(ke.framesRateFirefox)),F.receivePackets=ke.packets,F.receivePacketsLost=ke.packetsLost,F.packetLossRate=F.receivePacketsLost/(F.receivePackets+F.receivePacketsLost),F.totalDuration=A?A.totalDuration+1:1,F.totalFreezeTime=A?A.totalFreezeTime:0,F.receiveDelay=ke.jitterBufferMs||0;let lt=!!ue&&a.getRemoteVideoIsReady(ue);K&&lt&&b3.isRemoteVideoFreeze(K,ke,L)&&(F.totalFreezeTime+=1),F.freezeRate=F.totalFreezeTime/F.totalDuration}He&&(U.end2EndDelay=He.B_ad,F.end2EndDelay=He.B_vd,U.transportDelay=He.B_ed,F.transportDelay=He.B_ed,U.currentPacketLossRate=He.B_ealr4/100,F.currentPacketLossRate=He.B_evlr4/100,Z.uplinkNetworkQuality=He.B_punq?He.B_punq:0,Z.downlinkNetworkQuality=He.B_pdnq?He.B_pdnq:0),this.remoteStats.set(g,{audioStats:U,videoStats:F,videoPcStats:ke,networkStats:Z}),W&&this.exceptionMonitor.setRemoteAudioStats(W,U),K&&this.exceptionMonitor.setRemoteVideoStats(K,F)})}}function Mle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function C3(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Mle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Mle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class iNe extends tr{constructor(a,o,c,f){super(),X(this,"spec",void 0),X(this,"token",void 0),X(this,"websocket",void 0),X(this,"pingpongTimer",void 0),X(this,"reconnectMode","retry"),X(this,"serviceMode",void 0),X(this,"reqId",0),X(this,"commandReqId",0),X(this,"handleWebSocketOpen",()=>{this.reconnectMode="retry",this.startPingPong()}),X(this,"handleWebSocketMessage",g=>{if(!g.data)return;let v=JSON.parse(g.data);v.requestId?this.emit("@".concat(v.requestId,"-").concat(v.sid),v):this.serviceMode===Ns.INJECT?this.emit(Hf.INJECT_STREAM_STATUS,v):($t.workerEvent(this.spec.sid,{actionType:"status",serverCode:v.code,workerType:this.serviceMode===Ns.TRANSCODE?1:2}),this.emit(Hf.PUBLISH_STREAM_STATUS,v))}),this.spec=o,this.token=a,this.serviceMode=f,this.websocket=new GI("live-streaming",c),this.websocket.on(_n.CONNECTED,this.handleWebSocketOpen),this.websocket.on(_n.ON_MESSAGE,this.handleWebSocketMessage),this.websocket.on(_n.REQUEST_NEW_URLS,(g,v)=>{Yr(this,Hf.REQUEST_NEW_ADDRESS).then(g).catch(v)}),this.websocket.on(_n.RECONNECTING,()=>{this.websocket.reconnectMode=this.reconnectMode})}init(a){return this.websocket.init(a)}async request(a,o,c,f){this.reqId+=1,a==="request"&&(this.commandReqId+=1);let g=this.commandReqId,v=this.reqId;if(!v||!this.websocket)throw new De(ce.UNEXPECTED_ERROR);let w=C3({command:a,sdkVersion:pd==="4.21.0"?"0.0.1":pd,seq:v,requestId:v,allocate:c,cname:this.spec.cname,appId:this.spec.appId,sid:this.spec.sid,uid:this.spec.uid.toString(),ts:Math.floor(Date.now()/1e3)},o);if(this.websocket.state==="closed")throw new De(ce.WS_DISCONNECT);let T=()=>new Ct((U,F)=>{this.websocket.once(_n.CLOSED,()=>F(new De(ce.WS_ABORT))),this.websocket.once(_n.CONNECTED,U)});this.websocket.state!=="connected"&&await T(),w.clientRequest&&(w.clientRequest.workerToken=this.token);let R=new Ct((U,F)=>{let Z=()=>{F(new De(ce.WS_ABORT))};this.websocket.once(_n.RECONNECTING,Z),this.websocket.once(_n.CLOSED,Z),this.once("@".concat(v,"-").concat(this.spec.sid),W=>{U(W)})});f&&$t.workerEvent(this.spec.sid,C3(C3({},f),{},{requestId:g,actionType:"request",payload:JSON.stringify(o.clientRequest),serverCode:0,code:0}));let A=Date.now();this.websocket.sendMessage(w);let L=null;try{L=await R}catch(U){if(this.websocket.state==="closed")throw U;return await T(),await this.request(a,o,c)}return f&&$t.workerEvent(this.spec.sid,C3(C3({},f),{},{requestId:g,actionType:"response",payload:JSON.stringify(L.serverResponse),serverCode:L.code,success:L.code===200,responseTime:Date.now()-A})),L.code!==200&&this.handleResponseError(L),L}tryNextAddress(){this.reconnectMode="tryNext",this.websocket.reconnect("tryNext")}close(){let a=pd==="4.21.0"?"0.0.1":pd;this.reqId+=1,this.websocket.state==="connected"?(this.websocket.sendMessage({command:"request",appId:this.spec.appId,cname:this.spec.cname,uid:this.spec.uid.toString(),sdkVersion:a,sid:this.spec.sid,seq:this.reqId,ts:Math.floor(Date.now()/1e3),requestId:this.reqId,clientRequest:{command:"DestroyWorker"}}),this.websocket.close(!1,!0)):this.websocket.close(!1),this.pingpongTimer&&(window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0)}handleResponseError(a){switch(a.code){case rs.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM:return void z.warning("live stream response already exists stream");case rs.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR:case rs.LIVE_STREAM_RESPONSE_BAD_STREAM:case rs.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR:return new De(ce.LIVE_STREAMING_INVALID_ARGUMENT,"",{code:a.code}).throw();case rs.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST:if(a.serverResponse.command==="UnpublishStream"||a.serverResponse.command==="UninjectStream")return;throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case rs.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED:return new De(ce.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED,"",{code:a.code}).throw();case rs.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{let o=new De(ce.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE);return this.emit(Hf.WARNING,o,a.serverResponse.url)}case rs.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN:{let o=new De(ce.LIVE_STREAMING_WARN_FREQUENT_REQUEST);return this.emit(Hf.WARNING,o,a.serverResponse.url)}case rs.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH:throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case rs.LIVE_STREAM_RESPONSE_NOT_SUPPORTED:return new De(ce.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED,"",{code:a.code}).throw();case rs.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM:{let o=new De(ce.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT);return this.emit(Hf.WARNING,o,a.serverResponse.url)}case rs.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR:return new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:a.code}).throw();case rs.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT:throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream resource limit",{retry:!0,changeAddress:!0});case rs.LIVE_STREAM_RESPONSE_WORKER_LOST:case rs.LIVE_STREAM_RESPONSE_WORKER_QUIT:if(a.serverResponse.command==="UnpublishStream"||a.serverResponse.command==="UninjectStream")return;throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case rs.ERROR_FAIL_SEND_MESSAGE:if(a.serverResponse.command==="UnpublishStream"||a.serverResponse.command==="UninjectStream")return;if(a.serverResponse.command==="UpdateTranscoding"||a.serverResponse.command==="ControlStream")return new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{code:a.code}).throw();throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case rs.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case rs.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case rs.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case rs.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:return new De(ce.LIVE_STREAMING_CDN_ERROR,"",{code:a.code}).throw()}}startPingPong(){this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(()=>{this.websocket.state==="connected"&&this.request("ping",{}).catch(ck)},6e3)}}function jle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Mo(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?jle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):jle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class rNe extends tr{constructor(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mr,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Mr;super(),X(this,"onLiveStreamWarning",void 0),X(this,"onLiveStreamError",void 0),X(this,"onInjectStatusChange",void 0),X(this,"spec",void 0),X(this,"retryTimeout",1e4),X(this,"connection",void 0),X(this,"httpRetryConfig",void 0),X(this,"wsRetryConfig",void 0),X(this,"streamingTasks",new Map),X(this,"isStartingStreamingTask",!1),X(this,"taskMutex",new As("live-streaming")),X(this,"cancelToken",Lo.CancelToken.source()),X(this,"transcodingConfig",void 0),X(this,"injectConfig",Mo({},FAe)),X(this,"injectLoopTimes",0),X(this,"uapResponse",void 0),X(this,"lastTaskId",1),X(this,"statusError",new Map),this.spec=a,this.httpRetryConfig=c,this.wsRetryConfig=o}async setTranscodingConfig(a){let o=Mo(Mo({},UAe),a);o.videoCodecProfile!==66&&o.videoCodecProfile!==77&&o.videoCodecProfile!==100&&(z.debug("[".concat(this.spec.clientId,"] set transcoding config, fix video codec profile: ").concat(o.videoCodecProfile," -> 100")),o.videoCodecProfile=100),o.transcodingUsers||(o.transcodingUsers=o.userConfigs),o.transcodingUsers&&(o.transcodingUsers=o.transcodingUsers.map(v=>Mo(Mo(Mo({},jAe),v),{},{zOrder:v.zOrder?v.zOrder+1:1}))),function(v){gr(v.width)||Ti(v.width,"config.width",0,1e4),gr(v.height)||Ti(v.height,"config.height",0,1e4),gr(v.videoBitrate)||Ti(v.videoBitrate,"config.videoBitrate",1,1e6),gr(v.videoFrameRate)||Ti(v.videoFrameRate,"config.videoFrameRate"),gr(v.lowLatency)||Sm(v.lowLatency,"config.lowLatency"),gr(v.audioSampleRate)||ls(v.audioSampleRate,"config.audioSampleRate",[32e3,44100,48e3]),gr(v.audioBitrate)||Ti(v.audioBitrate,"config.audioBitrate",1,128),gr(v.audioChannels)||ls(v.audioChannels,"config.audioChannels",[1,2,3,4,5]),gr(v.videoGop)||Ti(v.videoGop,"config.videoGop"),gr(v.videoCodecProfile)||ls(v.videoCodecProfile,"config.videoCodecProfile",[66,77,100]),gr(v.userCount)||Ti(v.userCount,"config.userCount",0,17),gr(v.backgroundColor)||Ti(v.backgroundColor,"config.backgroundColor",0,16777215),gr(v.userConfigExtraInfo)||Fs(v.userConfigExtraInfo,"config.userConfigExtraInfo",0,4096,!1),v.transcodingUsers&&!gr(v.transcodingUsers)&&(bm(v.transcodingUsers,"config.transcodingUsers"),v.transcodingUsers.forEach((w,T)=>{vk(w.uid),gr(w.x)||Ti(w.x,"transcodingUser[".concat(T,"].x"),0,1e4),gr(w.y)||Ti(w.y,"transcodingUser[".concat(T,"].y"),0,1e4),gr(w.width)||Ti(w.width,"transcodingUser[".concat(T,"].width"),0,1e4),gr(w.height)||Ti(w.height,"transcodingUser[".concat(T,"].height"),0,1e4),gr(w.zOrder)||Ti(w.zOrder-1,"transcodingUser[".concat(T,"].zOrder"),0,100),gr(w.alpha)||Ti(w.alpha,"transcodingUser[".concat(T,"].alpha"),0,1,!1)})),gr(v.watermark)||DG(v.watermark,"watermark"),gr(v.backgroundImage)||DG(v.backgroundImage,"backgroundImage"),v.images&&!gr(v.images)&&(bm(v.images,"config.images"),v.images.forEach((w,T)=>{DG(w,"images[".concat(T,"]"))}))}(o);let c=[];o.images&&c.push(...o.images.map(v=>Mo(Mo(Mo({},LG),v),{},{zOrder:255}))),o.backgroundImage&&(c.push(Mo(Mo(Mo({},LG),o.backgroundImage),{},{zOrder:0})),delete o.backgroundImage),o.watermark&&(c.push(Mo(Mo(Mo({},LG),o.watermark),{},{zOrder:255})),delete o.watermark),o.images=c,o.transcodingUsers&&(o.userConfigs=o.transcodingUsers.map(v=>Mo({},v)),o.userCount=o.transcodingUsers.length,delete o.transcodingUsers);let f=(o.userConfigs||[]).map(v=>typeof v.uid=="number"?Ct.resolve(v.uid):wre(v.uid,this.spec,this.cancelToken.token,this.httpRetryConfig));if((await Ct.all(f)).forEach((v,w)=>{o.userConfigs&&o.userConfigs[w]&&(o.userConfigs[w].uid=v)}),this.transcodingConfig=o,this.connection)try{var g;let v=await this.connection.request("request",{clientRequest:{command:"UpdateTranscoding",transcodingConfig:this.transcodingConfig}},!1,{command:"UpdateTranscoding",workerType:1,requestByUser:!0,tid:Array.from(Oh(g=this.streamingTasks).call(g)).map(w=>w.taskId).join("#")});z.debug("[".concat(this.spec.clientId,"] update live transcoding config success, code: ").concat(v.code,", config:"),JSON.stringify(this.transcodingConfig))}catch(v){if(!v.data||!v.data.retry)throw v;v.data.changeAddress&&this.connection.tryNextAddress(),this.streamingTasks.forEach(w=>{z.warning("[".concat(this.spec.clientId,"] live streaming receive error"),v.toString(),"try to republish",w.url),this.startLiveStreamingTask(w.url,w.mode,v).then(()=>{z.debug("[".concat(this.spec.clientId,"] live streaming republish ").concat(w.url," success"))}).catch(T=>{z.error("[".concat(this.spec.clientId,"] live streaming republish failed"),w.url,T.toString()),this.onLiveStreamError&&this.onLiveStreamError(w.url,T)})})}}setInjectStreamConfig(a,o){this.injectConfig=Object.assign({},this.injectConfig,a),this.injectLoopTimes=o}async startLiveStreamingTask(a,o,c){var f;if(Array.from(Oh(f=this.streamingTasks).call(f)).find(T=>T.mode===Ns.INJECT)&&o===Ns.INJECT)return new De(ce.LIVE_STREAMING_TASK_CONFLICT,"inject stream over limit").throw();if(!this.transcodingConfig&&o===Ns.TRANSCODE)throw new De(ce.INVALID_OPERATION,"[LiveStreaming] no transcoding config found, can not start transcoding streaming task");let g={command:"PublishStream",ts:Date.now(),url:a,uid:this.spec.uid.toString(),autoDestroyTime:100,acceptImageTimeout:!0};z.debug("[".concat(this.spec.clientId,"] start live streaming ").concat(a,", mode: ").concat(o));let v=await this.taskMutex.lock();if(!this.connection&&c)return void v();if(this.streamingTasks.get(a)&&!c)return v(),new De(ce.LIVE_STREAMING_TASK_CONFLICT).throw();try{this.connection||(this.connection=await this.connect(o))}catch(T){throw v(),T}switch(o){case Ns.TRANSCODE:g.transcodingConfig=Mo({},this.transcodingConfig);break;case Ns.RAW:break;case Ns.INJECT:g={cname:this.spec.cname,command:"InjectStream",sid:this.spec.sid,transcodingConfig:this.injectConfig,ts:Date.now(),url:a,loopTimes:this.injectLoopTimes}}this.uapResponse&&this.uapResponse.vid&&(g.vid=this.uapResponse.vid),this.isStartingStreamingTask=!0;let w=this.lastTaskId++;try{let T=new Ct((A,L)=>{_s(this.retryTimeout).then(()=>{if(c)return L(c);let U=this.statusError.get(a);return U?(this.statusError.delete(a),L(U)):void 0})}),R=await Ct.race([this.connection.request("request",{clientRequest:g},!0,{url:a,command:"PublishStream",workerType:o===Ns.TRANSCODE?1:2,requestByUser:!c,tid:w.toString()}),T]);this.isStartingStreamingTask=!1,z.debug("[".concat(this.spec.clientId,"] live streaming started, code: ").concat(R.code)),this.streamingTasks.set(a,{clientRequest:g,mode:o,url:a,taskId:w}),v()}catch(T){if(v(),this.isStartingStreamingTask=!1,!T.data||!T.data.retry||c)throw T;return T.data.changeAddress?(this.connection.tryNextAddress(),await this.startLiveStreamingTask(a,o,T)):await this.startLiveStreamingTask(a,o,T)}}stopLiveStreamingTask(a){return new Ct((o,c)=>{let f=this.streamingTasks.get(a);if(!f||!this.connection)return new De(ce.UNEXPECTED_ERROR,"can not find streaming task to stop").throw();let g=f.mode;f.abortTask=()=>{z.debug("[".concat(this.spec.clientId,"] stop live streaming success(worker exception)")),this.streamingTasks.delete(a),o()},this.connection.request("request",{clientRequest:{command:g===Ns.INJECT?"UninjectStream":"UnpublishStream",url:f.url}},!1,{url:a,command:"UnPublishStream",workerType:g===Ns.TRANSCODE?1:2,requestByUser:!0,tid:(this.lastTaskId++).toString()}).then(v=>{z.debug("[".concat(this.spec.clientId,"] stop live streaming success, code: ").concat(v.code)),this.streamingTasks.delete(a),this.streamingTasks.size===0&&g!==Ns.INJECT&&(this.connection&&this.connection.close(),this.connection=void 0),o(),g===Ns.INJECT&&this.onInjectStatusChange&&this.onInjectStatusChange(cb.INJECT_STREAM_STATUS_STOP_SUCCESS,this.spec.uid,a)}).catch(c)})}async controlInjectStream(a,o,c,f){let g=this.streamingTasks.get(a);if(!g||!this.connection||g.mode!==Ns.INJECT)throw new De(ce.INVALID_OPERATION,"can not find inject stream task to control");return(await this.connection.request("request",{clientRequest:{command:"ControlStream",url:a,control:o,audioVolume:c,position:f}})).serverResponse}resetAllTask(){var a;let o=Array.from(Oh(a=this.streamingTasks).call(a));this.terminate();for(let c of o)this.startLiveStreamingTask(c.url,c.mode).catch(f=>{this.onLiveStreamError&&this.onLiveStreamError(c.url,f)})}terminate(){this.cancelToken&&this.cancelToken.cancel(),this.streamingTasks=new Map,this.isStartingStreamingTask=!1,this.statusError=new Map,this.cancelToken=Lo.CancelToken.source(),this.uapResponse=void 0,this.connection&&this.connection.close(),this.connection=void 0}async connect(a){if(this.connection)throw new De(ce.UNEXPECTED_ERROR,"live streaming connection has already connected");let o=await Yr(this,yk.REQUEST_WORKER_MANAGER_LIST,a);return this.uapResponse=o,this.connection=new iNe(o.workerToken,this.spec,this.wsRetryConfig,a),this.connection.on(Hf.WARNING,(c,f)=>this.onLiveStreamWarning&&this.onLiveStreamWarning(f,c)),this.connection.on(Hf.PUBLISH_STREAM_STATUS,c=>this.handlePublishStreamServer(c)),this.connection.on(Hf.INJECT_STREAM_STATUS,c=>this.handleInjectStreamServerStatus(c)),this.connection.on(Hf.REQUEST_NEW_ADDRESS,(c,f)=>{if(!this.connection)return f(new De(ce.UNEXPECTED_ERROR,"can not get new live streaming address list"));Yr(this,yk.REQUEST_WORKER_MANAGER_LIST,a).then(g=>{this.uapResponse=g,c(g.addressList)}).catch(f)}),await this.connection.init(o.addressList),this.connection}handlePublishStreamServer(a){let o=a.serverStatus&&a.serverStatus.url||"empty_url",c=this.streamingTasks.get(o),f=a.reason;switch(a.code){case rs.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case rs.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case rs.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case rs.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:{let v=new De(ce.LIVE_STREAMING_CDN_ERROR,"",{code:a.code});if(c)return z.error(v.toString()),this.onLiveStreamError&&this.onLiveStreamError(o,v);if(!this.isStartingStreamingTask)return;this.statusError.set(o,v)}case rs.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{let v=new De(ce.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE,f);return this.onLiveStreamWarning&&this.onLiveStreamWarning(o,v)}case rs.LIVE_STREAM_RESPONSE_WORKER_LOST:case rs.LIVE_STREAM_RESPONSE_WORKER_QUIT:{var g;if(!this.connection)return;this.connection.tryNextAddress();let v=Array.from(Oh(g=this.streamingTasks).call(g));for(let w of v)w.abortTask?w.abortTask():(z.warning("[".concat(this.spec.clientId,"] publish stream status code"),a.code,"try to republish",w.url),this.startLiveStreamingTask(w.url,w.mode,new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:a.code})).then(()=>{z.debug("[".concat(this.spec.clientId,"] republish live stream success"),w.url)}).catch(T=>{z.error(T.toString()),this.onLiveStreamError&&this.onLiveStreamError(w.url,T)}));return}}}handleInjectStreamServerStatus(a){let o=Number(a.uid),c=a.serverStatus&&a.serverStatus.url;switch(a.code){case 200:return void(this.onInjectStatusChange&&this.onInjectStatusChange(cb.INJECT_STREAM_STATUS_START_SUCCESS,o,c));case 451:return this.onInjectStatusChange&&this.onInjectStatusChange(cb.INJECT_STREAM_STATUS_START_ALREADY_EXISTS,o,c),void this.streamingTasks.delete(c);case 453:return this.onInjectStatusChange&&this.onInjectStatusChange(cb.INJECT_STREAM_STATUS_START_UNAUTHORIZED,o,c),void this.streamingTasks.delete(c);case 470:return this.onInjectStatusChange&&this.onInjectStatusChange(cb.INJECT_STREAM_STATUS_BROKEN,o,c),void this.streamingTasks.delete(c);case 499:return this.onInjectStatusChange&&this.onInjectStatusChange(cb.INJECT_STREAM_STATUS_START_TIMEOUT,o,c),void this.streamingTasks.delete(c);default:return void z.debug("inject stream server status",a)}}hasUrl(a){return this.streamingTasks.has(a)}}class Ule{constructor(){X(this,"destChannelMediaInfos",new Map),X(this,"srcChannelMediaInfo",void 0)}setSrcChannelInfo(a){Yie(a),this.srcChannelMediaInfo=a}addDestChannelInfo(a){Yie(a),this.destChannelMediaInfos.set(a.channelName,a)}removeDestChannelInfo(a){gk(a),this.destChannelMediaInfos.delete(a)}getSrcChannelMediaInfo(){return this.srcChannelMediaInfo}getDestChannelMediaInfo(){return this.destChannelMediaInfos}}function Fle(r){if(!(r instanceof Ule))return new De(ce.INVALID_PARAMS,"Config should be instance of [ChannelMediaRelayConfiguration]").throw();let a=r.getSrcChannelMediaInfo(),o=r.getDestChannelMediaInfo();if(!a)return new De(ce.INVALID_PARAMS,"srcChannelMediaInfo should not be empty").throw();if(o.size===0)return new De(ce.INVALID_PARAMS,"destChannelMediaInfo should not be empty").throw()}class sNe extends tr{constructor(a,o,c){super(),X(this,"ws",void 0),X(this,"requestId",1),X(this,"heartBeatTimer",void 0),X(this,"joinInfo",void 0),X(this,"clientId",void 0),X(this,"onOpen",()=>{this.emit("open"),this.startHeartBeatCheck()}),X(this,"onClose",f=>{this.emit("close"),this.dispose()}),X(this,"onMessage",f=>{let g=JSON.parse(f.data);if(!g||g.command!=="serverResponse"||!g.requestId)return g&&g.command==="serverStatus"&&g.serverStatus&&g.serverStatus.command?(this.emit("status",g.serverStatus),void this.emit(g.serverStatus.command,g.serverStatus)):void 0;this.emit("req_".concat(g.requestId),g)}),this.joinInfo=a,this.clientId=o,this.ws=new GI("cross-channel-".concat(this.clientId),c),this.ws.on(_n.RECONNECTING,()=>{this.ws.reconnectMode="retry",this.emit("reconnecting")}),this.ws.on(_n.CONNECTED,this.onOpen),this.ws.on(_n.ON_MESSAGE,this.onMessage),this.ws.on(_n.CLOSED,this.onClose)}isConnect(){return this.ws.state==="connected"}sendMessage(a){let o=this.requestId++;return a.requestId=o,a.seq=o,this.ws.sendMessage(a),o}waitStatus(a){return new Ct((o,c)=>{let f=window.setTimeout(()=>{c(new De(ce.TIMEOUT,"wait status timeout, status: ".concat(a)))},5e3);this.once(a,g=>{window.clearTimeout(f),g.state&&g.state!==0?c(new De(ce.CROSS_CHANNEL_WAIT_STATUS_ERROR,"wait status error, status: ".concat(a))):o(void 0)}),this.once("dispose",()=>{window.clearTimeout(f),c(new De(ce.WS_ABORT))})})}async request(a){if(this.ws.state==="closed")throw new De(ce.WS_DISCONNECT);let o=()=>new Ct((v,w)=>{this.ws.once(_n.CLOSED,()=>w(new De(ce.WS_ABORT))),this.ws.once(_n.CONNECTED,v)});this.ws.state!=="connected"&&await o();let c=this.sendMessage(a),f=new Ct((v,w)=>{let T=()=>{w(new De(ce.WS_ABORT))};this.ws.once(_n.RECONNECTING,T),this.ws.once(_n.CLOSED,T),this.once("req_".concat(c),v),_s(3e3).then(()=>{this.removeAllListeners("req_".concat(c)),this.ws.off(_n.RECONNECTING,T),this.ws.off(_n.CLOSED,T),w(new De(ce.TIMEOUT,"cross channel ws request timeout"))})}),g=await f;if(!g||g.code!==200)throw new De(ce.CROSS_CHANNEL_SERVER_ERROR_RESPONSE,"response: ".concat(JSON.stringify(g)));return g}async connect(a){this.ws.removeAllListeners(_n.REQUEST_NEW_URLS),this.ws.on(_n.REQUEST_NEW_URLS,o=>{o(a)}),await this.ws.init(a)}dispose(){this.clearHeartBeatCheck(),this.emit("dispose"),this.removeAllListeners(),this.ws.close()}sendPing(a){let o=this.requestId++;return a.requestId=o,this.ws.sendMessage(a),o}startHeartBeatCheck(){this.heartBeatTimer&&window.clearInterval(this.heartBeatTimer),this.heartBeatTimer=window.setInterval(()=>{this.sendPing({command:"ping",appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sid:this.joinInfo.sid,ts:+new Date,requestId:0})},3e3)}clearHeartBeatCheck(){window.clearInterval(this.heartBeatTimer),this.heartBeatTimer=void 0}}class aNe extends tr{set state(a){a!==this._state&&(a!==ll.RELAY_STATE_FAILURE&&(this.errorCode=db.RELAY_OK),this.emit("state",a,this.errorCode),this._state=a)}get state(){return this._state}constructor(a,o,c,f,g){super(),X(this,"joinInfo",void 0),X(this,"sid",void 0),X(this,"clientId",void 0),X(this,"cancelToken",Lo.CancelToken.source()),X(this,"workerToken",void 0),X(this,"requestId",0),X(this,"signal",void 0),X(this,"prevChannelMediaConfig",void 0),X(this,"httpRetryConfig",void 0),X(this,"_resolution",void 0),X(this,"_state",ll.RELAY_STATE_IDLE),X(this,"errorCode",db.RELAY_OK),X(this,"onStatus",v=>{z.debug("[".concat(this.clientId,"] ChannelMediaStatus: ").concat(JSON.stringify(v))),v&&v.command&&(v.command==="onAudioPacketReceived"&&this.emit("event",Cm.PACKET_RECEIVED_AUDIO_FROM_SRC),v.command==="onVideoPacketReceived"&&this.emit("event",Cm.PACKET_RECEIVED_VIDEO_FROM_SRC),v.command==="onSrcTokenPrivilegeDidExpire"&&(this.errorCode=db.SRC_TOKEN_EXPIRED,this.state=ll.RELAY_STATE_FAILURE),v.command==="onDestTokenPrivilegeDidExpire"&&(this.errorCode=db.DEST_TOKEN_EXPIRED,this.state=ll.RELAY_STATE_FAILURE))}),X(this,"onReconnect",async()=>{z.debug("[".concat(this.clientId,"] ChannelMediaSocket disconnect, reconnecting")),this.emit("event",Cm.NETWORK_DISCONNECTED),this.state=ll.RELAY_STATE_IDLE,this.prevChannelMediaConfig&&this.sendStartRelayMessage(this.prevChannelMediaConfig).catch(v=>{this.state!==ll.RELAY_STATE_IDLE&&(z.error("auto restart channel media relay failed",v.toString()),this.errorCode=db.SERVER_CONNECTION_LOST,this.state=ll.RELAY_STATE_FAILURE)})}),this.joinInfo=a,this.clientId=o,this.sid=FI(),this.signal=new sNe(this.joinInfo,this.clientId,c),this.httpRetryConfig=f,this._resolution=g}async startChannelMediaRelay(a){if(this.state!==ll.RELAY_STATE_IDLE)throw new De(ce.INVALID_OPERATION);this.state=ll.RELAY_STATE_CONNECTING,await this.connect(),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: connect success"));try{await this.sendStartRelayMessage(a)}catch(o){throw o.data&&o.data.serverResponse&&o.data.serverResponse.command==="SetSourceChannel"?new De(ce.CROSS_CHANNEL_FAILED_JOIN_SRC):o.data&&o.data.serverResponse&&o.serverResponse.command==="SetDestChannelStatus"?new De(ce.CROSS_CHANNEL_FAILED_JOIN_DEST):o.data&&o.data.serverResponse&&o.serverResponse.command==="StartPacketTransfer"?new De(ce.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST):o}this.prevChannelMediaConfig=a}async updateChannelMediaRelay(a){if(this.state!==ll.RELAY_STATE_RUNNING)throw new De(ce.INVALID_OPERATION);await this.sendUpdateMessage(a),this.prevChannelMediaConfig=a}async setVideoProfile(a){if(this._resolution=a,this.state!==ll.RELAY_STATE_RUNNING)throw new De(ce.INVALID_OPERATION);let o=this.genMessage(lo.SetVideoProfile);await this.signal.request(o),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: setVideoProfile success"))}async stopChannelMediaRelay(){await this.sendStopRelayMessage(),z.debug("[".concat(this.clientId,"] stopChannelMediaRelay: send stop message success")),this.state=ll.RELAY_STATE_IDLE,this.dispose()}dispose(){z.debug("[".concat(this.clientId,"] disposeChannelMediaRelay")),this.cancelToken.cancel(),this.cancelToken=Lo.CancelToken.source(),this.state=ll.RELAY_STATE_IDLE,this.emit("dispose"),this.signal.dispose(),this.prevChannelMediaConfig=void 0}async connect(){let a=await sIe(this.joinInfo,this.cancelToken.token,this.httpRetryConfig);this.workerToken=a.workerToken,await this.signal.connect(a.addressList),this.emit("event",Cm.NETWORK_CONNECTED),this.signal.on("status",this.onStatus),this.signal.on("reconnecting",this.onReconnect)}async sendStartRelayMessage(a){let o=this.genMessage(lo.StopPacketTransfer);await this.signal.request(o),await this.signal.waitStatus("Normal Quit"),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: StopPacketTransfer success"));let c=this.genMessage(lo.SetSdkProfile,a);await this.signal.request(c),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSdkProfile success"));let f=this.genMessage(lo.SetSourceChannel,a);await this.signal.request(f),await this.signal.waitStatus("SetSourceChannelStatus"),this.emit("event",Cm.PACKET_JOINED_SRC_CHANNEL),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceChannel success"));let g=this.genMessage(lo.SetSourceUserId,a);await this.signal.request(g),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceUserId success"));let v=this.genMessage(lo.SetDestChannel,a);await this.signal.request(v),await this.signal.waitStatus("SetDestChannelStatus"),this.emit("event",Cm.PACKET_JOINED_DEST_CHANNEL),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetDestChannel success"));let w=this.genMessage(lo.StartPacketTransfer,a);await this.signal.request(w),this.emit("event",Cm.PACKET_SENT_TO_DEST_CHANNEL),this.state=ll.RELAY_STATE_RUNNING,z.debug("[".concat(this.clientId,"] startChannelMediaRelay: StartPacketTransfer success")),this.setVideoProfile(this._resolution)}async sendUpdateMessage(a){let o=this.genMessage(lo.UpdateDestChannel,a);await this.signal.request(o),this.emit("event",Cm.PACKET_UPDATE_DEST_CHANNEL),z.debug("[".concat(this.clientId,"] sendUpdateMessage: UpdateDestChannel success"))}async sendStopRelayMessage(){let a=this.genMessage(lo.StopPacketTransfer);await this.signal.request(a),z.debug("[".concat(this.clientId,"] sendStopRelayMessage: StopPacketTransfer success"))}genMessage(a,o){let c=[],f=[],g=[];this.requestId+=1;let v={appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sdkVersion:pd,sid:this.sid,ts:Date.now(),requestId:this.requestId,seq:this.requestId,allocate:!0,clientRequest:{}};v.sdkVersion==="4.21.0"&&(v.sdkVersion="0.0.1");let w=null,T=null;switch(a){case lo.SetSdkProfile:return v.clientRequest={command:"SetSdkProfile",type:"multi_channel"},v;case lo.SetSourceChannel:if(T=o&&o.getSrcChannelMediaInfo(),!T)throw new De(ce.UNEXPECTED_ERROR,"can not find source config");return v.clientRequest={command:"SetSourceChannel",uid:"0",channelName:T.channelName,token:T.token||this.joinInfo.appId},v;case lo.SetSourceUserId:if(T=o&&o.getSrcChannelMediaInfo(),!T)throw new De(ce.UNEXPECTED_ERROR,"can not find source config");return v.clientRequest={command:"SetSourceUserId",uid:T.uid+""},v;case lo.SetDestChannel:if(w=o&&o.getDestChannelMediaInfo(),!w)throw new De(ce.UNEXPECTED_ERROR,"can not find dest config");return w.forEach(R=>{c.push(R.channelName),f.push(R.uid+""),g.push(R.token||this.joinInfo.appId)}),v.clientRequest={command:"SetDestChannel",channelName:c,uid:f,token:g},v;case lo.StartPacketTransfer:return v.clientRequest={command:"StartPacketTransfer"},v;case lo.Reconnect:return v.clientRequest={command:"Reconnect"},v;case lo.StopPacketTransfer:return v.clientRequest={command:"StopPacketTransfer"},v;case lo.UpdateDestChannel:if(w=o&&o.getDestChannelMediaInfo(),!w)throw new De(ce.UNEXPECTED_ERROR,"can not find dest config");return w.forEach(R=>{c.push(R.channelName),f.push(R.uid+""),g.push(R.token||this.joinInfo.appId)}),v.clientRequest={command:"UpdateDestChannel",channelName:c,uid:f,token:g},v;case lo.SetVideoProfile:v.clientRequest={command:"SetVideoProfile",width:this._resolution.width,height:this._resolution.height}}return v}}function c8(r){var a={},o=!1;function c(f,g){return o=!0,{done:!1,value:new JW(g=new QW(function(v){v(r[f](g))}),1)}}return a[JS!==void 0&&one||"@@iterator"]=function(){return this},a.next=function(f){return o?(o=!1,f):c("next",f)},typeof r.throw=="function"&&(a.throw=function(f){if(o)throw o=!1,f;return c("throw",f)}),typeof r.return=="function"&&(a.return=function(f){return o?(o=!1,f):c("return",f)}),a}var Ble=l(Xoe);function Vle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function zle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Vle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Vle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}var ki;function Hle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Gle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Hle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Hle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Fb=(ki=class Q3 extends Ek{get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get localCodecs(){return[...new Set(this.localCapabilities&&this.localCapabilities.videoCodecs.map(a=>a.rtpMap&&a.rtpMap.encodingName.toLowerCase()||"").filter(a=>{var o;return Tt(o=Object.keys(ob)).call(o,a)}))]}constructor(a,o){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"remoteSDP",void 0),X(this,"initialOffer",void 0),X(this,"statsFilter",void 0),X(this,"useRTX",!1),X(this,"localCapabilities",void 0),X(this,"localCandidateCount",0),X(this,"allCandidatesReceived",!1),X(this,"establishPromise",void 0),X(this,"mutex",new As("P2PConnection-mutex")),this.store=o,this.peerConnection=new RTCPeerConnection(Q3.resolvePCConfiguration(a),{optional:[{googDscp:!0}]}),this.statsFilter=i8(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Oi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1,this.establishPromise=this.establish()}async establish(){try{let a=await this.peerConnection.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});if(!a.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let o=jh(a.sdp),c=S3(a.sdp,{filterRTX:!this.useRTX,filterVideoFec:ve("FILTER_VIDEO_FEC"),filterAudioFec:ve("FILTER_AUDIO_FEC"),filterAudioCodec:["opus"]});return this.localCapabilities=c,this.initialOffer=a,Gle(Gle({},o),{},{rtpCapabilities:{send:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},recv:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},sendrecv:c},offerSDP:a.sdp})}catch(a){throw new Ke(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,a.toString())}}async connect(a,o,c,f,g,v){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new class{constructor(T){X(this,"sessionDesc",void 0),X(this,"localCapabilities",void 0),X(this,"rtpCapabilities",void 0),X(this,"candidates",void 0),X(this,"iceParameters",void 0),X(this,"dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname",void 0),T=zi(T);let{remoteIceParameters:R,remoteDtlsParameters:A,candidates:L,remoteRTPCapabilities:U,remoteSetup:F,localCapabilities:Z,sdkCodec:W,cname:K}=T,oe=ir.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
a=ice-lite
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:audio
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:video
`);this.rtpCapabilities=U,this.candidates=L,this.iceParameters=R,this.dtlsParameters=A,this.setup=F,this.localCapabilities=Z,this.cname=K;for(let ue=0;ue<oe.mediaDescriptions.length;ue++){let xe=oe.mediaDescriptions[ue];if(xe.attributes.iceUfrag=R.iceUfrag,xe.attributes.icePwd=R.icePwd,xe.attributes.fingerprints=A.fingerprints,xe.attributes.candidates=L,xe.attributes.setup=F,xe.media.mediaType==="video"){xe.media.fmts=U.videoCodecs.map(ke=>ke.payloadType.toString(10));let Ne=U.videoCodecs.filter(ke=>{var He,lt;return(He=ke.rtpMap)===null||He===void 0?void 0:Tt(lt=He.encodingName.toLowerCase()).call(lt,W)});Ne.length===0&&(Ne=U.videoCodecs),xe.attributes.payloads=Ne,xe.attributes.extmaps=U.videoExtensions}xe.media.mediaType==="audio"&&(xe.media.fmts=U.audioCodecs.map(Ne=>Ne.payloadType.toString(10)),xe.attributes.payloads=U.audioCodecs,xe.attributes.extmaps=U.audioExtensions),oe.mediaDescriptions[ue]=this.mungMediaDesc(xe)}this.sessionDesc=oe,this.currentMidIndex=oe.mediaDescriptions.length-1}toString(){return ir.print(this.sessionDesc)}send(T,R,A){let{ssrcs:L,ssrcGroups:U}=Uc(R,this.cname),F=this.sessionDesc.mediaDescriptions.find(K=>T===Wt.VIDEO?K.media.mediaType==="video":K.media.mediaType==="audio"),Z=L[0].attributes.label,W=L[0].attributes.mslabel;return F.attributes.ssrcs=F.attributes.ssrcs.concat(L),F.attributes.ssrcGroups=F.attributes.ssrcGroups.concat(U),{id:Z,mslabel:W}}batchSend(T){return T.map(R=>{let{kind:A,ssrcMsg:L}=R;return this.send(A,L,void 0)})}stopSending(T){this.sessionDesc.mediaDescriptions.forEach(R=>{let A=[],L=[],U=[];R.attributes.ssrcs.forEach(F=>{Tt(T).call(T,F.attributes.label||"")?U.push(F):A.push(F)}),R.attributes.ssrcGroups.forEach(F=>{var Z;Tt(Z=U.map(W=>W.ssrcId)).call(Z,F.ssrcIds[0])||L.push(F)}),R.attributes.ssrcs=A,R.attributes.ssrcGroups=L})}mute(T){let R=this.sessionDesc.mediaDescriptions.find(A=>A.attributes.mid===T);if(!R)throw new Error("mediaDescription not found with ".concat(T," in remote SDP when calling RemoteSDP.mute."));R.attributes.direction="inactive"}unmute(T){let R=this.sessionDesc.mediaDescriptions.find(A=>A.attributes.mid===T);if(!R)throw new Error("mediaDescription not found with ".concat(T," in remote SDP when calling RemoteSDP.unmute."));R.attributes.direction="sendonly"}receive(T,R,A){T.forEach((L,U)=>{let F=L._mediaStreamTrack,Z=this.sessionDesc.mediaDescriptions.findIndex(K=>K.attributes.mid===F.kind),W=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[Z],L);this.sessionDesc.mediaDescriptions[Z]=W})}stopReceiving(T){}updateCandidates(T){T===ja.TCP?this.candidates.forEach(R=>{this.candidates.findIndex(A=>A.transport==="tcp"&&A.connectionAddress===R.connectionAddress&&A.port===R.port)===-1&&this.candidates.push(zle(zle({},R),{},{foundation:"tcpcandidate",priority:Number(R.priority)-1+"",transport:"tcp",port:Number(R.port)+90+""}))}):this.candidates=this.candidates.filter(R=>R.transport!=="tcp");for(let R of this.sessionDesc.mediaDescriptions)R.attributes.candidates=this.candidates}restartICE(T){T=zi(T),this.iceParameters=T,this.sessionDesc.mediaDescriptions.forEach(R=>{R.attributes.iceUfrag=T.iceUfrag,R.attributes.icePwd=T.icePwd})}predictReceivingMids(T){let R=[];for(let A=0;A<T;A++)R.push((this.currentMidIndex+A+1).toString(10));return R}mungRecvMediaDsec(T,R){let A=zi(T);return e1(A,R),s8(A,R),A}updateRecvMedia(T,R){let A=this.sessionDesc.mediaDescriptions.findIndex(L=>L.attributes.mid===T);if(A!==-1){let L=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[A],R);this.sessionDesc.mediaDescriptions[A]=L}}bumpMid(T){this.currentMidIndex+=T}updateTrackLabel(T,R,A){let L=this.sessionDesc.mediaDescriptions.find(F=>T===Wt.VIDEO?F.attributes.mid==="video":F.attributes.mid==="audio");if(L){let F=L.attributes.ssrcs.find(Z=>Z.attributes.label===R);var U;F&&(F.attributes.label=A,(U=F.attributes.msid)===null||U===void 0||U.replace(R,A))}}mungMediaDesc(T){let R=zi(T);return r8(R),function(A){let L=A.attributes.extmaps.find(U=>U.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01");L&&A.attributes.extmaps.splice(A.attributes.extmaps.indexOf(L),1),A.attributes.payloads.forEach(U=>{let F=U.rtcpFeedbacks.findIndex(Z=>Z.type==="transport-cc");F!==-1&&U.rtcpFeedbacks.splice(F,1)})}(R),R}getSSRC(T){for(let R of this.sessionDesc.mediaDescriptions)for(let A of R.attributes.ssrcs)if(A.attributes.label===T)return[A]}}({remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f.send,remoteSetup:g,localCapabilities:this.localCapabilities,sdkCodec:this.store.codec,cname:v});let w=this.remoteSDP.toString();await this.peerConnection.setLocalDescription(this.initialOffer),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(w){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(w.toString()))}}async updateRemoteRTPCapabilities(a,o){throw new Ke(ce.NOT_SUPPORTED,"Planb mode does not support createDataChannels.")}send(a,o){var c=this;return zl(function*(){let f=yield Dn(c.mutex.lock());try{if(!c.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");let g=a.map(U=>c.peerConnection.addTrack(U._mediaStreamTrack)),v=yield Dn(c.peerConnection.createOffer()),w=ir.parse(v.sdp),T=a.map(U=>{let F=U._mediaStreamTrack,Z=w.mediaDescriptions.find(W=>W.attributes.mid===F.kind);if(!Z)throw new Error("Cannot extract ssrc from mediaDescription.");return function(W,K,oe){let ue=W.attributes.ssrcs.filter(Ne=>Ne.attributes.label===K),xe=W.attributes.ssrcGroups;if(ue.length===0)throw new Error("Cannot extract ssrc from plan-b SDP.");if(xe&&ue.length>1){let Ne=xe.find(ke=>ke.ssrcIds.indexOf(ue[0].ssrcId)!==-1);return Ne?[{ssrcId:Ne.ssrcIds[0],rtx:oe?Ne.ssrcIds[1]:void 0}]:[{ssrcId:ue[0].ssrcId}]}return[{ssrcId:ue[0].ssrcId}]}(Z,F.id,c.useRTX)}),R;try{R=yield T}catch(U){throw g.forEach(F=>{ys()&&F.replaceTrack(null),c.peerConnection.removeTrack(F)}),U}let A=c.mungSendOfferSDP(v.sdp,a);c.remoteSDP.receive(a,o,R);let L=c.remoteSDP.toString();return yield Dn(c.peerConnection.setLocalDescription({type:"offer",sdp:A})),yield Dn(c.applySendEncodings(g,a)),yield Dn(c.peerConnection.setRemoteDescription({type:"answer",sdp:L})),a.map((U,F)=>{let Z=U._mediaStreamTrack.id;return{localSSRC:T[F],id:Z}})}catch(g){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(g.toString()))}finally{f()}})()}async stopSending(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");let o=this.peerConnection.getSenders().filter(g=>{var v;return a.indexOf(((v=g.track)===null||v===void 0?void 0:v.id)||"")!==-1});if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");o.map(g=>{ys()&&g.replaceTrack(null),this.peerConnection.removeTrack(g)});let c=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(c),this.remoteSDP.stopReceiving(a);let f=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:f})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(o.toString()))}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{id:g,mslabel:v}=this.remoteSDP.send(a,o,f),w=new Ct((A,L)=>{let U=setTimeout(()=>{L(new Error("Cannot receive track, id: ".concat(g)))},1e4),F=Z=>{let W=ni();if((W.name==="Safari"&&Number(W.version)===11||ca())&&Z.track.id!==g&&Z.streams[0].id===v){var K;let oe=Z.streams[0].getTracks()[0];return(K=this.remoteSDP)===null||K===void 0||K.updateTrackLabel(a,g,Z.track.id),this.peerConnection.removeEventListener("track",F),clearTimeout(U),void A(oe)}if(Z.track.id===g)return this.peerConnection.removeEventListener("track",F),clearTimeout(U),void A(Z.track)};this.peerConnection.addEventListener("track",F)}),T=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:T});let R=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(R),{track:await w,id:g}}catch(g){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(g.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let c=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(c)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}async muteRemote(a){}async unmuteRemote(a){}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getSenders().filter(c=>{var f;return a.indexOf(((f=c.track)===null||f===void 0?void 0:f.id)||"")!==-1});if(o.length!==a.length)throw new Error("sender' length doesn't match mids' length.");o.map(c=>{if(ys()&&c.track)c.track.enabled=!1;else{let f=c.getParameters();f.encodings.forEach(g=>g.active=!1),c.setParameters(f)}})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getSenders().filter(g=>{var v;return a.indexOf(((v=g.track)===null||v===void 0?void 0:v.id)||"")!==-1});if(o.length!==a.length)throw new Error("Senders' length doesn't match mids' length.");o.map(async g=>{if(ys()&&g.track)g.track.enabled=!0;else{let v=g.getParameters();v.encodings.forEach(w=>w.active=!0),await g.setParameters(v)}});let c=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(c);let f=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:f})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(o.toString()))}}restartICE(a){var o=this;return zl(function*(){let c=yield Dn(o.mutex.lock("From P2PConnection.restartICE"));try{if(!o.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");if(Jn().supportPCSetConfiguration){let T=o.peerConnection.getConfiguration(),R=a===ja.RELAY?"relay":"all";T.iceTransportPolicy!==R&&(z.debug("[".concat(o.store.clientId,"] restartICE change iceTransportPolicy from [").concat(T.iceTransportPolicy,"] to [").concat(R,"]")),T.iceTransportPolicy=R,o.peerConnection.setConfiguration(T))}else if(a===ja.RELAY)return;a!==ja.RELAY&&o.remoteSDP.updateCandidates(a);let f=yield Dn(o.peerConnection.createOffer({iceRestart:!0}));if(!f.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let g=jh(f.sdp),{remoteIceParameters:v}=yield g.iceParameters;o.remoteSDP.restartICE(v);let w=o.remoteSDP.toString();yield Dn(o.peerConnection.setLocalDescription(f)),yield Dn(o.peerConnection.setRemoteDescription({type:"answer",sdp:w}))}catch(f){z.warning("[".concat(o.store.clientId,"] restart ICE failed, abort operation"),f)}finally{c()}})()}close(){var a;this.peerConnection.close(),(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o]);this.remoteSDP.updateRecvMedia(o._mediaStreamTrack.kind,o);let g=this.remoteSDP.toString();await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(c){throw new Ke(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getSenders().filter(f=>{var g;return((g=f.track)===null||g===void 0?void 0:g.id)===a});c.length===1&&await this.applySendEncodings(c,[o])}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getSenders().find(f=>{var g;return((g=f.track)===null||g===void 0?void 0:g.id)===o});c&&await c.replaceTrack(a._mediaStreamTrack)}createDataChannels(a,o){throw new Ke(ce.NOT_SUPPORTED,"Planb mode does not support createDataChannels.")}stopDataChannels(a){throw new Ke(ce.NOT_SUPPORTED,"Planb mode does not support stopDataChannels.")}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a;(a=this.onICEConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=a=>{a.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout(()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))},ve("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a){let o={iceServers:[],sdpSemantics:"plan-b"};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(rb(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...Q3.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...Q3.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}async updateRtpSenderEncodings(a,o){var c;if(o||(o=this.peerConnection.getSenders().find(R=>{var A;return((A=R.track)===null||A===void 0?void 0:A.id)===a._mediaStreamTrack.id})),!o)return z.warn("[".concat(a.getTrackId(),"] no rtpSender found}"));if(!Jn().supportSetRtpSenderParameters)return z.warn("Browser not support set rtp-sender parameters");let f={},g={};if(a instanceof Di)switch(a._optimizationMode){case"motion":f.degradationPreference="maintain-framerate";break;case"detail":f.degradationPreference="maintain-resolution";break;default:f.degradationPreference="balanced"}if(ve("DSCP_TYPE")&&F0()){var v;let R=ve("DSCP_TYPE");Tt(v=["very-low","low","medium","high"]).call(v,R)&&(g.networkPriority=R)}let w=o.getParameters(),T=(c=w.encodings)===null||c===void 0?void 0:c[0];T&&Object.assign(T,g),Object.assign(w,f),z.debug("[".concat(a.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(w.encodings))),await o.setParameters(w)}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let c=0;c<a.length;c++){let f=a[c],g=o[c];f&&g&&await this.updateRtpSenderEncodings(g,f)}}catch{z.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}}mungSendOfferSDP(a,o){let c=ir.parse(a);return o.forEach((f,g)=>{let v=f._mediaStreamTrack,w=c.mediaDescriptions.find(T=>T.attributes.mid===v.kind);w&&e1(w,f)}),ir.print(c)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0}async batchReceive(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");let o=this.remoteSDP.batchSend(a).map((g,v)=>{let{id:w,mslabel:T}=g,{kind:R}=a[v];return new Ct((A,L)=>{let U=setTimeout(()=>{L(new Error("Cannot receive track, id: ".concat(w)))},1e4),F=Z=>{let W=ni();if(W.name==="Safari"&&Number(W.version)===11&&Z.track.id!==w&&Z.streams[0].id===T){var K;let oe=Z.streams[0].getTracks()[0];return(K=this.remoteSDP)===null||K===void 0||K.updateTrackLabel(R,w,Z.track.id),this.peerConnection.removeEventListener("track",F),clearTimeout(U),void A({track:oe,id:w})}if(Z.track.id===w)return this.peerConnection.removeEventListener("track",F),clearTimeout(U),void A({track:Z.track,id:w})};this.peerConnection.addEventListener("track",F)})}),c=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:c});let f=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(f),await Ct.all(o)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(o.toString()))}}async getRemoteSSRC(a){if(!this.remoteSDP)return;let o=this.remoteSDP.getSSRC(a);return o==null?void 0:o[0].ssrcId}setConfiguration(a){if(Jn().supportPCSetConfiguration){let o=Q3.resolvePCConfiguration(a);this.peerConnection.setConfiguration(o)}}},vt(ki.prototype,"connect",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"connect"),ki.prototype),vt(ki.prototype,"stopSending",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"stopSending"),ki.prototype),vt(ki.prototype,"receive",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"receive"),ki.prototype),vt(ki.prototype,"stopReceiving",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"stopReceiving"),ki.prototype),vt(ki.prototype,"muteRemote",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"muteRemote"),ki.prototype),vt(ki.prototype,"unmuteRemote",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"unmuteRemote"),ki.prototype),vt(ki.prototype,"muteLocal",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"muteLocal"),ki.prototype),vt(ki.prototype,"unmuteLocal",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"unmuteLocal"),ki.prototype),vt(ki.prototype,"close",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"close"),ki.prototype),vt(ki.prototype,"updateEncoderConfig",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"updateEncoderConfig"),ki.prototype),vt(ki.prototype,"updateSendParameters",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"updateSendParameters"),ki.prototype),vt(ki.prototype,"replaceTrack",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"replaceTrack"),ki.prototype),vt(ki.prototype,"getRemoteSSRC",[wd],Object.getOwnPropertyDescriptor(ki.prototype,"getRemoteSSRC"),ki.prototype),ki);function wd(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,g=await f.lock("Locking from P2PConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),T=0;T<v;T++)w[T]=arguments[T];return await c.apply(this,w)}finally{g()}},o}function Wle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function r1(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Wle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Wle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let T3="9",$le=4e4;function Kle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Dm(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Kle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Kle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let d8=function(r){return r.BANDWIDTH="bandwidth",r.CPU="cpu",r.NONE="none",r.OTHER="other",r}({});var Bb=function(r){return r[r.DOWN=0]="DOWN",r[r.UP=1]="UP",r}(Bb||{});let u8=new Map;function qle(r,a,o,c){let{scale:f}=r;if(f===0&&c===Bb.UP||f>=a.length-1&&c===Bb.DOWN)return r;let g=Dm(Dm({},r),{},{scale:c===Bb.DOWN?++f:--f});switch(o){case"maintain-framerate":g=Dm(Dm({},g),a[f].motion);break;case"maintain-resolution":g=Dm(Dm({},g),a[f].detail);break;case"balanced":g=Dm(Dm({},g),a[f].balanced)}return g}function Yle(r,a){if(a){let o={overUse:0,underUse:0,adaptationList:Xle(a)};u8.set(r,o)}else u8.delete(r)}function Xle(r){let a=Dm({},r),{bitrateMax:o,frameRate:c,scaleResolutionDownBy:f,bitrateMin:g}=a,{MIN_FRAME_RATE:v,MAX_THRESHOLD_FRAMERATE:w,MAX_SCALE:T,BITRATE_MIN_THRESHOLD:R,BITRATE_MAX_THRESHOLD:A,BWE_SCALE_UP_THRESHOLD:L,BWE_SCALE_DOWN_THRESHOLD:U,PERF_SCALE_DOWN_THRESHOLD:F,PERF_SCALE_UP_THRESHOLD:Z,BALANCE_BITRATE_FACTOR:W,BALANCE_FRAMERATE_FACTOR:K,BALANCE_RESOLUTION_FACTOR:oe,MOTION_RESOLUTION_FACTOR:ue,MOTION_BITRATE_FACTOR:xe,DETAIL_FRAMERATE_FACTOR:Ne,DETAIL_BITRATE_FACTOR:ke}=CG,He=Math.min(a.frameRate,w),lt=[{scale:0,threshold:{bwe_down:Math.round(Math.pow(U,1)*o),bwe_up:o,fps_down:Math.round(Math.pow(F,1)*He),fps_up:c},balanced:{scaleResolutionDownBy:1,frameRate:c,bitrateMax:o,bitrateMin:g},motion:{scaleResolutionDownBy:1,frameRate:c,bitrateMax:o,bitrateMin:g},detail:{scaleResolutionDownBy:1,frameRate:c,bitrateMax:o,bitrateMin:g}}];for(let ut=1;ut<=T;ut++){let ft={bwe_up:Math.round(Math.pow(L,ut)*o),bwe_down:Math.round(Math.pow(U,ut+1)*o),fps_up:Math.round(Math.pow(Z,ut)*He),fps_down:Math.round(Math.pow(F,ut+1)*He)},zt={scaleResolutionDownBy:f/Math.pow(oe,ut),frameRate:Math.max(Math.round(Math.pow(K,ut)*c),v),bitrateMax:Math.max(Math.round(Math.pow(W,ut)*o),A),bitrateMin:Math.max(Math.round(Math.pow(W,ut)*g),R)},$n={scaleResolutionDownBy:f/Math.pow(ue,ut),frameRate:c,bitrateMax:Math.max(Math.round(Math.pow(xe,ut)*o),A),bitrateMin:Math.max(Math.round(Math.pow(xe,ut)*g),R)},hi={scaleResolutionDownBy:1,frameRate:Math.max(Math.round(Math.pow(Ne,ut)*c),v),bitrateMax:Math.max(Math.round(Math.pow(ke,ut)*o),A),bitrateMin:Math.max(Math.round(Math.pow(ke,ut)*g),R)};lt.push({scale:ut,threshold:ft,balanced:zt,motion:$n,detail:hi})}return lt}function oNe(r,a,o,c,f,g){let v=u8.get(r)||{overUse:0,underUse:0,adaptationList:Xle(f)},{adaptationList:w}=v;u8.set(r,v);let{OVERUSE_TIMES_THRESHOLD:T,UNDERUSE_TIMES_THRESHOLD:R}=CG,{scale:A}=c,L,U;return typeof a=="number"&&a>0&&function(F,Z,W,K){if(Z>=W.length)return!1;let{threshold:{fps_down:oe}}=W[Z];return ve("FORCE_AG_HIGH_FRAMERATE")&&K==="maintain-framerate"&&(oe=W[0].threshold.fps_down),F<oe}(a,A,w,g)&&(v.overUse++,U=d8.CPU,v.overUse>T)||typeof o=="number"&&o>0&&function(F,Z,W){if(Z>=W.length)return!1;let{threshold:{bwe_down:K}}=W[Z];return F<K}(o,A,w)&&(v.overUse++,U=d8.BANDWIDTH,v.overUse>T)?(v.overUse=0,v.underUse=0,L=qle(c,w,g,Bb.DOWN),[L,U]):(typeof a=="number"&&a>0&&typeof o=="number"&&o>0&&function(F,Z,W,K){if(Z===0)return;let{threshold:{fps_up:oe}}=W[Z];return ve("FORCE_AG_HIGH_FRAMERATE")&&K==="maintain-framerate"&&(oe=W[1].threshold.fps_up),F>oe}(a,A,w,g)&&function(F,Z,W){if(Z===0)return;let{threshold:{bwe_up:K}}=W[Z];return F>K}(o,A,w)&&(v.underUse++,v.underUse>R&&(v.overUse=0,v.underUse=0,L=qle(c,w,g,Bb.UP),L.scale===0&&(U=d8.NONE))),[L,U])}function Jle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function u$(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Jle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Jle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function lNe(r){var a;return!!ve("ENABLE_AG_ADAPTATION")&&!!(r instanceof YW||Tt(a=r._hints).call(a,Hi.CUSTOM_TRACK))&&(!!ve("FORCE_SUPPORT_AG_ADAPTATION")||!!(function(o){let c=ni();if(c.os!==vs.IOS||!c.osVersion)return!1;let f=c.osVersion.split(".");return Number(f[0])>=o}(14)&&oie(17,4)||aie(14)&&lie(17,4)))}let h8=new Map;function f8(r){let a=h8.get(r);if(a){let{timer:o,adaptationFunc:c,originConfig:f}=a;window.clearTimeout(o),c(f),h8.delete(r)}Yle(r)}var ri;function Qle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function s1(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Qle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Qle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Vh=(ri=class Z3 extends Ek{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get dtlsTransportState(){var a,o;return(a=(o=this.peerConnection.getReceivers()[0])===null||o===void 0||(o=o.transport)===null||o===void 0?void 0:o.state)!==null&&a!==void 0?a:null}get localCodecs(){return[...new Set(this.localCapabilities&&this.localCapabilities.send.videoCodecs.map(a=>a.rtpMap&&a.rtpMap.encodingName.toLowerCase()||"").filter(a=>{var o;return Tt(o=Object.keys(ob)).call(o,a)}))]}constructor(a,o){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"id",Li(5,"connection-")),X(this,"remoteSDP",void 0),X(this,"initialOffer",void 0),X(this,"transportEventReceiver",void 0),X(this,"statsFilter",void 0),X(this,"useXR",ve("USE_XR")),X(this,"localCapabilities",void 0),X(this,"remoteCodecs",void 0),X(this,"localCandidateCount",0),X(this,"allCandidatesReceived",!1),X(this,"dataStreamChannelMap",new Map),X(this,"establishPromise",void 0),X(this,"recoveredDataChannelIds",[]),X(this,"currentDataChannelId",1),X(this,"mutex",new As("P2PConnection-mutex")),X(this,"qualityLimitationReason",d8.NONE),this.store=o,this.peerConnection=new RTCPeerConnection(Z3.resolvePCConfiguration(a),{optional:[{googDscp:!0}]}),this.statsFilter=i8(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Oi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1,this.establishPromise=this.establish()}async updateRemoteRTPCapabilities(a,o){if(this.remoteCodecs=o,!this.remoteSDP)return void z.debug("[P2PConnection] cannot updateRemoteRTPCapabilities before remote SDP created, local codecs: ".concat(this.localCodecs,", codecs: ").concat(o));if(this.remoteSDP.updateRemoteCodec(a,o,this.store.codec)){let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c);let g=this.remoteSDP.toString();f==null||f(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}else z.debug("[P2PConnection] updateRemoteRTPCapabilities no need to exchange SDP.")}async establish(){try{this.peerConnection.addTransceiver("video",{direction:"recvonly"}),this.peerConnection.addTransceiver("audio",{direction:"recvonly"});let a=await this.peerConnection.createOffer();if(!a.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let o=jh(a.sdp),c=await a$({filterRTX:!ve("USE_PUB_RTX")&&!ve("USE_SUB_RTX"),filterVideoFec:ve("FILTER_VIDEO_FEC"),filterAudioFec:ve("FILTER_AUDIO_FEC"),filterVideoCodec:ve("FILTER_VIDEO_CODEC")},{useXR:this.useXR});return this.localCapabilities=Ub(c),this.initialOffer=a,s1(s1({},o),{},{rtpCapabilities:c,offerSDP:a.sdp})}catch(a){throw new Ke(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,a.toString())}}async connect(a,o,c,f,g,v){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new class{get localCapabilities(){return zi(this._localCapabilities)}get rtpCapabilities(){return zi(this._rtpCapabilities)}get candidates(){return zi(this._candidates)}get iceParameters(){return zi(this._iceParameters)}get dtlsParameters(){return zi(this._dtlsParameters)}constructor(F){X(this,"sessionDesc",void 0),X(this,"_localCapabilities",void 0),X(this,"_rtpCapabilities",void 0),X(this,"_candidates",void 0),X(this,"_iceParameters",void 0),X(this,"_dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname",void 0),X(this,"firefoxSsrcMidMap",new Map),F=zi(F);let{remoteIceParameters:Z,remoteDtlsParameters:W,candidates:K,remoteRTPCapabilities:oe,remoteSetup:ue,localCapabilities:xe,cname:Ne}=F,ke=ir.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=ice-lite
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`);this._rtpCapabilities=oe,this._candidates=K,this._iceParameters=Z,this._dtlsParameters=W,this._localCapabilities=xe,this.setup=ue,this.cname=Ne;let He=this.rtpCapabilities.send;for(let lt of ke.mediaDescriptions){if(lt.attributes.iceUfrag=Z.iceUfrag,lt.attributes.icePwd=Z.icePwd,lt.attributes.fingerprints=W.fingerprints,lt.attributes.candidates=K,lt.attributes.setup=ue,lt.media.mediaType==="video"&&(lt.media.fmts=He.videoCodecs.map(ut=>ut.payloadType.toString(10)),lt.attributes.payloads=He.videoCodecs,lt.attributes.extmaps=He.videoExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:ut,ssrcGroups:ft}=Uc([{ssrcId:$le,rtx:ve("USE_SUB_RTX")?40001:void 0}],this.cname);lt.attributes.ssrcs=ut,lt.attributes.ssrcGroups=ft}if(lt.media.mediaType==="audio"&&(lt.media.fmts=He.audioCodecs.map(ut=>ut.payloadType.toString(10)),lt.attributes.payloads=He.audioCodecs,lt.attributes.extmaps=He.audioExtensions,Uh(lt),ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:ut,ssrcGroups:ft}=Uc([{ssrcId:2e4}],this.cname);lt.attributes.ssrcs=ut,lt.attributes.ssrcGroups=ft}}this.sessionDesc=ke,this.currentMidIndex=ke.mediaDescriptions.length-1}preloadRemoteMedia(){let F=ve("PRELOAD_MEDIA_COUNT");this.rtpCapabilities;let Z=this.candidates,W=this.dtlsParameters,K=this.iceParameters,oe=this.rtpCapabilities.send;for(let ue=1;ue<F;ue++){let xe=2*ue+2e4,Ne=2*ue+$le,{ssrcs:ke,ssrcGroups:He}=Uc([{ssrcId:xe}],this.cname),{ssrcs:lt,ssrcGroups:ut}=Uc([{ssrcId:Ne,rtx:ve("USE_SUB_RTX")?Ne+1:void 0}],this.cname);this.sessionDesc.mediaDescriptions.push({media:{mediaType:"video",port:T3,protos:["UDP","TLS","RTP","SAVPF"],fmts:oe.videoCodecs.map(ft=>ft.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:K.iceUfrag,icePwd:K.icePwd,unrecognized:[],candidates:Z,extmaps:oe.videoExtensions,fingerprints:W.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:lt,ssrcGroups:ut,rtcpFeedbackWildcards:[],payloads:oe.videoCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*ue)}}),this.sessionDesc.mediaDescriptions.push({media:{mediaType:"audio",port:T3,protos:["UDP","TLS","RTP","SAVPF"],fmts:oe.audioCodecs.map(ft=>ft.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:K.iceUfrag,icePwd:K.icePwd,unrecognized:[],candidates:Z,extmaps:oe.audioExtensions,fingerprints:W.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:ke,ssrcGroups:He,rtcpFeedbackWildcards:[],payloads:oe.audioCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*ue+1)}}),this.currentMidIndex+=2}this.updateBundleMids()}toString(){return ir.print(this.sessionDesc)}send(F,Z,W,K){let{ssrcs:oe,ssrcGroups:ue}=Uc(Z,this.cname,ve("SYNC_GROUP")?W:void 0),xe=this.findPreloadMediaDesc(oe);if(xe){if(Oi()&&this.firefoxSsrcMidMap.set(oe[0].ssrcId,xe.attributes.mid),K&&(K.twcc||K.remb)){let Ne=this.sessionDesc.mediaDescriptions.indexOf(xe);return this.sessionDesc.mediaDescriptions[Ne]=this.mungSendMediaDesc(xe,K),{mid:xe.attributes.mid,needExchangeSDP:!0}}return{mid:xe.attributes.mid,needExchangeSDP:!1}}{let Ne=this.findAvailableMediaIndex(F,oe),ke;return Ne===-1||Ne===1&&(ys()||die())||Ne===0&&ve("USE_SUB_RTX")||uie()?(ke=this.createOrRecycleSendMedia(F,oe,ue,"sendonly",K),this.updateBundleMids()):(ke=zi(this.sessionDesc.mediaDescriptions[Ne]),ke.attributes.direction="sendonly",ke.attributes.ssrcs=oe,ke.attributes.ssrcGroups=ue,this.sessionDesc.mediaDescriptions[Ne]=this.mungSendMediaDesc(ke,K)),Oi()&&this.firefoxSsrcMidMap.set(oe[0].ssrcId,ke.attributes.mid),{mid:ke.attributes.mid,needExchangeSDP:!0}}}sendDataChannel(){let{mediaDesc:F,needExchangeSDP:Z}=this.createOrRecycleDataChannel();return this.updateBundleMids(),{mid:F.attributes.mid,needExchangeSDP:Z}}batchSend(F){let Z=F.map(oe=>{let{kind:ue,ssrcMsg:xe,mslabel:Ne}=oe;return this.send(ue,xe,Ne)}),W=[],K=!1;return Z.forEach(oe=>{let{mid:ue,needExchangeSDP:xe}=oe;xe&&(K=!0),W.push(ue)}),{mids:W,needExchangeSDP:K}}stopSending(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>W.attributes.mid&&F.indexOf(W.attributes.mid)!==-1);if(Z.length!==F.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");Z.forEach(W=>{W.attributes.mid==="0"||Oi()||uie()?W.attributes.ssrcs=[]:(W.attributes.ssrcs=[],W.attributes.direction="inactive",W.media.port="0")}),this.updateBundleMids()}mute(F){let Z=this.sessionDesc.mediaDescriptions.find(W=>W.attributes.mid===F);if(!Z)throw new Error("mediaDescription not found with ".concat(F," in remote SDP when calling RemoteSDP.mute."));Z.attributes.direction="inactive"}unmute(F){let Z=this.sessionDesc.mediaDescriptions.find(W=>W.attributes.mid===F);if(!Z)throw new Error("mediaDescription not found with ".concat(F," in remote SDP when calling RemoteSDP.unmute."));Z.attributes.direction="sendonly"}muteRemote(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>Tt(F).call(F,W.attributes.mid||""));if(Z.length!==F.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");Z.forEach(W=>{W.attributes.direction="inactive"})}unmuteRemote(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>Tt(F).call(F,W.attributes.mid||""));if(Z.length!==F.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");Z.forEach(W=>{W.attributes.direction="recvonly"})}receive(F,Z,W,K){F.forEach((oe,ue)=>{this.createOrRecycleRecvMedia(oe,[],"recvonly",Z,W,K[ue])}),this.updateBundleMids()}stopReceiving(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>F.indexOf(W.attributes.mid)!==-1);if(Z.length!==F.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");Z.forEach(W=>{W.media.port="0",W.attributes.direction="inactive"}),this.updateBundleMids()}updateCandidates(F){let Z=this._candidates.filter(W=>W.transport==="udp");if(F===ja.TCP){if(Z.length===0)return;if(ve("TCP_CANDIDATE_ONLY")){let W=this._candidates.filter(K=>K.transport==="tcp");Z.forEach(K=>{W.findIndex(oe=>oe.connectionAddress===K.connectionAddress)===-1&&W.push(r1(r1({},K),{},{foundation:"tcpcandidate",priority:Number(K.priority)-1+"",transport:"tcp",port:Number(K.port)+90+""}))}),this._candidates=W}else{let W=[];Z.forEach(K=>{W.push(r1(r1({},K),{},{foundation:"tcpcandidate",priority:Number(K.priority)-1+"",transport:"tcp",port:Number(K.port)+90+""}))}),this._candidates=[...Z,...W]}}else if(F===ja.RELAY){if(Z.length!==0)return;{let W=this._candidates.filter(K=>K.transport==="tcp");W.forEach(K=>{Z.push(r1(r1({},K),{},{foundation:"udpcandidate",priority:Number(K.priority)+1+"",transport:"udp",port:Number(K.port)-90+""}))}),this._candidates=[...Z,...W]}}else Z.length===0?(this._candidates.filter(W=>W.transport==="tcp").forEach(W=>{Z.push(r1(r1({},W),{},{foundation:"udpcandidate",priority:Number(W.priority)+1+"",transport:"udp",port:Number(W.port)-90+""}))}),this._candidates=Z):this._candidates=this._candidates.filter(W=>W.transport!=="tcp");for(let W of this.sessionDesc.mediaDescriptions)W.attributes.candidates=this.candidates}restartICE(F){F=zi(F),this._iceParameters=F,this.sessionDesc.mediaDescriptions.forEach(Z=>{Z.attributes.iceUfrag=F.iceUfrag,Z.attributes.icePwd=F.icePwd})}predictReceivingMids(F){let Z=[];for(let W=0;W<F;W++)Z.push((this.currentMidIndex+W+1).toString(10));return Z}findAvailableMediaIndex(F,Z){return this.sessionDesc.mediaDescriptions.findIndex(W=>{let K=W.media.mediaType===F&&W.media.port!=="0"&&(W.attributes.direction==="sendonly"||W.attributes.direction==="sendrecv")&&W.attributes.ssrcs.length===0;if(Oi()){if(K){let oe=this.firefoxSsrcMidMap.get(Z[0].ssrcId);return!(oe||W.attributes.mid!=="0"&&W.attributes.mid!=="1")||!(!oe||oe!==W.attributes.mid)}return!1}return K})}createOrRecycleDataChannel(){for(let W of this.sessionDesc.mediaDescriptions)if(W.media.mediaType==="application")return{mediaDesc:W,needExchangeSDP:!1};this.currentMidIndex+=1;let F="".concat(this.currentMidIndex),Z={media:{mediaType:"application",port:T3,protos:["UDP","DTLS","SCTP"],fmts:["webrtc-datachannel"]},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:[],fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[],rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,mid:"".concat(F),sctpPort:"5000"}};return this.sessionDesc.mediaDescriptions.push(Z),{mediaDesc:Z,needExchangeSDP:!0}}createOrRecycleRecvMedia(F,Z,W,K,oe,ue){let xe=F._mediaStreamTrack.kind,Ne=this.rtpCapabilities.recv,ke=R_(xe,Ne,this.localCapabilities.send,xe===Wt.VIDEO?K:oe),He=xe===Wt.VIDEO?Ne.videoExtensions:Ne.audioExtensions;this.currentMidIndex+=1;let lt="".concat(this.currentMidIndex),ut={media:{mediaType:xe,port:T3,protos:["UDP","TLS","RTP","SAVPF"],fmts:ke.map(zt=>zt.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:He,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:Z,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:ke,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:W,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(lt)}};ut=this.mungRecvMediaDsec(ut,F,ue);let ft=this.findFirstClosedMedia(xe);if(ft){let zt=this.sessionDesc.mediaDescriptions.indexOf(ft);this.sessionDesc.mediaDescriptions[zt]=ut}else this.sessionDesc.mediaDescriptions.push(ut);return ut}updateRemoteCodec(F,Z,W){let K=[...new Set(this._rtpCapabilities.recv.videoCodecs.map(ut=>ut.rtpMap&&ut.rtpMap.encodingName.toLowerCase()||"").filter(ut=>{var ft;return Tt(ft=Object.keys(ob)).call(ft,ut)}))],oe=new Set(Z);if(K.every(ut=>oe.has(ut)))return z.debug("codecs has not changed, no need to updateRemoteCodec, codecs: ".concat(Z)),!1;let ue=this._rtpCapabilities.recv.videoCodecs.filter(ut=>Z.some(ft=>{var zt;return Tt(zt=ut.rtpMap&&ut.rtpMap.encodingName.toLowerCase()||"").call(zt,ft)}));if(ue.length===0)return z.debug("updateRemoteCodec failed, because cannot find matched codec, remoteCapabilities codecs: ".concat(K," codecs: ").concat(Z)),!1;let xe=[...new Set(ue.map(ut=>ut.rtpMap&&ut.rtpMap.encodingName.toLowerCase()||""))],Ne;if(z.debug("updateRemoteCodec, from ".concat(K," to ").concat(xe)),F.length===0)Ne=this.sessionDesc.mediaDescriptions.filter(ut=>ut.media.mediaType==="video"&&ut.attributes.direction==="recvonly");else if(Ne=this.sessionDesc.mediaDescriptions.filter(ut=>ut.attributes.mid&&Tt(F).call(F,ut.attributes.mid)&&ut.attributes.direction==="recvonly"),Ne.length!==F.length)return z.debug("updateRemoteCodec failed, because cannot find mids, mids: ".concat(F,", codecs: ").concat(Z)),!1;if(ve("USE_PUB_RTX")||ve("USE_SUB_RTX")){let ut=o$(ue,this.rtpCapabilities.recv.videoCodecs);ue.push(...ut)}this._rtpCapabilities.recv.videoCodecs=ue;let ke=this.localCapabilities.send,He=this.rtpCapabilities.recv,lt=R_(Wt.VIDEO,He,ke,W);return Ne.forEach(ut=>{let ft=lt.map(zt=>zt.payloadType.toString(10));z.debug("updateRemoteCodec mid: ".concat(ut.attributes.mid,", from ").concat(ut.attributes.payloads," to ").concat(lt)),ut.attributes.payloads=lt,ut.media.fmts=ft}),!0}createOrRecycleSendMedia(F,Z,W,K,oe){let ue=this.rtpCapabilities.send,xe=F===Wt.VIDEO?ue.videoCodecs:ue.audioCodecs,Ne=F===Wt.VIDEO?ue.videoExtensions:ue.audioExtensions;this.currentMidIndex+=1;let ke="".concat(this.currentMidIndex),He={media:{mediaType:F,port:T3,protos:["UDP","TLS","RTP","SAVPF"],fmts:xe.map(ut=>ut.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:Ne,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:Z,ssrcGroups:W,rtcpFeedbackWildcards:[],payloads:xe,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:K,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(ke)}};He=this.mungSendMediaDesc(He,oe);let lt=this.findFirstClosedMedia(F);if(lt){let ut=this.sessionDesc.mediaDescriptions.indexOf(lt);this.sessionDesc.mediaDescriptions[ut]=He}else this.sessionDesc.mediaDescriptions.push(He);return He}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter(F=>F.media.port!=="0").map(F=>F.attributes.mid)}mungRecvMediaDsec(F,Z,W){let K=zi(F);return r8(K),e1(K,Z),s8(K,Z),r$(K),jb(K,W,this.localCapabilities.send),K}mungSendMediaDesc(F,Z){let W=zi(F);return jb(W,Z,this.localCapabilities.recv),Uh(W),W}updateRecvMedia(F,Z){let W=this.sessionDesc.mediaDescriptions.findIndex(K=>K.attributes.mid===F);if(W!==-1){let K=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[W],Z);this.sessionDesc.mediaDescriptions[W]=K}}bumpMid(F){this.currentMidIndex+=F}findFirstClosedMedia(F){return this.sessionDesc.mediaDescriptions.find(Z=>Oi()?Z.media.port==="0"&&Z.media.mediaType===F:Z.media.port==="0")}findPreloadMediaDesc(F){return this.sessionDesc.mediaDescriptions.find(Z=>{var W;return((W=Z.attributes)===null||W===void 0||(W=W.ssrcs[0])===null||W===void 0?void 0:W.ssrcId)===F[0].ssrcId})}getSSRC(F){var Z;return(Z=this.sessionDesc.mediaDescriptions.find(W=>W.attributes.mid===F))===null||Z===void 0?void 0:Z.attributes.ssrcs}}({remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f,remoteSetup:g,localCapabilities:this.localCapabilities,cname:v}),Array.isArray(this.remoteCodecs)&&this.remoteCodecs.length>0&&this.remoteSDP.updateRemoteCodec([],this.remoteCodecs,this.store.codec);let w=this.remoteSDP.toString(),T=ir.parse(this.initialOffer.sdp),R=T.mediaDescriptions.find(F=>F.media.mediaType==="audio");R&&Uh(R),this.useXR&&a8(T);let A=ir.print(T),L=this.logSDPExchange(A||"","offer","local","connect");this.store.descriptionStart(),await this.peerConnection.setLocalDescription({type:"offer",sdp:A}),L==null||L(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w});let U=this.peerConnection.getTransceivers()[0];if(U!=null&&U.receiver&&this.tryBindTransportEvents(U.receiver),ve("PRELOAD_MEDIA_COUNT")>0){this.remoteSDP.preloadRemoteMedia();let F=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:F});let Z=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(Z)}}catch(w){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(w.toString()))}}send(a,o,c){var f=this;return zl(function*(){let g=yield Dn(f.mutex.lock("From P2PConnection.send"));try{if(!f.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");let v=[];a.forEach(W=>{let K=f.peerConnection.addTransceiver(W._mediaStreamTrack,{direction:"sendonly"});v.push(K),W._updateRtpTransceiver(K)}),Oi()&&ve("SIMULCAST")===!0&&(yield Dn(f.applySimulcastForFirefox(v,a)));let w=yield Dn(f.peerConnection.createOffer()),T=f.remoteSDP.predictReceivingMids(a.length),R=f.mungSendOfferSDP(w.sdp,a,T),A=ir.parse(R),L=T.map(W=>{let K=A.mediaDescriptions.find(oe=>oe.attributes.mid===W);if(!K)throw new Error("Cannot extract ssrc from mediaDescription.");return i$(K,ve("USE_PUB_RTX"))}),U;try{U=yield L}catch(W){U=[],f.remoteSDP.receive(a,o,c,U);let K=f.remoteSDP.toString();throw yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:K})),yield Dn(f.stopSending(T,!0)),W}f.remoteSDP.receive(a,o,c,U);let F=f.remoteSDP.toString(),Z=f.logSDPExchange(R,"offer","local","send");return yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.applySimulcastEncodings(v,a)),yield Dn(f.applySendEncodings(v,a)),Z==null||Z(F),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:F})),v.map((W,K)=>{let oe=T[K];return{localSSRC:L[K],id:oe,transceiver:W}})}catch(v){throw v instanceof Ke?v:new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(v.toString()))}finally{g()}})()}async createDataChannels(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.createDataChannels before remote SDP created");let c=this.dataStreamChannelMap.get(a);if(c&&c.readyState==="open")z.debug("[P2PConnection] Channels are already available and can be reused directly.");else{let g=this.currentDataChannelId<1023?this.currentDataChannelId++:this.recoveredDataChannelIds.shift();if(typeof g!="number")throw new Error("create DataChannel error, because cannot get dc id");c=this.peerConnection.createDataChannel("datastream-channel",{id:g,negotiated:!0,ordered:!1,maxRetransmits:ve("DATASTREAM_MAX_RETRANSMITS")}),c.binaryType="arraybuffer",this.dataStreamChannelMap.set(a,c)}o.forEach(g=>{g._updateOriginDataChannel(c)});let{needExchangeSDP:f}=this.remoteSDP.sendDataChannel();if(f){let g=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:g});let v=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(v),z.debug("[P2PConnection] createDataChannels by exchanging SDP.")}else z.debug("[P2PConnection] createDataChannels no need to exchange SDP.");return}catch(c){throw c instanceof Ke?c:new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.createDataChannels failed; ".concat(c.toString()))}}async stopDataChannels(a){try{let o=this.dataStreamChannelMap.get(a);return o&&(o.id&&this.recoveredDataChannelIds.push(o.id),o.close()),void this.dataStreamChannelMap.delete(a)}catch(o){throw o instanceof Ke?o:new Ke(ce.DATACHANNEL_FAILED,"P2PConnection.stopDataChannels failed; ".concat(o.toString()))}}async stopSending(a,o){let c=o?void 0:await this.mutex.lock("From P2PConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");let f=this.peerConnection.getTransceivers().filter(T=>a.indexOf(T.mid)!==-1);if(f.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");f.map(T=>{var R;f8(this.id+T.mid),T.direction="inactive",(R=T.stop)===null||R===void 0||R.call(T)});let g=await this.peerConnection.createOffer(),v=this.logSDPExchange(g.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(g),this.remoteSDP.stopReceiving(a);let w=this.remoteSDP.toString();v==null||v(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(f){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(f.toString()))}finally{c&&c()}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{mid:g,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let T=this.remoteSDP.toString(),R=this.logSDPExchange(T,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:T});let A=await this.peerConnection.createAnswer(),L=this.mungReceiveAnswerSDP(A.sdp,g,a);R==null||R(L||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:L}),z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," no need to exchange SDP."));let w=this.peerConnection.getTransceivers().find(T=>T.mid===g);if(!w)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:w.receiver.track,id:g,transceiver:w}}catch(g){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(g.toString()))}}async batchReceive(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");let{mids:o,needExchangeSDP:c}=this.remoteSDP.batchSend(a);if(c){let f=this.remoteSDP.toString(),g=this.logSDPExchange(f,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:f});let v=await this.peerConnection.createAnswer();g==null||g(v.sdp||""),await this.peerConnection.setLocalDescription(v),z.debug("[".concat(this.store.clientId,"] [P2PConnection] batchReceive by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] batchReceive no need to exchange SDP."));return o.map(f=>{let g=this.peerConnection.getTransceivers().find(v=>v.mid===f);if(!g)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:g.receiver.track,id:f,transceiver:g}})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(o.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","stopReceiving");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}async muteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.mute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","muteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteRemote failed; ".concat(o.toString()))}}async unmuteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.unmute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","unmuteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteRemote failed; ".concat(o.toString()))}}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(v=>{v.direction="inactive"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.muteRemote(a);let g=this.remoteSDP.toString();f==null||f(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(async(v,w)=>{v.direction="sendonly"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.unmuteRemote(a);let g=this.remoteSDP.toString();f==null||f(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(o.toString()))}}restartICE(a){var o=this;return zl(function*(){let c=yield Dn(o.mutex.lock("From P2PConnection.restartICE"));try{if(!o.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");if(Jn().supportPCSetConfiguration){let R=o.peerConnection.getConfiguration(),A=a===ja.RELAY?"relay":"all";R.iceTransportPolicy!==A&&(z.debug("[".concat(o.store.clientId,"] restartICE change iceTransportPolicy from [").concat(R.iceTransportPolicy,"] to [").concat(A,"]")),R.iceTransportPolicy=A,o.peerConnection.setConfiguration(R))}else if(a===ja.RELAY)return;o.remoteSDP.updateCandidates(a);let f=yield Dn(o.peerConnection.createOffer({iceRestart:!0}));if(!f.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let g=jh(f.sdp),{remoteIceParameters:v}=yield g.iceParameters;o.remoteSDP.restartICE(v);let w=o.remoteSDP.toString(),T=o.logSDPExchange(f.sdp||"","offer","local","restartICE");o.store.descriptionStart(),yield Dn(o.peerConnection.setLocalDescription(f)),T==null||T(w),yield Dn(o.peerConnection.setRemoteDescription({type:"answer",sdp:w}))}catch(f){z.warning("[".concat(o.store.clientId,"] restart ICE failed, abort operation"),f)}finally{c()}})()}close(){var a;this.peerConnection.getTransceivers().forEach(o=>{f8(this.id+o.mid)}),this.peerConnection.close(),(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.tryUnbindTransportEvents(),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.transportEventReceiver=void 0,this.statsFilter.destroy(),this.dataStreamChannelMap.clear(),this.recoveredDataChannelIds=[],this.currentDataChannelId=1}getStats(){return s1(s1({},this.statsFilter.getStats()),{},{qualityLimitationReason:this.qualityLimitationReason})}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o],[a]);this.remoteSDP.updateRecvMedia(a,o);let g=this.remoteSDP.toString(),v=this.logSDPExchange(f,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),v==null||v(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(c){throw new Ke(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getTransceivers().filter(f=>f.mid===a);c.length===1&&(this.isVP8Simulcast(o)?Oi()||await this.applySimulcastEncodings(c,[o]):await this.applySendEncodings(c,[o]))}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getTransceivers().find(f=>f.mid===o);c&&await c.sender.replaceTrack(a._mediaStreamTrack)}async getSelectedCandidatePair(){let a=this.peerConnection.getReceivers();if(a.length>0&&a[0].transport&&a[0].transport.iceTransport&&a[0].transport.iceTransport.getSelectedCandidatePair&&a[0].transport.iceTransport.getSelectedCandidatePair()){let o=a[0].transport.iceTransport,{local:c,remote:f}=o.getSelectedCandidatePair();return{local:s1(s1({},Zf),{},{candidateType:c.type,protocol:c.protocol,address:c.address,port:c.port}),remote:s1(s1({},Zf),{},{candidateType:f.type,protocol:f.protocol,address:f.address,port:f.port})}}return this.statsFilter.getSelectedCandidatePair()}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a;(a=this.onICEConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=a=>{a.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout(()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))},ve("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a){let o={iceServers:[]};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(rb(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...Z3.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...Z3.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),ve("FORCE_TURN_TCP")?o.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),ve("ENABLE_ENCODED_TRANSFORM")&&Jn().supportWebRTCEncodedTransform&&(o.encodedInsertableStreams=!0),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat($0(c.turnServerURL),":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&!ve("FORCE_TURN_TCP")&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}tryBindTransportEvents(a){let o=a.transport;if(o){this.transportEventReceiver=a,o.onstatechange=()=>{var f;o!=null&&o.state&&((f=this.onDTLSTransportStateChange)===null||f===void 0||f.call(this,o.state))},o.onerror=f=>{var g;(g=this.onDTLSTransportError)===null||g===void 0||g.call(this,"error"in f?f.error:f)};let c=o.iceTransport;c&&(c.onstatechange=()=>{let f=o==null?void 0:o.iceTransport.state;var g;f&&((g=this.onICETransportStateChange)===null||g===void 0||g.call(this,f))},c.getSelectedCandidatePair&&(c.onselectedcandidatepairchange=()=>{if(c.getSelectedCandidatePair()){let{local:f,remote:g}=c.getSelectedCandidatePair();z.info("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] selectedcandidatepairchange: local ").concat(JSON.stringify({candidateType:f.type,protocol:f.protocol}),", remote ").concat(JSON.stringify({candidateType:g.type,protocol:g.protocol,address:g.address,port:g.port})," )"))}}))}}tryUnbindTransportEvents(){this.transportEventReceiver&&this.transportEventReceiver.transport&&(this.transportEventReceiver.transport.onstatechange=null,this.transportEventReceiver.transport.onerror=null,this.transportEventReceiver.transport.iceTransport&&(this.transportEventReceiver.transport.iceTransport.onstatechange=null))}async updateRtpSenderEncodings(a,o){var c,f;if(o||(o=this.peerConnection.getSenders().find(W=>W.track===a._mediaStreamTrack)),!o)return z.warn("[".concat(a.getTrackId(),"] no rtpSender found}"));if(this.isVP8Simulcast(a))return z.warn("[updateRtpSenderEncodings] Track is VP8 simulcast, please apply simulcast encodings");if(!Jn().supportSetRtpSenderParameters)return z.warn("[updateRtpSenderEncodings] Browser not support set rtp-sender parameters");let g={},v={};switch(a._optimizationMode){case"motion":g.degradationPreference="maintain-framerate";break;case"detail":g.degradationPreference="maintain-resolution";break;case"balanced":g.degradationPreference="balanced"}let w=function(W,K){return W.getTransceivers().find(oe=>oe.sender.track===K||oe.receiver.track===K)}(this.peerConnection,a._mediaStreamTrack),T=O4e(a);if(lNe(a)&&w&&o&&T&&this.getLocalVideoStats&&Tt(c=["vp8","vp9"]).call(c,this.store.codec)){var R;let W=g.degradationPreference||(Tt(R=a._hints).call(R,Hi.CUSTOM_TRACK)?ve("CUSTOM_ADAPTATION_DEFAULT_MODE"):"maintain-framerate");(function(K,oe,ue,xe,Ne,ke){if(f8(K),xe!=="balanced"&&xe!=="maintain-framerate"&&xe!=="maintain-resolution")return;let He=-1;Yle(K,oe);let lt=window.setInterval(()=>{let ft=h8.get(K);if(!ve("ENABLE_AG_ADAPTATION")||!ft)return void f8(K);let zt=ke();if(zt.sendPackets>0&&zt.OutgoingAvailableBandwidth>0){if(He===-1)return void(He=Date.now());if(Date.now()-He<1e3)return;let $n=zt.sendFrameRate,hi=zt.OutgoingAvailableBandwidth,[Gi,Fr]=oNe(K,$n,hi,ft.adaptationConfig,oe,xe);Fr&&(ue.qualityLimitationReason=Fr),Gi&&ft.adaptationConfig.scale!==Gi.scale&&(z.debug("[".concat(K,"] applyAdaptation: ").concat(ue.qualityLimitationReason,`
sendFps `).concat($n,", bwe ").concat(hi,", switch from ").concat(ft.adaptationConfig.scale," to ").concat(Gi.scale," ")),ft.adaptationConfig=u$(u$({},ft.adaptationConfig),Gi),Ne(Gi))}},ve("CHECK_LOCAL_STATS_INTERVAL")),ut=u$({},oe);h8.set(K,{timer:lt,adaptationConfig:ut,originConfig:oe,adaptationFunc:Ne}),z.debug("[".concat(K,"] start adaptation, originConfig: ").concat(JSON.stringify(oe),", degradationPreference: ").concat(xe))})(this.id+w.mid,T,this,W,K=>{o&&this.updateAdaptation(o,K)},this.getLocalVideoStats.bind(this))}if(a._encoderConfig){var A;let{bitrateMax:W,frameRate:K,scaleResolutionDownBy:oe}=a._encoderConfig;W&&(v.maxBitrate=1e3*W),(Tt(A=a._hints).call(A,Hi.LOW_STREAM)||a.isUseScaleResolutionDownBy)&&(K&&(v.maxFramerate=cl(K)),oe&&oe>=1&&(v.scaleResolutionDownBy=oe))}let{maxFramerate:L}=ve("ENCODER_CONFIG_LIMIT");if(L&&typeof L=="number"&&(v.maxFramerate=v.maxFramerate?Math.min(v.maxFramerate,L):L),ve("DSCP_TYPE")&&F0()){var U;let W=ve("DSCP_TYPE");Tt(U=["very-low","low","medium","high"]).call(U,W)&&(v.networkPriority=W)}let F=o.getParameters(),Z=(f=F.encodings)===null||f===void 0?void 0:f[0];Oi()&&!Z&&(g.encodings=[v]),Z&&Object.assign(Z,v),Object.assign(F,g),z.debug("[".concat(a.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(F.encodings))),await o.setParameters(F)}async updateAdaptation(a,o){var c,f;if(!a)return z.debug("[updateAdaptation] no rtpSender found");if(!Jn().supportSetRtpSenderParameters)return z.debug("[updateAdaptation] Browser not support set rtp-sender parameters");let g={},{bitrateMax:v,frameRate:w,scaleResolutionDownBy:T}=o;v&&(g.maxBitrate=1e3*v),w&&(g.maxFramerate=cl(w)),T&&T>=1&&Tt(c=["vp8","vp9"]).call(c,this.store.codec)&&(g.scaleResolutionDownBy=T);let R=a.getParameters(),A=(f=R.encodings)===null||f===void 0?void 0:f[0];A&&Object.assign(A,g),Object.assign(R,{});try{await a.setParameters(R),z.debug("[updateAdaptation] updateRtpSenderEncodings: ".concat(JSON.stringify(R.encodings)))}catch(L){!("transport"in a)||a.transport&&a.transport.state==="connected"?this.peerConnectionState!=="connected"?z.debug("[updateAdaptation] peerConnection not connected}"):z.debug("[updateAdaptation] updateRtpSenderEncodings failed",L):z.debug("[updateAdaptation] rtpSender transport not connected}")}}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let c=0;c<a.length;c++){let f=a[c],g=o[c];g instanceof Di&&!this.isVP8Simulcast(g)&&await this.updateRtpSenderEncodings(g,f.sender)}}catch{z.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}}mungSendOfferSDP(a,o,c){let f=ir.parse(a);return o.forEach((g,v)=>{let w=c[v],T=f.mediaDescriptions.find(R=>R.attributes.mid===w);T&&(e1(T,g),s$(T,g,this.store.codec))}),ir.print(f)}mungReceiveAnswerSDP(a,o,c){let f=ir.parse(a),g=f.mediaDescriptions.find(v=>v.attributes.mid===o);return g&&(c===Wt.AUDIO&&g.media.mediaType==="audio"&&Uh(g),this.useXR&&a8(f)),ir.print(f)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onFirstVideoDecodedTimeout=a=>{var o;(o=this.onFirstVideoDecodedTimeout)===null||o===void 0||o.call(this,a)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0,this.statsFilter.onFirstVideoDecodedTimeout=void 0}async applySimulcastForFirefox(a,o){if(a.length===o.length)for(let T=0;T<a.length;T++){var c,f,g,v,w;let R=a[T],A=o[T];if(A instanceof Di&&!Tt(c=A._hints).call(c,Hi.LOW_STREAM)&&(f=A._encoderConfig)!==null&&f!==void 0&&f.bitrateMax&&((g=A._encoderConfig)===null||g===void 0?void 0:g.bitrateMax)>200&&(v=A._scalabilityMode)!==null&&v!==void 0&&v.numSpatialLayers&&((w=A._scalabilityMode)===null||w===void 0?void 0:w.numSpatialLayers)>1&&this.store.codec==="vp8"){let L={},U={high:1e3*(A._encoderConfig.bitrateMax-50),medium:5e4};L.encodings=[{rid:"m",active:!0,maxBitrate:U.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:U.high}];let F=R.sender.getParameters();await R.sender.setParameters(Object.assign(F,L))}}}async applySimulcastEncodings(a,o){if(!Oi()&&a.length===o.length)for(let c=0;c<a.length;c++){let f=o[c];if(f instanceof Di&&this.isVP8Simulcast(f)){let g=a[c],v={},w={high:1e3*(f._encoderConfig.bitrateMax-50),medium:5e4};v.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:w.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:w.medium,scaleResolutionDownBy:4}];let T=g.sender.getParameters();await g.sender.setParameters(Object.assign(T,v))}}}isVP8Simulcast(a){var o,c,f,g,v;return!!(a instanceof Di&&ve("SIMULCAST")&&this.store.codec==="vp8"&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&(c=a._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&((f=a._encoderConfig)===null||f===void 0?void 0:f.bitrateMax)>200&&(g=a._scalabilityMode)!==null&&g!==void 0&&g.numSpatialLayers&&((v=a._scalabilityMode)===null||v===void 0?void 0:v.numSpatialLayers)>1)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("[".concat(this.store.clientId,"] exchanging ").concat(c," ").concat(o," SDP during P2PConnection.").concat(f,`
`),a),o==="offer"?g=>{this.logSDPExchange(g,"answer",c==="local"?"remote":"local",f)}:void 0}async getRemoteSSRC(a){if(!this.remoteSDP)return;let o=this.remoteSDP.getSSRC(a);return o==null?void 0:o[0].ssrcId}setConfiguration(a){if(Jn().supportPCSetConfiguration){let o=Z3.resolvePCConfiguration(a);this.peerConnection.setConfiguration(o)}}},vt(ri.prototype,"updateRemoteRTPCapabilities",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"updateRemoteRTPCapabilities"),ri.prototype),vt(ri.prototype,"connect",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"connect"),ri.prototype),vt(ri.prototype,"createDataChannels",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"createDataChannels"),ri.prototype),vt(ri.prototype,"receive",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"receive"),ri.prototype),vt(ri.prototype,"batchReceive",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"batchReceive"),ri.prototype),vt(ri.prototype,"stopReceiving",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"stopReceiving"),ri.prototype),vt(ri.prototype,"muteRemote",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"muteRemote"),ri.prototype),vt(ri.prototype,"unmuteRemote",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"unmuteRemote"),ri.prototype),vt(ri.prototype,"muteLocal",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"muteLocal"),ri.prototype),vt(ri.prototype,"unmuteLocal",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"unmuteLocal"),ri.prototype),vt(ri.prototype,"close",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"close"),ri.prototype),vt(ri.prototype,"updateEncoderConfig",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"updateEncoderConfig"),ri.prototype),vt(ri.prototype,"updateSendParameters",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"updateSendParameters"),ri.prototype),vt(ri.prototype,"replaceTrack",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"replaceTrack"),ri.prototype),vt(ri.prototype,"updateAdaptation",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"updateAdaptation"),ri.prototype),vt(ri.prototype,"getRemoteSSRC",[dl],Object.getOwnPropertyDescriptor(ri.prototype,"getRemoteSSRC"),ri.prototype),ri);function dl(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,g=await f.lock("From P2PConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),T=0;T<v;T++)w[T]=arguments[T];return await c.apply(this,w)}finally{g()}},o}function Zle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function ece(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Zle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Zle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let tce=`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0
a=msid-semantic: WMS
a=ice-lite
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 127.0.0.1
a=mid:0
`,p8="9",h$=2e4,f$=4e4;class cNe{get localCapabilities(){return zi(this._localCapabilities)}get rtpCapabilities(){return zi(this._rtpCapabilities)}get candidates(){return zi(this._candidates)}get iceParameters(){return zi(this._iceParameters)}get dtlsParameters(){return zi(this._dtlsParameters)}constructor(a){X(this,"sessionDesc",void 0),X(this,"_localCapabilities",void 0),X(this,"_rtpCapabilities",void 0),X(this,"_candidates",void 0),X(this,"_iceParameters",void 0),X(this,"_dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname",void 0),X(this,"firefoxSsrcMidMap",new Map),a=zi(a);let{remoteIceParameters:o,remoteDtlsParameters:c,candidates:f,remoteRTPCapabilities:g,remoteSetup:v,localCapabilities:w,cname:T}=a,R=ir.parse(tce);this._rtpCapabilities=g,this._candidates=f,this._iceParameters=o,this._dtlsParameters=c,this._localCapabilities=w,this.setup=v,this.cname=T;let A=this.rtpCapabilities.send;for(let L of R.mediaDescriptions){if(L.attributes.iceUfrag=o.iceUfrag,L.attributes.icePwd=o.icePwd,L.attributes.fingerprints=c.fingerprints,L.attributes.candidates=f,L.attributes.setup=v,L.media.mediaType==="application"&&(L.attributes.sctpPort="5000"),L.media.mediaType==="video"&&(L.media.fmts=A.videoCodecs.map(U=>U.payloadType.toString(10)),L.attributes.payloads=A.videoCodecs,L.attributes.extmaps=A.videoExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:U,ssrcGroups:F}=Uc([{ssrcId:f$,rtx:ve("USE_SUB_RTX")?40001:void 0}],this.cname);L.attributes.ssrcs=U,L.attributes.ssrcGroups=F}if(L.media.mediaType==="audio"&&(L.media.fmts=A.audioCodecs.map(U=>U.payloadType.toString(10)),L.attributes.payloads=A.audioCodecs,L.attributes.extmaps=A.audioExtensions,Uh(L),ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:U,ssrcGroups:F}=Uc([{ssrcId:h$}],this.cname);L.attributes.ssrcs=U,L.attributes.ssrcGroups=F}}this.sessionDesc=R,this.currentMidIndex=R.mediaDescriptions.length-1}updateRemoteRTPCapabilities(a){let o=ir.parse(tce);this._rtpCapabilities=a;let c=this.rtpCapabilities.send;for(let f of o.mediaDescriptions){if(f.attributes.iceUfrag=this._iceParameters.iceUfrag,f.attributes.icePwd=this._iceParameters.icePwd,f.attributes.fingerprints=this._dtlsParameters.fingerprints,f.attributes.candidates=this._candidates,f.attributes.setup=this.setup,f.media.mediaType==="application"&&(f.attributes.sctpPort="5000"),f.media.mediaType==="video"&&(f.media.fmts=c.videoCodecs.map(g=>g.payloadType.toString(10)),f.attributes.payloads=c.videoCodecs,f.attributes.extmaps=c.videoExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:g,ssrcGroups:v}=Uc([{ssrcId:f$,rtx:ve("USE_SUB_RTX")?40001:void 0}],this.cname);f.attributes.ssrcs=g,f.attributes.ssrcGroups=v}if(f.media.mediaType==="audio"&&(f.media.fmts=c.audioCodecs.map(g=>g.payloadType.toString(10)),f.attributes.payloads=c.audioCodecs,f.attributes.extmaps=c.audioExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:g,ssrcGroups:v}=Uc([{ssrcId:h$}],this.cname);f.attributes.ssrcs=g,f.attributes.ssrcGroups=v}}this.sessionDesc=o,this.currentMidIndex=o.mediaDescriptions.length-1}preloadRemoteMedia(a){this.rtpCapabilities;let o=this.candidates,c=this.dtlsParameters,f=this.iceParameters,g=this.rtpCapabilities.send;for(let v=1;v<a;v++){let w=2*v+h$,T=2*v+f$,{ssrcs:R,ssrcGroups:A}=Uc([{ssrcId:w}],this.cname),{ssrcs:L,ssrcGroups:U}=Uc([{ssrcId:T,rtx:ve("USE_SUB_RTX")?T+1:void 0}],this.cname);this.sessionDesc.mediaDescriptions.push({media:{mediaType:"video",port:p8,protos:["UDP","TLS","RTP","SAVPF"],fmts:g.videoCodecs.map(F=>F.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:f.iceUfrag,icePwd:f.icePwd,unrecognized:[],candidates:o,extmaps:g.videoExtensions,fingerprints:c.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:L,ssrcGroups:U,rtcpFeedbackWildcards:[],payloads:g.videoCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*v-1)}}),this.sessionDesc.mediaDescriptions.push({media:{mediaType:"audio",port:p8,protos:["UDP","TLS","RTP","SAVPF"],fmts:g.audioCodecs.map(F=>F.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:f.iceUfrag,icePwd:f.icePwd,unrecognized:[],candidates:o,extmaps:g.audioExtensions,fingerprints:c.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:R,ssrcGroups:A,rtcpFeedbackWildcards:[],payloads:g.audioCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*v)}}),this.currentMidIndex+=2}this.updateBundleMids()}toString(){return ir.print(this.sessionDesc)}send(a,o,c,f){let{ssrcs:g,ssrcGroups:v}=Uc(o,this.cname,ve("SYNC_GROUP")?c:void 0),w=this.findPreloadMediaDesc(g);if(w){if(Oi()&&this.firefoxSsrcMidMap.set(g[0].ssrcId,w.attributes.mid),f&&(f.twcc||f.remb)){let T=this.sessionDesc.mediaDescriptions.indexOf(w);return this.sessionDesc.mediaDescriptions[T]=this.mungSendMediaDesc(w,f),{mid:w.attributes.mid,needExchangeSDP:!0}}return{mid:w.attributes.mid,needExchangeSDP:!1}}{let T=this.findAvailableMediaIndex(a,g),R;return T===-1||ys()||ca()||die()||T===0&&ve("USE_SUB_RTX")?(R=this.createOrRecycleSendMedia(a,g,v,"sendonly",f),this.updateBundleMids()):(R=zi(this.sessionDesc.mediaDescriptions[T]),R.attributes.direction="sendonly",R.attributes.ssrcs=g,R.attributes.ssrcGroups=v,this.sessionDesc.mediaDescriptions[T]=this.mungSendMediaDesc(R,f)),Oi()&&this.firefoxSsrcMidMap.set(g[0].ssrcId,R.attributes.mid),{mid:R.attributes.mid,needExchangeSDP:!0}}}batchSend(a){let o=a.map(g=>{let{kind:v,ssrcMsg:w,mslabel:T}=g;return this.send(v,w,T)}),c=[],f=!1;return o.forEach(g=>{let{mid:v,needExchangeSDP:w}=g;w&&(f=!0),c.push(v)}),{mids:c,needExchangeSDP:f}}stopSending(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>c.attributes.mid&&a.indexOf(c.attributes.mid)!==-1);if(o.length!==a.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");o.forEach(c=>{c.attributes.mid==="0"||Oi()||ys()||ca()?c.attributes.ssrcs=[]:(c.attributes.ssrcs=[],c.attributes.direction="inactive",c.media.port="0")}),this.updateBundleMids()}mute(a){let o=this.sessionDesc.mediaDescriptions.find(c=>c.attributes.mid===a);if(!o)throw new Error("mediaDescription not found with ".concat(a," in remote SDP when calling RemoteSDP.mute."));o.attributes.direction="inactive"}unmute(a){let o=this.sessionDesc.mediaDescriptions.find(c=>c.attributes.mid===a);if(!o)throw new Error("mediaDescription not found with ".concat(a," in remote SDP when calling RemoteSDP.unmute."));o.attributes.direction="sendonly"}muteRemote(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>Tt(a).call(a,c.attributes.mid||""));if(o.length!==a.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");o.forEach(c=>{c.attributes.direction="inactive"})}unmuteRemote(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>Tt(a).call(a,c.attributes.mid||""));if(o.length!==a.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");o.forEach(c=>{c.attributes.direction="recvonly"})}receive(a,o,c,f){a.forEach((g,v)=>{this.createOrRecycleRecvMedia(g,[],"recvonly",o,c,f[v])}),this.updateBundleMids()}stopReceiving(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>a.indexOf(c.attributes.mid)!==-1);if(o.length!==a.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");o.forEach(c=>{c.media.port="0",c.attributes.direction="inactive"}),this.updateBundleMids()}updateCandidates(a){a===ja.TCP?this._candidates.forEach(o=>{this._candidates.findIndex(c=>c.transport==="tcp"&&c.connectionAddress===o.connectionAddress&&c.port===o.port)===-1&&this._candidates.push(ece(ece({},o),{},{foundation:"tcpcandidate",priority:Number(o.priority)-1+"",transport:"tcp",port:Number(o.port)+90+""}))}):this._candidates=this._candidates.filter(o=>o.transport!=="tcp");for(let o of this.sessionDesc.mediaDescriptions)o.attributes.candidates=this.candidates}restartICE(a){a=zi(a),this._iceParameters=a,this.sessionDesc.mediaDescriptions.forEach(o=>{o.attributes.iceUfrag=a.iceUfrag,o.attributes.icePwd=a.icePwd})}predictReceivingMids(a){let o=[];for(let c=0;c<a;c++)o.push((this.currentMidIndex+c+1).toString(10));return o}findAvailableMediaIndex(a,o){return this.sessionDesc.mediaDescriptions.findIndex(c=>{let f=c.media.mediaType===a&&c.media.port!=="0"&&(c.attributes.direction==="sendonly"||c.attributes.direction==="sendrecv")&&c.attributes.ssrcs.length===0;if(Oi()){if(f){let g=this.firefoxSsrcMidMap.get(o[0].ssrcId);return!(g||c.attributes.mid!=="0"&&c.attributes.mid!=="1")||!(!g||g!==c.attributes.mid)}return!1}return f})}createOrRecycleRecvMedia(a,o,c,f,g,v){let w=a._mediaStreamTrack.kind,T=this.rtpCapabilities.recv,R=R_(w,T,this.localCapabilities.send,w===Wt.VIDEO?f:g),A=w===Wt.VIDEO?T.videoExtensions:T.audioExtensions;this.currentMidIndex+=1;let L="".concat(this.currentMidIndex),U={media:{mediaType:w,port:p8,protos:["UDP","TLS","RTP","SAVPF"],fmts:R.map(Z=>Z.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:A,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:o,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:R,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:c,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(L)}};U=this.mungRecvMediaDsec(U,a,v);let F=this.findFirstClosedMedia(w);if(F){let Z=this.sessionDesc.mediaDescriptions.indexOf(F);this.sessionDesc.mediaDescriptions[Z]=U}else this.sessionDesc.mediaDescriptions.push(U);return U}updateRemoteCodec(a,o,c){let f=[...new Set(this._rtpCapabilities.recv.videoCodecs.map(U=>U.rtpMap&&U.rtpMap.encodingName.toLowerCase()||"").filter(U=>{var F;return Tt(F=Object.keys(ob)).call(F,U)}))],g=new Set(o);if(f.every(U=>g.has(U)))return z.debug("codecs has not changed, no need to updateRemoteCodec, codecs: ".concat(o)),!1;let v=this._rtpCapabilities.recv.videoCodecs.filter(U=>o.some(F=>{var Z;return Tt(Z=U.rtpMap&&U.rtpMap.encodingName.toLowerCase()||"").call(Z,F)}));if(v.length===0)return z.debug("updateRemoteCodec failed, because cannot find matched codec, remoteCapabilities codecs: ".concat(f," codecs: ").concat(o)),!1;let w=[...new Set(v.map(U=>U.rtpMap&&U.rtpMap.encodingName.toLowerCase()||""))],T;if(z.debug("updateRemoteCodec, from ".concat(f," to ").concat(w)),a.length===0)T=this.sessionDesc.mediaDescriptions.filter(U=>U.media.mediaType==="video"&&U.attributes.direction==="recvonly");else if(T=this.sessionDesc.mediaDescriptions.filter(U=>U.attributes.mid&&Tt(a).call(a,U.attributes.mid)&&U.attributes.direction==="recvonly"),T.length!==a.length)return z.debug("updateRemoteCodec failed, because cannot find mids, mids: ".concat(a,", codecs: ").concat(o)),!1;this._rtpCapabilities.recv.videoCodecs=v;let R=this.localCapabilities.send,A=this.rtpCapabilities.recv,L=R_(Wt.VIDEO,A,R,c);return T.forEach(U=>{let F=L.map(Z=>Z.payloadType.toString(10));z.debug("updateRemoteCodec mid: ".concat(U.attributes.mid,", from ").concat(U.attributes.payloads," to ").concat(L)),U.attributes.payloads=L,U.media.fmts=F}),!0}createOrRecycleSendMedia(a,o,c,f,g){let v=this.rtpCapabilities.send,w=a===Wt.VIDEO?v.videoCodecs:v.audioCodecs,T=a===Wt.VIDEO?v.videoExtensions:v.audioExtensions;this.currentMidIndex+=1;let R="".concat(this.currentMidIndex),A={media:{mediaType:a,port:p8,protos:["UDP","TLS","RTP","SAVPF"],fmts:w.map(U=>U.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:T,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:o,ssrcGroups:c,rtcpFeedbackWildcards:[],payloads:w,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:f,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(R)}};A=this.mungSendMediaDesc(A,g);let L=this.findFirstClosedMedia(a);if(L){let U=this.sessionDesc.mediaDescriptions.indexOf(L);this.sessionDesc.mediaDescriptions[U]=A}else this.sessionDesc.mediaDescriptions.push(A);return A}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter(a=>a.media.port!=="0").map(a=>a.attributes.mid)}mungRecvMediaDsec(a,o,c){let f=zi(a);return r8(f),e1(f,o),s8(f,o),r$(f),jb(f,c,this.localCapabilities.send),f}mungSendMediaDesc(a,o){let c=zi(a);return jb(c,o,this.localCapabilities.recv),Uh(c),c}updateRecvMedia(a,o){let c=this.sessionDesc.mediaDescriptions.findIndex(f=>f.attributes.mid===a);if(c!==-1){let f=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[c],o);this.sessionDesc.mediaDescriptions[c]=f}}bumpMid(a){this.currentMidIndex+=a}findFirstClosedMedia(a){return this.sessionDesc.mediaDescriptions.find(o=>Oi()?o.media.port==="0"&&o.media.mediaType===a:o.media.port==="0")}findPreloadMediaDesc(a){return this.sessionDesc.mediaDescriptions.find(o=>{var c;return((c=o.attributes)===null||c===void 0||(c=c.ssrcs[0])===null||c===void 0?void 0:c.ssrcId)===a[0].ssrcId})}getSSRC(a){var o;return(o=this.sessionDesc.mediaDescriptions.find(c=>c.attributes.mid===a))===null||o===void 0?void 0:o.attributes.ssrcs}}var si;function nce(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function m8(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?nce(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):nce(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let dNe=(si=class wM extends Ek{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get localCodecs(){let a;return this.localCapabilities&&(a=Ub(this.localCapabilities)),[...new Set(a&&a.send.videoCodecs.map(o=>o.rtpMap&&o.rtpMap.encodingName.toLowerCase()||"").filter(o=>{var c;return Tt(c=Object.keys(ob)).call(c,o)}))]}constructor(a,o,c){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"remoteSDP",void 0),X(this,"initialOffer",void 0),X(this,"transportEventReceiver",void 0),X(this,"statsFilter",void 0),X(this,"useXR",ve("USE_XR")),X(this,"localCapabilities",void 0),X(this,"localCandidateCount",0),X(this,"allCandidatesReceived",!1),X(this,"remoteCodecs",void 0),X(this,"dataStreamChannelMap",new Map),X(this,"establishPromise",void 0),X(this,"mutex",new As("NVExtentionsConnection-mutex")),X(this,"rtcMedia",void 0),this.store=o,this.peerConnection=c,this.statsFilter=i8(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Oi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1,this.establishPromise=this.establish()}async establish(a){try{let o=await this.peerConnection.createOffer();if(!o.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let c=jh(o.sdp),f=await a$({filterRTX:!ve("USE_PUB_RTX")&&!ve("USE_SUB_RTX"),filterVideoFec:ve("FILTER_VIDEO_FEC"),filterAudioFec:ve("FILTER_AUDIO_FEC"),filterVideoCodec:ve("FILTER_VIDEO_CODEC")},{useXR:this.useXR});return this.localCapabilities=f,this.initialOffer=o,m8(m8({},c),{},{rtpCapabilities:f,offerSDP:o.sdp})}catch(o){throw new De(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,o.toString())}}async connect(a,o,c,f,g,v){try{if(!this.initialOffer)throw new Error("Cannot establish NVConnection without initial offer.");this.remoteSDP=new cNe({remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f,remoteSetup:g,localCapabilities:Ub(this.localCapabilities),cname:v});let w=this.remoteSDP.toString(),T=ir.parse(this.initialOffer.sdp),R=T.mediaDescriptions.find(U=>U.media.mediaType==="audio");R&&Uh(R),this.useXR&&a8(T);let A=ir.print(T),L=this.logSDPExchange(A||"","offer","local","connect");await this.peerConnection.setLocalDescription({type:"offer",sdp:A}),L==null||L(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(w){throw new De(ce.EXCHANGE_SDP_FAILED,"NV.connect failed; ".concat(w.toString()))}}async updateRemoteRTPCapabilities(a,o){if(this.remoteCodecs=o,!this.remoteSDP)return void z.debug("[P2PConnection] cannot updateRemoteRTPCapabilities before remote SDP created, local codecs: ".concat(this.localCodecs,", codecs: ").concat(o));if(this.remoteSDP.updateRemoteCodec(a,o,this.store.codec)){let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c);let g=this.remoteSDP.toString();f==null||f(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}else z.debug("[P2PConnection] updateRemoteRTPCapabilities no need to exchange SDP.")}async updateRemoteConnect(a){var o,c,f,g;(o=this.remoteSDP)===null||o===void 0||o.updateRemoteRTPCapabilities(a),Array.isArray(this.remoteCodecs)&&this.remoteCodecs.length>0&&((g=this.remoteSDP)===null||g===void 0||g.updateRemoteCodec([],this.remoteCodecs,this.store.codec)),(c=this.remoteSDP)===null||c===void 0||c.preloadRemoteMedia(2);let v=(f=this.remoteSDP)===null||f===void 0?void 0:f.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:v});let w=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(w),z.debug("[NVExtentionsConnection] updateRemoteRTPCapabilities by exchanging SDP.")}send(a,o,c){var f=this;return zl(function*(){let g=yield Dn(f.mutex.lock("From NVExtentionsConnection.send"));try{if(!f.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.send before remote SDP created");let v=[];a.forEach(W=>{let K=f.peerConnection.addTransceiver(W._mediaStreamTrack,{direction:"sendonly"});v.push(K)}),Oi()&&ve("SIMULCAST")===!0&&(yield Dn(f.applySimulcastForFirefox(v,a)));let w=yield Dn(f.peerConnection.createOffer()),T=f.remoteSDP.predictReceivingMids(a.length),R=f.mungSendOfferSDP(w.sdp,a,T),A=ir.parse(R),L=T.map(W=>{let K=A.mediaDescriptions.find(oe=>oe.attributes.mid===W);if(!K)throw new Error("Cannot extract ssrc from mediaDescription.");return i$(K,ve("USE_PUB_RTX"))}),U;try{U=yield L}catch(W){U=[],f.remoteSDP.receive(a,o,c,U);let K=f.remoteSDP.toString();throw yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:K})),yield Dn(f.stopSending(T,!0)),W}f.remoteSDP.receive(a,o,c,U);let F=f.remoteSDP.toString(),Z=f.logSDPExchange(R,"offer","local","send");return yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.applySimulcastEncodings(v,a)),yield Dn(f.applySendEncodings(v,a)),Z==null||Z(F),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:F})),v.map((W,K)=>{let oe=T[K];return{localSSRC:L[K],id:oe,transceiver:W}})}catch(v){throw v instanceof De?v:new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.send failed; ".concat(v.toString()))}finally{g()}})()}async stopSending(a,o){let c=o?void 0:await this.mutex.lock("From NVExtentionsConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.stopSending before remote SDP created");let f=this.peerConnection.getTransceivers().filter(T=>a.indexOf(T.mid)!==-1);if(f.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call NVExtentionsConnection.stopSending.");f.map(T=>{var R;T.direction="inactive",(R=T.stop)===null||R===void 0||R.call(T)});let g=await this.peerConnection.createOffer(),v=this.logSDPExchange(g.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(g),this.remoteSDP.stopReceiving(a);let w=this.remoteSDP.toString();v==null||v(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(f){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.stopSending failed; ".concat(f.toString()))}finally{c&&c()}}async createDataChannels(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.createDataChannels before remote SDP created");let c=this.dataStreamChannelMap.get(a);return c&&c.readyState==="open"?z.debug("[P2PConnection] Channels are already available and can be reused directly."):(c=this.peerConnection.createDataChannel("datastream-channel",{ordered:!1,maxRetransmits:ve("DATASTREAM_MAX_RETRANSMITS")}),c.binaryType="arraybuffer",this.dataStreamChannelMap.set(a,c)),void o.forEach(f=>{f._updateOriginDataChannel(c)})}catch(c){throw c instanceof De?c:new De(ce.DATACHANNEL_FAILED,"NVExtentionsConnection.createDataChannels failed; ".concat(c.toString()))}}async stopDataChannels(a){try{let o=this.dataStreamChannelMap.get(a);return o==null||o.close(),void this.dataStreamChannelMap.delete(a)}catch(o){throw o instanceof De?o:new De(ce.DATACHANNEL_FAILED,"NVExtentionsConnection.stopDataChannels failed; ".concat(o.toString()))}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.receive ".concat(a," before remoteSDP created."));let{mid:g,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let T=this.remoteSDP.toString(),R=this.logSDPExchange(T,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:T});let A=await this.peerConnection.createAnswer(),L=this.mungReceiveAnswerSDP(A.sdp,g,a);R==null||R(L||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:L}),z.debug("[NVExtentionsConnection] receive ".concat(a," by exchanging SDP."))}else z.debug("[NVExtentionsConnection] receive ".concat(a," no need to exchange SDP."));let w=this.peerConnection.getTransceivers().find(T=>T.mid===g);if(!w)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:w.receiver.track,id:g}}catch(g){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.receive failed; ".concat(g.toString()))}}async batchReceive(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.batchReceive before remoteSDP created.");let{mids:o,needExchangeSDP:c}=this.remoteSDP.batchSend(a);if(c){let f=this.remoteSDP.toString(),g=this.logSDPExchange(f,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:f});let v=await this.peerConnection.createAnswer();g==null||g(v.sdp||""),await this.peerConnection.setLocalDescription(v),z.debug("[NVExtentionsConnection] batchReceive by exchanging SDP.")}else z.debug("[NVExtentionsConnection] batchReceive no need to exchange SDP.");return o.map(f=>{let g=this.peerConnection.getTransceivers().find(v=>v.mid===f);if(!g)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:g.receiver.track,id:f}})}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.receive failed; ".concat(o.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","stopReceiving");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection stopReceiving failed; ".concat(o.toString()))}}async muteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.muteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.mute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","muteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.muteRemote failed; ".concat(o.toString()))}}async unmuteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.unmuteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.unmute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","unmuteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.unmuteRemote failed; ".concat(o.toString()))}}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(v=>{v.direction="inactive"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.muteRemote(a);let g=this.remoteSDP.toString();f==null||f(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(async(v,w)=>{v.direction="sendonly"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.unmuteRemote(a);let g=this.remoteSDP.toString();f==null||f(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.unmuteLocal failed; ".concat(o.toString()))}}restartICE(a){var o=this;return zl(function*(){let c=yield Dn(o.mutex.lock("From NVExtentionsConnection.restartICE"));try{if(!o.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");if(Jn().supportPCSetConfiguration){let R=o.peerConnection.getConfiguration(),A=a===ja.RELAY?"relay":"all";R.iceTransportPolicy!==A&&(z.debug("restartICE change iceTransportPolicy from [".concat(R.iceTransportPolicy,"] to [").concat(A,"]")),R.iceTransportPolicy=A,o.peerConnection.setConfiguration(R))}else if(a===ja.RELAY)return;a!==ja.RELAY&&o.remoteSDP.updateCandidates(a);let f=yield Dn(o.peerConnection.createOffer({iceRestart:!0}));if(!f.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let g=jh(f.sdp),{remoteIceParameters:v}=yield g.iceParameters;o.remoteSDP.restartICE(v);let w=o.remoteSDP.toString(),T=o.logSDPExchange(f.sdp||"","offer","local","restartICE");yield Dn(o.peerConnection.setLocalDescription(f)),T==null||T(w),yield Dn(o.peerConnection.setRemoteDescription({type:"answer",sdp:w}))}catch(f){z.warning("restart ICE failed, abort operation",f)}finally{c()}})()}close(){var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.transportEventReceiver=void 0,this.statsFilter.destroy(),this.dataStreamChannelMap.clear()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o],[a]);this.remoteSDP.updateRecvMedia(a,o);let g=this.remoteSDP.toString(),v=this.logSDPExchange(f,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),v==null||v(g),await this.peerConnection.setRemoteDescription({type:"answer",sdp:g})}catch(c){throw new De(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getTransceivers().filter(f=>f.mid===a);c.length===1&&(this.isVP8Simulcast(o)?Oi()||await this.applySimulcastEncodings(c,[o]):await this.applySendEncodings(c,[o]))}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getTransceivers().find(f=>f.mid===o);c&&await c.sender.replaceTrack(a._mediaStreamTrack)}getP2PConnectionParams(){var a;if((a=this.peerConnection.currentLocalDescription)===null||a===void 0||!a.sdp||!this.localCapabilities)throw new Error;return m8(m8({},jh(this.peerConnection.currentLocalDescription.sdp)),{},{rtpCapabilities:this.localCapabilities})}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a;(a=this.onICEConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=a=>{a.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,z.debug("[pc-".concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout(()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,z.debug("[pc-".concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))},ve("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a){let o={iceServers:[]};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(rb(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...wM.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...wM.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),ve("FORCE_TURN_TCP")?o.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat($0(c.turnServerURL),":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&!ve("FORCE_TURN_TCP")&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let L=0;L<a.length;L++){let U=a[L],F=o[L];if(F&&F instanceof Di){var c,f,g;if(this.isVP8Simulcast(F))continue;let Z={},W={};switch(F._optimizationMode){case"motion":Z.degradationPreference="maintain-framerate";break;case"detail":Z.degradationPreference="maintain-resolution";break;default:Z.degradationPreference="balanced"}var v,w,T,R;if((c=F._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&(W.maxBitrate=1e3*((v=F._encoderConfig)===null||v===void 0?void 0:v.bitrateMax)),Tt(f=F._hints).call(f,Hi.LOW_STREAM)&&((w=F._encoderConfig)!==null&&w!==void 0&&w.frameRate&&(W.maxFramerate=cl(F._encoderConfig.frameRate)),(T=F._encoderConfig)!==null&&T!==void 0&&T.scaleResolutionDownBy&&((R=F._encoderConfig)===null||R===void 0?void 0:R.scaleResolutionDownBy)>1&&(W.scaleResolutionDownBy=F._encoderConfig.scaleResolutionDownBy)),ve("DSCP_TYPE")&&F0()){var A;let ue=ve("DSCP_TYPE");Tt(A=["very-low","low","medium","high"]).call(A,ue)&&(W.networkPriority=ue)}let K=U.sender.getParameters(),oe=(g=K.encodings)===null||g===void 0?void 0:g[0];Oi()&&!oe&&(Z.encodings=[W]),oe&&Object.assign(oe,W),Object.assign(K,Z),await U.sender.setParameters(K)}}}catch{z.debug("Apply RTPSendEncodings failed.")}}mungSendOfferSDP(a,o,c){let f=ir.parse(a);return o.forEach((g,v)=>{let w=c[v],T=f.mediaDescriptions.find(R=>R.attributes.mid===w);T&&(e1(T,g),s$(T,g,this.store.codec))}),ir.print(f)}mungReceiveAnswerSDP(a,o,c){let f=ir.parse(a),g=f.mediaDescriptions.find(v=>v.attributes.mid===o);return g&&c===Wt.AUDIO&&g.media.mediaType==="audio"&&Uh(g),this.useXR&&a8(f),ir.print(f)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onFirstVideoDecodedTimeout=a=>{var o;(o=this.onFirstVideoDecodedTimeout)===null||o===void 0||o.call(this,a)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0,this.statsFilter.onFirstVideoDecodedTimeout=void 0}async applySimulcastForFirefox(a,o){if(a.length===o.length)for(let T=0;T<a.length;T++){var c,f,g,v,w;let R=a[T],A=o[T];if(A instanceof Di&&!Tt(c=A._hints).call(c,Hi.LOW_STREAM)&&(f=A._encoderConfig)!==null&&f!==void 0&&f.bitrateMax&&((g=A._encoderConfig)===null||g===void 0?void 0:g.bitrateMax)>200&&(v=A._scalabilityMode)!==null&&v!==void 0&&v.numSpatialLayers&&((w=A._scalabilityMode)===null||w===void 0?void 0:w.numSpatialLayers)>1&&this.store.codec==="vp8"){let L={},U={high:1e3*(A._encoderConfig.bitrateMax-50),medium:5e4};L.encodings=[{rid:"m",active:!0,maxBitrate:U.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:U.high}];let F=R.sender.getParameters();await R.sender.setParameters(Object.assign(F,L))}}}async applySimulcastEncodings(a,o){if(!Oi()&&a.length===o.length)for(let c=0;c<a.length;c++){let f=o[c];if(f instanceof Di&&this.isVP8Simulcast(f)){let g=a[c],v={},w={high:1e3*(f._encoderConfig.bitrateMax-50),medium:5e4};v.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:w.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:w.medium,scaleResolutionDownBy:4}];let T=g.sender.getParameters();await g.sender.setParameters(Object.assign(T,v))}}}isVP8Simulcast(a){var o,c,f,g,v;return!!(a instanceof Di&&ve("SIMULCAST")&&this.store.codec==="vp8"&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&(c=a._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&((f=a._encoderConfig)===null||f===void 0?void 0:f.bitrateMax)>200&&(g=a._scalabilityMode)!==null&&g!==void 0&&g.numSpatialLayers&&((v=a._scalabilityMode)===null||v===void 0?void 0:v.numSpatialLayers)>1)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("exchanging ".concat(c," ").concat(o," SDP during NVExtentionsConnection.").concat(f,`
`),a),o==="offer"?g=>{this.logSDPExchange(g,"answer",c==="local"?"remote":"local",f)}:void 0}async getRemoteSSRC(a){if(!this.remoteSDP)return;let o=this.remoteSDP.getSSRC(a);return o==null?void 0:o[0].ssrcId}setConfiguration(a){if(Jn().supportPCSetConfiguration){let o=wM.resolvePCConfiguration(a);this.peerConnection.setConfiguration(o)}}},vt(si.prototype,"connect",[ul],Object.getOwnPropertyDescriptor(si.prototype,"connect"),si.prototype),vt(si.prototype,"updateRemoteRTPCapabilities",[ul],Object.getOwnPropertyDescriptor(si.prototype,"updateRemoteRTPCapabilities"),si.prototype),vt(si.prototype,"updateRemoteConnect",[ul],Object.getOwnPropertyDescriptor(si.prototype,"updateRemoteConnect"),si.prototype),vt(si.prototype,"createDataChannels",[ul],Object.getOwnPropertyDescriptor(si.prototype,"createDataChannels"),si.prototype),vt(si.prototype,"receive",[ul],Object.getOwnPropertyDescriptor(si.prototype,"receive"),si.prototype),vt(si.prototype,"batchReceive",[ul],Object.getOwnPropertyDescriptor(si.prototype,"batchReceive"),si.prototype),vt(si.prototype,"stopReceiving",[ul],Object.getOwnPropertyDescriptor(si.prototype,"stopReceiving"),si.prototype),vt(si.prototype,"muteRemote",[ul],Object.getOwnPropertyDescriptor(si.prototype,"muteRemote"),si.prototype),vt(si.prototype,"unmuteRemote",[ul],Object.getOwnPropertyDescriptor(si.prototype,"unmuteRemote"),si.prototype),vt(si.prototype,"muteLocal",[ul],Object.getOwnPropertyDescriptor(si.prototype,"muteLocal"),si.prototype),vt(si.prototype,"unmuteLocal",[ul],Object.getOwnPropertyDescriptor(si.prototype,"unmuteLocal"),si.prototype),vt(si.prototype,"close",[ul],Object.getOwnPropertyDescriptor(si.prototype,"close"),si.prototype),vt(si.prototype,"updateEncoderConfig",[ul],Object.getOwnPropertyDescriptor(si.prototype,"updateEncoderConfig"),si.prototype),vt(si.prototype,"updateSendParameters",[ul],Object.getOwnPropertyDescriptor(si.prototype,"updateSendParameters"),si.prototype),vt(si.prototype,"replaceTrack",[ul],Object.getOwnPropertyDescriptor(si.prototype,"replaceTrack"),si.prototype),vt(si.prototype,"getRemoteSSRC",[ul],Object.getOwnPropertyDescriptor(si.prototype,"getRemoteSSRC"),si.prototype),si);function ul(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,g=await f.lock("From NVExtentionsConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),T=0;T<v;T++)w[T]=arguments[T];return await c.apply(this,w)}finally{g()}},o}var yi;function ice(r){var a,o,c,f=2;for(typeof Symbol<"u"&&(o=Ble,c=Symbol.iterator);f--;){if(o&&(a=r[o])!=null)return a.call(r);if(c&&(a=r[c])!=null)return new g8(a.call(r));o="@@asyncIterator",c="@@iterator"}throw new TypeError("Object is not async iterable")}function g8(r){function a(o){if(Object(o)!==o)return Ct.reject(new TypeError(o+" is not an object."));var c=o.done;return Ct.resolve(o.value).then(function(f){return{value:f,done:c}})}return g8=function(o){this.s=o,this.n=o.next},g8.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(o){var c=this.s.return;return c===void 0?Ct.resolve({value:o,done:!0}):a(c.apply(this.s,arguments))},throw:function(o){var c=this.s.return;return c===void 0?Ct.reject(o):a(c.apply(this.s,arguments))}},new g8(r)}let a1=(yi=class SM extends Ek{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get localCodecs(){return this._p2pConnection.localCodecs}constructor(a,o){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"cname",void 0),X(this,"mutex",new As("DataChannelConnection-mutex")),X(this,"dataChannel",void 0),X(this,"_p2pConnection",void 0),X(this,"establishPromise",void 0),X(this,"_nvMedia",void 0),this.store=o,this.store.dcId=this.store.dcId+1,this.peerConnection=new RTCPeerConnection(SM.resolvePCConfiguration(a),{optional:[{googDscp:!0}]}),this.dataChannel=this.peerConnection.createDataChannel("agora-signal",{ordered:!1,maxPacketLifeTime:50}),this.dataChannel.binaryType="arraybuffer",this._p2pConnection=new dNe(a,o,this.peerConnection),this.bindPCEvents(),this.establishPromise=this._p2pConnection.establishPromise}async establish(){var a;let o=(a=this._nvMedia)===null||a===void 0?void 0:a.getLocalRtpCapabilities();return await this._p2pConnection.establish(o)}getP2PConnectionParams(){return this._p2pConnection.getP2PConnectionParams()}async connect(a,o,c,f,g,v){return this.cname=v,await this._p2pConnection.connect(a,o,c,f,g,v),await new Ct((w,T)=>{let R=setTimeout(()=>{this.closeSignal(),T(new De(ce.DATACHANNEL_CONNECTION_TIMEOUT,"Datachannel connection timed out, candidates: ".concat(JSON.stringify(c))))},2e3);this.dataChannel.onopen=()=>{if(this.dataChannel.readyState==="open")return clearTimeout(R),void w()},this.dataChannel.onerror=A=>{this.closeSignal(),T(A)}}),{transmitter:this.dataChannel,close:this.closeSignal.bind(this)}}async updateRemoteRTPCapabilities(a,o){return this._p2pConnection.updateRemoteRTPCapabilities(a,o)}send(a,o,c){var f=this;return zl(function*(){let g=yield Dn(f.mutex.lock("From DataChannelConnection.send"));try{return yield*c8(ice(f._p2pConnection.send(a,o,c)))}finally{g()}})()}async stopSending(a,o){return this._p2pConnection.stopSending(a,o)}async createDataChannels(a,o){return this._p2pConnection.createDataChannels(a,o)}async stopDataChannels(a){return this._p2pConnection.stopDataChannels(a)}async receive(a,o,c,f){return this._nvMedia?(z.debug("[DataChannelConnection] receive ".concat(a," by DataChannel.")),await this._nvMedia.reveiveByRTCMedia(a,o,this.cname)):(z.debug("[DataChannelConnection] receive ".concat(a," by WebRTC.")),await this._p2pConnection.receive(a,o,c,f))}async batchReceive(a){return[...await this._p2pConnection.batchReceive(a)]}async stopReceiving(a){return await this._p2pConnection.stopReceiving(a)}async muteRemote(a){return await this._p2pConnection.muteRemote(a)}async unmuteRemote(a){return await this._p2pConnection.unmuteRemote(a)}async muteLocal(a){return await this._p2pConnection.muteLocal(a)}async unmuteLocal(a){return await this._p2pConnection.unmuteLocal(a)}restartICE(a){var o=this;return zl(function*(){return yield*c8(ice(o._p2pConnection.restartICE(a)))})()}close(){var a;(a=this._nvMedia)===null||a===void 0||a.close(),this._p2pConnection.close(),this.unbindConnectionEvents(this._p2pConnection)}getStats(){return this._p2pConnection.getStats()}getRemoteVideoIsReady(a){return this._p2pConnection.getRemoteVideoIsReady(a)}updateRemoteConnect(a){var o;(o=this._nvMedia)===null||o===void 0||o.setRemoteRtpCapabilities(a),this._p2pConnection.updateRemoteConnect(a)}async updateEncoderConfig(a,o){return await this._p2pConnection.updateEncoderConfig(a,o)}async updateSendParameters(a,o){return await this._p2pConnection.updateSendParameters(a,o)}setStatsRemoteVideoIsReady(a,o){this._p2pConnection.setStatsRemoteVideoIsReady(a,o)}async replaceTrack(a,o){return await this._p2pConnection.replaceTrack(a,o)}async getRemoteSSRC(a){return this._p2pConnection.getRemoteSSRC(a)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("exchanging ".concat(c," ").concat(o," SDP during DataChannelConnection.").concat(f,`
`),a),o==="offer"?g=>{this.logSDPExchange(g,"answer",c==="local"?"remote":"local",f)}:void 0}static resolvePCConfiguration(a){let o={iceServers:[]};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(rb(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...SM.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...SM.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),ve("FORCE_TURN_TCP")?o.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat($0(c.turnServerURL),":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&!ve("FORCE_TURN_TCP")&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}bindPCEvents(){this._p2pConnection.onICEConnectionStateChange=a=>{var o;return(o=this.onICEConnectionStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onConnectionStateChange=a=>{var o;return(o=this.onConnectionStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onDTLSTransportStateChange=a=>{var o;return(o=this.onDTLSTransportStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onDTLSTransportError=a=>{var o;return(o=this.onDTLSTransportError)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onICETransportStateChange=a=>{var o;return(o=this.onICETransportStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstAudioReceived=a=>{var o;return(o=this.onFirstAudioReceived)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstVideoReceived=a=>{var o;return(o=this.onFirstVideoReceived)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstAudioDecoded=a=>{var o;return(o=this.onFirstAudioDecoded)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstVideoDecoded=(a,o,c)=>{var f;return(f=this.onFirstVideoDecoded)===null||f===void 0?void 0:f.call(this,a,o,c)},this._p2pConnection.onFirstVideoDecodedTimeout=a=>{var o;return(o=this.onFirstVideoDecodedTimeout)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onSelectedLocalCandidateChanged=(a,o)=>{var c;return(c=this.onSelectedLocalCandidateChanged)===null||c===void 0?void 0:c.call(this,a,o)},this._p2pConnection.onSelectedRemoteCandidateChanged=(a,o)=>{var c;return(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0?void 0:c.call(this,a,o)}}closeSignal(){this.dataChannel.close(),this.peerConnection.close()}unbindConnectionEvents(a){a.onConnectionStateChange=void 0,a.onICEConnectionStateChange=void 0,a.onICETransportStateChange=void 0,a.onDTLSTransportStateChange=void 0,a.onDTLSTransportError=void 0,a.onFirstAudioDecoded=void 0,a.onFirstAudioReceived=void 0,a.onFirstVideoDecoded=void 0,a.onFirstVideoReceived=void 0,a.onSelectedLocalCandidateChanged=void 0,a.onSelectedRemoteCandidateChanged=void 0,a.onFirstVideoDecodedTimeout=void 0}setConfiguration(a){this._p2pConnection.setConfiguration(a)}},vt(yi.prototype,"connect",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"connect"),yi.prototype),vt(yi.prototype,"updateRemoteRTPCapabilities",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"updateRemoteRTPCapabilities"),yi.prototype),vt(yi.prototype,"createDataChannels",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"createDataChannels"),yi.prototype),vt(yi.prototype,"receive",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"receive"),yi.prototype),vt(yi.prototype,"stopReceiving",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"stopReceiving"),yi.prototype),vt(yi.prototype,"muteRemote",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"muteRemote"),yi.prototype),vt(yi.prototype,"unmuteRemote",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"unmuteRemote"),yi.prototype),vt(yi.prototype,"muteLocal",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"muteLocal"),yi.prototype),vt(yi.prototype,"unmuteLocal",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"unmuteLocal"),yi.prototype),vt(yi.prototype,"close",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"close"),yi.prototype),vt(yi.prototype,"updateEncoderConfig",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"updateEncoderConfig"),yi.prototype),vt(yi.prototype,"updateSendParameters",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"updateSendParameters"),yi.prototype),vt(yi.prototype,"replaceTrack",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"replaceTrack"),yi.prototype),vt(yi.prototype,"getRemoteSSRC",[Fc],Object.getOwnPropertyDescriptor(yi.prototype,"getRemoteSSRC"),yi.prototype),yi);function Fc(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,g=await f.lock("From DataChannelConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),T=0;T<v;T++)w[T]=arguments[T];return await c.apply(this,w)}finally{g()}},o}var Mn;function rce(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function ep(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?rce(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):rce(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function sce(r){var a,o,c,f=2;for(typeof Symbol<"u"&&(o=Ble,c=Symbol.iterator);f--;){if(o&&(a=r[o])!=null)return a.call(r);if(c&&(a=r[c])!=null)return new v8(a.call(r));o="@@asyncIterator",c="@@iterator"}throw new TypeError("Object is not async iterable")}function v8(r){function a(o){if(Object(o)!==o)return Ct.reject(new TypeError(o+" is not an object."));var c=o.done;return Ct.resolve(o.value).then(function(f){return{value:f,done:c}})}return v8=function(o){this.s=o,this.n=o.next},v8.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(o){var c=this.s.return;return c===void 0?Ct.resolve({value:o,done:!0}):a(c.apply(this.s,arguments))},throw:function(o){var c=this.s.return;return c===void 0?Ct.reject(o):a(c.apply(this.s,arguments))}},new v8(r)}let y8=(Mn=class extends tr{get state(){return this._state}set state(r){let a=this._state;this._state=r,this.emit(pn.StateChange,a,this._state)}constructor(r,a){super(),X(this,"store",void 0),X(this,"statsUploader",void 0),X(this,"connection",void 0),X(this,"localTrackMap",new Map),X(this,"remoteUserMap",new Map),X(this,"localDataChannels",[]),X(this,"remoteDataChannelMap",new Map),X(this,"pendingLocalTracks",[]),X(this,"pendingRemoteTracks",[]),X(this,"pendingLocalDataChannels",[]),X(this,"pendingRemoteDataChannels",[]),X(this,"statsCollector",void 0),X(this,"isPlanB",!1),X(this,"shouldForwardP2PCreation",void 0),X(this,"iceFailedCount",0),X(this,"dtlsFailedCount",0),X(this,"mutex",new As("P2PChannel-mutex")),X(this,"_state",vi.Disconnected),X(this,"_pcStatsUploadType",ve("NEW_ICE_RESTART")?Tm.FIRST_CONNECTION:Tm.OLD_FIRST_CONNECTION),X(this,"_isInRestartIce",!1),X(this,"_isStartRestartIce",!1),X(this,"_restartStates",["disconnected","failed"]),X(this,"_restartTimer",void 0),X(this,"_isFirstConnected",!0),X(this,"handleMuteLocalTrack",async(o,c,f)=>{let g=await this.mutex.lock("Locking from P2PChannel.handleMuteLocalTrack");try{if(!this.connection||this.state!==vi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel.handleMuteLocalTrack before connection established."));let v=this.filterTobeMutedTracks(o);if(v.length===0)return void c();let w=v.find(R=>R[0]==="videoLowTrack");w&&w[1].track._originMediaStreamTrack.stop(),await this.connection.muteLocal(v.map(R=>{let[,{id:A}]=R;return A}));let T=this.createMuteMessage(v);await Pi(this,pn.RequestMuteLocal,T),c()}catch(v){f(v)}finally{g()}}),X(this,"handleUnmuteLocalTrack",async(o,c,f)=>{let g=await this.mutex.lock("Locking from P2PChannel.handleUnmuteLocalTrack");try{if(!this.connection||this.state!==vi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel.handleUnmuteLocalTrack before connection established."));let v=this.filterTobeUnmutedTracks(o);if(v.length===0)return void c();let w=v.find(R=>R[0]==="videoLowTrack");if(w){let R=w[1];if(R.track._originMediaStreamTrack.stop(),!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding){let A=o._mediaStreamTrack.clone();R.track._mediaStreamTrack=A,R.track._originMediaStreamTrack=A}else{let A=l$(o,a_(this,pn.RequestLowStreamParameter));R.track._mediaStreamTrack=A,R.track._originMediaStreamTrack=A}await new Ct((A,L)=>{this.handleReplaceTrack(R.track,A,L,!0)})}await this.connection.unmuteLocal(v.map(R=>{let[,{id:A}]=R;return A}));let T=this.createUnmuteMessage(v);await Pi(this,pn.RequestUnmuteLocal,T),c()}catch(v){f(v)}finally{g()}}),X(this,"handleUpdateVideoEncoder",async(o,c,f)=>{let g=await this.mutex.lock("Locking from P2PChannel.handleSetVideoEncoder");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.connection||!v||v.track!==o||this.state!==vi.Connected)return void c();let{id:w,track:T}=v;await this.connection.updateSendParameters(w,T),await this.connection.updateEncoderConfig(w,T),this.emit(pn.UpdateVideoEncoder,T),c()}catch(v){f(v)}finally{g()}}),X(this,"handleUpdateVideoSendParameters",async(o,c,f)=>{let g=await this.mutex.lock("Locking from P2PChannel.handleUpdateVideoSendParameters");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.connection||!v||v.track!==o||this.state!==vi.Connected)return void c();let{id:w,track:T}=v;await this.connection.updateSendParameters(w,T),c()}catch(v){f(v)}finally{g()}}),X(this,"handleReplaceMixingTrack",async(o,c,f,g)=>{if(!this.connection||this.state!==vi.Connected)return void c();let v=d$([o]),w;z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection will replace audioTrack [").concat(v.getTrackId(),"]")),typeof g=="boolean"&&g||(w=await this.mutex.lock("From P2PChannel.handleReplaceMixingTrack"));try{await this.replaceTrack(o,v),c()}catch(R){f(R)}finally{var T;(T=w)===null||T===void 0||T()}}),X(this,"handleReplaceTrack",async(o,c,f,g)=>{let v;z.debug("[".concat(this.store.clientId,"] P2PChannel handleReplaceTrack for [track-id-").concat(o.getTrackId(),"]")),typeof g=="boolean"&&g||(v=await this.mutex.lock("From P2PChannel.handleReplaceTrack"));try{var w;let R=Array.from(this.localTrackMap.entries()).find(A=>{let[,{track:L}]=A;return o===L});if(!this.connection||!R||this.state!==vi.Connected)return void c();if(await((w=this.connection)===null||w===void 0?void 0:w.replaceTrack(o,R[1].id)),this.isPlanB){let A=R[1];A.id=o._mediaStreamTrack.id,this.localTrackMap.set(R[0],A)}if(R[0]===ht.LocalVideoTrack&&!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding){let A=this.localTrackMap.get(ht.LocalVideoLowTrack);if(A){let L=o._mediaStreamTrack.clone();A.track._originMediaStreamTrack.stop(),A.track._mediaStreamTrack=L,A.track._originMediaStreamTrack=L,await new Ct((U,F)=>{this.handleReplaceTrack(A.track,U,F,!0)})}}c()}catch(R){f(R)}finally{var T;(T=v)===null||T===void 0||T()}}),X(this,"handleGetRTCStats",o=>{o(this.statsCollector.getRTCStats())}),X(this,"handleGetLocalVideoStats",o=>{o(this.statsCollector.getLocalVideoTrackStats())}),X(this,"handleGetLocalAudioStats",o=>{o(this.statsCollector.getLocalAudioTrackStats())}),X(this,"handleGetRemoteVideoStats",o=>this.statsCollector.getRemoteVideoTrackStats(o.uid)[o.uid]),X(this,"handleGetRemoteAudioStats",o=>this.statsCollector.getRemoteAudioTrackStats(o.uid)[o.uid]),this.store=r,this.statsCollector=a,this.statsCollector.addP2PChannel(this),this.statsUploader=new Sle(this.store),this.bindStatsUploaderEvents(),this.isPlanB=!Jn().supportUnifiedPlan||ve("CHROME_FORCE_PLAN_B")&&F0(),this.shouldForwardP2PCreation=ve("FORWARD_P2P_CREATION")&&Jn().supportPCSetConfiguration&&fG(),this.shouldForwardP2PCreation&&(this.connection=this.store.useDataChannel?new a1({},this.store):this.isPlanB?new Fb({},this.store):new Vh({},this.store),this.bindConnectionEvents(this.connection))}async startP2PConnection(r,a){var o;this.state=vi.New;let c=this.shouldForwardP2PCreation&&((o=this.connection)===null||o===void 0?void 0:o.peerConnectionState)==="closed";if(this.shouldForwardP2PCreation&&!c||(c&&this.connection&&(z.warning("[".concat(this.store.clientId,"] P2PChannel.startP2PConnection ForwardP2P closed.")),this.connection.close(),this.unbindConnectionEvents(this.connection)),this.connection=this.store.useDataChannel?new a1(r,this.store):this.isPlanB?new Fb(r,this.store):new Vh(r,this.store),this.bindConnectionEvents(this.connection)),!this.connection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel.startConnection before P2PConnection initialization .");return this._pcStatsUploadType=ve("NEW_ICE_RESTART")?Tm.FIRST_CONNECTION:Tm.OLD_FIRST_CONNECTION,this._isFirstConnected=!0,this._isInRestartIce=!1,this._isStartRestartIce=!1,this.connection.setConfiguration(r),this.connection.establishPromise}async connect(r,a,o,c,f,g){if(!this.connection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel.connect before P2PChannel.startP2PConnection .");this.connection instanceof a1?this.connection.updateRemoteConnect(c):(this.store.peerConnectionStart(),await this.connection.connect(r,a,o,c,f,g),this.statsUploader.startUploadTransportStats(),this.statsUploader.startUploadExtensionUsageStats(),this.state=vi.Connected)}updateRemoteRTPCapabilities(r){let a=Array.from(this.localTrackMap.entries()).filter(f=>{var g;let[v]=f;return Tt(g=[ht.LocalVideoLowTrack,ht.LocalVideoTrack]).call(g,v)}),o=a.map(f=>{let[,{id:g}]=f;return g}),c=a.map(f=>{let[g]=f;return g});if(this.connection instanceof Vh){if($t.updateRemoteRTPCapabilities(this.store.sessionId,{trackTypes:JSON.stringify(c),localCodecs:JSON.stringify(this.connection.localCodecs),remoteCodecs:JSON.stringify(r)}),!Tt(r).call(r,this.store.codec)){let f=["vp9","vp8","h264"].find(g=>Tt(r).call(r,g));f&&(this.store.codec=f,z.debug("[".concat(this.store.clientId,"] [").concat(this.store.p2pId," updateRemoteRTPCapabilities] default codec is not available, hence the fallback to ").concat(f,".")))}this.connection.updateRemoteRTPCapabilities(o,r)}}async preConnect(r,a,o,c,f,g){if(!this.connection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel.connect before P2PChannel.startP2PConnection .");this.store.peerConnectionStart();let v=await this.connection.connect(r,a,o,c,f,g);return this.statsUploader.startUploadTransportStats(),this.statsUploader.startUploadExtensionUsageStats(),this.state=vi.Connected,v}getEstablishParams(){if(this.connection instanceof a1)return this.connection.getP2PConnectionParams();throw new Error("Only DataChannelConnection needs to obtain establishParams")}async publishDataChannel(r){if(!this.connection||this.state!==vi.Connected){if(this.state===vi.Disconnected)throw new Ke(ce.UNEXPECTED_ERROR,"PeerConnection already disconnected.");return void r.forEach(o=>{var c;Tt(c=this.pendingLocalDataChannels).call(c,o)||this.pendingLocalDataChannels.push(o)})}let a=this.filterTobePublishedDataChannels(r);a.length!==0&&(a.forEach(o=>{let c=Date.now();this.store.publish(o.id.toString(),"datachannel",c)}),await this.connection.createDataChannels(this.store.uid,a),a.forEach(o=>{this.localDataChannels.push(o);let c=Date.now();this.store.publish(o.id+"","datachannel",void 0,c)}))}publish(r,a,o){var c=this;return zl(function*(){let f=yield Dn(c.mutex.lock("From P2PChannel.publish"));try{if(!c.connection||c.state!==vi.Connected){if(c.state===vi.Disconnected)throw new Ke(ce.UNEXPECTED_ERROR,"PeerConnection already disconnected.");c.throwIfTrackTypeNotMatch(r);let v=r.filter(w=>c.pendingLocalTracks.indexOf(w)===-1);return void(c.pendingLocalTracks=c.pendingLocalTracks.concat(v))}c.store.pubId=c.store.pubId+1,ua.markPublishStart(c.store.clientId,c.store.pubId);let g=c.filterTobePublishedTracks(r,a,o);if(g.length===0)return void(yield Dn(c.tryToUnmuteAudio(r)));yield*c8(sce(c.doPublish(c.connection,g)))}finally{f()}})()}doPublish(r,a){var o=this;return zl(function*(){a.forEach(L=>{let{track:U,type:F}=L,Z=Date.now();o.store.publish(U.getTrackId(),F===ht.LocalAudioTrack?"audio":"video",Z)}),o.bindLocalTrackEvents(a);let c=a.map(L=>{let{track:U}=L;return U}),f=yield Dn(r.send(a.map(L=>{let{track:U}=L;return U}),o.store.codec,o.store.audioCodec)),g=(yield Dn(f.next())).value,v=o.createGatewayPublishMessage(a,g),w;try{w=yield v}catch(L){throw f.throw(L),(L==null?void 0:L.code)===ce.WS_ABORT&&a.forEach(U=>{let{track:F}=U;o.pendingLocalTracks.indexOf(F)===-1&&o.pendingLocalTracks.push(F)}),o.unbindLocalTrackEvents(a),L}let T=o.mapPubResToRemoteConfig(v,w),R=(yield Dn(f.next(T))).value,A=ve("ENABLE_VIDEO_SEI");c.forEach(async L=>{let U=L.getRTCRtpTransceiver();U&&A&&(L.trackMediaType===Wt.VIDEO?await M4e(U.sender,L):L.trackMediaType===Wt.AUDIO&&await async function(F){if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support audio encoded transform");if(e8.has(F)||!F.track)return;let Z={track:F.track};if(U0()){if(!F.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let K=null;try{K=F.createEncodedStreams()}catch(ue){return void z.error("create audio-encoded-streams error",ue&&ue.message)}let oe=new TransformStream({transform(ue,xe){Z.controller||(Z.controller=xe),F.track&&F.track.id!==Z.track.id&&(z.debug("audio track changed: ".concat(Z.track.id," => ").concat(F.track.id)),Z.track.removeEventListener("ended",W),Z.track=F.track,Z.track.addEventListener("ended",W)),xe.enqueue(ue)}});K.readable.pipeThrough(oe).pipeTo(K.writable)}else if(ys()){if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let K=Zk(),oe=new MessageChannel;await new Ct(xe=>K.onmessage=Ne=>{Ne.data==="registered"&&xe(void 0)});let ue=new RTCRtpScriptTransform(K,{name:"tx",port:oe.port2},[oe.port2]);F.transform=ue,await new Ct(xe=>K.onmessage=Ne=>{Ne.data==="started"&&xe(void 0)}),oe.port1.onmessage=xe=>{var Ne;xe.data.transformed&&F.track&&((Ne=F.track)===null||Ne===void 0?void 0:Ne.id)!==Z.track.id&&(z.debug("audio track changed: ".concat(Z.track.id," => ").concat(F.track.id)),Z.track.removeEventListener("ended",W),Z.track=F.track,Z.track.addEventListener("ended",W))},Z.worker=K}function W(){if(F.track){if(this.id!==F.track.id)return;F.track.removeEventListener("ended",W)}let K=e8.get(F);if(K){e8.delete(F);try{var oe,ue;(oe=K.controller)===null||oe===void 0||oe.terminate(),(ue=K.worker)===null||ue===void 0||ue.terminate()}catch(xe){z.warning(xe&&xe.message)}}}e8.set(F,Z),F.track.addEventListener("ended",W)}(U.sender))}),a.forEach(L=>{let{type:U}=L;o.statsCollector.addLocalStats(U)}),o.assignLocalTracks(a,R),o.statsUploader.startUploadOutboundStats(),a.forEach(L=>{let{track:U,type:F}=L,Z=Date.now();o.store.publish(U.getTrackId(),F===ht.LocalAudioTrack?"audio":"video",void 0,Z)})})()}async updateVideoStreamParameter(r,a){let o=this.localTrackMap.get(a);if(!o)return;if(!(o.track instanceof Di))return z.warn("[updateVideoStreamParameter]: track is not an instance of LocalVideoTrack");if(!(this.connection instanceof Vh||this.connection instanceof Fb))return z.warn("[updateVideoStreamParameter]: connection is not P2PConnection or P2PConnectionPlanB");let{track:c}=o,f=function(g,v){let w={};return g.height&&g.width&&(w.scaleResolutionDownBy=UG(g,v)),w.maxFramerate=g.framerate?cl(g.framerate):void 0,w.maxBitrate=g.bitrate?1e3*g.bitrate:void 0,w}(r,c);if(c._encoderConfig||(c._encoderConfig={}),a!==ht.LocalVideoLowTrack||!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding)f.scaleResolutionDownBy!=null&&(c._encoderConfig.scaleResolutionDownBy=f.scaleResolutionDownBy);else{let g=c._originMediaStreamTrack;if(!g.canvas)return z.warn("[".concat(c.getTrackId(),"] no canvas on track"));(function(v,w){let T=v.canvas;w.width&&(T.width=cl(w.width)),w.height&&(T.height=cl(w.height)),w.framerate&&(T.stopCapture&&T.stopCapture(),T.stopCapture=HW(()=>{!T.startCapture&&T.stopCapture&&T.stopCapture(),T.startCapture&&T.startCapture()},cl(w.framerate)))})(g,r)}f.maxBitrate!=null&&(c._encoderConfig.bitrateMax=f.maxBitrate/1e3),f.maxFramerate!=null&&(c._encoderConfig.frameRate&&typeof c._encoderConfig.frameRate=="object"?c._encoderConfig.frameRate.max=f.maxFramerate:c._encoderConfig.frameRate={max:f.maxFramerate}),z.debug("[".concat(c.getTrackId(),"] LowStreamEncoderConfig: , ").concat(JSON.stringify(c._encoderConfig))),await this.connection.updateRtpSenderEncodings(c)}publishLowStream(r){var a=this;return zl(function*(){if(!a.connection||a.state!==vi.Connected)return;let o=yield Dn(a.mutex.lock("Locking from P2PChannel.publishLowStream"));try{let f=a.localTrackMap.get(ht.LocalVideoTrack);if(!f)throw new Ke(ce.UNEXPECTED_ERROR,"Could not find high stream");if(a.localTrackMap.has(ht.LocalVideoLowTrack))throw new Ke(ce.UNEXPECTED_ERROR,"[".concat(a.store.clientId,"] Can't publish low stream when stream already publish"));let g=[{track:a.getLowVideoTrack(f.track,r),type:ht.LocalVideoLowTrack}];if(yield*c8(sce(a.doPublish(a.connection,g))),f.track.muted||!f.track.enabled){var c;let v=(c=a.localTrackMap.get(ht.LocalVideoLowTrack))===null||c===void 0?void 0:c.id;v!==void 0&&(yield Dn(a.connection.muteLocal([v])))}}finally{o()}})()}async republish(){this.pendingLocalTracks.length>0&&(z.debug("[".concat(this.store.clientId,"] Emit P2PChannelEvents.RequestRePublish to republish tracks.")),await Yr(this,pn.RequestRePublish,this.pendingLocalTracks),this.emit(pn.MediaReconnectEnd,this.store.uid),this.pendingLocalTracks=[]),this.pendingLocalDataChannels.length>0&&(z.debug("Emit P2PChannelEvents.RequestRePublishDataChannel to republish datachannels."),await Yr(this,pn.RequestRePublishDataChannel,this.pendingLocalDataChannels),this.pendingLocalDataChannels=[])}async reSubscribe(r){for(let a=this.pendingRemoteTracks.length-1;a>=0;a--){let{user:o,kind:c}=this.pendingRemoteTracks[a];(c!==Wt.AUDIO||o._audio_added_&&o._audioSSRC)&&(c!==Wt.VIDEO||o._video_added_&&o._videoSSRC)||this.pendingRemoteTracks.splice(a,1)}if(r)await Yr(this,pn.RequestReSubscribe,this.pendingRemoteTracks);else for(let{user:a,kind:o}of this.pendingRemoteTracks)await this.subscribe(a,o,o===Wt.VIDEO?a._videoSSRC:a._audioSSRC);this.pendingRemoteTracks.forEach(a=>{let{user:o}=a;this.emit(pn.MediaReconnectEnd,o.uid)}),this.pendingRemoteTracks=[]}async unpublish(r){if(!this.connection||this.state!==vi.Connected)return void r.forEach(c=>{let f=this.pendingLocalTracks.indexOf(c);f!==-1&&this.pendingLocalTracks.splice(f,1)});let a=this.filterTobeUnpublishedTracks(r);if(a.length===0)return;let o=a.find(c=>c[0]==="videoLowTrack");return o&&o[1].track.close(),this.doUnpublish(this.connection,a)}async unpublishDataChannel(r){if(!this.connection||this.state!==vi.Connected)return void r.forEach(o=>{let c=this.pendingLocalDataChannels.indexOf(o);c!==-1&&this.pendingLocalDataChannels.splice(c,1)});let a=this.filterTobeUnpublishedDataChannels(r);return a.length!==0?(a.forEach(o=>{let c=this.localDataChannels.indexOf(o);c!==-1&&this.localDataChannels.splice(c,1)}),this.localDataChannels.length===0&&await this.connection.stopDataChannels(this.store.uid),a.map(o=>o.id)):void 0}async unpublishLowStream(){if(!this.connection||this.state!==vi.Connected)return;let r=this.localTrackMap.get(ht.LocalVideoLowTrack);if(!r)return;r.track.close();let a=[[ht.LocalVideoLowTrack,r]];return this.doUnpublish(this.connection,a)}async doUnpublish(r,a){let o=this.createGatewayUnpublishMessage(a);return await r.stopSending(a.map(c=>{let[,{id:f}]=c;return f})),this.withdrawLocalTracks(a),this.unbindLocalTrackEvents(a.map(c=>{let[f,{track:g}]=c;return{type:f,track:g}})),a.forEach(c=>{let[f]=c;this.statsCollector.removeLocalStats(f)}),this.localTrackMap.size===0&&this.statsUploader.stopUploadOutboundStats(),o}async subscribeDataChannel(r,a){if(!this.connection||this.state!==vi.Connected)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when peerConnection disconnected.");let o=a.filter(c=>{var f;return!((f=this.remoteDataChannelMap.get(r))!==null&&f!==void 0&&f.get(c.id))});if(o.length!==0)return await this.connection.createDataChannels(r.uid,o),o.forEach(c=>{var f;this.remoteDataChannelMap.has(r)?(f=this.remoteDataChannelMap.get(r))===null||f===void 0||f.set(c.id,c):this.remoteDataChannelMap.set(r,new Map([[c.id,c]]));let g=this.pendingRemoteDataChannels.findIndex(v=>{let{user:w,id:T}=v;return w.uid===r.uid&&T===c.id});g!==-1&&this.pendingRemoteDataChannels.splice(g,1)}),o.map(c=>c.id)}async subscribe(r,a,o,c,f){var g;if(!this.connection||this.state!==vi.Connected)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when peerConnection disconnected.");if((g=this.remoteUserMap.get(r))!==null&&g!==void 0&&g.has(a))return;let v,w,T;if(f){let L=f.find(F=>{let{stream_type:Z}=F;return Z===a});if(!L)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot subscribe to remote ".concat(a," for user: ").concat(r.uid," because subscribe answer from gateway does not contain stream_type: ").concat(a,"."));let U=await this.connection.receive(a,L.ssrcs,String(r._uintid),L.attributes);this.connection instanceof Vh&&(T=U.transceiver),v=U.track,w=U.id}else{let L=await this.connection.receive(a,[{ssrcId:o,rtx:c}],String(r._uintid),void 0);this.connection instanceof Vh&&(T=L.transceiver),v=L.track,w=L.id}a===Wt.AUDIO?(r._audioTrack?r._audioTrack._updateOriginMediaStreamTrack(v):(r._audioTrack=new Mb(v,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote audio track: ").concat(r._audioTrack.getTrackId()))),T&&r._audioTrack._updateRtpTransceiver(T),this.bindRemoteTrackEvents(r,r._audioTrack)):(r._videoTrack?r._videoTrack._updateOriginMediaStreamTrack(v):(r._videoTrack=new kb(v,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote video track: ").concat(r._videoTrack.getTrackId()))),T&&r._videoTrack._updateRtpTransceiver(T),this.bindRemoteTrackEvents(r,r._videoTrack)),ve("ENABLE_VIDEO_SEI")&&T&&(a==Wt.VIDEO?await j4e(T.receiver,{onSei:L=>{var U;(U=r._videoTrack)===null||U===void 0||U._onSei(L)}}):a==Wt.AUDIO&&await async function(L){if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support audio encoded transform");if(t8.has(L))return;let U={track:L.track};if(U0()){if(!L.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let Z=null;try{Z=L.createEncodedStreams()}catch(K){return void z.error("create audio-encoded-streams error",K&&K.message)}let W=new TransformStream({transform(K,oe){U.controller||(U.controller=oe),L.track&&L.track.id!==U.track.id&&(z.debug("audio track changed: ".concat(U.track.id," => ").concat(L.track.id)),U.track.removeEventListener("ended",F),U.track=L.track,U.track.addEventListener("ended",F)),oe.enqueue(K)}});Z.readable.pipeThrough(W).pipeTo(Z.writable)}else if(ys()){if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let Z=Zk(),W=new MessageChannel;await new Ct(oe=>Z.onmessage=ue=>{ue.data==="registered"&&oe(void 0)});let K=new RTCRtpScriptTransform(Z,{name:"rx",port:W.port2},[W.port2]);L.transform=K,await new Ct(oe=>Z.onmessage=ue=>{ue.data==="started"&&oe(void 0)}),W.port1.onmessage=oe=>{var ue;oe.data.transformed&&L.track&&((ue=L.track)===null||ue===void 0?void 0:ue.id)!==U.track.id&&(z.debug("audio track changed: ".concat(U.track.id," => ").concat(L.track.id)),U.track.removeEventListener("ended",F),U.track=L.track,U.track.addEventListener("ended",F))},U.worker=Z}function F(){L.track.removeEventListener("ended",F),function(Z){let W=t8.get(Z);if(W){t8.delete(Z);try{var K,oe;(K=W.controller)===null||K===void 0||K.terminate(),(oe=W.worker)===null||oe===void 0||oe.terminate()}catch(ue){z.warning(ue&&ue.message)}}}(L)}t8.set(L,U),L.track.addEventListener("ended",F)}(T.receiver));let R=this.remoteUserMap.get(r);R?R.set(a,w):this.remoteUserMap.set(r,new Map([[a,w]])),this.statsCollector.addRemoteStats(r.uid),this.statsUploader.startUploadInboundStats();let A=this.pendingRemoteTracks.findIndex(L=>{let{user:U,kind:F}=L;return U.uid===r.uid&&a===F});A!==-1&&(this.pendingRemoteTracks.splice(A,1),this.emit(pn.MediaReconnectEnd,r.uid))}async massSubscribe(r){return this.massSubscribeNoLock(r)}async massSubscribeNoLock(r){if(!this.connection||this.state!==vi.Connected)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribeAll remote users when peerConnection disconnected.");r=r.filter(o=>{var c;let{user:f,mediaType:g}=o;return!((c=this.remoteUserMap.get(f))!==null&&c!==void 0&&c.has(g))});let a=await this.connection.batchReceive(r.map(o=>{let{user:c,mediaType:f,ssrcId:g,rtxSsrcId:v}=o;return{kind:f,ssrcMsg:[{ssrcId:g,rtx:v}],mslabel:String(c._uintid)}}));r.forEach((o,c)=>{let{user:f,mediaType:g}=o,{track:v,id:w,transceiver:T}=a[c];g===Wt.AUDIO?(f._audioTrack?f._audioTrack._updateOriginMediaStreamTrack(v):(f._audioTrack=new Mb(v,f.uid,f._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote audio track: ").concat(f._audioTrack.getTrackId()))),T&&f._audioTrack._updateRtpTransceiver(T),this.bindRemoteTrackEvents(f,f._audioTrack)):(f._videoTrack?f._videoTrack._updateOriginMediaStreamTrack(v):(f._videoTrack=new kb(v,f.uid,f._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote video track: ").concat(f._videoTrack.getTrackId()))),T&&f._videoTrack._updateRtpTransceiver(T),this.bindRemoteTrackEvents(f,f._videoTrack));let R=this.remoteUserMap.get(f);R?R.set(g,w):this.remoteUserMap.set(f,new Map([[g,w]])),this.statsCollector.addRemoteStats(f.uid),this.statsUploader.startUploadInboundStats();let A=this.pendingRemoteTracks.findIndex(L=>{let{user:U,kind:F}=L;return U.uid===f.uid&&g===F});A!==-1&&(this.pendingRemoteTracks.splice(A,1),this.emit(pn.MediaReconnectEnd,f.uid))})}async unsubscribe(r,a,o){let c=this.pendingRemoteTracks.filter(v=>{let{user:w,kind:T}=v;return a!==void 0?w.uid===r.uid&&a===T:w.uid===r.uid});if(c.forEach(v=>{let w=this.pendingRemoteTracks.indexOf(v);this.pendingRemoteTracks.splice(w,1)}),this.connection&&this.state===vi.Connected||o||c.forEach(v=>{let{kind:w}=v;var T;if(w===Wt.AUDIO)(T=r._audioTrack)===null||T===void 0||T._destroy(),r._audioTrack=void 0;else if(w===Wt.VIDEO){var R;(R=r._videoTrack)===null||R===void 0||R._destroy(),r._videoTrack=void 0}}),!this.connection||this.state!==vi.Connected)return;let f=this.filterTobeUnSubscribedTracks(r,a);if(f.length===0)return;await this.connection.stopReceiving(f.map(v=>{let[,{id:w}]=v;return w}));let g=this.createUnsubscribeMessage(f);return this.withdrawRemoteTracks(f),this.remoteUserMap.size===0&&this.statsUploader.stopUploadInboundStats(),f.forEach(v=>{let[w,{kind:T}]=v;var R,A;if(T===Wt.VIDEO&&w._videoSSRC&&((R=this.connection)===null||R===void 0||R.setStatsRemoteVideoIsReady(w._videoSSRC,!1)),T===Wt.VIDEO)this.unbindRemoteTrackEvents(w._videoTrack),o||((A=w._videoTrack)===null||A===void 0||A._destroy(),w._videoTrack=void 0);else if(T===Wt.AUDIO){var L;this.unbindRemoteTrackEvents(w._audioTrack),!o&&((L=w._audioTrack)===null||L===void 0||L._destroy(),w._audioTrack=void 0)}}),g}async unsubscribeDataChannel(r,a){if(a.forEach(f=>{let g=this.pendingRemoteDataChannels.findIndex(v=>v.id===f.id);g!==-1&&this.pendingRemoteDataChannels.splice(g,1)}),!this.connection)return;let o=this.filterTobeUnSubscribedDataChannels(r,a);if(o.length===0)return;a.forEach(f=>{f._close()});let c=this.remoteDataChannelMap.get(r);return o.forEach(f=>{c&&c.delete(f.id)}),c&&c.size===0&&(this.remoteDataChannelMap.delete(r),await this.connection.stopDataChannels(r.uid)),o.map(f=>f.id)}async massUnsubscribe(r){return this.massUnsubscribeNoLock(r)}async massUnsubscribeNoLock(r){let a=[];for(let{user:f,mediaType:g}of r){let v=this.pendingRemoteTracks.filter(w=>{let{user:T,kind:R}=w;return g!==void 0?T.uid===f.uid&&g===R:T.uid===f.uid});v.forEach(w=>{let T=this.pendingRemoteTracks.indexOf(w);this.pendingRemoteTracks.splice(T,1)}),a=a.concat(v)}if(!this.connection||this.state!==vi.Connected)return void a.forEach(f=>{let{user:g,kind:v}=f;var w;if(v===Wt.AUDIO)(w=g._audioTrack)===null||w===void 0||w._destroy(),g._audioTrack=void 0;else if(v===Wt.VIDEO){var T;(T=g._videoTrack)===null||T===void 0||T._destroy(),g._videoTrack=void 0}});let o=bc(r).call(r,(f,g)=>{let{user:v,mediaType:w}=g,T=this.filterTobeUnSubscribedTracks(v,w);return f.concat(T)},[]);if(o.length===0)return;await this.connection.stopReceiving(o.map(f=>{let[,{id:g}]=f;return g}));let c=this.createUnsubscribeAllMessage(o);return this.withdrawRemoteTracks(o),this.remoteUserMap.size===0&&this.statsUploader.stopUploadInboundStats(),o.forEach(f=>{let[g,{kind:v}]=f;var w,T;if(v===Wt.VIDEO&&g._videoSSRC&&((w=this.connection)===null||w===void 0||w.setStatsRemoteVideoIsReady(g._videoSSRC,!1)),v===Wt.VIDEO)this.unbindRemoteTrackEvents(g._videoTrack),(T=g._videoTrack)===null||T===void 0||T._destroy(),g._videoTrack=void 0;else if(v===Wt.AUDIO){var R;this.unbindRemoteTrackEvents(g._audioTrack),(R=g._audioTrack)===null||R===void 0||R._destroy(),g._audioTrack=void 0}}),c}async muteRemote(r,a){if(!this.connection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel.muteRemote has no remote user ").concat(r.uid,"."));if(!o.get(a))return void z.warning("[".concat(this.store.clientId,"] P2PChannel.muteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."));let c=a===Wt.VIDEO?r._videoSSRC:r._audioSSRC;c!==void 0&&this.connection.setStatsRemoteVideoIsReady(c,!1)}async unmuteRemote(r,a){return this.unmuteRemoteNoLock(r,a)}async unmuteRemoteNoLock(r,a){if(!this.connection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel.unmuteRemote has no remote user ").concat(r.uid,"."));o.get(a)||z.warning("[".concat(this.store.clientId,"] P2PChannel.unmuteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."))}getAllTracks(r){let a=this.localTrackMap.get(ht.LocalAudioTrack);if((a==null?void 0:a.track)instanceof ss){let o=a.track;return Array.from(this.localTrackMap.entries()).filter(c=>{let[f]=c;return f!==ht.LocalAudioTrack}).filter(c=>{let[f]=c;return!(r&&f===ht.LocalVideoLowTrack)}).map(c=>{let[,{track:f}]=c;return f}).concat(o.trackList)}return Array.from(this.localTrackMap.entries()).filter(o=>{let[c]=o;return!(r&&c===ht.LocalVideoLowTrack)}).map(o=>{let[,{track:c}]=o;return c})}getAllDataChannels(){return this.localDataChannels}reportPublishEvent(r,a,o,c,f){if(r){let v=this.localTrackMap.get(ht.LocalAudioTrack),w=c?this.localTrackMap.get(ht.LocalVideoLowTrack):this.localTrackMap.get(ht.LocalVideoTrack);$t.publish(this.store.sessionId,{eventElapse:ua.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.track.getTrackLabel(),videoName:w==null?void 0:w.track.getTrackLabel(),screenshare:(w==null?void 0:w.track._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}else{var g;o||(o=[]);let v=o.find(T=>T instanceof br),w=c?(g=this.localTrackMap.get(ht.LocalVideoTrack))===null||g===void 0?void 0:g.track:o.find(T=>T instanceof Di);$t.publish(this.store.sessionId,{eventElapse:ua.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.getTrackLabel(),videoName:w==null?void 0:w.getTrackLabel(),screenshare:(w==null?void 0:w._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}}reportSubscribeEvent(r,a,o,c){let f=c===Wt.VIDEO?o._videoSSRC:o._audioSSRC;f&&$t.subscribe(this.store.sessionId,{succ:r,ec:a,video:c===Wt.VIDEO,audio:c===Wt.AUDIO,peerid:o.uid,subscribeRequestid:c===Wt.VIDEO?o._videoSSRC:o._audioSSRC,p2pid:this.store.p2pId,eventElapse:ua.measureFromSubscribeStart(this.store.clientId,f)})}reset(){z.debug("[".concat(this.store.clientId,"] P2PChannel.reset")),this.mutex=new As("P2PChannel-mutex"),this.connection&&(this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0),this.shouldForwardP2PCreation&&(this.connection=this.store.useDataChannel?new a1({},this.store):this.isPlanB?new Fb({},this.store):new Vh({},this.store),this.bindConnectionEvents(this.connection)),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),this.statsUploader.stopUploadExtensionUsageStats(),this.unbindLocalTrackEvents(),this.unbindAllRemoteTrackEvents(),this.unbindRtpTransceiver();let r=this.localTrackMap.get(ht.LocalAudioTrack);if((r==null?void 0:r.track)instanceof ss){if(r.track.trackList.length>0){let a=r.track;r.track.trackList.forEach(o=>{a.removeAudioTrack(o)})}r.track.close()}this.localTrackMap.clear(),this.remoteUserMap.clear(),this.statsCollector.removeRemoteStats(),this.statsCollector.removeLocalStats(),this.iceFailedCount=0,this.dtlsFailedCount=0,this.pendingLocalTracks=[],this.pendingRemoteTracks=[],this.localDataChannels=[],this.remoteDataChannelMap.clear(),this.pendingLocalDataChannels=[],this.pendingRemoteDataChannels=[],this.state=vi.Disconnected}getStats(){var r;return(r=this.connection)===null||r===void 0?void 0:r.getStats()}getRemoteVideoIsReady(r){var a;return((a=this.connection)===null||a===void 0?void 0:a.getRemoteVideoIsReady(r))||!1}getLocalAudioVolume(){let r=this.localTrackMap.get(ht.LocalAudioTrack);if(r)return r.track.getVolumeLevel()}getLocalVideoSize(){let r=this.localTrackMap.get(ht.LocalVideoTrack);if(r)return{width:r.track.videoWidth||0,height:r.track.videoHeight||0}}getEncoderConfig(r){let a=this.localTrackMap.get(r);return a&&a.track instanceof Di||a&&a.track instanceof br?a.track._encoderConfig:void 0}getLocalMedia(r){return this.localTrackMap.get(r)}hasLocalMedia(){return this.localTrackMap.size>0}hasRemoteMedia(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}async hasRemoteMediaWithLock(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}getRemoteMedia(r){var a;let o=Array.from(al(a=this.remoteUserMap).call(a)).find(c=>c.uid===r);return o?{audioTrack:o.audioTrack,audioSSRC:o._audioSSRC,videoTrack:o.videoTrack,videoSSRC:o._videoSSRC}:{}}getAudioLevels(){let r=Array.from(this.remoteUserMap.entries()).map(o=>{let[c]=o;return{uid:c.uid,level:c.audioTrack?100*c.audioTrack._source.getAccurateVolumeLevel():0}}),a=this.localTrackMap.get(ht.LocalAudioTrack);return a&&r.push({level:100*a.track._source.getAccurateVolumeLevel(),uid:this.store.uid}),r=wI(r).call(r,(o,c)=>o.level-c.level),r}async disconnectForReconnect(){this.connection&&(z.debug("[".concat(this.store.clientId,"] P2PChannel.disconnectForReconnect closing P2PConnection")),this.state=vi.Reconnecting,ve("KEEP_LAST_FRAME")&&this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a]=r;var o;a._videoTrack&&a._videoTrack._player&&((o=a._videoTrack._player.getVideoElement())===null||o===void 0||o.pause(),a._videoTrack._player.isKeepLastFrame=!0,a._videoTrack._originMediaStreamTrack.stop())}),this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0,this.shouldForwardP2PCreation&&(this.connection=this.store.useDataChannel?new a1({},this.store):this.isPlanB?new Fb({},this.store):new Vh({},this.store),this.bindConnectionEvents(this.connection)),this.localTrackMap.size!==0&&(Array.from(this.localTrackMap.entries()).forEach(r=>{var a;let[o,{track:c}]=r;switch(o){case ht.LocalVideoTrack:Tt(a=c._hints).call(a,Hi.LOW_STREAM)?c.close():this.pendingLocalTracks.push(c);break;case ht.LocalAudioTrack:c instanceof ss?this.pendingLocalTracks=this.pendingLocalTracks.concat(c.trackList):this.pendingLocalTracks.push(c);case ht.LocalVideoLowTrack:}}),this.emit(pn.MediaReconnectStart,this.store.uid)),this.unbindLocalTrackEvents(),this.localTrackMap.clear(),this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;Array.from(al(o).call(o)).forEach(c=>{this.setPendingRemoteMedia(a,c)}),this.emit(pn.MediaReconnectStart,a.uid)}),this.unbindAllRemoteTrackEvents(),this.remoteUserMap.clear(),this.localDataChannels.length!==0&&(this.localDataChannels.forEach(r=>{this.pendingLocalDataChannels.push(r)}),this.localDataChannels.length=0),this.remoteDataChannelMap.size!==0&&(Array.from(this.remoteDataChannelMap.entries()).forEach(r=>{let[a,o]=r;Array.from(al(o).call(o)).forEach(c=>{this.setPendingRemoteDataChannel(a,c)})}),this.remoteDataChannelMap.clear()),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),z.debug("[".concat(this.store.clientId,"] P2PChannel disconnected, waiting to reconnect.")))}hasPendingRemoteDataChannel(r,a){for(let o of this.pendingRemoteDataChannels){let{user:c,id:f}=o;if((r instanceof i1?r.uid:r)===c.uid&&f===a)return!0}return!1}setPendingRemoteDataChannel(r,a){this.hasPendingRemoteDataChannel(r,a)||this.pendingRemoteDataChannels.push({user:r,id:a})}hasPendingRemoteMedia(r,a){for(let o of this.pendingRemoteTracks){let{user:c,kind:f}=o;if((r instanceof i1?r.uid:r)===c.uid&&a===f)return!0}return!1}setPendingRemoteMedia(r,a){this.hasPendingRemoteMedia(r,a)||this.pendingRemoteTracks.push({user:r,kind:a})}restartICE(r){var a=this;return zl(function*(){if(!a.connection||a.state!==vi.Connected||a.connection instanceof a1)return;let o=yield Dn(a.mutex.lock("From P2PChannel.restartICE")),c;try{c=yield Dn(a.connection.restartICE(r));let g=yield Dn(c.next());if(g.done)return;let v=g.value,w=yield v;switch(a.reportPCDisconnectedOrFailed(r),r){case ja.TCP:a._pcStatsUploadType=Tm.TCP_RESTART;break;case ja.RELAY:a._pcStatsUploadType=Tm.RELAY_RESTART;break;default:a._pcStatsUploadType=Tm.OLD_RESTART}a._isInRestartIce=!0,c.next(w)}catch(g){var f;(f=c)===null||f===void 0||f.throw(g)}finally{o()}})()}getUplinkNetworkQuality(){if(!this.connection)return 0;let r=this.connection.getStats(),a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalAudioTrack),c=r.videoSend.find(F=>F.ssrc===(a==null?void 0:a.ssrcs[0].ssrcId)),f=r.audioSend.find(F=>F.ssrc===(o==null?void 0:o.ssrcs[0].ssrcId));if(!c||!f)return 1;let g=Bl(this,pn.NeedSignalRTT),v=c?c.rttMs:void 0,w=f?f.rttMs:void 0,T=v&&w?(v+w)/2:v||w,R=(T&&g?(T+g)/2:T||g)||0,A=100*r.sendPacketLossRate*.7/50+.3*R/1500,L=A<.17?1:A<.36?2:A<.59?3:A<.1?4:5,U=a==null?void 0:a.track;if(U&&U._encoderConfig&&U._hints.indexOf(Hi.SCREEN_TRACK)===-1){let F=U._encoderConfig.bitrateMax,Z=r.bitrate.actualEncoded;if(F&&Z){let W=(1e3*F-Z)/(1e3*F);return Vie[W<.15?0:W<.3?1:W<.45?2:W<.6?3:4][L]}}return L}getDownlinkNetworkQuality(){if(!this.connection)return 0;let r=this.connection.getStats(),a=0;return Array.from(this.remoteUserMap.entries()).forEach(o=>{let[c]=o,f=c._audioSSRC,g=c._videoSSRC,v=r.audioRecv.find(Z=>Z.ssrc===f),w=r.videoRecv.find(Z=>Z.ssrc===g);if(!v&&!w)return void(a+=1);let T=Bl(this,pn.NeedSignalRTT),R=r.rtt,A=(R&&T?(R+T)/2:R||T)||0,L=v?v.jitterMs:void 0,U=r.recvPacketLossRate,F=.7*U*100/50+.3*A/1500;L&&(F=.6*U*100/50+.2*A/1500+.2*L/400),a+=F<.1?1:F<.17?2:F<.36?3:F<.59?4:5}),this.remoteUserMap.size>0?Math.round(a/this.remoteUserMap.size):a}async muteLocalTrack(r){return new Ct((a,o)=>{this.handleMuteLocalTrack(r,a,o)})}async replaceTrack(r,a){var o;if(z.debug("[".concat(this.store.clientId,"] P2PChannel replaceTrack from [").concat(r.getTrackId(),"] to [").concat(a.getTrackId(),"]")),!this.connection||this.state!==vi.Connected)return;let c=Array.from(this.localTrackMap.entries()).find(g=>{let[,{track:v}]=g;return r===v});if(!c)return;let f=c[0];if(r!==a&&(this.unbindLocalTrackEvents([{track:r,type:f}]),this.bindLocalTrackEvents([{track:a,type:f}]),c[1].track=a),await((o=this.connection)===null||o===void 0?void 0:o.replaceTrack(a,c[1].id)),this.isPlanB){let g=c[1];g.id=a._mediaStreamTrack.id,this.localTrackMap.set(f,g)}if(f===ht.LocalVideoTrack&&!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding){let g=this.localTrackMap.get(ht.LocalVideoLowTrack);if(g){let v=r._mediaStreamTrack.clone();g.track._originMediaStreamTrack.stop(),g.track._mediaStreamTrack=v,g.track._originMediaStreamTrack=v,await new Ct((w,T)=>{this.handleReplaceTrack(g.track,w,T,!0)})}}}filterTobePublishedTracks(r,a,o){let c=[],f=this.getAllTracks();r=sb(r=r.filter(T=>f.indexOf(T)===-1));let g,v=!1,w=this.localTrackMap.get(ht.LocalAudioTrack);for(let T of r){if(T instanceof Di&&(this.localTrackMap.has(ht.LocalVideoTrack)||v?new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS).throw():(c.push({track:T,type:ht.LocalVideoTrack}),v=!0),a)){let R=this.getLowVideoTrack(T,o);c.push({track:R,type:ht.LocalVideoLowTrack})}if(T instanceof br)if(w){let R=w.track;if(R instanceof ss)c$([T]),R.addAudioTrack(T),this.bindLocalAudioTrackEvents(T,!0);else{let A=d$([R,T]);z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection will replace audioTrack [").concat(A.getTrackId(),"]")),this.replaceTrack(R,A)}}else g instanceof ss?(c$([T]),g.addAudioTrack(T)):g||!T._useAudioElement&&Jn().webAudioMediaStreamDest&&!T._bypassWebAudio?g=d$(g?[T,g]:[T]):g=T}return g&&(z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection will send audioTrack [").concat(g.getTrackId(),"]")),c.push({track:g,type:ht.LocalAudioTrack})),c}filterTobeUnpublishedTracks(r){let a=[],o=this.getAllTracks();r=sb(r=r.filter(c=>o.indexOf(c)!==-1));for(let c of r){if(c instanceof br){let f=this.localTrackMap.get(ht.LocalAudioTrack);if(!f)continue;f.track instanceof ss?(f.track.removeAudioTrack(c),this.unbindLocalAudioTrackEvents(c),f.track.trackList.length===0&&(a.push([ht.LocalAudioTrack,f]),f.track.close())):a.push([ht.LocalAudioTrack,f])}if(c instanceof Di){let f=this.localTrackMap.get(ht.LocalVideoTrack);if(!f)continue;a.push([ht.LocalVideoTrack,f]);let g=this.localTrackMap.get(ht.LocalVideoLowTrack);g&&a.push([ht.LocalVideoLowTrack,g])}}return a}filterTobePublishedDataChannels(r){return r=(r=sb(r)).filter(a=>this.localDataChannels.findIndex(o=>o.id===a.id)===-1)}filterTobeUnpublishedDataChannels(r){return r=(r=(r=sb(r)).filter(a=>this.localDataChannels.indexOf(a)!==-1)).filter(a=>a._originDataChannel)}bindLocalTrackEvents(r){r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.addListener(Mt.GET_STATS,this.handleGetLocalVideoStats),o.addListener(Mt.GET_RTC_STATS,this.handleGetRTCStats),o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.addListener(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.bindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}bindLocalAudioTrackEvents(r,a){r instanceof ss?r.trackList.forEach(o=>{o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),r.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack),a||(r.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),r.addListener(Mt.NEED_REPLACE_MIXING_TRACK,this.handleReplaceMixingTrack)))}unbindLocalTrackEvents(r){r||(r=Array.from(this.localTrackMap.entries()).map(a=>{let[o,{track:c}]=a;return{track:c,type:o}})),r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.off(Mt.GET_STATS,this.handleGetLocalVideoStats),o.off(Mt.GET_RTC_STATS,this.handleGetRTCStats),o.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.off(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.off(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.unbindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}unbindLocalAudioTrackEvents(r){r instanceof ss?r.trackList.forEach(a=>{a.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),a.off(Mt.GET_STATS,this.handleGetLocalAudioStats),a.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.off(Mt.GET_STATS,this.handleGetLocalAudioStats),r.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),r.off(Mt.NEED_REPLACE_MIXING_TRACK,this.handleReplaceMixingTrack),r.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack))}bindRemoteTrackEvents(r,a){a instanceof kb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteVideoStats(r))}),a instanceof Mb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteAudioStats(r))})}unbindRemoteTrackEvents(r){r&&r.removeAllListeners(Mt.GET_STATS)}unbindAllRemoteTrackEvents(){Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;o.has(Wt.AUDIO)&&this.unbindRemoteTrackEvents(a._audioTrack),o.has(Wt.VIDEO)&&this.unbindRemoteTrackEvents(a._videoTrack)})}createGatewayPublishMessage(r,a){return r.map((o,c)=>{var f;let g,v,{track:w,type:T}=o;switch(T){case ht.LocalAudioTrack:g=mi.Audio,v={dtx:w instanceof Qk&&w._config.DTX,hq:!1,lq:!1,stereo:!1,speech:!1};break;case ht.LocalVideoTrack:g=Tt(f=w._hints).call(f,Hi.SCREEN_TRACK)?mi.Screen:mi.High,v=ep(ep({},are(w)),{},{codec:this.store.codec});break;case ht.LocalVideoLowTrack:g=mi.Low,v=ep(ep({},are(w)),{},{codec:this.store.codec})}return{stream_type:g,attributes:v,ssrcs:a[c]}})}createGatewayUnpublishMessage(r){return r.map(a=>{var o;let c,[f,{track:g,ssrcs:v,id:w}]=a;switch(f){case ht.LocalVideoTrack:c=Tt(o=g._hints).call(o,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalAudioTrack:c=mi.Audio;break;case ht.LocalVideoLowTrack:c=mi.Low}return{stream_type:c,ssrcs:v,mid:w}})}assignLocalTracks(r,a){r.forEach((o,c)=>{let{track:f,type:g}=o;this.localTrackMap.set(g,{track:f,id:a[c].id,ssrcs:a[c].localSSRC})})}withdrawLocalTracks(r){r.forEach(a=>{let[o]=a;this.localTrackMap.delete(o)})}bindConnectionEvents(r){r.onConnectionStateChange=async a=>{if(z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onConnectionStateChange(").concat(a,")")),this.emit(pn.PeerConnectionStateChange,a),a!=="connected"||this.store.keyMetrics.peerConnectionEnd||this.store.peerConnectionEnd(),a==="connected"&&(this._restartTimer&&(clearTimeout(this._restartTimer),this._restartTimer=void 0),(this._isFirstConnected||this._isInRestartIce)&&this.reportPCStats(Date.now(),!0,this._pcStatsUploadType),this._isInRestartIce=!1,this._isFirstConnected=!1,this._isStartRestartIce=!1),ve("NEW_ICE_RESTART")){var o;if(Tt(o=this._restartStates).call(o,a)){if(this._isStartRestartIce)return;this._isStartRestartIce=!0;let c=v=>{(r.iceConnectionState==="disconnected"||r.iceConnectionState==="checking"||r.iceConnectionState==="failed")&&(z.debug("[".concat(this.store.clientId,"] [P2PChannel] start use restartICE, type is ").concat(v)),Bl(this,pn.QueryClientConnectionState)==="CONNECTED"&&this.emit(pn.RequestRestartICE,v))},f=()=>{r.iceConnectionState!=="disconnected"&&r.iceConnectionState!=="checking"&&r.iceConnectionState!=="failed"||(this.reportPCStats(Date.now(),!1,this._pcStatsUploadType),z.debug("[".concat(this.store.clientId,"] P2PConnection disconnected timeout, force reconnect")),setTimeout(()=>this.emit(pn.P2PLost),0),this.iceFailedCount+=1,this.requestReconnect())},g=ve("ICE_RESTART_INTERVAL");return void(this._restartTimer=window.setTimeout(()=>{if(ve("JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE")&&Jn().supportPCSetConfiguration)c(ja.RELAY),this._restartTimer=window.setTimeout(f,g);else if(Oi())c(ja.UDP),this._restartTimer=window.setTimeout(f,4e3);else{if(c(ja.TCP),Jn().supportPCSetConfiguration)return void(this._restartTimer=window.setTimeout(()=>{c(ja.RELAY),this._restartTimer=window.setTimeout(f,g)},g));this._restartTimer=window.setTimeout(f,g)}},800))}}else{if(a==="disconnected"&&r.iceConnectionState==="disconnected")return setTimeout(()=>{r.iceConnectionState==="disconnected"&&ve("ICE_RESTART")&&Bl(this,pn.QueryClientConnectionState)==="CONNECTED"&&this.emit(pn.RequestRestartICE)},800),void setTimeout(()=>{r.peerConnectionState==="disconnected"&&(z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection disconnected timeout 4000ms, force reconnect")),this.reportPCStats(Date.now(),!1,this._pcStatsUploadType),this._isInRestartIce=!1,setTimeout(()=>this.emit(pn.P2PLost),0),this.iceFailedCount+=1,this.requestReconnect())},4e3);a==="failed"&&(z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection state failed, force reconnect")),this.reportPCDisconnectedOrFailed(),setTimeout(()=>this.emit(pn.P2PLost),0),this.iceFailedCount+=1,await this.requestReconnect())}},r.onICEConnectionStateChange=a=>{a!=="connected"||this.store.keyMetrics.iceConnectionEnd||this.store.iceConnectionEnd(),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICEConnectionStateChange(").concat(a,")")),$t.reportApiInvoke(this.store.sessionId,{name:"ICEConnectionStateChange",options:a,tag:vr.TRACER}).onSuccess(),this.emit(pn.IceConnectionStateChange,a)},r.onICETransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICETransportStateChange(").concat(a,")"))},r.onDTLSTransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportStateChange(").concat(a,")"))},r.onDTLSTransportError=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportError(").concat(a,")"))},r.onFirstAudioDecoded=a=>{var o;let c=Array.from(al(o=this.remoteUserMap).call(o)).find(g=>g._audioSSRC===a);var f;c&&(this.store.subscribe(c.uid,"audio",void 0,void 0,void 0,Date.now()),(f=c.audioTrack)===null||f===void 0||f.emit(Ob.FIRST_FRAME_DECODED),$t.firstRemoteFrame(this.store.sessionId,Is.FIRST_AUDIO_DECODE,fr.FIRST_AUDIO_DECODE,{peer:c._uintid,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId}))},r.onFirstAudioReceived=a=>{var o;let c=Array.from(al(o=this.remoteUserMap).call(o)).find(f=>f._audioSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Is.FIRST_AUDIO_RECEIVED,fr.FIRST_AUDIO_RECEIVED,{peer:c._uintid,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onFirstVideoDecoded=(a,o,c)=>{this.reportVideoFirstFrameDecoded(a,o,c)},r.onFirstVideoReceived=a=>{var o;let c=Array.from(al(o=this.remoteUserMap).call(o)).find(f=>f._videoSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Is.FIRST_VIDEO_RECEIVED,fr.FIRST_VIDEO_RECEIVED,{peer:c._uintid,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onSelectedLocalCandidateChanged=(a,o)=>{let c=a.candidateType==="relay",f=o.candidateType==="relay";o.candidateType!=="unknown"&&c===f||this.emit(pn.ConnectionTypeChange,c),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedLocalCandidateChanged(").concat(JSON.stringify(K0(o))," -> ").concat(JSON.stringify(K0(a)),")"))},r.onSelectedRemoteCandidateChanged=(a,o)=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedRemoteCandidateChanged(").concat(JSON.stringify(K0(o))," -> ").concat(JSON.stringify(K0(a)),")"))},r.onFirstVideoDecodedTimeout=a=>{this.reportVideoFirstFrameDecoded(a,void 0,void 0,!0)},r.getLocalVideoStats=()=>{let a=this.statsCollector.getLocalVideoTrackStats(),o=this.statsCollector.getRTCStats();return ep(ep({},a),o)}}unbindConnectionEvents(r){r.onConnectionStateChange=void 0,r.onICEConnectionStateChange=void 0,r.onICETransportStateChange=void 0,r.onDTLSTransportStateChange=void 0,r.onDTLSTransportError=void 0,r.onFirstAudioDecoded=void 0,r.onFirstAudioReceived=void 0,r.onFirstVideoDecoded=void 0,r.onFirstVideoReceived=void 0,r.onSelectedLocalCandidateChanged=void 0,r.onSelectedRemoteCandidateChanged=void 0,r.onFirstVideoDecodedTimeout=void 0,r.getLocalVideoStats=void 0}filterTobeMutedTracks(r){let a=[];if(this.getAllTracks().indexOf(r)===-1)return a;let o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ss)return o.track.isActive||a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:g}]=f;return r===g});if(c&&(a.push(c),c[0]===ht.LocalVideoTrack)){let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}return a}filterTobeUnmutedTracks(r){let a=[],o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ss)return o.track.isActive&&a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:g}]=f;return r===g});if(c)if(c[0]===ht.LocalVideoTrack){a.push(c);let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}else a.push(c);return a}createMuteMessage(r){return r.map(a=>{var o;let c,[f,{track:g,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=mi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=g._hints).call(o,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalVideoLowTrack:c=mi.Low}return{stream_type:c,ssrcs:v,mid:w}})}createUnmuteMessage(r){return r.map(a=>{var o;let c,[f,{track:g,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=mi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=g._hints).call(o,Hi.SCREEN_TRACK)?mi.Screen:mi.High;break;case ht.LocalVideoLowTrack:c=mi.Low}return{stream_type:c,ssrcs:v,mid:w}})}filterTobeUnSubscribedTracks(r,a){let o=[],c=this.remoteUserMap.get(r);if(!c)return o;if(a){let f=c.get(a);if(!f)return o;o.push([r,{kind:a,id:f}])}else Array.from(c.entries()).forEach(f=>{let[g,v]=f;o.push([r,{kind:g,id:v}])});return o}filterTobeUnSubscribedDataChannels(r,a){let o=[];return a.forEach(c=>{var f;(f=this.remoteDataChannelMap.get(r))!==null&&f!==void 0&&f.has(c.id)&&o.push(c)}),o}createUnsubscribeMessage(r){let a=[];return r.forEach(o=>{let[c,{kind:f,id:g}]=o;switch(f){case Wt.VIDEO:return void(c._videoSSRC&&a.push({stream_type:Wt.VIDEO,ssrcId:c._videoSSRC}));case Wt.AUDIO:return void(c._audioSSRC&&a.push({stream_type:Wt.AUDIO,ssrcId:c._audioSSRC}))}}),a}createUnsubscribeAllMessage(r){let a=new Map;return r.forEach(o=>{let[c,{kind:f}]=o;if(a.has(c)){let g=a.get(c);f===Wt.VIDEO?g|=Es.Video:g|=Es.Audio,a.set(c,g)}else f===Wt.VIDEO?a.set(c,Es.Video):a.set(c,Es.Audio)}),{users:Array.from(a.entries()).map(o=>{let[c,f]=o;return{stream_id:c.uid,stream_type:f}})}}withdrawRemoteTracks(r){r.forEach(a=>{let[o,{kind:c}]=a,f=this.remoteUserMap.get(o);f&&(f.delete(c),Array.from(f.entries()).length===0&&this.remoteUserMap.delete(o))})}async updateBitrateLimit(r){let a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalVideoLowTrack);a&&await a.track.setBitrateLimit(r.uplink),o&&r.low_stream_uplink&&await o.track.setBitrateLimit({max_bitrate:r.low_stream_uplink.bitrate,min_bitrate:r.low_stream_uplink.bitrate||0})}isP2PDisconnected(){return this.connection?this.connection.peerConnectionState!=="connected":!0}mapPubResToRemoteConfig(r,a){return r.map((o,c)=>{var f;let{stream_type:g}=o;return(f=a.find(v=>{let{stream_type:w}=v;return g===w}))===null||f===void 0?void 0:f.attributes})}async tryToUnmuteAudio(r){for(let o=0;o<r.length;o++)if(r[o]instanceof br){var a;let c=this.filterTobeUnmutedTracks(r[o]);if(c.length===0)continue;await((a=this.connection)===null||a===void 0?void 0:a.unmuteLocal(c.map(g=>{let[,{id:v}]=g;return v})));let f=this.createUnmuteMessage(c);return void await Pi(this,pn.RequestUnmuteLocal,f)}}bindStatsUploaderEvents(){this.statsUploader.requestStats=()=>this.getStats(),this.statsUploader.requestLocalMedia=()=>Array.from(this.localTrackMap.entries()),this.statsUploader.requestRemoteMedia=()=>Array.from(this.remoteUserMap.entries()),this.statsUploader.requestVideoIsReady=r=>{var a;return!((a=this.connection)===null||a===void 0||!a.getRemoteVideoIsReady(r))},this.statsUploader.requestUpload=(r,a)=>this.emit(pn.RequestUpload,r,a),this.statsUploader.requestUploadStats=r=>this.emit(pn.RequestUploadStats,r),this.statsUploader.requestAllTracks=()=>this.getAllTracks()}unbindStatsUploaderEvents(){this.statsUploader.requestStats=void 0,this.statsUploader.requestLocalMedia=void 0,this.statsUploader.requestRemoteMedia=void 0,this.statsUploader.requestVideoIsReady=void 0}async requestReconnect(){this.dtlsFailedCount+=1,await _s(uk(this.dtlsFailedCount,Mr)),this.emit(pn.RequestReconnect)}async reconnectP2P(){let r=Array.from(this.localTrackMap.entries()),a=this.createGatewayUnpublishMessage(r);Array.from(this.remoteUserMap.entries()),a.length>0&&await Yr(this,pn.RequestUnpublishForReconnectPC,a),this.disconnectForReconnect(),this.emit(pn.RequestReconnectPC)}canPublishLowStream(){return this.localTrackMap.has(ht.LocalVideoTrack)||this.pendingLocalTracks.some(r=>r instanceof Di)}throwIfTrackTypeNotMatch(r){if(r.filter(a=>a instanceof Di).length>1)throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(r.filter(a=>a instanceof br).length>1&&(r.some(a=>a instanceof br&&a._bypassWebAudio)||!Jn().webAudioMediaStreamDest))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode");for(let a of r){if(a instanceof Di&&this.pendingLocalTracks.some(o=>o instanceof Di))throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(a instanceof br&&this.pendingLocalTracks.some(o=>o instanceof br)&&(!Jn().webAudioMediaStreamDest||a._bypassWebAudio||this.pendingLocalTracks.some(o=>o instanceof br&&o._bypassWebAudio)))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode")}}getLowVideoTrack(r,a){let o=!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding,c=ep(ep({},{width:160,height:120,framerate:15,bitrate:50}),a),f;f=o?r._mediaStreamTrack.clone():l$(r,c);let g=Li(8,"track-low-"),v=new Di(f,ep(ep({},o&&{scaleResolutionDownBy:UG(c,r)}),{},{frameRate:c.framerate,bitrateMax:c.bitrate,bitrateMin:c.bitrate}),void 0,void 0,g);return v.on(S_.TRANSCEIVER_UPDATED,w=>{r._updateRtpTransceiver(w,Ib.LOW_STREAM)}),v._hints.push(Hi.LOW_STREAM),r.on("sei-to-send",w=>{v.emit("sei-to-send",w)}),r.addListener(Mt.NEED_CLOSE,()=>{v.close()}),v}async globalLock(){return this.mutex.lock("From P2PChannel.globalLock")}async reportPCStats(r,a,o){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(this.connection&&this.connection instanceof Vh){var f,g,v,w;let T=this.store.keyMetrics.descriptionStart||0,{iceConnectionState:R,dtlsTransportState:A,peerConnectionState:L}=this.connection,{local:U,remote:F}=await this.connection.getSelectedCandidatePair();$t.pcStats(this.store.sessionId,{startTime:T,eventElapse:r-T||0,iceconnectionsate:R,dtlsstate:A,connectionstate:L,intSucc:a?1:2,error:c,selectedLocalCandidateProtocol:(f=U==null?void 0:U.protocol)!==null&&f!==void 0?f:"",selectedLocalCandidateType:(g=U.candidateType)!==null&&g!==void 0?g:"",selectedLocalCandidateAddress:"".concat(U.address,":").concat(U.port),selectedRemoteCandidateProtocol:(v=F.protocol)!==null&&v!==void 0?v:"",selectedRemoteCandidateType:(w=F.candidateType)!==null&&w!==void 0?w:"",selectedRemoteCandidateAddress:"".concat(F.address,":").concat(F.port),restartCnt:o})}}reportVideoFirstFrameDecoded(r,a,o,c){var f;let g=Array.from(al(f=this.remoteUserMap).call(f)).find(v=>v._videoSSRC===r);if(g){c||this.store.subscribe(g.uid,"video",void 0,void 0,void 0,void 0,Date.now());let v=this.store.keyMetrics,w=v.subscribe.find(T=>T.userId===g.uid&&T.type==="video");$t.firstRemoteVideoDecode(this.store.sessionId,Is.FIRST_VIDEO_DECODE,fr.FIRST_VIDEO_DECODE,{peer:g._uintid,videowidth:a,videoheight:o,subscribeElapse:ua.measureFromSubscribeStart(this.store.clientId,r),subscribeRequestid:r,p2pid:this.store.p2pId,apEnd:v.requestAPEnd||0,apStart:v.requestAPStart||0,joinGwEnd:v.joinGatewayEnd||0,joinGwStart:v.joinGatewayStart||0,pcEnd:v.peerConnectionEnd||0,pcStart:v.peerConnectionStart||0,subscriberEnd:(w==null?void 0:w.subscribeEnd)||0,subscriberStart:(w==null?void 0:w.subscribeStart)||0,videoAddNotify:(w==null?void 0:w.streamAdded)||0,state:c?1:0})}}async remoteMediaSsrcChanged(r,a,o){if(!this.connection)return!1;let c=this.remoteUserMap.get(r);if(!c)return!1;let f=c.get(a);if(!f)return!1;let g=await this.connection.getRemoteSSRC(f);return g!==void 0&&g!==o}resetConnection(r){z.debug("[".concat(this.store.clientId,"] [P2PChannel] reset connection to ").concat(r)),this.state===vi.Connected?(z.debug("[".concat(this.store.clientId,"] [P2PChannel] fallback to websocket but P2PChannel state still connected, disconnect first")),this.disconnectForReconnect()):(this.connection&&(this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0),this.shouldForwardP2PCreation&&(this.connection=r===Xie.datachannel?new a1({},this.store):this.isPlanB?new Fb({},this.store):new Vh({},this.store),this.bindConnectionEvents(this.connection)))}unbindRtpTransceiver(){this.localTrackMap.size!==0&&Array.from(this.localTrackMap.entries()).forEach(r=>{let[a,{track:o}]=r;a===ht.LocalVideoLowTrack?o._updateRtpTransceiver(void 0,Ib.LOW_STREAM):o._updateRtpTransceiver(void 0)})}reportPCDisconnectedOrFailed(r){this.connection&&this.connection instanceof Vh&&(this.connection.iceConnectionState!=="disconnected"&&this.connection.iceConnectionState!=="checking"&&this.connection.iceConnectionState!=="failed"||(this._isFirstConnected?(this.reportPCStats(Date.now(),!1,this._pcStatsUploadType),this._isFirstConnected=!1):this._pcStatsUploadType===Tm.TCP_RESTART&&r===ja.RELAY?this.reportPCStats(Date.now(),!1,this._pcStatsUploadType):this.reportPCStats(Date.now(),!1,Tm.DISCONNECTED_OR_FAILED)))}},vt(Mn.prototype,"startP2PConnection",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"startP2PConnection"),Mn.prototype),vt(Mn.prototype,"connect",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"connect"),Mn.prototype),vt(Mn.prototype,"updateRemoteRTPCapabilities",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"updateRemoteRTPCapabilities"),Mn.prototype),vt(Mn.prototype,"preConnect",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"preConnect"),Mn.prototype),vt(Mn.prototype,"publishDataChannel",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"publishDataChannel"),Mn.prototype),vt(Mn.prototype,"unpublish",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"unpublish"),Mn.prototype),vt(Mn.prototype,"unpublishDataChannel",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"unpublishDataChannel"),Mn.prototype),vt(Mn.prototype,"unpublishLowStream",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"unpublishLowStream"),Mn.prototype),vt(Mn.prototype,"subscribeDataChannel",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"subscribeDataChannel"),Mn.prototype),vt(Mn.prototype,"subscribe",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"subscribe"),Mn.prototype),vt(Mn.prototype,"massSubscribe",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"massSubscribe"),Mn.prototype),vt(Mn.prototype,"unsubscribe",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"unsubscribe"),Mn.prototype),vt(Mn.prototype,"unsubscribeDataChannel",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"unsubscribeDataChannel"),Mn.prototype),vt(Mn.prototype,"massUnsubscribe",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"massUnsubscribe"),Mn.prototype),vt(Mn.prototype,"muteRemote",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"muteRemote"),Mn.prototype),vt(Mn.prototype,"unmuteRemote",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"unmuteRemote"),Mn.prototype),vt(Mn.prototype,"hasRemoteMediaWithLock",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"hasRemoteMediaWithLock"),Mn.prototype),vt(Mn.prototype,"disconnectForReconnect",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"disconnectForReconnect"),Mn.prototype),vt(Mn.prototype,"updateBitrateLimit",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"updateBitrateLimit"),Mn.prototype),vt(Mn.prototype,"remoteMediaSsrcChanged",[Aa],Object.getOwnPropertyDescriptor(Mn.prototype,"remoteMediaSsrcChanged"),Mn.prototype),Mn);function Aa(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,g=await f.lock("From P2PChannel.".concat(a));try{for(var v=arguments.length,w=new Array(v),T=0;T<v;T++)w[T]=arguments[T];return await c.apply(this,w)}finally{g()}},o}function uNe(r){let a=lce();return function(o,c){let f=o.appId;f!==void 0&&(_i(c,10),tp(c,f));let g=o.cid;g!==void 0&&(_i(c,16),_i(c,g));let v=o.cname;v!==void 0&&(_i(c,26),tp(c,v));let w=o.deviceId;w!==void 0&&(_i(c,34),tp(c,w));let T=o.elapse;T!==void 0&&(_i(c,40),o1(c,T));let R=o.fileSize;R!==void 0&&(_i(c,48),o1(c,Vb(R)));let A=o.height;A!==void 0&&(_i(c,56),o1(c,Vb(A)));let L=o.jpg;L!==void 0&&(_i(c,66),_i(c,L.length),function(Uu,at){let yt=zb(Uu,at.length);Uu.bytes.set(at,yt)}(c,L));let U=o.networkType;U!==void 0&&(_i(c,72),o1(c,Vb(U)));let F=o.osType;F!==void 0&&(_i(c,80),o1(c,Vb(F)));let Z=o.requestId;Z!==void 0&&(_i(c,90),tp(c,Z));let W=o.sdkVersion;W!==void 0&&(_i(c,98),tp(c,W));let K=o.sequence;K!==void 0&&(_i(c,104),o1(c,Vb(K)));let oe=o.sid;oe!==void 0&&(_i(c,114),tp(c,oe));let ue=o.timestamp;ue!==void 0&&(_i(c,120),o1(c,ue));let xe=o.uid;xe!==void 0&&(_i(c,128),_i(c,xe));let Ne=o.vid;Ne!==void 0&&(_i(c,136),_i(c,Ne));let ke=o.width;ke!==void 0&&(_i(c,144),o1(c,Vb(ke)));let He=o.service;He!==void 0&&(_i(c,152),_i(c,He));let lt=o.callbackData;lt!==void 0&&(_i(c,162),tp(c,lt));let ut=o.jpgEncryption;ut!==void 0&&(_i(c,168),_i(c,ut));let ft=o.requestType;ft!==void 0&&(_i(c,176),_i(c,ft));let zt=o.scorePorn;zt!==void 0&&(_i(c,185),y$(c,zt));let $n=o.scoreSexy;$n!==void 0&&(_i(c,193),y$(c,$n));let hi=o.scoreNeutral;hi!==void 0&&(_i(c,201),y$(c,hi));let Gi=o.scene;Gi!==void 0&&(_i(c,208),_i(c,Gi));let Fr=o.ossFilePrefix;Fr!==void 0&&(_i(c,218),tp(c,Fr));let mr=o.serviceVendor;if(mr!==void 0)for(let Uu of mr){_i(c,226);let at=lce();pNe(Uu,at),_i(c,at.limit),yNe(c,at),vNe(at)}}(r,a),function(o){let c=o.bytes,f=o.limit;return c.length===f?c:c.subarray(0,f)}(a)}function hNe(r){return function(o){let c={};e:for(;!cce(o);){let f=np(o);switch(f>>>3){case 0:break e;case 1:c.code=np(o);break;case 2:c.msg=dce(o,np(o));break;case 3:{let g=mNe(o);c.data=fNe(o),o.limit=g;break}default:ace(o,7&f)}}return c}({bytes:a=r,offset:0,limit:a.length});var a}function fNe(r){let a={};e:for(;!cce(r);){let o=np(r);switch(o>>>3){case 0:break e;case 1:a.requestId=dce(r,np(r));break;case 2:a.requestType=np(r)>>>0;break;case 3:a.scorePorn=v$(r);break;case 4:a.scoreSexy=v$(r);break;case 5:a.scoreNeutral=v$(r);break;case 6:a.requestScene=np(r)>>>0;break;case 7:a.scene=np(r)>>>0;break;default:ace(r,7&o)}}return a}function pNe(r,a){let o=r.service;o!==void 0&&(_i(a,8),_i(a,o));let c=r.vendor;c!==void 0&&(_i(a,16),_i(a,c));let f=r.token;f!==void 0&&(_i(a,26),tp(a,f));let g=r.callbackUrl;g!==void 0&&(_i(a,34),tp(a,g))}function mNe(r){let a=np(r),o=r.limit;return r.limit=r.offset+a,o}function ace(r,a){switch(a){case 0:for(;128&uce(r););break;case 2:m$(r,np(r));break;case 5:m$(r,4);break;case 1:m$(r,8);break;default:throw new Error("Unimplemented type: "+a)}}let gNe=new Float32Array(1);new Uint8Array(gNe.buffer);let p$=new Float64Array(1),hl=new Uint8Array(p$.buffer);function Vb(r){return{low:r|=0,high:r>>31,unsigned:r>=0}}let oce=[];function lce(){let r=oce.pop();return r?(r.offset=r.limit=0,r):{bytes:new Uint8Array(64),offset:0,limit:0}}function vNe(r){oce.push(r)}function m$(r,a){if(r.offset+a>r.limit)throw new Error("Skip past limit");r.offset+=a}function cce(r){return r.offset>=r.limit}function zb(r,a){let o=r.bytes,c=r.offset,f=r.limit,g=c+a;if(g>o.length){let v=new Uint8Array(2*g);v.set(o),r.bytes=v}return r.offset=g,g>f&&(r.limit=g),c}function g$(r,a){let o=r.offset;if(o+a>r.limit)throw new Error("Read past limit");return r.offset+=a,o}function dce(r,a){let o=g$(r,a),c=String.fromCharCode,f=r.bytes,g="<22>",v="";for(let w=0;w<a;w++){let T,R,A,L,U=f[w+o];128&U?(224&U)==192?w+1>=a?v+=g:(T=f[w+o+1],(192&T)!=128?v+=g:(L=(31&U)<<6|63&T,L<128?v+=g:(v+=c(L),w++))):(240&U)==224?w+2>=a?v+=g:(T=f[w+o+1],R=f[w+o+2],(49344&(T|R<<8))!=32896?v+=g:(L=(15&U)<<12|(63&T)<<6|63&R,L<2048||L>=55296&&L<=57343?v+=g:(v+=c(L),w+=2))):(248&U)==240?w+3>=a?v+=g:(T=f[w+o+1],R=f[w+o+2],A=f[w+o+3],(12632256&(T|R<<8|A<<16))!=8421504?v+=g:(L=(7&U)<<18|(63&T)<<12|(63&R)<<6|63&A,L<65536||L>1114111?v+=g:(L-=65536,v+=c(55296+(L>>10),56320+(1023&L)),w+=3))):v+=g:v+=c(U)}return v}function tp(r,a){let o=a.length,c=0;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),c+=w<128?1:w<2048?2:w<65536?3:4}_i(r,c);let f=zb(r,c),g=r.bytes;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),w<128?g[f++]=w:(w<2048?g[f++]=w>>6&31|192:(w<65536?g[f++]=w>>12&15|224:(g[f++]=w>>18&7|240,g[f++]=w>>12&63|128),g[f++]=w>>6&63|128),g[f++]=63&w|128)}}function yNe(r,a){let o=zb(r,a.limit),c=r.bytes,f=a.bytes;for(let g=0,v=a.limit;g<v;g++)c[g+o]=f[g]}function uce(r){return r.bytes[g$(r,1)]}function hce(r,a){let o=zb(r,1);r.bytes[o]=a}function v$(r){let a=g$(r,8),o=r.bytes;return hl[0]=o[a++],hl[1]=o[a++],hl[2]=o[a++],hl[3]=o[a++],hl[4]=o[a++],hl[5]=o[a++],hl[6]=o[a++],hl[7]=o[a++],p$[0]}function y$(r,a){let o=zb(r,8),c=r.bytes;p$[0]=a,c[o++]=hl[0],c[o++]=hl[1],c[o++]=hl[2],c[o++]=hl[3],c[o++]=hl[4],c[o++]=hl[5],c[o++]=hl[6],c[o++]=hl[7]}function np(r){let a,o=0,c=0;do a=uce(r),o<32&&(c|=(127&a)<<o),o+=7;while(128&a);return c}function _i(r,a){for(a>>>=0;a>=128;)hce(r,127&a|128),a>>>=7;hce(r,a)}function o1(r,a){let o=a.low>>>0,c=(a.low>>>28|a.high<<4)>>>0,f=a.high>>>24,g=f===0?c===0?o<16384?o<128?1:2:o<1<<21?3:4:c<16384?c<128?5:6:c<1<<21?7:8:f<128?9:10,v=zb(r,g),w=r.bytes;switch(g){case 10:w[v+9]=f>>>7&1;case 9:w[v+8]=g!==9?128|f:127&f;case 8:w[v+7]=g!==8?c>>>21|128:c>>>21&127;case 7:w[v+6]=g!==7?c>>>14|128:c>>>14&127;case 6:w[v+5]=g!==6?c>>>7|128:c>>>7&127;case 5:w[v+4]=g!==5?128|c:127&c;case 4:w[v+3]=g!==4?o>>>21|128:o>>>21&127;case 3:w[v+2]=g!==3?o>>>14|128:o>>>14&127;case 2:w[v+1]=g!==2?o>>>7|128:o>>>7&127;case 1:w[v]=g!==1?128|o:127&o}}function fce(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}let _Ne=new Map([["moderation",1],["supervise",2]]);class _8 extends tr{get connectionState(){return this._connectionState}set connectionState(a){if(this._connectionState===a)return;let o=this._connectionState;this._connectionState=a,this.emit(Os.CONNECTION_STATE_CHANGE,o,a)}get inspectType(){return this._inspectType}set inspectType(a){var o;this._inspectMode=bc(o=a.map(c=>_Ne.get(c)||0)).call(o,(c,f)=>c+f),this._inspectType=a}get quality(){return this._quality}set quality(a){this._quality=a>1?1:a<.1?.1:a,this.qualityTimer&&(window.clearTimeout(this.qualityTimer),this.qualityTimer=null),this._quality>=1||(this.qualityTimer=window.setTimeout(()=>{this.quality=this._quality/this.qualityRatio},6e4))}constructor(a){super(),X(this,"name","AgoraRTCVideoContentInspect"),X(this,"_connectionState",Su.CONNECTING),X(this,"_innerConnectionState",void 0),X(this,"sequence",0),X(this,"inspectStartTime",void 0),X(this,"workerManagerConnection",void 0),X(this,"workerConnection",void 0),X(this,"workerMessageLengthLimit",void 0),X(this,"inspectIntervalMinimum",void 0),X(this,"qualityRatio",void 0),X(this,"_connectInfo",void 0),X(this,"_cancelTokenSource",Lo.CancelToken.source()),X(this,"_retryConfig",void 0),X(this,"wmSequence",0),X(this,"inspectInterval",void 0),X(this,"inspectTimer",null),X(this,"ossFilePrefix",void 0),X(this,"extraInfo",void 0),X(this,"_inspectType",void 0),X(this,"_inspectMode",void 0),X(this,"_quality",1),X(this,"qualityTimer",null),X(this,"_inspectId",void 0),X(this,"_needWorkUrlOnly",!1),X(this,"inspectImage",()=>{if(this.connectionState!==Su.CONNECTED)throw new De(ce.OPERATION_ABORTED,"content inspect service connection status is ".concat(this.connectionState));this.inspectTimer&&(window.clearInterval(this.inspectTimer),this.inspectTimer=null),this.inspectTimer=window.setInterval(()=>{this.connectionState===Su.CONNECTED?this.requestToInspectImage():z.debug("[".concat(this._inspectId,"] Inspect State is not connected , "),this.connectionState)},this.inspectInterval<this.inspectIntervalMinimum?this.inspectIntervalMinimum:this.inspectInterval),this.requestToInspectImage()}),this._inspectId=Li(5,"inspect-"),this.workerMessageLengthLimit=ve("VIDEO_INSPECT_WORKER_MESSAGE_LENGTH_LIMIT"),this.inspectIntervalMinimum=ve("VIDEO_INSPECT_INTERVAL_MINIMUM"),this.qualityRatio=ve("VIDEO_INSPECT_QUALITY_RATIO"),this.inspectInterval=a.interval,this.ossFilePrefix=a.ossFilePrefix,this.extraInfo=a.extraInfo,this.inspectType=a.inspectType,this.inspectStartTime=Number(Date.now()),this.workerManagerConnection=new GI("worker-manager-"+this._inspectId,Mr),this.on(Os.STATE_CHANGE,(o,c)=>{this._innerConnectionState=o,z.debug("[".concat(this._inspectId,"] Inspect operation :").concat(bu[o]," ").concat(c||""))}),this.handleWorkerManagerEvents(),this.workerConnection=new GI("worker-"+this._inspectId,Mr),this.handleWorkerEvents()}async init(a,o){this.emit(Os.STATE_CHANGE,bu.CONNECT_AP),this._connectInfo=a;let c=this._cancelTokenSource.token;return this._retryConfig=o,new Ct((f,g)=>{this.on(Os.CONNECTION_STATE_CHANGE,(v,w)=>{w===Su.CONNECTED&&f()}),this.requestAP(a,c,o).then(v=>{this.connectWorkerManager(v)}).catch(v=>{g(v)})})}async requestAP(a,o,c){let f=ve("WEBCS_DOMAIN").map(w=>"https://".concat(w,"/api/v1")),g=await function(w,T,R,A){let{appId:L,areaCode:U,cname:F,sid:Z,token:W,uid:K}=T;pb++;let oe="image_moderation_api",ue={service_name:oe,json_body:JSON.stringify({appId:L,areaCode:U,cname:F,command:"allocateEdge",requestId:pb,seq:pb,sid:Z,token:W,ts:Date.now(),uid:K+""})},xe,Ne,ke=w[0];return Nh(async()=>{xe=Date.now();let He=await Dh(ke,{data:ue,cancelToken:R,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"},params:{action:"wrtc_gateway"}});if(Ne=Date.now()-xe,He.code!==0){let zt=new De(ce.UNEXPECTED_RESPONSE,"image inspect ap error, code"+He.code,{retry:!0,responseTime:Ne});throw z.error(zt.toString()),zt}let lt=JSON.parse(He.json_body);if(lt.code!==200){let zt=new De(ce.UNEXPECTED_RESPONSE,"image inspect ap error, code: ".concat(lt.code,", reason: ").concat(lt.reason),{code:lt.code,responseTime:Ne});throw z.error(zt.toString()),zt}if(!lt.servers||!Array.isArray(lt.servers)||lt.servers.length===0){let zt=new De(ce.UNEXPECTED_RESPONSE,"image inspect ap empty server",{code:lt.code,responseTime:Ne});throw z.error(zt.toString()),zt}let ut=ve("VIDEO_INSPECT_WORKER_MANAGER_HOST"),ft=ve("VIDEO_INSPECT_WORKER_MANAGER_PORT");return{addressList:lt.servers.map(zt=>{let{address:$n,wss:hi}=zt;if($n&&hi)return"wss://".concat($n.replace(/\./g,"-"),".").concat(ut,":").concat(ft||hi)}).filter(zt=>!!zt),workerToken:lt.workerToken,vid:lt.vid,responseTime:Ne}},(He,lt)=>($t.apworkerEvent(Z,{success:!0,sc:200,serviceName:oe,responseDetail:JSON.stringify(He.addressList),firstSuccess:lt===0,responseTime:Ne,serverIp:w[lt%w.length]}),!1),(He,lt)=>($t.apworkerEvent(Z,{success:!1,sc:He.data&&He.data.code||200,serviceName:oe,responseTime:Ne,serverIp:w[lt%w.length]}),!!(He.code!==ce.OPERATION_ABORTED&&He.code!==ce.UNEXPECTED_RESPONSE||He.data&&He.data.retry)&&(ke=w[(lt+1)%w.length],!0)),A)}(f,a,o,c);this.emit(Os.STATE_CHANGE,bu.AP_CONNECTED);let{addressList:v}=g;return this.wmSequence++,v}async connectWorkerManager(a){let o=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this._needWorkUrlOnly=o,this.emit(Os.STATE_CHANGE,bu.CONNECT_WORKER_MANAGER),await this.workerManagerConnection.init(a,1e4)}async connectWorker(a){await this.workerConnection.init([a])}handleWorkerManagerEvents(){this.workerManagerConnection.on(_n.CONNECTED,async()=>{this.emit(Os.STATE_CHANGE,bu.WORKER_MANAGER_CONNECTED,this.workerManagerConnection.url),this.workerManagerConnection.sendMessage({appId:this._connectInfo.appId,cname:this._connectInfo.cname,uid:this._connectInfo.uid+"",sdkVersion:"4.21.0",sid:this._connectInfo.sid,seq:this.wmSequence,ts:Number(Date.now()),requestId:Math.floor(1e12*Math.random()),allocate:!0,clientRequest:{command:"join"}},!0)}),this.workerManagerConnection.on(_n.CLOSED,()=>{this._innerConnectionState<bu.GET_WORKER_MANAGER_RESPONSE&&z.debug("[".concat(this._inspectId,"] Inspect worker manager is closed before connecting worker"))}),this.workerManagerConnection.on(_n.FAILED,()=>{this._innerConnectionState<bu.GET_WORKER_MANAGER_RESPONSE&&z.debug("[".concat(this._inspectId,"] Connecting inspect worker manager is failed before connecting worker"))}),this.workerManagerConnection.on(_n.RECONNECTING,()=>{this._innerConnectionState<bu.GET_WORKER_MANAGER_RESPONSE&&z.debug("[".concat(this._inspectId,"] Inspect worker manager is reconnecting before connecting worker"))}),this.workerManagerConnection.on(_n.ON_MESSAGE,async a=>{this.emit(Os.STATE_CHANGE,bu.GET_WORKER_MANAGER_RESPONSE);let o=this.workerManagerConnection.url;this.workerManagerConnection.close();let c=JSON.parse(a.data);if(c.code!==200)throw z.error("[".concat(this._inspectId,"] Unexpected code ").concat(c.code," from worker manager")),new De(ce.UNEXPECTED_RESPONSE,"response code of worker is unexpected",c);if(!(c.serverResponse&&c.serverResponse.portWss&&o))throw z.error("[".concat(this._inspectId,"] Unexpected content from worker manager : ").concat(JSON.stringify(c))),new De(ce.UNEXPECTED_RESPONSE,"response content of worker is unexpected",c);{let f=ve("VIDEO_INSPECT_WORKER_PORT")||c.serverResponse.portWss,g=o.replace(/:\d+\/?$/,":".concat(f));this.emit(Os.STATE_CHANGE,bu.CONNECT_WORKER,g),this._needWorkUrlOnly?this.emit(Os.REQUEST_NEW_WORKER_URL,g):await this.connectWorker(g)}}),this.workerManagerConnection.on(_n.WILL_RECONNECT,(a,o,c)=>{c(a)}),this.workerManagerConnection.on(_n.REQUEST_NEW_URLS,(a,o)=>{this.requestAP(this._connectInfo,this._cancelTokenSource.token,this._retryConfig).then(a).catch(o)})}handleWorkerEvents(){this.workerConnection.on(_n.CONNECTED,async()=>{this.emit(Os.STATE_CHANGE,bu.WORKER_CONNECTED,this.workerConnection.url),this.connectionState=Su.CONNECTED}),this.workerConnection.on(_n.ON_MESSAGE,async a=>{if(a.data instanceof ArrayBuffer){let c=hNe(new Uint8Array(a.data));if(ve("SHOW_VIDEO_INSPECT_WORKER_MESSAGE")&&z.debug("[".concat(this._inspectId,"] Response message for worker of inspect content "),JSON.stringify(c)),c.code===200){if(Array.isArray(this.inspectType)&&this.inspectType.length===1&&this.inspectType[0]==="supervise")return void this.emit(Os.INSPECT_RESULT,void 0,void 0);if(c.data&&c.data.scorePorn&&c.data.scoreSexy&&c.data.scoreNeutral){var o;let f={porn:c.data.scorePorn,sexy:c.data.scoreSexy,neutral:c.data.scoreNeutral},g=bc(o=Object.keys(f)).call(o,(w,T)=>f[w]>f[T]?w:T,"porn"),v=Object.keys(f).find(w=>w===g);this.emit(Os.INSPECT_RESULT,v)}else this.emit(Os.INSPECT_RESULT,void 0,new De(ce.UNEXPECTED_RESPONSE,c.code+"","There is an unexpected data on message"))}else this.emit(Os.INSPECT_RESULT,void 0,new De(ce.UNEXPECTED_RESPONSE,c.code+"",c.msg))}else z.error("[".concat(this._inspectId,"] Unexpected message type from worker")),this.emit(Os.INSPECT_RESULT,void 0,new De(ce.UNEXPECTED_RESPONSE,"invalid worker message type"))}),this.workerConnection.on(_n.CLOSED,()=>{this.connectionState=Su.CLOSED}),this.workerConnection.on(_n.FAILED,()=>{this.connectionState=Su.CLOSED}),this.workerConnection.on(_n.RECONNECTING,()=>{this.connectionState=this.connectionState===Su.CONNECTED?Su.RECONNECTING:Su.CONNECTING}),this.workerConnection.on(_n.WILL_RECONNECT,(a,o,c)=>{a==="recover"&&c(a),c("tryNext")}),this.workerConnection.on(_n.REQUEST_NEW_URLS,(a,o)=>{this.workerManagerConnection.close(),this.once(Os.REQUEST_NEW_WORKER_URL,c=>{a([c])}),this.requestAP(this._connectInfo,this._cancelTokenSource.token,this._retryConfig).then(c=>{this.connectWorkerManager(c,!0)}).catch(c=>{o(c)})})}static intToLong(a){return{low:a|=0,high:a>>31,unsigned:a>=0}}async requestToInspectImage(){this.sequence++;let a=Bl(this,Os.CLIENT_LOCAL_VIDEO_TRACK),o={appId:this._connectInfo.appId,cname:this._connectInfo.cname,cid:this._connectInfo.cid,sid:this._connectInfo.sid,uid:this._connectInfo.uid,vid:this._connectInfo.vid};if(a){if(!a.isPlaying)return void this.emit(Os.INSPECT_RESULT,void 0,new De(ce.INVALID_OPERATION,"Only the track being played can be inspected"));let c=await this.generateRequestData(a,o);this.workerConnection.sendMessage(c,!0,!0)}else this.emit(Os.INSPECT_RESULT,void 0,new De(ce.INVALID_OPERATION,"Only the track being published can be inspected"))}async generateRequestData(a,o){let{appId:c,cname:f,cid:g,vid:v,sid:w,uid:T}=o,R=Date.now(),A=await a.getCurrentFrameImage("image/jpeg",this.quality),L=await pae(A,c,f),U=this.sequence+"-"+g+"-"+T+"-"+R+"-"+Li(12,""),F={appId:c,cid:g,cname:f,deviceId:"",elapse:_8.intToLong(Number(R-this.inspectStartTime)),fileSize:L.byteLength,jpgEncryption:2,height:A.height,width:A.width,jpg:L,networkType:6,osType:7,requestId:U,sdkVersion:"4.21.0",sequence:this.sequence,sid:w,timestamp:_8.intToLong(R),uid:T,vid:v,service:this._inspectMode,callbackData:this.extraInfo,ossFilePrefix:this.ossFilePrefix};this.extraInfo===void 0&&delete F.callbackData,this.ossFilePrefix===void 0&&delete F.ossFilePrefix;let Z=uNe(F);if(Z.byteLength<this.workerMessageLengthLimit){if(ve("SHOW_VIDEO_INSPECT_WORKER_MESSAGE")){let W=function(K){for(var oe=1;oe<arguments.length;oe++){var ue=arguments[oe]!=null?arguments[oe]:{};oe%2?fce(Object(ue),!0).forEach(function(xe){X(K,xe,ue[xe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(K,Object.getOwnPropertyDescriptors(ue)):fce(Object(ue)).forEach(function(xe){Object.defineProperty(K,xe,Object.getOwnPropertyDescriptor(ue,xe))})}return K}({},F);delete W.jpg,z.debug("[".concat(this._inspectId,"] Request message for worker of inspect content "),JSON.stringify(W))}return Z}{let W=this.quality*this.qualityRatio;return this.quality=W,await this.generateRequestData(a,{appId:c,cname:f,cid:g,vid:v,sid:w,uid:T})}}close(){this._cancelTokenSource.cancel(),this._cancelTokenSource=Lo.CancelToken.source(),this.workerManagerConnection&&this.workerManagerConnection.close(),this.workerConnection&&this.workerConnection.close(),this.inspectTimer&&window.clearInterval(this.inspectTimer),this.inspectTimer=null,this.connectionState=Su.CLOSED,this.emit(Os.STATE_CHANGE,bu.CLOSED)}}function ENe(r){let a=function(){let o=bNe.pop();return o?(o.offset=o.limit=0,o):{bytes:new Uint8Array(64),offset:0,limit:0}}();return function(o,c){let f=o.appId;f!==void 0&&(Ur(c,10),l1(c,f));let g=o.cid;g!==void 0&&(Ur(c,16),Ur(c,g));let v=o.cname;v!==void 0&&(Ur(c,26),l1(c,v));let w=o.deviceId;w!==void 0&&(Ur(c,34),l1(c,w));let T=o.elapse;T!==void 0&&(Ur(c,40),c1(c,T));let R=o.fileSize;R!==void 0&&(Ur(c,48),c1(c,Hb(R)));let A=o.height;A!==void 0&&(Ur(c,56),c1(c,Hb(A)));let L=o.jpg;L!==void 0&&(Ur(c,66),Ur(c,L.length),mce(c,L));let U=o.networkType;U!==void 0&&(Ur(c,72),c1(c,Hb(U)));let F=o.osType;F!==void 0&&(Ur(c,80),c1(c,Hb(F)));let Z=o.requestId;Z!==void 0&&(Ur(c,90),l1(c,Z));let W=o.sdkVersion;W!==void 0&&(Ur(c,98),l1(c,W));let K=o.sequence;K!==void 0&&(Ur(c,104),c1(c,Hb(K)));let oe=o.sid;oe!==void 0&&(Ur(c,114),l1(c,oe));let ue=o.timestamp;ue!==void 0&&(Ur(c,120),c1(c,ue));let xe=o.uid;xe!==void 0&&(Ur(c,128),Ur(c,xe));let Ne=o.vid;Ne!==void 0&&(Ur(c,136),Ur(c,Ne));let ke=o.width;ke!==void 0&&(Ur(c,144),c1(c,Hb(ke)));let He=o.service;He!==void 0&&(Ur(c,152),Ur(c,He));let lt=o.callbackData;lt!==void 0&&(Ur(c,162),Ur(c,lt.length),mce(c,lt));let ut=o.ticket;ut!==void 0&&(Ur(c,170),l1(c,ut));let ft=o.vendorConfigs;ft!==void 0&&(Ur(c,178),l1(c,ft))}(r,a),function(o){let c=o.bytes,f=o.limit;return c.length===f?c:c.subarray(0,f)}(a)}function wNe(r){return function(o){let c={};e:for(;!CNe(o);){let f=R3(o);switch(f>>>3){case 0:break e;case 1:c.code=R3(o);break;case 2:c.msg=gce(o,R3(o));break;case 3:c.requestId=gce(o,R3(o));break;case 4:c.timestamp=TNe(o,!1);break;default:SNe(o,7&f)}}return c}({bytes:a=r,offset:0,limit:a.length});var a}function SNe(r,a){switch(a){case 0:for(;128&ju(r););break;case 2:_$(r,R3(r));break;case 5:_$(r,4);break;case 1:_$(r,8);break;default:throw new Error("Unimplemented type: "+a)}}function Hb(r){return{low:r|=0,high:r>>31,unsigned:r>=0}}let bNe=[];function _$(r,a){if(r.offset+a>r.limit)throw new Error("Skip past limit");r.offset+=a}function CNe(r){return r.offset>=r.limit}function E8(r,a){let o=r.bytes,c=r.offset,f=r.limit,g=c+a;if(g>o.length){let v=new Uint8Array(2*g);v.set(o),r.bytes=v}return r.offset=g,g>f&&(r.limit=g),c}function pce(r,a){let o=r.offset;if(o+a>r.limit)throw new Error("Read past limit");return r.offset+=a,o}function mce(r,a){let o=E8(r,a.length);r.bytes.set(a,o)}function gce(r,a){let o=pce(r,a),c=String.fromCharCode,f=r.bytes,g="<22>",v="";for(let w=0;w<a;w++){let T,R,A,L,U=f[w+o];128&U?(224&U)==192?w+1>=a?v+=g:(T=f[w+o+1],(192&T)!=128?v+=g:(L=(31&U)<<6|63&T,L<128?v+=g:(v+=c(L),w++))):(240&U)==224?w+2>=a?v+=g:(T=f[w+o+1],R=f[w+o+2],(49344&(T|R<<8))!=32896?v+=g:(L=(15&U)<<12|(63&T)<<6|63&R,L<2048||L>=55296&&L<=57343?v+=g:(v+=c(L),w+=2))):(248&U)==240?w+3>=a?v+=g:(T=f[w+o+1],R=f[w+o+2],A=f[w+o+3],(12632256&(T|R<<8|A<<16))!=8421504?v+=g:(L=(7&U)<<18|(63&T)<<12|(63&R)<<6|63&A,L<65536||L>1114111?v+=g:(L-=65536,v+=c(55296+(L>>10),56320+(1023&L)),w+=3))):v+=g:v+=c(U)}return v}function l1(r,a){let o=a.length,c=0;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),c+=w<128?1:w<2048?2:w<65536?3:4}Ur(r,c);let f=E8(r,c),g=r.bytes;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),w<128?g[f++]=w:(w<2048?g[f++]=w>>6&31|192:(w<65536?g[f++]=w>>12&15|224:(g[f++]=w>>18&7|240,g[f++]=w>>12&63|128),g[f++]=w>>6&63|128),g[f++]=63&w|128)}}function ju(r){return r.bytes[pce(r,1)]}function vce(r,a){let o=E8(r,1);r.bytes[o]=a}function R3(r){let a,o=0,c=0;do a=ju(r),o<32&&(c|=(127&a)<<o),o+=7;while(128&a);return c}function Ur(r,a){for(a>>>=0;a>=128;)vce(r,127&a|128),a>>>=7;vce(r,a)}function TNe(r,a){let o,c=0,f=0,g=0;return o=ju(r),c=127&o,128&o&&(o=ju(r),c|=(127&o)<<7,128&o&&(o=ju(r),c|=(127&o)<<14,128&o&&(o=ju(r),c|=(127&o)<<21,128&o&&(o=ju(r),f=127&o,128&o&&(o=ju(r),f|=(127&o)<<7,128&o&&(o=ju(r),f|=(127&o)<<14,128&o&&(o=ju(r),f|=(127&o)<<21,128&o&&(o=ju(r),g=127&o,128&o&&(o=ju(r),g|=(127&o)<<7))))))))),{low:c|f<<28,high:f>>>4|g<<24,unsigned:a}}function c1(r,a){let o=a.low>>>0,c=(a.low>>>28|a.high<<4)>>>0,f=a.high>>>24,g=f===0?c===0?o<16384?o<128?1:2:o<1<<21?3:4:c<16384?c<128?5:6:c<1<<21?7:8:f<128?9:10,v=E8(r,g),w=r.bytes;switch(g){case 10:w[v+9]=f>>>7&1;case 9:w[v+8]=g!==9?128|f:127&f;case 8:w[v+7]=g!==8?c>>>21|128:c>>>21&127;case 7:w[v+6]=g!==7?c>>>14|128:c>>>14&127;case 6:w[v+5]=g!==6?c>>>7|128:c>>>7&127;case 5:w[v+4]=g!==5?128|c:127&c;case 4:w[v+3]=g!==4?o>>>21|128:o>>>21&127;case 3:w[v+2]=g!==3?o>>>14|128:o>>>14&127;case 2:w[v+1]=g!==2?o>>>7|128:o>>>7&127;case 1:w[v]=g!==1?128|o:127&o}}let yce={},_ce={},w8=4294967296,RNe=w8*w8,Ece=RNe/2;Sce(0,!0);let wce=Sce(0),xNe=x3(0,-2147483648,!1),ANe=x3(-1,2147483647,!1);function Sce(r,a){let o,c,f;return a?(f=0<=(r>>>=0)&&r<256)&&(c=_ce[r],c)?c:(o=x3(r,0,!0),f&&(_ce[r]=o),o):(f=-128<=(r|=0)&&r<128)&&(c=yce[r],c)?c:(o=x3(r,r<0?-1:0,!1),f&&(yce[r]=o),o)}function x3(r,a,o){return{low:0|r,high:0|a,unsigned:!!o}}function INe(r,a){if(isNaN(r))return wce;{if(r<=-Ece)return xNe;if(r+1>=Ece)return ANe}return r<0?wce:x3(r%w8|0,r/w8|0,a)}function bce(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}class E$ extends tr{get connectionState(){return this._connectionState}set connectionState(a){if(this._connectionState===a)return;let o=this._connectionState;this._connectionState=a,this.emit(Ph.CONNECTION_STATE_CHANGE,a,o)}get quality(){return this._quality}set quality(a){this._quality=a>1?1:a<.1?.1:a,this._qualityTimer&&(window.clearTimeout(this._qualityTimer),this._qualityTimer=null),this._quality>=1||(this._qualityTimer=window.setTimeout(()=>{this.quality=this._quality/this._qualityRatio},6e4))}constructor(a){var o;super(),X(this,"name","AgoraRTCImageModeration"),X(this,"_connectionState",gd.CONNECTING),X(this,"_sequence",0),X(this,"_moderationStartTime",void 0),X(this,"_workerConnection",void 0),X(this,"_workerMessageLengthLimit",void 0),X(this,"_qualityRatio",void 0),X(this,"_connectInfo",void 0),X(this,"_cancelTokenSource",Lo.CancelToken.source()),X(this,"_retryConfig",void 0),X(this,"_moderationInterval",void 0),X(this,"_moderationTimer",null),X(this,"_moderationMode",1),X(this,"_quality",1),X(this,"_qualityTimer",null),X(this,"_ticket",void 0),X(this,"_moderationIntervalMinimum",void 0),X(this,"_uploadFailedNum",0),X(this,"_uploadNum",0),X(this,"_uploadTimer",null),X(this,"_extraInfo",void 0),X(this,"_vendor",""),X(this,"_encoder",new TextEncoder),X(this,"_moderationId",void 0),X(this,"inspectImage",()=>{if(this.connectionState!==gd.CONNECTED)throw new De(ce.OPERATION_ABORTED,"image moderation service connection status is ".concat(this.connectionState));this._moderationTimer&&(window.clearInterval(this._moderationTimer),this._moderationTimer=null),this._moderationTimer=window.setInterval(()=>{this.connectionState===gd.CONNECTED?this.requestToInspectImage():z.debug("[".concat(this._moderationId,"] Moderation State is not connected , "),this.connectionState)},this._moderationInterval<this._moderationIntervalMinimum?this._moderationIntervalMinimum:this._moderationInterval),this.requestToInspectImage()}),this._moderationId=Li(5,"image-moderation-"),this._workerMessageLengthLimit=ve("IMAGE_MODERATION_WORKER_MESSAGE_LENGTH_LIMIT"),this._moderationIntervalMinimum=ve("IMAGE_MODERATION_INTERVAL_MINIMUM"),this._moderationInterval=(o=a.interval)!==null&&o!==void 0?o:1e3,a.extraInfo&&(this._extraInfo=this._encoder.encode(a.extraInfo)),a.vendor&&(this._vendor=a.vendor),this._qualityRatio=ve("IMAGE_MODERATION_QUALITY_RATIO"),this._moderationStartTime=Number(Date.now()),this._workerConnection=new GI("worker-"+this._moderationId,Mr),this.on(Ph.STATE_CHANGE,(c,f)=>{z.debug("[".concat(this._moderationId,"] Moderation operation :").concat(ub[c]," ").concat(f||""))}),this.handleWorkerEvents()}async init(a,o){this.emit(Ph.STATE_CHANGE,ub.CONNECT_AP),this._connectInfo=a;let c=this._cancelTokenSource.token;return this._retryConfig=o,new Ct((f,g)=>{this.on(Ph.CONNECTION_STATE_CHANGE,(v,w)=>{v===gd.CONNECTED&&f()}),this.requestAP(a,c,o).then(v=>{this.connectWorker(v)}).catch(v=>{g(v)})})}updateConfig(a){var o;this._moderationInterval=(o=a.interval)!==null&&o!==void 0?o:1e3,a.extraInfo&&(this._extraInfo=this._encoder.encode(a.extraInfo)),a.vendor&&(this._vendor=a.vendor),z.debug("[".concat(this._moderationId,"] updateConfig: ").concat(JSON.stringify(a))),this.connectionState===gd.CONNECTED&&this.inspectImage()}async requestAP(a,o,c){let f=ve("WEBCS_DOMAIN").map(T=>"https://".concat(T,"/api/v1")),g=await function(T,R,A,L){let{appId:U,areaCode:F,cname:Z,sid:W,token:K,uid:oe}=R;pb++;let ue="moderation_plugin",xe={service_name:ue,json_body:JSON.stringify({appId:U,areaCode:F,cname:Z,command:"allocateEdge",requestId:pb,seq:pb,sid:W,appToken:K,ts:Date.now(),uid:oe+""})},Ne,ke,He=T[0];return Nh(async()=>{Ne=Date.now();let lt=await Dh(He,{data:xe,cancelToken:A,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"},params:{action:"wrtc_gateway"}});if(ke=Date.now()-Ne,lt.code!==0){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap error, code"+lt.code,{retry:!0,responseTime:ke});throw z.error(zt.toString()),zt}let ut=JSON.parse(lt.json_body);if(ut.code!==200){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap error, code: ".concat(ut.code,", reason: ").concat(ut.reason),{code:ut.code,responseTime:ke});throw z.error(zt.toString()),zt}if(!ut.servers||!Array.isArray(ut.servers)||ut.servers.length===0){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap empty server",{code:ut.code,responseTime:ke});throw z.error(zt.toString()),zt}if(!ut.servers.some(zt=>!!zt.wss)){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap empty port",{code:ut.code,responseTime:ke});throw z.error(zt.toString()),zt}let ft=ve("IMAGE_MODERATION_WORKER_HOST");return{addressList:ut.servers.map(zt=>{let{address:$n,wss:hi}=zt;if($n&&hi)return"wss://".concat($n.replace(/\./g,"-"),".").concat(ft,":").concat(hi,"/moderation")}).filter(zt=>!!zt),workerToken:ut.workerToken,vid:ut.vid,ticket:ut.appTicket,responseTime:ke}},(lt,ut)=>($t.apworkerEvent(W,{success:!0,sc:200,serviceName:ue,responseDetail:JSON.stringify(lt.addressList),firstSuccess:ut===0,responseTime:ke,serverIp:T[ut%T.length]}),!1),(lt,ut)=>($t.apworkerEvent(W,{success:!1,sc:lt.data&&lt.data.code||200,serviceName:ue,responseTime:ke,serverIp:T[ut%T.length]}),!!(lt.code!==ce.OPERATION_ABORTED&&lt.code!==ce.UNEXPECTED_RESPONSE||lt.data&&lt.data.retry)&&(He=T[(ut+1)%T.length],!0)),L)}(f,a,o,c);this.emit(Ph.STATE_CHANGE,ub.AP_CONNECTED);let{addressList:v,ticket:w}=g;return this._ticket=w,v}async connectWorker(a){this.emit(Ph.STATE_CHANGE,ub.CONNECT_WORKER),await this._workerConnection.init(a,1e4)}handleWorkerEvents(){this._workerConnection.on(_n.CONNECTED,async()=>{this.emit(Ph.STATE_CHANGE,ub.WORKER_CONNECTED,this._workerConnection.url),this.connectionState=gd.CONNECTED}),this._workerConnection.on(_n.CLOSED,()=>{this.connectionState=gd.CLOSED}),this._workerConnection.on(_n.FAILED,()=>{this.connectionState=gd.CLOSED}),this._workerConnection.on(_n.RECONNECTING,()=>{this.connectionState=this.connectionState===gd.CONNECTED?gd.RECONNECTING:gd.CONNECTING}),this._workerConnection.on(_n.ON_MESSAGE,async a=>{if(a.data instanceof ArrayBuffer){let o=wNe(new Uint8Array(a.data));ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")&&z.debug("[".concat(this._moderationId,"] Response message for worker of image moderation "),JSON.stringify(o)),this._uploadNum++,o.code===void 0||o.code===0||(this._uploadFailedNum++,z.error("[".concat(this._moderationId,"] Error response from worke, code is ").concat(o.code,", msg is ").concat(o.msg)),this._uploadTimer||(this._uploadTimer=window.setTimeout(()=>{$t.reportApiInvoke(this._connectInfo.sid||null,{name:qr.IMAGE_MODERATION_UPLOAD,options:[this._uploadFailedNum,this._uploadNum,o.code],tag:vr.TRACER}).onError(new De(ce.IMAGE_MODERATION_UPLOAD_FAILED,o.msg)),this._uploadTimer=null},ve("IMAGE_MODERATION_UPLOAD_REPORT_INTERVAL"))))}else z.error("[".concat(this._moderationId,"] Unexpected message type from worker"))}),this._workerConnection.on(_n.WILL_RECONNECT,(a,o,c)=>{a==="recover"&&c(a),c("tryNext")}),this._workerConnection.on(_n.REQUEST_NEW_URLS,(a,o)=>{this.requestAP(this._connectInfo,this._cancelTokenSource.token,this._retryConfig).then(a).catch(o)})}static intToLong(a){return{low:a|=0,high:a>>31,unsigned:a>=0}}async requestToInspectImage(){let a=Bl(this,Ph.CLIENT_LOCAL_VIDEO_TRACK),o={appId:this._connectInfo.appId,cname:this._connectInfo.cname,cid:this._connectInfo.cid,sid:this._connectInfo.sid,uid:this._connectInfo.uid,vid:this._connectInfo.vid};if(a){if(!a.isPlaying)return void(ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")&&z.debug("Only the track being played can be inspected"));this._sequence++;let c=await this.generateRequestData(a,o);this._workerConnection.sendMessage(c,!0,!0)}else ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")&&z.debug("Only the track being published can be inspected")}async generateRequestData(a,o){let{appId:c,cname:f,cid:g,vid:v,sid:w,uid:T}=o,R=Date.now(),A=await a.getCurrentFrameImage("image/jpeg",this.quality),L=await pae(A,c,f),U=this._sequence+"-"+g+"-"+T+"-"+R+"-"+Li(12,""),F={appId:c,cid:g,cname:f,deviceId:"",elapse:E$.intToLong(Number(R-this._moderationStartTime)),fileSize:A.buffer.byteLength,height:A.height,width:A.width,jpg:L,networkType:6,osType:7,requestId:U,sdkVersion:"4.21.0",sequence:this._sequence,sid:w,timestamp:INe(R),uid:T,vid:v,service:this._moderationMode,ticket:this._ticket,callbackData:this._extraInfo,vendorConfigs:this._vendor};this._extraInfo===void 0&&delete F.callbackData;let Z=ENe(F);if(Z.byteLength<this._workerMessageLengthLimit){if(ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")){let W=function(K){for(var oe=1;oe<arguments.length;oe++){var ue=arguments[oe]!=null?arguments[oe]:{};oe%2?bce(Object(ue),!0).forEach(function(xe){X(K,xe,ue[xe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(K,Object.getOwnPropertyDescriptors(ue)):bce(Object(ue)).forEach(function(xe){Object.defineProperty(K,xe,Object.getOwnPropertyDescriptor(ue,xe))})}return K}({},F);delete W.jpg,z.debug("[".concat(this._moderationId,"] Request message for worker of image moderation service: "),JSON.stringify(W))}return Z}{let W=this.quality*this._qualityRatio;return this.quality=W,await this.generateRequestData(a,{appId:c,cname:f,cid:g,vid:v,sid:w,uid:T})}}close(){this._cancelTokenSource.cancel(),this._cancelTokenSource=Lo.CancelToken.source(),this._workerConnection&&this._workerConnection.close(),this._moderationTimer&&window.clearInterval(this._moderationTimer),this._moderationTimer=null,this._uploadTimer&&window.clearTimeout(this._uploadTimer),this._uploadTimer=null,this.connectionState=gd.CLOSED,this.emit(Ph.STATE_CHANGE,ub.CLOSED)}}function Cce(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Tce(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Cce(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Cce(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let NNe=Date.now(),ONe=20,w$=new Map,S8=new Map;async function Rce(r){let a=w$.get(r),o=Array.isArray(a)&&a[a.length-1],c=S8.get(r);if(!o)return void(c.isSyncing=!1);let f={uid:o.uid,payload:o.payload};c.firstRecvTs===0&&(c.firstRecvTs=o.recvTs,c.firstSendTs=o.sendTs);let g=o.sendTs-c.firstSendTs,v=g-(Date.now()-c.firstRecvTs);v>0&&(c.firstRecvTs=Date.now()-g);let w=o.mediaDelay+v;w<=0?(a.pop(),xce(o.context,f),w=0):w=Math.min(w,ONe),setTimeout(()=>a.length&&Rce(r),w)}function xce(r,a){r.safeEmit(Gn.STREAM_MESSAGE,a.uid,a.payload),r.onStreamMessage&&r.onStreamMessage(a)}function PNe(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;if(!r.syncWithAudio)return xce(o,{uid:r.uid,payload:r.payload});let c="".concat(o.id,"-").concat(r.uid),f=w$.get(c)||[],g=f.findIndex(R=>r.sendTs>=R.sendTs),v=Tce(Tce({},r),{},{context:o,mediaDelay:a,recvTs:Date.now()});g===-1?f.push(v):f.splice(g,0,v),w$.set(c,f);let w=!1;var T;S8.has(c)?w=!((T=S8.get(c))===null||T===void 0||!T.isSyncing):S8.set(c,{isSyncing:w,firstRecvTs:0,firstSendTs:0}),w||Rce(c)}let LNe=ni().name;function Ace(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Ice(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Ace(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Ace(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Gb="websdk_ng_cache_parameter",DNe=ve("MAX_PRELOAD_ASYNC_LENGTH"),kNe=1e4,O_=new Map,P_=[],S$=null,b$=0,C$=0,b8=new Map,MNe=function(r,a){let o=[],c=0,f=async()=>{let g=o.shift();g&&await g(),o.length>0&&c<a?f():c--};return async function(){for(var g=arguments.length,v=new Array(g),w=0;w<g;w++)v[w]=arguments[w];return new Ct(async(T,R)=>{o.push(async()=>{try{let A=await r(...v);T(A)}catch(A){R(A)}}),c<a&&(c++,f())})}}(Nce,DNe),T$=Lo.CancelToken.source();async function Nce(r,a,o,c,f){try{if(!ve("ENABLE_PRELOAD"))return;if(!Jn().supportWebCrypto)return void B0(()=>{z.warn("Your browser does not support preloading, this feature be run in a secure environment")},"preload_webcrypto_not_supported");if(!o&&o!==null)throw new Ke(ce.INVALID_PARAMS,"Invalid token: ".concat(o,". If you don not use token, set it to null"));o&&Fs(o,"token",1,2047),Fs(r,"appid",1,2047),gk(a),c&&vk(c);let g=FI();z.debug("preload channel ".concat(a,", uid is ").concat(c));let v={appId:r,cname:a,token:o||r,uid:typeof c!="string"?c:null,sid:g,proxyServer:f},w,T;typeof c=="string"?(v.stringUid=c,[T,w]=await Ct.all([iIe(c,{sid:g,appId:r},T$.token),Sre(Ice(Ice({},v),{},{token:o||r,uid:0}),T$.token)]),v.uid=T.uid,w.gatewayInfo.uid=v.uid,w.gatewayInfo.res.uid=v.uid):w=await Sre(v,T$.token);let R={sid:g,appId:r,cname:a,token:o||r,uid:v.stringUid||c,intUid:v.uid||w.gatewayInfo.uid,stringUid:v.stringUid,ts:Date.now(),sua:T,ap:w};await async function(A){let L;try{A.uid&&Pce({appId:A.appId,cname:A.cname,token:A.token,uid:A.uid,stringUid:A.stringUid});let U=Mce(A),F=await async function(W,K){try{let oe=await window.crypto.subtle.importKey("raw",Rie(K),"AES-GCM",!1,["encrypt"]),ue=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(1)},oe,l_(window.btoa(JSON.stringify(W))));return V0(new Uint8Array(ue))}catch{return}}(A,A.token||A.appId);if(!F)return;L=kce(Gb);let Z=L?JSON.parse(L):[];Z.push({[U]:F}),Z.length>ve("AP_CACHE_NUM")&&Z.shift(),C8(Gb,JSON.stringify(Z))}catch(U){z.warn("Error caching server parameters:",U.message),C8(Gb,"")}}(R),b$++}catch(g){throw C$++,function(v){S$||(S$=window.setTimeout(()=>{let T="";b8.forEach((R,A)=>{T+="".concat(A,": ").concat(R," ;")}),$t.reportApiInvoke(null,{name:qr.PRELOAD,options:{success:b$,failed:C$,err:T}}).onError(v),b$=0,C$=0,b8.clear(),S$=null},kNe));let w=b8.get(v.code)||0;b8.set(v.code,w+1)}(g),g}}async function Oce(r){try{let a=Pce(r);if(!a||r.cloudProxyServer!=="disabled")return;let o=await async function(c,f){try{let g=await window.crypto.subtle.importKey("raw",Rie(f),"AES-GCM",!1,["decrypt"]),v=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(1)},g,l_(c));return JSON.parse(window.atob(V0(new Uint8Array(v))))}catch{return}}(a,r.token||r.appId);if(!o||!function(c,f){return c.cname===f.cname&&c.appId===f.appId&&c.token===f.token?f.stringUid?c.stringUid===f.stringUid:typeof f.uid=="number"?c.uid===f.uid:c.uid==f.uid:!1}(o,r))return;if(o&&Date.now()-o.ts<ve("AP_CACHE_LIFETIME"))return o}catch(a){z.warn("Error get preloadInfo",a.message)}}function Pce(r){let a;try{if(a=kce(Gb),!a)return;let o=JSON.parse(a),c=Mce(r),f=function(v,w){for(let T=v.length-1;T>=0;T--)if(w(v[T]))return T;return-1}(o,v=>c in v);if(f===-1)return;let g=o.splice(f,1)[0];return C8(Gb,JSON.stringify(o)),g[c]}catch(o){z.warn("Error delete preload info: ".concat(a),o.message),C8(Gb,"")}}function R$(r){if(r){let a=O_.get(r);a&&(window.clearTimeout(a),a=null,O_.delete(r)),Tt(P_).call(P_,r)||r.cloudProxyServer!=="disabled"||P_.push(r)}if(O_.size<ve("AP_CACHE_NUM")&&P_.length>0){let a=P_.shift();O_.set(a,window.setTimeout(async()=>{let{appId:o,cname:c,token:f,uid:g,proxyServer:v}=a;try{await MNe(o,c,f,g,v),O_.has(a)&&R$(a)}catch(w){z.warn("update preload failed",w.message),Lce(a)}},ve("AP_UPDATE_INTERVAL")))}}function Lce(r){let a=P_.indexOf(r);a!==-1&&P_.splice(a,1);let o=O_.get(r);o&&(window.clearTimeout(o),o=null,O_.delete(r),R$())}function Dce(r,a){let o=r.sua,c=r.ap;a&&o&&$t.reqUserAccount(r.sid,{lts:o.requestTime,elapse:o.elapse,success:!0,serverAddr:o.url,stringUid:a,uid:r.intUid,errorCode:null,extend:o.req}),$t.reportResourceTiming(r.ap.url,r.sid),$t.joinWebProxyAP(r.sid,{lts:c.requestTime,elapse:c.elapse,sucess:1,apServerAddr:c.url,turnServerAddrList:c.proxyInfo.addresses.map(f=>f.ip).join(","),eventType:"disabled",unilbsServerIds:[jr.CHOOSE_SERVER,jr.CLOUD_PROXY_FALLBACK].toString()}),$t.joinChooseServer(r.sid,{lts:c.requestTime,elapse:c.elapse,succ:!0,csAddr:c.url,opid:c.opid,serverList:c.gatewayInfo.gatewayAddrs.map(f=>f.address),ec:null,cid:c.gatewayInfo.cid.toString(),uid:c.gatewayInfo.uid.toString(),csIp:c.gatewayInfo.csIp,unilbsServerIds:[jr.CHOOSE_SERVER].toString(),isHttp3:c.isHttp3})}function kce(r){return window.atob(window.localStorage.getItem(r)||"")}function C8(r,a){window.localStorage.setItem(r,window.btoa(a))}function Mce(r){let a="".concat(r.appId,"_").concat(r.cname);return typeof r.uid=="string"&&(a+="_s_".concat(r.uid)),typeof r.uid=="number"&&(a+="_".concat(r.uid)),r.token&&(a+="_".concat(r.token)),Lie(a)}var jce,Uce,Fce,Bce,Vce,zce,Hce,Gce,Wce,$ce,Kce,qce,Yce,Xce,Jce,Qce,Zce,ede,tde,nde,ide,rde,sde,ade,ode,lde,cde,dde,ude,hde,fde,pde,mde,gde,vde,yde,_de,Ede,wde,Sde,bde,Cde,Nt;function Tde(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Sd(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Tde(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Tde(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}As.setLogger(z);let jNe=(jce=hn(),Uce=hn({argsMap:(r,a)=>{if(!Array.isArray(a)){if(!(a instanceof Pb))return[a];a=[a]}return a.map(o=>o?Object(o).toString():"null")}}),Fce=hn({argsMap:(r,a)=>(a||(a=[]),a instanceof qoe?[a.getChannelId()]:(Array.isArray(a)||(a=[a]),a.map(o=>o.getTrackId())))}),Bce=hn({argsMap:(r,a,o,c)=>[typeof a=="object"?a.uid:a,o,c]}),Vce=hn({argsMap:(r,a,o)=>[a,o]}),zce=hn({argsMap:(r,a)=>a.map(o=>{let{user:c,mediaType:f}=o;return[c==null?void 0:c.uid,f]})}),Hce=hn({argsMap:(r,a,o,c)=>[typeof a=="object"?a.uid:a,o,c]}),Gce=hn({argsMap:(r,a)=>a.map(o=>{let{user:c,mediaType:f}=o;return{uid:c==null?void 0:c.uid,mediaType:f}})}),Wce=hn(),$ce=hn(),Kce=hn(),qce=hn(),Yce=hn(),Xce=hn(),Jce=hn(),Qce=hn(),Zce=hn(),ede=hn(),tde=hn(),nde=hn(),ide=hn(),rde=hn(),sde=hn({argsMap:(r,a)=>[a]}),ade=hn(),ode=hn(),lde=hn(),cde=hn(),dde=hn(),ude=hn(),hde=hn(),fde=hn(),pde=hn(),mde=hn(),gde=hn({argsMap:(r,a)=>(Array.isArray(a)||(a=[a]),[JSON.stringify(a)])}),vde=hn(),yde=hn(),_de=hn(),Ede=hn(),wde=hn(),Sde=hn(),bde=hn({reportResult:!0}),Cde=hn(),Nt=class extends tr{get connectionState(){return this._gateway.state}get remoteUsers(){return this._users}get localTracks(){return this._p2pChannel.getAllTracks(!0)}get uid(){return this._uid}get channelName(){return this._channelName}get localDataChannels(){return this._p2pChannel.getAllDataChannels()}get mode(){return this._config.mode}get role(){var r;return((r=this._config)===null||r===void 0?void 0:r.role)||"audience"}get codec(){return this._config.codec}get audioCodec(){return this._config.audioCodec||"opus"}get isStringUID(){return!!this._joinInfo&&!!this._joinInfo.stringUid}get __className__(){return"Client"}constructor(r){let a;if(super(),X(this,"store",void 0),X(this,"_uid",void 0),X(this,"_channelName",void 0),X(this,"_uintUid",void 0),X(this,"_users",[]),X(this,"_config",void 0),X(this,"_clientId",void 0),X(this,"_appId",void 0),X(this,"_sessionId",null),X(this,"_key",void 0),X(this,"_rtmConfig",{}),X(this,"_joinInfo",void 0),X(this,"_gateway",void 0),X(this,"_statsCollector",void 0),X(this,"_configDistribute",void 0),X(this,"_leaveMutex",new As("client-leave")),X(this,"_publishMutex",new As("client-publish")),X(this,"_renewTokenMutex",new As("client-renewtoken")),X(this,"_subscribeMutex",new As("client-subscribe")),X(this,"_encryptionMode","none"),X(this,"_encryptionSecret",null),X(this,"_encryptionSalt",null),X(this,"_encryptDataStream",!1),X(this,"_encryptDataStreamKey",null),X(this,"_encryptDataStreamIv",null),X(this,"_proxyServer",void 0),X(this,"_turnServer",{servers:[],mode:"auto"}),X(this,"_cloudProxyServerMode","disabled"),X(this,"_isDualStreamEnabled",!1),X(this,"_defaultStreamFallbackType",void 0),X(this,"_lowStreamParameter",void 0),X(this,"_streamFallbackTypeCacheMap",new Map),X(this,"_remoteStreamTypeCacheMap",new Map),X(this,"_axiosCancelSource",Lo.CancelToken.source()),X(this,"_audioVolumeIndicationInterval",void 0),X(this,"_networkQualityInterval",void 0),X(this,"_userOfflineTimeout",void 0),X(this,"_streamRemovedTimeout",void 0),X(this,"_injectStreamingClient",void 0),X(this,"_liveTranscodeStreamingClient",void 0),X(this,"_liveRawStreamingClient",void 0),X(this,"_channelMediaRelayClient",void 0),X(this,"_networkQualitySensitivity","normal"),X(this,"_p2pChannel",void 0),X(this,"_useLocalAccessPoint",!1),X(this,"_setLocalAPVersion",void 0),X(this,"_joinAndNotLeaveYet",!1),X(this,"_numberOfJoinCount",0),X(this,"_remoteDefaultVideoStreamType",void 0),X(this,"_inspect",void 0),X(this,"_moderation",void 0),X(this,"_license",void 0),X(this,"_pendingPublishedUsers",[]),X(this,"ntpAlignErrorCount",0),X(this,"remoteInboundOffset",0),X(this,"_handleLocalTrackEnable",(o,c,f)=>{this.publish(o,!1).then(c).catch(f)}),X(this,"_handleLocalTrackDisable",(o,c,f)=>{this.unpublish(o).then(c).catch(f)}),X(this,"_handleUserOnline",o=>{if(ve("BLOCK_LOCAL_CLIENT")&&d_(o.uid,this.channelName))return void z.debug("[".concat(o.uid,"] will be ignored in local"));this.isStringUID&&typeof o.uid!="string"&&z.error("[".concat(this._clientId,"] StringUID is Mixed with UintUID"));let c=this._users.find(f=>f.uid===o.uid);if(c)c._trust_in_room_=!0,c._is_pre_created&&(c._is_pre_created=!1,this.safeEmit(Gn.USER_JOINED,c));else{let f=new i1(o.uid,o.uint_id||o.uid);this._users.push(f),z.debug("[".concat(this._clientId,"] user online"),o.uid),this.safeEmit(Gn.USER_JOINED,f)}}),X(this,"_handleUserOffline",o=>{if(ve("BLOCK_LOCAL_CLIENT")&&d_(o.uid,this.channelName))return;let c=this._users.find(f=>f.uid===o.uid);c&&(this._handleRemoveStream(o),this._handleRemoveDataChannels(o),c._audio_pre_subscribed||c._video_pre_subscribed?c._is_pre_created=!0:ok(this._users,c),this._remoteStreamTypeCacheMap.delete(c.uid),this._streamFallbackTypeCacheMap.delete(c.uid),z.debug("[".concat(this._clientId,"] user offline"),o.uid,"reason:",o.reason),this.safeEmit(Gn.USER_LEAVED,c,o.reason))}),X(this,"_handleAddAudioOrVideoStream",(o,c,f,g,v,w,T)=>{if(ve("BLOCK_LOCAL_CLIENT")&&d_(c,this.channelName))return;let R=this._users.find(L=>L.uid===c);if(!R)return void z.error("[".concat(this._clientId,"] can not find target user!(on_add_stream)"));z.debug("[".concat(this._clientId,"] stream added with uid ").concat(c,", type ").concat(o)),this.store.subscribe(R.uid,o,void 0,void 0,void 0,Date.now());let A=o==="audio"?R.hasAudio:R.hasVideo;R._uintid||(R._uintid=v||c),o==="audio"?R._trust_audio_stream_added_state_=!0:R._trust_video_stream_added_state_=!0,o==="audio"?(R._audio_added_=!0,f!==void 0&&(R._audioSSRC=f),g!==void 0&&(R._cname=g),w&&(R._audioOrtc=w)):(R._video_added_=!0,f!==void 0&&(R._videoSSRC=f),g!==void 0&&(R._cname=g),T!==void 0&&(R._rtxSsrcId=T),w&&(R._videoOrtc=w)),(o==="audio"?R.hasAudio:R.hasVideo)&&!A&&(z.info("[".concat(this._clientId,"] remote user ").concat(R.uid," published ").concat(o)),this.safeEmit(Gn.USER_PUBLISHED,R,o)),o==="video"?$t.onGatewayStream(this._sessionId,Is.ON_ADD_VIDEO_STREAM,fr.ON_ADD_VIDEO_STREAM,{peer:v||c,ssrc:R._videoSSRC}):$t.onGatewayStream(this._sessionId,Is.ON_ADD_AUDIO_STREAM,fr.ON_ADD_AUDIO_STREAM,{peer:v||c,ssrc:R._audioSSRC}),this._p2pChannel.remoteMediaSsrcChanged(R,o,f).then(L=>{if(L&&(z.debug("[".concat(this._clientId,"] resubscribe ").concat(o," for user ").concat(R.uid," after rejoin because SSRC id changed.")),this._p2pChannel instanceof y8))return this._p2pChannel.unsubscribe(R,o,!0).then(()=>this._subscribe(R,o,!0).catch(U=>{z.error("[".concat(this._clientId,"] resubscribe error"),U.toString())}))}),this._p2pChannel.hasPendingRemoteMedia(R,o)&&(z.debug("[".concat(this._clientId,"] resubscribe ").concat(o," for user ").concat(R.uid," after reconnect.")),this._subscribe(R,o,!0).catch(L=>{z.error("[".concat(this._clientId,"] resubscribe error"),L.toString())}))}),X(this,"_handleRemoveStream",o=>{if(ve("BLOCK_LOCAL_CLIENT")&&d_(o.uid,this.channelName))return;let c=this._users.find(g=>g.uid===o.uid);if(!c)return void z.warning("[".concat(this._clientId,"] can not find target user!(on_remove_stream)"));z.debug("[".concat(this._clientId,"] stream removed with uid ").concat(o.uid));let f=()=>{};c.hasAudio&&c.hasVideo?f=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished audio track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"audio"),z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished video track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"video")}:c.hasVideo?f=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished video track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"video")}:c.hasAudio&&(f=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished audio track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"audio")}),c._video_pre_subscribed||c._audio_pre_subscribed||(c._trust_audio_stream_added_state_=!0,c._trust_video_stream_added_state_=!0,c._audio_added_=!1,c._video_added_=!1,this._p2pChannel instanceof y8&&this._p2pChannel.unsubscribe(c).then(g=>{if(g)return this._gateway.unsubscribe(g,c.uid)}),c._audioSSRC=void 0,c._videoSSRC=void 0,c._audioOrtc=void 0,c._videoOrtc=void 0,c._rtxSsrcId=void 0),$t.onGatewayStream(this._sessionId,Is.ON_REMOVE_STREAM,fr.ON_REMOVE_STREAM,{peer:o.uint_id||o.uid}),f()}),X(this,"_handleSetStreamLocalEnable",(o,c,f)=>{if(ve("BLOCK_LOCAL_CLIENT")&&d_(c,this.channelName))return;let g=this._users.find(T=>T.uid===c);if(!g)return void z.error("[".concat(this._clientId,"] can not find target user!(disable_local)"));z.debug("[".concat(this._clientId,"] local ").concat(o," ").concat(f?"enabled":"disabled"," with uid ").concat(c));let v=o==="audio"?g.hasAudio:g.hasVideo;if(o==="audio"){g._trust_audio_enabled_state_=!0;let T=g._audio_enabled_;if(g._audio_enabled_=f,g._audio_enabled_===T)return;{let R=g._audio_enabled_?"enable-local-audio":"disable-local-audio";z.debug("[".concat(this._clientId,"] user-info-updated, uid: ").concat(c,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,c,R)}}else{g._trust_video_enabled_state_=!0;let T=g._video_enabled_;if(g._video_enabled_=f,g._video_enabled_===T)return;{let R=g._video_enabled_?"enable-local-video":"disable-local-video";z.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(c,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,c,R)}}let w=o==="audio"?g.hasAudio:g.hasVideo;return v!==w?!v&&w?(z.info("[".concat(this._clientId,"] remote user ").concat(c," published ").concat(o)),void this.safeEmit(Gn.USER_PUBLISHED,g,o)):(o==="video"&&g._videoTrack&&g._videoTrack._destroy(),o==="audio"&&g._audioTrack,this._p2pChannel.muteRemote(g,o),z.info("[".concat(this._clientId,"] remote user ").concat(c," unpublished ").concat(o)),void this.safeEmit(Gn.USER_UNPUBLISHED,g,o)):void 0}),X(this,"_handleMuteStream",(o,c,f)=>{if(ve("BLOCK_LOCAL_CLIENT")&&d_(o,this.channelName))return;z.debug("[".concat(this._clientId,"] receive mute message"),o,c,f);let g=this._users.find(T=>T.uid===o);if(!g)return void z.warning("[".concat(this._clientId,"] can not find remote user, ignore mute event, uid: ").concat(o));let v=c==="audio"?g.hasAudio:g.hasVideo;if(c==="audio"){g._trust_audio_mute_state_=!0;let T=g._audio_muted_;if(g._audio_muted_=f,g._audio_muted_===T)return;{let R=g._audio_muted_?"mute-audio":"unmute-audio";z.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(o,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,o,R)}}else{g._trust_video_mute_state_=!0;let T=g._video_muted_;if(g._video_muted_=f,g._video_muted_===T)return;{let R=g._video_muted_?"mute-video":"unmute-video";z.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(o,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,o,R)}}let w=c==="audio"?g.hasAudio:g.hasVideo;if(v!==w){if(!v&&w)return(c==="audio"?g._audioSSRC:g._videoSSRC)?(z.info("[".concat(this._clientId,"] remote user ").concat(o," published ").concat(c)),void this.safeEmit(Gn.USER_PUBLISHED,g,c)):void z.warning("[".concat(this._clientId,"] remote user ").concat(o," receive ").concat(c," unmute message before add stream message, ").concat(c," SSRC doesn't exist yet."));c==="video"&&g._videoTrack&&!g._video_pre_subscribed&&g._videoTrack._destroy(),c==="audio"&&g._audioTrack,this._p2pChannel.muteRemote(g,c),z.info("[".concat(this._clientId,"] remote user ").concat(o," unpublished ").concat(c)),this.safeEmit(Gn.USER_UNPUBLISHED,g,c)}}),X(this,"_handleP2PLost",async o=>{z.debug("[".concat(this._clientId,"] receive p2p lost"),o),parseInt(o.p2pid,10)===this.store.p2pId?await this._p2pChannel.requestReconnect():z.warning("[".concat(this._clientId,"] P2PLost stream not found"),o)}),X(this,"_handleTokenWillExpire",()=>{z.debug("[".concat(this._clientId,"] received message onTokenPrivilegeWillExpire")),this.safeEmit(Gn.ON_TOKEN_PRIVILEGE_WILL_EXPIRE)}),X(this,"_handleBeforeUnload",o=>{o.type==="beforeunload"&&o.returnValue!==void 0&&o.returnValue!==""||(this.leave(),z.info("[".concat(this._clientId,"] auto leave onbeforeunload or pagehide")))}),X(this,"_handleUpdateNetworkQuality",()=>{if(this._networkQualitySensitivity==="normal")return;if(navigator&&navigator.onLine!==void 0&&!navigator.onLine)return void this.safeEmit(Gn.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6});let o={downlinkNetworkQuality:0,uplinkNetworkQuality:0};o.uplinkNetworkQuality=this._p2pChannel.getUplinkNetworkQuality(),o.downlinkNetworkQuality=this._p2pChannel.getDownlinkNetworkQuality(),this.safeEmit(Gn.NETWORK_QUALITY,o)}),X(this,"_handleP2PAddAudioOrVideoStream",(o,c,f,g)=>{let v=this._users.find(T=>T.uid===c);if(!v)return void z.error("[".concat(this._clientId,"] can not find target user!(on_add_stream)"));z.debug("[".concat(this._clientId,"] stream added with uid ").concat(c,", type ").concat(o)),this.store.subscribe(v.uid,o,void 0,void 0,void 0,Date.now());let w=o==="audio"?v.hasAudio:v.hasVideo;o==="audio"?v._trust_audio_stream_added_state_=!0:v._trust_video_stream_added_state_=!0,o==="audio"?(v._audio_added_=!0,f!==void 0&&(v._audioSSRC=f),g!==void 0&&(v._audioMid=g)):(v._video_added_=!0,f!==void 0&&(v._videoSSRC=f),g!==void 0&&(v._videoMid=g)),(o==="audio"?v.hasAudio:v.hasVideo)&&!w&&(z.info("[".concat(this._clientId,"] remote user ").concat(v.uid," published ").concat(o)),this.safeEmit(Gn.USER_PUBLISHED,v,o)),this._p2pChannel.hasPendingRemoteMedia(v,o)&&(z.debug("[".concat(this._clientId,"] resubscribe ").concat(o," for user ").concat(v.uid," after reconnect.")),this._subscribe(v,o,!0).catch(T=>{z.error("[".concat(this._clientId,"] resubscribe error"),T.toString())}))}),this._config=r,this._clientId=Li(5,"client-"),this.store=new Vxe(r.codec,r.audioCodec,r.mode,this._clientId),this.store.clientCreated(),r.proxyServer&&this.setProxyServer(r.proxyServer,!0),r.turnServer&&this.setTurnServer(r.turnServer,!0),z.info("[".concat(this._clientId,"] Initializing AgoraRTC client v").concat(pd," build: ").concat(TG,", mode: ").concat(this.mode,", codec: ").concat(this.codec)),r.clientRoleOptions)try{Cie(r.clientRoleOptions),a=Object.assign({},r.clientRoleOptions)}catch(o){z.warning("[".concat(this._clientId,"] ").concat(o.toString()))}this._statsCollector=new b3(this.store),this._statsCollector.onStatsException=(o,c,f)=>{z.debug("[".concat(this._clientId,"] receive exception msg, code: ").concat(o,", msg: ").concat(c,", uid: ").concat(f)),this.safeEmit(Gn.EXCEPTION,{code:o,msg:c,uid:f})},this._statsCollector.onUploadPublishDuration=(o,c,f,g)=>{let v=this._users.find(w=>w.uid===o);v&&$t.peerPublishStatus(this._sessionId,{subscribeElapse:g,audioPublishDuration:c,videoPublishDuration:f,peer:v._uintid})},this.store.useDataChannel=Jn().supportDataChannel&&ve("SIGNAL_CHANNEL"),this.store.useP2P=r.mode==="p2p",this._gateway=new JAe(this.store,{clientId:this._clientId,mode:this.mode,codec:this.codec,websocketRetryConfig:r.websocketRetryConfig||Mr,httpRetryConfig:r.httpRetryConfig||Mr,forceWaitGatewayResponse:r.forceWaitGatewayResponse===void 0||r.forceWaitGatewayResponse,statsCollector:this._statsCollector,role:r.role,clientRoleOptions:a}),this._configDistribute=new oIe,this.store.useP2P?(this._p2pChannel=new Hl(this.store,this._statsCollector),this._handleP2PEvents()):this._p2pChannel=new y8(this.store,this._statsCollector),this._handleP2PChannelEvents(),this._handleGatewayEvents(),this._handleGatewaySignalEvents()}async joinMeta(r,a,o,c,f){let g=!(arguments.length>5&&arguments[5]!==void 0)||arguments[5],v=arguments.length>6&&arguments[6]!==void 0&&arguments[6];Ri("JOIN_GATEWAY_USE_443PORT_ONLY",g),Ri("JOIN_GATEWAY_USE_DUAL_DOMAIN",v);let w=this._gateway.signal.websocket;return w instanceof HI&&(w.use443PortOnly=g,w.tryDoubleDomain=v),async function(T,R,A){nk.get(T)||nk.set(T,[]),ik.get(T)||ik.set(T,R),Vf.get(T)||Vf.set(T,0);let L=nk.get(T),U=ik.get(T);if(!L||!U)throw new Error("concurrent: deferQueue or maxConcurrency is null");if(Vf.get(T)===U){let oe=kI();L.push(oe),await oe.promise}Vf.set(T,Vf.get(T)+1);for(var F=arguments.length,Z=new Array(F>3?F-3:0),W=3;W<F;W++)Z[W-3]=arguments[W];let K=await A(...Z);return Vf.set(T,Vf.get(T)-1),Vf.get(T)===U-1&&L.length>0&&(L[0].resolve(),L.shift()),Vf.get(T)===0&&(nk.set(T,[]),ik.set(T,0),Vf.set(T,0)),K}("client.join",ve("JOIN_MAX_CONCURRENCY"),this.join.bind(this),r,a,o,c,f)}async join(r,a,o,c,f){let g=++this._numberOfJoinCount;this.store.joinStart(),c&&(this.store.uid=c);let v=(hk||hk||(hk=(window.location.protocol.split(":")[0]||"").toUpperCase(),hk))==="HTTPS",w=Die()?window.isSecureContext:"Browser Not Support";(!Die()&&!v||!window.isSecureContext)&&z.warning("The website must be running in a secure context (About secure context: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts ), otherwise the media collection will be restricted by the browser"),this.connectionState==="DISCONNECTED"&&(this.store.avoidJoinStart=Math.round(Date.now()),z.debug("[".concat(this._clientId,"] set avoidJoinStart to ").concat(this.store.avoidJoinStart))),$t.setAppId(r);try{if(!o&&o!==null)throw new De(ce.INVALID_PARAMS,"Invalid token: ".concat(o,". If you don not use token, set it to null"));o&&Fs(o,"token",1,2047),Fs(r,"appid",1,2047),gk(a),c&&vk(c),f&&Fs(f,"optionalInfo",1,2047)}catch(W){throw $t.reportApiInvoke(FI(),{name:qr.JOIN,options:[r,a,o,c],states:{isHttps:v,isSecureContext:w},tag:vr.TRACER}).onError(W),W}let T=await Oce({appId:r,cname:a,uid:c,stringUid:typeof c=="string"?c:void 0,token:o||r,cloudProxyServer:this._cloudProxyServerMode}),R=(T==null?void 0:T.sid)||FI(),A=$t.reportApiInvoke(R,{name:qr.JOIN,options:[r,a,o,c],states:{isHttps:v,isSecureContext:w},tag:vr.TRACER});if(z.info("[".concat(this._clientId,"] start join channel ").concat(a,", join number: ").concat(g)),this._leaveMutex.isLocked&&(z.debug("[".concat(this._clientId,"] join: waiting leave operation")),(await this._leaveMutex.lock())(),z.debug("[".concat(this._clientId,"] join: continue"))),this._joinAndNotLeaveYet=!0,this.connectionState!=="DISCONNECTED"){let W=new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already in connecting/connected state"));throw A.onError(W),W}this._sessionId||(this._sessionId=R,this.store.sessionId=this._sessionId),this._gateway.state="CONNECTING";let L=Sd(Sd({},this._rtmConfig),{},{clientId:this._clientId,appId:r,sid:this._sessionId,cname:a,uid:typeof c!="string"?c:null,turnServer:this._turnServer,proxyServer:this._proxyServer,token:o||r,cloudProxyServer:this._cloudProxyServerMode,optionalInfo:f,license:this._license,useLocalAccessPoint:this._useLocalAccessPoint,preload:!!T},this._remoteDefaultVideoStreamType!==void 0&&{defaultVideoStream:this._remoteDefaultVideoStreamType});if(this._useLocalAccessPoint&&(L.setLocalAPVersion=this._setLocalAPVersion),typeof c=="string"&&(L.stringUid=c,this._uintUid?(L.uid=this._uintUid,this._uintUid=void 0):L.uid=0),this._encryptionMode!=="none"&&this._encryptionSecret){if(L.aesmode=this._encryptionMode,L.aespassword=await(async W=>{let K=function(Ne){let ke=window.atob(`MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCMnXAHkKIGAM+x4N22gCI+Wyu
STM9ztkT3uYslTT2PuKmZfPzhH6kVdO7PTjGCOZnAsyb3oTtWat0KcxQ4jxvqQV+
HvYl3iI1Yd4vl2c3qRMJPLtRDfNxa2Mcxgq7e9aEUibzdd0st+OJAy3tOj/Y0aVy
xQiYDz3vqa6bP29adwIDAQAB`),He=new Uint8Array(new ArrayBuffer(ke.length));for(let lt=0;lt<ke.length;lt+=1)He[lt]=ke.charCodeAt(lt);return He}(),oe=await window.crypto.subtle.importKey("spki",K,{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),ue=gG(W),xe=await window.crypto.subtle.encrypt({name:"RSA-OAEP"},oe,ue);return function(Ne){let ke="";for(let He=0;He<Ne.length;He+=1)ke+=String.fromCharCode(Ne[He]);return window.btoa(ke)}(new Uint8Array(xe))})(this._encryptionSecret),!this._joinAndNotLeaveYet)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this._encryptionSalt&&(L.aessalt=this._encryptionSalt)}if(this._encryptDataStream&&(this._encryptionMode==="aes-128-gcm2"||this._encryptionMode==="aes-256-gcm2"))if(this._encryptionSalt&&this._encryptionSecret)if(window.crypto.subtle){let W=new TextEncoder,K=ve("USE_PURE_ENCRYPTION_MASTER_KEY")?W.encode(L.appId+this._encryptionSecret+this._encryptionSecret):W.encode(L.appId+L.cname+this._encryptionSecret);this._encryptDataStreamIv=await async function(oe,ue,xe){let Ne=await window.crypto.subtle.importKey("raw",ue,"PBKDF2",!1,["deriveBits","deriveKey"]),ke=oe==="aes-128-gcm2"?128:256,He=await window.crypto.subtle.deriveBits({name:"PBKDF2",iterations:Mie,hash:"SHA-256",salt:xe},Ne,ke+zxe);return new Uint8Array(He).subarray(ke/8)}(this._encryptionMode,K,l_(this._encryptionSalt)),this._encryptDataStreamKey=await async function(oe,ue,xe){let Ne=await window.crypto.subtle.importKey("raw",ue,"PBKDF2",!1,["deriveBits","deriveKey"]),ke=oe==="aes-128-gcm2"?128:256;return await window.crypto.subtle.deriveKey({name:"PBKDF2",iterations:Mie,hash:"SHA-256",salt:xe},Ne,{name:"AES-GCM",length:ke},!0,["encrypt","decrypt"])}(this._encryptionMode,K,l_(this._encryptionSalt))}else w?z.warning("[".concat(this._clientId,"] encrypt datastream must be running in a secure context, fallback to plain data stream")):z.warning("[".concat(this._clientId,"] current browser do not support WebCrypto ,fallback to plain data stream")),this._encryptDataStream=!1;else this._encryptDataStream=!1,z.debug("[".concat(this._clientId,"] no salt / secret, cannot support encrypt data stream, fallback to plain data stream"));this._startSession(this._sessionId,{channel:a,appId:r,stringUid:L.stringUid,preload:L.preload});let U=this._sessionId;setTimeout(()=>{this.connectionState==="CONNECTING"&&U===this._sessionId&&$t.joinChannelTimeout(this._sessionId,5)},5e3);try{var F;let W,K=L.cloudProxyServer;if(Tt(F=["proxy3","proxy4","proxy5"]).call(F,K)){let ke=ve("PROXY_SERVER_TYPE3");Array.isArray(ke)?L.proxyServer=ke[0]:L.proxyServer=ke}if($t.setProxyServer(L.proxyServer),z.setProxyServer(L.proxyServer),this.store.requestAPStart(),T){if(z.debug("[".concat(this._clientId,"] get serverInfo Success from Preload Cache ").concat(L.stringUid?", ".concat(L.stringUid," => ").concat(T.intUid):""," ")),L.stringUid&&!L.uid&&(L.uid=T.intUid),W={gatewayInfo:T.ap.gatewayInfo},ve("JOIN_WITH_FALLBACK_MEDIA_PROXY")&&L.turnServer.mode==="auto")if(T.ap.proxyInfo.addresses.length===0)z.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers");else{let ke=(await lre(T.ap.proxyInfo,T.ap.gatewayInfo.uid)).map(He=>({turnServerURL:He.address,tcpport:He.tcpport||Js.tcpport,udpport:He.udpport||Js.udpport,username:He.username||Js.username,password:He.password||Js.password,forceturn:!1,security:!0}));L.turnServer={mode:"manual",servers:ke}}Dce(T,L.stringUid)}else{if(L.stringUid&&!L.uid){let ke;[ke,W]=await Ct.all([wre(L.stringUid,L,this._axiosCancelSource.token,this._config.httpRetryConfig||Mr,this.store),Ere(L,this._axiosCancelSource.token,this._config.httpRetryConfig||Mr,!0,this.store)]),z.debug("[".concat(this._clientId,"] getUserAccount Success ").concat(L.stringUid," => ").concat(ke)),L.uid=ke,W.gatewayInfo.uid=ke,W.gatewayInfo.res.uid=ke}else W=await Ere(L,this._axiosCancelSource.token,this._config.httpRetryConfig||Mr,!0,this.store);if(!this._joinAndNotLeaveYet)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"))}this.store.requestAPEnd(),setTimeout(()=>{this._configDistribute.startGetConfigDistribute(L,this._axiosCancelSource.token),this._configDistribute.on(kG.UPDATE_BITRATE_LIMIT,ke=>{this._p2pChannel.updateBitrateLimit(ke)})},0),this._key=o||r;let oe=W.gatewayInfo,ue=L.uid?L.uid:oe.uid;this._joinInfo=Sd(Sd({},L),{},{cid:oe.cid,uid:ue,vid:oe.vid,apResponse:oe.res,uni_lbs_ip:oe.uni_lbs_ip,gatewayAddrs:oe.gatewayAddrs}),this.store.intUid=ue;let xe=await this._joinGateway();if(!this._joinAndNotLeaveYet)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));A.onSuccess(xe),this._appId=r,this._channelName=L.cname,this._uid=xe,this.store.uid=xe,setTimeout(()=>{this._networkQualityInterval&&window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=window.setInterval(this._handleUpdateNetworkQuality,2e3),window.addEventListener(ys()?"beforeunload":"pagehide",this._handleBeforeUnload),this._statsCollector.startUpdateStats()},0);let Ne=L.stringUid?"string uid: ".concat(L.stringUid,",uid: ").concat(L.uid):"uid: ".concat(this._uid);return z.info("[".concat(this._clientId,"] Joining channel success: channel: ").concat(a,",").concat(Ne)),setTimeout(()=>{z.startUpload()},5e3),this.store.joinEnd(),Z=this,Tt(H0).call(H0,Z)||H0.push(Z),this._cloudProxyServerMode==="disabled"&&Jn().supportWebCrypto&&ve("ENABLE_PRELOAD")&&R$(this._joinInfo),xe}catch(W){let K=Array.isArray(W)?W[0]:W;throw K&&K.code===ce.OPERATION_ABORTED?z.warning("[".concat(this._clientId,"] join number: ").concat(g,", Joining channel failed, rollback"),K):z.error("[".concat(this._clientId,"] join number: ").concat(g,", Joining channel failed, rollback"),K),K.code!==ce.OPERATION_ABORTED&&this._numberOfJoinCount===g&&(this._gateway.state="DISCONNECTED",this._reset()),A.onError(K),K}var Z}_joinGateway(){if(!this._joinInfo||!this._key)throw new De(ce.INVALID_OPERATION);return this._gateway.join(this._joinInfo,this._key,!(this._joinInfo.cloudProxyServer!=="disabled"||this._joinInfo.proxyServer||!ve("JOIN_WITH_FALLBACK_SIGNAL_PROXY"))).then(r=>r).catch(r=>{if(r.code===ce.INIT_WEBSOCKET_TIMEOUT)return this._gateway.leave(!0,Hn.FALLBACK),r;if(r.code===ce.INIT_DATACHANNEL_TIMEOUT)return this._gateway.leave(!0,Hn.FALLBACK),r;throw r}).then(r=>{if(r instanceof De){if(r.code===ce.INIT_WEBSOCKET_TIMEOUT){if(z.info("[".concat(this._clientId,"] join timeout, fallback to proxy")),!this._joinInfo||!this._key)throw new De(ce.INVALID_OPERATION);this._joinInfo.cloudProxyServer="fallback",this._cloudProxyServerMode="fallback",this.store.cloudProxyServerMode="fallback";let a=ve("PROXY_SERVER_TYPE3");if(Array.isArray(a))if(this._joinInfo.apUrl){let c=/^https?:\/\/(.+?)(\/.*)?$/.exec(this._joinInfo.apUrl)[1].split("."),f=c.slice(c.length-2).join(".");a.forEach(g=>{this._joinInfo&&Tt(g).call(g,f)&&(this._joinInfo.proxyServer=g)}),this._joinInfo.proxyServer||(this._joinInfo.proxyServer=a[0])}else this._joinInfo.proxyServer=a[0];else this._joinInfo.proxyServer=a;let o=ve("LOG_UPLOAD_SERVER").match(/.+:(\d{1,5})$/);return o&&o[1]&&o[1]!=="443"&&z.setProxyServer(this._joinInfo.proxyServer),ve("STATS_COLLECTOR_PORT").toString()!=="443"&&$t.setProxyServer(this._joinInfo.proxyServer),$t.reportApiInvoke(this._sessionId,{name:qr.JOIN_FALLBACK_TO_PROXY,options:[this._joinInfo.proxyServer],tag:vr.TRACER}).onSuccess(),this.safeEmit(Gn.JOIN_FALLBACK_TO_PROXY,this._joinInfo.proxyServer),ve("JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE")&&this._joinInfo.turnServer.servers.forEach(c=>{"forceturn"in c&&(c.forceturn=!0)}),this._gateway.join(this._joinInfo,this._key)}if(z.info("[".concat(this._clientId,"] join by datachannel timeout, fallback to websocket")),!this._joinInfo||!this._key)throw new De(ce.INVALID_OPERATION);return $t.reportApiInvoke(this._sessionId,{name:qr.DATACHANNEL_FAILBACK,options:[this.store.clientId],tag:vr.TRACER}).onSuccess(),this._joinGateway()}return r}).then(r=>r)}async leave(){z.info("[".concat(this._clientId,"] Leaving channel")),window.removeEventListener(ys()?"beforeunload":"pagehide",this._handleBeforeUnload),this._reset(),function(a){let o=H0.indexOf(a);o!==-1&&H0.splice(o,1)}(this),this._statsCollector.stopUpdateStats();let r=await this._leaveMutex.lock();if(this.connectionState==="DISCONNECTED")return z.info("[".concat(this._clientId,"] Leaving channel repeated, success")),void r();await this._gateway.leave(this.connectionState!=="CONNECTED"),z.info("[".concat(this._clientId,"] Leaving channel success")),this._joinAndNotLeaveYet=!1,this.store.resetJoinChannelServiceRecords(),r()}async publish(r){let a=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!Array.isArray(r)){if(!(r instanceof Pb))return this._publishDataChannel(r);r=[r]}if(r.length===0)throw new De(ce.INVALID_PARAMS,"param list is empty");let o=r;if(this._gateway.role==="audience")throw new De(ce.INVALID_OPERATION,"audience can not publish stream");for(let f of o){if(!(f instanceof Pb))throw new De(ce.INVALID_PARAMS,"parameter is not local track");if(!f._enabled&&a)throw new De(ce.TRACK_IS_DISABLED,"can not publish a disabled track: ".concat(f.getTrackId()))}z.info("[".concat(this._clientId,"] Publishing tracks, id ").concat(o.map(f=>"".concat(f.getTrackId()," "))));let c=await this._publishMutex.lock();await this._configDistribute.awaitConfigDistributeComplete(),a&&o.forEach(f=>{let g=this._configDistribute.getBitrateLimit();f instanceof Di&&g&&f.setBitrateLimit(g.uplink)});try{await this._publishHighStream(o),z.info("[".concat(this._clientId,"] Publish success, id ").concat(o.map(f=>"".concat(f.getTrackId()," "))))}catch(f){throw z.error("[".concat(this._clientId,"] publish error"),f.toString()),f}finally{c()}}async _publishDataChannel(r){Ti(r.id,"id",0,65535,!0),Sm(r.ordered,"ordered"),Fs(r.metadata,"metadata",0,512),z.info("[".concat(this._clientId,"] Publishing datachannels, id ").concat(r.id));let a=await this._publishMutex.lock();try{if(this._p2pChannel.getAllDataChannels().findIndex(c=>c.id===r.id)!==-1)throw new De(ce.INVALID_PARAMS,"Invalid id: ".concat(r.id,". If you want to republish the datachannel, unpublish first"));if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't publish datachannel, haven't joined yet!");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish datachannel in ".concat(this.connectionState," state"));if(this._turnServer.mode==="auto"&&ve("FORCE_TURN")&&!ve("TURN_ENABLE_TCP")&&!ve("TURN_ENABLE_UDP"))throw new De(ce.UNEXPECTED_ERROR,"force TURN With No TURN Configuration");let o=new qoe(r);if(await this._p2pChannel.publishDataChannel([o]),!this._p2pChannel.isP2PDisconnected()){if(typeof o._originDataChannelId!="number")throw z.error("[".concat(this._clientId,"] can not publish with mediaType datachannel, cannot get RTCDatachannel id")),new De(ce.CREATE_DATACHANNEL_ERROR);try{let c={streamId:r.id,ordered:r.ordered,maxRetransmits:ve("DATASTREAM_MAX_RETRANSMITS"),metadata:r.metadata,channelId:o._originDataChannelId};await this._gateway.publishDataChannel(this._uid,c,!0),await o._waitTillOpen()}catch(c){if(c.code!==ce.DISCONNECT_P2P)throw c}}return z.info("[".concat(this._clientId,"] Publish dataChannels success, id ").concat(o.id)),o}catch(o){throw z.error("[".concat(this._clientId,"] publish datachannels error"),o.toString()),o}finally{a()}}async unpublish(r){if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't unpublish stream, haven't joined yet!");let a=[];if(r)if(Array.isArray(r))a=r;else{if(!(r instanceof Pb))return this._unpublishDataChannel([r]);a=[r]}else this.store.useP2P||await this._unpublishDataChannel(),a=this._p2pChannel.getAllTracks(!0);z.info("[".concat(this._clientId,"] Unpublish tracks, tracks ").concat(a.map(c=>"".concat(c.getTrackId()," "))," "));let o=await this._publishMutex.lock();try{if(this._p2pChannel instanceof Hl){let c=await this._p2pChannel.unpublish(a);c&&await this._gateway.sendExtensionMessage(Nr.UNPUBLISH,{unpubMsg:c},!0)}else{let c=await this._p2pChannel.unpublish(a);c&&await this._gateway.unpublish(c,this._uid),z.info("[".concat(this._clientId,"] Unpublish success,tracks ").concat(a.map(f=>"".concat(f.getTrackId()))))}}catch(c){throw z.error("[".concat(this._clientId,"] unpublish error"),c.toString()),c}finally{o&&o()}}async _unpublishDataChannel(r){r!==void 0&&r.length!==0||(r=this._p2pChannel.getAllDataChannels()),z.info("[".concat(this._clientId,"] Unpublish datachannels, datachannels ").concat(r.map(o=>"".concat(o.id," "))," "));let a=await this._publishMutex.lock();try{let o=await this._p2pChannel.unpublishDataChannel(r);o&&await this._gateway.unpublishDataChannel(o),z.info("[".concat(this._clientId,"] Unpublish dataChannel success,dataChannel ").concat(r.map(c=>"".concat(c.id))))}catch(o){throw z.error("[".concat(this._clientId,"] unpublish dataChannel error"),o.toString()),o}finally{a&&a()}}async subscribe(r,a,o){if(!(r instanceof i1)){let c=this.remoteUsers.find(f=>f.uid===r);if(!c)throw new De(ce.INVALID_REMOTE_USER,"user is not in the channel");r=c}return a==="datachannel"?this._subscribeDataChannel(r,o):this._subscribe(r,a)}async presubscribe(r,a){if(ls(a,"mediaType",["audio","video"]),this._p2pChannel instanceof Hl)throw new De(ce.INVALID_OPERATION,"can't presub at p2p mode");if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can't presub when not join");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can't presub in ".concat(this.connectionState," state"));let o=a===Wt.AUDIO,c=a===Wt.VIDEO,f=await this._subscribeMutex.lock();try{let{ssrcId:g,ortc:v,rtxSsrcId:w,cname:T,uint_id:R}=await this._gateway.presubscribe(r,a,!0);if(g==null)throw new De(ce.UNEXPECTED_RESPONSE,"no ssrc id");let A=this._users.find(U=>U.uid===r);A||(A=new i1(r,R||r),A._is_pre_created=!0,this._users.push(A)),T&&(A._cname=T),A._uintid||(A._uintid=R||r),o&&(A._audioSSRC=g,A._audio_pre_subscribed=!0,v&&(A._audioOrtc=v)),c&&(A._videoSSRC=g,A._video_pre_subscribed=!0,v&&(A._videoOrtc=v),w!=null&&(A._rtxSsrcId=w)),z.info("[".concat(this._clientId,"] presub succeed ssrc: ").concat(g)),await this._p2pChannel.subscribe(A,a,g,w,v);let L=o?A._audioTrack:A._videoTrack;if(!L)throw new De(ce.UNEXPECTED_ERROR,"can not find remote track in user");return o&&(A._trust_audio_stream_added_state_=!0,A._audio_added_=!0),c&&(A._trust_video_stream_added_state_=!0,A._video_added_=!0),L}catch(g){throw z.error("[".concat(this._clientId,"] presub user ").concat(r," error"),g),g}finally{f()}}async _subscribeDataChannel(r,a){var o;if(Ti(a,"channelId",0,65535,!0),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe datachannel, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe datachannel in ".concat(this.connectionState," state"));if(!this._users.find(v=>v===r))throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", this user is not in the channel")),new De(ce.INVALID_REMOTE_USER,"user is not in the channel");if(!r.hasAudio&&!r.hasVideo&&r._dataChannels.length===0)throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not published")),new De(ce.INVALID_REMOTE_USER,"user is not published");let c=(o=r._dataChannels)===null||o===void 0?void 0:o.find(v=>v.id===a);if(!c)throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType datachannel, remote datachannel is not published")),new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);let f=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"] subscribe user ").concat(r.uid,", mediaType: datachannel"));try{let v=await this._p2pChannel.subscribeDataChannel(r,[c]);if(v&&Tt(v).call(v,c.id))try{var g;if(typeof c._originDataChannelId!="number")throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType datachannel, cannot get RTCDatachannel")),new De(ce.CREATE_DATACHANNEL_ERROR);let w={id:c.id,datachannelId:c._originDataChannelId,ordered:c.ordered,maxRetransmits:c.maxRetransmits,metadata:(g=c.metadata)!==null&&g!==void 0?g:""};await this._gateway.subscribeDataChannel(r.uid,w,!0),await c._waitTillOpen()}catch(w){if((w==null?void 0:w.code)!==ce.WS_ABORT)throw await this._p2pChannel.unsubscribeDataChannel(r,[c]),w;await this._p2pChannel.unsubscribeDataChannel(r,[c]),this._p2pChannel.setPendingRemoteDataChannel(r,c.id)}return z.info("[".concat(this._clientId,"] subscribe success user ").concat(r.uid,", mediaType: datachannel")),c}finally{f()}}async _p2pSubscribe(r,a,o){if(ls(a,"mediaType",["audio","video"]),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe stream, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));if(!this._users.find(f=>f===r)){let f=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", this user is not in the channel")),f}if(!r.hasAudio&&!r.hasVideo){let f=new De(ce.INVALID_REMOTE_USER,"user is not published");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not published")),f}if(!o&&(a==="audio"&&!r.hasAudio||a==="video"&&!r.hasVideo)){let f=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType ").concat(a,", remote track is not published")),f}let c=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"] subscribe user ").concat(r.uid,", mediaType: ").concat(a));try{if(await this._p2pChannel.hasRemoteMediaWithLock(r,a))await this._p2pChannel.unmuteRemote(r,a);else try{let g=a==="audio"?r._audioSSRC:r._videoSSRC,v=a==="audio"?r._audioMid:r._videoMid;this.store.subscribe(r.uid,a,Date.now()),this._p2pChannel instanceof Hl&&await this._p2pChannel.subscribe(r,a,g,v)}catch(g){throw g}z.info("[".concat(this._clientId,"] subscribe success user ").concat(r.uid,", mediaType: ").concat(a)),this._defaultStreamFallbackType&&this.setStreamFallbackOption(r.uid,this._defaultStreamFallbackType).catch(g=>{z.warning("[".concat(this._clientId,"] auto set fallback failed"),g)});let f=a==="audio"?r._audioTrack:r._videoTrack;if(!f)throw new De(ce.UNEXPECTED_ERROR,"can not find remote track in user object");return f}catch(f){throw z.error("[".concat(this._clientId,"] subscribe user ").concat(r.uid," error"),f),f}finally{c()}}async _subscribe(r,a,o){if(this._p2pChannel instanceof Hl)return this._p2pSubscribe(r,a);if(ls(a,"mediaType",["audio","video"]),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe stream, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));if(!this._users.find(T=>T===r)){let T=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", this user is not in the channel")),T}if(!r.hasAudio&&!r.hasVideo){let T=new De(ce.INVALID_REMOTE_USER,"user is not published");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not published")),T}if(!(o||(a!=="audio"||r.hasAudio&&r._audioSSRC!==void 0)&&(a!=="video"||r.hasVideo&&r._videoSSRC!==void 0))){let T=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType ").concat(a,", remote track is not published")),T}let c=a==="audio"?r._audioSSRC:r._videoSSRC,f=a==="audio"?r._audioOrtc:r._videoOrtc,g=a==="video"?r._rtxSsrcId:void 0,v={stream_type:a==="audio"?Wt.AUDIO:Wt.VIDEO,ssrcId:c},w=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"] subscribe user ").concat(r.uid,", mediaType: ").concat(a));try{if(await this._p2pChannel.hasRemoteMediaWithLock(r,a))await this._p2pChannel.unmuteRemote(r,a);else try{let R=a==="audio"?r._audioSSRC:r._videoSSRC;R!==void 0&&R!==c&&(c=R,f=a==="audio"?r._audioOrtc:r._videoOrtc,g=a==="video"?r._rtxSsrcId:void 0,v={stream_type:a==="audio"?Wt.AUDIO:Wt.VIDEO,ssrcId:c}),ua.markSubscribeStart(this.store.clientId,c),this.store.subscribe(r.uid,a,Date.now()),await this._p2pChannel.subscribe(r,a,c,g,f);try{await this._gateway.subscribe(r.uid,v,!0)}catch(A){if((A==null?void 0:A.code)!==ce.WS_ABORT)throw await this._p2pChannel.unsubscribe(r,a),A;await this._p2pChannel.unsubscribe(r,a,!0),this._p2pChannel.setPendingRemoteMedia(r,a)}this.store.subscribe(r.uid,a,void 0,Date.now()),this._p2pChannel.reportSubscribeEvent(!0,null,r,a)}catch(R){throw this._p2pChannel.reportSubscribeEvent(!1,R==null?void 0:R.code,r,a),R}z.info("[".concat(this._clientId,"] subscribe success user ").concat(r.uid,", mediaType: ").concat(a)),this._defaultStreamFallbackType&&this.setStreamFallbackOption(r.uid,this._defaultStreamFallbackType).catch(R=>{z.warning("[".concat(this._clientId,"] auto set fallback failed"),R)});let T=a==="audio"?r._audioTrack:r._videoTrack;if(!T)throw new De(ce.UNEXPECTED_ERROR,"can not find remote track in user object");return T}catch(T){throw z.error("[".concat(this._clientId,"] subscribe user ").concat(r.uid," error"),T),T}finally{w()}}async massSubscribe(r){if(bm(r,"subscribeList"),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe stream, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));let a=Date.now(),o=new Map,c=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"]start massSubscribe user ").concat(r.map(w=>{let{user:T,mediaType:R}=w;return"user: ".concat(T==null?void 0:T.uid,", mediaType: ").concat(R)}).join("; ")));let f=(r=[...r]).map(w=>{let{user:T,mediaType:R}=w;return{user:T,mediaType:R}}),g=await this._p2pChannel.globalLock();try{var v;for(let T=r.length-1;T>=0;T--){let R=r[T],{user:A,mediaType:L}=R;if(ls(L,"mediaType",["audio","video"]),!A){let Z=new De(ce.INVALID_PARAMS,"user property does not exist in subscribeList item");throw z.error("[".concat(this._clientId,"] user property does not exist in subscribeList item")),Z}if(!this._users.find(Z=>Z===A)){let Z=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");z.error("[".concat(this._clientId,"] can not massSubscribe ").concat(A.uid,", this user is not in the channel")),f[T].error=Z,r.splice(T,1);continue}if(L==="audio"&&(!A.hasAudio||A._audioSSRC===void 0)||L==="video"&&(!A.hasVideo||A._videoSSRC===void 0)){let Z=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);z.error("[".concat(this._clientId,"] can not subscribe ").concat(A.uid," with mediaType ").concat(L,", remote user is not published")),f[T].error=Z,r.splice(T,1);continue}let U=Es.Video|Es.LwoVideo,F=o.get(A);if(F){if(L==="video"?F&U:F&Es.Audio){r.splice(T,1),z.warning("[".concat(this._clientId,"] repeat massSubscribe user:").concat(A.uid,", mediaType:").concat(L," twice"));continue}o.set(A,F|(L==="video"?U:Es.Audio))}else o.set(A,L==="video"?U:Es.Audio)}for(let T=r.length-1;T>=0;T--){let R=r[T],{user:A,mediaType:L}=R,U=Es.Video|Es.LwoVideo;if(this._p2pChannel.hasRemoteMedia(A,L)){await this._p2pChannel.unmuteRemoteNoLock(A,L);let F=o.get(A);o.set(A,L==="video"?F^U:F^Es.Audio),r.splice(T,1)}}this.store.massSubscribe(r.map(T=>({userId:T.user.uid,type:T.mediaType})),a);let w=bc(v=Array.from(o.entries())).call(v,(T,R)=>{let[A,L]=R;if(L===0)return T;let U={stream_id:A.uid,stream_type:L};return L&Es.Audio&&(U.audio_ssrc=A._audioSSRC),L&Es.Video&&(U.video_ssrc=A._videoSSRC),T.push(U),T},[]);try{r.length>0&&await this._p2pChannel.massSubscribeNoLock(r.map(R=>{let{user:A,mediaType:L}=R;return{user:A,mediaType:L,ssrcId:L===Wt.VIDEO?A._videoSSRC:A._audioSSRC,rtxSsrcId:L===Wt.VIDEO?A._rtxSsrcId:void 0}}));let T=new Map;if(w.length>0){let R=await this._gateway.subscribeAll(w,!0);((R==null?void 0:R.users)||[]).forEach(A=>{let{stream_id:L,video_error_code:U,audio_error_code:F,error_code:Z}=A;(U||F||Z)&&T.set(L,{video_error_code:U,audio_error_code:F,error_code:Z})})}if(Array.from(T.entries()).length>0){let R=[];Array.from(T.entries()).forEach(A=>{let[L,U]=A,F=this.remoteUsers.find(Z=>Z.uid===L);if(F){let Z;U.error_code||U.video_error_code&&U.audio_error_code?Z=void 0:U.video_error_code?Z=Wt.VIDEO:U.audio_error_code&&(Z=Wt.AUDIO),R.push({user:F,mediaType:Z})}}),R.length>0&&await this._p2pChannel.massUnsubscribeNoLock(R)}for(let R of f){let A=T.get(R.user.uid);if(A){let L=A.error_code||R.mediaType==="audio"&&A.audio_error_code||R.mediaType==="video"&&A.video_error_code;if(L){let U=h_(L);z.error("user:".concat(R.user.uid," mediaType:").concat(R.mediaType," has massSubscribe error ").concat(U.desc)),R.error=new De(ce.SUBSCRIBE_FAILED,"code ".concat(L,": ").concat(U.desc))}}R.error||(R.mediaType==="video"?R.track=R.user.videoTrack:R.track=R.user.audioTrack)}return this.store.massSubscribe(f.filter(R=>!R.error).map(R=>({userId:R.user.uid,type:R.mediaType})),void 0,Date.now()),f.forEach(R=>{var A;$t.subscribe(this.store.sessionId,{succ:!!R.error,ec:((A=R.error)===null||A===void 0?void 0:A.code)||null,video:R.mediaType===Wt.VIDEO,audio:R.mediaType===Wt.AUDIO,peerid:R.user.uid,subscribeRequestid:R.mediaType===Wt.VIDEO?R.user._videoSSRC:R.user._audioSSRC,p2pid:this.store.p2pId,eventElapse:Math.floor(performance.now()-a)},!0)}),z.info("[".concat(this._clientId,"] massSubscribe success ").concat(r.map(R=>{let{user:A,mediaType:L}=R;return"user: ".concat(A==null?void 0:A.uid,", mediaType: ").concat(L)}).join("; "))),f}catch(T){throw await this._p2pChannel.massUnsubscribeNoLock(r),T}}finally{g(),c()}}async unsubscribe(r,a,o){if(!(r instanceof i1)){let f=this.remoteUsers.find(g=>g.uid===r);if(!f)throw new De(ce.INVALID_REMOTE_USER,"user is not in the channel");r=f}if(a||this.store.useP2P){if(a==="datachannel")return this._unsubscribeDataChannel(r,o)}else await this._unsubscribeDataChannel(r,o);if(a&&ls(a,"mediaType",["audio","video"]),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't unsubscribe stream, haven't joined yet!");if(!this._users.find(f=>f===r)){let f=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not unsubscribe ").concat(r.uid,", user is not in the channel")),f}z.info("[".concat(this._clientId,"] unsubscribe uid: ").concat(r.uid,", mediaType: ").concat(a));let c=await this._subscribeMutex.lock();try{if(this._p2pChannel instanceof Hl)await this._p2pChannel.unsubscribe(r,a);else{let f=await this._p2pChannel.unsubscribe(r,a);f&&await this._gateway.unsubscribe(f,r.uid),a&&a!=="audio"||(r._audio_pre_subscribed=!1),a&&a!=="video"||(r._video_pre_subscribed=!1),r._is_pre_created&&ok(this._users,r),z.info("[".concat(this._clientId,"] unsubscribe success uid: ").concat(r.uid,", mediaType: ").concat(a))}}catch(f){if(f.code===ce.DISCONNECT_P2P)return void z.warning("disconnecting p2p, abort unsubscribe request.");throw z.error("[".concat(this._clientId,"] unsubscribe user ").concat(r.uid," error"),f.toString()),f}finally{c()}}async _unsubscribeDataChannel(r,a){if(a&&Ti(a,"id",0,65535,!0),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't unsubscribe datachannel, haven't joined yet!");if(!this._users.find(c=>c===r)){let c=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not unsubscribe ").concat(r.uid,", user is not in the channel")),c}let o;if(typeof a=="number"){let c=r._dataChannels.find(f=>f.id===a);c&&(o=[c])}else o=r._dataChannels;if(o===void 0){let c=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);throw z.error("[".concat(this._clientId,"] can not unsubscribe ").concat(r.uid," with channelId ").concat(a,", remote datachannel is not published")),c}z.info("[".concat(this._clientId,"] unsubscribe uid: ").concat(r.uid,", mediaType: datachannel, ids: ").concat(o.map(c=>c.id)));try{let c=await this._p2pChannel.unsubscribeDataChannel(r,o);c&&await this._gateway.unsubscribeDataChannel(c,r.uid),z.info("[".concat(this._clientId,"] unsubscribe datachannel success uid: ").concat(r.uid,", mediaType: datachannel, ids: ").concat(c))}catch(c){if(c.code===ce.DISCONNECT_P2P)return void z.warning("disconnecting p2p, abort unsubscribe request.");throw z.error("[".concat(this._clientId,"] unsubscribe user ").concat(r.uid," error"),c.toString()),c}}async massUnsubscribe(r){if(bm(r,"unsubscribeList"),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't unsubscribeAll stream, haven't joined yet!");z.info("[".concat(this._clientId,"] start massUnsubscribe ").concat(r.map(o=>{let{user:c,mediaType:f}=o;return"user: ".concat(c==null?void 0:c.uid,", mediaType: ").concat(f,";")}).join())),r=[...r];let a=new Map;for(let o=r.length-1;o>=0;o--){let{user:c,mediaType:f}=r[o];if(!c){let v=new De(ce.INVALID_PARAMS,"user property does not exist in unsubscribeList item");throw z.error("[".concat(this._clientId,"] user property does not exist in unsubscribeList item")),v}if(ls(f,"mediaType",["video","audio",void 0]),!this._users.find(v=>v===c)){z.warning("[".concat(this._clientId,"] can not unsubscribe ").concat(c.uid,", user is not in the channel")),r.splice(o,1);continue}let g=Es.Video|Es.LwoVideo;if(a.has(c)){let v=a.get(c),w;switch(f){case"video":w=v&g;break;case"audio":w=v&Es.Audio;break;default:w=v&(Es.Audio|g)}if(w){z.warning("[".concat(this._clientId,"] repeat massUnsubscribe user:").concat(c.uid,",mediaType:").concat(f," twice.")),r.splice(o,1);continue}f?f==="audio"?a.set(c,v|Es.Audio):f==="video"&&a.set(c,v|g):a.set(c,v|Es.Audio|g)}else f?f==="audio"?a.set(c,Es.Audio):f==="video"&&a.set(c,g):a.set(c,Es.Audio|g)}try{let o=await this._p2pChannel.massUnsubscribe(r);o&&await this._gateway.massUnsubscribe(o),z.info("[".concat(this._clientId,"] massUnsubscribe success ").concat(r.map(c=>{let{user:f,mediaType:g}=c;return"user: ".concat(f==null?void 0:f.uid,", mediaType: ").concat(g,";")}).join()))}catch(o){if(o.code===ce.DISCONNECT_P2P)return void z.warning("[".concat(this._clientId,"] disconnecting p2p, abort unsubscribe request."));throw z.error("[".concat(this._clientId,"] massUnsubscribe error"),o.toString()),o}}async setLowStreamParameter(r){(function(o){if(!o)throw new Ke(ce.INVALID_PARAMS);gr(o.width)||pG(o.width,"streamParameter.width"),gr(o.height)||pG(o.height,"streamParameter.height"),gr(o.framerate)||pG(o.framerate,"streamParameter.framerate"),gr(o.bitrate)||Ti(o.bitrate,"streamParameter.bitrate")})(r),(!r.width&&r.height||r.width&&!r.height)&&z.warning("[".concat(this._clientId,"] The width and height parameters take effect only when both are set")),z.info("[".concat(this._clientId,"] set low stream parameter to"),JSON.stringify(r));let a=this._configDistribute.getLowStreamConfigDistribute();if(a&&a.bitrate&&r.bitrate&&a.bitrate<r.bitrate&&(r.bitrate=a.bitrate),this._lowStreamParameter=r,this._isDualStreamEnabled)return this._p2pChannel.updateVideoStreamParameter(r,ht.LocalVideoLowTrack)}async enableDualStream(){if(!Jn().supportDualStream)throw $t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1}),new De(ce.NOT_SUPPORTED,"Your browser is not support dual stream");if(this._isDualStreamEnabled)throw new De(ce.INVALID_OPERATION,"Dual stream is already enabled");if(this._p2pChannel.canPublishLowStream())try{await this._publishLowStream()}catch(r){throw $t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1}),r}this._isDualStreamEnabled=!0,$t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!0}),z.info("[".concat(this._clientId,"] enable dual stream"))}async disableDualStream(){if(this._isDualStreamEnabled){if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if(this._p2pChannel.getLocalMedia(ht.LocalVideoLowTrack))try{let r=await this._p2pChannel.unpublishLowStream();r&&await this._gateway.unpublish(r,this._joinInfo.stringUid||this._joinInfo.uid)}catch(r){throw $t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!1}),r}this._isDualStreamEnabled=!1,$t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!0}),z.info("[".concat(this._clientId,"] disable dual stream"))}}async setClientRole(r,a){if(function(o){ls(o,"role",["audience","host"])}(r),a&&Cie(a),this.mode==="rtc"||this.mode==="p2p")throw z.warning("[".concat(this._clientId,"]").concat(this.mode," mode can not use setClientRole")),new De(ce.INVALID_OPERATION,"".concat(this.mode," mode can not use setClientRole"));if(a&&a.level&&r==="host")throw new De(ce.INVALID_OPERATION,"host mode can not set audience latency level");if(r==="audience"&&this._p2pChannel.hasLocalMedia())throw new De(ce.INVALID_OPERATION,"can not set client role to audience when publishing stream");await this._gateway.setClientRole(r,a),this._config.role=r,z.info("[".concat(this._clientId,"] set client role to ").concat(r,", level: ").concat(a&&a.level))}getRemoteInboundOffset(){var r;let a=(r=this._p2pChannel.getStats())===null||r===void 0?void 0:r.audioSend[0];if(!a||!a.timestamp)return 0;let o=a.timestamp-Date.now();return Math.abs(o)>1e3+a.rttMs+100?this.ntpAlignErrorCount+=1:this.ntpAlignErrorCount=0,this.ntpAlignErrorCount>=3?o:0}getNtpWallTimeInMs(){return document.visibilityState==="visible"&&(this.remoteInboundOffset=this.getRemoteInboundOffset()),this.remoteInboundOffset+Date.now()+this._gateway.ntpOffset}setProxyServer(r,a){if(Fs(r,"proxyServer"),!a){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Set proxy server before join channel");if(this._cloudProxyServerMode!=="disabled"||this._useLocalAccessPoint)throw new De(ce.INVALID_OPERATION,"You have already set the proxy")}this._proxyServer=r,$t.setProxyServer(this._proxyServer),z.setProxyServer(this._proxyServer),z.info("[".concat(this._clientId,"] Set proxy server ").concat(a?"by initialize call":""," success."))}setTurnServer(r,a){if(Array.isArray(r)||(r=[r]),!a){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Set turn server before join channel");if(this._cloudProxyServerMode!=="disabled"||this._useLocalAccessPoint)throw new De(ce.INVALID_OPERATION,"You have already set the proxy")}if(rb(r))return this._turnServer={servers:r,mode:"original-manual"},void z.info("[".concat(this._clientId,"] Set original turnserver ").concat(a?"by initialize call":""," success: ").concat(r.map(o=>o.urls).join(","),"."));r.forEach(o=>bie(o)),this._turnServer={servers:r,mode:"manual"},z.info("[".concat(this._clientId,"] Set turnserver ").concat(a?"by initialize call":""," success."))}setLicense(r){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"you should set license before join channel");if(Fs(r,"license",32,32),!/^[A-Za-z\d]+$/.test(r))throw new De(ce.INVALID_PARAMS,"license should only contains characters from A-Z a-z 0-9");this._license=r,z.info("[".concat(this._clientId,"] set license success"),r)}startProxyServer(r){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Start proxy server before join channel");if(this._proxyServer||this._turnServer.mode==="manual"||this._useLocalAccessPoint)throw new De(ce.INVALID_OPERATION,"You have already set the proxy");let a=[3,4,5],o;switch(r===void 0&&(r=3),r){case 1:case 2:throw new De(ce.NOT_SUPPORTED,"proxy mode 1/2 has been deprecated and not supported.");case 3:o="proxy3";break;case 4:o="proxy4";break;case 5:o="proxy5";break;default:throw new De(ce.INVALID_PARAMS,"proxy server mode must be ".concat(a.join("|")))}this._cloudProxyServerMode=o,this.store.cloudProxyServerMode=o,z.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode)}stopProxyServer(){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Stop proxy server after leave channel");$t.setProxyServer(),z.setProxyServer(),this._cloudProxyServerMode="disabled",this.store.cloudProxyServerMode="disabled",z.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode),this._proxyServer=void 0,this._turnServer={mode:"auto",servers:[]}}setLocalAccessPointsV2(r){if(!r.accessPoints)throw new De(ce.INVALID_PARAMS,"accessPoints is required.");bm(r.accessPoints.serverList,"accessPoints.serverList"),Fs(r.accessPoints.domain,"accessPoints.domain");let a=(U,F)=>{Ti(U,F,0,65535,!0)},o=443;if(r.accessPoints.port&&(a(r.accessPoints.port,"accessPoints.port"),o=r.accessPoints.port),this._proxyServer||this._cloudProxyServerMode!=="disabled")throw new De(ce.INVALID_OPERATION,"set local access point failed, You have already set the cloud proxy");ve("CLOSE_AFB_FOR_LOCAL_AP")&&(Ri("JOIN_WITH_FALLBACK_SIGNAL_PROXY",!1),Ri("JOIN_WITH_FALLBACK_MEDIA_PROXY",!1));let c=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/,f=r.accessPoints.domain,g=r.accessPoints.serverList.map(U=>c.test(U)?"".concat(U.replace(/\./g,"-"),".").concat(f):U),v=g.map(U=>"".concat(U,":").concat(o));this._useLocalAccessPoint=!0,this._setLocalAPVersion=2,Ri("WEBCS_DOMAIN",v),Ri("WEBCS_DOMAIN_BACKUP_LIST",v),Ri("GATEWAY_DOMAINS",[f]),r.report&&r.report.hostname&&Array.isArray(r.report.hostname)&&r.report.hostname.length?(bm(r.report.hostname,"report.hostname"),Ri("EVENT_REPORT_DOMAIN",r.report.hostname[0]),Ri("EVENT_REPORT_BACKUP_DOMAIN",r.report.hostname[1]||r.report.hostname[0])):(Ri("EVENT_REPORT_DOMAIN",g[0]),Ri("EVENT_REPORT_BACKUP_DOMAIN",g[1]||g[0]));let w=6443;r.report&&r.report.port&&(a(r.report.port,"report.port"),w=r.report.port),Ri("STATS_COLLECTOR_PORT",w),r.report?Ri("ENABLE_EVENT_REPORT",!0):Ri("ENABLE_EVENT_REPORT",!1);let T="";r.log&&r.log.hostname&&Array.isArray(r.log.hostname)&&r.log.hostname.length?(bm(r.log.hostname,"log.hostname"),T=r.log.hostname[0]):T=g[0];let R=6444;r.log&&r.log.port&&(a(r.log.port,"log.port"),R=r.log.port),Ri("LOG_UPLOAD_SERVER","".concat(T,":").concat(R));let A=[];r.cds&&r.cds.hostname&&Array.isArray(r.cds.hostname)&&r.cds.hostname.length?(bm(r.cds.hostname,"cds.hostname"),A=r.cds.hostname):A=g;let L=443;r.cds&&r.cds.port&&(a(r.cds.port,"cds.port"),L=r.cds.port),Ri("CDS_AP",A.map(U=>"".concat(U,":").concat(L))),r.cds?Ri("ENABLE_CONFIG_DISTRIBUTE",!0):Ri("ENABLE_CONFIG_DISTRIBUTE",!1),z.info("set local access point v2 success")}setLocalAccessPoints(r,a){if(bm(r,"serverList"),Fs(a,"domain"),this._proxyServer||this._cloudProxyServerMode!=="disabled")throw new De(ce.INVALID_OPERATION,"set local access point failed, You have already set the cloud proxy");let o=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;r=r.map(c=>o.test(c)?"".concat(c.replace(/\./g,"-"),".").concat(a):c),this._useLocalAccessPoint=!0,this._setLocalAPVersion=1,Ri("WEBCS_DOMAIN",r),Ri("WEBCS_DOMAIN_BACKUP_LIST",r),Ri("GATEWAY_DOMAINS",[a]),Ri("EVENT_REPORT_DOMAIN",r[0]),Ri("EVENT_REPORT_BACKUP_DOMAIN",r[1]||r[0]),Ri("LOG_UPLOAD_SERVER","".concat(r[0],":6444")),z.info("[".concat(this._clientId,"] set local access point success"))}async setRemoteDefaultVideoStreamType(r){if(ls(r,"streamType",[0,1]),this._remoteDefaultVideoStreamType=r,this._joinInfo)try{await this._gateway.setDefaultRemoteVideoStreamType(r),this._joinInfo.defaultVideoStream=this._remoteDefaultVideoStreamType}catch(a){throw z.error("[".concat(this._clientId,"] set default remote video stream type error"),a.toString()),a}else z.debug("[".concat(this._clientId,"] haven't joined yet, cache remoteDefaultVideoStreamType ").concat(r))}async setRemoteVideoStreamType(r,a){ls(a,"streamType",[0,1]);try{await this._gateway.setRemoteVideoStreamType(r,a),setTimeout(()=>{let o=this._users.find(c=>c.uid===r);o&&o.videoTrack&&o.videoTrack.updateMediaStreamTrackResolution()},2e3)}catch(o){throw z.error("[".concat(this._clientId,"] set remote video stream type error"),o.toString()),o}z.info("[".concat(this._clientId,"] set remote ").concat(r," video stream type to ").concat(a)),this._remoteStreamTypeCacheMap.set(r,a)}async setStreamFallbackOption(r,a){ls(a,"fallbackType",[0,1,2]);try{await this._gateway.setStreamFallbackOption(r,a)}catch(o){throw z.error("[".concat(this._clientId,"] set stream fallback option"),o.toString()),o}z.info("[".concat(this._clientId,"] set remote ").concat(r," stream fallback type to ").concat(a)),this._streamFallbackTypeCacheMap.set(r,a)}setEncryptionConfig(r,a,o,c){(function(g){ls(g,"encryptionMode",["aes-128-xts","aes-256-xts","aes-128-ecb","sm4-128-ecb","aes-128-gcm","aes-256-gcm","aes-128-gcm2","aes-256-gcm2","none"])})(r),Fs(a,"secret");let f=["aes-128-gcm2","aes-256-gcm2"];if(Tt(f).call(f,r)){if(!o||!(o instanceof Uint8Array&&o.length===32))throw new De(ce.INVALID_PARAMS,"salt must be an Uint8Array and exactly equal to 32 bytes")}else if(o)throw new De(ce.INVALID_PARAMS,"current encrypt mode does not need salt");if(c){if(Sm(c,"encryptDataStream"),!Tt(f).call(f,r))throw new De(ce.INVALID_PARAMS,"current encrypt mode does not support data stream");this._encryptDataStream=!0}new RegExp(`^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*,.<>?/:;'"|{}\\[\\]])(?=.{8,})`).test(a)||z.warning(`The secret is not strong:
The secret must contain at least 1 lowercase alphabetical character,
The secret must contain at least 1 uppercase alphabetical character,
The secret must contain at least 1 numeric character,
The secret must contain at least one special character,
The secret must be eight characters or longer.
`),this._encryptionMode=r,this._encryptionSecret=a,o&&(this._encryptionSalt=V0(o))}async renewToken(r){if(Fs(r,"token",1,2047),!this._key||!this._joinInfo)throw new De(ce.INVALID_OPERATION,"renewToken should not be called before user join");let a=this._key;this._key=r,this._joinInfo&&(this._joinInfo.token=r);let o=await this._renewTokenMutex.lock();try{if(ve("USE_NEW_TOKEN")){z.debug("[".concat(this._clientId,"] start renew token with ticket from unilbs"));let c=await aIe(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||Mr);z.debug("[".concat(this._clientId,"] get ticket from unilbs success")),await this._gateway.renewToken({token:r,ticket:c})}else z.debug("[".concat(this._clientId,"] start renew token without ticket")),await this._gateway.renewToken({token:r});z.debug("[".concat(this._clientId,"] renewToken success"))}catch(c){throw this._key=a,this._joinInfo.token=a,z.error("[".concat(this._clientId,"] renewToken failed"),c.toString()),c}finally{o()}}enableAudioVolumeIndicator(){this._audioVolumeIndicationInterval?z.warning("you have already enabled audio volume indicator!"):this._audioVolumeIndicationInterval=window.setInterval(()=>{let r=this._p2pChannel.getAudioLevels();this.safeEmit(Gn.VOLUME_INDICATOR,r)},ve("AUDIO_VOLUME_INDICATION_INTERVAL")||2e3)}getRTCStats(){let r=this._statsCollector.getRTCStats(),a=this._gateway.getInChannelInfo();return r.Duration=Math.round(a.duration/1e3),r}async startLiveStreaming(r,a){if(!a){if(this.codec!=="h264")throw new De(ce.LIVE_STREAMING_INVALID_RAW_STREAM,"raw streaming is only support h264");if(!this._p2pChannel.hasLocalMedia())throw new De(ce.LIVE_STREAMING_INVALID_RAW_STREAM,"can not find stream to raw streaming")}if(this._liveRawStreamingClient&&this._liveRawStreamingClient.hasUrl(r)||this._liveTranscodeStreamingClient&&this._liveTranscodeStreamingClient.hasUrl(r))throw new De(ce.LIVE_STREAMING_TASK_CONFLICT);let o=a?Ns.TRANSCODE:Ns.RAW;return this._createLiveStreamingClient(o).startLiveStreamingTask(r,o)}setLiveTranscoding(r){return this._createLiveStreamingClient(Ns.TRANSCODE).setTranscodingConfig(r)}async stopLiveStreaming(r){let a=[this._liveRawStreamingClient,this._liveTranscodeStreamingClient].filter(o=>o&&o.hasUrl(r));if(!a.length)throw new De(ce.INVALID_PARAMS,"can not find live streaming url to stop");await Ct.all(a.map(o=>o&&o.stopLiveStreamingTask(r)))}async addInjectStreamUrl(r,a){if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not addInjectStreamUrl, no joininfo");let o=this._createLiveStreamingClient(Ns.INJECT);o.setInjectStreamConfig(a,0),await o.startLiveStreamingTask(r,Ns.INJECT)}async removeInjectStreamUrl(){var r;let a=this._createLiveStreamingClient(Ns.INJECT),o=Array.from(Oh(r=a.streamingTasks).call(r)).find(c=>c.mode===Ns.INJECT);if(!this._joinInfo||!o)throw new De(ce.INVALID_OPERATION,"can remove addInjectStreamUrl, no joininfo or inject task");await a.stopLiveStreamingTask(o.url)}async startChannelMediaRelay(r){Fle(r),await this._createChannelMediaRelayClient().startChannelMediaRelay(r)}async updateChannelMediaRelay(r){Fle(r),await this._createChannelMediaRelayClient().updateChannelMediaRelay(r)}async stopChannelMediaRelay(){await this._createChannelMediaRelayClient().stopChannelMediaRelay(),this._statsCollector.onStatsChanged&&(this._statsCollector.onStatsChanged=void 0)}async sendStreamMessage(r){var a;let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not send data stream, not joined");if((typeof r=="string"||r instanceof Uint8Array)&&(r={payload:r}),typeof r.payload=="string"){let f=new TextEncoder;r.payload=f.encode(r.payload)}let c=!1;if(this._encryptDataStream&&this._encryptDataStreamIv&&this._encryptDataStreamKey&&window.crypto.subtle&&Tt(a=["aes-128-gcm2","aes-256-gcm2"]).call(a,this._encryptionMode)&&(c=!0,r.payload=await async function(f,g,v){var w;let T=bc(w=Array.from(v)).call(w,(W,K)=>W+K,0),R={serverTs:0,seq:Hxe++,length:v.length,checkSum:T},A=new Uint8Array(Pie(T,2)),L=new ArrayBuffer(lb),U=new DataView(L);U.setUint32(0,R.serverTs),U.setUint16(4,R.seq),U.setUint16(6,R.length),U.setUint16(8,R.checkSum);let F=16-v.length%16;v=xie(v,new Uint8Array(F));let Z=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:f,tagLength:kie,additionalData:A},g,v);return xie(new Uint8Array(L),new Uint8Array(Z))}(this._encryptDataStreamIv,this._encryptDataStreamKey,r.payload)),new Blob([r.payload]).size>1024)throw new De(ce.INVALID_PARAMS,c?"encrypted stream message out of range.":"stream message out of range.");return this._gateway.signal.request(rn.DATA_STREAM,{payload:V0(r.payload),syncWithAudio:r.syncWithAudio,sendTs:Date.now()-NNe},!o)}sendMetadata(r){if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not send metadata, not joined");if(new Blob([r]).size>1024)throw new De(ce.METADATA_OUT_OF_RANGE);return this._gateway.signal.request(rn.SEND_METADATA,{session_id:this._joinInfo.sid,metadata:V0(r)})}async sendCustomReportMessage(r){if(Array.isArray(r)||(r=[r]),r.forEach(Wxe),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not send custom report, not joined");await $t.sendCustomReportMessage(this._joinInfo.sid,r)}getLocalAudioStats(){return this._statsCollector.getLocalAudioTrackStats()}getRemoteAudioStats(){return this._statsCollector.getRemoteAudioTrackStats()}getLocalVideoStats(){return this._statsCollector.getLocalVideoTrackStats()}getRemoteVideoStats(){return this._statsCollector.getRemoteVideoTrackStats()}getRemoteNetworkQuality(){return this._statsCollector.getRemoteNetworkQualityStats()}async pickSVCLayer(r,a){ls(a.spatialLayer,"spatialLayer",[0,1,2,3]),ls(a.temporalLayer,"temporalLayer",[0,1,2,3]);try{await this._gateway.pickSVCLayer(r,a)}catch(o){throw z.error("[".concat(this._clientId,"] pick SVC layer failed"),o.toString()),o}}async setRTMConfig(r){let{apRTM:a=!1,rtmFlag:o}=r;if(Sm(a,"apRTM"),Ti(o,"rtmFlag",0),this._rtmConfig.apRTM=a,this._rtmConfig.rtmFlag=o,z.debug("[".concat(this._clientId,"] setRTMconfig ").concat(JSON.stringify(r)," in ").concat(this.connectionState," state")),(this.connectionState==="CONNECTED"||this.connectionState==="RECONNECTING")&&this._joinInfo)return this._joinInfo.apRTM=a,this._joinInfo.rtmFlag=o,this._gateway.setRTM2Flag(o)}_reset(){if(z.debug("[".concat(this._clientId,"] reset client")),this._axiosCancelSource.cancel(),this._axiosCancelSource=Lo.CancelToken.source(),this._streamFallbackTypeCacheMap=new Map,this._remoteStreamTypeCacheMap=new Map,this._configDistribute.stopGetConfigDistribute(),this._joinInfo&&Lce(this._joinInfo),this._joinInfo=void 0,this._proxyServer=void 0,this._defaultStreamFallbackType=void 0,this._sessionId=null,this.store.sessionId=null,this._statsCollector.reset(),this._key=void 0,this._appId=void 0,this._uid=void 0,this.store.uid=void 0,this._channelName=void 0,this._encryptionMode="none",this._encryptionSecret=null,this._encryptionSalt=null,this._encryptDataStreamKey=null,this._encryptDataStreamIv=null,this._pendingPublishedUsers=[],this._users.forEach(r=>{r._audioTrack&&r._audioTrack._destroy(),r._videoTrack&&r._videoTrack._destroy(),r._dataChannels&&(r._dataChannels.forEach(a=>a._close()),r._dataChannels.length=0)}),this._users=[],this._audioVolumeIndicationInterval&&(window.clearInterval(this._audioVolumeIndicationInterval),this._audioVolumeIndicationInterval=void 0),this._cloudProxyServerMode==="fallback"&&(this._cloudProxyServerMode="disabled",this.store.cloudProxyServerMode="disabled"),this._p2pChannel.reset(),this._publishMutex=new As("client-publish"),this._subscribeMutex=new As("client-subscribe"),this._networkQualityInterval&&(window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=void 0),this._injectStreamingClient&&(this._injectStreamingClient.terminate(),this._injectStreamingClient.removeAllListeners(),this._injectStreamingClient=void 0),this._liveRawStreamingClient&&(this._liveRawStreamingClient.terminate(),this._liveRawStreamingClient.removeAllListeners(),this._liveRawStreamingClient=void 0),this._liveTranscodeStreamingClient&&(this._liveTranscodeStreamingClient.terminate(),this._liveTranscodeStreamingClient.removeAllListeners(),this._liveTranscodeStreamingClient=void 0),this._channelMediaRelayClient&&(this._channelMediaRelayClient.dispose(),this._channelMediaRelayClient=void 0),this._inspect)try{this._inspect.close(),this._inspect=void 0}catch{}if(this._moderation)try{this.setImageModeration(!1)}catch{}}_startSession(r,a){var o;let c=r||FI();r?z.debug("[".concat(this._clientId,"] new Session ").concat(c)):z.debug("[".concat(this._clientId,"] renewSession ").concat(this._sessionId," => ").concat(c));let f=r?"":this._sessionId||"";this._sessionId=c,this.store.sessionId=c;let g={lts:new Date().getTime(),mode:this.mode,buildFormat:1,stringUid:(a==null?void 0:a.stringUid)||((o=this._joinInfo)===null||o===void 0?void 0:o.stringUid),channelProfile:this.mode==="live"?1:0,channelMode:0,isABTestSuccess:Number(this._configDistribute.isSuccess),lsid:f,clientRole:this.role==="audience"?2:1};a?$t.sessionInit(this._sessionId,Sd({cname:a.channel,appid:a.appId,preload:a.preload},g)):this._joinInfo?$t.sessionInit(this._sessionId,Sd({cname:this._joinInfo.cname,appid:this._joinInfo.appId,preload:!!this._joinInfo.recoverPreloadCache},g)):this._gateway.joinInfo&&$t.sessionInit(this._sessionId,Sd({cname:this._gateway.joinInfo.cname,appid:this._gateway.joinInfo.appId},g)),this._joinInfo&&(this._joinInfo.sid=c),this._gateway.joinInfo&&(this._gateway.joinInfo.sid=c)}async _publishHighStream(r){if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));if(this._turnServer.mode==="auto"&&ve("FORCE_TURN")&&!ve("TURN_ENABLE_TCP")&&!ve("TURN_ENABLE_UDP"))throw new De(ce.UNEXPECTED_ERROR,"force TURN With No TURN Configuration");z.debug("[".concat(this._clientId,"] publish high stream"));try{let o=await this._p2pChannel.publish(r,this._isDualStreamEnabled,this._lowStreamParameter);if(this._p2pChannel instanceof Hl){let c=(await o.next()).value;if(c){try{await this._gateway.sendExtensionMessage(Nr.PUBLISH,c,!0)}catch(f){throw o.throw(f),f}await o.next()}this._p2pChannel.reportPublishEvent(!0,null)}else{let c=(await o.next()).value;if(c){var a;let f;try{f=await this._gateway.publish(this._uid,c,!0)}catch(g){if(g.code!==ce.DISCONNECT_P2P)throw o.throw(g),g}await o.next(((a=f)===null||a===void 0?void 0:a.ortc)||[])}this._p2pChannel.reportPublishEvent(!0,null);for(let f of r)f instanceof Di&&f._encoderConfig&&this._gateway.setVideoProfile(f._encoderConfig),!f.muted&&f.enabled||await this._p2pChannel.muteLocalTrack(f)}}catch(o){if(this._p2pChannel.reportPublishEvent(!1,o==null?void 0:o.code,r),(o==null?void 0:o.code)===ce.WS_ABORT)return;throw o}}async _publishLowStream(){if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));z.debug("[".concat(this._clientId,"] publish low stream"));let r=this._configDistribute.getLowStreamConfigDistribute();r&&r.bitrate&&(this._lowStreamParameter||(this._lowStreamParameter={width:160,height:120,framerate:15,bitrate:50}),this._lowStreamParameter&&this._lowStreamParameter.bitrate&&r.bitrate<this._lowStreamParameter.bitrate&&(this._lowStreamParameter.bitrate=r.bitrate));try{let o=await this._p2pChannel.publishLowStream(this._lowStreamParameter),c=(await o.next()).value;if(c){var a;let f;try{f=await this._gateway.publish(this._uid,c,!0)}catch(g){if(g.code!==ce.DISCONNECT_P2P)throw o.throw(g),g}o.next(((a=f)===null||a===void 0?void 0:a.ortc)||[]),this._p2pChannel.reportPublishEvent(!0,null,void 0,!0)}}catch(o){if(this._p2pChannel.reportPublishEvent(!1,o==null?void 0:o.code,void 0,!0),(o==null?void 0:o.code)===ce.WS_ABORT)return;throw o}}_createLiveStreamingClient(r){if(!this._joinInfo||!this._appId)return new De(ce.INVALID_OPERATION,"can not create live streaming client, please join channel first").throw();let a=()=>new rNe(this._joinInfo,this._config.websocketRetryConfig||Mr,this._config.httpRetryConfig||Mr),o=c=>{c.onLiveStreamError=(f,g)=>{$t.reportApiInvoke(this._sessionId,{name:qr.ON_LIVE_STREAM_ERROR,options:[f,g],tag:vr.TRACER}).onSuccess(),this.safeEmit(Gn.LIVE_STREAMING_ERROR,f,g)},c.onLiveStreamWarning=(f,g)=>{$t.reportApiInvoke(this._sessionId,{name:qr.ON_LIVE_STREAM_WARNING,options:[f,g],tag:vr.TRACER}).onSuccess(),this.safeEmit(Gn.LIVE_STREAMING_WARNING,f,g)},c.on(yk.REQUEST_WORKER_MANAGER_LIST,(f,g,v)=>{if(!this._joinInfo)return v(new De(ce.INVALID_OPERATION,"can not find join info to get worker manager"));Cre(f,this._joinInfo,this._axiosCancelSource.token,Mr).then(g).catch(v)})};switch(r){case Ns.RAW:return this._liveRawStreamingClient||(this._liveRawStreamingClient=a(),o(this._liveRawStreamingClient)),this._liveRawStreamingClient;case Ns.TRANSCODE:return this._liveTranscodeStreamingClient||(this._liveTranscodeStreamingClient=a(),o(this._liveTranscodeStreamingClient)),this._liveTranscodeStreamingClient;case Ns.INJECT:return this._injectStreamingClient||(this._injectStreamingClient=a(),this._injectStreamingClient.on(yk.REQUEST_WORKER_MANAGER_LIST,(c,f,g)=>{if(!this._joinInfo)return g(new De(ce.INVALID_OPERATION,"can not find join info to get worker manager"));Cre(c,this._joinInfo,this._axiosCancelSource.token,Mr).then(f).catch(g)}),this._injectStreamingClient.onInjectStatusChange=(c,f,g)=>{this.safeEmit(Gn.INJECT_STREAM_STATUS,c,f,g)}),this._injectStreamingClient}}_createChannelMediaRelayClient(){if(!this._joinInfo)return new De(ce.INVALID_OPERATION,"can not create channel media relay client, please join channel first").throw();if(!this._channelMediaRelayClient){let{sendResolutionWidth:r,sendResolutionHeight:a}=this.getLocalVideoStats(),o={width:r,height:a};this._channelMediaRelayClient=new aNe(this._joinInfo,this._clientId,this._config.websocketRetryConfig||Mr,this._config.httpRetryConfig||Mr,o),this._channelMediaRelayClient.on("state",c=>{c===ll.RELAY_STATE_FAILURE&&this._channelMediaRelayClient&&this._channelMediaRelayClient.dispose(),this.safeEmit(Gn.CHANNEL_MEDIA_RELAY_STATE,c)}),this._channelMediaRelayClient.on("event",c=>{this.safeEmit(Gn.CHANNEL_MEDIA_RELAY_EVENT,c)}),this._statsCollector.onStatsChanged=(c,f)=>{var g;c==="resolution"&&((g=this._channelMediaRelayClient)===null||g===void 0||g.setVideoProfile(f))}}return this._channelMediaRelayClient}_handleUpdateDataChannel(r,a){let{added:o,deleted:c}=r,f=[];Array.isArray(o)&&o.length>0&&o.forEach(g=>{let{uid:v,stream_id:w,ordered:T,max_retrans_times:R,metadata:A}=g,L=this._users.find(U=>U._uintid===v);if(!L)return void z.error("[".concat(this._clientId,"] can not find target user!(on_add_data_channel)"));if(z.debug("[".concat(this._clientId,"] data_channel added with uid ").concat(v)),Tt(f).call(f,L)||f.push(L),L._uintid||(L._uintid=v),L._dataChannels.findIndex(U=>U.id===g.stream_id)===-1){let U={id:w,ordered:!!T,maxRetransmits:R,metadata:A},F=new k4e(U);L._dataChannels.push(F),z.info("[".concat(this._clientId,"] remote user ").concat(L.uid," published datachannel")),a||this.safeEmit(Gn.USER_PUBLISHED,L,"datachannel",U)}this._p2pChannel.hasPendingRemoteDataChannel(L,g.stream_id)&&(z.debug("[".concat(this._clientId,"] resubscribe datachannel for user ").concat(L.uid," after reconnect.")),this._subscribeDataChannel(L,g.stream_id).catch(U=>{z.error("[".concat(this._clientId,"] resubscribe datachannel error"),U.toString())}))}),a&&(this.safeEmit(Gn.PUBLISHED_USER_LIST,this._pendingPublishedUsers),this._pendingPublishedUsers=[]),Array.isArray(c)&&c.length>0&&c.forEach(g=>{let{uid:v,stream_id:w}=g,T=this._users.find(A=>A._uintid===v);if(!T)return void z.error("[".concat(this._clientId,"] can not find target user!(on_delete_data_channel)"));let R=T._dataChannels.find(A=>A.id===g.stream_id);R&&(z.debug("[".concat(this._clientId,"] data_stream delete with uid ").concat(v)),this._p2pChannel.unsubscribeDataChannel(T,[R]).then(A=>{if(T._dataChannels=T._dataChannels.filter(L=>L!==R),A)return this._gateway.unsubscribeDataChannel(A,T.uid)}),z.info("[".concat(this._clientId,"] remote user ").concat(v," unpublished datachannel ,id:").concat(R.id)),this.safeEmit(Gn.USER_UNPUBLISHED,T,"datachannel",R._config))})}_handleRemoveDataChannels(r){let a=this._users.find(o=>o.uid===r.uid);if(a){if(a._dataChannels!==void 0&&a._dataChannels.length>0){z.debug("[".concat(this._clientId,"] datachannel removed with uid ").concat(r.uid));let o=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(a.uid," unpublished datachannel")),a._dataChannels.forEach(c=>{this.safeEmit(Gn.USER_UNPUBLISHED,a,"datachannel",c._config)})};this._p2pChannel.unsubscribeDataChannel(a,a._dataChannels).then(c=>{if(c)return this._gateway.unsubscribeDataChannel(c,a.uid)}),o()}}else z.warning("[".concat(this._clientId,"] can not find target user!(on_remove_datachannel)"))}_handleGatewayEvents(){this._gateway.on(Ir.DISCONNECT_P2P,async()=>{await this._p2pChannel.disconnectForReconnect()}),this._gateway.on(Ir.CONNECTION_STATE_CHANGE,(r,a,o)=>{var c;if(o===Hn.FALLBACK)return;let f=()=>{this.safeEmit(Gn.CONNECTION_STATE_CHANGE,r,a,o)};if($t.reportApiInvoke(this._sessionId||((c=this._gateway.joinInfo)===null||c===void 0?void 0:c.sid)||null,{name:qr.CONNECTION_STATE_CHANGE,options:[r,a,o],tag:vr.TRACER}).onSuccess(JSON.stringify({cur:r,prev:a,reason:o})),z.info("[".concat(this._clientId,"] connection state change: ").concat(a," -> ").concat(r)),r==="DISCONNECTED")return this._reset(),void f();if(r==="RECONNECTING")this._users.forEach(v=>{v._trust_in_room_=!1,v._trust_audio_enabled_state_=!1,v._trust_video_enabled_state_=!1,v._trust_audio_mute_state_=!1,v._trust_video_mute_state_=!1,v._trust_audio_stream_added_state_=!1,v._trust_video_stream_added_state_=!1,v._is_pre_created||(v._audio_pre_subscribed||(v._audioSSRC=void 0,v._audioOrtc=void 0),v._video_pre_subscribed||(v._videoSSRC=void 0,v._videoOrtc=void 0,v._rtxSsrcId=void 0),v._cname=void 0)}),this._userOfflineTimeout&&window.clearTimeout(this._userOfflineTimeout),this._streamRemovedTimeout&&window.clearTimeout(this._streamRemovedTimeout),this._userOfflineTimeout=void 0,this._streamRemovedTimeout=void 0;else if(r==="CONNECTED"){var g;this._streamFallbackTypeCacheMap.forEach((v,w)=>{this._gateway.setStreamFallbackOption(w,v).catch(T=>{z.warning("[".concat(this._clientId,"] auto set stream fallback option failed"),T)})}),this._remoteStreamTypeCacheMap.forEach((v,w)=>{this._gateway.setRemoteVideoStreamType(w,v).catch(T=>{z.warning("[".concat(this._clientId,"] auto set remote stream type failed"),T)})}),this._remoteDefaultVideoStreamType!==void 0&&((g=this._joinInfo)===null||g===void 0?void 0:g.defaultVideoStream)===void 0&&this.setRemoteDefaultVideoStreamType(this._remoteDefaultVideoStreamType).then(()=>{z.debug("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway connected"))}).catch(v=>{z.error("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway failed, ").concat(v))}),this.store.useP2P||(this._p2pChannel.republish(),this._userOfflineTimeout=window.setTimeout(()=>{this.connectionState==="CONNECTED"&&(this._userOfflineTimeout=void 0,this._users.filter(v=>!v._trust_in_room_).forEach(v=>{z.debug("[".concat(this._clientId,"] user offline timeout, emit user offline ").concat(v.uid)),this._handleUserOffline({uid:v.uid})}))},3e3),this._streamRemovedTimeout=window.setTimeout(()=>{this.connectionState==="CONNECTED"&&(this._streamRemovedTimeout=void 0,this._users.forEach(v=>{v._trust_audio_mute_state_||(z.debug("[".concat(this._clientId,"] auto dispatch audio unmute event ").concat(v.uid)),this._handleMuteStream(v.uid,Wt.AUDIO,!1)),v._trust_video_mute_state_||(z.debug("[".concat(this._clientId,"] auto dispatch video unmute event ").concat(v.uid)),this._handleMuteStream(v.uid,Wt.VIDEO,!1)),v._trust_audio_enabled_state_||(z.debug("[".concat(this._clientId,"] auto dispatch enable local audio ").concat(v.uid)),this._handleSetStreamLocalEnable("audio",v.uid,!0)),v._trust_video_enabled_state_||(z.debug("[".concat(this._clientId,"] auto dispatch enable local video ").concat(v.uid)),this._handleSetStreamLocalEnable("video",v.uid,!0)),v._trust_video_stream_added_state_||(z.debug("[".concat(this._clientId,"] auto dispatch reset video stream added ").concat(v.uid)),this._handleResetAddStream(v,"video")),v._trust_audio_stream_added_state_||(z.debug("[".concat(this._clientId,"] auto dispatch reset audio stream added ").concat(v.uid)),this._handleResetAddStream(v,"audio")),v._video_added_||v._audio_added_||(z.debug("[".concat(this._clientId,"] auto dispatch stream remove ").concat(v.uid)),this._handleRemoveStream({uid:v.uid,uint_id:v._uintid}))}))},1e3))}f()}),this._gateway.on(Ir.REQUEST_NEW_GATEWAY_LIST,async(r,a)=>{if(!this._joinInfo)return a(new De(ce.UNEXPECTED_ERROR,"can not recover, no join info"));try{let o;this._joinInfo.recoverPreloadCache?(o=this._joinInfo.recoverPreloadCache.ap,Dce(this._joinInfo.recoverPreloadCache),this._joinInfo.recoverPreloadCache=void 0):o=await qG(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||Mr,this.store),this._joinInfo&&(this._joinInfo.apResponse=o.gatewayInfo.res,this._joinInfo.gatewayAddrs=o.gatewayInfo.gatewayAddrs,this._joinInfo.uni_lbs_ip=o.gatewayInfo.uni_lbs_ip);let c=[];o.gatewayInfo.gatewayAddrs.forEach(f=>{let{address:g}=f,[v,w]=g.split(":");this._joinInfo&&this._joinInfo.proxyServer?c.push({proxy:this._joinInfo.proxyServer,host:v,port:w}):c.push({host:v,port:w})}),r(c)}catch(o){a(o)}}),this._gateway.on(Ir.NETWORK_QUALITY,r=>{this._networkQualitySensitivity==="normal"&&this.safeEmit(Gn.NETWORK_QUALITY,r)}),this._gateway.on(Ir.STREAM_TYPE_CHANGE,(r,a)=>{this.safeEmit(Gn.STREAM_TYPE_CHANGED,r,a),$t.reportApiInvoke(this._sessionId,{name:qr.STREAM_TYPE_CHANGE,options:[r,a],tag:vr.TRACER}).onSuccess(JSON.stringify({uid:r,streamType:a}))}),this._gateway.on(Ir.IS_P2P_DISCONNECTED,r=>{this._p2pChannel.isP2PDisconnected()?r(!0):this._p2pChannel.hasLocalMedia()||this._p2pChannel.hasRemoteMedia()?r(!1):r(!0)}),this._gateway.on(Ir.NEED_RENEW_SESSION,async r=>{if(r==="recover"&&this._joinInfo){let a=await Oce(Sd(Sd({},this._joinInfo),{},{uid:this._joinInfo.uid,stringUid:void 0}));this._joinInfo.recoverPreloadCache=a,this._startSession(a==null?void 0:a.sid)}else this._startSession()}),this._gateway.on(Ir.REQUEST_P2P_CONNECTION_PARAMS,async(r,a,o)=>{try{a(await this._p2pChannel.startP2PConnection(r))}catch(c){o(c)}}),this._gateway.on(Ir.JOIN_RESPONSE,(r,a)=>{if(this.store.useP2P)return;let{dtlsParameters:o,iceParameters:c,candidates:f,rtpCapabilities:g,setup:v,cname:w}=fle(r.ortc,a);this._p2pChannel.connect(c,o,f,g,v,w)}),this._gateway.on(Ir.REQUEST_DC_CONNECTION_PARAMS,r=>{r(this._p2pChannel.getEstablishParams())}),this._gateway.on(Ir.RESET_SIGNAL,r=>{this._p2pChannel.resetConnection(r),this._handleGatewaySignalEvents()}),this._gateway.on(Ir.DATACHANNEL_FAILBACK,()=>{this._joinGateway()}),this._gateway.on(Ir.DATACHANNEL_PRECONNECT,async(r,a,o,c)=>{var f,g,v,w,T,R;await this._p2pChannel.startP2PConnection({turnServer:(f=this._joinInfo)===null||f===void 0?void 0:f.turnServer},!0);let A=function(L,U){let F;return U&&U.ip&&typeof U.port=="number"?(F=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:U.ip,port:U.port.toString(),type:"host",extension:{}}],z.debug("Using remote candidate from AP ".concat(U.ip,":").concat(U.port)),U.ip6&&(F.push({foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:U.ip6,port:U.port.toString(),type:"host",extension:{}}),z.debug("Using IPV6 remote candidate from AP ".concat(U.ip6,":").concat(U.port)))):F=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:L.ip,port:L.port.toString(),type:"host",extension:{}}],F}(r,a);return this._p2pChannel.preConnect({iceUfrag:"".concat((g=this._joinInfo)===null||g===void 0?void 0:g.apResponse.cid,"_").concat((v=this._joinInfo)===null||v===void 0?void 0:v.apResponse.cert),icePwd:"".concat((w=this._joinInfo)===null||w===void 0?void 0:w.apResponse.cid,"_").concat((T=this._joinInfo)===null||T===void 0?void 0:T.apResponse.cert)},{fingerprints:[{hashFunction:"sha-256",fingerprint:(R=ve("FINGERPRINT"))!==null&&R!==void 0?R:r.fingerprint}]},A,{send:{audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]},recv:{audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]}},"active","o/i14u9pJrxRKAsu").then(o).catch(c)})}_handleGatewaySignalEvents(){this._gateway.signal.on(Sn.ON_USER_ONLINE,this._handleUserOnline),this._gateway.signal.on(Sn.ON_USER_OFFLINE,this._handleUserOffline),this._gateway.signal.on(Sn.ON_ADD_AUDIO_STREAM,r=>this._handleAddAudioOrVideoStream("audio",r.uid,r.ssrcId,r.cname,r.uint_id,r.ortc)),this._gateway.signal.on(Sn.ON_ADD_VIDEO_STREAM,r=>this._handleAddAudioOrVideoStream("video",r.uid,r.ssrcId,r.cname,r.uint_id,r.ortc,r.rtxSsrcId)),this._gateway.signal.on(Sn.ON_REMOTE_DATASTREAM_UPDATE,r=>{this._handleUpdateDataChannel(r)}),this._gateway.signal.on(Sn.ON_REMOTE_FULL_DATASTREAM_INFO,r=>{this._handleUpdateDataChannel({added:r.datastreams,deleted:[]},!0)}),this._gateway.signal.on(Sn.ON_REMOVE_STREAM,this._handleRemoveStream),this._gateway.signal.on(Sn.ON_P2P_LOST,this._handleP2PLost),this._gateway.signal.on(Sn.MUTE_AUDIO,r=>this._handleMuteStream(r.uid,Wt.AUDIO,!0)),this._gateway.signal.on(Sn.UNMUTE_AUDIO,r=>this._handleMuteStream(r.uid,Wt.AUDIO,!1)),this._gateway.signal.on(Sn.MUTE_VIDEO,r=>this._handleMuteStream(r.uid,Wt.VIDEO,!0)),this._gateway.signal.on(Sn.UNMUTE_VIDEO,r=>this._handleMuteStream(r.uid,Wt.VIDEO,!1)),this._gateway.signal.on(Sn.RECEIVE_METADATA,r=>{let a=l_(r.metadata);this.safeEmit(Gn.RECEIVE_METADATA,r.uid,a)}),this._gateway.signal.on(Sn.ON_DATA_STREAM,async r=>{var a;if(!r)return;let o=l_(r.payload);if(this._encryptDataStream&&this._encryptDataStreamIv&&this._encryptDataStreamKey&&window.crypto.subtle&&Tt(a=["aes-128-gcm2","aes-256-gcm2"]).call(a,this._encryptionMode)){if(r.payload.length<lb)throw new De(ce.UNEXPECTED_RESPONSE,"payload length ".concat(r.payload.length," is less than header length ").concat(lb));o=await async function(f,g,v){let w=v.subarray(0,lb),T=w.slice(8,lb),R=(T[0]<<8)+T[1],A=(w[6]<<8)+w[7],L=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:f,tagLength:kie,additionalData:new Uint8Array(Pie(R,2))},g,v.subarray(lb));return new Uint8Array(L).subarray(0,A)}(this._encryptDataStreamIv,this._encryptDataStreamKey,o)}let c=0;if(r.ordered||r.syncWithAudio){let f=this._p2pChannel.getStats(),g=this.remoteUsers.find(w=>w.uid===r.uid),v=f==null?void 0:f.audioRecv.find(w=>w.ssrc===(g==null?void 0:g._audioSSRC));c=v==null?void 0:v.jitterBufferMs}c==null&&(c=0),PNe(Sd(Sd({},r),{},{payload:o}),c,{id:this._clientId,onStreamMessage:typeof this.onStreamMessage=="function"?this.onStreamMessage.bind(this):void 0,safeEmit:this.safeEmit.bind(this)})}),this._gateway.signal.on(Sn.ON_CRYPT_ERROR,()=>{B0(()=>{z.warning("[".concat(this._clientId,"] on crypt error")),this.safeEmit(Gn.CRYPT_ERROR)},this._sessionId)}),this._gateway.signal.on(Sn.ON_TOKEN_PRIVILEGE_WILL_EXPIRE,this._handleTokenWillExpire),this._gateway.signal.on(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{z.warning("[".concat(this._clientId,"] received message onTokenPrivilegeDidExpire, please get new token and join again")),this._gateway.leave(!0,Hn.TOKEN_EXPIRE),this.safeEmit(Gn.ON_TOKEN_PRIVILEGE_DID_EXPIRE),this._reset()}),this._gateway.signal.on(Sn.ON_STREAM_FALLBACK_UPDATE,r=>{z.debug("[".concat(this._clientId,"] stream fallback peerId: ").concat(r.stream_id,", attr: ").concat(r.stream_type)),this.safeEmit(Gn.STREAM_FALLBACK,r.stream_id,r.stream_type===1?"fallback":"recover")}),this._gateway.signal.on(Sn.ON_PUBLISH_STREAM,r=>{this.uid===this._uid&&(this._p2pChannel.reportPublishEvent(!0,null,void 0,!1,JSON.stringify({proxy:r.proxy})),z.info("[".concat(this._clientId,"] on publish stream, ").concat(JSON.stringify(r))))}),this._gateway.signal.on(Sn.ENABLE_LOCAL_VIDEO,r=>{this._handleSetStreamLocalEnable("video",r.uid,!0)}),this._gateway.signal.on(Sn.DISABLE_LOCAL_VIDEO,r=>{this._handleSetStreamLocalEnable("video",r.uid,!1)}),this._gateway.signal.on(Ut.REQUEST_TIMEOUT,(r,a)=>{if(this._joinInfo)switch(r){case rn.PUBLISH:{if(!a)return;let f=a.ortc;if(f){var o,c;let g=f.some(T=>{let{stream_type:R}=T;return R===mi.Audio}),v=f.some(T=>{let{stream_type:R}=T;return R!==mi.Audio}),w=f.some(T=>{let{stream_type:R}=T;return R===mi.Screen||R===mi.ScreenLow});a.state==="offer"&&$t.publish(this._joinInfo.sid,{eventElapse:ua.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:!1,ec:ce.TIMEOUT,audio:g,video:v,p2pid:a.p2p_id,publishRequestid:this.store.pubId,screenshare:w,audioName:g?(o=f.find(T=>{let{stream_type:R}=T;return R===mi.Audio}))===null||o===void 0||(o=o.ssrcs[0])===null||o===void 0?void 0:o.ssrcId.toString():void 0,videoName:v?(c=f.find(T=>{let{stream_type:R}=T;return R!==mi.Audio}))===null||c===void 0||(c=c.ssrcs[0])===null||c===void 0?void 0:c.ssrcId.toString():void 0})}break}case rn.SUBSCRIBE:a&&$t.subscribe(this._joinInfo.sid,{succ:!1,ec:ce.TIMEOUT,audio:a.stream_type===Wt.AUDIO,video:a.stream_type===Wt.VIDEO,peerid:a.stream_id,subscribeRequestid:a.ssrcId,p2pid:this.store.p2pId,eventElapse:ua.measureFromSubscribeStart(this.store.clientId,a.ssrcId)})}}),this._gateway.signal.on(Sn.ON_P2P_OK,r=>{this.uid,this._uid}),this._gateway.signal.on(Sn.ON_PUBLISHED_USER_LIST,r=>{if(r==null||!r.users)return;ve("BLOCK_LOCAL_CLIENT")&&(r.users=r.users.filter(c=>!d_(c.string_id||c.stream_id,this.channelName)));let a=[],o=[];for(let c of r.users){let f=this._users.find(A=>A._uintid===c.stream_id);f?f._trust_in_room_=!0:(f=new i1(c.string_id||c.stream_id,c.stream_id),this._users.push(f),this.getListeners(Gn.PUBLISHED_USER_LIST).length===0&&(z.debug("[".concat(this._clientId,"] user online"),c.stream_id),this.safeEmit(Gn.USER_JOINED,f)));let g=Es.Audio&c.stream_type,v=(Es.Video|Es.LwoVideo)&c.stream_type,w=(65280&c.stream_type)!=0,T=g&&f.hasAudio,R=v&&f.hasVideo;v&&(f._trust_video_stream_added_state_=!0,f._video_added_=!0,f._videoSSRC=c.video_ssrc,f._rtxSsrcId=c.video_rtx),g&&(f._trust_audio_stream_added_state_=!0,f._audio_added_=!0,f._audioSSRC=c.audio_ssrc),g&&!T&&this.getListeners(Gn.PUBLISHED_USER_LIST).length===0&&(z.info("[".concat(this._clientId,"] remote user ").concat(f.uid," published audio")),this.safeEmit(Gn.USER_PUBLISHED,f,"audio")),v&&!R&&this.getListeners(Gn.PUBLISHED_USER_LIST).length===0&&(z.info("[".concat(this._clientId,"] remote user ").concat(f.uid," published video")),this.safeEmit(Gn.USER_PUBLISHED,f,"video")),(g&&!T||v&&!R||w)&&a.push(f),v&&this._p2pChannel.hasPendingRemoteMedia(f,"video")&&o.push({user:f,mediaType:"video"}),g&&this._p2pChannel.hasPendingRemoteMedia(f,"audio")&&o.push({user:f,mediaType:"audio"})}o.length>0&&(z.debug("[".concat(this._clientId,"] RE massSubscribe after reconnect ").concat(o.map(c=>"user: ".concat(c.user.uid,", mediaType: ").concat(c.mediaType)).join("; ")," ")),this.massSubscribe(o).catch(c=>{z.error("[".concat(this._clientId,"] mass resubscribe error"),c.toString())})),this.getListeners(Gn.PUBLISHED_USER_LIST).length>0?ve("ENABLE_DATASTREAM_2")?this._pendingPublishedUsers=a:(z.info("[".concat(this._clientId,"] client emit user-list event, users: ").concat(a.map(c=>c.uid).join(", "))),this.safeEmit(Gn.PUBLISHED_USER_LIST,a)):z.info("[".concat(this._clientId,"] client not emit user-list event case there is no user-list listener, users: ").concat(a.map(c=>c.uid).join(", ")))}),this._gateway.signal.on(Sn.ON_RTP_CAPABILITY_CHANGE,r=>{let{video_codec:a}=r;this._p2pChannel instanceof y8&&this._p2pChannel.updateRemoteRTPCapabilities(a.map(o=>o.toLowerCase()).filter(o=>{var c;return Tt(c=Object.keys(ob)).call(c,o)}))})}_handleP2PEvents(){this._gateway.signal.on(Sn.ON_USER_OFFLINE,()=>{this._p2pChannel.disconnectForReconnect()}),this._gateway.signal.on(Nr.PUBLISH,(r,a,o)=>{let{uid:c}=r;r.forEach(f=>{let{kind:g,ssrcs:v,mid:w,isMuted:T}=f;this._handleP2PAddAudioOrVideoStream(g,c,v[0].ssrcId,w);let R=this._users.find(A=>A.uid===c);return R&&this._p2pChannel instanceof Hl?this._p2pChannel.mockSubscribe(R,g,v[0].ssrcId,w).then(()=>{a()}).catch(o):a(),this._handleMuteStream(c,g,!!T)})}),this._gateway.signal.on(Nr.CALL,async(r,a,o)=>{if(this._p2pChannel instanceof Hl)try{var c;a(await this._p2pChannel.startP2P({turnServer:(c=this._joinInfo)===null||c===void 0?void 0:c.turnServer},r))}catch(f){o(f)}}),this._gateway.signal.on(Ut.P2P_CONNECTION,async r=>{this._p2pChannel instanceof Hl&&await this._p2pChannel.p2pConnect(r)}),this._gateway.signal.on(Nr.UNPUBLISH,async(r,a,o)=>{if(this._p2pChannel instanceof Hl){let{unpubMsg:c,uid:f}=r,g=this._users.find(v=>v.uid===f);if(!g)return z.warning("[".concat(this._clientId,"] can not find remote user, ignore mute event, uid: ").concat(f)),void a();try{c.forEach(async v=>{let{stream_type:w}=v,T=w===mi.Audio?Wt.AUDIO:Wt.VIDEO;await this._p2pChannel.unsubscribe(g,T),this._handleMuteStream(f,T,!0)}),a()}catch(v){o(v)}}}),this._gateway.signal.on(Nr.CONTROL,async(r,a)=>{let{action:o}=r;switch(o){case W0.MUTE_LOCAL_VIDEO:this._handleMuteStream(a,Wt.VIDEO,!0);break;case W0.MUTE_LOCAL_AUDIO:this._handleMuteStream(a,Wt.AUDIO,!0);break;case W0.UNMUTE_LOCAL_VIDEO:this._handleP2PAddAudioOrVideoStream("video",a),this._handleMuteStream(a,Wt.VIDEO,!1);break;case W0.UNMUTE_LOCAL_AUDIO:this._handleP2PAddAudioOrVideoStream("audio",a),this._handleMuteStream(a,Wt.AUDIO,!1)}}),this._gateway.signal.on(Nr.RESTART_ICE,async(r,a,o)=>{if(this._p2pChannel instanceof Hl)try{let{direction:c,iceParameter:f}=r;c!==oo.SEND_ONLY||f?a(await this._p2pChannel.restartICE(c,f)):(this._p2pChannel.handleDisconnect(c),a())}catch(c){o(c)}}),this._gateway.signal.on(Nr.CANDIDATE,r=>{if(this._p2pChannel instanceof Hl){let{candidate:a,direction:o}=r;this._p2pChannel.addRemoteCandidate(a,o)}}),this._p2pChannel.on(pn.RequestP2PRestartICE,async(r,a,o)=>{try{let{direction:c}=r;a(await this._gateway.sendExtensionMessage(Nr.RESTART_ICE,r,c===oo.SEND_ONLY))}catch(c){o(c)}}),this._p2pChannel.on(pn.LocalCandidate,r=>{this._gateway.sendExtensionMessage(Nr.CANDIDATE,JSON.stringify(r),!0)}),this._p2pChannel.on(pn.RequestP2PMuteLocal,async(r,a,o)=>{try{await this._gateway.sendExtensionMessage(Nr.CONTROL,r,!0),a()}catch(c){o(c)}}),this._p2pChannel.on(pn.RequestP2PUnmuteRemote,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.unmuteRemote(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.RequestP2PMuteRemote,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.muteRemote(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.StateChange,(r,a)=>{a===vi.Connected&&this._p2pChannel.republish()})}_handleP2PChannelEvents(){this._p2pChannel.on(pn.RequestMuteLocal,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.muteLocal(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.RequestUnmuteLocal,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.unmuteLocal(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.RequestRePublish,(r,a,o)=>{this.publish(r,!1).then(a).catch(o)}),this._p2pChannel.on(pn.RequestRePublishDataChannel,(r,a,o)=>{Ct.all(r.map(async c=>{await this._p2pChannel.publishDataChannel([c]);let f={streamId:c.id,ordered:c.ordered,maxRetransmits:c.maxRetransmits,metadata:c.metadata,channelId:c._originDataChannelId};try{await this._gateway.publishDataChannel(this._uid,f,!0)}catch(g){if(g.code!==ce.DISCONNECT_P2P)throw g}})).then(a).catch(o)}),this._p2pChannel.on(pn.RequestReSubscribe,async(r,a,o)=>{try{for(let{user:c,kind:f}of r)f===Wt.VIDEO?await this.subscribe(c,"video"):await this.subscribe(c,"audio");a()}catch(c){o(c)}}),this._p2pChannel.on(pn.RequestUpload,(r,a)=>{this._gateway.upload(r,a)}),this._p2pChannel.on(pn.RequestUploadStats,r=>{this._gateway.uploadWRTCStats(r)}),this._p2pChannel.on(pn.MediaReconnectStart,r=>{this.safeEmit(Gn.MEDIA_RECONNECT_START,r)}),this._p2pChannel.on(pn.MediaReconnectEnd,r=>{this.safeEmit(Gn.MEDIA_RECONNECT_END,r)}),this._p2pChannel.on(pn.NeedSignalRTT,r=>{r(this._gateway.getSignalRTT())}),this._p2pChannel.on(pn.RequestRestartICE,async r=>{if(this._p2pChannel instanceof Hl)return;let a=await this._p2pChannel.restartICE(r),o=await a.next();if(o.done)return;let c=o.value,f;try{f=await this._gateway.restartICE({iceParameters:c})}catch(v){return void a.throw(v)}let{iceParameters:g}=function(v){let w=v.iceParameters;return{iceParameters:{iceUfrag:w.iceUfrag,icePwd:w.icePwd}}}(f);await a.next({remoteIceParameters:g})}),this._p2pChannel.on(pn.RequestReconnect,async()=>{this._gateway.reconnect()}),this._p2pChannel.on(pn.RequestReconnectPC,async()=>{var r;let{iceParameters:a,dtlsParameters:o,rtpCapabilities:c}=await this._p2pChannel.startP2PConnection({turnServer:(r=this._joinInfo)===null||r===void 0?void 0:r.turnServer}),{gatewayEstablishParams:f,gatewayAddress:g}=await this._gateway.reconnectPC({iceParameters:a,dtlsParameters:o,rtpCapabilities:c}),{dtlsParameters:v,iceParameters:w,candidates:T,rtpCapabilities:R,setup:A,cname:L}=fle(f,g);await this._p2pChannel.connect(w,v,T,R,A,L),await this._p2pChannel.republish(),await this._p2pChannel.reSubscribe()}),this._p2pChannel.on(pn.RequestUnpublishForReconnectPC,async(r,a,o)=>{this._joinInfo&&this._uid!==void 0?(await this._gateway.unpublish(r,this._uid),a()):o()}),this._p2pChannel.on(pn.P2PLost,()=>{this.safeEmit(Gn.P2P_LOST,this.store.uid)}),this._p2pChannel.on(pn.UpdateVideoEncoder,r=>{r._encoderConfig&&this._gateway.setVideoProfile(r._encoderConfig)}),this._p2pChannel.on(pn.ConnectionTypeChange,r=>{this.safeEmit(Gn.IS_USING_CLOUD_PROXY,r)}),this._p2pChannel.on(pn.RequestLowStreamParameter,r=>{r(this._lowStreamParameter||{width:160,height:120,framerate:15,bitrate:50})}),this._p2pChannel.on(pn.QueryClientConnectionState,r=>{r(this.connectionState)})}getKeyMetrics(){return this.store.keyMetrics}async enableContentInspect(r){if(this.connectionState!=="CONNECTED"||!this._joinInfo)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client did not join channel"));if(this._inspect)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Inspect content service already in connecting/connected state"));if(!r)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] inspectConfig is necessary"));if(!r.inspectType||!Array.isArray(r.inspectType))throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] inspectConfig.inspectType is necessary and is an instance of Array."));{let a=[...new Set(r.inspectType)];a.forEach(o=>{var c;if(!Tt(c=["supervise","moderation"]).call(c,o))throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] ").concat(o," is not a valid inspect type."))}),r.inspectType=a}if(r&&r.extraInfo&&r.extraInfo.length>1024)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] inspectConfig.extraInfo length cannot exceed 1024 bytes"));try{let a=new _8(r);this._inspect=a,this.handleVideoInspectEvents(this._inspect),await a.init({appId:this._joinInfo.appId,areaCode:"",cname:this._joinInfo.cname,sid:this._joinInfo.sid,token:this._joinInfo.token,uid:this._joinInfo.uid,cid:this._joinInfo.cid,vid:this._joinInfo.vid?Number(this._joinInfo.vid):0},Mr)}catch(a){throw Array.isArray(a)?a[0]:a}}async disableContentInspect(){if(!this._inspect)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] inspectVideoContent not started"));try{this._inspect.close(),this._inspect=void 0}catch(r){throw Array.isArray(r)?r[0]:r}}async setImageModeration(r,a){if(Sm(r,"enabled"),r){if(!a)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] config is necessary"));if(Ti(a.interval,"interval",1e3,1/0),a&&a.extraInfo&&a.extraInfo.length>1024)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] config.extraInfo length cannot exceed 1024 bytes"));if(a&&a.vendor&&a.vendor.length>1024)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] config.vendor length cannot exceed 1024 bytes"));if(this.connectionState!=="CONNECTED"||!this._joinInfo)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,'] can not enable image moderation, not joined"'));try{if(this._moderation)return void this._moderation.updateConfig(a);let o=new E$(a);this._moderation=o,this.handleImageModerationEvents(this._moderation),await o.init({appId:this._joinInfo.appId,areaCode:"",cname:this._joinInfo.cname,sid:this._joinInfo.sid,token:this._joinInfo.token,uid:this._joinInfo.uid,cid:this._joinInfo.cid,vid:this._joinInfo.vid?Number(this._joinInfo.vid):0},Mr)}catch(o){throw Array.isArray(o)?o[0]:o}}else{if(!this._moderation)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] image moderation not started"));try{this._moderation.close(),this._moderation.removeAllListeners(),this._moderation=void 0}catch(o){throw Array.isArray(o)?o[0]:o}}}setP2PTransport(r){if(function(a){ls(a,"transport",["default","auto","relay","sd-rtn"])}(r),this.mode!=="p2p")throw new De(ce.INVALID_OPERATION,"only p2p mode can set p2pTransport");this.store.p2pTransport=r,z.info("[".concat(this._clientId,"] set client p2pTransport to ").concat(r))}handleImageModerationEvents(r){r.on(Ph.CONNECTION_STATE_CHANGE,(a,o)=>{if(this.safeEmit(Gn.IMAGE_MODERATION_CONNECTION_STATE_CHANGE,a,o),a===gd.CONNECTED){if(this.connectionState!=="CONNECTED")throw this.setImageModeration(!1),new De(ce.OPERATION_ABORTED,"Image moderation was cancelled because it left the channel");r.inspectImage()}}),r.on(Ph.CLIENT_LOCAL_VIDEO_TRACK,a=>{a(this.localTracks.filter(o=>o.trackMediaType==="video")[0])})}handleVideoInspectEvents(r){r.on(Os.CONNECTION_STATE_CHANGE,(a,o)=>{if(this.safeEmit(Gn.CONTENT_INSPECT_CONNECTION_STATE_CHANGE,a,o),o===Su.CONNECTED){if(this.connectionState!=="CONNECTED")return void this.safeEmit(Gn.CONTENT_INSPECT_ERROR,new De(ce.OPERATION_ABORTED,"Content inspect was cancelled because it left the channel"));r.inspectImage()}}),r.on(Os.INSPECT_RESULT,(a,o)=>{var c;if((o==null?void 0:o.code)===ce.INVALID_OPERATION&&this.connectionState==="DISCONNECTED")return z.debug("Stop inspect content because that has left channel"),this==null||(c=this._inspect)===null||c===void 0||c.close(),void(this._inspect=void 0);this.safeEmit(Gn.CONTENT_INSPECT_RESULT,a,o)}),r.on(Os.CLIENT_LOCAL_VIDEO_TRACK,a=>{a(this.localTracks.filter(o=>o.trackMediaType==="video")[0])})}getJoinChannelServiceRecords(){return z.debug("getJoinChannelServiceRecords"),this.store.joinChannelServiceRecords}async setPublishAudioFilterEnabled(r){Sm(r,"enabled"),Ri("ENABLE_PUBLISH_AUDIO_FILTER",r),this._joinInfo&&await this._gateway.setPublishAudioFilterEnabled(r)}_handleResetAddStream(r,a){switch(a){case"audio":r._audio_added_=!1,r._trust_audio_stream_added_state_=!0;break;case"video":r._video_added_=!1,r._trust_video_stream_added_state_=!0}}},vt(Nt.prototype,"leave",[jce],Object.getOwnPropertyDescriptor(Nt.prototype,"leave"),Nt.prototype),vt(Nt.prototype,"publish",[Uce],Object.getOwnPropertyDescriptor(Nt.prototype,"publish"),Nt.prototype),vt(Nt.prototype,"unpublish",[Fce],Object.getOwnPropertyDescriptor(Nt.prototype,"unpublish"),Nt.prototype),vt(Nt.prototype,"subscribe",[Bce],Object.getOwnPropertyDescriptor(Nt.prototype,"subscribe"),Nt.prototype),vt(Nt.prototype,"presubscribe",[Vce],Object.getOwnPropertyDescriptor(Nt.prototype,"presubscribe"),Nt.prototype),vt(Nt.prototype,"massSubscribe",[zce],Object.getOwnPropertyDescriptor(Nt.prototype,"massSubscribe"),Nt.prototype),vt(Nt.prototype,"unsubscribe",[Hce],Object.getOwnPropertyDescriptor(Nt.prototype,"unsubscribe"),Nt.prototype),vt(Nt.prototype,"massUnsubscribe",[Gce],Object.getOwnPropertyDescriptor(Nt.prototype,"massUnsubscribe"),Nt.prototype),vt(Nt.prototype,"setLowStreamParameter",[Wce],Object.getOwnPropertyDescriptor(Nt.prototype,"setLowStreamParameter"),Nt.prototype),vt(Nt.prototype,"enableDualStream",[$ce],Object.getOwnPropertyDescriptor(Nt.prototype,"enableDualStream"),Nt.prototype),vt(Nt.prototype,"disableDualStream",[Kce],Object.getOwnPropertyDescriptor(Nt.prototype,"disableDualStream"),Nt.prototype),vt(Nt.prototype,"setClientRole",[qce],Object.getOwnPropertyDescriptor(Nt.prototype,"setClientRole"),Nt.prototype),vt(Nt.prototype,"setProxyServer",[Yce],Object.getOwnPropertyDescriptor(Nt.prototype,"setProxyServer"),Nt.prototype),vt(Nt.prototype,"setTurnServer",[Xce],Object.getOwnPropertyDescriptor(Nt.prototype,"setTurnServer"),Nt.prototype),vt(Nt.prototype,"setLicense",[Jce],Object.getOwnPropertyDescriptor(Nt.prototype,"setLicense"),Nt.prototype),vt(Nt.prototype,"startProxyServer",[Qce],Object.getOwnPropertyDescriptor(Nt.prototype,"startProxyServer"),Nt.prototype),vt(Nt.prototype,"stopProxyServer",[Zce],Object.getOwnPropertyDescriptor(Nt.prototype,"stopProxyServer"),Nt.prototype),vt(Nt.prototype,"setLocalAccessPointsV2",[ede],Object.getOwnPropertyDescriptor(Nt.prototype,"setLocalAccessPointsV2"),Nt.prototype),vt(Nt.prototype,"setLocalAccessPoints",[tde],Object.getOwnPropertyDescriptor(Nt.prototype,"setLocalAccessPoints"),Nt.prototype),vt(Nt.prototype,"setRemoteDefaultVideoStreamType",[nde],Object.getOwnPropertyDescriptor(Nt.prototype,"setRemoteDefaultVideoStreamType"),Nt.prototype),vt(Nt.prototype,"setRemoteVideoStreamType",[ide],Object.getOwnPropertyDescriptor(Nt.prototype,"setRemoteVideoStreamType"),Nt.prototype),vt(Nt.prototype,"setStreamFallbackOption",[rde],Object.getOwnPropertyDescriptor(Nt.prototype,"setStreamFallbackOption"),Nt.prototype),vt(Nt.prototype,"setEncryptionConfig",[sde],Object.getOwnPropertyDescriptor(Nt.prototype,"setEncryptionConfig"),Nt.prototype),vt(Nt.prototype,"renewToken",[ade],Object.getOwnPropertyDescriptor(Nt.prototype,"renewToken"),Nt.prototype),vt(Nt.prototype,"enableAudioVolumeIndicator",[ode],Object.getOwnPropertyDescriptor(Nt.prototype,"enableAudioVolumeIndicator"),Nt.prototype),vt(Nt.prototype,"startLiveStreaming",[lde],Object.getOwnPropertyDescriptor(Nt.prototype,"startLiveStreaming"),Nt.prototype),vt(Nt.prototype,"setLiveTranscoding",[cde],Object.getOwnPropertyDescriptor(Nt.prototype,"setLiveTranscoding"),Nt.prototype),vt(Nt.prototype,"stopLiveStreaming",[dde],Object.getOwnPropertyDescriptor(Nt.prototype,"stopLiveStreaming"),Nt.prototype),vt(Nt.prototype,"addInjectStreamUrl",[ude],Object.getOwnPropertyDescriptor(Nt.prototype,"addInjectStreamUrl"),Nt.prototype),vt(Nt.prototype,"removeInjectStreamUrl",[hde],Object.getOwnPropertyDescriptor(Nt.prototype,"removeInjectStreamUrl"),Nt.prototype),vt(Nt.prototype,"startChannelMediaRelay",[fde],Object.getOwnPropertyDescriptor(Nt.prototype,"startChannelMediaRelay"),Nt.prototype),vt(Nt.prototype,"updateChannelMediaRelay",[pde],Object.getOwnPropertyDescriptor(Nt.prototype,"updateChannelMediaRelay"),Nt.prototype),vt(Nt.prototype,"stopChannelMediaRelay",[mde],Object.getOwnPropertyDescriptor(Nt.prototype,"stopChannelMediaRelay"),Nt.prototype),vt(Nt.prototype,"sendCustomReportMessage",[gde],Object.getOwnPropertyDescriptor(Nt.prototype,"sendCustomReportMessage"),Nt.prototype),vt(Nt.prototype,"pickSVCLayer",[vde],Object.getOwnPropertyDescriptor(Nt.prototype,"pickSVCLayer"),Nt.prototype),vt(Nt.prototype,"setRTMConfig",[yde],Object.getOwnPropertyDescriptor(Nt.prototype,"setRTMConfig"),Nt.prototype),vt(Nt.prototype,"enableContentInspect",[_de],Object.getOwnPropertyDescriptor(Nt.prototype,"enableContentInspect"),Nt.prototype),vt(Nt.prototype,"disableContentInspect",[Ede],Object.getOwnPropertyDescriptor(Nt.prototype,"disableContentInspect"),Nt.prototype),vt(Nt.prototype,"setImageModeration",[wde],Object.getOwnPropertyDescriptor(Nt.prototype,"setImageModeration"),Nt.prototype),vt(Nt.prototype,"setP2PTransport",[Sde],Object.getOwnPropertyDescriptor(Nt.prototype,"setP2PTransport"),Nt.prototype),vt(Nt.prototype,"getJoinChannelServiceRecords",[bde],Object.getOwnPropertyDescriptor(Nt.prototype,"getJoinChannelServiceRecords"),Nt.prototype),vt(Nt.prototype,"setPublishAudioFilterEnabled",[Cde],Object.getOwnPropertyDescriptor(Nt.prototype,"setPublishAudioFilterEnabled"),Nt.prototype),Nt);class A3{constructor(a,o){X(this,"id",0),X(this,"element",void 0),X(this,"peerPair",void 0),X(this,"context",void 0),X(this,"audioPlayerElement",void 0),X(this,"audioTrack",void 0),A3.count+=1,this.id=A3.count,this.element=a,this.context=o}initPeers(){this.peerPair=[new RTCPeerConnection,new RTCPeerConnection],this.peerPair[1].ontrack=a=>{let o=document.createElement("audio");o.srcObject=new MediaStream([a.track]),o.play(),this.audioPlayerElement=o}}async switchSdp(){if(!this.peerPair)return;let a=async(c,f)=>{let g=f==="offer"?await c.createOffer():await c.createAnswer();return await c.setLocalDescription(g),c.iceGatheringState==="complete"?c.localDescription:new Ct(v=>{c.onicegatheringstatechange=()=>{c.iceGatheringState==="complete"&&v(c.localDescription)}})},o=async(c,f)=>await c.setRemoteDescription(f);try{let c=await a(this.peerPair[0],"offer");await o(this.peerPair[1],c);let f=await a(this.peerPair[1],"answer");await o(this.peerPair[0],f)}catch(c){throw new De(ce.LOCAL_AEC_ERROR,c.toString()).print()}}async getTracksFromMediaElement(a){if(this.audioTrack)return this.audioTrack;let o;try{a instanceof HTMLVideoElement&&(a.captureStream?a.captureStream():a.mozCaptureStream()),o=this.context.createMediaStreamDestination(),this.context.createMediaElementSource(a).connect(o)}catch(f){throw new De(ce.LOCAL_AEC_ERROR,f.toString()).print()}if(!o)throw new De(ce.LOCAL_AEC_ERROR,"no dest node when local aec").print();let c=o.stream.getAudioTracks()[0];return this.audioTrack=c,c}getElement(){return this.element}async startEchoCancellation(){this.context.resume(),this.peerPair&&this.close(),this.initPeers();let a=this.element,o=await this.getTracksFromMediaElement(a);this.peerPair&&this.peerPair[0].addTrack(o),await this.switchSdp()}close(){z.debug("close echo cancellation unit, id is",this.id),this.audioPlayerElement&&this.audioPlayerElement.pause(),this.peerPair&&this.peerPair.forEach(a=>{a.close()}),this.peerPair=void 0,this.audioPlayerElement=void 0}}var Rde,T8;X(A3,"count",0);let UNe=window.AudioContext||window.webkitAudioContext,FNe=new(Rde=hn({report:$t}),vt((T8=class{constructor(){X(this,"units",[]),X(this,"context",void 0)}processExternalMediaAEC(r){if(!this._doesEnvironmentNeedAEC())return z.debug("the system does not need to process local aec"),-1;this.context||(this.context=new UNe);let a=this.units.find(o=>o&&o.getElement()===r);return a||(a=new A3(r,this.context),this.units.push(a)),a.startEchoCancellation(),z.debug("start processing local audio echo cancellation, id is",a.id),a.id}_doesEnvironmentNeedAEC(){return ni().name!==pi.SAFARI}}).prototype,"processExternalMediaAEC",[Rde],Object.getOwnPropertyDescriptor(T8.prototype,"processExternalMediaAEC"),T8.prototype),T8);function xde(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Ade(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?xde(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):xde(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let x$=window||document;function Ide(r){let a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!x$)return;let o=Jr._cspEventHandlerPointer;if(o&&a)return void console.error(o,a);let c=f=>{if(!(f&&f.blockedURI&&(Jr.onSecurityPolicyViolation||Jr.getListeners(Gf.SECURITY_POLICY_VIOLATION).length>0)))return;let g=f.blockedURI;ve("CSP_DETECTED_HOSTNAME_LIST").some(v=>Tt(g).call(g,v))&&(Jr.onSecurityPolicyViolation&&typeof Jr.onSecurityPolicyViolation=="function"&&Jr.onSecurityPolicyViolation(f),Jr.getListeners(Gf.SECURITY_POLICY_VIOLATION).length>0&&Jr.safeEmit(Gf.SECURITY_POLICY_VIOLATION,f))};o&&x$.removeEventListener("securitypolicyviolation",o),(a||r&&typeof r=="function"||Jr.getListeners(Gf.SECURITY_POLICY_VIOLATION).length>0)&&x$.addEventListener("securitypolicyviolation",c),Jr._cspEventHandlerPointer=c}Ri("PROCESS_ID","process-".concat(Li(8,""),"-").concat(Li(4,""),"-").concat(Li(4,""),"-").concat(Li(4,""),"-").concat(Li(12,""))),function(){let r;try{r=window.localStorage.getItem("websdk_ng_global_parameter")}catch(a){return void z.error("Error loading sdk config",a.message)}if(r)try{let a=JSON.parse(window.atob(r)),o=Date.now();z.debug("Loading global parameters from cache",a),Object.keys(a).forEach(c=>{if(Object.prototype.hasOwnProperty.call(is,c)){let{value:f,expires:g}=a[c];if(g&&g<=o)return;z0[c]=f,is[c]=f}})}catch(a){z.error("Error loading mutableParamsCache: ".concat(r),a.message)}}(),Array.isArray(z0.AREAS)&&z0.AREAS.length>0&&zG(z0.AREAS,!0);let Nde=(r,a,o)=>{z.debug("setParameter key:".concat(r,", value:").concat(JSON.stringify(a))),Ri(r,a,o)},Jr=function(r){let a=new tr,o=r,c={getListeners:a.getListeners.bind(a),on:(f,g)=>(function(v,w){v===Gf.SECURITY_POLICY_VIOLATION&&Ide(w,!0)}(f,g),a.on.bind(a)(f,g)),addListener:a.addListener.bind(a),once:a.once.bind(a),off:a.off.bind(a),removeAllListeners:a.removeAllListeners.bind(a),emit:a.emit.bind(a),safeEmit:a.safeEmit.bind(a)};return Ade(Ade({},o),c)}({__TRACK_LIST__:Ab,VERSION:pd,BUILD:TG,ESM_BUNDLER:!1,ESM:!1,UMD:!0,DEV:!1,setParameter:Nde,getParameter:ve,getSupportedCodec:async function(){let r={audio:[],video:[]};try{let a=new RTCPeerConnection,o=await async function(c){let f;return Jn().supportUnifiedPlan?(c.addTransceiver("video",{direction:"recvonly"}),c.addTransceiver("audio",{direction:"recvonly"}),f=(await c.createOffer()).sdp):f=(await c.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})).sdp,f}(a);if(!o)return r;a.close(),a=null,r=function(c){let f={video:[],audio:[]};return c.match(/ VP8/i)&&f.video.push("VP8"),c.match(/ VP9/i)&&f.video.push("VP9"),c.match(/ AV1/i)&&f.video.push("AV1"),c.match(/ H264/i)&&f.video.push("H264"),c.match(/ H265/i)&&f.video.push("H265"),c.match(/ opus/i)&&f.audio.push("OPUS"),c.match(/ PCMU/i)&&f.audio.push("PCMU"),c.match(/ PCMA/i)&&f.audio.push("PCMA"),c.match(/ G722/i)&&f.audio.push("G722"),f}(o)}catch(a){throw new De(ce.CREATE_OFFER_FAILED,a.toString&&a.toString()).print()}return r},checkSystemRequirements:function(){let r=$t.reportApiInvoke(null,{name:qr.CHECK_SYSTEM_REQUIREMENTS,options:[],tag:vr.TRACER}),a=!1;try{let g=window.RTCPeerConnection,v=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia,w=window.WebSocket;a=!!(g&&v&&w),a&&fG()&&function(T){let R=ni();return!(R.name!==pi.CHROME||!R.osVersion)&&Number(R.version)<T}(75)&&new g().close()}catch(g){return z.error("check system requirement failed: ",g),!1}let o=!1,c=ni();c.name===pi.CHROME&&Number(c.version)>=58&&(Ih.engine.name!=="WebKit"||function(){let g=ni();if(sk()){if(g.os===vs.MAC_OS)return!0;if(g.os===vs.IOS){let v=Ih.os.version&&Ih.os.version.split(".");if(v&&Number(v[0])===14&&v[1]&&Number(v[1])>=3||v&&Number(v[0])>14)return!0}}return!1}())&&(o=!0),(c.name===pi.FIREFOX&&Number(c.version)>=56||c.name===pi.OPERA&&Number(c.version)>=45||c.name===pi.SAFARI&&Number(c.version)>=11||c.name==="WebKit"&&(ca()||Eu())&&c.osVersion&&Number(c.osVersion.split(".")[0])>=11||fie()||ni().name===pi.QQ)&&(o=!0),z.debug("checkSystemRequirements, api:",a,"browser",o);let f=a&&o;return r.onSuccess(f),f},getDevices:function(r){return kc.enumerateDevices(!0,!0,r)},getMicrophones:function(r){return kc.getRecordingDevices(r)},getCameras:function(r){return kc.getCamerasDevices(r)},getElectronScreenSources:iae,getPlaybackDevices:function(r){return kc.getSpeakers(r)},createClient:function(){var r;let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{codec:"vp8",audioCodec:"opus",mode:"rtc"},o=$t.reportApiInvoke(null,{name:qr.CREATE_CLIENT,options:[a],tag:vr.TRACER});try{(function(c){ls(c.codec,"config.codec",["vp8","vp9","av1","h264","h265"]),ls(c.mode,"config.mode",["rtc","live","p2p"]),c.audioCodec!==void 0&&ls(c.audioCodec,"config.audioCodec",["opus","pcmu","pcma","g722"]),c.proxyServer!==void 0&&Fs(c.proxyServer,"config.proxyServer",1,1e4),c.turnServer!==void 0&&bie(c.turnServer),c.httpRetryConfig!==void 0&&Sie(c.httpRetryConfig),c.websocketRetryConfig!==void 0&&Sie(c.websocketRetryConfig)})(a)}catch(c){throw o.onError(c),c}return(oie(16,0)||lie(16,0))&&(a.codec==="vp9"&&(a.codec="vp8",z.debug("browser not support vp9, force use vp8")),Ri("UNSUPPORTED_VIDEO_CODEC",["vp9"])),a.audioCodec===void 0&&(a.audioCodec="opus"),o.onSuccess(),new jNe(Sd(Sd({forceWaitGatewayResponse:!0},a),{},{role:Tt(r=["rtc","p2p"]).call(r,a.mode)?"host":a.role||"audience"}))},createCameraVideoTrack:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=ve("CAMERA_CAPTURE_CONFIG"),o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CREATE_CAM_VIDEO_TRACK,options:[nr({},r),a]});a&&(r.encoderConfig=a);let c=Jk(r),f=Li(8,"track-cam-"),g=null,v=r.encoderConfig==="720p_auto";z.info("start create camera video track with config",JSON.stringify(r),"trackId",f);try{g=(await Dc({video:c},f)).getVideoTracks()[0]||null}catch(T){throw o.onError(T),T}if(!g){let T=new Ke(ce.UNEXPECTED_ERROR,"can not find track in media stream");return o.onError(T),T.throw(z)}r.optimizationMode&&XW(f,g,r,Xf(r.encoderConfig));let w=new YW(g,r,c,r.scalabiltyMode?Kk(r.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},r.optimizationMode,f);return v&&w.startMonitorStats(),o.onSuccess(w.getTrackId()),z.info("create camera video success, trackId:",f),w},createCustomVideoTrack:function(r){let a=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CREATE_CUSTOM_VIDEO_TRACK,options:[r]}),o=new Di(r.mediaStreamTrack,{width:r.width,height:r.height,frameRate:r.frameRate,bitrateMax:r.bitrateMax,bitrateMin:r.bitrateMin},r.scalabiltyMode?Kk(r.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},r.optimizationMode,Li(8,"track-cus-"),[Hi.CUSTOM_TRACK]);return a.onSuccess(o.getTrackId()),z.info("create custom video track success with config",r,"trackId",o.getTrackId()),o},createScreenVideoTrack:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"disable",o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CREATE_SCREEN_VIDEO_TRACK,options:[nr({},r),a]}),c=r.encoderConfig==="720p_auto";r.encoderConfig?typeof r.encoderConfig=="string"||r.encoderConfig.width&&r.encoderConfig.height||(r.encoderConfig.width={max:1920},r.encoderConfig.height={max:1080}):r.encoderConfig="1080p_2";let f=function(L){let U={};L.screenSourceType&&(U.mediaSource=L.screenSourceType),L.extensionId&&U0()&&(U.extensionId=L.extensionId);let{displaySurface:F,selfBrowserSurface:Z,surfaceSwitching:W,systemAudio:K}=L;(uG(107)||sie(107)||cie(93))&&(F&&(ls(F,"displaySurface",["browser","window","monitor"]),U.displaySurface=F),Z?(ls(Z,"selfBrowserSurface",["exclude","include"]),U.selfBrowserSurface=Z):U.selfBrowserSurface="include",W&&(ls(W,"surfaceSwitching",["exclude","include"]),U.surfaceSwitching=W)),(uG(105)||sie(105)||cie(91))&&K&&(ls(K,"systemAudio",["exclude","include"]),U.systemAudio=K),L.electronScreenSourceId&&(U.sourceId=L.electronScreenSourceId);let oe=L.encoderConfig?UW(L.encoderConfig):null;return U.mandatory={chromeMediaSource:"desktop",maxWidth:oe?oe.width:void 0,maxHeight:oe?oe.height:void 0},oe&&(oe.frameRate&&(typeof oe.frameRate=="number"?(U.mandatory.maxFrameRate=oe.frameRate,U.mandatory.minFrameRate=oe.frameRate):(U.mandatory.maxFrameRate=oe.frameRate.max||oe.frameRate.ideal||oe.frameRate.exact||void 0,U.mandatory.minFrameRate=oe.frameRate.min||oe.frameRate.ideal||oe.frameRate.exact||void 0),U.frameRate=oe.frameRate),oe.width&&(U.width=oe.width),oe.height&&(U.height=oe.height)),U}(r),g=Li(8,"track-scr-v-"),v=null,w=null,T=Jn();if(!T.supportShareAudio&&a==="enable"){let L=new Ke(ce.NOT_SUPPORTED,"your browser or platform is not support share-screen with audio");return o.onError(L),L.throw(z)}z.info("start create screen video track with config",r,"withAudio",a,"trackId",g);try{let L=await Dc({screen:f,screenAudio:a==="auto"?T.supportShareAudio:a==="enable"},g);v=L.getVideoTracks()[0]||null,w=L.getAudioTracks()[0]||null}catch(L){throw o.onError(L),L}if(!v){let L=new Ke(ce.UNEXPECTED_ERROR,"can not find track in media stream");return o.onError(L),L.throw(z)}if(!w&&a==="enable"){v&&v.stop();let L=new Ke(ce.SHARE_AUDIO_NOT_ALLOWED);return o.onError(L),L.throw(z)}r.optimizationMode||(r.optimizationMode="detail"),r.optimizationMode&&(XW(g,v,r,r.encoderConfig&&UW(r.encoderConfig)||void 0),r.encoderConfig&&typeof r.encoderConfig!="string"&&(r.encoderConfig.bitrateMin=r.encoderConfig.bitrateMax));let R=new Di(v,r.encoderConfig?UW(r.encoderConfig):{},r.scalabiltyMode?Kk(r.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},r.optimizationMode,g,[Hi.SCREEN_TRACK]);if(c&&R.startMonitorStats(),!w)return o.onSuccess(R.getTrackId()),z.info("create screen video track success","video:",R.getTrackId()),R;let A=new br(w,void 0,Li(8,"track-scr-a-"),!1);return o.onSuccess([R.getTrackId(),A.getTrackId()]),z.info("create screen video track success","video:",R.getTrackId(),"audio:",A.getTrackId()),[R,A]},createMicrophoneAndCameraTracks:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=ve("CAMERA_CAPTURE_CONFIG"),c=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CREATE_MIC_AND_CAM_TRACKS,options:[r,a,o]});o&&(a.encoderConfig=o);let f=a.encoderConfig==="720p_auto",g=Jk(a),v=fae(r),w=Li(8,"track-mic-"),T=Li(8,"track-cam-"),R=null,A=null;z.info("start create camera video track(".concat(T,") and microphone audio track(").concat(w,") with config, audio: ").concat(JSON.stringify(r),", video: ").concat(JSON.stringify(a)));try{let F=await Dc({audio:v,video:g},"".concat(w,"-").concat(T));R=F.getAudioTracks()[0],A=F.getVideoTracks()[0]}catch(F){throw c.onError(F),F}if(!R||!A){let F=new Ke(ce.UNEXPECTED_ERROR,"can not find tracks in media stream");return c.onError(F),F.throw(z)}a.optimizationMode&&XW(T,A,a,Xf(a.encoderConfig));let L=new Qk(R,r,v,w),U=new YW(A,a,g,a.scalabiltyMode?Kk(a.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},a.optimizationMode,T);return f&&U.startMonitorStats(),c.onSuccess([L.getTrackId(),U.getTrackId()]),z.info("create camera video track(".concat(T,") and microphone audio track(").concat(w,") success")),[L,U]},createMicrophoneAudioTrack:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CREATE_MIC_AUDIO_TRACK,options:[r]}),o=fae(r),c=Li(8,"track-mic-"),f=null;z.info("start create microphone audio track with config",JSON.stringify(r),"trackId",c);try{f=(await Dc({audio:o},c)).getAudioTracks()[0]||null}catch(v){throw a.onError(v),v}if(!f){let v=new Ke(ce.UNEXPECTED_ERROR,"can not find track in media stream");return a.onError(v),v.throw(z)}let g=new Qk(f,r,o,c);return a.onSuccess(g.getTrackId()),z.info("create microphone audio track success, trackId:",c),g},createCustomAudioTrack:function(r){let a=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CREATE_CUSTOM_AUDIO_TRACK,options:[r]}),o=new br(r.mediaStreamTrack,r.encoderConfig?qk(r.encoderConfig):{},Li(8,"track-cus-"),!1);return z.info("create custom audio track success with config",r,"trackId",o.getTrackId()),a.onSuccess(o.getTrackId()),o},createBufferSourceAudioTrack:async function(r){var a;let{cacheOnlineFile:o,encoderConfig:c}=r,{source:f}=r,g={source:f instanceof AudioBuffer?"AudioBuffer":f instanceof File?(a=File.name)!==null&&a!==void 0?a:"File":f,cacheOnlineFile:o,encoderConfig:c},v=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CREATE_BUFFER_AUDIO_TRACK,options:[g]});if(ve("DISABLE_WEBAUDIO"))throw new Ke(ce.NOT_SUPPORTED,"can not create BufferSourceAudioTrack when WebAudio disabled");let w=Li(8,"track-buf-");z.info("start create buffer source audio track with config",JSON.stringify(g),"trackId",w);let T=f;if(!(f instanceof AudioBuffer))try{f=await async function(L,U){let F=null;if(typeof L=="string"){let W=Zae.get(L);if(W)return z.debug("use cached audio resource: ",L),W;try{F=(await Nh(()=>Lo.get(L,{responseType:"arraybuffer"}),void 0,void 0,{maxRetryCount:3})).data}catch(K){throw new Ke(ce.FETCH_AUDIO_FILE_FAILED,K.toString())}}else F=await new Ct((W,K)=>{let oe=new FileReader;oe.onload=ue=>{ue.target?W(ue.target.result):K(new Ke(ce.READ_LOCAL_AUDIO_FILE_ERROR))},oe.onerror=()=>{K(new Ke(ce.READ_LOCAL_AUDIO_FILE_ERROR))},oe.readAsArrayBuffer(L)});let Z=await function(W){let K=Lb();return new Ct((oe,ue)=>{K.decodeAudioData(W,xe=>{oe(xe)},xe=>{ue(new Ke(ce.DECODE_AUDIO_FILE_FAILED,xe.toString()))})})}(F);return typeof L=="string"&&U&&Zae.set(L,Z),Z}(f,o)}catch(L){return v.onError(L),L.throw(z)}let R=new L4e(f),A=new P4e(T,R,c?qk(c):{},w);return z.info("create buffer source audio track success, trackId:",w),v.onSuccess(A.getTrackId()),A},setAppType:function(r){if(z.debug("setAppType: ".concat(r)),!(Number.isInteger(r)&&r>=0))throw z.debug("Invalid appType"),new De(ce.INVALID_PARAMS,"invalid app type",r);Ri("APP_TYPE",Math.floor(r))},setLogLevel:function(r){z.setLogLevel(r)},enableLogUpload:function(){ve("USE_NEW_LOG")?Ri("UPLOAD_LOG",!0):z.enableLogUpload()},disableLogUpload:function(){ve("USE_NEW_LOG")?Ri("UPLOAD_LOG",!1):z.disableLogUpload()},createChannelMediaRelayConfiguration:function(){return new Ule},checkAudioTrackIsActive:async function(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3,o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CHECK_AUDIO_TRACK_IS_ACTIVE,options:[a]});if(!(r instanceof br||r instanceof Mb)){let T=new De(ce.INVALID_TRACK,"the parameter is not a audio track");return o.onError(T),T.throw()}a&&a<1e3&&(a=1e3);let c=r instanceof br?r.getTrackLabel():"remote_track",f=r.getVolumeLevel(),g=f,v=f,w=Date.now();return new Ct(T=>{let R=setInterval(()=>{let A=r.getVolumeLevel();g=A>g?A:g,v=A<v?A:v;let L=g-v>1e-4,U=Date.now()-w;if(L||U>a){clearInterval(R);let F=L,Z={duration:U,deviceLabel:c,maxVolumeLevel:g,result:F};z.info("[track-".concat(r.getTrackId(),"] check audio track active completed. ").concat(JSON.stringify(Z))),o.onSuccess(Z),T(F)}},200)})},checkVideoTrackIsActive:async function(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3,o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:qr.CHECK_VIDEO_TRACK_IS_ACTIVE,options:[a]});if(!(r instanceof Di||r instanceof kb)){let L=new De(ce.INVALID_TRACK,"the parameter is not a video track");return o.onError(L),L.throw()}a&&a<1e3&&(a=1e3);let c=r instanceof Di?r.getTrackLabel():"remote_track",f=r.getMediaStreamTrack(!0),g=document.createElement("video");g.style.width="1px",g.style.height="1px",g.setAttribute("muted",""),g.muted=!0,g.setAttribute("playsinline",""),g.controls=!1,(ys()||sk())&&(g.style.opacity="0.01",g.style.position="fixed",g.style.left="0",g.style.top="0",document.body.appendChild(g)),g.srcObject=new MediaStream([f]),g.play();let v=document.createElement("canvas");v.width=160,v.height=120;let w=0,T=0;try{let L=Date.now();w=await function(U,F,Z,W){let K,oe=0,ue=null;return new Ct((xe,Ne)=>{function ke(){oe>W&&K&&(K(),xe(oe));let He=Z.getContext("2d");if(!He){let ft=new De(ce.UNEXPECTED_ERROR,"can not get canvas 2d context.");return z.error(ft.toString()),void Ne(ft)}He.drawImage(U,0,0,160,120);let lt=He.getImageData(0,0,Z.width,Z.height),ut=Math.floor(lt.data.length/3);if(ue){for(let ft=0;ft<ut;ft+=3)if(lt.data[ft]!==ue[ft])return oe+=1,void(ue=lt.data);ue=lt.data}else ue=lt.data}setTimeout(()=>{K&&(K(),xe(oe))},F),K=HW(()=>{ke()},30)})}(g,a,v,4),T=Date.now()-L}catch(L){throw o.onError(L),L}LNe===pi.SAFARI&&(g.pause(),g.remove()),g.srcObject=null;let R=w>4,A={duration:T,changedPicNum:w,deviceLabel:c,result:R};return z.info("[track-".concat(r.getTrackId(),"] check video track active completed. ").concat(JSON.stringify(A))),o.onSuccess(A),R},setArea:zG,audioElementPlayCenter:ko,resumeAudioContext:function(){ko.autoResumeAfterInterruption(!0)},processExternalMediaAEC:function(r){FNe.processExternalMediaAEC(r)},registerExtensions:function(r){let a=ve("PLUGIN_INFO")||[];r.forEach(o=>{"name"in o&&!Tt(a).call(a,o.name)&&a.push(o.name);let c=o;c.__registered__=!0,c.logger.hookLog=z.extLog,c.reporter.hookApiInvoke=$t.extApiInvoke,c.parameters&&Object.keys(c.parameters).forEach(f=>{c.parameters[f]=ve(f)})}),Nde("PLUGIN_INFO",a)},ChannelMediaRelayError:db,ChannelMediaRelayEvent:Cm,ChannelMediaRelayState:ll,RemoteStreamFallbackType:T4e,RemoteStreamType:C4e,ConnectionDisconnectedReason:Hn,AudienceLatencyLevelType:jxe,AREAS:ai,preload:async function(r,a,o,c){return Nce(r,a,o,c)}});return Object.defineProperties(Jr,{onAudioAutoplayFailed:{get:()=>Mc.onAudioAutoplayFailed,set:r=>{Mc.onAudioAutoplayFailed=r}},onAutoplayFailed:{get:()=>Mc.onAutoplayFailed,set:r=>{Mc.onAutoplayFailed=r}},_onSecurityPolicyViolation:{value:void 0,writable:!0},_cspEventHandlerPointer:{value:void 0,writable:!0},onSecurityPolicyViolation:{get:()=>Jr._onSecurityPolicyViolation,set(r){Jr._onSecurityPolicyViolation=r,Ide(r)}},__CLIENT_LIST__:{get:()=>ve("SHOW_GLOBAL_CLIENT_LIST")?H0:[]}}),kc.on(b_.CAMERA_DEVICE_CHANGED,r=>{z.info("camera device changed",JSON.stringify(r)),Jr.onCameraChanged&&Jr.onCameraChanged(r),Jr.safeEmit(Gf.CAMERA_CHANGED,r)}),kc.on(b_.RECORDING_DEVICE_CHANGED,r=>{z.info("microphone device changed",JSON.stringify(r)),Jr.onMicrophoneChanged&&Jr.onMicrophoneChanged(r),Jr.safeEmit(Gf.MICROPHONE_CHANGED,r)}),kc.on(b_.PLAYOUT_DEVICE_CHANGED,r=>{z.debug("playout device changed",JSON.stringify(r)),Jr.onPlaybackDeviceChanged&&Jr.onPlaybackDeviceChanged(r),Jr.safeEmit(Gf.PLAYBACK_DEVICE_CHANGED,r)}),ko.onAutoplayFailed=()=>{z.info("detect audio element autoplay failed"),Mc.onAudioAutoplayFailed&&Mc.onAudioAutoplayFailed()},Si.on("autoplay-failed",()=>{z.info("detect webaudio autoplay failed"),Mc.onAudioAutoplayFailed&&Mc.onAudioAutoplayFailed(),Jr.safeEmit(Gf.AUTOPLAY_FAILED)}),Si.on(Bs.STATE_CHANGE,(r,a)=>{z.info("audio context state changed: ".concat(a," => ").concat(r)),Jr.onAudioContextStateChanged&&Jr.onAudioContextStateChanged(r,a),Jr.safeEmit(Gf.AUDIO_CONTEXT_STATE_CHANGED,r,a)}),yr.on(s_.NETWORK_STATE_CHANGE,(r,a)=>{z.info("[network-indicator] network state changed, ".concat(a," => ").concat(r))}),window&&(window.__ARTC__=Jr),Jr})}),W0e={};PPe(W0e,{AgoraRTCProvider:()=>q0e,AgoraRTCReactError:()=>hc,AgoraRTCScreenShareProvider:()=>HPe,LocalAudioTrack:()=>e1e,LocalUser:()=>s1e,LocalVideoTrack:()=>i1e,RemoteAudioTrack:()=>a1e,RemoteUser:()=>o6e,RemoteVideoTrack:()=>o1e,TrackBoundary:()=>r6e,VERSION:()=>d6e,default:()=>l1e,useAutoPlayAudioTrack:()=>CQ,useAutoPlayVideoTrack:()=>bQ,useClientEvent:()=>BPe,useConnectionState:()=>WPe,useCurrentUID:()=>$Pe,useIsConnected:()=>Yp,useJoin:()=>X0e,useLocalCameraTrack:()=>Z0e,useLocalMicrophoneTrack:()=>Q0e,useLocalScreenTrack:()=>n6e,useNetworkQuality:()=>KPe,usePublish:()=>J0e,useRTCClient:()=>wf,useRTCScreenShareClient:()=>GPe,useRemoteAudioTracks:()=>QPe,useRemoteUserTrack:()=>qq,useRemoteUsers:()=>e6e,useRemoteVideoTracks:()=>ZPe,useTrackEvent:()=>VPe,useVolumeLevel:()=>YPe});var DPe=iw(rw());function Cl(n,t,i){return n.on(t,i),()=>n.off(t,i)}function kPe(n){try{return n()}catch(t){console.error(t)}}function sw(n){return()=>n.forEach(kPe)}function MPe(n,t){let i=setInterval(n,t);return()=>clearInterval(i)}function AU(n,t){let i=setTimeout(n,t);return()=>clearTimeout(i)}function wQ(){let n,t,i;function s(){if(t){let y=t;t=void 0,y()}}async function l(){if(i){let y=i;i=void 0;try{await y()}catch(_){console.error(_)}}}async function d(y){n=!0,await l();try{i=await y()}catch(_){console.error(_)}n=!1,s()}async function u(){n=!0,await l(),n=!1,s()}function p(y){n?t=()=>d(y):d(y)}function m(){n?t=u:u()}return{run:p,dispose:m}}var IU=typeof document<"u"?k.useLayoutEffect:k.useEffect;function jPe(n){return n!=null&&typeof n.then=="function"}function sy(){let n=k.useRef(!1);return k.useEffect(()=>(n.current=!1,()=>{n.current=!0}),[]),n}function UPe(){let n=sy();function t(i,s){return new Promise(async(l,d)=>{try{let u=await i;n.current||l(u)}catch(u){n.current?s&&s(u):d(u)}})}return k.useCallback(t,[n])}function $0e(n){let t=UPe(),[i,s]=k.useState();return IU(()=>{jPe(n)?t(n).then(s):s(n)},[n,t]),i}function aw(n,t){let i=k.useRef();k.useEffect(()=>{let{run:s,dispose:l}=i.current||(i.current=wQ());return s(n),l},t)}function FPe(n,t){let i=n.split("."),s=t.split("."),l=Math.max(i.length,s.length);for(let d=0;d<l;d++){let u=parseInt(i[d]||"0"),p=parseInt(s[d]||"0");if(u>p)return 1;if(u<p)return-1}return 0}function BPe(n,t,i){let s=k.useRef(i);IU(()=>{s.current=i},[i]),k.useEffect(()=>{if(n)return Cl(n,t,(...l)=>{s.current&&s.current(...l)})},[t,n])}function VPe(n,t,i){let s=k.useRef(i);IU(()=>{s.current=i},[i]),k.useEffect(()=>{if(n)return Cl(n,t,(...l)=>{s.current&&s.current(...l)})},[t,n])}var K0e=k.createContext(null);function q0e({client:n,children:t}){return h.jsx(K0e.Provider,{value:n,children:t})}function zPe(n){let t=k.useContext(K0e);return n||t}function wf(n){let t=zPe(n);if(!t)throw new Error("Agora RTC client not found. Should be wrapped in <AgoraRTCProvider value={client} />");return t}var Y0e=k.createContext(null);function HPe({client:n,children:t}){return h.jsx(Y0e.Provider,{value:n,children:t})}function GPe(n){let t=k.useContext(Y0e);return n||t}function WPe(n){let t=wf(n),[i,s]=k.useState(t?t.connectionState:"DISCONNECTED");return k.useEffect(()=>{if(t){s(t.connectionState);let l;return sw([Cl(t,"connection-state-change",d=>{l==null||l(),d==="CONNECTED"?l=AU(()=>s(d),0):s(d)}),()=>l==null?void 0:l()])}else s("DISCONNECTED")},[t]),i}function Yp(n){let t=wf(n),[i,s]=k.useState(t?t.connectionState==="CONNECTED":!1);return k.useEffect(()=>{if(t){s(t.connectionState==="CONNECTED");let l;return sw([Cl(t,"connection-state-change",d=>{l==null||l(),l=AU(()=>s(d==="CONNECTED"),0)}),()=>l==null?void 0:l()])}else s(!1)},[t]),i}function $Pe(n){let t=wf(n),[i,s]=k.useState(t==null?void 0:t.uid);return k.useEffect(()=>{if(t)return Cl(t,"connection-state-change",l=>{if(l==="CONNECTED")return AU(()=>s(t.uid),0);l==="DISCONNECTED"&&s(void 0)})},[t]),i}var hc=class extends Error{constructor(t,i){var n=(...tot)=>(super(...tot),sn(this,"rtcMethod"),sn(this,"rtcError"),sn(this,"name","AgoraRTCReactException"),this);n(typeof i=="string"?i:i.message),this.rtcMethod=t,this.rtcError=i}log(t){console[t](this)}};function X0e(n,t=!0,i){let s=wf(i),l=Yp(i),d=k.useRef(),[u,p]=k.useState(!1),[m,y]=k.useState(0),[_,E]=k.useState(null),C=sy();return aw(async()=>{if(C.current||(E(null),y(0),p(!1)),t&&s){try{C.current||p(!0);let{appid:N,channel:O,token:D,uid:P}=typeof n=="function"?await n():n,j=await s.join(N,O,D,P);C.current||y(j)}catch(N){console.error(N),C.current||E(new hc("IAgoraRTCClient.join",N))}C.current||p(!1);let x=d.current||(d.current=wQ());return sw([()=>{x.dispose()},()=>{x.run(()=>s.unpublish(s.localTracks))},()=>{for(let N of s.localTracks)N.isPlaying&&N.stop(),N.close();x.run(()=>s.leave())}])}},[t,i]),{data:m,isLoading:u,isConnected:l,error:_}}var Vue=()=>({uplinkNetworkQuality:0,downlinkNetworkQuality:0,delay:0});function KPe(n){let t=wf(n),[i,s]=k.useState(Vue);return k.useEffect(()=>{if(t)return Cl(t,"network-quality",l=>s({uplinkNetworkQuality:l.uplinkNetworkQuality,downlinkNetworkQuality:l.downlinkNetworkQuality,delay:t.getRTCStats().RTT??0}));s(Vue())},[t]),i}var qPe=iw(rw());function J0e(n,t=!0,i){let s=wf(i),l=Yp(i),d=k.useRef([]),[u,p]=k.useState(!1),[m,y]=k.useState(null),_=sy();return aw(async()=>{if(_.current||(p(!1),y(null)),!s||!l||!t)return;let E=n.filter(Boolean),C=O=>{let D=FPe(qPe.default.VERSION,"4.18.2")>=0;return D||new hc("usePublish","please check your agora-rtc-sdk-ng version in package.json, it's recommend upgrade to >= 4.18.2").log("warn"),D?s.mode!=="live"||s.role!=="audience":!0},x=O=>d.current.some(D=>D&&D.getTrackId()===O.getTrackId()),N=O=>C()&&O.enabled&&t&&!x(O);for(let O=0;O<E.length;O++){let D=E[O];if(D&&N(D)){await s.unpublish(d.current.filter(P=>(P==null?void 0:P.trackMediaType)===D.trackMediaType));try{_.current||p(!0),await s.publish(D)}catch(P){console.error(P),_.current||y(new hc("IAgoraRTCClient.publish",P))}_.current||p(!1)}}d.current=E},[l,t,s,n]),{isLoading:u,error:m}}function YPe(n){let[t,i]=k.useState(0);return k.useEffect(()=>{if(n)return MPe(()=>{i(n.getVolumeLevel())},1e3)},[n]),t}var XPe=iw(rw());function Q0e(n=!0,t={ANS:!0,AEC:!0},i){let s=Yp(i),[l,d]=k.useState(null),[u,p]=k.useState(!1),[m,y]=k.useState(null),_=sy();return aw(async()=>{if(_.current||(p(!1),y(null)),s&&n&&!l){try{_.current||p(!0);let E=await XPe.default.createMicrophoneAudioTrack(t);_.current||d(E)}catch(E){console.error(E),_.current||y(new hc("IAgoraRTC.createMicrophoneAudioTrack",E))}_.current||p(!1)}!s&&!_.current&&d(null)},[s,n]),{localMicrophoneTrack:l,isLoading:u,error:m}}var JPe=iw(rw());function Z0e(n=!0,t,i){let s=Yp(i),[l,d]=k.useState(null),[u,p]=k.useState(!1),[m,y]=k.useState(null),_=sy();return aw(async()=>{if(_.current||(p(!1),y(null)),s&&n&&!l){try{_.current||p(!0);let E=await JPe.default.createCameraVideoTrack(t);_.current||d(E)}catch(E){console.error(E),_.current||y(new hc("IAgoraRTC.createCameraVideoTrack",E))}_.current||p(!1)}!s&&!_.current&&d(null)},[s,n]),{localCameraTrack:l,isLoading:u,error:m}}function QPe(n,t){let i=wf(t),[s,l]=k.useState([]),d=Yp(),u=k.useRef([]),[p,m]=k.useState(!1),[y,_]=k.useState(null),E=sy();return aw(async()=>{if(E.current||_(null),!Array.isArray(n)||!d)return;let C=async O=>{if(!O.audioTrack&&n.some(({uid:D})=>O.uid===D)){try{E.current||m(!0),await i.subscribe(O,"audio")}catch(D){console.error(D),E.current||_(new hc("IAgoraRTCClient.subscribe",D))}O.audioTrack&&!u.current.some(D=>D.getUserId()===O.uid)&&u.current.push(O.audioTrack),u.current=u.current.map(D=>O.audioTrack&&D.getUserId()===O.uid&&D.getTrackId()!==O.audioTrack.getTrackId()?O.audioTrack:D),E.current||(l([...u.current]),m(!1))}},x=async O=>{if(n.some(({uid:D})=>O.uid===D)){E.current||(u.current=u.current.filter(D=>D.getUserId()!==O.uid),l([...u.current]));try{E.current||m(!0),await i.unsubscribe(O,"audio")}catch(D){console.error(D),E.current||_(new hc("IAgoraRTCClient.unsubscribe",D))}E.current||m(!1)}};n.map(O=>{!O.audioTrack&&O.hasAudio&&C(O)});let N=[];for(let O=0;O<u.current.length;O++){let D=u.current[O];if(!n.some(P=>P.uid===D.getUserId())){let P=i.remoteUsers.find(j=>j.uid===D.getUserId());P&&N.push({user:P,mediaType:"audio"}),u.current.splice(O,1),O--}}if(N.length>0){try{E.current||m(!0),await i.massUnsubscribe(N)}catch(O){console.error(O),E.current||_(new hc("IAgoraRTCClient.massUnsubscribe",O))}E.current||(l(u.current.slice()),m(!1))}return sw([Cl(i,"user-published",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="audio"&&C(O)}),Cl(i,"user-unpublished",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="audio"&&x(O)})])},[d,i,n]),{audioTracks:s,isLoading:p,error:y}}function ZPe(n,t){let i=wf(t),[s,l]=k.useState([]),d=Yp(),u=k.useRef([]),[p,m]=k.useState(!1),[y,_]=k.useState(null),E=sy();return aw(async()=>{if(E.current||_(null),!Array.isArray(n)||!d)return;let C=async O=>{if(!O.videoTrack&&n.some(({uid:D})=>O.uid===D)){try{E.current||m(!0),await i.subscribe(O,"video")}catch(D){console.error(D),E.current||_(new hc("IAgoraRTCClient.subscribe",D))}O.videoTrack&&!u.current.some(D=>D.getUserId()===O.uid)&&u.current.push(O.videoTrack),u.current=u.current.map(D=>O.videoTrack&&D.getUserId()===O.uid&&D.getTrackId()!==O.videoTrack.getTrackId()?O.videoTrack:D),E.current||(l([...u.current]),m(!1))}},x=async O=>{if(n.some(({uid:D})=>O.uid===D)){E.current||(u.current=u.current.filter(D=>D.getUserId()!==O.uid),l([...u.current]));try{E.current||m(!0),await i.unsubscribe(O,"video")}catch(D){console.error(D),E.current||_(new hc("IAgoraRTCClient.unsubscribe",D))}E.current||m(!1)}};n.map(O=>{!O.videoTrack&&O.hasVideo&&C(O)});let N=[];for(let O=0;O<u.current.length;O++){let D=u.current[O];if(!n.some(P=>P.uid===D.getUserId())){let P=i.remoteUsers.find(j=>j.uid===D.getUserId());P&&N.push({user:P,mediaType:"video"}),u.current.splice(O,1),O--}}if(N.length>0){try{E.current||m(!0),await i.massUnsubscribe(N)}catch(O){console.error(O),E.current||_(new hc("IAgoraRTCClient.massUnsubscribe",O))}E.current||(l(u.current.slice()),m(!1))}return sw([Cl(i,"user-published",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="video"&&C(O)}),Cl(i,"user-unpublished",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="video"&&x(O)})])},[d,i,n]),{videoTracks:s,isLoading:p,error:y}}function qq(n,t,i){let s=wf(i),l=t==="audio"?"audioTrack":"videoTrack",[d,u]=k.useState(n&&n[l]),p=Yp(),m=k.useRef(),[y,_]=k.useState(!1),[E,C]=k.useState(null);return k.useEffect(()=>{if(!n||!p)return;let x=!1;x||C(null);let N=t==="audio"?"hasAudio":"hasVideo",O=n.uid,D=async(M,V)=>{if(M[l]&&s.remoteUsers.some(({uid:G})=>M.uid===G))try{x||_(!0),await s.unsubscribe(M,V)}catch(G){x||C(new hc("IAgoraRTCClient.unsubscribe",G)),console.error(G)}x||(u(void 0),_(!1))},P=async(M,V)=>{try{!M[l]&&s.remoteUsers.some(({uid:G})=>M.uid===G)&&(x||_(!0),await s.subscribe(M,V)),x||u(M[l])}catch(G){x||C(new hc("IAgoraRTCClient.subscribe",G)),console.error(G)}x||_(!1)},j=m.current||(m.current=wQ());return!n[l]&&n[N]?j.run(()=>P(n,t)):u(n[l]),sw([()=>{x=!0,j.dispose()},Cl(s,"user-published",(M,V)=>{M.uid===O&&V===t&&j.run(()=>P(M,t))}),Cl(s,"user-unpublished",(M,V)=>{M.uid===O&&V===t&&j.run(()=>D(M,t))})])},[p,s,n,t,l]),{track:d,isLoading:y,error:E}}function e6e(n){let t=wf(n),[i,s]=k.useState(t?t.remoteUsers:[]);return k.useEffect(()=>{if(t){let l=()=>s(t.remoteUsers.slice());return sw([Cl(t,"user-joined",l),Cl(t,"user-left",l),Cl(t,"user-published",l),Cl(t,"user-unpublished",l)])}},[t]),i}var t6e=iw(rw());function n6e(n=!0,t,i,s){let l=Yp(s),[d,u]=k.useState(null),[p,m]=k.useState(!1),[y,_]=k.useState(null),E=sy();return aw(async()=>{if(E.current||(m(!1),_(null)),l&&n&&!d){try{E.current||m(!0);let C=await t6e.default.createScreenVideoTrack(t,i);E.current||u(C)}catch(C){console.error(C),E.current||_(new hc("IAgoraRTC.createScreenVideoTrack",C))}E.current||m(!1)}(!l||!n)&&!E.current&&u(null)},[l,n]),{screenTrack:d,isLoading:p,error:y}}function i6e(){let n=new Map,t=1500;return{onMount:i=>{let s=n.get(i);s&&(s(),n.delete(i))},onUnmount:i=>{let s=n.get(i);s&&s(),n.set(i,AU(()=>{i.isPlaying&&i.stop(),n.delete(i)},t))},dispose:()=>{for(let[i,s]of n)i.isPlaying&&i.stop(),s&&s();n.clear()}}}var SQ=k.createContext(void 0);function r6e({children:n}){let[t]=k.useState(i6e);return k.useEffect(()=>t.dispose,[t]),h.jsx(SQ.Provider,{value:t,children:n})}function bQ(n,t,i,s){let l=k.useContext(SQ);k.useEffect(()=>{if(n)return s&&t?n.play(s,i||void 0):n.stop(),l?(l.onMount(n),()=>l.onUnmount(n)):()=>{n.isPlaying&&n.stop()}},[n,s,t,l,i])}function CQ(n,t){let i=k.useContext(SQ);IU(()=>{if(n)return t?n.play():n.stop(),i?(i.onMount(n),()=>i.onUnmount(n)):()=>{n.isPlaying&&n.stop()}},[n,t,i])}function e1e({track:n,play:t=!1,volume:i,disabled:s,muted:l,children:d}){let u=$0e(n);return CQ(u,t),k.useEffect(()=>{u&&i!=null&&u.setVolume(i)},[u,i]),k.useEffect(()=>{u&&s!=null&&u.setEnabled(!s).catch(console.warn)},[s,u]),k.useEffect(()=>{u&&l!=null&&u.setMuted(l).catch(console.warn)},[l,u]),d?h.jsx(h.Fragment,{children:d}):null}var t1e={position:"relative",width:"100%",height:"100%",overflow:"hidden",background:"#000"},n1e={width:"100%",height:"100%"},TQ={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",zIndex:2},NU=(n,t)=>k.useMemo(()=>({...n,...t}),[n,t]);function i1e({track:n,play:t,disabled:i,muted:s,style:l,videoPlayerConfig:d,...u}){let p=NU(n1e,l),[m,y]=k.useState(null),_=$0e(n);return bQ(_,t,d,m),k.useEffect(()=>{_&&i!=null&&_.setEnabled(!i).catch(console.warn)},[i,_]),k.useEffect(()=>{_&&s!=null&&_.setMuted(s).catch(console.warn)},[s,_]),h.jsx("div",{...u,ref:y,style:p})}var s6e={width:"100%",height:"100%",background:"#1a1e21 center/cover no-repeat",filter:"blur(16px) brightness(0.4)"},a6e={position:"absolute",top:"50%",left:"50%",maxWidth:"50%",maxHeight:"50%",aspectRatio:"1",transform:"translate(-50%, -50%)",borderRadius:"50%",overflow:"hidden",objectFit:"cover"};function r1e({cover:n}){return h.jsx("div",{style:TQ,children:typeof n=="string"?h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{...s6e,backgroundImage:`url(${n})`}}),h.jsx("img",{src:n,style:a6e})]}):n()})}function s1e({micOn:n,cameraOn:t,audioTrack:i,videoTrack:s,playAudio:l,playVideo:d,volume:u,cover:p,children:m,style:y,..._}){let E=NU(t1e,y);return d=d??!!t,l=l??!!n,h.jsxs("div",{..._,style:E,children:[h.jsx(i1e,{disabled:!t,play:d,track:s}),h.jsx(e1e,{disabled:!n,play:l,track:i,volume:u}),p&&!t&&h.jsx(r1e,{cover:p}),h.jsx("div",{style:TQ,children:m})]})}function a1e({track:n,play:t=!1,playbackDeviceId:i,volume:s,children:l}){return CQ(n,t),k.useEffect(()=>{n&&i!=null&&n.setPlaybackDevice(i).catch(console.warn)},[n,i]),k.useEffect(()=>{n&&s!=null&&n.setVolume(s)},[n,s]),l?h.jsx(h.Fragment,{children:l}):null}function o1e({track:n,play:t,style:i,videoPlayerConfig:s,...l}){let d=NU(n1e,i),[u,p]=k.useState(null);return bQ(n,t,s,u),h.jsx("div",{...l,ref:p,style:d})}function o6e({user:n,playVideo:t,playAudio:i,playbackDeviceId:s,volume:l,cover:d,style:u,children:p,videoPlayerConfig:m,...y}){let _=NU(t1e,u),{track:E}=qq(n,"video"),{track:C}=qq(n,"audio");return t=t??(n==null?void 0:n.hasVideo),i=i??(n==null?void 0:n.hasAudio),h.jsxs("div",{...y,style:_,children:[h.jsx(o1e,{play:t,track:E,videoPlayerConfig:m}),h.jsx(a1e,{play:i,playbackDeviceId:s,track:C,volume:l}),d&&!t&&h.jsx(r1e,{cover:d}),h.jsx("div",{style:TQ,children:p})]})}var l6e=iw(rw()),c6e=class{constructor(){sn(this,"appType",1001);l6e.default.setAppType(this.appType)}};new c6e;var d6e="2.2.0";LPe(W0e,iw(rw()));var l1e=DPe.default;/**
* @remix-run/router v1.15.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function lN(){return lN=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},lN.apply(this,arguments)}var Pv;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Pv||(Pv={}));const zue="popstate";function u6e(n){n===void 0&&(n={});function t(s,l){let{pathname:d,search:u,hash:p}=s.location;return Yq("",{pathname:d,search:u,hash:p},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function i(s,l){return typeof l=="string"?l:k7(l)}return f6e(t,i,null,n)}function _a(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function RQ(n,t){if(!n){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function h6e(){return Math.random().toString(36).substr(2,8)}function Hue(n,t){return{usr:n.state,key:n.key,idx:t}}function Yq(n,t,i,s){return i===void 0&&(i=null),lN({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof t=="string"?mx(t):t,{state:i,key:t&&t.key||s||h6e()})}function k7(n){let{pathname:t="/",search:i="",hash:s=""}=n;return i&&i!=="?"&&(t+=i.charAt(0)==="?"?i:"?"+i),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function mx(n){let t={};if(n){let i=n.indexOf("#");i>=0&&(t.hash=n.substr(i),n=n.substr(0,i));let s=n.indexOf("?");s>=0&&(t.search=n.substr(s),n=n.substr(0,s)),n&&(t.pathname=n)}return t}function f6e(n,t,i,s){s===void 0&&(s={});let{window:l=document.defaultView,v5Compat:d=!1}=s,u=l.history,p=Pv.Pop,m=null,y=_();y==null&&(y=0,u.replaceState(lN({},u.state,{idx:y}),""));function _(){return(u.state||{idx:null}).idx}function E(){p=Pv.Pop;let D=_(),P=D==null?null:D-y;y=D,m&&m({action:p,location:O.location,delta:P})}function C(D,P){p=Pv.Push;let j=Yq(O.location,D,P);i&&i(j,D),y=_()+1;let M=Hue(j,y),V=O.createHref(j);try{u.pushState(M,"",V)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;l.location.assign(V)}d&&m&&m({action:p,location:O.location,delta:1})}function x(D,P){p=Pv.Replace;let j=Yq(O.location,D,P);i&&i(j,D),y=_();let M=Hue(j,y),V=O.createHref(j);u.replaceState(M,"",V),d&&m&&m({action:p,location:O.location,delta:0})}function N(D){let P=l.location.origin!=="null"?l.location.origin:l.location.href,j=typeof D=="string"?D:k7(D);return _a(P,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,P)}let O={get action(){return p},get location(){return n(l,u)},listen(D){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(zue,E),m=D,()=>{l.removeEventListener(zue,E),m=null}},createHref(D){return t(l,D)},createURL:N,encodeLocation(D){let P=N(D);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:C,replace:x,go(D){return u.go(D)}};return O}var Gue;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Gue||(Gue={}));function p6e(n,t,i){i===void 0&&(i="/");let s=typeof t=="string"?mx(t):t,l=xQ(s.pathname||"/",i);if(l==null)return null;let d=c1e(n);m6e(d);let u=null;for(let p=0;u==null&&p<d.length;++p)u=C6e(d[p],x6e(l));return u}function c1e(n,t,i,s){t===void 0&&(t=[]),i===void 0&&(i=[]),s===void 0&&(s="");let l=(d,u,p)=>{let m={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:u,route:d};m.relativePath.startsWith("/")&&(_a(m.relativePath.startsWith(s),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(s.length));let y=Wv([s,m.relativePath]),_=i.concat(m);d.children&&d.children.length>0&&(_a(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),c1e(d.children,t,_,y)),!(d.path==null&&!d.index)&&t.push({path:y,score:S6e(y,d.index),routesMeta:_})};return n.forEach((d,u)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))l(d,u);else for(let m of d1e(d.path))l(d,u,m)}),t}function d1e(n){let t=n.split("/");if(t.length===0)return[];let[i,...s]=t,l=i.endsWith("?"),d=i.replace(/\?$/,"");if(s.length===0)return l?[d,""]:[d];let u=d1e(s.join("/")),p=[];return p.push(...u.map(m=>m===""?d:[d,m].join("/"))),l&&p.push(...u),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function m6e(n){n.sort((t,i)=>t.score!==i.score?i.score-t.score:b6e(t.routesMeta.map(s=>s.childrenIndex),i.routesMeta.map(s=>s.childrenIndex)))}const g6e=/^:[\w-]+$/,v6e=3,y6e=2,_6e=1,E6e=10,w6e=-2,Wue=n=>n==="*";function S6e(n,t){let i=n.split("/"),s=i.length;return i.some(Wue)&&(s+=w6e),t&&(s+=y6e),i.filter(l=>!Wue(l)).reduce((l,d)=>l+(g6e.test(d)?v6e:d===""?_6e:E6e),s)}function b6e(n,t){return n.length===t.length&&n.slice(0,-1).every((s,l)=>s===t[l])?n[n.length-1]-t[t.length-1]:0}function C6e(n,t){let{routesMeta:i}=n,s={},l="/",d=[];for(let u=0;u<i.length;++u){let p=i[u],m=u===i.length-1,y=l==="/"?t:t.slice(l.length)||"/",_=T6e({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},y);if(!_)return null;Object.assign(s,_.params);let E=p.route;d.push({params:s,pathname:Wv([l,_.pathname]),pathnameBase:P6e(Wv([l,_.pathnameBase])),route:E}),_.pathnameBase!=="/"&&(l=Wv([l,_.pathnameBase]))}return d}function T6e(n,t){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,s]=R6e(n.path,n.caseSensitive,n.end),l=t.match(i);if(!l)return null;let d=l[0],u=d.replace(/(.)\/+$/,"$1"),p=l.slice(1);return{params:s.reduce((y,_,E)=>{let{paramName:C,isOptional:x}=_;if(C==="*"){let O=p[E]||"";u=d.slice(0,d.length-O.length).replace(/(.)\/+$/,"$1")}const N=p[E];return x&&!N?y[C]=void 0:y[C]=A6e(N||"",C),y},{}),pathname:d,pathnameBase:u,pattern:n}}function R6e(n,t,i){t===void 0&&(t=!1),i===void 0&&(i=!0),RQ(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let s=[],l="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,m)=>(s.push({paramName:p,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(s.push({paramName:"*"}),l+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?l+="\\/*$":n!==""&&n!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),s]}function x6e(n){try{return decodeURI(n)}catch(t){return RQ(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),n}}function A6e(n,t){try{return decodeURIComponent(n)}catch(i){return RQ(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+i+").")),n}}function xQ(n,t){if(t==="/")return n;if(!n.toLowerCase().startsWith(t.toLowerCase()))return null;let i=t.endsWith("/")?t.length-1:t.length,s=n.charAt(i);return s&&s!=="/"?null:n.slice(i)||"/"}function I6e(n,t){t===void 0&&(t="/");let{pathname:i,search:s="",hash:l=""}=typeof n=="string"?mx(n):n;return{pathname:i?i.startsWith("/")?i:N6e(i,t):t,search:L6e(s),hash:D6e(l)}}function N6e(n,t){let i=t.replace(/\/+$/,"").split("/");return n.split("/").forEach(l=>{l===".."?i.length>1&&i.pop():l!=="."&&i.push(l)}),i.length>1?i.join("/"):"/"}function nK(n,t,i,s){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function O6e(n){return n.filter((t,i)=>i===0||t.route.path&&t.route.path.length>0)}function AQ(n,t){let i=O6e(n);return t?i.map((s,l)=>l===n.length-1?s.pathname:s.pathnameBase):i.map(s=>s.pathnameBase)}function IQ(n,t,i,s){s===void 0&&(s=!1);let l;typeof n=="string"?l=mx(n):(l=lN({},n),_a(!l.pathname||!l.pathname.includes("?"),nK("?","pathname","search",l)),_a(!l.pathname||!l.pathname.includes("#"),nK("#","pathname","hash",l)),_a(!l.search||!l.search.includes("#"),nK("#","search","hash",l)));let d=n===""||l.pathname==="",u=d?"/":l.pathname,p;if(u==null)p=i;else{let E=t.length-1;if(!s&&u.startsWith("..")){let C=u.split("/");for(;C[0]==="..";)C.shift(),E-=1;l.pathname=C.join("/")}p=E>=0?t[E]:"/"}let m=I6e(l,p),y=u&&u!=="/"&&u.endsWith("/"),_=(d||u===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(y||_)&&(m.pathname+="/"),m}const Wv=n=>n.join("/").replace(/\/\/+/g,"/"),P6e=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),L6e=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,D6e=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function k6e(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const u1e=["post","put","patch","delete"];new Set(u1e);const M6e=["get",...u1e];new Set(M6e);/**
* React Router v6.22.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function cN(){return cN=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},cN.apply(this,arguments)}const NQ=k.createContext(null),j6e=k.createContext(null),ay=k.createContext(null),OU=k.createContext(null),Xp=k.createContext({outlet:null,matches:[],isDataRoute:!1}),h1e=k.createContext(null);function U6e(n,t){let{relative:i}=t===void 0?{}:t;gx()||_a(!1);let{basename:s,navigator:l}=k.useContext(ay),{hash:d,pathname:u,search:p}=p1e(n,{relative:i}),m=u;return s!=="/"&&(m=u==="/"?s:Wv([s,u])),l.createHref({pathname:m,search:p,hash:d})}function gx(){return k.useContext(OU)!=null}function tl(){return gx()||_a(!1),k.useContext(OU).location}function f1e(n){k.useContext(ay).static||k.useLayoutEffect(n)}function ji(){let{isDataRoute:n}=k.useContext(Xp);return n?Z6e():F6e()}function F6e(){gx()||_a(!1);let n=k.useContext(NQ),{basename:t,future:i,navigator:s}=k.useContext(ay),{matches:l}=k.useContext(Xp),{pathname:d}=tl(),u=JSON.stringify(AQ(l,i.v7_relativeSplatPath)),p=k.useRef(!1);return f1e(()=>{p.current=!0}),k.useCallback(function(y,_){if(_===void 0&&(_={}),!p.current)return;if(typeof y=="number"){s.go(y);return}let E=IQ(y,JSON.parse(u),d,_.relative==="path");n==null&&t!=="/"&&(E.pathname=E.pathname==="/"?t:Wv([t,E.pathname])),(_.replace?s.replace:s.push)(E,_.state,_)},[t,s,u,d,n])}const B6e=k.createContext(null);function V6e(n){let t=k.useContext(Xp).outlet;return t&&k.createElement(B6e.Provider,{value:n},t)}function PU(){let{matches:n}=k.useContext(Xp),t=n[n.length-1];return t?t.params:{}}function p1e(n,t){let{relative:i}=t===void 0?{}:t,{future:s}=k.useContext(ay),{matches:l}=k.useContext(Xp),{pathname:d}=tl(),u=JSON.stringify(AQ(l,s.v7_relativeSplatPath));return k.useMemo(()=>IQ(n,JSON.parse(u),d,i==="path"),[n,u,d,i])}function z6e(n,t){return H6e(n,t)}function H6e(n,t,i,s){gx()||_a(!1);let{navigator:l}=k.useContext(ay),{matches:d}=k.useContext(Xp),u=d[d.length-1],p=u?u.params:{};u&&u.pathname;let m=u?u.pathnameBase:"/";u&&u.route;let y=tl(),_;if(t){var E;let D=typeof t=="string"?mx(t):t;m==="/"||(E=D.pathname)!=null&&E.startsWith(m)||_a(!1),_=D}else _=y;let C=_.pathname||"/",x=m==="/"?C:C.slice(m.length)||"/",N=p6e(n,{pathname:x}),O=q6e(N&&N.map(D=>Object.assign({},D,{params:Object.assign({},p,D.params),pathname:Wv([m,l.encodeLocation?l.encodeLocation(D.pathname).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?m:Wv([m,l.encodeLocation?l.encodeLocation(D.pathnameBase).pathname:D.pathnameBase])})),d,i,s);return t&&O?k.createElement(OU.Provider,{value:{location:cN({pathname:"/",search:"",hash:"",state:null,key:"default"},_),navigationType:Pv.Pop}},O):O}function G6e(){let n=Q6e(),t=k6e(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),i?k.createElement("pre",{style:l},i):null,null)}const W6e=k.createElement(G6e,null);class $6e extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,i){return i.location!==t.location||i.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:i.error,location:i.location,revalidation:t.revalidation||i.revalidation}}componentDidCatch(t,i){console.error("React Router caught the following error during render",t,i)}render(){return this.state.error!==void 0?k.createElement(Xp.Provider,{value:this.props.routeContext},k.createElement(h1e.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function K6e(n){let{routeContext:t,match:i,children:s}=n,l=k.useContext(NQ);return l&&l.static&&l.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=i.route.id),k.createElement(Xp.Provider,{value:t},s)}function q6e(n,t,i,s){var l;if(t===void 0&&(t=[]),i===void 0&&(i=null),s===void 0&&(s=null),n==null){var d;if((d=i)!=null&&d.errors)n=i.matches;else return null}let u=n,p=(l=i)==null?void 0:l.errors;if(p!=null){let _=u.findIndex(E=>E.route.id&&(p==null?void 0:p[E.route.id]));_>=0||_a(!1),u=u.slice(0,Math.min(u.length,_+1))}let m=!1,y=-1;if(i&&s&&s.v7_partialHydration)for(let _=0;_<u.length;_++){let E=u[_];if((E.route.HydrateFallback||E.route.hydrateFallbackElement)&&(y=_),E.route.id){let{loaderData:C,errors:x}=i,N=E.route.loader&&C[E.route.id]===void 0&&(!x||x[E.route.id]===void 0);if(E.route.lazy||N){m=!0,y>=0?u=u.slice(0,y+1):u=[u[0]];break}}}return u.reduceRight((_,E,C)=>{let x,N=!1,O=null,D=null;i&&(x=p&&E.route.id?p[E.route.id]:void 0,O=E.route.errorElement||W6e,m&&(y<0&&C===0?(eLe("route-fallback",!1),N=!0,D=null):y===C&&(N=!0,D=E.route.hydrateFallbackElement||null)));let P=t.concat(u.slice(0,C+1)),j=()=>{let M;return x?M=O:N?M=D:E.route.Component?M=k.createElement(E.route.Component,null):E.route.element?M=E.route.element:M=_,k.createElement(K6e,{match:E,routeContext:{outlet:_,matches:P,isDataRoute:i!=null},children:M})};return i&&(E.route.ErrorBoundary||E.route.errorElement||C===0)?k.createElement($6e,{location:i.location,revalidation:i.revalidation,component:O,error:x,children:j(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):j()},null)}var m1e=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(m1e||{}),M7=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(M7||{});function Y6e(n){let t=k.useContext(NQ);return t||_a(!1),t}function X6e(n){let t=k.useContext(j6e);return t||_a(!1),t}function J6e(n){let t=k.useContext(Xp);return t||_a(!1),t}function g1e(n){let t=J6e(),i=t.matches[t.matches.length-1];return i.route.id||_a(!1),i.route.id}function Q6e(){var n;let t=k.useContext(h1e),i=X6e(M7.UseRouteError),s=g1e(M7.UseRouteError);return t!==void 0?t:(n=i.errors)==null?void 0:n[s]}function Z6e(){let{router:n}=Y6e(m1e.UseNavigateStable),t=g1e(M7.UseNavigateStable),i=k.useRef(!1);return f1e(()=>{i.current=!0}),k.useCallback(function(l,d){d===void 0&&(d={}),i.current&&(typeof l=="number"?n.navigate(l):n.navigate(l,cN({fromRouteId:t},d)))},[n,t])}const $ue={};function eLe(n,t,i){!t&&!$ue[n]&&($ue[n]=!0)}function v1e(n){let{to:t,replace:i,state:s,relative:l}=n;gx()||_a(!1);let{future:d,static:u}=k.useContext(ay),{matches:p}=k.useContext(Xp),{pathname:m}=tl(),y=ji(),_=IQ(t,AQ(p,d.v7_relativeSplatPath),m,l==="path"),E=JSON.stringify(_);return k.useEffect(()=>y(JSON.parse(E),{replace:i,state:s,relative:l}),[y,E,l,i,s]),null}function tLe(n){return V6e(n.context)}function gi(n){_a(!1)}function nLe(n){let{basename:t="/",children:i=null,location:s,navigationType:l=Pv.Pop,navigator:d,static:u=!1,future:p}=n;gx()&&_a(!1);let m=t.replace(/^\/*/,"/"),y=k.useMemo(()=>({basename:m,navigator:d,static:u,future:cN({v7_relativeSplatPath:!1},p)}),[m,p,d,u]);typeof s=="string"&&(s=mx(s));let{pathname:_="/",search:E="",hash:C="",state:x=null,key:N="default"}=s,O=k.useMemo(()=>{let D=xQ(_,m);return D==null?null:{location:{pathname:D,search:E,hash:C,state:x,key:N},navigationType:l}},[m,_,E,C,x,N,l]);return O==null?null:k.createElement(ay.Provider,{value:y},k.createElement(OU.Provider,{children:i,value:O}))}function iLe(n){let{children:t,location:i}=n;return z6e(Xq(t),i)}new Promise(()=>{});function Xq(n,t){t===void 0&&(t=[]);let i=[];return k.Children.forEach(n,(s,l)=>{if(!k.isValidElement(s))return;let d=[...t,l];if(s.type===k.Fragment){i.push.apply(i,Xq(s.props.children,d));return}s.type!==gi&&_a(!1),!s.props.index||!s.props.children||_a(!1);let u={id:s.props.id||d.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Xq(s.props.children,d)),i.push(u)}),i}/**
* React Router DOM v6.22.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Jq(){return Jq=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},Jq.apply(this,arguments)}function rLe(n,t){if(n==null)return{};var i={},s=Object.keys(n),l,d;for(d=0;d<s.length;d++)l=s[d],!(t.indexOf(l)>=0)&&(i[l]=n[l]);return i}function sLe(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function aLe(n,t){return n.button===0&&(!t||t==="_self")&&!sLe(n)}const oLe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],lLe="6";try{window.__reactRouterVersion=lLe}catch{}const cLe="startTransition",Kue=r5e[cLe];function dLe(n){let{basename:t,children:i,future:s,window:l}=n,d=k.useRef();d.current==null&&(d.current=u6e({window:l,v5Compat:!0}));let u=d.current,[p,m]=k.useState({action:u.action,location:u.location}),{v7_startTransition:y}=s||{},_=k.useCallback(E=>{y&&Kue?Kue(()=>m(E)):m(E)},[m,y]);return k.useLayoutEffect(()=>u.listen(_),[u,_]),k.createElement(nLe,{basename:t,children:i,location:p.location,navigationType:p.action,navigator:u,future:s})}const uLe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hLe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rh=k.forwardRef(function(t,i){let{onClick:s,relative:l,reloadDocument:d,replace:u,state:p,target:m,to:y,preventScrollReset:_,unstable_viewTransition:E}=t,C=rLe(t,oLe),{basename:x}=k.useContext(ay),N,O=!1;if(typeof y=="string"&&hLe.test(y)&&(N=y,uLe))try{let M=new URL(window.location.href),V=y.startsWith("//")?new URL(M.protocol+y):new URL(y),G=xQ(V.pathname,x);V.origin===M.origin&&G!=null?y=G+V.search+V.hash:O=!0}catch{}let D=U6e(y,{relative:l}),P=fLe(y,{replace:u,state:p,target:m,preventScrollReset:_,relative:l,unstable_viewTransition:E});function j(M){s&&s(M),M.defaultPrevented||P(M)}return k.createElement("a",Jq({},C,{href:N||D,onClick:O||d?s:j,ref:i,target:m}))});var que;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(que||(que={}));var Yue;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(Yue||(Yue={}));function fLe(n,t){let{target:i,replace:s,state:l,preventScrollReset:d,relative:u,unstable_viewTransition:p}=t===void 0?{}:t,m=ji(),y=tl(),_=p1e(n,{relative:u});return k.useCallback(E=>{if(aLe(E,i)){E.preventDefault();let C=s!==void 0?s:k7(y)===k7(_);m(n,{replace:C,state:l,preventScrollReset:d,relative:u,unstable_viewTransition:p})}},[y,m,_,s,l,i,n,d,u,p])}function y1e(n){var t,i,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(t=0;t<l;t++)n[t]&&(i=y1e(n[t]))&&(s&&(s+=" "),s+=i)}else for(i in n)n[i]&&(s&&(s+=" "),s+=i);return s}function Lv(){for(var n,t,i=0,s="",l=arguments.length;i<l;i++)(n=arguments[i])&&(t=y1e(n))&&(s&&(s+=" "),s+=t);return s}const dN=n=>typeof n=="number"&&!isNaN(n),L2=n=>typeof n=="string",Jd=n=>typeof n=="function",bM=n=>L2(n)||Jd(n)?n:null,Qq=n=>k.isValidElement(n)||L2(n)||Jd(n)||dN(n);function pLe(n,t,i){i===void 0&&(i=300);const{scrollHeight:s,style:l}=n;requestAnimationFrame(()=>{l.minHeight="initial",l.height=s+"px",l.transition=`all ${i}ms`,requestAnimationFrame(()=>{l.height="0",l.padding="0",l.margin="0",setTimeout(t,i)})})}function LU(n){let{enter:t,exit:i,appendPosition:s=!1,collapse:l=!0,collapseDuration:d=300}=n;return function(u){let{children:p,position:m,preventExitTransition:y,done:_,nodeRef:E,isIn:C,playToast:x}=u;const N=s?`${t}--${m}`:t,O=s?`${i}--${m}`:i,D=k.useRef(0);return k.useLayoutEffect(()=>{const P=E.current,j=N.split(" "),M=V=>{V.target===E.current&&(x(),P.removeEventListener("animationend",M),P.removeEventListener("animationcancel",M),D.current===0&&V.type!=="animationcancel"&&P.classList.remove(...j))};P.classList.add(...j),P.addEventListener("animationend",M),P.addEventListener("animationcancel",M)},[]),k.useEffect(()=>{const P=E.current,j=()=>{P.removeEventListener("animationend",j),l?pLe(P,_,d):_()};C||(y?j():(D.current=1,P.className+=` ${O}`,P.addEventListener("animationend",j)))},[C]),dn.createElement(dn.Fragment,null,p)}}function Xue(n,t){return n!=null?{content:n.content,containerId:n.props.containerId,id:n.props.toastId,theme:n.props.theme,type:n.props.type,data:n.props.data||{},isLoading:n.props.isLoading,icon:n.props.icon,status:t}:{}}const dc=new Map;let uN=[];const Zq=new Set,mLe=n=>Zq.forEach(t=>t(n)),_1e=()=>dc.size>0;function E1e(n,t){var i;if(t)return!((i=dc.get(t))==null||!i.isToastActive(n));let s=!1;return dc.forEach(l=>{l.isToastActive(n)&&(s=!0)}),s}function w1e(n,t){Qq(n)&&(_1e()||uN.push({content:n,options:t}),dc.forEach(i=>{i.buildToast(n,t)}))}function Jue(n,t){dc.forEach(i=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===i.id&&i.toggle(n,t==null?void 0:t.id):i.toggle(n,t==null?void 0:t.id)})}function gLe(n){const{subscribe:t,getSnapshot:i,setProps:s}=k.useRef(function(d){const u=d.containerId||1;return{subscribe(p){const m=function(_,E,C){let x=1,N=0,O=[],D=[],P=[],j=E;const M=new Map,V=new Set,G=()=>{P=Array.from(M.values()),V.forEach(Y=>Y())},$=Y=>{D=Y==null?[]:D.filter(le=>le!==Y),G()},ne=Y=>{const{toastId:le,onOpen:re,updateId:ee,children:de}=Y.props,H=ee==null;Y.staleId&&M.delete(Y.staleId),M.set(le,Y),D=[...D,Y.props.toastId].filter(ae=>ae!==Y.staleId),G(),C(Xue(Y,H?"added":"updated")),H&&Jd(re)&&re(k.isValidElement(de)&&de.props)};return{id:_,props:j,observe:Y=>(V.add(Y),()=>V.delete(Y)),toggle:(Y,le)=>{M.forEach(re=>{le!=null&&le!==re.props.toastId||Jd(re.toggle)&&re.toggle(Y)})},removeToast:$,toasts:M,clearQueue:()=>{N-=O.length,O=[]},buildToast:(Y,le)=>{if((Ue=>{let{containerId:Ve,toastId:Re,updateId:Be}=Ue;const Xe=Ve?Ve!==_:_!==1,we=M.has(Re)&&Be==null;return Xe||we})(le))return;const{toastId:re,updateId:ee,data:de,staleId:H,delay:ae}=le,_e=()=>{$(re)},me=ee==null;me&&N++;const Ce={...j,style:j.toastStyle,key:x++,...Object.fromEntries(Object.entries(le).filter(Ue=>{let[Ve,Re]=Ue;return Re!=null})),toastId:re,updateId:ee,data:de,closeToast:_e,isIn:!1,className:bM(le.className||j.toastClassName),bodyClassName:bM(le.bodyClassName||j.bodyClassName),progressClassName:bM(le.progressClassName||j.progressClassName),autoClose:!le.isLoading&&(he=le.autoClose,pe=j.autoClose,he===!1||dN(he)&&he>0?he:pe),deleteToast(){const Ue=M.get(re),{onClose:Ve,children:Re}=Ue.props;Jd(Ve)&&Ve(k.isValidElement(Re)&&Re.props),C(Xue(Ue,"removed")),M.delete(re),N--,N<0&&(N=0),O.length>0?ne(O.shift()):G()}};var he,pe;Ce.closeButton=j.closeButton,le.closeButton===!1||Qq(le.closeButton)?Ce.closeButton=le.closeButton:le.closeButton===!0&&(Ce.closeButton=!Qq(j.closeButton)||j.closeButton);let Oe=Y;k.isValidElement(Y)&&!L2(Y.type)?Oe=k.cloneElement(Y,{closeToast:_e,toastProps:Ce,data:de}):Jd(Y)&&(Oe=Y({closeToast:_e,toastProps:Ce,data:de}));const Fe={content:Oe,props:Ce,staleId:H};j.limit&&j.limit>0&&N>j.limit&&me?O.push(Fe):dN(ae)?setTimeout(()=>{ne(Fe)},ae):ne(Fe)},setProps(Y){j=Y},setToggle:(Y,le)=>{M.get(Y).toggle=le},isToastActive:Y=>D.some(le=>le===Y),getSnapshot:()=>j.newestOnTop?P.reverse():P}}(u,d,mLe);dc.set(u,m);const y=m.observe(p);return uN.forEach(_=>w1e(_.content,_.options)),uN=[],()=>{y(),dc.delete(u)}},setProps(p){var m;(m=dc.get(u))==null||m.setProps(p)},getSnapshot(){var p;return(p=dc.get(u))==null?void 0:p.getSnapshot()}}}(n)).current;s(n);const l=k.useSyncExternalStore(t,i,i);return{getToastToRender:function(d){if(!l)return[];const u=new Map;return l.forEach(p=>{const{position:m}=p.props;u.has(m)||u.set(m,[]),u.get(m).push(p)}),Array.from(u,p=>d(p[0],p[1]))},isToastActive:E1e,count:l==null?void 0:l.length}}function vLe(n){const[t,i]=k.useState(!1),[s,l]=k.useState(!1),d=k.useRef(null),u=k.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:p,pauseOnHover:m,closeToast:y,onClick:_,closeOnClick:E}=n;var C,x;function N(){i(!0)}function O(){i(!1)}function D(M){const V=d.current;u.canDrag&&V&&(u.didMove=!0,t&&O(),u.delta=n.draggableDirection==="x"?M.clientX-u.start:M.clientY-u.start,u.start!==M.clientX&&(u.canCloseOnClick=!1),V.style.transform=`translate3d(${n.draggableDirection==="x"?`${u.delta}px, var(--y)`:`0, calc(${u.delta}px + var(--y))`},0)`,V.style.opacity=""+(1-Math.abs(u.delta/u.removalDistance)))}function P(){document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",P);const M=d.current;if(u.canDrag&&u.didMove&&M){if(u.canDrag=!1,Math.abs(u.delta)>u.removalDistance)return l(!0),n.closeToast(),void n.collapseAll();M.style.transition="transform 0.2s, opacity 0.2s",M.style.removeProperty("transform"),M.style.removeProperty("opacity")}}(x=dc.get((C={id:n.toastId,containerId:n.containerId,fn:i}).containerId||1))==null||x.setToggle(C.id,C.fn),k.useEffect(()=>{if(n.pauseOnFocusLoss)return document.hasFocus()||O(),window.addEventListener("focus",N),window.addEventListener("blur",O),()=>{window.removeEventListener("focus",N),window.removeEventListener("blur",O)}},[n.pauseOnFocusLoss]);const j={onPointerDown:function(M){if(n.draggable===!0||n.draggable===M.pointerType){u.didMove=!1,document.addEventListener("pointermove",D),document.addEventListener("pointerup",P);const V=d.current;u.canCloseOnClick=!0,u.canDrag=!0,V.style.transition="none",n.draggableDirection==="x"?(u.start=M.clientX,u.removalDistance=V.offsetWidth*(n.draggablePercent/100)):(u.start=M.clientY,u.removalDistance=V.offsetHeight*(n.draggablePercent===80?1.5*n.draggablePercent:n.draggablePercent)/100)}},onPointerUp:function(M){const{top:V,bottom:G,left:$,right:ne}=d.current.getBoundingClientRect();M.nativeEvent.type!=="touchend"&&n.pauseOnHover&&M.clientX>=$&&M.clientX<=ne&&M.clientY>=V&&M.clientY<=G?O():N()}};return p&&m&&(j.onMouseEnter=O,n.stacked||(j.onMouseLeave=N)),E&&(j.onClick=M=>{_&&_(M),u.canCloseOnClick&&y()}),{playToast:N,pauseToast:O,isRunning:t,preventExitTransition:s,toastRef:d,eventHandlers:j}}function yLe(n){let{delay:t,isRunning:i,closeToast:s,type:l="default",hide:d,className:u,style:p,controlledProgress:m,progress:y,rtl:_,isIn:E,theme:C}=n;const x=d||m&&y===0,N={...p,animationDuration:`${t}ms`,animationPlayState:i?"running":"paused"};m&&(N.transform=`scaleX(${y})`);const O=Lv("Toastify__progress-bar",m?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${C}`,`Toastify__progress-bar--${l}`,{"Toastify__progress-bar--rtl":_}),D=Jd(u)?u({rtl:_,type:l,defaultClassName:O}):Lv(O,u),P={[m&&y>=1?"onTransitionEnd":"onAnimationEnd"]:m&&y<1?null:()=>{E&&s()}};return dn.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},dn.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${C} Toastify__progress-bar--${l}`}),dn.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer",className:D,style:N,...P}))}let _Le=1;const S1e=()=>""+_Le++;function ELe(n){return n&&(L2(n.toastId)||dN(n.toastId))?n.toastId:S1e()}function U4(n,t){return w1e(n,t),t.toastId}function j7(n,t){return{...t,type:t&&t.type||n,toastId:ELe(t)}}function W8(n){return(t,i)=>U4(t,j7(n,i))}function ts(n,t){return U4(n,j7("default",t))}ts.loading=(n,t)=>U4(n,j7("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ts.promise=function(n,t,i){let s,{pending:l,error:d,success:u}=t;l&&(s=L2(l)?ts.loading(l,i):ts.loading(l.render,{...i,...l}));const p={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},m=(_,E,C)=>{if(E==null)return void ts.dismiss(s);const x={type:_,...p,...i,data:C},N=L2(E)?{render:E}:E;return s?ts.update(s,{...x,...N}):ts(N.render,{...x,...N}),C},y=Jd(n)?n():n;return y.then(_=>m("success",u,_)).catch(_=>m("error",d,_)),y},ts.success=W8("success"),ts.info=W8("info"),ts.error=W8("error"),ts.warning=W8("warning"),ts.warn=ts.warning,ts.dark=(n,t)=>U4(n,j7("default",{theme:"dark",...t})),ts.dismiss=function(n){(function(t){var i;if(_1e()){if(t==null||L2(i=t)||dN(i))dc.forEach(l=>{l.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){var s;(s=dc.get(t.containerId))!=null&&s.removeToast(t.id)||dc.forEach(l=>{l.removeToast(t.id)})}}else uN=uN.filter(l=>t!=null&&l.options.toastId!==t)})(n)},ts.clearWaitingQueue=function(n){n===void 0&&(n={}),dc.forEach(t=>{!t.props.limit||n.containerId&&t.id!==n.containerId||t.clearQueue()})},ts.isActive=E1e,ts.update=function(n,t){t===void 0&&(t={});const i=((s,l)=>{var d;let{containerId:u}=l;return(d=dc.get(u||1))==null?void 0:d.toasts.get(s)})(n,t);if(i){const{props:s,content:l}=i,d={delay:100,...s,...t,toastId:t.toastId||n,updateId:S1e()};d.toastId!==n&&(d.staleId=n);const u=d.render||l;delete d.render,U4(u,d)}},ts.done=n=>{ts.update(n,{progress:1})},ts.onChange=function(n){return Zq.add(n),()=>{Zq.delete(n)}},ts.play=n=>Jue(!0,n),ts.pause=n=>Jue(!1,n);const wLe=typeof window<"u"?k.useLayoutEffect:k.useEffect,$8=n=>{let{theme:t,type:i,isLoading:s,...l}=n;return dn.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${i})`,...l})},iK={info:function(n){return dn.createElement($8,{...n},dn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(n){return dn.createElement($8,{...n},dn.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(n){return dn.createElement($8,{...n},dn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(n){return dn.createElement($8,{...n},dn.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return dn.createElement("div",{className:"Toastify__spinner"})}},SLe=n=>{const{isRunning:t,preventExitTransition:i,toastRef:s,eventHandlers:l,playToast:d}=vLe(n),{closeButton:u,children:p,autoClose:m,onClick:y,type:_,hideProgressBar:E,closeToast:C,transition:x,position:N,className:O,style:D,bodyClassName:P,bodyStyle:j,progressClassName:M,progressStyle:V,updateId:G,role:$,progress:ne,rtl:Y,toastId:le,deleteToast:re,isIn:ee,isLoading:de,closeOnClick:H,theme:ae}=n,_e=Lv("Toastify__toast",`Toastify__toast-theme--${ae}`,`Toastify__toast--${_}`,{"Toastify__toast--rtl":Y},{"Toastify__toast--close-on-click":H}),me=Jd(O)?O({rtl:Y,position:N,type:_,defaultClassName:_e}):Lv(_e,O),Ce=function(Fe){let{theme:Ue,type:Ve,isLoading:Re,icon:Be}=Fe,Xe=null;const we={theme:Ue,type:Ve};return Be===!1||(Jd(Be)?Xe=Be({...we,isLoading:Re}):k.isValidElement(Be)?Xe=k.cloneElement(Be,we):Re?Xe=iK.spinner():(We=>We in iK)(Ve)&&(Xe=iK[Ve](we))),Xe}(n),he=!!ne||!m,pe={closeToast:C,type:_,theme:ae};let Oe=null;return u===!1||(Oe=Jd(u)?u(pe):k.isValidElement(u)?k.cloneElement(u,pe):function(Fe){let{closeToast:Ue,theme:Ve,ariaLabel:Re="close"}=Fe;return dn.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Ve}`,type:"button",onClick:Be=>{Be.stopPropagation(),Ue(Be)},"aria-label":Re},dn.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},dn.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(pe)),dn.createElement(x,{isIn:ee,done:re,position:N,preventExitTransition:i,nodeRef:s,playToast:d},dn.createElement("div",{id:le,onClick:y,"data-in":ee,className:me,...l,style:D,ref:s},dn.createElement("div",{...ee&&{role:$},className:Jd(P)?P({type:_}):Lv("Toastify__toast-body",P),style:j},Ce!=null&&dn.createElement("div",{className:Lv("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!de})},Ce),dn.createElement("div",null,p)),Oe,dn.createElement(yLe,{...G&&!he?{key:`pb-${G}`}:{},rtl:Y,theme:ae,delay:m,isRunning:t,isIn:ee,closeToast:C,hide:E,type:_,style:V,className:M,controlledProgress:he,progress:ne||0})))},DU=function(n,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${n}-enter`,exit:`Toastify--animate Toastify__${n}-exit`,appendPosition:t}},bLe=LU(DU("bounce",!0)),CLe=LU(DU("slide",!0));LU(DU("zoom"));LU(DU("flip"));const TLe={position:"top-right",transition:bLe,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function RLe(n){let t={...TLe,...n};const i=n.stacked,[s,l]=k.useState(!0),d=k.useRef(null),{getToastToRender:u,isToastActive:p,count:m}=gLe(t),{className:y,style:_,rtl:E,containerId:C}=t;function x(O){const D=Lv("Toastify__toast-container",`Toastify__toast-container--${O}`,{"Toastify__toast-container--rtl":E});return Jd(y)?y({position:O,rtl:E,defaultClassName:D}):Lv(D,bM(y))}function N(){i&&(l(!0),ts.play())}return wLe(()=>{if(i){var O;const D=d.current.querySelectorAll('[data-in="true"]'),P=12,j=(O=t.position)==null?void 0:O.includes("top");let M=0,V=0;Array.from(D).reverse().forEach((G,$)=>{const ne=G;ne.classList.add("Toastify__toast--stacked"),$>0&&(ne.dataset.collapsed=`${s}`),ne.dataset.pos||(ne.dataset.pos=j?"top":"bot");const Y=M*(s?.2:1)+(s?0:P*$);ne.style.setProperty("--y",`${j?Y:-1*Y}px`),ne.style.setProperty("--g",`${P}`),ne.style.setProperty("--s",""+(1-(s?V:0))),M+=ne.offsetHeight,V+=.025})}},[s,m,i]),dn.createElement("div",{ref:d,className:"Toastify",id:C,onMouseEnter:()=>{i&&(l(!1),ts.pause())},onMouseLeave:N},u((O,D)=>{const P=D.length?{..._}:{..._,pointerEvents:"none"};return dn.createElement("div",{className:x(O),style:P,key:`container-${O}`},D.map(j=>{let{content:M,props:V}=j;return dn.createElement(SLe,{...V,stacked:i,collapseAll:N,isIn:p(V.toastId,V.containerId),style:V.style,key:`toast-${V.key}`},M)}))}))}const Qt=(n="Default message!",t="info")=>{t==="success"&&ts.success(n,{}),t==="error"&&ts.error(n,{}),t==="info"&&ts.info(n,{})},xLe=(n,t)=>{n==="dark"?document.body.classList.add("dark_theme"):document.body.classList.remove("dark_theme"),t(n),localStorage.setItem("theme",n)};function vx(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Jv(n="Guest",t="User",i=""){const s=`${n&&n} ${i&&i} ${t&&t}`;return!n&&!i&&!t?"Guest User":s}function ALe(n){const t=[{id:"dashboard",title:""},{id:"profile",title:"Profile"},{id:"change-password",title:"Change Password"},{id:"quick-actions",title:"Quick Actions"},{id:"notifications",title:"Notifications"},{id:"appreciations",title:"Appreciations"},{id:"badges",title:"Badges"},{id:"rewards",title:"Rewards"},{id:"metric-reports",title:"Metric Reports"},{id:"approve-reject-form-submission",title:"Approve or Reject Form Submission"},{id:"quick-actions-content",title:"Quick Actions Content"},{id:"magazines",title:"Magazines"},{id:"magazine-details",title:"Magazine Details"},{id:"messages",title:"Messages"},{id:"messages-details",title:"Messages Details"},{id:"contests",title:"Detailing Contests"},{id:"contest-details",title:"Contest Details"},{id:"upload-response",title:"Upload Response"},{id:"evaluate",title:"Evaluate"},{id:"competition-contests",title:"Contests"}];let i="";return t.forEach(s=>{(s==null?void 0:s.id.toLowerCase())===n.toLowerCase()&&(i=s==null?void 0:s.title)}),i}function ILe(n){let t="image2",i="media-image";switch(n?n.toLowerCase():"image"){case"video":t="play1",i="media-video";break;case"audio":t="consult1",i="media-audio";break;case"pdf":t="pdf2",i="media-doc";break;case"image":t="image2",i="media-image";break;case"gallery":t="image3",i="media-image";break;case"survey":t="survey1",i="media-survey";break;case"form":t="form1",i="media-form";break;case"quiz":t="quiz2",i="media-quiz";break;case"external":t="link2",i="media-link";break;default:t="consult1"}return{mediaIcon:t,mediaIconClass:i}}function OQ(n,t){return[parseInt(n/60/60),parseInt(n/60%60),parseInt(n%60)].join(t||":").replace(/\b(\d)\b/g,"0$1").replace(/^00\:/,"")}const D2=n=>{const t=`${Math.floor(n/60)}`.padStart(2,"0"),i=`${n-t*60}`.padStart(2,"0");return`${t>0?`${t}:${i} min`:`${i} sec`}`},NLe=(n,t)=>t.split(".").reduce((i,s)=>i&&i[s],n),pP=(n,t,i)=>{if(!t.trim())return n;const s=t.toLowerCase().split(" ").filter(Boolean);return n.filter(l=>s.some(d=>i.some(u=>{const p=NLe(l,u);return p==null?void 0:p.toLowerCase().includes(d)})))};function b1e(n,t){return function(){return n.apply(t,arguments)}}const{toString:OLe}=Object.prototype,{getPrototypeOf:PQ}=Object,kU=(n=>t=>{const i=OLe.call(t);return n[i]||(n[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Sf=n=>(n=n.toLowerCase(),t=>kU(t)===n),MU=n=>t=>typeof t===n,{isArray:yx}=Array,hN=MU("undefined");function PLe(n){return n!==null&&!hN(n)&&n.constructor!==null&&!hN(n.constructor)&&tu(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const C1e=Sf("ArrayBuffer");function LLe(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&C1e(n.buffer),t}const DLe=MU("string"),tu=MU("function"),T1e=MU("number"),jU=n=>n!==null&&typeof n=="object",kLe=n=>n===!0||n===!1,CM=n=>{if(kU(n)!=="object")return!1;const t=PQ(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},MLe=Sf("Date"),jLe=Sf("File"),ULe=Sf("Blob"),FLe=Sf("FileList"),BLe=n=>jU(n)&&tu(n.pipe),VLe=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||tu(n.append)&&((t=kU(n))==="formdata"||t==="object"&&tu(n.toString)&&n.toString()==="[object FormData]"))},zLe=Sf("URLSearchParams"),[HLe,GLe,WLe,$Le]=["ReadableStream","Request","Response","Headers"].map(Sf),KLe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mP(n,t,{allOwnKeys:i=!1}={}){if(n===null||typeof n>"u")return;let s,l;if(typeof n!="object"&&(n=[n]),yx(n))for(s=0,l=n.length;s<l;s++)t.call(null,n[s],s,n);else{const d=i?Object.getOwnPropertyNames(n):Object.keys(n),u=d.length;let p;for(s=0;s<u;s++)p=d[s],t.call(null,n[p],p,n)}}function R1e(n,t){t=t.toLowerCase();const i=Object.keys(n);let s=i.length,l;for(;s-- >0;)if(l=i[s],t===l.toLowerCase())return l;return null}const Z_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Xo,x1e=n=>!hN(n)&&n!==Z_;function eY(){const{caseless:n}=x1e(this)&&this||{},t={},i=(s,l)=>{const d=n&&R1e(t,l)||l;CM(t[d])&&CM(s)?t[d]=eY(t[d],s):CM(s)?t[d]=eY({},s):yx(s)?t[d]=s.slice():t[d]=s};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&mP(arguments[s],i);return t}const qLe=(n,t,i,{allOwnKeys:s}={})=>(mP(t,(l,d)=>{i&&tu(l)?n[d]=b1e(l,i):n[d]=l},{allOwnKeys:s}),n),YLe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),XLe=(n,t,i,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),i&&Object.assign(n.prototype,i)},JLe=(n,t,i,s)=>{let l,d,u;const p={};if(t=t||{},n==null)return t;do{for(l=Object.getOwnPropertyNames(n),d=l.length;d-- >0;)u=l[d],(!s||s(u,n,t))&&!p[u]&&(t[u]=n[u],p[u]=!0);n=i!==!1&&PQ(n)}while(n&&(!i||i(n,t))&&n!==Object.prototype);return t},QLe=(n,t,i)=>{n=String(n),(i===void 0||i>n.length)&&(i=n.length),i-=t.length;const s=n.indexOf(t,i);return s!==-1&&s===i},ZLe=n=>{if(!n)return null;if(yx(n))return n;let t=n.length;if(!T1e(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=n[t];return i},eDe=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&PQ(Uint8Array)),tDe=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let l;for(;(l=s.next())&&!l.done;){const d=l.value;t.call(n,d[0],d[1])}},nDe=(n,t)=>{let i;const s=[];for(;(i=n.exec(t))!==null;)s.push(i);return s},iDe=Sf("HTMLFormElement"),rDe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,s,l){return s.toUpperCase()+l}),Que=(({hasOwnProperty:n})=>(t,i)=>n.call(t,i))(Object.prototype),sDe=Sf("RegExp"),A1e=(n,t)=>{const i=Object.getOwnPropertyDescriptors(n),s={};mP(i,(l,d)=>{let u;(u=t(l,d,n))!==!1&&(s[d]=u||l)}),Object.defineProperties(n,s)},aDe=n=>{A1e(n,(t,i)=>{if(tu(n)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const s=n[i];if(tu(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},oDe=(n,t)=>{const i={},s=l=>{l.forEach(d=>{i[d]=!0})};return yx(n)?s(n):s(String(n).split(t)),i},lDe=()=>{},cDe=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t,rK="abcdefghijklmnopqrstuvwxyz",Zue="0123456789",I1e={DIGIT:Zue,ALPHA:rK,ALPHA_DIGIT:rK+rK.toUpperCase()+Zue},dDe=(n=16,t=I1e.ALPHA_DIGIT)=>{let i="";const{length:s}=t;for(;n--;)i+=t[Math.random()*s|0];return i};function uDe(n){return!!(n&&tu(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const hDe=n=>{const t=new Array(10),i=(s,l)=>{if(jU(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[l]=s;const d=yx(s)?[]:{};return mP(s,(u,p)=>{const m=i(u,l+1);!hN(m)&&(d[p]=m)}),t[l]=void 0,d}}return s};return i(n,0)},fDe=Sf("AsyncFunction"),pDe=n=>n&&(jU(n)||tu(n))&&tu(n.then)&&tu(n.catch),N1e=((n,t)=>n?setImmediate:t?((i,s)=>(Z_.addEventListener("message",({source:l,data:d})=>{l===Z_&&d===i&&s.length&&s.shift()()},!1),l=>{s.push(l),Z_.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",tu(Z_.postMessage)),mDe=typeof queueMicrotask<"u"?queueMicrotask.bind(Z_):typeof lc<"u"&&lc.nextTick||N1e,At={isArray:yx,isArrayBuffer:C1e,isBuffer:PLe,isFormData:VLe,isArrayBufferView:LLe,isString:DLe,isNumber:T1e,isBoolean:kLe,isObject:jU,isPlainObject:CM,isReadableStream:HLe,isRequest:GLe,isResponse:WLe,isHeaders:$Le,isUndefined:hN,isDate:MLe,isFile:jLe,isBlob:ULe,isRegExp:sDe,isFunction:tu,isStream:BLe,isURLSearchParams:zLe,isTypedArray:eDe,isFileList:FLe,forEach:mP,merge:eY,extend:qLe,trim:KLe,stripBOM:YLe,inherits:XLe,toFlatObject:JLe,kindOf:kU,kindOfTest:Sf,endsWith:QLe,toArray:ZLe,forEachEntry:tDe,matchAll:nDe,isHTMLForm:iDe,hasOwnProperty:Que,hasOwnProp:Que,reduceDescriptors:A1e,freezeMethods:aDe,toObjectSet:oDe,toCamelCase:rDe,noop:lDe,toFiniteNumber:cDe,findKey:R1e,global:Z_,isContextDefined:x1e,ALPHABET:I1e,generateString:dDe,isSpecCompliantForm:uDe,toJSONObject:hDe,isAsyncFn:fDe,isThenable:pDe,setImmediate:N1e,asap:mDe};function xi(n,t,i,s,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),s&&(this.request=s),l&&(this.response=l)}At.inherits(xi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:At.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const O1e=xi.prototype,P1e={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{P1e[n]={value:n}});Object.defineProperties(xi,P1e);Object.defineProperty(O1e,"isAxiosError",{value:!0});xi.from=(n,t,i,s,l,d)=>{const u=Object.create(O1e);return At.toFlatObject(n,u,function(m){return m!==Error.prototype},p=>p!=="isAxiosError"),xi.call(u,n.message,t,i,s,l),u.cause=n,u.name=n.name,d&&Object.assign(u,d),u};const gDe=null;function tY(n){return At.isPlainObject(n)||At.isArray(n)}function L1e(n){return At.endsWith(n,"[]")?n.slice(0,-2):n}function ehe(n,t,i){return n?n.concat(t).map(function(l,d){return l=L1e(l),!i&&d?"["+l+"]":l}).join(i?".":""):t}function vDe(n){return At.isArray(n)&&!n.some(tY)}const yDe=At.toFlatObject(At,{},null,function(t){return/^is[A-Z]/.test(t)});function UU(n,t,i){if(!At.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,i=At.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,D){return!At.isUndefined(D[O])});const s=i.metaTokens,l=i.visitor||_,d=i.dots,u=i.indexes,m=(i.Blob||typeof Blob<"u"&&Blob)&&At.isSpecCompliantForm(t);if(!At.isFunction(l))throw new TypeError("visitor must be a function");function y(N){if(N===null)return"";if(At.isDate(N))return N.toISOString();if(!m&&At.isBlob(N))throw new xi("Blob is not supported. Use a Buffer instead.");return At.isArrayBuffer(N)||At.isTypedArray(N)?m&&typeof Blob=="function"?new Blob([N]):D7.from(N):N}function _(N,O,D){let P=N;if(N&&!D&&typeof N=="object"){if(At.endsWith(O,"{}"))O=s?O:O.slice(0,-2),N=JSON.stringify(N);else if(At.isArray(N)&&vDe(N)||(At.isFileList(N)||At.endsWith(O,"[]"))&&(P=At.toArray(N)))return O=L1e(O),P.forEach(function(M,V){!(At.isUndefined(M)||M===null)&&t.append(u===!0?ehe([O],V,d):u===null?O:O+"[]",y(M))}),!1}return tY(N)?!0:(t.append(ehe(D,O,d),y(N)),!1)}const E=[],C=Object.assign(yDe,{defaultVisitor:_,convertValue:y,isVisitable:tY});function x(N,O){if(!At.isUndefined(N)){if(E.indexOf(N)!==-1)throw Error("Circular reference detected in "+O.join("."));E.push(N),At.forEach(N,function(P,j){(!(At.isUndefined(P)||P===null)&&l.call(t,P,At.isString(j)?j.trim():j,O,C))===!0&&x(P,O?O.concat(j):[j])}),E.pop()}}if(!At.isObject(n))throw new TypeError("data must be an object");return x(n),t}function the(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function LQ(n,t){this._pairs=[],n&&UU(n,this,t)}const D1e=LQ.prototype;D1e.append=function(t,i){this._pairs.push([t,i])};D1e.toString=function(t){const i=t?function(s){return t.call(this,s,the)}:the;return this._pairs.map(function(l){return i(l[0])+"="+i(l[1])},"").join("&")};function _De(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function k1e(n,t,i){if(!t)return n;const s=i&&i.encode||_De,l=i&&i.serialize;let d;if(l?d=l(t,i):d=At.isURLSearchParams(t)?t.toString():new LQ(t,i).toString(s),d){const u=n.indexOf("#");u!==-1&&(n=n.slice(0,u)),n+=(n.indexOf("?")===-1?"?":"&")+d}return n}class nhe{constructor(){this.handlers=[]}use(t,i,s){return this.handlers.push({fulfilled:t,rejected:i,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){At.forEach(this.handlers,function(s){s!==null&&t(s)})}}const M1e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},EDe=typeof URLSearchParams<"u"?URLSearchParams:LQ,wDe=typeof FormData<"u"?FormData:null,SDe=typeof Blob<"u"?Blob:null,bDe={isBrowser:!0,classes:{URLSearchParams:EDe,FormData:wDe,Blob:SDe},protocols:["http","https","file","blob","url","data"]},DQ=typeof window<"u"&&typeof document<"u",CDe=(n=>DQ&&["ReactNative","NativeScript","NS"].indexOf(n)<0)(typeof navigator<"u"&&navigator.product),TDe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",RDe=DQ&&window.location.href||"http://localhost",xDe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:DQ,hasStandardBrowserEnv:CDe,hasStandardBrowserWebWorkerEnv:TDe,origin:RDe},Symbol.toStringTag,{value:"Module"})),vf={...xDe,...bDe};function ADe(n,t){return UU(n,new vf.classes.URLSearchParams,Object.assign({visitor:function(i,s,l,d){return vf.isNode&&At.isBuffer(i)?(this.append(s,i.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},t))}function IDe(n){return At.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function NDe(n){const t={},i=Object.keys(n);let s;const l=i.length;let d;for(s=0;s<l;s++)d=i[s],t[d]=n[d];return t}function j1e(n){function t(i,s,l,d){let u=i[d++];if(u==="__proto__")return!0;const p=Number.isFinite(+u),m=d>=i.length;return u=!u&&At.isArray(l)?l.length:u,m?(At.hasOwnProp(l,u)?l[u]=[l[u],s]:l[u]=s,!p):((!l[u]||!At.isObject(l[u]))&&(l[u]=[]),t(i,s,l[u],d)&&At.isArray(l[u])&&(l[u]=NDe(l[u])),!p)}if(At.isFormData(n)&&At.isFunction(n.entries)){const i={};return At.forEachEntry(n,(s,l)=>{t(IDe(s),l,i,0)}),i}return null}function ODe(n,t,i){if(At.isString(n))try{return(t||JSON.parse)(n),At.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(i||JSON.stringify)(n)}const kQ={transitional:M1e,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const s=i.getContentType()||"",l=s.indexOf("application/json")>-1,d=At.isObject(t);if(d&&At.isHTMLForm(t)&&(t=new FormData(t)),At.isFormData(t))return l?JSON.stringify(j1e(t)):t;if(At.isArrayBuffer(t)||At.isBuffer(t)||At.isStream(t)||At.isFile(t)||At.isBlob(t)||At.isReadableStream(t))return t;if(At.isArrayBufferView(t))return t.buffer;if(At.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let p;if(d){if(s.indexOf("application/x-www-form-urlencoded")>-1)return ADe(t,this.formSerializer).toString();if((p=At.isFileList(t))||s.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return UU(p?{"files[]":t}:t,m&&new m,this.formSerializer)}}return d||l?(i.setContentType("application/json",!1),ODe(t)):t}],transformResponse:[function(t){const i=this.transitional||kQ.transitional,s=i&&i.forcedJSONParsing,l=this.responseType==="json";if(At.isResponse(t)||At.isReadableStream(t))return t;if(t&&At.isString(t)&&(s&&!this.responseType||l)){const u=!(i&&i.silentJSONParsing)&&l;try{return JSON.parse(t)}catch(p){if(u)throw p.name==="SyntaxError"?xi.from(p,xi.ERR_BAD_RESPONSE,this,null,this.response):p}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vf.classes.FormData,Blob:vf.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};At.forEach(["delete","get","head","post","put","patch"],n=>{kQ.headers[n]={}});const MQ=kQ,PDe=At.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),LDe=n=>{const t={};let i,s,l;return n&&n.split(`
`).forEach(function(u){l=u.indexOf(":"),i=u.substring(0,l).trim().toLowerCase(),s=u.substring(l+1).trim(),!(!i||t[i]&&PDe[i])&&(i==="set-cookie"?t[i]?t[i].push(s):t[i]=[s]:t[i]=t[i]?t[i]+", "+s:s)}),t},ihe=Symbol("internals");function j3(n){return n&&String(n).trim().toLowerCase()}function TM(n){return n===!1||n==null?n:At.isArray(n)?n.map(TM):String(n)}function DDe(n){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=i.exec(n);)t[s[1]]=s[2];return t}const kDe=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function sK(n,t,i,s,l){if(At.isFunction(s))return s.call(this,t,i);if(l&&(t=i),!!At.isString(t)){if(At.isString(s))return t.indexOf(s)!==-1;if(At.isRegExp(s))return s.test(t)}}function MDe(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,s)=>i.toUpperCase()+s)}function jDe(n,t){const i=At.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+i,{value:function(l,d,u){return this[s].call(this,t,l,d,u)},configurable:!0})})}class FU{constructor(t){t&&this.set(t)}set(t,i,s){const l=this;function d(p,m,y){const _=j3(m);if(!_)throw new Error("header name must be a non-empty string");const E=At.findKey(l,_);(!E||l[E]===void 0||y===!0||y===void 0&&l[E]!==!1)&&(l[E||m]=TM(p))}const u=(p,m)=>At.forEach(p,(y,_)=>d(y,_,m));if(At.isPlainObject(t)||t instanceof this.constructor)u(t,i);else if(At.isString(t)&&(t=t.trim())&&!kDe(t))u(LDe(t),i);else if(At.isHeaders(t))for(const[p,m]of t.entries())d(m,p,s);else t!=null&&d(i,t,s);return this}get(t,i){if(t=j3(t),t){const s=At.findKey(this,t);if(s){const l=this[s];if(!i)return l;if(i===!0)return DDe(l);if(At.isFunction(i))return i.call(this,l,s);if(At.isRegExp(i))return i.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=j3(t),t){const s=At.findKey(this,t);return!!(s&&this[s]!==void 0&&(!i||sK(this,this[s],s,i)))}return!1}delete(t,i){const s=this;let l=!1;function d(u){if(u=j3(u),u){const p=At.findKey(s,u);p&&(!i||sK(s,s[p],p,i))&&(delete s[p],l=!0)}}return At.isArray(t)?t.forEach(d):d(t),l}clear(t){const i=Object.keys(this);let s=i.length,l=!1;for(;s--;){const d=i[s];(!t||sK(this,this[d],d,t,!0))&&(delete this[d],l=!0)}return l}normalize(t){const i=this,s={};return At.forEach(this,(l,d)=>{const u=At.findKey(s,d);if(u){i[u]=TM(l),delete i[d];return}const p=t?MDe(d):String(d).trim();p!==d&&delete i[d],i[p]=TM(l),s[p]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return At.forEach(this,(s,l)=>{s!=null&&s!==!1&&(i[l]=t&&At.isArray(s)?s.join(", "):s)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const s=new this(t);return i.forEach(l=>s.set(l)),s}static accessor(t){const s=(this[ihe]=this[ihe]={accessors:{}}).accessors,l=this.prototype;function d(u){const p=j3(u);s[p]||(jDe(l,u),s[p]=!0)}return At.isArray(t)?t.forEach(d):d(t),this}}FU.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);At.reduceDescriptors(FU.prototype,({value:n},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[i]=s}}});At.freezeMethods(FU);const yf=FU;function aK(n,t){const i=this||MQ,s=t||i,l=yf.from(s.headers);let d=s.data;return At.forEach(n,function(p){d=p.call(i,d,l.normalize(),t?t.status:void 0)}),l.normalize(),d}function U1e(n){return!!(n&&n.__CANCEL__)}function _x(n,t,i){xi.call(this,n??"canceled",xi.ERR_CANCELED,t,i),this.name="CanceledError"}At.inherits(_x,xi,{__CANCEL__:!0});function F1e(n,t,i){const s=i.config.validateStatus;!i.status||!s||s(i.status)?n(i):t(new xi("Request failed with status code "+i.status,[xi.ERR_BAD_REQUEST,xi.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function UDe(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function FDe(n,t){n=n||10;const i=new Array(n),s=new Array(n);let l=0,d=0,u;return t=t!==void 0?t:1e3,function(m){const y=Date.now(),_=s[d];u||(u=y),i[l]=m,s[l]=y;let E=d,C=0;for(;E!==l;)C+=i[E++],E=E%n;if(l=(l+1)%n,l===d&&(d=(d+1)%n),y-u<t)return;const x=_&&y-_;return x?Math.round(C*1e3/x):void 0}}function BDe(n,t){let i=0,s=1e3/t,l,d;const u=(y,_=Date.now())=>{i=_,l=null,d&&(clearTimeout(d),d=null),n.apply(null,y)};return[(...y)=>{const _=Date.now(),E=_-i;E>=s?u(y,_):(l=y,d||(d=setTimeout(()=>{d=null,u(l)},s-E)))},()=>l&&u(l)]}const U7=(n,t,i=3)=>{let s=0;const l=FDe(50,250);return BDe(d=>{const u=d.loaded,p=d.lengthComputable?d.total:void 0,m=u-s,y=l(m),_=u<=p;s=u;const E={loaded:u,total:p,progress:p?u/p:void 0,bytes:m,rate:y||void 0,estimated:y&&p&&_?(p-u)/y:void 0,event:d,lengthComputable:p!=null,[t?"download":"upload"]:!0};n(E)},i)},rhe=(n,t)=>{const i=n!=null;return[s=>t[0]({lengthComputable:i,total:n,loaded:s}),t[1]]},she=n=>(...t)=>At.asap(()=>n(...t)),VDe=vf.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let s;function l(d){let u=d;return t&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return s=l(window.location.href),function(u){const p=At.isString(u)?l(u):u;return p.protocol===s.protocol&&p.host===s.host}}():function(){return function(){return!0}}(),zDe=vf.hasStandardBrowserEnv?{write(n,t,i,s,l,d){const u=[n+"="+encodeURIComponent(t)];At.isNumber(i)&&u.push("expires="+new Date(i).toGMTString()),At.isString(s)&&u.push("path="+s),At.isString(l)&&u.push("domain="+l),d===!0&&u.push("secure"),document.cookie=u.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function HDe(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function GDe(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function B1e(n,t){return n&&!HDe(t)?GDe(n,t):t}const ahe=n=>n instanceof yf?{...n}:n;function G2(n,t){t=t||{};const i={};function s(y,_,E){return At.isPlainObject(y)&&At.isPlainObject(_)?At.merge.call({caseless:E},y,_):At.isPlainObject(_)?At.merge({},_):At.isArray(_)?_.slice():_}function l(y,_,E){if(At.isUndefined(_)){if(!At.isUndefined(y))return s(void 0,y,E)}else return s(y,_,E)}function d(y,_){if(!At.isUndefined(_))return s(void 0,_)}function u(y,_){if(At.isUndefined(_)){if(!At.isUndefined(y))return s(void 0,y)}else return s(void 0,_)}function p(y,_,E){if(E in t)return s(y,_);if(E in n)return s(void 0,y)}const m={url:d,method:d,data:d,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:p,headers:(y,_)=>l(ahe(y),ahe(_),!0)};return At.forEach(Object.keys(Object.assign({},n,t)),function(_){const E=m[_]||l,C=E(n[_],t[_],_);At.isUndefined(C)&&E!==p||(i[_]=C)}),i}const V1e=n=>{const t=G2({},n);let{data:i,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:d,headers:u,auth:p}=t;t.headers=u=yf.from(u),t.url=k1e(B1e(t.baseURL,t.url),n.params,n.paramsSerializer),p&&u.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):"")));let m;if(At.isFormData(i)){if(vf.hasStandardBrowserEnv||vf.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((m=u.getContentType())!==!1){const[y,..._]=m?m.split(";").map(E=>E.trim()).filter(Boolean):[];u.setContentType([y||"multipart/form-data",..._].join("; "))}}if(vf.hasStandardBrowserEnv&&(s&&At.isFunction(s)&&(s=s(t)),s||s!==!1&&VDe(t.url))){const y=l&&d&&zDe.read(d);y&&u.set(l,y)}return t},WDe=typeof XMLHttpRequest<"u",$De=WDe&&function(n){return new Promise(function(i,s){const l=V1e(n);let d=l.data;const u=yf.from(l.headers).normalize();let{responseType:p,onUploadProgress:m,onDownloadProgress:y}=l,_,E,C,x,N;function O(){x&&x(),N&&N(),l.cancelToken&&l.cancelToken.unsubscribe(_),l.signal&&l.signal.removeEventListener("abort",_)}let D=new XMLHttpRequest;D.open(l.method.toUpperCase(),l.url,!0),D.timeout=l.timeout;function P(){if(!D)return;const M=yf.from("getAllResponseHeaders"in D&&D.getAllResponseHeaders()),G={data:!p||p==="text"||p==="json"?D.responseText:D.response,status:D.status,statusText:D.statusText,headers:M,config:n,request:D};F1e(function(ne){i(ne),O()},function(ne){s(ne),O()},G),D=null}"onloadend"in D?D.onloadend=P:D.onreadystatechange=function(){!D||D.readyState!==4||D.status===0&&!(D.responseURL&&D.responseURL.indexOf("file:")===0)||setTimeout(P)},D.onabort=function(){D&&(s(new xi("Request aborted",xi.ECONNABORTED,n,D)),D=null)},D.onerror=function(){s(new xi("Network Error",xi.ERR_NETWORK,n,D)),D=null},D.ontimeout=function(){let V=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const G=l.transitional||M1e;l.timeoutErrorMessage&&(V=l.timeoutErrorMessage),s(new xi(V,G.clarifyTimeoutError?xi.ETIMEDOUT:xi.ECONNABORTED,n,D)),D=null},d===void 0&&u.setContentType(null),"setRequestHeader"in D&&At.forEach(u.toJSON(),function(V,G){D.setRequestHeader(G,V)}),At.isUndefined(l.withCredentials)||(D.withCredentials=!!l.withCredentials),p&&p!=="json"&&(D.responseType=l.responseType),y&&([C,N]=U7(y,!0),D.addEventListener("progress",C)),m&&D.upload&&([E,x]=U7(m),D.upload.addEventListener("progress",E),D.upload.addEventListener("loadend",x)),(l.cancelToken||l.signal)&&(_=M=>{D&&(s(!M||M.type?new _x(null,n,D):M),D.abort(),D=null)},l.cancelToken&&l.cancelToken.subscribe(_),l.signal&&(l.signal.aborted?_():l.signal.addEventListener("abort",_)));const j=UDe(l.url);if(j&&vf.protocols.indexOf(j)===-1){s(new xi("Unsupported protocol "+j+":",xi.ERR_BAD_REQUEST,n));return}D.send(d||null)})},KDe=(n,t)=>{let i=new AbortController,s;const l=function(m){if(!s){s=!0,u();const y=m instanceof Error?m:this.reason;i.abort(y instanceof xi?y:new _x(y instanceof Error?y.message:y))}};let d=t&&setTimeout(()=>{l(new xi(`timeout ${t} of ms exceeded`,xi.ETIMEDOUT))},t);const u=()=>{n&&(d&&clearTimeout(d),d=null,n.forEach(m=>{m&&(m.removeEventListener?m.removeEventListener("abort",l):m.unsubscribe(l))}),n=null)};n.forEach(m=>m&&m.addEventListener&&m.addEventListener("abort",l));const{signal:p}=i;return p.unsubscribe=u,[p,()=>{d&&clearTimeout(d),d=null}]},qDe=function*(n,t){let i=n.byteLength;if(!t||i<t){yield n;return}let s=0,l;for(;s<i;)l=s+t,yield n.slice(s,l),s=l},YDe=async function*(n,t,i){for await(const s of n)yield*qDe(ArrayBuffer.isView(s)?s:await i(String(s)),t)},ohe=(n,t,i,s,l)=>{const d=YDe(n,t,l);let u=0,p,m=y=>{p||(p=!0,s&&s(y))};return new ReadableStream({async pull(y){try{const{done:_,value:E}=await d.next();if(_){m(),y.close();return}let C=E.byteLength;if(i){let x=u+=C;i(x)}y.enqueue(new Uint8Array(E))}catch(_){throw m(_),_}},cancel(y){return m(y),d.return()}},{highWaterMark:2})},BU=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",z1e=BU&&typeof ReadableStream=="function",nY=BU&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),H1e=(n,...t)=>{try{return!!n(...t)}catch{return!1}},XDe=z1e&&H1e(()=>{let n=!1;const t=new Request(vf.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),lhe=64*1024,iY=z1e&&H1e(()=>At.isReadableStream(new Response("").body)),F7={stream:iY&&(n=>n.body)};BU&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!F7[t]&&(F7[t]=At.isFunction(n[t])?i=>i[t]():(i,s)=>{throw new xi(`Response type '${t}' is not supported`,xi.ERR_NOT_SUPPORT,s)})})})(new Response);const JDe=async n=>{if(n==null)return 0;if(At.isBlob(n))return n.size;if(At.isSpecCompliantForm(n))return(await new Request(n).arrayBuffer()).byteLength;if(At.isArrayBufferView(n)||At.isArrayBuffer(n))return n.byteLength;if(At.isURLSearchParams(n)&&(n=n+""),At.isString(n))return(await nY(n)).byteLength},QDe=async(n,t)=>{const i=At.toFiniteNumber(n.getContentLength());return i??JDe(t)},ZDe=BU&&(async n=>{let{url:t,method:i,data:s,signal:l,cancelToken:d,timeout:u,onDownloadProgress:p,onUploadProgress:m,responseType:y,headers:_,withCredentials:E="same-origin",fetchOptions:C}=V1e(n);y=y?(y+"").toLowerCase():"text";let[x,N]=l||d||u?KDe([l,d],u):[],O,D;const P=()=>{!O&&setTimeout(()=>{x&&x.unsubscribe()}),O=!0};let j;try{if(m&&XDe&&i!=="get"&&i!=="head"&&(j=await QDe(_,s))!==0){let $=new Request(t,{method:"POST",body:s,duplex:"half"}),ne;if(At.isFormData(s)&&(ne=$.headers.get("content-type"))&&_.setContentType(ne),$.body){const[Y,le]=rhe(j,U7(she(m)));s=ohe($.body,lhe,Y,le,nY)}}At.isString(E)||(E=E?"include":"omit"),D=new Request(t,{...C,signal:x,method:i.toUpperCase(),headers:_.normalize().toJSON(),body:s,duplex:"half",credentials:E});let M=await fetch(D);const V=iY&&(y==="stream"||y==="response");if(iY&&(p||V)){const $={};["status","statusText","headers"].forEach(re=>{$[re]=M[re]});const ne=At.toFiniteNumber(M.headers.get("content-length")),[Y,le]=p&&rhe(ne,U7(she(p),!0))||[];M=new Response(ohe(M.body,lhe,Y,()=>{le&&le(),V&&P()},nY),$)}y=y||"text";let G=await F7[At.findKey(F7,y)||"text"](M,n);return!V&&P(),N&&N(),await new Promise(($,ne)=>{F1e($,ne,{data:G,headers:yf.from(M.headers),status:M.status,statusText:M.statusText,config:n,request:D})})}catch(M){throw P(),M&&M.name==="TypeError"&&/fetch/i.test(M.message)?Object.assign(new xi("Network Error",xi.ERR_NETWORK,n,D),{cause:M.cause||M}):xi.from(M,M&&M.code,n,D)}}),rY={http:gDe,xhr:$De,fetch:ZDe};At.forEach(rY,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const che=n=>`- ${n}`,eke=n=>At.isFunction(n)||n===null||n===!1,G1e={getAdapter:n=>{n=At.isArray(n)?n:[n];const{length:t}=n;let i,s;const l={};for(let d=0;d<t;d++){i=n[d];let u;if(s=i,!eke(i)&&(s=rY[(u=String(i)).toLowerCase()],s===void 0))throw new xi(`Unknown adapter '${u}'`);if(s)break;l[u||"#"+d]=s}if(!s){const d=Object.entries(l).map(([p,m])=>`adapter ${p} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=t?d.length>1?`since :
`+d.map(che).join(`
`):" "+che(d[0]):"as no adapter specified";throw new xi("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},adapters:rY};function oK(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new _x(null,n)}function dhe(n){return oK(n),n.headers=yf.from(n.headers),n.data=aK.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),G1e.getAdapter(n.adapter||MQ.adapter)(n).then(function(s){return oK(n),s.data=aK.call(n,n.transformResponse,s),s.headers=yf.from(s.headers),s},function(s){return U1e(s)||(oK(n),s&&s.response&&(s.response.data=aK.call(n,n.transformResponse,s.response),s.response.headers=yf.from(s.response.headers))),Promise.reject(s)})}const W1e="1.7.3",jQ={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{jQ[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const uhe={};jQ.transitional=function(t,i,s){function l(d,u){return"[Axios v"+W1e+"] Transitional option '"+d+"'"+u+(s?". "+s:"")}return(d,u,p)=>{if(t===!1)throw new xi(l(u," has been removed"+(i?" in "+i:"")),xi.ERR_DEPRECATED);return i&&!uhe[u]&&(uhe[u]=!0,console.warn(l(u," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(d,u,p):!0}};function tke(n,t,i){if(typeof n!="object")throw new xi("options must be an object",xi.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let l=s.length;for(;l-- >0;){const d=s[l],u=t[d];if(u){const p=n[d],m=p===void 0||u(p,d,n);if(m!==!0)throw new xi("option "+d+" must be "+m,xi.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new xi("Unknown option "+d,xi.ERR_BAD_OPTION)}}const sY={assertOptions:tke,validators:jQ},f1=sY.validators;class B7{constructor(t){this.defaults=t,this.interceptors={request:new nhe,response:new nhe}}async request(t,i){try{return await this._request(t,i)}catch(s){if(s instanceof Error){let l;Error.captureStackTrace?Error.captureStackTrace(l={}):l=new Error;const d=l.stack?l.stack.replace(/^.+\n/,""):"";try{s.stack?d&&!String(s.stack).endsWith(d.replace(/^.+\n.+\n/,""))&&(s.stack+=`
`+d):s.stack=d}catch{}}throw s}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=G2(this.defaults,i);const{transitional:s,paramsSerializer:l,headers:d}=i;s!==void 0&&sY.assertOptions(s,{silentJSONParsing:f1.transitional(f1.boolean),forcedJSONParsing:f1.transitional(f1.boolean),clarifyTimeoutError:f1.transitional(f1.boolean)},!1),l!=null&&(At.isFunction(l)?i.paramsSerializer={serialize:l}:sY.assertOptions(l,{encode:f1.function,serialize:f1.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let u=d&&At.merge(d.common,d[i.method]);d&&At.forEach(["delete","get","head","post","put","patch","common"],N=>{delete d[N]}),i.headers=yf.concat(u,d);const p=[];let m=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(i)===!1||(m=m&&O.synchronous,p.unshift(O.fulfilled,O.rejected))});const y=[];this.interceptors.response.forEach(function(O){y.push(O.fulfilled,O.rejected)});let _,E=0,C;if(!m){const N=[dhe.bind(this),void 0];for(N.unshift.apply(N,p),N.push.apply(N,y),C=N.length,_=Promise.resolve(i);E<C;)_=_.then(N[E++],N[E++]);return _}C=p.length;let x=i;for(E=0;E<C;){const N=p[E++],O=p[E++];try{x=N(x)}catch(D){O.call(this,D);break}}try{_=dhe.call(this,x)}catch(N){return Promise.reject(N)}for(E=0,C=y.length;E<C;)_=_.then(y[E++],y[E++]);return _}getUri(t){t=G2(this.defaults,t);const i=B1e(t.baseURL,t.url);return k1e(i,t.params,t.paramsSerializer)}}At.forEach(["delete","get","head","options"],function(t){B7.prototype[t]=function(i,s){return this.request(G2(s||{},{method:t,url:i,data:(s||{}).data}))}});At.forEach(["post","put","patch"],function(t){function i(s){return function(d,u,p){return this.request(G2(p||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:d,data:u}))}}B7.prototype[t]=i(),B7.prototype[t+"Form"]=i(!0)});const RM=B7;class UQ{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(d){i=d});const s=this;this.promise.then(l=>{if(!s._listeners)return;let d=s._listeners.length;for(;d-- >0;)s._listeners[d](l);s._listeners=null}),this.promise.then=l=>{let d;const u=new Promise(p=>{s.subscribe(p),d=p}).then(l);return u.cancel=function(){s.unsubscribe(d)},u},t(function(d,u,p){s.reason||(s.reason=new _x(d,u,p),i(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}static source(){let t;return{token:new UQ(function(l){t=l}),cancel:t}}}const nke=UQ;function ike(n){return function(i){return n.apply(null,i)}}function rke(n){return At.isObject(n)&&n.isAxiosError===!0}const aY={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aY).forEach(([n,t])=>{aY[t]=n});const ske=aY;function $1e(n){const t=new RM(n),i=b1e(RM.prototype.request,t);return At.extend(i,RM.prototype,t,{allOwnKeys:!0}),At.extend(i,t,null,{allOwnKeys:!0}),i.create=function(l){return $1e(G2(n,l))},i}const Gr=$1e(MQ);Gr.Axios=RM;Gr.CanceledError=_x;Gr.CancelToken=nke;Gr.isCancel=U1e;Gr.VERSION=W1e;Gr.toFormData=UU;Gr.AxiosError=xi;Gr.Cancel=Gr.CanceledError;Gr.all=function(t){return Promise.all(t)};Gr.spread=ike;Gr.isAxiosError=rke;Gr.mergeConfig=G2;Gr.AxiosHeaders=yf;Gr.formToJSON=n=>j1e(At.isHTMLForm(n)?new FormData(n):n);Gr.getAdapter=G1e.getAdapter;Gr.HttpStatusCode=ske;Gr.default=Gr;var K1e={baseUrl:"https://rapportapi.click/"};const kn=Gr.create({baseURL:K1e.baseUrl,validateStatus:function(n){return n>=200&&n<500},timeout:3e4}),ake=["ums/auth/login","ums/auth/verify","ums/auth/reverify","ums/auth/register","ums/auth/forgot_password_otp","ums/auth/forgot_password","mag/magazine/crest_verfication"],oke=async()=>{var t,i,s,l;const n=localStorage.getItem("refresh_token");try{const d=await Gr.post(`${K1e.baseUrl}ums/auth/reverify`,{refresh_token:n},{headers:{"Content-Type":"application/json"}});if(((t=d.data)==null?void 0:t.status)==="success"&&((i=d.data)==null?void 0:i.statusCode)===200){const{access_token:u,refresh_token:p,user:m,permissions:y,expiresin:_}=(s=d.data)==null?void 0:s.data;return localStorage.setItem("auth_token",u),localStorage.setItem("refresh_token",p),localStorage.setItem("auth_user",JSON.stringify(m)),localStorage.setItem("permissions",JSON.stringify(y)),localStorage.setItem("expiresin",_),u}else throw localStorage.clear(),new Error(((l=d==null?void 0:d.data)==null?void 0:l.message)||"Session expired")}catch(d){throw console.log("reVerifyAuth err - ",d),localStorage.clear(),Qt("Session expired. Please log in again.","error"),d}};kn.interceptors.request.use(async n=>{if(console.log("interceptor called config - ",n),!ake.includes(n.url)){let t=localStorage.getItem("auth_token")?localStorage.getItem("auth_token"):null;const i=parseInt(localStorage.getItem("expiresin")||"0");let s=Date.now()>i;if(!t||s)try{t=await oke(),console.log("auth_token after reVerifyAuth() -- ",t)}catch(l){return console.error("Failed to refresh token",l),Promise.reject(l)}t&&(n.headers.authorization=t)}return n},n=>(window.location.href="/",localStorage.clear(),Promise.reject(n)));const FQ={getFormApprovalInfo:async n=>(console.log("Inside Service getFormApprovalInfo() ...",n),await kn.post("form/formentity/approval",n)),approveForm:async n=>(console.log("Inside Service approveForm() ...",n),await kn.post("form/formentity/approvereject",n)),rejectForm:async n=>(console.log("Inside Service approveForm() ...",n),await kn.post("form/formentity/approvereject",n))},lke="form_approval",cke="form_approved",dke="form_reject",uke="form_submitted",q1e=n=>{console.log("handleNotificationClick called with payload = ",n);const t=n==null?void 0:n.type,i=n!=null&&n.entity_id?n==null?void 0:n.entity_id:n!=null&&n.contest_id?n==null?void 0:n.contest_id:"";let s="/dashboard";switch(t){case"form_approval":s=`/approve-reject-form-submission/${i}`;break;case"form_reminder":s="/quick-actions";break;case"form_approved":case"form_reject":case"form_submitted":console.log("Nothing to do...");break;case"broadcast_created":case"broadcast_liked":case"broadcast_comment":s=`/messages/${i}`;break;case"magazine_created":case"magazine_media_created":s=`/magazines/${i}`;break;case"appreciation_recieved":s="/appreciations";break;case"badge_recieved":s="/badges";break;case"detailing_contest_created":case"detailing_contest_upload_response":case"detailing_contest_evaluated":s=`/contests/${i}`;break;default:console.log("No payload type matched...")}return s},Ai={login:async n=>(console.log("In Login Data =",n),await kn.post("ums/auth/login",n)),changePassword:async n=>(console.log("In Login Service Data =",n),await kn.post("ums/auth/change_password",n)),getToken:()=>localStorage.getItem("auth_token"),getRefreshToken:()=>localStorage.getItem("refresh_token"),getTokenExpiry:()=>localStorage.getItem("expiresin"),setToken:n=>{localStorage.setItem("auth_token",n.access_token),localStorage.setItem("refresh_token",n.refresh_token),localStorage.setItem("auth_user",JSON.stringify(n.user)),localStorage.setItem("permissions",JSON.stringify(n.permissions)),localStorage.setItem("expiresin",n.expiresin)},getLoginSchemeFromLocal:()=>localStorage.getItem("login_scheme"),setLoginSchemeToLocal:n=>{console.log("setLoginSchemeToLocal = ",n,typeof n),localStorage.setItem("login_scheme",n)},setAuthUser:n=>{console.log("setAuthUSer = ",n);const i={...JSON.parse(localStorage.getItem("auth_user")),...n};localStorage.setItem("auth_user",JSON.stringify(i))},logout:()=>{localStorage.clear(),window.location.href="/"},verifyAuth:async n=>(console.log("In Verify Auth: ",n),await kn.post("ums/auth/verify",n)),reVerifyAuth:async n=>await kn.post("ums/auth/reverify",n),forgotPasswordOTP:async n=>await kn.post("ums/auth/forgot_password_otp",n),forgotPassword:async n=>await kn.post("ums/auth/forgot_password",n),getAuthUser:()=>localStorage.getItem("auth_user"),getDeviceInfo:()=>JSON.parse(localStorage.getItem("deviceInfo")),getDevicePlatform:()=>{const n=JSON.parse(localStorage.getItem("deviceInfo"));return n==null?void 0:n.platform},getDeviceID:()=>localStorage.getItem("deviceID"),getAppID:()=>localStorage.getItem("appID"),getAppCurrentVersion:()=>localStorage.getItem("appCurrentVersion"),getNotificationToken:()=>localStorage.getItem("notificationToken"),appInfoFromServer:async n=>(console.log("data in appInfoFromServer = ",JSON.stringify(n)),await kn.post("detailing/app/appversion",n)),registerDeviceForPushNotification:async()=>{console.log("-- ** registerDeviceForPushNotification() service called... ** --");const n=Ai.getDeviceInfo();console.log("deviceInfo from registerDeviceForPushNotification service = ",n);const t={device:Ai.getDeviceID(),platform:n.platform,package_name:Ai.getAppID(),token:Ai.getNotificationToken(),manufacturer:n.manufacturer,device_model:n.model,app_version:Ai.getAppCurrentVersion(),version:n.osVersion};return console.log("registerDeviceForPushNotification service tempData =",t),await kn.post("ums/notification/registertoken",t)}};var Y1e={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(n){(function(){var t={}.hasOwnProperty;function i(){for(var d="",u=0;u<arguments.length;u++){var p=arguments[u];p&&(d=l(d,s(p)))}return d}function s(d){if(typeof d=="string"||typeof d=="number")return d;if(typeof d!="object")return"";if(Array.isArray(d))return i.apply(null,d);if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]"))return d.toString();var u="";for(var p in d)t.call(d,p)&&d[p]&&(u=l(u,p));return u}function l(d,u){return u?d?d+" "+u:d+u:d}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(Y1e);var hke=Y1e.exports;const Fn=ty(hke);function Qd(){return Qd=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},Qd.apply(null,arguments)}function BQ(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)!==-1)continue;i[s]=n[s]}return i}function hhe(n){return"default"+n.charAt(0).toUpperCase()+n.substr(1)}function fke(n){var t=pke(n,"string");return typeof t=="symbol"?t:String(t)}function pke(n,t){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,t||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function mke(n,t,i){var s=k.useRef(n!==void 0),l=k.useState(t),d=l[0],u=l[1],p=n!==void 0,m=s.current;return s.current=p,!p&&m&&d!==t&&u(t),[p?n:d,k.useCallback(function(y){for(var _=arguments.length,E=new Array(_>1?_-1:0),C=1;C<_;C++)E[C-1]=arguments[C];i&&i.apply(void 0,[y].concat(E)),u(y)},[i])]}function VQ(n,t){return Object.keys(t).reduce(function(i,s){var l,d=i,u=d[hhe(s)],p=d[s],m=BQ(d,[hhe(s),s].map(fke)),y=t[s],_=mke(p,u,n[y]),E=_[0],C=_[1];return Qd({},m,(l={},l[s]=E,l[y]=C,l))},n)}function V7(n,t){return V7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,s){return i.__proto__=s,i},V7(n,t)}function gke(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,V7(n,t)}function X1e(){var n=this.constructor.getDerivedStateFromProps(this.props,this.state);n!=null&&this.setState(n)}function J1e(n){function t(i){var s=this.constructor.getDerivedStateFromProps(n,i);return s??null}this.setState(t.bind(this))}function Q1e(n,t){try{var i=this.props,s=this.state;this.props=n,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(i,s)}finally{this.props=i,this.state=s}}X1e.__suppressDeprecationWarning=!0;J1e.__suppressDeprecationWarning=!0;Q1e.__suppressDeprecationWarning=!0;function gP(n){var t=n.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof n.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return n;var i=null,s=null,l=null;if(typeof t.componentWillMount=="function"?i="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(i="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?s="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(s="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?l="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(l="UNSAFE_componentWillUpdate"),i!==null||s!==null||l!==null){var d=n.displayName||n.name,u=typeof n.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
`+d+" uses "+u+" but also contains the following legacy lifecycles:"+(i!==null?`
`+i:"")+(s!==null?`
`+s:"")+(l!==null?`
`+l:"")+`
The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof n.getDerivedStateFromProps=="function"&&(t.componentWillMount=X1e,t.componentWillReceiveProps=J1e),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=Q1e;var p=t.componentDidUpdate;t.componentDidUpdate=function(y,_,E){var C=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:E;p.call(this,y,_,C)}}return n}const vke=["xxl","xl","lg","md","sm","xs"],yke="xs",VU=k.createContext({prefixes:{},breakpoints:vke,minBreakpoint:yke});function ii(n,t){const{prefixes:i}=k.useContext(VU);return n||i[t]||t}function Z1e(){const{breakpoints:n}=k.useContext(VU);return n}function eve(){const{minBreakpoint:n}=k.useContext(VU);return n}function _ke(){const{dir:n}=k.useContext(VU);return n==="rtl"}function zU(n){return n&&n.ownerDocument||document}function Eke(n){var t=zU(n);return t&&t.defaultView||window}function wke(n,t){return Eke(n).getComputedStyle(n,t)}var Ske=/([A-Z])/g;function bke(n){return n.replace(Ske,"-$1").toLowerCase()}var Cke=/^ms-/;function K8(n){return bke(n).replace(Cke,"-ms-")}var Tke=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function Rke(n){return!!(n&&Tke.test(n))}function Hg(n,t){var i="",s="";if(typeof t=="string")return n.style.getPropertyValue(K8(t))||wke(n).getPropertyValue(K8(t));Object.keys(t).forEach(function(l){var d=t[l];!d&&d!==0?n.style.removeProperty(K8(l)):Rke(l)?s+=l+"("+d+") ":i+=K8(l)+": "+d+";"}),s&&(i+="transform: "+s+";"),n.style.cssText+=";"+i}var tve={exports:{}},xke="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Ake=xke,Ike=Ake;function nve(){}function ive(){}ive.resetWarningCache=nve;var Nke=function(){function n(s,l,d,u,p,m){if(m!==Ike){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}n.isRequired=n;function t(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:t,element:n,elementType:n,instanceOf:t,node:n,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ive,resetWarningCache:nve};return i.PropTypes=i,i};tve.exports=Nke();var zQ=tve.exports;const Sl=ty(zQ),fhe={disabled:!1},rve=dn.createContext(null);var Oke=function(t){return t.scrollTop},e4="unmounted",E1="exited",ff="entering",kg="entered",fN="exiting",Jg=function(n){gke(t,n);function t(s,l){var d;d=n.call(this,s,l)||this;var u=l,p=u&&!u.isMounting?s.enter:s.appear,m;return d.appearStatus=null,s.in?p?(m=E1,d.appearStatus=ff):m=kg:s.unmountOnExit||s.mountOnEnter?m=e4:m=E1,d.state={status:m},d.nextCallback=null,d}t.getDerivedStateFromProps=function(l,d){var u=l.in;return u&&d.status===e4?{status:E1}:null};var i=t.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(l){var d=null;if(l!==this.props){var u=this.state.status;this.props.in?u!==ff&&u!==kg&&(d=ff):(u===ff||u===kg)&&(d=fN)}this.updateStatus(!1,d)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var l=this.props.timeout,d,u,p;return d=u=p=l,l!=null&&typeof l!="number"&&(d=l.exit,u=l.enter,p=l.appear!==void 0?l.appear:u),{exit:d,enter:u,appear:p}},i.updateStatus=function(l,d){if(l===void 0&&(l=!1),d!==null)if(this.cancelNextCallback(),d===ff){if(this.props.unmountOnExit||this.props.mountOnEnter){var u=this.props.nodeRef?this.props.nodeRef.current:OC.findDOMNode(this);u&&Oke(u)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===E1&&this.setState({status:e4})},i.performEnter=function(l){var d=this,u=this.props.enter,p=this.context?this.context.isMounting:l,m=this.props.nodeRef?[p]:[OC.findDOMNode(this),p],y=m[0],_=m[1],E=this.getTimeouts(),C=p?E.appear:E.enter;if(!l&&!u||fhe.disabled){this.safeSetState({status:kg},function(){d.props.onEntered(y)});return}this.props.onEnter(y,_),this.safeSetState({status:ff},function(){d.props.onEntering(y,_),d.onTransitionEnd(C,function(){d.safeSetState({status:kg},function(){d.props.onEntered(y,_)})})})},i.performExit=function(){var l=this,d=this.props.exit,u=this.getTimeouts(),p=this.props.nodeRef?void 0:OC.findDOMNode(this);if(!d||fhe.disabled){this.safeSetState({status:E1},function(){l.props.onExited(p)});return}this.props.onExit(p),this.safeSetState({status:fN},function(){l.props.onExiting(p),l.onTransitionEnd(u.exit,function(){l.safeSetState({status:E1},function(){l.props.onExited(p)})})})},i.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(l,d){d=this.setNextCallback(d),this.setState(l,d)},i.setNextCallback=function(l){var d=this,u=!0;return this.nextCallback=function(p){u&&(u=!1,d.nextCallback=null,l(p))},this.nextCallback.cancel=function(){u=!1},this.nextCallback},i.onTransitionEnd=function(l,d){this.setNextCallback(d);var u=this.props.nodeRef?this.props.nodeRef.current:OC.findDOMNode(this),p=l==null&&!this.props.addEndListener;if(!u||p){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var m=this.props.nodeRef?[this.nextCallback]:[u,this.nextCallback],y=m[0],_=m[1];this.props.addEndListener(y,_)}l!=null&&setTimeout(this.nextCallback,l)},i.render=function(){var l=this.state.status;if(l===e4)return null;var d=this.props,u=d.children;d.in,d.mountOnEnter,d.unmountOnExit,d.appear,d.enter,d.exit,d.timeout,d.addEndListener,d.onEnter,d.onEntering,d.onEntered,d.onExit,d.onExiting,d.onExited,d.nodeRef;var p=BQ(d,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return dn.createElement(rve.Provider,{value:null},typeof u=="function"?u(l,p):dn.cloneElement(dn.Children.only(u),p))},t}(dn.Component);Jg.contextType=rve;Jg.propTypes={};function qb(){}Jg.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:qb,onEntering:qb,onEntered:qb,onExit:qb,onExiting:qb,onExited:qb};Jg.UNMOUNTED=e4;Jg.EXITED=E1;Jg.ENTERING=ff;Jg.ENTERED=kg;Jg.EXITING=fN;const Pke=Jg;function Lke(n){return n.code==="Escape"||n.keyCode===27}function Dke(){const n=k.version.split(".");return{major:+n[0],minor:+n[1],patch:+n[2]}}function Ex(n){if(!n||typeof n=="function")return null;const{major:t}=Dke();return t>=19?n.props.ref:n.ref}const wx=!!(typeof window<"u"&&window.document&&window.document.createElement);var oY=!1,lY=!1;try{var lK={get passive(){return oY=!0},get once(){return lY=oY=!0}};wx&&(window.addEventListener("test",lK,lK),window.removeEventListener("test",lK,!0))}catch{}function sve(n,t,i,s){if(s&&typeof s!="boolean"&&!lY){var l=s.once,d=s.capture,u=i;!lY&&l&&(u=i.__once||function p(m){this.removeEventListener(t,p,d),i.call(this,m)},i.__once=u),n.addEventListener(t,u,oY?s:d)}n.addEventListener(t,i,s)}function cY(n,t,i,s){var l=s&&typeof s!="boolean"?s.capture:s;n.removeEventListener(t,i,l),i.__once&&n.removeEventListener(t,i.__once,l)}function z7(n,t,i,s){return sve(n,t,i,s),function(){cY(n,t,i,s)}}function kke(n,t,i,s){if(i===void 0&&(i=!1),s===void 0&&(s=!0),n){var l=document.createEvent("HTMLEvents");l.initEvent(t,i,s),n.dispatchEvent(l)}}function Mke(n){var t=Hg(n,"transitionDuration")||"",i=t.indexOf("ms")===-1?1e3:1;return parseFloat(t)*i}function jke(n,t,i){i===void 0&&(i=5);var s=!1,l=setTimeout(function(){s||kke(n,"transitionend",!0)},t+i),d=z7(n,"transitionend",function(){s=!0},{once:!0});return function(){clearTimeout(l),d()}}function ave(n,t,i,s){i==null&&(i=Mke(n)||0);var l=jke(n,i,s),d=z7(n,"transitionend",t);return function(){l(),d()}}function phe(n,t){const i=Hg(n,t)||"",s=i.indexOf("ms")===-1?1e3:1;return parseFloat(i)*s}function HQ(n,t){const i=phe(n,"transitionDuration"),s=phe(n,"transitionDelay"),l=ave(n,d=>{d.target===n&&(l(),t(d))},i+s)}function U3(...n){return n.filter(t=>t!=null).reduce((t,i)=>{if(typeof i!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return t===null?i:function(...l){t.apply(this,l),i.apply(this,l)}},null)}function ove(n){n.offsetHeight}const mhe=n=>!n||typeof n=="function"?n:t=>{n.current=t};function Uke(n,t){const i=mhe(n),s=mhe(t);return l=>{i&&i(l),s&&s(l)}}function lve(n,t){return k.useMemo(()=>Uke(n,t),[n,t])}function Fke(n){return n&&"setState"in n?OC.findDOMNode(n):n??null}const cve=dn.forwardRef(({onEnter:n,onEntering:t,onEntered:i,onExit:s,onExiting:l,onExited:d,addEndListener:u,children:p,childRef:m,...y},_)=>{const E=k.useRef(null),C=lve(E,m),x=$=>{C(Fke($))},N=$=>ne=>{$&&E.current&&$(E.current,ne)},O=k.useCallback(N(n),[n]),D=k.useCallback(N(t),[t]),P=k.useCallback(N(i),[i]),j=k.useCallback(N(s),[s]),M=k.useCallback(N(l),[l]),V=k.useCallback(N(d),[d]),G=k.useCallback(N(u),[u]);return h.jsx(Pke,{ref:_,...y,onEnter:O,onEntered:P,onEntering:D,onExit:j,onExited:V,onExiting:M,addEndListener:G,nodeRef:E,children:typeof p=="function"?($,ne)=>p($,{...ne,ref:x}):dn.cloneElement(p,{ref:x})})});cve.displayName="TransitionWrapper";const GQ=cve,Bke={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function Vke(n,t){const i=`offset${n[0].toUpperCase()}${n.slice(1)}`,s=t[i],l=Bke[n];return s+parseInt(Hg(t,l[0]),10)+parseInt(Hg(t,l[1]),10)}const zke={[E1]:"collapse",[fN]:"collapsing",[ff]:"collapsing",[kg]:"collapse show"},dve=dn.forwardRef(({onEnter:n,onEntering:t,onEntered:i,onExit:s,onExiting:l,className:d,children:u,dimension:p="height",in:m=!1,timeout:y=300,mountOnEnter:_=!1,unmountOnExit:E=!1,appear:C=!1,getDimensionValue:x=Vke,...N},O)=>{const D=typeof p=="function"?p():p,P=k.useMemo(()=>U3($=>{$.style[D]="0"},n),[D,n]),j=k.useMemo(()=>U3($=>{const ne=`scroll${D[0].toUpperCase()}${D.slice(1)}`;$.style[D]=`${$[ne]}px`},t),[D,t]),M=k.useMemo(()=>U3($=>{$.style[D]=null},i),[D,i]),V=k.useMemo(()=>U3($=>{$.style[D]=`${x(D,$)}px`,ove($)},s),[s,x,D]),G=k.useMemo(()=>U3($=>{$.style[D]=null},l),[D,l]);return h.jsx(GQ,{ref:O,addEndListener:HQ,...N,"aria-expanded":N.role?m:null,onEnter:P,onEntering:j,onEntered:M,onExit:V,onExiting:G,childRef:Ex(u),in:m,timeout:y,mountOnEnter:_,unmountOnExit:E,appear:C,children:($,ne)=>dn.cloneElement(u,{...ne,className:Fn(d,u.props.className,zke[$],D==="width"&&"collapse-horizontal")})})});dve.displayName="Collapse";const WQ=dve;function Hke(n){const t=k.useRef(n);return k.useEffect(()=>{t.current=n},[n]),t}function ex(n){const t=Hke(n);return k.useCallback(function(...i){return t.current&&t.current(...i)},[t])}const HU=n=>k.forwardRef((t,i)=>h.jsx("div",{...t,ref:i,className:Fn(t.className,n)}));function Gke(n){const t=k.useRef(n);return k.useEffect(()=>{t.current=n},[n]),t}function Mg(n){const t=Gke(n);return k.useCallback(function(...i){return t.current&&t.current(...i)},[t])}function Wke(){const n=k.useRef(!0),t=k.useRef(()=>n.current);return k.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),t.current}function $ke(n){const t=k.useRef(null);return k.useEffect(()=>{t.current=n}),t.current}const Kke=typeof Xo<"u"&&Xo.navigator&&Xo.navigator.product==="ReactNative",qke=typeof document<"u",ghe=qke||Kke?k.useLayoutEffect:k.useEffect,Yke=["as","disabled"];function Xke(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function Jke(n){return!n||n.trim()==="#"}function $Q({tagName:n,disabled:t,href:i,target:s,rel:l,role:d,onClick:u,tabIndex:p=0,type:m}){n||(i!=null||s!=null||l!=null?n="a":n="button");const y={tagName:n};if(n==="button")return[{type:m||"button",disabled:t},y];const _=C=>{if((t||n==="a"&&Jke(i))&&C.preventDefault(),t){C.stopPropagation();return}u==null||u(C)},E=C=>{C.key===" "&&(C.preventDefault(),_(C))};return n==="a"&&(i||(i="#"),t&&(i=void 0)),[{role:d??"button",disabled:void 0,tabIndex:t?void 0:p,href:i,target:n==="a"?s:void 0,"aria-disabled":t||void 0,rel:n==="a"?l:void 0,onClick:_,onKeyDown:E},y]}const uve=k.forwardRef((n,t)=>{let{as:i,disabled:s}=n,l=Xke(n,Yke);const[d,{tagName:u}]=$Q(Object.assign({tagName:i,disabled:s},l));return h.jsx(u,Object.assign({},l,d,{ref:t}))});uve.displayName="Button";const Qke=["onKeyDown"];function Zke(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function e8e(n){return!n||n.trim()==="#"}const hve=k.forwardRef((n,t)=>{let{onKeyDown:i}=n,s=Zke(n,Qke);const[l]=$Q(Object.assign({tagName:"a"},s)),d=Mg(u=>{l.onKeyDown(u),i==null||i(u)});return e8e(s.href)||s.role==="button"?h.jsx("a",Object.assign({ref:t},s,l,{onKeyDown:d})):h.jsx("a",Object.assign({ref:t},s,{onKeyDown:i}))});hve.displayName="Anchor";const t8e=hve,n8e={[ff]:"show",[kg]:"show"},fve=k.forwardRef(({className:n,children:t,transitionClasses:i={},onEnter:s,...l},d)=>{const u={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...l},p=k.useCallback((m,y)=>{ove(m),s==null||s(m,y)},[s]);return h.jsx(GQ,{ref:d,addEndListener:HQ,...u,onEnter:p,childRef:Ex(t),children:(m,y)=>k.cloneElement(t,{...y,className:Fn("fade",n,t.props.className,n8e[m],i[m])})})});fve.displayName="Fade";const vP=fve,i8e={"aria-label":Sl.string,onClick:Sl.func,variant:Sl.oneOf(["white"])},KQ=k.forwardRef(({className:n,variant:t,"aria-label":i="Close",...s},l)=>h.jsx("button",{ref:l,type:"button",className:Fn("btn-close",t&&`btn-close-${t}`,n),"aria-label":i,...s}));KQ.displayName="CloseButton";KQ.propTypes=i8e;const r8e=KQ,pve=k.forwardRef(({as:n,bsPrefix:t,variant:i="primary",size:s,active:l=!1,disabled:d=!1,className:u,...p},m)=>{const y=ii(t,"btn"),[_,{tagName:E}]=$Q({tagName:n,disabled:d,...p}),C=E;return h.jsx(C,{..._,...p,ref:m,disabled:d,className:Fn(u,y,l&&"active",i&&`${y}-${i}`,s&&`${y}-${s}`,p.href&&d&&"disabled")})});pve.displayName="Button";const Lt=pve,mve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"card-body"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));mve.displayName="CardBody";const gve=mve,vve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"card-footer"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));vve.displayName="CardFooter";const s8e=vve,yve=k.createContext(null);yve.displayName="CardHeaderContext";const _ve=yve,Eve=k.forwardRef(({bsPrefix:n,className:t,as:i="div",...s},l)=>{const d=ii(n,"card-header"),u=k.useMemo(()=>({cardHeaderBsPrefix:d}),[d]);return h.jsx(_ve.Provider,{value:u,children:h.jsx(i,{ref:l,...s,className:Fn(t,d)})})});Eve.displayName="CardHeader";const a8e=Eve,wve=k.forwardRef(({bsPrefix:n,className:t,variant:i,as:s="img",...l},d)=>{const u=ii(n,"card-img");return h.jsx(s,{ref:d,className:Fn(i?`${u}-${i}`:u,t),...l})});wve.displayName="CardImg";const o8e=wve,Sve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"card-img-overlay"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));Sve.displayName="CardImgOverlay";const l8e=Sve,bve=k.forwardRef(({className:n,bsPrefix:t,as:i="a",...s},l)=>(t=ii(t,"card-link"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));bve.displayName="CardLink";const c8e=bve,d8e=HU("h6"),Cve=k.forwardRef(({className:n,bsPrefix:t,as:i=d8e,...s},l)=>(t=ii(t,"card-subtitle"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));Cve.displayName="CardSubtitle";const u8e=Cve,Tve=k.forwardRef(({className:n,bsPrefix:t,as:i="p",...s},l)=>(t=ii(t,"card-text"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));Tve.displayName="CardText";const h8e=Tve,f8e=HU("h5"),Rve=k.forwardRef(({className:n,bsPrefix:t,as:i=f8e,...s},l)=>(t=ii(t,"card-title"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));Rve.displayName="CardTitle";const p8e=Rve,xve=k.forwardRef(({bsPrefix:n,className:t,bg:i,text:s,border:l,body:d=!1,children:u,as:p="div",...m},y)=>{const _=ii(n,"card");return h.jsx(p,{ref:y,...m,className:Fn(t,_,i&&`bg-${i}`,s&&`text-${s}`,l&&`border-${l}`),children:d?h.jsx(gve,{children:u}):u})});xve.displayName="Card";const et=Object.assign(xve,{Img:o8e,Title:p8e,Subtitle:u8e,Body:gve,Link:c8e,Text:h8e,Header:a8e,Footer:s8e,ImgOverlay:l8e});function m8e(n){const t=k.useRef(n);return t.current=n,t}function g8e(n){const t=m8e(n);k.useEffect(()=>()=>t.current(),[])}function dY(n,t){let i=0;return k.Children.map(n,s=>k.isValidElement(s)?t(s,i++):s)}function v8e(n,t){let i=0;k.Children.forEach(n,s=>{k.isValidElement(s)&&t(s,i++)})}function y8e(n,t){return k.Children.toArray(n).some(i=>k.isValidElement(i)&&i.type===t)}function Ave({as:n,bsPrefix:t,className:i,...s}){t=ii(t,"col");const l=Z1e(),d=eve(),u=[],p=[];return l.forEach(m=>{const y=s[m];delete s[m];let _,E,C;typeof y=="object"&&y!=null?{span:_,offset:E,order:C}=y:_=y;const x=m!==d?`-${m}`:"";_&&u.push(_===!0?`${t}${x}`:`${t}${x}-${_}`),C!=null&&p.push(`order${x}-${C}`),E!=null&&p.push(`offset${x}-${E}`)}),[{...s,className:Fn(i,...u,...p)},{as:n,bsPrefix:t,spans:u}]}const Ive=k.forwardRef((n,t)=>{const[{className:i,...s},{as:l="div",bsPrefix:d,spans:u}]=Ave(n);return h.jsx(l,{...s,ref:t,className:Fn(i,!u.length&&d)})});Ive.displayName="Col";const Gt=Ive,Nve=k.forwardRef(({bsPrefix:n,fluid:t=!1,as:i="div",className:s,...l},d)=>{const u=ii(n,"container"),p=typeof t=="string"?`-${t}`:"-fluid";return h.jsx(i,{ref:d,...l,className:Fn(s,t?`${u}${p}`:u)})});Nve.displayName="Container";const Yn=Nve;var _8e=Function.prototype.bind.call(Function.prototype.call,[].slice);function j_(n,t){return _8e(n.querySelectorAll(t))}function E8e(n,t,i){const s=k.useRef(n!==void 0),[l,d]=k.useState(t),u=n!==void 0,p=s.current;return s.current=u,!u&&p&&l!==t&&d(t),[u?n:l,k.useCallback((...m)=>{const[y,..._]=m;let E=i==null?void 0:i(y,..._);return d(y),E},[i])]}function w8e(){const[,n]=k.useReducer(t=>t+1,0);return n}function vhe(n,t){if(n.contains)return n.contains(t);if(n.compareDocumentPosition)return n===t||!!(n.compareDocumentPosition(t)&16)}const H7={prefix:String(Math.round(Math.random()*1e10)),current:0},Ove=dn.createContext(H7),S8e=dn.createContext(!1);let b8e=!!(typeof window<"u"&&window.document&&window.document.createElement),cK=new WeakMap;function C8e(n=!1){let t=k.useContext(Ove),i=k.useRef(null);if(i.current===null&&!n){var s,l;let d=(l=dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||l===void 0||(s=l.ReactCurrentOwner)===null||s===void 0?void 0:s.current;if(d){let u=cK.get(d);u==null?cK.set(d,{id:t.current,state:d.memoizedState}):d.memoizedState!==u.state&&(t.current=u.id,cK.delete(d))}i.current=++t.current}return i.current}function T8e(n){let t=k.useContext(Ove),i=C8e(!!n),s=`react-aria${t.prefix}`;return n||`${s}-${i}`}function R8e(n){let t=dn.useId(),[i]=k.useState(O8e()),s=i?"react-aria":`react-aria${H7.prefix}`;return n||`${s}-${t}`}const x8e=typeof dn.useId=="function"?R8e:T8e;function A8e(){return!1}function I8e(){return!0}function N8e(n){return()=>{}}function O8e(){return typeof dn.useSyncExternalStore=="function"?dn.useSyncExternalStore(N8e,A8e,I8e):k.useContext(S8e)}const P8e=k.createContext(null),pN=(n,t=null)=>n!=null?String(n):t||null,W2=P8e,Pve=k.createContext(null);Pve.displayName="NavContext";const Lve=Pve,L8e="data-rr-ui-",D8e="rrUi";function GU(n){return`${L8e}${n}`}function k8e(n){return`${D8e}${n}`}const Dve=k.createContext(wx?window:void 0);Dve.Provider;function qQ(){return k.useContext(Dve)}const M8e=typeof Xo<"u"&&Xo.navigator&&Xo.navigator.product==="ReactNative",j8e=typeof document<"u",U8e=j8e||M8e?k.useLayoutEffect:k.useEffect,kve=k.createContext(null);kve.displayName="NavbarContext";const yP=kve,F8e={type:Sl.string,tooltip:Sl.bool,as:Sl.elementType},YQ=k.forwardRef(({as:n="div",className:t,type:i="valid",tooltip:s=!1,...l},d)=>h.jsx(n,{...l,ref:d,className:Fn(t,`${i}-${s?"tooltip":"feedback"}`)}));YQ.displayName="Feedback";YQ.propTypes=F8e;const Mve=YQ,B8e=k.createContext({}),qg=B8e,jve=k.forwardRef(({id:n,bsPrefix:t,className:i,type:s="checkbox",isValid:l=!1,isInvalid:d=!1,as:u="input",...p},m)=>{const{controlId:y}=k.useContext(qg);return t=ii(t,"form-check-input"),h.jsx(u,{...p,ref:m,type:s,id:n||y,className:Fn(i,t,l&&"is-valid",d&&"is-invalid")})});jve.displayName="FormCheckInput";const Uve=jve,Fve=k.forwardRef(({bsPrefix:n,className:t,htmlFor:i,...s},l)=>{const{controlId:d}=k.useContext(qg);return n=ii(n,"form-check-label"),h.jsx("label",{...s,ref:l,htmlFor:i||d,className:Fn(t,n)})});Fve.displayName="FormCheckLabel";const uY=Fve,Bve=k.forwardRef(({id:n,bsPrefix:t,bsSwitchPrefix:i,inline:s=!1,reverse:l=!1,disabled:d=!1,isValid:u=!1,isInvalid:p=!1,feedbackTooltip:m=!1,feedback:y,feedbackType:_,className:E,style:C,title:x="",type:N="checkbox",label:O,children:D,as:P="input",...j},M)=>{t=ii(t,"form-check"),i=ii(i,"form-switch");const{controlId:V}=k.useContext(qg),G=k.useMemo(()=>({controlId:n||V}),[V,n]),$=!D&&O!=null&&O!==!1||y8e(D,uY),ne=h.jsx(Uve,{...j,type:N==="switch"?"checkbox":N,ref:M,isValid:u,isInvalid:p,disabled:d,as:P});return h.jsx(qg.Provider,{value:G,children:h.jsx("div",{style:C,className:Fn(E,$&&t,s&&`${t}-inline`,l&&`${t}-reverse`,N==="switch"&&i),children:D||h.jsxs(h.Fragment,{children:[ne,$&&h.jsx(uY,{title:x,children:O}),y&&h.jsx(Mve,{type:_,tooltip:m,children:y})]})})})});Bve.displayName="FormCheck";const G7=Object.assign(Bve,{Input:Uve,Label:uY}),Vve=k.forwardRef(({bsPrefix:n,type:t,size:i,htmlSize:s,id:l,className:d,isValid:u=!1,isInvalid:p=!1,plaintext:m,readOnly:y,as:_="input",...E},C)=>{const{controlId:x}=k.useContext(qg);return n=ii(n,"form-control"),h.jsx(_,{...E,type:t,size:s,ref:C,readOnly:y,id:l||x,className:Fn(d,m?`${n}-plaintext`:n,i&&`${n}-${i}`,t==="color"&&`${n}-color`,u&&"is-valid",p&&"is-invalid")})});Vve.displayName="FormControl";const V8e=Object.assign(Vve,{Feedback:Mve}),zve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"form-floating"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));zve.displayName="FormFloating";const z8e=zve,Hve=k.forwardRef(({controlId:n,as:t="div",...i},s)=>{const l=k.useMemo(()=>({controlId:n}),[n]);return h.jsx(qg.Provider,{value:l,children:h.jsx(t,{...i,ref:s})})});Hve.displayName="FormGroup";const Gve=Hve,Wve=k.forwardRef(({as:n="label",bsPrefix:t,column:i=!1,visuallyHidden:s=!1,className:l,htmlFor:d,...u},p)=>{const{controlId:m}=k.useContext(qg);t=ii(t,"form-label");let y="col-form-label";typeof i=="string"&&(y=`${y} ${y}-${i}`);const _=Fn(l,t,s&&"visually-hidden",i&&y);return d=d||m,i?h.jsx(Gt,{ref:p,as:"label",className:_,htmlFor:d,...u}):h.jsx(n,{ref:p,className:_,htmlFor:d,...u})});Wve.displayName="FormLabel";const H8e=Wve,$ve=k.forwardRef(({bsPrefix:n,className:t,id:i,...s},l)=>{const{controlId:d}=k.useContext(qg);return n=ii(n,"form-range"),h.jsx("input",{...s,type:"range",ref:l,className:Fn(t,n),id:i||d})});$ve.displayName="FormRange";const G8e=$ve,Kve=k.forwardRef(({bsPrefix:n,size:t,htmlSize:i,className:s,isValid:l=!1,isInvalid:d=!1,id:u,...p},m)=>{const{controlId:y}=k.useContext(qg);return n=ii(n,"form-select"),h.jsx("select",{...p,size:i,ref:m,className:Fn(s,n,t&&`${n}-${t}`,l&&"is-valid",d&&"is-invalid"),id:u||y})});Kve.displayName="FormSelect";const W8e=Kve,qve=k.forwardRef(({bsPrefix:n,className:t,as:i="small",muted:s,...l},d)=>(n=ii(n,"form-text"),h.jsx(i,{...l,ref:d,className:Fn(t,n,s&&"text-muted")})));qve.displayName="FormText";const $8e=qve,Yve=k.forwardRef((n,t)=>h.jsx(G7,{...n,ref:t,type:"switch"}));Yve.displayName="Switch";const K8e=Object.assign(Yve,{Input:G7.Input,Label:G7.Label}),Xve=k.forwardRef(({bsPrefix:n,className:t,children:i,controlId:s,label:l,...d},u)=>(n=ii(n,"form-floating"),h.jsxs(Gve,{ref:u,className:Fn(t,n),controlId:s,...d,children:[i,h.jsx("label",{htmlFor:s,children:l})]})));Xve.displayName="FloatingLabel";const q8e=Xve,Y8e={_ref:Sl.any,validated:Sl.bool,as:Sl.elementType},XQ=k.forwardRef(({className:n,validated:t,as:i="form",...s},l)=>h.jsx(i,{...s,ref:l,className:Fn(n,t&&"was-validated")}));XQ.displayName="Form";XQ.propTypes=Y8e;const kt=Object.assign(XQ,{Group:Gve,Control:V8e,Floating:z8e,Check:G7,Switch:K8e,Label:H8e,Text:$8e,Range:G8e,Select:W8e,FloatingLabel:q8e}),yhe=n=>!n||typeof n=="function"?n:t=>{n.current=t};function X8e(n,t){const i=yhe(n),s=yhe(t);return l=>{i&&i(l),s&&s(l)}}function WU(n,t){return k.useMemo(()=>X8e(n,t),[n,t])}const J8e=k.createContext(null),Sx=J8e,Q8e=["as","active","eventKey"];function Z8e(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function Jve({key:n,onClick:t,active:i,id:s,role:l,disabled:d}){const u=k.useContext(W2),p=k.useContext(Lve),m=k.useContext(Sx);let y=i;const _={role:l};if(p){!l&&p.role==="tablist"&&(_.role="tab");const E=p.getControllerId(n??null),C=p.getControlledId(n??null);_[GU("event-key")]=n,_.id=E||s,y=i==null&&n!=null?p.activeKey===n:i,(y||!(m!=null&&m.unmountOnExit)&&!(m!=null&&m.mountOnEnter))&&(_["aria-controls"]=C)}return _.role==="tab"&&(_["aria-selected"]=y,y||(_.tabIndex=-1),d&&(_.tabIndex=-1,_["aria-disabled"]=!0)),_.onClick=Mg(E=>{d||(t==null||t(E),n!=null&&u&&!E.isPropagationStopped()&&u(n,E))}),[_,{isActive:y}]}const Qve=k.forwardRef((n,t)=>{let{as:i=uve,active:s,eventKey:l}=n,d=Z8e(n,Q8e);const[u,p]=Jve(Object.assign({key:pN(l,d.href),active:s},d));return u[GU("active")]=p.isActive,h.jsx(i,Object.assign({},d,u,{ref:t}))});Qve.displayName="NavItem";const eMe=Qve,tMe=["as","onSelect","activeKey","role","onKeyDown"];function nMe(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}const _he=()=>{},Ehe=GU("event-key"),Zve=k.forwardRef((n,t)=>{let{as:i="div",onSelect:s,activeKey:l,role:d,onKeyDown:u}=n,p=nMe(n,tMe);const m=w8e(),y=k.useRef(!1),_=k.useContext(W2),E=k.useContext(Sx);let C,x;E&&(d=d||"tablist",l=E.activeKey,C=E.getControlledId,x=E.getControllerId);const N=k.useRef(null),O=M=>{const V=N.current;if(!V)return null;const G=j_(V,`[${Ehe}]:not([aria-disabled=true])`),$=V.querySelector("[aria-selected=true]");if(!$||$!==document.activeElement)return null;const ne=G.indexOf($);if(ne===-1)return null;let Y=ne+M;return Y>=G.length&&(Y=0),Y<0&&(Y=G.length-1),G[Y]},D=(M,V)=>{M!=null&&(s==null||s(M,V),_==null||_(M,V))},P=M=>{if(u==null||u(M),!E)return;let V;switch(M.key){case"ArrowLeft":case"ArrowUp":V=O(-1);break;case"ArrowRight":case"ArrowDown":V=O(1);break;default:return}V&&(M.preventDefault(),D(V.dataset[k8e("EventKey")]||null,M),y.current=!0,m())};k.useEffect(()=>{if(N.current&&y.current){const M=N.current.querySelector(`[${Ehe}][aria-selected=true]`);M==null||M.focus()}y.current=!1});const j=WU(t,N);return h.jsx(W2.Provider,{value:D,children:h.jsx(Lve.Provider,{value:{role:d,activeKey:pN(l),getControlledId:C||_he,getControllerId:x||_he},children:h.jsx(i,Object.assign({},p,{onKeyDown:P,ref:j,role:d}))})})});Zve.displayName="Nav";const iMe=Object.assign(Zve,{Item:eMe});var q8;function mN(n){if((!q8&&q8!==0||n)&&wx){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),q8=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return q8}function rMe(){return k.useState(null)}function dK(n){n===void 0&&(n=zU());try{var t=n.activeElement;return!t||!t.nodeName?null:t}catch{return n.body}}function sMe(n){const t=k.useRef(n);return t.current=n,t}function aMe(n){const t=sMe(n);k.useEffect(()=>()=>t.current(),[])}function oMe(n=document){const t=n.defaultView;return Math.abs(t.innerWidth-n.documentElement.clientWidth)}const whe=GU("modal-open");class lMe{constructor({ownerDocument:t,handleContainerOverflow:i=!0,isRTL:s=!1}={}){this.handleContainerOverflow=i,this.isRTL=s,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return oMe(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const i={overflow:"hidden"},s=this.isRTL?"paddingLeft":"paddingRight",l=this.getElement();t.style={overflow:l.style.overflow,[s]:l.style[s]},t.scrollBarWidth&&(i[s]=`${parseInt(Hg(l,s)||"0",10)+t.scrollBarWidth}px`),l.setAttribute(whe,""),Hg(l,i)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const i=this.getElement();i.removeAttribute(whe),Object.assign(i.style,t.style)}add(t){let i=this.modals.indexOf(t);return i!==-1||(i=this.modals.length,this.modals.push(t),this.setModalAttributes(t),i!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),i}remove(t){const i=this.modals.indexOf(t);i!==-1&&(this.modals.splice(i,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const JQ=lMe,uK=(n,t)=>wx?n==null?(t||zU()).body:(typeof n=="function"&&(n=n()),n&&"current"in n&&(n=n.current),n&&("nodeType"in n||n.getBoundingClientRect)?n:null):null;function cMe(n,t){const i=qQ(),[s,l]=k.useState(()=>uK(n,i==null?void 0:i.document));if(!s){const d=uK(n);d&&l(d)}return k.useEffect(()=>{t&&s&&t(s)},[t,s]),k.useEffect(()=>{const d=uK(n);d!==s&&l(d)},[n,s]),s}function QQ({children:n,in:t,onExited:i,mountOnEnter:s,unmountOnExit:l}){const d=k.useRef(null),u=k.useRef(t),p=Mg(i);k.useEffect(()=>{t?u.current=!0:p(d.current)},[t,p]);const m=WU(d,Ex(n)),y=k.cloneElement(n,{ref:m});return t?y:l||!u.current&&s?null:y}const dMe=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];function uMe(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function hMe(n){let{onEnter:t,onEntering:i,onEntered:s,onExit:l,onExiting:d,onExited:u,addEndListener:p,children:m}=n,y=uMe(n,dMe);const _=k.useRef(null),E=WU(_,Ex(m)),C=V=>G=>{V&&_.current&&V(_.current,G)},x=k.useCallback(C(t),[t]),N=k.useCallback(C(i),[i]),O=k.useCallback(C(s),[s]),D=k.useCallback(C(l),[l]),P=k.useCallback(C(d),[d]),j=k.useCallback(C(u),[u]),M=k.useCallback(C(p),[p]);return Object.assign({},y,{nodeRef:_},t&&{onEnter:x},i&&{onEntering:N},s&&{onEntered:O},l&&{onExit:D},d&&{onExiting:P},u&&{onExited:j},p&&{addEndListener:M},{children:typeof m=="function"?(V,G)=>m(V,Object.assign({},G,{ref:E})):k.cloneElement(m,{ref:E})})}const fMe=["component"];function pMe(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}const mMe=k.forwardRef((n,t)=>{let{component:i}=n,s=pMe(n,fMe);const l=hMe(s);return h.jsx(i,Object.assign({ref:t},l))}),gMe=mMe;function vMe({in:n,onTransition:t}){const i=k.useRef(null),s=k.useRef(!0),l=Mg(t);return ghe(()=>{if(!i.current)return;let d=!1;return l({in:n,element:i.current,initial:s.current,isStale:()=>d}),()=>{d=!0}},[n,l]),ghe(()=>(s.current=!1,()=>{s.current=!0}),[]),i}function yMe({children:n,in:t,onExited:i,onEntered:s,transition:l}){const[d,u]=k.useState(!t);t&&d&&u(!1);const p=vMe({in:!!t,onTransition:y=>{const _=()=>{y.isStale()||(y.in?s==null||s(y.element,y.initial):(u(!0),i==null||i(y.element)))};Promise.resolve(l(y)).then(_,E=>{throw y.in||u(!0),E})}}),m=WU(p,Ex(n));return d&&!t?null:k.cloneElement(n,{ref:m})}function She(n,t,i){return n?h.jsx(gMe,Object.assign({},i,{component:n})):t?h.jsx(yMe,Object.assign({},i,{transition:t})):h.jsx(QQ,Object.assign({},i))}const _Me=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function EMe(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}let hK;function wMe(n){return hK||(hK=new JQ({ownerDocument:n==null?void 0:n.document})),hK}function SMe(n){const t=qQ(),i=n||wMe(t),s=k.useRef({dialog:null,backdrop:null});return Object.assign(s.current,{add:()=>i.add(s.current),remove:()=>i.remove(s.current),isTopModal:()=>i.isTopModal(s.current),setDialogRef:k.useCallback(l=>{s.current.dialog=l},[]),setBackdropRef:k.useCallback(l=>{s.current.backdrop=l},[])})}const eye=k.forwardRef((n,t)=>{let{show:i=!1,role:s="dialog",className:l,style:d,children:u,backdrop:p=!0,keyboard:m=!0,onBackdropClick:y,onEscapeKeyDown:_,transition:E,runTransition:C,backdropTransition:x,runBackdropTransition:N,autoFocus:O=!0,enforceFocus:D=!0,restoreFocus:P=!0,restoreFocusOptions:j,renderDialog:M,renderBackdrop:V=Ht=>h.jsx("div",Object.assign({},Ht)),manager:G,container:$,onShow:ne,onHide:Y=()=>{},onExit:le,onExited:re,onExiting:ee,onEnter:de,onEntering:H,onEntered:ae}=n,_e=EMe(n,_Me);const me=qQ(),Ce=cMe($),he=SMe(G),pe=Wke(),Oe=$ke(i),[Fe,Ue]=k.useState(!i),Ve=k.useRef(null);k.useImperativeHandle(t,()=>he,[he]),wx&&!Oe&&i&&(Ve.current=dK(me==null?void 0:me.document)),i&&Fe&&Ue(!1);const Re=Mg(()=>{if(he.add(),pt.current=z7(document,"keydown",We),st.current=z7(document,"focus",()=>setTimeout(Xe),!0),ne&&ne(),O){var Ht,gn;const It=dK((Ht=(gn=he.dialog)==null?void 0:gn.ownerDocument)!=null?Ht:me==null?void 0:me.document);he.dialog&&It&&!vhe(he.dialog,It)&&(Ve.current=It,he.dialog.focus())}}),Be=Mg(()=>{if(he.remove(),pt.current==null||pt.current(),st.current==null||st.current(),P){var Ht;(Ht=Ve.current)==null||Ht.focus==null||Ht.focus(j),Ve.current=null}});k.useEffect(()=>{!i||!Ce||Re()},[i,Ce,Re]),k.useEffect(()=>{Fe&&Be()},[Fe,Be]),aMe(()=>{Be()});const Xe=Mg(()=>{if(!D||!pe()||!he.isTopModal())return;const Ht=dK(me==null?void 0:me.document);he.dialog&&Ht&&!vhe(he.dialog,Ht)&&he.dialog.focus()}),we=Mg(Ht=>{Ht.target===Ht.currentTarget&&(y==null||y(Ht),p===!0&&Y())}),We=Mg(Ht=>{m&&Lke(Ht)&&he.isTopModal()&&(_==null||_(Ht),Ht.defaultPrevented||Y())}),st=k.useRef(),pt=k.useRef(),Qe=(...Ht)=>{Ue(!0),re==null||re(...Ht)};if(!Ce)return null;const Je=Object.assign({role:s,ref:he.setDialogRef,"aria-modal":s==="dialog"?!0:void 0},_e,{style:d,className:l,tabIndex:-1});let St=M?M(Je):h.jsx("div",Object.assign({},Je,{children:k.cloneElement(u,{role:"document"})}));St=She(E,C,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!i,onExit:le,onExiting:ee,onExited:Qe,onEnter:de,onEntering:H,onEntered:ae,children:St});let Xt=null;return p&&(Xt=V({ref:he.setBackdropRef,onClick:we}),Xt=She(x,N,{in:!!i,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Xt})),h.jsx(h.Fragment,{children:OC.createPortal(h.jsxs(h.Fragment,{children:[Xt,St]}),Ce)})});eye.displayName="Modal";const tye=Object.assign(eye,{Manager:JQ});function bMe(n,t){return n.classList?!!t&&n.classList.contains(t):(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+t+" ")!==-1}function CMe(n,t){n.classList?n.classList.add(t):bMe(n,t)||(typeof n.className=="string"?n.className=n.className+" "+t:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+t))}function bhe(n,t){return n.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function TMe(n,t){n.classList?n.classList.remove(t):typeof n.className=="string"?n.className=bhe(n.className,t):n.setAttribute("class",bhe(n.className&&n.className.baseVal||"",t))}const Yb={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class nye extends JQ{adjustAndStore(t,i,s){const l=i.style[t];i.dataset[t]=l,Hg(i,{[t]:`${parseFloat(Hg(i,t))+s}px`})}restore(t,i){const s=i.dataset[t];s!==void 0&&(delete i.dataset[t],Hg(i,{[t]:s}))}setContainerStyle(t){super.setContainerStyle(t);const i=this.getElement();if(CMe(i,"modal-open"),!t.scrollBarWidth)return;const s=this.isRTL?"paddingLeft":"paddingRight",l=this.isRTL?"marginLeft":"marginRight";j_(i,Yb.FIXED_CONTENT).forEach(d=>this.adjustAndStore(s,d,t.scrollBarWidth)),j_(i,Yb.STICKY_CONTENT).forEach(d=>this.adjustAndStore(l,d,-t.scrollBarWidth)),j_(i,Yb.NAVBAR_TOGGLER).forEach(d=>this.adjustAndStore(l,d,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const i=this.getElement();TMe(i,"modal-open");const s=this.isRTL?"paddingLeft":"paddingRight",l=this.isRTL?"marginLeft":"marginRight";j_(i,Yb.FIXED_CONTENT).forEach(d=>this.restore(s,d)),j_(i,Yb.STICKY_CONTENT).forEach(d=>this.restore(l,d)),j_(i,Yb.NAVBAR_TOGGLER).forEach(d=>this.restore(l,d))}}let fK;function iye(n){return fK||(fK=new nye(n)),fK}const rye=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"modal-body"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));rye.displayName="ModalBody";const RMe=rye,xMe=k.createContext({onHide(){}}),ZQ=xMe,sye=k.forwardRef(({bsPrefix:n,className:t,contentClassName:i,centered:s,size:l,fullscreen:d,children:u,scrollable:p,...m},y)=>{n=ii(n,"modal");const _=`${n}-dialog`,E=typeof d=="string"?`${n}-fullscreen-${d}`:`${n}-fullscreen`;return h.jsx("div",{...m,ref:y,className:Fn(_,t,l&&`${n}-${l}`,s&&`${_}-centered`,p&&`${_}-scrollable`,d&&E),children:h.jsx("div",{className:Fn(`${n}-content`,i),children:u})})});sye.displayName="ModalDialog";const aye=sye,oye=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"modal-footer"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));oye.displayName="ModalFooter";const AMe=oye,lye=k.forwardRef(({closeLabel:n="Close",closeVariant:t,closeButton:i=!1,onHide:s,children:l,...d},u)=>{const p=k.useContext(ZQ),m=ex(()=>{p==null||p.onHide(),s==null||s()});return h.jsxs("div",{ref:u,...d,children:[l,i&&h.jsx(r8e,{"aria-label":n,variant:t,onClick:m})]})});lye.displayName="AbstractModalHeader";const cye=lye,dye=k.forwardRef(({bsPrefix:n,className:t,closeLabel:i="Close",closeButton:s=!1,...l},d)=>(n=ii(n,"modal-header"),h.jsx(cye,{ref:d,...l,className:Fn(t,n),closeLabel:i,closeButton:s})));dye.displayName="ModalHeader";const IMe=dye,NMe=HU("h4"),uye=k.forwardRef(({className:n,bsPrefix:t,as:i=NMe,...s},l)=>(t=ii(t,"modal-title"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));uye.displayName="ModalTitle";const OMe=uye;function PMe(n){return h.jsx(vP,{...n,timeout:null})}function LMe(n){return h.jsx(vP,{...n,timeout:null})}const hye=k.forwardRef(({bsPrefix:n,className:t,style:i,dialogClassName:s,contentClassName:l,children:d,dialogAs:u=aye,"data-bs-theme":p,"aria-labelledby":m,"aria-describedby":y,"aria-label":_,show:E=!1,animation:C=!0,backdrop:x=!0,keyboard:N=!0,onEscapeKeyDown:O,onShow:D,onHide:P,container:j,autoFocus:M=!0,enforceFocus:V=!0,restoreFocus:G=!0,restoreFocusOptions:$,onEntered:ne,onExit:Y,onExiting:le,onEnter:re,onEntering:ee,onExited:de,backdropClassName:H,manager:ae,..._e},me)=>{const[Ce,he]=k.useState({}),[pe,Oe]=k.useState(!1),Fe=k.useRef(!1),Ue=k.useRef(!1),Ve=k.useRef(null),[Re,Be]=rMe(),Xe=lve(me,Be),we=ex(P),We=_ke();n=ii(n,"modal");const st=k.useMemo(()=>({onHide:we}),[we]);function pt(){return ae||iye({isRTL:We})}function Qe(Pt){if(!wx)return;const en=pt().getScrollbarWidth()>0,un=Pt.scrollHeight>zU(Pt).documentElement.clientHeight;he({paddingRight:en&&!un?mN():void 0,paddingLeft:!en&&un?mN():void 0})}const Je=ex(()=>{Re&&Qe(Re.dialog)});g8e(()=>{cY(window,"resize",Je),Ve.current==null||Ve.current()});const St=()=>{Fe.current=!0},Xt=Pt=>{Fe.current&&Re&&Pt.target===Re.dialog&&(Ue.current=!0),Fe.current=!1},Ht=()=>{Oe(!0),Ve.current=ave(Re.dialog,()=>{Oe(!1)})},gn=Pt=>{Pt.target===Pt.currentTarget&&Ht()},It=Pt=>{if(x==="static"){gn(Pt);return}if(Ue.current||Pt.target!==Pt.currentTarget){Ue.current=!1;return}P==null||P()},xt=Pt=>{N?O==null||O(Pt):(Pt.preventDefault(),x==="static"&&Ht())},mt=(Pt,en)=>{Pt&&Qe(Pt),re==null||re(Pt,en)},dt=Pt=>{Ve.current==null||Ve.current(),Y==null||Y(Pt)},it=(Pt,en)=>{ee==null||ee(Pt,en),sve(window,"resize",Je)},Me=Pt=>{Pt&&(Pt.style.display=""),de==null||de(Pt),cY(window,"resize",Je)},Ge=k.useCallback(Pt=>h.jsx("div",{...Pt,className:Fn(`${n}-backdrop`,H,!C&&"show")}),[C,H,n]),bt={...i,...Ce};bt.display="block";const wt=Pt=>h.jsx("div",{role:"dialog",...Pt,style:bt,className:Fn(t,n,pe&&`${n}-static`,!C&&"show"),onClick:x?It:void 0,onMouseUp:Xt,"data-bs-theme":p,"aria-label":_,"aria-labelledby":m,"aria-describedby":y,children:h.jsx(u,{..._e,onMouseDown:St,className:s,contentClassName:l,children:d})});return h.jsx(ZQ.Provider,{value:st,children:h.jsx(tye,{show:E,ref:Xe,backdrop:x,container:j,keyboard:!0,autoFocus:M,enforceFocus:V,restoreFocus:G,restoreFocusOptions:$,onEscapeKeyDown:xt,onShow:D,onHide:P,onEnter:mt,onEntering:it,onEntered:ne,onExit:dt,onExiting:le,onExited:Me,manager:pt(),transition:C?PMe:void 0,backdropTransition:C?LMe:void 0,renderBackdrop:Ge,renderDialog:wt})})});hye.displayName="Modal";const wn=Object.assign(hye,{Body:RMe,Header:IMe,Title:OMe,Footer:AMe,Dialog:aye,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),fye=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"nav-item"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));fye.displayName="NavItem";const pye=fye,mye=k.forwardRef(({bsPrefix:n,className:t,as:i=t8e,active:s,eventKey:l,disabled:d=!1,...u},p)=>{n=ii(n,"nav-link");const[m,y]=Jve({key:pN(l,u.href),active:s,disabled:d,...u});return h.jsx(i,{...u,...m,ref:p,disabled:d,className:Fn(t,n,d&&"disabled",y.isActive&&"active")})});mye.displayName="NavLink";const gye=mye,vye=k.forwardRef((n,t)=>{const{as:i="div",bsPrefix:s,variant:l,fill:d=!1,justify:u=!1,navbar:p,navbarScroll:m,className:y,activeKey:_,...E}=VQ(n,{activeKey:"onSelect"}),C=ii(s,"nav");let x,N,O=!1;const D=k.useContext(yP),P=k.useContext(_ve);return D?(x=D.bsPrefix,O=p??!0):P&&({cardHeaderBsPrefix:N}=P),h.jsx(iMe,{as:i,ref:t,activeKey:_,className:Fn(y,{[C]:!O,[`${x}-nav`]:O,[`${x}-nav-scroll`]:O&&m,[`${N}-${l}`]:!!N,[`${C}-${l}`]:!!l,[`${C}-fill`]:d,[`${C}-justified`]:u}),...E})});vye.displayName="Nav";const Un=Object.assign(vye,{Item:pye,Link:gye}),yye=k.forwardRef(({bsPrefix:n,className:t,as:i,...s},l)=>{n=ii(n,"navbar-brand");const d=i||(s.href?"a":"span");return h.jsx(d,{...s,ref:l,className:Fn(t,n)})});yye.displayName="NavbarBrand";const DMe=yye,_ye=k.forwardRef(({children:n,bsPrefix:t,...i},s)=>{t=ii(t,"navbar-collapse");const l=k.useContext(yP);return h.jsx(WQ,{in:!!(l&&l.expanded),...i,children:h.jsx("div",{ref:s,className:t,children:n})})});_ye.displayName="NavbarCollapse";const kMe=_ye,Eye=k.forwardRef(({bsPrefix:n,className:t,children:i,label:s="Toggle navigation",as:l="button",onClick:d,...u},p)=>{n=ii(n,"navbar-toggler");const{onToggle:m,expanded:y}=k.useContext(yP)||{},_=ex(E=>{d&&d(E),m&&m()});return l==="button"&&(u.type="button"),h.jsx(l,{...u,ref:p,onClick:_,"aria-label":s,className:Fn(t,n,!y&&"collapsed"),children:i||h.jsx("span",{className:`${n}-icon`})})});Eye.displayName="NavbarToggle";const MMe=Eye,hY=new WeakMap,Che=(n,t)=>{if(!n||!t)return;const i=hY.get(t)||new Map;hY.set(t,i);let s=i.get(n);return s||(s=t.matchMedia(n),s.refCount=0,i.set(s.media,s)),s};function jMe(n,t=typeof window>"u"?void 0:window){const i=Che(n,t),[s,l]=k.useState(()=>i?i.matches:!1);return U8e(()=>{let d=Che(n,t);if(!d)return l(!1);let u=hY.get(t);const p=()=>{l(d.matches)};return d.refCount++,d.addListener(p),p(),()=>{d.removeListener(p),d.refCount--,d.refCount<=0&&(u==null||u.delete(d.media)),d=void 0}},[n]),s}function UMe(n){const t=Object.keys(n);function i(p,m){return p===m?m:p?`${p} and ${m}`:m}function s(p){return t[Math.min(t.indexOf(p)+1,t.length-1)]}function l(p){const m=s(p);let y=n[m];return typeof y=="number"?y=`${y-.2}px`:y=`calc(${y} - 0.2px)`,`(max-width: ${y})`}function d(p){let m=n[p];return typeof m=="number"&&(m=`${m}px`),`(min-width: ${m})`}function u(p,m,y){let _;typeof p=="object"?(_=p,y=m,m=!0):(m=m||!0,_={[p]:m});let E=k.useMemo(()=>Object.entries(_).reduce((C,[x,N])=>((N==="up"||N===!0)&&(C=i(C,d(x))),(N==="down"||N===!0)&&(C=i(C,l(x))),C),""),[JSON.stringify(_)]);return jMe(E,y)}return u}const FMe=UMe({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),wye=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"offcanvas-body"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));wye.displayName="OffcanvasBody";const BMe=wye,VMe={[ff]:"show",[kg]:"show"},Sye=k.forwardRef(({bsPrefix:n,className:t,children:i,in:s=!1,mountOnEnter:l=!1,unmountOnExit:d=!1,appear:u=!1,...p},m)=>(n=ii(n,"offcanvas"),h.jsx(GQ,{ref:m,addEndListener:HQ,in:s,mountOnEnter:l,unmountOnExit:d,appear:u,...p,childRef:Ex(i),children:(y,_)=>k.cloneElement(i,{..._,className:Fn(t,i.props.className,(y===ff||y===fN)&&`${n}-toggling`,VMe[y])})})));Sye.displayName="OffcanvasToggling";const zMe=Sye,bye=k.forwardRef(({bsPrefix:n,className:t,closeLabel:i="Close",closeButton:s=!1,...l},d)=>(n=ii(n,"offcanvas-header"),h.jsx(cye,{ref:d,...l,className:Fn(t,n),closeLabel:i,closeButton:s})));bye.displayName="OffcanvasHeader";const HMe=bye,GMe=HU("h5"),Cye=k.forwardRef(({className:n,bsPrefix:t,as:i=GMe,...s},l)=>(t=ii(t,"offcanvas-title"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));Cye.displayName="OffcanvasTitle";const WMe=Cye;function $Me(n){return h.jsx(zMe,{...n})}function KMe(n){return h.jsx(vP,{...n})}const Tye=k.forwardRef(({bsPrefix:n,className:t,children:i,"aria-labelledby":s,placement:l="start",responsive:d,show:u=!1,backdrop:p=!0,keyboard:m=!0,scroll:y=!1,onEscapeKeyDown:_,onShow:E,onHide:C,container:x,autoFocus:N=!0,enforceFocus:O=!0,restoreFocus:D=!0,restoreFocusOptions:P,onEntered:j,onExit:M,onExiting:V,onEnter:G,onEntering:$,onExited:ne,backdropClassName:Y,manager:le,renderStaticNode:re=!1,...ee},de)=>{const H=k.useRef();n=ii(n,"offcanvas");const[ae,_e]=k.useState(!1),me=ex(C),Ce=FMe(d||"xs","up");k.useEffect(()=>{_e(d?u&&!Ce:u)},[u,d,Ce]);const he=k.useMemo(()=>({onHide:me}),[me]);function pe(){return le||(y?(H.current||(H.current=new nye({handleContainerOverflow:!1})),H.current):iye())}const Oe=(Re,...Be)=>{Re&&(Re.style.visibility="visible"),G==null||G(Re,...Be)},Fe=(Re,...Be)=>{Re&&(Re.style.visibility=""),ne==null||ne(...Be)},Ue=k.useCallback(Re=>h.jsx("div",{...Re,className:Fn(`${n}-backdrop`,Y)}),[Y,n]),Ve=Re=>h.jsx("div",{...Re,...ee,className:Fn(t,d?`${n}-${d}`:n,`${n}-${l}`),"aria-labelledby":s,children:i});return h.jsxs(h.Fragment,{children:[!ae&&(d||re)&&Ve({}),h.jsx(ZQ.Provider,{value:he,children:h.jsx(tye,{show:ae,ref:de,backdrop:p,container:x,keyboard:m,autoFocus:N,enforceFocus:O&&!y,restoreFocus:D,restoreFocusOptions:P,onEscapeKeyDown:_,onShow:E,onHide:me,onEnter:Oe,onEntering:$,onEntered:j,onExit:M,onExiting:V,onExited:Fe,manager:pe(),transition:$Me,backdropTransition:KMe,renderBackdrop:Ue,renderDialog:Ve})})]})});Tye.displayName="Offcanvas";const t4=Object.assign(Tye,{Body:BMe,Header:HMe,Title:WMe}),Rye=k.forwardRef(({onHide:n,...t},i)=>{const s=k.useContext(yP),l=ex(()=>{s==null||s.onToggle==null||s.onToggle(),n==null||n()});return h.jsx(t4,{ref:i,show:!!(s!=null&&s.expanded),...t,renderStaticNode:!0,onHide:l})});Rye.displayName="NavbarOffcanvas";const qMe=Rye,xye=k.forwardRef(({className:n,bsPrefix:t,as:i="span",...s},l)=>(t=ii(t,"navbar-text"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));xye.displayName="NavbarText";const YMe=xye,Aye=k.forwardRef((n,t)=>{const{bsPrefix:i,expand:s=!0,variant:l="light",bg:d,fixed:u,sticky:p,className:m,as:y="nav",expanded:_,onToggle:E,onSelect:C,collapseOnSelect:x=!1,...N}=VQ(n,{expanded:"onToggle"}),O=ii(i,"navbar"),D=k.useCallback((...M)=>{C==null||C(...M),x&&_&&(E==null||E(!1))},[C,x,_,E]);N.role===void 0&&y!=="nav"&&(N.role="navigation");let P=`${O}-expand`;typeof s=="string"&&(P=`${P}-${s}`);const j=k.useMemo(()=>({onToggle:()=>E==null?void 0:E(!_),bsPrefix:O,expanded:!!_,expand:s}),[O,_,s,E]);return h.jsx(yP.Provider,{value:j,children:h.jsx(W2.Provider,{value:D,children:h.jsx(y,{ref:t,...N,className:Fn(m,O,s&&P,l&&`${O}-${l}`,d&&`bg-${d}`,p&&`sticky-${p}`,u&&`fixed-${u}`)})})})});Aye.displayName="Navbar";const Iye=Object.assign(Aye,{Brand:DMe,Collapse:kMe,Offcanvas:qMe,Text:YMe,Toggle:MMe});function Nye({animation:n,bg:t,bsPrefix:i,size:s,...l}){i=ii(i,"placeholder");const[{className:d,...u}]=Ave(l);return{...u,className:Fn(d,n?`${i}-${n}`:i,s&&`${i}-${s}`,t&&`bg-${t}`)}}const Oye=k.forwardRef((n,t)=>{const i=Nye(n);return h.jsx(Lt,{...i,ref:t,disabled:!0,tabIndex:-1})});Oye.displayName="PlaceholderButton";const XMe=Oye,Pye=k.forwardRef(({as:n="span",...t},i)=>{const s=Nye(t);return h.jsx(n,{...s,ref:i})});Pye.displayName="Placeholder";const cn=Object.assign(Pye,{Button:XMe}),The=1e3;function JMe(n,t,i){const s=(n-t)/(i-t)*100;return Math.round(s*The)/The}function Rhe({min:n,now:t,max:i,label:s,visuallyHidden:l,striped:d,animated:u,className:p,style:m,variant:y,bsPrefix:_,...E},C){return h.jsx("div",{ref:C,...E,role:"progressbar",className:Fn(p,`${_}-bar`,{[`bg-${y}`]:y,[`${_}-bar-animated`]:u,[`${_}-bar-striped`]:u||d}),style:{width:`${JMe(t,n,i)}%`,...m},"aria-valuenow":t,"aria-valuemin":n,"aria-valuemax":i,children:l?h.jsx("span",{className:"visually-hidden",children:s}):s})}const Lye=k.forwardRef(({isChild:n=!1,...t},i)=>{const s={min:0,max:100,animated:!1,visuallyHidden:!1,striped:!1,...t};if(s.bsPrefix=ii(s.bsPrefix,"progress"),n)return Rhe(s,i);const{min:l,now:d,max:u,label:p,visuallyHidden:m,striped:y,animated:_,bsPrefix:E,variant:C,className:x,children:N,...O}=s;return h.jsx("div",{ref:i,...O,className:Fn(x,E),children:N?dY(N,D=>k.cloneElement(D,{isChild:!0})):Rhe({min:l,now:d,max:u,label:p,visuallyHidden:m,striped:y,animated:_,bsPrefix:E,variant:C},i)})});Lye.displayName="ProgressBar";const eZ=Lye;function QMe(n){return n<=0?"100%":n<1?`${n*100}%`:`${n}%`}const Dye=k.forwardRef(({bsPrefix:n,className:t,children:i,aspectRatio:s="1x1",style:l,...d},u)=>{n=ii(n,"ratio");const p=typeof s=="number";return h.jsx("div",{ref:u,...d,style:{...l,...p&&{"--bs-aspect-ratio":QMe(s)}},className:Fn(n,t,!p&&`${n}-${s}`),children:k.Children.only(i)})});Dye.displayName="Ratio";const iu=Dye,kye=k.forwardRef(({bsPrefix:n,className:t,as:i="div",...s},l)=>{const d=ii(n,"row"),u=Z1e(),p=eve(),m=`${d}-cols`,y=[];return u.forEach(_=>{const E=s[_];delete s[_];let C;E!=null&&typeof E=="object"?{cols:C}=E:C=E;const x=_!==p?`-${_}`:"";C!=null&&y.push(`${m}${x}-${C}`)}),h.jsx(i,{ref:l,...s,className:Fn(t,d,...y)})});kye.displayName="Row";const fn=kye,Mye=k.forwardRef(({bsPrefix:n,variant:t,animation:i="border",size:s,as:l="div",className:d,...u},p)=>{n=ii(n,"spinner");const m=`${n}-${i}`;return h.jsx(l,{ref:p,...u,className:Fn(d,m,s&&`${m}-${s}`,t&&`text-${t}`)})});Mye.displayName="Spinner";const Zi=Mye,ZMe=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],e7e=["activeKey","getControlledId","getControllerId"],t7e=["as"];function fY(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function jye(n){let{active:t,eventKey:i,mountOnEnter:s,transition:l,unmountOnExit:d,role:u="tabpanel",onEnter:p,onEntering:m,onEntered:y,onExit:_,onExiting:E,onExited:C}=n,x=fY(n,ZMe);const N=k.useContext(Sx);if(!N)return[Object.assign({},x,{role:u}),{eventKey:i,isActive:t,mountOnEnter:s,transition:l,unmountOnExit:d,onEnter:p,onEntering:m,onEntered:y,onExit:_,onExiting:E,onExited:C}];const{activeKey:O,getControlledId:D,getControllerId:P}=N,j=fY(N,e7e),M=pN(i);return[Object.assign({},x,{role:u,id:D(i),"aria-labelledby":P(i)}),{eventKey:i,isActive:t==null&&M!=null?pN(O)===M:t,transition:l||j.transition,mountOnEnter:s??j.mountOnEnter,unmountOnExit:d??j.unmountOnExit,onEnter:p,onEntering:m,onEntered:y,onExit:_,onExiting:E,onExited:C}]}const Uye=k.forwardRef((n,t)=>{let{as:i="div"}=n,s=fY(n,t7e);const[l,{isActive:d,onEnter:u,onEntering:p,onEntered:m,onExit:y,onExiting:_,onExited:E,mountOnEnter:C,unmountOnExit:x,transition:N=QQ}]=jye(s);return h.jsx(Sx.Provider,{value:null,children:h.jsx(W2.Provider,{value:null,children:h.jsx(N,{in:d,onEnter:u,onEntering:p,onEntered:m,onExit:y,onExiting:_,onExited:E,mountOnEnter:C,unmountOnExit:x,children:h.jsx(i,Object.assign({},l,{ref:t,hidden:!d,"aria-hidden":!d}))})})})});Uye.displayName="TabPanel";const Fye=n=>{const{id:t,generateChildId:i,onSelect:s,activeKey:l,defaultActiveKey:d,transition:u,mountOnEnter:p,unmountOnExit:m,children:y}=n,[_,E]=E8e(l,d,s),C=x8e(t),x=k.useMemo(()=>i||((O,D)=>C?`${C}-${D}-${O}`:null),[C,i]),N=k.useMemo(()=>({onSelect:E,activeKey:_,transition:u,mountOnEnter:p||!1,unmountOnExit:m||!1,getControlledId:O=>x(O,"tabpane"),getControllerId:O=>x(O,"tab")}),[E,_,u,p,m,x]);return h.jsx(Sx.Provider,{value:N,children:h.jsx(W2.Provider,{value:E||null,children:y})})};Fye.Panel=Uye;const Bye=Fye;function tZ(n){return typeof n=="boolean"?n?vP:QQ:n}const Vye=({transition:n,...t})=>h.jsx(Bye,{...t,transition:tZ(n)});Vye.displayName="TabContainer";const n7e=Vye,zye=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"tab-content"),h.jsx(i,{ref:l,className:Fn(n,t),...s})));zye.displayName="TabContent";const Hye=zye,Gye=k.forwardRef(({bsPrefix:n,transition:t,...i},s)=>{const[{className:l,as:d="div",...u},{isActive:p,onEnter:m,onEntering:y,onEntered:_,onExit:E,onExiting:C,onExited:x,mountOnEnter:N,unmountOnExit:O,transition:D=vP}]=jye({...i,transition:tZ(t)}),P=ii(n,"tab-pane");return h.jsx(Sx.Provider,{value:null,children:h.jsx(W2.Provider,{value:null,children:h.jsx(D,{in:p,onEnter:m,onEntering:y,onEntered:_,onExit:E,onExiting:C,onExited:x,mountOnEnter:N,unmountOnExit:O,children:h.jsx(d,{...u,ref:s,className:Fn(l,P,p&&"active")})})})})});Gye.displayName="TabPane";const Wye=Gye,i7e={eventKey:Sl.oneOfType([Sl.string,Sl.number]),title:Sl.node.isRequired,disabled:Sl.bool,tabClassName:Sl.string,tabAttrs:Sl.object},$ye=()=>{throw new Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};$ye.propTypes=i7e;const Zn=Object.assign($ye,{Container:n7e,Content:Hye,Pane:Wye}),Kye=k.forwardRef(({bsPrefix:n,className:t,striped:i,bordered:s,borderless:l,hover:d,size:u,variant:p,responsive:m,...y},_)=>{const E=ii(n,"table"),C=Fn(t,E,p&&`${E}-${p}`,u&&`${E}-${u}`,i&&`${E}-${typeof i=="string"?`striped-${i}`:"striped"}`,s&&`${E}-bordered`,l&&`${E}-borderless`,d&&`${E}-hover`),x=h.jsx("table",{...y,className:C,ref:_});if(m){let N=`${E}-responsive`;return typeof m=="string"&&(N=`${N}-${m}`),h.jsx("div",{className:N,children:x})}return x});Kye.displayName="Table";const r7e=Kye;function s7e(n){let t;return v8e(n,i=>{t==null&&(t=i.props.eventKey)}),t}function a7e(n){const{title:t,eventKey:i,disabled:s,tabClassName:l,tabAttrs:d,id:u}=n.props;return t==null?null:h.jsx(pye,{as:"li",role:"presentation",children:h.jsx(gye,{as:"button",type:"button",eventKey:i,disabled:s,id:u,className:l,...d,children:t})})}const qye=n=>{const{id:t,onSelect:i,transition:s,mountOnEnter:l=!1,unmountOnExit:d=!1,variant:u="tabs",children:p,activeKey:m=s7e(p),...y}=VQ(n,{activeKey:"onSelect"});return h.jsxs(Bye,{id:t,activeKey:m,onSelect:i,transition:tZ(s),mountOnEnter:l,unmountOnExit:d,children:[h.jsx(Un,{id:t,...y,role:"tablist",as:"ul",variant:u,children:dY(p,a7e)}),h.jsx(Hye,{children:dY(p,_=>{const E={..._.props};return delete E.title,delete E.disabled,delete E.tabClassName,delete E.tabAttrs,h.jsx(Wye,{...E})})})]})};qye.displayName="Tabs";const $U=qye;var Yye={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},xhe=dn.createContext&&dn.createContext(Yye),o7e=["attr","size","title"];function l7e(n,t){if(n==null)return{};var i=c7e(n,t),s,l;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(n);for(l=0;l<d.length;l++)s=d[l],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(n,s)&&(i[s]=n[s])}return i}function c7e(n,t){if(n==null)return{};var i={},s=Object.keys(n),l,d;for(d=0;d<s.length;d++)l=s[d],!(t.indexOf(l)>=0)&&(i[l]=n[l]);return i}function W7(){return W7=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},W7.apply(this,arguments)}function Ahe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function $7(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Ahe(Object(i),!0).forEach(function(s){d7e(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ahe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function d7e(n,t,i){return t=u7e(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function u7e(n){var t=h7e(n,"string");return typeof t=="symbol"?t:String(t)}function h7e(n,t){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,t||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Xye(n){return n&&n.map((t,i)=>dn.createElement(t.tag,$7({key:i},t.attr),Xye(t.child)))}function Le(n){return t=>dn.createElement(f7e,W7({attr:$7({},n.attr)},t),Xye(n.child))}function f7e(n){var t=i=>{var{attr:s,size:l,title:d}=n,u=l7e(n,o7e),p=l||i.size||"1em",m;return i.className&&(m=i.className),n.className&&(m=(m?m+" ":"")+n.className),dn.createElement("svg",W7({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,s,u,{className:m,style:$7($7({color:n.color||i.color},i.style),n.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),d&&dn.createElement("title",null,d),n.children)};return xhe!==void 0?dn.createElement(xhe.Consumer,null,i=>t(i)):t(Yye)}function p7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M863.1 518.5H505.5V160.9c0-4.4-3.6-8-8-8h-26a398.57 398.57 0 0 0-282.5 117 397.47 397.47 0 0 0-85.6 127C82.6 446.2 72 498.5 72 552.5S82.6 658.7 103.4 708c20.1 47.5 48.9 90.3 85.6 127 36.7 36.7 79.4 65.5 127 85.6a396.64 396.64 0 0 0 155.6 31.5 398.57 398.57 0 0 0 282.5-117c36.7-36.7 65.5-79.4 85.6-127a396.64 396.64 0 0 0 31.5-155.6v-26c-.1-4.4-3.7-8-8.1-8zM951 463l-2.6-28.2c-8.5-92-49.3-178.8-115.1-244.3A398.5 398.5 0 0 0 588.4 75.6L560.1 73c-4.7-.4-8.7 3.2-8.7 7.9v383.7c0 4.4 3.6 8 8 8l383.6-1c4.7-.1 8.4-4 8-8.6z"},child:[]}]})(n)}function m7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 0 0-11.3 0l-39.6 39.6a8.03 8.03 0 0 0 0 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0zm669.6-79.2l-39.6-39.6a8.03 8.03 0 0 0-11.3 0l-67.9 67.9a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"},child:[]}]})(n)}function g7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-616-64h536c4.4 0 8-3.6 8-8V284c0-7.2-8.7-10.7-13.7-5.7L592 488.6l-125.4-124a8.03 8.03 0 0 0-11.3 0l-189 189.6a7.87 7.87 0 0 0-2.3 5.6V720c0 4.4 3.6 8 8 8z"},child:[]}]})(n)}function v7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"},child:[]}]})(n)}function y7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0z"},child:[]}]})(n)}function _7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M709.6 210l.4-.2h.2L512 96 313.9 209.8h-.2l.7.3L151.5 304v416L512 928l360.5-208V304l-162.9-94zM482.7 843.6L339.6 761V621.4L210 547.8V372.9l272.7 157.3v313.4zM238.2 321.5l134.7-77.8 138.9 79.7 139.1-79.9 135.2 78-273.9 158-274-158zM814 548.3l-128.8 73.1v139.1l-143.9 83V530.4L814 373.1v175.2z"},child:[]}]})(n)}function E7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 128c-212.1 0-384 171.9-384 384v360c0 13.3 10.7 24 24 24h184c35.3 0 64-28.7 64-64V624c0-35.3-28.7-64-64-64H200v-48c0-172.3 139.7-312 312-312s312 139.7 312 312v48H688c-35.3 0-64 28.7-64 64v208c0 35.3 28.7 64 64 64h184c13.3 0 24-10.7 24-24V512c0-212.1-171.9-384-384-384zM328 632v192H200V632h128zm496 192H696V632h128v192z"},child:[]}]})(n)}function w7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"},child:[]}]})(n)}function S7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 0 1-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0 1 65.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0 1 96 0 48.01 48.01 0 0 1-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"},child:[]}]})(n)}function b7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 0 0-44.4 0L77.5 505a63.9 63.9 0 0 0-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0 0 18.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"},child:[]}]})(n)}function C7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 0 1-112.7 75.9A352.8 352.8 0 0 1 512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 0 1-112.7-75.9 353.28 353.28 0 0 1-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 0 0 0-12.6z"},child:[]}]})(n)}function T7e(n){return Le({tag:"svg",attr:{t:"1569683371420",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M952 612c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H298c-14.2-35.2-48.7-60-89-60-53 0-96 43-96 96s43 96 96 96c40.3 0 74.8-24.8 89-60h150.3v152c0 55.2 44.8 100 100 100H952c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H548.3c-15.5 0-28-12.5-28-28V612H952zM451.7 313.7l172.5 136.2c6.3 5.1 15.8 0.5 15.8-7.7V344h264c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H640v-98.2c0-8.1-9.4-12.8-15.8-7.7L451.7 298.3c-4.9 3.9-4.9 11.5 0 15.4z"},child:[]}]})(n)}function R7e(n){return Le({tag:"svg",attr:{t:"1569683374330",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M952 612c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H298c-14.2-35.2-48.7-60-89-60-53 0-96 43-96 96s43 96 96 96c40.3 0 74.8-24.8 89-60h150.3v152c0 55.2 44.8 100 100 100H952c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H548.3c-15.5 0-28-12.5-28-28V612H952zM456 344h264v98.2c0 8.1 9.5 12.8 15.8 7.7l172.5-136.2c5-3.9 5-11.4 0-15.3L735.8 162.1c-6.4-5.1-15.8-0.5-15.8 7.7V268H456c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8z"},child:[]}]})(n)}function x7e(n){return Le({tag:"svg",attr:{t:"1569683635191",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M843.5 737.4c-12.4-75.2-79.2-129.1-155.3-125.4S550.9 676 546 752c-153.5-4.8-208-40.7-199.1-113.7 3.3-27.3 19.8-41.9 50.1-49 18.4-4.3 38.8-4.9 57.3-3.2 1.7 0.2 3.5 0.3 5.2 0.5 11.3 2.7 22.8 5 34.3 6.8 34.1 5.6 68.8 8.4 101.8 6.6 92.8-5 156-45.9 159.2-132.7 3.1-84.1-54.7-143.7-147.9-183.6-29.9-12.8-61.6-22.7-93.3-30.2-14.3-3.4-26.3-5.7-35.2-7.2-7.9-75.9-71.5-133.8-147.8-134.4-76.3-0.6-140.9 56.1-150.1 131.9s40 146.3 114.2 163.9c74.2 17.6 149.9-23.3 175.7-95.1 9.4 1.7 18.7 3.6 28 5.8 28.2 6.6 56.4 15.4 82.4 26.6 70.7 30.2 109.3 70.1 107.5 119.9-1.6 44.6-33.6 65.2-96.2 68.6-27.5 1.5-57.6-0.9-87.3-5.8-8.3-1.4-15.9-2.8-22.6-4.3-3.9-0.8-6.6-1.5-7.8-1.8l-3.1-0.6c-2.2-0.3-5.9-0.8-10.7-1.3-25-2.3-52.1-1.5-78.5 4.6-55.2 12.9-93.9 47.2-101.1 105.8-15.7 126.2 78.6 184.7 276 188.9 29.1 70.4 106.4 107.9 179.6 87 73.3-20.9 119.3-93.4 106.9-168.6zM329.1 345.2c-46 0-83.3-37.3-83.3-83.3s37.3-83.3 83.3-83.3 83.3 37.3 83.3 83.3-37.3 83.3-83.3 83.3zM695.6 845c-46 0-83.3-37.3-83.3-83.3s37.3-83.3 83.3-83.3 83.3 37.3 83.3 83.3-37.3 83.3-83.3 83.3z"},child:[]}]})(n)}function A7e(n){return Le({tag:"svg",attr:{t:"1569683632175",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M640.6 429.8h257.1c7.9 0 14.3-6.4 14.3-14.3V158.3c0-7.9-6.4-14.3-14.3-14.3H640.6c-7.9 0-14.3 6.4-14.3 14.3v92.9H490.6c-3.9 0-7.1 3.2-7.1 7.1v221.5h-85.7v-96.5c0-7.9-6.4-14.3-14.3-14.3H126.3c-7.9 0-14.3 6.4-14.3 14.3v257.2c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3V544h85.7v221.5c0 3.9 3.2 7.1 7.1 7.1h135.7v92.9c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3v-257c0-7.9-6.4-14.3-14.3-14.3h-257c-7.9 0-14.3 6.4-14.3 14.3v100h-78.6v-393h78.6v100c0 7.9 6.4 14.3 14.3 14.3z m53.5-217.9h150V362h-150V211.9zM329.9 587h-150V437h150v150z m364.2 75.1h150v150.1h-150V662.1z"},child:[]}]})(n)}function I7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M864 518H506V160c0-4.4-3.6-8-8-8h-26a398.46 398.46 0 0 0-282.8 117.1 398.19 398.19 0 0 0-85.7 127.1A397.61 397.61 0 0 0 72 552a398.46 398.46 0 0 0 117.1 282.8c36.7 36.7 79.5 65.6 127.1 85.7A397.61 397.61 0 0 0 472 952a398.46 398.46 0 0 0 282.8-117.1c36.7-36.7 65.6-79.5 85.7-127.1A397.61 397.61 0 0 0 872 552v-26c0-4.4-3.6-8-8-8zM705.7 787.8A331.59 331.59 0 0 1 470.4 884c-88.1-.4-170.9-34.9-233.2-97.2C174.5 724.1 140 640.7 140 552c0-88.7 34.5-172.1 97.2-234.8 54.6-54.6 124.9-87.9 200.8-95.5V586h364.3c-7.7 76.3-41.3 147-96.6 201.8zM952 462.4l-2.6-28.2c-8.5-92.1-49.4-179-115.2-244.6A399.4 399.4 0 0 0 589 74.6L560.7 72c-4.7-.4-8.7 3.2-8.7 7.9V464c0 4.4 3.6 8 8 8l384-1c4.7 0 8.4-4 8-8.6zm-332.2-58.2V147.6a332.24 332.24 0 0 1 166.4 89.8c45.7 45.6 77 103.6 90 166.1l-256.4.7z"},child:[]}]})(n)}function N7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(n)}function O7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M928 161H699.2c-49.1 0-97.1 14.1-138.4 40.7L512 233l-48.8-31.3A255.2 255.2 0 0 0 324.8 161H96c-17.7 0-32 14.3-32 32v568c0 17.7 14.3 32 32 32h228.8c49.1 0 97.1 14.1 138.4 40.7l44.4 28.6c1.3.8 2.8 1.3 4.3 1.3s3-.4 4.3-1.3l44.4-28.6C602 807.1 650.1 793 699.2 793H928c17.7 0 32-14.3 32-32V193c0-17.7-14.3-32-32-32zM324.8 721H136V233h188.8c35.4 0 69.8 10.1 99.5 29.2l48.8 31.3 6.9 4.5v462c-47.6-25.6-100.8-39-155.2-39zm563.2 0H699.2c-54.4 0-107.6 13.4-155.2 39V298l6.9-4.5 48.8-31.3c29.7-19.1 64.1-29.2 99.5-29.2H888v488zM396.9 361H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm223.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c0-4.1-3.2-7.5-7.1-7.5H627.1c-3.9 0-7.1 3.4-7.1 7.5zM396.9 501H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm416 0H627.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5z"},child:[]}]})(n)}function P7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 0 0-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 0 1 655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 0 1 279 755.2a342.16 342.16 0 0 1-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 0 1 109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"},child:[]}]})(n)}function L7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M882 272.1V144c0-17.7-14.3-32-32-32H174c-17.7 0-32 14.3-32 32v128.1c-16.7 1-30 14.9-30 31.9v131.7a177 177 0 0 0 14.4 70.4c4.3 10.2 9.6 19.8 15.6 28.9v345c0 17.6 14.3 32 32 32h676c17.7 0 32-14.3 32-32V535a175 175 0 0 0 15.6-28.9c9.5-22.3 14.4-46 14.4-70.4V304c0-17-13.3-30.9-30-31.9zM214 184h596v88H214v-88zm362 656.1H448V736h128v104.1zm234 0H640V704c0-17.7-14.3-32-32-32H416c-17.7 0-32 14.3-32 32v136.1H214V597.9c2.9 1.4 5.9 2.8 9 4 22.3 9.4 46 14.1 70.4 14.1s48-4.7 70.4-14.1c13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0 0 38.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0 0 38.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 3-1.3 6-2.6 9-4v242.2zm30-404.4c0 59.8-49 108.3-109.3 108.3-40.8 0-76.4-22.1-95.2-54.9-2.9-5-8.1-8.1-13.9-8.1h-.6c-5.7 0-11 3.1-13.9 8.1A109.24 109.24 0 0 1 512 544c-40.7 0-76.2-22-95-54.7-3-5.1-8.4-8.3-14.3-8.3s-11.4 3.2-14.3 8.3a109.63 109.63 0 0 1-95.1 54.7C233 544 184 495.5 184 435.7v-91.2c0-.3.2-.5.5-.5h655c.3 0 .5.2.5.5v91.2z"},child:[]}]})(n)}function D7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M922.9 701.9H327.4l29.9-60.9 496.8-.9c16.8 0 31.2-12 34.2-28.6l68.8-385.1c1.8-10.1-.9-20.5-7.5-28.4a34.99 34.99 0 0 0-26.6-12.5l-632-2.1-5.4-25.4c-3.4-16.2-18-28-34.6-28H96.5a35.3 35.3 0 1 0 0 70.6h125.9L246 312.8l58.1 281.3-74.8 122.1a34.96 34.96 0 0 0-3 36.8c6 11.9 18.1 19.4 31.5 19.4h62.8a102.43 102.43 0 0 0-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7h161.1a102.43 102.43 0 0 0-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7H923c19.4 0 35.3-15.8 35.3-35.3a35.42 35.42 0 0 0-35.4-35.2zM305.7 253l575.8 1.9-56.4 315.8-452.3.8L305.7 253zm96.9 612.7c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 0 1-31.6 31.6zm325.1 0c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 0 1-31.6 31.6z"},child:[]}]})(n)}function k7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M832 312H696v-16c0-101.6-82.4-184-184-184s-184 82.4-184 184v16H192c-17.7 0-32 14.3-32 32v536c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V344c0-17.7-14.3-32-32-32zm-432-16c0-61.9 50.1-112 112-112s112 50.1 112 112v16H400v-16zm392 544H232V384h96v88c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-88h224v88c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-88h96v456z"},child:[]}]})(n)}function M7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M688 264c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48zm-8 136H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM480 544H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 308H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm356.8-74.4c29-26.3 47.2-64.3 47.2-106.6 0-79.5-64.5-144-144-144s-144 64.5-144 144c0 42.3 18.2 80.3 47.2 106.6-57 32.5-96.2 92.7-99.2 162.1-.2 4.5 3.5 8.3 8 8.3h48.1c4.2 0 7.7-3.3 8-7.6C564 871.2 621.7 816 692 816s128 55.2 131.9 124.4c.2 4.2 3.7 7.6 8 7.6H880c4.6 0 8.2-3.8 8-8.3-2.9-69.5-42.2-129.6-99.2-162.1zM692 591c44.2 0 80 35.8 80 80s-35.8 80-80 80-80-35.8-80-80 35.8-80 80-80z"},child:[]}]})(n)}function j7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"},child:[]}]})(n)}function U7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 0 1 755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 0 1 512.1 856a342.24 342.24 0 0 1-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 0 0-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 0 0-8-8.2z"},child:[]}]})(n)}function F7e(n){return Le({tag:"svg",attr:{t:"1569683921137",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M759 335c0-137-111-248-248-248S263 198 263 335c0 82.8 40.6 156.2 103 201.2-0.4 0.2-0.7 0.3-0.9 0.4-44.7 18.9-84.8 46-119.3 80.6-34.5 34.5-61.5 74.7-80.4 119.5C146.9 780.5 137 827 136 874.8c-0.1 4.5 3.5 8.2 8 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C356 614.2 431 583 511 583c137 0 248-111 248-248zM511 507c-95 0-172-77-172-172s77-172 172-172 172 77 172 172-77 172-172 172zM616 728h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H703.5l47.2-60.1c1.1-1.4 1.7-3.2 1.7-4.9 0-4.4-3.6-8-8-8h-72.6c-4.9 0-9.5 2.3-12.6 6.1l-68.5 87.1c-4.4 5.6-6.8 12.6-6.8 19.8 0.1 17.7 14.4 32 32.1 32zM856 792H592c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h176.5l-47.2 60.1c-1.1 1.4-1.7 3.2-1.7 4.9 0 4.4 3.6 8 8 8h72.6c4.9 0 9.5-2.3 12.6-6.1l68.5-87.1c4.4-5.6 6.8-12.6 6.8-19.8-0.1-17.7-14.4-32-32.1-32z"},child:[]}]})(n)}function B7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"},child:[]}]})(n)}function V7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"},child:[]}]})(n)}function z7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"},child:[]}]})(n)}function H7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"},child:[]},{tag:"path",attr:{d:"M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"},child:[]}]})(n)}function G7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m10.79 12.912-1.614-1.615a3.5 3.5 0 0 1-4.474-4.474l-2.06-2.06C.938 6.278 0 8 0 8s3 5.5 8 5.5a7.029 7.029 0 0 0 2.79-.588zM5.21 3.088A7.028 7.028 0 0 1 8 2.5c5 0 8 5.5 8 5.5s-.939 1.721-2.641 3.238l-2.062-2.062a3.5 3.5 0 0 0-4.474-4.474L5.21 3.089z"},child:[]},{tag:"path",attr:{d:"M5.525 7.646a2.5 2.5 0 0 0 2.829 2.829l-2.83-2.829zm4.95.708-2.829-2.83a2.5 2.5 0 0 1 2.829 2.829zm3.171 6-12-12 .708-.708 12 12-.708.708z"},child:[]}]})(n)}function W7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},child:[]}]})(n)}function $7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H7Zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm-5.784 6A2.238 2.238 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.325 6.325 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1h4.216ZM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"},child:[]}]})(n)}function K7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},child:[]}]})(n)}function q7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"},child:[]}]})(n)}function Y7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"},child:[]}]})(n)}function X7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1H2.5zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5zM8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5zm3 .5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 1 0z"},child:[]}]})(n)}function J7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43Zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282Z"},child:[]},{tag:"path",attr:{d:"M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43Zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282Z"},child:[]}]})(n)}function Q7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1 11.5a.5.5 0 0 0 .5.5h11.793l-3.147 3.146a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708.708L13.293 11H1.5a.5.5 0 0 0-.5.5zm14-7a.5.5 0 0 1-.5.5H2.707l3.147 3.146a.5.5 0 1 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 1 1 .708.708L2.707 4H14.5a.5.5 0 0 1 .5.5z"},child:[]}]})(n)}function Z7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.277.084a.5.5 0 0 0-.554 0l-7.5 5A.5.5 0 0 0 .5 6h1.875v7H1.5a.5.5 0 0 0 0 1h13a.5.5 0 1 0 0-1h-.875V6H15.5a.5.5 0 0 0 .277-.916l-7.5-5zM12.375 6v7h-1.25V6h1.25zm-2.5 0v7h-1.25V6h1.25zm-2.5 0v7h-1.25V6h1.25zm-2.5 0v7h-1.25V6h1.25zM8 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM.5 15a.5.5 0 0 0 0 1h15a.5.5 0 1 0 0-1H.5z"},child:[]}]})(n)}function e9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zm.995-14.901a1 1 0 1 0-1.99 0A5.002 5.002 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901z"},child:[]}]})(n)}function t9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.5a1 1 0 0 0-.8.4l-1.9 2.533a1 1 0 0 1-1.6 0L5.3 12.4a1 1 0 0 0-.8-.4H2a2 2 0 0 1-2-2V2zm3.5 1a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 2.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 2.5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5z"},child:[]}]})(n)}function n9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"},child:[]}]})(n)}function i9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"},child:[]}]})(n)}function r9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]}]})(n)}function s9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"},child:[]},{tag:"path",attr:{d:"M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"},child:[]},{tag:"path",attr:{d:"M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"},child:[]}]})(n)}function a9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 1v3H1V1h5zM1 0a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1H1zm14 12v3h-5v-3h5zm-5-1a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-5zM6 8v7H1V8h5zM1 7a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H1zm14-6v7h-5V1h5zm-5-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1h-5z"},child:[]}]})(n)}function o9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M6 3.5A1.5 1.5 0 0 1 7.5 2h1A1.5 1.5 0 0 1 10 3.5v1A1.5 1.5 0 0 1 8.5 6v1H14a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0v-1A.5.5 0 0 1 2 7h5.5V6A1.5 1.5 0 0 1 6 4.5v-1zM8.5 5a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1zM0 11.5A1.5 1.5 0 0 1 1.5 10h1A1.5 1.5 0 0 1 4 11.5v1A1.5 1.5 0 0 1 2.5 14h-1A1.5 1.5 0 0 1 0 12.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1zm4.5.5A1.5 1.5 0 0 1 7.5 10h1a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 8.5 14h-1A1.5 1.5 0 0 1 6 12.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1zm4.5.5a1.5 1.5 0 0 1 1.5-1.5h1a1.5 1.5 0 0 1 1.5 1.5v1a1.5 1.5 0 0 1-1.5 1.5h-1a1.5 1.5 0 0 1-1.5-1.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1z"},child:[]}]})(n)}function l9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z"},child:[]}]})(n)}function KU(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z"},child:[]}]})(n)}function c9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM1.6 11.85H0v3.999h.791v-1.342h.803c.287 0 .531-.057.732-.173.203-.117.358-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477c-.2-.12-.443-.179-.732-.179Zm.545 1.333a.795.795 0 0 1-.085.38.574.574 0 0 1-.238.241.794.794 0 0 1-.375.082H.788V12.48h.66c.218 0 .389.06.512.181.123.122.185.296.185.522Zm1.217-1.333v3.999h1.46c.401 0 .734-.08.998-.237a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084 0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.589-.68c-.264-.156-.599-.234-1.005-.234H3.362Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592 1.14 1.14 0 0 1-.196.422.8.8 0 0 1-.334.252 1.298 1.298 0 0 1-.483.082h-.563v-2.707Zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638H7.896Z"},child:[]}]})(n)}function d9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"},child:[]}]})(n)}function u9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z"},child:[]}]})(n)}function h9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"},child:[]}]})(n)}function f9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z"},child:[]},{tag:"path",attr:{d:"M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z"},child:[]}]})(n)}function p9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A31.493 31.493 0 0 1 8 14.58a31.481 31.481 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94zM8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10z"},child:[]},{tag:"path",attr:{d:"M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"},child:[]}]})(n)}function m9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 3a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V8a6 6 0 1 1 12 0v5a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1V8a5 5 0 0 0-5-5z"},child:[]}]})(n)}function g9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 1a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a6 6 0 1 1 12 0v6a2.5 2.5 0 0 1-2.5 2.5H9.366a1 1 0 0 1-.866.5h-1a1 1 0 1 1 0-2h1a1 1 0 0 1 .866.5H11.5A1.5 1.5 0 0 0 13 12h-1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1V6a5 5 0 0 0-5-5z"},child:[]}]})(n)}function v9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"},child:[]},{tag:"path",attr:{d:"M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z"},child:[]}]})(n)}function y9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.502 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"},child:[]},{tag:"path",attr:{d:"M14.002 13a2 2 0 0 1-2 2h-10a2 2 0 0 1-2-2V5A2 2 0 0 1 2 3a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v8a2 2 0 0 1-1.998 2zM14 2H4a1 1 0 0 0-1 1h9.002a2 2 0 0 1 2 2v7A1 1 0 0 0 15 11V3a1 1 0 0 0-1-1zM2.002 4a1 1 0 0 0-1 1v8l2.646-2.354a.5.5 0 0 1 .63-.062l2.66 1.773 3.71-3.71a.5.5 0 0 1 .577-.094l1.777 1.947V5a1 1 0 0 0-1-1h-10z"},child:[]}]})(n)}function _9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"},child:[]}]})(n)}function E9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"},child:[]},{tag:"path",attr:{d:"M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"},child:[]}]})(n)}function w9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.933.87a2.89 2.89 0 0 1 4.134 0l.622.638.89-.011a2.89 2.89 0 0 1 2.924 2.924l-.01.89.636.622a2.89 2.89 0 0 1 0 4.134l-.637.622.011.89a2.89 2.89 0 0 1-2.924 2.924l-.89-.01-.622.636a2.89 2.89 0 0 1-4.134 0l-.622-.637-.89.011a2.89 2.89 0 0 1-2.924-2.924l.01-.89-.636-.622a2.89 2.89 0 0 1 0-4.134l.637-.622-.011-.89a2.89 2.89 0 0 1 2.924-2.924l.89.01.622-.636zM7.002 11a1 1 0 1 0 2 0 1 1 0 0 0-2 0zm1.602-2.027c.04-.534.198-.815.846-1.26.674-.475 1.05-1.09 1.05-1.986 0-1.325-.92-2.227-2.262-2.227-1.02 0-1.792.492-2.1 1.29A1.71 1.71 0 0 0 6 5.48c0 .393.203.64.545.64.272 0 .455-.147.564-.51.158-.592.525-.915 1.074-.915.61 0 1.03.446 1.03 1.084 0 .563-.208.885-.822 1.325-.619.433-.926.914-.926 1.64v.111c0 .428.208.745.585.745.336 0 .504-.24.554-.627z"},child:[]}]})(n)}function S9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.05 9.6c.336 0 .504-.24.554-.627.04-.534.198-.815.847-1.26.673-.475 1.049-1.09 1.049-1.986 0-1.325-.92-2.227-2.262-2.227-1.02 0-1.792.492-2.1 1.29A1.71 1.71 0 0 0 6 5.48c0 .393.203.64.545.64.272 0 .455-.147.564-.51.158-.592.525-.915 1.074-.915.61 0 1.03.446 1.03 1.084 0 .563-.208.885-.822 1.325-.619.433-.926.914-.926 1.64v.111c0 .428.208.745.585.745z"},child:[]},{tag:"path",attr:{d:"m10.273 2.513-.921-.944.715-.698.622.637.89-.011a2.89 2.89 0 0 1 2.924 2.924l-.01.89.636.622a2.89 2.89 0 0 1 0 4.134l-.637.622.011.89a2.89 2.89 0 0 1-2.924 2.924l-.89-.01-.622.636a2.89 2.89 0 0 1-4.134 0l-.622-.637-.89.011a2.89 2.89 0 0 1-2.924-2.924l.01-.89-.636-.622a2.89 2.89 0 0 1 0-4.134l.637-.622-.011-.89a2.89 2.89 0 0 1 2.924-2.924l.89.01.622-.636a2.89 2.89 0 0 1 4.134 0l-.715.698a1.89 1.89 0 0 0-2.704 0l-.92.944-1.32-.016a1.89 1.89 0 0 0-1.911 1.912l.016 1.318-.944.921a1.89 1.89 0 0 0 0 2.704l.944.92-.016 1.32a1.89 1.89 0 0 0 1.912 1.911l1.318-.016.921.944a1.89 1.89 0 0 0 2.704 0l.92-.944 1.32.016a1.89 1.89 0 0 0 1.911-1.912l-.016-1.318.944-.921a1.89 1.89 0 0 0 0-2.704l-.944-.92.016-1.32a1.89 1.89 0 0 0-1.912-1.911l-1.318.016z"},child:[]},{tag:"path",attr:{d:"M7.001 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0z"},child:[]}]})(n)}function b9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"},child:[]}]})(n)}function C9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"},child:[]}]})(n)}function T9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"},child:[]}]})(n)}function R9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1h8Zm-7.978-1A.261.261 0 0 1 7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002a.274.274 0 0 1-.014.002H7.022ZM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM6.936 9.28a5.88 5.88 0 0 0-1.23-.247A7.35 7.35 0 0 0 5 9c-4 0-5 3-5 4 0 .667.333 1 1 1h4.216A2.238 2.238 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816ZM4.92 10A5.493 5.493 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275ZM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z"},child:[]}]})(n)}function x9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.5 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1h-3zM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"},child:[]},{tag:"path",attr:{d:"M4.5 0A2.5 2.5 0 0 0 2 2.5V14a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2.5A2.5 2.5 0 0 0 11.5 0h-7zM3 2.5A1.5 1.5 0 0 1 4.5 1h7A1.5 1.5 0 0 1 13 2.5v10.795a4.2 4.2 0 0 0-.776-.492C11.392 12.387 10.063 12 8 12s-3.392.387-4.224.803a4.2 4.2 0 0 0-.776.492V2.5z"},child:[]}]})(n)}function A9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm1.679-4.493-1.335 2.226a.75.75 0 0 1-1.174.144l-.774-.773a.5.5 0 0 1 .708-.708l.547.548 1.17-1.951a.5.5 0 1 1 .858.514ZM11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM8 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"},child:[]},{tag:"path",attr:{d:"M8.256 14a4.474 4.474 0 0 1-.229-1.004H3c.001-.246.154-.986.832-1.664C4.484 10.68 5.711 10 8 10c.26 0 .507.009.74.025.226-.341.496-.65.804-.918C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4s1 1 1 1h5.256Z"},child:[]}]})(n)}function I9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z"},child:[]}]})(n)}function N9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 9.05a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"},child:[]},{tag:"path",attr:{d:"M1 1a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h.5a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0 .5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0 .5.5 0 0 0 .5.5h.5a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H6.707L6 1.293A1 1 0 0 0 5.293 1H1Zm0 1h4.293L6 2.707A1 1 0 0 0 6.707 3H15v10h-.085a1.5 1.5 0 0 0-2.4-.63C11.885 11.223 10.554 10 8 10c-2.555 0-3.886 1.224-4.514 2.37a1.5 1.5 0 0 0-2.4.63H1V2Z"},child:[]}]})(n)}function O9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"},child:[]},{tag:"path",attr:{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm12 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1v-1c0-1-1-4-6-4s-6 3-6 4v1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12z"},child:[]}]})(n)}function P9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4 16s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H4Zm4-5.95a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"},child:[]},{tag:"path",attr:{d:"M2 1a2 2 0 0 0-2 2v9.5A1.5 1.5 0 0 0 1.5 14h.653a5.373 5.373 0 0 1 1.066-2H1V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v9h-2.219c.554.654.89 1.373 1.066 2h.653a1.5 1.5 0 0 0 1.5-1.5V3a2 2 0 0 0-2-2H2Z"},child:[]}]})(n)}function L9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4Zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10Z"},child:[]}]})(n)}function D9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 12V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm6.79-6.907A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z"},child:[]}]})(n)}function k9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.79 5.093A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z"},child:[]},{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z"},child:[]}]})(n)}function M9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM6.79 5.093A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z"},child:[]}]})(n)}function j9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"},child:[]}]})(n)}function U9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"},child:[]}]})(n)}function F9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"},child:[]}]})(n)}function B9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.302 1.256a1.5 1.5 0 0 0-2.604 0l-1.704 2.98a.5.5 0 0 0 .869.497l1.703-2.981a.5.5 0 0 1 .868 0l2.54 4.444-1.256-.337a.5.5 0 1 0-.26.966l2.415.647a.5.5 0 0 0 .613-.353l.647-2.415a.5.5 0 1 0-.966-.259l-.333 1.242-2.532-4.431zM2.973 7.773l-1.255.337a.5.5 0 1 1-.26-.966l2.416-.647a.5.5 0 0 1 .612.353l.647 2.415a.5.5 0 0 1-.966.259l-.333-1.242-2.545 4.454a.5.5 0 0 0 .434.748H5a.5.5 0 0 1 0 1H1.723A1.5 1.5 0 0 1 .421 12.24l2.552-4.467zm10.89 1.463a.5.5 0 1 0-.868.496l1.716 3.004a.5.5 0 0 1-.434.748h-5.57l.647-.646a.5.5 0 1 0-.708-.707l-1.5 1.5a.498.498 0 0 0 0 .707l1.5 1.5a.5.5 0 1 0 .708-.707l-.647-.647h5.57a1.5 1.5 0 0 0 1.302-2.244l-1.716-3.004z"},child:[]}]})(n)}function V9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"},child:[]}]})(n)}function z9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.499 2.499 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5zm-8.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm11 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"},child:[]}]})(n)}function H9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"},child:[]}]})(n)}function G9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"},child:[]}]})(n)}function W9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z"},child:[]}]})(n)}function $9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.5.5A.5.5 0 0 1 3 0h10a.5.5 0 0 1 .5.5c0 .538-.012 1.05-.034 1.536a3 3 0 1 1-1.133 5.89c-.79 1.865-1.878 2.777-2.833 3.011v2.173l1.425.356c.194.048.377.135.537.255L13.3 15.1a.5.5 0 0 1-.3.9H3a.5.5 0 0 1-.3-.9l1.838-1.379c.16-.12.343-.207.537-.255L6.5 13.11v-2.173c-.955-.234-2.043-1.146-2.833-3.012a3 3 0 1 1-1.132-5.89A33.076 33.076 0 0 1 2.5.5zm.099 2.54a2 2 0 0 0 .72 3.935c-.333-1.05-.588-2.346-.72-3.935zm10.083 3.935a2 2 0 0 0 .72-3.935c-.133 1.59-.388 2.885-.72 3.935zM3.504 1c.007.517.026 1.006.056 1.469.13 2.028.457 3.546.87 4.667C5.294 9.48 6.484 10 7 10a.5.5 0 0 1 .5.5v2.61a1 1 0 0 1-.757.97l-1.426.356a.5.5 0 0 0-.179.085L4.5 15h7l-.638-.479a.501.501 0 0 0-.18-.085l-1.425-.356a1 1 0 0 1-.757-.97V10.5A.5.5 0 0 1 9 10c.516 0 1.706-.52 2.57-2.864.413-1.12.74-2.64.87-4.667.03-.463.049-.952.056-1.469H3.504z"},child:[]}]})(n)}function K9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m2.244 13.081.943-2.803H6.66l.944 2.803H8.86L5.54 3.75H4.322L1 13.081h1.244zm2.7-7.923L6.34 9.314H3.51l1.4-4.156h.034zm9.146 7.027h.035v.896h1.128V8.125c0-1.51-1.114-2.345-2.646-2.345-1.736 0-2.59.916-2.666 2.174h1.108c.068-.718.595-1.19 1.517-1.19.971 0 1.518.52 1.518 1.464v.731H12.19c-1.647.007-2.522.8-2.522 2.058 0 1.319.957 2.18 2.345 2.18 1.06 0 1.716-.43 2.078-1.011zm-1.763.035c-.752 0-1.456-.397-1.456-1.244 0-.65.424-1.115 1.408-1.115h1.805v.834c0 .896-.752 1.525-1.757 1.525z"},child:[]}]})(n)}function q9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.273 9.53a2.273 2.273 0 1 0 0-4.546 2.273 2.273 0 0 0 0 4.547Zm9.467-4.984a2.273 2.273 0 1 0 0-4.546 2.273 2.273 0 0 0 0 4.546ZM7.4 13.108a5.535 5.535 0 0 1-3.775-2.88 3.273 3.273 0 0 1-1.944.24 7.4 7.4 0 0 0 5.328 4.465c.53.113 1.072.169 1.614.166a3.253 3.253 0 0 1-.666-1.9 5.639 5.639 0 0 1-.557-.091Zm3.828 2.285a2.273 2.273 0 1 0 0-4.546 2.273 2.273 0 0 0 0 4.546Zm3.163-3.108a7.436 7.436 0 0 0 .373-8.726 3.276 3.276 0 0 1-1.278 1.498 5.573 5.573 0 0 1-.183 5.535 3.26 3.26 0 0 1 1.088 1.693ZM2.098 3.998a3.28 3.28 0 0 1 1.897.486 5.544 5.544 0 0 1 4.464-2.388c.037-.67.277-1.313.69-1.843a7.472 7.472 0 0 0-7.051 3.745Z"},child:[]}]})(n)}function Y9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"},child:[]}]})(n)}function X9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"},child:[]}]})(n)}function ow(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"},child:[]}]})(n)}function J9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 1c3.681 0 7 2.565 7 6v4.539c0 .642.189 1.269.545 1.803l2.2 3.298A1.517 1.517 0 0 1 20.482 19H15.5a3.5 3.5 0 1 1-7 0H3.519a1.518 1.518 0 0 1-1.265-2.359l2.2-3.299A3.25 3.25 0 0 0 5 11.539V7c0-3.435 3.318-6 7-6ZM6.5 7v4.539a4.75 4.75 0 0 1-.797 2.635l-2.2 3.298-.003.01.001.007.004.006.006.004.007.001h16.964l.007-.001.006-.004.004-.006.001-.006a.017.017 0 0 0-.003-.01l-2.199-3.299a4.753 4.753 0 0 1-.798-2.635V7c0-2.364-2.383-4.5-5.5-4.5S6.5 4.636 6.5 7ZM14 19h-4a2 2 0 1 0 4 0Z"},child:[]}]})(n)}function Q9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 8a6 6 0 1 1 12 0v2.917c0 .703.228 1.387.65 1.95L20.7 15.6a1.5 1.5 0 0 1-1.2 2.4h-15a1.5 1.5 0 0 1-1.2-2.4l2.05-2.733a3.25 3.25 0 0 0 .65-1.95Zm6 13.5A3.502 3.502 0 0 1 8.645 19h6.71A3.502 3.502 0 0 1 12 21.5Z"},child:[]}]})(n)}function Z9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M0 3.75A.75.75 0 0 1 .75 3h7.497c1.566 0 2.945.8 3.751 2.014A4.495 4.495 0 0 1 15.75 3h7.5a.75.75 0 0 1 .75.75v15.063a.752.752 0 0 1-.755.75l-7.682-.052a3 3 0 0 0-2.142.878l-.89.891a.75.75 0 0 1-1.061 0l-.902-.901a2.996 2.996 0 0 0-2.121-.879H.75a.75.75 0 0 1-.75-.75Zm12.75 15.232a4.503 4.503 0 0 1 2.823-.971l6.927.047V4.5h-6.75a3 3 0 0 0-3 3ZM11.247 7.497a3 3 0 0 0-3-2.997H1.5V18h6.947c1.018 0 2.006.346 2.803.98Z"},child:[]}]})(n)}function eje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-1.5 0a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"},child:[]},{tag:"path",attr:{d:"M12 1c.266 0 .532.009.797.028.763.055 1.345.617 1.512 1.304l.352 1.45c.019.078.09.171.225.221.247.089.49.19.728.302.13.061.246.044.315.002l1.275-.776c.603-.368 1.411-.353 1.99.147.402.349.78.726 1.128 1.129.501.578.515 1.386.147 1.99l-.776 1.274c-.042.069-.058.185.002.315.112.238.213.481.303.728.048.135.142.205.22.225l1.45.352c.687.167 1.249.749 1.303 1.512.038.531.038 1.063 0 1.594-.054.763-.616 1.345-1.303 1.512l-1.45.352c-.078.019-.171.09-.221.225-.089.248-.19.491-.302.728-.061.13-.044.246-.002.315l.776 1.275c.368.603.353 1.411-.147 1.99-.349.402-.726.78-1.129 1.128-.578.501-1.386.515-1.99.147l-1.274-.776c-.069-.042-.185-.058-.314.002a8.606 8.606 0 0 1-.729.303c-.135.048-.205.142-.225.22l-.352 1.45c-.167.687-.749 1.249-1.512 1.303-.531.038-1.063.038-1.594 0-.763-.054-1.345-.616-1.512-1.303l-.352-1.45c-.019-.078-.09-.171-.225-.221a8.138 8.138 0 0 1-.728-.302c-.13-.061-.246-.044-.315-.002l-1.275.776c-.603.368-1.411.353-1.99-.147-.402-.349-.78-.726-1.128-1.129-.501-.578-.515-1.386-.147-1.99l.776-1.274c.042-.069.058-.185-.002-.314a8.606 8.606 0 0 1-.303-.729c-.048-.135-.142-.205-.22-.225l-1.45-.352c-.687-.167-1.249-.749-1.304-1.512a11.158 11.158 0 0 1 0-1.594c.055-.763.617-1.345 1.304-1.512l1.45-.352c.078-.019.171-.09.221-.225.089-.248.19-.491.302-.728.061-.13.044-.246.002-.315l-.776-1.275c-.368-.603-.353-1.411.147-1.99.349-.402.726-.78 1.129-1.128.578-.501 1.386-.515 1.99-.147l1.274.776c.069.042.185.058.315-.002.238-.112.481-.213.728-.303.135-.048.205-.142.225-.22l.352-1.45c.167-.687.749-1.249 1.512-1.304C11.466 1.01 11.732 1 12 1Zm-.69 1.525c-.055.004-.135.05-.161.161l-.353 1.45a1.832 1.832 0 0 1-1.172 1.277 7.147 7.147 0 0 0-.6.249 1.833 1.833 0 0 1-1.734-.074l-1.274-.776c-.098-.06-.186-.036-.228 0a9.774 9.774 0 0 0-.976.976c-.036.042-.06.131 0 .228l.776 1.274c.314.529.342 1.18.074 1.734a7.147 7.147 0 0 0-.249.6 1.831 1.831 0 0 1-1.278 1.173l-1.45.351c-.11.027-.156.107-.16.162a9.63 9.63 0 0 0 0 1.38c.004.055.05.135.161.161l1.45.353a1.832 1.832 0 0 1 1.277 1.172c.074.204.157.404.249.6.268.553.24 1.204-.074 1.733l-.776 1.275c-.06.098-.036.186 0 .228.301.348.628.675.976.976.042.036.131.06.228 0l1.274-.776a1.83 1.83 0 0 1 1.734-.075c.196.093.396.176.6.25a1.831 1.831 0 0 1 1.173 1.278l.351 1.45c.027.11.107.156.162.16a9.63 9.63 0 0 0 1.38 0c.055-.004.135-.05.161-.161l.353-1.45a1.834 1.834 0 0 1 1.172-1.278 6.82 6.82 0 0 0 .6-.248 1.831 1.831 0 0 1 1.733.074l1.275.776c.098.06.186.036.228 0 .348-.301.675-.628.976-.976.036-.042.06-.131 0-.228l-.776-1.275a1.834 1.834 0 0 1-.075-1.733c.093-.196.176-.396.25-.6a1.831 1.831 0 0 1 1.278-1.173l1.45-.351c.11-.027.156-.107.16-.162a9.63 9.63 0 0 0 0-1.38c-.004-.055-.05-.135-.161-.161l-1.45-.353c-.626-.152-1.08-.625-1.278-1.172a6.576 6.576 0 0 0-.248-.6 1.833 1.833 0 0 1 .074-1.734l.776-1.274c.06-.098.036-.186 0-.228a9.774 9.774 0 0 0-.976-.976c-.042-.036-.131-.06-.228 0l-1.275.776a1.831 1.831 0 0 1-1.733.074 6.88 6.88 0 0 0-.6-.249 1.835 1.835 0 0 1-1.173-1.278l-.351-1.45c-.027-.11-.107-.156-.162-.16a9.63 9.63 0 0 0-1.38 0Z"},child:[]}]})(n)}function tje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M14 20.408c-.492.308-.903.546-1.192.709-.153.086-.308.17-.463.252h-.002a.75.75 0 0 1-.686 0 16.709 16.709 0 0 1-.465-.252 31.147 31.147 0 0 1-4.803-3.34C3.8 15.572 1 12.331 1 8.513 1 5.052 3.829 2.5 6.736 2.5 9.03 2.5 10.881 3.726 12 5.605 13.12 3.726 14.97 2.5 17.264 2.5 20.17 2.5 23 5.052 23 8.514c0 3.818-2.801 7.06-5.389 9.262A31.146 31.146 0 0 1 14 20.408Z"},child:[]}]})(n)}function nje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2.5c-3.81 0-6.5 2.743-6.5 6.119 0 1.536.632 2.572 1.425 3.56.172.215.347.422.527.635l.096.112c.21.25.427.508.63.774.404.531.783 1.128.995 1.834a.75.75 0 0 1-1.436.432c-.138-.46-.397-.89-.753-1.357a18.111 18.111 0 0 0-.582-.714l-.092-.11c-.18-.212-.37-.436-.555-.667C4.87 12.016 4 10.651 4 8.618 4 4.363 7.415 1 12 1s8 3.362 8 7.619c0 2.032-.87 3.397-1.755 4.5-.185.23-.375.454-.555.667l-.092.109c-.21.248-.405.481-.582.714-.356.467-.615.898-.753 1.357a.751.751 0 0 1-1.437-.432c.213-.706.592-1.303.997-1.834.202-.266.419-.524.63-.774l.095-.112c.18-.213.355-.42.527-.634.793-.99 1.425-2.025 1.425-3.561C18.5 5.243 15.81 2.5 12 2.5ZM8.75 18h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5Zm.75 3.75a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75Z"},child:[]}]})(n)}function ije(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M0 4.75C0 3.784.784 3 1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25Zm1.75-.25a.25.25 0 0 0-.25.25v14.5c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V4.75a.25.25 0 0 0-.25-.25Z"},child:[]},{tag:"path",attr:{d:"M5 8.75A.75.75 0 0 1 5.75 8h11.5a.75.75 0 0 1 0 1.5H5.75A.75.75 0 0 1 5 8.75Zm0 4a.75.75 0 0 1 .75-.75h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1-.75-.75Z"},child:[]}]})(n)}function rje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12.672.668 3.059 6.197 6.838.993a.75.75 0 0 1 .416 1.28l-4.948 4.823 1.168 6.812a.75.75 0 0 1-1.088.79L12 18.347l-6.116 3.216a.75.75 0 0 1-1.088-.791l1.168-6.811-4.948-4.823a.749.749 0 0 1 .416-1.279l6.838-.994L11.327.668a.75.75 0 0 1 1.345 0Z"},child:[]}]})(n)}function sje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.38 8A9.502 9.502 0 0 1 12 2.5a9.502 9.502 0 0 1 9.215 7.182.75.75 0 1 0 1.456-.364C21.473 4.539 17.15 1 12 1a10.995 10.995 0 0 0-9.5 5.452V4.75a.75.75 0 0 0-1.5 0V8.5a1 1 0 0 0 1 1h3.75a.75.75 0 0 0 0-1.5H3.38Zm-.595 6.318a.75.75 0 0 0-1.455.364C2.527 19.461 6.85 23 12 23c4.052 0 7.592-2.191 9.5-5.451v1.701a.75.75 0 0 0 1.5 0V15.5a1 1 0 0 0-1-1h-3.75a.75.75 0 0 0 0 1.5h2.37A9.502 9.502 0 0 1 12 21.5c-4.446 0-8.181-3.055-9.215-7.182Z"},child:[]}]})(n)}function aje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 1.75V3h5.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H8V1.75C8 .784 8.784 0 9.75 0h4.5C15.216 0 16 .784 16 1.75Zm-6.5 0V3h5V1.75a.25.25 0 0 0-.25-.25h-4.5a.25.25 0 0 0-.25.25ZM4.997 6.178a.75.75 0 1 0-1.493.144L4.916 20.92a1.75 1.75 0 0 0 1.742 1.58h10.684a1.75 1.75 0 0 0 1.742-1.581l1.413-14.597a.75.75 0 0 0-1.494-.144l-1.412 14.596a.25.25 0 0 1-.249.226H6.658a.25.25 0 0 1-.249-.226L4.997 6.178Z"},child:[]},{tag:"path",attr:{d:"M9.206 7.501a.75.75 0 0 1 .793.705l.5 8.5A.75.75 0 1 1 9 16.794l-.5-8.5a.75.75 0 0 1 .705-.793Zm6.293.793A.75.75 0 1 0 14 8.206l-.5 8.5a.75.75 0 0 0 1.498.088l.5-8.5Z"},child:[]}]})(n)}function oje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5.09 10.121A5.251 5.251 0 0 1 1 5V3.75C1 2.784 1.784 2 2.75 2h2.364c.236-.586.81-1 1.48-1h10.812c.67 0 1.244.414 1.48 1h2.489c.966 0 1.75.784 1.75 1.75V5a5.252 5.252 0 0 1-4.219 5.149 7.01 7.01 0 0 1-4.644 5.478l.231 3.003a.5.5 0 0 0 .034.031c.079.065.303.203.836.282.838.124 1.637.81 1.637 1.807v.75h2.25a.75.75 0 0 1 0 1.5H4.75a.75.75 0 0 1 0-1.5H7v-.75c0-.996.8-1.683 1.637-1.807.533-.08.757-.217.836-.282a.5.5 0 0 0 .034-.031l.231-3.003A7.012 7.012 0 0 1 5.09 10.12ZM6.5 2.594V9a5.5 5.5 0 1 0 11 0V2.594a.094.094 0 0 0-.094-.094H6.594a.094.094 0 0 0-.094.094Zm4.717 13.363-.215 2.793-.001.021-.003.043a1.212 1.212 0 0 1-.022.147c-.05.237-.194.567-.553.86-.348.286-.853.5-1.566.605a.478.478 0 0 0-.274.136.264.264 0 0 0-.083.188v.75h7v-.75a.264.264 0 0 0-.083-.188.478.478 0 0 0-.274-.136c-.713-.105-1.218-.32-1.567-.604-.358-.294-.502-.624-.552-.86a1.22 1.22 0 0 1-.025-.19l-.001-.022-.215-2.793a7.069 7.069 0 0 1-1.566 0ZM19 8.578A3.751 3.751 0 0 0 21.625 5V3.75a.25.25 0 0 0-.25-.25H19ZM5 3.5H2.75a.25.25 0 0 0-.25.25V5A3.752 3.752 0 0 0 5 8.537Z"},child:[]}]})(n)}function lje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M1.75 4.5a.25.25 0 0 0-.25.25v.852l10.36 7a.25.25 0 0 0 .28 0l5.69-3.845A.75.75 0 0 1 18.67 10l-5.69 3.845c-.592.4-1.368.4-1.96 0L1.5 7.412V19.25c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25v-8.5a.75.75 0 0 1 1.5 0v8.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25V4.75C0 3.784.784 3 1.75 3h15.5a.75.75 0 0 1 0 1.5H1.75Z"},child:[]},{tag:"path",attr:{d:"M24 5.5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"},child:[]}]})(n)}function cje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.517-7.665c.112-.223.268-.424.488-.57C11.186 8.12 11.506 8 12 8c.384 0 .766.118 1.034.319a.953.953 0 0 1 .403.806c0 .48-.218.81-.62 1.186a9.293 9.293 0 0 1-.409.354 19.8 19.8 0 0 0-.294.249c-.246.213-.524.474-.738.795l-.126.19V13.5a.75.75 0 0 0 1.5 0v-1.12c.09-.1.203-.208.347-.333.063-.055.14-.119.222-.187.166-.14.358-.3.52-.452.536-.5 1.098-1.2 1.098-2.283a2.45 2.45 0 0 0-1.003-2.006C13.37 6.695 12.658 6.5 12 6.5c-.756 0-1.373.191-1.861.517a2.944 2.944 0 0 0-.997 1.148.75.75 0 0 0 1.341.67Z"},child:[]},{tag:"path",attr:{d:"M9.864 1.2a3.61 3.61 0 0 1 4.272 0l1.375 1.01c.274.2.593.333.929.384l1.686.259a3.61 3.61 0 0 1 3.021 3.02l.259 1.687c.051.336.183.655.384.929l1.01 1.375a3.61 3.61 0 0 1 0 4.272l-1.01 1.375a2.106 2.106 0 0 0-.384.929l-.259 1.686a3.61 3.61 0 0 1-3.02 3.021l-1.687.259a2.106 2.106 0 0 0-.929.384l-1.375 1.01a3.61 3.61 0 0 1-4.272 0l-1.375-1.01a2.106 2.106 0 0 0-.929-.384l-1.686-.259a3.61 3.61 0 0 1-3.021-3.02l-.259-1.687a2.106 2.106 0 0 0-.384-.929L1.2 14.136a3.61 3.61 0 0 1 0-4.272l1.01-1.375c.201-.274.333-.593.384-.929l.259-1.686a3.61 3.61 0 0 1 3.02-3.021l1.687-.259c.336-.051.655-.183.929-.384Zm3.384 1.209a2.11 2.11 0 0 0-2.496 0l-1.376 1.01a3.61 3.61 0 0 1-1.589.658l-1.686.258a2.111 2.111 0 0 0-1.766 1.766l-.258 1.686a3.614 3.614 0 0 1-.658 1.59l-1.01 1.375a2.11 2.11 0 0 0 0 2.496l1.01 1.376a3.61 3.61 0 0 1 .658 1.589l.258 1.686a2.11 2.11 0 0 0 1.766 1.765l1.686.26a3.613 3.613 0 0 1 1.59.657l1.375 1.01a2.11 2.11 0 0 0 2.496 0l1.376-1.01a3.61 3.61 0 0 1 1.589-.658l1.686-.258a2.11 2.11 0 0 0 1.765-1.766l.26-1.686a3.613 3.613 0 0 1 .657-1.59l1.01-1.375a2.11 2.11 0 0 0 0-2.496l-1.01-1.376a3.61 3.61 0 0 1-.658-1.589l-.258-1.686a2.111 2.111 0 0 0-1.766-1.766l-1.686-.258a3.614 3.614 0 0 1-1.59-.658Z"},child:[]}]})(n)}function dje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M241.063 54.406c-2.31.008-4.61.032-6.907.094-1.805.05-3.61.106-5.406.188-8.814 1.567-12.884 5.426-15.094 9.843-2.435 4.87-2.34 11.423.375 17.25 2.717 5.83 7.7 10.596 14.657 12.376 6.958 1.78 16.536.86 29.125-7.187l10.063 15.75c-15.818 10.11-31.124 12.777-43.813 9.53-12.688-3.247-22.103-12.123-26.968-22.563-4.584-9.836-5.426-21.376-1.03-31.624-42.917 6.94-81.777 23.398-111.626 46.562-9.81 10.688-10.77 23.11-6.47 31.594 4.83 9.526 16.21 16.48 38.97 9.28l5.656 17.813c-28.58 9.04-52.137-.588-61.28-18.625-2.23-4.397-3.592-9.156-4.127-14.063-4.814 5.712-9.16 11.658-13 17.844l.126.06c-8.614 19.616-8.81 33.203-5.376 42.032 3.436 8.83 10.635 14.44 21.72 17.532 22.168 6.18 58.065-1.277 83.343-20.156 10.82-8.08 21.077-27.677 21.97-42.875.445-7.6-1.165-13.604-4.345-17.438-3.18-3.834-8.272-6.703-18.813-6.594l-.187-18.686c14.487-.15 26.25 4.754 33.375 13.344 7.124 8.59 9.26 19.652 8.625 30.468-1.27 21.633-12.595 44.172-29.438 56.75-29.876 22.314-69.336 31.606-99.53 23.188-13.988-3.9-26.37-12.386-32.75-25.53-9.546 45.446 4.323 87.66 30.718 116.874 3.45 3.82 7.122 7.43 10.97 10.78-2.754-7.887-4.016-16.1-3.72-24.093.53-14.325 6.082-28.346 17.22-38.03 9.134-7.946 21.752-12.53 36.843-12.5 1.006 0 2.034.018 3.062.06 2.35.1 4.763.304 7.22.626l-2.44 18.532c-15.588-2.048-25.705 1.522-32.436 7.375-6.73 5.854-10.443 14.614-10.813 24.625-.74 20.024 12.07 43.406 39.69 50.188l-.032.188c27.192 5.19 57.536.372 88-18.22.018-.012.043-.017.062-.03 6.34-4.45 9.755-8.808 11.438-12.563 1.985-4.432 1.943-8.292.53-12.438-2.824-8.29-12.94-16.812-22.218-19.187-15.002-3.84-24.532 1.436-29 7.72-4.468 6.28-4.74 12.45 2.156 17.81l-11.47 14.75c-14.187-11.033-15.092-30.487-5.905-43.405 6.892-9.688 18.985-16.326 33.564-16.75.607-.018 1.228-.036 1.844-.03 4.306.03 8.79.622 13.437 1.81 15.505 3.97 29.84 15.277 35.28 31.25 1.416 4.155 2.09 8.69 1.876 13.314 16.71-8.538 34.332-16.12 52.282-21.814 30.156-13.78 43.23-37.938 42.72-58.28-.515-20.493-13.187-37.74-42.376-40.626l1.844-18.594c36.666 3.626 58.462 29.848 59.188 58.75.422 16.84-5.754 34.363-18.188 49.28 16.072-1.8 32.044-1.495 47.53 1.627-3.152-6.472-4.68-13.478-4.467-20.438.677-22.036 19.42-42.593 48.875-42.906 1.963-.022 3.974.053 6.03.218l-1.5 18.625c-24.927-1.998-34.3 11.086-34.718 24.656-.412 13.42 8.545 28.442 34.22 30.436 28.3.25 48.588-15.098 58.53-37.906 13.31-30.536 6.997-76.317-34.844-118.188-.792-.793-1.578-1.593-2.375-2.375-.444 3.792-1.424 7.443-2.842 10.844-7.25 17.39-24.233 29.128-41.875 32.407-24.335 4.522-44.29-5.347-53.5-20.406-9.21-15.057-6.792-36.35 9.78-47.56l10.47 15.5c-8.913 6.028-9.28 14.19-4.313 22.31 4.967 8.122 16.17 15.156 34.156 11.814 11.306-2.102 23.896-11.33 28.03-21.25 2.07-4.96 2.47-9.862.408-15.47-1.675-4.555-5.187-9.764-11.72-15.25l-.187-.155c-27.316-20.587-56.338-35.393-85.75-45.157.018.032.045.06.063.093 6.684 12.22 7.18 26.082 3.063 38.344-8.233 24.525-34.07 43.848-66.032 42.78-6.948-.23-13.56 3.12-19.186 9.657-5.627 6.537-9.735 16.113-10.688 26.313-1.905 20.4 6.923 42.886 41.344 54L277 258.28c-41.083-13.264-56.83-45.546-54.22-73.5 1.307-13.975 6.706-26.962 15.157-36.78 8.452-9.818 20.475-16.603 33.97-16.156 24.04.802 42.323-14.084 47.687-30.063 2.682-7.988 2.335-15.937-1.75-23.405-3.968-7.252-11.83-14.423-25.906-19.656-17.114-2.967-34.16-4.367-50.875-4.314zM342.28 306.344c-41.915 3.41-87.366 23.4-125.28 46.562-55.98 34.198-114.89 26.733-156.688-4.28 16.444 58.844 74.712 70.788 135.5 55.905 6.083-2.285 12.06-6.538 17.157-12.03 7.057-7.607 12.17-17.47 13.78-25.625l18.344 3.625c-2.445 12.383-9.078 24.666-18.406 34.72-8.95 9.645-20.61 17.35-34.094 19.374-6.766 15.07-12.334 29.68-14.594 39.906-3.55 16.06 14.206 22.225 22.156 6.03 19.022-38.743 45.87-73.23 79.406-102.967 26.064-17.153 48.406-38.303 62.72-61.22z"},child:[]}]})(n)}function uje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M196.38 16.29l12.018 214.677-69.382-213.75h-19.65l70.52 217.25c-17.16-18.22-34.434-44.74-52.243-80.246 18.864 62.058 35.573 139.067 40.552 192.04L19.38 62.393v38.277l144.89 258.98c-33.493-21.316-67.86-56.375-97.918-92.87 26.712 52.73 55.26 104.847 73.076 160.54L19.378 289.453v28.46l107.997 124.026C99 434.69 70.625 422.05 42.25 408.165c38.03 26.607 62.036 50.897 84.234 85.82H230.84l-6.785-91.082H197.77c0-44.845 2.87-108.728 40.767-115.86-6.993-8.433-11.533-20.27-11.533-33.523 0-23.93 14.228-43.758 32.45-46.127h.005c.303-.038.61-.056.923-.063.934-.02 1.895.063 2.83.063 19.957 0 36.205 20.602 36.205 46.128 0 12.928-4.304 24.595-10.996 32.99 41.4 6.42 40.496 71.424 40.496 116.394h-24.94l-6.003 91.082h90.96c19.418-30.77 60.864-56.727 96.524-75.234-38.585 10.67-75.927 17.602-109.66 21.02l117.97-86.97v-23.218l-125.78 92.728c24.4-49.363 55.902-88.075 90.164-122.648-40.56 27.323-73.25 37.7-107.027 43.785L493.77 158.7v-30.58L339.297 328.19c1.19-51.24 16.946-114.427 39.156-171.047-17.383 25.054-33.876 46.073-49.713 62.742l56.406-202.668h-19.398l-53.412 191.906 3.832-192.834h-119.79z"},child:[]}]})(n)}function hje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M115.703 19.684C74.03 56.01 47.746 108.598 47.746 167.047c0 59.615 27.327 113.03 70.47 149.428-2.24-9.474-3.615-19.306-4.03-29.4-29.71-31.86-47.75-73.932-47.75-120.028 0-60.944 31.49-114.743 79.876-147.363h-30.61zm245.98 0c48.38 32.614 79.874 86.417 79.874 147.363 0 44.114-16.52 84.543-43.98 115.863-.15 10.162-1.272 20.075-3.272 29.645 40.52-36.26 65.94-88.003 65.94-145.508 0-58.446-26.263-111.034-67.93-147.363h-30.633zM259.616 21.13c-1.22.046-2.1.16-2.627.16-22.966 0-42.474 13.933-54.28 34.743 5.434-2.258 11.378-3.512 17.602-3.512 2.635 0 5.216.238 7.733.667 8.205-8.343 18.363-13.208 28.945-13.208 2.87 0 4.478-.11 4.53-.103l.09.014.09.012c8.883 1.155 17.385 5.918 24.452 13.31 2.568-.448 5.204-.69 7.895-.69 6.14 0 12.004 1.224 17.377 3.423-10.47-18.69-27.132-31.908-47.215-34.556-1.847-.27-3.393-.303-4.593-.26zm-58.758.925C139.302 43.72 95.366 100.54 95.366 167.23c0 26.838 7.12 52.075 19.633 74.07 4.785-43.393 27.372-81.088 59.895-104.857-4.985-11.973-7.76-25.238-7.76-39.2 0-30.428 13.17-57.555 33.724-75.188zm112.966.884c19.968 17.648 32.7 44.38 32.7 74.304 0 14.4-2.955 28.06-8.24 40.324 31.91 23.98 53.94 61.508 58.454 104.57 12.815-22.19 20.12-47.727 20.12-74.908 0-65.8-42.768-121.992-103.034-144.29zm-93.514 48.27c-15.31 0-27.52 12.21-27.52 27.522 0 15.31 12.21 27.522 27.52 27.522 15.31 0 27.524-12.21 27.524-27.522 0-15.31-12.213-27.523-27.524-27.523zm73.735 0c-15.31 0-27.522 12.21-27.522 27.522 0 15.31 12.21 27.522 27.522 27.522 15.31 0 27.523-12.21 27.523-27.522 0-15.31-12.212-27.523-27.523-27.523zm-96.818 67.495c1.458 3.72 3.135 7.29 5.014 10.688-28.76 10.036-47.118 36.23-56.088 67.806-10.313 36.304-9.78 80.714-1.82 123.044l1.432 7.617h38.28l.354 5.406.04 4.084.23-.002 9.09 137.91h122.584l10.408-139.71.385.003.038-5.708.148-1.98h40.32l1.543-7.446c9.072-43.706 8.052-87.865-3.38-123.508-9.866-30.763-28.282-55.794-54.945-66.185 2.144-3.686 4.042-7.593 5.68-11.678-6.67 3.75-14.344 5.898-22.498 5.898-.516 0-1.025-.03-1.537-.047-1.22 1.83-2.504 3.576-3.858 5.21l-10.125 12.212 15.59 2.934c25.758 4.847 43.76 25.75 53.9 57.363 9.523 29.697 11.076 68.077 4.198 106.557h-24.893l.64-91.475-18.687-.13-.78 111.488L299 476.568h-33.332V342.19H246.98V476.57h-35.72l-8.174-124.025-1.133-115.002-18.69.185.903 91.447h-22.713c-6.188-37.77-5.89-76.687 2.682-106.865 9.15-32.208 26.076-53.426 54.59-57.848l15.91-2.47L224.6 149.4c-1.133-1.42-2.22-2.92-3.256-4.488-.345.008-.685.03-1.03.03-8.396 0-16.28-2.28-23.085-6.237z"},child:[]}]})(n)}function fje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M272.95 16.707c-151.29 47.714 57.322 110.88-26.536 131.344C190.7 161.648 137.3 96.283 192.947 45.313c-90.766 32.524-66.292 89.67-12.396 113.25 34.31 15.01 31.884 61.38 8.643 64.637 46.37-54.285-116.637-44.737-86.03-147.47-126.44 158.063 132.535 163.37 51.6 273.194 16.4-51.26-51.074-33.42-65.52-77.88-48.557 115.975 86.87 96.047 107.81 222.95h36.394l-7.375-108.703H196.93c0-49.724 3.178-108.336 45.2-116.245-7.75-9.352-12.786-24.51-12.786-39.207 0-26.536 15.774-48.523 35.98-51.15h.002c1.348-.17 2.78 0 4.164 0 22.13 0 40.145 22.846 40.145 51.15 0 14.334-4.772 29.304-12.192 38.613 45.905 7.12 44.903 66.976 44.903 116.84H314.69l-6.524 108.704h36.752c14.29-138.24 137.056-121.245 77.576-235.742 9.728 46.034-32.646 93.67-53.514 52.13-19.04-37.903 125.515-105.092 70.21-215.175 4.588 81.484-114.155 120.303-118.663 65.824 52.768 23.022 73.61-45.905 30.02-71.985-40.69-24.346-116.444-36.76-77.596-72.338zm69.488 20.635c44.895 15.685 63.888 78.675 48.73 110.674 18.238-3.568 70.807-106.98-48.73-110.674z"},child:[]}]})(n)}function pje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M250.9 18.9c-23.9 2.99-45.3 30.65-45.3 66.99 0 19.91 6.8 37.41 16.8 49.61l12.2 14.5-18.7 3.5c-13 2.5-22.6 9.5-30.7 20.8-8.5 11.5-14.8 26.9-19.1 45.2-8 32.7-9.9 72.7-9.9 108.2h43.6l11.7 160.5c30.4 7 63.1 6.5 92.3 0l10.7-160.5H356c0-35.7-.5-76.4-7.8-109.7-3.9-17.9-10-33.7-18.2-45.1-8.2-11.1-18.5-17.8-33.3-20.1l-18.9-3 11.9-14.9c9.9-12.1 16.4-29.6 16.4-49.01 0-38.54-24-66.99-50.3-66.99h-4.9zm145 3.59v41.85h-41.8v50.16h41.8v41.6h49.9v-41.6h41.9V64.34h-41.9V22.49h-49.9zM52.92 62.89v30.58H22.39v36.63h30.53v30.4h36.4v-30.4h30.58V93.47H89.32V62.89h-36.4zM92.63 199.7v21.8H70.75v26.3h21.88v21.9h26.27v-21.9h21.8v-26.3h-21.8v-21.8H92.63zm355.07 62.4v21.8h-21.9v26.3h21.9v21.9H474v-21.9h21.8v-26.3H474v-21.8h-26.3zm-307.5 99.4v15h-15v18h15v15h18.1v-15h15v-18h-15v-15h-18.1zm230 45.8v15h-15v18h15v15h18v-15h15v-18h-15v-15h-18zM49.32 431.8v15h-15v18h15v15h18.01v-15h15v-18h-15v-15H49.32z"},child:[]}]})(n)}function mje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M54.53 118.73c-15.623 74.884 20.42 123.6 64.126 150.56-33.063-7.81-65.052-19.483-98.25-36.845 25.5 77.488 81.165 95.816 129.906 90.75-26.933 14.252-55.392 25.302-83.937 32.782 69.446 43.143 120.11 16.458 148.27-21.317a586.15 586.15 0 0 0-6.217-5.498c-5.193-3.697-10.128-7.95-14.778-12.71-5.968-5.095-12.045-10.295-18.173-15.73-33.648-29.837-67.978-65.614-69.43-112.83-.002-.05 0-.1-.002-.15-19.147-22.057-36.472-45.304-51.514-69.013zm402.94 0c-15.04 23.705-32.368 46.943-51.515 68.993 0 .026.003.05.004.078 1.388 45.967-33.476 82.66-67.968 113.386-13.87 12.355-27.86 23.824-39.904 34.44 28.298 37.26 78.683 63.125 147.54 20.35-28.543-7.48-56.98-18.53-83.91-32.78 48.737 5.056 104.38-13.28 129.876-90.75-33.197 17.363-65.187 29.036-98.25 36.845 43.705-26.962 79.75-75.675 64.125-150.56zm-132.42 3.977c-22.146.17-45.395 11.85-61.025 38.36l-7.783 13.2-7.736-13.228c-19.473-33.286-54.394-43.623-82.15-35.75h-.01c-24.486 6.947-43.386 26.957-42.307 62.048 1.187 38.61 30.602 70.852 63.38 99.918 16.39 14.533 33.36 28.123 47.412 41.52 8.357 7.968 15.777 15.842 21.332 24.142 5.568-7.718 12.923-15.143 21.217-22.86 14.382-13.384 31.856-27.363 48.64-42.314 33.567-29.9 63.045-63.115 61.95-99.398-1.118-36.974-22.723-58.38-48.618-64.127a63.71 63.71 0 0 0-14.303-1.513z"},child:[]}]})(n)}function gje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480.25 156.355c0 161.24-224.25 324.43-224.25 324.43S31.75 317.595 31.75 156.355c0-91.41 70.63-125.13 107.77-125.13 77.65 0 116.48 65.72 116.48 65.72s38.83-65.73 116.48-65.73c37.14.01 107.77 33.72 107.77 125.14z"},child:[]}]})(n)}function vje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M262.82 18.514c-1.538-.042-3.118.125-4.656.125-32.843 0-59.586 33.905-59.586 75.917 0 21.273 7.083 40.47 18.096 54.287-7.947 1.232-15.16 3.625-21.688 7.004l-.066-.465c-21.085 10.394-34.678 31.075-42.815 58.777-4.388 14.94-6.894 31.782-7.736 49.553-.034.657-.06 1.32-.087 1.978-.037.938-.092 1.866-.12 2.808l.013-.016c-.013.397-.022.795-.033 1.192l-.014-.004c-.01.333-.01.67-.017 1.004-.565 22.66 1.55 46.508 5.914 69.724h23.56L172.57 237.02l1.785-1.98 16.883-.165 1.248 126.938 8.74 132.626h46.895V318.847h18.69v175.59h44.32l11.475-154.04h.055l1.035-105.523 15.606.154 3.05 3.376-1 101.992h24.51c16.256-78.303.03-158.175-47.17-183.627l-.13-.073v.002c-6.087-3.265-12.68-5.636-19.79-6.973 11.508-13.88 18.98-33.36 18.98-55.17 0-39.388-23.415-72.02-53.406-75.918h-.002c-.5-.076-1.01-.112-1.522-.126zm-138.877.062l21.733 94.787 26.586 34.713c5.16-4.086 10.777-7.594 16.855-10.437-5.548-13.12-8.664-27.926-8.664-43.45 0-1.243.037-2.476.076-3.71l-56.587-71.904zm265.782 0l-53.29 67.72c.18 2.61.29 5.237.29 7.893 0 16.542-3.534 32.27-9.786 46.005 4.808 2.61 9.335 5.635 13.568 9.05l27.484-35.886 21.733-94.784zM64.037 81.902l46.19 76.31 37.8 18.202c3.21-5.437 6.79-10.53 10.748-15.215l-32.15-41.975-62.588-37.323zm385.594 0l-62.59 37.325-33.08 43.19c3.828 4.506 7.336 9.376 10.52 14.556l38.96-18.762 46.19-76.308zm-420.86 78.46l53.515 42.034 51.88 6.526.01-.027c1.59-5.413 3.44-10.67 5.54-15.74L93.58 170.936 28.77 160.36zm456.128 0l-64.814 10.577-46.938 22.603c2.152 4.86 4.08 9.896 5.776 15.074.04.12.076.243.115.363l52.346-6.584 53.515-42.035zM80.305 220.98l-59.866 11.48 76.238 27.143 28.87 4.44c.554-12.688 1.93-25.047 4.212-36.84l-49.455-6.223zm353.058 0l-49.36 6.21c2.63 11.738 4.363 24.043 5.257 36.677l27.734-4.266 76.236-27.143-59.867-11.478zm-339.418 57.11l-74.814 52.72 87.286-.964 20.588-18.703c-.95-9.458-1.526-18.897-1.693-28.23l-31.365-4.823zm325.778 0l-29.746 4.574c.063 10.024-.368 20.174-1.262 30.342l18.537 16.84 87.285.964-74.814-52.72zm-334.01 78.01l-51.61 58.302 75.004-20.424 22.9-37.56-46.294-.318zm341.746 0l-46.294.318 22.898 37.56 75.004 20.424-51.61-58.302zM159.49 400.455L121.346 419.7l-11.664 69.577 50.79-48.36-.98-40.462zm194.186 0l-.977 40.46 50.788 48.362-11.664-69.578-38.146-19.245z"},child:[]}]})(n)}function yje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M51.34 23.63l-6.68 16.72 80.04 32.01 6.6-16.72-79.96-32.01zm409.36.01l-80 32 6.6 16.72 80-32-6.6-16.72zM256 25c-29 0-50 14.08-64.7 34.29C176.6 79.51 169 106 169 128c0 13 7 27.8 14.5 39s14.9 18.6 14.9 18.6l1.5 1.5 9.3 27.9H228L194.7 98.07 256 118.5l61.3-20.43L284 215h18.8l9.3-27.9 1.5-1.5s7.4-7.4 14.9-18.6c7.5-11.2 14.5-26 14.5-39 0-22-7.6-48.49-22.3-68.71C306 39.08 285 25 256 25zm128 94v18h96v-18h-96zm-352 .1v18h96v-18H32zm189.3 6.8l25.5 89.1h18.4l25.5-89.1-34.7 11.6-34.7-11.6zm166 57.7l-6.6 16.8 80 32 6.6-16.8-80-32zm-262.6.1l-80.04 32 6.68 16.8 79.96-32-6.6-16.8zM217 233v14h78v-14h-78zm0 32v14h78v-14h-78zm-46.9 2.6c-27.1.5-52.6 5-66.9 11.1L29.8 484.1c71.1-14.1 143.9-26 217.2-.9V297h-48v-28.3c-7.9-.7-16-1.1-23.9-1.1h-5zm166.8 0c-7.9 0-16 .4-23.9 1.1V297h-48v186.2c73.3-25.1 146.1-13.2 217.2.9l-73.4-205.4c-14.3-6.1-39.8-10.6-66.9-11.1h-5z"},child:[]}]})(n)}function _je(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M282.063 20.938c-18.876 0-33.875 15.56-33.875 34.437 0 18.877 15 33.875 33.875 33.875s33.875-14.998 33.875-33.875c0-18.875-15-34.438-33.875-34.438zM129.905 82.094c-18.875 0-33.875 15.59-33.875 34.47 0 18.876 15 33.874 33.876 33.874 18.875 0 33.875-14.998 33.875-33.875 0-18.876-15-34.47-33.874-34.47zm284.281 22.656c-18.875 0-33.875 15.59-33.875 34.47 0 18.876 15 33.874 33.875 33.874 18.876 0 33.875-14.998 33.875-33.875 0-18.877-15-34.47-33.875-34.47zm-162.25 57.563c-3.24-.003-6.51.42-9.718 1.28-25.657 6.875-39.12 39.755-30.095 73.438 3.502 13.072 9.883 24.315 17.875 32.814-19.225 4.532-34.137 13.467-40.5 24.5l-.406-.094-41.594 64.438-50.688-21.938c-29.376-16.12-61.575 24-30.624 41.688l94.468 44.062 38.03-50.063c21.493 38.735 15.748 77.484-25.124 116.25H342.75c-39.82-38.2-42.438-76.424-23.28-114.625l36.81 48.438 94.47-44.063c11.635-6.65 14.334-16.47 11.625-25.28-8.184 5.26-17.915 8.343-28.344 8.343-14.224 0-27.118-5.72-36.592-14.938l-28 12.125-41.594-64.437h-.03c-5.48-9.417-17.226-17.278-32.533-22.188 11.58-14.222 15.924-36.9 9.75-59.937-7.896-29.473-30.4-49.798-53.092-49.813zm-164.125 61.03c-18.875 0-33.874 15.56-33.874 34.438 0 18.88 15 33.876 33.874 33.876 18.876 0 33.876-14.997 33.876-33.875 0-18.874-15-34.436-33.876-34.436zm346.22 51.126c-18.876 0-33.876 15.59-33.876 34.467 0 18.878 15 33.875 33.875 33.875 18.876 0 33.876-14.997 33.876-33.875 0-18.875-15-34.468-33.875-34.468z"},child:[]}]})(n)}function Eje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M263.375 19.375c-11.768 0-22.676 6.137-31.156 17.22-7.267 9.494-12.397 22.54-13.72 37.25 11.14-4.926 22.473-7.91 33.813-9V83.25c-10.965 1.377-22.008 5.008-33.157 11.03 1.968 12.487 6.703 23.502 13.063 31.814 8.48 11.082 19.387 17.22 31.155 17.22s22.707-6.138 31.188-17.22c6.167-8.06 10.783-18.667 12.843-30.688-12.07-6.832-24.194-10.997-36.406-12.344V64.75c12.676 1.087 25.22 4.516 37.344 10.188-1.155-15.158-6.336-28.614-13.78-38.344-8.482-11.082-19.42-17.22-31.19-17.22zm-46.594 117.25c-10.442 4.8-18.39 11.182-22.593 18.47l-.375-.095-41.625 64.438-50.656-21.97c-29.375-16.118-61.574 24-30.624 41.688l94.47 44.063 38.03-50.064c18.7 33.703 16.77 67.43-10.97 101.156-8.344-.642-16.37-.958-23.967-.906-40.312.278-68.942 10.254-73.907 28.78l.03.002c-4.44 16.58 10.992 36.67 39.126 55.28 55.675 29.297 95.38 38.468 156.968 42.344h1.562l.438.125c.424.026.823.07 1.25.094l-.032.314 92.063 28.72-22.19-53.72L183.595 375.5l5.875-17.72 71.81 23.845 71.845-23.844L339 375.5l-48.094 15.97 94.438 31.374c33.494-20.046 52.528-42.468 47.656-60.656-5.95-22.21-45.925-32.107-99.25-27.782-26.392-33.215-26.196-66.41-9.53-99.625L361 283.22l94.47-44.064c30.95-17.687-1.25-57.806-30.626-41.687l-50.688 21.968L332.562 155h-.062c-4.217-7.246-12.135-13.596-22.53-18.375-.2.27-.392.547-.595.813-11.268 14.725-27.633 24.562-46 24.562s-34.732-9.837-46-24.563c-.203-.265-.394-.543-.594-.812zm-63.686 311l-16.72 40.5 69.876-21.78c-17.624-4.574-34.93-10.634-53.156-18.72z"},child:[]}]})(n)}function wje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 28l-32 128c-32-16-64-48-96-96 0 48 0 96 32 128-32 17-64 0-96-32 0 32 0 80 48 112-32 16-64 0-80-32 0 48 16 96 48 128-16 16-48 0-64-16 0 64 48 112 112 144h76.8l16.7-68.6-17.2-86.1-97.9 5s20.3-75.2 34.9-103.7c5-9.6 7.2-18 20-18.3 11.3 0 20.4 9.8 20.4 21.9 0 12-9.1 21.8-20.4 21.8-2.3 0-4.6-.5-6.6-1.3l-5.1 46.8c29.6-8.9 56.9-18.8 84-30.9 0-.1-.1-.2-.1-.3-6.2-8.8-10.4-21.5-10.4-35.7 0-14.1 4.1-26.8 10.4-35.7 6.1-8.9 14.1-13.7 22.5-13.7 8.5 0 16.5 4.8 22.6 13.7 6.2 8.9 10.2 21.6 10.2 35.7 0 14.2-4 26.9-10.2 35.7-.1.3-.5.7-.6.9 27.3 12.1 56.1 20.6 84.3 30.3l-5-46.8c-2.2.8-4.3 1.3-6.7 1.3-11.2 0-20.3-9.8-20.3-21.8 0-12.1 9.1-21.9 20.3-21.9 12.8.3 15.2 8.7 20 18.3 14.8 28.5 35 103.7 35 103.7l-97.9-5-17.2 86.1 16.7 68.6H384c64-32 112-80 112-144-16 16-48 32-64 16 32-32 48-80 48-128-16 32-48 48-80 32 48-32 48-80 48-112-32 32-64 48-96 32 32-32 32-80 32-128-32 48-64 80-96 96z"},child:[]}]})(n)}function Sje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M206.28 20.75l40.75 18.406v95.625l11 17.907 12.75-17.906V39.157l40.75-18.406H206.28zm-81.874 32.28L49.97 127.438l41.843-15.78 67.624 67.624 21.657 3.657-4.875-20.468-67.626-67.595 15.812-41.844zm264.281 0l15.782 41.845-67.626 67.594-4.875 20.468 21.686-3.657 67.594-67.624 41.844 15.78-74.406-74.405zM258.281 167.47c-18.774 0-35.987 9.647-49 26.28-13.01 16.633-21.374 40.158-21.374 66.313 0 27.096 9.278 51.387 23.188 68.156l10.125 12.217-15.595 2.938c-39.857 7.504-58.408 22.664-69.28 48.25-10.143 23.866-12.33 58.635-12.595 103.094h270.406c-.04-44.852-.605-80.457-9.812-104.626-9.865-25.894-27.82-41.064-71.28-47.906l-15.845-2.5 10-12.563c13.226-16.583 21.436-40.478 21.436-67.063 0-26.153-8.363-49.68-21.375-66.312-13.01-16.633-30.224-26.28-49-26.28zM35.407 206.78V312l18.438-40.75h95.594l17.906-12.72-17.906-11H53.844l-18.438-40.75zm446.97 0l-18.407 40.75h-95.626l-17.906 11 17.906 12.72h95.625L482.374 312V206.78z"},child:[]}]})(n)}function bje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M253.813 15.625c-132.32 0-239.782 107.46-239.782 239.78s107.463 239.782 239.782 239.782c132.32 0 239.782-107.46 239.782-239.78S386.132 15.624 253.814 15.624zm0 17.906c122.653 0 221.906 99.223 221.906 221.876 0 30.738-6.26 59.99-17.533 86.594l-42.343-34.72c-49.613 13.98-110.337 9.033-138.906-60.874l-41.97 152.938c-8.837-45.53-23.35-81.28-47.905-115.22-19.71 13.855-32.352 32.63-39.72 50.97L88.94 237.03c-17.85 27.32-33.77 56.565-45.032 90.47-7.744-22.6-11.968-46.852-11.968-72.094 0-26.013 4.484-50.973 12.687-74.156 2.752 6.608 9.27 11.25 16.875 11.25 10.093 0 18.28-8.157 18.28-18.25s-8.187-18.28-18.28-18.28c-2.385 0-4.66.48-6.75 1.31 27.537-55.83 77.83-98.368 138.844-115.5-.558 1.938-.844 3.98-.844 6.095 0 12.146 9.823 22 21.97 22 12.144 0 22-9.854 22-22 0-4.99-1.67-9.59-4.47-13.28 7.092-.683 14.29-1.064 21.563-1.064zm18.75 27.657c-6.444 0-11.657 5.213-11.657 11.657 0 6.443 5.213 11.687 11.656 11.687 6.444 0 11.688-5.243 11.688-11.686 0-6.444-5.244-11.656-11.688-11.656zM198.03 90.22c-6.02.06-12.132.868-18.218 2.5-38.945 10.434-62.06 50.46-51.625 89.405 10.436 38.946 50.463 62.06 89.407 51.625 21.712-5.818 38.48-20.85 47.28-39.75-6.835 7.36-15.737 12.958-26.155 15.75-29.504 7.905-59.846-9.59-67.75-39.094-7.907-29.504 9.62-59.813 39.124-67.72 10.41-2.788 20.906-2.417 30.5.533-12.28-8.598-27.116-13.405-42.563-13.25zm155.282.81c-9.408 0-17.03 7.624-17.03 17.032 0 9.41 7.622 17.032 17.03 17.032 9.41 0 17.032-7.623 17.032-17.03 0-9.41-7.623-17.033-17.03-17.033zm-248.937 27.376c-6.443 0-11.656 5.244-11.656 11.688 0 6.443 5.212 11.656 11.655 11.656s11.656-5.213 11.656-11.656c0-6.444-5.212-11.688-11.655-11.688zm275.688 40.813l-.625 29.843-28.22 9.812 28.22 9.813.625 29.843 18.03-23.78 28.563 8.625-17.03-24.5 17.03-24.53L398.094 183l-18.03-23.78zm-72.094 11.593c-6.445 0-11.658 5.212-11.658 11.656 0 6.442 5.213 11.686 11.657 11.686 6.442 0 11.686-5.244 11.686-11.687 0-6.445-5.244-11.657-11.687-11.657zm139 74.75c-6.445 0-11.658 5.244-11.658 11.687s5.213 11.656 11.657 11.656c6.442 0 11.686-5.213 11.686-11.656 0-6.443-5.244-11.688-11.687-11.688zm-127.314 3.5c-6.443 0-11.656 5.244-11.656 11.687s5.213 11.656 11.656 11.656c6.444 0 11.656-5.213 11.656-11.656 0-6.443-5.212-11.688-11.656-11.688z"},child:[]}]})(n)}function Cje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M294.8 26.57L238 60.37l7.8 13.17L281 52.59 270.8 118l6.3 10.6L336 93.53l-7.8-13.17-37.3 22.14L301 37.12l-6.2-10.55zM147.1 60.55A224 224 0 0 0 32 256a224 224 0 0 0 224 224 224 224 0 0 0 214.9-161.2A208 208 0 0 1 320 384a208 208 0 0 1-208-208 208 208 0 0 1 35.1-115.45zm244.5 52.05l-6.9 16.5 44.1 18.4-68.3 35.9-5.5 13.2 73.7 30.8 6.9-16.5-46.7-19.5 68.3-35.9 5.5-13.2-71.1-29.7zm-115 64l-97.8 35 8.1 22.7 60.6-21.7-35.4 97.9 6.5 18.1L320 292.4l-8.1-22.7-64.2 23 35.4-97.9-6.5-18.2z"},child:[]}]})(n)}function Tje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256.25 20.656c-32.78 0-64.03 6.79-92.438 19-8.182-10.618-20.994-17.468-35.437-17.468-24.716 0-44.78 20.033-44.78 44.75 0 8.356 2.324 16.18 6.31 22.874-42.638 42.655-69.093 101.49-69.093 166.282 0 129.617 105.823 234.72 235.438 234.72 129.615-.002 234.72-105.103 234.72-234.72 0-129.618-105.105-235.438-234.72-235.438zm0 19.313c119.515 0 216.094 96.607 216.094 216.124s-96.58 216.094-216.094 216.094c-119.515 0-216.813-96.577-216.813-216.094 0-59.568 24.176-113.438 63.22-152.5 7.273 5.113 16.15 8.094 25.718 8.094 24.716 0 44.75-20.034 44.75-44.75 0-3.453-.385-6.804-1.125-10.032C197.91 46 226.396 39.97 256.25 39.97zm-.125 51.81c-91.3 0-165.875 74.575-165.875 165.876 0 91.3 74.576 165.406 165.875 165.406 35.12 0 67.708-10.965 94.5-29.656 7.13 4.23 15.45 6.656 24.344 6.656 26.396 0 47.81-21.384 47.81-47.78 0-12.763-5.005-24.366-13.155-32.938 7.677-19.067 11.906-39.884 11.906-61.688 0-91.3-74.106-165.875-165.405-165.875zm0 19.126c81.2 0 146.78 65.55 146.78 146.75 0 17.833-3.172 34.924-8.967 50.72-5.81-2.513-12.237-3.907-18.97-3.907-26.396 0-47.78 21.414-47.78 47.81 0 10.59 3.454 20.362 9.28 28.283-23.065 15.084-50.66 23.843-80.343 23.843-81.2 0-147.22-65.55-147.22-146.75s66.02-146.75 147.22-146.75zm-1.063 19.625c-7.462 31.99-21.767 62.112-42.906 83.25-21.14 21.14-48.73 32.913-80.72 40.376 31.99 7.462 62.112 21.736 83.25 42.875 21.14 21.14 32.914 48.764 40.376 80.75 7.463-31.986 19.204-59.61 40.344-80.75 21.14-21.138 51.262-35.412 83.25-42.874-32.236-7.428-59.455-19.11-80.72-40.375-21.262-21.263-35.446-51.013-42.873-83.25zm.094 86.564c20.498 0 37.125 16.627 37.125 37.125 0 20.496-16.626 37.124-37.124 37.124-20.497 0-37.125-16.628-37.125-37.125 0-20.5 16.63-37.126 37.126-37.126z"},child:[]}]})(n)}function Rje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M122.7 23.32l1.7 21.87-16.7 14.25 21.4 5.17 8.4 20.25L149 66.18l21.8-1.75-14.2-16.71 5.1-21.32-20.3 8.35-18.7-11.43zM464 32a16 16 0 0 0-16 16 16 16 0 0 0 16 16 16 16 0 0 0 16-16 16 16 0 0 0-16-16zM239.8 42.5a16 16 0 0 0-16 16 16 16 0 0 0 16 16 16 16 0 0 0 16-16 16 16 0 0 0-16-16zm183.9 6.84c-9.2 1.74-17.7 7.18-25.9 14.28-7.6 6.53-14.7 14.66-20.7 23.45-18.8 3.01-37.6 10.67-50.2 21.13-16.1 13.2-30.4 35.8-38.2 59.1-7.4 3.1-14.4 6.8-20.1 10.8-15.5 10.9-23.5 31.8-29.4 50-5.9 18.3-8.8 34.3-8.8 34.3l17.8 3.2s2.7-15 8.1-31.9c5.5-16.9 14.8-35.3 22.7-40.8 1.3-.9 3-1.9 4.5-2.8-.6 5.7-.6 11.4.3 16.8 1.8 11.4 8 22.3 19 28.2 7.8 4.2 16.6 3.2 24 .2 7.4-3.1 14-8.2 19.7-14.2 5.7-6 10.4-13.1 13.2-20.6 2.8-7.5 3.8-16 .2-23.9h-.1c-3.9-8.4-11.4-13.8-19.4-16.1-8-2.3-16.6-2.2-25.2-.9-1.5.2-2.9.7-4.4 1 7.4-15.8 18-30.7 27.5-38.6 6.2-5.1 16.6-10 27.7-13.6-1.4 3.8-2.5 7.6-3 11.5-1.6 10.5.7 21.9 9.1 29.7 6.1 5.6 14.3 6.5 21.5 5.3 7.1-1.2 14-4.4 20.2-8.5 6.2-4.2 11.7-9.4 15.6-15.5 3.9-6.1 6.5-13.9 4-21.7v-.1c-3.3-10.07-11.5-16.99-20.6-20.27-3.9-1.4-8-2.19-12.2-2.66 2.9-3.26 5.9-6.31 8.9-8.92 6.8-5.84 13.7-9.5 17.6-10.23l-3.4-17.68zM174.8 84.39l-15.2 9.56 34.5 55.25-56.4 2.9 26.5 57.8 16.4-7.6-15.5-33.6 60.6-3.1-50.9-81.21zm216.4 19.31c6.1-.1 11.5.6 15.5 2.1 5.4 1.9 8.1 4.3 9.5 8.8.4 1.1.2 3.3-1.9 6.6-2.2 3.4-6.1 7.2-10.5 10.2-4.5 3-9.5 5.1-13.2 5.7-3.8.7-5.5 0-6.3-.7-3.5-3.2-4.5-7.2-3.5-13.9.8-5.4 3.3-11.9 7-18.6 1.2 0 2.3-.2 3.4-.2zM94.99 123a16 16 0 0 0-16 16 16 16 0 0 0 16 16A16 16 0 0 0 111 139a16 16 0 0 0-16.01-16zm356.11 37.2l-14.4 16.6-21.8-1.8 11.4 18.8-8.5 20.2 21.4-5 16.6 14.3 1.9-21.9 18.7-11.4-20.2-8.5-5.1-21.3zm-123.5 16.5c2.9.1 5.6.5 7.7 1.1 4.3 1.2 6.6 3 8.2 6.4.9 1.9 1 5.4-.7 10-1.7 4.7-5.2 10.1-9.4 14.6s-9.3 8.1-13.5 9.8c-4.2 1.7-6.8 1.6-8.5.7h-.1c-5.8-3.2-8.6-7.8-9.7-15.2-1-6.3-.3-14.3 1.8-22.9 4.9-1.7 9.8-3.1 14.5-3.8 3.5-.5 6.7-.7 9.7-.7zm-202.4 51.9c-7.2-.2-11.7 1.5-14.5 4.3-2.8 2.8-4.5 7.3-4.3 14.5.2 7.3 2.6 16.9 7.2 27.6 9.2 21.5 27.3 47.4 51.6 71.8 24.3 24.3 50.3 42.3 71.8 51.5 10.6 4.6 20.2 7 27.5 7.2 7.3.3 11.7-1.5 14.5-4.3 2.8-2.8 4.6-7.2 4.3-14.5-.2-7.3-2.6-16.9-7.2-27.6-9.2-21.4-27.2-47.4-51.5-71.7-24.3-24.4-50.3-42.4-71.8-51.6-10.7-4.6-20.3-7-27.6-7.2zm232 31.3l-33 54-29.1-27.9-12.4 13 45.1 43.3 33.8-55.2 38.7 32.3 89.3-38.2-7-16.6-79.3 34-46.1-38.7zM93.43 272.6l-17.64 57.9c41.41 49.1 89.71 76.7 142.11 94.7l21.6-6.6c-3.1-1.1-6.4-2.4-9.7-3.8-24.4-10.4-51.7-29.6-77.3-55.3-25.7-25.7-44.9-53-55.34-77.4-1.41-3.2-2.65-6.4-3.73-9.5zm-23.82 78.2l-14.01 46c28.89 27 59 39.2 90.6 50.2l43.4-13.2c-43.2-17.6-84-43.3-119.99-83zM368 352a16 16 0 0 0-16 16 16 16 0 0 0 16 16 16 16 0 0 0 16-16 16 16 0 0 0-16-16zM49.81 415.9l-20.29 66.6 88.28-26.9c-22.77-9.1-45.78-20.7-67.99-39.7z"},child:[]}]})(n)}function xje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M486 203.652H310.111L256 37.113l-54.111 166.539H26l142.22 103.623-54.462 167.612L256 371.24l142.242 103.646-54.473-167.612zm-85.995 28.008l-65.335 47.596-15.46-47.596h80.795zM256 127.708l24.658 75.91H231.33zM111.995 231.66h80.795l-15.45 47.596zm55.097 169.713l24.932-76.743 40.194 29.29zm34.041-104.762l21.1-64.951h67.524l21.099 64.95-54.867 39.977zm143.731 104.762l-65.082-47.454 40.194-29.29zm-37.983-264.359l-10.424-32.092a183.269 183.269 0 0 1 114.322 81.21H376.43a155.293 155.293 0 0 0-69.55-49.118zM129 371.328l-10.413 32.049a182.425 182.425 0 0 1-43.918-142.581l26.684 19.435v2.847A153.804 153.804 0 0 0 129 371.284zm177.104 58.108l26.64 19.413a182.447 182.447 0 0 1-153.51 0l26.64-19.413a154.79 154.79 0 0 0 100.23 0zM135.569 186.133h-34.348a183.269 183.269 0 0 1 114.322-81.21l-10.424 32.091a155.293 155.293 0 0 0-69.55 49.119zm303.12 96.955a181.922 181.922 0 0 1-45.276 120.245L383 371.285a153.804 153.804 0 0 0 27.68-88.197v-2.846l26.683-19.446a183.685 183.685 0 0 1 1.325 22.292z"},child:[]}]})(n)}function Aje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M255.9 19.77C241.5 109.6 229.4 163 196.2 196.2c-33.2 33.2-86.6 45.3-176.43 59.7C109.6 270.3 163 282.4 196.2 315.7c33.2 33.2 45.3 86.6 59.7 176.5 14.4-89.9 26.5-143.3 59.7-176.6 33.3-33.2 86.7-45.3 176.6-59.7-89.9-14.4-143.3-26.5-176.5-59.7-33.3-33.2-45.4-86.6-59.8-176.43zM423 89c-45.8 33.1-81 56.9-112.4 70.2 5.1 9.4 11 17.4 17.8 24.2 6.8 6.8 14.8 12.7 24.3 17.9 13.4-31.4 37.2-66.6 70.3-112.3zm-333.94.06C122.2 134.8 145.9 169.9 159.2 201.2c9.4-5.1 17.4-11 24.2-17.8 6.8-6.8 12.7-14.8 17.8-24.2-31.3-13.3-66.4-37-112.14-70.14zM352.7 310.5c-9.5 5.2-17.5 11.1-24.3 17.9-6.8 6.8-12.7 14.8-17.9 24.3C342 366 377.2 389.8 423 423c-33.2-45.8-57-81-70.3-112.5zm-193.5.1C145.9 342 122.1 377.2 89 423c45.7-33.1 80.9-56.9 112.3-70.3-5.2-9.5-11.1-17.5-17.9-24.3-6.8-6.8-14.8-12.7-24.2-17.8z"},child:[]}]})(n)}function Ije(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M65.125 18.344C47.11 49.844 36.72 86.262 36.72 125.124c0 80.293 43.973 150.497 109.124 187.75.403-6.904.92-13.833 1.625-20.75-55.33-34.965-92.064-96.676-92.064-167 0-39.426 11.63-75.964 31.563-106.78H65.124zm69.03 0c-25.61 28.273-41.374 65.635-41.374 106.78 0 51.08 24.052 96.656 61.44 125.97l.06-.25c1.612-6.61 3.473-13.008 5.69-19.125-29.73-25.896-48.5-64.026-48.5-106.595 0-42.848 19.254-80.837 49.436-106.78h-26.75zm210.532 0c30.125 25.95 49.438 64.003 49.438 106.78 0 41.152-17.546 78.157-45.563 103.97 2.26 6.282 4.116 12.876 5.657 19.687 35.748-29.366 58.592-73.883 58.592-123.655 0-41.123-15.81-78.5-41.406-106.78h-26.72zm73.407 0c20.06 30.867 32.094 67.387 32.094 106.78 0 69.457-35.82 130.505-90 165.69.545 7.037.933 14.107 1.187 21.123 64.267-37.483 107.53-107.18 107.53-186.812 0-38.925-10.745-75.328-28.874-106.78h-21.936zm-165.313 2.28c-57.625 0-104.53 46.906-104.53 104.532 0 28.606 11.56 54.573 30.25 73.47 4.13-4.712 8.84-8.817 14.094-12.19-15.844-15.56-25.656-37.237-25.656-61.28 0-47.527 38.316-85.844 85.843-85.844 47.528 0 85.845 38.317 85.845 85.844 0 23.16-9.108 44.114-23.938 59.53 5.488 3.14 10.394 7.033 14.688 11.533 17.327-18.666 27.938-43.657 27.938-71.064 0-57.626-46.905-104.53-104.532-104.53zm-4.186 55.564c-21.622 2.8-40.97 27.91-40.97 60.28 0 17.846 6.173 33.653 15.282 44.595l10.188 12.218-15.656 2.94c-11.884 2.226-20.62 8.512-28.032 18.655-7.41 10.143-13.023 24.216-16.97 40.406-7.188 29.5-8.736 65.498-8.967 97.126h38.999l.655 8.656 9.906 132.5h83.69l8.75-132.437.592-8.72h37.125c-.02-32-.39-68.49-6.906-98.217-3.57-16.297-8.992-30.34-16.5-40.375-7.505-10.035-16.654-16.288-29.967-18.344L273.875 193l10.094-12.625c8.713-10.89 14.592-26.495 14.592-43.906 0-34.515-21.658-60.22-45.468-60.22-2.672 0-4.275-.092-4.5-.063z"},child:[]}]})(n)}function Nje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 23.545c-33.5 0-63.525 15.197-83.55 39.053L92.7 38.313l60.85 56.867c-2.134 5.82-3.785 11.872-4.905 18.105L18.498 132.592 148.635 151.9c1.118 6.238 2.768 12.293 4.902 18.118L92.7 226.873l78.898-24.025c1.62-2.674 3.35-5.246 5.203-7.702 2.154-2.85 4.502-5.53 7.02-8.027-11.435-15.14-18.21-34.01-18.21-54.503 0-50.03 40.357-90.39 90.39-90.39 50.03 0 90.39 40.36 90.39 90.39 0 20.494-6.774 39.36-18.208 54.5 2.518 2.497 4.868 5.177 7.02 8.03 1.855 2.455 3.585 5.028 5.204 7.703l78.895 24.023-60.837-56.857c2.133-5.824 3.784-11.88 4.902-18.116l130.137-19.308-130.147-19.307c-1.12-6.232-2.77-12.283-4.906-18.103l60.85-56.87-79.75 24.286C319.52 38.743 289.5 23.545 256 23.545zm.002 45.182c-23.1 0-42.257 23.548-45.89 54.412h36.544v18.686H209.85c1.698 19.243 9.403 35.878 20.408 46.133H219.94c-11.947 2.392-20.787 8.595-28.223 18.446-7.56 10.013-13.304 23.86-17.34 39.875-7.365 29.223-8.98 65.15-9.22 97.33h39.972l10.32 149.056h81.103l10.322-149.057h39.973c-.24-32.18-1.856-68.107-9.22-97.33-4.037-16.014-9.782-29.86-17.34-39.874-7.437-9.85-16.278-16.054-28.226-18.447h-10.316c11.005-10.256 18.71-26.89 20.408-46.134h-36.81V123.14h36.547c-3.633-30.865-22.79-54.413-45.888-54.413z"},child:[]}]})(n)}function Oje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.176 280.486c21.38-30.735 42.538-61.17 64.123-92.267-30.341-4.086-59.886-8.048-89.888-12.134 13.6-39.089 26.955-77.509 40.735-117.15-41.247 23.546-81.281 46.413-121.716 69.462-10.34-34.333-20.703-68.359-31.223-103.298-18.23 32.498-35.798 63.965-53.603 95.676-33.719-32.262-66.83-64.029-101.163-96.841 7.803 45.31 15.426 89.155 22.986 133.733-43.964-7.009-86.833-13.655-130.986-20.553 31.892 37.199 63.052 73.548 94.4 110.197-27.932 25.67-55.681 51.161-84.029 77.383 36.648 8.173 71.958 16.16 108.18 24.332-13.236 29.451-26.221 58.358-39.577 88.061 23.718-6.284 26.68-7.016 49.303-13.118 0 0 22.35-68.463 32.866-84.747 4.806-7.29 5.267-13.96 3.675-22.182-6.668-34.118-12.749-68.32-19.108-102.447-.39-1.934-.47-3.335 1.543-4.647 23.978-16.689 36.344-21.244 73.797-47.78 17.295 19.699 34.47 39.477 51.997 59.647a2368.384 2368.384 0 0 0-17.837 16.364c-.46.46-1.622.69-2.324.46-6.52-1.943-13.03-3.876-19.588-5.968-7.708-7.292-13.68-15.293-19.808-21.482-1.703 6.36-3.456 12.327-4.887 18.457 8.984 10.945 11.236 14.184 16.904 19.77 1.162 1.17 1.861 3.024 1.861 4.576 1.549 31.612.61 62.646 2.134 89.81 3.374.932 6.439 1.703 10.196 2.795-.773-34.13-1.353-67.71-2.244-101.52 2.053 0 3.995 1.012 5.618 3.877 19.688 32.305 37.333 64.041 54.95 93.455 2.944-1.712 5.858-3.415 8.843-5.127-1.513 4.573-6.594 10.905-9.314 14.822-9.388 14.727-25.093 22.027-37.995 30.863-15.624 24.762-28.247 50.076-38.257 67.658l14.789 37.443c.37.118 26.19-39.152 38.908-59.09 21.19 18.717 41.987 37.136 63.39 56.035 1.55-41.042 3.196-80.801 4.692-121.048 44.704 3.844 88.763 7.623 134.04 11.53-26.01-32.444-51.169-63.604-76.383-95.007zm-164.443-117.08c12.948-8.062 25.587-15.822 38.506-23.725 6.389 11.007 12.479 21.863 18.646 32.878-10.625 6.59-21.17 13.189-32.107 19.849-8.181-9.614-16.593-19.147-25.045-29.002zm51.184 59.027c-6.29-7.37-12.568-14.512-19.197-22.183 11.055-6.75 22.062-13.57 33.307-20.48 5.74 10.085 11.368 19.93 17.066 30.013-16.835 10.475-33.47 20.63-49.834 30.715-.11-.232-.23-.311-.459-.47 6.317-5.739 12.598-11.476 19.117-17.595zm-26.138 34.74c20.55-12.639 40.83-25.047 61.42-37.765 6.128 10.546 11.946 20.86 18.115 31.716-20.52 12.719-40.879 25.127-61.54 37.844-6.018-10.775-11.985-21.25-17.995-31.795zm40.479 71.033c-5.739-10.155-11.476-20.08-17.175-30.325 19.238-11.786 38.346-23.574 57.744-35.51 5.698 10.073 11.438 20.079 17.135 30.245-19.31 12.015-38.466 23.733-57.704 35.59z"},child:[]}]})(n)}function Pje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M384 64a64 64 0 0 0-64 64 64 64 0 0 0 1.1 11.3l-146.3 73.2A64 64 0 0 0 128 192a64 64 0 0 0-64 64 64 64 0 0 0 64 64 64 64 0 0 0 46.8-20.5L321 372.7a64 64 0 0 0-1 11.3 64 64 0 0 0 64 64 64 64 0 0 0 64-64 64 64 0 0 0-64-64 64 64 0 0 0-46.8 20.5L191 267.4a64 64 0 0 0 1-11.4 64 64 0 0 0-1.1-11.4l146.3-73.1A64 64 0 0 0 384 192a64 64 0 0 0 64-64 64 64 0 0 0-64-64z"},child:[]}]})(n)}function Lje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256.3 19.95c-41 0-74.1 32.7-74.1 73.27 0 22.98 8 33.78 16.8 47.78 5.9 9.3 12 20.1 15.5 35.6h83c3.5-15.9 9.6-26.8 15.5-36.2 8.9-14.1 16.8-24.7 16.8-47.18 0-40.57-32.8-73.27-73.5-73.27zm-142.1 7.7L81 35.4l81.2 40.25-48-48zm283.6 0l-48 48L431 35.4l-33.2-7.75zM210.5 79.2l45.5 22.7 45.5-22.7-20.8 83-17.4-4.4 11.2-45-18.5 9.3-18.5-9.3 11.2 45-17.4 4.4-20.8-83zM64 96.03v32.07l96-16.1-96-15.97zm384 0L352 112l96 16V96.03zM334.2 144.3l39.9 63.3 24.1-15.3-64-48zm-156.4.1l-64 48 24.1 15.3 39.9-63.3zM216 191v16h80v-16h-80zm34.4 28.3c-13.7 0-26.9.5-35.7 1-68.2 10.7-82.9 105.4-66.7 191.6h23.6l-1-105.4 18.6-.2c-1.4 63.7 1.6 126.6 5.5 189.7h51.4V390.3h18.7V496h50.4c4.5-65 5.9-131.5 6.5-189.7l18.7.2-1.1 105.4h24.6c18.3-88.5-4.8-178.9-67.1-190.6-9.4-1.4-24.9-2-40.6-2h-5.8z"},child:[]}]})(n)}function Dje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M257.65 19.033l-47.552 85.598c-51.53 16.016-91.8 57.678-105.877 110.026L33.407 252.25l69.276 38.486c5.942 26.33 18.456 50.18 35.722 69.737 5.63-7.952 12.438-15.05 20.547-21.162-19.19-22.513-30.794-51.682-30.794-83.51 0-71.074 57.838-128.488 128.912-128.488 71.077 0 128.49 57.412 128.49 128.49 0 30.006-10.234 57.65-27.408 79.583 8.525 5.88 15.612 12.795 21.413 20.592 15.176-18.532 26.235-40.563 31.77-64.692l70.263-39.035-71.826-38.13c-14.312-52.475-54.968-94.123-106.856-109.825L257.65 19.033zm.266 150.33c-17.56 0-33.686 9.02-45.902 24.647-12.217 15.626-20.09 37.754-20.09 62.373 0 26.12 9.218 49.343 22.846 65.148l10.14 11.76-15.14 3.452c-38.027 8.67-55.962 26.396-66.48 54.268-9.788 25.934-11.75 61.67-11.99 104.236h254.473c-.047-42.74-.66-79.348-9.683-105.814-9.693-28.432-27.11-46.38-67.99-54.38l-15.272-2.99 9.817-12.076c12.778-15.718 21.267-38.404 21.267-63.603 0-24.62-7.875-46.747-20.092-62.373-12.216-15.626-28.343-24.647-45.902-24.647h-.002z"},child:[]}]})(n)}function kje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M255.422 18.346c-111.086 0-204.14 76.375-229.615 179.533-11.867 70.7 11.228 143.745 60.048 194.24-5.034 28.402-5.687 61.755-5.687 100.54h18.687c0-57.013 2.106-100.723 14.88-130.744 12.776-30.02 34.883-47.983 81.394-56.728l15.61-2.934-10.148-12.22c-16.364-19.7-27.22-48.142-27.22-79.84 0-30.586 9.785-58.117 25.093-77.66 15.308-19.54 35.707-30.99 57.99-30.99s42.683 11.45 57.99 30.99c15.308 19.543 25.094 47.074 25.094 77.66 0 31.072-9.61 59.05-25.186 78.55l-10.036 12.565 15.885 2.497c50.69 7.97 72.17 25.994 83.77 56.398 11.598 30.404 11.513 75.137 11.513 132.455h18.69c0-30.09.238-57.06-1.506-81.117 36.888-41.708 59.28-96.54 59.28-156.668 0-130.742-105.786-236.53-236.528-236.53zm8.2 43.45c30.12.1 60.5 7.25 88.24 21.995 99.02 52.642 132.557 179.59 80.525 276.79-1.816 3.392-3.722 6.703-5.698 9.95-1.455-5.895-3.186-11.558-5.256-16.985-.896-2.347-1.872-4.636-2.913-6.877 43.444-87.576 12.394-199.683-75.432-246.373-24.95-13.264-52.307-19.685-79.436-19.775-59.683-.2-118.266 30.23-147.71 85.798-25.907 48.89-22.56 108.01 5.224 152.838-4.82 4.473-9.11 9.337-12.906 14.582-34-50.89-38.835-119.552-8.834-176.17 32.91-62.107 97.928-95.992 164.195-95.77zm86.657 98.9c37.642 37.22 50.227 94.933 32.638 145.548-5.115-3.25-10.7-6.19-16.773-8.81 10.177-31.69 6.895-66.347-8.112-95-.702-14.7-3.382-28.753-7.754-41.74zM158.92 173.642c-2.762 11.597-4.24 23.864-4.24 36.55 0 7.46.533 14.768 1.543 21.875-1.932 21.073 3.05 42.43 14.21 60.077-6.35 1.94-12.302 4.153-17.867 6.638-19.113-32.745-21.045-74.92-2.818-110.215 2.726-5.28 5.8-10.255 9.172-14.925zm60.45 29.34c-15.794.205-19.24 4.585-24.546 8.15 12.483 11.99 36.9 10.832 47.748 0-4.992-4.043-10.37-8.317-23.203-8.15zm74.69.177c-15.794.205-19.24 4.586-24.546 8.15 12.483 11.992 36.9 10.833 47.748 0-4.992-4.042-10.37-8.317-23.203-8.15z"},child:[]}]})(n)}function Mje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 16c-48 0-80 32-80 64 0 48 16 80 32 96v16h96v-16c16-16 32-48 32-96 0-32-32-64-80-64zm-63.6 65.33L256 102.5l63.6-21.17-39.2 97.97-16.8-6.6 24.8-62-32.4 10.8-32.4-10.8 24.8 62-16.8 6.6-39.2-97.97zm-83.3 79.07c-23.4 3-44.6 30.5-44.6 65.9 0 19.6 6.8 36.9 16.7 48.9l11.9 14.2-18.3 3.4c-12.9 2.5-22.3 9.3-30.4 20.4-8.1 11.1-14.3 26.5-18.6 44.4C18 389.8 16.2 429.2 16 464h42.8l2.24 30H169.6l2-30h40.8c0-35.2-.4-75.1-7.5-107.7-4-17.9-9.9-33.3-18.1-44.3-8.2-11-18.1-17.8-32.6-20l-18.5-2.9 11.7-14.7c9.5-11.9 15.9-29 15.9-48.1 0-37.8-23.6-65.8-49.4-65.8l-4.8-.1zm283.6 0c-23.4 3-44.6 30.5-44.6 65.9 0 19.6 6.8 36.9 16.7 48.9l11.9 14.2-18.3 3.4c-12.9 2.5-22.3 9.3-30.4 20.4-8.1 11.1-14.3 26.5-18.6 44.4-7.8 32.2-9.6 71.6-9.8 106.4h42.8l2.2 30h108.6l2-30H496c0-35.2-.4-75.1-7.5-107.7-4-17.9-9.9-33.3-18.1-44.3-8.2-11-18.1-17.8-32.6-20l-18.5-2.9 11.7-14.7c9.5-11.9 15.9-29 15.9-48.1 0-37.8-23.6-65.8-49.4-65.8l-4.8-.1zM208 209v18h96v-18h-96zm16 34v18h64v-18h-64z"},child:[]}]})(n)}function jje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M249.334 22.717c-18.64 2.424-35.677 23.574-37.043 51.49v.02c-.057 1.186-.097 2.38-.097 3.59 0 16.362 5.658 30.827 13.942 40.818l10.127 12.213-15.592 2.933c-10.75 2.025-18.622 7.702-25.373 16.978-2.285 3.14-4.384 6.707-6.31 10.62-57.54-6.44-97.91-21.06-97.91-37.952 0-17.363 42.647-31.983 102.75-37.97-.213-2.51-.323-5.057-.323-7.636v-.002c0-.84.024-1.674.047-2.51-96.43 6.77-167.298 29.15-167.3 55.71-.002 25.33 64.462 46.86 154.074 54.67-.19.742-.394 1.465-.576 2.216-2.36 9.72-4.05 20.22-5.268 31.03-.01 0-.02 0-.03.002-.418 3.653-.78 7.34-1.095 11.046l.05-.005c-1.316 15.777-1.772 31.88-1.893 46.95h35.894l2.115 28.4c-68.24-4.994-118.444-21.004-118.444-39.843 0-13.243 24.83-24.89 63.27-32.33.3-4.056.66-8.115 1.076-12.162-76.42 9.353-129.17 29.168-129.172 52.086-.002 28.17 79.71 51.643 185.098 56.768l5.94 79.77c10.5 2.648 24.84 4.162 39.017 4.068 13.79-.092 27.235-1.71 36.45-4l5.263-79.846c105.308-5.14 184.935-28.605 184.935-56.76 0-23.013-53.196-42.895-130.13-52.2.304 4.02.557 8.047.755 12.07 38.883 7.43 63.965 19.17 63.965 32.536 0 18.84-49.804 34.85-117.908 39.844l1.87-28.402h34.18c-.012-15.113-.127-31.27-1.033-47.094.01 0 .02.002.032.004-.214-3.687-.472-7.352-.782-10.986l-.02-.002c-.94-11.157-2.367-21.984-4.546-31.967-.09-.405-.184-.803-.275-1.206 89.518-7.826 153.893-29.344 153.893-54.656 0-26.787-72.076-49.332-169.77-55.887.025.895.053 1.788.053 2.688 0 2.5-.104 4.97-.304 7.407 61.19 5.836 104.61 20.61 104.61 38.2 0 16.805-39.633 31.355-96.524 37.848-2.01-4.283-4.26-8.15-6.762-11.505-6.83-9.167-15.063-14.81-27.14-16.682l-15.913-2.47 10.037-12.59c6.928-8.69 11.912-20.715 13.057-34.268h.002c.163-1.95.25-3.93.25-5.938 0-.77-.022-1.532-.048-2.29-.015-.48-.033-.958-.057-1.434h-.002c-1.48-29.745-20.507-51.3-41.076-51.3-2.528 0-3.966-.087-4.03-.08h-.003zM194.54 355.822c-97.11 6.655-168.573 29.11-168.573 55.8 0 31.932 102.243 57.815 228.367 57.815S482.7 443.555 482.7 411.623c0-26.608-71.02-49.004-167.67-55.736l-.655 9.93c60.363 6.055 103.074 20.956 103.074 38.394 0 22.81-73.032 41.298-163.12 41.298-90.088 0-163.12-18.49-163.12-41.297 0-17.533 43.18-32.502 104.07-38.493l-.74-9.895z"},child:[]}]})(n)}function Uje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M20.22 21.75v65.5l92 70.625-60.126 58.094 235.656 157.5-83.844-5.845 93.25 76.53-77.562 5.47 113.5 40.656-4.625-69.03h-21.783c0-37.79-.747-91.963 32.5-100-5.097-7.648-8.187-17.65-8.187-28.625 0-23.993 14.784-43.47 33-43.47s32.97 19.475 32.97 43.47c0 11.247-3.24 21.472-8.564 29.188 30.514 8.638 32.875 61.79 32.875 99.437h-22.967l-5.25 69.813 91.906-59.594-49.064 4.374 57.594-105.53-60.156 16.905 57.5-92.814-68.53 28.813 54.217-102.345-72.655 43.063 18.53-123.407-51.717 115.94-71.125-144.032 23 165.062-66.25-52.5 42.468 85.75-120.436-76.97 73.594-54.655L123.188 21.75H20.218z"},child:[]}]})(n)}function Fje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M250.322 18.494c-25.06 3.26-47.158 32.267-47.158 69.346 0 20.453 7.06 38.57 17.502 51.166l10.123 12.213-15.59 2.932c-13.676 2.574-23.794 9.896-32.272 21.547-8.48 11.65-14.86 27.7-19.326 46.095-8.23 33.9-9.916 75.216-10.143 111.275h44.007l11.883 159.512h96.37l10.514-159.512h41.88c-.013-36.448-.353-78.316-7.81-112.48-4.042-18.524-10.176-34.575-18.777-46.12-8.6-11.543-19.21-18.81-34.482-21.18l-15.912-2.468 10.037-12.59c9.99-12.533 16.7-30.436 16.7-50.392 0-39.537-24.776-69.268-52.352-69.268-2.915 0-4.754-.135-5.196-.078zm178.608 1.078c-31.872-.534-61.166 26.473-71.084 63.49-4.575 17.073-4.83 35.29-.817 51.108-10.96 1.307-20.99 5.173-29.772 10.996 5.563 3.58 10.537 7.906 14.906 12.814 7.998-4.296 16.716-6.28 27.084-5.492l15.816 1.2-6.615-14.415c-5.86-12.764-7.33-33.55-2.554-51.377 8.122-30.308 31.484-49.75 52.75-49.61 1.416.008 2.825.104 4.22.29l.01.002c.263.037 1.817.567 4.44 1.27 23.73 6.36 38.404 37.853 29.168 72.324-4.66 17.392-15.965 34.567-27.02 42.73l-12.954 9.565 14.73 6.502c13.063 5.765 20.835 13.86 25.885 24.348 5.05 10.487 7.12 23.674 6.846 38.674-.5 27.368-8.862 60.148-17.2 91.362l-36.864-9.88-51.232 153.712-42.69.11-1.23 18.69 57.402-.146 49.914-149.758 37.946 10.166 2.42-9.025c9.022-33.677 19.603-71.135 20.22-104.89.31-16.876-1.89-32.994-8.693-47.124-5.016-10.417-12.696-19.57-23.065-26.622 10.814-11.607 19.228-27.125 23.637-43.58 11.288-42.13-6.228-85.52-42.38-95.21l-.003-.003c-1.106-.296-3.297-1.274-6.81-1.744h-.008l-2.838-.38-.295.146c-1.09-.082-2.185-.226-3.27-.244zm-349.32.46c-4.49.056-9.02.665-13.538 1.876-.095.026-.327.068-.44.094l-.575-.574-5.76 2.377h-.002C27.32 36.99 13.11 77.635 23.69 117.12c4.574 17.073 13.46 32.977 24.845 44.67-9.328 6.978-16.34 15.908-21.053 25.99-6.507 13.924-8.973 29.83-9.11 46.6-.27 33.543 8.753 71.01 17.82 104.845l2.42 9.027 40.02-10.727 51.11 149.454 60.46.153-1.39-18.694-45.7-.116-52.446-153.37-38.73 10.378c-8.028-30.892-15.098-63.467-14.875-90.8.122-14.997 2.417-28.276 7.354-38.84 4.937-10.56 12.24-18.566 23.865-24.15l14.298-6.87-12.94-9.176c-11.456-8.122-23.12-25.39-27.896-43.215-8.66-32.315 3.867-62.596 24.653-71.188l.025-.01c.244-.1 1.86-.42 4.486-1.12h.002l.002-.003c2.966-.796 6.005-1.18 9.072-1.175 21.47.027 44.263 19.06 52.344 49.223 4.66 17.392 3.46 37.92-2.035 50.517l-6.436 14.76 16.01-1.734c13.355-1.447 23.684 1.234 32.868 7.016 4.285-4.866 9.108-9.17 14.46-12.742-.73-.536-1.464-1.062-2.212-1.572-9.55-6.512-20.777-10.598-33.283-11.522 3.562-15.46 3.09-33.105-1.318-49.56-9.878-36.864-39.338-63.538-70.77-63.14z"},child:[]}]})(n)}function Bje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4"},child:[]},{tag:"path",attr:{d:"M18 14v4h4"},child:[]},{tag:"path",attr:{d:"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"},child:[]},{tag:"path",attr:{d:"M15 3v4"},child:[]},{tag:"path",attr:{d:"M7 3v4"},child:[]},{tag:"path",attr:{d:"M3 11h16"},child:[]}]})(n)}function Vje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4"},child:[]},{tag:"path",attr:{d:"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"},child:[]},{tag:"path",attr:{d:"M15 3v4"},child:[]},{tag:"path",attr:{d:"M7 3v4"},child:[]},{tag:"path",attr:{d:"M3 11h16"},child:[]},{tag:"path",attr:{d:"M18 16.496v1.504l1 1"},child:[]}]})(n)}function zje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M15.22 9.375a1 1 0 0 1 1.393 -.165l.094 .083l4 4a1 1 0 0 1 .284 .576l.009 .131v5a1 1 0 0 1 -.883 .993l-.117 .007h-16.022l-.11 -.009l-.11 -.02l-.107 -.034l-.105 -.046l-.1 -.059l-.094 -.07l-.06 -.055l-.072 -.082l-.064 -.089l-.054 -.096l-.016 -.035l-.04 -.103l-.027 -.106l-.015 -.108l-.004 -.11l.009 -.11l.019 -.105c.01 -.04 .022 -.077 .035 -.112l.046 -.105l.059 -.1l4 -6a1 1 0 0 1 1.165 -.39l.114 .05l3.277 1.638l3.495 -4.369z",strokeWidth:"0",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M15.232 3.36a1 1 0 0 1 1.382 -.15l.093 .083l4 4a1 1 0 0 1 -1.32 1.497l-.094 -.083l-3.226 -3.225l-4.299 5.158a1 1 0 0 1 -1.1 .303l-.115 -.049l-3.254 -1.626l-2.499 3.332a1 1 0 0 1 -1.295 .269l-.105 -.069a1 1 0 0 1 -.269 -1.295l.069 -.105l3 -4a1 1 0 0 1 1.137 -.341l.11 .047l3.291 1.645l4.494 -5.391z",strokeWidth:"0",fill:"currentColor"},child:[]}]})(n)}function Hje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M3 3v18h18"},child:[]},{tag:"path",attr:{d:"M20 18v3"},child:[]},{tag:"path",attr:{d:"M16 16v5"},child:[]},{tag:"path",attr:{d:"M12 13v8"},child:[]},{tag:"path",attr:{d:"M8 16v5"},child:[]},{tag:"path",attr:{d:"M3 11c6 0 5 -5 9 -5s3 5 9 5"},child:[]}]})(n)}function Gje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M14 3v4a1 1 0 0 0 1 1h4"},child:[]},{tag:"path",attr:{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"},child:[]},{tag:"path",attr:{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"},child:[]},{tag:"path",attr:{d:"M17 18h2"},child:[]},{tag:"path",attr:{d:"M20 15h-3v6"},child:[]},{tag:"path",attr:{d:"M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1z"},child:[]}]})(n)}function Wje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2"},child:[]}]})(n)}function $je(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M15 10v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4"},child:[]},{tag:"path",attr:{d:"M19 21h-4l4 -7h-4"},child:[]},{tag:"path",attr:{d:"M4 15l3 3l3 -3"},child:[]},{tag:"path",attr:{d:"M7 6v12"},child:[]}]})(n)}function Kje(n){return Le({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10.895 16.553l-4-8c-.339-.678-1.45-.678-1.789 0l-4 8c-.247.494-.047 1.095.447 1.342.495.248 1.095.046 1.342-.447l.723-1.448h4.764l.724 1.447c.175.351.528.553.895.553.15 0 .303-.034.446-.105.494-.248.695-.848.448-1.342zm-6.277-2.553l1.382-2.764 1.382 2.764h-2.764zM22 18h-6c-.379 0-.725-.214-.895-.553s-.132-.744.095-1.047l4.8-6.4h-4c-.552 0-1-.448-1-1s.448-1 1-1h6c.379 0 .725.214.895.553s.132.744-.095 1.047l-4.8 6.4h4c.552 0 1 .448 1 1s-.448 1-1 1zM14 14h-2c-.552 0-1-.448-1-1s.448-1 1-1h2c.552 0 1 .448 1 1s-.448 1-1 1z"},child:[]}]})(n)}function qje(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 11.5v0.5h-6.168v-1h5.152c-0.112-1.692-0.789-3.231-1.842-4.434l-0.806 0.806-0.707-0.707 0.802-0.802c-1.202-1.053-2.74-1.726-4.431-1.839v2.976h-1v-2.976c-1.691 0.113-3.229 0.786-4.43 1.839l0.796 0.796-0.707 0.707-0.8-0.8c-1.053 1.203-1.731 2.742-1.842 4.434h5.171v1h-6.188v-0.5c0-4.687 3.813-8.5 8.5-8.5s8.5 3.813 8.5 8.5zM10.5 11.5c0 1.103-0.897 2-2 2s-2-0.897-2-2c0-0.644 0.311-1.21 0.784-1.577l-2.082-3.63 0.867-0.497 2.141 3.733c0.095-0.014 0.19-0.029 0.29-0.029 1.103 0 2 0.897 2 2zM9.5 11.5c0-0.551-0.449-1-1-1s-1 0.449-1 1 0.449 1 1 1 1-0.449 1-1z"},child:[]}]})(n)}function Yje(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M8.301 6.422c0.437 0 0.769-0.161 1.006-0.484 0.181-0.237 0.265-0.617 0.265-1.12v-1.66c0-0.503-0.084-0.873-0.265-1.11-0.238-0.321-0.57-0.483-1.006-0.483-0.428 0-0.76 0.161-0.995 0.483-0.181 0.238-0.266 0.608-0.266 1.111v1.66c0 0.503 0.085 0.873 0.266 1.12 0.235 0.322 0.567 0.483 0.995 0.483zM7.893 2.988c0-0.436 0.133-0.654 0.408-0.654 0.285 0 0.408 0.218 0.408 0.654v1.992c0 0.437-0.123 0.664-0.408 0.664-0.275 0-0.408-0.228-0.408-0.664v-1.992zM10.35 6.071c-0.048-0.143-0.075-0.37-0.075-0.711v-3.738h0.863v3.481c0 0.2 0 0.313 0.010 0.333 0.019 0.133 0.085 0.208 0.199 0.208 0.17 0 0.35-0.133 0.54-0.408v-3.614h0.863v4.734h-0.863v-0.522c-0.341 0.398-0.663 0.588-0.978 0.588-0.275 0-0.474-0.113-0.559-0.351zM13.633 11.811v0.436h-0.854v-0.436c0-0.427 0.143-0.646 0.427-0.646 0.284 0.001 0.427 0.219 0.427 0.646zM4.354 1.774c-0.208-0.588-0.416-1.186-0.617-1.774h1.007l0.673 2.495 0.645-2.495h0.968l-1.148 3.785v2.571h-0.948v-2.571c-0.086-0.465-0.276-1.129-0.58-2.011zM15.283 8.785c-0.171-0.75-0.788-1.3-1.518-1.385-1.746-0.19-3.511-0.19-5.266-0.19s-3.52 0-5.256 0.19c-0.738 0.085-1.346 0.635-1.526 1.385-0.237 1.062-0.247 2.22-0.247 3.32 0 1.091 0 2.257 0.247 3.32 0.171 0.75 0.788 1.3 1.518 1.376 1.745 0.199 3.51 0.199 5.265 0.199s3.52 0 5.266-0.199c0.729-0.076 1.337-0.626 1.518-1.376 0.237-1.062 0.247-2.229 0.247-3.32-0.001-1.1-0.001-2.258-0.248-3.32zM5.483 9.743h-1.014v5.398h-0.949v-5.398h-0.997v-0.892h2.96v0.892zM8.045 15.141h-0.845v-0.512c-0.342 0.389-0.664 0.579-0.968 0.579-0.274 0-0.474-0.114-0.55-0.351-0.048-0.142-0.076-0.361-0.076-0.692v-3.709h0.845v3.453c0 0.2 0 0.304 0.009 0.333 0.020 0.132 0.086 0.199 0.199 0.199 0.172 0 0.352-0.132 0.541-0.398v-3.586h0.845v4.684zM11.271 13.737c0 0.437-0.020 0.749-0.086 0.948-0.104 0.342-0.342 0.522-0.674 0.522-0.303 0-0.598-0.171-0.883-0.522v0.456h-0.843v-6.29h0.843v2.059c0.275-0.342 0.57-0.512 0.883-0.512 0.332 0 0.57 0.18 0.674 0.531 0.066 0.19 0.086 0.502 0.086 0.939v1.869zM14.477 12.959h-1.698v0.825c0 0.437 0.143 0.654 0.437 0.654 0.209 0 0.332-0.113 0.38-0.341 0.009-0.047 0.019-0.237 0.019-0.579h0.863v0.124c0 0.275 0 0.465-0.019 0.55-0.020 0.189-0.096 0.36-0.199 0.512-0.229 0.332-0.579 0.503-1.024 0.503-0.446 0-0.779-0.161-1.025-0.484-0.18-0.228-0.275-0.598-0.275-1.101v-1.641c0-0.503 0.086-0.863 0.266-1.101 0.247-0.323 0.579-0.484 1.016-0.484 0.428 0 0.759 0.161 1.005 0.484 0.172 0.237 0.257 0.597 0.257 1.101v0.978zM10.426 11.801v2.002c0 0.427-0.124 0.635-0.37 0.635-0.143 0-0.285-0.066-0.428-0.208v-2.855c0.143-0.143 0.285-0.209 0.428-0.209 0.246 0 0.37 0.218 0.37 0.635z"},child:[]}]})(n)}function Xje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 14h.5c.827 0 1.5-.673 1.5-1.5v-9c0-.827-.673-1.5-1.5-1.5h-13C2.673 2 2 2.673 2 3.5V18l5.333-4H16zm-9.333-2L4 14V4h12v8H6.667z"},child:[]},{tag:"path",attr:{d:"M20.5 8H20v6.001c0 1.1-.893 1.993-1.99 1.999H8v.5c0 .827.673 1.5 1.5 1.5h7.167L22 22V9.5c0-.827-.673-1.5-1.5-1.5z"},child:[]}]})(n)}function Jje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.56,3.34a1,1,0,0,0-1-.08l-17,8a1,1,0,0,0-.57.92,1,1,0,0,0,.6.9L8,15.45v6.72L13.84,18l4.76,2.08a.93.93,0,0,0,.4.09,1,1,0,0,0,.52-.15,1,1,0,0,0,.48-.79l1-15A1,1,0,0,0,20.56,3.34ZM18.1,17.68l-5.27-2.31L16,9.17,8.35,13.42,5.42,12.13,18.89,5.79Z"},child:[]}]})(n)}function Qje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 6c0-1.654-1.346-3-3-3a2.993 2.993 0 0 0-2.815 2h-6.37A2.993 2.993 0 0 0 6 3C4.346 3 3 4.346 3 6c0 1.302.839 2.401 2 2.815v6.369A2.997 2.997 0 0 0 3 18c0 1.654 1.346 3 3 3a2.993 2.993 0 0 0 2.815-2h6.369a2.994 2.994 0 0 0 2.815 2c1.654 0 3-1.346 3-3a2.997 2.997 0 0 0-2-2.816V8.816A2.996 2.996 0 0 0 21 6zm-3-1a1.001 1.001 0 1 1-1 1c0-.551.448-1 1-1zm-2.815 12h-6.37A2.99 2.99 0 0 0 7 15.184V8.816A2.99 2.99 0 0 0 8.815 7h6.369A2.99 2.99 0 0 0 17 8.815v6.369A2.99 2.99 0 0 0 15.185 17zM6 5a1.001 1.001 0 1 1-1 1c0-.551.448-1 1-1zm0 14a1.001 1.001 0 0 1 0-2 1.001 1.001 0 0 1 0 2zm12 0a1.001 1.001 0 0 1 0-2 1.001 1.001 0 0 1 0 2z"},child:[]}]})(n)}function Zje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2C7.589 2 4 5.589 4 9.995 3.971 16.44 11.696 21.784 12 22c0 0 8.029-5.56 8-12 0-4.411-3.589-8-8-8zm0 12c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"},child:[]}]})(n)}function eUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(n)}function tUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function nUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"},child:[]}]})(n)}function iUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}function rUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M424 64H88c-22 0-40 18-40 40v304c0 22 18 40 40 40h336c22 0 40-18 40-40V104c0-22-18-40-40-40zm12 176c0 8.8-7.2 16-16 16h-86.8c-6.8 0-12.8 4.2-15.1 10.6C314 278.2 303.8 288 292 288h-72c-11.9 0-22.1-9.8-26.1-21.4-2.2-6.4-8.3-10.6-15.1-10.6H92c-8.8 0-16-7.2-16-16V108c0-8.8 7.2-16 16-16h328c8.8 0 16 7.2 16 16v132z"},child:[]},{tag:"path",attr:{d:"M386 156H126c-7.7 0-14-6.3-14-14s6.3-14 14-14h260c7.7 0 14 6.3 14 14s-6.3 14-14 14zM386 220H126c-7.7 0-14-6.3-14-14s6.3-14 14-14h260c7.7 0 14 6.3 14 14s-6.3 14-14 14z"},child:[]}]})(n)}function sUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M260.062 32C138.605 32 40.134 129.701 40.134 250.232c0 41.23 11.532 79.79 31.559 112.687L32 480l121.764-38.682c31.508 17.285 67.745 27.146 106.298 27.146C381.535 468.464 480 370.749 480 250.232 480 129.701 381.535 32 260.062 32zm109.362 301.11c-5.174 12.827-28.574 24.533-38.899 25.072-10.314.547-10.608 7.994-66.84-16.434-56.225-24.434-90.052-83.844-92.719-87.67-2.669-3.812-21.78-31.047-20.749-58.455 1.038-27.413 16.047-40.346 21.404-45.725 5.351-5.387 11.486-6.352 15.232-6.413 4.428-.072 7.296-.132 10.573-.011 3.274.124 8.192-.685 12.45 10.639 4.256 11.323 14.443 39.153 15.746 41.989 1.302 2.839 2.108 6.126.102 9.771-2.012 3.653-3.042 5.935-5.961 9.083-2.935 3.148-6.174 7.042-8.792 9.449-2.92 2.665-5.97 5.572-2.9 11.269 3.068 5.693 13.653 24.356 29.779 39.736 20.725 19.771 38.598 26.329 44.098 29.317 5.515 3.004 8.806 2.67 12.226-.929 3.404-3.599 14.639-15.746 18.596-21.169 3.955-5.438 7.661-4.373 12.742-2.329 5.078 2.052 32.157 16.556 37.673 19.551 5.51 2.989 9.193 4.529 10.51 6.9 1.317 2.38.901 13.531-4.271 26.359z"},child:[]}]})(n)}function aUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M448 248L288 96v85.334C138.666 202.667 85.333 309.334 64 416c53.333-74.666 117.333-108.802 224-108.802v87.469L448 248z"},child:[]}]})(n)}function oUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M32 32v432a16 16 0 0 0 16 16h432"},child:[]},{tag:"rect",attr:{width:"80",height:"192",x:"96",y:"224",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",rx:"20",ry:"20"},child:[]},{tag:"rect",attr:{width:"80",height:"240",x:"240",y:"176",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",rx:"20",ry:"20"},child:[]},{tag:"rect",attr:{width:"80",height:"304",x:"383.64",y:"112",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",rx:"20",ry:"20"},child:[]}]})(n)}function lUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M451 374c-15.88-16-54.34-39.35-73-48.76-24.3-12.24-26.3-13.24-45.4.95-12.74 9.47-21.21 17.93-36.12 14.75s-47.31-21.11-75.68-49.39-47.34-61.62-50.53-76.48 5.41-23.23 14.79-36c13.22-18 12.22-21 .92-45.3-8.81-18.9-32.84-57-48.9-72.8C119.9 44 119.9 47 108.83 51.6A160.15 160.15 0 0 0 83 65.37C67 76 58.12 84.83 51.91 98.1s-9 44.38 23.07 102.64 54.57 88.05 101.14 134.49S258.5 406.64 310.85 436c64.76 36.27 89.6 29.2 102.91 23s22.18-15 32.83-31a159.09 159.09 0 0 0 13.8-25.8C465 391.17 468 391.17 451 374z"},child:[]}]})(n)}function cUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m479.66 268.7-32-151.81C441.48 83.77 417.68 64 384 64H128c-16.8 0-31 4.69-42.1 13.94s-18.37 22.31-21.58 38.89l-32 151.87A16.65 16.65 0 0 0 32 272v112a64 64 0 0 0 64 64h320a64 64 0 0 0 64-64V272a16.65 16.65 0 0 0-.34-3.3zm-384-145.4v-.28c3.55-18.43 13.81-27 32.29-27H384c18.61 0 28.87 8.55 32.27 26.91 0 .13.05.26.07.39l26.93 127.88a4 4 0 0 1-3.92 4.82H320a15.92 15.92 0 0 0-16 15.82 48 48 0 1 1-96 0A15.92 15.92 0 0 0 192 256H72.65a4 4 0 0 1-3.92-4.82z"},child:[]},{tag:"path",attr:{d:"M368 160H144a16 16 0 0 1 0-32h224a16 16 0 0 1 0 32zm16 64H128a16 16 0 0 1 0-32h256a16 16 0 0 1 0 32z"},child:[]}]})(n)}function dUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M218.1 167.17c0 13 0 25.6 4.1 37.4-43.1 50.6-156.9 184.3-167.5 194.5a20.17 20.17 0 0 0-6.7 15c0 8.5 5.2 16.7 9.6 21.3 6.6 6.9 34.8 33 40 28 15.4-15 18.5-19 24.8-25.2 9.5-9.3-1-28.3 2.3-36s6.8-9.2 12.5-10.4 15.8 2.9 23.7 3c8.3.1 12.8-3.4 19-9.2 5-4.6 8.6-8.9 8.7-15.6.2-9-12.8-20.9-3.1-30.4s23.7 6.2 34 5 22.8-15.5 24.1-21.6-11.7-21.8-9.7-30.7c.7-3 6.8-10 11.4-11s25 6.9 29.6 5.9c5.6-1.2 12.1-7.1 17.4-10.4 15.5 6.7 29.6 9.4 47.7 9.4 68.5 0 124-53.4 124-119.2S408.5 48 340 48s-121.9 53.37-121.9 119.17zM400 144a32 32 0 1 1-32-32 32 32 0 0 1 32 32z"},child:[]}]})(n)}function uUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M218.1 167.17c0 13 0 25.6 4.1 37.4-43.1 50.6-156.9 184.3-167.5 194.5a20.17 20.17 0 0 0-6.7 15c0 8.5 5.2 16.7 9.6 21.3 6.6 6.9 34.8 33 40 28 15.4-15 18.5-19 24.8-25.2 9.5-9.3-1-28.3 2.3-36s6.8-9.2 12.5-10.4 15.8 2.9 23.7 3c8.3.1 12.8-3.4 19-9.2 5-4.6 8.6-8.9 8.7-15.6.2-9-12.8-20.9-3.1-30.4s23.7 6.2 34 5 22.8-15.5 24.1-21.6-11.7-21.8-9.7-30.7c.7-3 6.8-10 11.4-11s25 6.9 29.6 5.9c5.6-1.2 12.1-7.1 17.4-10.4 15.5 6.7 29.6 9.4 47.7 9.4 68.5 0 124-53.4 124-119.2S408.5 48 340 48s-121.9 53.37-121.9 119.17zM400 144a32 32 0 1 1-32-32 32 32 0 0 1 32 32z"},child:[]}]})(n)}function hUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C167.67 32 96 96.51 96 176c0 128 160 304 160 304s160-176 160-304c0-79.49-71.67-144-160-144zm0 224a64 64 0 1 1 64-64 64.07 64.07 0 0 1-64 64z"},child:[]}]})(n)}function fUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M384 368h24a40.12 40.12 0 0 0 40-40V168a40.12 40.12 0 0 0-40-40H104a40.12 40.12 0 0 0-40 40v160a40.12 40.12 0 0 0 40 40h24"},child:[]},{tag:"rect",attr:{width:"256",height:"208",x:"128",y:"240",fill:"none",strokeLinejoin:"round",strokeWidth:"32",rx:"24.32",ry:"24.32"},child:[]},{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M384 128v-24a40.12 40.12 0 0 0-40-40H168a40.12 40.12 0 0 0-40 40v24"},child:[]},{tag:"circle",attr:{cx:"392",cy:"184",r:"24"},child:[]}]})(n)}function pUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M400 96V56a8 8 0 0 0-8-8H120a8 8 0 0 0-8 8v40"},child:[]},{tag:"rect",attr:{width:"208",height:"160",x:"152",y:"264",fill:"none",rx:"4",ry:"4"},child:[]},{tag:"rect",attr:{width:"208",height:"160",x:"152",y:"264",fill:"none",rx:"4",ry:"4"},child:[]},{tag:"path",attr:{d:"M408 112H104a56 56 0 0 0-56 56v208a8 8 0 0 0 8 8h56v72a8 8 0 0 0 8 8h272a8 8 0 0 0 8-8v-72h56a8 8 0 0 0 8-8V168a56 56 0 0 0-56-56zm-48 308a4 4 0 0 1-4 4H156a4 4 0 0 1-4-4V268a4 4 0 0 1 4-4h200a4 4 0 0 1 4 4zm34-212.08a24 24 0 1 1 22-22 24 24 0 0 1-22 22z"},child:[]}]})(n)}function mUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM127 384.5c-5.5 9.6-17.8 12.8-27.3 7.3-9.6-5.5-12.8-17.8-7.3-27.3l14.3-24.7c16.1-4.9 29.3-1.1 39.6 11.4L127 384.5zm138.9-53.9H84c-11 0-20-9-20-20s9-20 20-20h51l65.4-113.2-20.5-35.4c-5.5-9.6-2.2-21.8 7.3-27.3 9.6-5.5 21.8-2.2 27.3 7.3l8.9 15.4 8.9-15.4c5.5-9.6 17.8-12.8 27.3-7.3 9.6 5.5 12.8 17.8 7.3 27.3l-85.8 148.6h62.1c20.2 0 31.5 23.7 22.7 40zm98.1 0h-29l19.6 33.9c5.5 9.6 2.2 21.8-7.3 27.3-9.6 5.5-21.8 2.2-27.3-7.3-32.9-56.9-57.5-99.7-74-128.1-16.7-29-4.8-58 7.1-67.8 13.1 22.7 32.7 56.7 58.9 102h52c11 0 20 9 20 20 0 11.1-9 20-20 20z"},child:[]}]})(n)}function gUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"},child:[]}]})(n)}function vUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M325.3 234.3L104.6 13l280.8 161.2-60.1 60.1zM47 0C34 6.8 25.3 19.2 25.3 35.3v441.3c0 16.1 8.7 28.5 21.7 35.3l256.6-256L47 0zm425.2 225.6l-58.9-34.1-65.7 64.5 65.7 64.5 60.1-34.1c18-14.3 18-46.5-1.2-60.8zM104.6 499l280.8-161.2-60.1-60.1L104.6 499z"},child:[]}]})(n)}function yUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M446.7 98.6l-67.6 318.8c-5.1 22.5-18.4 28.1-37.3 17.5l-103-75.9-49.7 47.8c-5.5 5.5-10.1 10.1-20.7 10.1l7.4-104.9 190.9-172.5c8.3-7.4-1.8-11.5-12.9-4.1L117.8 284 16.2 252.2c-22.1-6.9-22.5-22.1 4.6-32.7L418.2 66.4c18.4-6.9 34.5 4.1 28.5 32.2z"},child:[]}]})(n)}function _Ue(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"},child:[]}]})(n)}function EUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(n)}function wUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(n)}function SUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(n)}function bUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"},child:[]}]})(n)}function CUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 544 512"},child:[{tag:"path",attr:{d:"M527.79 288H290.5l158.03 158.03c6.04 6.04 15.98 6.53 22.19.68 38.7-36.46 65.32-85.61 73.13-140.86 1.34-9.46-6.51-17.85-16.06-17.85zm-15.83-64.8C503.72 103.74 408.26 8.28 288.8.04 279.68-.59 272 7.1 272 16.24V240h223.77c9.14 0 16.82-7.68 16.19-16.8zM224 288V50.71c0-9.55-8.39-17.4-17.84-16.06C86.99 51.49-4.1 155.6.14 280.37 4.5 408.51 114.83 513.59 243.03 511.98c50.4-.63 96.97-16.87 135.26-44.03 7.9-5.6 8.42-17.23 1.57-24.08L224 288z"},child:[]}]})(n)}function TUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(n)}function RUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"},child:[]}]})(n)}function xUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C114.6 32 0 125.1 0 240c0 49.6 21.4 95 57 130.7C44.5 421.1 2.7 466 2.2 466.5c-2.2 2.3-2.8 5.7-1.5 8.7S4.8 480 8 480c66.3 0 116-31.8 140.6-51.4 32.7 12.3 69 19.4 107.4 19.4 141.4 0 256-93.1 256-208S397.4 32 256 32zM128 272c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"},child:[]}]})(n)}function AUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M528 448H112c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h416c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm64-320c-26.5 0-48 21.5-48 48 0 7.1 1.6 13.7 4.4 19.8L476 239.2c-15.4 9.2-35.3 4-44.2-11.6L350.3 85C361 76.2 368 63 368 48c0-26.5-21.5-48-48-48s-48 21.5-48 48c0 15 7 28.2 17.7 37l-81.5 142.6c-8.9 15.6-28.9 20.8-44.2 11.6l-72.3-43.4c2.7-6 4.4-12.7 4.4-19.8 0-26.5-21.5-48-48-48S0 149.5 0 176s21.5 48 48 48c2.6 0 5.2-.4 7.7-.8L128 416h384l72.3-192.8c2.5.4 5.1.8 7.7.8 26.5 0 48-21.5 48-48s-21.5-48-48-48z"},child:[]}]})(n)}function IUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"},child:[]}]})(n)}function NUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"},child:[]}]})(n)}function OUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"},child:[]}]})(n)}function PUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 56v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H24C10.745 32 0 42.745 0 56zm40 200c0-13.255 10.745-24 24-24s24 10.745 24 24-10.745 24-24 24-24-10.745-24-24zm272 256c-20.183 0-29.485-39.293-33.931-57.795-5.206-21.666-10.589-44.07-25.393-58.902-32.469-32.524-49.503-73.967-89.117-113.111a11.98 11.98 0 0 1-3.558-8.521V59.901c0-6.541 5.243-11.878 11.783-11.998 15.831-.29 36.694-9.079 52.651-16.178C256.189 17.598 295.709.017 343.995 0h2.844c42.777 0 93.363.413 113.774 29.737 8.392 12.057 10.446 27.034 6.148 44.632 16.312 17.053 25.063 48.863 16.382 74.757 17.544 23.432 19.143 56.132 9.308 79.469l.11.11c11.893 11.949 19.523 31.259 19.439 49.197-.156 30.352-26.157 58.098-59.553 58.098H350.723C358.03 364.34 384 388.132 384 430.548 384 504 336 512 312 512z"},child:[]}]})(n)}function LUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M104 224H24c-13.255 0-24 10.745-24 24v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V248c0-13.255-10.745-24-24-24zM64 472c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zM384 81.452c0 42.416-25.97 66.208-33.277 94.548h101.723c33.397 0 59.397 27.746 59.553 58.098.084 17.938-7.546 37.249-19.439 49.197l-.11.11c9.836 23.337 8.237 56.037-9.308 79.469 8.681 25.895-.069 57.704-16.382 74.757 4.298 17.598 2.244 32.575-6.148 44.632C440.202 511.587 389.616 512 346.839 512l-2.845-.001c-48.287-.017-87.806-17.598-119.56-31.725-15.957-7.099-36.821-15.887-52.651-16.178-6.54-.12-11.783-5.457-11.783-11.998v-213.77c0-3.2 1.282-6.271 3.558-8.521 39.614-39.144 56.648-80.587 89.117-113.111 14.804-14.832 20.188-37.236 25.393-58.902C282.515 39.293 291.817 0 312 0c24 0 72 8 72 81.452z"},child:[]}]})(n)}function DUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(n)}function kUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"},child:[]}]})(n)}function MUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"},child:[]}]})(n)}function jUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"},child:[]}]})(n)}function UUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 73.4-73.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-128 128z"},child:[]}]})(n)}function FUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"},child:[]}]})(n)}function BUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM105.8 229.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L216 328.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V314.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H158.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM160 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"},child:[]}]})(n)}function VUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"},child:[]}]})(n)}function zUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"},child:[]}]})(n)}function HUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M168.2 384.9c-15-5.4-31.7-3.1-44.6 6.4c-8.2 6-22.3 14.8-39.4 22.7c5.6-14.7 9.9-31.3 11.3-49.4c1-12.9-3.3-25.7-11.8-35.5C60.4 302.8 48 272 48 240c0-79.5 83.3-160 208-160s208 80.5 208 160s-83.3 160-208 160c-31.6 0-61.3-5.5-87.8-15.1zM26.3 423.8c-1.6 2.7-3.3 5.4-5.1 8.1l-.3 .5c-1.6 2.3-3.2 4.6-4.8 6.9c-3.5 4.7-7.3 9.3-11.3 13.5c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c5.1 0 10.2-.3 15.3-.8l.7-.1c4.4-.5 8.8-1.1 13.2-1.9c.8-.1 1.6-.3 2.4-.5c17.8-3.5 34.9-9.5 50.1-16.1c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"},child:[]}]})(n)}function GUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152V424c0 48.6 39.4 88 88 88H360c48.6 0 88-39.4 88-88V312c0-13.3-10.7-24-24-24s-24 10.7-24 24V424c0 22.1-17.9 40-40 40H88c-22.1 0-40-17.9-40-40V152c0-22.1 17.9-40 40-40H200c13.3 0 24-10.7 24-24s-10.7-24-24-24H88z"},child:[]}]})(n)}function WUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M400 255.4V240 208c0-8.8-7.2-16-16-16H352 336 289.5c-50.9 0-93.9 33.5-108.3 79.6c-3.3-9.4-5.2-19.8-5.2-31.6c0-61.9 50.1-112 112-112h48 16 32c8.8 0 16-7.2 16-16V80 64.6L506 160 400 255.4zM336 240h16v48c0 17.7 14.3 32 32 32h3.7c7.9 0 15.5-2.9 21.4-8.2l139-125.1c7.6-6.8 11.9-16.5 11.9-26.7s-4.3-19.9-11.9-26.7L409.9 8.9C403.5 3.2 395.3 0 386.7 0C367.5 0 352 15.5 352 34.7V80H336 304 288c-88.4 0-160 71.6-160 160c0 60.4 34.6 99.1 63.9 120.9c5.9 4.4 11.5 8.1 16.7 11.2c4.4 2.7 8.5 4.9 11.9 6.6c3.4 1.7 6.2 3 8.2 3.9c2.2 1 4.6 1.4 7.1 1.4h2.5c9.8 0 17.8-8 17.8-17.8c0-7.8-5.3-14.7-11.6-19.5l0 0c-.4-.3-.7-.5-1.1-.8c-1.7-1.1-3.4-2.5-5-4.1c-.8-.8-1.7-1.6-2.5-2.6s-1.6-1.9-2.4-2.9c-1.8-2.5-3.5-5.3-5-8.5c-2.6-6-4.3-13.3-4.3-22.4c0-36.1 29.3-65.5 65.5-65.5H304h32zM72 32C32.2 32 0 64.2 0 104V440c0 39.8 32.2 72 72 72H408c39.8 0 72-32.2 72-72V376c0-13.3-10.7-24-24-24s-24 10.7-24 24v64c0 13.3-10.7 24-24 24H72c-13.3 0-24-10.7-24-24V104c0-13.3 10.7-24 24-24h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H72z"},child:[]}]})(n)}function $Ue(n){return Le({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},child:[]}]})(n)}function KUe(n){return Le({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"},child:[]}]})(n)}function qUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"},child:[]},{tag:"path",attr:{d:"M16 2v4"},child:[]},{tag:"path",attr:{d:"M8 2v4"},child:[]},{tag:"path",attr:{d:"M3 10h5"},child:[]},{tag:"path",attr:{d:"M17.5 17.5 16 16.25V14"},child:[]},{tag:"path",attr:{d:"M22 16a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"},child:[]}]})(n)}function YUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"16",x2:"16",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"8",x2:"8",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",x2:"21",y1:"10",y2:"10"},child:[]},{tag:"path",attr:{d:"M8 14h.01"},child:[]},{tag:"path",attr:{d:"M12 14h.01"},child:[]},{tag:"path",attr:{d:"M16 14h.01"},child:[]},{tag:"path",attr:{d:"M8 18h.01"},child:[]},{tag:"path",attr:{d:"M12 18h.01"},child:[]},{tag:"path",attr:{d:"M16 18h.01"},child:[]}]})(n)}function XUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"16",x2:"16",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"8",x2:"8",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",x2:"21",y1:"10",y2:"10"},child:[]},{tag:"path",attr:{d:"M17 14h-6"},child:[]},{tag:"path",attr:{d:"M13 18H7"},child:[]},{tag:"path",attr:{d:"M7 14h.01"},child:[]},{tag:"path",attr:{d:"M17 18h.01"},child:[]}]})(n)}function JUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"7",height:"7",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"7",height:"7",x:"3",y:"14",rx:"1"},child:[]},{tag:"path",attr:{d:"M14 4h7"},child:[]},{tag:"path",attr:{d:"M14 9h7"},child:[]},{tag:"path",attr:{d:"M14 15h7"},child:[]},{tag:"path",attr:{d:"M14 20h7"},child:[]}]})(n)}function QUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2"},child:[]},{tag:"path",attr:{d:"M18 14h-8"},child:[]},{tag:"path",attr:{d:"M15 18h-5"},child:[]},{tag:"path",attr:{d:"M10 6h8v4h-8V6Z"},child:[]}]})(n)}function ZUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"},child:[]}]})(n)}function eFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8A5.87 5.87 0 0 1 6 12c0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"},child:[]}]})(n)}function tFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11 9.16V2c-5 .5-9 4.79-9 10s4 9.5 9 10v-7.16c-1-.41-2-1.52-2-2.84s1-2.43 2-2.84zM14.86 11H22c-.48-4.75-4-8.53-9-9v7.16c1 .3 1.52.98 1.86 1.84zM13 14.84V22c5-.47 8.52-4.25 9-9h-7.14c-.34.86-.86 1.54-1.86 1.84z"},child:[]}]})(n)}function nFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14 19.88V22h2.12l5.17-5.17-2.12-2.12zM20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H12v-2.95l8-8V8zm-7 1V3.5L18.5 9H13zM22.71 14l-.71-.71a.996.996 0 0 0-1.41 0l-.71.71L22 16.12l.71-.71a.996.996 0 0 0 0-1.41z"},child:[]}]})(n)}function iFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"},child:[]}]})(n)}function rFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"},child:[]}]})(n)}function sFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.5 21H2V9h5.5v12zm7.25-18h-5.5v18h5.5V3zM22 11h-5.5v10H22V11z"},child:[]}]})(n)}function aFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2 11.7V16h-4v-2.3C8.48 12.63 7 11.53 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.49-1.51 3.65-3 4.7z"},child:[]}]})(n)}function oFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z"},child:[]}]})(n)}function lFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6zM18 20H6V10h12v10z"},child:[]}]})(n)}function cFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"},child:[]}]})(n)}function dFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"},child:[]}]})(n)}function uFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"4"},child:[]},{tag:"path",attr:{d:"M9 15c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4zm7.76-9.64-1.68 1.69c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27zM20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14z"},child:[]}]})(n)}function hFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2zm-2-1h8v-2H5v2zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5zm4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6l-.63 1.37zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94L19 6z"},child:[]}]})(n)}function fFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20.5 16.5c-.83 0-1.5-.67-1.5-1.5v-2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V15c0 .83-.67 1.5-1.5 1.5zM20 20h1v-1.54c1.69-.24 3-1.7 3-3.46h-1a2.5 2.5 0 0 1-5 0h-1c0 1.76 1.31 3.22 3 3.46V20zM9 12c-2.21 0-4-1.79-4-4a3.999 3.999 0 0 1 5.34-3.77A5.938 5.938 0 0 0 9 8c0 1.43.5 2.74 1.34 3.77-.42.15-.87.23-1.34.23zm-1.89 1.13A4.965 4.965 0 0 0 5 17.22V20H1v-2.78c0-1.12.61-2.15 1.61-2.66 1.24-.64 2.76-1.19 4.5-1.43zM11 8c0-2.21 1.79-4 4-4s4 1.79 4 4-1.79 4-4 4-4-1.79-4-4zm7.32 12a4.997 4.997 0 0 1-2.82-4.5c0-.89.23-1.73.64-2.45-.37-.03-.75-.05-1.14-.05-2.53 0-4.71.7-6.39 1.56A2.97 2.97 0 0 0 7 17.22V20h11.32z"},child:[]}]})(n)}function pFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0zm.75.75h22.5v22.5H.75z"},child:[]},{tag:"path",attr:{d:"M14.94 4.66h-4.72l2.36-2.36zm-4.69 14.71h4.66l-2.33 2.33zM6.1 6.27 1.6 17.73h1.84l.92-2.45h5.11l.92 2.45h1.84L7.74 6.27H6.1zm-1.13 7.37 1.94-5.18 1.94 5.18H4.97zm10.76 2.5h6.12v1.59h-8.53v-1.29l5.92-8.56h-5.88v-1.6h8.3v1.26l-5.93 8.6z"},child:[]}]})(n)}function mFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.1 0-2 .9-2 2v8h2V5h18v16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]},{tag:"circle",attr:{cx:"9",cy:"10",r:"4"},child:[]},{tag:"path",attr:{d:"M15.39 16.56C13.71 15.7 11.53 15 9 15s-4.71.7-6.39 1.56A2.97 2.97 0 0 0 1 19.22V22h16v-2.78c0-1.12-.61-2.15-1.61-2.66z"},child:[]}]})(n)}function gFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19.1 17H22v-6c0-1.7-1.3-3-3-3h-9l9.1 9zm-.1-7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-1-3V3H6v1.1L9 7zM1.2 1.8 0 3l4.9 5C3.3 8.1 2 9.4 2 11v6h4v4h11.9l3 3 1.3-1.3-21-20.9zM8 19v-5h2.9l5 5H8z"},child:[]}]})(n)}function vFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M18 13h-.68l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2H6l-3 3v4c0 1.1.89 2 1.99 2H19a2 2 0 0 0 2-2v-4l-3-3zm-1-5.05-4.95 4.95-3.54-3.54 4.95-4.95L17 7.95zm-4.24-5.66L6.39 8.66a.996.996 0 0 0 0 1.41l4.95 4.95c.39.39 1.02.39 1.41 0l6.36-6.36a.996.996 0 0 0 0-1.41L14.16 2.3a.975.975 0 0 0-1.4-.01z"},child:[]}]})(n)}function yFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 8c-1.45 0-2.26 1.44-1.93 2.51l-3.55 3.56c-.3-.09-.74-.09-1.04 0l-2.55-2.55C12.27 10.45 11.46 9 10 9c-1.45 0-2.27 1.44-1.93 2.52l-4.56 4.55C2.44 15.74 1 16.55 1 18c0 1.1.9 2 2 2 1.45 0 2.26-1.44 1.93-2.51l4.55-4.56c.3.09.74.09 1.04 0l2.55 2.55C12.73 16.55 13.54 18 15 18c1.45 0 2.27-1.44 1.93-2.52l3.56-3.55c1.07.33 2.51-.48 2.51-1.93 0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"m15 9 .94-2.07L18 6l-2.06-.93L15 3l-.92 2.07L12 6l2.08.93zM3.5 11 4 9l2-.5L4 8l-.5-2L3 8l-2 .5L3 9z"},child:[]}]})(n)}function Jye(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"},child:[]}]})(n)}function _Fe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-6.43 9.57L12 15l-1.57-3.43L7 10l3.43-1.57L12 5l1.57 3.43L17 10l-3.43 1.57z"},child:[]}]})(n)}function EFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14.06 9.94 12 9l2.06-.94L15 6l.94 2.06L18 9l-2.06.94L15 12l-.94-2.06zM4 14l.94-2.06L7 11l-2.06-.94L4 8l-.94 2.06L1 11l2.06.94L4 14zm4.5-5 1.09-2.41L12 5.5 9.59 4.41 8.5 2 7.41 4.41 5 5.5l2.41 1.09L8.5 9zm-4 11.5 6-6.01 4 4L23 8.93l-1.41-1.41-7.09 7.97-4-4L3 19l1.5 1.5z"},child:[]}]})(n)}function wFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M23 7V1h-6v2H7V1H1v6h2v10H1v6h6v-2h10v2h6v-6h-2V7h2zM3 3h2v2H3V3zm2 18H3v-2h2v2zm12-2H7v-2H5V7h2V5h10v2h2v10h-2v2zm4 2h-2v-2h2v2zM19 5V3h2v2h-2zm-5.27 9h-3.49l-.73 2H7.89l3.4-9h1.4l3.41 9h-1.63l-.74-2zm-3.04-1.26h2.61L12 8.91l-1.31 3.83z"},child:[]}]})(n)}function SFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 2v20c-5.07-.5-9-4.79-9-10s3.93-9.5 9-10zm2.03 0v8.99H22c-.47-4.74-4.24-8.52-8.97-8.99zm0 11.01V22c4.74-.47 8.5-4.25 8.97-8.99h-8.97z"},child:[]}]})(n)}function bFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6z"},child:[]},{tag:"path",attr:{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-3.37 12.5-.8-2.3H12.2l-.82 2.3H9.81l3.38-9h1.61l3.38 9h-1.55z"},child:[]},{tag:"path",attr:{d:"m13.96 7.17-1.31 3.72h2.69l-1.3-3.72z"},child:[]}]})(n)}function CFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25L19 15z"},child:[]}]})(n)}function TFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.996.996 0 0 0-1.41 0L1.29 18.96a.996.996 0 0 0 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05a.996.996 0 0 0 0-1.41l-2.33-2.35zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12-2.44 2.44z"},child:[]}]})(n)}function RFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m10.1 15.9 1.42-1.42C8.79 12.05 7 10.41 7 8.85 7 7.8 7.8 7 8.85 7c1.11 0 1.54.65 2.68 2h.93c1.12-1.31 1.53-2 2.68-2 .87 0 1.55.54 1.77 1.32.35-.04.68-.06 1-.06.36 0 .7.03 1.03.08C18.7 6.43 17.13 5 15.15 5c-.12 0-.23.03-.35.04.12-.33.2-.67.2-1.04 0-1.66-1.34-3-3-3S9 2.34 9 4c0 .37.08.71.2 1.04-.12-.01-.23-.04-.35-.04C6.69 5 5 6.69 5 8.85c0 2.42 2.04 4.31 5.1 7.05z"},child:[]},{tag:"path",attr:{d:"M22.5 16.24c-.32-.18-.66-.29-1-.35.07-.1.15-.18.21-.28 1.08-1.87.46-4.18-1.41-5.26-2.09-1.21-4.76-.39-8.65.9l.52 1.94c3.47-1.14 5.79-1.88 7.14-1.1.91.53 1.2 1.61.68 2.53-.56.96-1.33 1-3.07 1.32l-.47.81c.58 1.62.97 2.33.39 3.32-.53.91-1.61 1.2-2.53.68-.06-.03-.11-.09-.17-.13-.3.67-.64 1.24-1.03 1.73.07.04.13.09.2.14 1.87 1.08 4.18.46 5.26-1.41.06-.1.09-.21.14-.32.22.27.48.51.8.69 1.43.83 3.27.34 4.1-1.1s.32-3.29-1.11-4.11z"},child:[]},{tag:"path",attr:{d:"M12.32 14.01c-.74 3.58-1.27 5.95-2.62 6.73-.91.53-2 .24-2.53-.68-.56-.96-.2-1.66.39-3.32l-.46-.81c-1.7-.31-2.5-.33-3.07-1.32-.53-.91-.24-2 .68-2.53.09-.05.19-.08.29-.11-.35-.56-.64-1.17-.82-1.85-.16.07-.32.14-.48.23-1.87 1.08-2.49 3.39-1.41 5.26.06.1.14.18.21.28-.34.06-.68.17-1 .35-1.43.83-1.93 2.66-1.1 4.1s2.66 1.93 4.1 1.1c.32-.18.58-.42.8-.69.05.11.08.22.14.32 1.08 1.87 3.39 2.49 5.26 1.41 2.09-1.21 2.71-3.93 3.55-7.94l-1.93-.53z"},child:[]}]})(n)}function xFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6.32 13.01c.96.02 1.85.5 2.45 1.34A3.961 3.961 0 0 0 12 16c1.29 0 2.5-.62 3.23-1.66.6-.84 1.49-1.32 2.45-1.34-.72-1.22-3.6-2-5.68-2-2.07 0-4.96.78-5.68 2.01zM4 13c1.66 0 3-1.34 3-3S5.66 7 4 7s-3 1.34-3 3 1.34 3 3 3zM20 13c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zM12 10c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z"},child:[]},{tag:"path",attr:{d:"M21 14h-3.27c-.77 0-1.35.45-1.68.92-.04.06-1.36 2.08-4.05 2.08-1.43 0-3.03-.64-4.05-2.08-.39-.55-1-.92-1.68-.92H3c-1.1 0-2 .9-2 2v4h7v-2.26c1.15.8 2.54 1.26 4 1.26s2.85-.46 4-1.26V20h7v-4c0-1.1-.9-2-2-2z"},child:[]}]})(n)}function AFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10.27 12h3.46a1.5 1.5 0 0 0 1.48-1.75l-.3-1.79a2.951 2.951 0 0 0-5.82.01l-.3 1.79c-.15.91.55 1.74 1.48 1.74zM1.66 11.11c-.13.26-.18.57-.1.88.16.69.76 1.03 1.53 1h1.95c.83 0 1.51-.58 1.51-1.29 0-.14-.03-.27-.07-.4-.01-.03-.01-.05.01-.08.09-.16.14-.34.14-.53 0-.31-.14-.6-.36-.82-.03-.03-.03-.06-.02-.1.07-.2.07-.43.01-.65a1.12 1.12 0 0 0-.99-.74.09.09 0 0 1-.07-.03C5.03 8.14 4.72 8 4.37 8c-.3 0-.57.1-.75.26-.03.03-.06.03-.09.02a1.24 1.24 0 0 0-1.7 1.03c0 .02-.01.04-.03.06-.29.26-.46.65-.41 1.05.03.22.12.43.25.6.03.02.03.06.02.09zM16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM22 11v-.5c0-1.1-.9-2-2-2h-2c-.42 0-.65.48-.39.81l.7.63c-.19.31-.31.67-.31 1.06 0 1.1.9 2 2 2s2-.9 2-2z"},child:[]}]})(n)}function IFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM12 12c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zM1.497 11 4 8.497 6.503 11 4 13.503zM20 9l-2.5 4h5z"},child:[]}]})(n)}function NFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 12.75c1.63 0 3.07.39 4.24.9 1.08.48 1.76 1.56 1.76 2.73V18H6v-1.61c0-1.18.68-2.26 1.76-2.73 1.17-.52 2.61-.91 4.24-.91zM4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29zM20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4 3.43c0-.81-.48-1.53-1.22-1.85A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57zM12 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z"},child:[]}]})(n)}function OFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z"},child:[]}]})(n)}function PFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"},child:[]}]})(n)}function LFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13 8c0-2.21-1.79-4-4-4S5 5.79 5 8s1.79 4 4 4 4-1.79 4-4zm2 2v2h3v3h2v-3h3v-2h-3V7h-2v3h-3zM1 18v2h16v-2c0-2.66-5.33-4-8-4s-8 1.34-8 4z"},child:[]}]})(n)}function DFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"},child:[]}]})(n)}function kFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19.94 9.06C19.5 5.73 16.57 3 13 3 9.47 3 6.57 5.61 6.08 9l-1.93 3.48c-.41.66.07 1.52.85 1.52h1v2c0 1.1.9 2 2 2h1v3h7v-4.68a7.016 7.016 0 0 0 3.94-7.26zM12.5 14c-.41 0-.74-.33-.74-.74s.33-.73.74-.73.73.32.73.73-.31.74-.73.74zm1.76-4.32c-.44.65-.86.85-1.09 1.27-.09.17-.13.28-.13.82h-1.06c0-.29-.04-.75.18-1.16.28-.51.83-.81 1.14-1.26.33-.47.15-1.36-.8-1.36-.62 0-.92.47-1.05.86l-.96-.4c.27-.78.97-1.45 2.01-1.45.86 0 1.45.39 1.75.88.26.43.41 1.22.01 1.8z"},child:[]}]})(n)}function MFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13 8.57a1.43 1.43 0 1 0 0 2.86 1.43 1.43 0 0 0 0-2.86z"},child:[]},{tag:"path",attr:{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2a.5.5 0 0 0 .4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68A6.999 6.999 0 0 0 13 3zm3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39a.19.19 0 0 1 .05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38a.2.2 0 0 1-.05.26l-.85.66c.03.12.04.25.04.39z"},child:[]}]})(n)}function jFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"6",r:"2"},child:[]},{tag:"path",attr:{d:"M21 16v-2c-2.24 0-4.16-.96-5.6-2.68l-1.34-1.6A1.98 1.98 0 0 0 12.53 9h-1.05c-.59 0-1.15.26-1.53.72l-1.34 1.6C7.16 13.04 5.24 14 3 14v2c2.77 0 5.19-1.17 7-3.25V15l-3.88 1.55c-.67.27-1.12.93-1.12 1.66C5 19.2 5.8 20 6.79 20H9v-.5a2.5 2.5 0 0 1 2.5-2.5h3c.28 0 .5.22.5.5s-.22.5-.5.5h-3c-.83 0-1.5.67-1.5 1.5v.5h7.21c.99 0 1.79-.8 1.79-1.79 0-.73-.45-1.39-1.12-1.66L14 15v-2.25c1.81 2.08 4.23 3.25 7 3.25z"},child:[]}]})(n)}function UFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"},child:[]}]})(n)}function FFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17 8H7c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-4 12.5h-2V19h2v1.5zm0-2.5h-2c0-1.5-2.5-3-2.5-5 0-1.93 1.57-3.5 3.5-3.5s3.5 1.57 3.5 3.5c0 2-2.5 3.5-2.5 5zm5-11.5H6C6 5.67 6.67 5 7.5 5h9c.83 0 1.5.67 1.5 1.5zm-1-3H7C7 2.67 7.67 2 8.5 2h7c.83 0 1.5.67 1.5 1.5z"},child:[]}]})(n)}function BFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2zm-7 5h5v5h-5z"},child:[]}]})(n)}function VFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M16.23 7h2.6c-.06-.47-.36-.94-.79-1.17L10.5 2 2.8 5.83c-.48.26-.8.81-.8 1.34V15c0 1.1.9 2 2 2V7.4L10.5 4l5.73 3z"},child:[]},{tag:"path",attr:{d:"M20 8H7c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm0 11H7v-7l6.5 3.33L20 12v7zm-6.5-5.67L7 10h13l-6.5 3.33z"},child:[]}]})(n)}function zFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2zm-2-1h8v-2H5v2zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5zm-2 0C14.5 6.47 12.03 4 9 4S3.5 6.47 3.5 9.5c0 2.47 1.49 3.89 2.35 4.5h6.3c.86-.61 2.35-2.03 2.35-4.5zm6.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6l-.63 1.37zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94L19 6z"},child:[]}]})(n)}function HFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20.5 16.5c-.83 0-1.5-.67-1.5-1.5v-2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V15c0 .83-.67 1.5-1.5 1.5zM20 20h1v-1.54c1.69-.24 3-1.7 3-3.46h-1a2.5 2.5 0 0 1-5 0h-1c0 1.76 1.31 3.22 3 3.46V20zM9 12c-2.21 0-4-1.79-4-4a3.999 3.999 0 0 1 5.34-3.77A5.938 5.938 0 0 0 9 8c0 1.43.5 2.74 1.34 3.77-.42.15-.87.23-1.34.23zm-1.89 1.13A4.965 4.965 0 0 0 5 17.22V20H1v-2.78c0-1.12.61-2.15 1.61-2.66 1.24-.64 2.76-1.19 4.5-1.43zM11 8c0-2.21 1.79-4 4-4s4 1.79 4 4-1.79 4-4 4-4-1.79-4-4zm2 0c0 1.1.9 2 2 2s2-.9 2-2-.9-2-2-2-2 .9-2 2zm2 7c-2.37 0-4.29.73-5.48 1.34-.32.16-.52.5-.52.88V18h7.17c.5.86 1.25 1.56 2.15 2H7v-2.78c0-1.12.61-2.15 1.61-2.66C10.29 13.7 12.47 13 15 13c.39 0 .77.02 1.14.05-.33.59-.55 1.26-.62 1.96-.17-.01-.34-.01-.52-.01z"},child:[]}]})(n)}function GFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M14.94 4.66h-4.72l2.36-2.36 2.36 2.36zm-4.69 14.71h4.66l-2.33 2.33-2.33-2.33zM6.1 6.27 1.6 17.73h1.84l.92-2.45h5.11l.92 2.45h1.84L7.74 6.27H6.1zm-1.13 7.37 1.94-5.18 1.94 5.18H4.97zm10.76 2.5h6.12v1.59h-8.53v-1.29l5.92-8.56h-5.88v-1.6h8.3v1.26l-5.93 8.6z"},child:[]}]})(n)}function WFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.1 0-2 .9-2 2v8h2V5h18v16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"M13 10c0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4 4-1.79 4-4zm-6 0c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2zM15.39 16.56C13.71 15.7 11.53 15 9 15s-4.71.7-6.39 1.56A2.97 2.97 0 0 0 1 19.22V22h16v-2.78c0-1.12-.61-2.15-1.61-2.66zM15 20H3c0-.72-.1-1.34.52-1.66C4.71 17.73 6.63 17 9 17c2.37 0 4.29.73 5.48 1.34.63.32.52.95.52 1.66z"},child:[]}]})(n)}function $Fe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"},child:[]}]})(n)}function KFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M22 8.98V18c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2l.01-12c0-1.1.89-2 1.99-2h10.1c-.06.32-.1.66-.1 1s.04.68.1 1H4l8 5 3.67-2.29c.47.43 1.02.76 1.63.98L12 13 4 8v10h16V9.9c.74-.15 1.42-.48 2-.92zM16 5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"},child:[]}]})(n)}function qFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21.99 8c0-.72-.37-1.35-.94-1.7L12 1 2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zm-2 0v.01L12 13 4 8l8-4.68L19.99 8zM4 18v-7.66l8 5.02 7.99-4.99L20 18H4z"},child:[]}]})(n)}function YFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M18 13h-.68l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2H6l-3 3v4c0 1.1.89 2 1.99 2H19a2 2 0 0 0 2-2v-4l-3-3zm1 7H5v-1h14v1zm-7.66-4.98c.39.39 1.02.39 1.41 0l6.36-6.36a.996.996 0 0 0 0-1.41L14.16 2.3a.975.975 0 0 0-1.4-.01L6.39 8.66a.996.996 0 0 0 0 1.41l4.95 4.95zm2.12-10.61L17 7.95l-4.95 4.95-3.54-3.54 4.95-4.95z"},child:[]}]})(n)}function XFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 8c-1.45 0-2.26 1.44-1.93 2.51l-3.55 3.56c-.3-.09-.74-.09-1.04 0l-2.55-2.55C12.27 10.45 11.46 9 10 9c-1.45 0-2.27 1.44-1.93 2.52l-4.56 4.55C2.44 15.74 1 16.55 1 18c0 1.1.9 2 2 2 1.45 0 2.26-1.44 1.93-2.51l4.55-4.56c.3.09.74.09 1.04 0l2.55 2.55C12.73 16.55 13.54 18 15 18c1.45 0 2.27-1.44 1.93-2.52l3.56-3.55c1.07.33 2.51-.48 2.51-1.93 0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"m15 9 .94-2.07L18 6l-2.06-.93L15 3l-.92 2.07L12 6l2.08.93zM3.5 11 4 9l2-.5L4 8l-.5-2L3 8l-2 .5L3 9z"},child:[]}]})(n)}function JFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0-8 4.99L4 6h16zm0 12H4V8l8 5 8-5v10z"},child:[]}]})(n)}function QFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M3 10h11v2H3v-2zm0-2h11V6H3v2zm0 8h7v-2H3v2zm15.01-3.13.71-.71a.996.996 0 0 1 1.41 0l.71.71c.39.39.39 1.02 0 1.41l-.71.71-2.12-2.12zm-.71.71-5.3 5.3V21h2.12l5.3-5.3-2.12-2.12z"},child:[]}]})(n)}function ZFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M23 7V1h-6v2H7V1H1v6h2v10H1v6h6v-2h10v2h6v-6h-2V7h2zM3 3h2v2H3V3zm2 18H3v-2h2v2zm12-2H7v-2H5V7h2V5h10v2h2v10h-2v2zm4 2h-2v-2h2v2zM19 5V3h2v2h-2zm-5.27 9h-3.49l-.73 2H7.89l3.4-9h1.4l3.41 9h-1.63l-.74-2zm-3.04-1.26h2.61L12 8.91l-1.31 3.83z"},child:[]}]})(n)}function eBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6zm-2 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"},child:[]}]})(n)}function tBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zM11.5 9.5 9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99-2.18.99z"},child:[]}]})(n)}function nBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"circle",attr:{cx:"4",cy:"14",r:"2"},child:[]},{tag:"path",attr:{d:"M1.22 17.58A2.01 2.01 0 0 0 0 19.43V21h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58z"},child:[]},{tag:"circle",attr:{cx:"20",cy:"14",r:"2"},child:[]},{tag:"path",attr:{d:"M22.78 17.58A6.95 6.95 0 0 0 20 17c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V21H24v-1.57c0-.81-.48-1.53-1.22-1.85zM16.24 16.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 19.39V21h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 19a.96.96 0 0 1 .49-.52c1.1-.49 2.26-.73 3.43-.73 1.18 0 2.33.25 3.43.73.23.1.4.29.49.52H8.07zM9 12c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3zm4 0c0 .55-.45 1-1 1s-1-.45-1-1 .45-1 1-1 1 .45 1 1z"},child:[]},{tag:"path",attr:{d:"M2.48 10.86C2.17 10.1 2 9.36 2 8.6 2 6.02 4.02 4 6.6 4c2.68 0 3.82 1.74 5.4 3.59C13.57 5.76 14.7 4 17.4 4 19.98 4 22 6.02 22 8.6c0 .76-.17 1.5-.48 2.26.65.31 1.18.82 1.53 1.44.6-1.2.95-2.42.95-3.7C24 4.9 21.1 2 17.4 2c-2.09 0-4.09.97-5.4 2.51C10.69 2.97 8.69 2 6.6 2 2.9 2 0 4.9 0 8.6c0 1.28.35 2.5.96 3.7.35-.62.88-1.13 1.52-1.44z"},child:[]}]})(n)}function iBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10.27 12h3.46a1.5 1.5 0 0 0 1.48-1.75l-.3-1.79a2.951 2.951 0 0 0-5.82.01l-.3 1.79c-.15.91.55 1.74 1.48 1.74zm.79-3.21c.08-.46.47-.79.94-.79s.86.33.94.79l.2 1.21h-2.28l.2-1.21zM1.66 11.11c-.13.26-.18.57-.1.88.16.69.76 1.03 1.53 1h1.95c.83 0 1.51-.58 1.51-1.29 0-.14-.03-.27-.07-.4-.01-.03-.01-.05.01-.08.09-.16.14-.34.14-.53 0-.31-.14-.6-.36-.82-.03-.03-.03-.06-.02-.1.07-.2.07-.43.01-.65a1.12 1.12 0 0 0-.99-.74.09.09 0 0 1-.07-.03C5.03 8.14 4.72 8 4.37 8c-.3 0-.57.1-.75.26-.03.03-.06.03-.09.02a1.24 1.24 0 0 0-1.7 1.03c0 .02-.01.04-.03.06-.29.26-.46.65-.41 1.05.03.22.12.43.25.6.03.02.03.06.02.09zM16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 16a.96.96 0 0 1 .49-.52c1.1-.49 2.26-.73 3.43-.73 1.18 0 2.33.25 3.43.73.23.1.4.29.49.52H8.07zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM22 11v-.5c0-1.1-.9-2-2-2h-2c-.42 0-.65.48-.39.81l.7.63c-.19.31-.31.67-.31 1.06 0 1.1.9 2 2 2s2-.9 2-2z"},child:[]}]})(n)}function rBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 16a.96.96 0 0 1 .49-.52c1.1-.49 2.26-.73 3.43-.73 1.18 0 2.33.25 3.43.73.23.1.4.29.49.52H8.07zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM12 12c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm0-4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM1.497 11 4 8.497 6.503 11 4 13.503zM20 9l-2.5 4h5z"},child:[]}]})(n)}function sBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29zM20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4 3.43c0-.81-.48-1.53-1.22-1.85A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69H8.07zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"},child:[]}]})(n)}function aBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.67 13.13C18.04 14.06 19 15.32 19 17v3h4v-3c0-2.18-3.57-3.47-6.33-3.87zM15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4c-.47 0-.91.1-1.33.24a5.98 5.98 0 0 1 0 7.52c.42.14.86.24 1.33.24zM9 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zM9 13c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4zm6 5H3v-.99C3.2 16.29 6.3 15 9 15s5.8 1.29 6 2v1z"},child:[]}]})(n)}function oBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM8 14V16H6V14H8ZM18 14V16H10V14H18ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z"},child:[]}]})(n)}function lBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.8611 2.39057C12.8495 1.73163 14.1336 1.71797 15.1358 2.35573L19.291 4.99994H20.9998C21.5521 4.99994 21.9998 5.44766 21.9998 5.99994V14.9999C21.9998 15.5522 21.5521 15.9999 20.9998 15.9999H19.4801C19.5396 16.9472 19.0933 17.9102 18.1955 18.4489L13.1021 21.505C12.4591 21.8907 11.6609 21.8817 11.0314 21.4974C10.3311 22.1167 9.2531 22.1849 8.47104 21.5704L3.33028 17.5312C2.56387 16.9291 2.37006 15.9003 2.76579 15.0847C2.28248 14.7057 2 14.1254 2 13.5109V6C2 5.44772 2.44772 5 3 5H7.94693L11.8611 2.39057ZM4.17264 13.6452L4.86467 13.0397C6.09488 11.9632 7.96042 12.0698 9.06001 13.2794L11.7622 16.2518C12.6317 17.2083 12.7903 18.6135 12.1579 19.739L17.1665 16.7339C17.4479 16.5651 17.5497 16.2276 17.4448 15.9433L13.0177 9.74551C12.769 9.39736 12.3264 9.24598 11.9166 9.36892L9.43135 10.1145C8.37425 10.4316 7.22838 10.1427 6.44799 9.36235L6.15522 9.06958C5.58721 8.50157 5.44032 7.69318 5.67935 7H4V13.5109L4.17264 13.6452ZM14.0621 4.04306C13.728 3.83047 13.3 3.83502 12.9705 4.05467L7.56943 7.65537L7.8622 7.94814C8.12233 8.20827 8.50429 8.30456 8.85666 8.19885L11.3419 7.45327C12.5713 7.08445 13.8992 7.53859 14.6452 8.58303L18.5144 13.9999H19.9998V6.99994H19.291C18.9106 6.99994 18.5381 6.89148 18.2172 6.68727L14.0621 4.04306ZM6.18168 14.5448L4.56593 15.9586L9.70669 19.9978L10.4106 18.7659C10.6256 18.3897 10.5738 17.9178 10.2823 17.5971L7.58013 14.6247C7.2136 14.2215 6.59175 14.186 6.18168 14.5448Z"},child:[]}]})(n)}function cBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 4H21C21.5523 4 22 4.44772 22 5V19C22 19.5523 21.5523 20 21 20H3C2.44772 20 2 19.5523 2 19V5C2 4.44772 2.44772 4 3 4Z"},child:[]}]})(n)}function dBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 4H21C21.5523 4 22 4.44772 22 5V19C22 19.5523 21.5523 20 21 20H3C2.44772 20 2 19.5523 2 19V5C2 4.44772 2.44772 4 3 4ZM4 6V18H20V6H4Z"},child:[]}]})(n)}function uBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12 5C13.018 5 13.9852 5.21731 14.8579 5.60806L13.2954 7.16944C12.8822 7.05892 12.448 7 12 7C9.23858 7 7 9.23858 7 12C7 13.3807 7.55964 14.6307 8.46447 15.5355L7.05025 16.9497L6.89445 16.7889C5.71957 15.5368 5 13.8525 5 12C5 8.13401 8.13401 5 12 5ZM18.3924 9.14312C18.7829 10.0155 19 10.9824 19 12C19 13.933 18.2165 15.683 16.9497 16.9497L15.5355 15.5355C16.4404 14.6307 17 13.3807 17 12C17 11.552 16.9411 11.1178 16.8306 10.7046L18.3924 9.14312ZM16.2426 6.34315L17.6569 7.75736L13.9325 11.483C13.9765 11.6479 14 11.8212 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C12.1788 10 12.3521 10.0235 12.517 10.0675L16.2426 6.34315Z"},child:[]}]})(n)}function hBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM7 6H11V10H7V6ZM7 12H17V14H7V12ZM7 16H17V18H7V16ZM13 7H17V9H13V7Z"},child:[]}]})(n)}function fBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"},child:[]}]})(n)}function pBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9.97308 18H14.0269C14.1589 16.7984 14.7721 15.8065 15.7676 14.7226C15.8797 14.6006 16.5988 13.8564 16.6841 13.7501C17.5318 12.6931 18 11.385 18 10C18 6.68629 15.3137 4 12 4C8.68629 4 6 6.68629 6 10C6 11.3843 6.46774 12.6917 7.31462 13.7484C7.40004 13.855 8.12081 14.6012 8.23154 14.7218C9.22766 15.8064 9.84103 16.7984 9.97308 18ZM14 20H10V21H14V20ZM5.75395 14.9992C4.65645 13.6297 4 11.8915 4 10C4 5.58172 7.58172 2 12 2C16.4183 2 20 5.58172 20 10C20 11.8925 19.3428 13.6315 18.2443 15.0014C17.624 15.7748 16 17 16 18.5V21C16 22.1046 15.1046 23 14 23H10C8.89543 23 8 22.1046 8 21V18.5C8 17 6.37458 15.7736 5.75395 14.9992ZM13 10.0048H15.5L11 16.0048V12.0048H8.5L13 6V10.0048Z"},child:[]}]})(n)}function mBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V11H19L18.9999 6.413L11.2071 14.2071L9.79289 12.7929L17.5849 5H13V3H21Z"},child:[]}]})(n)}function gBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 14V16C8.68629 16 6 18.6863 6 22H4C4 17.5817 7.58172 14 12 14ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11ZM18 21.5L15.0611 23.0451L15.6224 19.7725L13.2447 17.4549L16.5305 16.9775L18 14L19.4695 16.9775L22.7553 17.4549L20.3776 19.7725L20.9389 23.0451L18 21.5Z"},child:[]}]})(n)}function vBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M1023.31 473.28c-1.36-11.312-5.614-21.713-12.095-30.465h.16l-.88-.88c-3.28-4.32-7.12-8.128-11.408-11.504L831.935 262.047V158.783c0-17.68-14.32-32-32-32H698.607l-116.8-99.711c-36.223-36.224-99.504-36.289-135.776 0l-116.4 99.711H223.935c-17.68 0-32 14.32-32 32V264.16L28.815 427.28c-17.343 11.472-28.88 31.088-28.88 53.344v479.504c0 35.184 28.817 64 64 64h896c35.184 0 64-28.816 64-64v-478.24c.224-2.88-.064-5.76-.624-8.607zM268.865 725.503L63.937 915.582V544.686zm61.697 29.999a31.634 31.634 0 0 0 11.377-8.224c1.712-1.935 3.056-4.063 4.224-6.255l137.904-127.936c7.248-5.84 15.84-8.913 24.88-8.913 9.183 0 18.367 3.216 24.527 8l383.84 347.936H110.002zm427.777-25.776l201.6-178.896v361.632zm139.599-313.104h-.976l54.896 55.792-119.92 106.432V350.638zM491.283 72.318c6.064-6.032 14.095-9.376 22.623-9.376 8.56 0 16.592 3.344 22.656 9.376l64.624 54.464H426.754zm276.655 118.464V635.63l-57.312 50.88-136.32-123.568c-37.68-29.536-91.775-30.817-131.68 1.376l-126.624 117.44-60.064-53.008V190.782zM103.777 442.813l88.16-88.129V572.3L75.313 469.404l26.992-26.592h1.472z"},child:[]}]})(n)}function yBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M1023.46 232a31.629 31.629 0 0 0-2.48-18.271C1012.917 178.288 987.3 160 944.005 160h-832c-38.08 0-79.105 14-99.28 41.472-1.745 1.328-3.409 2.832-4.912 4.576-6.449 7.44-8.705 17.009-7.264 26.033-.288 2.592-.544 5.2-.544 7.92v512c0 53.024 58.992 112 112 112h832c53.024 0 80-58.976 80-112v-512c0-2.832-.368-5.313-.544-8.001zm-911.459-8l832.001-.001h.432L512.002 568.655 81.314 225.407C91.106 223.599 103.154 224 112 224zm832.001 575.999H112.003c-17.648 0-48-30.336-48-48V293.551l427.04 341.648c6.016 5.2 13.487 7.792 20.959 7.792a32.046 32.046 0 0 0 20.976-7.792l427.024-341.632v458.432c0 17.664 1.664 48-16 48z"},child:[]}]})(n)}function _Be(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 17 16"},child:[{tag:"path",attr:{d:"M16 15v-1h-1v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-1v1h-1v1h17v-1h-1z"},child:[]},{tag:"path",attr:{d:"M8 0h1l8 5v1h-17v-1l8-5z"},child:[]}]})(n)}function EBe(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 0c-2.761 0-5 2.239-5 5 0 0.313 0.029 0.619 0.084 0.916l-6.084 6.084v3c0 0.552 0.448 1 1 1h1v-1h2v-2h2v-2h2l1.298-1.298c0.531 0.192 1.105 0.298 1.702 0.298 2.761 0 5-2.239 5-5s-2.239-5-5-5zM12.498 5.002c-0.828 0-1.5-0.672-1.5-1.5s0.672-1.5 1.5-1.5 1.5 0.672 1.5 1.5-0.672 1.5-1.5 1.5z"},child:[]}]})(n)}function wBe(n){return Le({tag:"svg",attr:{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#FFC107",d:`M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\r
c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24\r
c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z`},child:[]},{tag:"path",attr:{fill:"#FF3D00",d:`M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657\r
C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z`},child:[]},{tag:"path",attr:{fill:"#4CAF50",d:`M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\r
c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z`},child:[]},{tag:"path",attr:{fill:"#1976D2",d:`M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\r
c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z`},child:[]}]})(n)}function SBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 2H13V1h-1v1H4V1H3v1H1.5l-.5.5v12l.5.5h13l.5-.5v-12l-.5-.5zM14 14H2V5h12v9zm0-10H2V3h12v1zM4 8H3v1h1V8zm-1 2h1v1H3v-1zm1 2H3v1h1v-1zm2-4h1v1H6V8zm1 2H6v1h1v-1zm-1 2h1v1H6v-1zm1-6H6v1h1V6zm2 2h1v1H9V8zm1 2H9v1h1v-1zm-1 2h1v1H9v-1zm1-6H9v1h1V6zm2 2h1v1h-1V8zm1 2h-1v1h1v-1zm-1-4h1v1h-1V6z"},child:[]}]})(n)}function bBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M3.889 2.095a6.5 6.5 0 1 1 7.222 10.81A6.5 6.5 0 0 1 3.89 2.094zm.555 9.978A5.5 5.5 0 0 0 7.5 13 5.506 5.506 0 0 0 13 7.5a5.5 5.5 0 1 0-8.556 4.573zM10.294 4l.706.707-2.15 2.15a1.514 1.514 0 1 1-.707-.707L10.293 4zM7.221 7.916a.5.5 0 1 0 .556-.832.5.5 0 0 0-.556.832zm4.286-2.449l-.763.763c.166.403.253.834.255 1.27a3.463 3.463 0 0 1-.5 1.777l.735.735a4.477 4.477 0 0 0 .274-4.545h-.001zM8.733 4.242A3.373 3.373 0 0 0 7.5 4 3.5 3.5 0 0 0 4 7.5a3.46 3.46 0 0 0 .5 1.777l-.734.735A4.5 4.5 0 0 1 9.5 3.473l-.767.769z"},child:[]}]})(n)}function CBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M13.85 4.44l-3.28-3.3-.35-.14H2.5l-.5.5V7h1V2h6v3.5l.5.5H13v1h1V4.8l-.15-.36zM10 5V2l3 3h-3zM2.5 8l-.5.5v6l.5.5h11l.5-.5v-6l-.5-.5h-11zM13 13v1H3V9h10v4zm-8-1h-.32v1H4v-3h1.06c.75 0 1.13.36 1.13 1a.94.94 0 0 1-.32.72A1.33 1.33 0 0 1 5 12zm-.06-1.45h-.26v.93h.26c.36 0 .54-.16.54-.47 0-.31-.18-.46-.54-.46zM9 12.58a1.48 1.48 0 0 0 .44-1.12c0-1-.53-1.46-1.6-1.46H6.78v3h1.06A1.6 1.6 0 0 0 9 12.58zm-1.55-.13v-1.9h.33a.94.94 0 0 1 .7.25.91.91 0 0 1 .25.67 1 1 0 0 1-.25.72.94.94 0 0 1-.69.26h-.34zm4.45-.61h-.97V13h-.68v-3h1.74v.55h-1.06v.74h.97v.55z"},child:[]}]})(n)}function TBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.02 3.77v1.56l1-.99V2.5l-.5-.5h-9l-.5.5v.486L2 3v10.29l.36.46 5 1.72L8 15v-1h3.52l.5-.5v-1.81l-1-1V13H8V4.71l-.33-.46L4.036 3h6.984v.77zM7 14.28l-4-1.34V3.72l4 1.34v9.22zm6.52-5.8H8.55v-1h4.93l-1.6-1.6.71-.7 2.47 2.46v.71l-2.49 2.48-.7-.7 1.65-1.65z"},child:[]}]})(n)}function RBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M152,180a40.55,40.55,0,0,1-20,34.91A8,8,0,0,1,124,201.09a24.49,24.49,0,0,0,0-42.18A8,8,0,0,1,132,145.09,40.55,40.55,0,0,1,152,180ZM99.06,128.61a8,8,0,0,0-8.72,1.73L68.69,152H48a8,8,0,0,0-8,8v40a8,8,0,0,0,8,8H68.69l21.65,21.66A8,8,0,0,0,104,224V136A8,8,0,0,0,99.06,128.61ZM216,88V216a16,16,0,0,1-16,16H168a8,8,0,0,1,0-16h32V96H152a8,8,0,0,1-8-8V40H56v80a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Z"},child:[]}]})(n)}function xBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M112,216a8,8,0,0,1-8,8H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h56a8,8,0,0,1,0,16H48V208h56A8,8,0,0,1,112,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L196.69,120H104a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,221.66,122.34Z"},child:[]}]})(n)}function ABe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"13",r:"4"},child:[]}]})(n)}function IBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 3 Z M 8 5 L 24 5 L 24 27 L 8 27 Z M 16 9.71875 L 16 16.1875 C 15.683594 16.074219 15.351563 16 15 16 C 13.355469 16 12 17.355469 12 19 C 12 20.644531 13.355469 22 15 22 C 16.644531 22 18 20.644531 18 19 L 18 12.28125 L 20.75 12.96875 L 21.25 11.03125 Z M 15 18 C 15.5625 18 16 18.4375 16 19 C 16 19.5625 15.5625 20 15 20 C 14.4375 20 14 19.5625 14 19 C 14 18.4375 14.4375 18 15 18 Z"},child:[]}]})(n)}function NBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 9.59375 L 25.71875 9.28125 L 19.71875 3.28125 L 19.40625 3 Z M 8 5 L 18 5 L 18 11 L 24 11 L 24 27 L 8 27 Z M 20 6.4375 L 22.5625 9 L 20 9 Z M 21.09375 14 C 20.542969 14 20.09375 14.449219 20.09375 15 C 20.09375 15.550781 20.542969 16 21.09375 16 C 21.644531 16 22.09375 15.550781 22.09375 15 C 22.09375 14.449219 21.644531 14 21.09375 14 Z M 14 15.59375 L 13.28125 16.28125 L 9.28125 20.28125 L 10.71875 21.71875 L 14 18.4375 L 16.28125 20.71875 L 17 21.40625 L 17.71875 20.71875 L 19 19.4375 L 21.28125 21.71875 L 22.71875 20.28125 L 19.71875 17.28125 L 19 16.59375 L 18.28125 17.28125 L 17 18.5625 L 14.71875 16.28125 Z"},child:[]}]})(n)}function OBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 3 Z M 8 5 L 24 5 L 24 27 L 8 27 Z M 15.40625 10.34375 C 15.101563 10.339844 14.746094 10.449219 14.5 10.65625 C 14.246094 10.871094 14.132813 11.136719 14.0625 11.40625 C 13.925781 11.945313 13.964844 12.503906 14.09375 13.125 C 14.246094 13.851563 14.679688 14.726563 15.03125 15.5625 C 14.851563 16.324219 14.804688 17 14.53125 17.78125 C 14.296875 18.453125 13.996094 18.839844 13.71875 19.4375 C 13.089844 19.675781 12.339844 19.816406 11.84375 20.125 C 11.308594 20.457031 10.839844 20.824219 10.5625 21.34375 C 10.285156 21.863281 10.316406 22.597656 10.6875 23.125 C 10.871094 23.402344 11.113281 23.621094 11.4375 23.75 C 11.761719 23.878906 12.113281 23.882813 12.40625 23.78125 C 12.996094 23.578125 13.414063 23.125 13.8125 22.59375 C 14.183594 22.101563 14.445313 21.265625 14.78125 20.59375 C 15.285156 20.425781 15.648438 20.214844 16.1875 20.09375 C 16.75 19.96875 17.128906 20.027344 17.65625 19.96875 C 17.882813 20.226563 18.074219 20.640625 18.3125 20.84375 C 18.789063 21.257813 19.3125 21.585938 19.9375 21.625 C 20.5625 21.664063 21.1875 21.273438 21.53125 20.6875 L 21.5625 20.6875 L 21.5625 20.65625 C 21.714844 20.390625 21.820313 20.101563 21.8125 19.78125 C 21.804688 19.460938 21.644531 19.125 21.4375 18.90625 C 21.027344 18.46875 20.503906 18.355469 19.9375 18.28125 C 19.5 18.222656 18.890625 18.378906 18.375 18.40625 C 17.921875 17.808594 17.472656 17.359375 17.0625 16.59375 C 16.839844 16.179688 16.78125 15.828125 16.59375 15.40625 C 16.738281 14.726563 17.023438 13.96875 17.0625 13.375 C 17.109375 12.65625 17.082031 12.035156 16.875 11.46875 C 16.769531 11.183594 16.601563 10.902344 16.34375 10.6875 C 16.09375 10.480469 15.769531 10.351563 15.4375 10.34375 C 15.425781 10.34375 15.417969 10.34375 15.40625 10.34375 Z M 16.0625 17.75 C 16.242188 18.066406 16.464844 18.265625 16.65625 18.5625 C 16.375 18.613281 16.160156 18.5625 15.875 18.625 C 15.828125 18.636719 15.796875 18.675781 15.75 18.6875 C 15.808594 18.53125 15.882813 18.4375 15.9375 18.28125 C 16 18.097656 16.003906 17.933594 16.0625 17.75 Z M 19.75 19.78125 C 20.085938 19.824219 20.207031 19.886719 20.25 19.90625 C 20.242188 19.921875 20.261719 19.917969 20.25 19.9375 C 20.125 20.144531 20.113281 20.128906 20.03125 20.125 C 19.964844 20.121094 19.710938 19.984375 19.46875 19.8125 C 19.539063 19.816406 19.6875 19.773438 19.75 19.78125 Z M 12.75 21.34375 C 12.695313 21.425781 12.648438 21.617188 12.59375 21.6875 C 12.289063 22.09375 12.007813 22.28125 11.9375 22.3125 C 11.925781 22.296875 11.957031 22.3125 11.9375 22.28125 L 11.90625 22.28125 C 11.804688 22.136719 11.832031 22.195313 11.90625 22.0625 C 11.980469 21.929688 12.214844 21.660156 12.625 21.40625 C 12.65625 21.386719 12.71875 21.363281 12.75 21.34375 Z"},child:[]}]})(n)}function PBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 9.59375 L 25.71875 9.28125 L 19.71875 3.28125 L 19.40625 3 Z M 8 5 L 18 5 L 18 11 L 24 11 L 24 27 L 8 27 Z M 20 6.4375 L 22.5625 9 L 20 9 Z M 13 13.21875 L 13 22.78125 L 14.5 21.84375 L 19.5 18.84375 L 20.9375 18 L 19.5 17.15625 L 14.5 14.15625 Z M 15 16.75 L 17.09375 18 L 15 19.25 Z"},child:[]}]})(n)}const En=[{title:"FaBars",category:"general",tag:"menubar1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(bUe,{})},{title:"FaSignOutAlt",category:"general",tag:"logout1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(OUe,{})},{title:"AiOutlineLogout",category:"general",tag:"logout2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(C7e,{})},{title:"VscSignOut",category:"general",tag:"logout3",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(TBe,{})},{title:"PiSignOut",category:"general",tag:"logout4",familyName:"Phosphor Icons",familyCode:"pi",component:h.jsx(xBe,{})},{title:"BsPlusCircle",category:"general",tag:"add1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(U9e,{})},{title:"BsPlus",category:"general",tag:"add2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(F9e,{})},{title:"AiOutlinePlus",category:"general",tag:"add3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(N7e,{})},{title:"BsMoonStarsFill",category:"general",tag:"theme-light1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(E9e,{})},{title:"BsFillSunFill",category:"general",tag:"theme-dark1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(Y7e,{})},{title:"BsPlayCircleFill",category:"general",tag:"play1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(M9e,{})},{title:"BsPlayBtnFill",category:"general",tag:"play2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(D9e,{})},{title:"BsPlayFill",category:"general",tag:"play3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(j9e,{})},{title:"BsExclamationCircle",category:"general",tag:"warning1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(KU,{})},{title:"BsFillExclamationTriangleFill",category:"general",tag:"warning2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(z7e,{})},{title:"BsFillExclamationCircleFill",category:"general",tag:"warning3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(V7e,{})},{title:"BsInfoCircle",category:"general",tag:"info1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(_9e,{})},{title:"BsFillInfoCircleFill",category:"general",tag:"info2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(W7e,{})},{title:"MdSend",category:"general",tag:"send1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(Jye,{})},{title:"FaTelegramPlane",category:"general",tag:"send2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(yUe,{})},{title:"BiPaperPlane",category:"general",tag:"send3",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(Jje,{})},{title:"BsGear",category:"general",tag:"settings1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(f9e,{})},{title:"GoGear",category:"general",tag:"settings2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(eje,{})},{title:"BsGearFill",category:"general",tag:"settings3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(h9e,{})},{title:"BsFillEyeFill",category:"general",tag:"view1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(H7e,{})},{title:"BsFillEyeSlashFill",category:"general",tag:"hide1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(G7e,{})},{title:"BsCheck",category:"general",tag:"check1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(i9e,{})},{title:"BsFillCheckCircleFill",category:"general",tag:"check2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(B7e,{})},{title:"BsCheckCircleFill",category:"general",tag:"check3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(n9e,{})},{title:"BsSearch",category:"general",tag:"search1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(V9e,{})},{title:"FaCrown",category:"general",tag:"crown1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(AUe,{})},{title:"BsClockHistory",category:"general",tag:"date1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(s9e,{})},{title:"TbCalendarTime",category:"general",tag:"date2",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(Vje,{})},{title:"TbCalendarStats",category:"general",tag:"date3",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(Bje,{})},{title:"VscCalendar",category:"general",tag:"date4",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(SBe,{})},{title:"LuCalendarClock",category:"general",tag:"date5",familyName:"Lucide",familyCode:"lu",component:h.jsx(qUe,{})},{title:"LuCalendarDays",category:"general",tag:"date6",familyName:"Lucide",familyCode:"lu",component:h.jsx(YUe,{})},{title:"LuCalendarRange",category:"general",tag:"date7",familyName:"Lucide",familyCode:"lu",component:h.jsx(XUe,{})},{title:"TfiDashboard",category:"general",tag:"metrics1",familyName:"Themify Icons",familyCode:"tfi",component:h.jsx(qje,{})},{title:"RiDashboard2Line",category:"general",tag:"metrics2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(uBe,{})},{title:"VscDashboard",category:"general",tag:"metrics3",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(bBe,{})},{title:"BsPerson",category:"general",tag:"user1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(L9e,{})},{title:"MdPerson",category:"general",tag:"user2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(DFe,{})},{title:"BsFillPersonFill",category:"general",tag:"user3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(K7e,{})},{title:"FiCamera",category:"general",tag:"camera1",familyName:"Feather",familyCode:"fi",component:h.jsx(ABe,{})},{title:"IoCallOutline",category:"general",tag:"call1",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(lUe,{})},{title:"HiOutlinePhone",category:"general",tag:"call2",familyName:"Heroicons",familyCode:"hi",component:h.jsx(KUe,{})},{title:"TbPhone",category:"general",tag:"call3",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(Wje,{})},{title:"AiOutlineHome",category:"general",tag:"home1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(b7e,{})},{title:"BsCircle",category:"general",tag:"circle1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(r9e,{})},{title:"FaThumbsUp",category:"general",tag:"upvote1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(LUe,{})},{title:"FaThumbsDown",category:"general",tag:"downvote1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(PUe,{})},{title:"BiSolidMap",category:"general",tag:"location1",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(Zje,{})},{title:"FaKey",category:"general",tag:"key1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(NUe,{})},{title:"IoKey",category:"general",tag:"key2",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(uUe,{})},{title:"IoKeyOutline",category:"general",tag:"key3",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(dUe,{})},{title:"ImKey",category:"general",tag:"key4",familyName:"IcoMoon Free",familyCode:"im",component:h.jsx(EBe,{})},{title:"MdLock",category:"general",tag:"lock1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(cFe,{})},{title:"MdLockOpen",category:"general",tag:"lock2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(oFe,{})},{title:"MdLockOutline",category:"general",tag:"lock3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(lFe,{})},{title:"MdPrint",category:"general",tag:"print1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(dFe,{})},{title:"IoPrintSharp",category:"general",tag:"print2",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(pUe,{})},{title:"IoPrintOutline",category:"general",tag:"print3",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(fUe,{})},{title:"MdPrintDisabled",category:"general",tag:"noprint1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(gFe,{})},{title:"IoLocationSharp",category:"general",tag:"location1",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(hUe,{})},{title:"FaLocationDot",category:"file",tag:"location2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(zUe,{})},{title:"BsPlayBtn",category:"file",tag:"video1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(k9e,{})},{title:"LiaFileVideo",category:"file",tag:"video2",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(PBe,{})},{title:"MdOutlineAudiotrack",category:"file",tag:"audio1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(eBe,{})},{title:"PiFileAudioFill",category:"file",tag:"audio2",familyName:"Phosphor Icons",familyCode:"pi",component:h.jsx(RBe,{})},{title:"LiaFileAudio",category:"file",tag:"audio3",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(IBe,{})},{title:"LiaFilePdf",category:"file",tag:"pdf1",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(OBe,{})},{title:"FaFilePdf",category:"file",tag:"pdf2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(IUe,{})},{title:"BsFiletypePdf",category:"file",tag:"pdf3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(c9e,{})},{title:"VscFilePdf",category:"file",tag:"pdf4",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(CBe,{})},{title:"TbFileTypePdf",category:"file",tag:"pdf5",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(Gje,{})},{title:"LiaFileImage",category:"file",tag:"image1",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(NBe,{})},{title:"BsImage",category:"file",tag:"image2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(v9e,{})},{title:"BsImages",category:"file",tag:"image3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(y9e,{})},{title:"FaClipboardQuestion",category:"file",tag:"quiz1",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(BUe,{})},{title:"BsPatchQuestionFill",category:"file",tag:"quiz2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(w9e,{})},{title:"FaLink",category:"file",tag:"link1",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(VUe,{})},{title:"RiExternalLinkLine",category:"file",tag:"link2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(mBe,{})},{title:"MdEditDocument",category:"file",tag:"form1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(nFe,{})},{title:"MdOutlineEditNote",category:"file",tag:"survey1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(QFe,{})},{title:"IoIosArrowUp",category:"arrows",tag:"arrow-up1",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(iUe,{})},{title:"FaChevronDown",category:"arrows",tag:"arrow-down1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(TUe,{})},{title:"IoIosArrowDown",category:"arrows",tag:"arrow-down2",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(tUe,{})},{title:"FaArrowLeft",category:"arrows",tag:"arrow-left1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(wUe,{})},{title:"FaArrowLeftLong",category:"arrows",tag:"arrow-left2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(UUe,{})},{title:"IoIosArrowBack",category:"arrows",tag:"arrow-left3",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(eUe,{})},{title:"FaAnglesLeft",category:"arrows",tag:"arrow-left4",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(MUe,{})},{title:"IoIosArrowForward",category:"arrows",tag:"arrow-right1",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(nUe,{})},{title:"FaArrowRight",category:"arrows",tag:"arrow-right2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(SUe,{})},{title:"FaArrowRightLong",category:"arrows",tag:"arrow-right3",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(FUe,{})},{title:"FaAnglesRight",category:"arrows",tag:"arrow-right4",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(jUe,{})},{title:"BsArrowLeftRight",category:"arrows",tag:"arrow-left-right1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(Q7e,{})},{title:"TiSortAlphabetically",category:"sort",tag:"sort1",familyName:"Typicons",familyCode:"ti",component:h.jsx(Kje,{})},{title:"BsFilter",category:"sort",tag:"sort2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(d9e,{})},{title:"BsType",category:"sort",tag:"sort3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(K9e,{})},{title:"TbSortAscendingLetters",category:"sort",tag:"sort4",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx($je,{})},{title:"MdOutlineSortByAlpha",category:"sort",tag:"sort5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(GFe,{})},{title:"MdSortByAlpha",category:"sort",tag:"sort6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(pFe,{})},{title:"BsThreeDotsVertical",category:"sort",tag:"sort7",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(G9e,{})},{title:"BsFunnelFill",category:"sort",tag:"sort8",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(u9e,{})},{title:"ImLibrary",category:"exp-bank",tag:"exp-bank1",familyName:"IcoMoon Free",familyCode:"im",component:h.jsx(_Be,{})},{title:"BsBank2",category:"exp-bank",tag:"exp-bank2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(Z7e,{})},{title:"BsColumnsGap",category:"dashboard",tag:"dashboard1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(a9e,{})},{title:"BiShapeSquare",category:"associate",tag:"associate1",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(Qje,{})},{title:"BsRecycle",category:"associate",tag:"associate2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(B9e,{})},{title:"BsUbuntu",category:"associate",tag:"associate3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(q9e,{})},{title:"AiOutlineCodeSandbox",category:"associate",tag:"associate4",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(_7e,{})},{title:"AiOutlineDeploymentUnit",category:"associate",tag:"associate5",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(S7e,{})},{title:"MdFormatShapes",category:"associate",tag:"associate6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(wFe,{})},{title:"MdTypeSpecimen",category:"associate",tag:"associate7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(bFe,{})},{title:"MdOutlineFormatShapes",category:"associate",tag:"associate8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(ZFe,{})},{title:"RiShakeHandsLine",category:"associate",tag:"associate9",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(lBe,{})},{title:"MdDiversity2",category:"associate",tag:"associate10",familyName:"Material Design icons",familyCode:"md",component:h.jsx(RFe,{})},{title:"BsShare",category:"share",tag:"share1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(z9e,{})},{title:"FaRegShareFromSquare",category:"share",tag:"share2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(WUe,{})},{title:"IoMdShareAlt",category:"share",tag:"share3",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(aUe,{})},{title:"GiShare",category:"share",tag:"share4",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Pje,{})},{title:"BsDiagram3",category:"network",tag:"network1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(o9e,{})},{title:"BsFillPeopleFill",category:"network",tag:"network2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx($7e,{})},{title:"AiOutlineCluster",category:"network",tag:"network3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(y7e,{})},{title:"AiOutlinePartition",category:"network",tag:"network4",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(A7e,{})},{title:"AiOutlineNodeCollapse",category:"network",tag:"network5",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(T7e,{})},{title:"AiOutlineNodeExpand",category:"network",tag:"network6",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(R7e,{})},{title:"AiOutlineNodeIndex",category:"network",tag:"network7",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(x7e,{})},{title:"MdDiversity3",category:"network",tag:"network8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(xFe,{})},{title:"MdGroups2",category:"network",tag:"network9",familyName:"Material Design icons",familyCode:"md",component:h.jsx(AFe,{})},{title:"MdGroups",category:"network",tag:"network10",familyName:"Material Design icons",familyCode:"md",component:h.jsx(NFe,{})},{title:"MdGroups3",category:"network",tag:"network11",familyName:"Material Design icons",familyCode:"md",component:h.jsx(IFe,{})},{title:"MdOutlineGroups3",category:"network",tag:"network12",familyName:"Material Design icons",familyCode:"md",component:h.jsx(rBe,{})},{title:"MdOutlineGroups2",category:"network",tag:"network13",familyName:"Material Design icons",familyCode:"md",component:h.jsx(iBe,{})},{title:"MdOutlineGroups",category:"network",tag:"network14",familyName:"Material Design icons",familyCode:"md",component:h.jsx(sBe,{})},{title:"MdOutlineDiversity1",category:"network",tag:"network15",familyName:"Material Design icons",familyCode:"md",component:h.jsx(nBe,{})},{title:"MdOutlinePeopleAlt",category:"network",tag:"network16",familyName:"Material Design icons",familyCode:"md",component:h.jsx(aBe,{})},{title:"BsPeople",category:"network",tag:"network17",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(R9e,{})},{title:"BsPatchQuestion",category:"discover",tag:"discover1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(S9e,{})},{title:"AiOutlineAlert",category:"discover",tag:"discover2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(m7e,{})},{title:"AiOutlineBulb",category:"discover",tag:"discover3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(v7e,{})},{title:"GiSmart",category:"discover",tag:"discover4",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Lje,{})},{title:"GiTeamIdea",category:"discover",tag:"discover5",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Mje,{})},{title:"GoLightBulb",category:"discover",tag:"discover6",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(nje,{})},{title:"HiOutlineLightBulb",category:"discover",tag:"discover7",familyName:"Heroicons",familyCode:"hi",component:h.jsx($Ue,{})},{title:"MdLightbulbOutline",category:"discover",tag:"discover8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(aFe,{})},{title:"MdTipsAndUpdates",category:"discover",tag:"discover9",familyName:"Material Design icons",familyCode:"md",component:h.jsx(hFe,{})},{title:"MdOutlineBatchPrediction",category:"discover",tag:"discover10",familyName:"Material Design icons",familyCode:"md",component:h.jsx(FFe,{})},{title:"MdOutlineTipsAndUpdates",category:"discover",tag:"discover11",familyName:"Material Design icons",familyCode:"md",component:h.jsx(zFe,{})},{title:"RiLightbulbFlashLine",category:"discover",tag:"discover12",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(pBe,{})},{title:"BsHeadphones",category:"consult",tag:"consult1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(m9e,{})},{title:"BsPersonCheck",category:"consult",tag:"consult2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(A9e,{})},{title:"BsPersonBadge",category:"consult",tag:"consult3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(x9e,{})},{title:"AiOutlineCustomerService",category:"consult",tag:"consult4",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(E7e,{})},{title:"AiOutlineSolution",category:"consult",tag:"consult5",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(M7e,{})},{title:"MdCoPresent",category:"consult",tag:"consult6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(mFe,{})},{title:"MdOutlineCoPresent",category:"consult",tag:"consult7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(WFe,{})},{title:"BsPersonWorkspace",category:"consult",tag:"consult8",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(P9e,{})},{title:"BsPersonRolodex",category:"consult",tag:"consult9",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(N9e,{})},{title:"BsPersonSquare",category:"consult",tag:"consult10",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(O9e,{})},{title:"BsHeadset",category:"consult",tag:"consult11",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(g9e,{})},{title:"BsPersonLinesFill",category:"consult",tag:"consult12",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(I9e,{})},{title:"AiOutlineUserSwitch",category:"consult",tag:"consult13",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(F7e,{})},{title:"MdRecordVoiceOver",category:"consult",tag:"consult14",familyName:"Material Design icons",familyCode:"md",component:h.jsx(uFe,{})},{title:"MdInterpreterMode",category:"consult",tag:"consult15",familyName:"Material Design icons",familyCode:"md",component:h.jsx(fFe,{})},{title:"MdOutlineInterpreterMode",category:"consult",tag:"consult16",familyName:"Material Design icons",familyCode:"md",component:h.jsx(HFe,{})},{title:"BsEnvelope",category:"message",tag:"message1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(l9e,{})},{title:"MdOutlineMailOutline",category:"message",tag:"message2",familyName:"Material Design icons",familyCode:"md",component:h.jsx($Fe,{})},{title:"MdOutlineMarkEmailUnread",category:"message",tag:"message3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(KFe,{})},{title:"MdOutlineMail",category:"message",tag:"message4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(JFe,{})},{title:"SlEnvolope",category:"message",tag:"message5",familyName:"Simple Line Icons",familyCode:"sl",component:h.jsx(yBe,{})},{title:"BsChatSquareTextFill",category:"message",tag:"message6",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(t9e,{})},{title:"BiConversation",category:"message",tag:"message7",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(Xje,{})},{title:"FaCommentDots",category:"message",tag:"message8",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(xUe,{})},{title:"FaRegCommentDots",category:"message",tag:"message9",familyName:"Font Awesome 6",familyCode:"fas",component:h.jsx(HUe,{})},{title:"BsTrophy",category:"achievements",tag:"achievements1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx($9e,{})},{title:"GoTrophy",category:"achievements",tag:"achievements2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(oje,{})},{title:"BsStarFill",category:"star",tag:"star1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(H9e,{})},{title:"BsFillStarFill",category:"star",tag:"star2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(q7e,{})},{title:"FaRegStar",category:"star",tag:"star3",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(kUe,{})},{title:"BsTrash3",category:"delete",tag:"delete1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(W9e,{})},{title:"BsXCircle",category:"delete",tag:"delete2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(X9e,{})},{title:"AiOutlineDelete",category:"delete",tag:"delete3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(w7e,{})},{title:"GoTrash",category:"delete",tag:"delete4",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(aje,{})},{title:"BsFillTrashFill",category:"delete",tag:"delete5",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(X7e,{})},{title:"FaTimes",category:"delete",tag:"delete6",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(DUe,{})},{title:"BsX",category:"delete",tag:"delete7",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(ow,{})},{title:"BsXCircleFill",category:"delete",tag:"delete8",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(Y9e,{})},{title:"AiFillPieChart",category:"analyze",tag:"analyze1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(p7e,{})},{title:"AiOutlineAreaChart",category:"analyze",tag:"analyze2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(g7e,{})},{title:"AiOutlinePieChart",category:"analyze",tag:"analyze3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(I7e,{})},{title:"IoBarChartOutline",category:"analyze",tag:"analyze4",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(oUe,{})},{title:"MdDonutSmall",category:"analyze",tag:"analyze5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(tFe,{})},{title:"MdPieChart",category:"analyze",tag:"analyze6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(SFe,{})},{title:"TbChartHistogram",category:"analyze",tag:"analyze7",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(Hje,{})},{title:"TbChartAreaLineFilled",category:"analyze",tag:"analyze8",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(zje,{})},{title:"FaChartPie",category:"analyze",tag:"analyze9",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(CUe,{})},{title:"BsGeoAlt",category:"location",tag:"location1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(p9e,{})},{title:"BsPencil",category:"edit",tag:"edit1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(T9e,{})},{title:"FaRegPenToSquare",category:"edit",tag:"edit2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(GUe,{})},{title:"BsPencilFill",category:"edit",tag:"edit3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(b9e,{})},{title:"BsPencilSquare",category:"edit",tag:"edit4",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(C9e,{})},{title:"AiOutlineRead",category:"dictionary",tag:"dictionary1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(O7e,{})},{title:"GoBook",category:"dictionary",tag:"dictionary2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(Z9e,{})},{title:"AiOutlineReload",category:"reload",tag:"reload1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(P7e,{})},{title:"AiOutlineSync",category:"reload",tag:"reload2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(U7e,{})},{title:"GoSync",category:"reload",tag:"reload3",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(sje,{})},{title:"MdAutorenew",category:"reload",tag:"reload4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(eFe,{})},{title:"AiOutlineShoppingCart",category:"shop",tag:"shop1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(D7e,{})},{title:"AiOutlineShop",category:"shop",tag:"shop2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(L7e,{})},{title:"AiOutlineShopping",category:"shop",tag:"shop3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(k7e,{})},{title:"AiOutlineSwap",category:"connect",tag:"connect1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(j7e,{})},{title:"GoNote",category:"invitation",tag:"invitation1",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(ije,{})},{title:"GoUnread",category:"invitation",tag:"invitation2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(lje,{})},{title:"GoUnverified",category:"invitation",tag:"invitation3",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(cje,{})},{title:"IoIosFiling",category:"invitation",tag:"invitation4",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(rUe,{})},{title:"IoFileTrayFull",category:"invitation",tag:"invitation5",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(cUe,{})},{title:"MdHowToVote",category:"invitation",tag:"invitation6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(vFe,{})},{title:"MdOutlineMarkAsUnread",category:"invitation",tag:"invitation7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(VFe,{})},{title:"MdOutlineDrafts",category:"invitation",tag:"invitation8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(qFe,{})},{title:"MdOutlineHowToVote",category:"invitation",tag:"invitation9",familyName:"Material Design icons",familyCode:"md",component:h.jsx(YFe,{})},{title:"SlEnvolopeLetter",category:"invitation",tag:"invitation10",familyName:"Simple Line Icons",familyCode:"sl",component:h.jsx(vBe,{})},{title:"GiBrain",category:"experience",tag:"experience1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(dje,{})},{title:"MdSelfImprovement",category:"experience",tag:"experience2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(jFe,{})},{title:"MdArticle",category:"details",tag:"details1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(ZUe,{})},{title:"LuLayoutList",category:"details",tag:"details2",familyName:"Lucide",familyCode:"lu",component:h.jsx(JUe,{})},{title:"LuNewspaper",category:"details",tag:"details3",familyName:"Lucide",familyCode:"lu",component:h.jsx(QUe,{})},{title:"MdOutlineArticle",category:"details",tag:"details4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(UFe,{})},{title:"RiArticleLine",category:"details",tag:"details5",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(hBe,{})},{title:"GiNightSleep",category:"dreams",tag:"dreams1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Cje,{})},{title:"GiNightSky",category:"dreams",tag:"dreams2",familyName:"Game Icons",familyCode:"gi",component:h.jsx(bje,{})},{title:"MdOutlineEvent",category:"events",tag:"events1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(BFe,{})},{title:"RiCalendarTodoLine",category:"events",tag:"events2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(oBe,{})},{title:"GiPartyPopper",category:"events",tag:"events3",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Rje,{})},{title:"MdPsychologyAlt",category:"thoughts",tag:"thoughts1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(kFe,{})},{title:"MdPsychology",category:"thoughts",tag:"thoughts2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(MFe,{})},{title:"GiDeadlyStrike",category:"out of body",tag:"out-of-body1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(uje,{})},{title:"GiExtraLucid",category:"out of body",tag:"out-of-body2",familyName:"Game Icons",familyCode:"gi",component:h.jsx(hje,{})},{title:"GiFireSilhouette",category:"out of body",tag:"out-of-body3",familyName:"Game Icons",familyCode:"gi",component:h.jsx(fje,{})},{title:"GiHealing",category:"out of body",tag:"out-of-body4",familyName:"Game Icons",familyCode:"gi",component:h.jsx(pje,{})},{title:"GiIciclesAura",category:"out of body",tag:"out-of-body5",familyName:"Game Icons",familyCode:"gi",component:h.jsx(vje,{})},{title:"GiInspiration",category:"out of body",tag:"out-of-body6",familyName:"Game Icons",familyCode:"gi",component:h.jsx(yje,{})},{title:"GiJuggler",category:"out of body",tag:"out-of-body7",familyName:"Game Icons",familyCode:"gi",component:h.jsx(_je,{})},{title:"GiMeditation",category:"out of body",tag:"out-of-body8",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Eje,{})},{title:"GiMightyForce",category:"out of body",tag:"out-of-body9",familyName:"Game Icons",familyCode:"gi",component:h.jsx(wje,{})},{title:"GiNailedHead",category:"out of body",tag:"out-of-body10",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Sje,{})},{title:"GiOrbital",category:"out of body",tag:"out-of-body13",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Tje,{})},{title:"GiPentacle",category:"out of body",tag:"out-of-body15",familyName:"Game Icons",familyCode:"gi",component:h.jsx(xje,{})},{title:"GiPolarStar",category:"out of body",tag:"out-of-body16",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Aje,{})},{title:"GiPsychicWaves",category:"out of body",tag:"out-of-body17",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Ije,{})},{title:"GiRearAura",category:"out of body",tag:"out-of-body18",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Nje,{})},{title:"GiSpikedHalo",category:"out of body",tag:"out-of-body19",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Dje,{})},{title:"GiSuspicious",category:"out of body",tag:"out-of-body20",familyName:"Game Icons",familyCode:"gi",component:h.jsx(kje,{})},{title:"GiTeleport",category:"out of body",tag:"out-of-body21",familyName:"Game Icons",familyCode:"gi",component:h.jsx(jje,{})},{title:"GiThunderStruck",category:"out of body",tag:"out-of-body22",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Uje,{})},{title:"GiTwoShadows",category:"out of body",tag:"out-of-body23",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Fje,{})},{title:"GiHeartWings",category:"favorite",tag:"favorite1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(mje,{})},{title:"GiHearts",category:"favorite",tag:"favorite2",familyName:"Game Icons",familyCode:"gi",component:h.jsx(gje,{})},{title:"GoHeartFill",category:"favorite",tag:"favorite3",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(tje,{})},{title:"GoStarFill",category:"favorite",tag:"favorite4",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(rje,{})},{title:"MdFavorite",category:"favorite",tag:"favorite5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(rFe,{})},{title:"MdFavoriteBorder",category:"favorite",tag:"favorite6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(iFe,{})},{title:"GiRevolt",category:"resolution",tag:"resolution1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Oje,{})},{title:"GoBellFill",category:"notifications",tag:"notifications1",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(Q9e,{})},{title:"GoBell",category:"notifications",tag:"notifications2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(J9e,{})},{title:"MdNotificationsNone",category:"notifications",tag:"notifications3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(OFe,{})},{title:"MdNotifications",category:"notifications",tag:"notifications4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(PFe,{})},{title:"BsBellFill",category:"notifications",tag:"notifications5",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(e9e,{})},{title:"MdLeaderboard",category:"leaderboard",tag:"leaderboard",familyName:"Material Design icons",familyCode:"md",component:h.jsx(sFe,{})},{title:"MdInsights",category:"popular insights",tag:"insights1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(yFe,{})},{title:"MdReviews",category:"popular insights",tag:"insights2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(_Fe,{})},{title:"MdAutoGraph",category:"popular insights",tag:"insights3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(EFe,{})},{title:"MdAutoAwesome",category:"popular insights",tag:"insights4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(CFe,{})},{title:"MdAutoFixHigh",category:"popular insights",tag:"insights5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(TFe,{})},{title:"MdOutlineInsights",category:"popular insights",tag:"insights6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(XFe,{})},{title:"MdOutlineAutoAwesome",category:"popular insights",tag:"insights7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(tBe,{})},{title:"RiUserStarLine",category:"popular insights",tag:"insights8",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(gBe,{})},{title:"MdPersonAddAlt1",category:"add user",tag:"add-user1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(LFe,{})},{title:"TfiYoutube",category:"social",tag:"youtube1",familyName:"Themify Icons",familyCode:"tfi",component:h.jsx(Yje,{})},{title:"FaYoutube",category:"social",tag:"youtube2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(EUe,{})},{title:"BsApple",category:"social",tag:"apple1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(J7e,{})},{title:"FaFacebookF",category:"social",tag:"facebook1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(gUe,{})},{title:"FcGoogle",category:"social",tag:"google1",familyName:"Flat Color Icons",familyCode:"fc",component:h.jsx(wBe,{})},{title:"FaWhatsapp",category:"social",tag:"whatsapp1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(_Ue,{})},{title:"IoLogoWhatsapp",category:"social",tag:"whatsapp2",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(sUe,{})},{title:"FaCircle",category:"default",tag:"default",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(RUe,{})}];function tn({className:n,tag:t,style:i}){var u,p;const s=t||"default",l=h.jsx(h.Fragment,{children:En.filter(m=>(m==null?void 0:m.tag)===s).length>0?(u=En.filter(m=>(m==null?void 0:m.tag)===s)[0])==null?void 0:u.component:(p=En.filter(m=>(m==null?void 0:m.tag)==="default")[0])==null?void 0:p.component}),d=l&&k.cloneElement(l.props.children,{className:n,style:i});return h.jsx(h.Fragment,{children:d})}var Qye={exports:{}};(()=>{var n={181:(l,d,u)=>{var p=/^\s+|\s+$/g,m=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,_=/^0o[0-7]+$/i,E=parseInt,C=typeof u.g=="object"&&u.g&&u.g.Object===Object&&u.g,x=typeof self=="object"&&self&&self.Object===Object&&self,N=C||x||Function("return this")(),O=Object.prototype.toString,D=Math.max,P=Math.min,j=function(){return N.Date.now()};function M(G){var $=typeof G;return!!G&&($=="object"||$=="function")}function V(G){if(typeof G=="number")return G;if(function(Y){return typeof Y=="symbol"||function(le){return!!le&&typeof le=="object"}(Y)&&O.call(Y)=="[object Symbol]"}(G))return NaN;if(M(G)){var $=typeof G.valueOf=="function"?G.valueOf():G;G=M($)?$+"":$}if(typeof G!="string")return G===0?G:+G;G=G.replace(p,"");var ne=y.test(G);return ne||_.test(G)?E(G.slice(2),ne?2:8):m.test(G)?NaN:+G}l.exports=function(G,$,ne){var Y,le,re,ee,de,H,ae=0,_e=!1,me=!1,Ce=!0;if(typeof G!="function")throw new TypeError("Expected a function");function he(Ve){var Re=Y,Be=le;return Y=le=void 0,ae=Ve,ee=G.apply(Be,Re)}function pe(Ve){var Re=Ve-H;return H===void 0||Re>=$||Re<0||me&&Ve-ae>=re}function Oe(){var Ve=j();if(pe(Ve))return Fe(Ve);de=setTimeout(Oe,function(Re){var Be=$-(Re-H);return me?P(Be,re-(Re-ae)):Be}(Ve))}function Fe(Ve){return de=void 0,Ce&&Y?he(Ve):(Y=le=void 0,ee)}function Ue(){var Ve=j(),Re=pe(Ve);if(Y=arguments,le=this,H=Ve,Re){if(de===void 0)return function(Be){return ae=Be,de=setTimeout(Oe,$),_e?he(Be):ee}(H);if(me)return de=setTimeout(Oe,$),he(H)}return de===void 0&&(de=setTimeout(Oe,$)),ee}return $=V($)||0,M(ne)&&(_e=!!ne.leading,re=(me="maxWait"in ne)?D(V(ne.maxWait)||0,$):re,Ce="trailing"in ne?!!ne.trailing:Ce),Ue.cancel=function(){de!==void 0&&clearTimeout(de),ae=0,Y=H=le=de=void 0},Ue.flush=function(){return de===void 0?ee:Fe(j())},Ue}},858:(l,d,u)=>{var p="Expected a function",m=NaN,y="[object Symbol]",_=/^\s+|\s+$/g,E=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,x=/^0o[0-7]+$/i,N=parseInt,O=typeof u.g=="object"&&u.g&&u.g.Object===Object&&u.g,D=typeof self=="object"&&self&&self.Object===Object&&self,P=O||D||Function("return this")(),j=Object.prototype.toString,M=Math.max,V=Math.min,G=function(){return P.Date.now()};function $(Y){var le=typeof Y;return!!Y&&(le=="object"||le=="function")}function ne(Y){if(typeof Y=="number")return Y;if(function(ee){return typeof ee=="symbol"||function(de){return!!de&&typeof de=="object"}(ee)&&j.call(ee)==y}(Y))return m;if($(Y)){var le=typeof Y.valueOf=="function"?Y.valueOf():Y;Y=$(le)?le+"":le}if(typeof Y!="string")return Y===0?Y:+Y;Y=Y.replace(_,"");var re=C.test(Y);return re||x.test(Y)?N(Y.slice(2),re?2:8):E.test(Y)?m:+Y}l.exports=function(Y,le,re){var ee=!0,de=!0;if(typeof Y!="function")throw new TypeError(p);return $(re)&&(ee="leading"in re?!!re.leading:ee,de="trailing"in re?!!re.trailing:de),function(H,ae,_e){var me,Ce,he,pe,Oe,Fe,Ue=0,Ve=!1,Re=!1,Be=!0;if(typeof H!="function")throw new TypeError(p);function Xe(Qe){var Je=me,St=Ce;return me=Ce=void 0,Ue=Qe,pe=H.apply(St,Je)}function we(Qe){var Je=Qe-Fe;return Fe===void 0||Je>=ae||Je<0||Re&&Qe-Ue>=he}function We(){var Qe=G();if(we(Qe))return st(Qe);Oe=setTimeout(We,function(Je){var St=ae-(Je-Fe);return Re?V(St,he-(Je-Ue)):St}(Qe))}function st(Qe){return Oe=void 0,Be&&me?Xe(Qe):(me=Ce=void 0,pe)}function pt(){var Qe=G(),Je=we(Qe);if(me=arguments,Ce=this,Fe=Qe,Je){if(Oe===void 0)return function(St){return Ue=St,Oe=setTimeout(We,ae),Ve?Xe(St):pe}(Fe);if(Re)return Oe=setTimeout(We,ae),Xe(Fe)}return Oe===void 0&&(Oe=setTimeout(We,ae)),pe}return ae=ne(ae)||0,$(_e)&&(Ve=!!_e.leading,he=(Re="maxWait"in _e)?M(ne(_e.maxWait)||0,ae):he,Be="trailing"in _e?!!_e.trailing:Be),pt.cancel=function(){Oe!==void 0&&clearTimeout(Oe),Ue=0,me=Fe=Ce=Oe=void 0},pt.flush=function(){return Oe===void 0?pe:st(G())},pt}(Y,le,{leading:ee,maxWait:le,trailing:de})}},694:(l,d,u)=>{var p=u(925);function m(){}function y(){}y.resetWarningCache=m,l.exports=function(){function _(x,N,O,D,P,j){if(j!==p){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}}function E(){return _}_.isRequired=_;var C={array:_,bigint:_,bool:_,func:_,number:_,object:_,string:_,symbol:_,any:_,arrayOf:E,element:_,elementType:_,instanceOf:E,node:_,objectOf:E,oneOf:E,oneOfType:E,shape:E,exact:E,checkPropTypes:y,resetWarningCache:m};return C.PropTypes=C,C}},556:(l,d,u)=>{l.exports=u(694)()},925:l=>{l.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function i(l){var d=t[l];if(d!==void 0)return d.exports;var u=t[l]={exports:{}};return n[l](u,u.exports,i),u.exports}i.n=l=>{var d=l&&l.__esModule?()=>l.default:()=>l;return i.d(d,{a:d}),d},i.d=(l,d)=>{for(var u in d)i.o(d,u)&&!i.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:d[u]})},i.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),i.o=(l,d)=>Object.prototype.hasOwnProperty.call(l,d),i.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var s={};(()=>{i.r(s),i.d(s,{LazyLoadComponent:()=>it,LazyLoadImage:()=>tt,trackWindowScroll:()=>Ve});const l=k;var d=i.n(l),u=i(556);function p(){return typeof window<"u"&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function m(Te){return m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},m(Te)}function y(Te,Pe){var Ze=Object.keys(Te);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(Te);Pe&&(nt=nt.filter(function($e){return Object.getOwnPropertyDescriptor(Te,$e).enumerable})),Ze.push.apply(Ze,nt)}return Ze}function _(Te,Pe,Ze){return(Pe=C(Pe))in Te?Object.defineProperty(Te,Pe,{value:Ze,enumerable:!0,configurable:!0,writable:!0}):Te[Pe]=Ze,Te}function E(Te,Pe){for(var Ze=0;Ze<Pe.length;Ze++){var nt=Pe[Ze];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,C(nt.key),nt)}}function C(Te){var Pe=function(Ze,nt){if(m(Ze)!="object"||!Ze)return Ze;var $e=Ze[Symbol.toPrimitive];if($e!==void 0){var rt=$e.call(Ze,"string");if(m(rt)!="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Ze)}(Te);return m(Pe)=="symbol"?Pe:Pe+""}function x(Te,Pe,Ze){return Pe=O(Pe),function(nt,$e){if($e&&(m($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}(nt)}(Te,N()?Reflect.construct(Pe,Ze||[],O(Te).constructor):Pe.apply(Te,Ze))}function N(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N=function(){return!!Te})()}function O(Te){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},O(Te)}function D(Te,Pe){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ze,nt){return Ze.__proto__=nt,Ze},D(Te,Pe)}var P=function(Te){Te.forEach(function(Pe){Pe.isIntersecting&&Pe.target.onVisible()})},j={},M=function(Te){function Pe($e){var rt;if(function(Dt,nn){if(!(Dt instanceof nn))throw new TypeError("Cannot call a class as a function")}(this,Pe),(rt=x(this,Pe,[$e])).supportsObserver=!$e.scrollPosition&&$e.useIntersectionObserver&&p(),rt.supportsObserver){var yn=$e.threshold;rt.observer=function(Dt){return j[Dt]=j[Dt]||new IntersectionObserver(P,{rootMargin:Dt+"px"}),j[Dt]}(yn)}return rt}return function($e,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(rt&&rt.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),rt&&D($e,rt)}(Pe,Te),Ze=Pe,nt=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.placeholder&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var $e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollPosition,rt=this.placeholder.getBoundingClientRect(),yn=this.placeholder.style,Dt=parseInt(yn.getPropertyValue("margin-left"),10)||0,nn=parseInt(yn.getPropertyValue("margin-top"),10)||0;return{bottom:$e.y+rt.bottom+nn,left:$e.x+rt.left+Dt,right:$e.x+rt.right+Dt,top:$e.y+rt.top+nn}}},{key:"isPlaceholderInViewport",value:function(){if(typeof window>"u"||!this.placeholder)return!1;var $e=this.props,rt=$e.scrollPosition,yn=$e.threshold,Dt=this.getPlaceholderBoundingBox(rt),nn=rt.y+window.innerHeight,Zt=rt.x,qt=rt.x+window.innerWidth,Jt=rt.y;return Jt-yn<=Dt.bottom&&nn+yn>=Dt.top&&Zt-yn<=Dt.right&&qt+yn>=Dt.left}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var $e=this,rt=this.props,yn=rt.className,Dt=rt.height,nn=rt.placeholder,Zt=rt.style,qt=rt.width;if(nn&&typeof nn.type!="function")return d().cloneElement(nn,{ref:function(mn){return $e.placeholder=mn}});var Jt=function(mn){for(var Kn=1;Kn<arguments.length;Kn++){var On=arguments[Kn]!=null?arguments[Kn]:{};Kn%2?y(Object(On),!0).forEach(function(Tn){_(mn,Tn,On[Tn])}):Object.getOwnPropertyDescriptors?Object.defineProperties(mn,Object.getOwnPropertyDescriptors(On)):y(Object(On)).forEach(function(Tn){Object.defineProperty(mn,Tn,Object.getOwnPropertyDescriptor(On,Tn))})}return mn}({display:"inline-block"},Zt);return qt!==void 0&&(Jt.width=qt),Dt!==void 0&&(Jt.height=Dt),d().createElement("span",{className:yn,ref:function(mn){return $e.placeholder=mn},style:Jt},nn)}}],nt&&E(Ze.prototype,nt),Object.defineProperty(Ze,"prototype",{writable:!1}),Ze;var Ze,nt}(d().Component);M.propTypes={onVisible:u.PropTypes.func.isRequired,className:u.PropTypes.string,height:u.PropTypes.oneOfType([u.PropTypes.number,u.PropTypes.string]),placeholder:u.PropTypes.element,threshold:u.PropTypes.number,useIntersectionObserver:u.PropTypes.bool,scrollPosition:u.PropTypes.shape({x:u.PropTypes.number.isRequired,y:u.PropTypes.number.isRequired}),width:u.PropTypes.oneOfType([u.PropTypes.number,u.PropTypes.string])},M.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const V=M;var G=i(181),$=i.n(G),ne=i(858),Y=i.n(ne),le=function(Te){var Pe=getComputedStyle(Te,null);return Pe.getPropertyValue("overflow")+Pe.getPropertyValue("overflow-y")+Pe.getPropertyValue("overflow-x")};const re=function(Te){if(!(Te instanceof HTMLElement))return window;for(var Pe=Te;Pe&&Pe instanceof HTMLElement;){if(/(scroll|auto)/.test(le(Pe)))return Pe;Pe=Pe.parentNode}return window};function ee(Te){return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},ee(Te)}var de=["delayMethod","delayTime"];function H(){return H=Object.assign?Object.assign.bind():function(Te){for(var Pe=1;Pe<arguments.length;Pe++){var Ze=arguments[Pe];for(var nt in Ze)({}).hasOwnProperty.call(Ze,nt)&&(Te[nt]=Ze[nt])}return Te},H.apply(null,arguments)}function ae(Te,Pe){for(var Ze=0;Ze<Pe.length;Ze++){var nt=Pe[Ze];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,_e(nt.key),nt)}}function _e(Te){var Pe=function(Ze,nt){if(ee(Ze)!="object"||!Ze)return Ze;var $e=Ze[Symbol.toPrimitive];if($e!==void 0){var rt=$e.call(Ze,"string");if(ee(rt)!="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Ze)}(Te);return ee(Pe)=="symbol"?Pe:Pe+""}function me(Te,Pe,Ze){return Pe=pe(Pe),Ce(Te,he()?Reflect.construct(Pe,Ze||[],pe(Te).constructor):Pe.apply(Te,Ze))}function Ce(Te,Pe){if(Pe&&(ee(Pe)=="object"||typeof Pe=="function"))return Pe;if(Pe!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Ze){if(Ze===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ze}(Te)}function he(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(he=function(){return!!Te})()}function pe(Te){return pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},pe(Te)}function Oe(Te,Pe){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ze,nt){return Ze.__proto__=nt,Ze},Oe(Te,Pe)}var Fe=function(){return typeof window>"u"?0:window.scrollX||window.pageXOffset},Ue=function(){return typeof window>"u"?0:window.scrollY||window.pageYOffset};const Ve=function(Te){var Pe=function(Ze){function nt(yn){var Dt;if(function(Zt,qt){if(!(Zt instanceof qt))throw new TypeError("Cannot call a class as a function")}(this,nt),(Dt=me(this,nt,[yn])).useIntersectionObserver=yn.useIntersectionObserver&&p(),Dt.useIntersectionObserver)return Ce(Dt);var nn=Dt.onChangeScroll.bind(Dt);return yn.delayMethod==="debounce"?Dt.delayedScroll=$()(nn,yn.delayTime):yn.delayMethod==="throttle"&&(Dt.delayedScroll=Y()(nn,yn.delayTime)),Dt.state={scrollPosition:{x:Fe(),y:Ue()}},Dt.baseComponentRef=d().createRef(),Dt}return function(yn,Dt){if(typeof Dt!="function"&&Dt!==null)throw new TypeError("Super expression must either be null or a function");yn.prototype=Object.create(Dt&&Dt.prototype,{constructor:{value:yn,writable:!0,configurable:!0}}),Object.defineProperty(yn,"prototype",{writable:!1}),Dt&&Oe(yn,Dt)}(nt,Ze),$e=nt,rt=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){typeof window>"u"||this.useIntersectionObserver||re(this.baseComponentRef.current)!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement=re(this.baseComponentRef.current),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:Fe(),y:Ue()}})}},{key:"render",value:function(){var yn=this.props,Dt=(yn.delayMethod,yn.delayTime,function(Zt,qt){if(Zt==null)return{};var Jt,mn,Kn=function(Tn,Ui){if(Tn==null)return{};var xr={};for(var bi in Tn)if({}.hasOwnProperty.call(Tn,bi)){if(Ui.indexOf(bi)>=0)continue;xr[bi]=Tn[bi]}return xr}(Zt,qt);if(Object.getOwnPropertySymbols){var On=Object.getOwnPropertySymbols(Zt);for(mn=0;mn<On.length;mn++)Jt=On[mn],qt.indexOf(Jt)>=0||{}.propertyIsEnumerable.call(Zt,Jt)&&(Kn[Jt]=Zt[Jt])}return Kn}(yn,de)),nn=this.useIntersectionObserver?null:this.state.scrollPosition;return d().createElement(Te,H({forwardRef:this.baseComponentRef,scrollPosition:nn},Dt))}}],rt&&ae($e.prototype,rt),Object.defineProperty($e,"prototype",{writable:!1}),$e;var $e,rt}(d().Component);return Pe.propTypes={delayMethod:u.PropTypes.oneOf(["debounce","throttle"]),delayTime:u.PropTypes.number,useIntersectionObserver:u.PropTypes.bool},Pe.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},Pe};function Re(Te){return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},Re(Te)}function Be(Te,Pe){for(var Ze=0;Ze<Pe.length;Ze++){var nt=Pe[Ze];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,Xe(nt.key),nt)}}function Xe(Te){var Pe=function(Ze,nt){if(Re(Ze)!="object"||!Ze)return Ze;var $e=Ze[Symbol.toPrimitive];if($e!==void 0){var rt=$e.call(Ze,"string");if(Re(rt)!="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Ze)}(Te);return Re(Pe)=="symbol"?Pe:Pe+""}function we(Te,Pe,Ze){return Pe=st(Pe),function(nt,$e){if($e&&(Re($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}(nt)}(Te,We()?Reflect.construct(Pe,Ze||[],st(Te).constructor):Pe.apply(Te,Ze))}function We(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(We=function(){return!!Te})()}function st(Te){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},st(Te)}function pt(Te,Pe){return pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ze,nt){return Ze.__proto__=nt,Ze},pt(Te,Pe)}var Qe=function(Te){function Pe($e){return function(rt,yn){if(!(rt instanceof yn))throw new TypeError("Cannot call a class as a function")}(this,Pe),we(this,Pe,[$e])}return function($e,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(rt&&rt.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),rt&&pt($e,rt)}(Pe,Te),Ze=Pe,(nt=[{key:"render",value:function(){return d().createElement(V,this.props)}}])&&Be(Ze.prototype,nt),Object.defineProperty(Ze,"prototype",{writable:!1}),Ze;var Ze,nt}(d().Component);const Je=Ve(Qe);function St(Te){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},St(Te)}function Xt(Te,Pe){for(var Ze=0;Ze<Pe.length;Ze++){var nt=Pe[Ze];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,Ht(nt.key),nt)}}function Ht(Te){var Pe=function(Ze,nt){if(St(Ze)!="object"||!Ze)return Ze;var $e=Ze[Symbol.toPrimitive];if($e!==void 0){var rt=$e.call(Ze,"string");if(St(rt)!="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Ze)}(Te);return St(Pe)=="symbol"?Pe:Pe+""}function gn(Te,Pe,Ze){return Pe=xt(Pe),function(nt,$e){if($e&&(St($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}(nt)}(Te,It()?Reflect.construct(Pe,Ze||[],xt(Te).constructor):Pe.apply(Te,Ze))}function It(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(It=function(){return!!Te})()}function xt(Te){return xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},xt(Te)}function mt(Te,Pe){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ze,nt){return Ze.__proto__=nt,Ze},mt(Te,Pe)}var dt=function(Te){function Pe($e){var rt;(function(qt,Jt){if(!(qt instanceof Jt))throw new TypeError("Cannot call a class as a function")})(this,Pe),rt=gn(this,Pe,[$e]);var yn=$e.afterLoad,Dt=$e.beforeLoad,nn=$e.scrollPosition,Zt=$e.visibleByDefault;return rt.state={visible:Zt},Zt&&(Dt(),yn()),rt.onVisible=rt.onVisible.bind(rt),rt.isScrollTracked=!!(nn&&Number.isFinite(nn.x)&&nn.x>=0&&Number.isFinite(nn.y)&&nn.y>=0),rt}return function($e,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(rt&&rt.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),rt&&mt($e,rt)}(Pe,Te),Ze=Pe,(nt=[{key:"componentDidUpdate",value:function($e,rt){rt.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var $e=this.props,rt=$e.className,yn=$e.delayMethod,Dt=$e.delayTime,nn=$e.height,Zt=$e.placeholder,qt=$e.scrollPosition,Jt=$e.style,mn=$e.threshold,Kn=$e.useIntersectionObserver,On=$e.width;return this.isScrollTracked||Kn&&p()?d().createElement(V,{className:rt,height:nn,onVisible:this.onVisible,placeholder:Zt,scrollPosition:qt,style:Jt,threshold:mn,useIntersectionObserver:Kn,width:On}):d().createElement(Je,{className:rt,delayMethod:yn,delayTime:Dt,height:nn,onVisible:this.onVisible,placeholder:Zt,style:Jt,threshold:mn,width:On})}}])&&Xt(Ze.prototype,nt),Object.defineProperty(Ze,"prototype",{writable:!1}),Ze;var Ze,nt}(d().Component);dt.propTypes={afterLoad:u.PropTypes.func,beforeLoad:u.PropTypes.func,useIntersectionObserver:u.PropTypes.bool,visibleByDefault:u.PropTypes.bool},dt.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const it=dt;function Me(Te){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},Me(Te)}var Ge=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function bt(Te,Pe){var Ze=Object.keys(Te);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(Te);Pe&&(nt=nt.filter(function($e){return Object.getOwnPropertyDescriptor(Te,$e).enumerable})),Ze.push.apply(Ze,nt)}return Ze}function wt(Te){for(var Pe=1;Pe<arguments.length;Pe++){var Ze=arguments[Pe]!=null?arguments[Pe]:{};Pe%2?bt(Object(Ze),!0).forEach(function(nt){Pt(Te,nt,Ze[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Te,Object.getOwnPropertyDescriptors(Ze)):bt(Object(Ze)).forEach(function(nt){Object.defineProperty(Te,nt,Object.getOwnPropertyDescriptor(Ze,nt))})}return Te}function Pt(Te,Pe,Ze){return(Pe=an(Pe))in Te?Object.defineProperty(Te,Pe,{value:Ze,enumerable:!0,configurable:!0,writable:!0}):Te[Pe]=Ze,Te}function en(){return en=Object.assign?Object.assign.bind():function(Te){for(var Pe=1;Pe<arguments.length;Pe++){var Ze=arguments[Pe];for(var nt in Ze)({}).hasOwnProperty.call(Ze,nt)&&(Te[nt]=Ze[nt])}return Te},en.apply(null,arguments)}function un(Te,Pe){for(var Ze=0;Ze<Pe.length;Ze++){var nt=Pe[Ze];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,an(nt.key),nt)}}function an(Te){var Pe=function(Ze,nt){if(Me(Ze)!="object"||!Ze)return Ze;var $e=Ze[Symbol.toPrimitive];if($e!==void 0){var rt=$e.call(Ze,"string");if(Me(rt)!="object")return rt;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Ze)}(Te);return Me(Pe)=="symbol"?Pe:Pe+""}function ye(Te,Pe,Ze){return Pe=ie(Pe),function(nt,$e){if($e&&(Me($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(rt){if(rt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return rt}(nt)}(Te,Q()?Reflect.construct(Pe,Ze||[],ie(Te).constructor):Pe.apply(Te,Ze))}function Q(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q=function(){return!!Te})()}function ie(Te){return ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},ie(Te)}function Se(Te,Pe){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Ze,nt){return Ze.__proto__=nt,Ze},Se(Te,Pe)}var je=function(Te){function Pe($e){var rt;return function(yn,Dt){if(!(yn instanceof Dt))throw new TypeError("Cannot call a class as a function")}(this,Pe),(rt=ye(this,Pe,[$e])).state={loaded:!1},rt}return function($e,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(rt&&rt.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),rt&&Se($e,rt)}(Pe,Te),Ze=Pe,nt=[{key:"onImageLoad",value:function(){var $e=this;return this.state.loaded?null:function(rt){$e.props.onLoad(rt),$e.props.afterLoad(),$e.setState({loaded:!0})}}},{key:"getImg",value:function(){var $e=this.props,rt=($e.afterLoad,$e.beforeLoad,$e.delayMethod,$e.delayTime,$e.effect,$e.placeholder,$e.placeholderSrc,$e.scrollPosition,$e.threshold,$e.useIntersectionObserver,$e.visibleByDefault,$e.wrapperClassName,$e.wrapperProps,function(yn,Dt){if(yn==null)return{};var nn,Zt,qt=function(mn,Kn){if(mn==null)return{};var On={};for(var Tn in mn)if({}.hasOwnProperty.call(mn,Tn)){if(Kn.indexOf(Tn)>=0)continue;On[Tn]=mn[Tn]}return On}(yn,Dt);if(Object.getOwnPropertySymbols){var Jt=Object.getOwnPropertySymbols(yn);for(Zt=0;Zt<Jt.length;Zt++)nn=Jt[Zt],Dt.indexOf(nn)>=0||{}.propertyIsEnumerable.call(yn,nn)&&(qt[nn]=yn[nn])}return qt}($e,Ge));return d().createElement("img",en({},rt,{onLoad:this.onImageLoad()}))}},{key:"getLazyLoadImage",value:function(){var $e=this.props,rt=$e.beforeLoad,yn=$e.className,Dt=$e.delayMethod,nn=$e.delayTime,Zt=$e.height,qt=$e.placeholder,Jt=$e.scrollPosition,mn=$e.style,Kn=$e.threshold,On=$e.useIntersectionObserver,Tn=$e.visibleByDefault,Ui=$e.width;return d().createElement(it,{beforeLoad:rt,className:yn,delayMethod:Dt,delayTime:nn,height:Zt,placeholder:qt,scrollPosition:Jt,style:mn,threshold:Kn,useIntersectionObserver:On,visibleByDefault:Tn,width:Ui},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function($e){var rt=this.props,yn=rt.effect,Dt=rt.height,nn=rt.placeholderSrc,Zt=rt.width,qt=rt.wrapperClassName,Jt=rt.wrapperProps,mn=this.state.loaded,Kn=mn?" lazy-load-image-loaded":"",On=mn||!nn?{}:{backgroundImage:"url(".concat(nn,")"),backgroundSize:"100% 100%"};return d().createElement("span",en({className:qt+" lazy-load-image-background "+yn+Kn,style:wt(wt({},On),{},{color:"transparent",display:"inline-block",height:Dt,width:Zt})},Jt),$e)}},{key:"render",value:function(){var $e=this.props,rt=$e.effect,yn=$e.placeholderSrc,Dt=$e.visibleByDefault,nn=$e.wrapperClassName,Zt=$e.wrapperProps,qt=this.getLazyLoadImage();return(rt||yn)&&!Dt||nn||Zt?this.getWrappedLazyLoadImage(qt):qt}}],nt&&un(Ze.prototype,nt),Object.defineProperty(Ze,"prototype",{writable:!1}),Ze;var Ze,nt}(d().Component);je.propTypes={onLoad:u.PropTypes.func,afterLoad:u.PropTypes.func,beforeLoad:u.PropTypes.func,delayMethod:u.PropTypes.string,delayTime:u.PropTypes.number,effect:u.PropTypes.string,placeholderSrc:u.PropTypes.string,threshold:u.PropTypes.number,useIntersectionObserver:u.PropTypes.bool,visibleByDefault:u.PropTypes.bool,wrapperClassName:u.PropTypes.string,wrapperProps:u.PropTypes.object},je.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const tt=je})(),Qye.exports=s})();var LBe=Qye.exports;function Ts({src:n,alt:t,loadedimageprops:i,wrapperClassName:s}){const l=h.jsx("div",{className:"p-3 rounded-4 bg-gray-lighter1 w-100",style:{height:200},children:h.jsx("h1",{children:"Placeholder DIV"})});return h.jsx(LBe.LazyLoadImage,{alt:t,title:t,src:n,placeholder:l,visibleByDefault:!0,loadedimageprops:i,effect:"blur",width:"100%",wrapperClassName:`custom-image-container ${s}`})}function nZ(n){const t=ji(),i=n!=null&&n.className?n==null?void 0:n.className:"",s=n!=null&&n.profileImg?n==null?void 0:n.profileImg:"/img/profile-pic.png",l=n!=null&&n.profileName?n==null?void 0:n.profileName:"Guest User",d=n!=null&&n.profileDesig?n==null?void 0:n.profileDesig:"NA",u=n!=null&&n.isEdit?n==null?void 0:n.isEdit:!1,p=Ai.getLoginSchemeFromLocal();return h.jsxs(et,{className:`card-theme border-0 profile-card ${i}`,children:[h.jsx(et.Body,{className:"text-center",children:h.jsxs("div",{className:"d-flex profile-info-container align-items-center",children:[h.jsxs("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex align-items-center",children:[u&&h.jsx(Lt,{type:"button",className:"btn-theme btn-icon btn-white position-absolute rounded-circle align-self-start",style:{right:"-0.5rem",top:"-0.5rem",zIndex:1},onClick:()=>n.handleShowUpdateProfilePhotoModal(),children:h.jsx(tn,{tag:"camera1",className:"text-purple font-20"})}),h.jsx("div",{className:"media-icon-wrapper rounded-circle overflow-hidden",children:h.jsx(Ts,{src:s,alt:`${l} image`,className:"img-fluid"})})]}),h.jsxs("div",{className:"text-start flex-grow-1 ms-3 media-info-container",children:[h.jsx("span",{className:"welcome-user text-truncate d-block",children:`${l} `}),h.jsx("span",{className:"d-block font-13",children:vx(d)}),u&&p!=="password"&&h.jsxs(Lt,{type:"button",className:"btn-theme btn-sm btn-white position-relative rounded-1 mt-2 px-2 py-1",onClick:n.handleEditProfile,children:[h.jsx(tn,{tag:"edit1",className:"text-purple font-14 me-1"}),"Edit Profile"]})]})]})}),u&&p==="password"&&h.jsx(h.Fragment,{children:h.jsxs(et.Footer,{className:"bg-transparent pt-0 pb-3 border-0 d-flex",children:[u&&h.jsxs(Lt,{type:"button",className:"btn-theme btn-sm btn-white position-relative rounded-1 mt-0 px-2 py-1 flex-grow-1 me-1",onClick:n.handleEditProfile,children:[h.jsx(tn,{tag:"edit3",className:"text-purple font-14 me-1"}),"Edit Profile"]}),u&&p==="password"&&h.jsxs(Lt,{type:"button",className:"btn-theme btn-sm btn-white position-relative rounded-1 mt-0 px-2 py-1 flex-grow-1 ms-1",onClick:()=>t("/profile/change-password",{state:{pageTitle:"Change Password"}}),children:[h.jsx(tn,{tag:"key4",className:"text-purple font-14 me-1"}),"Change Password"]})]})})]})}function DBe(n){var i,s,l;const t=Ai.getAppCurrentVersion();return h.jsxs(t4,{show:n.showNavigation,onHide:n.handleCloseNavigation,className:"app-sidenav",children:[h.jsx(t4.Header,{closeButton:!0,children:h.jsx(t4.Title,{})}),h.jsxs(t4.Body,{children:[h.jsx("div",{className:"text-center pb-3 pb-sm-5 pt-sm-5",children:h.jsx("img",{src:"/img/logo-small.png",alt:"rapport logo small",className:"img-fluid"})}),h.jsx("div",{className:"border-top border-bottom py-4 navigation-profile-wrapper",children:h.jsx(rh,{to:"/profile",className:"d-flex align-items-center",onClick:n.handleCloseNavigation,children:h.jsx(nZ,{userProfile:n.userProfile,profileImg:(i=n.userProfile)==null?void 0:i.avatar,profileName:(s=n.userProfile)==null?void 0:s.name,profileDesig:(l=n.userProfile)==null?void 0:l.designation,isEdit:!1,className:"profile-card-navigation bg-transparent"})})}),h.jsxs("div",{className:"list-group py-3",children:[h.jsxs(rh,{to:"/dashboard",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(tn,{tag:"dashboard1",className:""})}),"Dashboard"]}),h.jsxs(rh,{to:"/profile",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(tn,{tag:"consult8",className:""})}),"Profile"]}),h.jsxs(rh,{to:"/quick-actions",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(tn,{tag:"add1",className:""})}),"Quick Actions"]}),h.jsxs(rh,{to:"/appreciations",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx("img",{src:"/img/appreciations-icon.png",alt:"Appreciations Icon"})}),"Appreciations"]}),h.jsxs(rh,{to:"/badges",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx("img",{src:"/img/badges-icon.png",alt:"Badges Icon"})}),"Badges"]}),h.jsxs(rh,{to:"/notifications",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(tn,{tag:"notifications2",className:""})}),"Notifications"]}),h.jsxs(Lt,{type:"button",className:"list-group-item text-start",onClick:n.handleLogout,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(tn,{tag:"logout4",className:""})}),"Logout"]})]})]}),h.jsxs("div",{className:"app-sidenav-footer fw-sb",children:["Version ",t||null]})]})}const qU=k.createContext();function tx(n){var m,y,_,E,C,x,N,O;let t="",i="",s="",l="Cancel",d={backdrop:"static",keyboard:!1},u={closeButton:!1};const p=()=>{switch(n.content_type){case"logout-modal":n.handlePrimaryAction();break;case"submission-delete-modal":n.handlePrimaryAction(n.primaryActionData);break;case"reattempt-submission-delete-modal":console.log("Started deleting response for re-attempt."),n.handlePrimaryAction(n.primaryActionData);break;case"force-evaluation-submission-modal":const D={...n.primaryActionData,force:!0};n.handlePrimaryAction(D),console.log("Started force submission of response evaluation.");break;case"force-upload-submission-cancel-modal":n.handlePrimaryAction();break}};switch(n.content_type){case"logout-modal":t="Are you sure you want to logout from app? This action cannot be undone.",s="Logout";break;case"submission-delete-modal":t="Are you sure you want to delete a contest response? This action cannot be undone.",s="Delete";break;case"reattempt-submission-delete-modal":t="Are you sure you want to delete a contest response for a re-attempt? This action cannot be undone.",s="Delete";break;case"force-evaluation-submission-modal":i="Score matched!",t=(m=n==null?void 0:n.data)!=null&&m.message?(y=n==null?void 0:n.data)==null?void 0:y.message:"Are you sure you want to submit a same contest response evaluation? This action cannot be undone.",d={backdrop:"static",keyboard:!1},u={closeButton:!1},s=((_=n==null?void 0:n.data)==null?void 0:_.btnOptions.length)>0&&((E=n==null?void 0:n.data)!=null&&E.btnOptions.includes("continue"))?"Continue":"",l=((C=n==null?void 0:n.data)==null?void 0:C.btnOptions.length)>0?(x=n==null?void 0:n.data)==null?void 0:x.btnOptions.filter(D=>D.toLowerCase()==="edit"):"Cancel";break;case"force-upload-submission-cancel-modal":i="About to Cancel Uploading!",t=(N=n==null?void 0:n.data)!=null&&N.message?(O=n==null?void 0:n.data)==null?void 0:O.message:"Your uploading will be cancelled and you need to reupload a response again. Do you still want to go back?",d={backdrop:"static",keyboard:!1},u={closeButton:!1},s="Cancel Upload",l="Continue Upload";break}return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",className:"theme-modal confirmation-modal",...d,show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb-2",...u,children:h.jsxs(wn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:"heading-icon d-flex justify-content-center align-items-center rounded-circle font-24",children:h.jsx(KU,{})})}),h.jsx("div",{className:"heading flex-grow-1 ms-3",children:"Confirmation"})]})}),h.jsxs(wn.Body,{children:[i!==""&&h.jsx("div",{className:"font-16 fw-sb mb-2",style:{color:"#684609"},children:i}),h.jsx("div",{className:"modal-helper-text",children:t}),h.jsxs("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:[h.jsx(Lt,{type:"submit",className:`btn-theme\r
btn-gray btn-md flex-grow-1 text-capitalize`,onClick:n.handleClose,children:l}),s!==""&&h.jsx(Lt,{type:"submit",className:`btn-theme\r
btn-yellow btn-md flex-grow-1`,onClick:p,style:{paddingLeft:6,paddingRight:6},children:n.loading?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):h.jsx(h.Fragment,{children:s})})]})]})]})})}function Zye(n){let t={backdrop:"static",keyboard:!1},i={closeButton:!1};return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",className:"theme-modal confirmation-modal",...t,show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb-1",...i,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:h.jsx("div",{className:"heading flex-grow-1 ms-0",children:"Terms & Conditions"})})}),h.jsxs(wn.Body,{children:[h.jsx("div",{className:"modal-helper-text",children:n.terms}),h.jsx("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:h.jsx(Lt,{type:"submit",className:`btn-theme
btn-gray btn-md flex-grow-1 text-capitalize`,onClick:n.handleClose,children:"Ok"})})]})]})})}function kBe(n){const t=n.page,i=ji(),s=tl(),[l,d]=k.useState(""),{userProfile:u,notificationStats:p,backLink:m,setBackLink:y}=k.useContext(qU),_=JSON.parse(Ai.getAuthUser());k.useEffect(()=>{var ne,Y;let M=ALe(t);(ne=s.state)!=null&&ne.pageTitle&&(M=(Y=s.state)==null?void 0:Y.pageTitle),d(M);const G=s.pathname.split("/").filter((le,re)=>le!=="");let $="";G.length>2?$=`/${G[0]}/${G[1]}`:G.length>1?($=`/${G[0]}`,t==="approve-reject-form-submission"&&($="/notifications")):$="/dashboard",$!==""&&y($)},[s.pathname]);const[E,C]=k.useState(!1),[x,N]=k.useState(!1);function O(){s.pathname&&s.pathname.split("/").length>2,i(m)}const D=()=>{C(!1)},P=()=>{C(!0)};function j(M){localStorage.clear(),n.handleCloseNavigation(),Qt("Logout successfully!","success"),i("/")}return h.jsxs("div",{children:[h.jsxs(Iye,{expand:"lg",fixed:"top",className:"navbar-header",children:[h.jsxs(Yn,{className:"justify-content-start",children:[t!=="dashboard"&&h.jsx(Lt,{type:"button",className:"btn-theme btn-transparent btn-icon btn-menu px-1 text-white ps-0 pe-2",style:{width:25,minWidth:0},onClick:O,children:h.jsx(tn,{tag:"arrow-left1",className:""})}),h.jsx("div",{className:`${t!=="dashboard"&&"ms-1"} d-flex flex-row align-items-center flex-fill`,style:{width:"calc(100% - 10vw)"},children:t==="dashboard"?h.jsx(h.Fragment,{children:h.jsx(rh,{to:"/profile",className:"text-decoration-none overflow-hidden",children:h.jsx(nZ,{userProfile:_,profileImg:_==null?void 0:_.avatar,profileName:_==null?void 0:_.name,profileDesig:_==null?void 0:_.designation,isEdit:!1,className:"profile-card-sm profile-card-navigation bg-transparent"})})}):h.jsx("h5",{className:"page-title mb-0 font-16 text-white",children:l})}),t==="dashboard"&&h.jsx(h.Fragment,{children:h.jsx(rh,{to:"/notifications",className:"btn btn-theme btn-icon btn-white btn-notification position-relative",children:h.jsx(tn,{tag:"notifications2",className:"font-22"})})})]}),h.jsx(DBe,{showNavigation:n.showNavigation,handleCloseNavigation:n.handleCloseNavigation,handleShowNavigation:n.handleShowNavigation,handleLogout:P,userProfile:_})]}),h.jsx(tx,{show:E,loading:x,handleClose:D,primaryActionData:null,content_type:"logout-modal",handlePrimaryAction:j})]})}const MBe="up",jBe="down";function UBe(){const[n,t]=k.useState();return k.useEffect(()=>{let i=window.scrollY;const s=()=>{let l=i<window.scrollY?jBe:MBe;i=window.scrollY,t(l)};return window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}},[]),{direction:n}}function FBe(n){const t=ji(),i=n.page,{state:s,pathname:l}=tl(),{direction:d}=UBe();return h.jsx(h.Fragment,{children:h.jsx(Iye,{expand:"lg",fixed:"bottom",className:`navbar-footer ${s!=null&&s.hideFooterNav?"navbar-hidden":""} ${d!=="down"?"":"navbar-hidden"}
${i==="messages"&&l.split("/").length>2?"navbar-hidden":""}
`,children:h.jsxs(Yn,{className:"justify-content-between px-0 flex-nowrap",children:[h.jsxs(Lt,{type:"button",className:"btn-theme btn-white btn-menu p-1",onClick:()=>{l==="/dashboard"&&Qt("Already on Dashboard!"),t("/dashboard")},children:[h.jsx(tn,{tag:"home1",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Home"})]}),h.jsxs(Lt,{type:"button",className:"btn-theme btn-white btn-menu p-1",onClick:()=>{l==="/magazines"&&Qt("Already on Magazines!"),t("/magazines")},children:[h.jsx(tn,{tag:"dictionary2",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Magazine"})]}),h.jsx(Lt,{type:"button",variant:"primary",className:"btn-theme btn-icon btn-action position-relative border-0 rounded-circle",onClick:()=>{l==="/quick-actions"&&Qt("Already on Quick actions!"),t("/quick-actions")},children:h.jsx(tn,{tag:"add3",className:"font-32"})}),h.jsxs(Lt,{type:"button",className:"btn-theme btn-white btn-message p-1",onClick:()=>{l==="/messages"&&Qt("Already on Messages!"),t("/messages")},children:[h.jsx(tn,{tag:"message5",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Message"})]}),h.jsxs(Lt,{type:"button",className:"btn-theme btn-white btn-message p-1",onClick:n.handleShowNavigation,children:[h.jsx(tn,{tag:"menubar1",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Menu"})]})]})})})}function Bc(n){const[t,i]=k.useState(!1),s=()=>i(!1),l=()=>i(!0);return h.jsxs(h.Fragment,{children:[h.jsx(kBe,{page:n.page,showNavigation:t,handleCloseNavigation:s,handleShowNavigation:l}),h.jsx(tLe,{}),h.jsx(FBe,{page:n.page,showNavigation:t,handleCloseNavigation:s,handleShowNavigation:l})]})}function sr({item:n}){const t=async()=>{if(navigator.clipboard)try{await navigator.clipboard.writeText(`${n.tag}`),console.log("Successfully copied - ",n.tag),Qt(`Copied to clipboard - '${n.tag}'`,"success")}catch(i){console.log("Failed to copy to clipboard...",i),Qt("Failed to copy","error")}};return h.jsxs(et,{children:[h.jsxs(et.Body,{className:"text-center position-relative p-2",children:[h.jsxs("div",{className:"d-flex justify-content-between",children:[h.jsx("div",{className:"me-0 font-15 fw_sb custom_tag tag_secondary_light",children:n.category}),h.jsx(Lt,{type:"button",className:"btn btn-theme btn-yellow btn-icon pe-none",children:n.familyCode})]}),h.jsx("div",{className:"lh-1",style:{fontSize:"40px"},children:h.jsx(tn,{title:n.title,tag:n.tag,className:`custom-icon icon-${n.category}`})}),h.jsx("div",{className:"mt-2 me-0 font-15 fw_sb",children:n.title}),h.jsx("div",{className:"mt-2 mb-2",children:`( ${n.familyName} )`})]}),h.jsx(et.Footer,{className:"p-0 border-top-0",children:h.jsxs(Lt,{type:"button",className:"btn btn-theme btn-primary w-100 border-0 position-relative",title:"Click to copy",onClick:t,children:["Tag: ",h.jsx("span",{className:"fw_sb",children:n.tag}),h.jsx(fBe,{className:"position-absolute font-20",style:{right:"12px"}})]})})]})}function BBe(){return h.jsxs(Yn,{fluid:!0,className:"py-5",children:[h.jsx("h4",{children:"All React Icons used in App:"}),h.jsx("hr",{}),En.filter(n=>n.category==="general").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"General:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="general").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="file").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Files:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="file").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="arrows").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Arrows:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="arrows").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="sort").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Sorting / Filter:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="sort").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="exp-bank").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Experience Bank:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="exp-bank").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="dashboard").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Dashboard:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="dashboard").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="associate").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Associate:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="associate").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="share").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Share:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="share").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="network").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Network:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="network").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="discover").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Discover:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="discover").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="consult").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Consult / Consulting session:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="consult").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="message").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Message:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="message").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="achievements").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Achievements:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="achievements").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="star").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Star:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="star").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="delete").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Delete / Trash:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="delete").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="analyze").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Analyze:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="analyze").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="edit").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Edit:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="edit").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="dictionary").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Dictionary:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="dictionary").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="reload").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Reload:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="reload").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="shop").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Shop:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="shop").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="connect").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Connect:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="connect").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="invitation").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Invitation:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="invitation").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="details").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Details:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="details").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="experience").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Experience:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="experience").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="dreams").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Dreams:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="dreams").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="events").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Events:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="events").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="thoughts").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Thoughts:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="thoughts").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="out of body").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Out of body:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="out of body").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="favorite").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Favorite:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="favorite").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="resolution").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Resolution:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="resolution").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="notifications").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Notifications:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="notifications").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="leaderboard").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Leaderboard:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="leaderboard").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="popular insights").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Popular insights:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="popular insights").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="add user").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Add user / friend:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="add user").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]}),En.filter(n=>n.category==="social").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Social:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:En.filter(n=>n.category==="social").map(n=>h.jsx(Gt,{children:h.jsx(sr,{item:n})},n.title))})]})]})}var VBe=function(t){return zBe(t)&&!HBe(t)};function zBe(n){return!!n&&typeof n=="object"}function HBe(n){var t=Object.prototype.toString.call(n);return t==="[object RegExp]"||t==="[object Date]"||$Be(n)}var GBe=typeof Symbol=="function"&&Symbol.for,WBe=GBe?Symbol.for("react.element"):60103;function $Be(n){return n.$$typeof===WBe}function KBe(n){return Array.isArray(n)?[]:{}}function K7(n,t){return t.clone!==!1&&t.isMergeableObject(n)?gN(KBe(n),n,t):n}function qBe(n,t,i){return n.concat(t).map(function(s){return K7(s,i)})}function YBe(n,t,i){var s={};return i.isMergeableObject(n)&&Object.keys(n).forEach(function(l){s[l]=K7(n[l],i)}),Object.keys(t).forEach(function(l){!i.isMergeableObject(t[l])||!n[l]?s[l]=K7(t[l],i):s[l]=gN(n[l],t[l],i)}),s}function gN(n,t,i){i=i||{},i.arrayMerge=i.arrayMerge||qBe,i.isMergeableObject=i.isMergeableObject||VBe;var s=Array.isArray(t),l=Array.isArray(n),d=s===l;return d?s?i.arrayMerge(n,t,i):YBe(n,t,i):K7(t,i)}gN.all=function(t,i){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(s,l){return gN(s,l,i)},{})};var pY=gN,e_e=typeof Xo=="object"&&Xo&&Xo.Object===Object&&Xo,XBe=typeof self=="object"&&self&&self.Object===Object&&self,Jp=e_e||XBe||Function("return this")(),Qv=Jp.Symbol,t_e=Object.prototype,JBe=t_e.hasOwnProperty,QBe=t_e.toString,F3=Qv?Qv.toStringTag:void 0;function ZBe(n){var t=JBe.call(n,F3),i=n[F3];try{n[F3]=void 0;var s=!0}catch{}var l=QBe.call(n);return s&&(t?n[F3]=i:delete n[F3]),l}var eVe=Object.prototype,tVe=eVe.toString;function nVe(n){return tVe.call(n)}var iVe="[object Null]",rVe="[object Undefined]",Ihe=Qv?Qv.toStringTag:void 0;function lw(n){return n==null?n===void 0?rVe:iVe:Ihe&&Ihe in Object(n)?ZBe(n):nVe(n)}function n_e(n,t){return function(i){return n(t(i))}}var iZ=n_e(Object.getPrototypeOf,Object);function cw(n){return n!=null&&typeof n=="object"}var sVe="[object Object]",aVe=Function.prototype,oVe=Object.prototype,i_e=aVe.toString,lVe=oVe.hasOwnProperty,cVe=i_e.call(Object);function Nhe(n){if(!cw(n)||lw(n)!=sVe)return!1;var t=iZ(n);if(t===null)return!0;var i=lVe.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&i_e.call(i)==cVe}var Ohe=Array.isArray,Phe=Object.keys,dVe=Object.prototype.hasOwnProperty,uVe=typeof Element<"u";function mY(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){var i=Ohe(n),s=Ohe(t),l,d,u;if(i&&s){if(d=n.length,d!=t.length)return!1;for(l=d;l--!==0;)if(!mY(n[l],t[l]))return!1;return!0}if(i!=s)return!1;var p=n instanceof Date,m=t instanceof Date;if(p!=m)return!1;if(p&&m)return n.getTime()==t.getTime();var y=n instanceof RegExp,_=t instanceof RegExp;if(y!=_)return!1;if(y&&_)return n.toString()==t.toString();var E=Phe(n);if(d=E.length,d!==Phe(t).length)return!1;for(l=d;l--!==0;)if(!dVe.call(t,E[l]))return!1;if(uVe&&n instanceof Element&&t instanceof Element)return n===t;for(l=d;l--!==0;)if(u=E[l],!(u==="_owner"&&n.$$typeof)&&!mY(n[u],t[u]))return!1;return!0}return n!==n&&t!==t}var hVe=function(t,i){try{return mY(t,i)}catch(s){if(s.message&&s.message.match(/stack|recursion/i)||s.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",s.name,s.message),!1;throw s}};const U_=ty(hVe);function fVe(){this.__data__=[],this.size=0}function r_e(n,t){return n===t||n!==n&&t!==t}function YU(n,t){for(var i=n.length;i--;)if(r_e(n[i][0],t))return i;return-1}var pVe=Array.prototype,mVe=pVe.splice;function gVe(n){var t=this.__data__,i=YU(t,n);if(i<0)return!1;var s=t.length-1;return i==s?t.pop():mVe.call(t,i,1),--this.size,!0}function vVe(n){var t=this.__data__,i=YU(t,n);return i<0?void 0:t[i][1]}function yVe(n){return YU(this.__data__,n)>-1}function _Ve(n,t){var i=this.__data__,s=YU(i,n);return s<0?(++this.size,i.push([n,t])):i[s][1]=t,this}function Qg(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}Qg.prototype.clear=fVe;Qg.prototype.delete=gVe;Qg.prototype.get=vVe;Qg.prototype.has=yVe;Qg.prototype.set=_Ve;function EVe(){this.__data__=new Qg,this.size=0}function wVe(n){var t=this.__data__,i=t.delete(n);return this.size=t.size,i}function SVe(n){return this.__data__.get(n)}function bVe(n){return this.__data__.has(n)}function _P(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var CVe="[object AsyncFunction]",TVe="[object Function]",RVe="[object GeneratorFunction]",xVe="[object Proxy]";function s_e(n){if(!_P(n))return!1;var t=lw(n);return t==TVe||t==RVe||t==CVe||t==xVe}var pK=Jp["__core-js_shared__"],Lhe=function(){var n=/[^.]+$/.exec(pK&&pK.keys&&pK.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function AVe(n){return!!Lhe&&Lhe in n}var IVe=Function.prototype,NVe=IVe.toString;function dw(n){if(n!=null){try{return NVe.call(n)}catch{}try{return n+""}catch{}}return""}var OVe=/[\\^$.*+?()[\]{}|]/g,PVe=/^\[object .+?Constructor\]$/,LVe=Function.prototype,DVe=Object.prototype,kVe=LVe.toString,MVe=DVe.hasOwnProperty,jVe=RegExp("^"+kVe.call(MVe).replace(OVe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function UVe(n){if(!_P(n)||AVe(n))return!1;var t=s_e(n)?jVe:PVe;return t.test(dw(n))}function FVe(n,t){return n==null?void 0:n[t]}function uw(n,t){var i=FVe(n,t);return UVe(i)?i:void 0}var vN=uw(Jp,"Map"),yN=uw(Object,"create");function BVe(){this.__data__=yN?yN(null):{},this.size=0}function VVe(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var zVe="__lodash_hash_undefined__",HVe=Object.prototype,GVe=HVe.hasOwnProperty;function WVe(n){var t=this.__data__;if(yN){var i=t[n];return i===zVe?void 0:i}return GVe.call(t,n)?t[n]:void 0}var $Ve=Object.prototype,KVe=$Ve.hasOwnProperty;function qVe(n){var t=this.__data__;return yN?t[n]!==void 0:KVe.call(t,n)}var YVe="__lodash_hash_undefined__";function XVe(n,t){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=yN&&t===void 0?YVe:t,this}function $2(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}$2.prototype.clear=BVe;$2.prototype.delete=VVe;$2.prototype.get=WVe;$2.prototype.has=qVe;$2.prototype.set=XVe;function JVe(){this.size=0,this.__data__={hash:new $2,map:new(vN||Qg),string:new $2}}function QVe(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function XU(n,t){var i=n.__data__;return QVe(t)?i[typeof t=="string"?"string":"hash"]:i.map}function ZVe(n){var t=XU(this,n).delete(n);return this.size-=t?1:0,t}function eze(n){return XU(this,n).get(n)}function tze(n){return XU(this,n).has(n)}function nze(n,t){var i=XU(this,n),s=i.size;return i.set(n,t),this.size+=i.size==s?0:1,this}function oy(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}oy.prototype.clear=JVe;oy.prototype.delete=ZVe;oy.prototype.get=eze;oy.prototype.has=tze;oy.prototype.set=nze;var ize=200;function rze(n,t){var i=this.__data__;if(i instanceof Qg){var s=i.__data__;if(!vN||s.length<ize-1)return s.push([n,t]),this.size=++i.size,this;i=this.__data__=new oy(s)}return i.set(n,t),this.size=i.size,this}function bx(n){var t=this.__data__=new Qg(n);this.size=t.size}bx.prototype.clear=EVe;bx.prototype.delete=wVe;bx.prototype.get=SVe;bx.prototype.has=bVe;bx.prototype.set=rze;function sze(n,t){for(var i=-1,s=n==null?0:n.length;++i<s&&t(n[i],i,n)!==!1;);return n}var Dhe=function(){try{var n=uw(Object,"defineProperty");return n({},"",{}),n}catch{}}();function a_e(n,t,i){t=="__proto__"&&Dhe?Dhe(n,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[t]=i}var aze=Object.prototype,oze=aze.hasOwnProperty;function o_e(n,t,i){var s=n[t];(!(oze.call(n,t)&&r_e(s,i))||i===void 0&&!(t in n))&&a_e(n,t,i)}function JU(n,t,i,s){var l=!i;i||(i={});for(var d=-1,u=t.length;++d<u;){var p=t[d],m=s?s(i[p],n[p],p,i,n):void 0;m===void 0&&(m=n[p]),l?a_e(i,p,m):o_e(i,p,m)}return i}function lze(n,t){for(var i=-1,s=Array(n);++i<n;)s[i]=t(i);return s}var cze="[object Arguments]";function khe(n){return cw(n)&&lw(n)==cze}var l_e=Object.prototype,dze=l_e.hasOwnProperty,uze=l_e.propertyIsEnumerable,hze=khe(function(){return arguments}())?khe:function(n){return cw(n)&&dze.call(n,"callee")&&!uze.call(n,"callee")},EP=Array.isArray;function fze(){return!1}var c_e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mhe=c_e&&typeof module=="object"&&module&&!module.nodeType&&module,pze=Mhe&&Mhe.exports===c_e,jhe=pze?Jp.Buffer:void 0,mze=jhe?jhe.isBuffer:void 0,d_e=mze||fze,gze=9007199254740991,vze=/^(?:0|[1-9]\d*)$/;function yze(n,t){var i=typeof n;return t=t??gze,!!t&&(i=="number"||i!="symbol"&&vze.test(n))&&n>-1&&n%1==0&&n<t}var _ze=9007199254740991;function u_e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=_ze}var Eze="[object Arguments]",wze="[object Array]",Sze="[object Boolean]",bze="[object Date]",Cze="[object Error]",Tze="[object Function]",Rze="[object Map]",xze="[object Number]",Aze="[object Object]",Ize="[object RegExp]",Nze="[object Set]",Oze="[object String]",Pze="[object WeakMap]",Lze="[object ArrayBuffer]",Dze="[object DataView]",kze="[object Float32Array]",Mze="[object Float64Array]",jze="[object Int8Array]",Uze="[object Int16Array]",Fze="[object Int32Array]",Bze="[object Uint8Array]",Vze="[object Uint8ClampedArray]",zze="[object Uint16Array]",Hze="[object Uint32Array]",bs={};bs[kze]=bs[Mze]=bs[jze]=bs[Uze]=bs[Fze]=bs[Bze]=bs[Vze]=bs[zze]=bs[Hze]=!0;bs[Eze]=bs[wze]=bs[Lze]=bs[Sze]=bs[Dze]=bs[bze]=bs[Cze]=bs[Tze]=bs[Rze]=bs[xze]=bs[Aze]=bs[Ize]=bs[Nze]=bs[Oze]=bs[Pze]=!1;function Gze(n){return cw(n)&&u_e(n.length)&&!!bs[lw(n)]}function rZ(n){return function(t){return n(t)}}var h_e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,F4=h_e&&typeof module=="object"&&module&&!module.nodeType&&module,Wze=F4&&F4.exports===h_e,mK=Wze&&e_e.process,nx=function(){try{var n=F4&&F4.require&&F4.require("util").types;return n||mK&&mK.binding&&mK.binding("util")}catch{}}(),Uhe=nx&&nx.isTypedArray,$ze=Uhe?rZ(Uhe):Gze,Kze=Object.prototype,qze=Kze.hasOwnProperty;function f_e(n,t){var i=EP(n),s=!i&&hze(n),l=!i&&!s&&d_e(n),d=!i&&!s&&!l&&$ze(n),u=i||s||l||d,p=u?lze(n.length,String):[],m=p.length;for(var y in n)(t||qze.call(n,y))&&!(u&&(y=="length"||l&&(y=="offset"||y=="parent")||d&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||yze(y,m)))&&p.push(y);return p}var Yze=Object.prototype;function sZ(n){var t=n&&n.constructor,i=typeof t=="function"&&t.prototype||Yze;return n===i}var Xze=n_e(Object.keys,Object),Jze=Object.prototype,Qze=Jze.hasOwnProperty;function Zze(n){if(!sZ(n))return Xze(n);var t=[];for(var i in Object(n))Qze.call(n,i)&&i!="constructor"&&t.push(i);return t}function p_e(n){return n!=null&&u_e(n.length)&&!s_e(n)}function aZ(n){return p_e(n)?f_e(n):Zze(n)}function eHe(n,t){return n&&JU(t,aZ(t),n)}function tHe(n){var t=[];if(n!=null)for(var i in Object(n))t.push(i);return t}var nHe=Object.prototype,iHe=nHe.hasOwnProperty;function rHe(n){if(!_P(n))return tHe(n);var t=sZ(n),i=[];for(var s in n)s=="constructor"&&(t||!iHe.call(n,s))||i.push(s);return i}function oZ(n){return p_e(n)?f_e(n,!0):rHe(n)}function sHe(n,t){return n&&JU(t,oZ(t),n)}var m_e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fhe=m_e&&typeof module=="object"&&module&&!module.nodeType&&module,aHe=Fhe&&Fhe.exports===m_e,Bhe=aHe?Jp.Buffer:void 0,Vhe=Bhe?Bhe.allocUnsafe:void 0;function oHe(n,t){if(t)return n.slice();var i=n.length,s=Vhe?Vhe(i):new n.constructor(i);return n.copy(s),s}function g_e(n,t){var i=-1,s=n.length;for(t||(t=Array(s));++i<s;)t[i]=n[i];return t}function lHe(n,t){for(var i=-1,s=n==null?0:n.length,l=0,d=[];++i<s;){var u=n[i];t(u,i,n)&&(d[l++]=u)}return d}function v_e(){return[]}var cHe=Object.prototype,dHe=cHe.propertyIsEnumerable,zhe=Object.getOwnPropertySymbols,lZ=zhe?function(n){return n==null?[]:(n=Object(n),lHe(zhe(n),function(t){return dHe.call(n,t)}))}:v_e;function uHe(n,t){return JU(n,lZ(n),t)}function y_e(n,t){for(var i=-1,s=t.length,l=n.length;++i<s;)n[l+i]=t[i];return n}var hHe=Object.getOwnPropertySymbols,__e=hHe?function(n){for(var t=[];n;)y_e(t,lZ(n)),n=iZ(n);return t}:v_e;function fHe(n,t){return JU(n,__e(n),t)}function E_e(n,t,i){var s=t(n);return EP(n)?s:y_e(s,i(n))}function pHe(n){return E_e(n,aZ,lZ)}function mHe(n){return E_e(n,oZ,__e)}var gY=uw(Jp,"DataView"),vY=uw(Jp,"Promise"),yY=uw(Jp,"Set"),_Y=uw(Jp,"WeakMap"),Hhe="[object Map]",gHe="[object Object]",Ghe="[object Promise]",Whe="[object Set]",$he="[object WeakMap]",Khe="[object DataView]",vHe=dw(gY),yHe=dw(vN),_He=dw(vY),EHe=dw(yY),wHe=dw(_Y),F_=lw;(gY&&F_(new gY(new ArrayBuffer(1)))!=Khe||vN&&F_(new vN)!=Hhe||vY&&F_(vY.resolve())!=Ghe||yY&&F_(new yY)!=Whe||_Y&&F_(new _Y)!=$he)&&(F_=function(n){var t=lw(n),i=t==gHe?n.constructor:void 0,s=i?dw(i):"";if(s)switch(s){case vHe:return Khe;case yHe:return Hhe;case _He:return Ghe;case EHe:return Whe;case wHe:return $he}return t});const cZ=F_;var SHe=Object.prototype,bHe=SHe.hasOwnProperty;function CHe(n){var t=n.length,i=new n.constructor(t);return t&&typeof n[0]=="string"&&bHe.call(n,"index")&&(i.index=n.index,i.input=n.input),i}var qhe=Jp.Uint8Array;function dZ(n){var t=new n.constructor(n.byteLength);return new qhe(t).set(new qhe(n)),t}function THe(n,t){var i=t?dZ(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}var RHe=/\w*$/;function xHe(n){var t=new n.constructor(n.source,RHe.exec(n));return t.lastIndex=n.lastIndex,t}var Yhe=Qv?Qv.prototype:void 0,Xhe=Yhe?Yhe.valueOf:void 0;function AHe(n){return Xhe?Object(Xhe.call(n)):{}}function IHe(n,t){var i=t?dZ(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}var NHe="[object Boolean]",OHe="[object Date]",PHe="[object Map]",LHe="[object Number]",DHe="[object RegExp]",kHe="[object Set]",MHe="[object String]",jHe="[object Symbol]",UHe="[object ArrayBuffer]",FHe="[object DataView]",BHe="[object Float32Array]",VHe="[object Float64Array]",zHe="[object Int8Array]",HHe="[object Int16Array]",GHe="[object Int32Array]",WHe="[object Uint8Array]",$He="[object Uint8ClampedArray]",KHe="[object Uint16Array]",qHe="[object Uint32Array]";function YHe(n,t,i){var s=n.constructor;switch(t){case UHe:return dZ(n);case NHe:case OHe:return new s(+n);case FHe:return THe(n,i);case BHe:case VHe:case zHe:case HHe:case GHe:case WHe:case $He:case KHe:case qHe:return IHe(n,i);case PHe:return new s;case LHe:case MHe:return new s(n);case DHe:return xHe(n);case kHe:return new s;case jHe:return AHe(n)}}var Jhe=Object.create,XHe=function(){function n(){}return function(t){if(!_P(t))return{};if(Jhe)return Jhe(t);n.prototype=t;var i=new n;return n.prototype=void 0,i}}();function JHe(n){return typeof n.constructor=="function"&&!sZ(n)?XHe(iZ(n)):{}}var QHe="[object Map]";function ZHe(n){return cw(n)&&cZ(n)==QHe}var Qhe=nx&&nx.isMap,eGe=Qhe?rZ(Qhe):ZHe,tGe="[object Set]";function nGe(n){return cw(n)&&cZ(n)==tGe}var Zhe=nx&&nx.isSet,iGe=Zhe?rZ(Zhe):nGe,rGe=1,sGe=2,aGe=4,w_e="[object Arguments]",oGe="[object Array]",lGe="[object Boolean]",cGe="[object Date]",dGe="[object Error]",S_e="[object Function]",uGe="[object GeneratorFunction]",hGe="[object Map]",fGe="[object Number]",b_e="[object Object]",pGe="[object RegExp]",mGe="[object Set]",gGe="[object String]",vGe="[object Symbol]",yGe="[object WeakMap]",_Ge="[object ArrayBuffer]",EGe="[object DataView]",wGe="[object Float32Array]",SGe="[object Float64Array]",bGe="[object Int8Array]",CGe="[object Int16Array]",TGe="[object Int32Array]",RGe="[object Uint8Array]",xGe="[object Uint8ClampedArray]",AGe="[object Uint16Array]",IGe="[object Uint32Array]",us={};us[w_e]=us[oGe]=us[_Ge]=us[EGe]=us[lGe]=us[cGe]=us[wGe]=us[SGe]=us[bGe]=us[CGe]=us[TGe]=us[hGe]=us[fGe]=us[b_e]=us[pGe]=us[mGe]=us[gGe]=us[vGe]=us[RGe]=us[xGe]=us[AGe]=us[IGe]=!0;us[dGe]=us[S_e]=us[yGe]=!1;function xM(n,t,i,s,l,d){var u,p=t&rGe,m=t&sGe,y=t&aGe;if(i&&(u=l?i(n,s,l,d):i(n)),u!==void 0)return u;if(!_P(n))return n;var _=EP(n);if(_){if(u=CHe(n),!p)return g_e(n,u)}else{var E=cZ(n),C=E==S_e||E==uGe;if(d_e(n))return oHe(n,p);if(E==b_e||E==w_e||C&&!l){if(u=m||C?{}:JHe(n),!p)return m?fHe(n,sHe(u,n)):uHe(n,eHe(u,n))}else{if(!us[E])return l?n:{};u=YHe(n,E,p)}}d||(d=new bx);var x=d.get(n);if(x)return x;d.set(n,u),iGe(n)?n.forEach(function(D){u.add(xM(D,t,i,D,n,d))}):eGe(n)&&n.forEach(function(D,P){u.set(P,xM(D,t,i,P,n,d))});var N=y?m?mHe:pHe:m?oZ:aZ,O=_?void 0:N(n);return sze(O||n,function(D,P){O&&(P=D,D=n[P]),o_e(u,P,xM(D,t,i,P,n,d))}),u}var NGe=4;function efe(n){return xM(n,NGe)}function C_e(n,t){for(var i=-1,s=n==null?0:n.length,l=Array(s);++i<s;)l[i]=t(n[i],i,n);return l}var OGe="[object Symbol]";function uZ(n){return typeof n=="symbol"||cw(n)&&lw(n)==OGe}var PGe="Expected a function";function hZ(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new TypeError(PGe);var i=function(){var s=arguments,l=t?t.apply(this,s):s[0],d=i.cache;if(d.has(l))return d.get(l);var u=n.apply(this,s);return i.cache=d.set(l,u)||d,u};return i.cache=new(hZ.Cache||oy),i}hZ.Cache=oy;var LGe=500;function DGe(n){var t=hZ(n,function(s){return i.size===LGe&&i.clear(),s}),i=t.cache;return t}var kGe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,MGe=/\\(\\)?/g,jGe=DGe(function(n){var t=[];return n.charCodeAt(0)===46&&t.push(""),n.replace(kGe,function(i,s,l,d){t.push(l?d.replace(MGe,"$1"):s||i)}),t});const UGe=jGe;var FGe=1/0;function BGe(n){if(typeof n=="string"||uZ(n))return n;var t=n+"";return t=="0"&&1/n==-FGe?"-0":t}var VGe=1/0,tfe=Qv?Qv.prototype:void 0,nfe=tfe?tfe.toString:void 0;function T_e(n){if(typeof n=="string")return n;if(EP(n))return C_e(n,T_e)+"";if(uZ(n))return nfe?nfe.call(n):"";var t=n+"";return t=="0"&&1/n==-VGe?"-0":t}function zGe(n){return n==null?"":T_e(n)}function R_e(n){return EP(n)?C_e(n,BGe):uZ(n)?[n]:g_e(UGe(zGe(n)))}var x_e={exports:{}},Wr={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ao=typeof Symbol=="function"&&Symbol.for,fZ=Ao?Symbol.for("react.element"):60103,pZ=Ao?Symbol.for("react.portal"):60106,QU=Ao?Symbol.for("react.fragment"):60107,ZU=Ao?Symbol.for("react.strict_mode"):60108,eF=Ao?Symbol.for("react.profiler"):60114,tF=Ao?Symbol.for("react.provider"):60109,nF=Ao?Symbol.for("react.context"):60110,mZ=Ao?Symbol.for("react.async_mode"):60111,iF=Ao?Symbol.for("react.concurrent_mode"):60111,rF=Ao?Symbol.for("react.forward_ref"):60112,sF=Ao?Symbol.for("react.suspense"):60113,HGe=Ao?Symbol.for("react.suspense_list"):60120,aF=Ao?Symbol.for("react.memo"):60115,oF=Ao?Symbol.for("react.lazy"):60116,GGe=Ao?Symbol.for("react.block"):60121,WGe=Ao?Symbol.for("react.fundamental"):60117,$Ge=Ao?Symbol.for("react.responder"):60118,KGe=Ao?Symbol.for("react.scope"):60119;function ou(n){if(typeof n=="object"&&n!==null){var t=n.$$typeof;switch(t){case fZ:switch(n=n.type,n){case mZ:case iF:case QU:case eF:case ZU:case sF:return n;default:switch(n=n&&n.$$typeof,n){case nF:case rF:case oF:case aF:case tF:return n;default:return t}}case pZ:return t}}}function A_e(n){return ou(n)===iF}Wr.AsyncMode=mZ;Wr.ConcurrentMode=iF;Wr.ContextConsumer=nF;Wr.ContextProvider=tF;Wr.Element=fZ;Wr.ForwardRef=rF;Wr.Fragment=QU;Wr.Lazy=oF;Wr.Memo=aF;Wr.Portal=pZ;Wr.Profiler=eF;Wr.StrictMode=ZU;Wr.Suspense=sF;Wr.isAsyncMode=function(n){return A_e(n)||ou(n)===mZ};Wr.isConcurrentMode=A_e;Wr.isContextConsumer=function(n){return ou(n)===nF};Wr.isContextProvider=function(n){return ou(n)===tF};Wr.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===fZ};Wr.isForwardRef=function(n){return ou(n)===rF};Wr.isFragment=function(n){return ou(n)===QU};Wr.isLazy=function(n){return ou(n)===oF};Wr.isMemo=function(n){return ou(n)===aF};Wr.isPortal=function(n){return ou(n)===pZ};Wr.isProfiler=function(n){return ou(n)===eF};Wr.isStrictMode=function(n){return ou(n)===ZU};Wr.isSuspense=function(n){return ou(n)===sF};Wr.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===QU||n===iF||n===eF||n===ZU||n===sF||n===HGe||typeof n=="object"&&n!==null&&(n.$$typeof===oF||n.$$typeof===aF||n.$$typeof===tF||n.$$typeof===nF||n.$$typeof===rF||n.$$typeof===WGe||n.$$typeof===$Ge||n.$$typeof===KGe||n.$$typeof===GGe)};Wr.typeOf=ou;x_e.exports=Wr;var qGe=x_e.exports,I_e=qGe,YGe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},XGe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},N_e={};N_e[I_e.ForwardRef]=YGe;N_e[I_e.Memo]=XGe;function wo(){return wo=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},wo.apply(this,arguments)}function O_e(n,t){if(n==null)return{};var i={},s=Object.keys(n),l,d;for(d=0;d<s.length;d++)l=s[d],!(t.indexOf(l)>=0)&&(i[l]=n[l]);return i}var lF=k.createContext(void 0);lF.displayName="FormikContext";var JGe=lF.Provider;lF.Consumer;function QGe(){var n=k.useContext(lF);return n}var Wu=function(t){return typeof t=="function"},cF=function(t){return t!==null&&typeof t=="object"},ZGe=function(t){return String(Math.floor(Number(t)))===t},gK=function(t){return Object.prototype.toString.call(t)==="[object String]"},eWe=function(t){return k.Children.count(t)===0},vK=function(t){return cF(t)&&Wu(t.then)};function Rd(n,t,i,s){s===void 0&&(s=0);for(var l=R_e(t);n&&s<l.length;)n=n[l[s++]];return s!==l.length&&!n||n===void 0?i:n}function k2(n,t,i){for(var s=efe(n),l=s,d=0,u=R_e(t);d<u.length-1;d++){var p=u[d],m=Rd(n,u.slice(0,d+1));if(m&&(cF(m)||Array.isArray(m)))l=l[p]=efe(m);else{var y=u[d+1];l=l[p]=ZGe(y)&&Number(y)>=0?[]:{}}}return(d===0?n:l)[u[d]]===i?n:(i===void 0?delete l[u[d]]:l[u[d]]=i,d===0&&i===void 0&&delete s[u[d]],s)}function P_e(n,t,i,s){i===void 0&&(i=new WeakMap),s===void 0&&(s={});for(var l=0,d=Object.keys(n);l<d.length;l++){var u=d[l],p=n[u];cF(p)?i.get(p)||(i.set(p,!0),s[u]=Array.isArray(p)?[]:{},P_e(p,t,i,s[u])):s[u]=t}return s}function tWe(n,t){switch(t.type){case"SET_VALUES":return wo({},n,{values:t.payload});case"SET_TOUCHED":return wo({},n,{touched:t.payload});case"SET_ERRORS":return U_(n.errors,t.payload)?n:wo({},n,{errors:t.payload});case"SET_STATUS":return wo({},n,{status:t.payload});case"SET_ISSUBMITTING":return wo({},n,{isSubmitting:t.payload});case"SET_ISVALIDATING":return wo({},n,{isValidating:t.payload});case"SET_FIELD_VALUE":return wo({},n,{values:k2(n.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return wo({},n,{touched:k2(n.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return wo({},n,{errors:k2(n.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return wo({},n,t.payload);case"SET_FORMIK_STATE":return t.payload(n);case"SUBMIT_ATTEMPT":return wo({},n,{touched:P_e(n.values,!0),isSubmitting:!0,submitCount:n.submitCount+1});case"SUBMIT_FAILURE":return wo({},n,{isSubmitting:!1});case"SUBMIT_SUCCESS":return wo({},n,{isSubmitting:!1});default:return n}}var L_={},Y8={};function nWe(n){var t=n.validateOnChange,i=t===void 0?!0:t,s=n.validateOnBlur,l=s===void 0?!0:s,d=n.validateOnMount,u=d===void 0?!1:d,p=n.isInitialValid,m=n.enableReinitialize,y=m===void 0?!1:m,_=n.onSubmit,E=O_e(n,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),C=wo({validateOnChange:i,validateOnBlur:l,validateOnMount:u,onSubmit:_},E),x=k.useRef(C.initialValues),N=k.useRef(C.initialErrors||L_),O=k.useRef(C.initialTouched||Y8),D=k.useRef(C.initialStatus),P=k.useRef(!1),j=k.useRef({});k.useEffect(function(){return P.current=!0,function(){P.current=!1}},[]);var M=k.useState(0),V=M[1],G=k.useRef({values:C.initialValues,errors:C.initialErrors||L_,touched:C.initialTouched||Y8,status:C.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),$=G.current,ne=k.useCallback(function(Me){var Ge=G.current;G.current=tWe(Ge,Me),Ge!==G.current&&V(function(bt){return bt+1})},[]),Y=k.useCallback(function(Me,Ge){return new Promise(function(bt,wt){var Pt=C.validate(Me,Ge);Pt==null?bt(L_):vK(Pt)?Pt.then(function(en){bt(en||L_)},function(en){wt(en)}):bt(Pt)})},[C.validate]),le=k.useCallback(function(Me,Ge){var bt=C.validationSchema,wt=Wu(bt)?bt(Ge):bt,Pt=Ge&&wt.validateAt?wt.validateAt(Ge,Me):rWe(Me,wt);return new Promise(function(en,un){Pt.then(function(){en(L_)},function(an){an.name==="ValidationError"?en(iWe(an)):un(an)})})},[C.validationSchema]),re=k.useCallback(function(Me,Ge){return new Promise(function(bt){return bt(j.current[Me].validate(Ge))})},[]),ee=k.useCallback(function(Me){var Ge=Object.keys(j.current).filter(function(wt){return Wu(j.current[wt].validate)}),bt=Ge.length>0?Ge.map(function(wt){return re(wt,Rd(Me,wt))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(bt).then(function(wt){return wt.reduce(function(Pt,en,un){return en==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||en&&(Pt=k2(Pt,Ge[un],en)),Pt},{})})},[re]),de=k.useCallback(function(Me){return Promise.all([ee(Me),C.validationSchema?le(Me):{},C.validate?Y(Me):{}]).then(function(Ge){var bt=Ge[0],wt=Ge[1],Pt=Ge[2],en=pY.all([bt,wt,Pt],{arrayMerge:sWe});return en})},[C.validate,C.validationSchema,ee,Y,le]),H=Fu(function(Me){return Me===void 0&&(Me=$.values),ne({type:"SET_ISVALIDATING",payload:!0}),de(Me).then(function(Ge){return P.current&&(ne({type:"SET_ISVALIDATING",payload:!1}),ne({type:"SET_ERRORS",payload:Ge})),Ge})});k.useEffect(function(){u&&P.current===!0&&U_(x.current,C.initialValues)&&H(x.current)},[u,H]);var ae=k.useCallback(function(Me){var Ge=Me&&Me.values?Me.values:x.current,bt=Me&&Me.errors?Me.errors:N.current?N.current:C.initialErrors||{},wt=Me&&Me.touched?Me.touched:O.current?O.current:C.initialTouched||{},Pt=Me&&Me.status?Me.status:D.current?D.current:C.initialStatus;x.current=Ge,N.current=bt,O.current=wt,D.current=Pt;var en=function(){ne({type:"RESET_FORM",payload:{isSubmitting:!!Me&&!!Me.isSubmitting,errors:bt,touched:wt,status:Pt,values:Ge,isValidating:!!Me&&!!Me.isValidating,submitCount:Me&&Me.submitCount&&typeof Me.submitCount=="number"?Me.submitCount:0}})};if(C.onReset){var un=C.onReset($.values,St);vK(un)?un.then(en):en()}else en()},[C.initialErrors,C.initialStatus,C.initialTouched,C.onReset]);k.useEffect(function(){P.current===!0&&!U_(x.current,C.initialValues)&&y&&(x.current=C.initialValues,ae(),u&&H(x.current))},[y,C.initialValues,ae,u,H]),k.useEffect(function(){y&&P.current===!0&&!U_(N.current,C.initialErrors)&&(N.current=C.initialErrors||L_,ne({type:"SET_ERRORS",payload:C.initialErrors||L_}))},[y,C.initialErrors]),k.useEffect(function(){y&&P.current===!0&&!U_(O.current,C.initialTouched)&&(O.current=C.initialTouched||Y8,ne({type:"SET_TOUCHED",payload:C.initialTouched||Y8}))},[y,C.initialTouched]),k.useEffect(function(){y&&P.current===!0&&!U_(D.current,C.initialStatus)&&(D.current=C.initialStatus,ne({type:"SET_STATUS",payload:C.initialStatus}))},[y,C.initialStatus,C.initialTouched]);var _e=Fu(function(Me){if(j.current[Me]&&Wu(j.current[Me].validate)){var Ge=Rd($.values,Me),bt=j.current[Me].validate(Ge);return vK(bt)?(ne({type:"SET_ISVALIDATING",payload:!0}),bt.then(function(wt){return wt}).then(function(wt){ne({type:"SET_FIELD_ERROR",payload:{field:Me,value:wt}}),ne({type:"SET_ISVALIDATING",payload:!1})})):(ne({type:"SET_FIELD_ERROR",payload:{field:Me,value:bt}}),Promise.resolve(bt))}else if(C.validationSchema)return ne({type:"SET_ISVALIDATING",payload:!0}),le($.values,Me).then(function(wt){return wt}).then(function(wt){ne({type:"SET_FIELD_ERROR",payload:{field:Me,value:Rd(wt,Me)}}),ne({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),me=k.useCallback(function(Me,Ge){var bt=Ge.validate;j.current[Me]={validate:bt}},[]),Ce=k.useCallback(function(Me){delete j.current[Me]},[]),he=Fu(function(Me,Ge){ne({type:"SET_TOUCHED",payload:Me});var bt=Ge===void 0?l:Ge;return bt?H($.values):Promise.resolve()}),pe=k.useCallback(function(Me){ne({type:"SET_ERRORS",payload:Me})},[]),Oe=Fu(function(Me,Ge){var bt=Wu(Me)?Me($.values):Me;ne({type:"SET_VALUES",payload:bt});var wt=Ge===void 0?i:Ge;return wt?H(bt):Promise.resolve()}),Fe=k.useCallback(function(Me,Ge){ne({type:"SET_FIELD_ERROR",payload:{field:Me,value:Ge}})},[]),Ue=Fu(function(Me,Ge,bt){ne({type:"SET_FIELD_VALUE",payload:{field:Me,value:Ge}});var wt=bt===void 0?i:bt;return wt?H(k2($.values,Me,Ge)):Promise.resolve()}),Ve=k.useCallback(function(Me,Ge){var bt=Ge,wt=Me,Pt;if(!gK(Me)){Me.persist&&Me.persist();var en=Me.target?Me.target:Me.currentTarget,un=en.type,an=en.name,ye=en.id,Q=en.value,ie=en.checked,Se=en.outerHTML,je=en.options,tt=en.multiple;bt=Ge||an||ye,wt=/number|range/.test(un)?(Pt=parseFloat(Q),isNaN(Pt)?"":Pt):/checkbox/.test(un)?oWe(Rd($.values,bt),ie,Q):je&&tt?aWe(je):Q}bt&&Ue(bt,wt)},[Ue,$.values]),Re=Fu(function(Me){if(gK(Me))return function(Ge){return Ve(Ge,Me)};Ve(Me)}),Be=Fu(function(Me,Ge,bt){Ge===void 0&&(Ge=!0),ne({type:"SET_FIELD_TOUCHED",payload:{field:Me,value:Ge}});var wt=bt===void 0?l:bt;return wt?H($.values):Promise.resolve()}),Xe=k.useCallback(function(Me,Ge){Me.persist&&Me.persist();var bt=Me.target,wt=bt.name,Pt=bt.id,en=bt.outerHTML,un=Ge||wt||Pt;Be(un,!0)},[Be]),we=Fu(function(Me){if(gK(Me))return function(Ge){return Xe(Ge,Me)};Xe(Me)}),We=k.useCallback(function(Me){Wu(Me)?ne({type:"SET_FORMIK_STATE",payload:Me}):ne({type:"SET_FORMIK_STATE",payload:function(){return Me}})},[]),st=k.useCallback(function(Me){ne({type:"SET_STATUS",payload:Me})},[]),pt=k.useCallback(function(Me){ne({type:"SET_ISSUBMITTING",payload:Me})},[]),Qe=Fu(function(){return ne({type:"SUBMIT_ATTEMPT"}),H().then(function(Me){var Ge=Me instanceof Error,bt=!Ge&&Object.keys(Me).length===0;if(bt){var wt;try{if(wt=Xt(),wt===void 0)return}catch(Pt){throw Pt}return Promise.resolve(wt).then(function(Pt){return P.current&&ne({type:"SUBMIT_SUCCESS"}),Pt}).catch(function(Pt){if(P.current)throw ne({type:"SUBMIT_FAILURE"}),Pt})}else if(P.current&&(ne({type:"SUBMIT_FAILURE"}),Ge))throw Me})}),Je=Fu(function(Me){Me&&Me.preventDefault&&Wu(Me.preventDefault)&&Me.preventDefault(),Me&&Me.stopPropagation&&Wu(Me.stopPropagation)&&Me.stopPropagation(),Qe().catch(function(Ge){console.warn("Warning: An unhandled error was caught from submitForm()",Ge)})}),St={resetForm:ae,validateForm:H,validateField:_e,setErrors:pe,setFieldError:Fe,setFieldTouched:Be,setFieldValue:Ue,setStatus:st,setSubmitting:pt,setTouched:he,setValues:Oe,setFormikState:We,submitForm:Qe},Xt=Fu(function(){return _($.values,St)}),Ht=Fu(function(Me){Me&&Me.preventDefault&&Wu(Me.preventDefault)&&Me.preventDefault(),Me&&Me.stopPropagation&&Wu(Me.stopPropagation)&&Me.stopPropagation(),ae()}),gn=k.useCallback(function(Me){return{value:Rd($.values,Me),error:Rd($.errors,Me),touched:!!Rd($.touched,Me),initialValue:Rd(x.current,Me),initialTouched:!!Rd(O.current,Me),initialError:Rd(N.current,Me)}},[$.errors,$.touched,$.values]),It=k.useCallback(function(Me){return{setValue:function(bt,wt){return Ue(Me,bt,wt)},setTouched:function(bt,wt){return Be(Me,bt,wt)},setError:function(bt){return Fe(Me,bt)}}},[Ue,Be,Fe]),xt=k.useCallback(function(Me){var Ge=cF(Me),bt=Ge?Me.name:Me,wt=Rd($.values,bt),Pt={name:bt,value:wt,onChange:Re,onBlur:we};if(Ge){var en=Me.type,un=Me.value,an=Me.as,ye=Me.multiple;en==="checkbox"?un===void 0?Pt.checked=!!wt:(Pt.checked=!!(Array.isArray(wt)&&~wt.indexOf(un)),Pt.value=un):en==="radio"?(Pt.checked=wt===un,Pt.value=un):an==="select"&&ye&&(Pt.value=Pt.value||[],Pt.multiple=!0)}return Pt},[we,Re,$.values]),mt=k.useMemo(function(){return!U_(x.current,$.values)},[x.current,$.values]),dt=k.useMemo(function(){return typeof p<"u"?mt?$.errors&&Object.keys($.errors).length===0:p!==!1&&Wu(p)?p(C):p:$.errors&&Object.keys($.errors).length===0},[p,mt,$.errors,C]),it=wo({},$,{initialValues:x.current,initialErrors:N.current,initialTouched:O.current,initialStatus:D.current,handleBlur:we,handleChange:Re,handleReset:Ht,handleSubmit:Je,resetForm:ae,setErrors:pe,setFormikState:We,setFieldTouched:Be,setFieldValue:Ue,setFieldError:Fe,setStatus:st,setSubmitting:pt,setTouched:he,setValues:Oe,submitForm:Qe,validateForm:H,validateField:_e,isValid:dt,dirty:mt,unregisterField:Ce,registerField:me,getFieldProps:xt,getFieldMeta:gn,getFieldHelpers:It,validateOnBlur:l,validateOnChange:i,validateOnMount:u});return it}function od(n){var t=nWe(n),i=n.component,s=n.children,l=n.render,d=n.innerRef;return k.useImperativeHandle(d,function(){return t}),k.createElement(JGe,{value:t},i?k.createElement(i,t):l?l(t):s?Wu(s)?s(t):eWe(s)?null:k.Children.only(s):null)}function iWe(n){var t={};if(n.inner){if(n.inner.length===0)return k2(t,n.path,n.message);for(var l=n.inner,i=Array.isArray(l),s=0,l=i?l:l[Symbol.iterator]();;){var d;if(i){if(s>=l.length)break;d=l[s++]}else{if(s=l.next(),s.done)break;d=s.value}var u=d;Rd(t,u.path)||(t=k2(t,u.path,u.message))}}return t}function rWe(n,t,i,s){i===void 0&&(i=!1);var l=EY(n);return t[i?"validateSync":"validate"](l,{abortEarly:!1,context:s||l})}function EY(n){var t=Array.isArray(n)?[]:{};for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var s=String(i);Array.isArray(n[s])===!0?t[s]=n[s].map(function(l){return Array.isArray(l)===!0||Nhe(l)?EY(l):l!==""?l:void 0}):Nhe(n[s])?t[s]=EY(n[s]):t[s]=n[s]!==""?n[s]:void 0}return t}function sWe(n,t,i){var s=n.slice();return t.forEach(function(d,u){if(typeof s[u]>"u"){var p=i.clone!==!1,m=p&&i.isMergeableObject(d);s[u]=m?pY(Array.isArray(d)?[]:{},d,i):d}else i.isMergeableObject(d)?s[u]=pY(n[u],d,i):n.indexOf(d)===-1&&s.push(d)}),s}function aWe(n){return Array.from(n).filter(function(t){return t.selected}).map(function(t){return t.value})}function oWe(n,t,i){if(typeof n=="boolean")return!!t;var s=[],l=!1,d=-1;if(Array.isArray(n))s=n,d=n.indexOf(i),l=d>=0;else if(!i||i=="true"||i=="false")return!!t;return t&&i&&!l?s.concat(i):l?s.slice(0,d).concat(s.slice(d+1)):s}var lWe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?k.useLayoutEffect:k.useEffect;function Fu(n){var t=k.useRef(n);return lWe(function(){t.current=n}),k.useCallback(function(){for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t.current.apply(void 0,s)},[])}var cWe=k.forwardRef(function(n,t){var i=n.action,s=O_e(n,["action"]),l=i??"#",d=QGe(),u=d.handleReset,p=d.handleSubmit;return k.createElement("form",wo({onSubmit:p,ref:t,onReset:u,action:l},s))});cWe.displayName="Form";function hw(n){this._maxSize=n,this.clear()}hw.prototype.clear=function(){this._size=0,this._values=Object.create(null)};hw.prototype.get=function(n){return this._values[n]};hw.prototype.set=function(n,t){return this._size>=this._maxSize&&this.clear(),n in this._values||this._size++,this._values[n]=t};var dWe=/[^.^\]^[]+|(?=\[\]|\.\.)/g,L_e=/^\d+$/,uWe=/^\d/,hWe=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,fWe=/^\s*(['"]?)(.*?)(\1)\s*$/,gZ=512,ife=new hw(gZ),rfe=new hw(gZ),sfe=new hw(gZ),M2={Cache:hw,split:wY,normalizePath:yK,setter:function(n){var t=yK(n);return rfe.get(n)||rfe.set(n,function(s,l){for(var d=0,u=t.length,p=s;d<u-1;){var m=t[d];if(m==="__proto__"||m==="constructor"||m==="prototype")return s;p=p[t[d++]]}p[t[d]]=l})},getter:function(n,t){var i=yK(n);return sfe.get(n)||sfe.set(n,function(l){for(var d=0,u=i.length;d<u;)if(l!=null||!t)l=l[i[d++]];else return;return l})},join:function(n){return n.reduce(function(t,i){return t+(vZ(i)||L_e.test(i)?"["+i+"]":(t?".":"")+i)},"")},forEach:function(n,t,i){pWe(Array.isArray(n)?n:wY(n),t,i)}};function yK(n){return ife.get(n)||ife.set(n,wY(n).map(function(t){return t.replace(fWe,"$2")}))}function wY(n){return n.match(dWe)||[""]}function pWe(n,t,i){var s=n.length,l,d,u,p;for(d=0;d<s;d++)l=n[d],l&&(vWe(l)&&(l='"'+l+'"'),p=vZ(l),u=!p&&/^\d+$/.test(l),t.call(i,l,p,u,d,n))}function vZ(n){return typeof n=="string"&&n&&["'",'"'].indexOf(n.charAt(0))!==-1}function mWe(n){return n.match(uWe)&&!n.match(L_e)}function gWe(n){return hWe.test(n)}function vWe(n){return!vZ(n)&&(mWe(n)||gWe(n))}const yWe=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,dF=n=>n.match(yWe)||[],uF=n=>n[0].toUpperCase()+n.slice(1),yZ=(n,t)=>dF(n).join(t).toLowerCase(),D_e=n=>dF(n).reduce((t,i)=>`${t}${t?i[0].toUpperCase()+i.slice(1).toLowerCase():i.toLowerCase()}`,""),_We=n=>uF(D_e(n)),EWe=n=>yZ(n,"_"),wWe=n=>yZ(n,"-"),SWe=n=>uF(yZ(n," ")),bWe=n=>dF(n).map(uF).join(" ");var _K={words:dF,upperFirst:uF,camelCase:D_e,pascalCase:_We,snakeCase:EWe,kebabCase:wWe,sentenceCase:SWe,titleCase:bWe},_Z={exports:{}};_Z.exports=function(n){return k_e(CWe(n),n)};_Z.exports.array=k_e;function k_e(n,t){var i=n.length,s=new Array(i),l={},d=i,u=TWe(t),p=RWe(n);for(t.forEach(function(y){if(!p.has(y[0])||!p.has(y[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)l[d]||m(n[d],d,new Set);return s;function m(y,_,E){if(E.has(y)){var C;try{C=", node was:"+JSON.stringify(y)}catch{C=""}throw new Error("Cyclic dependency"+C)}if(!p.has(y))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(y));if(!l[_]){l[_]=!0;var x=u.get(y)||new Set;if(x=Array.from(x),_=x.length){E.add(y);do{var N=x[--_];m(N,p.get(N),E)}while(_);E.delete(y)}s[--i]=y}}}function CWe(n){for(var t=new Set,i=0,s=n.length;i<s;i++){var l=n[i];t.add(l[0]),t.add(l[1])}return Array.from(t)}function TWe(n){for(var t=new Map,i=0,s=n.length;i<s;i++){var l=n[i];t.has(l[0])||t.set(l[0],new Set),t.has(l[1])||t.set(l[1],new Set),t.get(l[0]).add(l[1])}return t}function RWe(n){for(var t=new Map,i=0,s=n.length;i<s;i++)t.set(n[i],i);return t}var xWe=_Z.exports;const AWe=ty(xWe),IWe=Object.prototype.toString,NWe=Error.prototype.toString,OWe=RegExp.prototype.toString,PWe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",LWe=/^Symbol\((.*)\)(.*)$/;function DWe(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function afe(n,t=!1){if(n==null||n===!0||n===!1)return""+n;const i=typeof n;if(i==="number")return DWe(n);if(i==="string")return t?`"${n}"`:n;if(i==="function")return"[Function "+(n.name||"anonymous")+"]";if(i==="symbol")return PWe.call(n).replace(LWe,"Symbol($1)");const s=IWe.call(n).slice(8,-1);return s==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):s==="Error"||n instanceof Error?"["+NWe.call(n)+"]":s==="RegExp"?OWe.call(n):null}function $v(n,t){let i=afe(n,t);return i!==null?i:JSON.stringify(n,function(s,l){let d=afe(this[s],t);return d!==null?d:l},2)}function M_e(n){return n==null?[]:[].concat(n)}let j_e,kWe=/\$\{\s*(\w+)\s*\}/g;j_e=Symbol.toStringTag;class nd extends Error{static formatError(t,i){const s=i.label||i.path||"this";return s!==i.path&&(i=Object.assign({},i,{path:s})),typeof t=="string"?t.replace(kWe,(l,d)=>$v(i[d])):typeof t=="function"?t(i):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,i,s,l,d){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[j_e]="Error",this.name="ValidationError",this.value=i,this.path=s,this.type=l,this.errors=[],this.inner=[],M_e(t).forEach(u=>{if(nd.isError(u)){this.errors.push(...u.errors);const p=u.inner.length?u.inner:[u];this.inner.push(...p)}else this.errors.push(u)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!d&&Error.captureStackTrace&&Error.captureStackTrace(this,nd)}}let fp={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:t,value:i,originalValue:s})=>{const l=s!=null&&s!==i?` (cast from the value \`${$v(s,!0)}\`).`:".";return t!=="mixed"?`${n} must be a \`${t}\` type, but the final value was: \`${$v(i,!0)}\``+l:`${n} must match the configured type. The validated value was: \`${$v(i,!0)}\``+l}},Gh={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},MWe={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},SY={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},jWe={isValue:"${path} field must be ${value}"},bY={noUnknown:"${path} field has unspecified keys: ${unknown}"},UWe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},FWe={notType:n=>{const{path:t,value:i,spec:s}=n,l=s.types.length;if(Array.isArray(i)){if(i.length<l)return`${t} tuple value has too few items, expected a length of ${l} but got ${i.length} for value: \`${$v(i,!0)}\``;if(i.length>l)return`${t} tuple value has too many items, expected a length of ${l} but got ${i.length} for value: \`${$v(i,!0)}\``}return nd.formatError(fp.notType,n)}};Object.assign(Object.create(null),{mixed:fp,string:Gh,number:MWe,date:SY,object:bY,array:UWe,boolean:jWe,tuple:FWe});const EZ=n=>n&&n.__isYupSchema__;class q7{static fromOptions(t,i){if(!i.then&&!i.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:l,otherwise:d}=i,u=typeof s=="function"?s:(...p)=>p.every(m=>m===s);return new q7(t,(p,m)=>{var y;let _=u(...p)?l:d;return(y=_==null?void 0:_(m))!=null?y:m})}constructor(t,i){this.fn=void 0,this.refs=t,this.refs=t,this.fn=i}resolve(t,i){let s=this.refs.map(d=>d.getValue(i==null?void 0:i.value,i==null?void 0:i.parent,i==null?void 0:i.context)),l=this.fn(s,t,i);if(l===void 0||l===t)return t;if(!EZ(l))throw new TypeError("conditions must return a schema object");return l.resolve(i)}}const X8={context:"$",value:"."};class fw{constructor(t,i={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===X8.context,this.isValue=this.key[0]===X8.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?X8.context:this.isValue?X8.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&M2.getter(this.path,!0),this.map=i.map}getValue(t,i,s){let l=this.isContext?s:this.isValue?t:i;return this.getter&&(l=this.getter(l||{})),this.map&&(l=this.map(l)),l}cast(t,i){return this.getValue(t,i==null?void 0:i.parent,i==null?void 0:i.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}fw.prototype.__isYupRef=!0;const eE=n=>n==null;function Xb(n){function t({value:i,path:s="",options:l,originalValue:d,schema:u},p,m){const{name:y,test:_,params:E,message:C,skipAbsent:x}=n;let{parent:N,context:O,abortEarly:D=u.spec.abortEarly,disableStackTrace:P=u.spec.disableStackTrace}=l;function j(ee){return fw.isRef(ee)?ee.getValue(i,N,O):ee}function M(ee={}){var de;const H=Object.assign({value:i,originalValue:d,label:u.spec.label,path:ee.path||s,spec:u.spec},E,ee.params);for(const _e of Object.keys(H))H[_e]=j(H[_e]);const ae=new nd(nd.formatError(ee.message||C,H),i,H.path,ee.type||y,(de=ee.disableStackTrace)!=null?de:P);return ae.params=H,ae}const V=D?p:m;let G={path:s,parent:N,type:y,from:l.from,createError:M,resolve:j,options:l,originalValue:d,schema:u};const $=ee=>{nd.isError(ee)?V(ee):ee?m(null):V(M())},ne=ee=>{nd.isError(ee)?V(ee):p(ee)};if(x&&eE(i))return $(!0);let le;try{var re;if(le=_.call(G,i,G),typeof((re=le)==null?void 0:re.then)=="function"){if(l.sync)throw new Error(`Validation test of type: "${G.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(le).then($,ne)}}catch(ee){ne(ee);return}$(le)}return t.OPTIONS=n,t}function BWe(n,t,i,s=i){let l,d,u;return t?(M2.forEach(t,(p,m,y)=>{let _=m?p.slice(1,p.length-1):p;n=n.resolve({context:s,parent:l,value:i});let E=n.type==="tuple",C=y?parseInt(_,10):0;if(n.innerType||E){if(E&&!y)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${u}" must contain an index to the tuple element, e.g. "${u}[0]"`);if(i&&C>=i.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${p}, in the path: ${t}. because there is no value at that index. `);l=i,i=i&&i[C],n=E?n.spec.types[C]:n.innerType}if(!y){if(!n.fields||!n.fields[_])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${u} which is a type: "${n.type}")`);l=i,i=i&&i[_],n=n.fields[_]}d=_,u=m?"["+p+"]":"."+p}),{schema:n,parent:l,parentPath:d}):{parent:l,parentPath:t,schema:n}}class Y7 extends Set{describe(){const t=[];for(const i of this.values())t.push(fw.isRef(i)?i.describe():i);return t}resolveAll(t){let i=[];for(const s of this.values())i.push(t(s));return i}clone(){return new Y7(this.values())}merge(t,i){const s=this.clone();return t.forEach(l=>s.add(l)),i.forEach(l=>s.delete(l)),s}}function PC(n,t=new Map){if(EZ(n)||!n||typeof n!="object")return n;if(t.has(n))return t.get(n);let i;if(n instanceof Date)i=new Date(n.getTime()),t.set(n,i);else if(n instanceof RegExp)i=new RegExp(n),t.set(n,i);else if(Array.isArray(n)){i=new Array(n.length),t.set(n,i);for(let s=0;s<n.length;s++)i[s]=PC(n[s],t)}else if(n instanceof Map){i=new Map,t.set(n,i);for(const[s,l]of n.entries())i.set(s,PC(l,t))}else if(n instanceof Set){i=new Set,t.set(n,i);for(const s of n)i.add(PC(s,t))}else if(n instanceof Object){i={},t.set(n,i);for(const[s,l]of Object.entries(n))i[s]=PC(l,t)}else throw Error(`Unable to clone ${n}`);return i}class $p{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Y7,this._blacklist=new Y7,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(fp.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(i=>{i.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const i=Object.create(Object.getPrototypeOf(this));return i.type=this.type,i._typeCheck=this._typeCheck,i._whitelist=this._whitelist.clone(),i._blacklist=this._blacklist.clone(),i.internalTests=Object.assign({},this.internalTests),i.exclusiveTests=Object.assign({},this.exclusiveTests),i.deps=[...this.deps],i.conditions=[...this.conditions],i.tests=[...this.tests],i.transforms=[...this.transforms],i.spec=PC(Object.assign({},this.spec,t)),i}label(t){let i=this.clone();return i.spec.label=t,i}meta(...t){if(t.length===0)return this.spec.meta;let i=this.clone();return i.spec.meta=Object.assign(i.spec.meta||{},t[0]),i}withMutation(t){let i=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=i,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let i=this,s=t.clone();const l=Object.assign({},i.spec,s.spec);return s.spec=l,s.internalTests=Object.assign({},i.internalTests,s.internalTests),s._whitelist=i._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=i._blacklist.merge(t._blacklist,t._whitelist),s.tests=i.tests,s.exclusiveTests=i.exclusiveTests,s.withMutation(d=>{t.tests.forEach(u=>{d.test(u.OPTIONS)})}),s.transforms=[...i.transforms,...s.transforms],s}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let i=this;if(i.conditions.length){let s=i.conditions;i=i.clone(),i.conditions=[],i=s.reduce((l,d)=>d.resolve(l,t),i),i=i.resolve(t)}return i}resolveOptions(t){var i,s,l,d;return Object.assign({},t,{from:t.from||[],strict:(i=t.strict)!=null?i:this.spec.strict,abortEarly:(s=t.abortEarly)!=null?s:this.spec.abortEarly,recursive:(l=t.recursive)!=null?l:this.spec.recursive,disableStackTrace:(d=t.disableStackTrace)!=null?d:this.spec.disableStackTrace})}cast(t,i={}){let s=this.resolve(Object.assign({value:t},i)),l=i.assert==="ignore-optionality",d=s._cast(t,i);if(i.assert!==!1&&!s.isType(d)){if(l&&eE(d))return d;let u=$v(t),p=$v(d);throw new TypeError(`The value of ${i.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
attempted value: ${u}
`+(p!==u?`result of cast: ${p}`:""))}return d}_cast(t,i){let s=t===void 0?t:this.transforms.reduce((l,d)=>d.call(this,l,t,this),t);return s===void 0&&(s=this.getDefault(i)),s}_validate(t,i={},s,l){let{path:d,originalValue:u=t,strict:p=this.spec.strict}=i,m=t;p||(m=this._cast(m,Object.assign({assert:!1},i)));let y=[];for(let _ of Object.values(this.internalTests))_&&y.push(_);this.runTests({path:d,value:m,originalValue:u,options:i,tests:y},s,_=>{if(_.length)return l(_,m);this.runTests({path:d,value:m,originalValue:u,options:i,tests:this.tests},s,l)})}runTests(t,i,s){let l=!1,{tests:d,value:u,originalValue:p,path:m,options:y}=t,_=O=>{l||(l=!0,i(O,u))},E=O=>{l||(l=!0,s(O,u))},C=d.length,x=[];if(!C)return E([]);let N={value:u,originalValue:p,path:m,options:y,schema:this};for(let O=0;O<d.length;O++){const D=d[O];D(N,_,function(j){j&&(Array.isArray(j)?x.push(...j):x.push(j)),--C<=0&&E(x)})}}asNestedTest({key:t,index:i,parent:s,parentPath:l,originalParent:d,options:u}){const p=t??i;if(p==null)throw TypeError("Must include `key` or `index` for nested validations");const m=typeof p=="number";let y=s[p];const _=Object.assign({},u,{strict:!0,parent:s,value:y,originalValue:d[p],key:void 0,[m?"index":"key"]:p,path:m||p.includes(".")?`${l||""}[${y?p:`"${p}"`}]`:(l?`${l}.`:"")+t});return(E,C,x)=>this.resolve(_)._validate(y,_,C,x)}validate(t,i){var s;let l=this.resolve(Object.assign({},i,{value:t})),d=(s=i==null?void 0:i.disableStackTrace)!=null?s:l.spec.disableStackTrace;return new Promise((u,p)=>l._validate(t,i,(m,y)=>{nd.isError(m)&&(m.value=y),p(m)},(m,y)=>{m.length?p(new nd(m,y,void 0,void 0,d)):u(y)}))}validateSync(t,i){var s;let l=this.resolve(Object.assign({},i,{value:t})),d,u=(s=i==null?void 0:i.disableStackTrace)!=null?s:l.spec.disableStackTrace;return l._validate(t,Object.assign({},i,{sync:!0}),(p,m)=>{throw nd.isError(p)&&(p.value=m),p},(p,m)=>{if(p.length)throw new nd(p,t,void 0,void 0,u);d=m}),d}isValid(t,i){return this.validate(t,i).then(()=>!0,s=>{if(nd.isError(s))return!1;throw s})}isValidSync(t,i){try{return this.validateSync(t,i),!0}catch(s){if(nd.isError(s))return!1;throw s}}_getDefault(t){let i=this.spec.default;return i==null?i:typeof i=="function"?i.call(this,t):PC(i)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,i){const s=this.clone({nullable:t});return s.internalTests.nullable=Xb({message:i,name:"nullable",test(l){return l===null?this.schema.spec.nullable:!0}}),s}optionality(t,i){const s=this.clone({optional:t});return s.internalTests.optionality=Xb({message:i,name:"optionality",test(l){return l===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(t=fp.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=fp.notNull){return this.nullability(!1,t)}required(t=fp.required){return this.clone().withMutation(i=>i.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let i=this.clone();return i.transforms.push(t),i}test(...t){let i;if(t.length===1?typeof t[0]=="function"?i={test:t[0]}:i=t[0]:t.length===2?i={name:t[0],test:t[1]}:i={name:t[0],message:t[1],test:t[2]},i.message===void 0&&(i.message=fp.default),typeof i.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),l=Xb(i),d=i.exclusive||i.name&&s.exclusiveTests[i.name]===!0;if(i.exclusive&&!i.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return i.name&&(s.exclusiveTests[i.name]=!!i.exclusive),s.tests=s.tests.filter(u=>!(u.OPTIONS.name===i.name&&(d||u.OPTIONS.test===l.OPTIONS.test))),s.tests.push(l),s}when(t,i){!Array.isArray(t)&&typeof t!="string"&&(i=t,t=".");let s=this.clone(),l=M_e(t).map(d=>new fw(d));return l.forEach(d=>{d.isSibling&&s.deps.push(d.key)}),s.conditions.push(typeof i=="function"?new q7(l,i):q7.fromOptions(l,i)),s}typeError(t){let i=this.clone();return i.internalTests.typeError=Xb({message:t,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),i}oneOf(t,i=fp.oneOf){let s=this.clone();return t.forEach(l=>{s._whitelist.add(l),s._blacklist.delete(l)}),s.internalTests.whiteList=Xb({message:i,name:"oneOf",skipAbsent:!0,test(l){let d=this.schema._whitelist,u=d.resolveAll(this.resolve);return u.includes(l)?!0:this.createError({params:{values:Array.from(d).join(", "),resolved:u}})}}),s}notOneOf(t,i=fp.notOneOf){let s=this.clone();return t.forEach(l=>{s._blacklist.add(l),s._whitelist.delete(l)}),s.internalTests.blacklist=Xb({message:i,name:"notOneOf",test(l){let d=this.schema._blacklist,u=d.resolveAll(this.resolve);return u.includes(l)?this.createError({params:{values:Array.from(d).join(", "),resolved:u}}):!0}}),s}strip(t=!0){let i=this.clone();return i.spec.strip=t,i}describe(t){const i=(t?this.resolve(t):this).clone(),{label:s,meta:l,optional:d,nullable:u}=i.spec;return{meta:l,label:s,optional:d,nullable:u,default:i.getDefault(t),type:i.type,oneOf:i._whitelist.describe(),notOneOf:i._blacklist.describe(),tests:i.tests.map(m=>({name:m.OPTIONS.name,params:m.OPTIONS.params})).filter((m,y,_)=>_.findIndex(E=>E.name===m.name)===y)}}}$p.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])$p.prototype[`${n}At`]=function(t,i,s={}){const{parent:l,parentPath:d,schema:u}=BWe(this,t,i,s.context);return u[n](l&&l[d],Object.assign({},s,{parent:l,path:t}))};for(const n of["equals","is"])$p.prototype[n]=$p.prototype.oneOf;for(const n of["not","nope"])$p.prototype[n]=$p.prototype.notOneOf;let VWe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,zWe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,HWe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,GWe=n=>eE(n)||n===n.trim(),WWe={}.toString();function Ef(){return new U_e}class U_e extends $p{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,i,s)=>{if(!s.spec.coerce||s.isType(t)||Array.isArray(t))return t;const l=t!=null&&t.toString?t.toString():t;return l===WWe?t:l})})}required(t){return super.required(t).withMutation(i=>i.test({message:t||fp.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(i=>i.OPTIONS.name!=="required"),t))}length(t,i=Gh.length){return this.test({message:i,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(s){return s.length===this.resolve(t)}})}min(t,i=Gh.min){return this.test({message:i,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s.length>=this.resolve(t)}})}max(t,i=Gh.max){return this.test({name:"max",exclusive:!0,message:i,params:{max:t},skipAbsent:!0,test(s){return s.length<=this.resolve(t)}})}matches(t,i){let s=!1,l,d;return i&&(typeof i=="object"?{excludeEmptyString:s=!1,message:l,name:d}=i:l=i),this.test({name:d||"matches",message:l||Gh.matches,params:{regex:t},skipAbsent:!0,test:u=>u===""&&s||u.search(t)!==-1})}email(t=Gh.email){return this.matches(VWe,{name:"email",message:t,excludeEmptyString:!0})}url(t=Gh.url){return this.matches(zWe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Gh.uuid){return this.matches(HWe,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Gh.trim){return this.transform(i=>i!=null?i.trim():i).test({message:t,name:"trim",test:GWe})}lowercase(t=Gh.lowercase){return this.transform(i=>eE(i)?i:i.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:i=>eE(i)||i===i.toLowerCase()})}uppercase(t=Gh.uppercase){return this.transform(i=>eE(i)?i:i.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:i=>eE(i)||i===i.toUpperCase()})}}Ef.prototype=U_e.prototype;const $We=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Mm(n,t=0){return Number(n)||t}function KWe(n){const t=$We.exec(n);if(!t)return Date.parse?Date.parse(n):Number.NaN;const i={year:Mm(t[1]),month:Mm(t[2],1)-1,day:Mm(t[3],1),hour:Mm(t[4]),minute:Mm(t[5]),second:Mm(t[6]),millisecond:t[7]?Mm(t[7].substring(0,3)):0,z:t[8]||void 0,plusMinus:t[9]||void 0,hourOffset:Mm(t[10]),minuteOffset:Mm(t[11])};if(i.z===void 0&&i.plusMinus===void 0)return new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond).valueOf();let s=0;return i.z!=="Z"&&i.plusMinus!==void 0&&(s=i.hourOffset*60+i.minuteOffset,i.plusMinus==="+"&&(s=0-s)),Date.UTC(i.year,i.month,i.day,i.hour,i.minute+s,i.second,i.millisecond)}let qWe=new Date(""),YWe=n=>Object.prototype.toString.call(n)==="[object Date]";class hF extends $p{constructor(){super({type:"date",check(t){return YWe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,i,s)=>!s.spec.coerce||s.isType(t)||t===null?t:(t=KWe(t),isNaN(t)?hF.INVALID_DATE:new Date(t)))})}prepareParam(t,i){let s;if(fw.isRef(t))s=t;else{let l=this.cast(t);if(!this._typeCheck(l))throw new TypeError(`\`${i}\` must be a Date or a value that can be \`cast()\` to a Date`);s=l}return s}min(t,i=SY.min){let s=this.prepareParam(t,"min");return this.test({message:i,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(l){return l>=this.resolve(s)}})}max(t,i=SY.max){let s=this.prepareParam(t,"max");return this.test({message:i,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(l){return l<=this.resolve(s)}})}}hF.INVALID_DATE=qWe;hF.prototype;function XWe(n,t=[]){let i=[],s=new Set,l=new Set(t.map(([u,p])=>`${u}-${p}`));function d(u,p){let m=M2.split(u)[0];s.add(m),l.has(`${p}-${m}`)||i.push([p,m])}for(const u of Object.keys(n)){let p=n[u];s.add(u),fw.isRef(p)&&p.isSibling?d(p.path,u):EZ(p)&&"deps"in p&&p.deps.forEach(m=>d(m,u))}return AWe.array(Array.from(s),i).reverse()}function ofe(n,t){let i=1/0;return n.some((s,l)=>{var d;if((d=t.path)!=null&&d.includes(s))return i=l,!0}),i}function F_e(n){return(t,i)=>ofe(n,t)-ofe(n,i)}const JWe=(n,t,i)=>{if(typeof n!="string")return n;let s=n;try{s=JSON.parse(n)}catch{}return i.isType(s)?s:n};function AM(n){if("fields"in n){const t={};for(const[i,s]of Object.entries(n.fields))t[i]=AM(s);return n.setFields(t)}if(n.type==="array"){const t=n.optional();return t.innerType&&(t.innerType=AM(t.innerType)),t}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(AM)}):"optional"in n?n.optional():n}const QWe=(n,t)=>{const i=[...M2.normalizePath(t)];if(i.length===1)return i[0]in n;let s=i.pop(),l=M2.getter(M2.join(i),!0)(n);return!!(l&&s in l)};let lfe=n=>Object.prototype.toString.call(n)==="[object Object]";function ZWe(n,t){let i=Object.keys(n.fields);return Object.keys(t).filter(s=>i.indexOf(s)===-1)}const e$e=F_e([]);function gc(n){return new B_e(n)}class B_e extends $p{constructor(t){super({type:"object",check(i){return lfe(i)||typeof i=="function"}}),this.fields=Object.create(null),this._sortErrors=e$e,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,i={}){var s;let l=super._cast(t,i);if(l===void 0)return this.getDefault(i);if(!this._typeCheck(l))return l;let d=this.fields,u=(s=i.stripUnknown)!=null?s:this.spec.noUnknown,p=[].concat(this._nodes,Object.keys(l).filter(E=>!this._nodes.includes(E))),m={},y=Object.assign({},i,{parent:m,__validating:i.__validating||!1}),_=!1;for(const E of p){let C=d[E],x=E in l;if(C){let N,O=l[E];y.path=(i.path?`${i.path}.`:"")+E,C=C.resolve({value:O,context:i.context,parent:m});let D=C instanceof $p?C.spec:void 0,P=D==null?void 0:D.strict;if(D!=null&&D.strip){_=_||E in l;continue}N=!i.__validating||!P?C.cast(l[E],y):l[E],N!==void 0&&(m[E]=N)}else x&&!u&&(m[E]=l[E]);(x!==E in m||m[E]!==l[E])&&(_=!0)}return _?m:l}_validate(t,i={},s,l){let{from:d=[],originalValue:u=t,recursive:p=this.spec.recursive}=i;i.from=[{schema:this,value:u},...d],i.__validating=!0,i.originalValue=u,super._validate(t,i,s,(m,y)=>{if(!p||!lfe(y)){l(m,y);return}u=u||y;let _=[];for(let E of this._nodes){let C=this.fields[E];!C||fw.isRef(C)||_.push(C.asNestedTest({options:i,key:E,parent:y,parentPath:i.path,originalParent:u}))}this.runTests({tests:_,value:y,originalValue:u,options:i},s,E=>{l(E.sort(this._sortErrors).concat(m),y)})})}clone(t){const i=super.clone(t);return i.fields=Object.assign({},this.fields),i._nodes=this._nodes,i._excludedEdges=this._excludedEdges,i._sortErrors=this._sortErrors,i}concat(t){let i=super.concat(t),s=i.fields;for(let[l,d]of Object.entries(this.fields)){const u=s[l];s[l]=u===void 0?d:u}return i.withMutation(l=>l.setFields(s,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let i={};return this._nodes.forEach(s=>{var l;const d=this.fields[s];let u=t;(l=u)!=null&&l.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[s]})),i[s]=d&&"getDefault"in d?d.getDefault(u):void 0}),i}setFields(t,i){let s=this.clone();return s.fields=t,s._nodes=XWe(t,i),s._sortErrors=F_e(Object.keys(t)),i&&(s._excludedEdges=i),s}shape(t,i=[]){return this.clone().withMutation(s=>{let l=s._excludedEdges;return i.length&&(Array.isArray(i[0])||(i=[i]),l=[...s._excludedEdges,...i]),s.setFields(Object.assign(s.fields,t),l)})}partial(){const t={};for(const[i,s]of Object.entries(this.fields))t[i]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(t)}deepPartial(){return AM(this)}pick(t){const i={};for(const s of t)this.fields[s]&&(i[s]=this.fields[s]);return this.setFields(i,this._excludedEdges.filter(([s,l])=>t.includes(s)&&t.includes(l)))}omit(t){const i=[];for(const s of Object.keys(this.fields))t.includes(s)||i.push(s);return this.pick(i)}from(t,i,s){let l=M2.getter(t,!0);return this.transform(d=>{if(!d)return d;let u=d;return QWe(d,t)&&(u=Object.assign({},d),s||delete u[t],u[i]=l(d)),u})}json(){return this.transform(JWe)}noUnknown(t=!0,i=bY.noUnknown){typeof t!="boolean"&&(i=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:i,test(l){if(l==null)return!0;const d=ZWe(this.schema,l);return!t||d.length===0||this.createError({params:{unknown:d.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,i=bY.noUnknown){return this.noUnknown(!t,i)}transformKeys(t){return this.transform(i=>{if(!i)return i;const s={};for(const l of Object.keys(i))s[t(l)]=i[l];return s})}camelCase(){return this.transformKeys(_K.camelCase)}snakeCase(){return this.transformKeys(_K.snakeCase)}constantCase(){return this.transformKeys(t=>_K.snakeCase(t).toUpperCase())}describe(t){const i=(t?this.resolve(t):this).clone(),s=super.describe(t);s.fields={};for(const[d,u]of Object.entries(i.fields)){var l;let p=t;(l=p)!=null&&l.value&&(p=Object.assign({},p,{parent:p.value,value:p.value[d]})),s.fields[d]=u.describe(p)}return s}}gc.prototype=B_e.prototype;function V_e({otp:n,totalDigits:t,handleUpdateOTP:i}){const[s,l]=k.useState(new Array(t).fill("")),[d,u]=k.useState(""),[p,m]=k.useState(!1),y=k.useRef([]);function _(C,x){if(C.length>1){x<t-1&&y.current[x+1].focus();return}let N=[...s];N[x]=C,l(N),C&&x<t-1&&y.current[x+1].focus()}function E(C,x){C.key==="Backspace"&&!C.target.value&&x>0&&y.current[x-1].focus(),C.key==="Enter"&&C.target.value&&x<t-1&&y.current[x+1].focus()}return k.useEffect(()=>{s.includes("")?(m(!1),u("Enter OTP")):(m(!0),u(""));const C=s.join("");i(C)},[s]),k.useEffect(()=>{n===0&&l(new Array(t).fill(""))},[n]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"d-flex justify-content-around align-items-center otp-input-wrap",children:s.map((C,x)=>h.jsx("input",{type:"number",value:C,min:"0",max:"9",step:"1",maxLength:1,inputMode:"numeric",pattern:"[0-9]*",onChange:N=>_(N.target.value,x),onKeyUp:N=>E(N,x),ref:N=>y.current[x]=N,className:"otp-field text-center"},x))}),d&&h.jsx("p",{className:"text-danger font-13 text-center py-2",children:d})]})}function t$e(n){var G;const i=ji(),[s,l]=k.useState(!1),[d,u]=k.useState(!1),[p,m]=k.useState(""),[y,_]=k.useState(!1),[E,C]=k.useState(!1),[x,N]=k.useState(!1);k.useEffect(()=>{window.scrollTo(0,0)},[]);const O=()=>{C(!1)},D=()=>{C(!0)};function P($){$.toString().length===6?_(!0):_(!1),m($)}async function j($){if($.preventDefault(),!x){Qt("Please accept Terms & Conditions.","error");return}l(!0);let ne={email:n.data.email,otp:p,device:localStorage.getItem("deviceID"),application:n.data.application,domain:n.data.domain};Ai.verifyAuth(ne).then(Y=>{Y.data.status==="success"&&(Qt(Y.data.message,"success"),l(!1),Ai.setToken(Y.data.data),Ai.registerDeviceForPushNotification(),i("/dashboard")),Y.data.status==="failed"&&(console.log("Failed ERROR response : ",Y.data),Qt(Y.data.message,"error"),l(!1),P(0))}).catch(Y=>{var le,re;l(!1),((le=Y.response)==null?void 0:le.data.status)==="failed"&&Qt((re=Y.response)==null?void 0:re.data.message,"error"),console.log("Verify OTP Error = ",Y)})}async function M(){u(!0);let $={email:n.data.email,application:n.data.application,domain:n.data.domain};Ai.login($).then(ne=>{ne.data.status==="success"&&(Qt(ne.data.message,"success"),u(!1)),ne.data.status==="failed"&&(console.log("Failed ERROR response : ",ne.data),Qt(ne.data.message,"error"),u(!1))}).catch(ne=>{u(!1),ne.response.data.status==="failed"&&Qt(ne.response.data.message,"error"),console.log("Resend Code Error = ",ne)})}function V($){N(!x),D()}return h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsxs(et.Body,{children:[h.jsxs("div",{className:"mb-5 text-center",children:[h.jsx("div",{className:"secondary-text mb-4 text-center",children:h.jsx("h2",{children:"Verify Code"})}),h.jsx("div",{className:"helper-text",children:"We have sent you OTP on your email."})]}),h.jsx("div",{className:"form-container",children:h.jsxs(kt,{onSubmit:j,children:[h.jsx(kt.Group,{className:"form-group",children:h.jsx(kt.Control,{type:"text",placeholder:"Enter OTP",name:"otp",value:p,required:!0,autoComplete:"off",readOnly:!0,style:{width:"0.1px",height:"0.1px",overflow:"hidden",position:"absolute",zIndex:"-1",opacity:0,visibility:"hidden"}})}),h.jsx(kt.Group,{className:"form-group mb-3",children:h.jsx(V_e,{totalDigits:6,handleUpdateOTP:P,otp:p})}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-3",children:h.jsx(kt.Group,{className:"form-group mb-2 fw-sb",children:h.jsx(kt.Check,{onChange:V,value:"test",type:"checkbox",id:"terms",label:"Terms & Conditions"})})}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-4 pb-5 px-2",children:h.jsx(Lt,{type:"button",variant:"link",className:"btn-theme font-14 fw-sb text-decoration-none",onClick:M,children:d?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Sending"]}):h.jsx(h.Fragment,{children:"Send me a new code"})})}),h.jsx("div",{className:"btn-wrapper",children:h.jsx(Lt,{type:"submit",size:"lg",disabled:!y,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:s?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):y?"Verify OTP":"Please fill out all info"})}),h.jsx(Zye,{show:E,handleClose:O,terms:(G=n.data)==null?void 0:G.terms})]})})]})})}function n$e(n){const[i,s]=k.useState(""),[l,d]=k.useState(!1),[u,p]=k.useState("password"),[m,y]=k.useState(!1),_=()=>{p(u==="password"?"text":"password")},E={password:""},C=gc().shape({password:Ef().min(6,"Password is too short").required("Please enter a valid password")});function x(O){console.log("handleUpdateOTP",O,"Type of = ",typeof O),O.toString().length===6?y(!0):y(!1),s(O)}async function N(O,{resetForm:D}){if(console.log("Forgot Pwd otp",O),!m){console.log("isValidOTP = ",m),Qt("Please enter correct otp.","error");return}d(!0),console.log(i),console.log("data from Login form = ",n.data);let P={email:n.data.email,application:n.data.application,domain:n.data.domain,otp:i,password:O.password};console.log("newValues from Forgot Password Modal form = ",P),Ai.forgotPassword(P).then(j=>{console.log("forgotPassword Response: ",j),j.data.status==="success"&&(console.log("Success response =",j.data),Qt("Your password has been updated successfully!","success"),d(!1),setTimeout(()=>{n.handleClose()},1500),D()),j.data.status==="failed"&&(console.log("Failed ERROR response : ",j.data),Qt(j.data.message,"error"),d(!1),x(0),D())}).catch(j=>{var M,V,G;d(!1),((M=j.response)==null?void 0:M.data.status)==="failed"&&Qt((V=j.response)==null?void 0:V.data.message,"error"),console.log("forgotPassword Error = ",j),console.log("forgotPassword Error response = ",(G=j.response)==null?void 0:G.data)})}return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom forgot-pwd-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:"Forgot Password"})}),h.jsxs(wn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:[h.jsx("div",{className:"mb-3 text-cente",children:h.jsx("div",{className:"p-2 d-flex align-items-center bg-warning-lighter font-13 rounded-2",children:n.loadingCode?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ",h.jsx("span",{className:"ms-2",children:"Sending OTP..."})]}):h.jsxs(h.Fragment,{children:[h.jsx(tn,{tag:"warning3",className:"me-2 font-22 text-theme-warning"})," ","We have sent OTP on your email."]})})}),h.jsx("div",{className:"form-container",children:h.jsx(od,{initialValues:E,validationSchema:C,onSubmit:N,children:O=>h.jsxs(kt,{onSubmit:O.handleSubmit,children:[h.jsx(kt.Group,{className:"form-group",children:h.jsx(kt.Control,{type:"text",placeholder:"Enter OTP",name:"otp",value:i,required:!0,autoComplete:"off",readOnly:!0,style:{width:"0.1px",height:"0.1px",overflow:"hidden",position:"absolute",zIndex:"-1",opacity:0,visibility:"hidden"}})}),h.jsx(kt.Group,{className:"form-group mb-3",children:h.jsx(V_e,{totalDigits:6,handleUpdateOTP:x,otp:i})}),h.jsx("div",{className:"pb-2 text-gray9",children:h.jsx("hr",{style:{borderStyle:"dashed"}})}),h.jsxs(kt.Group,{className:"form-group mb-3 position-relative",children:[h.jsx(kt.Label,{className:"pe-none",children:"Enter New Password"}),h.jsx(kt.Control,{type:u,placeholder:"New Password",name:"password",value:O.values.password,onBlur:O.handleBlur,onChange:O.handleChange,required:!0,autoComplete:"off"}),h.jsx("span",{className:"p-2 d-flex position-absolute font-22 text-gray6",style:{right:0,top:35},onClick:_,children:h.jsx(tn,{tag:u==="password"?"view1":"hide1"})}),O.touched.password&&O.errors.password?h.jsx("p",{className:"form-error",children:O.errors.password}):null]}),h.jsx("div",{className:"btn-wrap pt-3 d-flex justify-content-center position-fixed bg-white border-top pt-3 pb-4 px-3",style:{bottom:0,right:0,left:0},children:h.jsx(Lt,{type:"submit",size:"lg",disabled:!O.isValid&&!m,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:l?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):!O.isValid&&!m?"Please fill out all info":"Update Password"})})]})})})]})]})})}function i$e({data:n}){const t=ji(),[i,s]=k.useState(!1),[l,d]=k.useState(!1),[u,p]=k.useState(!1),[m,y]=k.useState(!1),[_,E]=k.useState(!1),[C,x]=k.useState("password"),[N,O]=k.useState(!1);k.useEffect(()=>{window.scrollTo(0,0)},[]);const D=()=>{x(C==="password"?"text":"password")},P=()=>{y(!1)},j=()=>{y(!0)},M=()=>{O(!1)},V=()=>{O(!0),G()};async function G(){d(!0);let re={email:n.email,application:n.application,domain:n.domain};console.log("forgotPasswordOTP newValues = ",re),Ai.forgotPasswordOTP(re).then(ee=>{console.log("forgotPasswordOTP Response: ",ee),ee.data.status==="success"&&(console.log("Success response =",ee.data),Qt("OTP sent successfully!","success"),d(!1)),ee.data.status==="failed"&&(console.log("Failed ERROR response : ",ee.data),Qt(ee.data.message,"error"),d(!1))}).catch(ee=>{d(!1),ee.response.data.status==="failed"&&Qt(ee.response.data.message,"error"),console.log("forgotPasswordOTP Error = ",ee),console.log("forgotPasswordOTP Error response = ",ee.response.data)})}async function $(re,{resetForm:ee}){if(!_){console.log("Terms = ",_),Qt("Please accept Terms & Conditions.","error");return}s(!0),console.log("data from Login form = ",n),console.log("deviceID = ",localStorage.getItem("deviceID"));let de={email:n.email,password:re.password,device:localStorage.getItem("deviceID"),application:n.application,domain:n.domain};console.log("newValues from Verify Password form = ",de),Ai.verifyAuth(de).then(H=>{var ae,_e;console.log("verifyAuth Response: ",H),H.data.status==="success"&&(console.log("Success response =",H.data),Qt(H.data.message,"success"),s(!1),Ai.setToken(H.data.data),Ai.registerDeviceForPushNotification(),((_e=(ae=H.data)==null?void 0:ae.data)==null?void 0:_e.force_change_password.toLowerCase())==="yes"?t("/profile/change-password",{state:{pageTitle:"Change Password"}}):t("/dashboard")),H.data.status==="failed"&&(console.log("Failed ERROR response : ",H.data),Qt(H.data.message,"error"),s(!1))}).catch(H=>{var ae,_e,me;s(!1),((ae=H.response)==null?void 0:ae.data.status)==="failed"&&Qt((_e=H.response)==null?void 0:_e.data.message,"error"),console.log("Verify Password Error = ",H),console.log("Verify Password Error response = ",(me=H.response)==null?void 0:me.data)})}function ne(re){console.log("Inside handleCheckboxChange...",_),_&&E(!1),_||(E(!0),p(!0),j())}const Y={password:""},le=gc().shape({password:Ef().min(6,"Password is too short").required("Please enter a valid password")});return h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsxs(et.Body,{children:[h.jsx("div",{className:"mb-5 text-center",children:h.jsx("div",{className:"secondary-text mb-4 text-center",children:h.jsx("h2",{children:"Enter Password"})})}),h.jsxs("div",{className:"form-container",children:[h.jsx(od,{initialValues:Y,validationSchema:le,onSubmit:$,children:re=>h.jsxs(kt,{onSubmit:re.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group mb-3 position-relative",children:[h.jsx(kt.Label,{className:"pe-none",children:"Password"}),h.jsx(kt.Control,{type:C,placeholder:"Password",name:"password",value:re.values.password,onBlur:re.handleBlur,onChange:re.handleChange,required:!0,autoComplete:"off"}),h.jsx("span",{className:"p-2 d-flex position-absolute font-22 text-gray6",style:{right:0,top:35},onClick:D,children:h.jsx(tn,{tag:C==="password"?"view1":"hide1"})}),re.touched.password&&re.errors.password?h.jsx("p",{className:"form-error",children:re.errors.password}):null]}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-2 pb-3 px-2",children:h.jsx(Lt,{type:"button",variant:"link",className:"btn-theme font-14 fw-sb text-decoration-none",onClick:V,children:h.jsx(h.Fragment,{children:"Forgot Password?"})})}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-3 pb-3",children:h.jsx(kt.Group,{className:"form-group mb-2 fw-sb",children:h.jsx(kt.Check,{onChange:ne,value:"test",type:"checkbox",id:"terms",label:"Terms & Conditions"})})}),h.jsx("div",{className:"btn-wrapper",children:h.jsx(Lt,{type:"submit",size:"lg",disabled:!re.isValid&&!u,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:i?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):u?"Verify Password":"Please fill out all info"})})]})}),h.jsx(Zye,{show:m,handleClose:P,terms:n==null?void 0:n.terms}),h.jsx(n$e,{show:N,handleClose:M,data:n,loadingCode:l})]})]})})}function r$e(){ji();const[n,t]=k.useState(!1),[i,s]=k.useState(!1),[l,d]=k.useState(null),u={domain:"gennovadc",email:""},p=gc().shape({domain:Ef().required("Please enter a valid URL"),email:Ef().required("Please enter a valid email")});async function m(y,{resetForm:_}){t(!0);let E={...y,application:"rapport",domain:y.domain.trim()};Ai.login(E).then(C=>{var x,N,O,D,P;if(C.data.status==="success"){Qt(C.data.message,"success"),t(!1);const j={...E,...(x=C.data)==null?void 0:x.data};let M=(O=(N=C.data)==null?void 0:N.data)==null?void 0:O.login_scheme.toLowerCase();d(j),Ai.setLoginSchemeToLocal(M),s(!0)}((D=C==null?void 0:C.data)==null?void 0:D.status)==="failed"&&(console.log("Failed ERROR response : ",C.data),Qt((P=C==null?void 0:C.data)==null?void 0:P.message,"error"),t(!1),d(null),s(!1))}).catch(C=>{var x,N,O,D;t(!1),d(null),s(!1),((N=(x=C.response)==null?void 0:x.data)==null?void 0:N.status)==="failed"&&Qt((D=(O=C.response)==null?void 0:O.data)==null?void 0:D.message,"error"),console.log("Login Error = ",C)})}return h.jsxs(h.Fragment,{children:[!i&&h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsxs(et.Body,{children:[h.jsx("div",{className:"welcome-text mb-4 text-center",children:h.jsx("h1",{children:"Welcome Back!"})}),h.jsx("div",{className:"secondary-text mb-5 text-center",children:h.jsxs("h2",{children:["Sign In To Your ",h.jsx("br",{}),"Account"]})}),h.jsx("div",{className:"form-container",children:h.jsx(od,{initialValues:u,validationSchema:p,onSubmit:m,children:y=>h.jsxs(kt,{onSubmit:y.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group mb-4 visibility-hidden opacity-0",children:[h.jsx(kt.Label,{className:"pe-none",children:"Your team URL"}),h.jsx(kt.Control,{type:"hidden",placeholder:"Your team URL",name:"domain",value:y.values.domain,onBlur:y.handleBlur,onChange:y.handleChange,required:!0,autoComplete:"off"}),y.touched.domain&&y.errors.domain?h.jsx("p",{className:"form-error",children:y.errors.domain}):null]}),h.jsxs(kt.Group,{className:"form-group mb-4",children:[h.jsx(kt.Label,{children:"Your company email id"}),h.jsx(kt.Control,{type:"email",placeholder:"Your Company Email Id",name:"email",value:y.values.email,onBlur:y.handleBlur,onChange:y.handleChange,required:!0,autoComplete:"off"}),y.touched.email&&y.errors.email?h.jsx("p",{className:"form-error",children:y.errors.email}):null]}),h.jsx("div",{className:"btn-wrapper",children:h.jsx(Lt,{type:"submit",size:"lg",disabled:!y.isValid,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:n?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):y.isValid?"Sign in":"Please fill out all info"})})]})})})]})}),i&&(l==null?void 0:l.login_scheme)==="Password"&&h.jsx(i$e,{data:l}),i&&(l==null?void 0:l.login_scheme)==="OTP"&&h.jsx(t$e,{data:l})]})}function s$e(){return h.jsx("section",{className:"home-page-content-wrapper container-fluid d-flex",children:h.jsx(r$e,{})})}var z_e={},wZ={};function cfe(n){return n!==null&&typeof n=="object"&&"constructor"in n&&n.constructor===Object}function SZ(n,t){n===void 0&&(n={}),t===void 0&&(t={}),Object.keys(t).forEach(i=>{typeof n[i]>"u"?n[i]=t[i]:cfe(t[i])&&cfe(n[i])&&Object.keys(t[i]).length>0&&SZ(n[i],t[i])})}const H_e={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function fc(){const n=typeof document<"u"?document:{};return SZ(n,H_e),n}const a$e={document:H_e,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(n){return typeof setTimeout>"u"?(n(),null):setTimeout(n,0)},cancelAnimationFrame(n){typeof setTimeout>"u"||clearTimeout(n)}};function sa(){const n=typeof window<"u"?window:{};return SZ(n,a$e),n}function p1(n){return n===void 0&&(n=""),n.trim().split(" ").filter(t=>!!t.trim())}function o$e(n){const t=n;Object.keys(t).forEach(i=>{try{t[i]=null}catch{}try{delete t[i]}catch{}})}function K2(n,t){return t===void 0&&(t=0),setTimeout(n,t)}function lh(){return Date.now()}function l$e(n){const t=sa();let i;return t.getComputedStyle&&(i=t.getComputedStyle(n,null)),!i&&n.currentStyle&&(i=n.currentStyle),i||(i=n.style),i}function CY(n,t){t===void 0&&(t="x");const i=sa();let s,l,d;const u=l$e(n);return i.WebKitCSSMatrix?(l=u.transform||u.webkitTransform,l.split(",").length>6&&(l=l.split(", ").map(p=>p.replace(",",".")).join(", ")),d=new i.WebKitCSSMatrix(l==="none"?"":l)):(d=u.MozTransform||u.OTransform||u.MsTransform||u.msTransform||u.transform||u.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),s=d.toString().split(",")),t==="x"&&(i.WebKitCSSMatrix?l=d.m41:s.length===16?l=parseFloat(s[12]):l=parseFloat(s[4])),t==="y"&&(i.WebKitCSSMatrix?l=d.m42:s.length===16?l=parseFloat(s[13]):l=parseFloat(s[5])),l||0}function n4(n){return typeof n=="object"&&n!==null&&n.constructor&&Object.prototype.toString.call(n).slice(8,-1)==="Object"}function c$e(n){return typeof window<"u"&&typeof window.HTMLElement<"u"?n instanceof HTMLElement:n&&(n.nodeType===1||n.nodeType===11)}function Kd(){const n=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let i=1;i<arguments.length;i+=1){const s=i<0||arguments.length<=i?void 0:arguments[i];if(s!=null&&!c$e(s)){const l=Object.keys(Object(s)).filter(d=>t.indexOf(d)<0);for(let d=0,u=l.length;d<u;d+=1){const p=l[d],m=Object.getOwnPropertyDescriptor(s,p);m!==void 0&&m.enumerable&&(n4(n[p])&&n4(s[p])?s[p].__swiper__?n[p]=s[p]:Kd(n[p],s[p]):!n4(n[p])&&n4(s[p])?(n[p]={},s[p].__swiper__?n[p]=s[p]:Kd(n[p],s[p])):n[p]=s[p])}}}return n}function i4(n,t,i){n.style.setProperty(t,i)}function G_e(n){let{swiper:t,targetPosition:i,side:s}=n;const l=sa(),d=-t.translate;let u=null,p;const m=t.params.speed;t.wrapperEl.style.scrollSnapType="none",l.cancelAnimationFrame(t.cssModeFrameID);const y=i>d?"next":"prev",_=(C,x)=>y==="next"&&C>=x||y==="prev"&&C<=x,E=()=>{p=new Date().getTime(),u===null&&(u=p);const C=Math.max(Math.min((p-u)/m,1),0),x=.5-Math.cos(C*Math.PI)/2;let N=d+x*(i-d);if(_(N,i)&&(N=i),t.wrapperEl.scrollTo({[s]:N}),_(N,i)){t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout(()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[s]:N})}),l.cancelAnimationFrame(t.cssModeFrameID);return}t.cssModeFrameID=l.requestAnimationFrame(E)};E()}function pw(n){return n.querySelector(".swiper-slide-transform")||n.shadowRoot&&n.shadowRoot.querySelector(".swiper-slide-transform")||n}function Jo(n,t){return t===void 0&&(t=""),[...n.children].filter(i=>i.matches(t))}function X7(n){try{console.warn(n);return}catch{}}function Zd(n,t){t===void 0&&(t=[]);const i=document.createElement(n);return i.classList.add(...Array.isArray(t)?t:p1(t)),i}function J7(n){const t=sa(),i=fc(),s=n.getBoundingClientRect(),l=i.body,d=n.clientTop||l.clientTop||0,u=n.clientLeft||l.clientLeft||0,p=n===t?t.scrollY:n.scrollTop,m=n===t?t.scrollX:n.scrollLeft;return{top:s.top+p-d,left:s.left+m-u}}function d$e(n,t){const i=[];for(;n.previousElementSibling;){const s=n.previousElementSibling;t?s.matches(t)&&i.push(s):i.push(s),n=s}return i}function u$e(n,t){const i=[];for(;n.nextElementSibling;){const s=n.nextElementSibling;t?s.matches(t)&&i.push(s):i.push(s),n=s}return i}function Dv(n,t){return sa().getComputedStyle(n,null).getPropertyValue(t)}function _N(n){let t=n,i;if(t){for(i=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(i+=1);return i}}function j2(n,t){const i=[];let s=n.parentElement;for(;s;)t?s.matches(t)&&i.push(s):i.push(s),s=s.parentElement;return i}function B4(n,t){function i(s){s.target===n&&(t.call(n,s),n.removeEventListener("transitionend",i))}t&&n.addEventListener("transitionend",i)}function TY(n,t,i){const s=sa();return i?n[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(s.getComputedStyle(n,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(s.getComputedStyle(n,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom")):n.offsetWidth}function or(n){return(Array.isArray(n)?n:[n]).filter(t=>!!t)}let EK;function h$e(){const n=sa(),t=fc();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in n||n.DocumentTouch&&t instanceof n.DocumentTouch)}}function W_e(){return EK||(EK=h$e()),EK}let wK;function f$e(n){let{userAgent:t}=n===void 0?{}:n;const i=W_e(),s=sa(),l=s.navigator.platform,d=t||s.navigator.userAgent,u={ios:!1,android:!1},p=s.screen.width,m=s.screen.height,y=d.match(/(Android);?[\s\/]+([\d.]+)?/);let _=d.match(/(iPad).*OS\s([\d_]+)/);const E=d.match(/(iPod)(.*OS\s([\d_]+))?/),C=!_&&d.match(/(iPhone\sOS|iOS)\s([\d_]+)/),x=l==="Win32";let N=l==="MacIntel";const O=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!_&&N&&i.touch&&O.indexOf(`${p}x${m}`)>=0&&(_=d.match(/(Version)\/([\d.]+)/),_||(_=[0,1,"13_0_0"]),N=!1),y&&!x&&(u.os="android",u.android=!0),(_||C||E)&&(u.os="ios",u.ios=!0),u}function $_e(n){return n===void 0&&(n={}),wK||(wK=f$e(n)),wK}let SK;function p$e(){const n=sa(),t=$_e();let i=!1;function s(){const p=n.navigator.userAgent.toLowerCase();return p.indexOf("safari")>=0&&p.indexOf("chrome")<0&&p.indexOf("android")<0}if(s()){const p=String(n.navigator.userAgent);if(p.includes("Version/")){const[m,y]=p.split("Version/")[1].split(" ")[0].split(".").map(_=>Number(_));i=m<16||m===16&&y<2}}const l=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(n.navigator.userAgent),d=s(),u=d||l&&t.ios;return{isSafari:i||d,needPerspectiveFix:i,need3dFix:u,isWebView:l}}function m$e(){return SK||(SK=p$e()),SK}function g$e(n){let{swiper:t,on:i,emit:s}=n;const l=sa();let d=null,u=null;const p=()=>{!t||t.destroyed||!t.initialized||(s("beforeResize"),s("resize"))},m=()=>{!t||t.destroyed||!t.initialized||(d=new ResizeObserver(E=>{u=l.requestAnimationFrame(()=>{const{width:C,height:x}=t;let N=C,O=x;E.forEach(D=>{let{contentBoxSize:P,contentRect:j,target:M}=D;M&&M!==t.el||(N=j?j.width:(P[0]||P).inlineSize,O=j?j.height:(P[0]||P).blockSize)}),(N!==C||O!==x)&&p()})}),d.observe(t.el))},y=()=>{u&&l.cancelAnimationFrame(u),d&&d.unobserve&&t.el&&(d.unobserve(t.el),d=null)},_=()=>{!t||t.destroyed||!t.initialized||s("orientationchange")};i("init",()=>{if(t.params.resizeObserver&&typeof l.ResizeObserver<"u"){m();return}l.addEventListener("resize",p),l.addEventListener("orientationchange",_)}),i("destroy",()=>{y(),l.removeEventListener("resize",p),l.removeEventListener("orientationchange",_)})}function v$e(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=[],u=sa(),p=function(_,E){E===void 0&&(E={});const C=u.MutationObserver||u.WebkitMutationObserver,x=new C(N=>{if(t.__preventObserver__)return;if(N.length===1){l("observerUpdate",N[0]);return}const O=function(){l("observerUpdate",N[0])};u.requestAnimationFrame?u.requestAnimationFrame(O):u.setTimeout(O,0)});x.observe(_,{attributes:typeof E.attributes>"u"?!0:E.attributes,childList:typeof E.childList>"u"?!0:E.childList,characterData:typeof E.characterData>"u"?!0:E.characterData}),d.push(x)},m=()=>{if(t.params.observer){if(t.params.observeParents){const _=j2(t.hostEl);for(let E=0;E<_.length;E+=1)p(_[E])}p(t.hostEl,{childList:t.params.observeSlideChildren}),p(t.wrapperEl,{attributes:!1})}},y=()=>{d.forEach(_=>{_.disconnect()}),d.splice(0,d.length)};i({observer:!1,observeParents:!1,observeSlideChildren:!1}),s("init",m),s("destroy",y)}var y$e={on(n,t,i){const s=this;if(!s.eventsListeners||s.destroyed||typeof t!="function")return s;const l=i?"unshift":"push";return n.split(" ").forEach(d=>{s.eventsListeners[d]||(s.eventsListeners[d]=[]),s.eventsListeners[d][l](t)}),s},once(n,t,i){const s=this;if(!s.eventsListeners||s.destroyed||typeof t!="function")return s;function l(){s.off(n,l),l.__emitterProxy&&delete l.__emitterProxy;for(var d=arguments.length,u=new Array(d),p=0;p<d;p++)u[p]=arguments[p];t.apply(s,u)}return l.__emitterProxy=t,s.on(n,l,i)},onAny(n,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof n!="function")return i;const s=t?"unshift":"push";return i.eventsAnyListeners.indexOf(n)<0&&i.eventsAnyListeners[s](n),i},offAny(n){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const i=t.eventsAnyListeners.indexOf(n);return i>=0&&t.eventsAnyListeners.splice(i,1),t},off(n,t){const i=this;return!i.eventsListeners||i.destroyed||!i.eventsListeners||n.split(" ").forEach(s=>{typeof t>"u"?i.eventsListeners[s]=[]:i.eventsListeners[s]&&i.eventsListeners[s].forEach((l,d)=>{(l===t||l.__emitterProxy&&l.__emitterProxy===t)&&i.eventsListeners[s].splice(d,1)})}),i},emit(){const n=this;if(!n.eventsListeners||n.destroyed||!n.eventsListeners)return n;let t,i,s;for(var l=arguments.length,d=new Array(l),u=0;u<l;u++)d[u]=arguments[u];return typeof d[0]=="string"||Array.isArray(d[0])?(t=d[0],i=d.slice(1,d.length),s=n):(t=d[0].events,i=d[0].data,s=d[0].context||n),i.unshift(s),(Array.isArray(t)?t:t.split(" ")).forEach(m=>{n.eventsAnyListeners&&n.eventsAnyListeners.length&&n.eventsAnyListeners.forEach(y=>{y.apply(s,[m,...i])}),n.eventsListeners&&n.eventsListeners[m]&&n.eventsListeners[m].forEach(y=>{y.apply(s,i)})}),n}};function _$e(){const n=this;let t,i;const s=n.el;typeof n.params.width<"u"&&n.params.width!==null?t=n.params.width:t=s.clientWidth,typeof n.params.height<"u"&&n.params.height!==null?i=n.params.height:i=s.clientHeight,!(t===0&&n.isHorizontal()||i===0&&n.isVertical())&&(t=t-parseInt(Dv(s,"padding-left")||0,10)-parseInt(Dv(s,"padding-right")||0,10),i=i-parseInt(Dv(s,"padding-top")||0,10)-parseInt(Dv(s,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(i)&&(i=0),Object.assign(n,{width:t,height:i,size:n.isHorizontal()?t:i}))}function E$e(){const n=this;function t(re,ee){return parseFloat(re.getPropertyValue(n.getDirectionLabel(ee))||0)}const i=n.params,{wrapperEl:s,slidesEl:l,size:d,rtlTranslate:u,wrongRTL:p}=n,m=n.virtual&&i.virtual.enabled,y=m?n.virtual.slides.length:n.slides.length,_=Jo(l,`.${n.params.slideClass}, swiper-slide`),E=m?n.virtual.slides.length:_.length;let C=[];const x=[],N=[];let O=i.slidesOffsetBefore;typeof O=="function"&&(O=i.slidesOffsetBefore.call(n));let D=i.slidesOffsetAfter;typeof D=="function"&&(D=i.slidesOffsetAfter.call(n));const P=n.snapGrid.length,j=n.slidesGrid.length;let M=i.spaceBetween,V=-O,G=0,$=0;if(typeof d>"u")return;typeof M=="string"&&M.indexOf("%")>=0?M=parseFloat(M.replace("%",""))/100*d:typeof M=="string"&&(M=parseFloat(M)),n.virtualSize=-M,_.forEach(re=>{u?re.style.marginLeft="":re.style.marginRight="",re.style.marginBottom="",re.style.marginTop=""}),i.centeredSlides&&i.cssMode&&(i4(s,"--swiper-centered-offset-before",""),i4(s,"--swiper-centered-offset-after",""));const ne=i.grid&&i.grid.rows>1&&n.grid;ne?n.grid.initSlides(_):n.grid&&n.grid.unsetSlides();let Y;const le=i.slidesPerView==="auto"&&i.breakpoints&&Object.keys(i.breakpoints).filter(re=>typeof i.breakpoints[re].slidesPerView<"u").length>0;for(let re=0;re<E;re+=1){Y=0;let ee;if(_[re]&&(ee=_[re]),ne&&n.grid.updateSlide(re,ee,_),!(_[re]&&Dv(ee,"display")==="none")){if(i.slidesPerView==="auto"){le&&(_[re].style[n.getDirectionLabel("width")]="");const de=getComputedStyle(ee),H=ee.style.transform,ae=ee.style.webkitTransform;if(H&&(ee.style.transform="none"),ae&&(ee.style.webkitTransform="none"),i.roundLengths)Y=n.isHorizontal()?TY(ee,"width",!0):TY(ee,"height",!0);else{const _e=t(de,"width"),me=t(de,"padding-left"),Ce=t(de,"padding-right"),he=t(de,"margin-left"),pe=t(de,"margin-right"),Oe=de.getPropertyValue("box-sizing");if(Oe&&Oe==="border-box")Y=_e+he+pe;else{const{clientWidth:Fe,offsetWidth:Ue}=ee;Y=_e+me+Ce+he+pe+(Ue-Fe)}}H&&(ee.style.transform=H),ae&&(ee.style.webkitTransform=ae),i.roundLengths&&(Y=Math.floor(Y))}else Y=(d-(i.slidesPerView-1)*M)/i.slidesPerView,i.roundLengths&&(Y=Math.floor(Y)),_[re]&&(_[re].style[n.getDirectionLabel("width")]=`${Y}px`);_[re]&&(_[re].swiperSlideSize=Y),N.push(Y),i.centeredSlides?(V=V+Y/2+G/2+M,G===0&&re!==0&&(V=V-d/2-M),re===0&&(V=V-d/2-M),Math.abs(V)<1/1e3&&(V=0),i.roundLengths&&(V=Math.floor(V)),$%i.slidesPerGroup===0&&C.push(V),x.push(V)):(i.roundLengths&&(V=Math.floor(V)),($-Math.min(n.params.slidesPerGroupSkip,$))%n.params.slidesPerGroup===0&&C.push(V),x.push(V),V=V+Y+M),n.virtualSize+=Y+M,G=Y,$+=1}}if(n.virtualSize=Math.max(n.virtualSize,d)+D,u&&p&&(i.effect==="slide"||i.effect==="coverflow")&&(s.style.width=`${n.virtualSize+M}px`),i.setWrapperSize&&(s.style[n.getDirectionLabel("width")]=`${n.virtualSize+M}px`),ne&&n.grid.updateWrapperSize(Y,C),!i.centeredSlides){const re=[];for(let ee=0;ee<C.length;ee+=1){let de=C[ee];i.roundLengths&&(de=Math.floor(de)),C[ee]<=n.virtualSize-d&&re.push(de)}C=re,Math.floor(n.virtualSize-d)-Math.floor(C[C.length-1])>1&&C.push(n.virtualSize-d)}if(m&&i.loop){const re=N[0]+M;if(i.slidesPerGroup>1){const ee=Math.ceil((n.virtual.slidesBefore+n.virtual.slidesAfter)/i.slidesPerGroup),de=re*i.slidesPerGroup;for(let H=0;H<ee;H+=1)C.push(C[C.length-1]+de)}for(let ee=0;ee<n.virtual.slidesBefore+n.virtual.slidesAfter;ee+=1)i.slidesPerGroup===1&&C.push(C[C.length-1]+re),x.push(x[x.length-1]+re),n.virtualSize+=re}if(C.length===0&&(C=[0]),M!==0){const re=n.isHorizontal()&&u?"marginLeft":n.getDirectionLabel("marginRight");_.filter((ee,de)=>!i.cssMode||i.loop?!0:de!==_.length-1).forEach(ee=>{ee.style[re]=`${M}px`})}if(i.centeredSlides&&i.centeredSlidesBounds){let re=0;N.forEach(de=>{re+=de+(M||0)}),re-=M;const ee=re-d;C=C.map(de=>de<=0?-O:de>ee?ee+D:de)}if(i.centerInsufficientSlides){let re=0;if(N.forEach(ee=>{re+=ee+(M||0)}),re-=M,re<d){const ee=(d-re)/2;C.forEach((de,H)=>{C[H]=de-ee}),x.forEach((de,H)=>{x[H]=de+ee})}}if(Object.assign(n,{slides:_,snapGrid:C,slidesGrid:x,slidesSizesGrid:N}),i.centeredSlides&&i.cssMode&&!i.centeredSlidesBounds){i4(s,"--swiper-centered-offset-before",`${-C[0]}px`),i4(s,"--swiper-centered-offset-after",`${n.size/2-N[N.length-1]/2}px`);const re=-n.snapGrid[0],ee=-n.slidesGrid[0];n.snapGrid=n.snapGrid.map(de=>de+re),n.slidesGrid=n.slidesGrid.map(de=>de+ee)}if(E!==y&&n.emit("slidesLengthChange"),C.length!==P&&(n.params.watchOverflow&&n.checkOverflow(),n.emit("snapGridLengthChange")),x.length!==j&&n.emit("slidesGridLengthChange"),i.watchSlidesProgress&&n.updateSlidesOffset(),n.emit("slidesUpdated"),!m&&!i.cssMode&&(i.effect==="slide"||i.effect==="fade")){const re=`${i.containerModifierClass}backface-hidden`,ee=n.el.classList.contains(re);E<=i.maxBackfaceHiddenSlides?ee||n.el.classList.add(re):ee&&n.el.classList.remove(re)}}function w$e(n){const t=this,i=[],s=t.virtual&&t.params.virtual.enabled;let l=0,d;typeof n=="number"?t.setTransition(n):n===!0&&t.setTransition(t.params.speed);const u=p=>s?t.slides[t.getSlideIndexByData(p)]:t.slides[p];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(p=>{i.push(p)});else for(d=0;d<Math.ceil(t.params.slidesPerView);d+=1){const p=t.activeIndex+d;if(p>t.slides.length&&!s)break;i.push(u(p))}else i.push(u(t.activeIndex));for(d=0;d<i.length;d+=1)if(typeof i[d]<"u"){const p=i[d].offsetHeight;l=p>l?p:l}(l||l===0)&&(t.wrapperEl.style.height=`${l}px`)}function S$e(){const n=this,t=n.slides,i=n.isElement?n.isHorizontal()?n.wrapperEl.offsetLeft:n.wrapperEl.offsetTop:0;for(let s=0;s<t.length;s+=1)t[s].swiperSlideOffset=(n.isHorizontal()?t[s].offsetLeft:t[s].offsetTop)-i-n.cssOverflowAdjustment()}function b$e(n){n===void 0&&(n=this&&this.translate||0);const t=this,i=t.params,{slides:s,rtlTranslate:l,snapGrid:d}=t;if(s.length===0)return;typeof s[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let u=-n;l&&(u=n),s.forEach(m=>{m.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass)}),t.visibleSlidesIndexes=[],t.visibleSlides=[];let p=i.spaceBetween;typeof p=="string"&&p.indexOf("%")>=0?p=parseFloat(p.replace("%",""))/100*t.size:typeof p=="string"&&(p=parseFloat(p));for(let m=0;m<s.length;m+=1){const y=s[m];let _=y.swiperSlideOffset;i.cssMode&&i.centeredSlides&&(_-=s[0].swiperSlideOffset);const E=(u+(i.centeredSlides?t.minTranslate():0)-_)/(y.swiperSlideSize+p),C=(u-d[0]+(i.centeredSlides?t.minTranslate():0)-_)/(y.swiperSlideSize+p),x=-(u-_),N=x+t.slidesSizesGrid[m],O=x>=0&&x<=t.size-t.slidesSizesGrid[m];(x>=0&&x<t.size-1||N>1&&N<=t.size||x<=0&&N>=t.size)&&(t.visibleSlides.push(y),t.visibleSlidesIndexes.push(m),s[m].classList.add(i.slideVisibleClass)),O&&s[m].classList.add(i.slideFullyVisibleClass),y.progress=l?-E:E,y.originalProgress=l?-C:C}}function C$e(n){const t=this;if(typeof n>"u"){const _=t.rtlTranslate?-1:1;n=t&&t.translate&&t.translate*_||0}const i=t.params,s=t.maxTranslate()-t.minTranslate();let{progress:l,isBeginning:d,isEnd:u,progressLoop:p}=t;const m=d,y=u;if(s===0)l=0,d=!0,u=!0;else{l=(n-t.minTranslate())/s;const _=Math.abs(n-t.minTranslate())<1,E=Math.abs(n-t.maxTranslate())<1;d=_||l<=0,u=E||l>=1,_&&(l=0),E&&(l=1)}if(i.loop){const _=t.getSlideIndexByData(0),E=t.getSlideIndexByData(t.slides.length-1),C=t.slidesGrid[_],x=t.slidesGrid[E],N=t.slidesGrid[t.slidesGrid.length-1],O=Math.abs(n);O>=C?p=(O-C)/N:p=(O+N-x)/N,p>1&&(p-=1)}Object.assign(t,{progress:l,progressLoop:p,isBeginning:d,isEnd:u}),(i.watchSlidesProgress||i.centeredSlides&&i.autoHeight)&&t.updateSlidesProgress(n),d&&!m&&t.emit("reachBeginning toEdge"),u&&!y&&t.emit("reachEnd toEdge"),(m&&!d||y&&!u)&&t.emit("fromEdge"),t.emit("progress",l)}function T$e(){const n=this,{slides:t,params:i,slidesEl:s,activeIndex:l}=n,d=n.virtual&&i.virtual.enabled,u=n.grid&&i.grid&&i.grid.rows>1,p=E=>Jo(s,`.${i.slideClass}${E}, swiper-slide${E}`)[0];t.forEach(E=>{E.classList.remove(i.slideActiveClass,i.slideNextClass,i.slidePrevClass)});let m,y,_;if(d)if(i.loop){let E=l-n.virtual.slidesBefore;E<0&&(E=n.virtual.slides.length+E),E>=n.virtual.slides.length&&(E-=n.virtual.slides.length),m=p(`[data-swiper-slide-index="${E}"]`)}else m=p(`[data-swiper-slide-index="${l}"]`);else u?(m=t.filter(E=>E.column===l)[0],_=t.filter(E=>E.column===l+1)[0],y=t.filter(E=>E.column===l-1)[0]):m=t[l];m&&(m.classList.add(i.slideActiveClass),u?(_&&_.classList.add(i.slideNextClass),y&&y.classList.add(i.slidePrevClass)):(_=u$e(m,`.${i.slideClass}, swiper-slide`)[0],i.loop&&!_&&(_=t[0]),_&&_.classList.add(i.slideNextClass),y=d$e(m,`.${i.slideClass}, swiper-slide`)[0],i.loop&&!y===0&&(y=t[t.length-1]),y&&y.classList.add(i.slidePrevClass))),n.emitSlidesClasses()}const IM=(n,t)=>{if(!n||n.destroyed||!n.params)return;const i=()=>n.isElement?"swiper-slide":`.${n.params.slideClass}`,s=t.closest(i());if(s){let l=s.querySelector(`.${n.params.lazyPreloaderClass}`);!l&&n.isElement&&(s.shadowRoot?l=s.shadowRoot.querySelector(`.${n.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{s.shadowRoot&&(l=s.shadowRoot.querySelector(`.${n.params.lazyPreloaderClass}`),l&&l.remove())})),l&&l.remove()}},bK=(n,t)=>{if(!n.slides[t])return;const i=n.slides[t].querySelector('[loading="lazy"]');i&&i.removeAttribute("loading")},RY=n=>{if(!n||n.destroyed||!n.params)return;let t=n.params.lazyPreloadPrevNext;const i=n.slides.length;if(!i||!t||t<0)return;t=Math.min(t,i);const s=n.params.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(n.params.slidesPerView),l=n.activeIndex;if(n.params.grid&&n.params.grid.rows>1){const u=l,p=[u-t];p.push(...Array.from({length:t}).map((m,y)=>u+s+y)),n.slides.forEach((m,y)=>{p.includes(m.column)&&bK(n,y)});return}const d=l+s-1;if(n.params.rewind||n.params.loop)for(let u=l-t;u<=d+t;u+=1){const p=(u%i+i)%i;(p<l||p>d)&&bK(n,p)}else for(let u=Math.max(l-t,0);u<=Math.min(d+t,i-1);u+=1)u!==l&&(u>d||u<l)&&bK(n,u)};function R$e(n){const{slidesGrid:t,params:i}=n,s=n.rtlTranslate?n.translate:-n.translate;let l;for(let d=0;d<t.length;d+=1)typeof t[d+1]<"u"?s>=t[d]&&s<t[d+1]-(t[d+1]-t[d])/2?l=d:s>=t[d]&&s<t[d+1]&&(l=d+1):s>=t[d]&&(l=d);return i.normalizeSlideIndex&&(l<0||typeof l>"u")&&(l=0),l}function x$e(n){const t=this,i=t.rtlTranslate?t.translate:-t.translate,{snapGrid:s,params:l,activeIndex:d,realIndex:u,snapIndex:p}=t;let m=n,y;const _=x=>{let N=x-t.virtual.slidesBefore;return N<0&&(N=t.virtual.slides.length+N),N>=t.virtual.slides.length&&(N-=t.virtual.slides.length),N};if(typeof m>"u"&&(m=R$e(t)),s.indexOf(i)>=0)y=s.indexOf(i);else{const x=Math.min(l.slidesPerGroupSkip,m);y=x+Math.floor((m-x)/l.slidesPerGroup)}if(y>=s.length&&(y=s.length-1),m===d&&!t.params.loop){y!==p&&(t.snapIndex=y,t.emit("snapIndexChange"));return}if(m===d&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=_(m);return}const E=t.grid&&l.grid&&l.grid.rows>1;let C;if(t.virtual&&l.virtual.enabled&&l.loop)C=_(m);else if(E){const x=t.slides.filter(O=>O.column===m)[0];let N=parseInt(x.getAttribute("data-swiper-slide-index"),10);Number.isNaN(N)&&(N=Math.max(t.slides.indexOf(x),0)),C=Math.floor(N/l.grid.rows)}else if(t.slides[m]){const x=t.slides[m].getAttribute("data-swiper-slide-index");x?C=parseInt(x,10):C=m}else C=m;Object.assign(t,{previousSnapIndex:p,snapIndex:y,previousRealIndex:u,realIndex:C,previousIndex:d,activeIndex:m}),t.initialized&&RY(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(u!==C&&t.emit("realIndexChange"),t.emit("slideChange"))}function A$e(n,t){const i=this,s=i.params;let l=n.closest(`.${s.slideClass}, swiper-slide`);!l&&i.isElement&&t&&t.length>1&&t.includes(n)&&[...t.slice(t.indexOf(n)+1,t.length)].forEach(p=>{!l&&p.matches&&p.matches(`.${s.slideClass}, swiper-slide`)&&(l=p)});let d=!1,u;if(l){for(let p=0;p<i.slides.length;p+=1)if(i.slides[p]===l){d=!0,u=p;break}}if(l&&d)i.clickedSlide=l,i.virtual&&i.params.virtual.enabled?i.clickedIndex=parseInt(l.getAttribute("data-swiper-slide-index"),10):i.clickedIndex=u;else{i.clickedSlide=void 0,i.clickedIndex=void 0;return}s.slideToClickedSlide&&i.clickedIndex!==void 0&&i.clickedIndex!==i.activeIndex&&i.slideToClickedSlide()}var I$e={updateSize:_$e,updateSlides:E$e,updateAutoHeight:w$e,updateSlidesOffset:S$e,updateSlidesProgress:b$e,updateProgress:C$e,updateSlidesClasses:T$e,updateActiveIndex:x$e,updateClickedSlide:A$e};function N$e(n){n===void 0&&(n=this.isHorizontal()?"x":"y");const t=this,{params:i,rtlTranslate:s,translate:l,wrapperEl:d}=t;if(i.virtualTranslate)return s?-l:l;if(i.cssMode)return l;let u=CY(d,n);return u+=t.cssOverflowAdjustment(),s&&(u=-u),u||0}function O$e(n,t){const i=this,{rtlTranslate:s,params:l,wrapperEl:d,progress:u}=i;let p=0,m=0;const y=0;i.isHorizontal()?p=s?-n:n:m=n,l.roundLengths&&(p=Math.floor(p),m=Math.floor(m)),i.previousTranslate=i.translate,i.translate=i.isHorizontal()?p:m,l.cssMode?d[i.isHorizontal()?"scrollLeft":"scrollTop"]=i.isHorizontal()?-p:-m:l.virtualTranslate||(i.isHorizontal()?p-=i.cssOverflowAdjustment():m-=i.cssOverflowAdjustment(),d.style.transform=`translate3d(${p}px, ${m}px, ${y}px)`);let _;const E=i.maxTranslate()-i.minTranslate();E===0?_=0:_=(n-i.minTranslate())/E,_!==u&&i.updateProgress(n),i.emit("setTranslate",i.translate,t)}function P$e(){return-this.snapGrid[0]}function L$e(){return-this.snapGrid[this.snapGrid.length-1]}function D$e(n,t,i,s,l){n===void 0&&(n=0),t===void 0&&(t=this.params.speed),i===void 0&&(i=!0),s===void 0&&(s=!0);const d=this,{params:u,wrapperEl:p}=d;if(d.animating&&u.preventInteractionOnTransition)return!1;const m=d.minTranslate(),y=d.maxTranslate();let _;if(s&&n>m?_=m:s&&n<y?_=y:_=n,d.updateProgress(_),u.cssMode){const E=d.isHorizontal();if(t===0)p[E?"scrollLeft":"scrollTop"]=-_;else{if(!d.support.smoothScroll)return G_e({swiper:d,targetPosition:-_,side:E?"left":"top"}),!0;p.scrollTo({[E?"left":"top"]:-_,behavior:"smooth"})}return!0}return t===0?(d.setTransition(0),d.setTranslate(_),i&&(d.emit("beforeTransitionStart",t,l),d.emit("transitionEnd"))):(d.setTransition(t),d.setTranslate(_),i&&(d.emit("beforeTransitionStart",t,l),d.emit("transitionStart")),d.animating||(d.animating=!0,d.onTranslateToWrapperTransitionEnd||(d.onTranslateToWrapperTransitionEnd=function(C){!d||d.destroyed||C.target===this&&(d.wrapperEl.removeEventListener("transitionend",d.onTranslateToWrapperTransitionEnd),d.onTranslateToWrapperTransitionEnd=null,delete d.onTranslateToWrapperTransitionEnd,i&&d.emit("transitionEnd"))}),d.wrapperEl.addEventListener("transitionend",d.onTranslateToWrapperTransitionEnd))),!0}var k$e={getTranslate:N$e,setTranslate:O$e,minTranslate:P$e,maxTranslate:L$e,translateTo:D$e};function M$e(n,t){const i=this;i.params.cssMode||(i.wrapperEl.style.transitionDuration=`${n}ms`,i.wrapperEl.style.transitionDelay=n===0?"0ms":""),i.emit("setTransition",n,t)}function K_e(n){let{swiper:t,runCallbacks:i,direction:s,step:l}=n;const{activeIndex:d,previousIndex:u}=t;let p=s;if(p||(d>u?p="next":d<u?p="prev":p="reset"),t.emit(`transition${l}`),i&&d!==u){if(p==="reset"){t.emit(`slideResetTransition${l}`);return}t.emit(`slideChangeTransition${l}`),p==="next"?t.emit(`slideNextTransition${l}`):t.emit(`slidePrevTransition${l}`)}}function j$e(n,t){n===void 0&&(n=!0);const i=this,{params:s}=i;s.cssMode||(s.autoHeight&&i.updateAutoHeight(),K_e({swiper:i,runCallbacks:n,direction:t,step:"Start"}))}function U$e(n,t){n===void 0&&(n=!0);const i=this,{params:s}=i;i.animating=!1,!s.cssMode&&(i.setTransition(0),K_e({swiper:i,runCallbacks:n,direction:t,step:"End"}))}var F$e={setTransition:M$e,transitionStart:j$e,transitionEnd:U$e};function B$e(n,t,i,s,l){n===void 0&&(n=0),t===void 0&&(t=this.params.speed),i===void 0&&(i=!0),typeof n=="string"&&(n=parseInt(n,10));const d=this;let u=n;u<0&&(u=0);const{params:p,snapGrid:m,slidesGrid:y,previousIndex:_,activeIndex:E,rtlTranslate:C,wrapperEl:x,enabled:N}=d;if(d.animating&&p.preventInteractionOnTransition||!N&&!s&&!l||d.destroyed)return!1;const O=Math.min(d.params.slidesPerGroupSkip,u);let D=O+Math.floor((u-O)/d.params.slidesPerGroup);D>=m.length&&(D=m.length-1);const P=-m[D];if(p.normalizeSlideIndex)for(let M=0;M<y.length;M+=1){const V=-Math.floor(P*100),G=Math.floor(y[M]*100),$=Math.floor(y[M+1]*100);typeof y[M+1]<"u"?V>=G&&V<$-($-G)/2?u=M:V>=G&&V<$&&(u=M+1):V>=G&&(u=M)}if(d.initialized&&u!==E&&(!d.allowSlideNext&&(C?P>d.translate&&P>d.minTranslate():P<d.translate&&P<d.minTranslate())||!d.allowSlidePrev&&P>d.translate&&P>d.maxTranslate()&&(E||0)!==u))return!1;u!==(_||0)&&i&&d.emit("beforeSlideChangeStart"),d.updateProgress(P);let j;if(u>E?j="next":u<E?j="prev":j="reset",C&&-P===d.translate||!C&&P===d.translate)return d.updateActiveIndex(u),p.autoHeight&&d.updateAutoHeight(),d.updateSlidesClasses(),p.effect!=="slide"&&d.setTranslate(P),j!=="reset"&&(d.transitionStart(i,j),d.transitionEnd(i,j)),!1;if(p.cssMode){const M=d.isHorizontal(),V=C?P:-P;if(t===0){const G=d.virtual&&d.params.virtual.enabled;G&&(d.wrapperEl.style.scrollSnapType="none",d._immediateVirtual=!0),G&&!d._cssModeVirtualInitialSet&&d.params.initialSlide>0?(d._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{x[M?"scrollLeft":"scrollTop"]=V})):x[M?"scrollLeft":"scrollTop"]=V,G&&requestAnimationFrame(()=>{d.wrapperEl.style.scrollSnapType="",d._immediateVirtual=!1})}else{if(!d.support.smoothScroll)return G_e({swiper:d,targetPosition:V,side:M?"left":"top"}),!0;x.scrollTo({[M?"left":"top"]:V,behavior:"smooth"})}return!0}return d.setTransition(t),d.setTranslate(P),d.updateActiveIndex(u),d.updateSlidesClasses(),d.emit("beforeTransitionStart",t,s),d.transitionStart(i,j),t===0?d.transitionEnd(i,j):d.animating||(d.animating=!0,d.onSlideToWrapperTransitionEnd||(d.onSlideToWrapperTransitionEnd=function(V){!d||d.destroyed||V.target===this&&(d.wrapperEl.removeEventListener("transitionend",d.onSlideToWrapperTransitionEnd),d.onSlideToWrapperTransitionEnd=null,delete d.onSlideToWrapperTransitionEnd,d.transitionEnd(i,j))}),d.wrapperEl.addEventListener("transitionend",d.onSlideToWrapperTransitionEnd)),!0}function V$e(n,t,i,s){n===void 0&&(n=0),t===void 0&&(t=this.params.speed),i===void 0&&(i=!0),typeof n=="string"&&(n=parseInt(n,10));const l=this;if(l.destroyed)return;const d=l.grid&&l.params.grid&&l.params.grid.rows>1;let u=n;if(l.params.loop)if(l.virtual&&l.params.virtual.enabled)u=u+l.virtual.slidesBefore;else{let p;if(d){const C=u*l.params.grid.rows;p=l.slides.filter(x=>x.getAttribute("data-swiper-slide-index")*1===C)[0].column}else p=l.getSlideIndexByData(u);const m=d?Math.ceil(l.slides.length/l.params.grid.rows):l.slides.length,{centeredSlides:y}=l.params;let _=l.params.slidesPerView;_==="auto"?_=l.slidesPerViewDynamic():(_=Math.ceil(parseFloat(l.params.slidesPerView,10)),y&&_%2===0&&(_=_+1));let E=m-p<_;if(y&&(E=E||p<Math.ceil(_/2)),E){const C=y?p<l.activeIndex?"prev":"next":p-l.activeIndex-1<l.params.slidesPerView?"next":"prev";l.loopFix({direction:C,slideTo:!0,activeSlideIndex:C==="next"?p+1:p-m+1,slideRealIndex:C==="next"?l.realIndex:void 0})}if(d){const C=u*l.params.grid.rows;u=l.slides.filter(x=>x.getAttribute("data-swiper-slide-index")*1===C)[0].column}else u=l.getSlideIndexByData(u)}return requestAnimationFrame(()=>{l.slideTo(u,t,i,s)}),l}function z$e(n,t,i){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0);const s=this,{enabled:l,params:d,animating:u}=s;if(!l||s.destroyed)return s;let p=d.slidesPerGroup;d.slidesPerView==="auto"&&d.slidesPerGroup===1&&d.slidesPerGroupAuto&&(p=Math.max(s.slidesPerViewDynamic("current",!0),1));const m=s.activeIndex<d.slidesPerGroupSkip?1:p,y=s.virtual&&d.virtual.enabled;if(d.loop){if(u&&!y&&d.loopPreventsSliding)return!1;if(s.loopFix({direction:"next"}),s._clientLeft=s.wrapperEl.clientLeft,s.activeIndex===s.slides.length-1&&d.cssMode)return requestAnimationFrame(()=>{s.slideTo(s.activeIndex+m,n,t,i)}),!0}return d.rewind&&s.isEnd?s.slideTo(0,n,t,i):s.slideTo(s.activeIndex+m,n,t,i)}function H$e(n,t,i){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0);const s=this,{params:l,snapGrid:d,slidesGrid:u,rtlTranslate:p,enabled:m,animating:y}=s;if(!m||s.destroyed)return s;const _=s.virtual&&l.virtual.enabled;if(l.loop){if(y&&!_&&l.loopPreventsSliding)return!1;s.loopFix({direction:"prev"}),s._clientLeft=s.wrapperEl.clientLeft}const E=p?s.translate:-s.translate;function C(P){return P<0?-Math.floor(Math.abs(P)):Math.floor(P)}const x=C(E),N=d.map(P=>C(P));let O=d[N.indexOf(x)-1];if(typeof O>"u"&&l.cssMode){let P;d.forEach((j,M)=>{x>=j&&(P=M)}),typeof P<"u"&&(O=d[P>0?P-1:P])}let D=0;if(typeof O<"u"&&(D=u.indexOf(O),D<0&&(D=s.activeIndex-1),l.slidesPerView==="auto"&&l.slidesPerGroup===1&&l.slidesPerGroupAuto&&(D=D-s.slidesPerViewDynamic("previous",!0)+1,D=Math.max(D,0))),l.rewind&&s.isBeginning){const P=s.params.virtual&&s.params.virtual.enabled&&s.virtual?s.virtual.slides.length-1:s.slides.length-1;return s.slideTo(P,n,t,i)}else if(l.loop&&s.activeIndex===0&&l.cssMode)return requestAnimationFrame(()=>{s.slideTo(D,n,t,i)}),!0;return s.slideTo(D,n,t,i)}function G$e(n,t,i){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0);const s=this;if(!s.destroyed)return s.slideTo(s.activeIndex,n,t,i)}function W$e(n,t,i,s){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0),s===void 0&&(s=.5);const l=this;if(l.destroyed)return;let d=l.activeIndex;const u=Math.min(l.params.slidesPerGroupSkip,d),p=u+Math.floor((d-u)/l.params.slidesPerGroup),m=l.rtlTranslate?l.translate:-l.translate;if(m>=l.snapGrid[p]){const y=l.snapGrid[p],_=l.snapGrid[p+1];m-y>(_-y)*s&&(d+=l.params.slidesPerGroup)}else{const y=l.snapGrid[p-1],_=l.snapGrid[p];m-y<=(_-y)*s&&(d-=l.params.slidesPerGroup)}return d=Math.max(d,0),d=Math.min(d,l.slidesGrid.length-1),l.slideTo(d,n,t,i)}function $$e(){const n=this;if(n.destroyed)return;const{params:t,slidesEl:i}=n,s=t.slidesPerView==="auto"?n.slidesPerViewDynamic():t.slidesPerView;let l=n.clickedIndex,d;const u=n.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(n.animating)return;d=parseInt(n.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?l<n.loopedSlides-s/2||l>n.slides.length-n.loopedSlides+s/2?(n.loopFix(),l=n.getSlideIndex(Jo(i,`${u}[data-swiper-slide-index="${d}"]`)[0]),K2(()=>{n.slideTo(l)})):n.slideTo(l):l>n.slides.length-s?(n.loopFix(),l=n.getSlideIndex(Jo(i,`${u}[data-swiper-slide-index="${d}"]`)[0]),K2(()=>{n.slideTo(l)})):n.slideTo(l)}else n.slideTo(l)}var K$e={slideTo:B$e,slideToLoop:V$e,slideNext:z$e,slidePrev:H$e,slideReset:G$e,slideToClosest:W$e,slideToClickedSlide:$$e};function q$e(n){const t=this,{params:i,slidesEl:s}=t;if(!i.loop||t.virtual&&t.params.virtual.enabled)return;const l=()=>{Jo(s,`.${i.slideClass}, swiper-slide`).forEach((E,C)=>{E.setAttribute("data-swiper-slide-index",C)})},d=t.grid&&i.grid&&i.grid.rows>1,u=i.slidesPerGroup*(d?i.grid.rows:1),p=t.slides.length%u!==0,m=d&&t.slides.length%i.grid.rows!==0,y=_=>{for(let E=0;E<_;E+=1){const C=t.isElement?Zd("swiper-slide",[i.slideBlankClass]):Zd("div",[i.slideClass,i.slideBlankClass]);t.slidesEl.append(C)}};if(p){if(i.loopAddBlankSlides){const _=u-t.slides.length%u;y(_),t.recalcSlides(),t.updateSlides()}else X7("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else if(m){if(i.loopAddBlankSlides){const _=i.grid.rows-t.slides.length%i.grid.rows;y(_),t.recalcSlides(),t.updateSlides()}else X7("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else l();t.loopFix({slideRealIndex:n,direction:i.centeredSlides?void 0:"next"})}function Y$e(n){let{slideRealIndex:t,slideTo:i=!0,direction:s,setTranslate:l,activeSlideIndex:d,byController:u,byMousewheel:p}=n===void 0?{}:n;const m=this;if(!m.params.loop)return;m.emit("beforeLoopFix");const{slides:y,allowSlidePrev:_,allowSlideNext:E,slidesEl:C,params:x}=m,{centeredSlides:N}=x;if(m.allowSlidePrev=!0,m.allowSlideNext=!0,m.virtual&&x.virtual.enabled){i&&(!x.centeredSlides&&m.snapIndex===0?m.slideTo(m.virtual.slides.length,0,!1,!0):x.centeredSlides&&m.snapIndex<x.slidesPerView?m.slideTo(m.virtual.slides.length+m.snapIndex,0,!1,!0):m.snapIndex===m.snapGrid.length-1&&m.slideTo(m.virtual.slidesBefore,0,!1,!0)),m.allowSlidePrev=_,m.allowSlideNext=E,m.emit("loopFix");return}let O=x.slidesPerView;O==="auto"?O=m.slidesPerViewDynamic():(O=Math.ceil(parseFloat(x.slidesPerView,10)),N&&O%2===0&&(O=O+1));const D=x.slidesPerGroupAuto?O:x.slidesPerGroup;let P=D;P%D!==0&&(P+=D-P%D),P+=x.loopAdditionalSlides,m.loopedSlides=P;const j=m.grid&&x.grid&&x.grid.rows>1;y.length<O+P?X7("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):j&&x.grid.fill==="row"&&X7("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const M=[],V=[];let G=m.activeIndex;typeof d>"u"?d=m.getSlideIndex(y.filter(H=>H.classList.contains(x.slideActiveClass))[0]):G=d;const $=s==="next"||!s,ne=s==="prev"||!s;let Y=0,le=0;const re=j?Math.ceil(y.length/x.grid.rows):y.length,de=(j?y[d].column:d)+(N&&typeof l>"u"?-O/2+.5:0);if(de<P){Y=Math.max(P-de,D);for(let H=0;H<P-de;H+=1){const ae=H-Math.floor(H/re)*re;if(j){const _e=re-ae-1;for(let me=y.length-1;me>=0;me-=1)y[me].column===_e&&M.push(me)}else M.push(re-ae-1)}}else if(de+O>re-P){le=Math.max(de-(re-P*2),D);for(let H=0;H<le;H+=1){const ae=H-Math.floor(H/re)*re;j?y.forEach((_e,me)=>{_e.column===ae&&V.push(me)}):V.push(ae)}}if(m.__preventObserver__=!0,requestAnimationFrame(()=>{m.__preventObserver__=!1}),ne&&M.forEach(H=>{y[H].swiperLoopMoveDOM=!0,C.prepend(y[H]),y[H].swiperLoopMoveDOM=!1}),$&&V.forEach(H=>{y[H].swiperLoopMoveDOM=!0,C.append(y[H]),y[H].swiperLoopMoveDOM=!1}),m.recalcSlides(),x.slidesPerView==="auto"?m.updateSlides():j&&(M.length>0&&ne||V.length>0&&$)&&m.slides.forEach((H,ae)=>{m.grid.updateSlide(ae,H,m.slides)}),x.watchSlidesProgress&&m.updateSlidesOffset(),i){if(M.length>0&&ne){if(typeof t>"u"){const H=m.slidesGrid[G],_e=m.slidesGrid[G+Y]-H;p?m.setTranslate(m.translate-_e):(m.slideTo(G+Y,0,!1,!0),l&&(m.touchEventsData.startTranslate=m.touchEventsData.startTranslate-_e,m.touchEventsData.currentTranslate=m.touchEventsData.currentTranslate-_e))}else if(l){const H=j?M.length/x.grid.rows:M.length;m.slideTo(m.activeIndex+H,0,!1,!0),m.touchEventsData.currentTranslate=m.translate}}else if(V.length>0&&$)if(typeof t>"u"){const H=m.slidesGrid[G],_e=m.slidesGrid[G-le]-H;p?m.setTranslate(m.translate-_e):(m.slideTo(G-le,0,!1,!0),l&&(m.touchEventsData.startTranslate=m.touchEventsData.startTranslate-_e,m.touchEventsData.currentTranslate=m.touchEventsData.currentTranslate-_e))}else{const H=j?V.length/x.grid.rows:V.length;m.slideTo(m.activeIndex-H,0,!1,!0)}}if(m.allowSlidePrev=_,m.allowSlideNext=E,m.controller&&m.controller.control&&!u){const H={slideRealIndex:t,direction:s,setTranslate:l,activeSlideIndex:d,byController:!0};Array.isArray(m.controller.control)?m.controller.control.forEach(ae=>{!ae.destroyed&&ae.params.loop&&ae.loopFix({...H,slideTo:ae.params.slidesPerView===x.slidesPerView?i:!1})}):m.controller.control instanceof m.constructor&&m.controller.control.params.loop&&m.controller.control.loopFix({...H,slideTo:m.controller.control.params.slidesPerView===x.slidesPerView?i:!1})}m.emit("loopFix")}function X$e(){const n=this,{params:t,slidesEl:i}=n;if(!t.loop||n.virtual&&n.params.virtual.enabled)return;n.recalcSlides();const s=[];n.slides.forEach(l=>{const d=typeof l.swiperSlideIndex>"u"?l.getAttribute("data-swiper-slide-index")*1:l.swiperSlideIndex;s[d]=l}),n.slides.forEach(l=>{l.removeAttribute("data-swiper-slide-index")}),s.forEach(l=>{i.append(l)}),n.recalcSlides(),n.slideTo(n.realIndex,0)}var J$e={loopCreate:q$e,loopFix:Y$e,loopDestroy:X$e};function Q$e(n){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const i=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),i.style.cursor="move",i.style.cursor=n?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function Z$e(){const n=this;n.params.watchOverflow&&n.isLocked||n.params.cssMode||(n.isElement&&(n.__preventObserver__=!0),n[n.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",n.isElement&&requestAnimationFrame(()=>{n.__preventObserver__=!1}))}var eKe={setGrabCursor:Q$e,unsetGrabCursor:Z$e};function tKe(n,t){t===void 0&&(t=this);function i(s){if(!s||s===fc()||s===sa())return null;s.assignedSlot&&(s=s.assignedSlot);const l=s.closest(n);return!l&&!s.getRootNode?null:l||i(s.getRootNode().host)}return i(t)}function dfe(n,t,i){const s=sa(),{params:l}=n,d=l.edgeSwipeDetection,u=l.edgeSwipeThreshold;return d&&(i<=u||i>=s.innerWidth-u)?d==="prevent"?(t.preventDefault(),!0):!1:!0}function nKe(n){const t=this,i=fc();let s=n;s.originalEvent&&(s=s.originalEvent);const l=t.touchEventsData;if(s.type==="pointerdown"){if(l.pointerId!==null&&l.pointerId!==s.pointerId)return;l.pointerId=s.pointerId}else s.type==="touchstart"&&s.targetTouches.length===1&&(l.touchId=s.targetTouches[0].identifier);if(s.type==="touchstart"){dfe(t,s,s.targetTouches[0].pageX);return}const{params:d,touches:u,enabled:p}=t;if(!p||!d.simulateTouch&&s.pointerType==="mouse"||t.animating&&d.preventInteractionOnTransition)return;!t.animating&&d.cssMode&&d.loop&&t.loopFix();let m=s.target;if(d.touchEventsTarget==="wrapper"&&!t.wrapperEl.contains(m)||"which"in s&&s.which===3||"button"in s&&s.button>0||l.isTouched&&l.isMoved)return;const y=!!d.noSwipingClass&&d.noSwipingClass!=="",_=s.composedPath?s.composedPath():s.path;y&&s.target&&s.target.shadowRoot&&_&&(m=_[0]);const E=d.noSwipingSelector?d.noSwipingSelector:`.${d.noSwipingClass}`,C=!!(s.target&&s.target.shadowRoot);if(d.noSwiping&&(C?tKe(E,m):m.closest(E))){t.allowClick=!0;return}if(d.swipeHandler&&!m.closest(d.swipeHandler))return;u.currentX=s.pageX,u.currentY=s.pageY;const x=u.currentX,N=u.currentY;if(!dfe(t,s,x))return;Object.assign(l,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),u.startX=x,u.startY=N,l.touchStartTime=lh(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,d.threshold>0&&(l.allowThresholdMove=!1);let O=!0;m.matches(l.focusableElements)&&(O=!1,m.nodeName==="SELECT"&&(l.isTouched=!1)),i.activeElement&&i.activeElement.matches(l.focusableElements)&&i.activeElement!==m&&i.activeElement.blur();const D=O&&t.allowTouchMove&&d.touchStartPreventDefault;(d.touchStartForcePreventDefault||D)&&!m.isContentEditable&&s.preventDefault(),d.freeMode&&d.freeMode.enabled&&t.freeMode&&t.animating&&!d.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",s)}function iKe(n){const t=fc(),i=this,s=i.touchEventsData,{params:l,touches:d,rtlTranslate:u,enabled:p}=i;if(!p||!l.simulateTouch&&n.pointerType==="mouse")return;let m=n;if(m.originalEvent&&(m=m.originalEvent),m.type==="pointermove"&&(s.touchId!==null||m.pointerId!==s.pointerId))return;let y;if(m.type==="touchmove"){if(y=[...m.changedTouches].filter($=>$.identifier===s.touchId)[0],!y||y.identifier!==s.touchId)return}else y=m;if(!s.isTouched){s.startMoving&&s.isScrolling&&i.emit("touchMoveOpposite",m);return}const _=y.pageX,E=y.pageY;if(m.preventedByNestedSwiper){d.startX=_,d.startY=E;return}if(!i.allowTouchMove){m.target.matches(s.focusableElements)||(i.allowClick=!1),s.isTouched&&(Object.assign(d,{startX:_,startY:E,currentX:_,currentY:E}),s.touchStartTime=lh());return}if(l.touchReleaseOnEdges&&!l.loop){if(i.isVertical()){if(E<d.startY&&i.translate<=i.maxTranslate()||E>d.startY&&i.translate>=i.minTranslate()){s.isTouched=!1,s.isMoved=!1;return}}else if(_<d.startX&&i.translate<=i.maxTranslate()||_>d.startX&&i.translate>=i.minTranslate())return}if(t.activeElement&&m.target===t.activeElement&&m.target.matches(s.focusableElements)){s.isMoved=!0,i.allowClick=!1;return}s.allowTouchCallbacks&&i.emit("touchMove",m),d.previousX=d.currentX,d.previousY=d.currentY,d.currentX=_,d.currentY=E;const C=d.currentX-d.startX,x=d.currentY-d.startY;if(i.params.threshold&&Math.sqrt(C**2+x**2)<i.params.threshold)return;if(typeof s.isScrolling>"u"){let $;i.isHorizontal()&&d.currentY===d.startY||i.isVertical()&&d.currentX===d.startX?s.isScrolling=!1:C*C+x*x>=25&&($=Math.atan2(Math.abs(x),Math.abs(C))*180/Math.PI,s.isScrolling=i.isHorizontal()?$>l.touchAngle:90-$>l.touchAngle)}if(s.isScrolling&&i.emit("touchMoveOpposite",m),typeof s.startMoving>"u"&&(d.currentX!==d.startX||d.currentY!==d.startY)&&(s.startMoving=!0),s.isScrolling){s.isTouched=!1;return}if(!s.startMoving)return;i.allowClick=!1,!l.cssMode&&m.cancelable&&m.preventDefault(),l.touchMoveStopPropagation&&!l.nested&&m.stopPropagation();let N=i.isHorizontal()?C:x,O=i.isHorizontal()?d.currentX-d.previousX:d.currentY-d.previousY;l.oneWayMovement&&(N=Math.abs(N)*(u?1:-1),O=Math.abs(O)*(u?1:-1)),d.diff=N,N*=l.touchRatio,u&&(N=-N,O=-O);const D=i.touchesDirection;i.swipeDirection=N>0?"prev":"next",i.touchesDirection=O>0?"prev":"next";const P=i.params.loop&&!l.cssMode,j=i.touchesDirection==="next"&&i.allowSlideNext||i.touchesDirection==="prev"&&i.allowSlidePrev;if(!s.isMoved){if(P&&j&&i.loopFix({direction:i.swipeDirection}),s.startTranslate=i.getTranslate(),i.setTransition(0),i.animating){const $=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});i.wrapperEl.dispatchEvent($)}s.allowMomentumBounce=!1,l.grabCursor&&(i.allowSlideNext===!0||i.allowSlidePrev===!0)&&i.setGrabCursor(!0),i.emit("sliderFirstMove",m)}let M;if(new Date().getTime(),s.isMoved&&s.allowThresholdMove&&D!==i.touchesDirection&&P&&j&&Math.abs(N)>=1){Object.assign(d,{startX:_,startY:E,currentX:_,currentY:E,startTranslate:s.currentTranslate}),s.loopSwapReset=!0,s.startTranslate=s.currentTranslate;return}i.emit("sliderMove",m),s.isMoved=!0,s.currentTranslate=N+s.startTranslate;let V=!0,G=l.resistanceRatio;if(l.touchReleaseOnEdges&&(G=0),N>0?(P&&j&&!M&&s.allowThresholdMove&&s.currentTranslate>(l.centeredSlides?i.minTranslate()-i.slidesSizesGrid[i.activeIndex+1]:i.minTranslate())&&i.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),s.currentTranslate>i.minTranslate()&&(V=!1,l.resistance&&(s.currentTranslate=i.minTranslate()-1+(-i.minTranslate()+s.startTranslate+N)**G))):N<0&&(P&&j&&!M&&s.allowThresholdMove&&s.currentTranslate<(l.centeredSlides?i.maxTranslate()+i.slidesSizesGrid[i.slidesSizesGrid.length-1]:i.maxTranslate())&&i.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:i.slides.length-(l.slidesPerView==="auto"?i.slidesPerViewDynamic():Math.ceil(parseFloat(l.slidesPerView,10)))}),s.currentTranslate<i.maxTranslate()&&(V=!1,l.resistance&&(s.currentTranslate=i.maxTranslate()+1-(i.maxTranslate()-s.startTranslate-N)**G))),V&&(m.preventedByNestedSwiper=!0),!i.allowSlideNext&&i.swipeDirection==="next"&&s.currentTranslate<s.startTranslate&&(s.currentTranslate=s.startTranslate),!i.allowSlidePrev&&i.swipeDirection==="prev"&&s.currentTranslate>s.startTranslate&&(s.currentTranslate=s.startTranslate),!i.allowSlidePrev&&!i.allowSlideNext&&(s.currentTranslate=s.startTranslate),l.threshold>0)if(Math.abs(N)>l.threshold||s.allowThresholdMove){if(!s.allowThresholdMove){s.allowThresholdMove=!0,d.startX=d.currentX,d.startY=d.currentY,s.currentTranslate=s.startTranslate,d.diff=i.isHorizontal()?d.currentX-d.startX:d.currentY-d.startY;return}}else{s.currentTranslate=s.startTranslate;return}!l.followFinger||l.cssMode||((l.freeMode&&l.freeMode.enabled&&i.freeMode||l.watchSlidesProgress)&&(i.updateActiveIndex(),i.updateSlidesClasses()),l.freeMode&&l.freeMode.enabled&&i.freeMode&&i.freeMode.onTouchMove(),i.updateProgress(s.currentTranslate),i.setTranslate(s.currentTranslate))}function rKe(n){const t=this,i=t.touchEventsData;let s=n;s.originalEvent&&(s=s.originalEvent);let l;if(s.type==="touchend"||s.type==="touchcancel"){if(l=[...s.changedTouches].filter(G=>G.identifier===i.touchId)[0],!l||l.identifier!==i.touchId)return}else{if(i.touchId!==null||s.pointerId!==i.pointerId)return;l=s}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(s.type)&&!(["pointercancel","contextmenu"].includes(s.type)&&(t.browser.isSafari||t.browser.isWebView)))return;i.pointerId=null,i.touchId=null;const{params:u,touches:p,rtlTranslate:m,slidesGrid:y,enabled:_}=t;if(!_||!u.simulateTouch&&s.pointerType==="mouse")return;if(i.allowTouchCallbacks&&t.emit("touchEnd",s),i.allowTouchCallbacks=!1,!i.isTouched){i.isMoved&&u.grabCursor&&t.setGrabCursor(!1),i.isMoved=!1,i.startMoving=!1;return}u.grabCursor&&i.isMoved&&i.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const E=lh(),C=E-i.touchStartTime;if(t.allowClick){const G=s.path||s.composedPath&&s.composedPath();t.updateClickedSlide(G&&G[0]||s.target,G),t.emit("tap click",s),C<300&&E-i.lastClickTime<300&&t.emit("doubleTap doubleClick",s)}if(i.lastClickTime=lh(),K2(()=>{t.destroyed||(t.allowClick=!0)}),!i.isTouched||!i.isMoved||!t.swipeDirection||p.diff===0&&!i.loopSwapReset||i.currentTranslate===i.startTranslate&&!i.loopSwapReset){i.isTouched=!1,i.isMoved=!1,i.startMoving=!1;return}i.isTouched=!1,i.isMoved=!1,i.startMoving=!1;let x;if(u.followFinger?x=m?t.translate:-t.translate:x=-i.currentTranslate,u.cssMode)return;if(u.freeMode&&u.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:x});return}const N=x>=-t.maxTranslate()&&!t.params.loop;let O=0,D=t.slidesSizesGrid[0];for(let G=0;G<y.length;G+=G<u.slidesPerGroupSkip?1:u.slidesPerGroup){const $=G<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;typeof y[G+$]<"u"?(N||x>=y[G]&&x<y[G+$])&&(O=G,D=y[G+$]-y[G]):(N||x>=y[G])&&(O=G,D=y[y.length-1]-y[y.length-2])}let P=null,j=null;u.rewind&&(t.isBeginning?j=u.virtual&&u.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(P=0));const M=(x-y[O])/D,V=O<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;if(C>u.longSwipesMs){if(!u.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(M>=u.longSwipesRatio?t.slideTo(u.rewind&&t.isEnd?P:O+V):t.slideTo(O)),t.swipeDirection==="prev"&&(M>1-u.longSwipesRatio?t.slideTo(O+V):j!==null&&M<0&&Math.abs(M)>u.longSwipesRatio?t.slideTo(j):t.slideTo(O))}else{if(!u.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(s.target===t.navigation.nextEl||s.target===t.navigation.prevEl)?s.target===t.navigation.nextEl?t.slideTo(O+V):t.slideTo(O):(t.swipeDirection==="next"&&t.slideTo(P!==null?P:O+V),t.swipeDirection==="prev"&&t.slideTo(j!==null?j:O))}}function ufe(){const n=this,{params:t,el:i}=n;if(i&&i.offsetWidth===0)return;t.breakpoints&&n.setBreakpoint();const{allowSlideNext:s,allowSlidePrev:l,snapGrid:d}=n,u=n.virtual&&n.params.virtual.enabled;n.allowSlideNext=!0,n.allowSlidePrev=!0,n.updateSize(),n.updateSlides(),n.updateSlidesClasses();const p=u&&t.loop;(t.slidesPerView==="auto"||t.slidesPerView>1)&&n.isEnd&&!n.isBeginning&&!n.params.centeredSlides&&!p?n.slideTo(n.slides.length-1,0,!1,!0):n.params.loop&&!u?n.slideToLoop(n.realIndex,0,!1,!0):n.slideTo(n.activeIndex,0,!1,!0),n.autoplay&&n.autoplay.running&&n.autoplay.paused&&(clearTimeout(n.autoplay.resizeTimeout),n.autoplay.resizeTimeout=setTimeout(()=>{n.autoplay&&n.autoplay.running&&n.autoplay.paused&&n.autoplay.resume()},500)),n.allowSlidePrev=l,n.allowSlideNext=s,n.params.watchOverflow&&d!==n.snapGrid&&n.checkOverflow()}function sKe(n){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&n.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(n.stopPropagation(),n.stopImmediatePropagation())))}function aKe(){const n=this,{wrapperEl:t,rtlTranslate:i,enabled:s}=n;if(!s)return;n.previousTranslate=n.translate,n.isHorizontal()?n.translate=-t.scrollLeft:n.translate=-t.scrollTop,n.translate===0&&(n.translate=0),n.updateActiveIndex(),n.updateSlidesClasses();let l;const d=n.maxTranslate()-n.minTranslate();d===0?l=0:l=(n.translate-n.minTranslate())/d,l!==n.progress&&n.updateProgress(i?-n.translate:n.translate),n.emit("setTranslate",n.translate,!1)}function oKe(n){const t=this;IM(t,n.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update()}function lKe(){const n=this;n.documentTouchHandlerProceeded||(n.documentTouchHandlerProceeded=!0,n.params.touchReleaseOnEdges&&(n.el.style.touchAction="auto"))}const q_e=(n,t)=>{const i=fc(),{params:s,el:l,wrapperEl:d,device:u}=n,p=!!s.nested,m=t==="on"?"addEventListener":"removeEventListener",y=t;i[m]("touchstart",n.onDocumentTouchStart,{passive:!1,capture:p}),l[m]("touchstart",n.onTouchStart,{passive:!1}),l[m]("pointerdown",n.onTouchStart,{passive:!1}),i[m]("touchmove",n.onTouchMove,{passive:!1,capture:p}),i[m]("pointermove",n.onTouchMove,{passive:!1,capture:p}),i[m]("touchend",n.onTouchEnd,{passive:!0}),i[m]("pointerup",n.onTouchEnd,{passive:!0}),i[m]("pointercancel",n.onTouchEnd,{passive:!0}),i[m]("touchcancel",n.onTouchEnd,{passive:!0}),i[m]("pointerout",n.onTouchEnd,{passive:!0}),i[m]("pointerleave",n.onTouchEnd,{passive:!0}),i[m]("contextmenu",n.onTouchEnd,{passive:!0}),(s.preventClicks||s.preventClicksPropagation)&&l[m]("click",n.onClick,!0),s.cssMode&&d[m]("scroll",n.onScroll),s.updateOnWindowResize?n[y](u.ios||u.android?"resize orientationchange observerUpdate":"resize observerUpdate",ufe,!0):n[y]("observerUpdate",ufe,!0),l[m]("load",n.onLoad,{capture:!0})};function cKe(){const n=this,{params:t}=n;n.onTouchStart=nKe.bind(n),n.onTouchMove=iKe.bind(n),n.onTouchEnd=rKe.bind(n),n.onDocumentTouchStart=lKe.bind(n),t.cssMode&&(n.onScroll=aKe.bind(n)),n.onClick=sKe.bind(n),n.onLoad=oKe.bind(n),q_e(n,"on")}function dKe(){q_e(this,"off")}var uKe={attachEvents:cKe,detachEvents:dKe};const hfe=(n,t)=>n.grid&&t.grid&&t.grid.rows>1;function hKe(){const n=this,{realIndex:t,initialized:i,params:s,el:l}=n,d=s.breakpoints;if(!d||d&&Object.keys(d).length===0)return;const u=n.getBreakpoint(d,n.params.breakpointsBase,n.el);if(!u||n.currentBreakpoint===u)return;const m=(u in d?d[u]:void 0)||n.originalParams,y=hfe(n,s),_=hfe(n,m),E=s.enabled;y&&!_?(l.classList.remove(`${s.containerModifierClass}grid`,`${s.containerModifierClass}grid-column`),n.emitContainerClasses()):!y&&_&&(l.classList.add(`${s.containerModifierClass}grid`),(m.grid.fill&&m.grid.fill==="column"||!m.grid.fill&&s.grid.fill==="column")&&l.classList.add(`${s.containerModifierClass}grid-column`),n.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(P=>{if(typeof m[P]>"u")return;const j=s[P]&&s[P].enabled,M=m[P]&&m[P].enabled;j&&!M&&n[P].disable(),!j&&M&&n[P].enable()});const C=m.direction&&m.direction!==s.direction,x=s.loop&&(m.slidesPerView!==s.slidesPerView||C),N=s.loop;C&&i&&n.changeDirection(),Kd(n.params,m);const O=n.params.enabled,D=n.params.loop;Object.assign(n,{allowTouchMove:n.params.allowTouchMove,allowSlideNext:n.params.allowSlideNext,allowSlidePrev:n.params.allowSlidePrev}),E&&!O?n.disable():!E&&O&&n.enable(),n.currentBreakpoint=u,n.emit("_beforeBreakpoint",m),i&&(x?(n.loopDestroy(),n.loopCreate(t),n.updateSlides()):!N&&D?(n.loopCreate(t),n.updateSlides()):N&&!D&&n.loopDestroy()),n.emit("breakpoint",m)}function fKe(n,t,i){if(t===void 0&&(t="window"),!n||t==="container"&&!i)return;let s=!1;const l=sa(),d=t==="window"?l.innerHeight:i.clientHeight,u=Object.keys(n).map(p=>{if(typeof p=="string"&&p.indexOf("@")===0){const m=parseFloat(p.substr(1));return{value:d*m,point:p}}return{value:p,point:p}});u.sort((p,m)=>parseInt(p.value,10)-parseInt(m.value,10));for(let p=0;p<u.length;p+=1){const{point:m,value:y}=u[p];t==="window"?l.matchMedia(`(min-width: ${y}px)`).matches&&(s=m):y<=i.clientWidth&&(s=m)}return s||"max"}var pKe={setBreakpoint:hKe,getBreakpoint:fKe};function mKe(n,t){const i=[];return n.forEach(s=>{typeof s=="object"?Object.keys(s).forEach(l=>{s[l]&&i.push(t+l)}):typeof s=="string"&&i.push(t+s)}),i}function gKe(){const n=this,{classNames:t,params:i,rtl:s,el:l,device:d}=n,u=mKe(["initialized",i.direction,{"free-mode":n.params.freeMode&&i.freeMode.enabled},{autoheight:i.autoHeight},{rtl:s},{grid:i.grid&&i.grid.rows>1},{"grid-column":i.grid&&i.grid.rows>1&&i.grid.fill==="column"},{android:d.android},{ios:d.ios},{"css-mode":i.cssMode},{centered:i.cssMode&&i.centeredSlides},{"watch-progress":i.watchSlidesProgress}],i.containerModifierClass);t.push(...u),l.classList.add(...t),n.emitContainerClasses()}function vKe(){const n=this,{el:t,classNames:i}=n;t.classList.remove(...i),n.emitContainerClasses()}var yKe={addClasses:gKe,removeClasses:vKe};function _Ke(){const n=this,{isLocked:t,params:i}=n,{slidesOffsetBefore:s}=i;if(s){const l=n.slides.length-1,d=n.slidesGrid[l]+n.slidesSizesGrid[l]+s*2;n.isLocked=n.size>d}else n.isLocked=n.snapGrid.length===1;i.allowSlideNext===!0&&(n.allowSlideNext=!n.isLocked),i.allowSlidePrev===!0&&(n.allowSlidePrev=!n.isLocked),t&&t!==n.isLocked&&(n.isEnd=!1),t!==n.isLocked&&n.emit(n.isLocked?"lock":"unlock")}var EKe={checkOverflow:_Ke},ffe={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function wKe(n,t){return function(s){s===void 0&&(s={});const l=Object.keys(s)[0],d=s[l];if(typeof d!="object"||d===null){Kd(t,s);return}if(n[l]===!0&&(n[l]={enabled:!0}),l==="navigation"&&n[l]&&n[l].enabled&&!n[l].prevEl&&!n[l].nextEl&&(n[l].auto=!0),["pagination","scrollbar"].indexOf(l)>=0&&n[l]&&n[l].enabled&&!n[l].el&&(n[l].auto=!0),!(l in n&&"enabled"in d)){Kd(t,s);return}typeof n[l]=="object"&&!("enabled"in n[l])&&(n[l].enabled=!0),n[l]||(n[l]={enabled:!1}),Kd(t,s)}}const CK={eventsEmitter:y$e,update:I$e,translate:k$e,transition:F$e,slide:K$e,loop:J$e,grabCursor:eKe,events:uKe,breakpoints:pKe,checkOverflow:EKe,classes:yKe},TK={};class Qc{constructor(){let t,i;for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];l.length===1&&l[0].constructor&&Object.prototype.toString.call(l[0]).slice(8,-1)==="Object"?i=l[0]:[t,i]=l,i||(i={}),i=Kd({},i),t&&!i.el&&(i.el=t);const u=fc();if(i.el&&typeof i.el=="string"&&u.querySelectorAll(i.el).length>1){const _=[];return u.querySelectorAll(i.el).forEach(E=>{const C=Kd({},i,{el:E});_.push(new Qc(C))}),_}const p=this;p.__swiper__=!0,p.support=W_e(),p.device=$_e({userAgent:i.userAgent}),p.browser=m$e(),p.eventsListeners={},p.eventsAnyListeners=[],p.modules=[...p.__modules__],i.modules&&Array.isArray(i.modules)&&p.modules.push(...i.modules);const m={};p.modules.forEach(_=>{_({params:i,swiper:p,extendParams:wKe(i,m),on:p.on.bind(p),once:p.once.bind(p),off:p.off.bind(p),emit:p.emit.bind(p)})});const y=Kd({},ffe,m);return p.params=Kd({},y,TK,i),p.originalParams=Kd({},p.params),p.passedParams=Kd({},i),p.params&&p.params.on&&Object.keys(p.params.on).forEach(_=>{p.on(_,p.params.on[_])}),p.params&&p.params.onAny&&p.onAny(p.params.onAny),Object.assign(p,{enabled:p.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return p.params.direction==="horizontal"},isVertical(){return p.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:p.params.allowSlideNext,allowSlidePrev:p.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:p.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:p.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),p.emit("_swiper"),p.params.init&&p.init(),p}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:i,params:s}=this,l=Jo(i,`.${s.slideClass}, swiper-slide`),d=_N(l[0]);return _N(t)-d}getSlideIndexByData(t){return this.getSlideIndex(this.slides.filter(i=>i.getAttribute("data-swiper-slide-index")*1===t)[0])}recalcSlides(){const t=this,{slidesEl:i,params:s}=t;t.slides=Jo(i,`.${s.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,i){const s=this;t=Math.min(Math.max(t,0),1);const l=s.minTranslate(),u=(s.maxTranslate()-l)*t+l;s.translateTo(u,typeof i>"u"?0:i),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const i=t.el.className.split(" ").filter(s=>s.indexOf("swiper")===0||s.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",i.join(" "))}getSlideClasses(t){const i=this;return i.destroyed?"":t.className.split(" ").filter(s=>s.indexOf("swiper-slide")===0||s.indexOf(i.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const i=[];t.slides.forEach(s=>{const l=t.getSlideClasses(s);i.push({slideEl:s,classNames:l}),t.emit("_slideClass",s,l)}),t.emit("_slideClasses",i)}slidesPerViewDynamic(t,i){t===void 0&&(t="current"),i===void 0&&(i=!1);const s=this,{params:l,slides:d,slidesGrid:u,slidesSizesGrid:p,size:m,activeIndex:y}=s;let _=1;if(typeof l.slidesPerView=="number")return l.slidesPerView;if(l.centeredSlides){let E=d[y]?Math.ceil(d[y].swiperSlideSize):0,C;for(let x=y+1;x<d.length;x+=1)d[x]&&!C&&(E+=Math.ceil(d[x].swiperSlideSize),_+=1,E>m&&(C=!0));for(let x=y-1;x>=0;x-=1)d[x]&&!C&&(E+=d[x].swiperSlideSize,_+=1,E>m&&(C=!0))}else if(t==="current")for(let E=y+1;E<d.length;E+=1)(i?u[E]+p[E]-u[y]<m:u[E]-u[y]<m)&&(_+=1);else for(let E=y-1;E>=0;E-=1)u[y]-u[E]<m&&(_+=1);return _}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:i,params:s}=t;s.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach(u=>{u.complete&&IM(t,u)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function l(){const u=t.rtlTranslate?t.translate*-1:t.translate,p=Math.min(Math.max(u,t.maxTranslate()),t.minTranslate());t.setTranslate(p),t.updateActiveIndex(),t.updateSlidesClasses()}let d;if(s.freeMode&&s.freeMode.enabled&&!s.cssMode)l(),s.autoHeight&&t.updateAutoHeight();else{if((s.slidesPerView==="auto"||s.slidesPerView>1)&&t.isEnd&&!s.centeredSlides){const u=t.virtual&&s.virtual.enabled?t.virtual.slides:t.slides;d=t.slideTo(u.length-1,0,!1,!0)}else d=t.slideTo(t.activeIndex,0,!1,!0);d||l()}s.watchOverflow&&i!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,i){i===void 0&&(i=!0);const s=this,l=s.params.direction;return t||(t=l==="horizontal"?"vertical":"horizontal"),t===l||t!=="horizontal"&&t!=="vertical"||(s.el.classList.remove(`${s.params.containerModifierClass}${l}`),s.el.classList.add(`${s.params.containerModifierClass}${t}`),s.emitContainerClasses(),s.params.direction=t,s.slides.forEach(d=>{t==="vertical"?d.style.width="":d.style.height=""}),s.emit("changeDirection"),i&&s.update()),s}changeLanguageDirection(t){const i=this;i.rtl&&t==="rtl"||!i.rtl&&t==="ltr"||(i.rtl=t==="rtl",i.rtlTranslate=i.params.direction==="horizontal"&&i.rtl,i.rtl?(i.el.classList.add(`${i.params.containerModifierClass}rtl`),i.el.dir="rtl"):(i.el.classList.remove(`${i.params.containerModifierClass}rtl`),i.el.dir="ltr"),i.update())}mount(t){const i=this;if(i.mounted)return!0;let s=t||i.params.el;if(typeof s=="string"&&(s=document.querySelector(s)),!s)return!1;s.swiper=i,s.parentNode&&s.parentNode.host&&s.parentNode.host.nodeName===i.params.swiperElementNodeName.toUpperCase()&&(i.isElement=!0);const l=()=>`.${(i.params.wrapperClass||"").trim().split(" ").join(".")}`;let u=s&&s.shadowRoot&&s.shadowRoot.querySelector?s.shadowRoot.querySelector(l()):Jo(s,l())[0];return!u&&i.params.createElements&&(u=Zd("div",i.params.wrapperClass),s.append(u),Jo(s,`.${i.params.slideClass}`).forEach(p=>{u.append(p)})),Object.assign(i,{el:s,wrapperEl:u,slidesEl:i.isElement&&!s.parentNode.host.slideSlots?s.parentNode.host:u,hostEl:i.isElement?s.parentNode.host:s,mounted:!0,rtl:s.dir.toLowerCase()==="rtl"||Dv(s,"direction")==="rtl",rtlTranslate:i.params.direction==="horizontal"&&(s.dir.toLowerCase()==="rtl"||Dv(s,"direction")==="rtl"),wrongRTL:Dv(u,"display")==="-webkit-box"}),!0}init(t){const i=this;if(i.initialized||i.mount(t)===!1)return i;i.emit("beforeInit"),i.params.breakpoints&&i.setBreakpoint(),i.addClasses(),i.updateSize(),i.updateSlides(),i.params.watchOverflow&&i.checkOverflow(),i.params.grabCursor&&i.enabled&&i.setGrabCursor(),i.params.loop&&i.virtual&&i.params.virtual.enabled?i.slideTo(i.params.initialSlide+i.virtual.slidesBefore,0,i.params.runCallbacksOnInit,!1,!0):i.slideTo(i.params.initialSlide,0,i.params.runCallbacksOnInit,!1,!0),i.params.loop&&i.loopCreate(),i.attachEvents();const l=[...i.el.querySelectorAll('[loading="lazy"]')];return i.isElement&&l.push(...i.hostEl.querySelectorAll('[loading="lazy"]')),l.forEach(d=>{d.complete?IM(i,d):d.addEventListener("load",u=>{IM(i,u.target)})}),RY(i),i.initialized=!0,RY(i),i.emit("init"),i.emit("afterInit"),i}destroy(t,i){t===void 0&&(t=!0),i===void 0&&(i=!0);const s=this,{params:l,el:d,wrapperEl:u,slides:p}=s;return typeof s.params>"u"||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),l.loop&&s.loopDestroy(),i&&(s.removeClasses(),d.removeAttribute("style"),u.removeAttribute("style"),p&&p.length&&p.forEach(m=>{m.classList.remove(l.slideVisibleClass,l.slideFullyVisibleClass,l.slideActiveClass,l.slideNextClass,l.slidePrevClass),m.removeAttribute("style"),m.removeAttribute("data-swiper-slide-index")})),s.emit("destroy"),Object.keys(s.eventsListeners).forEach(m=>{s.off(m)}),t!==!1&&(s.el.swiper=null,o$e(s)),s.destroyed=!0),null}static extendDefaults(t){Kd(TK,t)}static get extendedDefaults(){return TK}static get defaults(){return ffe}static installModule(t){Qc.prototype.__modules__||(Qc.prototype.__modules__=[]);const i=Qc.prototype.__modules__;typeof t=="function"&&i.indexOf(t)<0&&i.push(t)}static use(t){return Array.isArray(t)?(t.forEach(i=>Qc.installModule(i)),Qc):(Qc.installModule(t),Qc)}}Object.keys(CK).forEach(n=>{Object.keys(CK[n]).forEach(t=>{Qc.prototype[t]=CK[n][t]})});Qc.use([g$e,v$e]);const SKe=Object.freeze(Object.defineProperty({__proto__:null,Swiper:Qc,default:Qc},Symbol.toStringTag,{value:"Module"})),bKe=Sme(SKe);/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var pfe=Object.getOwnPropertySymbols,CKe=Object.prototype.hasOwnProperty,TKe=Object.prototype.propertyIsEnumerable;function RKe(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function xKe(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;var s=Object.getOwnPropertyNames(t).map(function(d){return t[d]});if(s.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(d){l[d]=d}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var AKe=xKe()?Object.assign:function(n,t){for(var i,s=RKe(n),l,d=1;d<arguments.length;d++){i=Object(arguments[d]);for(var u in i)CKe.call(i,u)&&(s[u]=i[u]);if(pfe){l=pfe(i);for(var p=0;p<l.length;p++)TKe.call(i,l[p])&&(s[l[p]]=i[l[p]])}}return s},Yd={};Object.defineProperty(Yd,"__esModule",{value:!0});Yd.setRef=Yd.isModuleAvailable=Yd.isReactElement=Yd.validateChildren=Yd.classNames=void 0;var NM=k;Yd.classNames=function(n){return typeof n=="string"?n.split(".").join(" ").trim():n instanceof HTMLElement?n.className:""};Yd.validateChildren=function(n){var t=!0;return Array.isArray(n)?NM.Children.forEach(n,function(i){NM.isValidElement(i)||(t=!1)}):t=NM.isValidElement(n),t};Yd.isReactElement=function(n){return NM.isValidElement(n)&&(typeof n.type=="string"||typeof n.type=="function"||typeof n.type=="object")};Yd.isModuleAvailable=function(n,t){for(var i=!1,s=0;s<n.length;s++)if(n[s].name===t){i=!0;break}return i};Yd.setRef=function(n,t){typeof n=="function"?n(t):n&&(n.current=t)};var fF={};Object.defineProperty(fF,"__esModule",{value:!0});fF.useForkRef=void 0;var IKe=k,mfe=Yd;fF.useForkRef=function(n,t){return IKe.useMemo(function(){return n==null&&t==null?null:function(i){mfe.setRef(n,i),mfe.setRef(t,i)}},[n,t])};var Q7=Ws&&Ws.__assign||function(){return Q7=Object.assign||function(n){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(n[l]=t[l])}return n},Q7.apply(this,arguments)},NKe=Ws&&Ws.__createBinding||(Object.create?function(n,t,i,s){s===void 0&&(s=i),Object.defineProperty(n,s,{enumerable:!0,get:function(){return t[i]}})}:function(n,t,i,s){s===void 0&&(s=i),n[s]=t[i]}),OKe=Ws&&Ws.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),PKe=Ws&&Ws.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var i in n)i!=="default"&&Object.hasOwnProperty.call(n,i)&&NKe(t,n,i);return OKe(t,n),t},Y_e=Ws&&Ws.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(wZ,"__esModule",{value:!0});var Ka=PKe(k),LKe=Y_e(bKe),DKe=Y_e(AKe),jg=Yd,kKe=fF,bZ=Ka.forwardRef(function(n,t){var i=n.activeSlideKey,s=n.ContainerEl,l=n.children,d=n.containerClass,u=n.navigation,p=n.noSwiping,m=n.pagination,y=n.parallax,_=n.parallaxEl,E=n.WrapperEl,C=n.wrapperClass,x=n.rebuildOnUpdate,N=n.renderScrollbar,O=n.renderPagination,D=n.renderPrevButton,P=n.renderNextButton,j=n.renderParallax,M=n.rtl,V=n.scrollbar,G=n.shouldSwiperUpdate,$=n.slideClass,ne=n.loop,Y=Ka.useRef(null),le=Ka.useRef(null),re=kKe.useForkRef(le,t),ee=Ka.useCallback(function(){if(!i)return null;var _e=0,me=ne?1:0;return Ka.Children.forEach(l,function(Ce){Ka.isValidElement(Ce)&&(Ce.key===i&&(_e=me),me+=1)}),_e},[i,l,ne]),de=Ka.useCallback(function(){Y.current!==null&&(Y.current.destroy(!0,!0),jg.setRef(Y,null))},[]),H=Ka.useCallback(function(){le.current&&Y.current===null&&jg.setRef(Y,new LKe.default(le.current,DKe.default({},n)))},[n]),ae=function(_e){if(!jg.isReactElement(_e))return null;var me=[$,_e.props.className];return p&&me.push("swiper-no-swiping"),Ka.cloneElement(_e,Q7(Q7({},_e.props),{className:me.join(" ").trim()}))};return Ka.useEffect(function(){return function(){return de()}},[de]),Ka.useEffect(function(){if(H(),Y.current!==null){x?(de(),H()):G&&Y.current.update();var _e=Y.current.slides.length;if(_e<=Y.current.activeIndex){var me=Math.max(_e-1,0);Y.current.slideTo(me)}var Ce=ee();Ce!==null&&Y.current.slideTo(Ce)}},[de,ee,x,G,H]),!l||!s||!E||!jg.validateChildren(l)?null:Ka.default.createElement(s,{className:d,dir:M&&"rtl",ref:re},y&&_&&j&&j(n),Ka.default.createElement(E,{className:C},Ka.Children.map(l,ae)),m&&m.el&&O&&O(n),V&&V.el&&N&&N(n),u&&u.nextEl&&P&&P(n),u&&u.prevEl&&D&&D(n))});bZ.defaultProps={containerClass:"swiper-container",wrapperClass:"swiper-wrapper",slideClass:"swiper-slide",ContainerEl:"div",WrapperEl:"div",renderScrollbar:function(n){var t=n.scrollbar;return t?Ka.default.createElement("div",{className:jg.classNames(t.el)}):null},renderPagination:function(n){var t=n.pagination;return t?Ka.default.createElement("div",{className:jg.classNames(t.el)}):null},renderPrevButton:function(n){var t=n.navigation;return t?Ka.default.createElement("div",{className:jg.classNames(t.prevEl)}):null},renderNextButton:function(n){var t=n.navigation;return t?Ka.default.createElement("div",{className:jg.classNames(t.nextEl)}):null},renderParallax:function(n){var t=n.parallaxEl;return t?Ka.default.createElement("div",{className:jg.classNames(t.el),"data-swiper-parallax":t.value}):null}};bZ.displayName="ReactIdSwiper";wZ.default=bZ;var MKe=Ws&&Ws.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(z_e,"__esModule",{value:!0});var jKe=MKe(wZ),CZ=z_e.default=jKe.default;function UKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;i({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});let d;const u=fc();t.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const p=u.createElement("div");function m(N,O){const D=t.params.virtual;if(D.cache&&t.virtual.cache[O])return t.virtual.cache[O];let P;return D.renderSlide?(P=D.renderSlide.call(t,N,O),typeof P=="string"&&(p.innerHTML=P,P=p.children[0])):t.isElement?P=Zd("swiper-slide"):P=Zd("div",t.params.slideClass),P.setAttribute("data-swiper-slide-index",O),D.renderSlide||(P.innerHTML=N),D.cache&&(t.virtual.cache[O]=P),P}function y(N){const{slidesPerView:O,slidesPerGroup:D,centeredSlides:P,loop:j}=t.params,{addSlidesBefore:M,addSlidesAfter:V}=t.params.virtual,{from:G,to:$,slides:ne,slidesGrid:Y,offset:le}=t.virtual;t.params.cssMode||t.updateActiveIndex();const re=t.activeIndex||0;let ee;t.rtlTranslate?ee="right":ee=t.isHorizontal()?"left":"top";let de,H;P?(de=Math.floor(O/2)+D+V,H=Math.floor(O/2)+D+M):(de=O+(D-1)+V,H=(j?O:D)+M);let ae=re-H,_e=re+de;j||(ae=Math.max(ae,0),_e=Math.min(_e,ne.length-1));let me=(t.slidesGrid[ae]||0)-(t.slidesGrid[0]||0);j&&re>=H?(ae-=H,P||(me+=t.slidesGrid[0])):j&&re<H&&(ae=-H,P&&(me+=t.slidesGrid[0])),Object.assign(t.virtual,{from:ae,to:_e,offset:me,slidesGrid:t.slidesGrid,slidesBefore:H,slidesAfter:de});function Ce(){t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),l("virtualUpdate")}if(G===ae&&$===_e&&!N){t.slidesGrid!==Y&&me!==le&&t.slides.forEach(Ve=>{Ve.style[ee]=`${me-Math.abs(t.cssOverflowAdjustment())}px`}),t.updateProgress(),l("virtualUpdate");return}if(t.params.virtual.renderExternal){t.params.virtual.renderExternal.call(t,{offset:me,from:ae,to:_e,slides:function(){const Re=[];for(let Be=ae;Be<=_e;Be+=1)Re.push(ne[Be]);return Re}()}),t.params.virtual.renderExternalUpdate?Ce():l("virtualUpdate");return}const he=[],pe=[],Oe=Ve=>{let Re=Ve;return Ve<0?Re=ne.length+Ve:Re>=ne.length&&(Re=Re-ne.length),Re};if(N)t.slides.filter(Ve=>Ve.matches(`.${t.params.slideClass}, swiper-slide`)).forEach(Ve=>{Ve.remove()});else for(let Ve=G;Ve<=$;Ve+=1)if(Ve<ae||Ve>_e){const Re=Oe(Ve);t.slides.filter(Be=>Be.matches(`.${t.params.slideClass}[data-swiper-slide-index="${Re}"], swiper-slide[data-swiper-slide-index="${Re}"]`)).forEach(Be=>{Be.remove()})}const Fe=j?-ne.length:0,Ue=j?ne.length*2:ne.length;for(let Ve=Fe;Ve<Ue;Ve+=1)if(Ve>=ae&&Ve<=_e){const Re=Oe(Ve);typeof $>"u"||N?pe.push(Re):(Ve>$&&pe.push(Re),Ve<G&&he.push(Re))}if(pe.forEach(Ve=>{t.slidesEl.append(m(ne[Ve],Ve))}),j)for(let Ve=he.length-1;Ve>=0;Ve-=1){const Re=he[Ve];t.slidesEl.prepend(m(ne[Re],Re))}else he.sort((Ve,Re)=>Re-Ve),he.forEach(Ve=>{t.slidesEl.prepend(m(ne[Ve],Ve))});Jo(t.slidesEl,".swiper-slide, swiper-slide").forEach(Ve=>{Ve.style[ee]=`${me-Math.abs(t.cssOverflowAdjustment())}px`}),Ce()}function _(N){if(typeof N=="object"&&"length"in N)for(let O=0;O<N.length;O+=1)N[O]&&t.virtual.slides.push(N[O]);else t.virtual.slides.push(N);y(!0)}function E(N){const O=t.activeIndex;let D=O+1,P=1;if(Array.isArray(N)){for(let j=0;j<N.length;j+=1)N[j]&&t.virtual.slides.unshift(N[j]);D=O+N.length,P=N.length}else t.virtual.slides.unshift(N);if(t.params.virtual.cache){const j=t.virtual.cache,M={};Object.keys(j).forEach(V=>{const G=j[V],$=G.getAttribute("data-swiper-slide-index");$&&G.setAttribute("data-swiper-slide-index",parseInt($,10)+P),M[parseInt(V,10)+P]=G}),t.virtual.cache=M}y(!0),t.slideTo(D,0)}function C(N){if(typeof N>"u"||N===null)return;let O=t.activeIndex;if(Array.isArray(N))for(let D=N.length-1;D>=0;D-=1)t.params.virtual.cache&&(delete t.virtual.cache[N[D]],Object.keys(t.virtual.cache).forEach(P=>{P>N&&(t.virtual.cache[P-1]=t.virtual.cache[P],t.virtual.cache[P-1].setAttribute("data-swiper-slide-index",P-1),delete t.virtual.cache[P])})),t.virtual.slides.splice(N[D],1),N[D]<O&&(O-=1),O=Math.max(O,0);else t.params.virtual.cache&&(delete t.virtual.cache[N],Object.keys(t.virtual.cache).forEach(D=>{D>N&&(t.virtual.cache[D-1]=t.virtual.cache[D],t.virtual.cache[D-1].setAttribute("data-swiper-slide-index",D-1),delete t.virtual.cache[D])})),t.virtual.slides.splice(N,1),N<O&&(O-=1),O=Math.max(O,0);y(!0),t.slideTo(O,0)}function x(){t.virtual.slides=[],t.params.virtual.cache&&(t.virtual.cache={}),y(!0),t.slideTo(0,0)}s("beforeInit",()=>{if(!t.params.virtual.enabled)return;let N;if(typeof t.passedParams.virtual.slides>"u"){const O=[...t.slidesEl.children].filter(D=>D.matches(`.${t.params.slideClass}, swiper-slide`));O&&O.length&&(t.virtual.slides=[...O],N=!0,O.forEach((D,P)=>{D.setAttribute("data-swiper-slide-index",P),t.virtual.cache[P]=D,D.remove()}))}N||(t.virtual.slides=t.params.virtual.slides),t.classNames.push(`${t.params.containerModifierClass}virtual`),t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0,y()}),s("setTranslate",()=>{t.params.virtual.enabled&&(t.params.cssMode&&!t._immediateVirtual?(clearTimeout(d),d=setTimeout(()=>{y()},100)):y())}),s("init update resize",()=>{t.params.virtual.enabled&&t.params.cssMode&&i4(t.wrapperEl,"--swiper-virtual-size",`${t.virtualSize}px`)}),Object.assign(t.virtual,{appendSlide:_,prependSlide:E,removeSlide:C,removeAllSlides:x,update:y})}function FKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=fc(),u=sa();t.keyboard={enabled:!1},i({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function p(_){if(!t.enabled)return;const{rtlTranslate:E}=t;let C=_;C.originalEvent&&(C=C.originalEvent);const x=C.keyCode||C.charCode,N=t.params.keyboard.pageUpDown,O=N&&x===33,D=N&&x===34,P=x===37,j=x===39,M=x===38,V=x===40;if(!t.allowSlideNext&&(t.isHorizontal()&&j||t.isVertical()&&V||D)||!t.allowSlidePrev&&(t.isHorizontal()&&P||t.isVertical()&&M||O))return!1;if(!(C.shiftKey||C.altKey||C.ctrlKey||C.metaKey)&&!(d.activeElement&&d.activeElement.nodeName&&(d.activeElement.nodeName.toLowerCase()==="input"||d.activeElement.nodeName.toLowerCase()==="textarea"))){if(t.params.keyboard.onlyInViewport&&(O||D||P||j||M||V)){let G=!1;if(j2(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&j2(t.el,`.${t.params.slideActiveClass}`).length===0)return;const $=t.el,ne=$.clientWidth,Y=$.clientHeight,le=u.innerWidth,re=u.innerHeight,ee=J7($);E&&(ee.left-=$.scrollLeft);const de=[[ee.left,ee.top],[ee.left+ne,ee.top],[ee.left,ee.top+Y],[ee.left+ne,ee.top+Y]];for(let H=0;H<de.length;H+=1){const ae=de[H];if(ae[0]>=0&&ae[0]<=le&&ae[1]>=0&&ae[1]<=re){if(ae[0]===0&&ae[1]===0)continue;G=!0}}if(!G)return}t.isHorizontal()?((O||D||P||j)&&(C.preventDefault?C.preventDefault():C.returnValue=!1),((D||j)&&!E||(O||P)&&E)&&t.slideNext(),((O||P)&&!E||(D||j)&&E)&&t.slidePrev()):((O||D||M||V)&&(C.preventDefault?C.preventDefault():C.returnValue=!1),(D||V)&&t.slideNext(),(O||M)&&t.slidePrev()),l("keyPress",x)}}function m(){t.keyboard.enabled||(d.addEventListener("keydown",p),t.keyboard.enabled=!0)}function y(){t.keyboard.enabled&&(d.removeEventListener("keydown",p),t.keyboard.enabled=!1)}s("init",()=>{t.params.keyboard.enabled&&m()}),s("destroy",()=>{t.keyboard.enabled&&y()}),Object.assign(t.keyboard,{enable:m,disable:y})}function BKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=sa();i({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),t.mousewheel={enabled:!1};let u,p=lh(),m;const y=[];function _(M){let ne=0,Y=0,le=0,re=0;return"detail"in M&&(Y=M.detail),"wheelDelta"in M&&(Y=-M.wheelDelta/120),"wheelDeltaY"in M&&(Y=-M.wheelDeltaY/120),"wheelDeltaX"in M&&(ne=-M.wheelDeltaX/120),"axis"in M&&M.axis===M.HORIZONTAL_AXIS&&(ne=Y,Y=0),le=ne*10,re=Y*10,"deltaY"in M&&(re=M.deltaY),"deltaX"in M&&(le=M.deltaX),M.shiftKey&&!le&&(le=re,re=0),(le||re)&&M.deltaMode&&(M.deltaMode===1?(le*=40,re*=40):(le*=800,re*=800)),le&&!ne&&(ne=le<1?-1:1),re&&!Y&&(Y=re<1?-1:1),{spinX:ne,spinY:Y,pixelX:le,pixelY:re}}function E(){t.enabled&&(t.mouseEntered=!0)}function C(){t.enabled&&(t.mouseEntered=!1)}function x(M){return t.params.mousewheel.thresholdDelta&&M.delta<t.params.mousewheel.thresholdDelta||t.params.mousewheel.thresholdTime&&lh()-p<t.params.mousewheel.thresholdTime?!1:M.delta>=6&&lh()-p<60?!0:(M.direction<0?(!t.isEnd||t.params.loop)&&!t.animating&&(t.slideNext(),l("scroll",M.raw)):(!t.isBeginning||t.params.loop)&&!t.animating&&(t.slidePrev(),l("scroll",M.raw)),p=new d.Date().getTime(),!1)}function N(M){const V=t.params.mousewheel;if(M.direction<0){if(t.isEnd&&!t.params.loop&&V.releaseOnEdges)return!0}else if(t.isBeginning&&!t.params.loop&&V.releaseOnEdges)return!0;return!1}function O(M){let V=M,G=!0;if(!t.enabled||M.target.closest(`.${t.params.mousewheel.noMousewheelClass}`))return;const $=t.params.mousewheel;t.params.cssMode&&V.preventDefault();let ne=t.el;t.params.mousewheel.eventsTarget!=="container"&&(ne=document.querySelector(t.params.mousewheel.eventsTarget));const Y=ne&&ne.contains(V.target);if(!t.mouseEntered&&!Y&&!$.releaseOnEdges)return!0;V.originalEvent&&(V=V.originalEvent);let le=0;const re=t.rtlTranslate?-1:1,ee=_(V);if($.forceToAxis)if(t.isHorizontal())if(Math.abs(ee.pixelX)>Math.abs(ee.pixelY))le=-ee.pixelX*re;else return!0;else if(Math.abs(ee.pixelY)>Math.abs(ee.pixelX))le=-ee.pixelY;else return!0;else le=Math.abs(ee.pixelX)>Math.abs(ee.pixelY)?-ee.pixelX*re:-ee.pixelY;if(le===0)return!0;$.invert&&(le=-le);let de=t.getTranslate()+le*$.sensitivity;if(de>=t.minTranslate()&&(de=t.minTranslate()),de<=t.maxTranslate()&&(de=t.maxTranslate()),G=t.params.loop?!0:!(de===t.minTranslate()||de===t.maxTranslate()),G&&t.params.nested&&V.stopPropagation(),!t.params.freeMode||!t.params.freeMode.enabled){const H={time:lh(),delta:Math.abs(le),direction:Math.sign(le),raw:M};y.length>=2&&y.shift();const ae=y.length?y[y.length-1]:void 0;if(y.push(H),ae?(H.direction!==ae.direction||H.delta>ae.delta||H.time>ae.time+150)&&x(H):x(H),N(H))return!0}else{const H={time:lh(),delta:Math.abs(le),direction:Math.sign(le)},ae=m&&H.time<m.time+500&&H.delta<=m.delta&&H.direction===m.direction;if(!ae){m=void 0;let _e=t.getTranslate()+le*$.sensitivity;const me=t.isBeginning,Ce=t.isEnd;if(_e>=t.minTranslate()&&(_e=t.minTranslate()),_e<=t.maxTranslate()&&(_e=t.maxTranslate()),t.setTransition(0),t.setTranslate(_e),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses(),(!me&&t.isBeginning||!Ce&&t.isEnd)&&t.updateSlidesClasses(),t.params.loop&&t.loopFix({direction:H.direction<0?"next":"prev",byMousewheel:!0}),t.params.freeMode.sticky){clearTimeout(u),u=void 0,y.length>=15&&y.shift();const he=y.length?y[y.length-1]:void 0,pe=y[0];if(y.push(H),he&&(H.delta>he.delta||H.direction!==he.direction))y.splice(0);else if(y.length>=15&&H.time-pe.time<500&&pe.delta-H.delta>=1&&H.delta<=6){const Oe=le>0?.8:.2;m=H,y.splice(0),u=K2(()=>{t.slideToClosest(t.params.speed,!0,void 0,Oe)},0)}u||(u=K2(()=>{m=H,y.splice(0),t.slideToClosest(t.params.speed,!0,void 0,.5)},500))}if(ae||l("scroll",V),t.params.autoplay&&t.params.autoplayDisableOnInteraction&&t.autoplay.stop(),$.releaseOnEdges&&(_e===t.minTranslate()||_e===t.maxTranslate()))return!0}}return V.preventDefault?V.preventDefault():V.returnValue=!1,!1}function D(M){let V=t.el;t.params.mousewheel.eventsTarget!=="container"&&(V=document.querySelector(t.params.mousewheel.eventsTarget)),V[M]("mouseenter",E),V[M]("mouseleave",C),V[M]("wheel",O)}function P(){return t.params.cssMode?(t.wrapperEl.removeEventListener("wheel",O),!0):t.mousewheel.enabled?!1:(D("addEventListener"),t.mousewheel.enabled=!0,!0)}function j(){return t.params.cssMode?(t.wrapperEl.addEventListener(event,O),!0):t.mousewheel.enabled?(D("removeEventListener"),t.mousewheel.enabled=!1,!0):!1}s("init",()=>{!t.params.mousewheel.enabled&&t.params.cssMode&&j(),t.params.mousewheel.enabled&&P()}),s("destroy",()=>{t.params.cssMode&&P(),t.mousewheel.enabled&&j()}),Object.assign(t.mousewheel,{enable:P,disable:j})}function TZ(n,t,i,s){return n.params.createElements&&Object.keys(s).forEach(l=>{if(!i[l]&&i.auto===!0){let d=Jo(n.el,`.${s[l]}`)[0];d||(d=Zd("div",s[l]),d.className=s[l],n.el.append(d)),i[l]=d,t[l]=d}}),i}function VKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;i({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};function d(N){let O;return N&&typeof N=="string"&&t.isElement&&(O=t.el.querySelector(N),O)?O:(N&&(typeof N=="string"&&(O=[...document.querySelectorAll(N)]),t.params.uniqueNavElements&&typeof N=="string"&&O.length>1&&t.el.querySelectorAll(N).length===1&&(O=t.el.querySelector(N))),N&&!O?N:O)}function u(N,O){const D=t.params.navigation;N=or(N),N.forEach(P=>{P&&(P.classList[O?"add":"remove"](...D.disabledClass.split(" ")),P.tagName==="BUTTON"&&(P.disabled=O),t.params.watchOverflow&&t.enabled&&P.classList[t.isLocked?"add":"remove"](D.lockClass))})}function p(){const{nextEl:N,prevEl:O}=t.navigation;if(t.params.loop){u(O,!1),u(N,!1);return}u(O,t.isBeginning&&!t.params.rewind),u(N,t.isEnd&&!t.params.rewind)}function m(N){N.preventDefault(),!(t.isBeginning&&!t.params.loop&&!t.params.rewind)&&(t.slidePrev(),l("navigationPrev"))}function y(N){N.preventDefault(),!(t.isEnd&&!t.params.loop&&!t.params.rewind)&&(t.slideNext(),l("navigationNext"))}function _(){const N=t.params.navigation;if(t.params.navigation=TZ(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(N.nextEl||N.prevEl))return;let O=d(N.nextEl),D=d(N.prevEl);Object.assign(t.navigation,{nextEl:O,prevEl:D}),O=or(O),D=or(D);const P=(j,M)=>{j&&j.addEventListener("click",M==="next"?y:m),!t.enabled&&j&&j.classList.add(...N.lockClass.split(" "))};O.forEach(j=>P(j,"next")),D.forEach(j=>P(j,"prev"))}function E(){let{nextEl:N,prevEl:O}=t.navigation;N=or(N),O=or(O);const D=(P,j)=>{P.removeEventListener("click",j==="next"?y:m),P.classList.remove(...t.params.navigation.disabledClass.split(" "))};N.forEach(P=>D(P,"next")),O.forEach(P=>D(P,"prev"))}s("init",()=>{t.params.navigation.enabled===!1?x():(_(),p())}),s("toEdge fromEdge lock unlock",()=>{p()}),s("destroy",()=>{E()}),s("enable disable",()=>{let{nextEl:N,prevEl:O}=t.navigation;if(N=or(N),O=or(O),t.enabled){p();return}[...N,...O].filter(D=>!!D).forEach(D=>D.classList.add(t.params.navigation.lockClass))}),s("click",(N,O)=>{let{nextEl:D,prevEl:P}=t.navigation;D=or(D),P=or(P);const j=O.target;if(t.params.navigation.hideOnClick&&!P.includes(j)&&!D.includes(j)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===j||t.pagination.el.contains(j)))return;let M;D.length?M=D[0].classList.contains(t.params.navigation.hiddenClass):P.length&&(M=P[0].classList.contains(t.params.navigation.hiddenClass)),l(M===!0?"navigationShow":"navigationHide"),[...D,...P].filter(V=>!!V).forEach(V=>V.classList.toggle(t.params.navigation.hiddenClass))}});const C=()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),_(),p()},x=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),E()};Object.assign(t.navigation,{enable:C,disable:x,update:p,init:_,destroy:E})}function Ug(n){return n===void 0&&(n=""),`.${n.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function zKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d="swiper-pagination";i({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:P=>P,formatFractionTotal:P=>P,bulletClass:`${d}-bullet`,bulletActiveClass:`${d}-bullet-active`,modifierClass:`${d}-`,currentClass:`${d}-current`,totalClass:`${d}-total`,hiddenClass:`${d}-hidden`,progressbarFillClass:`${d}-progressbar-fill`,progressbarOppositeClass:`${d}-progressbar-opposite`,clickableClass:`${d}-clickable`,lockClass:`${d}-lock`,horizontalClass:`${d}-horizontal`,verticalClass:`${d}-vertical`,paginationDisabledClass:`${d}-disabled`}}),t.pagination={el:null,bullets:[]};let u,p=0;function m(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&t.pagination.el.length===0}function y(P,j){const{bulletActiveClass:M}=t.params.pagination;P&&(P=P[`${j==="prev"?"previous":"next"}ElementSibling`],P&&(P.classList.add(`${M}-${j}`),P=P[`${j==="prev"?"previous":"next"}ElementSibling`],P&&P.classList.add(`${M}-${j}-${j}`)))}function _(P){const j=P.target.closest(Ug(t.params.pagination.bulletClass));if(!j)return;P.preventDefault();const M=_N(j)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===M)return;t.slideToLoop(M)}else t.slideTo(M)}function E(){const P=t.rtl,j=t.params.pagination;if(m())return;let M=t.pagination.el;M=or(M);let V,G;const $=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,ne=t.params.loop?Math.ceil($/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(G=t.previousRealIndex||0,V=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):typeof t.snapIndex<"u"?(V=t.snapIndex,G=t.previousSnapIndex):(G=t.previousIndex||0,V=t.activeIndex||0),j.type==="bullets"&&t.pagination.bullets&&t.pagination.bullets.length>0){const Y=t.pagination.bullets;let le,re,ee;if(j.dynamicBullets&&(u=TY(Y[0],t.isHorizontal()?"width":"height",!0),M.forEach(de=>{de.style[t.isHorizontal()?"width":"height"]=`${u*(j.dynamicMainBullets+4)}px`}),j.dynamicMainBullets>1&&G!==void 0&&(p+=V-(G||0),p>j.dynamicMainBullets-1?p=j.dynamicMainBullets-1:p<0&&(p=0)),le=Math.max(V-p,0),re=le+(Math.min(Y.length,j.dynamicMainBullets)-1),ee=(re+le)/2),Y.forEach(de=>{const H=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(ae=>`${j.bulletActiveClass}${ae}`)].map(ae=>typeof ae=="string"&&ae.includes(" ")?ae.split(" "):ae).flat();de.classList.remove(...H)}),M.length>1)Y.forEach(de=>{const H=_N(de);H===V?de.classList.add(...j.bulletActiveClass.split(" ")):t.isElement&&de.setAttribute("part","bullet"),j.dynamicBullets&&(H>=le&&H<=re&&de.classList.add(...`${j.bulletActiveClass}-main`.split(" ")),H===le&&y(de,"prev"),H===re&&y(de,"next"))});else{const de=Y[V];if(de&&de.classList.add(...j.bulletActiveClass.split(" ")),t.isElement&&Y.forEach((H,ae)=>{H.setAttribute("part",ae===V?"bullet-active":"bullet")}),j.dynamicBullets){const H=Y[le],ae=Y[re];for(let _e=le;_e<=re;_e+=1)Y[_e]&&Y[_e].classList.add(...`${j.bulletActiveClass}-main`.split(" "));y(H,"prev"),y(ae,"next")}}if(j.dynamicBullets){const de=Math.min(Y.length,j.dynamicMainBullets+4),H=(u*de-u)/2-ee*u,ae=P?"right":"left";Y.forEach(_e=>{_e.style[t.isHorizontal()?ae:"top"]=`${H}px`})}}M.forEach((Y,le)=>{if(j.type==="fraction"&&(Y.querySelectorAll(Ug(j.currentClass)).forEach(re=>{re.textContent=j.formatFractionCurrent(V+1)}),Y.querySelectorAll(Ug(j.totalClass)).forEach(re=>{re.textContent=j.formatFractionTotal(ne)})),j.type==="progressbar"){let re;j.progressbarOpposite?re=t.isHorizontal()?"vertical":"horizontal":re=t.isHorizontal()?"horizontal":"vertical";const ee=(V+1)/ne;let de=1,H=1;re==="horizontal"?de=ee:H=ee,Y.querySelectorAll(Ug(j.progressbarFillClass)).forEach(ae=>{ae.style.transform=`translate3d(0,0,0) scaleX(${de}) scaleY(${H})`,ae.style.transitionDuration=`${t.params.speed}ms`})}j.type==="custom"&&j.renderCustom?(Y.innerHTML=j.renderCustom(t,V+1,ne),le===0&&l("paginationRender",Y)):(le===0&&l("paginationRender",Y),l("paginationUpdate",Y)),t.params.watchOverflow&&t.enabled&&Y.classList[t.isLocked?"add":"remove"](j.lockClass)})}function C(){const P=t.params.pagination;if(m())return;const j=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.grid&&t.params.grid.rows>1?t.slides.length/Math.ceil(t.params.grid.rows):t.slides.length;let M=t.pagination.el;M=or(M);let V="";if(P.type==="bullets"){let G=t.params.loop?Math.ceil(j/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&G>j&&(G=j);for(let $=0;$<G;$+=1)P.renderBullet?V+=P.renderBullet.call(t,$,P.bulletClass):V+=`<${P.bulletElement} ${t.isElement?'part="bullet"':""} class="${P.bulletClass}"></${P.bulletElement}>`}P.type==="fraction"&&(P.renderFraction?V=P.renderFraction.call(t,P.currentClass,P.totalClass):V=`<span class="${P.currentClass}"></span> / <span class="${P.totalClass}"></span>`),P.type==="progressbar"&&(P.renderProgressbar?V=P.renderProgressbar.call(t,P.progressbarFillClass):V=`<span class="${P.progressbarFillClass}"></span>`),t.pagination.bullets=[],M.forEach(G=>{P.type!=="custom"&&(G.innerHTML=V||""),P.type==="bullets"&&t.pagination.bullets.push(...G.querySelectorAll(Ug(P.bulletClass)))}),P.type!=="custom"&&l("paginationRender",M[0])}function x(){t.params.pagination=TZ(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const P=t.params.pagination;if(!P.el)return;let j;typeof P.el=="string"&&t.isElement&&(j=t.el.querySelector(P.el)),!j&&typeof P.el=="string"&&(j=[...document.querySelectorAll(P.el)]),j||(j=P.el),!(!j||j.length===0)&&(t.params.uniqueNavElements&&typeof P.el=="string"&&Array.isArray(j)&&j.length>1&&(j=[...t.el.querySelectorAll(P.el)],j.length>1&&(j=j.filter(M=>j2(M,".swiper")[0]===t.el)[0])),Array.isArray(j)&&j.length===1&&(j=j[0]),Object.assign(t.pagination,{el:j}),j=or(j),j.forEach(M=>{P.type==="bullets"&&P.clickable&&M.classList.add(...(P.clickableClass||"").split(" ")),M.classList.add(P.modifierClass+P.type),M.classList.add(t.isHorizontal()?P.horizontalClass:P.verticalClass),P.type==="bullets"&&P.dynamicBullets&&(M.classList.add(`${P.modifierClass}${P.type}-dynamic`),p=0,P.dynamicMainBullets<1&&(P.dynamicMainBullets=1)),P.type==="progressbar"&&P.progressbarOpposite&&M.classList.add(P.progressbarOppositeClass),P.clickable&&M.addEventListener("click",_),t.enabled||M.classList.add(P.lockClass)}))}function N(){const P=t.params.pagination;if(m())return;let j=t.pagination.el;j&&(j=or(j),j.forEach(M=>{M.classList.remove(P.hiddenClass),M.classList.remove(P.modifierClass+P.type),M.classList.remove(t.isHorizontal()?P.horizontalClass:P.verticalClass),P.clickable&&(M.classList.remove(...(P.clickableClass||"").split(" ")),M.removeEventListener("click",_))})),t.pagination.bullets&&t.pagination.bullets.forEach(M=>M.classList.remove(...P.bulletActiveClass.split(" ")))}s("changeDirection",()=>{if(!t.pagination||!t.pagination.el)return;const P=t.params.pagination;let{el:j}=t.pagination;j=or(j),j.forEach(M=>{M.classList.remove(P.horizontalClass,P.verticalClass),M.classList.add(t.isHorizontal()?P.horizontalClass:P.verticalClass)})}),s("init",()=>{t.params.pagination.enabled===!1?D():(x(),C(),E())}),s("activeIndexChange",()=>{typeof t.snapIndex>"u"&&E()}),s("snapIndexChange",()=>{E()}),s("snapGridLengthChange",()=>{C(),E()}),s("destroy",()=>{N()}),s("enable disable",()=>{let{el:P}=t.pagination;P&&(P=or(P),P.forEach(j=>j.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass)))}),s("lock unlock",()=>{E()}),s("click",(P,j)=>{const M=j.target,V=or(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&V&&V.length>0&&!M.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&M===t.navigation.nextEl||t.navigation.prevEl&&M===t.navigation.prevEl))return;const G=V[0].classList.contains(t.params.pagination.hiddenClass);l(G===!0?"paginationShow":"paginationHide"),V.forEach($=>$.classList.toggle(t.params.pagination.hiddenClass))}});const O=()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:P}=t.pagination;P&&(P=or(P),P.forEach(j=>j.classList.remove(t.params.pagination.paginationDisabledClass))),x(),C(),E()},D=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:P}=t.pagination;P&&(P=or(P),P.forEach(j=>j.classList.add(t.params.pagination.paginationDisabledClass))),N()};Object.assign(t.pagination,{enable:O,disable:D,render:C,update:E,init:x,destroy:N})}function HKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=fc();let u=!1,p=null,m=null,y,_,E,C;i({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),t.scrollbar={el:null,dragEl:null};function x(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:de,rtlTranslate:H}=t,{dragEl:ae,el:_e}=de,me=t.params.scrollbar,Ce=t.params.loop?t.progressLoop:t.progress;let he=_,pe=(E-_)*Ce;H?(pe=-pe,pe>0?(he=_-pe,pe=0):-pe+_>E&&(he=E+pe)):pe<0?(he=_+pe,pe=0):pe+_>E&&(he=E-pe),t.isHorizontal()?(ae.style.transform=`translate3d(${pe}px, 0, 0)`,ae.style.width=`${he}px`):(ae.style.transform=`translate3d(0px, ${pe}px, 0)`,ae.style.height=`${he}px`),me.hide&&(clearTimeout(p),_e.style.opacity=1,p=setTimeout(()=>{_e.style.opacity=0,_e.style.transitionDuration="400ms"},1e3))}function N(de){!t.params.scrollbar.el||!t.scrollbar.el||(t.scrollbar.dragEl.style.transitionDuration=`${de}ms`)}function O(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:de}=t,{dragEl:H,el:ae}=de;H.style.width="",H.style.height="",E=t.isHorizontal()?ae.offsetWidth:ae.offsetHeight,C=t.size/(t.virtualSize+t.params.slidesOffsetBefore-(t.params.centeredSlides?t.snapGrid[0]:0)),t.params.scrollbar.dragSize==="auto"?_=E*C:_=parseInt(t.params.scrollbar.dragSize,10),t.isHorizontal()?H.style.width=`${_}px`:H.style.height=`${_}px`,C>=1?ae.style.display="none":ae.style.display="",t.params.scrollbar.hide&&(ae.style.opacity=0),t.params.watchOverflow&&t.enabled&&de.el.classList[t.isLocked?"add":"remove"](t.params.scrollbar.lockClass)}function D(de){return t.isHorizontal()?de.clientX:de.clientY}function P(de){const{scrollbar:H,rtlTranslate:ae}=t,{el:_e}=H;let me;me=(D(de)-J7(_e)[t.isHorizontal()?"left":"top"]-(y!==null?y:_/2))/(E-_),me=Math.max(Math.min(me,1),0),ae&&(me=1-me);const Ce=t.minTranslate()+(t.maxTranslate()-t.minTranslate())*me;t.updateProgress(Ce),t.setTranslate(Ce),t.updateActiveIndex(),t.updateSlidesClasses()}function j(de){const H=t.params.scrollbar,{scrollbar:ae,wrapperEl:_e}=t,{el:me,dragEl:Ce}=ae;u=!0,y=de.target===Ce?D(de)-de.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,de.preventDefault(),de.stopPropagation(),_e.style.transitionDuration="100ms",Ce.style.transitionDuration="100ms",P(de),clearTimeout(m),me.style.transitionDuration="0ms",H.hide&&(me.style.opacity=1),t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="none"),l("scrollbarDragStart",de)}function M(de){const{scrollbar:H,wrapperEl:ae}=t,{el:_e,dragEl:me}=H;u&&(de.preventDefault?de.preventDefault():de.returnValue=!1,P(de),ae.style.transitionDuration="0ms",_e.style.transitionDuration="0ms",me.style.transitionDuration="0ms",l("scrollbarDragMove",de))}function V(de){const H=t.params.scrollbar,{scrollbar:ae,wrapperEl:_e}=t,{el:me}=ae;u&&(u=!1,t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="",_e.style.transitionDuration=""),H.hide&&(clearTimeout(m),m=K2(()=>{me.style.opacity=0,me.style.transitionDuration="400ms"},1e3)),l("scrollbarDragEnd",de),H.snapOnRelease&&t.slideToClosest())}function G(de){const{scrollbar:H,params:ae}=t,_e=H.el;if(!_e)return;const me=_e,Ce=ae.passiveListeners?{passive:!1,capture:!1}:!1,he=ae.passiveListeners?{passive:!0,capture:!1}:!1;if(!me)return;const pe=de==="on"?"addEventListener":"removeEventListener";me[pe]("pointerdown",j,Ce),d[pe]("pointermove",M,Ce),d[pe]("pointerup",V,he)}function $(){!t.params.scrollbar.el||!t.scrollbar.el||G("on")}function ne(){!t.params.scrollbar.el||!t.scrollbar.el||G("off")}function Y(){const{scrollbar:de,el:H}=t;t.params.scrollbar=TZ(t,t.originalParams.scrollbar,t.params.scrollbar,{el:"swiper-scrollbar"});const ae=t.params.scrollbar;if(!ae.el)return;let _e;if(typeof ae.el=="string"&&t.isElement&&(_e=t.el.querySelector(ae.el)),!_e&&typeof ae.el=="string"){if(_e=d.querySelectorAll(ae.el),!_e.length)return}else _e||(_e=ae.el);t.params.uniqueNavElements&&typeof ae.el=="string"&&_e.length>1&&H.querySelectorAll(ae.el).length===1&&(_e=H.querySelector(ae.el)),_e.length>0&&(_e=_e[0]),_e.classList.add(t.isHorizontal()?ae.horizontalClass:ae.verticalClass);let me;_e&&(me=_e.querySelector(Ug(t.params.scrollbar.dragClass)),me||(me=Zd("div",t.params.scrollbar.dragClass),_e.append(me))),Object.assign(de,{el:_e,dragEl:me}),ae.draggable&&$(),_e&&_e.classList[t.enabled?"remove":"add"](...p1(t.params.scrollbar.lockClass))}function le(){const de=t.params.scrollbar,H=t.scrollbar.el;H&&H.classList.remove(...p1(t.isHorizontal()?de.horizontalClass:de.verticalClass)),ne()}s("changeDirection",()=>{if(!t.scrollbar||!t.scrollbar.el)return;const de=t.params.scrollbar;let{el:H}=t.scrollbar;H=or(H),H.forEach(ae=>{ae.classList.remove(de.horizontalClass,de.verticalClass),ae.classList.add(t.isHorizontal()?de.horizontalClass:de.verticalClass)})}),s("init",()=>{t.params.scrollbar.enabled===!1?ee():(Y(),O(),x())}),s("update resize observerUpdate lock unlock changeDirection",()=>{O()}),s("setTranslate",()=>{x()}),s("setTransition",(de,H)=>{N(H)}),s("enable disable",()=>{const{el:de}=t.scrollbar;de&&de.classList[t.enabled?"remove":"add"](...p1(t.params.scrollbar.lockClass))}),s("destroy",()=>{le()});const re=()=>{t.el.classList.remove(...p1(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.remove(...p1(t.params.scrollbar.scrollbarDisabledClass)),Y(),O(),x()},ee=()=>{t.el.classList.add(...p1(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.add(...p1(t.params.scrollbar.scrollbarDisabledClass)),le()};Object.assign(t.scrollbar,{enable:re,disable:ee,updateSize:O,setTranslate:x,init:Y,destroy:le})}function GKe(n){let{swiper:t,extendParams:i,on:s}=n;i({parallax:{enabled:!1}});const l="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",d=(m,y)=>{const{rtl:_}=t,E=_?-1:1,C=m.getAttribute("data-swiper-parallax")||"0";let x=m.getAttribute("data-swiper-parallax-x"),N=m.getAttribute("data-swiper-parallax-y");const O=m.getAttribute("data-swiper-parallax-scale"),D=m.getAttribute("data-swiper-parallax-opacity"),P=m.getAttribute("data-swiper-parallax-rotate");if(x||N?(x=x||"0",N=N||"0"):t.isHorizontal()?(x=C,N="0"):(N=C,x="0"),x.indexOf("%")>=0?x=`${parseInt(x,10)*y*E}%`:x=`${x*y*E}px`,N.indexOf("%")>=0?N=`${parseInt(N,10)*y}%`:N=`${N*y}px`,typeof D<"u"&&D!==null){const M=D-(D-1)*(1-Math.abs(y));m.style.opacity=M}let j=`translate3d(${x}, ${N}, 0px)`;if(typeof O<"u"&&O!==null){const M=O-(O-1)*(1-Math.abs(y));j+=` scale(${M})`}if(P&&typeof P<"u"&&P!==null){const M=P*y*-1;j+=` rotate(${M}deg)`}m.style.transform=j},u=()=>{const{el:m,slides:y,progress:_,snapGrid:E,isElement:C}=t,x=Jo(m,l);t.isElement&&x.push(...Jo(t.hostEl,l)),x.forEach(N=>{d(N,_)}),y.forEach((N,O)=>{let D=N.progress;t.params.slidesPerGroup>1&&t.params.slidesPerView!=="auto"&&(D+=Math.ceil(O/2)-_*(E.length-1)),D=Math.min(Math.max(D,-1),1),N.querySelectorAll(`${l}, [data-swiper-parallax-rotate]`).forEach(P=>{d(P,D)})})},p=function(m){m===void 0&&(m=t.params.speed);const{el:y,hostEl:_}=t,E=[...y.querySelectorAll(l)];t.isElement&&E.push(..._.querySelectorAll(l)),E.forEach(C=>{let x=parseInt(C.getAttribute("data-swiper-parallax-duration"),10)||m;m===0&&(x=0),C.style.transitionDuration=`${x}ms`})};s("beforeInit",()=>{t.params.parallax.enabled&&(t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0)}),s("init",()=>{t.params.parallax.enabled&&u()}),s("setTranslate",()=>{t.params.parallax.enabled&&u()}),s("setTransition",(m,y)=>{t.params.parallax.enabled&&p(y)})}function WKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=sa();i({zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),t.zoom={enabled:!1};let u=1,p=!1,m,y;const _=[],E={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},C={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},x={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let N=1;Object.defineProperty(t.zoom,"scale",{get(){return N},set(Ce){if(N!==Ce){const he=E.imageEl,pe=E.slideEl;l("zoomChange",Ce,he,pe)}N=Ce}});function O(){if(_.length<2)return 1;const Ce=_[0].pageX,he=_[0].pageY,pe=_[1].pageX,Oe=_[1].pageY;return Math.sqrt((pe-Ce)**2+(Oe-he)**2)}function D(){if(_.length<2)return{x:null,y:null};const Ce=E.imageEl.getBoundingClientRect();return[(_[0].pageX+(_[1].pageX-_[0].pageX)/2-Ce.x-d.scrollX)/u,(_[0].pageY+(_[1].pageY-_[0].pageY)/2-Ce.y-d.scrollY)/u]}function P(){return t.isElement?"swiper-slide":`.${t.params.slideClass}`}function j(Ce){const he=P();return!!(Ce.target.matches(he)||t.slides.filter(pe=>pe.contains(Ce.target)).length>0)}function M(Ce){const he=`.${t.params.zoom.containerClass}`;return!!(Ce.target.matches(he)||[...t.hostEl.querySelectorAll(he)].filter(pe=>pe.contains(Ce.target)).length>0)}function V(Ce){if(Ce.pointerType==="mouse"&&_.splice(0,_.length),!j(Ce))return;const he=t.params.zoom;if(m=!1,y=!1,_.push(Ce),!(_.length<2)){if(m=!0,E.scaleStart=O(),!E.slideEl){E.slideEl=Ce.target.closest(`.${t.params.slideClass}, swiper-slide`),E.slideEl||(E.slideEl=t.slides[t.activeIndex]);let pe=E.slideEl.querySelector(`.${he.containerClass}`);if(pe&&(pe=pe.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=pe,pe?E.imageWrapEl=j2(E.imageEl,`.${he.containerClass}`)[0]:E.imageWrapEl=void 0,!E.imageWrapEl){E.imageEl=void 0;return}E.maxRatio=E.imageWrapEl.getAttribute("data-swiper-zoom")||he.maxRatio}if(E.imageEl){const[pe,Oe]=D();E.originX=pe,E.originY=Oe,E.imageEl.style.transitionDuration="0ms"}p=!0}}function G(Ce){if(!j(Ce))return;const he=t.params.zoom,pe=t.zoom,Oe=_.findIndex(Fe=>Fe.pointerId===Ce.pointerId);Oe>=0&&(_[Oe]=Ce),!(_.length<2)&&(y=!0,E.scaleMove=O(),E.imageEl&&(pe.scale=E.scaleMove/E.scaleStart*u,pe.scale>E.maxRatio&&(pe.scale=E.maxRatio-1+(pe.scale-E.maxRatio+1)**.5),pe.scale<he.minRatio&&(pe.scale=he.minRatio+1-(he.minRatio-pe.scale+1)**.5),E.imageEl.style.transform=`translate3d(0,0,0) scale(${pe.scale})`))}function $(Ce){if(!j(Ce)||Ce.pointerType==="mouse"&&Ce.type==="pointerout")return;const he=t.params.zoom,pe=t.zoom,Oe=_.findIndex(Fe=>Fe.pointerId===Ce.pointerId);Oe>=0&&_.splice(Oe,1),!(!m||!y)&&(m=!1,y=!1,E.imageEl&&(pe.scale=Math.max(Math.min(pe.scale,E.maxRatio),he.minRatio),E.imageEl.style.transitionDuration=`${t.params.speed}ms`,E.imageEl.style.transform=`translate3d(0,0,0) scale(${pe.scale})`,u=pe.scale,p=!1,pe.scale>1&&E.slideEl?E.slideEl.classList.add(`${he.zoomedSlideClass}`):pe.scale<=1&&E.slideEl&&E.slideEl.classList.remove(`${he.zoomedSlideClass}`),pe.scale===1&&(E.originX=0,E.originY=0,E.slideEl=void 0)))}function ne(Ce){const he=t.device;if(!E.imageEl||C.isTouched)return;he.android&&Ce.cancelable&&Ce.preventDefault(),C.isTouched=!0;const pe=_.length>0?_[0]:Ce;C.touchesStart.x=pe.pageX,C.touchesStart.y=pe.pageY}function Y(Ce){if(!j(Ce)||!M(Ce))return;const he=t.zoom;if(!E.imageEl||!C.isTouched||!E.slideEl)return;C.isMoved||(C.width=E.imageEl.offsetWidth,C.height=E.imageEl.offsetHeight,C.startX=CY(E.imageWrapEl,"x")||0,C.startY=CY(E.imageWrapEl,"y")||0,E.slideWidth=E.slideEl.offsetWidth,E.slideHeight=E.slideEl.offsetHeight,E.imageWrapEl.style.transitionDuration="0ms");const pe=C.width*he.scale,Oe=C.height*he.scale;if(pe<E.slideWidth&&Oe<E.slideHeight)return;if(C.minX=Math.min(E.slideWidth/2-pe/2,0),C.maxX=-C.minX,C.minY=Math.min(E.slideHeight/2-Oe/2,0),C.maxY=-C.minY,C.touchesCurrent.x=_.length>0?_[0].pageX:Ce.pageX,C.touchesCurrent.y=_.length>0?_[0].pageY:Ce.pageY,Math.max(Math.abs(C.touchesCurrent.x-C.touchesStart.x),Math.abs(C.touchesCurrent.y-C.touchesStart.y))>5&&(t.allowClick=!1),!C.isMoved&&!p){if(t.isHorizontal()&&(Math.floor(C.minX)===Math.floor(C.startX)&&C.touchesCurrent.x<C.touchesStart.x||Math.floor(C.maxX)===Math.floor(C.startX)&&C.touchesCurrent.x>C.touchesStart.x)){C.isTouched=!1;return}if(!t.isHorizontal()&&(Math.floor(C.minY)===Math.floor(C.startY)&&C.touchesCurrent.y<C.touchesStart.y||Math.floor(C.maxY)===Math.floor(C.startY)&&C.touchesCurrent.y>C.touchesStart.y)){C.isTouched=!1;return}}Ce.cancelable&&Ce.preventDefault(),Ce.stopPropagation(),C.isMoved=!0;const Ue=(he.scale-u)/(E.maxRatio-t.params.zoom.minRatio),{originX:Ve,originY:Re}=E;C.currentX=C.touchesCurrent.x-C.touchesStart.x+C.startX+Ue*(C.width-Ve*2),C.currentY=C.touchesCurrent.y-C.touchesStart.y+C.startY+Ue*(C.height-Re*2),C.currentX<C.minX&&(C.currentX=C.minX+1-(C.minX-C.currentX+1)**.8),C.currentX>C.maxX&&(C.currentX=C.maxX-1+(C.currentX-C.maxX+1)**.8),C.currentY<C.minY&&(C.currentY=C.minY+1-(C.minY-C.currentY+1)**.8),C.currentY>C.maxY&&(C.currentY=C.maxY-1+(C.currentY-C.maxY+1)**.8),x.prevPositionX||(x.prevPositionX=C.touchesCurrent.x),x.prevPositionY||(x.prevPositionY=C.touchesCurrent.y),x.prevTime||(x.prevTime=Date.now()),x.x=(C.touchesCurrent.x-x.prevPositionX)/(Date.now()-x.prevTime)/2,x.y=(C.touchesCurrent.y-x.prevPositionY)/(Date.now()-x.prevTime)/2,Math.abs(C.touchesCurrent.x-x.prevPositionX)<2&&(x.x=0),Math.abs(C.touchesCurrent.y-x.prevPositionY)<2&&(x.y=0),x.prevPositionX=C.touchesCurrent.x,x.prevPositionY=C.touchesCurrent.y,x.prevTime=Date.now(),E.imageWrapEl.style.transform=`translate3d(${C.currentX}px, ${C.currentY}px,0)`}function le(){const Ce=t.zoom;if(!E.imageEl)return;if(!C.isTouched||!C.isMoved){C.isTouched=!1,C.isMoved=!1;return}C.isTouched=!1,C.isMoved=!1;let he=300,pe=300;const Oe=x.x*he,Fe=C.currentX+Oe,Ue=x.y*pe,Ve=C.currentY+Ue;x.x!==0&&(he=Math.abs((Fe-C.currentX)/x.x)),x.y!==0&&(pe=Math.abs((Ve-C.currentY)/x.y));const Re=Math.max(he,pe);C.currentX=Fe,C.currentY=Ve;const Be=C.width*Ce.scale,Xe=C.height*Ce.scale;C.minX=Math.min(E.slideWidth/2-Be/2,0),C.maxX=-C.minX,C.minY=Math.min(E.slideHeight/2-Xe/2,0),C.maxY=-C.minY,C.currentX=Math.max(Math.min(C.currentX,C.maxX),C.minX),C.currentY=Math.max(Math.min(C.currentY,C.maxY),C.minY),E.imageWrapEl.style.transitionDuration=`${Re}ms`,E.imageWrapEl.style.transform=`translate3d(${C.currentX}px, ${C.currentY}px,0)`}function re(){const Ce=t.zoom;E.slideEl&&t.activeIndex!==t.slides.indexOf(E.slideEl)&&(E.imageEl&&(E.imageEl.style.transform="translate3d(0,0,0) scale(1)"),E.imageWrapEl&&(E.imageWrapEl.style.transform="translate3d(0,0,0)"),E.slideEl.classList.remove(`${t.params.zoom.zoomedSlideClass}`),Ce.scale=1,u=1,E.slideEl=void 0,E.imageEl=void 0,E.imageWrapEl=void 0,E.originX=0,E.originY=0)}function ee(Ce){const he=t.zoom,pe=t.params.zoom;if(!E.slideEl){Ce&&Ce.target&&(E.slideEl=Ce.target.closest(`.${t.params.slideClass}, swiper-slide`)),E.slideEl||(t.params.virtual&&t.params.virtual.enabled&&t.virtual?E.slideEl=Jo(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:E.slideEl=t.slides[t.activeIndex]);let mt=E.slideEl.querySelector(`.${pe.containerClass}`);mt&&(mt=mt.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=mt,mt?E.imageWrapEl=j2(E.imageEl,`.${pe.containerClass}`)[0]:E.imageWrapEl=void 0}if(!E.imageEl||!E.imageWrapEl)return;t.params.cssMode&&(t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.touchAction="none"),E.slideEl.classList.add(`${pe.zoomedSlideClass}`);let Oe,Fe,Ue,Ve,Re,Be,Xe,we,We,st,pt,Qe,Je,St,Xt,Ht,gn,It;typeof C.touchesStart.x>"u"&&Ce?(Oe=Ce.pageX,Fe=Ce.pageY):(Oe=C.touchesStart.x,Fe=C.touchesStart.y);const xt=typeof Ce=="number"?Ce:null;u===1&&xt&&(Oe=void 0,Fe=void 0),he.scale=xt||E.imageWrapEl.getAttribute("data-swiper-zoom")||pe.maxRatio,u=xt||E.imageWrapEl.getAttribute("data-swiper-zoom")||pe.maxRatio,Ce&&!(u===1&&xt)?(gn=E.slideEl.offsetWidth,It=E.slideEl.offsetHeight,Ue=J7(E.slideEl).left+d.scrollX,Ve=J7(E.slideEl).top+d.scrollY,Re=Ue+gn/2-Oe,Be=Ve+It/2-Fe,We=E.imageEl.offsetWidth,st=E.imageEl.offsetHeight,pt=We*he.scale,Qe=st*he.scale,Je=Math.min(gn/2-pt/2,0),St=Math.min(It/2-Qe/2,0),Xt=-Je,Ht=-St,Xe=Re*he.scale,we=Be*he.scale,Xe<Je&&(Xe=Je),Xe>Xt&&(Xe=Xt),we<St&&(we=St),we>Ht&&(we=Ht)):(Xe=0,we=0),xt&&he.scale===1&&(E.originX=0,E.originY=0),E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform=`translate3d(${Xe}px, ${we}px,0)`,E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform=`translate3d(0,0,0) scale(${he.scale})`}function de(){const Ce=t.zoom,he=t.params.zoom;if(!E.slideEl){t.params.virtual&&t.params.virtual.enabled&&t.virtual?E.slideEl=Jo(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:E.slideEl=t.slides[t.activeIndex];let pe=E.slideEl.querySelector(`.${he.containerClass}`);pe&&(pe=pe.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=pe,pe?E.imageWrapEl=j2(E.imageEl,`.${he.containerClass}`)[0]:E.imageWrapEl=void 0}!E.imageEl||!E.imageWrapEl||(t.params.cssMode&&(t.wrapperEl.style.overflow="",t.wrapperEl.style.touchAction=""),Ce.scale=1,u=1,E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform="translate3d(0,0,0)",E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform="translate3d(0,0,0) scale(1)",E.slideEl.classList.remove(`${he.zoomedSlideClass}`),E.slideEl=void 0,E.originX=0,E.originY=0)}function H(Ce){const he=t.zoom;he.scale&&he.scale!==1?de():ee(Ce)}function ae(){const Ce=t.params.passiveListeners?{passive:!0,capture:!1}:!1,he=t.params.passiveListeners?{passive:!1,capture:!0}:!0;return{passiveListener:Ce,activeListenerWithCapture:he}}function _e(){const Ce=t.zoom;if(Ce.enabled)return;Ce.enabled=!0;const{passiveListener:he,activeListenerWithCapture:pe}=ae();t.wrapperEl.addEventListener("pointerdown",V,he),t.wrapperEl.addEventListener("pointermove",G,pe),["pointerup","pointercancel","pointerout"].forEach(Oe=>{t.wrapperEl.addEventListener(Oe,$,he)}),t.wrapperEl.addEventListener("pointermove",Y,pe)}function me(){const Ce=t.zoom;if(!Ce.enabled)return;Ce.enabled=!1;const{passiveListener:he,activeListenerWithCapture:pe}=ae();t.wrapperEl.removeEventListener("pointerdown",V,he),t.wrapperEl.removeEventListener("pointermove",G,pe),["pointerup","pointercancel","pointerout"].forEach(Oe=>{t.wrapperEl.removeEventListener(Oe,$,he)}),t.wrapperEl.removeEventListener("pointermove",Y,pe)}s("init",()=>{t.params.zoom.enabled&&_e()}),s("destroy",()=>{me()}),s("touchStart",(Ce,he)=>{t.zoom.enabled&&ne(he)}),s("touchEnd",(Ce,he)=>{t.zoom.enabled&&le()}),s("doubleTap",(Ce,he)=>{!t.animating&&t.params.zoom.enabled&&t.zoom.enabled&&t.params.zoom.toggle&&H(he)}),s("transitionEnd",()=>{t.zoom.enabled&&t.params.zoom.enabled&&re()}),s("slideChange",()=>{t.zoom.enabled&&t.params.zoom.enabled&&t.params.cssMode&&re()}),Object.assign(t.zoom,{enable:_e,disable:me,in:ee,out:de,toggle:H})}function $Ke(n){let{swiper:t,extendParams:i,on:s}=n;i({controller:{control:void 0,inverse:!1,by:"slide"}}),t.controller={control:void 0};function l(y,_){const E=function(){let O,D,P;return(j,M)=>{for(D=-1,O=j.length;O-D>1;)P=O+D>>1,j[P]<=M?D=P:O=P;return O}}();this.x=y,this.y=_,this.lastIndex=y.length-1;let C,x;return this.interpolate=function(O){return O?(x=E(this.x,O),C=x-1,(O-this.x[C])*(this.y[x]-this.y[C])/(this.x[x]-this.x[C])+this.y[C]):0},this}function d(y){t.controller.spline=t.params.loop?new l(t.slidesGrid,y.slidesGrid):new l(t.snapGrid,y.snapGrid)}function u(y,_){const E=t.controller.control;let C,x;const N=t.constructor;function O(D){if(D.destroyed)return;const P=t.rtlTranslate?-t.translate:t.translate;t.params.controller.by==="slide"&&(d(D),x=-t.controller.spline.interpolate(-P)),(!x||t.params.controller.by==="container")&&(C=(D.maxTranslate()-D.minTranslate())/(t.maxTranslate()-t.minTranslate()),(Number.isNaN(C)||!Number.isFinite(C))&&(C=1),x=(P-t.minTranslate())*C+D.minTranslate()),t.params.controller.inverse&&(x=D.maxTranslate()-x),D.updateProgress(x),D.setTranslate(x,t),D.updateActiveIndex(),D.updateSlidesClasses()}if(Array.isArray(E))for(let D=0;D<E.length;D+=1)E[D]!==_&&E[D]instanceof N&&O(E[D]);else E instanceof N&&_!==E&&O(E)}function p(y,_){const E=t.constructor,C=t.controller.control;let x;function N(O){O.destroyed||(O.setTransition(y,t),y!==0&&(O.transitionStart(),O.params.autoHeight&&K2(()=>{O.updateAutoHeight()}),B4(O.wrapperEl,()=>{C&&O.transitionEnd()})))}if(Array.isArray(C))for(x=0;x<C.length;x+=1)C[x]!==_&&C[x]instanceof E&&N(C[x]);else C instanceof E&&_!==C&&N(C)}function m(){t.controller.control&&t.controller.spline&&(t.controller.spline=void 0,delete t.controller.spline)}s("beforeInit",()=>{if(typeof window<"u"&&(typeof t.params.controller.control=="string"||t.params.controller.control instanceof HTMLElement)){const y=document.querySelector(t.params.controller.control);if(y&&y.swiper)t.controller.control=y.swiper;else if(y){const _=E=>{t.controller.control=E.detail[0],t.update(),y.removeEventListener("init",_)};y.addEventListener("init",_)}return}t.controller.control=t.params.controller.control}),s("update",()=>{m()}),s("resize",()=>{m()}),s("observerUpdate",()=>{m()}),s("setTranslate",(y,_,E)=>{!t.controller.control||t.controller.control.destroyed||t.controller.setTranslate(_,E)}),s("setTransition",(y,_,E)=>{!t.controller.control||t.controller.control.destroyed||t.controller.setTransition(_,E)}),Object.assign(t.controller,{setTranslate:u,setTransition:p})}function KKe(n){let{swiper:t,extendParams:i,on:s}=n;i({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null}}),t.a11y={clicked:!1};let l=null;function d(H){const ae=l;ae.length!==0&&(ae.innerHTML="",ae.innerHTML=H)}function u(H){H===void 0&&(H=16);const ae=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(H).replace(/x/g,ae)}function p(H){H=or(H),H.forEach(ae=>{ae.setAttribute("tabIndex","0")})}function m(H){H=or(H),H.forEach(ae=>{ae.setAttribute("tabIndex","-1")})}function y(H,ae){H=or(H),H.forEach(_e=>{_e.setAttribute("role",ae)})}function _(H,ae){H=or(H),H.forEach(_e=>{_e.setAttribute("aria-roledescription",ae)})}function E(H,ae){H=or(H),H.forEach(_e=>{_e.setAttribute("aria-controls",ae)})}function C(H,ae){H=or(H),H.forEach(_e=>{_e.setAttribute("aria-label",ae)})}function x(H,ae){H=or(H),H.forEach(_e=>{_e.setAttribute("id",ae)})}function N(H,ae){H=or(H),H.forEach(_e=>{_e.setAttribute("aria-live",ae)})}function O(H){H=or(H),H.forEach(ae=>{ae.setAttribute("aria-disabled",!0)})}function D(H){H=or(H),H.forEach(ae=>{ae.setAttribute("aria-disabled",!1)})}function P(H){if(H.keyCode!==13&&H.keyCode!==32)return;const ae=t.params.a11y,_e=H.target;t.pagination&&t.pagination.el&&(_e===t.pagination.el||t.pagination.el.contains(H.target))&&!H.target.matches(Ug(t.params.pagination.bulletClass))||(t.navigation&&t.navigation.nextEl&&_e===t.navigation.nextEl&&(t.isEnd&&!t.params.loop||t.slideNext(),t.isEnd?d(ae.lastSlideMessage):d(ae.nextSlideMessage)),t.navigation&&t.navigation.prevEl&&_e===t.navigation.prevEl&&(t.isBeginning&&!t.params.loop||t.slidePrev(),t.isBeginning?d(ae.firstSlideMessage):d(ae.prevSlideMessage)),t.pagination&&_e.matches(Ug(t.params.pagination.bulletClass))&&_e.click())}function j(){if(t.params.loop||t.params.rewind||!t.navigation)return;const{nextEl:H,prevEl:ae}=t.navigation;ae&&(t.isBeginning?(O(ae),m(ae)):(D(ae),p(ae))),H&&(t.isEnd?(O(H),m(H)):(D(H),p(H)))}function M(){return t.pagination&&t.pagination.bullets&&t.pagination.bullets.length}function V(){return M()&&t.params.pagination.clickable}function G(){const H=t.params.a11y;M()&&t.pagination.bullets.forEach(ae=>{t.params.pagination.clickable&&(p(ae),t.params.pagination.renderBullet||(y(ae,"button"),C(ae,H.paginationBulletMessage.replace(/\{\{index\}\}/,_N(ae)+1)))),ae.matches(Ug(t.params.pagination.bulletActiveClass))?ae.setAttribute("aria-current","true"):ae.removeAttribute("aria-current")})}const $=(H,ae,_e)=>{p(H),H.tagName!=="BUTTON"&&(y(H,"button"),H.addEventListener("keydown",P)),C(H,_e),E(H,ae)},ne=()=>{t.a11y.clicked=!0},Y=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.destroyed||(t.a11y.clicked=!1)})})},le=H=>{if(t.a11y.clicked)return;const ae=H.target.closest(`.${t.params.slideClass}, swiper-slide`);if(!ae||!t.slides.includes(ae))return;const _e=t.slides.indexOf(ae)===t.activeIndex,me=t.params.watchSlidesProgress&&t.visibleSlides&&t.visibleSlides.includes(ae);_e||me||H.sourceCapabilities&&H.sourceCapabilities.firesTouchEvents||(t.isHorizontal()?t.el.scrollLeft=0:t.el.scrollTop=0,t.slideTo(t.slides.indexOf(ae),0))},re=()=>{const H=t.params.a11y;H.itemRoleDescriptionMessage&&_(t.slides,H.itemRoleDescriptionMessage),H.slideRole&&y(t.slides,H.slideRole);const ae=t.slides.length;H.slideLabelMessage&&t.slides.forEach((_e,me)=>{const Ce=t.params.loop?parseInt(_e.getAttribute("data-swiper-slide-index"),10):me,he=H.slideLabelMessage.replace(/\{\{index\}\}/,Ce+1).replace(/\{\{slidesLength\}\}/,ae);C(_e,he)})},ee=()=>{const H=t.params.a11y;t.el.append(l);const ae=t.el;H.containerRoleDescriptionMessage&&_(ae,H.containerRoleDescriptionMessage),H.containerMessage&&C(ae,H.containerMessage);const _e=t.wrapperEl,me=H.id||_e.getAttribute("id")||`swiper-wrapper-${u(16)}`,Ce=t.params.autoplay&&t.params.autoplay.enabled?"off":"polite";x(_e,me),N(_e,Ce),re();let{nextEl:he,prevEl:pe}=t.navigation?t.navigation:{};he=or(he),pe=or(pe),he&&he.forEach(Oe=>$(Oe,me,H.nextSlideMessage)),pe&&pe.forEach(Oe=>$(Oe,me,H.prevSlideMessage)),V()&&or(t.pagination.el).forEach(Fe=>{Fe.addEventListener("keydown",P)}),t.el.addEventListener("focus",le,!0),t.el.addEventListener("pointerdown",ne,!0),t.el.addEventListener("pointerup",Y,!0)};function de(){l&&l.remove();let{nextEl:H,prevEl:ae}=t.navigation?t.navigation:{};H=or(H),ae=or(ae),H&&H.forEach(_e=>_e.removeEventListener("keydown",P)),ae&&ae.forEach(_e=>_e.removeEventListener("keydown",P)),V()&&or(t.pagination.el).forEach(me=>{me.removeEventListener("keydown",P)}),t.el.removeEventListener("focus",le,!0),t.el.removeEventListener("pointerdown",ne,!0),t.el.removeEventListener("pointerup",Y,!0)}s("beforeInit",()=>{l=Zd("span",t.params.a11y.notificationClass),l.setAttribute("aria-live","assertive"),l.setAttribute("aria-atomic","true")}),s("afterInit",()=>{t.params.a11y.enabled&&ee()}),s("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{t.params.a11y.enabled&&re()}),s("fromEdge toEdge afterInit lock unlock",()=>{t.params.a11y.enabled&&j()}),s("paginationUpdate",()=>{t.params.a11y.enabled&&G()}),s("destroy",()=>{t.params.a11y.enabled&&de()})}function qKe(n){let{swiper:t,extendParams:i,on:s}=n;i({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let l=!1,d={};const u=x=>x.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),p=x=>{const N=sa();let O;x?O=new URL(x):O=N.location;const D=O.pathname.slice(1).split("/").filter(V=>V!==""),P=D.length,j=D[P-2],M=D[P-1];return{key:j,value:M}},m=(x,N)=>{const O=sa();if(!l||!t.params.history.enabled)return;let D;t.params.url?D=new URL(t.params.url):D=O.location;const P=t.slides[N];let j=u(P.getAttribute("data-history"));if(t.params.history.root.length>0){let V=t.params.history.root;V[V.length-1]==="/"&&(V=V.slice(0,V.length-1)),j=`${V}/${x?`${x}/`:""}${j}`}else D.pathname.includes(x)||(j=`${x?`${x}/`:""}${j}`);t.params.history.keepQuery&&(j+=D.search);const M=O.history.state;M&&M.value===j||(t.params.history.replaceState?O.history.replaceState({value:j},null,j):O.history.pushState({value:j},null,j))},y=(x,N,O)=>{if(N)for(let D=0,P=t.slides.length;D<P;D+=1){const j=t.slides[D];if(u(j.getAttribute("data-history"))===N){const V=t.getSlideIndex(j);t.slideTo(V,x,O)}}else t.slideTo(0,x,O)},_=()=>{d=p(t.params.url),y(t.params.speed,d.value,!1)},E=()=>{const x=sa();if(t.params.history){if(!x.history||!x.history.pushState){t.params.history.enabled=!1,t.params.hashNavigation.enabled=!0;return}if(l=!0,d=p(t.params.url),!d.key&&!d.value){t.params.history.replaceState||x.addEventListener("popstate",_);return}y(0,d.value,t.params.runCallbacksOnInit),t.params.history.replaceState||x.addEventListener("popstate",_)}},C=()=>{const x=sa();t.params.history.replaceState||x.removeEventListener("popstate",_)};s("init",()=>{t.params.history.enabled&&E()}),s("destroy",()=>{t.params.history.enabled&&C()}),s("transitionEnd _freeModeNoMomentumRelease",()=>{l&&m(t.params.history.key,t.activeIndex)}),s("slideChange",()=>{l&&t.params.cssMode&&m(t.params.history.key,t.activeIndex)})}function YKe(n){let{swiper:t,extendParams:i,emit:s,on:l}=n,d=!1;const u=fc(),p=sa();i({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(C,x){if(t.virtual&&t.params.virtual.enabled){const N=t.slides.filter(D=>D.getAttribute("data-hash")===x)[0];return N?parseInt(N.getAttribute("data-swiper-slide-index"),10):0}return t.getSlideIndex(Jo(t.slidesEl,`.${t.params.slideClass}[data-hash="${x}"], swiper-slide[data-hash="${x}"]`)[0])}}});const m=()=>{s("hashChange");const C=u.location.hash.replace("#",""),x=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],N=x?x.getAttribute("data-hash"):"";if(C!==N){const O=t.params.hashNavigation.getSlideIndex(t,C);if(typeof O>"u"||Number.isNaN(O))return;t.slideTo(O)}},y=()=>{if(!d||!t.params.hashNavigation.enabled)return;const C=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],x=C?C.getAttribute("data-hash")||C.getAttribute("data-history"):"";t.params.hashNavigation.replaceState&&p.history&&p.history.replaceState?(p.history.replaceState(null,null,`#${x}`||""),s("hashSet")):(u.location.hash=x||"",s("hashSet"))},_=()=>{if(!t.params.hashNavigation.enabled||t.params.history&&t.params.history.enabled)return;d=!0;const C=u.location.hash.replace("#","");if(C){const N=t.params.hashNavigation.getSlideIndex(t,C);t.slideTo(N||0,0,t.params.runCallbacksOnInit,!0)}t.params.hashNavigation.watchState&&p.addEventListener("hashchange",m)},E=()=>{t.params.hashNavigation.watchState&&p.removeEventListener("hashchange",m)};l("init",()=>{t.params.hashNavigation.enabled&&_()}),l("destroy",()=>{t.params.hashNavigation.enabled&&E()}),l("transitionEnd _freeModeNoMomentumRelease",()=>{d&&y()}),l("slideChange",()=>{d&&t.params.cssMode&&y()})}function XKe(n){let{swiper:t,extendParams:i,on:s,emit:l,params:d}=n;t.autoplay={running:!1,paused:!1,timeLeft:0},i({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let u,p,m=d&&d.autoplay?d.autoplay.delay:3e3,y=d&&d.autoplay?d.autoplay.delay:3e3,_,E=new Date().getTime(),C,x,N,O,D,P,j;function M(he){!t||t.destroyed||!t.wrapperEl||he.target===t.wrapperEl&&(t.wrapperEl.removeEventListener("transitionend",M),!j&&re())}const V=()=>{if(t.destroyed||!t.autoplay.running)return;t.autoplay.paused?C=!0:C&&(y=_,C=!1);const he=t.autoplay.paused?_:E+y-new Date().getTime();t.autoplay.timeLeft=he,l("autoplayTimeLeft",he,he/m),p=requestAnimationFrame(()=>{V()})},G=()=>{let he;return t.virtual&&t.params.virtual.enabled?he=t.slides.filter(Oe=>Oe.classList.contains("swiper-slide-active"))[0]:he=t.slides[t.activeIndex],he?parseInt(he.getAttribute("data-swiper-autoplay"),10):void 0},$=he=>{if(t.destroyed||!t.autoplay.running)return;cancelAnimationFrame(p),V();let pe=typeof he>"u"?t.params.autoplay.delay:he;m=t.params.autoplay.delay,y=t.params.autoplay.delay;const Oe=G();!Number.isNaN(Oe)&&Oe>0&&typeof he>"u"&&(pe=Oe,m=Oe,y=Oe),_=pe;const Fe=t.params.speed,Ue=()=>{!t||t.destroyed||(t.params.autoplay.reverseDirection?!t.isBeginning||t.params.loop||t.params.rewind?(t.slidePrev(Fe,!0,!0),l("autoplay")):t.params.autoplay.stopOnLastSlide||(t.slideTo(t.slides.length-1,Fe,!0,!0),l("autoplay")):!t.isEnd||t.params.loop||t.params.rewind?(t.slideNext(Fe,!0,!0),l("autoplay")):t.params.autoplay.stopOnLastSlide||(t.slideTo(0,Fe,!0,!0),l("autoplay")),t.params.cssMode&&(E=new Date().getTime(),requestAnimationFrame(()=>{$()})))};return pe>0?(clearTimeout(u),u=setTimeout(()=>{Ue()},pe)):requestAnimationFrame(()=>{Ue()}),pe},ne=()=>{E=new Date().getTime(),t.autoplay.running=!0,$(),l("autoplayStart")},Y=()=>{t.autoplay.running=!1,clearTimeout(u),cancelAnimationFrame(p),l("autoplayStop")},le=(he,pe)=>{if(t.destroyed||!t.autoplay.running)return;clearTimeout(u),he||(P=!0);const Oe=()=>{l("autoplayPause"),t.params.autoplay.waitForTransition?t.wrapperEl.addEventListener("transitionend",M):re()};if(t.autoplay.paused=!0,pe){D&&(_=t.params.autoplay.delay),D=!1,Oe();return}_=(_||t.params.autoplay.delay)-(new Date().getTime()-E),!(t.isEnd&&_<0&&!t.params.loop)&&(_<0&&(_=0),Oe())},re=()=>{t.isEnd&&_<0&&!t.params.loop||t.destroyed||!t.autoplay.running||(E=new Date().getTime(),P?(P=!1,$(_)):$(),t.autoplay.paused=!1,l("autoplayResume"))},ee=()=>{if(t.destroyed||!t.autoplay.running)return;const he=fc();he.visibilityState==="hidden"&&(P=!0,le(!0)),he.visibilityState==="visible"&&re()},de=he=>{he.pointerType==="mouse"&&(P=!0,j=!0,!(t.animating||t.autoplay.paused)&&le(!0))},H=he=>{he.pointerType==="mouse"&&(j=!1,t.autoplay.paused&&re())},ae=()=>{t.params.autoplay.pauseOnMouseEnter&&(t.el.addEventListener("pointerenter",de),t.el.addEventListener("pointerleave",H))},_e=()=>{t.el.removeEventListener("pointerenter",de),t.el.removeEventListener("pointerleave",H)},me=()=>{fc().addEventListener("visibilitychange",ee)},Ce=()=>{fc().removeEventListener("visibilitychange",ee)};s("init",()=>{t.params.autoplay.enabled&&(ae(),me(),ne())}),s("destroy",()=>{_e(),Ce(),t.autoplay.running&&Y()}),s("_freeModeStaticRelease",()=>{(N||P)&&re()}),s("_freeModeNoMomentumRelease",()=>{t.params.autoplay.disableOnInteraction?Y():le(!0,!0)}),s("beforeTransitionStart",(he,pe,Oe)=>{t.destroyed||!t.autoplay.running||(Oe||!t.params.autoplay.disableOnInteraction?le(!0,!0):Y())}),s("sliderFirstMove",()=>{if(!(t.destroyed||!t.autoplay.running)){if(t.params.autoplay.disableOnInteraction){Y();return}x=!0,N=!1,P=!1,O=setTimeout(()=>{P=!0,N=!0,le(!0)},200)}}),s("touchEnd",()=>{if(!(t.destroyed||!t.autoplay.running||!x)){if(clearTimeout(O),clearTimeout(u),t.params.autoplay.disableOnInteraction){N=!1,x=!1;return}N&&t.params.cssMode&&re(),N=!1,x=!1}}),s("slideChange",()=>{t.destroyed||!t.autoplay.running||(D=!0)}),Object.assign(t.autoplay,{start:ne,stop:Y,pause:le,resume:re})}function JKe(n){let{swiper:t,extendParams:i,on:s}=n;i({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let l=!1,d=!1;t.thumbs={swiper:null};function u(){const y=t.thumbs.swiper;if(!y||y.destroyed)return;const _=y.clickedIndex,E=y.clickedSlide;if(E&&E.classList.contains(t.params.thumbs.slideThumbActiveClass)||typeof _>"u"||_===null)return;let C;y.params.loop?C=parseInt(y.clickedSlide.getAttribute("data-swiper-slide-index"),10):C=_,t.params.loop?t.slideToLoop(C):t.slideTo(C)}function p(){const{thumbs:y}=t.params;if(l)return!1;l=!0;const _=t.constructor;if(y.swiper instanceof _)t.thumbs.swiper=y.swiper,Object.assign(t.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(t.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper.update();else if(n4(y.swiper)){const E=Object.assign({},y.swiper);Object.assign(E,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper=new _(E),d=!0}return t.thumbs.swiper.el.classList.add(t.params.thumbs.thumbsContainerClass),t.thumbs.swiper.on("tap",u),!0}function m(y){const _=t.thumbs.swiper;if(!_||_.destroyed)return;const E=_.params.slidesPerView==="auto"?_.slidesPerViewDynamic():_.params.slidesPerView;let C=1;const x=t.params.thumbs.slideThumbActiveClass;if(t.params.slidesPerView>1&&!t.params.centeredSlides&&(C=t.params.slidesPerView),t.params.thumbs.multipleActiveThumbs||(C=1),C=Math.floor(C),_.slides.forEach(D=>D.classList.remove(x)),_.params.loop||_.params.virtual&&_.params.virtual.enabled)for(let D=0;D<C;D+=1)Jo(_.slidesEl,`[data-swiper-slide-index="${t.realIndex+D}"]`).forEach(P=>{P.classList.add(x)});else for(let D=0;D<C;D+=1)_.slides[t.realIndex+D]&&_.slides[t.realIndex+D].classList.add(x);const N=t.params.thumbs.autoScrollOffset,O=N&&!_.params.loop;if(t.realIndex!==_.realIndex||O){const D=_.activeIndex;let P,j;if(_.params.loop){const M=_.slides.filter(V=>V.getAttribute("data-swiper-slide-index")===`${t.realIndex}`)[0];P=_.slides.indexOf(M),j=t.activeIndex>t.previousIndex?"next":"prev"}else P=t.realIndex,j=P>t.previousIndex?"next":"prev";O&&(P+=j==="next"?N:-1*N),_.visibleSlidesIndexes&&_.visibleSlidesIndexes.indexOf(P)<0&&(_.params.centeredSlides?P>D?P=P-Math.floor(E/2)+1:P=P+Math.floor(E/2)-1:P>D&&_.params.slidesPerGroup,_.slideTo(P,y?0:void 0))}}s("beforeInit",()=>{const{thumbs:y}=t.params;if(!(!y||!y.swiper))if(typeof y.swiper=="string"||y.swiper instanceof HTMLElement){const _=fc(),E=()=>{const x=typeof y.swiper=="string"?_.querySelector(y.swiper):y.swiper;if(x&&x.swiper)y.swiper=x.swiper,p(),m(!0);else if(x){const N=O=>{y.swiper=O.detail[0],x.removeEventListener("init",N),p(),m(!0),y.swiper.update(),t.update()};x.addEventListener("init",N)}return x},C=()=>{if(t.destroyed)return;E()||requestAnimationFrame(C)};requestAnimationFrame(C)}else p(),m(!0)}),s("slideChange update resize observerUpdate",()=>{m()}),s("setTransition",(y,_)=>{const E=t.thumbs.swiper;!E||E.destroyed||E.setTransition(_)}),s("beforeDestroy",()=>{const y=t.thumbs.swiper;!y||y.destroyed||d&&y.destroy()}),Object.assign(t.thumbs,{init:p,update:m})}function QKe(n){let{swiper:t,extendParams:i,emit:s,once:l}=n;i({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}});function d(){if(t.params.cssMode)return;const m=t.getTranslate();t.setTranslate(m),t.setTransition(0),t.touchEventsData.velocities.length=0,t.freeMode.onTouchEnd({currentPos:t.rtl?t.translate:-t.translate})}function u(){if(t.params.cssMode)return;const{touchEventsData:m,touches:y}=t;m.velocities.length===0&&m.velocities.push({position:y[t.isHorizontal()?"startX":"startY"],time:m.touchStartTime}),m.velocities.push({position:y[t.isHorizontal()?"currentX":"currentY"],time:lh()})}function p(m){let{currentPos:y}=m;if(t.params.cssMode)return;const{params:_,wrapperEl:E,rtlTranslate:C,snapGrid:x,touchEventsData:N}=t,D=lh()-N.touchStartTime;if(y<-t.minTranslate()){t.slideTo(t.activeIndex);return}if(y>-t.maxTranslate()){t.slides.length<x.length?t.slideTo(x.length-1):t.slideTo(t.slides.length-1);return}if(_.freeMode.momentum){if(N.velocities.length>1){const Y=N.velocities.pop(),le=N.velocities.pop(),re=Y.position-le.position,ee=Y.time-le.time;t.velocity=re/ee,t.velocity/=2,Math.abs(t.velocity)<_.freeMode.minimumVelocity&&(t.velocity=0),(ee>150||lh()-Y.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=_.freeMode.momentumVelocityRatio,N.velocities.length=0;let P=1e3*_.freeMode.momentumRatio;const j=t.velocity*P;let M=t.translate+j;C&&(M=-M);let V=!1,G;const $=Math.abs(t.velocity)*20*_.freeMode.momentumBounceRatio;let ne;if(M<t.maxTranslate())_.freeMode.momentumBounce?(M+t.maxTranslate()<-$&&(M=t.maxTranslate()-$),G=t.maxTranslate(),V=!0,N.allowMomentumBounce=!0):M=t.maxTranslate(),_.loop&&_.centeredSlides&&(ne=!0);else if(M>t.minTranslate())_.freeMode.momentumBounce?(M-t.minTranslate()>$&&(M=t.minTranslate()+$),G=t.minTranslate(),V=!0,N.allowMomentumBounce=!0):M=t.minTranslate(),_.loop&&_.centeredSlides&&(ne=!0);else if(_.freeMode.sticky){let Y;for(let le=0;le<x.length;le+=1)if(x[le]>-M){Y=le;break}Math.abs(x[Y]-M)<Math.abs(x[Y-1]-M)||t.swipeDirection==="next"?M=x[Y]:M=x[Y-1],M=-M}if(ne&&l("transitionEnd",()=>{t.loopFix()}),t.velocity!==0){if(C?P=Math.abs((-M-t.translate)/t.velocity):P=Math.abs((M-t.translate)/t.velocity),_.freeMode.sticky){const Y=Math.abs((C?-M:M)-t.translate),le=t.slidesSizesGrid[t.activeIndex];Y<le?P=_.speed:Y<2*le?P=_.speed*1.5:P=_.speed*2.5}}else if(_.freeMode.sticky){t.slideToClosest();return}_.freeMode.momentumBounce&&V?(t.updateProgress(G),t.setTransition(P),t.setTranslate(M),t.transitionStart(!0,t.swipeDirection),t.animating=!0,B4(E,()=>{!t||t.destroyed||!N.allowMomentumBounce||(s("momentumBounce"),t.setTransition(_.speed),setTimeout(()=>{t.setTranslate(G),B4(E,()=>{!t||t.destroyed||t.transitionEnd()})},0))})):t.velocity?(s("_freeModeNoMomentumRelease"),t.updateProgress(M),t.setTransition(P),t.setTranslate(M),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,B4(E,()=>{!t||t.destroyed||t.transitionEnd()}))):t.updateProgress(M),t.updateActiveIndex(),t.updateSlidesClasses()}else if(_.freeMode.sticky){t.slideToClosest();return}else _.freeMode&&s("_freeModeNoMomentumRelease");(!_.freeMode.momentum||D>=_.longSwipesMs)&&(s("_freeModeStaticRelease"),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}Object.assign(t,{freeMode:{onTouchStart:d,onTouchMove:u,onTouchEnd:p}})}function ZKe(n){let{swiper:t,extendParams:i,on:s}=n;i({grid:{rows:1,fill:"column"}});let l,d,u,p;const m=()=>{let O=t.params.spaceBetween;return typeof O=="string"&&O.indexOf("%")>=0?O=parseFloat(O.replace("%",""))/100*t.size:typeof O=="string"&&(O=parseFloat(O)),O},y=O=>{const{slidesPerView:D}=t.params,{rows:P,fill:j}=t.params.grid,M=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:O.length;u=Math.floor(M/P),Math.floor(M/P)===M/P?l=M:l=Math.ceil(M/P)*P,D!=="auto"&&j==="row"&&(l=Math.max(l,D*P)),d=l/P},_=()=>{t.slides&&t.slides.forEach(O=>{O.swiperSlideGridSet&&(O.style.height="",O.style[t.getDirectionLabel("margin-top")]="")})},E=(O,D,P)=>{const{slidesPerGroup:j}=t.params,M=m(),{rows:V,fill:G}=t.params.grid,$=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:P.length;let ne,Y,le;if(G==="row"&&j>1){const re=Math.floor(O/(j*V)),ee=O-V*j*re,de=re===0?j:Math.min(Math.ceil(($-re*V*j)/V),j);le=Math.floor(ee/de),Y=ee-le*de+re*j,ne=Y+le*l/V,D.style.order=ne}else G==="column"?(Y=Math.floor(O/V),le=O-Y*V,(Y>u||Y===u&&le===V-1)&&(le+=1,le>=V&&(le=0,Y+=1))):(le=Math.floor(O/d),Y=O-le*d);D.row=le,D.column=Y,D.style.height=`calc((100% - ${(V-1)*M}px) / ${V})`,D.style[t.getDirectionLabel("margin-top")]=le!==0?M&&`${M}px`:"",D.swiperSlideGridSet=!0},C=(O,D)=>{const{centeredSlides:P,roundLengths:j}=t.params,M=m(),{rows:V}=t.params.grid;if(t.virtualSize=(O+M)*l,t.virtualSize=Math.ceil(t.virtualSize/V)-M,t.params.cssMode||(t.wrapperEl.style[t.getDirectionLabel("width")]=`${t.virtualSize+M}px`),P){const G=[];for(let $=0;$<D.length;$+=1){let ne=D[$];j&&(ne=Math.floor(ne)),D[$]<t.virtualSize+D[0]&&G.push(ne)}D.splice(0,D.length),D.push(...G)}},x=()=>{p=t.params.grid&&t.params.grid.rows>1},N=()=>{const{params:O,el:D}=t,P=O.grid&&O.grid.rows>1;p&&!P?(D.classList.remove(`${O.containerModifierClass}grid`,`${O.containerModifierClass}grid-column`),u=1,t.emitContainerClasses()):!p&&P&&(D.classList.add(`${O.containerModifierClass}grid`),O.grid.fill==="column"&&D.classList.add(`${O.containerModifierClass}grid-column`),t.emitContainerClasses()),p=P};s("init",x),s("update",N),t.grid={initSlides:y,unsetSlides:_,updateSlide:E,updateWrapperSize:C}}function eqe(n){const t=this,{params:i,slidesEl:s}=t;i.loop&&t.loopDestroy();const l=d=>{if(typeof d=="string"){const u=document.createElement("div");u.innerHTML=d,s.append(u.children[0]),u.innerHTML=""}else s.append(d)};if(typeof n=="object"&&"length"in n)for(let d=0;d<n.length;d+=1)n[d]&&l(n[d]);else l(n);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update()}function tqe(n){const t=this,{params:i,activeIndex:s,slidesEl:l}=t;i.loop&&t.loopDestroy();let d=s+1;const u=p=>{if(typeof p=="string"){const m=document.createElement("div");m.innerHTML=p,l.prepend(m.children[0]),m.innerHTML=""}else l.prepend(p)};if(typeof n=="object"&&"length"in n){for(let p=0;p<n.length;p+=1)n[p]&&u(n[p]);d=s+n.length}else u(n);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update(),t.slideTo(d,0,!1)}function nqe(n,t){const i=this,{params:s,activeIndex:l,slidesEl:d}=i;let u=l;s.loop&&(u-=i.loopedSlides,i.loopDestroy(),i.recalcSlides());const p=i.slides.length;if(n<=0){i.prependSlide(t);return}if(n>=p){i.appendSlide(t);return}let m=u>n?u+1:u;const y=[];for(let _=p-1;_>=n;_-=1){const E=i.slides[_];E.remove(),y.unshift(E)}if(typeof t=="object"&&"length"in t){for(let _=0;_<t.length;_+=1)t[_]&&d.append(t[_]);m=u>n?u+t.length:u}else d.append(t);for(let _=0;_<y.length;_+=1)d.append(y[_]);i.recalcSlides(),s.loop&&i.loopCreate(),(!s.observer||i.isElement)&&i.update(),s.loop?i.slideTo(m+i.loopedSlides,0,!1):i.slideTo(m,0,!1)}function iqe(n){const t=this,{params:i,activeIndex:s}=t;let l=s;i.loop&&(l-=t.loopedSlides,t.loopDestroy());let d=l,u;if(typeof n=="object"&&"length"in n){for(let p=0;p<n.length;p+=1)u=n[p],t.slides[u]&&t.slides[u].remove(),u<d&&(d-=1);d=Math.max(d,0)}else u=n,t.slides[u]&&t.slides[u].remove(),u<d&&(d-=1),d=Math.max(d,0);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update(),i.loop?t.slideTo(d+t.loopedSlides,0,!1):t.slideTo(d,0,!1)}function rqe(){const n=this,t=[];for(let i=0;i<n.slides.length;i+=1)t.push(i);n.removeSlide(t)}function sqe(n){let{swiper:t}=n;Object.assign(t,{appendSlide:eqe.bind(t),prependSlide:tqe.bind(t),addSlide:nqe.bind(t),removeSlide:iqe.bind(t),removeAllSlides:rqe.bind(t)})}function Cx(n){const{effect:t,swiper:i,on:s,setTranslate:l,setTransition:d,overwriteParams:u,perspective:p,recreateShadows:m,getEffectParams:y}=n;s("beforeInit",()=>{if(i.params.effect!==t)return;i.classNames.push(`${i.params.containerModifierClass}${t}`),p&&p()&&i.classNames.push(`${i.params.containerModifierClass}3d`);const E=u?u():{};Object.assign(i.params,E),Object.assign(i.originalParams,E)}),s("setTranslate",()=>{i.params.effect===t&&l()}),s("setTransition",(E,C)=>{i.params.effect===t&&d(C)}),s("transitionEnd",()=>{if(i.params.effect===t&&m){if(!y||!y().slideShadows)return;i.slides.forEach(E=>{E.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(C=>C.remove())}),m()}});let _;s("virtualUpdate",()=>{i.params.effect===t&&(i.slides.length||(_=!0),requestAnimationFrame(()=>{_&&i.slides&&i.slides.length&&(l(),_=!1)}))})}function wP(n,t){const i=pw(t);return i!==t&&(i.style.backfaceVisibility="hidden",i.style["-webkit-backface-visibility"]="hidden"),i}function pF(n){let{swiper:t,duration:i,transformElements:s,allSlides:l}=n;const{activeIndex:d}=t,u=p=>p.parentElement?p.parentElement:t.slides.filter(y=>y.shadowRoot&&y.shadowRoot===p.parentNode)[0];if(t.params.virtualTranslate&&i!==0){let p=!1,m;l?m=s:m=s.filter(y=>{const _=y.classList.contains("swiper-slide-transform")?u(y):y;return t.getSlideIndex(_)===d}),m.forEach(y=>{B4(y,()=>{if(p||!t||t.destroyed)return;p=!0,t.animating=!1;const _=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(_)})})}}function aqe(n){let{swiper:t,extendParams:i,on:s}=n;i({fadeEffect:{crossFade:!1}}),Cx({effect:"fade",swiper:t,on:s,setTranslate:()=>{const{slides:u}=t,p=t.params.fadeEffect;for(let m=0;m<u.length;m+=1){const y=t.slides[m];let E=-y.swiperSlideOffset;t.params.virtualTranslate||(E-=t.translate);let C=0;t.isHorizontal()||(C=E,E=0);const x=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(y.progress),0):1+Math.min(Math.max(y.progress,-1),0),N=wP(p,y);N.style.opacity=x,N.style.transform=`translate3d(${E}px, ${C}px, 0px)`}},setTransition:u=>{const p=t.slides.map(m=>pw(m));p.forEach(m=>{m.style.transitionDuration=`${u}ms`}),pF({swiper:t,duration:u,transformElements:p,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}function oqe(n){let{swiper:t,extendParams:i,on:s}=n;i({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const l=(m,y,_)=>{let E=_?m.querySelector(".swiper-slide-shadow-left"):m.querySelector(".swiper-slide-shadow-top"),C=_?m.querySelector(".swiper-slide-shadow-right"):m.querySelector(".swiper-slide-shadow-bottom");E||(E=Zd("div",`swiper-slide-shadow-cube swiper-slide-shadow-${_?"left":"top"}`.split(" ")),m.append(E)),C||(C=Zd("div",`swiper-slide-shadow-cube swiper-slide-shadow-${_?"right":"bottom"}`.split(" ")),m.append(C)),E&&(E.style.opacity=Math.max(-y,0)),C&&(C.style.opacity=Math.max(y,0))};Cx({effect:"cube",swiper:t,on:s,setTranslate:()=>{const{el:m,wrapperEl:y,slides:_,width:E,height:C,rtlTranslate:x,size:N,browser:O}=t,D=t.params.cubeEffect,P=t.isHorizontal(),j=t.virtual&&t.params.virtual.enabled;let M=0,V;D.shadow&&(P?(V=t.wrapperEl.querySelector(".swiper-cube-shadow"),V||(V=Zd("div","swiper-cube-shadow"),t.wrapperEl.append(V)),V.style.height=`${E}px`):(V=m.querySelector(".swiper-cube-shadow"),V||(V=Zd("div","swiper-cube-shadow"),m.append(V))));for(let $=0;$<_.length;$+=1){const ne=_[$];let Y=$;j&&(Y=parseInt(ne.getAttribute("data-swiper-slide-index"),10));let le=Y*90,re=Math.floor(le/360);x&&(le=-le,re=Math.floor(-le/360));const ee=Math.max(Math.min(ne.progress,1),-1);let de=0,H=0,ae=0;Y%4===0?(de=-re*4*N,ae=0):(Y-1)%4===0?(de=0,ae=-re*4*N):(Y-2)%4===0?(de=N+re*4*N,ae=N):(Y-3)%4===0&&(de=-N,ae=3*N+N*4*re),x&&(de=-de),P||(H=de,de=0);const _e=`rotateX(${P?0:-le}deg) rotateY(${P?le:0}deg) translate3d(${de}px, ${H}px, ${ae}px)`;ee<=1&&ee>-1&&(M=Y*90+ee*90,x&&(M=-Y*90-ee*90),t.browser&&t.browser.need3dFix&&Math.abs(M)/90%2===1&&(M+=.001)),ne.style.transform=_e,D.slideShadows&&l(ne,ee,P)}if(y.style.transformOrigin=`50% 50% -${N/2}px`,y.style["-webkit-transform-origin"]=`50% 50% -${N/2}px`,D.shadow)if(P)V.style.transform=`translate3d(0px, ${E/2+D.shadowOffset}px, ${-E/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${D.shadowScale})`;else{const $=Math.abs(M)-Math.floor(Math.abs(M)/90)*90,ne=1.5-(Math.sin($*2*Math.PI/360)/2+Math.cos($*2*Math.PI/360)/2),Y=D.shadowScale,le=D.shadowScale/ne,re=D.shadowOffset;V.style.transform=`scale3d(${Y}, 1, ${le}) translate3d(0px, ${C/2+re}px, ${-C/2/le}px) rotateX(-89.99deg)`}const G=(O.isSafari||O.isWebView)&&O.needPerspectiveFix?-N/2:0;y.style.transform=`translate3d(0px,0,${G}px) rotateX(${t.isHorizontal()?0:M}deg) rotateY(${t.isHorizontal()?-M:0}deg)`,y.style.setProperty("--swiper-cube-translate-z",`${G}px`)},setTransition:m=>{const{el:y,slides:_}=t;if(_.forEach(E=>{E.style.transitionDuration=`${m}ms`,E.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(C=>{C.style.transitionDuration=`${m}ms`})}),t.params.cubeEffect.shadow&&!t.isHorizontal()){const E=y.querySelector(".swiper-cube-shadow");E&&(E.style.transitionDuration=`${m}ms`)}},recreateShadows:()=>{const m=t.isHorizontal();t.slides.forEach(y=>{const _=Math.max(Math.min(y.progress,1),-1);l(y,_,m)})},getEffectParams:()=>t.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})}function ix(n,t,i){const s=`swiper-slide-shadow${i?`-${i}`:""}${n?` swiper-slide-shadow-${n}`:""}`,l=pw(t);let d=l.querySelector(`.${s.split(" ").join(".")}`);return d||(d=Zd("div",s.split(" ")),l.append(d)),d}function lqe(n){let{swiper:t,extendParams:i,on:s}=n;i({flipEffect:{slideShadows:!0,limitRotation:!0}});const l=(m,y)=>{let _=t.isHorizontal()?m.querySelector(".swiper-slide-shadow-left"):m.querySelector(".swiper-slide-shadow-top"),E=t.isHorizontal()?m.querySelector(".swiper-slide-shadow-right"):m.querySelector(".swiper-slide-shadow-bottom");_||(_=ix("flip",m,t.isHorizontal()?"left":"top")),E||(E=ix("flip",m,t.isHorizontal()?"right":"bottom")),_&&(_.style.opacity=Math.max(-y,0)),E&&(E.style.opacity=Math.max(y,0))};Cx({effect:"flip",swiper:t,on:s,setTranslate:()=>{const{slides:m,rtlTranslate:y}=t,_=t.params.flipEffect;for(let E=0;E<m.length;E+=1){const C=m[E];let x=C.progress;t.params.flipEffect.limitRotation&&(x=Math.max(Math.min(C.progress,1),-1));const N=C.swiperSlideOffset;let D=-180*x,P=0,j=t.params.cssMode?-N-t.translate:-N,M=0;t.isHorizontal()?y&&(D=-D):(M=j,j=0,P=-D,D=0),t.browser&&t.browser.need3dFix&&(Math.abs(D)/90%2===1&&(D+=.001),Math.abs(P)/90%2===1&&(P+=.001)),C.style.zIndex=-Math.abs(Math.round(x))+m.length,_.slideShadows&&l(C,x);const V=`translate3d(${j}px, ${M}px, 0px) rotateX(${P}deg) rotateY(${D}deg)`,G=wP(_,C);G.style.transform=V}},setTransition:m=>{const y=t.slides.map(_=>pw(_));y.forEach(_=>{_.style.transitionDuration=`${m}ms`,_.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(E=>{E.style.transitionDuration=`${m}ms`})}),pF({swiper:t,duration:m,transformElements:y})},recreateShadows:()=>{t.params.flipEffect,t.slides.forEach(m=>{let y=m.progress;t.params.flipEffect.limitRotation&&(y=Math.max(Math.min(m.progress,1),-1)),l(m,y)})},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}function cqe(n){let{swiper:t,extendParams:i,on:s}=n;i({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),Cx({effect:"coverflow",swiper:t,on:s,setTranslate:()=>{const{width:u,height:p,slides:m,slidesSizesGrid:y}=t,_=t.params.coverflowEffect,E=t.isHorizontal(),C=t.translate,x=E?-C+u/2:-C+p/2,N=E?_.rotate:-_.rotate,O=_.depth;for(let D=0,P=m.length;D<P;D+=1){const j=m[D],M=y[D],V=j.swiperSlideOffset,G=(x-V-M/2)/M,$=typeof _.modifier=="function"?_.modifier(G):G*_.modifier;let ne=E?N*$:0,Y=E?0:N*$,le=-O*Math.abs($),re=_.stretch;typeof re=="string"&&re.indexOf("%")!==-1&&(re=parseFloat(_.stretch)/100*M);let ee=E?0:re*$,de=E?re*$:0,H=1-(1-_.scale)*Math.abs($);Math.abs(de)<.001&&(de=0),Math.abs(ee)<.001&&(ee=0),Math.abs(le)<.001&&(le=0),Math.abs(ne)<.001&&(ne=0),Math.abs(Y)<.001&&(Y=0),Math.abs(H)<.001&&(H=0),t.browser&&t.browser.need3dFix&&(Math.abs(ne)/90%2===1&&(ne+=.001),Math.abs(Y)/90%2===1&&(Y+=.001));const ae=`translate3d(${de}px,${ee}px,${le}px) rotateX(${Y}deg) rotateY(${ne}deg) scale(${H})`,_e=wP(_,j);if(_e.style.transform=ae,j.style.zIndex=-Math.abs(Math.round($))+1,_.slideShadows){let me=E?j.querySelector(".swiper-slide-shadow-left"):j.querySelector(".swiper-slide-shadow-top"),Ce=E?j.querySelector(".swiper-slide-shadow-right"):j.querySelector(".swiper-slide-shadow-bottom");me||(me=ix("coverflow",j,E?"left":"top")),Ce||(Ce=ix("coverflow",j,E?"right":"bottom")),me&&(me.style.opacity=$>0?$:0),Ce&&(Ce.style.opacity=-$>0?-$:0)}}},setTransition:u=>{t.slides.map(m=>pw(m)).forEach(m=>{m.style.transitionDuration=`${u}ms`,m.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(y=>{y.style.transitionDuration=`${u}ms`})})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})}function dqe(n){let{swiper:t,extendParams:i,on:s}=n;i({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const l=p=>typeof p=="string"?p:`${p}px`;Cx({effect:"creative",swiper:t,on:s,setTranslate:()=>{const{slides:p,wrapperEl:m,slidesSizesGrid:y}=t,_=t.params.creativeEffect,{progressMultiplier:E}=_,C=t.params.centeredSlides;if(C){const x=y[0]/2-t.params.slidesOffsetBefore||0;m.style.transform=`translateX(calc(50% - ${x}px))`}for(let x=0;x<p.length;x+=1){const N=p[x],O=N.progress,D=Math.min(Math.max(N.progress,-_.limitProgress),_.limitProgress);let P=D;C||(P=Math.min(Math.max(N.originalProgress,-_.limitProgress),_.limitProgress));const j=N.swiperSlideOffset,M=[t.params.cssMode?-j-t.translate:-j,0,0],V=[0,0,0];let G=!1;t.isHorizontal()||(M[1]=M[0],M[0]=0);let $={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};D<0?($=_.next,G=!0):D>0&&($=_.prev,G=!0),M.forEach((H,ae)=>{M[ae]=`calc(${H}px + (${l($.translate[ae])} * ${Math.abs(D*E)}))`}),V.forEach((H,ae)=>{let _e=$.rotate[ae]*Math.abs(D*E);t.browser&&t.browser.need3dFix&&Math.abs(_e)/90%2===1&&(_e+=.001),V[ae]=_e}),N.style.zIndex=-Math.abs(Math.round(O))+p.length;const ne=M.join(", "),Y=`rotateX(${V[0]}deg) rotateY(${V[1]}deg) rotateZ(${V[2]}deg)`,le=P<0?`scale(${1+(1-$.scale)*P*E})`:`scale(${1-(1-$.scale)*P*E})`,re=P<0?1+(1-$.opacity)*P*E:1-(1-$.opacity)*P*E,ee=`translate3d(${ne}) ${Y} ${le}`;if(G&&$.shadow||!G){let H=N.querySelector(".swiper-slide-shadow");if(!H&&$.shadow&&(H=ix("creative",N)),H){const ae=_.shadowPerProgress?D*(1/_.limitProgress):D;H.style.opacity=Math.min(Math.max(Math.abs(ae),0),1)}}const de=wP(_,N);de.style.transform=ee,de.style.opacity=re,$.origin&&(de.style.transformOrigin=$.origin)}},setTransition:p=>{const m=t.slides.map(y=>pw(y));m.forEach(y=>{y.style.transitionDuration=`${p}ms`,y.querySelectorAll(".swiper-slide-shadow").forEach(_=>{_.style.transitionDuration=`${p}ms`})}),pF({swiper:t,duration:p,transformElements:m,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}function uqe(n){let{swiper:t,extendParams:i,on:s}=n;i({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),Cx({effect:"cards",swiper:t,on:s,setTranslate:()=>{const{slides:u,activeIndex:p,rtlTranslate:m}=t,y=t.params.cardsEffect,{startTranslate:_,isTouched:E}=t.touchEventsData,C=m?-t.translate:t.translate;for(let x=0;x<u.length;x+=1){const N=u[x],O=N.progress,D=Math.min(Math.max(O,-4),4);let P=N.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(P-=u[0].swiperSlideOffset);let j=t.params.cssMode?-P-t.translate:-P,M=0;const V=-100*Math.abs(D);let G=1,$=-y.perSlideRotate*D,ne=y.perSlideOffset-Math.abs(D)*.75;const Y=t.virtual&&t.params.virtual.enabled?t.virtual.from+x:x,le=(Y===p||Y===p-1)&&D>0&&D<1&&(E||t.params.cssMode)&&C<_,re=(Y===p||Y===p+1)&&D<0&&D>-1&&(E||t.params.cssMode)&&C>_;if(le||re){const ae=(1-Math.abs((Math.abs(D)-.5)/.5))**.5;$+=-28*D*ae,G+=-.5*ae,ne+=96*ae,M=`${-25*ae*Math.abs(D)}%`}if(D<0?j=`calc(${j}px ${m?"-":"+"} (${ne*Math.abs(D)}%))`:D>0?j=`calc(${j}px ${m?"-":"+"} (-${ne*Math.abs(D)}%))`:j=`${j}px`,!t.isHorizontal()){const ae=M;M=j,j=ae}const ee=D<0?`${1+(1-G)*D}`:`${1-(1-G)*D}`,de=`
translate3d(${j}, ${M}, ${V}px)
rotateZ(${y.rotate?m?-$:$:0}deg)
scale(${ee})
`;if(y.slideShadows){let ae=N.querySelector(".swiper-slide-shadow");ae||(ae=ix("cards",N)),ae&&(ae.style.opacity=Math.min(Math.max((Math.abs(D)-.5)/.5,0),1))}N.style.zIndex=-Math.abs(Math.round(O))+u.length;const H=wP(y,N);H.style.transform=de}},setTransition:u=>{const p=t.slides.map(m=>pw(m));p.forEach(m=>{m.style.transitionDuration=`${u}ms`,m.querySelectorAll(".swiper-slide-shadow").forEach(y=>{y.style.transitionDuration=`${u}ms`})}),pF({swiper:t,duration:u,transformElements:p})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}const hqe=[UKe,FKe,BKe,VKe,zKe,HKe,GKe,WKe,$Ke,KKe,qKe,YKe,XKe,JKe,QKe,ZKe,sqe,aqe,oqe,lqe,cqe,dqe,uqe];Qc.use(hqe);const ps={getAllUsers:async()=>(console.log("Inside Service getAllUsers() ..."),await kn.get("ums/users/dropdown")),getAllRecipients:async n=>(console.log("Inside Service getAllRecipients() ..."),await kn.get(`ums/users/recipients?type=${n}`)),getUserProfile:async()=>(console.log("Inside Service getUserProfile() ..."),await kn.get("ums/users/profile")),updateUserProfile:async n=>(console.log("Inside Service updateUserProfile() ...",n),await kn.post("ums/users/saveprofile",n)),getDashboardWallBanners:async()=>(console.log("Inside Service getDashboardWallBanners() ..."),await kn.get("wall/wallbanner/dashboard")),getDashboardUserStats:async n=>(console.log("Inside Service getDashboardUserStats() ...",n),await kn.get(`metric/metric_report/dashboard_stats${n.isRefresh?"?refresh=1":""}`)),getReloadedDashboardUserStats:async()=>(console.log("Inside Service getReloadedDashboardUserStats() ..."),await kn.get("metric/metric_report/dashboard_stats?refresh=1")),getFormQuickActions:async()=>(console.log("Inside Service getFormQuickActions() ..."),await kn.get("form/formaction/list")),getSignedUploadUrl:async n=>(console.log("Inside Service getSignedUploadUrl() data ...",n),await kn.post("wall/wallmessage/getsigneduploadurl",n)),uploadFileToS3:async n=>{},completeChunkUpload:async n=>(console.log("Inside Service completeChunkUpload() data ...",n),await kn.post("wall/wallmessage/completechunkupload",n)),getDashboardMagazines:async()=>(console.log("Inside Service getDashboardMagazines() ..."),await kn.get("mag/magazine/dashboard")),getAllMagazines:async()=>(console.log("Inside Service getAllMagazines() ..."),await kn.get("mag/magazine/list")),getMagazineDetails:async n=>(console.log("Inside Service getMagazineDetails() ..."),await kn.get(`mag/magazine/details?id=${n}`)),getMagazineMediaDetails:async n=>(console.log("Inside Service getMagazineMediaDetails() ..."),await kn.get(`mag/mag_media/details?id=${n}`)),getMagazineMediaLike:async n=>(console.log("Inside Service getMagazineMediaLike() ..."),await kn.get(`mag/mag_media/like?id=${n}`)),getMagazineMediaLikesList:async n=>(console.log("Inside Service getMagazineMediaLikesList() ..."),await kn.get(`mag/mag_media/likes?id=${n}`)),getAllMagazineMediaCommentList:async n=>(console.log("Inside Service getAllMagazineMediaCommentList() ..."),await kn.get(`mag/mag_media/comments?id=${n}`)),addMagazineMediaComment:async n=>(console.log("Inside Service addMagazineMediaComment() ...",n),await kn.post("mag/mag_media/comment",n))},Xa={getAllDashboardContests:async()=>(console.log("Inside Service getAllDashboardContests() ..."),await kn.get("detailing/contest/dashboard")),getAllContests:async()=>(console.log("Inside Service getAllContests() ..."),await kn.get("detailing/contest/list")),getContestDetails:async n=>(console.log("Inside Service getContestDetails() ..."),await kn.get(`detailing/contest/details?id=${n}`)),getContestSubmissionLike:async n=>(console.log("Inside Service getContestResponseLike() ..."),await kn.get(`detailing/contest_response/like?id=${n}`)),getContestSubmissionLikesList:async n=>(console.log("Inside Service getContestSubmissionLikesList() ..."),await kn.get(`detailing/contest_response/likes?id=${n}`)),getAllContestSubmissionCommentList:async n=>(console.log("Inside Service getAllContestSubmissionCommentList() ..."),await kn.get(`detailing/contest_response/comments?id=${n}`)),addContestSubmissionComment:async n=>(console.log("Inside Service addContestSubmissionComment() ...",n),await kn.post("detailing/contest_response/comment",n)),addContestResponseRecord:async n=>(console.log("Inside Service addContestResponseRecord() ...",n),await kn.post("detailing/contest_response/record",n)),deleteContestResponseRecord:async n=>(console.log("Inside Service deleteContestResponseRecord() ...",n),await kn.get(`detailing/contest_response/delete?id=${n}`)),deleteContestResponseRecordForReattempt:async n=>(console.log("Inside Service deleteContestResponseRecordForReattempt() ...",n),await kn.get(`detailing/contest_response/deleteforreattempt?id=${n}`)),getDetailingContestParameters:async n=>(console.log("Inside Service getDetailingContestParameters() ...",n),await kn.get(`detailing/parameter/list?contest_id=${n}`)),evaluateDetailingContestResponse:async n=>(console.log("Inside Service evaluateDetailingContestResponse() ...",n),await kn.post("detailing/contest_response/evaluate",n)),initializeCallAndGetDetails:async n=>await kn.get(`wall/wallmessage/initializecall?contest_id=${n}`),startVideoRecording:async n=>await kn.get(`wall/wallmessage/startrecording?record_id=${n}`),stopVideoRecording:async n=>await kn.get(`wall/wallmessage/stoprecording?record_id=${n}`),getAllCompetitionContests:async()=>(console.log("Inside Service getAllCompetitionContests() ..."),await kn.get("competition/contest/dashboard"))};function qi(n){const t=tl(),i=n.className?n.className:"";return k.useEffect(()=>{window.scrollTo(0,0)},[t]),h.jsx("div",{className:`page-content-wrapper ${i}`,children:n.children})}function ci(n){let t=n!=null&&n.className?n==null?void 0:n.className:"",i=null;switch(n.type){case"user-profile":i=h.jsxs(et,{className:"placeholder-card shadow1 border-0 mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{className:"pb-0",children:h.jsx("div",{className:"d-flex align-items-center justify-content-between",children:h.jsxs("div",{className:"flex-grow-1 ms-0 text-start",children:[h.jsx("div",{className:"w-100 mb-1",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:5,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn.Button,{"aria-hidden":"true",style:{borderRadius:"20px",width:"100px",height:"20px"},className:"btn-theme btn-sm btn-gray",animation:"glow"})})]})})}),h.jsxs(et.Body,{className:"p2",children:[h.jsx("div",{className:"w-100 mb-3 text-center",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{style:{height:"30px",borderRadius:"5px"},xs:4,bg:"secondary"})})}),h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"200px"},bg:"secondary",as:"div"})})})]})]});break;case"quick-actions":i=h.jsx(et,{className:`card-theme placeholder-card shadow1 border-0 mb2 text-left overflow-hidden ${t}`,children:h.jsxs(et.Body,{className:"p2 text-center",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{className:"rounded-4",style:{width:"80px",height:"80px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-1",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:10,bg:"secondary"})})})]})});break;case"simple-stats":i=h.jsxs(et,{className:`placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden ${t}`,children:[h.jsx(et.Header,{children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"flex-grow-1 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})})}),h.jsx(et.Body,{className:"p2 text-center",children:h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:4,bg:"secondary"})]})})})]});break;case"banners":i=h.jsx(et,{className:`placeholder-card shadow1 border-0 mb2 text-left overflow-hidden ${t}`,children:h.jsx(et.Body,{className:"p2",children:h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})})})});break;case"magazine":i=h.jsxs(et,{className:"card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{className:"border-bottom-0 bg-transparent",children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"flex-grow-1 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})})}),h.jsxs(et.Body,{className:"p-",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})})]})]});break;case"dashboard-magazine":i=h.jsx(et,{className:`card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden ${t}`,children:h.jsxs(et.Body,{className:"p-0",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-2 px-2",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:9,bg:"secondary"})})})]})});break;case"competition-contest":i=h.jsxs(et,{className:"card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{className:"border-bottom-0 bg-transparent",children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"flex-grow-1 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})})}),h.jsxs(et.Body,{className:"p-",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})})]})]});break;case"dashboard-competition-contest":i=h.jsx(et,{className:`card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden ${t}`,children:h.jsxs(et.Body,{className:"p-0",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"50px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-2 px-2",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:8,bg:"secondary"})]})})]})});break;case"likes-list":i=h.jsx(et,{className:"card-theme placeholder-card likes-list-placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:h.jsx(et.Header,{children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-5"})})}),h.jsx("div",{className:"flex-grow-1 ms-3 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})]})})});break;case"notifications-list":i=h.jsx(et,{className:"card-theme placeholder-card notifications-list-placeholder-card border-0 border-bottom bg-transparent rounded-0 mb2 text-left overflow-hidden",children:h.jsx(et.Header,{className:"px-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-3"})})}),h.jsxs("div",{className:"flex-grow-1 ms-3 text-left",children:[h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:3,bg:"secondary"})})})]})]})})});break;case"appreciations-list":i=h.jsx(et,{className:"card-theme placeholder-card appreciation-list-placeholder-card shadow-sm border-0 bg-transparent rounded-0 mb2 text-left overflow-hidden",children:h.jsx(et.Header,{className:"px-2",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-3"})})}),h.jsxs("div",{className:"flex-grow-1 ms-3 text-left",children:[h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:3,bg:"secondary"})})})]})]})})});break;case"comment-list":i=h.jsx(et,{className:"card-theme placeholder-card comment-list-placeholder-card border- shadow-s mb2 text-left overflow-hidden",children:h.jsxs(et.Body,{className:"p-2",children:[h.jsx("div",{className:"d-flex align-items-center flex-column mb-2",children:h.jsx("div",{className:"w-100",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:5,bg:"secondary"})]})})}),h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-5"})})}),h.jsx("div",{className:"flex-grow-1 ms-2 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:4,bg:"secondary"})})})})]})]})});break;case"details":i=h.jsx(et,{className:"placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:h.jsxs(et.Body,{className:"p2",children:[h.jsx("div",{className:"w-100 mb1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:12,bg:"secondary"}),h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:12,bg:"secondary"})]})}),h.jsx("br",{}),h.jsx("div",{className:"w-100 mb1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:12,bg:"secondary"}),h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:12,bg:"secondary"})]})}),h.jsx("br",{}),h.jsx("div",{className:"w-100 mb1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:12,bg:"secondary"}),h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:12,bg:"secondary"})]})})]})});break;case"iframe-loader":i=h.jsx(et,{className:`placeholder-card shadow1 border-0 mb2 text-left overflow-hidden ${t}`,children:h.jsx(et.Body,{className:"p-0",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"500px"},bg:"secondary",as:"div"})})})})});break;default:i=h.jsxs(et,{className:"placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-circle"})})}),h.jsxs("div",{className:"flex-grow-1 ms-3 text-left",children:[h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:4,bg:"secondary"})})})]})]})}),h.jsxs(et.Body,{className:"p2",children:[h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})}),h.jsx("br",{}),h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})})]})]})}return h.jsx(h.Fragment,{children:i})}function fqe(n){var u,p,m,y,_,E,C;const t=(u=n==null?void 0:n.item)!=null&&u.title?(p=n==null?void 0:n.item)==null?void 0:p.title:"Default title",i=(m=n==null?void 0:n.item)==null?void 0:m.value_title;(y=n==null?void 0:n.item)!=null&&y.type;const s=(_=n==null?void 0:n.item)!=null&&_.text?parseInt((E=n==null?void 0:n.item)==null?void 0:E.text):0;(C=n==null?void 0:n.item)==null||C.report_view_url;let l=n!=null&&n.className?n==null?void 0:n.className:"";function d(x){console.log("HandleClick item =",x);let N=`${x.report_view_url}&authorization=${Ai.getToken()}`;console.log("url = ",N),n.handleStatsCardClick(N)}return h.jsxs(et,{className:`border-0 card-theme overflow-hidden me-3 ${l}`,onClick:()=>d(n.item),children:[h.jsx(et.Header,{className:"font-13 border-bottom-0 p-2 p-md-3",children:t}),h.jsx(et.Body,{className:"px-2 py-3",children:h.jsx(fn,{className:"row-cols-1 g-0 d-flex align-items-sm-center pt-sm-3",children:h.jsxs(Gt,{className:"d-flex flex-column text-center",children:[h.jsx("span",{className:"font-20 fw-sb mb-1",children:s}),h.jsx("span",{className:"font-13 mb-0",children:i})]})})})]})}var SP=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},q2=typeof window>"u"||"Deno"in globalThis;function Zc(){}function pqe(n,t){return typeof n=="function"?n(t):n}function xY(n){return typeof n=="number"&&n>=0&&n!==1/0}function X_e(n,t){return Math.max(n+(t||0)-Date.now(),0)}function Kv(n,t){return typeof n=="function"?n(t):n}function sh(n,t){return typeof n=="function"?n(t):n}function gfe(n,t){const{type:i="all",exact:s,fetchStatus:l,predicate:d,queryKey:u,stale:p}=n;if(u){if(s){if(t.queryHash!==RZ(u,t.options))return!1}else if(!wN(t.queryKey,u))return!1}if(i!=="all"){const m=t.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof p=="boolean"&&t.isStale()!==p||l&&l!==t.state.fetchStatus||d&&!d(t))}function vfe(n,t){const{exact:i,status:s,predicate:l,mutationKey:d}=n;if(d){if(!t.options.mutationKey)return!1;if(i){if(EN(t.options.mutationKey)!==EN(d))return!1}else if(!wN(t.options.mutationKey,d))return!1}return!(s&&t.state.status!==s||l&&!l(t))}function RZ(n,t){return((t==null?void 0:t.queryKeyHashFn)||EN)(n)}function EN(n){return JSON.stringify(n,(t,i)=>IY(i)?Object.keys(i).sort().reduce((s,l)=>(s[l]=i[l],s),{}):i)}function wN(n,t){return n===t?!0:typeof n!=typeof t?!1:n&&t&&typeof n=="object"&&typeof t=="object"?Object.keys(t).every(i=>wN(n[i],t[i])):!1}var mqe=Object.prototype.hasOwnProperty;function J_e(n,t){if(n===t)return n;const i=yfe(n)&&yfe(t);if(!i&&!(IY(n)&&IY(t)))return t;const l=(i?n:Object.keys(n)).length,d=i?t:Object.keys(t),u=d.length,p=i?new Array(u):{};let m=0;for(let y=0;y<u;y++){const _=i?y:d[y],E=n[_],C=t[_];if(E===C){p[_]=E,(i?y<l:mqe.call(n,_))&&m++;continue}if(E===null||C===null||typeof E!="object"||typeof C!="object"){p[_]=C;continue}const x=J_e(E,C);p[_]=x,x===E&&m++}return l===u&&m===l?n:p}function AY(n,t){if(!t||Object.keys(n).length!==Object.keys(t).length)return!1;for(const i in n)if(n[i]!==t[i])return!1;return!0}function yfe(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function IY(n){if(!_fe(n))return!1;const t=n.constructor;if(t===void 0)return!0;const i=t.prototype;return!(!_fe(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function _fe(n){return Object.prototype.toString.call(n)==="[object Object]"}function gqe(n){return new Promise(t=>{setTimeout(t,n)})}function NY(n,t,i){return typeof i.structuralSharing=="function"?i.structuralSharing(n,t):i.structuralSharing!==!1?J_e(n,t):t}function vqe(n,t,i=0){const s=[...n,t];return i&&s.length>i?s.slice(1):s}function yqe(n,t,i=0){const s=[t,...n];return i&&s.length>i?s.slice(0,-1):s}var xZ=Symbol();function Q_e(n,t){return!n.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!n.queryFn||n.queryFn===xZ?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function _qe(n,t){return typeof n=="function"?n(...t):!!n}var tE,T1,KC,hme,Eqe=(hme=class extends SP{constructor(){super();J(this,tE,void 0);J(this,T1,void 0);J(this,KC,void 0);te(this,KC,t=>{if(!q2&&window.addEventListener){const i=()=>t();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){b(this,T1)||this.setEventListener(b(this,KC))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,T1))==null||t.call(this),te(this,T1,void 0))}setEventListener(t){var i;te(this,KC,t),(i=b(this,T1))==null||i.call(this),te(this,T1,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){b(this,tE)!==t&&(te(this,tE,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(i=>{i(t)})}isFocused(){var t;return typeof b(this,tE)=="boolean"?b(this,tE):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tE=new WeakMap,T1=new WeakMap,KC=new WeakMap,hme),AZ=new Eqe,qC,R1,YC,fme,wqe=(fme=class extends SP{constructor(){super();J(this,qC,!0);J(this,R1,void 0);J(this,YC,void 0);te(this,YC,t=>{if(!q2&&window.addEventListener){const i=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}})}onSubscribe(){b(this,R1)||this.setEventListener(b(this,YC))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,R1))==null||t.call(this),te(this,R1,void 0))}setEventListener(t){var i;te(this,YC,t),(i=b(this,R1))==null||i.call(this),te(this,R1,t(this.setOnline.bind(this)))}setOnline(t){b(this,qC)!==t&&(te(this,qC,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return b(this,qC)}},qC=new WeakMap,R1=new WeakMap,YC=new WeakMap,fme),Z7=new wqe;function OY(){let n,t;const i=new Promise((l,d)=>{n=l,t=d});i.status="pending",i.catch(()=>{});function s(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{s({status:"fulfilled",value:l}),n(l)},i.reject=l=>{s({status:"rejected",reason:l}),t(l)},i}function Sqe(n){return Math.min(1e3*2**n,3e4)}function Z_e(n){return(n??"online")==="online"?Z7.isOnline():!0}var PY=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function eEe(n){let t=!1,i=0,s;const l=OY(),d=()=>l.status!=="pending",u=O=>{var D;if(!d()){const P=new PY(O);C(P),(D=n.onCancel)==null||D.call(n,P)}},p=()=>{t=!0},m=()=>{t=!1},y=()=>AZ.isFocused()&&(n.networkMode==="always"||Z7.isOnline())&&n.canRun(),_=()=>Z_e(n.networkMode)&&n.canRun(),E=O=>{d()||(s==null||s(),l.resolve(O))},C=O=>{d()||(s==null||s(),l.reject(O))},x=()=>new Promise(O=>{var D;s=P=>{(d()||y())&&O(P)},(D=n.onPause)==null||D.call(n)}).then(()=>{var O;s=void 0,d()||(O=n.onContinue)==null||O.call(n)}),N=()=>{if(d())return;let O;const D=i===0?n.initialPromise:void 0;try{O=D??n.fn()}catch(P){O=Promise.reject(P)}Promise.resolve(O).then(E).catch(P=>{var $;if(d())return;const j=n.retry??(q2?0:3),M=n.retryDelay??Sqe,V=typeof M=="function"?M(i,P):M,G=j===!0||typeof j=="number"&&i<j||typeof j=="function"&&j(i,P);if(t||!G){C(P);return}i++,($=n.onFail)==null||$.call(n,i,P),gqe(V).then(()=>y()?void 0:x()).then(()=>{t?C(P):N()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(s==null||s(),l),cancelRetry:p,continueRetry:m,canStart:_,start:()=>(_()?N():x().then(N),l)}}var bqe=n=>setTimeout(n,0);function Cqe(){let n=[],t=0,i=p=>{p()},s=p=>{p()},l=bqe;const d=p=>{t?n.push(p):l(()=>{i(p)})},u=()=>{const p=n;n=[],p.length&&l(()=>{s(()=>{p.forEach(m=>{i(m)})})})};return{batch:p=>{let m;t++;try{m=p()}finally{t--,t||u()}return m},batchCalls:p=>(...m)=>{d(()=>{p(...m)})},schedule:d,setNotifyFunction:p=>{i=p},setBatchNotifyFunction:p=>{s=p},setScheduler:p=>{l=p}}}var Yo=Cqe(),nE,pme,tEe=(pme=class{constructor(){J(this,nE,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xY(this.gcTime)&&te(this,nE,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(q2?1/0:5*60*1e3))}clearGcTimeout(){b(this,nE)&&(clearTimeout(b(this,nE)),te(this,nE,void 0))}},nE=new WeakMap,pme),XC,JC,Ku,iE,fo,ON,rE,Xh,jm,mme,Tqe=(mme=class extends tEe{constructor(t){super();J(this,Xh);J(this,XC,void 0);J(this,JC,void 0);J(this,Ku,void 0);J(this,iE,void 0);J(this,fo,void 0);J(this,ON,void 0);J(this,rE,void 0);te(this,rE,!1),te(this,ON,t.defaultOptions),this.setOptions(t.options),this.observers=[],te(this,iE,t.client),te(this,Ku,b(this,iE).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,te(this,XC,Rqe(this.options)),this.state=t.state??b(this,XC),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=b(this,fo))==null?void 0:t.promise}setOptions(t){this.options={...b(this,ON),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&b(this,Ku).remove(this)}setData(t,i){const s=NY(this.state.data,t,this.options);return fe(this,Xh,jm).call(this,{data:s,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),s}setState(t,i){fe(this,Xh,jm).call(this,{type:"setState",state:t,setStateOptions:i})}cancel(t){var s,l;const i=(s=b(this,fo))==null?void 0:s.promise;return(l=b(this,fo))==null||l.cancel(t),i?i.then(Zc).catch(Zc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(b(this,XC))}isActive(){return this.observers.some(t=>sh(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xZ||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Kv(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!X_e(this.state.dataUpdatedAt,t)}onFocus(){var i;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(i=b(this,fo))==null||i.continue()}onOnline(){var i;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(i=b(this,fo))==null||i.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),b(this,Ku).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(i=>i!==t),this.observers.length||(b(this,fo)&&(b(this,rE)?b(this,fo).cancel({revert:!0}):b(this,fo).cancelRetry()),this.scheduleGc()),b(this,Ku).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||fe(this,Xh,jm).call(this,{type:"invalidate"})}async fetch(t,i){var m,y,_,E,C,x,N,O,D,P,j,M;if(this.state.fetchStatus!=="idle"&&((m=b(this,fo))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(b(this,fo))return b(this,fo).continueRetry(),b(this,fo).promise}if(t&&this.setOptions(t),!this.options.queryFn){const V=this.observers.find(G=>G.options.queryFn);V&&this.setOptions(V.options)}const s=new AbortController,l=V=>{Object.defineProperty(V,"signal",{enumerable:!0,get:()=>(te(this,rE,!0),s.signal)})},d=()=>{const V=Q_e(this.options,i),$=(()=>{const ne={client:b(this,iE),queryKey:this.queryKey,meta:this.meta};return l(ne),ne})();return te(this,rE,!1),this.options.persister?this.options.persister(V,$,this):V($)},p=(()=>{const V={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:b(this,iE),state:this.state,fetchFn:d};return l(V),V})();(y=this.options.behavior)==null||y.onFetch(p,this),te(this,JC,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((_=p.fetchOptions)==null?void 0:_.meta))&&fe(this,Xh,jm).call(this,{type:"fetch",meta:(E=p.fetchOptions)==null?void 0:E.meta}),te(this,fo,eEe({initialPromise:i==null?void 0:i.initialPromise,fn:p.fetchFn,onCancel:V=>{V instanceof PY&&V.revert&&this.setState({...b(this,JC),fetchStatus:"idle"}),s.abort()},onFail:(V,G)=>{fe(this,Xh,jm).call(this,{type:"failed",failureCount:V,error:G})},onPause:()=>{fe(this,Xh,jm).call(this,{type:"pause"})},onContinue:()=>{fe(this,Xh,jm).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{const V=await b(this,fo).start();if(V===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(V),(x=(C=b(this,Ku).config).onSuccess)==null||x.call(C,V,this),(O=(N=b(this,Ku).config).onSettled)==null||O.call(N,V,this.state.error,this),V}catch(V){if(V instanceof PY){if(V.silent)return b(this,fo).promise;if(V.revert){if(this.state.data===void 0)throw V;return this.state.data}}throw fe(this,Xh,jm).call(this,{type:"error",error:V}),(P=(D=b(this,Ku).config).onError)==null||P.call(D,V,this),(M=(j=b(this,Ku).config).onSettled)==null||M.call(j,this.state.data,V,this),V}finally{this.scheduleGc()}}},XC=new WeakMap,JC=new WeakMap,Ku=new WeakMap,iE=new WeakMap,fo=new WeakMap,ON=new WeakMap,rE=new WeakMap,Xh=new WeakSet,jm=function(t){const i=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...nEe(s.data,this.options),fetchMeta:t.meta??null};case"success":const l={...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return te(this,JC,t.manual?l:void 0),l;case"error":const d=t.error;return{...s,error:d,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=i(this.state),Yo.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),b(this,Ku).notify({query:this,type:"updated",action:t})})},mme);function nEe(n,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z_e(t.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Rqe(n){const t=typeof n.initialData=="function"?n.initialData():n.initialData,i=t!==void 0,s=i?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var pp,gme,xqe=(gme=class extends SP{constructor(t={}){super();J(this,pp,void 0);this.config=t,te(this,pp,new Map)}build(t,i,s){const l=i.queryKey,d=i.queryHash??RZ(l,i);let u=this.get(d);return u||(u=new Tqe({client:t,queryKey:l,queryHash:d,options:t.defaultQueryOptions(i),state:s,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){b(this,pp).has(t.queryHash)||(b(this,pp).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const i=b(this,pp).get(t.queryHash);i&&(t.destroy(),i===t&&b(this,pp).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yo.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return b(this,pp).get(t)}getAll(){return[...b(this,pp).values()]}find(t){const i={exact:!0,...t};return this.getAll().find(s=>gfe(i,s))}findAll(t={}){const i=this.getAll();return Object.keys(t).length>0?i.filter(s=>gfe(t,s)):i}notify(t){Yo.batch(()=>{this.listeners.forEach(i=>{i(t)})})}onFocus(){Yo.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yo.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},pp=new WeakMap,gme),mp,Zl,sE,gp,m1,vme,Aqe=(vme=class extends tEe{constructor(t){super();J(this,gp);J(this,mp,void 0);J(this,Zl,void 0);J(this,sE,void 0);this.mutationId=t.mutationId,te(this,Zl,t.mutationCache),te(this,mp,[]),this.state=t.state||Iqe(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){b(this,mp).includes(t)||(b(this,mp).push(t),this.clearGcTimeout(),b(this,Zl).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){te(this,mp,b(this,mp).filter(i=>i!==t)),this.scheduleGc(),b(this,Zl).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){b(this,mp).length||(this.state.status==="pending"?this.scheduleGc():b(this,Zl).remove(this))}continue(){var t;return((t=b(this,sE))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var d,u,p,m,y,_,E,C,x,N,O,D,P,j,M,V,G,$,ne,Y;const i=()=>{fe(this,gp,m1).call(this,{type:"continue"})};te(this,sE,eEe({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(le,re)=>{fe(this,gp,m1).call(this,{type:"failed",failureCount:le,error:re})},onPause:()=>{fe(this,gp,m1).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>b(this,Zl).canRun(this)}));const s=this.state.status==="pending",l=!b(this,sE).canStart();try{if(s)i();else{fe(this,gp,m1).call(this,{type:"pending",variables:t,isPaused:l}),await((u=(d=b(this,Zl).config).onMutate)==null?void 0:u.call(d,t,this));const re=await((m=(p=this.options).onMutate)==null?void 0:m.call(p,t));re!==this.state.context&&fe(this,gp,m1).call(this,{type:"pending",context:re,variables:t,isPaused:l})}const le=await b(this,sE).start();return await((_=(y=b(this,Zl).config).onSuccess)==null?void 0:_.call(y,le,t,this.state.context,this)),await((C=(E=this.options).onSuccess)==null?void 0:C.call(E,le,t,this.state.context)),await((N=(x=b(this,Zl).config).onSettled)==null?void 0:N.call(x,le,null,this.state.variables,this.state.context,this)),await((D=(O=this.options).onSettled)==null?void 0:D.call(O,le,null,t,this.state.context)),fe(this,gp,m1).call(this,{type:"success",data:le}),le}catch(le){try{throw await((j=(P=b(this,Zl).config).onError)==null?void 0:j.call(P,le,t,this.state.context,this)),await((V=(M=this.options).onError)==null?void 0:V.call(M,le,t,this.state.context)),await(($=(G=b(this,Zl).config).onSettled)==null?void 0:$.call(G,void 0,le,this.state.variables,this.state.context,this)),await((Y=(ne=this.options).onSettled)==null?void 0:Y.call(ne,void 0,le,t,this.state.context)),le}finally{fe(this,gp,m1).call(this,{type:"error",error:le})}}finally{b(this,Zl).runNext(this)}}},mp=new WeakMap,Zl=new WeakMap,sE=new WeakMap,gp=new WeakSet,m1=function(t){const i=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Yo.batch(()=>{b(this,mp).forEach(s=>{s.onMutationUpdate(t)}),b(this,Zl).notify({mutation:this,type:"updated",action:t})})},vme);function Iqe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $m,Jh,PN,yme,Nqe=(yme=class extends SP{constructor(t={}){super();J(this,$m,void 0);J(this,Jh,void 0);J(this,PN,void 0);this.config=t,te(this,$m,new Set),te(this,Jh,new Map),te(this,PN,0)}build(t,i,s){const l=new Aqe({mutationCache:this,mutationId:++ea(this,PN)._,options:t.defaultMutationOptions(i),state:s});return this.add(l),l}add(t){b(this,$m).add(t);const i=J8(t);if(typeof i=="string"){const s=b(this,Jh).get(i);s?s.push(t):b(this,Jh).set(i,[t])}this.notify({type:"added",mutation:t})}remove(t){if(b(this,$m).delete(t)){const i=J8(t);if(typeof i=="string"){const s=b(this,Jh).get(i);if(s)if(s.length>1){const l=s.indexOf(t);l!==-1&&s.splice(l,1)}else s[0]===t&&b(this,Jh).delete(i)}}this.notify({type:"removed",mutation:t})}canRun(t){const i=J8(t);if(typeof i=="string"){const s=b(this,Jh).get(i),l=s==null?void 0:s.find(d=>d.state.status==="pending");return!l||l===t}else return!0}runNext(t){var s;const i=J8(t);if(typeof i=="string"){const l=(s=b(this,Jh).get(i))==null?void 0:s.find(d=>d!==t&&d.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yo.batch(()=>{b(this,$m).forEach(t=>{this.notify({type:"removed",mutation:t})}),b(this,$m).clear(),b(this,Jh).clear()})}getAll(){return Array.from(b(this,$m))}find(t){const i={exact:!0,...t};return this.getAll().find(s=>vfe(i,s))}findAll(t={}){return this.getAll().filter(i=>vfe(t,i))}notify(t){Yo.batch(()=>{this.listeners.forEach(i=>{i(t)})})}resumePausedMutations(){const t=this.getAll().filter(i=>i.state.isPaused);return Yo.batch(()=>Promise.all(t.map(i=>i.continue().catch(Zc))))}},$m=new WeakMap,Jh=new WeakMap,PN=new WeakMap,yme);function J8(n){var t;return(t=n.options.scope)==null?void 0:t.id}function Efe(n){return{onFetch:(t,i)=>{var _,E,C,x,N;const s=t.options,l=(C=(E=(_=t.fetchOptions)==null?void 0:_.meta)==null?void 0:E.fetchMore)==null?void 0:C.direction,d=((x=t.state.data)==null?void 0:x.pages)||[],u=((N=t.state.data)==null?void 0:N.pageParams)||[];let p={pages:[],pageParams:[]},m=0;const y=async()=>{let O=!1;const D=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(t.signal.aborted?O=!0:t.signal.addEventListener("abort",()=>{O=!0}),t.signal)})},P=Q_e(t.options,t.fetchOptions),j=async(M,V,G)=>{if(O)return Promise.reject();if(V==null&&M.pages.length)return Promise.resolve(M);const ne=(()=>{const ee={client:t.client,queryKey:t.queryKey,pageParam:V,direction:G?"backward":"forward",meta:t.options.meta};return D(ee),ee})(),Y=await P(ne),{maxPages:le}=t.options,re=G?yqe:vqe;return{pages:re(M.pages,Y,le),pageParams:re(M.pageParams,V,le)}};if(l&&d.length){const M=l==="backward",V=M?Oqe:wfe,G={pages:d,pageParams:u},$=V(s,G);p=await j(G,$,M)}else{const M=n??d.length;do{const V=m===0?u[0]??s.initialPageParam:wfe(s,p);if(m>0&&V==null)break;p=await j(p,V),m++}while(m<M)}return p};t.options.persister?t.fetchFn=()=>{var O,D;return(D=(O=t.options).persister)==null?void 0:D.call(O,y,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},i)}:t.fetchFn=y}}}function wfe(n,{pages:t,pageParams:i}){const s=t.length-1;return t.length>0?n.getNextPageParam(t[s],t,i[s],i):void 0}function Oqe(n,{pages:t,pageParams:i}){var s;return t.length>0?(s=n.getPreviousPageParam)==null?void 0:s.call(n,t[0],t,i[0],i):void 0}var na,x1,A1,QC,ZC,I1,eT,tT,_me,Pqe=(_me=class{constructor(n={}){J(this,na,void 0);J(this,x1,void 0);J(this,A1,void 0);J(this,QC,void 0);J(this,ZC,void 0);J(this,I1,void 0);J(this,eT,void 0);J(this,tT,void 0);te(this,na,n.queryCache||new xqe),te(this,x1,n.mutationCache||new Nqe),te(this,A1,n.defaultOptions||{}),te(this,QC,new Map),te(this,ZC,new Map),te(this,I1,0)}mount(){ea(this,I1)._++,b(this,I1)===1&&(te(this,eT,AZ.subscribe(async n=>{n&&(await this.resumePausedMutations(),b(this,na).onFocus())})),te(this,tT,Z7.subscribe(async n=>{n&&(await this.resumePausedMutations(),b(this,na).onOnline())})))}unmount(){var n,t;ea(this,I1)._--,b(this,I1)===0&&((n=b(this,eT))==null||n.call(this),te(this,eT,void 0),(t=b(this,tT))==null||t.call(this),te(this,tT,void 0))}isFetching(n){return b(this,na).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return b(this,x1).findAll({...n,status:"pending"}).length}getQueryData(n){var i;const t=this.defaultQueryOptions({queryKey:n});return(i=b(this,na).get(t.queryHash))==null?void 0:i.state.data}ensureQueryData(n){const t=this.defaultQueryOptions(n),i=b(this,na).build(this,t),s=i.state.data;return s===void 0?this.fetchQuery(n):(n.revalidateIfStale&&i.isStaleByTime(Kv(t.staleTime,i))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(n){return b(this,na).findAll(n).map(({queryKey:t,state:i})=>{const s=i.data;return[t,s]})}setQueryData(n,t,i){const s=this.defaultQueryOptions({queryKey:n}),l=b(this,na).get(s.queryHash),d=l==null?void 0:l.state.data,u=pqe(t,d);if(u!==void 0)return b(this,na).build(this,s).setData(u,{...i,manual:!0})}setQueriesData(n,t,i){return Yo.batch(()=>b(this,na).findAll(n).map(({queryKey:s})=>[s,this.setQueryData(s,t,i)]))}getQueryState(n){var i;const t=this.defaultQueryOptions({queryKey:n});return(i=b(this,na).get(t.queryHash))==null?void 0:i.state}removeQueries(n){const t=b(this,na);Yo.batch(()=>{t.findAll(n).forEach(i=>{t.remove(i)})})}resetQueries(n,t){const i=b(this,na);return Yo.batch(()=>(i.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...n},t)))}cancelQueries(n,t={}){const i={revert:!0,...t},s=Yo.batch(()=>b(this,na).findAll(n).map(l=>l.cancel(i)));return Promise.all(s).then(Zc).catch(Zc)}invalidateQueries(n,t={}){return Yo.batch(()=>(b(this,na).findAll(n).forEach(i=>{i.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},t)))}refetchQueries(n,t={}){const i={...t,cancelRefetch:t.cancelRefetch??!0},s=Yo.batch(()=>b(this,na).findAll(n).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let d=l.fetch(void 0,i);return i.throwOnError||(d=d.catch(Zc)),l.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(s).then(Zc)}fetchQuery(n){const t=this.defaultQueryOptions(n);t.retry===void 0&&(t.retry=!1);const i=b(this,na).build(this,t);return i.isStaleByTime(Kv(t.staleTime,i))?i.fetch(t):Promise.resolve(i.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Zc).catch(Zc)}fetchInfiniteQuery(n){return n.behavior=Efe(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Zc).catch(Zc)}ensureInfiniteQueryData(n){return n.behavior=Efe(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return Z7.isOnline()?b(this,x1).resumePausedMutations():Promise.resolve()}getQueryCache(){return b(this,na)}getMutationCache(){return b(this,x1)}getDefaultOptions(){return b(this,A1)}setDefaultOptions(n){te(this,A1,n)}setQueryDefaults(n,t){b(this,QC).set(EN(n),{queryKey:n,defaultOptions:t})}getQueryDefaults(n){const t=[...b(this,QC).values()],i={};return t.forEach(s=>{wN(n,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(n,t){b(this,ZC).set(EN(n),{mutationKey:n,defaultOptions:t})}getMutationDefaults(n){const t=[...b(this,ZC).values()],i={};return t.forEach(s=>{wN(n,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(n){if(n._defaulted)return n;const t={...b(this,A1).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return t.queryHash||(t.queryHash=RZ(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xZ&&(t.enabled=!1),t}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...b(this,A1).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){b(this,na).clear(),b(this,x1).clear()}},na=new WeakMap,x1=new WeakMap,A1=new WeakMap,QC=new WeakMap,ZC=new WeakMap,I1=new WeakMap,eT=new WeakMap,tT=new WeakMap,_me),Kc,ar,LN,ec,aE,nT,Km,N1,DN,iT,rT,oE,lE,O1,sT,cE,r4,kN,LY,MN,DY,jN,kY,UN,MY,FN,jY,BN,UY,VN,FY,v9,iEe,Eme,Lqe=(Eme=class extends SP{constructor(t,i){super();J(this,cE);J(this,kN);J(this,MN);J(this,jN);J(this,UN);J(this,FN);J(this,BN);J(this,VN);J(this,v9);J(this,Kc,void 0);J(this,ar,void 0);J(this,LN,void 0);J(this,ec,void 0);J(this,aE,void 0);J(this,nT,void 0);J(this,Km,void 0);J(this,N1,void 0);J(this,DN,void 0);J(this,iT,void 0);J(this,rT,void 0);J(this,oE,void 0);J(this,lE,void 0);J(this,O1,void 0);J(this,sT,new Set);this.options=i,te(this,Kc,t),te(this,N1,null),te(this,Km,OY()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,ar).addObserver(this),Sfe(b(this,ar),this.options)?fe(this,cE,r4).call(this):this.updateResult(),fe(this,UN,MY).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return BY(b(this,ar),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return BY(b(this,ar),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,fe(this,FN,jY).call(this),fe(this,BN,UY).call(this),b(this,ar).removeObserver(this)}setOptions(t){const i=this.options,s=b(this,ar);if(this.options=b(this,Kc).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sh(this.options.enabled,b(this,ar))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");fe(this,VN,FY).call(this),b(this,ar).setOptions(this.options),i._defaulted&&!AY(this.options,i)&&b(this,Kc).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,ar),observer:this});const l=this.hasListeners();l&&bfe(b(this,ar),s,this.options,i)&&fe(this,cE,r4).call(this),this.updateResult(),l&&(b(this,ar)!==s||sh(this.options.enabled,b(this,ar))!==sh(i.enabled,b(this,ar))||Kv(this.options.staleTime,b(this,ar))!==Kv(i.staleTime,b(this,ar)))&&fe(this,kN,LY).call(this);const d=fe(this,MN,DY).call(this);l&&(b(this,ar)!==s||sh(this.options.enabled,b(this,ar))!==sh(i.enabled,b(this,ar))||d!==b(this,O1))&&fe(this,jN,kY).call(this,d)}getOptimisticResult(t){const i=b(this,Kc).getQueryCache().build(b(this,Kc),t),s=this.createResult(i,t);return kqe(this,s)&&(te(this,ec,s),te(this,nT,this.options),te(this,aE,b(this,ar).state)),s}getCurrentResult(){return b(this,ec)}trackResult(t,i){return new Proxy(t,{get:(s,l)=>(this.trackProp(l),i==null||i(l),l==="promise"&&!this.options.experimental_prefetchInRender&&b(this,Km).status==="pending"&&b(this,Km).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(s,l))})}trackProp(t){b(this,sT).add(t)}getCurrentQuery(){return b(this,ar)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const i=b(this,Kc).defaultQueryOptions(t),s=b(this,Kc).getQueryCache().build(b(this,Kc),i);return s.fetch().then(()=>this.createResult(s,i))}fetch(t){return fe(this,cE,r4).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),b(this,ec)))}createResult(t,i){var le;const s=b(this,ar),l=this.options,d=b(this,ec),u=b(this,aE),p=b(this,nT),y=t!==s?t.state:b(this,LN),{state:_}=t;let E={..._},C=!1,x;if(i._optimisticResults){const re=this.hasListeners(),ee=!re&&Sfe(t,i),de=re&&bfe(t,s,i,l);(ee||de)&&(E={...E,...nEe(_.data,t.options)}),i._optimisticResults==="isRestoring"&&(E.fetchStatus="idle")}let{error:N,errorUpdatedAt:O,status:D}=E;x=E.data;let P=!1;if(i.placeholderData!==void 0&&x===void 0&&D==="pending"){let re;d!=null&&d.isPlaceholderData&&i.placeholderData===(p==null?void 0:p.placeholderData)?(re=d.data,P=!0):re=typeof i.placeholderData=="function"?i.placeholderData((le=b(this,rT))==null?void 0:le.state.data,b(this,rT)):i.placeholderData,re!==void 0&&(D="success",x=NY(d==null?void 0:d.data,re,i),C=!0)}if(i.select&&x!==void 0&&!P)if(d&&x===(u==null?void 0:u.data)&&i.select===b(this,DN))x=b(this,iT);else try{te(this,DN,i.select),x=i.select(x),x=NY(d==null?void 0:d.data,x,i),te(this,iT,x),te(this,N1,null)}catch(re){te(this,N1,re)}b(this,N1)&&(N=b(this,N1),x=b(this,iT),O=Date.now(),D="error");const j=E.fetchStatus==="fetching",M=D==="pending",V=D==="error",G=M&&j,$=x!==void 0,Y={status:D,fetchStatus:E.fetchStatus,isPending:M,isSuccess:D==="success",isError:V,isInitialLoading:G,isLoading:G,data:x,dataUpdatedAt:E.dataUpdatedAt,error:N,errorUpdatedAt:O,failureCount:E.fetchFailureCount,failureReason:E.fetchFailureReason,errorUpdateCount:E.errorUpdateCount,isFetched:E.dataUpdateCount>0||E.errorUpdateCount>0,isFetchedAfterMount:E.dataUpdateCount>y.dataUpdateCount||E.errorUpdateCount>y.errorUpdateCount,isFetching:j,isRefetching:j&&!M,isLoadingError:V&&!$,isPaused:E.fetchStatus==="paused",isPlaceholderData:C,isRefetchError:V&&$,isStale:IZ(t,i),refetch:this.refetch,promise:b(this,Km),isEnabled:sh(i.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const re=H=>{Y.status==="error"?H.reject(Y.error):Y.data!==void 0&&H.resolve(Y.data)},ee=()=>{const H=te(this,Km,Y.promise=OY());re(H)},de=b(this,Km);switch(de.status){case"pending":t.queryHash===s.queryHash&&re(de);break;case"fulfilled":(Y.status==="error"||Y.data!==de.value)&&ee();break;case"rejected":(Y.status!=="error"||Y.error!==de.reason)&&ee();break}}return Y}updateResult(){const t=b(this,ec),i=this.createResult(b(this,ar),this.options);if(te(this,aE,b(this,ar).state),te(this,nT,this.options),b(this,aE).data!==void 0&&te(this,rT,b(this,ar)),AY(i,t))return;te(this,ec,i);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,d=typeof l=="function"?l():l;if(d==="all"||!d&&!b(this,sT).size)return!0;const u=new Set(d??b(this,sT));return this.options.throwOnError&&u.add("error"),Object.keys(b(this,ec)).some(p=>{const m=p;return b(this,ec)[m]!==t[m]&&u.has(m)})};fe(this,v9,iEe).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&fe(this,UN,MY).call(this)}},Kc=new WeakMap,ar=new WeakMap,LN=new WeakMap,ec=new WeakMap,aE=new WeakMap,nT=new WeakMap,Km=new WeakMap,N1=new WeakMap,DN=new WeakMap,iT=new WeakMap,rT=new WeakMap,oE=new WeakMap,lE=new WeakMap,O1=new WeakMap,sT=new WeakMap,cE=new WeakSet,r4=function(t){fe(this,VN,FY).call(this);let i=b(this,ar).fetch(this.options,t);return t!=null&&t.throwOnError||(i=i.catch(Zc)),i},kN=new WeakSet,LY=function(){fe(this,FN,jY).call(this);const t=Kv(this.options.staleTime,b(this,ar));if(q2||b(this,ec).isStale||!xY(t))return;const s=X_e(b(this,ec).dataUpdatedAt,t)+1;te(this,oE,setTimeout(()=>{b(this,ec).isStale||this.updateResult()},s))},MN=new WeakSet,DY=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,ar)):this.options.refetchInterval)??!1},jN=new WeakSet,kY=function(t){fe(this,BN,UY).call(this),te(this,O1,t),!(q2||sh(this.options.enabled,b(this,ar))===!1||!xY(b(this,O1))||b(this,O1)===0)&&te(this,lE,setInterval(()=>{(this.options.refetchIntervalInBackground||AZ.isFocused())&&fe(this,cE,r4).call(this)},b(this,O1)))},UN=new WeakSet,MY=function(){fe(this,kN,LY).call(this),fe(this,jN,kY).call(this,fe(this,MN,DY).call(this))},FN=new WeakSet,jY=function(){b(this,oE)&&(clearTimeout(b(this,oE)),te(this,oE,void 0))},BN=new WeakSet,UY=function(){b(this,lE)&&(clearInterval(b(this,lE)),te(this,lE,void 0))},VN=new WeakSet,FY=function(){const t=b(this,Kc).getQueryCache().build(b(this,Kc),this.options);if(t===b(this,ar))return;const i=b(this,ar);te(this,ar,t),te(this,LN,t.state),this.hasListeners()&&(i==null||i.removeObserver(this),t.addObserver(this))},v9=new WeakSet,iEe=function(t){Yo.batch(()=>{t.listeners&&this.listeners.forEach(i=>{i(b(this,ec))}),b(this,Kc).getQueryCache().notify({query:b(this,ar),type:"observerResultsUpdated"})})},Eme);function Dqe(n,t){return sh(t.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&t.retryOnMount===!1)}function Sfe(n,t){return Dqe(n,t)||n.state.data!==void 0&&BY(n,t,t.refetchOnMount)}function BY(n,t,i){if(sh(t.enabled,n)!==!1&&Kv(t.staleTime,n)!=="static"){const s=typeof i=="function"?i(n):i;return s==="always"||s!==!1&&IZ(n,t)}return!1}function bfe(n,t,i,s){return(n!==t||sh(s.enabled,n)===!1)&&(!i.suspense||n.state.status!=="error")&&IZ(n,i)}function IZ(n,t){return sh(t.enabled,n)!==!1&&n.isStaleByTime(Kv(t.staleTime,n))}function kqe(n,t){return!AY(n.getCurrentResult(),t)}var rEe=k.createContext(void 0),Mqe=n=>{const t=k.useContext(rEe);if(n)return n;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jqe=({client:n,children:t})=>(k.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),h.jsx(rEe.Provider,{value:n,children:t})),sEe=k.createContext(!1),Uqe=()=>k.useContext(sEe);sEe.Provider;function Fqe(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Bqe=k.createContext(Fqe()),Vqe=()=>k.useContext(Bqe),zqe=(n,t)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(t.isReset()||(n.retryOnMount=!1))},Hqe=n=>{k.useEffect(()=>{n.clearReset()},[n])},Gqe=({result:n,errorResetBoundary:t,throwOnError:i,query:s,suspense:l})=>n.isError&&!t.isReset()&&!n.isFetching&&s&&(l&&n.data===void 0||_qe(i,[n.error,s])),Wqe=n=>{if(n.suspense){const i=l=>l==="static"?l:Math.max(l??1e3,1e3),s=n.staleTime;n.staleTime=typeof s=="function"?(...l)=>i(s(...l)):i(s),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},$qe=(n,t)=>n.isLoading&&n.isFetching&&!t,Kqe=(n,t)=>(n==null?void 0:n.suspense)&&t.isPending,Cfe=(n,t,i)=>t.fetchOptimistic(n).catch(()=>{i.clearReset()});function qqe(n,t,i){var E,C,x,N,O;const s=Uqe(),l=Vqe(),d=Mqe(i),u=d.defaultQueryOptions(n);(C=(E=d.getDefaultOptions().queries)==null?void 0:E._experimental_beforeQuery)==null||C.call(E,u),u._optimisticResults=s?"isRestoring":"optimistic",Wqe(u),zqe(u,l),Hqe(l);const p=!d.getQueryCache().get(u.queryHash),[m]=k.useState(()=>new t(d,u)),y=m.getOptimisticResult(u),_=!s&&n.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(D=>{const P=_?m.subscribe(Yo.batchCalls(D)):Zc;return m.updateResult(),P},[m,_]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),k.useEffect(()=>{m.setOptions(u)},[u,m]),Kqe(u,y))throw Cfe(u,m,l);if(Gqe({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:d.getQueryCache().get(u.queryHash),suspense:u.suspense}))throw y.error;if((N=(x=d.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||N.call(x,u,y),u.experimental_prefetchInRender&&!q2&&$qe(y,s)){const D=p?Cfe(u,m,l):(O=d.getQueryCache().get(u.queryHash))==null?void 0:O.promise;D==null||D.catch(Zc).finally(()=>{m.updateResult()})}return u.notifyOnChangeProps?y:m.trackResult(y)}function ru(n,t){return qqe(n,Lqe,t)}const Yqe="modulepreload",Xqe=function(n){return"/"+n},Tfe={},lr=function(t,i,s){let l=Promise.resolve();if(i&&i.length>0){const d=document.getElementsByTagName("link");l=Promise.all(i.map(u=>{if(u=Xqe(u),u in Tfe)return;Tfe[u]=!0;const p=u.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(!!s)for(let E=d.length-1;E>=0;E--){const C=d[E];if(C.href===u&&(!p||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${m}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":Yqe,p||(_.as="script",_.crossOrigin=""),_.href=u,document.head.appendChild(_),p)return new Promise((E,C)=>{_.addEventListener("load",E),_.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${u}`)))})}))}return l.then(()=>t()).catch(d=>{const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=d,window.dispatchEvent(u),!u.defaultPrevented)throw d})};/*! Capacitor: https://capacitorjs.com/ - MIT License */var rx;(function(n){n.Unimplemented="UNIMPLEMENTED",n.Unavailable="UNAVAILABLE"})(rx||(rx={}));class RK extends Error{constructor(t,i,s){super(t),this.message=t,this.code=i,this.data=s}}const Jqe=n=>{var t,i;return n!=null&&n.androidBridge?"android":!((i=(t=n==null?void 0:n.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||i===void 0)&&i.bridge?"ios":"web"},Qqe=n=>{const t=n.CapacitorCustomPlatform||null,i=n.Capacitor||{},s=i.Plugins=i.Plugins||{},l=()=>t!==null?t.name:Jqe(n),d=()=>l()!=="web",u=E=>{const C=y.get(E);return!!(C!=null&&C.platforms.has(l())||p(E))},p=E=>{var C;return(C=i.PluginHeaders)===null||C===void 0?void 0:C.find(x=>x.name===E)},m=E=>n.console.error(E),y=new Map,_=(E,C={})=>{const x=y.get(E);if(x)return console.warn(`Capacitor plugin "${E}" already registered. Cannot register plugins twice.`),x.proxy;const N=l(),O=p(E);let D;const P=async()=>(!D&&N in C?D=typeof C[N]=="function"?D=await C[N]():D=C[N]:t!==null&&!D&&"web"in C&&(D=typeof C.web=="function"?D=await C.web():D=C.web),D),j=(Y,le)=>{var re,ee;if(O){const de=O==null?void 0:O.methods.find(H=>le===H.name);if(de)return de.rtype==="promise"?H=>i.nativePromise(E,le.toString(),H):(H,ae)=>i.nativeCallback(E,le.toString(),H,ae);if(Y)return(re=Y[le])===null||re===void 0?void 0:re.bind(Y)}else{if(Y)return(ee=Y[le])===null||ee===void 0?void 0:ee.bind(Y);throw new RK(`"${E}" plugin is not implemented on ${N}`,rx.Unimplemented)}},M=Y=>{let le;const re=(...ee)=>{const de=P().then(H=>{const ae=j(H,Y);if(ae){const _e=ae(...ee);return le=_e==null?void 0:_e.remove,_e}else throw new RK(`"${E}.${Y}()" is not implemented on ${N}`,rx.Unimplemented)});return Y==="addListener"&&(de.remove=async()=>le()),de};return re.toString=()=>`${Y.toString()}() { [capacitor code] }`,Object.defineProperty(re,"name",{value:Y,writable:!1,configurable:!1}),re},V=M("addListener"),G=M("removeListener"),$=(Y,le)=>{const re=V({eventName:Y},le),ee=async()=>{const H=await re;G({eventName:Y,callbackId:H},le)},de=new Promise(H=>re.then(()=>H({remove:ee})));return de.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await ee()},de},ne=new Proxy({},{get(Y,le){switch(le){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return O?$:V;case"removeListener":return G;default:return M(le)}}});return s[E]=ne,y.set(E,{name:E,proxy:ne,platforms:new Set([...Object.keys(C),...O?[N]:[]])}),ne};return i.convertFileSrc||(i.convertFileSrc=E=>E),i.getPlatform=l,i.handleError=m,i.isNativePlatform=d,i.isPluginAvailable=u,i.registerPlugin=_,i.Exception=RK,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i},Zqe=n=>n.Capacitor=Qqe(n),VY=Zqe(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof Xo<"u"?Xo:{}),lu=VY.registerPlugin;class aEe{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,i){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(i);const d=this.windowListeners[t];d&&!d.registered&&this.addWindowListener(d),s&&this.sendRetainedArgumentsForEvent(t);const u=async()=>this.removeListener(t,i);return Promise.resolve({remove:u})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,i,s){const l=this.listeners[t];if(!l){if(s){let d=this.retainedEventArguments[t];d||(d=[]),d.push(i),this.retainedEventArguments[t]=d}return}l.forEach(d=>d(i))}hasListeners(t){var i;return!!(!((i=this.listeners[t])===null||i===void 0)&&i.length)}registerWindowListener(t,i){this.windowListeners[i]={registered:!1,windowEventName:t,pluginEventName:i,handler:s=>{this.notifyListeners(i,s)}}}unimplemented(t="not implemented"){return new VY.Exception(t,rx.Unimplemented)}unavailable(t="not available"){return new VY.Exception(t,rx.Unavailable)}async removeListener(t,i){const s=this.listeners[t];if(!s)return;const l=s.indexOf(i);this.listeners[t].splice(l,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const i=this.retainedEventArguments[t];i&&(delete this.retainedEventArguments[t],i.forEach(s=>{this.notifyListeners(t,s)}))}}const Rfe=n=>encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),xfe=n=>n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class eYe extends aEe{async getCookies(){const t=document.cookie,i={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[l,d]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");l=xfe(l).trim(),d=xfe(d).trim(),i[l]=d}),i}async setCookie(t){try{const i=Rfe(t.key),s=Rfe(t.value),l=`; expires=${(t.expires||"").replace("expires=","")}`,d=(t.path||"/").replace("path=",""),u=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${i}=${s||""}${l}; path=${d}; ${u};`}catch(i){return Promise.reject(i)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(i){return Promise.reject(i)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const i of t)document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}lu("CapacitorCookies",{web:()=>new eYe});const tYe=async n=>new Promise((t,i)=>{const s=new FileReader;s.onload=()=>{const l=s.result;t(l.indexOf(",")>=0?l.split(",")[1]:l)},s.onerror=l=>i(l),s.readAsDataURL(n)}),nYe=(n={})=>{const t=Object.keys(n);return Object.keys(n).map(l=>l.toLocaleLowerCase()).reduce((l,d,u)=>(l[d]=n[t[u]],l),{})},iYe=(n,t=!0)=>n?Object.entries(n).reduce((s,l)=>{const[d,u]=l;let p,m;return Array.isArray(u)?(m="",u.forEach(y=>{p=t?encodeURIComponent(y):y,m+=`${d}=${p}&`}),m.slice(0,-1)):(p=t?encodeURIComponent(u):u,m=`${d}=${p}`),`${s}&${m}`},"").substr(1):null,rYe=(n,t={})=>{const i=Object.assign({method:n.method||"GET",headers:n.headers},t),l=nYe(n.headers)["content-type"]||"";if(typeof n.data=="string")i.body=n.data;else if(l.includes("application/x-www-form-urlencoded")){const d=new URLSearchParams;for(const[u,p]of Object.entries(n.data||{}))d.set(u,p);i.body=d.toString()}else if(l.includes("multipart/form-data")||n.data instanceof FormData){const d=new FormData;if(n.data instanceof FormData)n.data.forEach((p,m)=>{d.append(m,p)});else for(const p of Object.keys(n.data))d.append(p,n.data[p]);i.body=d;const u=new Headers(i.headers);u.delete("content-type"),i.headers=u}else(l.includes("application/json")||typeof n.data=="object")&&(i.body=JSON.stringify(n.data));return i};class sYe extends aEe{async request(t){const i=rYe(t,t.webFetchExtra),s=iYe(t.params,t.shouldEncodeUrlParams),l=s?`${t.url}?${s}`:t.url,d=await fetch(l,i),u=d.headers.get("content-type")||"";let{responseType:p="text"}=d.ok?t:{};u.includes("application/json")&&(p="json");let m,y;switch(p){case"arraybuffer":case"blob":y=await d.blob(),m=await tYe(y);break;case"json":m=await d.json();break;case"document":case"text":default:m=await d.text()}const _={};return d.headers.forEach((E,C)=>{_[C]=E}),{data:m,headers:_,status:d.status,url:d.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}lu("CapacitorHttp",{web:()=>new sYe});const sx=lu("Browser",{web:()=>lr(()=>import("./web-B1JEa_Q8.js"),__vite__mapDeps([])).then(n=>new n.BrowserWeb)}),Y2="#00aed9",oEe="#fafafa",Afe="messageUsers",aYe="messageUserListFetchedOn";function oYe(){ji();const[n,t]=k.useState(!1),i=async({queryKey:E})=>{var N,O;const[C,x]=E;try{const D=await ps.getDashboardUserStats(x);return D.data.status==="success"?(O=(N=D.data)==null?void 0:N.data)==null?void 0:O.stats:null}catch{throw new Error("Error fetching quick actions")}},{isFetching:s,isPending:l,isError:d,data:u,error:p,refetch:m}=ru({queryKey:["dashboardUserStatsQuery",{isRefresh:n}],queryFn:i});async function y(){t(!0)}const _=async E=>{await sx.open({url:E,toolbarColor:Y2})};return l?h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((E,C)=>h.jsx(ci,{type:"simple-stats",className:"card-theme overflow-hidden card-width-40 me-3"},C))})}):d?h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more stats"})}):h.jsx(h.Fragment,{children:s&&(u==null?void 0:u.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((E,C)=>h.jsx(ci,{type:"simple-stats",className:"card-theme overflow-hidden card-width-40 me-3"},C))})})}):h.jsx(h.Fragment,{children:(u==null?void 0:u.length)>0&&h.jsxs(Yn,{className:"pt-1 pb-1 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Performance stats"}),h.jsx(Lt,{variant:"link",size:"sm",className:"btn-theme font-12 fw-sb pe-0 d-none",children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:u.map((E,C)=>h.jsx(fqe,{item:E,className:"card-width-40 shadow-sm dashboard-stats-card",handleStatsCardClick:_},`${E==null?void 0:E.value_title}-${C}`))}),h.jsx("div",{className:"text-center pt-2 pb-1",children:h.jsxs(Lt,{variant:"secondary",size:"sm",className:"btn-theme btn-secondary rounded- font-14",onClick:y,disabled:s,children:[h.jsx(tn,{tag:"reload3",className:`${s?"rotate-anime":""}`})," ","Reload Stats"]})})]})})})}(function(n){var t={};function i(s){if(t[s])return t[s].exports;var l=t[s]={i:s,l:!1,exports:{}};return n[s].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=n,i.c=t,i.d=function(s,l,d){i.o(s,l)||Object.defineProperty(s,l,{enumerable:!0,get:d})},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},i.t=function(s,l){if(1&l&&(s=i(s)),8&l||4&l&&typeof s=="object"&&s&&s.__esModule)return s;var d=Object.create(null);if(i.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:s}),2&l&&typeof s!="string")for(var u in s)i.d(d,u,(function(p){return s[p]}).bind(null,u));return d},i.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(l,"a",l),l},i.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},i.p="",i(i.s=32)})([function(n,t,i){n.exports=i(27)()},function(n,t,i){n.exports=i(25)},function(n,t,i){n.exports=i(21)},function(n,t,i){var s=i(20);n.exports=function(l){for(var d=1;d<arguments.length;d++)if(d%2){var u=arguments[d]!=null?arguments[d]:{},p=Object.keys(u);typeof Object.getOwnPropertySymbols=="function"&&(p=p.concat(Object.getOwnPropertySymbols(u).filter(function(m){return Object.getOwnPropertyDescriptor(u,m).enumerable}))),p.forEach(function(m){s(l,m,u[m])})}else Object.defineProperties(l,Object.getOwnPropertyDescriptors(arguments[d]));return l}},function(n,t){function i(s,l,d,u,p,m,y){try{var _=s[m](y),E=_.value}catch(C){return void d(C)}_.done?l(E):Promise.resolve(E).then(u,p)}n.exports=function(s){return function(){var l=this,d=arguments;return new Promise(function(u,p){var m=s.apply(l,d);function y(E){i(m,u,p,y,_,"next",E)}function _(E){i(m,u,p,y,_,"throw",E)}y(void 0)})}}},function(n,t){function i(s){return n.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},i(s)}n.exports=i},function(n,t){n.exports=function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}},function(n,t){function i(s,l){for(var d=0;d<l.length;d++){var u=l[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(s,u.key,u)}}n.exports=function(s,l,d){return l&&i(s.prototype,l),d&&i(s,d),s}},function(n,t,i){var s=i(22),l=i(9);n.exports=function(d,u){return!u||s(u)!=="object"&&typeof u!="function"?l(d):u}},function(n,t){n.exports=function(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}},function(n,t,i){var s=i(23);n.exports=function(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),d&&s(l,d)}},function(n,t,i){var s=i(29),l=i(30),d=i(31);n.exports=function(u,p){return s(u)||l(u,p)||d()}},function(n,t,i){var s=i(17),l=i(18),d=i(19);n.exports=function(u){return s(u)||l(u)||d()}},function(n,t,i){i(5);var s=i(24);function l(d,u,p){return typeof Reflect<"u"&&Reflect.get?n.exports=l=Reflect.get:n.exports=l=function(m,y,_){var E=s(m,y);if(E){var C=Object.getOwnPropertyDescriptor(E,y);return C.get?C.get.call(_):C.value}},l(d,u,p||d)}n.exports=l},function(n,t){n.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgOCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMzMzMzMzIj48cGF0aCBkPSJNMSwxNCBDMC40LDE0IDAsMTMuNiAwLDEzIEwwLDEgQzAsMC40IDAuNCwwIDEsMCBDMS42LDAgMiwwLjQgMiwxIEwyLDEzIEMyLDEzLjYgMS42LDE0IDEsMTQgWiIgaWQ9IlBhdGgiPjwvcGF0aD48cGF0aCBkPSJNNywxNCBDNi40LDE0IDYsMTMuNiA2LDEzIEw2LDEgQzYsMC40IDYuNCwwIDcsMCBDNy42LDAgOCwwLjQgOCwxIEw4LDEzIEM4LDEzLjYgNy42LDE0IDcsMTQgWiIgaWQ9IlBhdGgiPjwvcGF0aD48L2c+PC9zdmc+Cg=="},function(n,t){n.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTQgMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTUuMCwgMC4wKSIgZmlsbD0iIzMzMzMzMyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNC4wLCAwLjApIj48cG9seWdvbiBwb2ludHM9IjcuNzE5IDQuOTY0IDEyLjY5MiAwLjAxNyAxNC4zODkgMS43MTUgOS40MTIgNi42NjYgMTQuMzU0IDExLjYzNCAxMi42NTcgMTMuMzMxIDYuMDE3IDYuNjU3IDcuNzE1IDQuOTYwIj48L3BvbHlnb24+PHBvbHlnb24gcG9pbnRzPSI3LjYxMiA0Ljk2NCA3LjYxNiA0Ljk2MCA5LjMxMyA2LjY1NyAyLjY3NCAxMy4zMzEgMC45NzcgMTEuNjM0IDUuOTE5IDYuNjY2IDAuOTQyIDEuNzE1IDIuNjM5IDAuMDE3Ij48L3BvbHlnb24+PC9nPjwvZz48L3N2Zz4K"},function(n,t){n.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGc+PHBhdGggZD0iTTAuNSwxNC45IEMwLjIsMTQuNyAwLDE0LjQgMCwxNCBMMCwyIEMwLDEuNiAwLjIsMS4zIDAuNSwxLjEgQzAuOCwwLjkgMS4yLDAuOSAxLjUsMS4xIEwxMC41LDcuMSBDMTAuOCw3LjMgMTAuOSw3LjYgMTAuOSw3LjkgQzEwLjksOC4yIDEwLjcsOC41IDEwLjUsOC43IEwxLjUsMTQuNyBDMS40LDE0LjkgMC44LDE1LjEgMC41LDE0LjkgWiBNMiwzLjkgTDIsMTIuMiBMOC4yLDguMSBMMiwzLjkgWiI+PC9wYXRoPjwvZz48L3N2Zz4K"},function(n,t){n.exports=function(i){if(Array.isArray(i)){for(var s=0,l=new Array(i.length);s<i.length;s++)l[s]=i[s];return l}}},function(n,t){n.exports=function(i){if(Symbol.iterator in Object(i)||Object.prototype.toString.call(i)==="[object Arguments]")return Array.from(i)}},function(n,t){n.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(n,t){n.exports=function(i,s,l){return s in i?Object.defineProperty(i,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[s]=l,i}},function(n,t,i){var s=function(l){var d,u=Object.prototype,p=u.hasOwnProperty,m=typeof Symbol=="function"?Symbol:{},y=m.iterator||"@@iterator",_=m.asyncIterator||"@@asyncIterator",E=m.toStringTag||"@@toStringTag";function C(he,pe,Oe,Fe){var Ue=pe&&pe.prototype instanceof M?pe:M,Ve=Object.create(Ue.prototype),Re=new _e(Fe||[]);return Ve._invoke=function(Be,Xe,we){var We=N;return function(st,pt){if(We===D)throw new Error("Generator is already running");if(We===P){if(st==="throw")throw pt;return Ce()}for(we.method=st,we.arg=pt;;){var Qe=we.delegate;if(Qe){var Je=de(Qe,we);if(Je){if(Je===j)continue;return Je}}if(we.method==="next")we.sent=we._sent=we.arg;else if(we.method==="throw"){if(We===N)throw We=P,we.arg;we.dispatchException(we.arg)}else we.method==="return"&&we.abrupt("return",we.arg);We=D;var St=x(Be,Xe,we);if(St.type==="normal"){if(We=we.done?P:O,St.arg===j)continue;return{value:St.arg,done:we.done}}St.type==="throw"&&(We=P,we.method="throw",we.arg=St.arg)}}}(he,Oe,Re),Ve}function x(he,pe,Oe){try{return{type:"normal",arg:he.call(pe,Oe)}}catch(Fe){return{type:"throw",arg:Fe}}}l.wrap=C;var N="suspendedStart",O="suspendedYield",D="executing",P="completed",j={};function M(){}function V(){}function G(){}var $={};$[y]=function(){return this};var ne=Object.getPrototypeOf,Y=ne&&ne(ne(me([])));Y&&Y!==u&&p.call(Y,y)&&($=Y);var le=G.prototype=M.prototype=Object.create($);function re(he){["next","throw","return"].forEach(function(pe){he[pe]=function(Oe){return this._invoke(pe,Oe)}})}function ee(he){var pe;this._invoke=function(Oe,Fe){function Ue(){return new Promise(function(Ve,Re){(function Be(Xe,we,We,st){var pt=x(he[Xe],he,we);if(pt.type!=="throw"){var Qe=pt.arg,Je=Qe.value;return Je&&typeof Je=="object"&&p.call(Je,"__await")?Promise.resolve(Je.__await).then(function(St){Be("next",St,We,st)},function(St){Be("throw",St,We,st)}):Promise.resolve(Je).then(function(St){Qe.value=St,We(Qe)},function(St){return Be("throw",St,We,st)})}st(pt.arg)})(Oe,Fe,Ve,Re)})}return pe=pe?pe.then(Ue,Ue):Ue()}}function de(he,pe){var Oe=he.iterator[pe.method];if(Oe===d){if(pe.delegate=null,pe.method==="throw"){if(he.iterator.return&&(pe.method="return",pe.arg=d,de(he,pe),pe.method==="throw"))return j;pe.method="throw",pe.arg=new TypeError("The iterator does not provide a 'throw' method")}return j}var Fe=x(Oe,he.iterator,pe.arg);if(Fe.type==="throw")return pe.method="throw",pe.arg=Fe.arg,pe.delegate=null,j;var Ue=Fe.arg;return Ue?Ue.done?(pe[he.resultName]=Ue.value,pe.next=he.nextLoc,pe.method!=="return"&&(pe.method="next",pe.arg=d),pe.delegate=null,j):Ue:(pe.method="throw",pe.arg=new TypeError("iterator result is not an object"),pe.delegate=null,j)}function H(he){var pe={tryLoc:he[0]};1 in he&&(pe.catchLoc=he[1]),2 in he&&(pe.finallyLoc=he[2],pe.afterLoc=he[3]),this.tryEntries.push(pe)}function ae(he){var pe=he.completion||{};pe.type="normal",delete pe.arg,he.completion=pe}function _e(he){this.tryEntries=[{tryLoc:"root"}],he.forEach(H,this),this.reset(!0)}function me(he){if(he){var pe=he[y];if(pe)return pe.call(he);if(typeof he.next=="function")return he;if(!isNaN(he.length)){var Oe=-1,Fe=function Ue(){for(;++Oe<he.length;)if(p.call(he,Oe))return Ue.value=he[Oe],Ue.done=!1,Ue;return Ue.value=d,Ue.done=!0,Ue};return Fe.next=Fe}}return{next:Ce}}function Ce(){return{value:d,done:!0}}return V.prototype=le.constructor=G,G.constructor=V,G[E]=V.displayName="GeneratorFunction",l.isGeneratorFunction=function(he){var pe=typeof he=="function"&&he.constructor;return!!pe&&(pe===V||(pe.displayName||pe.name)==="GeneratorFunction")},l.mark=function(he){return Object.setPrototypeOf?Object.setPrototypeOf(he,G):(he.__proto__=G,E in he||(he[E]="GeneratorFunction")),he.prototype=Object.create(le),he},l.awrap=function(he){return{__await:he}},re(ee.prototype),ee.prototype[_]=function(){return this},l.AsyncIterator=ee,l.async=function(he,pe,Oe,Fe){var Ue=new ee(C(he,pe,Oe,Fe));return l.isGeneratorFunction(pe)?Ue:Ue.next().then(function(Ve){return Ve.done?Ve.value:Ue.next()})},re(le),le[E]="Generator",le[y]=function(){return this},le.toString=function(){return"[object Generator]"},l.keys=function(he){var pe=[];for(var Oe in he)pe.push(Oe);return pe.reverse(),function Fe(){for(;pe.length;){var Ue=pe.pop();if(Ue in he)return Fe.value=Ue,Fe.done=!1,Fe}return Fe.done=!0,Fe}},l.values=me,_e.prototype={constructor:_e,reset:function(he){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(ae),!he)for(var pe in this)pe.charAt(0)==="t"&&p.call(this,pe)&&!isNaN(+pe.slice(1))&&(this[pe]=d)},stop:function(){this.done=!0;var he=this.tryEntries[0].completion;if(he.type==="throw")throw he.arg;return this.rval},dispatchException:function(he){if(this.done)throw he;var pe=this;function Oe(Xe,we){return Ve.type="throw",Ve.arg=he,pe.next=Xe,we&&(pe.method="next",pe.arg=d),!!we}for(var Fe=this.tryEntries.length-1;0<=Fe;--Fe){var Ue=this.tryEntries[Fe],Ve=Ue.completion;if(Ue.tryLoc==="root")return Oe("end");if(Ue.tryLoc<=this.prev){var Re=p.call(Ue,"catchLoc"),Be=p.call(Ue,"finallyLoc");if(Re&&Be){if(this.prev<Ue.catchLoc)return Oe(Ue.catchLoc,!0);if(this.prev<Ue.finallyLoc)return Oe(Ue.finallyLoc)}else if(Re){if(this.prev<Ue.catchLoc)return Oe(Ue.catchLoc,!0)}else{if(!Be)throw new Error("try statement without catch or finally");if(this.prev<Ue.finallyLoc)return Oe(Ue.finallyLoc)}}}},abrupt:function(he,pe){for(var Oe=this.tryEntries.length-1;0<=Oe;--Oe){var Fe=this.tryEntries[Oe];if(Fe.tryLoc<=this.prev&&p.call(Fe,"finallyLoc")&&this.prev<Fe.finallyLoc){var Ue=Fe;break}}Ue&&(he==="break"||he==="continue")&&Ue.tryLoc<=pe&&pe<=Ue.finallyLoc&&(Ue=null);var Ve=Ue?Ue.completion:{};return Ve.type=he,Ve.arg=pe,Ue?(this.method="next",this.next=Ue.finallyLoc,j):this.complete(Ve)},complete:function(he,pe){if(he.type==="throw")throw he.arg;return he.type==="break"||he.type==="continue"?this.next=he.arg:he.type==="return"?(this.rval=this.arg=he.arg,this.method="return",this.next="end"):he.type==="normal"&&pe&&(this.next=pe),j},finish:function(he){for(var pe=this.tryEntries.length-1;0<=pe;--pe){var Oe=this.tryEntries[pe];if(Oe.finallyLoc===he)return this.complete(Oe.completion,Oe.afterLoc),ae(Oe),j}},catch:function(he){for(var pe=this.tryEntries.length-1;0<=pe;--pe){var Oe=this.tryEntries[pe];if(Oe.tryLoc===he){var Fe=Oe.completion;if(Fe.type==="throw"){var Ue=Fe.arg;ae(Oe)}return Ue}}throw new Error("illegal catch attempt")},delegateYield:function(he,pe,Oe){return this.delegate={iterator:me(he),resultName:pe,nextLoc:Oe},this.method==="next"&&(this.arg=d),j}},l}(n.exports);try{regeneratorRuntime=s}catch{Function("r","regeneratorRuntime = r")(s)}},function(n,t){function i(l){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d})(l)}function s(l){return typeof Symbol=="function"&&i(Symbol.iterator)==="symbol"?n.exports=s=function(d){return i(d)}:n.exports=s=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":i(d)},s(l)}n.exports=s},function(n,t){function i(s,l){return n.exports=i=Object.setPrototypeOf||function(d,u){return d.__proto__=u,d},i(s,l)}n.exports=i},function(n,t,i){var s=i(5);n.exports=function(l,d){for(;!Object.prototype.hasOwnProperty.call(l,d)&&(l=s(l))!==null;);return l}},function(n,t,i){/** @license React v16.8.6
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var s=i(26),l=typeof Symbol=="function"&&Symbol.for,d=l?Symbol.for("react.element"):60103,u=l?Symbol.for("react.portal"):60106,p=l?Symbol.for("react.fragment"):60107,m=l?Symbol.for("react.strict_mode"):60108,y=l?Symbol.for("react.profiler"):60114,_=l?Symbol.for("react.provider"):60109,E=l?Symbol.for("react.context"):60110,C=l?Symbol.for("react.concurrent_mode"):60111,x=l?Symbol.for("react.forward_ref"):60112,N=l?Symbol.for("react.suspense"):60113,O=l?Symbol.for("react.memo"):60115,D=l?Symbol.for("react.lazy"):60116,P=typeof Symbol=="function"&&Symbol.iterator;function j(we){for(var We=arguments.length-1,st="https://reactjs.org/docs/error-decoder.html?invariant="+we,pt=0;pt<We;pt++)st+="&args[]="+encodeURIComponent(arguments[pt+1]);(function(Qe,Je,St,Xt,Ht,gn,It,xt){if(!Qe){if((Qe=void 0)===Je)Qe=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var mt=[St,Xt,Ht,gn,It,xt],dt=0;(Qe=Error(Je.replace(/%s/g,function(){return mt[dt++]}))).name="Invariant Violation"}throw Qe.framesToPop=1,Qe}})(!1,"Minified React error #"+we+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",st)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V={};function G(we,We,st){this.props=we,this.context=We,this.refs=V,this.updater=st||M}function $(){}function ne(we,We,st){this.props=we,this.context=We,this.refs=V,this.updater=st||M}G.prototype.isReactComponent={},G.prototype.setState=function(we,We){typeof we!="object"&&typeof we!="function"&&we!=null&&j("85"),this.updater.enqueueSetState(this,we,We,"setState")},G.prototype.forceUpdate=function(we){this.updater.enqueueForceUpdate(this,we,"forceUpdate")},$.prototype=G.prototype;var Y=ne.prototype=new $;Y.constructor=ne,s(Y,G.prototype),Y.isPureReactComponent=!0;var le={current:null},re={current:null},ee=Object.prototype.hasOwnProperty,de={key:!0,ref:!0,__self:!0,__source:!0};function H(we,We,st){var pt=void 0,Qe={},Je=null,St=null;if(We!=null)for(pt in We.ref!==void 0&&(St=We.ref),We.key!==void 0&&(Je=""+We.key),We)ee.call(We,pt)&&!de.hasOwnProperty(pt)&&(Qe[pt]=We[pt]);var Xt=arguments.length-2;if(Xt===1)Qe.children=st;else if(1<Xt){for(var Ht=Array(Xt),gn=0;gn<Xt;gn++)Ht[gn]=arguments[gn+2];Qe.children=Ht}if(we&&we.defaultProps)for(pt in Xt=we.defaultProps)Qe[pt]===void 0&&(Qe[pt]=Xt[pt]);return{$$typeof:d,type:we,key:Je,ref:St,props:Qe,_owner:re.current}}function ae(we){return typeof we=="object"&&we!==null&&we.$$typeof===d}var _e=/\/+/g,me=[];function Ce(we,We,st,pt){if(me.length){var Qe=me.pop();return Qe.result=we,Qe.keyPrefix=We,Qe.func=st,Qe.context=pt,Qe.count=0,Qe}return{result:we,keyPrefix:We,func:st,context:pt,count:0}}function he(we){we.result=null,we.keyPrefix=null,we.func=null,we.context=null,we.count=0,me.length<10&&me.push(we)}function pe(we,We,st){return we==null?0:function pt(Qe,Je,St,Xt){var Ht=typeof Qe;Ht!=="undefined"&&Ht!=="boolean"||(Qe=null);var gn=!1;if(Qe===null)gn=!0;else switch(Ht){case"string":case"number":gn=!0;break;case"object":switch(Qe.$$typeof){case d:case u:gn=!0}}if(gn)return St(Xt,Qe,Je===""?"."+Oe(Qe,0):Je),1;if(gn=0,Je=Je===""?".":Je+":",Array.isArray(Qe))for(var It=0;It<Qe.length;It++){var xt=Je+Oe(Ht=Qe[It],It);gn+=pt(Ht,xt,St,Xt)}else if(typeof(xt=Qe===null||typeof Qe!="object"?null:typeof(xt=P&&Qe[P]||Qe["@@iterator"])=="function"?xt:null)=="function")for(Qe=xt.call(Qe),It=0;!(Ht=Qe.next()).done;)gn+=pt(Ht=Ht.value,xt=Je+Oe(Ht,It++),St,Xt);else Ht==="object"&&j("31",(St=""+Qe)=="[object Object]"?"object with keys {"+Object.keys(Qe).join(", ")+"}":St,"");return gn}(we,"",We,st)}function Oe(we,We){return typeof we=="object"&&we!==null&&we.key!=null?function(st){var pt={"=":"=0",":":"=2"};return"$"+(""+st).replace(/[=:]/g,function(Qe){return pt[Qe]})}(we.key):We.toString(36)}function Fe(we,We){we.func.call(we.context,We,we.count++)}function Ue(we,We,st){var pt=we.result,Qe=we.keyPrefix;we=we.func.call(we.context,We,we.count++),Array.isArray(we)?Ve(we,pt,st,function(Je){return Je}):we!=null&&(ae(we)&&(we=function(Je,St){return{$$typeof:d,type:Je.type,key:St,ref:Je.ref,props:Je.props,_owner:Je._owner}}(we,Qe+(!we.key||We&&We.key===we.key?"":(""+we.key).replace(_e,"$&/")+"/")+st)),pt.push(we))}function Ve(we,We,st,pt,Qe){var Je="";st!=null&&(Je=(""+st).replace(_e,"$&/")+"/"),pe(we,Ue,We=Ce(We,Je,pt,Qe)),he(We)}function Re(){var we=le.current;return we===null&&j("321"),we}var Be={Children:{map:function(we,We,st){if(we==null)return we;var pt=[];return Ve(we,pt,null,We,st),pt},forEach:function(we,We,st){if(we==null)return we;pe(we,Fe,We=Ce(null,null,We,st)),he(We)},count:function(we){return pe(we,function(){return null},null)},toArray:function(we){var We=[];return Ve(we,We,null,function(st){return st}),We},only:function(we){return ae(we)||j("143"),we}},createRef:function(){return{current:null}},Component:G,PureComponent:ne,createContext:function(we,We){return We===void 0&&(We=null),(we={$$typeof:E,_calculateChangedBits:We,_currentValue:we,_currentValue2:we,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:_,_context:we},we.Consumer=we},forwardRef:function(we){return{$$typeof:x,render:we}},lazy:function(we){return{$$typeof:D,_ctor:we,_status:-1,_result:null}},memo:function(we,We){return{$$typeof:O,type:we,compare:We===void 0?null:We}},useCallback:function(we,We){return Re().useCallback(we,We)},useContext:function(we,We){return Re().useContext(we,We)},useEffect:function(we,We){return Re().useEffect(we,We)},useImperativeHandle:function(we,We,st){return Re().useImperativeHandle(we,We,st)},useDebugValue:function(){},useLayoutEffect:function(we,We){return Re().useLayoutEffect(we,We)},useMemo:function(we,We){return Re().useMemo(we,We)},useReducer:function(we,We,st){return Re().useReducer(we,We,st)},useRef:function(we){return Re().useRef(we)},useState:function(we){return Re().useState(we)},Fragment:p,StrictMode:m,Suspense:N,createElement:H,cloneElement:function(we,We,st){we==null&&j("267",we);var pt=void 0,Qe=s({},we.props),Je=we.key,St=we.ref,Xt=we._owner;if(We!=null){We.ref!==void 0&&(St=We.ref,Xt=re.current),We.key!==void 0&&(Je=""+We.key);var Ht=void 0;for(pt in we.type&&we.type.defaultProps&&(Ht=we.type.defaultProps),We)ee.call(We,pt)&&!de.hasOwnProperty(pt)&&(Qe[pt]=We[pt]===void 0&&Ht!==void 0?Ht[pt]:We[pt])}if((pt=arguments.length-2)===1)Qe.children=st;else if(1<pt){Ht=Array(pt);for(var gn=0;gn<pt;gn++)Ht[gn]=arguments[gn+2];Qe.children=Ht}return{$$typeof:d,type:we.type,key:Je,ref:St,props:Qe,_owner:Xt}},createFactory:function(we){var We=H.bind(null,we);return We.type=we,We},isValidElement:ae,version:"16.8.6",unstable_ConcurrentMode:C,unstable_Profiler:y,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:le,ReactCurrentOwner:re,assign:s}},Xe=Be;n.exports=Xe.default||Xe},function(n,t,i){/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable;n.exports=function(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var p={},m=0;m<10;m++)p["_"+String.fromCharCode(m)]=m;if(Object.getOwnPropertyNames(p).map(function(_){return p[_]}).join("")!=="0123456789")return!1;var y={};return"abcdefghijklmnopqrst".split("").forEach(function(_){y[_]=_}),Object.keys(Object.assign({},y)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(u,p){for(var m,y,_=function(N){if(N==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(N)}(u),E=1;E<arguments.length;E++){for(var C in m=Object(arguments[E]))l.call(m,C)&&(_[C]=m[C]);if(s){y=s(m);for(var x=0;x<y.length;x++)d.call(m,y[x])&&(_[y[x]]=m[y[x]])}}return _}},function(n,t,i){var s=i(28);function l(){}function d(){}d.resetWarningCache=l,n.exports=function(){function u(y,_,E,C,x,N){if(N!==s){var O=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw O.name="Invariant Violation",O}}function p(){return u}var m={array:u.isRequired=u,bool:u,func:u,number:u,object:u,string:u,symbol:u,any:u,arrayOf:p,element:u,elementType:u,instanceOf:p,node:u,objectOf:p,oneOf:p,oneOfType:p,shape:p,exact:p,checkPropTypes:d,resetWarningCache:l};return m.PropTypes=m}},function(n,t,i){n.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(n,t){n.exports=function(i){if(Array.isArray(i))return i}},function(n,t){n.exports=function(i,s){var l=[],d=!0,u=!1,p=void 0;try{for(var m,y=i[Symbol.iterator]();!(d=(m=y.next()).done)&&(l.push(m.value),!s||l.length!==s);d=!0);}catch(_){u=!0,p=_}finally{try{d||y.return==null||y.return()}finally{if(u)throw p}}return l}},function(n,t){n.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(n,t,i){i.r(t);function s(It){var xt=It.input,mt=It.previews,dt=It.submitButton,it=It.dropzoneProps,Me=It.files,Ge=It.extra.maxFiles;return ee.a.createElement("div",Object.assign({},it),mt,Me.length<Ge&&xt,0<Me.length&&dt)}var l=i(12),d=i.n(l),u=i(3),p=i.n(u),m=i(2),y=i.n(m),_=i(4),E=i.n(_),C=i(6),x=i.n(C),N=i(7),O=i.n(N),D=i(8),P=i.n(D),j=i(9),M=i.n(j),V=i(10),G=i.n(V),$=i(5),ne=i.n($),Y=i(13),le=i.n(Y),re=i(1),ee=i.n(re),de=i(0),H=i.n(de);s.propTypes={input:H.a.node,previews:H.a.arrayOf(H.a.node),submitButton:H.a.node,dropzoneProps:H.a.shape({ref:H.a.any.isRequired,className:H.a.string.isRequired,style:H.a.object,onDragEnter:H.a.func.isRequired,onDragOver:H.a.func.isRequired,onDragLeave:H.a.func.isRequired,onDrop:H.a.func.isRequired}).isRequired,files:H.a.arrayOf(H.a.any).isRequired,extra:H.a.shape({active:H.a.bool.isRequired,reject:H.a.bool.isRequired,dragged:H.a.arrayOf(H.a.any).isRequired,accept:H.a.string.isRequired,multiple:H.a.bool.isRequired,minSizeBytes:H.a.number.isRequired,maxSizeBytes:H.a.number.isRequired,maxFiles:H.a.number.isRequired,onFiles:H.a.func.isRequired,onCancelFile:H.a.func.isRequired,onRemoveFile:H.a.func.isRequired,onRestartFile:H.a.func.isRequired}).isRequired};function ae(It){var xt,mt=It.className,dt=It.labelClassName,it=It.labelWithFilesClassName,Me=It.style,Ge=It.labelStyle,bt=It.labelWithFilesStyle,wt=It.getFilesFromEvent,Pt=It.accept,en=It.multiple,un=It.disabled,an=It.content,ye=It.withFilesContent,Q=It.onFiles,ie=It.files;return ee.a.createElement("label",{className:0<ie.length?it:dt,style:0<ie.length?bt:Ge},0<ie.length?ye:an,ee.a.createElement("input",{className:mt,style:Me,type:"file",accept:Pt,multiple:en,disabled:un,onChange:(xt=E()(y.a.mark(function Se(je){var tt,Te;return y.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return tt=je.target,Pe.next=3,wt(je);case 3:Te=Pe.sent,Q(Te),tt.value=null;case 6:case"end":return Pe.stop()}},Se)})),function(Se){return xt.apply(this,arguments)})}))}var _e=s;ae.propTypes={className:H.a.string,labelClassName:H.a.string,labelWithFilesClassName:H.a.string,style:H.a.object,labelStyle:H.a.object,labelWithFilesStyle:H.a.object,getFilesFromEvent:H.a.func.isRequired,accept:H.a.string.isRequired,multiple:H.a.bool.isRequired,disabled:H.a.bool.isRequired,content:H.a.node,withFilesContent:H.a.node,onFiles:H.a.func.isRequired,files:H.a.arrayOf(H.a.any).isRequired,extra:H.a.shape({active:H.a.bool.isRequired,reject:H.a.bool.isRequired,dragged:H.a.arrayOf(H.a.any).isRequired,accept:H.a.string.isRequired,multiple:H.a.bool.isRequired,minSizeBytes:H.a.number.isRequired,maxSizeBytes:H.a.number.isRequired,maxFiles:H.a.number.isRequired}).isRequired};function me(It){for(var xt=0,mt=It;1024<=mt;)mt/=1024,xt+=1;return"".concat(mt.toFixed(10<=mt||xt<1?0:1)).concat(["bytes","kB","MB","GB","TB","PB","EB","ZB","YB"][xt])}function Ce(It){var xt=new Date(0);xt.setSeconds(It);var mt=xt.toISOString().slice(11,19);return It<3600?mt.slice(3):mt}function he(It,xt){if(!xt||xt==="*")return!0;var mt=It.type||"",dt=mt.replace(/\/.*$/,"");return xt.split(",").map(function(it){return it.trim()}).some(function(it){return it.charAt(0)==="."?It.name===void 0||It.name.toLowerCase().endsWith(it.toLowerCase()):it.endsWith("/*")?dt===it.replace(/\/.*$/,""):mt===it})}function pe(It){for(var xt=arguments.length,mt=new Array(1<xt?xt-1:0),dt=1;dt<xt;dt++)mt[dt-1]=arguments[dt];return typeof It=="function"?It.apply(void 0,mt):It}function Oe(It){var xt=null;if("dataTransfer"in It){var mt=It.dataTransfer;"files"in mt&&mt.files.length?xt=mt.files:mt.items&&mt.items.length&&(xt=mt.items)}else It.target&&It.target.files&&(xt=It.target.files);return Array.prototype.slice.call(xt)}var Fe=ae,Ue=i(11),Ve=i.n(Ue),Re={dropzone:"dzu-dropzone",dropzoneActive:"dzu-dropzoneActive",dropzoneReject:"dzu-dropzoneActive",dropzoneDisabled:"dzu-dropzoneDisabled",input:"dzu-input",inputLabel:"dzu-inputLabel",inputLabelWithFiles:"dzu-inputLabelWithFiles",preview:"dzu-previewContainer",previewImage:"dzu-previewImage",submitButtonContainer:"dzu-submitButtonContainer",submitButton:"dzu-submitButton"},Be=i(14),Xe=i.n(Be),we=i(15),We=i.n(we),st=i(16),pt=i.n(st),Qe={cancel:{backgroundImage:"url(".concat(Xe.a,")")},remove:{backgroundImage:"url(".concat(We.a,")")},restart:{backgroundImage:"url(".concat(pt.a,")")}},Je=function(It){function xt(){return x()(this,xt),P()(this,ne()(xt).apply(this,arguments))}return G()(xt,It),O()(xt,[{key:"render",value:function(){var mt=this.props,dt=mt.className,it=mt.imageClassName,Me=mt.style,Ge=mt.imageStyle,bt=mt.fileWithMeta,wt=bt.cancel,Pt=bt.remove,en=bt.restart,un=mt.meta,an=un.name,ye=an===void 0?"":an,Q=un.percent,ie=Q===void 0?0:Q,Se=un.size,je=Se===void 0?0:Se,tt=un.previewUrl,Te=un.status,Pe=un.duration,Ze=un.validationError,nt=mt.isUpload,$e=mt.canCancel,rt=mt.canRemove,yn=mt.canRestart,Dt=mt.extra.minSizeBytes,nn="".concat(ye||"?",", ").concat(me(je));return Pe&&(nn="".concat(nn,", ").concat(Ce(Pe))),Te==="error_file_size"||Te==="error_validation"?ee.a.createElement("div",{className:dt,style:Me},ee.a.createElement("span",{className:"dzu-previewFileNameError"},nn),Te==="error_file_size"&&ee.a.createElement("span",null,je<Dt?"File too small":"File too big"),Te==="error_validation"&&ee.a.createElement("span",null,String(Ze)),rt&&ee.a.createElement("span",{className:"dzu-previewButton",style:Qe.remove,onClick:Pt})):(Te!=="error_upload_params"&&Te!=="exception_upload"&&Te!=="error_upload"||(nn="".concat(nn," (upload failed)")),Te==="aborted"&&(nn="".concat(nn," (cancelled)")),ee.a.createElement("div",{className:dt,style:Me},tt&&ee.a.createElement("img",{className:it,style:Ge,src:tt,alt:nn,title:nn}),!tt&&ee.a.createElement("span",{className:"dzu-previewFileName"},nn),ee.a.createElement("div",{className:"dzu-previewStatusContainer"},nt&&ee.a.createElement("progress",{max:100,value:Te==="done"||Te==="headers_received"?100:ie}),Te==="uploading"&&$e&&ee.a.createElement("span",{className:"dzu-previewButton",style:Qe.cancel,onClick:wt}),Te!=="preparing"&&Te!=="getting_upload_params"&&Te!=="uploading"&&rt&&ee.a.createElement("span",{className:"dzu-previewButton",style:Qe.remove,onClick:Pt}),["error_upload_params","exception_upload","error_upload","aborted","ready"].includes(Te)&&yn&&ee.a.createElement("span",{className:"dzu-previewButton",style:Qe.restart,onClick:en}))))}}]),xt}(ee.a.PureComponent);Je.propTypes={className:H.a.string,imageClassName:H.a.string,style:H.a.object,imageStyle:H.a.object,fileWithMeta:H.a.shape({file:H.a.any.isRequired,meta:H.a.object.isRequired,cancel:H.a.func.isRequired,restart:H.a.func.isRequired,remove:H.a.func.isRequired,xhr:H.a.any}).isRequired,meta:H.a.shape({status:H.a.oneOf(["preparing","error_file_size","error_validation","ready","getting_upload_params","error_upload_params","uploading","exception_upload","aborted","error_upload","headers_received","done"]).isRequired,type:H.a.string.isRequired,name:H.a.string,uploadedDate:H.a.string.isRequired,percent:H.a.number,size:H.a.number,lastModifiedDate:H.a.string,previewUrl:H.a.string,duration:H.a.number,width:H.a.number,height:H.a.number,videoWidth:H.a.number,videoHeight:H.a.number,validationError:H.a.any}).isRequired,isUpload:H.a.bool.isRequired,canCancel:H.a.bool.isRequired,canRemove:H.a.bool.isRequired,canRestart:H.a.bool.isRequired,files:H.a.arrayOf(H.a.any).isRequired,extra:H.a.shape({active:H.a.bool.isRequired,reject:H.a.bool.isRequired,dragged:H.a.arrayOf(H.a.any).isRequired,accept:H.a.string.isRequired,multiple:H.a.bool.isRequired,minSizeBytes:H.a.number.isRequired,maxSizeBytes:H.a.number.isRequired,maxFiles:H.a.number.isRequired}).isRequired};function St(It){var xt=It.className,mt=It.buttonClassName,dt=It.style,it=It.buttonStyle,Me=It.disabled,Ge=It.content,bt=It.onSubmit,wt=It.files,Pt=wt.some(function(en){return["preparing","getting_upload_params","uploading"].includes(en.meta.status)})||!wt.some(function(en){return["headers_received","done"].includes(en.meta.status)});return ee.a.createElement("div",{className:xt,style:dt},ee.a.createElement("button",{className:mt,style:it,onClick:function(){bt(wt.filter(function(en){return["headers_received","done"].includes(en.meta.status)}))},disabled:Me||Pt},Ge))}var Xt=Je;St.propTypes={className:H.a.string,buttonClassName:H.a.string,style:H.a.object,buttonStyle:H.a.object,disabled:H.a.bool.isRequired,content:H.a.node,onSubmit:H.a.func.isRequired,files:H.a.arrayOf(H.a.object).isRequired,extra:H.a.shape({active:H.a.bool.isRequired,reject:H.a.bool.isRequired,dragged:H.a.arrayOf(H.a.any).isRequired,accept:H.a.string.isRequired,multiple:H.a.bool.isRequired,minSizeBytes:H.a.number.isRequired,maxSizeBytes:H.a.number.isRequired,maxFiles:H.a.number.isRequired}).isRequired};var Ht=St;i.d(t,"Layout",function(){return _e}),i.d(t,"Input",function(){return Fe}),i.d(t,"Preview",function(){return Xt}),i.d(t,"SubmitButton",function(){return Ht}),i.d(t,"formatBytes",function(){return me}),i.d(t,"formatDuration",function(){return Ce}),i.d(t,"accepts",function(){return he}),i.d(t,"defaultClassNames",function(){return Re}),i.d(t,"getFilesFromEvent",function(){return Oe});var gn=function(It){function xt(mt){var dt;return x()(this,xt),(dt=P()(this,ne()(xt).call(this,mt))).forceUpdate=function(){dt.mounted&&le()(ne()(xt.prototype),"forceUpdate",M()(dt)).call(M()(dt))},dt.getFilesFromEvent=function(){return dt.props.getFilesFromEvent||Oe},dt.getDataTransferItemsFromEvent=function(){return dt.props.getDataTransferItemsFromEvent||Oe},dt.handleDragEnter=function(){var it=E()(y.a.mark(function Me(Ge){var bt;return y.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return Ge.preventDefault(),Ge.stopPropagation(),wt.next=4,dt.getDataTransferItemsFromEvent()(Ge);case 4:bt=wt.sent,dt.setState({active:!0,dragged:bt});case 6:case"end":return wt.stop()}},Me)}));return function(Me){return it.apply(this,arguments)}}(),dt.handleDragOver=function(){var it=E()(y.a.mark(function Me(Ge){var bt;return y.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return Ge.preventDefault(),Ge.stopPropagation(),clearTimeout(dt.dragTimeoutId),wt.next=5,dt.getDataTransferItemsFromEvent()(Ge);case 5:bt=wt.sent,dt.setState({active:!0,dragged:bt});case 7:case"end":return wt.stop()}},Me)}));return function(Me){return it.apply(this,arguments)}}(),dt.handleDragLeave=function(it){it.preventDefault(),it.stopPropagation(),dt.dragTimeoutId=window.setTimeout(function(){return dt.setState({active:!1,dragged:[]})},150)},dt.handleDrop=function(){var it=E()(y.a.mark(function Me(Ge){var bt;return y.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return Ge.preventDefault(),Ge.stopPropagation(),dt.setState({active:!1,dragged:[]}),wt.next=5,dt.getFilesFromEvent()(Ge);case 5:bt=wt.sent,dt.handleFiles(bt);case 7:case"end":return wt.stop()}},Me)}));return function(Me){return it.apply(this,arguments)}}(),dt.handleDropDisabled=function(it){it.preventDefault(),it.stopPropagation(),dt.setState({active:!1,dragged:[]})},dt.handleChangeStatus=function(it){if(dt.props.onChangeStatus){var Me=(dt.props.onChangeStatus(it,it.meta.status,dt.files)||{}).meta,Ge=Me===void 0?{}:Me;Ge&&(delete Ge.status,it.meta=p()({},it.meta,{},Ge),dt.forceUpdate())}},dt.handleSubmit=function(it){dt.props.onSubmit&&dt.props.onSubmit(it,d()(dt.files))},dt.handleCancel=function(it){it.meta.status==="uploading"&&(it.meta.status="aborted",it.xhr&&it.xhr.abort(),dt.handleChangeStatus(it),dt.forceUpdate())},dt.handleRemove=function(it){var Me=dt.files.findIndex(function(Ge){return Ge===it});Me!==-1&&(URL.revokeObjectURL(it.meta.previewUrl||""),it.meta.status="removed",dt.handleChangeStatus(it),dt.files.splice(Me,1),dt.forceUpdate())},dt.handleRestart=function(it){dt.props.getUploadParams&&(it.meta.status==="ready"?it.meta.status="started":it.meta.status="restarted",dt.handleChangeStatus(it),it.meta.status="getting_upload_params",it.meta.percent=0,dt.handleChangeStatus(it),dt.forceUpdate(),dt.uploadFile(it))},dt.handleFiles=function(it){it.forEach(function(Ge,bt){return dt.handleFile(Ge,"".concat(new Date().getTime(),"-").concat(bt))});var Me=dt.dropzone.current;Me&&setTimeout(function(){return Me.scroll({top:Me.scrollHeight,behavior:"smooth"})},150)},dt.handleFile=function(){var it=E()(y.a.mark(function Me(Ge,bt){var wt,Pt,en,un,an,ye,Q,ie,Se,je,tt,Te,Pe,Ze,nt,$e;return y.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(wt=Ge.name,Pt=Ge.size,en=Ge.type,un=Ge.lastModified,an=dt.props,ye=an.minSizeBytes,Q=an.maxSizeBytes,ie=an.maxFiles,Se=an.accept,je=an.getUploadParams,tt=an.autoUpload,Te=an.validate,Pe=new Date().toISOString(),Ze=un&&new Date(un).toISOString(),nt={file:Ge,meta:{name:wt,size:Pt,type:en,lastModifiedDate:Ze,uploadedDate:Pe,percent:0,id:bt}},Ge.type==="application/x-moz-file"||he(Ge,Se)){rt.next=9;break}return nt.meta.status="rejected_file_type",dt.handleChangeStatus(nt),rt.abrupt("return");case 9:if(dt.files.length>=ie)return nt.meta.status="rejected_max_files",dt.handleChangeStatus(nt),rt.abrupt("return");rt.next=13;break;case 13:if(nt.cancel=function(){return dt.handleCancel(nt)},nt.remove=function(){return dt.handleRemove(nt)},nt.restart=function(){return dt.handleRestart(nt)},nt.meta.status="preparing",dt.files.push(nt),dt.handleChangeStatus(nt),dt.forceUpdate(),Pt<ye||Q<Pt)return nt.meta.status="error_file_size",dt.handleChangeStatus(nt),dt.forceUpdate(),rt.abrupt("return");rt.next=25;break;case 25:return rt.next=27,dt.generatePreview(nt);case 27:if(!Te){rt.next=35;break}if($e=Te(nt))return nt.meta.status="error_validation",nt.meta.validationError=$e,dt.handleChangeStatus(nt),dt.forceUpdate(),rt.abrupt("return");rt.next=35;break;case 35:je?tt?(dt.uploadFile(nt),nt.meta.status="getting_upload_params"):nt.meta.status="ready":nt.meta.status="done",dt.handleChangeStatus(nt),dt.forceUpdate();case 38:case"end":return rt.stop()}},Me)}));return function(Me,Ge){return it.apply(this,arguments)}}(),dt.generatePreview=function(){var it=E()(y.a.mark(function Me(Ge){var bt,wt,Pt,en,un,an,ye,Q,ie,Se;return y.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:if(bt=Ge.meta.type,wt=Ge.file,Pt=bt.startsWith("image/"),en=bt.startsWith("audio/"),un=bt.startsWith("video/"),Pt||en||un){je.next=6;break}return je.abrupt("return");case 6:if(an=URL.createObjectURL(wt),ye=function(tt){return Promise.race([new Promise(function(Te){tt instanceof HTMLImageElement?tt.onload=Te:tt.onloadedmetadata=Te}),new Promise(function(Te,Pe){setTimeout(Pe,1e3)})])},je.prev=8,Pt)return(Q=new Image).src=an,Ge.meta.previewUrl=an,je.next=15,ye(Q);je.next=17;break;case 15:Ge.meta.width=Q.width,Ge.meta.height=Q.height;case 17:if(en)return(ie=new Audio).src=an,je.next=22,ye(ie);je.next=23;break;case 22:Ge.meta.duration=ie.duration;case 23:if(un)return(Se=document.createElement("video")).src=an,je.next=28,ye(Se);je.next=31;break;case 28:Ge.meta.duration=Se.duration,Ge.meta.videoWidth=Se.videoWidth,Ge.meta.videoHeight=Se.videoHeight;case 31:Pt||URL.revokeObjectURL(an),je.next=37;break;case 34:je.prev=34,je.t0=je.catch(8),URL.revokeObjectURL(an);case 37:dt.forceUpdate();case 38:case"end":return je.stop()}},Me,null,[[8,34]])}));return function(Me){return it.apply(this,arguments)}}(),dt.uploadFile=function(){var it=E()(y.a.mark(function Me(Ge){var bt,wt,Pt,en,un,an,ye,Q,ie,Se,je,tt,Te,Pe,Ze,nt,$e,rt,yn,Dt,nn;return y.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(bt=dt.props.getUploadParams){Zt.next=3;break}return Zt.abrupt("return");case 3:return wt=null,Zt.prev=4,Zt.next=7,bt(Ge);case 7:wt=Zt.sent,Zt.next=13;break;case 10:Zt.prev=10,Zt.t0=Zt.catch(4),console.error("Error Upload Params",Zt.t0.stack);case 13:if(wt===null)return Zt.abrupt("return");Zt.next=15;break;case 15:if(en=(Pt=wt).url,un=Pt.method,an=un===void 0?"POST":un,ye=Pt.body,Q=Pt.fields,ie=Q===void 0?{}:Q,Se=Pt.headers,je=Se===void 0?{}:Se,tt=Pt.meta,delete(Te=tt===void 0?{}:tt).status,en){Zt.next=22;break}return Ge.meta.status="error_upload_params",dt.handleChangeStatus(Ge),dt.forceUpdate(),Zt.abrupt("return");case 22:for(Pe=new XMLHttpRequest,Ze=new FormData,Pe.open(an,en,!0),nt=0,$e=Object.keys(ie);nt<$e.length;nt++)rt=$e[nt],Ze.append(rt,ie[rt]);for(Pe.setRequestHeader("X-Requested-With","XMLHttpRequest"),yn=0,Dt=Object.keys(je);yn<Dt.length;yn++)nn=Dt[yn],Pe.setRequestHeader(nn,je[nn]);Ge.meta=p()({},Ge.meta,{},Te),Pe.upload.addEventListener("progress",function(qt){Ge.meta.percent=100*qt.loaded/qt.total||100,dt.forceUpdate()}),Pe.addEventListener("readystatechange",function(){Pe.readyState!==2&&Pe.readyState!==4||(Pe.status===0&&Ge.meta.status!=="aborted"&&(Ge.meta.status="exception_upload",dt.handleChangeStatus(Ge),dt.forceUpdate()),0<Pe.status&&Pe.status<400&&(Ge.meta.percent=100,Pe.readyState===2&&(Ge.meta.status="headers_received"),Pe.readyState===4&&(Ge.meta.status="done"),dt.handleChangeStatus(Ge),dt.forceUpdate()),400<=Pe.status&&Ge.meta.status!=="error_upload"&&(Ge.meta.status="error_upload",dt.handleChangeStatus(Ge),dt.forceUpdate()))}),Ze.append("file",Ge.file),dt.props.timeout&&(Pe.timeout=dt.props.timeout),Pe.send(ye||Ze),Ge.xhr=Pe,Ge.meta.status="uploading",dt.handleChangeStatus(Ge),dt.forceUpdate();case 38:case"end":return Zt.stop()}},Me,null,[[4,10]])}));return function(Me){return it.apply(this,arguments)}}(),dt.state={active:!1,dragged:[]},dt.files=[],dt.mounted=!0,dt.dropzone=ee.a.createRef(),dt}return G()(xt,It),O()(xt,[{key:"componentDidMount",value:function(){this.props.initialFiles&&this.handleFiles(this.props.initialFiles)}},{key:"componentDidUpdate",value:function(mt){var dt=this.props.initialFiles;mt.initialFiles!==dt&&dt&&this.handleFiles(dt)}},{key:"componentWillUnmount",value:function(){var mt=!(this.mounted=!1),dt=!1,it=void 0;try{for(var Me,Ge=this.files[Symbol.iterator]();!(mt=(Me=Ge.next()).done);mt=!0){var bt=Me.value;this.handleCancel(bt)}}catch(wt){dt=!0,it=wt}finally{try{mt||Ge.return==null||Ge.return()}finally{if(dt)throw it}}}},{key:"render",value:function(){var mt=this.props,dt=mt.accept,it=mt.multiple,Me=mt.maxFiles,Ge=mt.minSizeBytes,bt=mt.maxSizeBytes,wt=mt.onSubmit,Pt=mt.getUploadParams,en=mt.disabled,un=mt.canCancel,an=mt.canRemove,ye=mt.canRestart,Q=mt.inputContent,ie=mt.inputWithFilesContent,Se=mt.submitButtonDisabled,je=mt.submitButtonContent,tt=mt.classNames,Te=mt.styles,Pe=mt.addClassNames,Ze=mt.InputComponent,nt=mt.PreviewComponent,$e=mt.SubmitButtonComponent,rt=mt.LayoutComponent,yn=this.state,Dt=yn.active,nn=yn.dragged,Zt=nn.some(function(Za){return Za.type!=="application/x-moz-file"&&!he(Za,dt)}),qt={active:Dt,reject:Zt,dragged:nn,accept:dt,multiple:it,minSizeBytes:Ge,maxSizeBytes:bt,maxFiles:Me},Jt=d()(this.files),mn=pe(en,Jt,qt),Kn=function(Za,Qp,hy){for(var Xi=p()({},Re),fy=p()({},Qp),gh=arguments.length,Cf=new Array(3<gh?gh-3:0),r0=3;r0<gh;r0++)Cf[r0-3]=arguments[r0];for(var s0=0,py=Object.entries(Za);s0<py.length;s0++){var a0=Ve()(py[s0],2),Tf=a0[0],Rf=a0[1];Xi[Tf]=pe.apply(void 0,[Rf].concat(Cf))}for(var uu=0,Zp=Object.entries(hy);uu<Zp.length;uu++){var ld=Ve()(Zp[uu],2);Tf=ld[0],Rf=ld[1],Xi[Tf]="".concat(Xi[Tf]," ").concat(pe.apply(void 0,[Rf].concat(Cf)))}for(var o0=0,em=Object.entries(Qp);o0<em.length;o0++){var Rw=Ve()(em[o0],2);Tf=Rw[0],Rf=Rw[1],fy[Tf]=pe.apply(void 0,[Rf].concat(Cf))}return{classNames:Xi,styles:fy}}(tt,Te,Pe,Jt,qt),On=Kn.classNames,Tn=On.dropzone,Ui=On.dropzoneActive,xr=On.dropzoneReject,bi=On.dropzoneDisabled,Da=On.input,Rl=On.inputLabel,_c=On.inputLabelWithFiles,cu=On.preview,Io=On.previewImage,e0=On.submitButtonContainer,t0=On.submitButton,Qa=Kn.styles,Ew=Qa.dropzone,uy=Qa.dropzoneActive,ww=Qa.dropzoneReject,bf=Qa.dropzoneDisabled,Ix=Qa.input,Nx=Qa.inputLabel,No=Qa.inputLabelWithFiles,Ox=Qa.preview,n0=Qa.previewImage,ms=Qa.submitButtonContainer,Px=Qa.submitButton,Lx=Ze||Fe,Sw=nt||Xt,bw=$e||Ht,i0=rt||_e,Cw=null;nt!==null&&(Cw=Jt.map(function(Za){return ee.a.createElement(Sw,{className:cu,imageClassName:Io,style:Ox,imageStyle:n0,key:Za.meta.id,fileWithMeta:Za,meta:p()({},Za.meta),isUpload:!!Pt,canCancel:pe(un,Jt,qt),canRemove:pe(an,Jt,qt),canRestart:pe(ye,Jt,qt),files:Jt,extra:qt})}));var Tw=Ze!==null?ee.a.createElement(Lx,{className:Da,labelClassName:Rl,labelWithFilesClassName:_c,style:Ix,labelStyle:Nx,labelWithFilesStyle:No,getFilesFromEvent:this.getFilesFromEvent(),accept:dt,multiple:it,disabled:mn,content:pe(Q,Jt,qt),withFilesContent:pe(ie,Jt,qt),onFiles:this.handleFiles,files:Jt,extra:qt}):null,Dx=wt&&$e!==null?ee.a.createElement(bw,{className:e0,buttonClassName:t0,style:ms,buttonStyle:Px,disabled:pe(Se,Jt,qt),content:pe(je,Jt,qt),onSubmit:this.handleSubmit,files:Jt,extra:qt}):null,mh=Tn,du=Ew;return mn?(mh="".concat(mh," ").concat(bi),du=p()({},du||{},{},bf||{})):Zt?(mh="".concat(mh," ").concat(xr),du=p()({},du||{},{},ww||{})):Dt&&(mh="".concat(mh," ").concat(Ui),du=p()({},du||{},{},uy||{})),ee.a.createElement(i0,{input:Tw,previews:Cw,submitButton:Dx,dropzoneProps:{ref:this.dropzone,className:mh,style:du,onDragEnter:this.handleDragEnter,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:mn?this.handleDropDisabled:this.handleDrop},files:Jt,extra:p()({},qt,{onFiles:this.handleFiles,onCancelFile:this.handleCancel,onRemoveFile:this.handleRemove,onRestartFile:this.handleRestart})})}}]),xt}(ee.a.Component);gn.defaultProps={accept:"*",multiple:!0,minSizeBytes:0,maxSizeBytes:Number.MAX_SAFE_INTEGER,maxFiles:Number.MAX_SAFE_INTEGER,autoUpload:!0,disabled:!1,canCancel:!0,canRemove:!0,canRestart:!0,inputContent:"Drag Files or Click to Browse",inputWithFilesContent:"Add Files",submitButtonDisabled:!1,submitButtonContent:"Submit",classNames:{},styles:{},addClassNames:{}},gn.propTypes={onChangeStatus:H.a.func,getUploadParams:H.a.func,onSubmit:H.a.func,getFilesFromEvent:H.a.func,getDataTransferItemsFromEvent:H.a.func,accept:H.a.string,multiple:H.a.bool,minSizeBytes:H.a.number.isRequired,maxSizeBytes:H.a.number.isRequired,maxFiles:H.a.number.isRequired,validate:H.a.func,autoUpload:H.a.bool,timeout:H.a.number,initialFiles:H.a.arrayOf(H.a.any),disabled:H.a.oneOfType([H.a.bool,H.a.func]),canCancel:H.a.oneOfType([H.a.bool,H.a.func]),canRemove:H.a.oneOfType([H.a.bool,H.a.func]),canRestart:H.a.oneOfType([H.a.bool,H.a.func]),inputContent:H.a.oneOfType([H.a.node,H.a.func]),inputWithFilesContent:H.a.oneOfType([H.a.node,H.a.func]),submitButtonDisabled:H.a.oneOfType([H.a.bool,H.a.func]),submitButtonContent:H.a.oneOfType([H.a.node,H.a.func]),classNames:H.a.object.isRequired,styles:H.a.object.isRequired,addClassNames:H.a.object.isRequired,InputComponent:H.a.func,PreviewComponent:H.a.func,SubmitButtonComponent:H.a.func,LayoutComponent:H.a.func},t.default=gn}]);function lYe(n){var m,y,_,E,C,x,N,O,D,P;const t=(m=n==null?void 0:n.item)!=null&&m.name?(y=n==null?void 0:n.item)==null?void 0:y.name:"Default title",i=n!=null&&n.bgImg?n==null?void 0:n.bgImg:"/img/default-bg.jpg";let s=n!=null&&n.className?n==null?void 0:n.className:"";const l=(E=(_=n.item)==null?void 0:_.completion)!=null&&E.count?(x=(C=n.item)==null?void 0:C.completion)==null?void 0:x.count:0,d=(O=(N=n.item)==null?void 0:N.completion)!=null&&O.total?(P=(D=n.item)==null?void 0:D.completion)==null?void 0:P.total:0,u=isNaN(Math.round(l/d*100))?0:Math.round(l/d*100);function p(j){n.handleMagazineCardClick(j.id)}return h.jsxs(et,{className:`border-0 card-theme dashboard-magazine-card overflow-hidden me-3 ${s}`,onClick:()=>p(n.item),children:[h.jsx(Ts,{src:i,alt:`${t} image`,wrapperClassName:"card-img"}),h.jsxs("div",{className:"card-img-overlay bg-primary-overlay p-2 p-sm-3 d-flex flex-column justify-content-end",children:[h.jsx("div",{className:"font-14 fw-sb text-truncate text-white mb-sm-2",children:t}),h.jsx("div",{className:"d-flex align-items-center",children:d!==0&&h.jsxs(h.Fragment,{children:[h.jsx(eZ,{now:u,className:"flex-grow-1"}),h.jsxs("div",{className:"d-flex font-12 ps-2 text-white",children:[h.jsx("span",{className:"fw-b",children:l}),"/",h.jsx("span",{children:d})]})]})})]})]})}function cYe(n){const t=ji(),i=async()=>{var y,_;try{const E=await ps.getDashboardMagazines();return E.data.status==="success"?(_=(y=E.data)==null?void 0:y.data)==null?void 0:_.items:null}catch{throw new Error("Error fetching dashboard magazines")}},{isFetching:s,isPending:l,isError:d,data:u,error:p}=ru({queryKey:["dashboardMagazinesQuery"],queryFn:i});function m(y){console.log("Magazine ID = ",y),y&&t(`/magazines/${y}`,{state:{pageTitle:"Magazine Details"}})}return l?h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((y,_)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},_))})}):h.jsx(h.Fragment,{children:s&&(u==null?void 0:u.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((y,_)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},_))})})}):h.jsx(h.Fragment,{children:(u==null?void 0:u.length)>0&&h.jsxs(Yn,{className:"pt-2 pb-2 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Magazines"}),h.jsx(Lt,{variant:"link",size:"sm",className:"btn-theme font-13 fw-sb pe-0",onClick:()=>t("/magazines"),children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:u==null?void 0:u.map(y=>h.jsx(lYe,{item:y,bgImg:y.image,title:y.name,className:"card-width-40 shadow-sm ",handleMagazineCardClick:m},y.id))})]})})})}function dYe(n){var p,m,y,_;let t=n!=null&&n.className?n==null?void 0:n.className:"";const i=n!=null&&n.title?n==null?void 0:n.title:"Default title",s=n!=null&&n.bgImg?n==null?void 0:n.bgImg:"/img/default-bg.jpg",l=(p=n==null?void 0:n.item)!=null&&p.button?(m=n==null?void 0:n.item)==null?void 0:m.button:null,d=(y=n==null?void 0:n.item)!=null&&y.expires_in?(_=n==null?void 0:n.item)==null?void 0:_.expires_in:"";function u(E){console.log("handleClick in Dashbaord Contest = ",E),n.handleContestCardClick(E.id)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`border-0 card-theme dashboard-contest-card overflow-hidden me-3 ${t}`,onClick:()=>u(n.item),children:[h.jsx(Ts,{src:s,alt:`${i} image`,wrapperClassName:"card-img"}),h.jsx("span",{className:"d-flex font-11 expiry-tag position-absolute top- end-0",children:d}),h.jsxs("div",{className:"card-img-overlay bg-gray-overlay p- p-0 d-flex flex-column justify-content-end",children:[h.jsx("div",{className:"font-13 fw-sb text-truncat line-clamp text-white mb-1 mb-sm-3 px-2 px-sm-3",children:i}),h.jsx("div",{className:"d-flex btn-wrap align-items-center justify-content-center",children:h.jsx(Lt,{type:"button",className:"btn btn-theme btn-sm btn-secondary px-1 text-nowrap w-100",children:l==null?void 0:l.title})})]})]})})}function uYe(n){const t=ji(),i=async()=>{var y,_;try{const E=await Xa.getAllDashboardContests();return E.data.status==="success"?(_=(y=E.data)==null?void 0:y.data)==null?void 0:_.items:null}catch{throw new Error("Error fetching dashboard contest")}},{isFetching:s,isPending:l,isError:d,data:u,error:p}=ru({queryKey:["dashboardContestsQuery"],queryFn:i});function m(y){console.log("Contest ID = ",y),y&&t(`/contests/${y}`,{state:{pageTitle:"Detailing Contest Details"}})}return l?h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((y,_)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},`DCPC-${_}`))})}):h.jsx(h.Fragment,{children:s&&(u==null?void 0:u.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((y,_)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},`DCPC-${_}`))})})}):h.jsx(h.Fragment,{children:(u==null?void 0:u.length)>0&&h.jsxs(Yn,{className:"pt-2 pb-2 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Detailing Contest"}),h.jsx(Lt,{variant:"link",size:"sm",className:"btn-theme font-12 fw-sb pe-0",onClick:()=>t("/contests"),children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:u==null?void 0:u.map(y=>h.jsx(dn.Fragment,{children:h.jsx(dYe,{item:y,bgImg:y.cover_image,title:y.title,className:"card-width-40 shadow-sm ",handleContestCardClick:m},y.id)},y.id))})]})})})}function hYe(n){function t(i){console.log("handleURLRedirection url = ",i),window.open(encodeURI(i),"_system","location=yes")}return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,fullscreen:!1,backdrop:"static",keyboard:!1,className:"theme-modal app-version-check-update-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb-2 border-0 d-flex justify-content-center align-items-center",children:h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:"heading-icon d-flex justify-content-center align-items-center rounded-circle font-24",children:h.jsx(KU,{})})})}),h.jsx(wn.Body,{className:"no-scrollbar text-center d-flex flex-wrap justify-content-center align-items-center",children:n.loading?h.jsx(h.Fragment,{children:h.jsx(Zi,{animation:"border",variant:"dark"})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[h.jsx("div",{className:"w-100 d-block",children:h.jsx("p",{className:"font-15 mb-3",style:{lineHeight:1.6},children:"It appears you're using an older version of our app. To continue, kindly update to the latest version."})}),h.jsx("div",{className:"btn-wrap d-grid gap-3 pt-1",children:(n==null?void 0:n.platform)==="ios"?h.jsx(h.Fragment,{children:h.jsxs(Lt,{type:"button",className:"btn-theme btn-black btn-lg w-100 text-white text-decoration-none rounded-3",onClick:()=>{var i;return t((i=n.appUpdatedInfo)==null?void 0:i.store_link)},children:[h.jsx(h.Fragment,{children:h.jsx(mUe,{className:"font-32 me-2"})}),"Update Now"]})}):h.jsx(h.Fragment,{children:h.jsxs(Lt,{type:"button",className:"btn-theme btn-black btn-lg w-100 text-white text-decoration-none rounded-3",onClick:()=>{var i;return t((i=n.appUpdatedInfo)==null?void 0:i.store_link)},children:[h.jsx(h.Fragment,{children:h.jsx(vUe,{className:"font-30 me-2"})}),"Update Now"]})})})]})})})]})})}function fYe({contest:n,className:t,handleCompetitionContestBtnClick:i}){const s=n!=null&&n.role?n==null?void 0:n.role:"",l=n!=null&&n.contest_name?n==null?void 0:n.contest_name:"";n!=null&&n.cover_image&&(n==null||n.cover_image);const d=n!=null&&n.points_unit?n==null?void 0:n.points_unit:"Points",u=n!=null&&n.points?n==null?void 0:n.points:0,p=n!=null&&n.team_points?n==null?void 0:n.team_points:0,m=n!=null&&n.team_rank?n==null?void 0:n.team_rank:0,y=n!=null&&n.team_rank_out_of?n==null?void 0:n.team_rank_out_of:0,_=n!=null&&n.rank_in_team?n==null?void 0:n.rank_in_team:0,E=n!=null&&n.rank_in_team_out_of?n==null?void 0:n.rank_in_team_out_of:0;n!=null&&n.team_dashboard&&(n==null||n.team_dashboard);const C=n!=null&&n.contest_dashboard?n==null?void 0:n.contest_dashboard:null,x=n!=null&&n.top3?n==null?void 0:n.top3:[];function N(O,D){console.log("----- Inside handleCardClick ----"),i(O,D)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:"border-0 shadow-sm card-theme overflow-hidden card-width-90 me-3",onClick:()=>{N(n,C)},children:[h.jsx(et.Header,{className:"font-13 border-bottom-0 p-2",children:l}),h.jsxs(et.Body,{className:"px-2 py-3",children:[s.toLowerCase()==="player"&&h.jsx(h.Fragment,{children:h.jsxs(fn,{className:"row-cols-3 g-0",children:[h.jsxs(Gt,{className:"border-end d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(tn,{tag:"insights1",className:"font-24 text-theme-primary"})}),h.jsx("span",{className:"font-20 fw-sb",children:u}),h.jsx("span",{className:"font-13 fw-sb",children:`My ${d}`})]}),h.jsxs(Gt,{className:"border-end d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(tn,{tag:"crown1",className:"font-24 text-theme-primary"})}),h.jsxs("div",{className:"font-20 fw-sb",children:[_," ",h.jsxs("span",{className:"font-12 text-gray8",children:["(",E,")"]})]}),h.jsx("span",{className:"font-13 fw-sb",children:"Rank In Team"})]}),h.jsxs(Gt,{className:"d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(tn,{tag:"crown1",className:"font-24 text-theme-primary"})}),h.jsxs("div",{className:"font-20 fw-sb",children:[m," ",h.jsxs("span",{className:"font-12 text-gray8",children:["(",y,")"]})]}),h.jsx("span",{className:"font-13 fw-sb",children:"Team Rank"})]})]})}),s.toLowerCase()==="observer"&&h.jsx(h.Fragment,{children:(x==null?void 0:x.length)>0?h.jsx(h.Fragment,{children:h.jsx(fn,{className:"row-cols-3 g-0",children:x==null?void 0:x.map((O,D)=>{const P=O!=null&&O.team_image?O==null?void 0:O.team_image:"/img/default-bg.jpg",j=O!=null&&O.team_name?O==null?void 0:O.team_name:"",M=O!=null&&O.rank?O==null?void 0:O.rank:"";return h.jsx(Gt,{className:"",children:h.jsxs(et,{className:`border-0 campaigns-counter-card bg-primary-lighter bg-transparent rounded-0 h-100 ${D+1!==(x==null?void 0:x.length)?"border-end":""}`,children:[h.jsx(et.Header,{className:"border-0 text-center pt-1 pb-0 px-1 bg-transparent",children:h.jsx("div",{className:"ms-2 font-13 fw-sb text-center lh-sm text-gray6",children:j})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center justify-content-center p-1 pt- position-relative",children:h.jsx("div",{className:"d-flex align-items-center mb-2",children:h.jsx("div",{className:"flex-shrink-0",style:{width:32},children:h.jsx(Ts,{src:P,alt:j,wrapperClassName:"img-fluid"})})})}),h.jsx(et.Footer,{className:"border-theme-top border-0 p-1 pt-0 bg-transparent text-center",children:h.jsx("div",{className:"btn btn-theme btn-icon btn-sm bg-primary-light-overlay rounded-circle fw-sb shadow-sm",children:M})})]})},O==null?void 0:O.team_name)})})}):h.jsx(h.Fragment,{})}),s.toLowerCase()==="non_player"&&h.jsx(h.Fragment,{children:h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsxs(Gt,{className:"border-end d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(tn,{tag:"insights1",className:"font-24 text-theme-primary"})}),h.jsx("span",{className:"font-20 fw-sb",children:p}),h.jsx("span",{className:"font-13 fw-sb",children:`Team ${d}`})]}),h.jsxs(Gt,{className:"d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(tn,{tag:"crown1",className:"font-24 text-theme-primary"})}),h.jsxs("div",{className:"font-20 fw-sb",children:[m," ",h.jsxs("span",{className:"font-12 text-gray8",children:["(",y,")"]})]}),h.jsx("span",{className:"font-13 fw-sb",children:"Team Rank"})]})]})})]})]})})}function pYe(){const n=ji(),t=async()=>{var m,y;try{const _=await Xa.getAllCompetitionContests();return _.data.status==="success"?(y=(m=_.data)==null?void 0:m.data)==null?void 0:y.items:null}catch{throw new Error("Error fetching dashboard competition contest")}},{isFetching:i,isPending:s,isError:l,data:d,error:u}=ru({queryKey:["dashboardCompetitionContestsQuery"],queryFn:t});function p(m,y){m&&n("/competition-contests/competition-contest-details",{state:{item:m,url:y,pageTitle:m==null?void 0:m.contest_name}})}return s?h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((m,y)=>h.jsx(ci,{type:"dashboard-competition-contest",className:"card-theme overflow-hidden card-width-90 me-3"},y))})}):h.jsx(h.Fragment,{children:i&&(d==null?void 0:d.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((m,y)=>h.jsx(ci,{type:"dashboard-competition-contest",className:"card-theme overflow-hidden card-width-90 me-3"},y))})})}):h.jsx(h.Fragment,{children:(d==null?void 0:d.length)>0&&h.jsxs(Yn,{className:"pt-2 pb-2 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Contests"}),h.jsx(rh,{to:"/competition-contests",variant:"link",size:"sm",className:"btn-theme btn-link font-13 fw-sb",children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:d==null?void 0:d.map(m=>h.jsx(fYe,{contest:m,className:"",handleCompetitionContestBtnClick:p},m))})]})})})}function Ife({loading:n,banners:t,itemClassName:i,className:s}){const l=i||"",d=ji(),u={shouldSwiperUpdate:!0,rebuildOnUpdate:!0,effect:"slide",autoplay:{delay:4e3,disableOnInteraction:!1},pagination:{el:".swiper-pagination",clickable:!0},spaceBetween:30,grabCursor:!0};async function p(m){if(console.log("Banner clicked = ",m),(m==null?void 0:m.has_cta)!=="no"&&(m==null?void 0:m.has_cta)==="yes")if((m==null?void 0:m.action_type)==="web_view")console.log("Banner action Web view = ",m==null?void 0:m.url),await sx.open({url:m==null?void 0:m.url,toolbarColor:Y2});else if((m==null?void 0:m.action_type)==="web_view_with_token"){console.log("Banner action internal = ",m==null?void 0:m.url);let y=`${m==null?void 0:m.url}&authorization=${Ai.getToken()}`;console.log("urlWithToken = ",y),await sx.open({url:y,toolbarColor:Y2})}else(m==null?void 0:m.action_type)==="internal_action"&&(console.log("Banner action internal = ",m==null?void 0:m.url),d(m==null?void 0:m.url,{state:null}))}return h.jsx(h.Fragment,{children:n?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"banners"})}):h.jsx(h.Fragment,{children:(t==null?void 0:t.length)>0?h.jsx(h.Fragment,{children:h.jsx(CZ,{...u,containerClass:"swiper-container theme-swiper dashboard-swiper mb-2 position-relative",children:t.map((m,y)=>h.jsx(et,{className:`card-slide border-0 overflow-hidden bg-transparent ${l}`,onClick:()=>{p(m)},children:h.jsx(et.Body,{className:"p-0",children:h.jsx(Ts,{src:m==null?void 0:m.media_url,alt:`Wall Banner ${y+1}`})})},m==null?void 0:m.id))})}):h.jsx(h.Fragment,{})})})}function mYe({show:n,handleClose:t,className:i,banners:s}){const l=ji(),d={shouldSwiperUpdate:!0,rebuildOnUpdate:!0,effect:"slide",pagination:{el:".swiper-pagination",clickable:!0},spaceBetween:30,grabCursor:!0};async function u(p){(p==null?void 0:p.has_cta)!=="no"&&(p==null?void 0:p.has_cta)==="yes"&&((p==null?void 0:p.action_type)==="web_view"?await sx.open({url:p==null?void 0:p.url,toolbarColor:Y2}):(p==null?void 0:p.action_type)==="internal_action"&&l(p==null?void 0:p.url,{state:null}))}return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal likes-list-modal",show:n,onHide:t,children:[h.jsx(Lt,{className:"btn-theme btn-icon shadow-sm btn-red rounded-2 position-absolute end-0",style:{zIndex:10},onClick:t,children:h.jsx(tn,{tag:"delete7",className:"font-24"})}),h.jsx(wn.Body,{className:"no-scrollbar p-1",children:h.jsx(CZ,{...d,containerClass:"swiper-container theme-swiper dashboard-swiper popup-media-swiper mb-0 position-relative",children:s.map((p,m)=>h.jsx(et,{className:"card-slide border-0 overflow-hidden bg-transparent",onClick:()=>{u(p)},children:h.jsx(et.Body,{className:"p-0",children:h.jsx(Ts,{src:p==null?void 0:p.media_url,alt:`Popup Banner ${m+1}`})})},p==null?void 0:p.id))})})]})})}const SN=lu("App",{web:()=>lr(()=>import("./web-tRX6fKb3.js"),__vite__mapDeps([])).then(n=>new n.AppWeb)});function gYe(){ji(),tl();const[n,t]=k.useState([]),[i,s]=k.useState([]),[l,d]=k.useState([]),[u,p]=k.useState(null),[m,y]=k.useState(!0),[_,E]=k.useState(!0),[C,x]=k.useState(!1),[N,O]=k.useState(!1),D=()=>{x(!1)},P=()=>{x(!0)},j=()=>{O(!1)},M=()=>{O(!0)};async function V($){const ne=await SN.getInfo();E(!0),Ai.appInfoFromServer($).then(Y=>{var le,re;if(console.log("appInfoFromServer called == ",JSON.stringify(Y.data)),Y.data.status==="success"){const ee=(re=(le=Y.data)==null?void 0:le.data)==null?void 0:re.app_info;p(ee);const de=parseFloat(ne==null?void 0:ne.version).toFixed(2),H=parseFloat(ee.min_version).toFixed(2);E(!1),parseFloat(de)<parseFloat(H)&&P()}}).catch(Y=>{console.log("ERROR in appInfoFromServer ",JSON.stringify(Y)),E(!1),p(null)})}async function G(){ps.getDashboardWallBanners().then($=>{var ne,Y;if(console.log("getDashboardWallBanners RES = ",$.data),$.data.status==="success"){let le=(Y=(ne=$.data)==null?void 0:ne.data)==null?void 0:Y.items,re=le.length>0?le.filter(H=>H.position==="default"):[],ee=le.length>0?le.filter(H=>H.position!=="default"&&H.position!=="popup"):[],de=le.length>0?le.filter(H=>H.position==="popup"):[];t(re),s(ee),d(de),y(!1)}}).catch($=>{y(!1),t([]),s([]),d([]),console.log("Error in getDashboardWallBanners = ",$)})}return k.useEffect(()=>{G(),V({platform:Ai.getDevicePlatform(),package_name:Ai.getAppID()})},[]),k.useEffect(()=>{sessionStorage.getItem("showPopup")||l.length>0&&setTimeout(()=>{M(),sessionStorage.setItem("showPopup",!0)},500)},[l]),h.jsxs(qi,{className:"dashboard-content-wrapper",children:[h.jsxs(Yn,{className:"mb-2 banner-container bg-primary-lighter",children:[h.jsxs(fn,{className:"row-cols-2 gx-2 mb-1 justify-content-center px-4",children:[h.jsx(Gt,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm h-100",style:{background:"var(--color-kudos-light)"},children:h.jsx(rh,{to:"/appreciations",children:h.jsxs(et.Body,{className:"p-2 text-center d-flex align-items-center",children:[h.jsx("div",{className:"pe-none icon-wrap wrap-sm",style:{background:"var(--color-kudos)"},children:h.jsx("img",{src:"/img/appreciations-icon.png",alt:"Appreciations Icon"})}),h.jsx("span",{className:"d-block font-12 ms-2 text-truncate",children:"Appreciations"})]})})})}),h.jsx(Gt,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm h-100",style:{background:"var(--color-badges-light)"},children:h.jsx(rh,{to:"/badges",children:h.jsxs(et.Body,{className:"p-2 text-center d-flex align-items-center",children:[h.jsx("div",{className:"pe-none icon-wrap wrap-sm",style:{background:"var(--color-badges)"},children:h.jsx("img",{src:"/img/badges-icon.png",alt:"Badges Icon"})}),h.jsx("span",{className:"d-block font-12 ms-2",children:"Badges"})]})})})})]}),h.jsxs("section",{className:`${n.length>0?"py-1 pb-3 py-sm-3":""}`,children:[m&&h.jsx(ci,{type:"banners"}),!m&&n.length>0&&h.jsx(Ife,{loading:m,banners:n,itemClassName:"rounded-1 shadow-none",className:""})]})]}),h.jsx(oYe,{}),(i==null?void 0:i.length)>0&&h.jsxs("section",{className:`overflow-hidden ${i.length>0?"py-3 px-4 py-sm-3 bg-red-lighter1":"d-none"}`,children:[m&&h.jsx(ci,{type:"banners"}),!m&&i.length>0&&h.jsx(Ife,{loading:m,banners:i,itemClassName:"rounded-4 shadow-sm cta-slide"})]}),h.jsx(pYe,{}),h.jsx(cYe,{}),h.jsx(uYe,{}),h.jsx(mYe,{show:N,loading:m,banners:l,handleClose:j}),h.jsx(hYe,{show:C,loading:_,handleClose:D,platform:Ai.getDevicePlatform(),appUpdatedInfo:u}),h.jsx("div",{className:"d-block",style:{height:150}})]})}/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var zY=function(n,t){return zY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var l in s)s.hasOwnProperty(l)&&(i[l]=s[l])},zY(n,t)};function vYe(n,t){zY(n,t);function i(){this.constructor=n}n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}var V4=function(){return V4=Object.assign||function(t){for(var i,s=1,l=arguments.length;s<l;s++){i=arguments[s];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(t[d]=i[d])}return t},V4.apply(this,arguments)};function yYe(n,t,i,s){var l,d=!1,u=0;function p(){l&&clearTimeout(l)}function m(){p(),d=!0}typeof t!="boolean"&&(s=i,i=t,t=void 0);function y(){var _=this,E=Date.now()-u,C=arguments;if(d)return;function x(){u=Date.now(),i.apply(_,C)}function N(){l=void 0}s&&!l&&x(),p(),s===void 0&&E>n?x():t!==!0&&(l=setTimeout(s?N:x,s===void 0?n-E:n))}return y.cancel=m,y}var GC={Pixel:"Pixel",Percent:"Percent"},Nfe={unit:GC.Percent,value:.8};function Ofe(n){return typeof n=="number"?{unit:GC.Percent,value:n*100}:typeof n=="string"?n.match(/^(\d*(\.\d+)?)px$/)?{unit:GC.Pixel,value:parseFloat(n)}:n.match(/^(\d*(\.\d+)?)%$/)?{unit:GC.Percent,value:parseFloat(n)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),Nfe):(console.warn("scrollThreshold should be string or number"),Nfe)}var lEe=function(n){vYe(t,n);function t(i){var s=n.call(this,i)||this;return s.lastScrollTop=0,s.actionTriggered=!1,s.startY=0,s.currentY=0,s.dragging=!1,s.maxPullDownDistance=0,s.getScrollableTarget=function(){return s.props.scrollableTarget instanceof HTMLElement?s.props.scrollableTarget:typeof s.props.scrollableTarget=="string"?document.getElementById(s.props.scrollableTarget):(s.props.scrollableTarget===null&&console.warn(`You are trying to pass scrollableTarget but it is null. This might
happen because the element may not have been added to DOM yet.
See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.
`),null)},s.onStart=function(l){s.lastScrollTop||(s.dragging=!0,l instanceof MouseEvent?s.startY=l.pageY:l instanceof TouchEvent&&(s.startY=l.touches[0].pageY),s.currentY=s.startY,s._infScroll&&(s._infScroll.style.willChange="transform",s._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},s.onMove=function(l){s.dragging&&(l instanceof MouseEvent?s.currentY=l.pageY:l instanceof TouchEvent&&(s.currentY=l.touches[0].pageY),!(s.currentY<s.startY)&&(s.currentY-s.startY>=Number(s.props.pullDownToRefreshThreshold)&&s.setState({pullToRefreshThresholdBreached:!0}),!(s.currentY-s.startY>s.maxPullDownDistance*1.5)&&s._infScroll&&(s._infScroll.style.overflow="visible",s._infScroll.style.transform="translate3d(0px, "+(s.currentY-s.startY)+"px, 0px)")))},s.onEnd=function(){s.startY=0,s.currentY=0,s.dragging=!1,s.state.pullToRefreshThresholdBreached&&(s.props.refreshFunction&&s.props.refreshFunction(),s.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){s._infScroll&&(s._infScroll.style.overflow="auto",s._infScroll.style.transform="none",s._infScroll.style.willChange="unset")})},s.onScrollListener=function(l){typeof s.props.onScroll=="function"&&setTimeout(function(){return s.props.onScroll&&s.props.onScroll(l)},0);var d=s.props.height||s._scrollableNode?l.target:document.documentElement.scrollTop?document.documentElement:document.body;if(!s.actionTriggered){var u=s.props.inverse?s.isElementAtTop(d,s.props.scrollThreshold):s.isElementAtBottom(d,s.props.scrollThreshold);u&&s.props.hasMore&&(s.actionTriggered=!0,s.setState({showLoader:!0}),s.props.next&&s.props.next()),s.lastScrollTop=d.scrollTop}},s.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:i.dataLength},s.throttledOnScrollListener=yYe(150,s.onScrollListener).bind(s),s.onStart=s.onStart.bind(s),s.onMove=s.onMove.bind(s),s.onEnd=s.onEnd.bind(s),s}return t.prototype.componentDidMount=function(){if(typeof this.props.dataLength>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),typeof this.props.initialScrollY=="number"&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),typeof this.props.refreshFunction!="function"))throw new Error(`Mandatory prop "refreshFunction" missing.
Pull Down To Refresh functionality will not work
as expected. Check README.md for usage'`)},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(i){this.props.dataLength!==i.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(i,s){var l=i.dataLength!==s.prevDataLength;return l?V4(V4({},s),{prevDataLength:i.dataLength}):null},t.prototype.isElementAtTop=function(i,s){s===void 0&&(s=.8);var l=i===document.body||i===document.documentElement?window.screen.availHeight:i.clientHeight,d=Ofe(s);return d.unit===GC.Pixel?i.scrollTop<=d.value+l-i.scrollHeight+1:i.scrollTop<=d.value/100+l-i.scrollHeight+1},t.prototype.isElementAtBottom=function(i,s){s===void 0&&(s=.8);var l=i===document.body||i===document.documentElement?window.screen.availHeight:i.clientHeight,d=Ofe(s);return d.unit===GC.Pixel?i.scrollTop+l>=i.scrollHeight-d.value:i.scrollTop+l>=d.value/100*i.scrollHeight},t.prototype.render=function(){var i=this,s=V4({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),l=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),d=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return dn.createElement("div",{style:d,className:"infinite-scroll-component__outerdiv"},dn.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(u){return i._infScroll=u},style:s},this.props.pullDownToRefresh&&dn.createElement("div",{style:{position:"relative"},ref:function(u){return i._pullDown=u}},dn.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!l&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(k.Component);const Q8=[{type:"form_approval",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_reminder",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_approved",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_reject",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_submitted",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"broadcast_created",icon:"invitation2",color:"#32c3b3",bgColor:"#a9e9e2"},{type:"broadcast_liked",icon:"invitation2",color:"#32c3b3",bgColor:"#a9e9e2"},{type:"broadcast_comment",icon:"invitation2",color:"#32c3b3",bgColor:"#a9e9e2"},{type:"magazine_created",icon:"dictionary2",color:"#5970ac",bgColor:"#91a7df"},{type:"magazine_media_created",icon:"dictionary2",color:"#5970ac",bgColor:"#91a7df"},{type:"appreciation_recieved",icon:"insights8",color:"#5970ac",bgColor:"#b8c8f3"},{type:"detailing_contest_created",icon:"notifications2",color:"#1099bb",bgColor:"#d9f7ff"},{type:"detailing_contest_upload_response",icon:"notifications2",color:"#1099bb",bgColor:"#d9f7ff"},{type:"detailing_contest_evaluated",icon:"notifications2",color:"#1099bb",bgColor:"#d9f7ff"},{type:"badge_recieved",icon:"insights8",color:"#5970ac",bgColor:"#b8c8f3"}];function bP({text:n,linesToShow:t=2,containerClass:i="",buttonClass:s="",buttonStyles:l=null}){const d={WebkitLineClamp:t,WebkitBoxOrient:"vertical",overflow:"hidden",display:"-webkit-box"},[u,p]=k.useState(!1),[m,y]=k.useState(!1),_=k.useRef(null);return k.useEffect(()=>{if(_.current){const E=_.current.scrollHeight!==_.current.clientHeight;y(E)}},[]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:`${i}`,style:u?null:d,ref:_,children:n}),m&&h.jsx("button",{type:"button",className:`${s}`,style:l,onClick:E=>{E.stopPropagation(),p(!u)},children:u?"Read less":"Read more"})]})}function _Ye(n){var _,E,C,x,N,O,D,P,j,M,V,G,$,ne,Y,le,re,ee,de;const t=ji();k.useState(null);const i=n.className?n.className:"";((_=n.data)==null?void 0:_.icon)!==""&&((E=n.data)==null||E.icon),(C=n.data)!=null&&C.bg_color&&`${(x=n.data)==null?void 0:x.bg_color}`;const s=(N=n.data)!=null&&N.title?(O=n.data)==null?void 0:O.title:"Default Title",l=(D=n.data)!=null&&D.description?(P=n.data)==null?void 0:P.description:"",d=(j=n.data)!=null&&j.time_ago?(M=n.data)==null?void 0:M.time_ago:"",u=(V=n.data)!=null&&V.payload?($=(G=n.data)==null?void 0:G.payload)==null?void 0:$.type:"";(ne=n.data)!=null&&ne.payload&&((le=(Y=n.data)==null?void 0:Y.payload)==null||le.entity_id);const p=m(u);function m(H){let ae=[];return H&&(Q8==null?void 0:Q8.length)>0&&(ae=Q8.filter(_e=>_e.type===H)),ae.length>0?ae[0]:ae}const y=h.jsx(Lt,{type:"button",className:`btn-theme btn-sm btn-green stretched-link ${((ee=(re=n.data)==null?void 0:re.payload)==null?void 0:ee.type)!==lke&&"opacity-0"}`,onClick:()=>{var ae,_e,me,Ce,he,pe,Oe;let H=q1e((ae=n.data)==null?void 0:ae.payload);if(console.log("handleRedirection url =",H),((me=(_e=n.data)==null?void 0:_e.payload)==null?void 0:me.type)===cke||((he=(Ce=n.data)==null?void 0:Ce.payload)==null?void 0:he.type)===dke||((Oe=(pe=n.data)==null?void 0:pe.payload)==null?void 0:Oe.type)===uke){console.log("Do nothing");return}t(H)},children:"Approve / Reject"});return h.jsx(et,{className:`media-list-card notification-list-card border-0 ${i}`,children:h.jsx(et.Body,{className:"px-0 py-2",children:h.jsxs("div",{className:"d-flex align-items-start",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper d-flex align-items-center justify-content-center",style:{backgroundColor:`${p.bgColor}`},children:h.jsx(tn,{tag:p.icon,style:{color:`${p.color}`},className:""})}),h.jsxs("div",{className:"flex-grow-1 ms-3 media-content-wrapper",children:[h.jsx("div",{className:"font-13 fw-sb mb-1",children:s}),h.jsx(bP,{text:l,linesToShow:1,containerClass:"font-13 text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}}),h.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[h.jsx("span",{className:"text-start media-time-text",children:d}),((de=n.data)==null?void 0:de.payload)&&h.jsx(h.Fragment,{children:y})]})]})]})})})}const cEe={getAllNotifications:async n=>{console.log("Inside Service getAllNotifications() ...");const t=n?`&lastkey=${n}`:"";return await kn.get(`ums/notification/list?paginate=yes${t}`)},getNotificationStats:async()=>(console.log("Inside Service getNotificationStats() ..."),await kn.get("ums/notification/stats"))};function dEe(){return h.jsx("div",{className:"d-flex align-items-center justify-content-center w-100 p-3",children:h.jsxs("div",{className:"d-flex align-items-center py-2 px-3 rounded-3 bg-gray-normal-overlay text-white font-15",style:{maxWidth:300},children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ",h.jsx("span",{className:"ms-2",children:"Loading more..."})]})})}function EYe(){const[n,t]=k.useState([]),[i,s]=k.useState(0),[l,d]=k.useState(null),[u,p]=k.useState(!0);function m(){console.log("handleNotificationAction Button Clicked...")}async function y(){let _;l&&(_=l),cEe.getAllNotifications(_).then(E=>{var C,x,N,O,D,P;if(console.log("getAllNotifications RES = ",E.data),E.data.status==="success"){const j=(x=(C=E.data)==null?void 0:C.data)==null?void 0:x.notifications,M=(O=(N=E.data)==null?void 0:N.data)==null?void 0:O.count,V=(P=(D=E.data)==null?void 0:D.data)==null?void 0:P.lastkey;t(G=>[...G,...j]),s(M),d(V),p(!1)}}).catch(E=>{p(!1),t([]),s(0),d(null),console.log("Error in getAllNotifications = ",E)})}return k.useEffect(()=>{y()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:u?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-2",children:[0,1,2].map((_,E)=>h.jsx(ci,{type:"notifications-list"},`notification-list-card-${E}`))})}):h.jsx(h.Fragment,{children:n.length>0?h.jsx(h.Fragment,{children:h.jsx(lEe,{dataLength:n.length,next:y,scrollThreshold:1,hasMore:!!l,loader:h.jsx(dEe,{}),children:h.jsx("div",{className:"d-grid gap-2",children:n.map((_,E)=>h.jsx(_Ye,{cardType:"list",data:_,handlePrimaryAction:m,className:"rounded-0 border-bottom bg-transparent"},_.id))})})}):h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more notifications"})})})})}function To({children:n,size:t,className:i}){let s=i||"",l="",d="heading";switch(t){case"xs":l=`${d}-xs`;break;case"sm":l=`${d}-sm`;break;case"md":l=`${d}-md`;break;case"lg":l=`${d}-lg`;break;case"xl":l=`${d}-xl`;break;case"2xl":l=`${d}-2xl`;break;case"3xl":l=`${d}-3xl`;break;case"4xl":l=`${d}-4xl`;break;case"5xl":l=`${d}-5xl`;break;default:l=""}return h.jsx(h.Fragment,{children:h.jsx("div",{className:`section-heading ${l} ${s}`,children:n})})}function wYe(n){var l,d;ji(),n!=null&&n.className&&(n==null||n.className);const t=(l=n==null?void 0:n.item)!=null&&l.name?(d=n==null?void 0:n.item)==null?void 0:d.name:"Default title",i=n!=null&&n.item.icon?n==null?void 0:n.item.icon:"/img/quick-action-icon.png";n!=null&&n.item.url&&(n==null||n.item.url);function s(u){console.log("HandleClick item =",u);let p=u!=null&&u.action_type?u==null?void 0:u.action_type:"web_view",m=u!=null&&u.url?`${u==null?void 0:u.url}`:u!=null&&u.route?u==null?void 0:u.route:"";console.log("url = ",m),console.log("actionType = ",p),n.handleQuickAction(m,p)}return h.jsx(et,{className:"border-0 shadow-sm h-100 action-card",onClick:()=>s(n.item),children:h.jsxs(et.Body,{className:"text-center px-1",children:[h.jsx("img",{src:i,alt:`${t} Form Icon`,className:"mx-auto img-fluid"}),h.jsx("div",{className:"d-flex align-items-center justify-content-center w-100 pt-1",children:h.jsx("div",{className:"pt-1 font-12 fw-sb overflow-hidden line-clamp",children:t})})]})})}var e9={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/e9.exports;(function(n,t){(function(){var i,s="4.17.21",l=200,d="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",p="Invalid `variable` option passed into `_.template`",m="__lodash_hash_undefined__",y=500,_="__lodash_placeholder__",E=1,C=2,x=4,N=1,O=2,D=1,P=2,j=4,M=8,V=16,G=32,$=64,ne=128,Y=256,le=512,re=30,ee="...",de=800,H=16,ae=1,_e=2,me=3,Ce=1/0,he=9007199254740991,pe=17976931348623157e292,Oe=NaN,Fe=4294967295,Ue=Fe-1,Ve=Fe>>>1,Re=[["ary",ne],["bind",D],["bindKey",P],["curry",M],["curryRight",V],["flip",le],["partial",G],["partialRight",$],["rearg",Y]],Be="[object Arguments]",Xe="[object Array]",we="[object AsyncFunction]",We="[object Boolean]",st="[object Date]",pt="[object DOMException]",Qe="[object Error]",Je="[object Function]",St="[object GeneratorFunction]",Xt="[object Map]",Ht="[object Number]",gn="[object Null]",It="[object Object]",xt="[object Promise]",mt="[object Proxy]",dt="[object RegExp]",it="[object Set]",Me="[object String]",Ge="[object Symbol]",bt="[object Undefined]",wt="[object WeakMap]",Pt="[object WeakSet]",en="[object ArrayBuffer]",un="[object DataView]",an="[object Float32Array]",ye="[object Float64Array]",Q="[object Int8Array]",ie="[object Int16Array]",Se="[object Int32Array]",je="[object Uint8Array]",tt="[object Uint8ClampedArray]",Te="[object Uint16Array]",Pe="[object Uint32Array]",Ze=/\b__p \+= '';/g,nt=/\b(__p \+=) '' \+/g,$e=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rt=/&(?:amp|lt|gt|quot|#39);/g,yn=/[&<>"']/g,Dt=RegExp(rt.source),nn=RegExp(yn.source),Zt=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Jt=/<%=([\s\S]+?)%>/g,mn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kn=/^\w*$/,On=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tn=/[\\^$.*+?()[\]{}|]/g,Ui=RegExp(Tn.source),xr=/^\s+/,bi=/\s/,Da=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Rl=/\{\n\/\* \[wrapped with (.+)\] \*/,_c=/,? & /,cu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Io=/[()=,{}\[\]\/\s]/,e0=/\\(\\)?/g,t0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qa=/\w*$/,Ew=/^[-+]0x[0-9a-f]+$/i,uy=/^0b[01]+$/i,ww=/^\[object .+?Constructor\]$/,bf=/^0o[0-7]+$/i,Ix=/^(?:0|[1-9]\d*)$/,Nx=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,No=/($^)/,Ox=/['\n\r\u2028\u2029\\]/g,n0="\\ud800-\\udfff",ms="\\u0300-\\u036f",Px="\\ufe20-\\ufe2f",Lx="\\u20d0-\\u20ff",Sw=ms+Px+Lx,bw="\\u2700-\\u27bf",i0="a-z\\xdf-\\xf6\\xf8-\\xff",Cw="\\xac\\xb1\\xd7\\xf7",Tw="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dx="\\u2000-\\u206f",mh=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",du="A-Z\\xc0-\\xd6\\xd8-\\xde",Za="\\ufe0e\\ufe0f",Qp=Cw+Tw+Dx+mh,hy="['’]",Xi="["+n0+"]",fy="["+Qp+"]",gh="["+Sw+"]",Cf="\\d+",r0="["+bw+"]",s0="["+i0+"]",py="[^"+n0+Qp+Cf+bw+i0+du+"]",a0="\\ud83c[\\udffb-\\udfff]",Tf="(?:"+gh+"|"+a0+")",Rf="[^"+n0+"]",uu="(?:\\ud83c[\\udde6-\\uddff]){2}",Zp="[\\ud800-\\udbff][\\udc00-\\udfff]",ld="["+du+"]",o0="\\u200d",em="(?:"+s0+"|"+py+")",Rw="(?:"+ld+"|"+py+")",kx="(?:"+hy+"(?:d|ll|m|re|s|t|ve))?",FP="(?:"+hy+"(?:D|LL|M|RE|S|T|VE))?",BP=Tf+"?",VP="["+Za+"]?",VF="(?:"+o0+"(?:"+[Rf,uu,Zp].join("|")+")"+VP+BP+")*",zF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",HF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",zP=VP+BP+VF,GF="(?:"+[r0,uu,Zp].join("|")+")"+zP,HP="(?:"+[Rf+gh+"?",gh,uu,Zp,Xi].join("|")+")",WF=RegExp(hy,"g"),$F=RegExp(gh,"g"),Mx=RegExp(a0+"(?="+a0+")|"+HP+zP,"g"),my=RegExp([ld+"?"+s0+"+"+kx+"(?="+[fy,ld,"$"].join("|")+")",Rw+"+"+FP+"(?="+[fy,ld+em,"$"].join("|")+")",ld+"?"+em+"+"+kx,ld+"+"+FP,HF,zF,Cf,GF].join("|"),"g"),KF=RegExp("["+o0+n0+Sw+Za+"]"),qF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,YF=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],XF=-1,$r={};$r[an]=$r[ye]=$r[Q]=$r[ie]=$r[Se]=$r[je]=$r[tt]=$r[Te]=$r[Pe]=!0,$r[Be]=$r[Xe]=$r[en]=$r[We]=$r[un]=$r[st]=$r[Qe]=$r[Je]=$r[Xt]=$r[Ht]=$r[It]=$r[dt]=$r[it]=$r[Me]=$r[wt]=!1;var Kr={};Kr[Be]=Kr[Xe]=Kr[en]=Kr[un]=Kr[We]=Kr[st]=Kr[an]=Kr[ye]=Kr[Q]=Kr[ie]=Kr[Se]=Kr[Xt]=Kr[Ht]=Kr[It]=Kr[dt]=Kr[it]=Kr[Me]=Kr[Ge]=Kr[je]=Kr[tt]=Kr[Te]=Kr[Pe]=!0,Kr[Qe]=Kr[Je]=Kr[wt]=!1;var JF={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},QF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ec={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},GP=parseFloat,ZF=parseInt,WP=typeof Ws=="object"&&Ws&&Ws.Object===Object&&Ws,eB=typeof self=="object"&&self&&self.Object===Object&&self,dr=WP||eB||Function("return this")(),jx=t&&!t.nodeType&&t,tm=jx&&!0&&n&&!n.nodeType&&n,$P=tm&&tm.exports===jx,l0=$P&&WP.process,xl=function(){try{var ot=tm&&tm.require&&tm.require("util").types;return ot||l0&&l0.binding&&l0.binding("util")}catch{}}(),KP=xl&&xl.isArrayBuffer,xw=xl&&xl.isDate,qP=xl&&xl.isMap,Aw=xl&&xl.isRegExp,Iw=xl&&xl.isSet,Nw=xl&&xl.isTypedArray;function Al(ot,Ot,_t){switch(_t.length){case 0:return ot.call(Ot);case 1:return ot.call(Ot,_t[0]);case 2:return ot.call(Ot,_t[0],_t[1]);case 3:return ot.call(Ot,_t[0],_t[1],_t[2])}return ot.apply(Ot,_t)}function tB(ot,Ot,_t,Cn){for(var di=-1,ur=ot==null?0:ot.length;++di<ur;){var oa=ot[di];Ot(Cn,oa,_t(oa),ot)}return Cn}function aa(ot,Ot){for(var _t=-1,Cn=ot==null?0:ot.length;++_t<Cn&&Ot(ot[_t],_t,ot)!==!1;);return ot}function Ow(ot,Ot){for(var _t=ot==null?0:ot.length;_t--&&Ot(ot[_t],_t,ot)!==!1;);return ot}function YP(ot,Ot){for(var _t=-1,Cn=ot==null?0:ot.length;++_t<Cn;)if(!Ot(ot[_t],_t,ot))return!1;return!0}function Af(ot,Ot){for(var _t=-1,Cn=ot==null?0:ot.length,di=0,ur=[];++_t<Cn;){var oa=ot[_t];Ot(oa,_t,ot)&&(ur[di++]=oa)}return ur}function Pw(ot,Ot){var _t=ot==null?0:ot.length;return!!_t&&d0(ot,Ot,0)>-1}function Ux(ot,Ot,_t){for(var Cn=-1,di=ot==null?0:ot.length;++Cn<di;)if(_t(Ot,ot[Cn]))return!0;return!1}function os(ot,Ot){for(var _t=-1,Cn=ot==null?0:ot.length,di=Array(Cn);++_t<Cn;)di[_t]=Ot(ot[_t],_t,ot);return di}function Il(ot,Ot){for(var _t=-1,Cn=Ot.length,di=ot.length;++_t<Cn;)ot[di+_t]=Ot[_t];return ot}function Fx(ot,Ot,_t,Cn){var di=-1,ur=ot==null?0:ot.length;for(Cn&&ur&&(_t=ot[++di]);++di<ur;)_t=Ot(_t,ot[di],di,ot);return _t}function c0(ot,Ot,_t,Cn){var di=ot==null?0:ot.length;for(Cn&&di&&(_t=ot[--di]);di--;)_t=Ot(_t,ot[di],di,ot);return _t}function Lw(ot,Ot){for(var _t=-1,Cn=ot==null?0:ot.length;++_t<Cn;)if(Ot(ot[_t],_t,ot))return!0;return!1}var nB=Vx("length");function Ii(ot){return ot.split("")}function iB(ot){return ot.match(cu)||[]}function XP(ot,Ot,_t){var Cn;return _t(ot,function(di,ur,oa){if(Ot(di,ur,oa))return Cn=ur,!1}),Cn}function Dw(ot,Ot,_t,Cn){for(var di=ot.length,ur=_t+(Cn?1:-1);Cn?ur--:++ur<di;)if(Ot(ot[ur],ur,ot))return ur;return-1}function d0(ot,Ot,_t){return Ot===Ot?Uw(ot,Ot,_t):Dw(ot,JP,_t)}function Bx(ot,Ot,_t,Cn){for(var di=_t-1,ur=ot.length;++di<ur;)if(Cn(ot[di],Ot))return di;return-1}function JP(ot){return ot!==ot}function QP(ot,Ot){var _t=ot==null?0:ot.length;return _t?kw(ot,Ot)/_t:Oe}function Vx(ot){return function(Ot){return Ot==null?i:Ot[ot]}}function gy(ot){return function(Ot){return ot==null?i:ot[Ot]}}function ZP(ot,Ot,_t,Cn,di){return di(ot,function(ur,oa,kr){_t=Cn?(Cn=!1,ur):Ot(_t,ur,oa,kr)}),_t}function rB(ot,Ot){var _t=ot.length;for(ot.sort(Ot);_t--;)ot[_t]=ot[_t].value;return ot}function kw(ot,Ot){for(var _t,Cn=-1,di=ot.length;++Cn<di;){var ur=Ot(ot[Cn]);ur!==i&&(_t=_t===i?ur:_t+ur)}return _t}function zx(ot,Ot){for(var _t=-1,Cn=Array(ot);++_t<ot;)Cn[_t]=Ot(_t);return Cn}function vh(ot,Ot){return os(Ot,function(_t){return[_t,ot[_t]]})}function e6(ot){return ot&&ot.slice(0,dd(ot)+1).replace(xr,"")}function Nl(ot){return function(Ot){return ot(Ot)}}function Hx(ot,Ot){return os(Ot,function(_t){return ot[_t]})}function u0(ot,Ot){return ot.has(Ot)}function Mw(ot,Ot){for(var _t=-1,Cn=ot.length;++_t<Cn&&d0(Ot,ot[_t],0)>-1;);return _t}function t6(ot,Ot){for(var _t=ot.length;_t--&&d0(Ot,ot[_t],0)>-1;);return _t}function sB(ot,Ot){for(var _t=ot.length,Cn=0;_t--;)ot[_t]===Ot&&++Cn;return Cn}var wc=gy(JF),aB=gy(QF);function oB(ot){return"\\"+Ec[ot]}function lB(ot,Ot){return ot==null?i:ot[Ot]}function h0(ot){return KF.test(ot)}function n6(ot){return qF.test(ot)}function cB(ot){for(var Ot,_t=[];!(Ot=ot.next()).done;)_t.push(Ot.value);return _t}function Gx(ot){var Ot=-1,_t=Array(ot.size);return ot.forEach(function(Cn,di){_t[++Ot]=[di,Cn]}),_t}function Wx(ot,Ot){return function(_t){return ot(Ot(_t))}}function hu(ot,Ot){for(var _t=-1,Cn=ot.length,di=0,ur=[];++_t<Cn;){var oa=ot[_t];(oa===Ot||oa===_)&&(ot[_t]=_,ur[di++]=_t)}return ur}function jw(ot){var Ot=-1,_t=Array(ot.size);return ot.forEach(function(Cn){_t[++Ot]=Cn}),_t}function dB(ot){var Ot=-1,_t=Array(ot.size);return ot.forEach(function(Cn){_t[++Ot]=[Cn,Cn]}),_t}function Uw(ot,Ot,_t){for(var Cn=_t-1,di=ot.length;++Cn<di;)if(ot[Cn]===Ot)return Cn;return-1}function uB(ot,Ot,_t){for(var Cn=_t+1;Cn--;)if(ot[Cn]===Ot)return Cn;return Cn}function f0(ot){return h0(ot)?fB(ot):nB(ot)}function cd(ot){return h0(ot)?Ol(ot):Ii(ot)}function dd(ot){for(var Ot=ot.length;Ot--&&bi.test(ot.charAt(Ot)););return Ot}var hB=gy(xf);function fB(ot){for(var Ot=Mx.lastIndex=0;Mx.test(ot);)++Ot;return Ot}function Ol(ot){return ot.match(Mx)||[]}function pB(ot){return ot.match(my)||[]}var mB=function ot(Ot){Ot=Ot==null?dr:p0.defaults(dr.Object(),Ot,p0.pick(dr,YF));var _t=Ot.Array,Cn=Ot.Date,di=Ot.Error,ur=Ot.Function,oa=Ot.Math,kr=Ot.Object,vy=Ot.RegExp,$x=Ot.String,Sc=Ot.TypeError,Tt=_t.prototype,gB=ur.prototype,m0=kr.prototype,Fw=Ot["__core-js_shared__"],Bw=gB.toString,Tr=m0.hasOwnProperty,i6=0,r6=function(){var S=/[^.]+$/.exec(Fw&&Fw.keys&&Fw.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),Vw=m0.toString,zw=Bw.call(kr),yy=dr._,vB=vy("^"+Bw.call(Tr).replace(Tn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hw=$P?Ot.Buffer:i,If=Ot.Symbol,Gw=Ot.Uint8Array,Ww=Hw?Hw.allocUnsafe:i,$w=Wx(kr.getPrototypeOf,kr),Kx=kr.create,bc=m0.propertyIsEnumerable,_y=Tt.splice,qx=If?If.isConcatSpreadable:i,Nf=If?If.iterator:i,Pl=If?If.toStringTag:i,Kw=function(){try{var S=pm(kr,"defineProperty");return S({},"",{}),S}catch{}}(),yB=Ot.clearTimeout!==dr.clearTimeout&&Ot.clearTimeout,s6=Cn&&Cn.now!==dr.Date.now&&Cn.now,Yx=Ot.setTimeout!==dr.setTimeout&&Ot.setTimeout,Ey=oa.ceil,wy=oa.floor,Sy=kr.getOwnPropertySymbols,a6=Hw?Hw.isBuffer:i,o6=Ot.isFinite,l6=Tt.join,qw=Wx(kr.keys,kr),la=oa.max,eo=oa.min,_B=Cn.now,EB=Ot.parseInt,c6=oa.random,d6=Tt.reverse,by=pm(Ot,"DataView"),Cy=pm(Ot,"Map"),Ty=pm(Ot,"Promise"),g0=pm(Ot,"Set"),Ry=pm(Ot,"WeakMap"),xy=pm(kr,"create"),Yw=Ry&&new Ry,v0={},wB=gm(by),SB=gm(Cy),bB=gm(Ty),CB=gm(g0),Xw=gm(Ry),nm=If?If.prototype:i,im=nm?nm.valueOf:i,u6=nm?nm.toString:i;function be(S){if(Rs(S)&&!ui(S)&&!(S instanceof Fi)){if(S instanceof Ll)return S;if(Tr.call(S,"__wrapped__"))return iL(S)}return new Ll(S)}var y0=function(){function S(){}return function(I){if(!gs(I))return{};if(Kx)return Kx(I);S.prototype=I;var B=new S;return S.prototype=i,B}}();function Ay(){}function Ll(S,I){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!I,this.__index__=0,this.__values__=i}be.templateSettings={escape:Zt,evaluate:qt,interpolate:Jt,variable:"",imports:{_:be}},be.prototype=Ay.prototype,be.prototype.constructor=be,Ll.prototype=y0(Ay.prototype),Ll.prototype.constructor=Ll;function Fi(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Fe,this.__views__=[]}function TB(){var S=new Fi(this.__wrapped__);return S.__actions__=nl(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=nl(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=nl(this.__views__),S}function RB(){if(this.__filtered__){var S=new Fi(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function Iy(){var S=this.__wrapped__.value(),I=this.__dir__,B=ui(S),se=I<0,ge=B?S.length:0,Ie=Y6(0,ge,this.__views__),ze=Ie.start,Ye=Ie.end,ct=Ye-ze,jt=se?Ye:ze-1,Ft=this.__iteratees__,Yt=Ft.length,vn=0,Pn=eo(ct,this.__takeCount__);if(!B||!se&&ge==ct&&Pn==ct)return P6(S,this.__actions__);var qn=[];e:for(;ct--&&vn<Pn;){jt+=I;for(var Ci=-1,ei=S[jt];++Ci<Yt;){var Bi=Ft[Ci],Yi=Bi.iteratee,ol=Bi.type,io=Yi(ei);if(ol==_e)ei=io;else if(!io){if(ol==ae)continue e;break e}}qn[vn++]=ei}return qn}Fi.prototype=y0(Ay.prototype),Fi.prototype.constructor=Fi;function rm(S){var I=-1,B=S==null?0:S.length;for(this.clear();++I<B;){var se=S[I];this.set(se[0],se[1])}}function xB(){this.__data__=xy?xy(null):{},this.size=0}function AB(S){var I=this.has(S)&&delete this.__data__[S];return this.size-=I?1:0,I}function IB(S){var I=this.__data__;if(xy){var B=I[S];return B===m?i:B}return Tr.call(I,S)?I[S]:i}function NB(S){var I=this.__data__;return xy?I[S]!==i:Tr.call(I,S)}function OB(S,I){var B=this.__data__;return this.size+=this.has(S)?0:1,B[S]=xy&&I===i?m:I,this}rm.prototype.clear=xB,rm.prototype.delete=AB,rm.prototype.get=IB,rm.prototype.has=NB,rm.prototype.set=OB;function fu(S){var I=-1,B=S==null?0:S.length;for(this.clear();++I<B;){var se=S[I];this.set(se[0],se[1])}}function PB(){this.__data__=[],this.size=0}function LB(S){var I=this.__data__,B=Oy(I,S);if(B<0)return!1;var se=I.length-1;return B==se?I.pop():_y.call(I,B,1),--this.size,!0}function DB(S){var I=this.__data__,B=Oy(I,S);return B<0?i:I[B][1]}function Xx(S){return Oy(this.__data__,S)>-1}function kB(S,I){var B=this.__data__,se=Oy(B,S);return se<0?(++this.size,B.push([S,I])):B[se][1]=I,this}fu.prototype.clear=PB,fu.prototype.delete=LB,fu.prototype.get=DB,fu.prototype.has=Xx,fu.prototype.set=kB;function yh(S){var I=-1,B=S==null?0:S.length;for(this.clear();++I<B;){var se=S[I];this.set(se[0],se[1])}}function Jw(){this.size=0,this.__data__={hash:new rm,map:new(Cy||fu),string:new rm}}function MB(S){var I=zy(this,S).delete(S);return this.size-=I?1:0,I}function jB(S){return zy(this,S).get(S)}function UB(S){return zy(this,S).has(S)}function FB(S,I){var B=zy(this,S),se=B.size;return B.set(S,I),this.size+=B.size==se?0:1,this}yh.prototype.clear=Jw,yh.prototype.delete=MB,yh.prototype.get=jB,yh.prototype.has=UB,yh.prototype.set=FB;function sm(S){var I=-1,B=S==null?0:S.length;for(this.__data__=new yh;++I<B;)this.add(S[I])}function BB(S){return this.__data__.set(S,m),this}function Qw(S){return this.__data__.has(S)}sm.prototype.add=sm.prototype.push=BB,sm.prototype.has=Qw;function Cc(S){var I=this.__data__=new fu(S);this.size=I.size}function VB(){this.__data__=new fu,this.size=0}function zB(S){var I=this.__data__,B=I.delete(S);return this.size=I.size,B}function h6(S){return this.__data__.get(S)}function HB(S){return this.__data__.has(S)}function GB(S,I){var B=this.__data__;if(B instanceof fu){var se=B.__data__;if(!Cy||se.length<l-1)return se.push([S,I]),this.size=++B.size,this;B=this.__data__=new yh(se)}return B.set(S,I),this.size=B.size,this}Cc.prototype.clear=VB,Cc.prototype.delete=zB,Cc.prototype.get=h6,Cc.prototype.has=HB,Cc.prototype.set=GB;function f6(S,I){var B=ui(S),se=!B&&jf(S),ge=!B&&!se&&hd(S),Ie=!B&&!se&&!ge&&O0(S),ze=B||se||ge||Ie,Ye=ze?zx(S.length,$x):[],ct=Ye.length;for(var jt in S)(I||Tr.call(S,jt))&&!(ze&&(jt=="length"||ge&&(jt=="offset"||jt=="parent")||Ie&&(jt=="buffer"||jt=="byteLength"||jt=="byteOffset")||gu(jt,ct)))&&Ye.push(jt);return Ye}function Zw(S){var I=S.length;return I?S[aA(0,I-1)]:i}function Jx(S,I){return Wy(nl(S),am(I,0,S.length))}function p6(S){return Wy(nl(S))}function Ny(S,I,B){(B!==i&&!no(S[I],B)||B===i&&!(I in S))&&_h(S,I,B)}function _0(S,I,B){var se=S[I];(!(Tr.call(S,I)&&no(se,B))||B===i&&!(I in S))&&_h(S,I,B)}function Oy(S,I){for(var B=S.length;B--;)if(no(S[B][0],I))return B;return-1}function eS(S,I,B,se){return Of(S,function(ge,Ie,ze){I(se,ge,B(ge),ze)}),se}function E0(S,I){return S&&mu(I,Ta(I),S)}function WB(S,I){return S&&mu(I,rl(I),S)}function _h(S,I,B){I=="__proto__"&&Kw?Kw(S,I,{configurable:!0,enumerable:!0,value:B,writable:!0}):S[I]=B}function tS(S,I){for(var B=-1,se=I.length,ge=_t(se),Ie=S==null;++B<se;)ge[B]=Ie?i:tI(S,I[B]);return ge}function am(S,I,B){return S===S&&(B!==i&&(S=S<=B?S:B),I!==i&&(S=S>=I?S:I)),S}function Tc(S,I,B,se,ge,Ie){var ze,Ye=I&E,ct=I&C,jt=I&x;if(B&&(ze=ge?B(S,se,ge,Ie):B(S)),ze!==i)return ze;if(!gs(S))return S;var Ft=ui(S);if(Ft){if(ze=mV(S),!Ye)return nl(S,ze)}else{var Yt=Ma(S),vn=Yt==Je||Yt==St;if(hd(S))return Lf(S,Ye);if(Yt==It||Yt==Be||vn&&!ge){if(ze=ct||vn?{}:Gy(S),!Ye)return ct?k6(S,WB(ze,S)):lV(S,E0(ze,S))}else{if(!Kr[Yt])return ge?S:{};ze=gV(S,Yt,Ye)}}Ie||(Ie=new Cc);var Pn=Ie.get(S);if(Pn)return Pn;Ie.set(S,ze),BL(S)?S.forEach(function(ei){ze.add(Tc(ei,I,B,ei,S,Ie))}):jL(S)&&S.forEach(function(ei,Bi){ze.set(Bi,Tc(ei,I,B,Bi,S,Ie))});var qn=jt?ct?Vy:C0:ct?rl:Ta,Ci=Ft?i:qn(S);return aa(Ci||S,function(ei,Bi){Ci&&(Bi=ei,ei=S[Bi]),_0(ze,Bi,Tc(ei,I,B,Bi,S,Ie))}),ze}function m6(S){var I=Ta(S);return function(B){return g6(B,S,I)}}function g6(S,I,B){var se=B.length;if(S==null)return!se;for(S=kr(S);se--;){var ge=B[se],Ie=I[ge],ze=S[ge];if(ze===i&&!(ge in S)||!Ie(ze))return!1}return!0}function v6(S,I,B){if(typeof S!="function")throw new Sc(u);return Ch(function(){S.apply(i,B)},I)}function Py(S,I,B,se){var ge=-1,Ie=Pw,ze=!0,Ye=S.length,ct=[],jt=I.length;if(!Ye)return ct;B&&(I=os(I,Nl(B))),se?(Ie=Ux,ze=!1):I.length>=l&&(Ie=u0,ze=!1,I=new sm(I));e:for(;++ge<Ye;){var Ft=S[ge],Yt=B==null?Ft:B(Ft);if(Ft=se||Ft!==0?Ft:0,ze&&Yt===Yt){for(var vn=jt;vn--;)if(I[vn]===Yt)continue e;ct.push(Ft)}else Ie(I,Yt,se)||ct.push(Ft)}return ct}var Of=fA(pu),y6=fA(nS,!0);function $B(S,I){var B=!0;return Of(S,function(se,ge,Ie){return B=!!I(se,ge,Ie),B}),B}function Ly(S,I,B){for(var se=-1,ge=S.length;++se<ge;){var Ie=S[se],ze=I(Ie);if(ze!=null&&(Ye===i?ze===ze&&!Ul(ze):B(ze,Ye)))var Ye=ze,ct=Ie}return ct}function om(S,I,B,se){var ge=S.length;for(B=wi(B),B<0&&(B=-B>ge?0:ge+B),se=se===i||se>ge?ge:wi(se),se<0&&(se+=ge),se=B>se?0:QA(se);B<se;)S[B++]=I;return S}function _6(S,I){var B=[];return Of(S,function(se,ge,Ie){I(se,ge,Ie)&&B.push(se)}),B}function ka(S,I,B,se,ge){var Ie=-1,ze=S.length;for(B||(B=yV),ge||(ge=[]);++Ie<ze;){var Ye=S[Ie];I>0&&B(Ye)?I>1?ka(Ye,I-1,B,se,ge):Il(ge,Ye):se||(ge[ge.length]=Ye)}return ge}var Qx=M6(),Zx=M6(!0);function pu(S,I){return S&&Qx(S,I,Ta)}function nS(S,I){return S&&Zx(S,I,Ta)}function iS(S,I){return Af(I,function(B){return Th(S[B])})}function lm(S,I){I=kl(I,S);for(var B=0,se=I.length;S!=null&&B<se;)S=S[Ml(I[B++])];return B&&B==se?S:i}function E6(S,I,B){var se=I(S);return ui(S)?se:Il(se,B(S))}function Ca(S){return S==null?S===i?bt:gn:Pl&&Pl in kr(S)?K6(S):eL(S)}function eA(S,I){return S>I}function KB(S,I){return S!=null&&Tr.call(S,I)}function qB(S,I){return S!=null&&I in kr(S)}function YB(S,I,B){return S>=eo(I,B)&&S<la(I,B)}function tA(S,I,B){for(var se=B?Ux:Pw,ge=S[0].length,Ie=S.length,ze=Ie,Ye=_t(Ie),ct=1/0,jt=[];ze--;){var Ft=S[ze];ze&&I&&(Ft=os(Ft,Nl(I))),ct=eo(Ft.length,ct),Ye[ze]=!B&&(I||ge>=120&&Ft.length>=120)?new sm(ze&&Ft):i}Ft=S[0];var Yt=-1,vn=Ye[0];e:for(;++Yt<ge&&jt.length<ct;){var Pn=Ft[Yt],qn=I?I(Pn):Pn;if(Pn=B||Pn!==0?Pn:0,!(vn?u0(vn,qn):se(jt,qn,B))){for(ze=Ie;--ze;){var Ci=Ye[ze];if(!(Ci?u0(Ci,qn):se(S[ze],qn,B)))continue e}vn&&vn.push(qn),jt.push(Pn)}}return jt}function XB(S,I,B,se){return pu(S,function(ge,Ie,ze){I(se,B(ge),Ie,ze)}),se}function cm(S,I,B){I=kl(I,S),S=wA(S,I);var se=S==null?S:S[Ml(il(I))];return se==null?i:Al(se,S,B)}function w6(S){return Rs(S)&&Ca(S)==Be}function S6(S){return Rs(S)&&Ca(S)==en}function JB(S){return Rs(S)&&Ca(S)==st}function w0(S,I,B,se,ge){return S===I?!0:S==null||I==null||!Rs(S)&&!Rs(I)?S!==S&&I!==I:QB(S,I,B,se,w0,ge)}function QB(S,I,B,se,ge,Ie){var ze=ui(S),Ye=ui(I),ct=ze?Xe:Ma(S),jt=Ye?Xe:Ma(I);ct=ct==Be?It:ct,jt=jt==Be?It:jt;var Ft=ct==It,Yt=jt==It,vn=ct==jt;if(vn&&hd(S)){if(!hd(I))return!1;ze=!0,Ft=!1}if(vn&&!Ft)return Ie||(Ie=new Cc),ze||O0(S)?gA(S,I,B,se,ge,Ie):$6(S,I,ct,B,se,ge,Ie);if(!(B&N)){var Pn=Ft&&Tr.call(S,"__wrapped__"),qn=Yt&&Tr.call(I,"__wrapped__");if(Pn||qn){var Ci=Pn?S.value():S,ei=qn?I.value():I;return Ie||(Ie=new Cc),ge(Ci,ei,B,se,Ie)}}return vn?(Ie||(Ie=new Cc),fV(S,I,B,se,ge,Ie)):!1}function ZB(S){return Rs(S)&&Ma(S)==Xt}function nA(S,I,B,se){var ge=B.length,Ie=ge,ze=!se;if(S==null)return!Ie;for(S=kr(S);ge--;){var Ye=B[ge];if(ze&&Ye[2]?Ye[1]!==S[Ye[0]]:!(Ye[0]in S))return!1}for(;++ge<Ie;){Ye=B[ge];var ct=Ye[0],jt=S[ct],Ft=Ye[1];if(ze&&Ye[2]){if(jt===i&&!(ct in S))return!1}else{var Yt=new Cc;if(se)var vn=se(jt,Ft,ct,S,I,Yt);if(!(vn===i?w0(Ft,jt,N|O,se,Yt):vn))return!1}}return!0}function b6(S){if(!gs(S)||EA(S))return!1;var I=Th(S)?vB:ww;return I.test(gm(S))}function eV(S){return Rs(S)&&Ca(S)==dt}function tV(S){return Rs(S)&&Ma(S)==it}function C6(S){return Rs(S)&&FS(S.length)&&!!$r[Ca(S)]}function T6(S){return typeof S=="function"?S:S==null?sl:typeof S=="object"?ui(S)?S0(S[0],S[1]):sA(S):t_(S)}function iA(S){if(!T0(S))return qw(S);var I=[];for(var B in kr(S))Tr.call(S,B)&&B!="constructor"&&I.push(B);return I}function R6(S){if(!gs(S))return wV(S);var I=T0(S),B=[];for(var se in S)se=="constructor"&&(I||!Tr.call(S,se))||B.push(se);return B}function rA(S,I){return S<I}function Dy(S,I){var B=-1,se=Po(S)?_t(S.length):[];return Of(S,function(ge,Ie,ze){se[++B]=I(ge,Ie,ze)}),se}function sA(S){var I=Hy(S);return I.length==1&&I[0][2]?Q6(I[0][0],I[0][1]):function(B){return B===S||nA(B,S,I)}}function S0(S,I){return vA(S)&&J6(I)?Q6(Ml(S),I):function(B){var se=tI(B,S);return se===i&&se===I?zS(B,S):w0(I,se,N|O)}}function rS(S,I,B,se,ge){S!==I&&Qx(I,function(Ie,ze){if(ge||(ge=new Cc),gs(Ie))nV(S,I,ze,B,rS,se,ge);else{var Ye=se?se(bA(S,ze),Ie,ze+"",S,I,ge):i;Ye===i&&(Ye=Ie),Ny(S,ze,Ye)}},rl)}function nV(S,I,B,se,ge,Ie,ze){var Ye=bA(S,B),ct=bA(I,B),jt=ze.get(ct);if(jt){Ny(S,B,jt);return}var Ft=Ie?Ie(Ye,ct,B+"",S,I,ze):i,Yt=Ft===i;if(Yt){var vn=ui(ct),Pn=!vn&&hd(ct),qn=!vn&&!Pn&&O0(ct);Ft=ct,vn||Pn||qn?ui(Ye)?Ft=Ye:js(Ye)?Ft=nl(Ye):Pn?(Yt=!1,Ft=Lf(ct,!0)):qn?(Yt=!1,Ft=gS(ct,!0)):Ft=[]:Qy(ct)||jf(ct)?(Ft=Ye,jf(Ye)?Ft=VS(Ye):(!gs(Ye)||Th(Ye))&&(Ft=Gy(ct))):Yt=!1}Yt&&(ze.set(ct,Ft),ge(Ft,ct,se,Ie,ze),ze.delete(ct)),Ny(S,B,Ft)}function x6(S,I){var B=S.length;if(B)return I+=I<0?B:0,gu(I,B)?S[I]:i}function A6(S,I,B){I.length?I=os(I,function(Ie){return ui(Ie)?function(ze){return lm(ze,Ie.length===1?Ie[0]:Ie)}:Ie}):I=[sl];var se=-1;I=os(I,Nl(Xn()));var ge=Dy(S,function(Ie,ze,Ye){var ct=os(I,function(jt){return jt(Ie)});return{criteria:ct,index:++se,value:Ie}});return rB(ge,function(Ie,ze){return oV(Ie,ze,B)})}function sS(S,I){return I6(S,I,function(B,se){return zS(S,se)})}function I6(S,I,B){for(var se=-1,ge=I.length,Ie={};++se<ge;){var ze=I[se],Ye=lm(S,ze);B(Ye,ze)&&My(Ie,kl(ze,S),Ye)}return Ie}function N6(S){return function(I){return lm(I,S)}}function ky(S,I,B,se){var ge=se?Bx:d0,Ie=-1,ze=I.length,Ye=S;for(S===I&&(I=nl(I)),B&&(Ye=os(S,Nl(B)));++Ie<ze;)for(var ct=0,jt=I[Ie],Ft=B?B(jt):jt;(ct=ge(Ye,Ft,ct,se))>-1;)Ye!==S&&_y.call(Ye,ct,1),_y.call(S,ct,1);return S}function aS(S,I){for(var B=S?I.length:0,se=B-1;B--;){var ge=I[B];if(B==se||ge!==Ie){var Ie=ge;gu(ge)?_y.call(S,ge,1):jy(S,ge)}}return S}function aA(S,I){return S+wy(c6()*(I-S+1))}function iV(S,I,B,se){for(var ge=-1,Ie=la(Ey((I-S)/(B||1)),0),ze=_t(Ie);Ie--;)ze[se?Ie:++ge]=S,S+=B;return ze}function oA(S,I){var B="";if(!S||I<1||I>he)return B;do I%2&&(B+=S),I=wy(I/2),I&&(S+=S);while(I);return B}function Ni(S,I){return bS(tL(S,I,sl),S+"")}function rV(S){return Zw(_m(S))}function oS(S,I){var B=_m(S);return Wy(B,am(I,0,B.length))}function My(S,I,B,se){if(!gs(S))return S;I=kl(I,S);for(var ge=-1,Ie=I.length,ze=Ie-1,Ye=S;Ye!=null&&++ge<Ie;){var ct=Ml(I[ge]),jt=B;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return S;if(ge!=ze){var Ft=Ye[ct];jt=se?se(Ft,ct,Ye):i,jt===i&&(jt=gs(Ft)?Ft:gu(I[ge+1])?[]:{})}_0(Ye,ct,jt),Ye=Ye[ct]}return S}var dm=Yw?function(S,I){return Yw.set(S,I),S}:sl,lA=Kw?function(S,I){return Kw(S,"toString",{configurable:!0,enumerable:!1,value:uI(I),writable:!0})}:sl;function lS(S){return Wy(_m(S))}function to(S,I,B){var se=-1,ge=S.length;I<0&&(I=-I>ge?0:ge+I),B=B>ge?ge:B,B<0&&(B+=ge),ge=I>B?0:B-I>>>0,I>>>=0;for(var Ie=_t(ge);++se<ge;)Ie[se]=S[se+I];return Ie}function cS(S,I){var B;return Of(S,function(se,ge,Ie){return B=I(se,ge,Ie),!B}),!!B}function dS(S,I,B){var se=0,ge=S==null?se:S.length;if(typeof I=="number"&&I===I&&ge<=Ve){for(;se<ge;){var Ie=se+ge>>>1,ze=S[Ie];ze!==null&&!Ul(ze)&&(B?ze<=I:ze<I)?se=Ie+1:ge=Ie}return ge}return uS(S,I,sl,B)}function uS(S,I,B,se){var ge=0,Ie=S==null?0:S.length;if(Ie===0)return 0;I=B(I);for(var ze=I!==I,Ye=I===null,ct=Ul(I),jt=I===i;ge<Ie;){var Ft=wy((ge+Ie)/2),Yt=B(S[Ft]),vn=Yt!==i,Pn=Yt===null,qn=Yt===Yt,Ci=Ul(Yt);if(ze)var ei=se||qn;else jt?ei=qn&&(se||vn):Ye?ei=qn&&vn&&(se||!Pn):ct?ei=qn&&vn&&!Pn&&(se||!Ci):Pn||Ci?ei=!1:ei=se?Yt<=I:Yt<I;ei?ge=Ft+1:Ie=Ft}return eo(Ie,Ue)}function O6(S,I){for(var B=-1,se=S.length,ge=0,Ie=[];++B<se;){var ze=S[B],Ye=I?I(ze):ze;if(!B||!no(Ye,ct)){var ct=Ye;Ie[ge++]=ze===0?0:ze}}return Ie}function cA(S){return typeof S=="number"?S:Ul(S)?Oe:+S}function Dl(S){if(typeof S=="string")return S;if(ui(S))return os(S,Dl)+"";if(Ul(S))return u6?u6.call(S):"";var I=S+"";return I=="0"&&1/S==-Ce?"-0":I}function Pf(S,I,B){var se=-1,ge=Pw,Ie=S.length,ze=!0,Ye=[],ct=Ye;if(B)ze=!1,ge=Ux;else if(Ie>=l){var jt=I?null:uV(S);if(jt)return jw(jt);ze=!1,ge=u0,ct=new sm}else ct=I?[]:Ye;e:for(;++se<Ie;){var Ft=S[se],Yt=I?I(Ft):Ft;if(Ft=B||Ft!==0?Ft:0,ze&&Yt===Yt){for(var vn=ct.length;vn--;)if(ct[vn]===Yt)continue e;I&&ct.push(Yt),Ye.push(Ft)}else ge(ct,Yt,B)||(ct!==Ye&&ct.push(Yt),Ye.push(Ft))}return Ye}function jy(S,I){return I=kl(I,S),S=wA(S,I),S==null||delete S[Ml(il(I))]}function hS(S,I,B,se){return My(S,I,B(lm(S,I)),se)}function fS(S,I,B,se){for(var ge=S.length,Ie=se?ge:-1;(se?Ie--:++Ie<ge)&&I(S[Ie],Ie,S););return B?to(S,se?0:Ie,se?Ie+1:ge):to(S,se?Ie+1:0,se?ge:Ie)}function P6(S,I){var B=S;return B instanceof Fi&&(B=B.value()),Fx(I,function(se,ge){return ge.func.apply(ge.thisArg,Il([se],ge.args))},B)}function pS(S,I,B){var se=S.length;if(se<2)return se?Pf(S[0]):[];for(var ge=-1,Ie=_t(se);++ge<se;)for(var ze=S[ge],Ye=-1;++Ye<se;)Ye!=ge&&(Ie[ge]=Py(Ie[ge]||ze,S[Ye],I,B));return Pf(ka(Ie,1),I,B)}function mS(S,I,B){for(var se=-1,ge=S.length,Ie=I.length,ze={};++se<ge;){var Ye=se<Ie?I[se]:i;B(ze,S[se],Ye)}return ze}function dA(S){return js(S)?S:[]}function Rc(S){return typeof S=="function"?S:sl}function kl(S,I){return ui(S)?S:vA(S,I)?[S]:CS(Sr(S))}var um=Ni;function Eh(S,I,B){var se=S.length;return B=B===i?se:B,!I&&B>=se?S:to(S,I,B)}var uA=yB||function(S){return dr.clearTimeout(S)};function Lf(S,I){if(I)return S.slice();var B=S.length,se=Ww?Ww(B):new S.constructor(B);return S.copy(se),se}function Uy(S){var I=new S.constructor(S.byteLength);return new Gw(I).set(new Gw(S)),I}function sV(S,I){var B=I?Uy(S.buffer):S.buffer;return new S.constructor(B,S.byteOffset,S.byteLength)}function L6(S){var I=new S.constructor(S.source,Qa.exec(S));return I.lastIndex=S.lastIndex,I}function aV(S){return im?kr(im.call(S)):{}}function gS(S,I){var B=I?Uy(S.buffer):S.buffer;return new S.constructor(B,S.byteOffset,S.length)}function hA(S,I){if(S!==I){var B=S!==i,se=S===null,ge=S===S,Ie=Ul(S),ze=I!==i,Ye=I===null,ct=I===I,jt=Ul(I);if(!Ye&&!jt&&!Ie&&S>I||Ie&&ze&&ct&&!Ye&&!jt||se&&ze&&ct||!B&&ct||!ge)return 1;if(!se&&!Ie&&!jt&&S<I||jt&&B&&ge&&!se&&!Ie||Ye&&B&&ge||!ze&&ge||!ct)return-1}return 0}function oV(S,I,B){for(var se=-1,ge=S.criteria,Ie=I.criteria,ze=ge.length,Ye=B.length;++se<ze;){var ct=hA(ge[se],Ie[se]);if(ct){if(se>=Ye)return ct;var jt=B[se];return ct*(jt=="desc"?-1:1)}}return S.index-I.index}function wh(S,I,B,se){for(var ge=-1,Ie=S.length,ze=B.length,Ye=-1,ct=I.length,jt=la(Ie-ze,0),Ft=_t(ct+jt),Yt=!se;++Ye<ct;)Ft[Ye]=I[Ye];for(;++ge<ze;)(Yt||ge<Ie)&&(Ft[B[ge]]=S[ge]);for(;jt--;)Ft[Ye++]=S[ge++];return Ft}function D6(S,I,B,se){for(var ge=-1,Ie=S.length,ze=-1,Ye=B.length,ct=-1,jt=I.length,Ft=la(Ie-Ye,0),Yt=_t(Ft+jt),vn=!se;++ge<Ft;)Yt[ge]=S[ge];for(var Pn=ge;++ct<jt;)Yt[Pn+ct]=I[ct];for(;++ze<Ye;)(vn||ge<Ie)&&(Yt[Pn+B[ze]]=S[ge++]);return Yt}function nl(S,I){var B=-1,se=S.length;for(I||(I=_t(se));++B<se;)I[B]=S[B];return I}function mu(S,I,B,se){var ge=!B;B||(B={});for(var Ie=-1,ze=I.length;++Ie<ze;){var Ye=I[Ie],ct=se?se(B[Ye],S[Ye],Ye,B,S):i;ct===i&&(ct=S[Ye]),ge?_h(B,Ye,ct):_0(B,Ye,ct)}return B}function lV(S,I){return mu(S,SS(S),I)}function k6(S,I){return mu(S,q6(S),I)}function vS(S,I){return function(B,se){var ge=ui(B)?tB:eS,Ie=I?I():{};return ge(B,S,Xn(se,2),Ie)}}function Df(S){return Ni(function(I,B){var se=-1,ge=B.length,Ie=ge>1?B[ge-1]:i,ze=ge>2?B[2]:i;for(Ie=S.length>3&&typeof Ie=="function"?(ge--,Ie):i,ze&&Oo(B[0],B[1],ze)&&(Ie=ge<3?i:Ie,ge=1),I=kr(I);++se<ge;){var Ye=B[se];Ye&&S(I,Ye,se,Ie)}return I})}function fA(S,I){return function(B,se){if(B==null)return B;if(!Po(B))return S(B,se);for(var ge=B.length,Ie=I?ge:-1,ze=kr(B);(I?Ie--:++Ie<ge)&&se(ze[Ie],Ie,ze)!==!1;);return B}}function M6(S){return function(I,B,se){for(var ge=-1,Ie=kr(I),ze=se(I),Ye=ze.length;Ye--;){var ct=ze[S?Ye:++ge];if(B(Ie[ct],ct,Ie)===!1)break}return I}}function j6(S,I,B){var se=I&D,ge=Fy(S);function Ie(){var ze=this&&this!==dr&&this instanceof Ie?ge:S;return ze.apply(se?B:this,arguments)}return Ie}function U6(S){return function(I){I=Sr(I);var B=h0(I)?cd(I):i,se=B?B[0]:I.charAt(0),ge=B?Eh(B,1).join(""):I.slice(1);return se[S]()+ge}}function b0(S){return function(I){return Fx(TD(cI(I).replace(WF,"")),S,"")}}function Fy(S){return function(){var I=arguments;switch(I.length){case 0:return new S;case 1:return new S(I[0]);case 2:return new S(I[0],I[1]);case 3:return new S(I[0],I[1],I[2]);case 4:return new S(I[0],I[1],I[2],I[3]);case 5:return new S(I[0],I[1],I[2],I[3],I[4]);case 6:return new S(I[0],I[1],I[2],I[3],I[4],I[5]);case 7:return new S(I[0],I[1],I[2],I[3],I[4],I[5],I[6])}var B=y0(S.prototype),se=S.apply(B,I);return gs(se)?se:B}}function cV(S,I,B){var se=Fy(S);function ge(){for(var Ie=arguments.length,ze=_t(Ie),Ye=Ie,ct=fm(ge);Ye--;)ze[Ye]=arguments[Ye];var jt=Ie<3&&ze[0]!==ct&&ze[Ie-1]!==ct?[]:hu(ze,ct);if(Ie-=jt.length,Ie<B)return z6(S,I,yS,ge.placeholder,i,ze,jt,i,i,B-Ie);var Ft=this&&this!==dr&&this instanceof ge?se:S;return Al(Ft,this,ze)}return ge}function F6(S){return function(I,B,se){var ge=kr(I);if(!Po(I)){var Ie=Xn(B,3);I=Ta(I),B=function(Ye){return Ie(ge[Ye],Ye,ge)}}var ze=S(I,B,se);return ze>-1?ge[Ie?I[ze]:ze]:i}}function B6(S){return bh(function(I){var B=I.length,se=B,ge=Ll.prototype.thru;for(S&&I.reverse();se--;){var Ie=I[se];if(typeof Ie!="function")throw new Sc(u);if(ge&&!ze&&hm(Ie)=="wrapper")var ze=new Ll([],!0)}for(se=ze?se:B;++se<B;){Ie=I[se];var Ye=hm(Ie),ct=Ye=="wrapper"?wS(Ie):i;ct&&_A(ct[0])&&ct[1]==(ne|M|G|Y)&&!ct[4].length&&ct[9]==1?ze=ze[hm(ct[0])].apply(ze,ct[3]):ze=Ie.length==1&&_A(Ie)?ze[Ye]():ze.thru(Ie)}return function(){var jt=arguments,Ft=jt[0];if(ze&&jt.length==1&&ui(Ft))return ze.plant(Ft).value();for(var Yt=0,vn=B?I[Yt].apply(this,jt):Ft;++Yt<B;)vn=I[Yt].call(this,vn);return vn}})}function yS(S,I,B,se,ge,Ie,ze,Ye,ct,jt){var Ft=I&ne,Yt=I&D,vn=I&P,Pn=I&(M|V),qn=I&le,Ci=vn?i:Fy(S);function ei(){for(var Bi=arguments.length,Yi=_t(Bi),ol=Bi;ol--;)Yi[ol]=arguments[ol];if(Pn)var io=fm(ei),qs=sB(Yi,io);if(se&&(Yi=wh(Yi,se,ge,Pn)),Ie&&(Yi=D6(Yi,Ie,ze,Pn)),Bi-=qs,Pn&&Bi<jt){var xs=hu(Yi,io);return z6(S,I,yS,ei.placeholder,B,Yi,xs,Ye,ct,jt-Bi)}var fd=Yt?B:this,xh=vn?fd[S]:S;return Bi=Yi.length,Ye?Yi=SA(Yi,Ye):qn&&Bi>1&&Yi.reverse(),Ft&&ct<Bi&&(Yi.length=ct),this&&this!==dr&&this instanceof ei&&(xh=Ci||Fy(xh)),xh.apply(fd,Yi)}return ei}function pA(S,I){return function(B,se){return XB(B,S,I(se),{})}}function ud(S,I){return function(B,se){var ge;if(B===i&&se===i)return I;if(B!==i&&(ge=B),se!==i){if(ge===i)return se;typeof B=="string"||typeof se=="string"?(B=Dl(B),se=Dl(se)):(B=cA(B),se=cA(se)),ge=S(B,se)}return ge}}function mA(S){return bh(function(I){return I=os(I,Nl(Xn())),Ni(function(B){var se=this;return S(I,function(ge){return Al(ge,se,B)})})})}function _S(S,I){I=I===i?" ":Dl(I);var B=I.length;if(B<2)return B?oA(I,S):I;var se=oA(I,Ey(S/f0(I)));return h0(I)?Eh(cd(se),0,S).join(""):se.slice(0,S)}function dV(S,I,B,se){var ge=I&D,Ie=Fy(S);function ze(){for(var Ye=-1,ct=arguments.length,jt=-1,Ft=se.length,Yt=_t(Ft+ct),vn=this&&this!==dr&&this instanceof ze?Ie:S;++jt<Ft;)Yt[jt]=se[jt];for(;ct--;)Yt[jt++]=arguments[++Ye];return Al(vn,ge?B:this,Yt)}return ze}function V6(S){return function(I,B,se){return se&&typeof se!="number"&&Oo(I,B,se)&&(B=se=i),I=Rh(I),B===i?(B=I,I=0):B=Rh(B),se=se===i?I<B?1:-1:Rh(se),iV(I,B,se,S)}}function ES(S){return function(I,B){return typeof I=="string"&&typeof B=="string"||(I=xc(I),B=xc(B)),S(I,B)}}function z6(S,I,B,se,ge,Ie,ze,Ye,ct,jt){var Ft=I&M,Yt=Ft?ze:i,vn=Ft?i:ze,Pn=Ft?Ie:i,qn=Ft?i:Ie;I|=Ft?G:$,I&=~(Ft?$:G),I&j||(I&=~(D|P));var Ci=[S,I,ge,Pn,Yt,qn,vn,Ye,ct,jt],ei=B.apply(i,Ci);return _A(S)&&nL(ei,Ci),ei.placeholder=se,R0(ei,S,I)}function By(S){var I=oa[S];return function(B,se){if(B=xc(B),se=se==null?0:eo(wi(se),292),se&&o6(B)){var ge=(Sr(B)+"e").split("e"),Ie=I(ge[0]+"e"+(+ge[1]+se));return ge=(Sr(Ie)+"e").split("e"),+(ge[0]+"e"+(+ge[1]-se))}return I(B)}}var uV=g0&&1/jw(new g0([,-0]))[1]==Ce?function(S){return new g0(S)}:D0;function H6(S){return function(I){var B=Ma(I);return B==Xt?Gx(I):B==it?dB(I):vh(I,S(I))}}function Sh(S,I,B,se,ge,Ie,ze,Ye){var ct=I&P;if(!ct&&typeof S!="function")throw new Sc(u);var jt=se?se.length:0;if(jt||(I&=~(G|$),se=ge=i),ze=ze===i?ze:la(wi(ze),0),Ye=Ye===i?Ye:wi(Ye),jt-=ge?ge.length:0,I&$){var Ft=se,Yt=ge;se=ge=i}var vn=ct?i:wS(S),Pn=[S,I,B,se,ge,Ft,Yt,Ie,ze,Ye];if(vn&&EV(Pn,vn),S=Pn[0],I=Pn[1],B=Pn[2],se=Pn[3],ge=Pn[4],Ye=Pn[9]=Pn[9]===i?ct?0:S.length:la(Pn[9]-jt,0),!Ye&&I&(M|V)&&(I&=~(M|V)),!I||I==D)var qn=j6(S,I,B);else I==M||I==V?qn=cV(S,I,Ye):(I==G||I==(D|G))&&!ge.length?qn=dV(S,I,B,se):qn=yS.apply(i,Pn);var Ci=vn?dm:nL;return R0(Ci(qn,Pn),S,I)}function G6(S,I,B,se){return S===i||no(S,m0[B])&&!Tr.call(se,B)?I:S}function W6(S,I,B,se,ge,Ie){return gs(S)&&gs(I)&&(Ie.set(I,S),rS(S,I,i,W6,Ie),Ie.delete(I)),S}function hV(S){return Qy(S)?i:S}function gA(S,I,B,se,ge,Ie){var ze=B&N,Ye=S.length,ct=I.length;if(Ye!=ct&&!(ze&&ct>Ye))return!1;var jt=Ie.get(S),Ft=Ie.get(I);if(jt&&Ft)return jt==I&&Ft==S;var Yt=-1,vn=!0,Pn=B&O?new sm:i;for(Ie.set(S,I),Ie.set(I,S);++Yt<Ye;){var qn=S[Yt],Ci=I[Yt];if(se)var ei=ze?se(Ci,qn,Yt,I,S,Ie):se(qn,Ci,Yt,S,I,Ie);if(ei!==i){if(ei)continue;vn=!1;break}if(Pn){if(!Lw(I,function(Bi,Yi){if(!u0(Pn,Yi)&&(qn===Bi||ge(qn,Bi,B,se,Ie)))return Pn.push(Yi)})){vn=!1;break}}else if(!(qn===Ci||ge(qn,Ci,B,se,Ie))){vn=!1;break}}return Ie.delete(S),Ie.delete(I),vn}function $6(S,I,B,se,ge,Ie,ze){switch(B){case un:if(S.byteLength!=I.byteLength||S.byteOffset!=I.byteOffset)return!1;S=S.buffer,I=I.buffer;case en:return!(S.byteLength!=I.byteLength||!Ie(new Gw(S),new Gw(I)));case We:case st:case Ht:return no(+S,+I);case Qe:return S.name==I.name&&S.message==I.message;case dt:case Me:return S==I+"";case Xt:var Ye=Gx;case it:var ct=se&N;if(Ye||(Ye=jw),S.size!=I.size&&!ct)return!1;var jt=ze.get(S);if(jt)return jt==I;se|=O,ze.set(S,I);var Ft=gA(Ye(S),Ye(I),se,ge,Ie,ze);return ze.delete(S),Ft;case Ge:if(im)return im.call(S)==im.call(I)}return!1}function fV(S,I,B,se,ge,Ie){var ze=B&N,Ye=C0(S),ct=Ye.length,jt=C0(I),Ft=jt.length;if(ct!=Ft&&!ze)return!1;for(var Yt=ct;Yt--;){var vn=Ye[Yt];if(!(ze?vn in I:Tr.call(I,vn)))return!1}var Pn=Ie.get(S),qn=Ie.get(I);if(Pn&&qn)return Pn==I&&qn==S;var Ci=!0;Ie.set(S,I),Ie.set(I,S);for(var ei=ze;++Yt<ct;){vn=Ye[Yt];var Bi=S[vn],Yi=I[vn];if(se)var ol=ze?se(Yi,Bi,vn,I,S,Ie):se(Bi,Yi,vn,S,I,Ie);if(!(ol===i?Bi===Yi||ge(Bi,Yi,B,se,Ie):ol)){Ci=!1;break}ei||(ei=vn=="constructor")}if(Ci&&!ei){var io=S.constructor,qs=I.constructor;io!=qs&&"constructor"in S&&"constructor"in I&&!(typeof io=="function"&&io instanceof io&&typeof qs=="function"&&qs instanceof qs)&&(Ci=!1)}return Ie.delete(S),Ie.delete(I),Ci}function bh(S){return bS(tL(S,i,oL),S+"")}function C0(S){return E6(S,Ta,SS)}function Vy(S){return E6(S,rl,q6)}var wS=Yw?function(S){return Yw.get(S)}:D0;function hm(S){for(var I=S.name+"",B=v0[I],se=Tr.call(v0,I)?B.length:0;se--;){var ge=B[se],Ie=ge.func;if(Ie==null||Ie==S)return ge.name}return I}function fm(S){var I=Tr.call(be,"placeholder")?be:S;return I.placeholder}function Xn(){var S=be.iteratee||Us;return S=S===Us?T6:S,arguments.length?S(arguments[0],arguments[1]):S}function zy(S,I){var B=S.__data__;return yA(I)?B[typeof I=="string"?"string":"hash"]:B.map}function Hy(S){for(var I=Ta(S),B=I.length;B--;){var se=I[B],ge=S[se];I[B]=[se,ge,J6(ge)]}return I}function pm(S,I){var B=lB(S,I);return b6(B)?B:i}function K6(S){var I=Tr.call(S,Pl),B=S[Pl];try{S[Pl]=i;var se=!0}catch{}var ge=Vw.call(S);return se&&(I?S[Pl]=B:delete S[Pl]),ge}var SS=Sy?function(S){return S==null?[]:(S=kr(S),Af(Sy(S),function(I){return bc.call(S,I)}))}:gI,q6=Sy?function(S){for(var I=[];S;)Il(I,SS(S)),S=$w(S);return I}:gI,Ma=Ca;(by&&Ma(new by(new ArrayBuffer(1)))!=un||Cy&&Ma(new Cy)!=Xt||Ty&&Ma(Ty.resolve())!=xt||g0&&Ma(new g0)!=it||Ry&&Ma(new Ry)!=wt)&&(Ma=function(S){var I=Ca(S),B=I==It?S.constructor:i,se=B?gm(B):"";if(se)switch(se){case wB:return un;case SB:return Xt;case bB:return xt;case CB:return it;case Xw:return wt}return I});function Y6(S,I,B){for(var se=-1,ge=B.length;++se<ge;){var Ie=B[se],ze=Ie.size;switch(Ie.type){case"drop":S+=ze;break;case"dropRight":I-=ze;break;case"take":I=eo(I,S+ze);break;case"takeRight":S=la(S,I-ze);break}}return{start:S,end:I}}function pV(S){var I=S.match(Rl);return I?I[1].split(_c):[]}function X6(S,I,B){I=kl(I,S);for(var se=-1,ge=I.length,Ie=!1;++se<ge;){var ze=Ml(I[se]);if(!(Ie=S!=null&&B(S,ze)))break;S=S[ze]}return Ie||++se!=ge?Ie:(ge=S==null?0:S.length,!!ge&&FS(ge)&&gu(ze,ge)&&(ui(S)||jf(S)))}function mV(S){var I=S.length,B=new S.constructor(I);return I&&typeof S[0]=="string"&&Tr.call(S,"index")&&(B.index=S.index,B.input=S.input),B}function Gy(S){return typeof S.constructor=="function"&&!T0(S)?y0($w(S)):{}}function gV(S,I,B){var se=S.constructor;switch(I){case en:return Uy(S);case We:case st:return new se(+S);case un:return sV(S,B);case an:case ye:case Q:case ie:case Se:case je:case tt:case Te:case Pe:return gS(S,B);case Xt:return new se;case Ht:case Me:return new se(S);case dt:return L6(S);case it:return new se;case Ge:return aV(S)}}function vV(S,I){var B=I.length;if(!B)return S;var se=B-1;return I[se]=(B>1?"& ":"")+I[se],I=I.join(B>2?", ":" "),S.replace(Da,`{
/* [wrapped with `+I+`] */
`)}function yV(S){return ui(S)||jf(S)||!!(qx&&S&&S[qx])}function gu(S,I){var B=typeof S;return I=I??he,!!I&&(B=="number"||B!="symbol"&&Ix.test(S))&&S>-1&&S%1==0&&S<I}function Oo(S,I,B){if(!gs(B))return!1;var se=typeof I;return(se=="number"?Po(B)&&gu(I,B.length):se=="string"&&I in B)?no(B[I],S):!1}function vA(S,I){if(ui(S))return!1;var B=typeof S;return B=="number"||B=="symbol"||B=="boolean"||S==null||Ul(S)?!0:Kn.test(S)||!mn.test(S)||I!=null&&S in kr(I)}function yA(S){var I=typeof S;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?S!=="__proto__":S===null}function _A(S){var I=hm(S),B=be[I];if(typeof B!="function"||!(I in Fi.prototype))return!1;if(S===B)return!0;var se=wS(B);return!!se&&S===se[0]}function EA(S){return!!r6&&r6 in S}var _V=Fw?Th:vI;function T0(S){var I=S&&S.constructor,B=typeof I=="function"&&I.prototype||m0;return S===B}function J6(S){return S===S&&!gs(S)}function Q6(S,I){return function(B){return B==null?!1:B[S]===I&&(I!==i||S in kr(B))}}function Z6(S){var I=kS(S,function(se){return B.size===y&&B.clear(),se}),B=I.cache;return I}function EV(S,I){var B=S[1],se=I[1],ge=B|se,Ie=ge<(D|P|ne),ze=se==ne&&B==M||se==ne&&B==Y&&S[7].length<=I[8]||se==(ne|Y)&&I[7].length<=I[8]&&B==M;if(!(Ie||ze))return S;se&D&&(S[2]=I[2],ge|=B&D?0:j);var Ye=I[3];if(Ye){var ct=S[3];S[3]=ct?wh(ct,Ye,I[4]):Ye,S[4]=ct?hu(S[3],_):I[4]}return Ye=I[5],Ye&&(ct=S[5],S[5]=ct?D6(ct,Ye,I[6]):Ye,S[6]=ct?hu(S[5],_):I[6]),Ye=I[7],Ye&&(S[7]=Ye),se&ne&&(S[8]=S[8]==null?I[8]:eo(S[8],I[8])),S[9]==null&&(S[9]=I[9]),S[0]=I[0],S[1]=ge,S}function wV(S){var I=[];if(S!=null)for(var B in kr(S))I.push(B);return I}function eL(S){return Vw.call(S)}function tL(S,I,B){return I=la(I===i?S.length-1:I,0),function(){for(var se=arguments,ge=-1,Ie=la(se.length-I,0),ze=_t(Ie);++ge<Ie;)ze[ge]=se[I+ge];ge=-1;for(var Ye=_t(I+1);++ge<I;)Ye[ge]=se[ge];return Ye[I]=B(ze),Al(S,this,Ye)}}function wA(S,I){return I.length<2?S:lm(S,to(I,0,-1))}function SA(S,I){for(var B=S.length,se=eo(I.length,B),ge=nl(S);se--;){var Ie=I[se];S[se]=gu(Ie,B)?ge[Ie]:i}return S}function bA(S,I){if(!(I==="constructor"&&typeof S[I]=="function")&&I!="__proto__")return S[I]}var nL=mm(dm),Ch=Yx||function(S,I){return dr.setTimeout(S,I)},bS=mm(lA);function R0(S,I,B){var se=I+"";return bS(S,vV(se,SV(pV(se),B)))}function mm(S){var I=0,B=0;return function(){var se=_B(),ge=H-(se-B);if(B=se,ge>0){if(++I>=de)return arguments[0]}else I=0;return S.apply(i,arguments)}}function Wy(S,I){var B=-1,se=S.length,ge=se-1;for(I=I===i?se:I;++B<I;){var Ie=aA(B,ge),ze=S[Ie];S[Ie]=S[B],S[B]=ze}return S.length=I,S}var CS=Z6(function(S){var I=[];return S.charCodeAt(0)===46&&I.push(""),S.replace(On,function(B,se,ge,Ie){I.push(ge?Ie.replace(e0,"$1"):se||B)}),I});function Ml(S){if(typeof S=="string"||Ul(S))return S;var I=S+"";return I=="0"&&1/S==-Ce?"-0":I}function gm(S){if(S!=null){try{return Bw.call(S)}catch{}try{return S+""}catch{}}return""}function SV(S,I){return aa(Re,function(B){var se="_."+B[0];I&B[1]&&!Pw(S,se)&&S.push(se)}),S.sort()}function iL(S){if(S instanceof Fi)return S.clone();var I=new Ll(S.__wrapped__,S.__chain__);return I.__actions__=nl(S.__actions__),I.__index__=S.__index__,I.__values__=S.__values__,I}function rL(S,I,B){(B?Oo(S,I,B):I===i)?I=1:I=la(wi(I),0);var se=S==null?0:S.length;if(!se||I<1)return[];for(var ge=0,Ie=0,ze=_t(Ey(se/I));ge<se;)ze[Ie++]=to(S,ge,ge+=I);return ze}function bV(S){for(var I=-1,B=S==null?0:S.length,se=0,ge=[];++I<B;){var Ie=S[I];Ie&&(ge[se++]=Ie)}return ge}function CV(){var S=arguments.length;if(!S)return[];for(var I=_t(S-1),B=arguments[0],se=S;se--;)I[se-1]=arguments[se];return Il(ui(B)?nl(B):[B],ka(I,1))}var TV=Ni(function(S,I){return js(S)?Py(S,ka(I,1,js,!0)):[]}),CA=Ni(function(S,I){var B=il(I);return js(B)&&(B=i),js(S)?Py(S,ka(I,1,js,!0),Xn(B,2)):[]}),TA=Ni(function(S,I){var B=il(I);return js(B)&&(B=i),js(S)?Py(S,ka(I,1,js,!0),i,B):[]});function RV(S,I,B){var se=S==null?0:S.length;return se?(I=B||I===i?1:wi(I),to(S,I<0?0:I,se)):[]}function TS(S,I,B){var se=S==null?0:S.length;return se?(I=B||I===i?1:wi(I),I=se-I,to(S,0,I<0?0:I)):[]}function sL(S,I){return S&&S.length?fS(S,Xn(I,3),!0,!0):[]}function jl(S,I){return S&&S.length?fS(S,Xn(I,3),!0):[]}function xV(S,I,B,se){var ge=S==null?0:S.length;return ge?(B&&typeof B!="number"&&Oo(S,I,B)&&(B=0,se=ge),om(S,I,B,se)):[]}function aL(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=B==null?0:wi(B);return ge<0&&(ge=la(se+ge,0)),Dw(S,Xn(I,3),ge)}function RA(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=se-1;return B!==i&&(ge=wi(B),ge=B<0?la(se+ge,0):eo(ge,se-1)),Dw(S,Xn(I,3),ge,!0)}function oL(S){var I=S==null?0:S.length;return I?ka(S,1):[]}function lL(S){var I=S==null?0:S.length;return I?ka(S,Ce):[]}function cL(S,I){var B=S==null?0:S.length;return B?(I=I===i?1:wi(I),ka(S,I)):[]}function AV(S){for(var I=-1,B=S==null?0:S.length,se={};++I<B;){var ge=S[I];se[ge[0]]=ge[1]}return se}function xA(S){return S&&S.length?S[0]:i}function IV(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=B==null?0:wi(B);return ge<0&&(ge=la(se+ge,0)),d0(S,I,ge)}function NV(S){var I=S==null?0:S.length;return I?to(S,0,-1):[]}var OV=Ni(function(S){var I=os(S,dA);return I.length&&I[0]===S[0]?tA(I):[]}),AA=Ni(function(S){var I=il(S),B=os(S,dA);return I===il(B)?I=i:B.pop(),B.length&&B[0]===S[0]?tA(B,Xn(I,2)):[]}),IA=Ni(function(S){var I=il(S),B=os(S,dA);return I=typeof I=="function"?I:i,I&&B.pop(),B.length&&B[0]===S[0]?tA(B,i,I):[]});function PV(S,I){return S==null?"":l6.call(S,I)}function il(S){var I=S==null?0:S.length;return I?S[I-1]:i}function LV(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=se;return B!==i&&(ge=wi(B),ge=ge<0?la(se+ge,0):eo(ge,se-1)),I===I?uB(S,I,ge):Dw(S,JP,ge,!0)}function dL(S,I){return S&&S.length?x6(S,wi(I)):i}var DV=Ni(RS);function RS(S,I){return S&&S.length&&I&&I.length?ky(S,I):S}function $y(S,I,B){return S&&S.length&&I&&I.length?ky(S,I,Xn(B,2)):S}function uL(S,I,B){return S&&S.length&&I&&I.length?ky(S,I,i,B):S}var NA=bh(function(S,I){var B=S==null?0:S.length,se=tS(S,I);return aS(S,os(I,function(ge){return gu(ge,B)?+ge:ge}).sort(hA)),se});function OA(S,I){var B=[];if(!(S&&S.length))return B;var se=-1,ge=[],Ie=S.length;for(I=Xn(I,3);++se<Ie;){var ze=S[se];I(ze,se,S)&&(B.push(ze),ge.push(se))}return aS(S,ge),B}function xS(S){return S==null?S:d6.call(S)}function hL(S,I,B){var se=S==null?0:S.length;return se?(B&&typeof B!="number"&&Oo(S,I,B)?(I=0,B=se):(I=I==null?0:wi(I),B=B===i?se:wi(B)),to(S,I,B)):[]}function fL(S,I){return dS(S,I)}function pL(S,I,B){return uS(S,I,Xn(B,2))}function x0(S,I){var B=S==null?0:S.length;if(B){var se=dS(S,I);if(se<B&&no(S[se],I))return se}return-1}function PA(S,I){return dS(S,I,!0)}function LA(S,I,B){return uS(S,I,Xn(B,2),!0)}function DA(S,I){var B=S==null?0:S.length;if(B){var se=dS(S,I,!0)-1;if(no(S[se],I))return se}return-1}function mL(S){return S&&S.length?O6(S):[]}function gL(S,I){return S&&S.length?O6(S,Xn(I,2)):[]}function kV(S){var I=S==null?0:S.length;return I?to(S,1,I):[]}function MV(S,I,B){return S&&S.length?(I=B||I===i?1:wi(I),to(S,0,I<0?0:I)):[]}function vm(S,I,B){var se=S==null?0:S.length;return se?(I=B||I===i?1:wi(I),I=se-I,to(S,I<0?0:I,se)):[]}function vL(S,I){return S&&S.length?fS(S,Xn(I,3),!1,!0):[]}function jV(S,I){return S&&S.length?fS(S,Xn(I,3)):[]}var kA=Ni(function(S){return Pf(ka(S,1,js,!0))}),UV=Ni(function(S){var I=il(S);return js(I)&&(I=i),Pf(ka(S,1,js,!0),Xn(I,2))}),FV=Ni(function(S){var I=il(S);return I=typeof I=="function"?I:i,Pf(ka(S,1,js,!0),i,I)});function BV(S){return S&&S.length?Pf(S):[]}function VV(S,I){return S&&S.length?Pf(S,Xn(I,2)):[]}function MA(S,I){return I=typeof I=="function"?I:i,S&&S.length?Pf(S,i,I):[]}function AS(S){if(!(S&&S.length))return[];var I=0;return S=Af(S,function(B){if(js(B))return I=la(B.length,I),!0}),zx(I,function(B){return os(S,Vx(B))})}function jA(S,I){if(!(S&&S.length))return[];var B=AS(S);return I==null?B:os(B,function(se){return Al(I,i,se)})}var yL=Ni(function(S,I){return js(S)?Py(S,I):[]}),IS=Ni(function(S){return pS(Af(S,js))}),_L=Ni(function(S){var I=il(S);return js(I)&&(I=i),pS(Af(S,js),Xn(I,2))}),UA=Ni(function(S){var I=il(S);return I=typeof I=="function"?I:i,pS(Af(S,js),i,I)}),NS=Ni(AS);function OS(S,I){return mS(S||[],I||[],_0)}function zV(S,I){return mS(S||[],I||[],My)}var A0=Ni(function(S){var I=S.length,B=I>1?S[I-1]:i;return B=typeof B=="function"?(S.pop(),B):i,jA(S,B)});function kf(S){var I=be(S);return I.__chain__=!0,I}function EL(S,I){return I(S),S}function PS(S,I){return I(S)}var HV=bh(function(S){var I=S.length,B=I?S[0]:0,se=this.__wrapped__,ge=function(Ie){return tS(Ie,S)};return I>1||this.__actions__.length||!(se instanceof Fi)||!gu(B)?this.thru(ge):(se=se.slice(B,+B+(I?1:0)),se.__actions__.push({func:PS,args:[ge],thisArg:i}),new Ll(se,this.__chain__).thru(function(Ie){return I&&!Ie.length&&Ie.push(i),Ie}))});function Ky(){return kf(this)}function GV(){return new Ll(this.value(),this.__chain__)}function WV(){this.__values__===i&&(this.__values__=VL(this.value()));var S=this.__index__>=this.__values__.length,I=S?i:this.__values__[this.__index__++];return{done:S,value:I}}function $V(){return this}function KV(S){for(var I,B=this;B instanceof Ay;){var se=iL(B);se.__index__=0,se.__values__=i,I?ge.__wrapped__=se:I=se;var ge=se;B=B.__wrapped__}return ge.__wrapped__=S,I}function qV(){var S=this.__wrapped__;if(S instanceof Fi){var I=S;return this.__actions__.length&&(I=new Fi(this)),I=I.reverse(),I.__actions__.push({func:PS,args:[xS],thisArg:i}),new Ll(I,this.__chain__)}return this.thru(xS)}function YV(){return P6(this.__wrapped__,this.__actions__)}var FA=vS(function(S,I,B){Tr.call(S,B)?++S[B]:_h(S,B,1)});function wL(S,I,B){var se=ui(S)?YP:$B;return B&&Oo(S,I,B)&&(I=i),se(S,Xn(I,3))}function XV(S,I){var B=ui(S)?Af:_6;return B(S,Xn(I,3))}var SL=F6(aL),bL=F6(RA);function JV(S,I){return ka(ym(S,I),1)}function qy(S,I){return ka(ym(S,I),Ce)}function vu(S,I,B){return B=B===i?1:wi(B),ka(ym(S,I),B)}function BA(S,I){var B=ui(S)?aa:Of;return B(S,Xn(I,3))}function CL(S,I){var B=ui(S)?Ow:y6;return B(S,Xn(I,3))}var QV=vS(function(S,I,B){Tr.call(S,B)?S[B].push(I):_h(S,B,[I])});function VA(S,I,B,se){S=Po(S)?S:_m(S),B=B&&!se?wi(B):0;var ge=S.length;return B<0&&(B=la(ge+B,0)),BS(S)?B<=ge&&S.indexOf(I,B)>-1:!!ge&&d0(S,I,B)>-1}var TL=Ni(function(S,I,B){var se=-1,ge=typeof I=="function",Ie=Po(S)?_t(S.length):[];return Of(S,function(ze){Ie[++se]=ge?Al(I,ze,B):cm(ze,I,B)}),Ie}),ZV=vS(function(S,I,B){_h(S,B,I)});function ym(S,I){var B=ui(S)?os:Dy;return B(S,Xn(I,3))}function Mf(S,I,B,se){return S==null?[]:(ui(I)||(I=I==null?[]:[I]),B=se?i:B,ui(B)||(B=B==null?[]:[B]),A6(S,I,B))}var Yy=vS(function(S,I,B){S[B?0:1].push(I)},function(){return[[],[]]});function ez(S,I,B){var se=ui(S)?Fx:ZP,ge=arguments.length<3;return se(S,Xn(I,4),B,ge,Of)}function tz(S,I,B){var se=ui(S)?c0:ZP,ge=arguments.length<3;return se(S,Xn(I,4),B,ge,y6)}function nz(S,I){var B=ui(S)?Af:_6;return B(S,MS(Xn(I,3)))}function iz(S){var I=ui(S)?Zw:rV;return I(S)}function zA(S,I,B){(B?Oo(S,I,B):I===i)?I=1:I=wi(I);var se=ui(S)?Jx:oS;return se(S,I)}function rz(S){var I=ui(S)?p6:lS;return I(S)}function sz(S){if(S==null)return 0;if(Po(S))return BS(S)?f0(S):S.length;var I=Ma(S);return I==Xt||I==it?S.size:iA(S).length}function az(S,I,B){var se=ui(S)?Lw:cS;return B&&Oo(S,I,B)&&(I=i),se(S,Xn(I,3))}var RL=Ni(function(S,I){if(S==null)return[];var B=I.length;return B>1&&Oo(S,I[0],I[1])?I=[]:B>2&&Oo(I[0],I[1],I[2])&&(I=[I[0]]),A6(S,ka(I,1),[])}),I0=s6||function(){return dr.Date.now()};function oz(S,I){if(typeof I!="function")throw new Sc(u);return S=wi(S),function(){if(--S<1)return I.apply(this,arguments)}}function xL(S,I,B){return I=B?i:I,I=S&&I==null?S.length:I,Sh(S,ne,i,i,i,i,I)}function AL(S,I){var B;if(typeof I!="function")throw new Sc(u);return S=wi(S),function(){return--S>0&&(B=I.apply(this,arguments)),S<=1&&(I=i),B}}var LS=Ni(function(S,I,B){var se=D;if(B.length){var ge=hu(B,fm(LS));se|=G}return Sh(S,se,I,B,ge)}),DS=Ni(function(S,I,B){var se=D|P;if(B.length){var ge=hu(B,fm(DS));se|=G}return Sh(I,se,S,B,ge)});function HA(S,I,B){I=B?i:I;var se=Sh(S,M,i,i,i,i,i,I);return se.placeholder=HA.placeholder,se}function GA(S,I,B){I=B?i:I;var se=Sh(S,V,i,i,i,i,i,I);return se.placeholder=GA.placeholder,se}function Xy(S,I,B){var se,ge,Ie,ze,Ye,ct,jt=0,Ft=!1,Yt=!1,vn=!0;if(typeof S!="function")throw new Sc(u);I=xc(I)||0,gs(B)&&(Ft=!!B.leading,Yt="maxWait"in B,Ie=Yt?la(xc(B.maxWait)||0,I):Ie,vn="trailing"in B?!!B.trailing:vn);function Pn(xs){var fd=se,xh=ge;return se=ge=i,jt=xs,ze=S.apply(xh,fd),ze}function qn(xs){return jt=xs,Ye=Ch(Bi,I),Ft?Pn(xs):ze}function Ci(xs){var fd=xs-ct,xh=xs-jt,LD=I-fd;return Yt?eo(LD,Ie-xh):LD}function ei(xs){var fd=xs-ct,xh=xs-jt;return ct===i||fd>=I||fd<0||Yt&&xh>=Ie}function Bi(){var xs=I0();if(ei(xs))return Yi(xs);Ye=Ch(Bi,Ci(xs))}function Yi(xs){return Ye=i,vn&&se?Pn(xs):(se=ge=i,ze)}function ol(){Ye!==i&&uA(Ye),jt=0,se=ct=ge=Ye=i}function io(){return Ye===i?ze:Yi(I0())}function qs(){var xs=I0(),fd=ei(xs);if(se=arguments,ge=this,ct=xs,fd){if(Ye===i)return qn(ct);if(Yt)return uA(Ye),Ye=Ch(Bi,I),Pn(ct)}return Ye===i&&(Ye=Ch(Bi,I)),ze}return qs.cancel=ol,qs.flush=io,qs}var IL=Ni(function(S,I){return v6(S,1,I)}),lz=Ni(function(S,I,B){return v6(S,xc(I)||0,B)});function WA(S){return Sh(S,le)}function kS(S,I){if(typeof S!="function"||I!=null&&typeof I!="function")throw new Sc(u);var B=function(){var se=arguments,ge=I?I.apply(this,se):se[0],Ie=B.cache;if(Ie.has(ge))return Ie.get(ge);var ze=S.apply(this,se);return B.cache=Ie.set(ge,ze)||Ie,ze};return B.cache=new(kS.Cache||yh),B}kS.Cache=yh;function MS(S){if(typeof S!="function")throw new Sc(u);return function(){var I=arguments;switch(I.length){case 0:return!S.call(this);case 1:return!S.call(this,I[0]);case 2:return!S.call(this,I[0],I[1]);case 3:return!S.call(this,I[0],I[1],I[2])}return!S.apply(this,I)}}function Jy(S){return AL(2,S)}var $A=um(function(S,I){I=I.length==1&&ui(I[0])?os(I[0],Nl(Xn())):os(ka(I,1),Nl(Xn()));var B=I.length;return Ni(function(se){for(var ge=-1,Ie=eo(se.length,B);++ge<Ie;)se[ge]=I[ge].call(this,se[ge]);return Al(S,this,se)})}),jS=Ni(function(S,I){var B=hu(I,fm(jS));return Sh(S,G,i,I,B)}),US=Ni(function(S,I){var B=hu(I,fm(US));return Sh(S,$,i,I,B)}),KA=bh(function(S,I){return Sh(S,Y,i,i,i,I)});function qA(S,I){if(typeof S!="function")throw new Sc(u);return I=I===i?I:wi(I),Ni(S,I)}function cz(S,I){if(typeof S!="function")throw new Sc(u);return I=I==null?0:la(wi(I),0),Ni(function(B){var se=B[I],ge=Eh(B,0,I);return se&&Il(ge,se),Al(S,this,ge)})}function dz(S,I,B){var se=!0,ge=!0;if(typeof S!="function")throw new Sc(u);return gs(B)&&(se="leading"in B?!!B.leading:se,ge="trailing"in B?!!B.trailing:ge),Xy(S,I,{leading:se,maxWait:I,trailing:ge})}function NL(S){return xL(S,1)}function OL(S,I){return jS(Rc(I),S)}function PL(){if(!arguments.length)return[];var S=arguments[0];return ui(S)?S:[S]}function LL(S){return Tc(S,x)}function DL(S,I){return I=typeof I=="function"?I:i,Tc(S,x,I)}function uz(S){return Tc(S,E|x)}function kL(S,I){return I=typeof I=="function"?I:i,Tc(S,E|x,I)}function hz(S,I){return I==null||g6(S,I,Ta(I))}function no(S,I){return S===I||S!==S&&I!==I}var N0=ES(eA),YA=ES(function(S,I){return S>=I}),jf=w6(function(){return arguments}())?w6:function(S){return Rs(S)&&Tr.call(S,"callee")&&!bc.call(S,"callee")},ui=_t.isArray,fz=KP?Nl(KP):S6;function Po(S){return S!=null&&FS(S.length)&&!Th(S)}function js(S){return Rs(S)&&Po(S)}function pz(S){return S===!0||S===!1||Rs(S)&&Ca(S)==We}var hd=a6||vI,mz=xw?Nl(xw):JB;function gz(S){return Rs(S)&&S.nodeType===1&&!Qy(S)}function vz(S){if(S==null)return!0;if(Po(S)&&(ui(S)||typeof S=="string"||typeof S.splice=="function"||hd(S)||O0(S)||jf(S)))return!S.length;var I=Ma(S);if(I==Xt||I==it)return!S.size;if(T0(S))return!iA(S).length;for(var B in S)if(Tr.call(S,B))return!1;return!0}function yz(S,I){return w0(S,I)}function _z(S,I,B){B=typeof B=="function"?B:i;var se=B?B(S,I):i;return se===i?w0(S,I,i,B):!!se}function XA(S){if(!Rs(S))return!1;var I=Ca(S);return I==Qe||I==pt||typeof S.message=="string"&&typeof S.name=="string"&&!Qy(S)}function Ez(S){return typeof S=="number"&&o6(S)}function Th(S){if(!gs(S))return!1;var I=Ca(S);return I==Je||I==St||I==we||I==mt}function ML(S){return typeof S=="number"&&S==wi(S)}function FS(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=he}function gs(S){var I=typeof S;return S!=null&&(I=="object"||I=="function")}function Rs(S){return S!=null&&typeof S=="object"}var jL=qP?Nl(qP):ZB;function wz(S,I){return S===I||nA(S,I,Hy(I))}function Sz(S,I,B){return B=typeof B=="function"?B:i,nA(S,I,Hy(I),B)}function bz(S){return FL(S)&&S!=+S}function Cz(S){if(_V(S))throw new di(d);return b6(S)}function UL(S){return S===null}function Tz(S){return S==null}function FL(S){return typeof S=="number"||Rs(S)&&Ca(S)==Ht}function Qy(S){if(!Rs(S)||Ca(S)!=It)return!1;var I=$w(S);if(I===null)return!0;var B=Tr.call(I,"constructor")&&I.constructor;return typeof B=="function"&&B instanceof B&&Bw.call(B)==zw}var JA=Aw?Nl(Aw):eV;function Rz(S){return ML(S)&&S>=-he&&S<=he}var BL=Iw?Nl(Iw):tV;function BS(S){return typeof S=="string"||!ui(S)&&Rs(S)&&Ca(S)==Me}function Ul(S){return typeof S=="symbol"||Rs(S)&&Ca(S)==Ge}var O0=Nw?Nl(Nw):C6;function xz(S){return S===i}function Az(S){return Rs(S)&&Ma(S)==wt}function Iz(S){return Rs(S)&&Ca(S)==Pt}var Nz=ES(rA),Oz=ES(function(S,I){return S<=I});function VL(S){if(!S)return[];if(Po(S))return BS(S)?cd(S):nl(S);if(Nf&&S[Nf])return cB(S[Nf]());var I=Ma(S),B=I==Xt?Gx:I==it?jw:_m;return B(S)}function Rh(S){if(!S)return S===0?S:0;if(S=xc(S),S===Ce||S===-Ce){var I=S<0?-1:1;return I*pe}return S===S?S:0}function wi(S){var I=Rh(S),B=I%1;return I===I?B?I-B:I:0}function QA(S){return S?am(wi(S),0,Fe):0}function xc(S){if(typeof S=="number")return S;if(Ul(S))return Oe;if(gs(S)){var I=typeof S.valueOf=="function"?S.valueOf():S;S=gs(I)?I+"":I}if(typeof S!="string")return S===0?S:+S;S=e6(S);var B=uy.test(S);return B||bf.test(S)?ZF(S.slice(2),B?2:8):Ew.test(S)?Oe:+S}function VS(S){return mu(S,rl(S))}function Pz(S){return S?am(wi(S),-he,he):S===0?S:0}function Sr(S){return S==null?"":Dl(S)}var Lz=Df(function(S,I){if(T0(I)||Po(I)){mu(I,Ta(I),S);return}for(var B in I)Tr.call(I,B)&&_0(S,B,I[B])}),zL=Df(function(S,I){mu(I,rl(I),S)}),Zy=Df(function(S,I,B,se){mu(I,rl(I),S,se)}),Dz=Df(function(S,I,B,se){mu(I,Ta(I),S,se)}),ZA=bh(tS);function kz(S,I){var B=y0(S);return I==null?B:E0(B,I)}var Mz=Ni(function(S,I){S=kr(S);var B=-1,se=I.length,ge=se>2?I[2]:i;for(ge&&Oo(I[0],I[1],ge)&&(se=1);++B<se;)for(var Ie=I[B],ze=rl(Ie),Ye=-1,ct=ze.length;++Ye<ct;){var jt=ze[Ye],Ft=S[jt];(Ft===i||no(Ft,m0[jt])&&!Tr.call(S,jt))&&(S[jt]=Ie[jt])}return S}),jz=Ni(function(S){return S.push(i,W6),Al(nI,i,S)});function Uz(S,I){return XP(S,Xn(I,3),pu)}function HL(S,I){return XP(S,Xn(I,3),nS)}function Fz(S,I){return S==null?S:Qx(S,Xn(I,3),rl)}function GL(S,I){return S==null?S:Zx(S,Xn(I,3),rl)}function eI(S,I){return S&&pu(S,Xn(I,3))}function Bz(S,I){return S&&nS(S,Xn(I,3))}function Vz(S){return S==null?[]:iS(S,Ta(S))}function WL(S){return S==null?[]:iS(S,rl(S))}function tI(S,I,B){var se=S==null?i:lm(S,I);return se===i?B:se}function $L(S,I){return S!=null&&X6(S,I,KB)}function zS(S,I){return S!=null&&X6(S,I,qB)}var zz=pA(function(S,I,B){I!=null&&typeof I.toString!="function"&&(I=Vw.call(I)),S[I]=B},uI(sl)),Hz=pA(function(S,I,B){I!=null&&typeof I.toString!="function"&&(I=Vw.call(I)),Tr.call(S,I)?S[I].push(B):S[I]=[B]},Xn),Gz=Ni(cm);function Ta(S){return Po(S)?f6(S):iA(S)}function rl(S){return Po(S)?f6(S,!0):R6(S)}function Wz(S,I){var B={};return I=Xn(I,3),pu(S,function(se,ge,Ie){_h(B,I(se,ge,Ie),se)}),B}function $z(S,I){var B={};return I=Xn(I,3),pu(S,function(se,ge,Ie){_h(B,ge,I(se,ge,Ie))}),B}var KL=Df(function(S,I,B){rS(S,I,B)}),nI=Df(function(S,I,B,se){rS(S,I,B,se)}),iI=bh(function(S,I){var B={};if(S==null)return B;var se=!1;I=os(I,function(Ie){return Ie=kl(Ie,S),se||(se=Ie.length>1),Ie}),mu(S,Vy(S),B),se&&(B=Tc(B,E|C|x,hV));for(var ge=I.length;ge--;)jy(B,I[ge]);return B});function qL(S,I){return sI(S,MS(Xn(I)))}var rI=bh(function(S,I){return S==null?{}:sS(S,I)});function sI(S,I){if(S==null)return{};var B=os(Vy(S),function(se){return[se]});return I=Xn(I),I6(S,B,function(se,ge){return I(se,ge[0])})}function Ct(S,I,B){I=kl(I,S);var se=-1,ge=I.length;for(ge||(ge=1,S=i);++se<ge;){var Ie=S==null?i:S[Ml(I[se])];Ie===i&&(se=ge,Ie=B),S=Th(Ie)?Ie.call(S):Ie}return S}function YL(S,I,B){return S==null?S:My(S,I,B)}function XL(S,I,B,se){return se=typeof se=="function"?se:i,S==null?S:My(S,I,B,se)}var aI=H6(Ta),oI=H6(rl);function JL(S,I,B){var se=ui(S),ge=se||hd(S)||O0(S);if(I=Xn(I,4),B==null){var Ie=S&&S.constructor;ge?B=se?new Ie:[]:gs(S)?B=Th(Ie)?y0($w(S)):{}:B={}}return(ge?aa:pu)(S,function(ze,Ye,ct){return I(B,ze,Ye,ct)}),B}function QL(S,I){return S==null?!0:jy(S,I)}function ZL(S,I,B){return S==null?S:hS(S,I,Rc(B))}function eD(S,I,B,se){return se=typeof se=="function"?se:i,S==null?S:hS(S,I,Rc(B),se)}function _m(S){return S==null?[]:Hx(S,Ta(S))}function lI(S){return S==null?[]:Hx(S,rl(S))}function tD(S,I,B){return B===i&&(B=I,I=i),B!==i&&(B=xc(B),B=B===B?B:0),I!==i&&(I=xc(I),I=I===I?I:0),am(xc(S),I,B)}function nD(S,I,B){return I=Rh(I),B===i?(B=I,I=0):B=Rh(B),S=xc(S),YB(S,I,B)}function iD(S,I,B){if(B&&typeof B!="boolean"&&Oo(S,I,B)&&(I=B=i),B===i&&(typeof I=="boolean"?(B=I,I=i):typeof S=="boolean"&&(B=S,S=i)),S===i&&I===i?(S=0,I=1):(S=Rh(S),I===i?(I=S,S=0):I=Rh(I)),S>I){var se=S;S=I,I=se}if(B||S%1||I%1){var ge=c6();return eo(S+ge*(I-S+GP("1e-"+((ge+"").length-1))),I)}return aA(S,I)}var rD=b0(function(S,I,B){return I=I.toLowerCase(),S+(B?HS(I):I)});function HS(S){return e_(Sr(S).toLowerCase())}function cI(S){return S=Sr(S),S&&S.replace(Nx,wc).replace($F,"")}function sD(S,I,B){S=Sr(S),I=Dl(I);var se=S.length;B=B===i?se:am(wi(B),0,se);var ge=B;return B-=I.length,B>=0&&S.slice(B,ge)==I}function aD(S){return S=Sr(S),S&&nn.test(S)?S.replace(yn,aB):S}function oD(S){return S=Sr(S),S&&Ui.test(S)?S.replace(Tn,"\\$&"):S}var lD=b0(function(S,I,B){return S+(B?"-":"")+I.toLowerCase()}),cD=b0(function(S,I,B){return S+(B?" ":"")+I.toLowerCase()}),dD=U6("toLowerCase");function uD(S,I,B){S=Sr(S),I=wi(I);var se=I?f0(S):0;if(!I||se>=I)return S;var ge=(I-se)/2;return _S(wy(ge),B)+S+_S(Ey(ge),B)}function hD(S,I,B){S=Sr(S),I=wi(I);var se=I?f0(S):0;return I&&se<I?S+_S(I-se,B):S}function fD(S,I,B){S=Sr(S),I=wi(I);var se=I?f0(S):0;return I&&se<I?_S(I-se,B)+S:S}function pD(S,I,B){return B||I==null?I=0:I&&(I=+I),EB(Sr(S).replace(xr,""),I||0)}function mD(S,I,B){return(B?Oo(S,I,B):I===i)?I=1:I=wi(I),oA(Sr(S),I)}function gD(){var S=arguments,I=Sr(S[0]);return S.length<3?I:I.replace(S[1],S[2])}var vD=b0(function(S,I,B){return S+(B?"_":"")+I.toLowerCase()});function yD(S,I,B){return B&&typeof B!="number"&&Oo(S,I,B)&&(I=B=i),B=B===i?Fe:B>>>0,B?(S=Sr(S),S&&(typeof I=="string"||I!=null&&!JA(I))&&(I=Dl(I),!I&&h0(S))?Eh(cd(S),0,B):S.split(I,B)):[]}var _D=b0(function(S,I,B){return S+(B?" ":"")+e_(I)});function ED(S,I,B){return S=Sr(S),B=B==null?0:am(wi(B),0,S.length),I=Dl(I),S.slice(B,B+I.length)==I}function wD(S,I,B){var se=be.templateSettings;B&&Oo(S,I,B)&&(I=i),S=Sr(S),I=Zy({},I,se,G6);var ge=Zy({},I.imports,se.imports,G6),Ie=Ta(ge),ze=Hx(ge,Ie),Ye,ct,jt=0,Ft=I.interpolate||No,Yt="__p += '",vn=vy((I.escape||No).source+"|"+Ft.source+"|"+(Ft===Jt?t0:No).source+"|"+(I.evaluate||No).source+"|$","g"),Pn="//# sourceURL="+(Tr.call(I,"sourceURL")?(I.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++XF+"]")+`
`;S.replace(vn,function(ei,Bi,Yi,ol,io,qs){return Yi||(Yi=ol),Yt+=S.slice(jt,qs).replace(Ox,oB),Bi&&(Ye=!0,Yt+=`' +
__e(`+Bi+`) +
'`),io&&(ct=!0,Yt+=`';
`+io+`;
__p += '`),Yi&&(Yt+=`' +
((__t = (`+Yi+`)) == null ? '' : __t) +
'`),jt=qs+ei.length,ei}),Yt+=`';
`;var qn=Tr.call(I,"variable")&&I.variable;if(!qn)Yt=`with (obj) {
`+Yt+`
}
`;else if(Io.test(qn))throw new di(p);Yt=(ct?Yt.replace(Ze,""):Yt).replace(nt,"$1").replace($e,"$1;"),Yt="function("+(qn||"obj")+`) {
`+(qn?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Ye?", __e = _.escape":"")+(ct?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Yt+`return __p
}`;var Ci=RD(function(){return ur(Ie,Pn+"return "+Yt).apply(i,ze)});if(Ci.source=Yt,XA(Ci))throw Ci;return Ci}function SD(S){return Sr(S).toLowerCase()}function bD(S){return Sr(S).toUpperCase()}function Kz(S,I,B){if(S=Sr(S),S&&(B||I===i))return e6(S);if(!S||!(I=Dl(I)))return S;var se=cd(S),ge=cd(I),Ie=Mw(se,ge),ze=t6(se,ge)+1;return Eh(se,Ie,ze).join("")}function qz(S,I,B){if(S=Sr(S),S&&(B||I===i))return S.slice(0,dd(S)+1);if(!S||!(I=Dl(I)))return S;var se=cd(S),ge=t6(se,cd(I))+1;return Eh(se,0,ge).join("")}function dI(S,I,B){if(S=Sr(S),S&&(B||I===i))return S.replace(xr,"");if(!S||!(I=Dl(I)))return S;var se=cd(S),ge=Mw(se,cd(I));return Eh(se,ge).join("")}function CD(S,I){var B=re,se=ee;if(gs(I)){var ge="separator"in I?I.separator:ge;B="length"in I?wi(I.length):B,se="omission"in I?Dl(I.omission):se}S=Sr(S);var Ie=S.length;if(h0(S)){var ze=cd(S);Ie=ze.length}if(B>=Ie)return S;var Ye=B-f0(se);if(Ye<1)return se;var ct=ze?Eh(ze,0,Ye).join(""):S.slice(0,Ye);if(ge===i)return ct+se;if(ze&&(Ye+=ct.length-Ye),JA(ge)){if(S.slice(Ye).search(ge)){var jt,Ft=ct;for(ge.global||(ge=vy(ge.source,Sr(Qa.exec(ge))+"g")),ge.lastIndex=0;jt=ge.exec(Ft);)var Yt=jt.index;ct=ct.slice(0,Yt===i?Ye:Yt)}}else if(S.indexOf(Dl(ge),Ye)!=Ye){var vn=ct.lastIndexOf(ge);vn>-1&&(ct=ct.slice(0,vn))}return ct+se}function Yz(S){return S=Sr(S),S&&Dt.test(S)?S.replace(rt,hB):S}var Xz=b0(function(S,I,B){return S+(B?" ":"")+I.toUpperCase()}),e_=U6("toUpperCase");function TD(S,I,B){return S=Sr(S),I=B?i:I,I===i?n6(S)?pB(S):iB(S):S.match(I)||[]}var RD=Ni(function(S,I){try{return Al(S,i,I)}catch(B){return XA(B)?B:new di(B)}}),Jz=bh(function(S,I){return aa(I,function(B){B=Ml(B),_h(S,B,LS(S[B],S))}),S});function xD(S){var I=S==null?0:S.length,B=Xn();return S=I?os(S,function(se){if(typeof se[1]!="function")throw new Sc(u);return[B(se[0]),se[1]]}):[],Ni(function(se){for(var ge=-1;++ge<I;){var Ie=S[ge];if(Al(Ie[0],this,se))return Al(Ie[1],this,se)}})}function Qz(S){return m6(Tc(S,E))}function uI(S){return function(){return S}}function Zz(S,I){return S==null||S!==S?I:S}var eH=B6(),hI=B6(!0);function sl(S){return S}function Us(S){return T6(typeof S=="function"?S:Tc(S,E))}function AD(S){return sA(Tc(S,E))}function ID(S,I){return S0(S,Tc(I,E))}var P0=Ni(function(S,I){return function(B){return cm(B,S,I)}}),tH=Ni(function(S,I){return function(B){return cm(S,B,I)}});function L0(S,I,B){var se=Ta(I),ge=iS(I,se);B==null&&!(gs(I)&&(ge.length||!se.length))&&(B=I,I=S,S=this,ge=iS(I,Ta(I)));var Ie=!(gs(B)&&"chain"in B)||!!B.chain,ze=Th(S);return aa(ge,function(Ye){var ct=I[Ye];S[Ye]=ct,ze&&(S.prototype[Ye]=function(){var jt=this.__chain__;if(Ie||jt){var Ft=S(this.__wrapped__),Yt=Ft.__actions__=nl(this.__actions__);return Yt.push({func:ct,args:arguments,thisArg:S}),Ft.__chain__=jt,Ft}return ct.apply(S,Il([this.value()],arguments))})}),S}function fI(){return dr._===this&&(dr._=yy),this}function D0(){}function GS(S){return S=wi(S),Ni(function(I){return x6(I,S)})}var pI=mA(os),mI=mA(YP),WS=mA(Lw);function t_(S){return vA(S)?Vx(Ml(S)):N6(S)}function nH(S){return function(I){return S==null?i:lm(S,I)}}var iH=V6(),rH=V6(!0);function gI(){return[]}function vI(){return!1}function sH(){return{}}function yI(){return""}function aH(){return!0}function oH(S,I){if(S=wi(S),S<1||S>he)return[];var B=Fe,se=eo(S,Fe);I=Xn(I),S-=Fe;for(var ge=zx(se,I);++B<S;)I(B);return ge}function al(S){return ui(S)?os(S,Ml):Ul(S)?[S]:nl(CS(Sr(S)))}function ND(S){var I=++i6;return Sr(S)+I}var lH=ud(function(S,I){return S+I},0),cH=By("ceil"),dH=ud(function(S,I){return S/I},1),uH=By("floor");function $S(S){return S&&S.length?Ly(S,sl,eA):i}function OD(S,I){return S&&S.length?Ly(S,Xn(I,2),eA):i}function hH(S){return QP(S,sl)}function fH(S,I){return QP(S,Xn(I,2))}function pH(S){return S&&S.length?Ly(S,sl,rA):i}function mH(S,I){return S&&S.length?Ly(S,Xn(I,2),rA):i}var _I=ud(function(S,I){return S*I},1),PD=By("round"),gH=ud(function(S,I){return S-I},0);function EI(S){return S&&S.length?kw(S,sl):0}function vH(S,I){return S&&S.length?kw(S,Xn(I,2)):0}return be.after=oz,be.ary=xL,be.assign=Lz,be.assignIn=zL,be.assignInWith=Zy,be.assignWith=Dz,be.at=ZA,be.before=AL,be.bind=LS,be.bindAll=Jz,be.bindKey=DS,be.castArray=PL,be.chain=kf,be.chunk=rL,be.compact=bV,be.concat=CV,be.cond=xD,be.conforms=Qz,be.constant=uI,be.countBy=FA,be.create=kz,be.curry=HA,be.curryRight=GA,be.debounce=Xy,be.defaults=Mz,be.defaultsDeep=jz,be.defer=IL,be.delay=lz,be.difference=TV,be.differenceBy=CA,be.differenceWith=TA,be.drop=RV,be.dropRight=TS,be.dropRightWhile=sL,be.dropWhile=jl,be.fill=xV,be.filter=XV,be.flatMap=JV,be.flatMapDeep=qy,be.flatMapDepth=vu,be.flatten=oL,be.flattenDeep=lL,be.flattenDepth=cL,be.flip=WA,be.flow=eH,be.flowRight=hI,be.fromPairs=AV,be.functions=Vz,be.functionsIn=WL,be.groupBy=QV,be.initial=NV,be.intersection=OV,be.intersectionBy=AA,be.intersectionWith=IA,be.invert=zz,be.invertBy=Hz,be.invokeMap=TL,be.iteratee=Us,be.keyBy=ZV,be.keys=Ta,be.keysIn=rl,be.map=ym,be.mapKeys=Wz,be.mapValues=$z,be.matches=AD,be.matchesProperty=ID,be.memoize=kS,be.merge=KL,be.mergeWith=nI,be.method=P0,be.methodOf=tH,be.mixin=L0,be.negate=MS,be.nthArg=GS,be.omit=iI,be.omitBy=qL,be.once=Jy,be.orderBy=Mf,be.over=pI,be.overArgs=$A,be.overEvery=mI,be.overSome=WS,be.partial=jS,be.partialRight=US,be.partition=Yy,be.pick=rI,be.pickBy=sI,be.property=t_,be.propertyOf=nH,be.pull=DV,be.pullAll=RS,be.pullAllBy=$y,be.pullAllWith=uL,be.pullAt=NA,be.range=iH,be.rangeRight=rH,be.rearg=KA,be.reject=nz,be.remove=OA,be.rest=qA,be.reverse=xS,be.sampleSize=zA,be.set=YL,be.setWith=XL,be.shuffle=rz,be.slice=hL,be.sortBy=RL,be.sortedUniq=mL,be.sortedUniqBy=gL,be.split=yD,be.spread=cz,be.tail=kV,be.take=MV,be.takeRight=vm,be.takeRightWhile=vL,be.takeWhile=jV,be.tap=EL,be.throttle=dz,be.thru=PS,be.toArray=VL,be.toPairs=aI,be.toPairsIn=oI,be.toPath=al,be.toPlainObject=VS,be.transform=JL,be.unary=NL,be.union=kA,be.unionBy=UV,be.unionWith=FV,be.uniq=BV,be.uniqBy=VV,be.uniqWith=MA,be.unset=QL,be.unzip=AS,be.unzipWith=jA,be.update=ZL,be.updateWith=eD,be.values=_m,be.valuesIn=lI,be.without=yL,be.words=TD,be.wrap=OL,be.xor=IS,be.xorBy=_L,be.xorWith=UA,be.zip=NS,be.zipObject=OS,be.zipObjectDeep=zV,be.zipWith=A0,be.entries=aI,be.entriesIn=oI,be.extend=zL,be.extendWith=Zy,L0(be,be),be.add=lH,be.attempt=RD,be.camelCase=rD,be.capitalize=HS,be.ceil=cH,be.clamp=tD,be.clone=LL,be.cloneDeep=uz,be.cloneDeepWith=kL,be.cloneWith=DL,be.conformsTo=hz,be.deburr=cI,be.defaultTo=Zz,be.divide=dH,be.endsWith=sD,be.eq=no,be.escape=aD,be.escapeRegExp=oD,be.every=wL,be.find=SL,be.findIndex=aL,be.findKey=Uz,be.findLast=bL,be.findLastIndex=RA,be.findLastKey=HL,be.floor=uH,be.forEach=BA,be.forEachRight=CL,be.forIn=Fz,be.forInRight=GL,be.forOwn=eI,be.forOwnRight=Bz,be.get=tI,be.gt=N0,be.gte=YA,be.has=$L,be.hasIn=zS,be.head=xA,be.identity=sl,be.includes=VA,be.indexOf=IV,be.inRange=nD,be.invoke=Gz,be.isArguments=jf,be.isArray=ui,be.isArrayBuffer=fz,be.isArrayLike=Po,be.isArrayLikeObject=js,be.isBoolean=pz,be.isBuffer=hd,be.isDate=mz,be.isElement=gz,be.isEmpty=vz,be.isEqual=yz,be.isEqualWith=_z,be.isError=XA,be.isFinite=Ez,be.isFunction=Th,be.isInteger=ML,be.isLength=FS,be.isMap=jL,be.isMatch=wz,be.isMatchWith=Sz,be.isNaN=bz,be.isNative=Cz,be.isNil=Tz,be.isNull=UL,be.isNumber=FL,be.isObject=gs,be.isObjectLike=Rs,be.isPlainObject=Qy,be.isRegExp=JA,be.isSafeInteger=Rz,be.isSet=BL,be.isString=BS,be.isSymbol=Ul,be.isTypedArray=O0,be.isUndefined=xz,be.isWeakMap=Az,be.isWeakSet=Iz,be.join=PV,be.kebabCase=lD,be.last=il,be.lastIndexOf=LV,be.lowerCase=cD,be.lowerFirst=dD,be.lt=Nz,be.lte=Oz,be.max=$S,be.maxBy=OD,be.mean=hH,be.meanBy=fH,be.min=pH,be.minBy=mH,be.stubArray=gI,be.stubFalse=vI,be.stubObject=sH,be.stubString=yI,be.stubTrue=aH,be.multiply=_I,be.nth=dL,be.noConflict=fI,be.noop=D0,be.now=I0,be.pad=uD,be.padEnd=hD,be.padStart=fD,be.parseInt=pD,be.random=iD,be.reduce=ez,be.reduceRight=tz,be.repeat=mD,be.replace=gD,be.result=Ct,be.round=PD,be.runInContext=ot,be.sample=iz,be.size=sz,be.snakeCase=vD,be.some=az,be.sortedIndex=fL,be.sortedIndexBy=pL,be.sortedIndexOf=x0,be.sortedLastIndex=PA,be.sortedLastIndexBy=LA,be.sortedLastIndexOf=DA,be.startCase=_D,be.startsWith=ED,be.subtract=gH,be.sum=EI,be.sumBy=vH,be.template=wD,be.times=oH,be.toFinite=Rh,be.toInteger=wi,be.toLength=QA,be.toLower=SD,be.toNumber=xc,be.toSafeInteger=Pz,be.toString=Sr,be.toUpper=bD,be.trim=Kz,be.trimEnd=qz,be.trimStart=dI,be.truncate=CD,be.unescape=Yz,be.uniqueId=ND,be.upperCase=Xz,be.upperFirst=e_,be.each=BA,be.eachRight=CL,be.first=xA,L0(be,function(){var S={};return pu(be,function(I,B){Tr.call(be.prototype,B)||(S[B]=I)}),S}(),{chain:!1}),be.VERSION=s,aa(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){be[S].placeholder=be}),aa(["drop","take"],function(S,I){Fi.prototype[S]=function(B){B=B===i?1:la(wi(B),0);var se=this.__filtered__&&!I?new Fi(this):this.clone();return se.__filtered__?se.__takeCount__=eo(B,se.__takeCount__):se.__views__.push({size:eo(B,Fe),type:S+(se.__dir__<0?"Right":"")}),se},Fi.prototype[S+"Right"]=function(B){return this.reverse()[S](B).reverse()}}),aa(["filter","map","takeWhile"],function(S,I){var B=I+1,se=B==ae||B==me;Fi.prototype[S]=function(ge){var Ie=this.clone();return Ie.__iteratees__.push({iteratee:Xn(ge,3),type:B}),Ie.__filtered__=Ie.__filtered__||se,Ie}}),aa(["head","last"],function(S,I){var B="take"+(I?"Right":"");Fi.prototype[S]=function(){return this[B](1).value()[0]}}),aa(["initial","tail"],function(S,I){var B="drop"+(I?"":"Right");Fi.prototype[S]=function(){return this.__filtered__?new Fi(this):this[B](1)}}),Fi.prototype.compact=function(){return this.filter(sl)},Fi.prototype.find=function(S){return this.filter(S).head()},Fi.prototype.findLast=function(S){return this.reverse().find(S)},Fi.prototype.invokeMap=Ni(function(S,I){return typeof S=="function"?new Fi(this):this.map(function(B){return cm(B,S,I)})}),Fi.prototype.reject=function(S){return this.filter(MS(Xn(S)))},Fi.prototype.slice=function(S,I){S=wi(S);var B=this;return B.__filtered__&&(S>0||I<0)?new Fi(B):(S<0?B=B.takeRight(-S):S&&(B=B.drop(S)),I!==i&&(I=wi(I),B=I<0?B.dropRight(-I):B.take(I-S)),B)},Fi.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},Fi.prototype.toArray=function(){return this.take(Fe)},pu(Fi.prototype,function(S,I){var B=/^(?:filter|find|map|reject)|While$/.test(I),se=/^(?:head|last)$/.test(I),ge=be[se?"take"+(I=="last"?"Right":""):I],Ie=se||/^find/.test(I);ge&&(be.prototype[I]=function(){var ze=this.__wrapped__,Ye=se?[1]:arguments,ct=ze instanceof Fi,jt=Ye[0],Ft=ct||ui(ze),Yt=function(Bi){var Yi=ge.apply(be,Il([Bi],Ye));return se&&vn?Yi[0]:Yi};Ft&&B&&typeof jt=="function"&&jt.length!=1&&(ct=Ft=!1);var vn=this.__chain__,Pn=!!this.__actions__.length,qn=Ie&&!vn,Ci=ct&&!Pn;if(!Ie&&Ft){ze=Ci?ze:new Fi(this);var ei=S.apply(ze,Ye);return ei.__actions__.push({func:PS,args:[Yt],thisArg:i}),new Ll(ei,vn)}return qn&&Ci?S.apply(this,Ye):(ei=this.thru(Yt),qn?se?ei.value()[0]:ei.value():ei)})}),aa(["pop","push","shift","sort","splice","unshift"],function(S){var I=Tt[S],B=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",se=/^(?:pop|shift)$/.test(S);be.prototype[S]=function(){var ge=arguments;if(se&&!this.__chain__){var Ie=this.value();return I.apply(ui(Ie)?Ie:[],ge)}return this[B](function(ze){return I.apply(ui(ze)?ze:[],ge)})}}),pu(Fi.prototype,function(S,I){var B=be[I];if(B){var se=B.name+"";Tr.call(v0,se)||(v0[se]=[]),v0[se].push({name:I,func:B})}}),v0[yS(i,P).name]=[{name:"wrapper",func:i}],Fi.prototype.clone=TB,Fi.prototype.reverse=RB,Fi.prototype.value=Iy,be.prototype.at=HV,be.prototype.chain=Ky,be.prototype.commit=GV,be.prototype.next=WV,be.prototype.plant=KV,be.prototype.reverse=qV,be.prototype.toJSON=be.prototype.valueOf=be.prototype.value=YV,be.prototype.first=be.prototype.head,Nf&&(be.prototype[Nf]=$V),be},p0=mB();tm?((tm.exports=p0)._=p0,jx._=p0):dr._=p0}).call(Ws)})(e9,e9.exports);var Tx=e9.exports;const CP=({filters:n,onSearch:t,className:i=""})=>{var p;const s=i||"",l=k.useRef(),d=()=>{l.current&&(l.current.value="",t(""))},u=Tx.debounce(m=>{t(m)},500);return h.jsx("div",{className:`search-bar position-relative pb-1 ${s}`,children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-0",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:m=>{u(m.target.value)},ref:l,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off",className:"mb-"}),((p=l==null?void 0:l.current)==null?void 0:p.value.length)>0&&h.jsx(Lt,{onClick:d,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(ow,{})},"search-clear-btn")]})})};function SYe(){const n=ji(),[t,i]=k.useState(""),s=["name","target"],l=async()=>{var C,x;try{const N=await ps.getFormQuickActions();return N.data.status==="success"?(console.log("## actionRes --",N),(x=(C=N.data)==null?void 0:C.data)==null?void 0:x.actions):null}catch{throw new Error("Error fetching quick actions")}},{isFetching:d,isPending:u,isError:p,data:m,error:y}=ru({queryKey:["formQuickActionsQuery"],queryFn:l}),_=k.useMemo(()=>pP(m,t,s),[m,t]),E=async(C,x)=>{if(console.log("handleUrl is called...",C," ",x),x==="internal_action"){let N=null;C.includes("send-message")&&(console.log('url.includes("send-message") = ',C.includes("send-message")),N={pageTitle:"Send a Message",hideFooterNav:!0}),n(C,{state:N})}else await sx.open({url:C,toolbarColor:Y2})};return u?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:[0,1,2].map((C,x)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions"})},x))})})}):p?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more actions"})})}):h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[(m==null?void 0:m.length)>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"py-0 pt-2 sticky-to",style:{},children:h.jsxs("div",{className:"pb-0",children:[h.jsx(CP,{filters:s,onSearch:C=>i(C),className:"mb-"}),(_==null?void 0:_.length)>0&&t.length>0&&h.jsx(To,{size:"sm",className:"px-1 text-gray9",children:`Results found ${_==null?void 0:_.length}`})]})})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-2",children:d&&(_==null?void 0:_.length)===0?h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:[0,1,2].map((C,x)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions"})},x))}):h.jsx(h.Fragment,{children:h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:_==null?void 0:_.map((C,x)=>h.jsx(Gt,{children:h.jsx(wYe,{className:"",item:C,handleQuickAction:E})},(C==null?void 0:C.form_id)+(C==null?void 0:C.name)))})})})]})})}function NZ({btnTitle:n,className:t,isWide:i,icon:s,style:l,primaryActionHandler:d}){const u=k.useRef(null),p=i||!1,m=s||"add3",y=n||"Add",_=t||"",E={bottom:120,right:10},C=l?{...E,...l}:E;function x(){const N=window.scrollY;Math.round(N)>=100?u.current.classList.remove("expanded"):u.current.classList.add("expanded")}return k.useEffect(()=>(x(),window.addEventListener("scroll",x),()=>{window.removeEventListener("scroll",x)}),[]),h.jsx(h.Fragment,{children:h.jsxs(Lt,{type:"button",ref:u,className:`btn-theme btn-icon btn-lg btn-secondary btn-quick-action position-fixed border-0 rounded-5 shadow expanded ${_} ${p?"btn-wide":""}`,style:C,onClick:d,children:[h.jsx(tn,{tag:m,className:"font-22"}),h.jsx("span",{className:"text-white fw-sb font-14 btn-title",children:y})]})})}function uEe(n){var u,p,m;const t=n!=null&&n.className?n==null?void 0:n.className:"",i=n!=null&&n.bodyClassName?n==null?void 0:n.bodyClassName:"",s=(u=n.item)==null?void 0:u.name,l=(p=n.item)==null?void 0:p.avatar,d=(m=n.item)==null?void 0:m.date;return h.jsx(h.Fragment,{children:h.jsx(et,{className:`list-view-card list-view-card-sm border-0 border-bottom rounded-0 shado ${t}`,children:h.jsx(et.Body,{className:`p-2 ${i}`,children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 list-icon-container position-relative d-flex align-items-center",children:h.jsx("div",{className:"list-icon-wrapper rounded-circle overflow-hidden",children:h.jsx("img",{src:l,alt:`${s} image`,className:"img-fluid"})})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 list-info-container",children:[h.jsx("span",{className:"font-13 fw-sb",children:`${s} `}),h.jsx("span",{className:"d-block font-12 text-gray9",children:d})]})]})})})})}function Rx({isLiked:n,loadingMediaLike:t,loadingLikesList:i,likesData:s,likeActionHandler:l,parentId:d}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"d-flex justify-content-between align-items-center p-2 bg-gray-lighter3 rounded-3 mb-2",children:[h.jsx("span",{className:"font-13 fw-sb",children:n?"You liked it":"You did not like it yet!"}),h.jsxs(Lt,{className:`btn-theme btn-sm btn-likes-light ms-2 px-2 ${n&&"active"}`,onClick:()=>l(d),children:[t?h.jsx(Zi,{size:"sm",className:"me-1"}):h.jsx(tn,{tag:"favorite3",className:"font-18 me-1"}),h.jsx("span",{className:"",children:n?"Dislike now":"Like now"})]})]}),i&&h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:[0,1,2].map((u,p)=>h.jsx(ci,{type:"likes-list"},p))})}),!i&&(s==null?void 0:s.length)>0&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:s.map(u=>h.jsx(uEe,{item:u,className:"",bodyClassName:"px-0"},u.name+u.date))})})})]})}function bYe(n,t){k.useEffect(()=>{if(n){console.log("textAreaRef = ",n);const i=n.scrollHeight;console.log("scrollHeight = ",i),i<=100&&(n.style.height="0px",n.style.height=i+"px")}},[n,t])}const Ro={getAllWallMessages:async n=>{console.log("Inside Service getAllWallMessages() ...");const t=n?`&lastkey=${n}`:"";return await kn.get(`wall/wallmessage/list?paginate=yes${t}`)},getWallMessageDetails:async n=>(console.log("Inside Service getWallMessageDetails() ..."),await kn.get(`wall/wallmessage/details?id=${n}`)),getAllWallMessageRecipients:async()=>(console.log("Inside Service getWallMessageDetails() ..."),await kn.get("ums/users/recipients")),sendWallMessage:async n=>(console.log("Inside Service sendWallMessage() ...",n),await kn.post("wall/wallmessage/sendbroadcast",n)),getWallMessageLike:async n=>(console.log("Inside Service getWallMessageLike() ..."),await kn.get(`wall/wallmessage/like?id=${n}`)),getWallMessageLikesList:async n=>(console.log("Inside Service getWallMessageLikesList() ..."),await kn.get(`wall/wallmessage/likes?id=${n}`)),getAllWallMessageCommentList:async n=>(console.log("Inside Service getAllWallMessageCommentList() ..."),await kn.get(`wall/wallmessage/comments?id=${n}`)),addWallMessageComment:async n=>(console.log("Inside Service addWallMessageComment() ...",n),await kn.post("wall/wallmessage/comment",n))},CYe=40;function TYe(n){const[t,i]=k.useState(!1),[s,l]=k.useState(""),[d,u]=k.useState(!1),p=k.useRef(null);bYe(p.current,s);const m=C=>{var N;console.log("handleTextAreaChange called ...",C),u(!1);const x=(N=C.target)==null?void 0:N.value;l(x),x!==""&&u(!0)},y=C=>{l(""),i(!1),u(!1)};let _="";switch(n.addPlacement){case"modal":_="";break;case"fixed-bottom":_="fixed-bottom";break}const E=async C=>{if(C.preventDefault(),s===""){handleAlert("Comment should not be empty!","error"),u(!1);return}i(!0);let x={comment:s};switch(console.log("handleSubmit called...",C),n.comment_type){case"media":x={...x,media_id:n.parent_id},console.log("Calling add thread comment..."),ps.addMagazineMediaComment(x).then(N=>{console.log("addMagazineMediaComment RES = ",N.data),N.data.status==="success"?(console.log('Inside AddComment case "thread" : ',N.data),n.setCommentsCount(O=>O+1),n.handleCommentList(n.parent_id),i(!1),y()):N.data.status==="failed"&&(console.log("ERROR:",N.data.error),handleAlert("Failed to add a comment!","error"),i(!1),y())}).catch(N=>{console.log(N)});break;case"message":x={...x,message_id:n.parent_id},console.log("Calling add message comment..."),Ro.addWallMessageComment(x).then(N=>{N.data.status==="success"?(console.log(N.data),n.setCommentsCount(O=>O+1),n.handleCommentList(n.parent_id),i(!1),y()):N.data.status==="failed"&&(console.log("ERROR:",N.data.error),handleAlert("Failed to add a comment!","error"),i(!1),y())}).catch(N=>{console.log(N)});break;case"contest":x={...x,submission_id:n.parent_id},console.log("Calling add contest comment..."),Xa.addContestSubmissionComment(x).then(N=>{N.data.status==="success"?(console.log(N.data),n.setCommentsCount(O=>O+1),n.handleCommentList(n.parent_id),i(!1),y()):N.data.status==="failed"&&(console.log("ERROR:",N.data.error),handleAlert("Failed to add a comment!","error"),i(!1),y())}).catch(N=>{console.log(N)});break}};return h.jsx(h.Fragment,{children:h.jsx(et,{className:`border-0 pt-3 pb-2 px-0 add_comment_card ${_}`,children:h.jsx(kt,{className:"form_style",onSubmit:E,children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-fill pe-2",children:h.jsx(kt.Group,{className:"form-group rounded_corners mb-0",children:h.jsx(kt.Control,{as:"textarea",ref:p,rows:1,style:{height:s===""&&CYe,resize:"auto"},placeholder:"Add comment",name:"comment",value:s,onChange:m,autoComplete:"off"})})}),h.jsx("div",{className:"btn-wrap",children:h.jsx(Lt,{type:"submit",className:"btn btn-theme btn-primary btn_comment_submit",disabled:!d,children:t?h.jsx(h.Fragment,{children:h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})}):h.jsx(Jye,{})})})]})})})})}function RYe(n){var i,s,l,d,u,p;const t=((i=n.comment)==null?void 0:i.avatar)!=="NULL"?(s=n.comment)==null?void 0:s.avatar:"/img/profile-pic.png";return h.jsx(h.Fragment,{children:h.jsxs(et,{className:"comment_card border- shadow-s mb-0 overflow-hidden",children:[h.jsx(et.Body,{className:"pb-0",children:h.jsx("p",{className:"mb-0 font-14 text-gray5 ps-1",children:(l=n.comment)==null?void 0:l.comment})}),h.jsx(et.Header,{className:"bg_transparent border-0 pt-2",children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:t,className:"rounded-circle media_img",alt:`${(d=n.comment)==null?void 0:d.name} profile`})}),h.jsxs("div",{className:"media_body ms-1 d-flex justify-content-betwee align-items-center",children:[h.jsx("div",{className:"mb-0 font-12 text-gray6 fw-",children:(u=n.comment)==null?void 0:u.name}),h.jsx("span",{className:"dot-seperator"}),h.jsx("div",{className:"font-12 text-gray6",children:(p=n.comment)==null?void 0:p.date})]})]})})]})})}function xYe(n){var t;return h.jsxs("div",{className:"d-grid gap-3 comment_list_wrap px-0 pt-0",children:[h.jsx(TYe,{comment_type:n.comment_type,parent_id:n.parent_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:n.addPlacement}),n.loading?h.jsx(h.Fragment,{children:[0,1,2].map((i,s)=>h.jsx(ci,{type:"comment-list"},`placeholder-comment-card-${s}`))}):h.jsxs(h.Fragment,{children:[!((t=n.comments)!=null&&t.length)>0&&h.jsxs(h.Fragment,{children:[" ",h.jsx("div",{className:"font-14 fw-sb",children:"No more comments!"})]}),n.comments.length>0&&n.comments.map(i=>h.jsx(RYe,{comment_type:n.comment_type,comment:i,parent_owner_id:n.parent_owner_id},n.parent_id+i.name+i.date))]})]})}function mw(n){const t=n.addPlacement?n.addPlacement:"modal";return h.jsx("div",{className:"position-relative pb-3 h-100",children:h.jsx(xYe,{loading:n.loading,comment_type:n.comment_type,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:t})})}function AYe(n){var m,y,_,E,C,x;const[t,i]=k.useState("msg_likes_tab");console.log("BadgeDetailsModal: I am running...likeCount",n.likeCount);const s=((m=n.badge)==null?void 0:m.image)!==""?(y=n.badge)==null?void 0:y.image:"star-icon.png",l=((_=n.data)==null?void 0:_.title)&&((E=n.data)==null?void 0:E.title),d=n.likeCount?n.likeCount:(C=n.data)==null?void 0:C.likes_count,u=n.commentsCount?n.commentsCount:(x=n.data)==null?void 0:x.comments_count;k.useEffect(()=>{n.likesListHandler(n.parent_id)},[n.parent_id]);const p=N=>{console.log("Key in handleSelectedTab =",N),N=="msg_likes_tab"&&(console.log("Entering into msg_likes_tab",n.parent_id),n.likesListHandler(n.parent_id)),N=="msg_comments_tab"&&n.handleCommentList(n.parent_id),i(N)};return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb border-0",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:n.badge.title})}),h.jsx(wn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"d-flex justify-content-center badge-symbol-container mx-auto",children:h.jsx("div",{className:"media-img-wrapper rounded-3",children:h.jsx(Ts,{src:s,alt:n.badge.title,wrapperClassName:"img-fluid mx-auto "})})}),h.jsxs("div",{className:"d-flex justify-content-center align-items-center py-2 font-14 fw-sb text-gray9",children:[h.jsxs("div",{className:"",children:[n.badge.points," points"]}),h.jsx("div",{className:"dot-seperator"}),h.jsx("div",{className:"",children:n.badge.date})]}),h.jsx("div",{className:"font-14 fw-sb text-gray6 pb-2 d-flex justify-content-center",children:h.jsx("div",{className:"mx-auto my-3 text-center",children:l})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:N=>p(N),mountOnEnter:!0,unmountOnExit:!0,children:[h.jsx("div",{className:"tab_links",children:h.jsxs(Un,{variant:"pills",className:"nav-justified",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${d} ${d===1?"Like":"Likes"}`})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${u} ${u===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(Rx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:n.parent_id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(mw,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})})}function IYe({badge:n,className:t}){const[i,s]=k.useState(!1),[l,d]=k.useState(null),[u,p]=k.useState(l==null?void 0:l.is_liked),[m,y]=k.useState(l==null?void 0:l.likes_count),[_,E]=k.useState([]),[C,x]=k.useState(!0),[N,O]=k.useState(!1),[D,P]=k.useState(!1),[j,M]=k.useState(l==null?void 0:l.comments_count),[V,G]=k.useState([]),[$,ne]=k.useState(!0),Y=t||"",le=(n==null?void 0:n.image)!==""?n==null?void 0:n.image:"/img/warranty-icon.png",re=(n==null?void 0:n.title)&&(n==null?void 0:n.title);n!=null&&n.points&&(n==null||n.points);const ee=(n==null?void 0:n.date)&&(n==null?void 0:n.date);function de(pe){ae(pe)}const H=()=>{s(!1)},ae=pe=>{const Oe=pe.wall_message_id;_e(Oe),s(!0)};async function _e(pe){P(!0),Ro.getWallMessageDetails(pe).then(Oe=>{var Fe,Ue,Ve;if(console.log("getWallMessageDetails RES = ",(Fe=Oe.data)==null?void 0:Fe.data),Oe.data.status==="success"){const Re=(Ve=(Ue=Oe.data)==null?void 0:Ue.data)==null?void 0:Ve.message;d(Re),P(!1)}}).catch(Oe=>{P(!1),d(null),console.log("Error in getWallMessageDetails = ",Oe)})}async function me(pe){O(!0),pe&&Ro.getWallMessageLike(pe).then(Oe=>{var Fe,Ue;Oe.data.status==="success"&&(console.log("Success in getWallMessageLike =",Oe.data.data),p((Fe=Oe.data.data)==null?void 0:Fe.is_liked),y((Ue=Oe.data.data)==null?void 0:Ue.likes_count),O(!1),Ce(pe))}).catch(Oe=>{O(!1),p(appreciationDetails==null?void 0:appreciationDetails.is_liked),y(appreciationDetails==null?void 0:appreciationDetails.likes_count),console.log("Error in getWallMessageLike = ",Oe)})}async function Ce(pe){pe&&Ro.getWallMessageLikesList(pe).then(Oe=>{var Fe;console.log("getWallMessageLikesList RES = ",Oe.data),Oe.data.status==="success"&&(E((Fe=Oe.data.data)==null?void 0:Fe.likes),x(!1))}).catch(Oe=>{x(!1),E([]),console.log("Error in getWallMessageLikesList = ",Oe)})}async function he(pe){ne(!0),pe&&Ro.getAllWallMessageCommentList(pe).then(Oe=>{var Fe;Oe.data.status==="success"&&(G((Fe=Oe.data.data)==null?void 0:Fe.comments),ne(!1))}).catch(Oe=>{ne(!1),G([]),console.log("Error in getAllWallMessageCommentList = ",Oe)})}return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:`card-theme media-card badge-card border-0 ${Y}`,onClick:()=>de(n),children:h.jsxs(et.Body,{className:"p-2 text-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper text-center mx-auto",children:h.jsx("img",{src:le,alt:`${re} Badge Icon`,className:"img-fluid"})}),h.jsxs("div",{className:"d-flex flex-column align-items-center justify-content-center w-100 pt-2 media-content-wrapper",children:[h.jsx("p",{className:"fw-sb",children:re}),h.jsx("div",{className:"d-flex justify-content-betwee align-items-center",children:h.jsx("span",{className:"media-time-text",children:ee})})]})]})}),h.jsx(AYe,{show:i,handleClose:H,badge:n,data:l,loadingData:D,likesData:_,likeCount:m,isLiked:u,likeActionHandler:me,loadingMediaLike:N,likesListHandler:Ce,loadingLikesList:C,comment_type:"message",loadingCommentsList:$,parent_id:n==null?void 0:n.wall_message_id,parent_owner_id:null,comments:V,handleCommentList:he,setCommentsCount:M,commentsCount:j})]})}const bN={getAllBadges:async()=>await kn.get("recognition/badge/list"),getBadgeCreationHelpers:async()=>(console.log("Inside Service getBadgeCreationHelpers() ..."),await kn.get("recognition/badge/createhelper")),sendBadge:async n=>(console.log("Inside Service sendBadge() ...",n),await kn.post("recognition/badge/create",n))};function NYe(){var m,y,_;const n=ji(),t=async()=>{var E;try{const C=await bN.getAllBadges();return C.data.status==="success"?(E=C.data)==null?void 0:E.data:null}catch{throw new Error("Error fetching badges")}},{isFetching:i,isPending:s,isError:l,data:d,error:u}=ru({queryKey:["allBadgesQuery"],queryFn:t}),p=()=>{n("/badges/send-badges",{state:{pageTitle:"Send a Badge",hideFooterNav:!0}})};return s?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx(fn,{className:"row-cols-2 g-3 mb-4",children:[0,1].map((E,C)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions",className:"card-theme overflow-hidden"})},C))})})}):l?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more badges"})})}):h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[i&&((m=d==null?void 0:d.received)==null?void 0:m.length)===0?h.jsx(h.Fragment,{children:h.jsx(fn,{className:"row-cols-2 g-3 mb-4",children:[0,1].map((E,C)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions",className:"card-theme overflow-hidden"})},C))})}):h.jsx(h.Fragment,{children:((y=d==null?void 0:d.received)==null?void 0:y.length)>0&&h.jsx(fn,{className:"row-cols-2 g-3 mb-4",children:(_=d==null?void 0:d.received)==null?void 0:_.map(E=>h.jsx(Gt,{className:"",children:h.jsx(IYe,{badge:E,className:"shadow-sm"})},E==null?void 0:E.id))})}),(d==null?void 0:d.cansend)&&h.jsx(NZ,{btnTitle:"Send",className:"",isWide:!1,icon:"send2",primaryActionHandler:p})]})})}function OYe(n){var l,d,u,p;const t=n.className?n.className:"",i=((l=n.reward)==null?void 0:l.text)&&((d=n.reward)==null?void 0:d.text),s=((u=n.reward)==null?void 0:u.points)&&((p=n.reward)==null?void 0:p.points);return h.jsx(et,{className:`card-theme reward-card border-0 me-3 w-100 ${t}`,children:h.jsxs(et.Body,{className:"px-2 text-center d-flex flex-column justify-content-between",children:[h.jsx("div",{className:"font-14 text-gray7",children:i}),h.jsx("span",{className:"font-16 fw-sb",children:s})]})})}const HY=[{id:"reward-1",type:"reward",text:"Available points",time:"2 hours ago",points:1562,icon:"",isActionBtn:!1},{id:"reward-2",type:"reward",text:"Redeemed till date",time:"1 day ago",points:3452,icon:"",isActionBtn:!1},{id:"reward-3",type:"reward",text:"Available points",time:"1 day ago",points:1562,icon:"",isActionBtn:!1},{id:"reward-4",type:"reward",text:"Redeemed till date",time:"5 hours ago",points:3452,icon:"",isActionBtn:!1}];function PYe(n){const[t,i]=k.useState(HY);return console.log("Rewards data = ",HY),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:t.map((s,l)=>h.jsx(Gt,{className:"",children:h.jsx(OYe,{reward:s,className:"shadow-sm"})},s.id))})})})}function LYe(n){var C,x,N,O,D,P,j,M,V,G,$,ne,Y,le,re,ee,de;const[t,i]=k.useState("msg_details_tab"),s=((C=n.data)==null?void 0:C.icon)!==""?(x=n.data)==null?void 0:x.icon:"/img/star-icon.png",l=(N=n.data)!=null&&N.sender?(O=n.data)==null?void 0:O.sender:"",d=((D=n.data)==null?void 0:D.sender_avatar)!==""?(P=n.data)==null?void 0:P.sender_avatar:"/img/user-profile.jpg",u=(j=n.data)!=null&&j.receiver?(M=n.data)==null?void 0:M.receiver:"",p=((V=n.data)==null?void 0:V.receiver_avatar)!==""?(G=n.data)==null?void 0:G.receiver_avatar:"/img/user-profile.jpg",m=(($=n.data)==null?void 0:$.message)&&((ne=n.data)==null?void 0:ne.message),y=n.likeCount?n.likeCount:(Y=n.data)==null?void 0:Y.likes_count,_=n.commentsCount?n.commentsCount:(le=n.data)==null?void 0:le.comments_count,E=H=>{var ae;console.log("Key in handleSelectedTab =",H),H=="msg_likes_tab"&&n.likesListHandler((ae=n.data)==null?void 0:ae.wall_message_id),H=="msg_comments_tab"&&n.handleCommentList(n.parent_id),i(H)};return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb border-0",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:"Appreciation Details"})}),h.jsx(wn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"d-flex w-100 justify-content-center appreciation-symbol-container",children:[h.jsx("div",{className:"flex-shrink-0 media-img-wrapper symbol-left",children:h.jsx("img",{src:`${d}`,alt:`${l} avatar`,className:"img-fluid"})}),h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper symbol-center",children:h.jsx("img",{src:`${s}`,alt:"Star Icon",className:"img-fluid"})}),h.jsx("div",{className:"flex-shrink-0 media-img-wrapper symbol-right",children:h.jsx("img",{src:`${p}`,alt:`${u} avatar`,className:"img-fluid"})})]}),h.jsx("div",{className:"font-14 text-gray6 pb-2 d-flex justify-content-between",children:h.jsxs("div",{className:"mx-auto my-3",children:[h.jsx("span",{className:"fw-sb text-theme-primary",children:l}),h.jsx("small",{className:"mx-1",children:"appreciated"}),h.jsx("span",{className:"fw-sb text-theme-primary",children:u})]})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:H=>E(H),mountOnEnter:!0,unmountOnExit:!0,children:[h.jsx("div",{className:"tab_links",children:h.jsxs(Un,{variant:"pills",className:"nav-justified",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${y} ${y===1?"Like":"Likes"}`})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${_} ${_===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_details_tab",children:h.jsx("div",{className:"py-2",children:((re=n.data)==null?void 0:re.image)&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"media-container text-center mb-2",children:h.jsx(Ts,{src:(ee=n.data)==null?void 0:ee.image,alt:"appreciation image",wrapperClassName:"img-fluid mx-auto"})}),h.jsxs("div",{className:"font-14 fst-italic text-gray6 pb-2 d-block text-start",children:[h.jsxs("div",{className:"",children:[h.jsx("span",{className:"fw-sb",children:l}),h.jsx("small",{className:"mx-1",children:"appreciated"}),h.jsx("span",{className:"fw-sb",children:u})]}),h.jsx("div",{className:"font-14 my-1",children:"for"}),h.jsx("div",{className:"fw-sb",children:m})]})]})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(Rx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:(de=n.data)==null?void 0:de.wall_message_id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(mw,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})})}const CN={getAllAppreciations:async()=>await kn.get("recognition/appreciation/list"),getAppreciationDetails:async n=>await kn.get(`recognition/appreciation/detail?id=${n}`),getAppreciationCreationHelpers:async()=>(console.log("Inside Service getAppreciationCreationHelpers() ..."),await kn.get("recognition/appreciation/createhelper")),sendAppreciation:async n=>(console.log("Inside Service sendAppreciation() ...",n),await kn.post("recognition/appreciation/create",n))};function hEe(n){var pe,Oe,Fe,Ue,Ve,Re;const[t,i]=k.useState(!1),[s,l]=k.useState(null),[d,u]=k.useState(!1),[p,m]=k.useState(s==null?void 0:s.is_liked),[y,_]=k.useState(s==null?void 0:s.likes_count),[E,C]=k.useState([]),[x,N]=k.useState(!0),[O,D]=k.useState(!1),[P,j]=k.useState(s==null?void 0:s.comments_count),[M,V]=k.useState([]),[G,$]=k.useState(!0),ne=n.className?n.className:"",Y=((pe=n.data)==null?void 0:pe.icon)!==""?(Oe=n.data)==null?void 0:Oe.icon:"/img/star-icon.png",le=(Fe=n.data)!=null&&Fe.sender?(Ue=n.data)==null?void 0:Ue.sender:"",re=(Ve=n.data)!=null&&Ve.receiver?(Re=n.data)==null?void 0:Re.receiver:"";n.data.text&&n.data.text;const ee=n.data.date&&n.data.date;function de(Be){ae(Be)}const H=()=>{i(!1)},ae=Be=>{const Xe=Be.id;_e(Xe),i(!0)};async function _e(Be){u(!0),CN.getAppreciationDetails(Be).then(Xe=>{var we,We,st;if(console.log("getAppreciationDetails RES = ",(we=Xe.data)==null?void 0:we.data),Xe.data.status==="success"){const pt=(st=(We=Xe.data)==null?void 0:We.data)==null?void 0:st.appreciation;l(pt),u(!1)}}).catch(Xe=>{u(!1),l(null),console.log("Error in getAppreciationDetails = ",Xe)})}async function me(Be){D(!0),Be&&Ro.getWallMessageLike(Be).then(Xe=>{var we,We;Xe.data.status==="success"&&(console.log("Success in getWallMessageLike =",Xe.data.data),m((we=Xe.data.data)==null?void 0:we.is_liked),_((We=Xe.data.data)==null?void 0:We.likes_count),D(!1),Ce(Be))}).catch(Xe=>{D(!1),m(s==null?void 0:s.is_liked),_(s==null?void 0:s.likes_count),console.log("Error in getWallMessageLike = ",Xe)})}async function Ce(Be){Be&&Ro.getWallMessageLikesList(Be).then(Xe=>{var we;console.log("getWallMessageLikesList RES = ",Xe.data),Xe.data.status==="success"&&(C((we=Xe.data.data)==null?void 0:we.likes),N(!1))}).catch(Xe=>{N(!1),C([]),console.log("Error in getWallMessageLikesList = ",Xe)})}async function he(Be){$(!0),Be&&Ro.getAllWallMessageCommentList(Be).then(Xe=>{var we;Xe.data.status==="success"&&(V((we=Xe.data.data)==null?void 0:we.comments),$(!1))}).catch(Xe=>{$(!1),V([]),console.log("Error in getAllWallMessageCommentList = ",Xe)})}return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:`card-theme media-list-card appreciation-list-card border-0 ${ne}`,onClick:()=>de(n.data),children:h.jsx(et.Body,{className:"p-2",children:h.jsxs("div",{className:"d-flex align-items-start",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper",children:h.jsx("img",{src:`${Y}`,alt:"Star Icon",className:"img-fluid"})}),h.jsxs("div",{className:"flex-grow-1 ms-3 media-content-wrapper",children:[h.jsxs("p",{children:[h.jsx("span",{className:"fw-sb me-1",children:le}),h.jsx("small",{children:"appreciated"})," ",h.jsx("br",{}),h.jsx("span",{className:"fw-sb",children:re})]}),h.jsx("div",{className:"d-flex justify-content-between align-items-center",children:h.jsx("span",{className:"text-start media-time-text",children:ee})})]}),n.showRightIcon&&h.jsx(tn,{tag:"arrow-right1",className:"font-22 align-self-center text-theme-primary"})]})})}),h.jsx(LYe,{show:t,handleClose:H,data:s,loadingData:d,likesData:E,likeCount:y,isLiked:p,likeActionHandler:me,loadingMediaLike:O,likesListHandler:Ce,loadingLikesList:x,comment_type:"message",loadingCommentsList:G,parent_id:s==null?void 0:s.wall_message_id,parent_owner_id:null,comments:M,handleCommentList:he,setCommentsCount:j,commentsCount:P})]})}function DYe({appreciations:n,loading:t,getAppreciationDetails:i}){return h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:t?h.jsx(h.Fragment,{children:[0,1,2].map((s,l)=>h.jsx(ci,{type:"appreciations-list"},`appreciation-${l}`))}):h.jsx(h.Fragment,{children:(n==null?void 0:n.length)>0?h.jsx(h.Fragment,{children:n==null?void 0:n.map(s=>h.jsx(hEe,{cardType:"list",data:s,showRightIcon:!0,className:"card-theme shadow-sm",getAppreciationDetails:i},s==null?void 0:s.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more appreciations"})})})})})}function kYe({appreciations:n,loading:t}){return h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:t?h.jsx(h.Fragment,{children:[0,1,2].map((i,s)=>h.jsx(ci,{type:"appreciations-list"},`appreciation-${s}`))}):h.jsx(h.Fragment,{children:(n==null?void 0:n.length)>0?h.jsx(h.Fragment,{children:n==null?void 0:n.map((i,s)=>h.jsx(hEe,{cardType:"list",data:i,showRightIcon:!0,className:"card-theme shadow-sm"},i==null?void 0:i.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more appreciations"})})})})})}function MYe(){var C;const n=ji(),t=tl(),[i,s]=k.useState(((C=t==null?void 0:t.state)==null?void 0:C.data)==="sent"?"appreciations-sent":"appreciations-received"),l=async()=>{var x;try{const N=await CN.getAllAppreciations();return N.data.status==="success"?(x=N.data)==null?void 0:x.data:null}catch{throw new Error("Error fetching appreciations")}},{isFetching:d,isPending:u,isError:p,data:m,error:y}=ru({queryKey:["allAppreciationsQuery"],queryFn:l}),_=x=>{s(x)},E=()=>{n("/appreciations/send-appreciations",{state:{pageTitle:"Send an Appreciation",hideFooterNav:!0}})};return u?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-grid gap-3",children:[0,1,2].map((x,N)=>h.jsx(ci,{type:"appreciations-list"},`appreciation-${N}`))})})}):p?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(Card,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more appreciations"})})}):h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[h.jsxs($U,{activeKey:i,variant:"pills",justify:!0,id:"uncontrolled-tab-example",className:"mb-3 theme-tabs",onSelect:x=>{_(x)},children:[h.jsx(Zn,{eventKey:"appreciations-received",title:"Appreciations received",children:h.jsx(DYe,{appreciations:m==null?void 0:m.received,loading:u})}),h.jsx(Zn,{eventKey:"appreciations-sent",title:"Appreciations sent",children:h.jsx(kYe,{appreciations:m==null?void 0:m.sent,loading:u})})]}),(m==null?void 0:m.cansend)&&h.jsx(NZ,{btnTitle:"Send",className:"",isWide:!1,icon:"send2",primaryActionHandler:E})]})})})}function Pfe(n){let t="default",i=(n==null?void 0:n.contactType.split("").map((l,d)=>d===0?l.toUpperCase():l).join(""))||"Type",s=(n==null?void 0:n.contactValue)||"NA";switch(n==null?void 0:n.contactType){case"email":t="message5";break;case"mobile":t="call1";break;default:t="call1"}return h.jsx(h.Fragment,{children:h.jsx(et,{className:"media-list-card profile-contact-list-card border-0 rounded-0 bg-transparent",children:h.jsx(et.Body,{className:"p-0",children:h.jsxs("div",{className:"d-flex align-items-start",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper align-items-center d-flex justify-content-center",children:h.jsx(tn,{tag:t,className:"font-20"})}),h.jsx("div",{className:"flex-grow-1 ms-3 media-content-wrapper",children:h.jsxs("span",{className:"welcome-user font-14 text-gray7",children:[`${i} `,h.jsx("span",{className:"d-block fw-sb text-gray3",children:s})]})})]})})})})}function jYe(n){const[t,i]=k.useState(!0),[s,l]=k.useState([]);k.useEffect(()=>{const u=Object.entries(n==null?void 0:n.userProfile).map(([m,y])=>{let _="";return _=m.split("").map((E,C)=>C===0?E.toUpperCase():E).join(""),{key:_,value:y}}),p=u.filter(m=>{if(["hq","territory","area","region","zone","city","state","pincode","address"].includes(m.key.toLowerCase()))return console.log("Item Key = ",m.key),{key:m.key,value:m.value}});l(p),console.log("userAdd = ",u),console.log("userAdd2 = ",p)},[n.userProfile]);function d(){console.log("handleProfileInfoCollapseToggle called..."),i(!t)}return h.jsxs(h.Fragment,{children:[h.jsx(WQ,{in:t,children:h.jsx("div",{id:"profile-info-collapse",className:"profile-other-info font-14",children:h.jsx(et,{className:"bg-transparent border-0",children:s.length>0?h.jsx(r7e,{hover:!0,className:"bg-transparent",children:h.jsx("tbody",{children:s.map((u,p)=>h.jsxs("tr",{children:[h.jsxs("td",{className:"text-gray7",children:[u.key,":"]}),h.jsx("td",{className:"fw-sb",children:u.value})]},p))})}):h.jsx("p",{children:"No more info..."})})})}),h.jsx("div",{className:"d-flex justify-content-end d-none",children:h.jsxs(Lt,{variant:"link",size:"sm",className:"btn-theme font-12 fw-sb text-decoration-none","aria-controls":"profile-info-collapse","aria-expanded":t,onClick:d,children:[t?"See less":"See more"," ",h.jsx(tn,{tag:"arrow-down1",className:`font-10 theme-transition ${t&&"rotate-180"}`})]})})]})}function UYe(n){const[t,i]=k.useState(!1),[s,l]=k.useState({}),d=n.isAddMode,u=[{key:"Male",value:"male"},{key:"Female",value:"female"},{key:"Other",value:"other"}],p={firstname:"",lastname:"",email:"",phone:"",designation:"",gender:"male",date_of_birth:null,city:"",state:"",pincode:"",address:"",avatar:""},m=gc({firstname:Ef().required("Required"),lastname:Ef().required("Required")});k.useEffect(()=>{if(console.log("currentUser = ",n.currentUser),!d&&n.currentUser){let _={firstname:n.currentUser.firstname?n.currentUser.firstname:"",lastname:n.currentUser.lastname?n.currentUser.lastname:"",phone:n.currentUser.phone?n.currentUser.phone:"",gender:n.currentUser.gender?n.currentUser.gender:"male",date_of_birth:n.currentUser.date_of_birth?n.currentUser.date_of_birth:"",city:n.currentUser.city?n.currentUser.city:"",state:n.currentUser.state?n.currentUser.state:"",pincode:n.currentUser.pincode?n.currentUser.pincode:"",address:n.currentUser.address?n.currentUser.address:""};l(_)}},[n.currentUser]);const y=async(_,{resetForm:E})=>{i(!0),console.log("Form Values :",_),_.address&&_.address;const C={..._,city:_.city,state:_.state,pincode:_.pincode,date_of_birth:_.date_of_birth},x=Object.entries(C).reduce((N,[O,D])=>(D&&(N[O]=D),N),{});console.log("New values in Update Settings =",C),console.log("All Falsy removed in Update Settings =",x),d||(console.log("Updating existing user details"),ps.updateUserProfile(x).then(N=>{if(console.log(N),N.data.status==="success"){console.log("Suucess res from update = ",N.data.data.profile);const O=N.data.data.profile;Qt("You have successfully updated user details!","success"),E({}),i(!1),n.handleClose(),n.getUserProfile();const D={avatar:O.avatar,firstname:O.firstname,lastname:O.lastname,name:`${O.firstname} ${O.lastname}`,phone:O.phone};Ai.setAuthUser(D)}else N.data.status==="failed"&&(console.log("ERROR:",N.data.error),Qt("User details updation failed!","error"),E({}),i(!1),n.handleClose())}).catch(N=>{console.log(N)}))};return h.jsx(h.Fragment,{children:h.jsx(od,{initialValues:d?p:s,validationSchema:m,onSubmit:y,enableReinitialize:!0,children:_=>h.jsxs(kt,{className:"form_style",onSubmit:_.handleSubmit,children:[h.jsxs(fn,{className:"row-cols-1 row-cols-md-",children:[h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"First name"}),h.jsx(kt.Control,{type:"text",placeholder:"First name",name:"firstname",..._.getFieldProps("firstname"),autoComplete:"off"}),_.touched.firstname&&_.errors.firstname?h.jsx("p",{className:"error-state-text font-12 text-danger",children:_.errors.firstname}):null]})}),h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Last name"}),h.jsx(kt.Control,{type:"text",placeholder:"Last name",name:"lastname",..._.getFieldProps("lastname"),autoComplete:"off"}),_.touched.lastname&&_.errors.lastname?h.jsx("p",{className:"error-state-text font-12 text-danger",children:_.errors.lastname}):null]})})]}),h.jsxs(fn,{className:"row-cols-1 row-cols-md-",children:[h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Phone"}),h.jsx(kt.Control,{type:"text",placeholder:"Phone",name:"phone",..._.getFieldProps("phone"),autoComplete:"off"}),_.touched.phone&&_.errors.phone?h.jsx("p",{className:"error-state-text font-12 text-danger",children:_.errors.phone}):null]})}),h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners px-0 inline_radio_fields mb-2",children:[h.jsx("div",{className:"font-14 mb-1 fw-sb",children:"Gender"}),h.jsx("div",{className:"px-1",children:u.map(E=>{var C;return h.jsx(kt.Check,{inline:!0,label:E.key,name:"gender",type:"radio",id:`gender-${E.key}`,value:E.value,onChange:_.handleChange,onBlur:_.handleBlur,checked:((C=_.values)==null?void 0:C.gender)===E.value.toString()},E.value)})}),_.touched.gender&&_.errors.gender?h.jsx("p",{className:"error-state-text",children:_.errors.gender}):null]})})]}),h.jsx(fn,{children:h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Date of Birth"}),h.jsx(kt.Control,{type:"date",placeholder:"Date of Birth",name:"date_of_birth",..._.getFieldProps("date_of_birth"),autoComplete:"off",pattern:"\\d{4}-\\d{2}-\\d{2}"}),_.touched.date_of_birth&&_.errors.date_of_birth?h.jsx("p",{className:"error-state-text",children:_.errors.date_of_birth}):null]})})}),h.jsxs(fn,{className:"row-cols-1 row-cols-md-",children:[h.jsxs(Gt,{children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"City"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Control,{type:"text",placeholder:"City",name:"city",..._.getFieldProps("city"),autoComplete:"off"}),_.touched.city&&_.errors.city?h.jsx("p",{className:"error-state-text",children:_.errors.city}):null]})]}),h.jsxs(Gt,{children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"State"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Control,{type:"text",placeholder:"State",name:"state",..._.getFieldProps("state"),autoComplete:"off"}),_.touched.state&&_.errors.state?h.jsx("p",{className:"error-state-text",children:_.errors.state}):null]})]})]}),h.jsx(fn,{className:"row-cols-1 row-cols-md-",children:h.jsxs(Gt,{children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Pincode"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Control,{type:"text",placeholder:"Pincode",name:"pincode",..._.getFieldProps("pincode"),autoComplete:"off"}),_.touched.pincode&&_.errors.pincode?h.jsx("p",{className:"error-state-text",children:_.errors.pincode}):null]})]})}),h.jsx(fn,{children:h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Address"}),h.jsx(kt.Control,{type:"text",placeholder:"Addres",name:"address",..._.getFieldProps("address"),autoComplete:"off"}),_.touched.address&&_.errors.address?h.jsx("p",{className:"error-state-text",children:_.errors.address}):null]})})}),h.jsx("div",{className:"btn-wrap position-fixed px-2 pt-3 pb-4 bg-white",style:{bottom:0,left:0,right:0,zIndex:1},children:h.jsx(Lt,{type:"submit",className:"btn btn-theme btn-primary btn-md w-100",children:t?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Updating"]}):"Update"})})]})})})}function FYe(n){return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom update-profile-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:"Update Profile"})}),h.jsx(wn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:h.jsx(UYe,{isAddMode:!1,currentUser:n.userProfile,handleClose:n.handleClose,getUserProfile:n.getUserProfile})})]})})}/**
* filesize
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 10.1.0
*/const BYe="array",VYe="bit",Lfe="bits",zYe="byte",Dfe="bytes",Jb="",HYe="exponent",GYe="function",kfe="iec",WYe="Invalid number",$Ye="Invalid rounding method",xK="jedec",KYe="object",Mfe=".",qYe="round",YYe="s",XYe="si",JYe="kbit",QYe="kB",ZYe=" ",eXe="string",tXe="0",AK={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function ax(n,{bits:t=!1,pad:i=!1,base:s=-1,round:l=2,locale:d=Jb,localeOptions:u={},separator:p=Jb,spacer:m=ZYe,symbols:y={},standard:_=Jb,output:E=eXe,fullform:C=!1,fullforms:x=[],exponent:N=-1,roundingMethod:O=qYe,precision:D=0}={}){let P=N,j=Number(n),M=[],V=0,G=Jb;_===XYe?(s=10,_=xK):_===kfe||_===xK?s=2:s===2?_=kfe:(s=10,_=xK);const $=s===10?1e3:1024,ne=C===!0,Y=j<0,le=Math[O];if(typeof n!="bigint"&&isNaN(n))throw new TypeError(WYe);if(typeof le!==GYe)throw new TypeError($Ye);if(Y&&(j=-j),(P===-1||isNaN(P))&&(P=Math.floor(Math.log(j)/Math.log($)),P<0&&(P=0)),P>8&&(D>0&&(D+=8-P),P=8),E===HYe)return P;if(j===0)M[0]=0,G=M[1]=AK.symbol[_][t?Lfe:Dfe][P];else{V=j/(s===2?Math.pow(2,P*10):Math.pow(1e3,P)),t&&(V=V*8,V>=$&&P<8&&(V=V/$,P++));const re=Math.pow(10,P>0?l:0);M[0]=le(V*re)/re,M[0]===$&&P<8&&N===-1&&(M[0]=1,P++),G=M[1]=s===10&&P===1?t?JYe:QYe:AK.symbol[_][t?Lfe:Dfe][P]}if(Y&&(M[0]=-M[0]),D>0&&(M[0]=M[0].toPrecision(D)),M[1]=y[M[1]]||M[1],d===!0?M[0]=M[0].toLocaleString():d.length>0?M[0]=M[0].toLocaleString(d,u):p.length>0&&(M[0]=M[0].toString().replace(Mfe,p)),i&&Number.isInteger(M[0])===!1&&l>0){const re=p||Mfe,ee=M[0].toString().split(re),de=ee[1]||Jb,H=de.length,ae=l-H;M[0]=`${ee[0]}${re}${de.padEnd(H+ae,tXe)}`}return ne&&(M[1]=x[P]?x[P]:AK.fullform[_][P]+(t?VYe:zYe)+(M[0]===1?Jb:YYe)),E===BYe?M:E===KYe?{value:M[0],symbol:M[1],exponent:P,unit:G}:M.join(m)}const t9={x:0,y:0,width:0,height:0,unit:"px"},Qb=(n,t,i)=>Math.min(Math.max(n,t),i),nXe=(...n)=>n.filter(t=>t&&typeof t=="string").join(" "),jfe=(n,t)=>n===t||n.width===t.width&&n.height===t.height&&n.x===t.x&&n.y===t.y&&n.unit===t.unit;function iXe(n,t,i,s){const l=dp(n,i,s);return n.width&&(l.height=l.width/t),n.height&&(l.width=l.height*t),l.y+l.height>s&&(l.height=s-l.y,l.width=l.height*t),l.x+l.width>i&&(l.width=i-l.x,l.height=l.width/t),n.unit==="%"?w1(l,i,s):l}function rXe(n,t,i){const s=dp(n,t,i);return s.x=(t-s.width)/2,s.y=(i-s.height)/2,n.unit==="%"?w1(s,t,i):s}function w1(n,t,i){return n.unit==="%"?{...t9,...n,unit:"%"}:{unit:"%",x:n.x?n.x/t*100:0,y:n.y?n.y/i*100:0,width:n.width?n.width/t*100:0,height:n.height?n.height/i*100:0}}function dp(n,t,i){return n.unit?n.unit==="px"?{...t9,...n,unit:"px"}:{unit:"px",x:n.x?n.x*t/100:0,y:n.y?n.y*i/100:0,width:n.width?n.width*t/100:0,height:n.height?n.height*i/100:0}:{...t9,...n,unit:"px"}}function Ufe(n,t,i,s,l,d=0,u=0,p=s,m=l){const y={...n};let _=Math.min(d,s),E=Math.min(u,l),C=Math.min(p,s),x=Math.min(m,l);t&&(t>1?(_=u?u*t:_,E=_/t,C=p*t):(E=d?d/t:E,_=E*t,x=m/t)),y.y<0&&(y.height=Math.max(y.height+y.y,E),y.y=0),y.x<0&&(y.width=Math.max(y.width+y.x,_),y.x=0);const N=s-(y.x+y.width);N<0&&(y.x=Math.min(y.x,s-_),y.width+=N);const O=l-(y.y+y.height);if(O<0&&(y.y=Math.min(y.y,l-E),y.height+=O),y.width<_&&((i==="sw"||i=="nw")&&(y.x-=_-y.width),y.width=_),y.height<E&&((i==="nw"||i=="ne")&&(y.y-=E-y.height),y.height=E),y.width>C&&((i==="sw"||i=="nw")&&(y.x-=C-y.width),y.width=C),y.height>x&&((i==="nw"||i=="ne")&&(y.y-=x-y.height),y.height=x),t){const D=y.width/y.height;if(D<t){const P=Math.max(y.width/t,E);(i==="nw"||i=="ne")&&(y.y-=P-y.height),y.height=P}else if(D>t){const P=Math.max(y.height*t,_);(i==="sw"||i=="nw")&&(y.x-=P-y.width),y.width=P}}return y}function sXe(n,t,i,s){const l={...n};return t==="ArrowLeft"?s==="nw"?(l.x-=i,l.y-=i,l.width+=i,l.height+=i):s==="w"?(l.x-=i,l.width+=i):s==="sw"?(l.x-=i,l.width+=i,l.height+=i):s==="ne"?(l.y+=i,l.width-=i,l.height-=i):s==="e"?l.width-=i:s==="se"&&(l.width-=i,l.height-=i):t==="ArrowRight"&&(s==="nw"?(l.x+=i,l.y+=i,l.width-=i,l.height-=i):s==="w"?(l.x+=i,l.width-=i):s==="sw"?(l.x+=i,l.width-=i,l.height-=i):s==="ne"?(l.y-=i,l.width+=i,l.height+=i):s==="e"?l.width+=i:s==="se"&&(l.width+=i,l.height+=i)),t==="ArrowUp"?s==="nw"?(l.x-=i,l.y-=i,l.width+=i,l.height+=i):s==="n"?(l.y-=i,l.height+=i):s==="ne"?(l.y-=i,l.width+=i,l.height+=i):s==="sw"?(l.x+=i,l.width-=i,l.height-=i):s==="s"?l.height-=i:s==="se"&&(l.width-=i,l.height-=i):t==="ArrowDown"&&(s==="nw"?(l.x+=i,l.y+=i,l.width-=i,l.height-=i):s==="n"?(l.y+=i,l.height-=i):s==="ne"?(l.y+=i,l.width-=i,l.height-=i):s==="sw"?(l.x-=i,l.width+=i,l.height+=i):s==="s"?l.height+=i:s==="se"&&(l.width+=i,l.height+=i)),l}const Zb={capture:!0,passive:!1};let aXe=0;const g1=class Wh extends k.PureComponent{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=k.createRef(),this.mediaRef=k.createRef(),this.initChangeCalled=!1,this.instanceId=`rc-${aXe++}`,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=t=>{const{crop:i,disabled:s}=this.props,l=this.getBox();if(!i)return;const d=dp(i,l.width,l.height);if(s)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const u=t.target.dataset.ord,p=!!u;let m=t.clientX,y=t.clientY,_=d.x,E=d.y;if(u){const C=t.clientX-l.x,x=t.clientY-l.y;let N=0,O=0;u==="ne"||u=="e"?(N=C-(d.x+d.width),O=x-d.y,_=d.x,E=d.y+d.height):u==="se"||u==="s"?(N=C-(d.x+d.width),O=x-(d.y+d.height),_=d.x,E=d.y):u==="sw"||u=="w"?(N=C-d.x,O=x-(d.y+d.height),_=d.x+d.width,E=d.y):(u==="nw"||u=="n")&&(N=C-d.x,O=x-d.y,_=d.x+d.width,E=d.y+d.height),m=_+l.x+N,y=E+l.y+O}this.evData={startClientX:m,startClientY:y,startCropX:_,startCropY:E,clientX:t.clientX,clientY:t.clientY,isResize:p,ord:u},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=t=>{const{crop:i,disabled:s,locked:l,keepSelection:d,onChange:u}=this.props,p=this.getBox();if(s||l||d&&i)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const m=t.clientX-p.x,y=t.clientY-p.y,_={unit:"px",x:m,y,width:0,height:0};this.evData={startClientX:t.clientX,startClientY:t.clientY,startCropX:m,startCropY:y,clientX:t.clientX,clientY:t.clientY,isResize:!0},this.mouseDownOnCrop=!0,u(dp(_,p.width,p.height),w1(_,p.width,p.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=t=>{const{crop:i,disabled:s,onChange:l,onDragStart:d}=this.props,u=this.getBox();if(s||!i||!this.mouseDownOnCrop)return;t.cancelable&&t.preventDefault(),this.dragStarted||(this.dragStarted=!0,d&&d(t));const{evData:p}=this;p.clientX=t.clientX,p.clientY=t.clientY;let m;p.isResize?m=this.resizeCrop():m=this.dragCrop(),jfe(i,m)||l(dp(m,u.width,u.height),w1(m,u.width,u.height))},this.onComponentKeyDown=t=>{const{crop:i,disabled:s,onChange:l,onComplete:d}=this.props;if(s)return;const u=t.key;let p=!1;if(!i)return;const m=this.getBox(),y=this.makePixelCrop(m),_=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Wh.nudgeStepLarge:t.shiftKey?Wh.nudgeStepMedium:Wh.nudgeStep;if(u==="ArrowLeft"?(y.x-=_,p=!0):u==="ArrowRight"?(y.x+=_,p=!0):u==="ArrowUp"?(y.y-=_,p=!0):u==="ArrowDown"&&(y.y+=_,p=!0),p){t.cancelable&&t.preventDefault(),y.x=Qb(y.x,0,m.width-y.width),y.y=Qb(y.y,0,m.height-y.height);const E=dp(y,m.width,m.height),C=w1(y,m.width,m.height);l(E,C),d&&d(E,C)}},this.onHandlerKeyDown=(t,i)=>{const{aspect:s=0,crop:l,disabled:d,minWidth:u=0,minHeight:p=0,maxWidth:m,maxHeight:y,onChange:_,onComplete:E}=this.props,C=this.getBox();if(d||!l)return;if(t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="ArrowLeft"||t.key==="ArrowRight")t.stopPropagation(),t.preventDefault();else return;const x=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Wh.nudgeStepLarge:t.shiftKey?Wh.nudgeStepMedium:Wh.nudgeStep,N=dp(l,C.width,C.height),O=sXe(N,t.key,x,i),D=Ufe(O,s,i,C.width,C.height,u,p,m,y);if(!jfe(l,D)){const P=w1(D,C.width,C.height);_(D,P),E&&E(D,P)}},this.onDocPointerDone=t=>{const{crop:i,disabled:s,onComplete:l,onDragEnd:d}=this.props,u=this.getBox();this.unbindDocMove(),!(s||!i)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,d&&d(t),l&&l(dp(i,u.width,u.height),w1(i,u.width,u.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=()=>{var t;(t=this.componentRef.current)==null||t.scrollTo(0,0)}}get document(){return document}getBox(){const t=this.mediaRef.current;if(!t)return{x:0,y:0,width:0,height:0};const{x:i,y:s,width:l,height:d}=t.getBoundingClientRect();return{x:i,y:s,width:l,height:d}}componentDidUpdate(t){const{crop:i,onComplete:s}=this.props;if(s&&!t.crop&&i){const{width:l,height:d}=this.getBox();l&&d&&s(dp(i,l,d),w1(i,l,d))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Zb),this.document.addEventListener("pointerup",this.onDocPointerDone,Zb),this.document.addEventListener("pointercancel",this.onDocPointerDone,Zb),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Zb),this.document.removeEventListener("pointerup",this.onDocPointerDone,Zb),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Zb),this.docMoveBound=!1)}getCropStyle(){const{crop:t}=this.props;if(t)return{top:`${t.y}${t.unit}`,left:`${t.x}${t.unit}`,width:`${t.width}${t.unit}`,height:`${t.height}${t.unit}`}}dragCrop(){const{evData:t}=this,i=this.getBox(),s=this.makePixelCrop(i),l=t.clientX-t.startClientX,d=t.clientY-t.startClientY;return s.x=Qb(t.startCropX+l,0,i.width-s.width),s.y=Qb(t.startCropY+d,0,i.height-s.height),s}getPointRegion(t,i,s,l){const{evData:d}=this,u=d.clientX-t.x,p=d.clientY-t.y;let m;l&&i?m=i==="nw"||i==="n"||i==="ne":m=p<d.startCropY;let y;return s&&i?y=i==="nw"||i==="w"||i==="sw":y=u<d.startCropX,y?m?"nw":"sw":m?"ne":"se"}resolveMinDimensions(t,i,s=0,l=0){const d=Math.min(s,t.width),u=Math.min(l,t.height);return!i||!d&&!u?[d,u]:i>1?d?[d,d/i]:[u*i,u]:u?[u*i,u]:[d,d/i]}resizeCrop(){const{evData:t}=this,{aspect:i=0,maxWidth:s,maxHeight:l}=this.props,d=this.getBox(),[u,p]=this.resolveMinDimensions(d,i,this.props.minWidth,this.props.minHeight);let m=this.makePixelCrop(d);const y=this.getPointRegion(d,t.ord,u,p),_=t.ord||y;let E=t.clientX-t.startClientX,C=t.clientY-t.startClientY;(u&&_==="nw"||_==="w"||_==="sw")&&(E=Math.min(E,-u)),(p&&_==="nw"||_==="n"||_==="ne")&&(C=Math.min(C,-p));const x={unit:"px",x:0,y:0,width:0,height:0};y==="ne"?(x.x=t.startCropX,x.width=E,i?(x.height=x.width/i,x.y=t.startCropY-x.height):(x.height=Math.abs(C),x.y=t.startCropY-x.height)):y==="se"?(x.x=t.startCropX,x.y=t.startCropY,x.width=E,i?x.height=x.width/i:x.height=C):y==="sw"?(x.x=t.startCropX+E,x.y=t.startCropY,x.width=Math.abs(E),i?x.height=x.width/i:x.height=C):y==="nw"&&(x.x=t.startCropX+E,x.width=Math.abs(E),i?(x.height=x.width/i,x.y=t.startCropY-x.height):(x.height=Math.abs(C),x.y=t.startCropY+C));const N=Ufe(x,i,y,d.width,d.height,u,p,s,l);return i||Wh.xyOrds.indexOf(_)>-1?m=N:Wh.xOrds.indexOf(_)>-1?(m.x=N.x,m.width=N.width):Wh.yOrds.indexOf(_)>-1&&(m.y=N.y,m.height=N.height),m.x=Qb(m.x,0,d.width-m.width),m.y=Qb(m.y,0,d.height-m.height),m}renderCropSelection(){const{ariaLabels:t=Wh.defaultProps.ariaLabels,disabled:i,locked:s,renderSelectionAddon:l,ruleOfThirds:d,crop:u}=this.props,p=this.getCropStyle();if(u)return dn.createElement("div",{style:p,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!i&&!s&&dn.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},dn.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),dn.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),dn.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),dn.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"nw"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"n"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"ne"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"e"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"se"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"s"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"sw"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:m=>this.onHandlerKeyDown(m,"w"),role:"button"})),l&&dn.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:m=>m.stopPropagation()},l(this.state)),d&&dn.createElement(dn.Fragment,null,dn.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),dn.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(t){const i={...t9,...this.props.crop||{}};return dp(i,t.width,t.height)}render(){const{aspect:t,children:i,circularCrop:s,className:l,crop:d,disabled:u,locked:p,style:m,ruleOfThirds:y}=this.props,{cropIsActive:_,newCropIsBeingDrawn:E}=this.state,C=d?this.renderCropSelection():null,x=nXe("ReactCrop",l,_&&"ReactCrop--active",u&&"ReactCrop--disabled",p&&"ReactCrop--locked",E&&"ReactCrop--new-crop",d&&t&&"ReactCrop--fixed-aspect",d&&s&&"ReactCrop--circular-crop",d&&y&&"ReactCrop--rule-of-thirds",!this.dragStarted&&d&&!d.width&&!d.height&&"ReactCrop--invisible-crop",s&&"ReactCrop--no-animate");return dn.createElement("div",{ref:this.componentRef,className:x,style:m},dn.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},i),d?dn.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},dn.createElement("defs",null,dn.createElement("mask",{id:`hole-${this.instanceId}`},dn.createElement("rect",{width:"100%",height:"100%",fill:"white"}),s?dn.createElement("ellipse",{cx:`${d.x+d.width/2}${d.unit}`,cy:`${d.y+d.height/2}${d.unit}`,rx:`${d.width/2}${d.unit}`,ry:`${d.height/2}${d.unit}`,fill:"black"}):dn.createElement("rect",{x:`${d.x}${d.unit}`,y:`${d.y}${d.unit}`,width:`${d.width}${d.unit}`,height:`${d.height}${d.unit}`,fill:"black"}))),dn.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,C)}};g1.xOrds=["e","w"],g1.yOrds=["n","s"],g1.xyOrds=["nw","ne","se","sw"],g1.nudgeStep=1,g1.nudgeStepMedium=10,g1.nudgeStepLarge=100,g1.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};let oXe=g1;function lXe(n,t,i){k.useEffect(()=>{const s=setTimeout(()=>{n.apply(void 0,i)},t);return()=>{clearTimeout(s)}},i)}const cXe=Math.PI/180;async function dXe(n,t,i,s=1,l=0){const d=t.getContext("2d");if(!d)throw new Error("No 2d context");const u=n.naturalWidth/n.width,p=n.naturalHeight/n.height,m=window.devicePixelRatio;t.width=Math.floor(i.width*u*m),t.height=Math.floor(i.height*p*m),d.scale(m,m),d.imageSmoothingQuality="low";const y=i.x*u,_=i.y*p,E=l*cXe,C=n.naturalWidth/2,x=n.naturalHeight/2;d.save(),d.translate(-y,-_),d.translate(C,x),d.rotate(E),d.scale(s,s),d.translate(-C,-x),d.drawImage(n,0,0,n.naturalWidth,n.naturalHeight,0,0,n.naturalWidth,n.naturalHeight),d.restore()}function uXe(n,t,i){return rXe(iXe({unit:"%",width:90},i,n,t),n,t)}function hXe({src:n,fileExtension:t,fileType:i,setCropFile:s,setCropFileURL:l,setShowCropper:d}){const[u,p]=k.useState(""),[m,y]=k.useState(),[_,E]=k.useState(),[C,x]=k.useState(1),[N,O]=k.useState(0),[D,P]=k.useState(1),j=k.useRef(null),M=k.useRef(null),V=k.useRef("");k.useRef(null),k.useEffect(()=>{p(n)},[n]);function G(Y){if(D){const{width:le,height:re}=Y.currentTarget;y(uXe(le,re,D))}}function $(){console.log("handleCancelCrop"),p(""),y(null),E(null),d(!1)}lXe(async()=>{_!=null&&_.width&&(_!=null&&_.height)&&j.current&&M.current&&(console.log(j.current),console.log(M.current),dXe(j.current,M.current,_,C,N))},100,[_,C,N]);async function ne(){console.log("handleSaveCrop called...");const Y=j.current,le=M.current;if(!Y||!le||!_)throw new Error("Crop canvas does not exist");console.log(le,"previewCanvas --");const re=Y.naturalWidth/Y.width,ee=Y.naturalHeight/Y.height;console.log("scaleX = ",re),console.log("scaleY = ",ee);const de=new OffscreenCanvas(_.width*C,_.height*C),H=de.getContext("2d");if(!H)throw new Error("No 2d context");H.drawImage(le,0,0,le.width,le.height,0,0,de.width,de.height);const ae=await de.convertToBlob(()=>{},{type:i||"image/jpg"});console.log("blob = ",ae),s(ae),V.current&&URL.revokeObjectURL(V.current),V.current=URL.createObjectURL(ae),l(V.current),d(!1),console.log("Download url = ",V.current)}return h.jsx(h.Fragment,{children:h.jsxs("div",{children:[!!_&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"d-flex justify-content-center mb-2 position-relative",children:[h.jsx(Lt,{type:"button",onClick:$,className:"btn-theme btn-gray flex-grow-1 me-1",children:"Cancel"},"cancel-crop"),h.jsx(Lt,{type:"button",onClick:ne,className:"btn-theme btn-secondary flex-grow-1 ms-1",children:"Submit"},"download-crop")]})}),!!u&&h.jsx(oXe,{crop:m,onChange:(Y,le)=>y(le),onComplete:Y=>{E(Y)},aspect:D,minHeight:100,children:h.jsx("img",{ref:j,alt:"Crop me",src:u,style:{transform:`scale(${C}) rotate(${N}deg)`},onLoad:G})}),!!_&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"opacity-0 visibility-hidden",style:{height:.1},children:h.jsx("canvas",{ref:M,style:{border:"1px solid black",objectFit:"contain",width:_.width,height:_.height}})})})]})})}function fXe({mediaType:n,mediaSource:t,className:i,contestId:s,handleClose:l,getUserProfile:d}){ji();const[p,m]=k.useState(),[y,_]=k.useState(!1),[E,C]=k.useState(0),[x,N]=k.useState(null),[O,D]=k.useState(""),[P,j]=k.useState(!1);k.useState(!1);const[M,V]=k.useState(!1);k.useState();const[G,$]=k.useState(),[ne,Y]=k.useState(),[le,re]=k.useState(),[ee,de]=k.useState(!1),H=k.useRef(null),ae=k.useRef(null),_e=k.useRef(null),me={title:""},Ce=gc({}),he=n?n==="pdf"?".pdf":`${n}/*`:"image/*",pe=n!==""?"user":"",Oe=n?`${n}-gallery-file`:"media-gallery-file",Fe=n?`${n}-camera-file`:"media-camera-file";function Ue(Be){if(console.log("Inside handleChange =",Be.target.files[0]),Be.target.files[0]){m(Be.target.files[0]),_(!0);const Xe=ax(Be.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",Xe," type = ",typeof Xe),N(Xe),n==="image"&&Be.target.files[0].size>25*1024*1024?D(""):D(Be.target.files[0].name),n){case"image":console.log("Image Preview =",H.current);let we=URL.createObjectURL(Be.target.files[0]);$(we),de(!0);break;default:console.log("No case matched...")}}}function Ve(){if(p)switch(m(null),_(!1),D(""),ae.current&&(ae.current.value=""),_e.current&&(_e.current.value=""),n){case"image":console.log("Image Preview =",H.current),H.current.src="",H.current.className="d-none",Y(null),re("");break;default:console.log("No case matched...")}}const Re=async(Be,{resetForm:Xe})=>{if(console.log("Form Values :",Be),console.log("mediaUrl in onSubmit =",O),O===""){Qt("Upload Valid File","error");return}j(!0);const we={fileextention:p.name.substring(p.name.lastIndexOf(".")+1),modulename:"profile"};console.log("data for getSignedUrl = ",we);const We=await ps.getSignedUploadUrl(we),st=ne,pt={headers:{},onUploadProgress:function(Je){const St=Math.round(Je.loaded*100/Je.total);C(St)}};console.log(pt);const Qe=await Gr.put(We.data.data.uploadURL,st,pt);if(console.log("result =",Qe),console.log("result status =",Qe.status),Qe.status===200){console.log("uploadProgress =",E);const Je={avatar:We.data.data.resourceUrl};console.log("uploadResponseData = ",Je),ps.updateUserProfile(Je).then(St=>{if(console.log(St),St.data.status==="success"){console.log("Suucess res from update = ",St.data.data.profile);const Xt=St.data.data.profile;Qt("Profile Photo Updated","success"),Xe({}),V(!1),C(0),j(!1),m(null),_(!1),l(),d();const Ht={avatar:Xt.avatar,firstname:Xt.firstname,lastname:Xt.lastname,name:`${Xt.firstname} ${Xt.lastname}`,phone:Xt.phone};Ai.setAuthUser(Ht)}else St.data.status==="failed"&&(console.log("ERROR:",St.data.error),Qt("Failed to update Profile Photo!","error"),Xe({}),V(!1),C(0),j(!1),m(null),_(!1),l())}).catch(St=>{console.log(St)})}console.log("Outside if uploadProgress =",E)};return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:"mb-1",children:h.jsxs(et.Body,{className:"p-1 font-13 text-gray4",style:{background:"var(--color-yellow-lighter)"},children:[h.jsx("span",{className:"fw-b font-13",children:"Note: "}),"Upload file size should not exceeds"," ",h.jsx("span",{className:"fw-b text-danger",children:"25 mb"})," ","."]})}),h.jsx(od,{initialValues:me,validationSchema:Ce,onSubmit:Re,children:Be=>{var Xe,we;return h.jsxs(kt,{className:"form_style",onSubmit:Be.handleSubmit,children:[h.jsxs(kt.Group,{className:`form-group rounded_corners mb-2 ${ee?"opacity-0 visibility-hidden":""}`,style:{height:ee?"0px":"auto"},children:[h.jsx("div",{className:"font-13",children:"Choose upload type"}),h.jsx("div",{className:"btn-wrap d-flex justify-content- mb-1 pt-2",children:h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:ae,name:Fe,id:Fe,className:"uploadMediafile",capture:pe,accept:he,onChange:Ue}),h.jsx("label",{htmlFor:Fe,className:"justify-content-center px-3 capture-btn",children:"Camera"})]}),h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:_e,name:Oe,id:Oe,className:"uploadMediafile",accept:he,onChange:Ue}),h.jsx("label",{htmlFor:Oe,className:"justify-content-center px-3 gallery-btn",children:"Gallery"})]})]})})]}),E>0&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-0",children:[h.jsx("progress",{value:E,max:"100"}),h.jsx("span",{className:"font-12 fw-sb ps-2",children:`${E}%`})]}),!ee&&le&&h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Lt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${y?"d-block":"d-none"}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:Ve,children:h.jsx(tn,{tag:"delete7",className:"font-26"})}),h.jsx(iu,{aspectRatio:"1x1",className:"preview-container",children:h.jsx(h.Fragment,{children:n==="image"&&h.jsx("img",{ref:H,src:le,alt:"preview image",className:`img-fluid mx-auto ${le?"d-block":"d-none"} `})})})]}),h.jsx("div",{className:`btn-wrap pt-3 d-flex justify-content-center position-fixed bg-white border-top pt-3 pb-4 px-3 ${ee?"opacity-0 visibility-hidden":""}`,style:{bottom:0,right:0,left:0},children:h.jsx(Lt,{type:"submit",disabled:!Be.isValid,className:"btn-theme btn-primary btn-md w-100",children:P?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(Be.isValid,"Update")})}),ee&&h.jsx("div",{className:"my-1",children:G&&h.jsx(hXe,{src:G,fileExtension:(we=p==null?void 0:p.name)==null?void 0:we.substring(((Xe=p==null?void 0:p.name)==null?void 0:Xe.lastIndexOf("."))+1),fileType:p==null?void 0:p.type,setCropFile:Y,setCropFileURL:re,setShowCropper:de})})]})}})]})}function pXe(n){return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom -modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:"Update Profile Photo"})}),h.jsx(wn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:h.jsx(fXe,{mediaType:"image",handleClose:n.handleClose,getUserProfile:n.getUserProfile})})]})})}function mXe(n){var x,N,O,D,P,j,M;const[t,i]=k.useState(!1),[s,l]=k.useState(!1),d=Jv((x=n.userProfile)==null?void 0:x.firstname,(N=n.userProfile)==null?void 0:N.lastname),u=vx((O=n.userProfile)==null?void 0:O.designation),p=(D=n.userProfile)!=null&&D.phone?(P=n.userProfile)==null?void 0:P.phone:"",m=()=>{i(!1)},y=()=>{i(!0)},_=()=>{l(!1)},E=V=>{l(!0)},C=()=>{console.log("handleShowLikesBtnClick called..."),y()};return h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx(nZ,{userProfile:n.userProfile,profileImg:(j=n.userProfile)==null?void 0:j.avatar,profileName:d,profileDesig:u,isEdit:!0,handleEditProfile:C,handleShowUpdateProfilePhotoModal:E}),h.jsxs("div",{className:"profile-quick-contact py-3 d-grid gap-2",children:[h.jsx(Pfe,{contactType:"email",contactValue:(M=n.userProfile)==null?void 0:M.email}),h.jsx(Pfe,{contactType:"mobile",contactValue:p}),h.jsx(jYe,{userProfile:n.userProfile})]})]}),h.jsx(FYe,{show:t,handleClose:m,userProfile:n.userProfile,getUserProfile:n.getUserProfile}),h.jsx(pXe,{show:s,handleClose:_,getUserProfile:n.getUserProfile})]})}const gXe=[{id:"appre-1",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"2 hours ago",icon:"star-icon.png",isActionBtn:!1},{id:"appre-2",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"5 hours ago",icon:"star-icon.png",isActionBtn:!1},{id:"appre-3",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"1 day ago",icon:"star-icon.png",isActionBtn:!1},{id:"appre-4",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"1 day ago",icon:"star-icon.png",isActionBtn:!1}],vXe=[{id:"badge-1",type:"badge",text:"Fatest fifty",time:"2 hours ago",points:44,icon:"warranty-icon.png",isActionBtn:!1},{id:"badge-2",type:"badge",text:"Fatest fifty",time:"1 day ago",points:44,icon:"warranty-icon.png",isActionBtn:!1},{id:"badge-3",type:"badge",text:"Fatest fifty",time:"1 day ago",points:44,icon:"warranty-icon.png",isActionBtn:!1},{id:"badge-4",type:"badge",text:"Fatest fifty",time:"5 hours ago",points:44,icon:"warranty-icon.png",isActionBtn:!1}];function yXe(n){k.useState(gXe),k.useState(vXe),k.useState(HY);const[t,i]=k.useState(null),[s,l]=k.useState(!1);k.useContext(qU);async function d(){l(!0),ps.getUserProfile().then(u=>{var p;u.data.status==="success"&&u.data.data&&(console.log("getUserProfile success =",u.data.data),i((p=u.data.data)==null?void 0:p.profile))}).catch(u=>{console.log("getUserProfile() catch block error =",u)}).finally(()=>{l(!1)})}return k.useEffect(()=>{d()},[]),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[!t&&s&&h.jsx(ci,{type:""}),!t&&!s&&h.jsx(et,{className:"card-theme",children:h.jsx(et.Body,{children:"No data found."})}),t&&h.jsx(mXe,{userProfile:t,getUserProfile:d})]})})}function _Xe(){const[n,t]=k.useState(!0),{state:i}=tl();return console.log("Data passed via navigate = ",i),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"rati0 ratio-1x1 position-relativ px-0",style:{height:"calc(100vh - 160px)",zIndex:1},children:[n?h.jsx(ci,{type:"iframe-loader"}):null,h.jsx("iframe",{src:`${i.url}`,title:"Metric Reports",onLoad:()=>t(!1),className:`no-scrollbar ${n?"opacity-0":""}`,sandbox:"allow-scripts",height:"100%",width:"100%"})]})})}function EXe(){k.useState(!0);const{state:n}=tl();return console.log("url = ",n.url),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"ratio ratio-1x1 position-relative",style:{height:"calc(100vh - 160px)",zIndex:1},children:h.jsx("iframe",{src:`${n.url}`,"default-src":"*",title:"QuickActionContent",height:"100%",width:"100%"})})})}function wXe(n){var N,O,D,P,j,M,V,G,$,ne,Y,le,re,ee,de,H,ae,_e,me,Ce,he,pe,Oe,Fe,Ue,Ve,Re,Be,Xe,we,We,st,pt,Qe,Je,St,Xt,Ht,gn,It;k.useState(!1);const t=(N=n==null?void 0:n.item)!=null&&N.name?(O=n==null?void 0:n.item)==null?void 0:O.name:"Default title",i=(D=n.item)!=null&&D.image?(P=n.item)==null?void 0:P.image:"/img/default-bg.jpg",s=(j=n.item)!=null&&j.description?(M=n.item)==null?void 0:M.description:"",l=(G=(V=n.item)==null?void 0:V.user_info)!=null&&G.name?(ne=($=n.item)==null?void 0:$.user_info)==null?void 0:ne.name:"";(le=(Y=n.item)==null?void 0:Y.user_info)!=null&&le.avatar&&((ee=(re=n.item)==null?void 0:re.user_info)==null||ee.avatar);const d=(de=n.item)!=null&&de.comment_count?(H=n.item)==null?void 0:H.comment_count:0,u=(ae=n.item)!=null&&ae.likes_count?(_e=n.item)==null?void 0:_e.likes_count:0,p=(Ce=(me=n.item)==null?void 0:me.completion)!=null&&Ce.count?(pe=(he=n.item)==null?void 0:he.completion)==null?void 0:pe.count:0,m=(Fe=(Oe=n.item)==null?void 0:Oe.completion)!=null&&Fe.total?(Ve=(Ue=n.item)==null?void 0:Ue.completion)==null?void 0:Ve.total:0,y=isNaN(Math.round(p/m*100))?0:Math.round(p/m*100);(Re=n.item)!=null&&Re.has_expiry&&((Be=n.item)==null||Be.has_expiry);const _=(we=(Xe=n.item)==null?void 0:Xe.expiry_date)!=null&&we.day?(st=(We=n.item)==null?void 0:We.expiry_date)==null?void 0:st.day:"",E=(Qe=(pt=n.item)==null?void 0:pt.expiry_date)!=null&&Qe.month?(St=(Je=n.item)==null?void 0:Je.expiry_date)==null?void 0:St.month:"";(Ht=(Xt=n.item)==null?void 0:Xt.expiry_date)!=null&&Ht.year&&((It=(gn=n.item)==null?void 0:gn.expiry_date)==null||It.year);let C=n!=null&&n.className?n==null?void 0:n.className:"";function x(xt){n.handleMagazineCardClick(xt.id)}return h.jsxs(et,{className:`border-0 card-theme magazine-card overflow-hidden ${C}`,onClick:()=>x(n.item),children:[h.jsx(et.Header,{className:"border-bottom-0 p-2 p-sm-3",children:t}),h.jsx(Ts,{src:i,alt:`${t} image`,wrapperClassName:"card-img"}),h.jsx(et.Body,{className:"p-2 p-sm-3",children:h.jsxs("div",{className:"font-13 mb-1",children:[h.jsxs("div",{className:"mb-1",children:[h.jsx("span",{className:"text-theme-primary mb-2",children:"Published By: "})," ",l]}),h.jsx(bP,{text:s,linesToShow:2,containerClass:"magazine-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0"})]})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-2 py-sm-3 d-flex justify-content-between",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1",style:{maxWidth:"120px"},children:m!==0&&h.jsxs(h.Fragment,{children:[h.jsx(eZ,{now:y,className:"flex-grow-1"}),h.jsxs("div",{className:"d-flex font-12 ps-2",children:[h.jsx("span",{className:"fw-b",children:p}),"/",h.jsx("span",{children:m})]})]})}),h.jsxs("div",{className:"btn-wrap ms-2",children:[h.jsxs(Lt,{className:"btn-theme btn-sm btn-likes-light px-2 pe-none visibility-hidden opacity-0",children:[h.jsx(tn,{tag:"favorite3",className:"font-18"})," ",u]}),h.jsxs(Lt,{className:"btn-theme btn-sm btn-gray px-2 pe-none visibility-hidden opacity-0",children:[h.jsx(tn,{tag:"message8",className:"font-18"})," ",d]}),h.jsxs(Lt,{className:"btn-theme btn-sm btn-date btn-transparent px-0 pe-none",children:[h.jsx(tn,{tag:"events1",className:"font-20"})," ",h.jsx("span",{className:"",children:`${_} ${E}`})]})]})]})]})}function SXe(){const n=ji(),[t,i]=k.useState(""),s=["name","user_info.name"],l=async()=>{var x,N;try{const O=await ps.getAllMagazines();return console.log("fetchAllMagazines RES - ",O),O.data.status==="success"?(console.log("## Dashboard Mags res --",O),(N=(x=O.data)==null?void 0:x.data)==null?void 0:N.magazines):[]}catch{throw new Error("Error fetching all magazines")}},{isPending:d,isFetching:u,isError:p,data:m,error:y}=ru({queryKey:["allMagazinesQuery"],queryFn:l});console.log("## fetchAllMagazines - ",m);const _=(x,N)=>N.split(".").reduce((O,D)=>O&&O[D],x);k.useMemo(()=>{if(!t.trim())return m;const x=t.toLowerCase();return m.filter(N=>s.some(O=>{const D=_(N,O);return D==null?void 0:D.toLowerCase().includes(x)}))},[m,t]),k.useMemo(()=>{if(!t.trim())return m;const x=t.toLowerCase().split(" ").filter(Boolean);return m.filter(N=>x.some(O=>s.some(D=>{const P=_(N,D);return P==null?void 0:P.toLowerCase().includes(O)})))},[m,t]);const E=k.useMemo(()=>pP(m,t,s),[m,t]);console.log("filteredData3 - ",E);function C(x){x&&n(`/magazines/${x}`,{state:{pageTitle:"Magazine Details"}})}return d?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((x,N)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},N))})})}):p?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx("div",{className:"d-grid gap-3",children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more responses found."})})})})})}):h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[(m==null?void 0:m.length)>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"py-0 pt-2 sticky-to",style:{},children:h.jsxs("div",{className:"pb-0",children:[h.jsx(CP,{filters:s,onSearch:x=>i(x),className:"mb-"}),(E==null?void 0:E.length)>0&&t.length>0&&h.jsx(To,{size:"sm",className:"px-1 text-gray9",children:`Results found ${E==null?void 0:E.length}`})]})})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-2",children:u&&(E==null?void 0:E.length)===0?h.jsx(h.Fragment,{children:[0,1].map((x,N)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},N))}):h.jsx(h.Fragment,{children:(E==null?void 0:E.length)>0?h.jsx("div",{className:"d-grid gap-3",children:E==null?void 0:E.map((x,N)=>h.jsx(wXe,{item:x,className:"shadow-sm ",handleMagazineCardClick:C},x.id))}):h.jsx("div",{className:"d-grid gap-3",children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"Data not found."})})})})})})]})})}var fEe=function(t,i,s){var l=document.head||document.getElementsByTagName("head")[0],d=document.createElement("script");typeof i=="function"&&(s=i,i={}),i=i||{},s=s||function(){},d.type=i.type||"text/javascript",d.charset=i.charset||"utf8",d.async="async"in i?!!i.async:!0,d.src=t,i.attrs&&bXe(d,i.attrs),i.text&&(d.text=""+i.text);var u="onload"in d?Ffe:CXe;u(d,s),d.onload||Ffe(d,s),l.appendChild(d)};function bXe(n,t){for(var i in t)n.setAttribute(i,t[i])}function Ffe(n,t){n.onload=function(){this.onerror=this.onload=null,t(null,n)},n.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),n)}}function CXe(n,t){n.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,n))}}var TXe=function(t){return RXe(t)&&!xXe(t)};function RXe(n){return!!n&&typeof n=="object"}function xXe(n){var t=Object.prototype.toString.call(n);return t==="[object RegExp]"||t==="[object Date]"||NXe(n)}var AXe=typeof Symbol=="function"&&Symbol.for,IXe=AXe?Symbol.for("react.element"):60103;function NXe(n){return n.$$typeof===IXe}function OXe(n){return Array.isArray(n)?[]:{}}function TN(n,t){return t.clone!==!1&&t.isMergeableObject(n)?ox(OXe(n),n,t):n}function PXe(n,t,i){return n.concat(t).map(function(s){return TN(s,i)})}function LXe(n,t){if(!t.customMerge)return ox;var i=t.customMerge(n);return typeof i=="function"?i:ox}function DXe(n){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n).filter(function(t){return Object.propertyIsEnumerable.call(n,t)}):[]}function Bfe(n){return Object.keys(n).concat(DXe(n))}function pEe(n,t){try{return t in n}catch{return!1}}function kXe(n,t){return pEe(n,t)&&!(Object.hasOwnProperty.call(n,t)&&Object.propertyIsEnumerable.call(n,t))}function MXe(n,t,i){var s={};return i.isMergeableObject(n)&&Bfe(n).forEach(function(l){s[l]=TN(n[l],i)}),Bfe(t).forEach(function(l){kXe(n,l)||(pEe(n,l)&&i.isMergeableObject(t[l])?s[l]=LXe(l,i)(n[l],t[l],i):s[l]=TN(t[l],i))}),s}function ox(n,t,i){i=i||{},i.arrayMerge=i.arrayMerge||PXe,i.isMergeableObject=i.isMergeableObject||TXe,i.cloneUnlessOtherwiseSpecified=TN;var s=Array.isArray(t),l=Array.isArray(n),d=s===l;return d?s?i.arrayMerge(n,t,i):MXe(n,t,i):TN(t,i)}ox.all=function(t,i){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(s,l){return ox(s,l,i)},{})};var jXe=ox,mF=jXe,UXe=Object.create,gF=Object.defineProperty,FXe=Object.getOwnPropertyDescriptor,BXe=Object.getOwnPropertyNames,VXe=Object.getPrototypeOf,zXe=Object.prototype.hasOwnProperty,HXe=(n,t)=>{for(var i in t)gF(n,i,{get:t[i],enumerable:!0})},mEe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of BXe(t))!zXe.call(n,l)&&l!==i&&gF(n,l,{get:()=>t[l],enumerable:!(s=FXe(t,l))||s.enumerable});return n},OZ=(n,t,i)=>(i=n!=null?UXe(VXe(n)):{},mEe(t||!n||!n.__esModule?gF(i,"default",{value:n,enumerable:!0}):i,n)),GXe=n=>mEe(gF({},"__esModule",{value:!0}),n),gEe={};HXe(gEe,{callPlayer:()=>aJe,getConfig:()=>rJe,getSDK:()=>iJe,isBlobUrl:()=>lJe,isMediaStream:()=>oJe,lazy:()=>qXe,omit:()=>sJe,parseEndTime:()=>eJe,parseStartTime:()=>ZXe,queryString:()=>nJe,randomString:()=>tJe,supportsWebKitPresentationMode:()=>cJe});var vF=GXe(gEe),WXe=OZ(k),$Xe=OZ(fEe),KXe=OZ(mF);const qXe=n=>WXe.default.lazy(async()=>{const t=await n();return typeof t.default=="function"?t:t.default}),YXe=/[?&#](?:start|t)=([0-9hms]+)/,XXe=/[?&#]end=([0-9hms]+)/,GY=/(\d+)(h|m|s)/g,JXe=/^\d+$/;function vEe(n,t){if(n instanceof Array)return;const i=n.match(t);if(i){const s=i[1];if(s.match(GY))return QXe(s);if(JXe.test(s))return parseInt(s)}}function QXe(n){let t=0,i=GY.exec(n);for(;i!==null;){const[,s,l]=i;l==="h"&&(t+=parseInt(s,10)*60*60),l==="m"&&(t+=parseInt(s,10)*60),l==="s"&&(t+=parseInt(s,10)),i=GY.exec(n)}return t}function ZXe(n){return vEe(n,YXe)}function eJe(n){return vEe(n,XXe)}function tJe(){return Math.random().toString(36).substr(2,5)}function nJe(n){return Object.keys(n).map(t=>`${t}=${n[t]}`).join("&")}function IK(n){return window[n]?window[n]:window.exports&&window.exports[n]?window.exports[n]:window.module&&window.module.exports&&window.module.exports[n]?window.module.exports[n]:null}const eC={},iJe=function(t,i,s=null,l=()=>!0,d=$Xe.default){const u=IK(i);return u&&l(u)?Promise.resolve(u):new Promise((p,m)=>{if(eC[t]){eC[t].push({resolve:p,reject:m});return}eC[t]=[{resolve:p,reject:m}];const y=_=>{eC[t].forEach(E=>E.resolve(_))};if(s){const _=window[s];window[s]=function(){_&&_(),y(IK(i))}}d(t,_=>{_?(eC[t].forEach(E=>E.reject(_)),eC[t]=null):s||y(IK(i))})})};function rJe(n,t){return(0,KXe.default)(t.config,n.config)}function sJe(n,...t){const i=[].concat(...t),s={},l=Object.keys(n);for(const d of l)i.indexOf(d)===-1&&(s[d]=n[d]);return s}function aJe(n,...t){if(!this.player||!this.player[n]){let i=`ReactPlayer: ${this.constructor.displayName} player could not call %c${n}%c – `;return this.player?this.player[n]||(i+="The method was not available"):i+="The player was not available",console.warn(i,"font-weight: bold",""),null}return this.player[n](...t)}function oJe(n){return typeof window<"u"&&typeof window.MediaStream<"u"&&n instanceof window.MediaStream}function lJe(n){return/^blob:/.test(n)}function cJe(n=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return n.webkitSupportsPresentationMode&&typeof n.webkitSetPresentationMode=="function"&&t}var PZ=Object.defineProperty,dJe=Object.getOwnPropertyDescriptor,uJe=Object.getOwnPropertyNames,hJe=Object.prototype.hasOwnProperty,fJe=(n,t)=>{for(var i in t)PZ(n,i,{get:t[i],enumerable:!0})},pJe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of uJe(t))!hJe.call(n,l)&&l!==i&&PZ(n,l,{get:()=>t[l],enumerable:!(s=dJe(t,l))||s.enumerable});return n},mJe=n=>pJe(PZ({},"__esModule",{value:!0}),n),yEe={};fJe(yEe,{AUDIO_EXTENSIONS:()=>LZ,DASH_EXTENSIONS:()=>OEe,FLV_EXTENSIONS:()=>PEe,HLS_EXTENSIONS:()=>kZ,MATCH_URL_DAILYMOTION:()=>xEe,MATCH_URL_FACEBOOK:()=>wEe,MATCH_URL_FACEBOOK_WATCH:()=>SEe,MATCH_URL_KALTURA:()=>NEe,MATCH_URL_MIXCLOUD:()=>AEe,MATCH_URL_SOUNDCLOUD:()=>_Ee,MATCH_URL_STREAMABLE:()=>bEe,MATCH_URL_TWITCH_CHANNEL:()=>REe,MATCH_URL_TWITCH_VIDEO:()=>TEe,MATCH_URL_VIDYARD:()=>IEe,MATCH_URL_VIMEO:()=>EEe,MATCH_URL_WISTIA:()=>CEe,MATCH_URL_YOUTUBE:()=>WY,VIDEO_EXTENSIONS:()=>DZ,canPlay:()=>vJe});var gJe=mJe(yEe),Vfe=vF;const WY=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,_Ee=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,EEe=/vimeo\.com\/(?!progressive_redirect).+/,wEe=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,SEe=/^https?:\/\/fb\.watch\/.+$/,bEe=/streamable\.com\/([a-z0-9]+)$/,CEe=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,TEe=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,REe=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,xEe=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,AEe=/mixcloud\.com\/([^/]+\/[^/]+)/,IEe=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,NEe=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,LZ=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,DZ=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,kZ=/\.(m3u8)($|\?)/i,OEe=/\.(mpd)($|\?)/i,PEe=/\.(flv)($|\?)/i,$Y=n=>{if(n instanceof Array){for(const t of n)if(typeof t=="string"&&$Y(t)||$Y(t.src))return!0;return!1}return(0,Vfe.isMediaStream)(n)||(0,Vfe.isBlobUrl)(n)?!0:LZ.test(n)||DZ.test(n)||kZ.test(n)||OEe.test(n)||PEe.test(n)},vJe={youtube:n=>n instanceof Array?n.every(t=>WY.test(t)):WY.test(n),soundcloud:n=>_Ee.test(n)&&!LZ.test(n),vimeo:n=>EEe.test(n)&&!DZ.test(n)&&!kZ.test(n),facebook:n=>wEe.test(n)||SEe.test(n),streamable:n=>bEe.test(n),wistia:n=>CEe.test(n),twitch:n=>TEe.test(n)||REe.test(n),dailymotion:n=>xEe.test(n),mixcloud:n=>AEe.test(n),vidyard:n=>IEe.test(n),kaltura:n=>NEe.test(n),file:$Y};var MZ=Object.defineProperty,yJe=Object.getOwnPropertyDescriptor,_Je=Object.getOwnPropertyNames,EJe=Object.prototype.hasOwnProperty,wJe=(n,t)=>{for(var i in t)MZ(n,i,{get:t[i],enumerable:!0})},SJe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of _Je(t))!EJe.call(n,l)&&l!==i&&MZ(n,l,{get:()=>t[l],enumerable:!(s=yJe(t,l))||s.enumerable});return n},bJe=n=>SJe(MZ({},"__esModule",{value:!0}),n),LEe={};wJe(LEe,{default:()=>TJe});var CJe=bJe(LEe),Cd=vF,Vc=gJe,TJe=[{key:"youtube",name:"YouTube",canPlay:Vc.canPlay.youtube,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./YouTube-pu9jdv6K.js").then(n=>n.Y),__vite__mapDeps([])))},{key:"soundcloud",name:"SoundCloud",canPlay:Vc.canPlay.soundcloud,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./SoundCloud-Bem1BcnI.js").then(n=>n.S),__vite__mapDeps([])))},{key:"vimeo",name:"Vimeo",canPlay:Vc.canPlay.vimeo,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Vimeo-BKGsN9uR.js").then(n=>n.V),__vite__mapDeps([])))},{key:"facebook",name:"Facebook",canPlay:Vc.canPlay.facebook,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Facebook-Bn5ao2nH.js").then(n=>n.F),__vite__mapDeps([])))},{key:"streamable",name:"Streamable",canPlay:Vc.canPlay.streamable,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Streamable-DGFmjQ_W.js").then(n=>n.S),__vite__mapDeps([])))},{key:"wistia",name:"Wistia",canPlay:Vc.canPlay.wistia,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Wistia-DmXccwzg.js").then(n=>n.W),__vite__mapDeps([])))},{key:"twitch",name:"Twitch",canPlay:Vc.canPlay.twitch,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Twitch-DnAeix8m.js").then(n=>n.T),__vite__mapDeps([])))},{key:"dailymotion",name:"DailyMotion",canPlay:Vc.canPlay.dailymotion,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./DailyMotion-CR3JQlTg.js").then(n=>n.D),__vite__mapDeps([])))},{key:"mixcloud",name:"Mixcloud",canPlay:Vc.canPlay.mixcloud,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Mixcloud-DuBoAkmj.js").then(n=>n.M),__vite__mapDeps([])))},{key:"vidyard",name:"Vidyard",canPlay:Vc.canPlay.vidyard,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Vidyard-B0q-ROHQ.js").then(n=>n.V),__vite__mapDeps([])))},{key:"kaltura",name:"Kaltura",canPlay:Vc.canPlay.kaltura,lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./Kaltura-3wIx0feh.js").then(n=>n.K),__vite__mapDeps([])))},{key:"file",name:"FilePlayer",canPlay:Vc.canPlay.file,canEnablePIP:n=>Vc.canPlay.file(n)&&(document.pictureInPictureEnabled||(0,Cd.supportsWebKitPresentationMode)())&&!Vc.AUDIO_EXTENSIONS.test(n),lazyPlayer:(0,Cd.lazy)(()=>lr(()=>import("./FilePlayer-ZFojmqQI.js").then(n=>n.F),__vite__mapDeps([])))}],zfe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function RJe(n,t){return!!(n===t||zfe(n)&&zfe(t))}function xJe(n,t){if(n.length!==t.length)return!1;for(var i=0;i<n.length;i++)if(!RJe(n[i],t[i]))return!1;return!0}function AJe(n,t){t===void 0&&(t=xJe);var i,s=[],l,d=!1;function u(){for(var p=[],m=0;m<arguments.length;m++)p[m]=arguments[m];return d&&i===this&&t(p,s)||(l=n.apply(this,p),d=!0,i=this,s=p),l}return u}const IJe=Object.freeze(Object.defineProperty({__proto__:null,default:AJe},Symbol.toStringTag,{value:"Module"})),DEe=Sme(IJe);var NJe=typeof Element<"u",OJe=typeof Map=="function",PJe=typeof Set=="function",LJe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function OM(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var i,s,l;if(Array.isArray(n)){if(i=n.length,i!=t.length)return!1;for(s=i;s--!==0;)if(!OM(n[s],t[s]))return!1;return!0}var d;if(OJe&&n instanceof Map&&t instanceof Map){if(n.size!==t.size)return!1;for(d=n.entries();!(s=d.next()).done;)if(!t.has(s.value[0]))return!1;for(d=n.entries();!(s=d.next()).done;)if(!OM(s.value[1],t.get(s.value[0])))return!1;return!0}if(PJe&&n instanceof Set&&t instanceof Set){if(n.size!==t.size)return!1;for(d=n.entries();!(s=d.next()).done;)if(!t.has(s.value[0]))return!1;return!0}if(LJe&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(t)){if(i=n.length,i!=t.length)return!1;for(s=i;s--!==0;)if(n[s]!==t[s])return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof t.valueOf=="function")return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof t.toString=="function")return n.toString()===t.toString();if(l=Object.keys(n),i=l.length,i!==Object.keys(t).length)return!1;for(s=i;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[s]))return!1;if(NJe&&n instanceof Element)return!1;for(s=i;s--!==0;)if(!((l[s]==="_owner"||l[s]==="__v"||l[s]==="__o")&&n.$$typeof)&&!OM(n[l[s]],t[l[s]]))return!1;return!0}return n!==n&&t!==t}var yF=function(t,i){try{return OM(t,i)}catch(s){if((s.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw s}},DJe=Object.create,_F=Object.defineProperty,kJe=Object.getOwnPropertyDescriptor,MJe=Object.getOwnPropertyNames,jJe=Object.getPrototypeOf,UJe=Object.prototype.hasOwnProperty,FJe=(n,t)=>{for(var i in t)_F(n,i,{get:t[i],enumerable:!0})},kEe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of MJe(t))!UJe.call(n,l)&&l!==i&&_F(n,l,{get:()=>t[l],enumerable:!(s=kJe(t,l))||s.enumerable});return n},BJe=(n,t,i)=>(i=n!=null?DJe(jJe(n)):{},kEe(t||!n||!n.__esModule?_F(i,"default",{value:n,enumerable:!0}):i,n)),VJe=n=>kEe(_F({},"__esModule",{value:!0}),n),MEe={};FJe(MEe,{defaultProps:()=>GJe,propTypes:()=>HJe});var jEe=VJe(MEe),zJe=BJe(zQ);const{string:Wl,bool:$l,number:tC,array:NK,oneOfType:B3,shape:Bu,object:Kl,func:Va,node:Hfe}=zJe.default,HJe={url:B3([Wl,NK,Kl]),playing:$l,loop:$l,controls:$l,volume:tC,muted:$l,playbackRate:tC,width:B3([Wl,tC]),height:B3([Wl,tC]),style:Kl,progressInterval:tC,playsinline:$l,pip:$l,stopOnUnmount:$l,light:B3([$l,Wl,Kl]),playIcon:Hfe,previewTabIndex:tC,fallback:Hfe,oEmbedUrl:Wl,wrapper:B3([Wl,Va,Bu({render:Va.isRequired})]),config:Bu({soundcloud:Bu({options:Kl}),youtube:Bu({playerVars:Kl,embedOptions:Kl,onUnstarted:Va}),facebook:Bu({appId:Wl,version:Wl,playerId:Wl,attributes:Kl}),dailymotion:Bu({params:Kl}),vimeo:Bu({playerOptions:Kl,title:Wl}),file:Bu({attributes:Kl,tracks:NK,forceVideo:$l,forceAudio:$l,forceHLS:$l,forceSafariHLS:$l,forceDisableHls:$l,forceDASH:$l,forceFLV:$l,hlsOptions:Kl,hlsVersion:Wl,dashVersion:Wl,flvVersion:Wl}),wistia:Bu({options:Kl,playerId:Wl,customControls:NK}),mixcloud:Bu({options:Kl}),twitch:Bu({options:Kl,playerId:Wl}),vidyard:Bu({options:Kl})}),onReady:Va,onStart:Va,onPlay:Va,onPause:Va,onBuffer:Va,onBufferEnd:Va,onEnded:Va,onError:Va,onDuration:Va,onSeek:Va,onPlaybackRateChange:Va,onPlaybackQualityChange:Va,onProgress:Va,onClickPreview:Va,onEnablePIP:Va,onDisablePIP:Va},jo=()=>{},GJe={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:jo},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:jo,onStart:jo,onPlay:jo,onPause:jo,onBuffer:jo,onBufferEnd:jo,onEnded:jo,onError:jo,onDuration:jo,onSeek:jo,onPlaybackRateChange:jo,onPlaybackQualityChange:jo,onProgress:jo,onClickPreview:jo,onEnablePIP:jo,onDisablePIP:jo};var WJe=Object.create,TP=Object.defineProperty,$Je=Object.getOwnPropertyDescriptor,KJe=Object.getOwnPropertyNames,qJe=Object.getPrototypeOf,YJe=Object.prototype.hasOwnProperty,XJe=(n,t,i)=>t in n?TP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,JJe=(n,t)=>{for(var i in t)TP(n,i,{get:t[i],enumerable:!0})},UEe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of KJe(t))!YJe.call(n,l)&&l!==i&&TP(n,l,{get:()=>t[l],enumerable:!(s=$Je(t,l))||s.enumerable});return n},FEe=(n,t,i)=>(i=n!=null?WJe(qJe(n)):{},UEe(t||!n||!n.__esModule?TP(i,"default",{value:n,enumerable:!0}):i,n)),QJe=n=>UEe(TP({},"__esModule",{value:!0}),n),pa=(n,t,i)=>(XJe(n,typeof t!="symbol"?t+"":t,i),i),BEe={};JJe(BEe,{default:()=>EF});var ZJe=QJe(BEe),Gfe=FEe(k),eQe=FEe(yF),VEe=jEe,tQe=vF;const nQe=5e3;let EF=class extends Gfe.Component{constructor(){super(...arguments),pa(this,"mounted",!1),pa(this,"isReady",!1),pa(this,"isPlaying",!1),pa(this,"isLoading",!0),pa(this,"loadOnReady",null),pa(this,"startOnPlay",!0),pa(this,"seekOnPlay",null),pa(this,"onDurationCalled",!1),pa(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),pa(this,"getInternalPlayer",t=>this.player?this.player[t]:null),pa(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,i=this.getSecondsLoaded(),s=this.getDuration();if(s){const l={playedSeconds:t,played:t/s};i!==null&&(l.loadedSeconds=i,l.loaded=i/s),(l.playedSeconds!==this.prevPlayed||l.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(l),this.prevPlayed=l.playedSeconds,this.prevLoaded=l.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),pa(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:i,volume:s,muted:l}=this.props;t(),!l&&s!==null&&this.player.setVolume(s),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):i&&this.player.play(),this.handleDurationCheck()}),pa(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:i,playbackRate:s}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&s!==1&&this.player.setPlaybackRate(s),t(),this.startOnPlay=!1),i(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),pa(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),pa(this,"handleEnded",()=>{const{activePlayer:t,loop:i,onEnded:s}=this.props;t.loopOnEnded&&i&&this.seekTo(0),i||(this.isPlaying=!1,s())}),pa(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),pa(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),pa(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:i,playing:s,volume:l,muted:d,playbackRate:u,pip:p,loop:m,activePlayer:y,disableDeferredLoading:_}=this.props;if(!(0,eQe.default)(t.url,i)){if(this.isLoading&&!y.forceLoad&&!_&&!(0,tQe.isMediaStream)(i)){console.warn(`ReactPlayer: the attempt to load ${i} is being deferred until the player has loaded`),this.loadOnReady=i;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(i,this.isReady)}!t.playing&&s&&!this.isPlaying&&this.player.play(),t.playing&&!s&&this.isPlaying&&this.player.pause(),!t.pip&&p&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!p&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==l&&l!==null&&this.player.setVolume(l),t.muted!==d&&(d?this.player.mute():(this.player.unmute(),l!==null&&setTimeout(()=>this.player.setVolume(l)))),t.playbackRate!==u&&this.player.setPlaybackRate&&this.player.setPlaybackRate(u),t.loop!==m&&this.player.setLoop&&this.player.setLoop(m)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,i,s){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},nQe));return}if(i?i==="fraction":t>0&&t<1){const d=this.player.getDuration();if(!d){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(d*t,s);return}this.player.seekTo(t,s)}render(){const t=this.props.activePlayer;return t?Gfe.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}};pa(EF,"displayName","Player");pa(EF,"propTypes",VEe.propTypes);pa(EF,"defaultProps",VEe.defaultProps);var iQe=Object.create,RP=Object.defineProperty,rQe=Object.getOwnPropertyDescriptor,sQe=Object.getOwnPropertyNames,aQe=Object.getPrototypeOf,oQe=Object.prototype.hasOwnProperty,lQe=(n,t,i)=>t in n?RP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,cQe=(n,t)=>{for(var i in t)RP(n,i,{get:t[i],enumerable:!0})},zEe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of sQe(t))!oQe.call(n,l)&&l!==i&&RP(n,l,{get:()=>t[l],enumerable:!(s=rQe(t,l))||s.enumerable});return n},xP=(n,t,i)=>(i=n!=null?iQe(aQe(n)):{},zEe(t||!n||!n.__esModule?RP(i,"default",{value:n,enumerable:!0}):i,n)),dQe=n=>zEe(RP({},"__esModule",{value:!0}),n),ha=(n,t,i)=>(lQe(n,typeof t!="symbol"?t+"":t,i),i),HEe={};cQe(HEe,{createReactPlayer:()=>_Qe});var uQe=dQe(HEe),cC=xP(k),hQe=xP(mF),OK=xP(DEe),Wfe=xP(yF),s4=jEe,GEe=vF,fQe=xP(ZJe);const pQe=(0,GEe.lazy)(()=>lr(()=>import("./Preview-DsUXhKvR.js").then(n=>n.P),__vite__mapDeps([]))),mQe=typeof window<"u"&&window.document,gQe=typeof Ws<"u"&&Ws.window&&Ws.window.document,vQe=Object.keys(s4.propTypes),yQe=mQe||gQe?cC.Suspense:()=>null,V3=[],_Qe=(n,t)=>{var i;return i=class extends cC.Component{constructor(){super(...arguments),ha(this,"state",{showPreview:!!this.props.light}),ha(this,"references",{wrapper:s=>{this.wrapper=s},player:s=>{this.player=s}}),ha(this,"handleClickPreview",s=>{this.setState({showPreview:!1}),this.props.onClickPreview(s)}),ha(this,"showPreview",()=>{this.setState({showPreview:!0})}),ha(this,"getDuration",()=>this.player?this.player.getDuration():null),ha(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),ha(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),ha(this,"getInternalPlayer",(s="player")=>this.player?this.player.getInternalPlayer(s):null),ha(this,"seekTo",(s,l,d)=>{if(!this.player)return null;this.player.seekTo(s,l,d)}),ha(this,"handleReady",()=>{this.props.onReady(this)}),ha(this,"getActivePlayer",(0,OK.default)(s=>{for(const l of[...V3,...n])if(l.canPlay(s))return l;return t||null})),ha(this,"getConfig",(0,OK.default)((s,l)=>{const{config:d}=this.props;return hQe.default.all([s4.defaultProps.config,s4.defaultProps.config[l]||{},d,d[l]||{}])})),ha(this,"getAttributes",(0,OK.default)(s=>(0,GEe.omit)(this.props,vQe))),ha(this,"renderActivePlayer",s=>{if(!s)return null;const l=this.getActivePlayer(s);if(!l)return null;const d=this.getConfig(s,l.key);return cC.default.createElement(fQe.default,{...this.props,key:l.key,ref:this.references.player,config:d,activePlayer:l.lazyPlayer||l,onReady:this.handleReady})})}shouldComponentUpdate(s,l){return!(0,Wfe.default)(this.props,s)||!(0,Wfe.default)(this.state,l)}componentDidUpdate(s){const{light:l}=this.props;!s.light&&l&&this.setState({showPreview:!0}),s.light&&!l&&this.setState({showPreview:!1})}renderPreview(s){if(!s)return null;const{light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p}=this.props;return cC.default.createElement(pQe,{url:s,light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p,onClick:this.handleClickPreview})}render(){const{url:s,style:l,width:d,height:u,fallback:p,wrapper:m}=this.props,{showPreview:y}=this.state,_=this.getAttributes(s),E=typeof m=="string"?this.references.wrapper:void 0;return cC.default.createElement(m,{ref:E,style:{...l,width:d,height:u},..._},cC.default.createElement(yQe,{fallback:p},y?this.renderPreview(s):this.renderActivePlayer(s)))}},ha(i,"displayName","ReactPlayer"),ha(i,"propTypes",s4.propTypes),ha(i,"defaultProps",s4.defaultProps),ha(i,"addCustomPlayer",s=>{V3.push(s)}),ha(i,"removeCustomPlayers",()=>{V3.length=0}),ha(i,"canPlay",s=>{for(const l of[...V3,...n])if(l.canPlay(s))return!0;return!1}),ha(i,"canEnablePIP",s=>{for(const l of[...V3,...n])if(l.canEnablePIP&&l.canEnablePIP(s))return!0;return!1}),i};var EQe=Object.create,wF=Object.defineProperty,wQe=Object.getOwnPropertyDescriptor,SQe=Object.getOwnPropertyNames,bQe=Object.getPrototypeOf,CQe=Object.prototype.hasOwnProperty,TQe=(n,t)=>{for(var i in t)wF(n,i,{get:t[i],enumerable:!0})},WEe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of SQe(t))!CQe.call(n,l)&&l!==i&&wF(n,l,{get:()=>t[l],enumerable:!(s=wQe(t,l))||s.enumerable});return n},RQe=(n,t,i)=>(i=n!=null?EQe(bQe(n)):{},WEe(t||!n||!n.__esModule?wF(i,"default",{value:n,enumerable:!0}):i,n)),xQe=n=>WEe(wF({},"__esModule",{value:!0}),n),$Ee={};TQe($Ee,{default:()=>OQe});var AQe=xQe($Ee),KY=RQe(CJe),IQe=uQe;const NQe=KY.default[KY.default.length-1];var OQe=(0,IQe.createReactPlayer)(KY.default,NQe);const gw=ty(AQe),sc=typeof lc=="object"&&lc+""=="[object process]"&&!lc.versions.nw&&!(lc.versions.electron&&lc.type&&lc.type!=="browser"),qY=[.001,0,0,.001,0,0],PK=1.35,Wd={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},C1={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},KEe="pdfjs_internal_editor_",fi={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},cr={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},PQe={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Fo={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},PM={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Na={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},dC={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},SF={ERRORS:0,WARNINGS:1,INFOS:5},RN={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},Z8={moveTo:0,lineTo:1,curveTo:2,closePath:3},LQe={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let bF=SF.WARNINGS;function DQe(n){Number.isInteger(n)&&(bF=n)}function kQe(){return bF}function CF(n){bF>=SF.INFOS&&console.log(`Info: ${n}`)}function Ei(n){bF>=SF.WARNINGS&&console.log(`Warning: ${n}`)}function ns(n){throw new Error(n)}function La(n,t){n||ns(t)}function MQe(n){switch(n==null?void 0:n.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function qEe(n,t=null,i=null){if(!n)return null;if(i&&typeof n=="string"){if(i.addDefaultProtocol&&n.startsWith("www.")){const l=n.match(/\./g);(l==null?void 0:l.length)>=2&&(n=`http://${n}`)}if(i.tryConvertEncoding)try{n=VQe(n)}catch{}}const s=t?URL.parse(n,t):URL.parse(n);return MQe(s)?s:null}function YEe(n,t,i=!1){const s=URL.parse(n);return s?(s.hash=t,s.href):i&&qEe(n,"http://example.com")?n.split("#",1)[0]+`${t?`#${t}`:""}`:""}function Ki(n,t,i,s=!1){return Object.defineProperty(n,t,{value:i,enumerable:!s,configurable:!0,writable:!1}),i}const vw=function(){function t(i,s){this.message=i,this.name=s}return t.prototype=new Error,t.constructor=t,t}();class $fe extends vw{constructor(t,i){super(t,"PasswordException"),this.code=i}}class LK extends vw{constructor(t,i){super(t,"UnknownErrorException"),this.details=i}}class YY extends vw{constructor(t){super(t,"InvalidPDFException")}}class n9 extends vw{constructor(t,i,s){super(t,"ResponseException"),this.status=i,this.missing=s}}class jQe extends vw{constructor(t){super(t,"FormatError")}}class Zv extends vw{constructor(t){super(t,"AbortException")}}function XEe(n){(typeof n!="object"||(n==null?void 0:n.length)===void 0)&&ns("Invalid argument for bytesToString");const t=n.length,i=8192;if(t<i)return String.fromCharCode.apply(null,n);const s=[];for(let l=0;l<t;l+=i){const d=Math.min(l+i,t),u=n.subarray(l,d);s.push(String.fromCharCode.apply(null,u))}return s.join("")}function AP(n){typeof n!="string"&&ns("Invalid argument for stringToBytes");const t=n.length,i=new Uint8Array(t);for(let s=0;s<t;++s)i[s]=n.charCodeAt(s)&255;return i}function UQe(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function FQe(){const n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function BQe(){try{return new Function(""),!0}catch{return!1}}class Zo{static get isLittleEndian(){return Ki(this,"isLittleEndian",FQe())}static get isEvalSupported(){return Ki(this,"isEvalSupported",BQe())}static get isOffscreenCanvasSupported(){return Ki(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Ki(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:i}=navigator;return Ki(this,"platform",{isAndroid:i.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:i.includes("Firefox")})}static get isCSSRoundSupported(){var t,i;return Ki(this,"isCSSRoundSupported",(i=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:i.call(t,"width: round(1.5px, 1px)"))}}const DK=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));var aT,LM,zN,XY;class In{static makeHexColor(t,i,s){return`#${DK[t]}${DK[i]}${DK[s]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,i){let s;t[0]?(t[0]<0&&(s=i[0],i[0]=i[2],i[2]=s),i[0]*=t[0],i[2]*=t[0],t[3]<0&&(s=i[1],i[1]=i[3],i[3]=s),i[1]*=t[3],i[3]*=t[3]):(s=i[0],i[0]=i[1],i[1]=s,s=i[2],i[2]=i[3],i[3]=s,t[1]<0&&(s=i[1],i[1]=i[3],i[3]=s),i[1]*=t[1],i[3]*=t[1],t[2]<0&&(s=i[0],i[0]=i[2],i[2]=s),i[0]*=t[2],i[2]*=t[2]),i[0]+=t[4],i[1]+=t[5],i[2]+=t[4],i[3]+=t[5]}static transform(t,i){return[t[0]*i[0]+t[2]*i[1],t[1]*i[0]+t[3]*i[1],t[0]*i[2]+t[2]*i[3],t[1]*i[2]+t[3]*i[3],t[0]*i[4]+t[2]*i[5]+t[4],t[1]*i[4]+t[3]*i[5]+t[5]]}static multiplyByDOMMatrix(t,i){return[t[0]*i.a+t[2]*i.b,t[1]*i.a+t[3]*i.b,t[0]*i.c+t[2]*i.d,t[1]*i.c+t[3]*i.d,t[0]*i.e+t[2]*i.f+t[4],t[1]*i.e+t[3]*i.f+t[5]]}static applyTransform(t,i,s=0){const l=t[s],d=t[s+1];t[s]=l*i[0]+d*i[2]+i[4],t[s+1]=l*i[1]+d*i[3]+i[5]}static applyTransformToBezier(t,i,s=0){const l=i[0],d=i[1],u=i[2],p=i[3],m=i[4],y=i[5];for(let _=0;_<6;_+=2){const E=t[s+_],C=t[s+_+1];t[s+_]=E*l+C*u+m,t[s+_+1]=E*d+C*p+y}}static applyInverseTransform(t,i){const s=t[0],l=t[1],d=i[0]*i[3]-i[1]*i[2];t[0]=(s*i[3]-l*i[2]+i[2]*i[5]-i[4]*i[3])/d,t[1]=(-s*i[1]+l*i[0]+i[4]*i[1]-i[5]*i[0])/d}static axialAlignedBoundingBox(t,i,s){const l=i[0],d=i[1],u=i[2],p=i[3],m=i[4],y=i[5],_=t[0],E=t[1],C=t[2],x=t[3];let N=l*_+m,O=N,D=l*C+m,P=D,j=p*E+y,M=j,V=p*x+y,G=V;if(d!==0||u!==0){const $=d*_,ne=d*C,Y=u*E,le=u*x;N+=Y,P+=Y,D+=le,O+=le,j+=$,G+=$,V+=ne,M+=ne}s[0]=Math.min(s[0],N,D,O,P),s[1]=Math.min(s[1],j,V,M,G),s[2]=Math.max(s[2],N,D,O,P),s[3]=Math.max(s[3],j,V,M,G)}static inverseTransform(t){const i=t[0]*t[3]-t[1]*t[2];return[t[3]/i,-t[1]/i,-t[2]/i,t[0]/i,(t[2]*t[5]-t[4]*t[3])/i,(t[4]*t[1]-t[5]*t[0])/i]}static singularValueDecompose2dScale(t,i){const s=t[0],l=t[1],d=t[2],u=t[3],p=s**2+l**2,m=s*d+l*u,y=d**2+u**2,_=(p+y)/2,E=Math.sqrt(_**2-(p*y-m**2));i[0]=Math.sqrt(_+E||1),i[1]=Math.sqrt(_-E||1)}static normalizeRect(t){const i=t.slice(0);return t[0]>t[2]&&(i[0]=t[2],i[2]=t[0]),t[1]>t[3]&&(i[1]=t[3],i[3]=t[1]),i}static intersect(t,i){const s=Math.max(Math.min(t[0],t[2]),Math.min(i[0],i[2])),l=Math.min(Math.max(t[0],t[2]),Math.max(i[0],i[2]));if(s>l)return null;const d=Math.max(Math.min(t[1],t[3]),Math.min(i[1],i[3])),u=Math.min(Math.max(t[1],t[3]),Math.max(i[1],i[3]));return d>u?null:[s,d,l,u]}static pointBoundingBox(t,i,s){s[0]=Math.min(s[0],t),s[1]=Math.min(s[1],i),s[2]=Math.max(s[2],t),s[3]=Math.max(s[3],i)}static rectBoundingBox(t,i,s,l,d){d[0]=Math.min(d[0],t,s),d[1]=Math.min(d[1],i,l),d[2]=Math.max(d[2],t,s),d[3]=Math.max(d[3],i,l)}static bezierBoundingBox(t,i,s,l,d,u,p,m,y){y[0]=Math.min(y[0],t,p),y[1]=Math.min(y[1],i,m),y[2]=Math.max(y[2],t,p),y[3]=Math.max(y[3],i,m),fe(this,zN,XY).call(this,t,s,d,p,i,l,u,m,3*(-t+3*(s-d)+p),6*(t-2*s+d),3*(s-t),y),fe(this,zN,XY).call(this,t,s,d,p,i,l,u,m,3*(-i+3*(l-u)+m),6*(i-2*l+u),3*(l-i),y)}}aT=new WeakSet,LM=function(t,i,s,l,d,u,p,m,y,_){if(y<=0||y>=1)return;const E=1-y,C=y*y,x=C*y,N=E*(E*(E*t+3*y*i)+3*C*s)+x*l,O=E*(E*(E*d+3*y*u)+3*C*p)+x*m;_[0]=Math.min(_[0],N),_[1]=Math.min(_[1],O),_[2]=Math.max(_[2],N),_[3]=Math.max(_[3],O)},zN=new WeakSet,XY=function(t,i,s,l,d,u,p,m,y,_,E,C){if(Math.abs(y)<1e-12){Math.abs(_)>=1e-12&&fe(this,aT,LM).call(this,t,i,s,l,d,u,p,m,-E/_,C);return}const x=_**2-4*E*y;if(x<0)return;const N=Math.sqrt(x),O=2*y;fe(this,aT,LM).call(this,t,i,s,l,d,u,p,m,(-_+N)/O,C),fe(this,aT,LM).call(this,t,i,s,l,d,u,p,m,(-_-N)/O,C)},J(In,aT),J(In,zN);function VQe(n){return decodeURIComponent(escape(n))}let kK=null,Kfe=null;function zQe(n){return kK||(kK=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Kfe=new Map([["ſt","ſt"]])),n.replaceAll(kK,(t,i,s)=>i?i.normalize("NFKC"):Kfe.get(s))}function JEe(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=new Uint8Array(32);return crypto.getRandomValues(n),XEe(n)}const jZ="pdfjs_internal_id_";function HQe(n,t,i){if(!Array.isArray(i)||i.length<2)return!1;const[s,l,...d]=i;if(!n(s)&&!Number.isInteger(s)||!t(l))return!1;const u=d.length;let p=!0;switch(l.name){case"XYZ":if(u<2||u>3)return!1;break;case"Fit":case"FitB":return u===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(u>1)return!1;break;case"FitR":if(u!==4)return!1;p=!1;break;default:return!1}for(const m of d)if(!(typeof m=="number"||p&&m===null))return!1;return!0}function ac(n,t,i){return Math.min(Math.max(n,t),i)}function QEe(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(XEe(n))}function GQe(n){return Uint8Array.fromBase64?Uint8Array.fromBase64(n):AP(atob(n))}typeof Promise.try!="function"&&(Promise.try=function(n,...t){return new Promise(i=>{i(n(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(n){return n.reduce((t,i)=>t+i,0)});const Um="http://www.w3.org/2000/svg",$_=class $_{};sn($_,"CSS",96),sn($_,"PDF",72),sn($_,"PDF_TO_CSS_UNITS",$_.CSS/$_.PDF);let ey=$_;async function IP(n,t="text"){if(a4(n,document.baseURI)){const i=await fetch(n);if(!i.ok)throw new Error(i.statusText);switch(t){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,s)=>{const l=new XMLHttpRequest;l.open("GET",n,!0),l.responseType=t,l.onreadystatechange=()=>{if(l.readyState===XMLHttpRequest.DONE){if(l.status===200||l.status===0){switch(t){case"arraybuffer":case"blob":case"json":i(l.response);return}i(l.responseText);return}s(new Error(l.statusText))}},l.send(null)})}class NP{constructor({viewBox:t,userUnit:i,scale:s,rotation:l,offsetX:d=0,offsetY:u=0,dontFlip:p=!1}){this.viewBox=t,this.userUnit=i,this.scale=s,this.rotation=l,this.offsetX=d,this.offsetY=u,s*=i;const m=(t[2]+t[0])/2,y=(t[3]+t[1])/2;let _,E,C,x;switch(l%=360,l<0&&(l+=360),l){case 180:_=-1,E=0,C=0,x=1;break;case 90:_=0,E=1,C=1,x=0;break;case 270:_=0,E=-1,C=-1,x=0;break;case 0:_=1,E=0,C=0,x=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}p&&(C=-C,x=-x);let N,O,D,P;_===0?(N=Math.abs(y-t[1])*s+d,O=Math.abs(m-t[0])*s+u,D=(t[3]-t[1])*s,P=(t[2]-t[0])*s):(N=Math.abs(m-t[0])*s+d,O=Math.abs(y-t[1])*s+u,D=(t[2]-t[0])*s,P=(t[3]-t[1])*s),this.transform=[_*s,E*s,C*s,x*s,N-_*s*m-C*s*y,O-E*s*m-x*s*y],this.width=D,this.height=P}get rawDims(){const t=this.viewBox;return Ki(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:i=this.rotation,offsetX:s=this.offsetX,offsetY:l=this.offsetY,dontFlip:d=!1}={}){return new NP({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:i,offsetX:s,offsetY:l,dontFlip:d})}convertToViewportPoint(t,i){const s=[t,i];return In.applyTransform(s,this.transform),s}convertToViewportRectangle(t){const i=[t[0],t[1]];In.applyTransform(i,this.transform);const s=[t[2],t[3]];return In.applyTransform(s,this.transform),[i[0],i[1],s[0],s[1]]}convertToPdfPoint(t,i){const s=[t,i];return In.applyInverseTransform(s,this.transform),s}}class UZ extends vw{constructor(t,i=0){super(t,"RenderingCancelledException"),this.extraDelay=i}}function TF(n){const t=n.length;let i=0;for(;i<t&&n[i].trim()==="";)i++;return n.substring(i,i+5).toLowerCase()==="data:"}function FZ(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function WQe(n){return[n]=n.split(/[#?]/,1),n.substring(n.lastIndexOf("/")+1)}function $Qe(n,t="document.pdf"){if(typeof n!="string")return t;if(TF(n))return Ei('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const s=(p=>{try{return new URL(p)}catch{try{return new URL(decodeURIComponent(p))}catch{try{return new URL(p,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(p),"https://foo.bar")}catch{return null}}}}})(n);if(!s)return t;const l=p=>{try{let m=decodeURIComponent(p);return m.includes("/")?(m=m.split("/").at(-1),m.test(/^\.pdf$/i)?m:p):m}catch{return p}},d=/\.pdf$/i,u=s.pathname.split("/").at(-1);if(d.test(u))return l(u);if(s.searchParams.size>0){const p=Array.from(s.searchParams.values()).reverse();for(const y of p)if(d.test(y))return l(y);const m=Array.from(s.searchParams.keys()).reverse();for(const y of m)if(d.test(y))return l(y)}if(s.hash){const m=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(m)return l(m[0])}return t}class qfe{constructor(){sn(this,"started",Object.create(null));sn(this,"times",[])}time(t){t in this.started&&Ei(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Ei(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let i=0;for(const{name:s}of this.times)i=Math.max(s.length,i);for(const{name:s,start:l,end:d}of this.times)t.push(`${s.padEnd(i)} ${d-l}ms
`);return t.join("")}}function a4(n,t){const i=t?URL.parse(n,t):URL.parse(n);return(i==null?void 0:i.protocol)==="http:"||(i==null?void 0:i.protocol)==="https:"}function fh(n){n.preventDefault()}function Oa(n){n.preventDefault(),n.stopPropagation()}function KQe(n){console.log("Deprecated API usage: "+n)}var HN;class i9{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;b(this,HN)||te(this,HN,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const i=b(this,HN).exec(t);if(!i)return null;const s=parseInt(i[1],10);let l=parseInt(i[2],10);l=l>=1&&l<=12?l-1:0;let d=parseInt(i[3],10);d=d>=1&&d<=31?d:1;let u=parseInt(i[4],10);u=u>=0&&u<=23?u:0;let p=parseInt(i[5],10);p=p>=0&&p<=59?p:0;let m=parseInt(i[6],10);m=m>=0&&m<=59?m:0;const y=i[7]||"Z";let _=parseInt(i[8],10);_=_>=0&&_<=23?_:0;let E=parseInt(i[9],10)||0;return E=E>=0&&E<=59?E:0,y==="-"?(u+=_,p+=E):y==="+"&&(u-=_,p-=E),new Date(Date.UTC(s,l,d,u,p,m))}}HN=new WeakMap,J(i9,HN,void 0);function qQe(n,{scale:t=1,rotation:i=0}){const{width:s,height:l}=n.attributes.style,d=[0,0,parseInt(s),parseInt(l)];return new NP({viewBox:d,userUnit:1,scale:t,rotation:i})}function RF(n){if(n.startsWith("#")){const t=parseInt(n.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(t=>parseInt(t)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Ei(`Not a valid color format: "${n}"`),[0,0,0])}function YQe(n){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const i of n.keys()){t.style.color=i;const s=window.getComputedStyle(t).color;n.set(i,RF(s))}t.remove()}function Hs(n){const{a:t,b:i,c:s,d:l,e:d,f:u}=n.getTransform();return[t,i,s,l,d,u]}function sp(n){const{a:t,b:i,c:s,d:l,e:d,f:u}=n.getTransform().invertSelf();return[t,i,s,l,d,u]}function X2(n,t,i=!1,s=!0){if(t instanceof NP){const{pageWidth:l,pageHeight:d}=t.rawDims,{style:u}=n,p=Zo.isCSSRoundSupported,m=`var(--total-scale-factor) * ${l}px`,y=`var(--total-scale-factor) * ${d}px`,_=p?`round(down, ${m}, var(--scale-round-x))`:`calc(${m})`,E=p?`round(down, ${y}, var(--scale-round-y))`:`calc(${y})`;!i||t.rotation%180===0?(u.width=_,u.height=E):(u.width=E,u.height=_)}s&&n.setAttribute("data-main-rotation",t.rotation)}class Kp{constructor(){const{pixelRatio:t}=Kp;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,i,s,l,d=-1){let u=1/0,p=1/0,m=1/0;s=Kp.capPixels(s,d),s>0&&(u=Math.sqrt(s/(t*i))),l!==-1&&(p=l/t,m=l/i);const y=Math.min(u,p,m);return this.sx>y||this.sy>y?(this.sx=y,this.sy=y,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,i){if(i>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+i/100));return t>0?Math.min(t,s):s}return t}}const JY=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var P1,L1,qu,qm,GN,oT,lT,WN,y9,ZEe,_9,e2e,E9,t2e,D1,uC,dE,o4;const Hm=class Hm{constructor(t){J(this,_9);J(this,E9);J(this,D1);J(this,dE);J(this,P1,null);J(this,L1,null);J(this,qu,void 0);J(this,qm,null);J(this,GN,null);J(this,oT,null);J(this,lT,null);te(this,qu,t),b(Hm,WN)||te(Hm,WN,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const t=te(this,P1,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const i=b(this,qu)._uiManager._signal;i instanceof AbortSignal&&!i.aborted&&(t.addEventListener("contextmenu",fh,{signal:i}),t.addEventListener("pointerdown",fe(Hm,y9,ZEe),{signal:i}));const s=te(this,qm,document.createElement("div"));s.className="buttons",t.append(s);const l=b(this,qu).toolbarPosition;if(l){const{style:d}=t,u=b(this,qu)._uiManager.direction==="ltr"?1-l[0]:l[0];d.insetInlineEnd=`${100*u}%`,d.top=`calc(${100*l[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return b(this,P1)}hide(){var t;b(this,P1).classList.add("hidden"),(t=b(this,L1))==null||t.hideDropdown()}show(){var t,i;b(this,P1).classList.remove("hidden"),(t=b(this,GN))==null||t.shown(),(i=b(this,oT))==null||i.shown()}addDeleteButton(){const{editorType:t,_uiManager:i}=b(this,qu),s=document.createElement("button");s.classList.add("basic","deleteButton"),s.tabIndex=0,s.setAttribute("data-l10n-id",b(Hm,WN)[t]),fe(this,D1,uC).call(this,s)&&s.addEventListener("click",l=>{i.delete()},{signal:i._signal}),b(this,qm).append(s)}async addAltText(t){const i=await t.render();fe(this,D1,uC).call(this,i),b(this,qm).append(i,b(this,dE,o4)),te(this,GN,t)}addComment(t){if(b(this,oT))return;const i=t.render();i&&(fe(this,D1,uC).call(this,i),b(this,qm).append(i,b(this,dE,o4)),te(this,oT,t),t.toolbar=this)}addColorPicker(t){if(b(this,L1))return;te(this,L1,t);const i=t.renderButton();fe(this,D1,uC).call(this,i),b(this,qm).append(i,b(this,dE,o4))}async addEditSignatureButton(t){const i=te(this,lT,await t.renderEditButton(b(this,qu)));fe(this,D1,uC).call(this,i),b(this,qm).append(i,b(this,dE,o4))}async addButton(t,i){switch(t){case"colorPicker":this.addColorPicker(i);break;case"altText":await this.addAltText(i);break;case"editSignature":await this.addEditSignatureButton(i);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(i);break}}updateEditSignatureButton(t){b(this,lT)&&(b(this,lT).title=t)}remove(){var t;b(this,P1).remove(),(t=b(this,L1))==null||t.destroy(),te(this,L1,null)}};P1=new WeakMap,L1=new WeakMap,qu=new WeakMap,qm=new WeakMap,GN=new WeakMap,oT=new WeakMap,lT=new WeakMap,WN=new WeakMap,y9=new WeakSet,ZEe=function(t){t.stopPropagation()},_9=new WeakSet,e2e=function(t){b(this,qu)._focusEventsAllowed=!1,Oa(t)},E9=new WeakSet,t2e=function(t){b(this,qu)._focusEventsAllowed=!0,Oa(t)},D1=new WeakSet,uC=function(t){const i=b(this,qu)._uiManager._signal;return!(i instanceof AbortSignal)||i.aborted?!1:(t.addEventListener("focusin",fe(this,_9,e2e).bind(this),{capture:!0,signal:i}),t.addEventListener("focusout",fe(this,E9,t2e).bind(this),{capture:!0,signal:i}),t.addEventListener("contextmenu",fh,{signal:i}),!0)},dE=new WeakSet,o4=function(){const t=document.createElement("div");return t.className="divider",t},J(Hm,y9),J(Hm,WN,null);let QY=Hm;var $N,uE,Ym,w9,n2e,S9,i2e,KN,ZY;class XQe{constructor(t){J(this,w9);J(this,S9);J(this,KN);J(this,$N,null);J(this,uE,null);J(this,Ym,void 0);te(this,Ym,t)}show(t,i,s){const[l,d]=fe(this,S9,i2e).call(this,i,s),{style:u}=b(this,uE)||te(this,uE,fe(this,w9,n2e).call(this));t.append(b(this,uE)),u.insetInlineEnd=`${100*l}%`,u.top=`calc(${100*d}% + var(--editor-toolbar-vert-offset))`}hide(){b(this,uE).remove()}}$N=new WeakMap,uE=new WeakMap,Ym=new WeakMap,w9=new WeakSet,n2e=function(){const t=te(this,uE,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const i=b(this,Ym)._signal;i instanceof AbortSignal&&!i.aborted&&t.addEventListener("contextmenu",fh,{signal:i});const s=te(this,$N,document.createElement("div"));return s.className="buttons",t.append(s),b(this,Ym).hasCommentManager()&&fe(this,KN,ZY).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{b(this,Ym).commentSelection("floating_button")}),fe(this,KN,ZY).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{b(this,Ym).highlightSelection("floating_button")}),t},S9=new WeakSet,i2e=function(t,i){let s=0,l=0;for(const d of t){const u=d.y+d.height;if(u<s)continue;const p=d.x+(i?d.width:0);if(u>s){l=p,s=u;continue}i?p>l&&(l=p):p<l&&(l=p)}return[i?1-l:l,s]},KN=new WeakSet,ZY=function(t,i,s,l){const d=document.createElement("button");d.classList.add("basic",t),d.tabIndex=0,d.setAttribute("data-l10n-id",i);const u=document.createElement("span");d.append(u),u.className="visuallyHidden",u.setAttribute("data-l10n-id",s);const p=b(this,Ym)._signal;p instanceof AbortSignal&&!p.aborted&&(d.addEventListener("contextmenu",fh,{signal:p}),d.addEventListener("click",l,{signal:p})),b(this,$N).append(d)};function r2e(n,t,i){for(const s of i)t.addEventListener(s,n[s].bind(n))}var b9;class JQe{constructor(){J(this,b9,0)}get id(){return`${KEe}${ea(this,b9)._++}`}}b9=new WeakMap;var cT,qN,yl,dT,DM;const Tee=class Tee{constructor(){J(this,dT);J(this,cT,JEe());J(this,qN,0);J(this,yl,null)}static get _isSVGFittingCanvas(){const t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',s=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),l=new Image;l.src=t;const d=l.decode().then(()=>(s.drawImage(l,0,0,1,1,0,0,1,3),new Uint32Array(s.getImageData(0,0,1,1).data.buffer)[0]===0));return Ki(this,"_isSVGFittingCanvas",d)}async getFromFile(t){const{lastModified:i,name:s,size:l,type:d}=t;return fe(this,dT,DM).call(this,`${i}_${s}_${l}_${d}`,t)}async getFromUrl(t){return fe(this,dT,DM).call(this,t,t)}async getFromBlob(t,i){const s=await i;return fe(this,dT,DM).call(this,t,s)}async getFromId(t){b(this,yl)||te(this,yl,new Map);const i=b(this,yl).get(t);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:s}=i;return delete i.blobPromise,this.getFromBlob(i.id,s)}return this.getFromUrl(i.url)}getFromCanvas(t,i){b(this,yl)||te(this,yl,new Map);let s=b(this,yl).get(t);if(s!=null&&s.bitmap)return s.refCounter+=1,s;const l=new OffscreenCanvas(i.width,i.height);return l.getContext("2d").drawImage(i,0,0),s={bitmap:l.transferToImageBitmap(),id:`image_${b(this,cT)}_${ea(this,qN)._++}`,refCounter:1,isSvg:!1},b(this,yl).set(t,s),b(this,yl).set(s.id,s),s}getSvgUrl(t){const i=b(this,yl).get(t);return i!=null&&i.isSvg?i.svgUrl:null}deleteId(t){var l;b(this,yl)||te(this,yl,new Map);const i=b(this,yl).get(t);if(!i||(i.refCounter-=1,i.refCounter!==0))return;const{bitmap:s}=i;if(!i.url&&!i.file){const d=new OffscreenCanvas(s.width,s.height);d.getContext("bitmaprenderer").transferFromImageBitmap(s),i.blobPromise=d.convertToBlob()}(l=s.close)==null||l.call(s),i.bitmap=null}isValidId(t){return t.startsWith(`image_${b(this,cT)}_`)}};cT=new WeakMap,qN=new WeakMap,yl=new WeakMap,dT=new WeakSet,DM=async function(t,i){b(this,yl)||te(this,yl,new Map);let s=b(this,yl).get(t);if(s===null)return null;if(s!=null&&s.bitmap)return s.refCounter+=1,s;try{s||(s={bitmap:null,id:`image_${b(this,cT)}_${ea(this,qN)._++}`,refCounter:0,isSvg:!1});let l;if(typeof i=="string"?(s.url=i,l=await IP(i,"blob")):i instanceof File?l=s.file=i:i instanceof Blob&&(l=i),l.type==="image/svg+xml"){const d=Tee._isSVGFittingCanvas,u=new FileReader,p=new Image,m=new Promise((y,_)=>{p.onload=()=>{s.bitmap=p,s.isSvg=!0,y()},u.onload=async()=>{const E=s.svgUrl=u.result;p.src=await d?`${E}#svgView(preserveAspectRatio(none))`:E},p.onerror=u.onerror=_});u.readAsDataURL(l),await m}else s.bitmap=await createImageBitmap(l);s.refCounter=1}catch(l){Ei(l),s=null}return b(this,yl).set(t,s),s&&b(this,yl).set(s.id,s),s};let eX=Tee;var ga,k1,YN,Vs;class QQe{constructor(t=128){J(this,ga,[]);J(this,k1,!1);J(this,YN,void 0);J(this,Vs,-1);te(this,YN,t)}add({cmd:t,undo:i,post:s,mustExec:l,type:d=NaN,overwriteIfSameType:u=!1,keepUndo:p=!1}){if(l&&t(),b(this,k1))return;const m={cmd:t,undo:i,post:s,type:d};if(b(this,Vs)===-1){b(this,ga).length>0&&(b(this,ga).length=0),te(this,Vs,0),b(this,ga).push(m);return}if(u&&b(this,ga)[b(this,Vs)].type===d){p&&(m.undo=b(this,ga)[b(this,Vs)].undo),b(this,ga)[b(this,Vs)]=m;return}const y=b(this,Vs)+1;y===b(this,YN)?b(this,ga).splice(0,1):(te(this,Vs,y),y<b(this,ga).length&&b(this,ga).splice(y)),b(this,ga).push(m)}undo(){if(b(this,Vs)===-1)return;te(this,k1,!0);const{undo:t,post:i}=b(this,ga)[b(this,Vs)];t(),i==null||i(),te(this,k1,!1),te(this,Vs,b(this,Vs)-1)}redo(){if(b(this,Vs)<b(this,ga).length-1){te(this,Vs,b(this,Vs)+1),te(this,k1,!0);const{cmd:t,post:i}=b(this,ga)[b(this,Vs)];t(),i==null||i(),te(this,k1,!1)}}hasSomethingToUndo(){return b(this,Vs)!==-1}hasSomethingToRedo(){return b(this,Vs)<b(this,ga).length-1}cleanType(t){if(b(this,Vs)!==-1){for(let i=b(this,Vs);i>=0;i--)if(b(this,ga)[i].type!==t){b(this,ga).splice(i+1,b(this,Vs)-i),te(this,Vs,i);return}b(this,ga).length=0,te(this,Vs,-1)}}destroy(){te(this,ga,null)}}ga=new WeakMap,k1=new WeakMap,YN=new WeakMap,Vs=new WeakMap;var C9,s2e;class OP{constructor(t){J(this,C9);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=Zo.platform;for(const[s,l,d={}]of t)for(const u of s){const p=u.startsWith("mac+");i&&p?(this.callbacks.set(u.slice(4),{callback:l,options:d}),this.allKeys.add(u.split("+").at(-1))):!i&&!p&&(this.callbacks.set(u,{callback:l,options:d}),this.allKeys.add(u.split("+").at(-1)))}}exec(t,i){if(!this.allKeys.has(i.key))return;const s=this.callbacks.get(fe(this,C9,s2e).call(this,i));if(!s)return;const{callback:l,options:{bubbles:d=!1,args:u=[],checker:p=null}}=s;p&&!p(t,i)||(l.bind(t,...u,i)(),d||Oa(i))}}C9=new WeakSet,s2e=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const i=this.buffer.join("+");return this.buffer.length=0,i};const T9=class T9{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return YQe(t),Ki(this,"_colors",t)}convert(t){const i=RF(t);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[s,l]of this._colors)if(l.every((d,u)=>d===i[u]))return T9._colorsMapping.get(s);return i}getHexCode(t){const i=this._colors.get(t);return i?In.makeHexColor(...i):t}};sn(T9,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let tX=T9;var uT,Ad,hT,Ga,Bo,fT,Xm,pT,Yu,Jm,M1,j1,mT,hE,vp,Xu,fE,XN,JN,gT,QN,yp,U1,vT,F1,_p,R9,B1,yT,ZN,V1,pE,_T,z1,e5,Wa,Br,Qm,H1,G1,t5,ET,n5,W1,Ep,Zm,i5,r5,Ju,wT,kM,s5,nX,x9,a2e,A9,o2e,mE,l4,I9,l2e,N9,c2e,O9,d2e,a5,iX,P9,u2e,o5,rX,l5,sX,L9,h2e,Vo,Jl,Qh,Fm,D9,f2e,k9,p2e,c5,aX,M9,m2e,gE,c4,d5,oX;const kC=class kC{constructor(t,i,s,l,d,u,p,m,y,_,E,C,x,N,O,D){J(this,wT);J(this,s5);J(this,x9);J(this,A9);J(this,mE);J(this,I9);J(this,N9);J(this,O9);J(this,a5);J(this,P9);J(this,o5);J(this,l5);J(this,L9);J(this,Vo);J(this,Qh);J(this,D9);J(this,k9);J(this,c5);J(this,M9);J(this,gE);J(this,d5);J(this,uT,new AbortController);J(this,Ad,null);J(this,hT,null);J(this,Ga,new Map);J(this,Bo,new Map);J(this,fT,null);J(this,Xm,null);J(this,pT,null);J(this,Yu,new QQe);J(this,Jm,null);J(this,M1,null);J(this,j1,null);J(this,mT,0);J(this,hE,new Set);J(this,vp,null);J(this,Xu,null);J(this,fE,new Set);sn(this,"_editorUndoBar",null);J(this,XN,!1);J(this,JN,!1);J(this,gT,!1);J(this,QN,null);J(this,yp,null);J(this,U1,null);J(this,vT,null);J(this,F1,!1);J(this,_p,null);J(this,R9,new JQe);J(this,B1,!1);J(this,yT,!1);J(this,ZN,!1);J(this,V1,null);J(this,pE,null);J(this,_T,null);J(this,z1,null);J(this,e5,null);J(this,Wa,fi.NONE);J(this,Br,new Set);J(this,Qm,null);J(this,H1,null);J(this,G1,null);J(this,t5,null);J(this,ET,null);J(this,n5,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});J(this,W1,[0,0]);J(this,Ep,null);J(this,Zm,null);J(this,i5,null);J(this,r5,null);J(this,Ju,null);const P=this._signal=b(this,uT).signal;te(this,Zm,t),te(this,i5,i),te(this,r5,s),te(this,fT,l),te(this,Jm,d),te(this,H1,u),te(this,ET,m),this._eventBus=p,p._on("editingaction",this.onEditingAction.bind(this),{signal:P}),p._on("pagechanging",this.onPageChanging.bind(this),{signal:P}),p._on("scalechanging",this.onScaleChanging.bind(this),{signal:P}),p._on("rotationchanging",this.onRotationChanging.bind(this),{signal:P}),p._on("setpreference",this.onSetPreference.bind(this),{signal:P}),p._on("switchannotationeditorparams",j=>this.updateParams(j.type,j.value),{signal:P}),window.addEventListener("pointerdown",()=>{te(this,yT,!0)},{capture:!0,signal:P}),window.addEventListener("pointerup",()=>{te(this,yT,!1)},{capture:!0,signal:P}),fe(this,I9,l2e).call(this),fe(this,L9,h2e).call(this),fe(this,a5,iX).call(this),te(this,Xm,m.annotationStorage),te(this,QN,m.filterFactory),te(this,G1,y),te(this,vT,_||null),te(this,XN,E),te(this,JN,C),te(this,gT,x),te(this,e5,N||null),this.viewParameters={realScale:ey.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=O||null,this._supportsPinchToZoom=D!==!1}static get _keyboardManager(){const t=kC.prototype,i=u=>b(u,Zm).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&u.hasSomethingToControl(),s=(u,{target:p})=>{if(p instanceof HTMLInputElement){const{type:m}=p;return m!=="text"&&m!=="number"}return!0},l=this.TRANSLATE_SMALL,d=this.TRANSLATE_BIG;return Ki(this,"_keyboardManager",new OP([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:s}],[["ctrl+z","mac+meta+z"],t.undo,{checker:s}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:s}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:s}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(u,{target:p})=>!(p instanceof HTMLButtonElement)&&b(u,Zm).contains(p)&&!u.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(u,{target:p})=>!(p instanceof HTMLButtonElement)&&b(u,Zm).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-d,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[d,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-d],checker:i}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,d],checker:i}]]))}destroy(){var t,i,s,l,d,u,p,m,y;(t=b(this,Ju))==null||t.resolve(),te(this,Ju,null),(i=b(this,uT))==null||i.abort(),te(this,uT,null),this._signal=null;for(const _ of b(this,Bo).values())_.destroy();b(this,Bo).clear(),b(this,Ga).clear(),b(this,fE).clear(),(s=b(this,z1))==null||s.clear(),te(this,Ad,null),b(this,Br).clear(),b(this,Yu).destroy(),(l=b(this,fT))==null||l.destroy(),(d=b(this,Jm))==null||d.destroy(),(u=b(this,H1))==null||u.destroy(),(p=b(this,_p))==null||p.hide(),te(this,_p,null),(m=b(this,_T))==null||m.destroy(),te(this,_T,null),te(this,hT,null),b(this,yp)&&(clearTimeout(b(this,yp)),te(this,yp,null)),b(this,Ep)&&(clearTimeout(b(this,Ep)),te(this,Ep,null)),(y=this._editorUndoBar)==null||y.destroy(),te(this,ET,null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return b(this,e5)}get useNewAltTextFlow(){return b(this,JN)}get useNewAltTextWhenAddingImage(){return b(this,gT)}get hcmFilter(){return Ki(this,"hcmFilter",b(this,G1)?b(this,QN).addHCMFilter(b(this,G1).foreground,b(this,G1).background):"none")}get direction(){return Ki(this,"direction",getComputedStyle(b(this,Zm)).direction)}get _highlightColors(){return Ki(this,"_highlightColors",b(this,vT)?new Map(b(this,vT).split(",").map(t=>(t=t.split("=").map(i=>i.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return Ki(this,"highlightColors",null);const i=new Map,s=!!b(this,G1);for(const[l,d]of t){const u=l.endsWith("_HCM");if(s&&u){i.set(l.replace("_HCM",""),d);continue}!s&&!u&&i.set(l,d)}return Ki(this,"highlightColors",i)}get highlightColorNames(){return Ki(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const i=this.highlightColorNames.get(t);return this._highlightColors.get(i)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),te(this,j1,t)}setMainHighlightColorPicker(t){te(this,_T,t)}editAltText(t,i=!1){var s;(s=b(this,fT))==null||s.editAltText(this,t,i)}hasCommentManager(){return!!b(this,Jm)}editComment(t,i){var s;(s=b(this,Jm))==null||s.open(this,t,i)}getSignature(t){var i;(i=b(this,H1))==null||i.getSignature({uiManager:this,editor:t})}get signatureManager(){return b(this,H1)}switchToMode(t,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,i){this._eventBus.dispatch("setpreference",{source:this,name:t,value:i})}onSetPreference({name:t,value:i}){switch(t){case"enableNewAltTextWhenAddingImage":te(this,gT,i);break}}onPageChanging({pageNumber:t}){te(this,mT,t-1)}focusMainContainer(){b(this,Zm).focus()}findParent(t,i){for(const s of b(this,Bo).values()){const{x:l,y:d,width:u,height:p}=s.div.getBoundingClientRect();if(t>=l&&t<=l+u&&i>=d&&i<=d+p)return s}return null}disableUserSelect(t=!1){b(this,i5).classList.toggle("noUserSelect",t)}addShouldRescale(t){b(this,fE).add(t)}removeShouldRescale(t){b(this,fE).delete(t)}onScaleChanging({scale:t}){var i;this.commitOrRemove(),this.viewParameters.realScale=t*ey.PDF_TO_CSS_UNITS;for(const s of b(this,fE))s.onScaleChanging();(i=b(this,j1))==null||i.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t="",i=!1){const s=document.getSelection();if(!s||s.isCollapsed)return;const{anchorNode:l,anchorOffset:d,focusNode:u,focusOffset:p}=s,m=s.toString(),_=fe(this,wT,kM).call(this,s).closest(".textLayer"),E=this.getSelectionBoxes(_);if(!E)return;s.empty();const C=fe(this,s5,nX).call(this,_),x=b(this,Wa)===fi.NONE,N=()=>{const O=C==null?void 0:C.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:E,anchorNode:l,anchorOffset:d,focusNode:u,focusOffset:p,text:m});x&&this.showAllEditors("highlight",!0,!0),i&&(O==null||O.editComment())};if(x){this.switchToMode(fi.HIGHLIGHT,N);return}N()}commentSelection(t=""){this.highlightSelection(t,!0)}addToAnnotationStorage(t){!t.isEmpty()&&b(this,Xm)&&!b(this,Xm).has(t.id)&&b(this,Xm).setValue(t.id,t)}a11yAlert(t,i=null){const s=b(this,r5);s&&(s.setAttribute("data-l10n-id",t),i?s.setAttribute("data-l10n-args",JSON.stringify(i)):s.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,b(this,F1)&&(te(this,F1,!1),fe(this,mE,l4).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const i of b(this,Br))if(i.div.contains(t)){te(this,pE,[i,t]),i._focusEventsAllowed=!1;break}}focus(){if(!b(this,pE))return;const[t,i]=b(this,pE);te(this,pE,null),i.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}addEditListeners(){fe(this,a5,iX).call(this),fe(this,o5,rX).call(this)}removeEditListeners(){fe(this,P9,u2e).call(this),fe(this,l5,sX).call(this)}dragOver(t){for(const{type:i}of t.dataTransfer.items)for(const s of b(this,Xu))if(s.isHandlingMimeForPasting(i)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const i of t.dataTransfer.items)for(const s of b(this,Xu))if(s.isHandlingMimeForPasting(i.type)){s.paste(i,this.currentLayer),t.preventDefault();return}}copy(t){var s;if(t.preventDefault(),(s=b(this,Ad))==null||s.commitOrRemove(),!this.hasSelection)return;const i=[];for(const l of b(this,Br)){const d=l.serialize(!0);d&&i.push(d)}i.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:i}=t;for(const d of i.items)for(const u of b(this,Xu))if(u.isHandlingMimeForPasting(d.type)){u.paste(d,this.currentLayer);return}let s=i.getData("application/pdfjs");if(!s)return;try{s=JSON.parse(s)}catch(d){Ei(`paste: "${d.message}".`);return}if(!Array.isArray(s))return;this.unselectAll();const l=this.currentLayer;try{const d=[];for(const m of s){const y=await l.deserialize(m);if(!y)return;d.push(y)}const u=()=>{for(const m of d)fe(this,c5,aX).call(this,m);fe(this,d5,oX).call(this,d)},p=()=>{for(const m of d)m.remove()};this.addCommands({cmd:u,undo:p,mustExec:!0})}catch(d){Ei(`paste: "${d.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),b(this,Wa)!==fi.NONE&&!this.isEditorHandlingKeyboard&&kC._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,b(this,F1)&&(te(this,F1,!1),fe(this,mE,l4).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(t){t?(fe(this,N9,c2e).call(this),fe(this,o5,rX).call(this),fe(this,Vo,Jl).call(this,{isEditing:b(this,Wa)!==fi.NONE,isEmpty:fe(this,gE,c4).call(this),hasSomethingToUndo:b(this,Yu).hasSomethingToUndo(),hasSomethingToRedo:b(this,Yu).hasSomethingToRedo(),hasSelectedEditor:!1})):(fe(this,O9,d2e).call(this),fe(this,l5,sX).call(this),fe(this,Vo,Jl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!b(this,Xu)){te(this,Xu,t);for(const i of b(this,Xu))fe(this,Qh,Fm).call(this,i.defaultPropertiesToUpdate)}}getId(){return b(this,R9).id}get currentLayer(){return b(this,Bo).get(b(this,mT))}getLayer(t){return b(this,Bo).get(t)}get currentPageIndex(){return b(this,mT)}addLayer(t){b(this,Bo).set(t.pageIndex,t),b(this,B1)?t.enable():t.disable()}removeLayer(t){b(this,Bo).delete(t.pageIndex)}async updateMode(t,i=null,s=!1,l=!1,d=!1){var u,p,m,y,_;if(b(this,Wa)!==t&&!(b(this,Ju)&&(await b(this,Ju).promise,!b(this,Ju)))){if(te(this,Ju,Promise.withResolvers()),(u=b(this,j1))==null||u.commitOrRemove(),b(this,Wa)===fi.POPUP&&((p=b(this,Jm))==null||p.hideSidebar()),te(this,Wa,t),t===fi.NONE){this.setEditingState(!1),fe(this,k9,p2e).call(this),(m=this._editorUndoBar)==null||m.hide(),b(this,Ju).resolve();return}t===fi.SIGNATURE&&await((y=b(this,H1))==null?void 0:y.loadSignatures()),t===fi.POPUP&&(b(this,hT)||te(this,hT,await b(this,ET).getAnnotationsByType(new Set(b(this,Xu).map(E=>E._editorType)))),(_=b(this,Jm))==null||_.showSidebar(b(this,hT))),this.setEditingState(!0),await fe(this,D9,f2e).call(this),this.unselectAll();for(const E of b(this,Bo).values())E.updateMode(t);if(!i){s&&this.addNewEditorFromKeyboard(),b(this,Ju).resolve();return}for(const E of b(this,Ga).values())E.annotationElementId===i||E.id===i?(this.setSelected(E),d?E.editComment():l&&E.enterInEditMode()):E.unselect();b(this,Ju).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==b(this,Wa)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,i){if(b(this,Xu)){switch(t){case cr.CREATE:this.currentLayer.addNewEditor(i);return;case cr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(b(this,t5)||te(this,t5,new Map)).set(t,i),this.showAllEditors("highlight",i);break}if(this.hasSelection)for(const s of b(this,Br))s.updateParams(t,i);else for(const s of b(this,Xu))s.updateDefaultParams(t,i)}}showAllEditors(t,i,s=!1){var d;for(const u of b(this,Ga).values())u.editorType===t&&u.show(i);(((d=b(this,t5))==null?void 0:d.get(cr.HIGHLIGHT_SHOW_ALL))??!0)!==i&&fe(this,Qh,Fm).call(this,[[cr.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(t=!1){if(b(this,ZN)!==t){te(this,ZN,t);for(const i of b(this,Bo).values())t?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",t)}}getEditors(t){const i=[];for(const s of b(this,Ga).values())s.pageIndex===t&&i.push(s);return i}getEditor(t){return b(this,Ga).get(t)}addEditor(t){b(this,Ga).set(t.id,t)}removeEditor(t){var i,s;t.div.contains(document.activeElement)&&(b(this,yp)&&clearTimeout(b(this,yp)),te(this,yp,setTimeout(()=>{this.focusMainContainer(),te(this,yp,null)},0))),b(this,Ga).delete(t.id),t.annotationElementId&&((i=b(this,z1))==null||i.delete(t.annotationElementId)),this.unselect(t),(!t.annotationElementId||!b(this,hE).has(t.annotationElementId))&&((s=b(this,Xm))==null||s.remove(t.id))}addDeletedAnnotationElement(t){b(this,hE).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return b(this,hE).has(t)}removeDeletedAnnotationElement(t){b(this,hE).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){b(this,Ad)!==t&&(te(this,Ad,t),t&&fe(this,Qh,Fm).call(this,t.propertiesToUpdate))}updateUI(t){b(this,M9,m2e)===t&&fe(this,Qh,Fm).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){fe(this,Qh,Fm).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(b(this,Br).has(t)){b(this,Br).delete(t),t.unselect(),fe(this,Vo,Jl).call(this,{hasSelectedEditor:this.hasSelection});return}b(this,Br).add(t),t.select(),fe(this,Qh,Fm).call(this,t.propertiesToUpdate),fe(this,Vo,Jl).call(this,{hasSelectedEditor:!0})}setSelected(t){var i;this.updateToolbar({mode:t.mode,editId:t.id}),(i=b(this,j1))==null||i.commitOrRemove();for(const s of b(this,Br))s!==t&&s.unselect();b(this,Br).clear(),b(this,Br).add(t),t.select(),fe(this,Qh,Fm).call(this,t.propertiesToUpdate),fe(this,Vo,Jl).call(this,{hasSelectedEditor:!0})}isSelected(t){return b(this,Br).has(t)}get firstSelectedEditor(){return b(this,Br).values().next().value}unselect(t){t.unselect(),b(this,Br).delete(t),fe(this,Vo,Jl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return b(this,Br).size!==0}get isEnterHandled(){return b(this,Br).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;b(this,Yu).undo(),fe(this,Vo,Jl).call(this,{hasSomethingToUndo:b(this,Yu).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:fe(this,gE,c4).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){b(this,Yu).redo(),fe(this,Vo,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:b(this,Yu).hasSomethingToRedo(),isEmpty:fe(this,gE,c4).call(this)})}addCommands(t){b(this,Yu).add(t),fe(this,Vo,Jl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:fe(this,gE,c4).call(this)})}cleanUndoStack(t){b(this,Yu).cleanType(t)}delete(){var d;this.commitOrRemove();const t=(d=this.currentLayer)==null?void 0:d.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const i=t?[t]:[...b(this,Br)],s=()=>{var u;(u=this._editorUndoBar)==null||u.show(l,i.length===1?i[0].editorType:i.length);for(const p of i)p.remove()},l=()=>{for(const u of i)fe(this,c5,aX).call(this,u)};this.addCommands({cmd:s,undo:l,mustExec:!0})}commitOrRemove(){var t;(t=b(this,Ad))==null||t.commitOrRemove()}hasSomethingToControl(){return b(this,Ad)||this.hasSelection}selectAll(){for(const t of b(this,Br))t.commit();fe(this,d5,oX).call(this,b(this,Ga).values())}unselectAll(){var t;if(!(b(this,Ad)&&(b(this,Ad).commitOrRemove(),b(this,Wa)!==fi.NONE))&&!((t=b(this,j1))!=null&&t.commitOrRemove())&&this.hasSelection){for(const i of b(this,Br))i.unselect();b(this,Br).clear(),fe(this,Vo,Jl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,i,s=!1){if(s||this.commitOrRemove(),!this.hasSelection)return;b(this,W1)[0]+=t,b(this,W1)[1]+=i;const[l,d]=b(this,W1),u=[...b(this,Br)],p=1e3;b(this,Ep)&&clearTimeout(b(this,Ep)),te(this,Ep,setTimeout(()=>{te(this,Ep,null),b(this,W1)[0]=b(this,W1)[1]=0,this.addCommands({cmd:()=>{for(const m of u)b(this,Ga).has(m.id)&&(m.translateInPage(l,d),m.translationDone())},undo:()=>{for(const m of u)b(this,Ga).has(m.id)&&(m.translateInPage(-l,-d),m.translationDone())},mustExec:!1})},p));for(const m of u)m.translateInPage(t,i),m.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),te(this,vp,new Map);for(const t of b(this,Br))b(this,vp).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!b(this,vp))return!1;this.disableUserSelect(!1);const t=b(this,vp);te(this,vp,null);let i=!1;for(const[{x:l,y:d,pageIndex:u},p]of t)p.newX=l,p.newY=d,p.newPageIndex=u,i||(i=l!==p.savedX||d!==p.savedY||u!==p.savedPageIndex);if(!i)return!1;const s=(l,d,u,p)=>{if(b(this,Ga).has(l.id)){const m=b(this,Bo).get(p);m?l._setParentAndPosition(m,d,u):(l.pageIndex=p,l.x=d,l.y=u)}};return this.addCommands({cmd:()=>{for(const[l,{newX:d,newY:u,newPageIndex:p}]of t)s(l,d,u,p)},undo:()=>{for(const[l,{savedX:d,savedY:u,savedPageIndex:p}]of t)s(l,d,u,p)},mustExec:!0}),!0}dragSelectedEditors(t,i){if(b(this,vp))for(const s of b(this,vp).keys())s.drag(t,i)}rebuild(t){if(t.parent===null){const i=this.getLayer(t.pageIndex);i?(i.changeParent(t),i.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return((t=this.getActive())==null?void 0:t.shouldGetKeyboardEvents())||b(this,Br).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return b(this,Ad)===t}getActive(){return b(this,Ad)}getMode(){return b(this,Wa)}get imageManager(){return Ki(this,"imageManager",new eX)}getSelectionBoxes(t){if(!t)return null;const i=document.getSelection();for(let y=0,_=i.rangeCount;y<_;y++)if(!t.contains(i.getRangeAt(y).commonAncestorContainer))return null;const{x:s,y:l,width:d,height:u}=t.getBoundingClientRect();let p;switch(t.getAttribute("data-main-rotation")){case"90":p=(y,_,E,C)=>({x:(_-l)/u,y:1-(y+E-s)/d,width:C/u,height:E/d});break;case"180":p=(y,_,E,C)=>({x:1-(y+E-s)/d,y:1-(_+C-l)/u,width:E/d,height:C/u});break;case"270":p=(y,_,E,C)=>({x:1-(_+C-l)/u,y:(y-s)/d,width:C/u,height:E/d});break;default:p=(y,_,E,C)=>({x:(y-s)/d,y:(_-l)/u,width:E/d,height:C/u});break}const m=[];for(let y=0,_=i.rangeCount;y<_;y++){const E=i.getRangeAt(y);if(!E.collapsed)for(const{x:C,y:x,width:N,height:O}of E.getClientRects())N===0||O===0||m.push(p(C,x,N,O))}return m.length===0?null:m}addChangedExistingAnnotation({annotationElementId:t,id:i}){(b(this,pT)||te(this,pT,new Map)).set(t,i)}removeChangedExistingAnnotation({annotationElementId:t}){var i;(i=b(this,pT))==null||i.delete(t)}renderAnnotationElement(t){var l;const i=(l=b(this,pT))==null?void 0:l.get(t.data.id);if(!i)return;const s=b(this,Xm).getRawValue(i);s&&(b(this,Wa)===fi.NONE&&!s.hasBeenModified||s.renderAnnotationElement(t))}setMissingCanvas(t,i,s){var d;const l=(d=b(this,z1))==null?void 0:d.get(t);l&&(l.setCanvas(i,s),b(this,z1).delete(t))}addMissingCanvas(t,i){(b(this,z1)||te(this,z1,new Map)).set(t,i)}};uT=new WeakMap,Ad=new WeakMap,hT=new WeakMap,Ga=new WeakMap,Bo=new WeakMap,fT=new WeakMap,Xm=new WeakMap,pT=new WeakMap,Yu=new WeakMap,Jm=new WeakMap,M1=new WeakMap,j1=new WeakMap,mT=new WeakMap,hE=new WeakMap,vp=new WeakMap,Xu=new WeakMap,fE=new WeakMap,XN=new WeakMap,JN=new WeakMap,gT=new WeakMap,QN=new WeakMap,yp=new WeakMap,U1=new WeakMap,vT=new WeakMap,F1=new WeakMap,_p=new WeakMap,R9=new WeakMap,B1=new WeakMap,yT=new WeakMap,ZN=new WeakMap,V1=new WeakMap,pE=new WeakMap,_T=new WeakMap,z1=new WeakMap,e5=new WeakMap,Wa=new WeakMap,Br=new WeakMap,Qm=new WeakMap,H1=new WeakMap,G1=new WeakMap,t5=new WeakMap,ET=new WeakMap,n5=new WeakMap,W1=new WeakMap,Ep=new WeakMap,Zm=new WeakMap,i5=new WeakMap,r5=new WeakMap,Ju=new WeakMap,wT=new WeakSet,kM=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},s5=new WeakSet,nX=function(t){const{currentLayer:i}=this;if(i.hasTextLayer(t))return i;for(const s of b(this,Bo).values())if(s.hasTextLayer(t))return s;return null},x9=new WeakSet,a2e=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const s=fe(this,wT,kM).call(this,t).closest(".textLayer"),l=this.getSelectionBoxes(s);l&&(b(this,_p)||te(this,_p,new XQe(this)),b(this,_p).show(s,l,this.direction==="ltr"))},A9=new WeakSet,o2e=function(){var d,u,p;const t=document.getSelection();if(!t||t.isCollapsed){b(this,Qm)&&((d=b(this,_p))==null||d.hide(),te(this,Qm,null),fe(this,Vo,Jl).call(this,{hasSelectedText:!1}));return}const{anchorNode:i}=t;if(i===b(this,Qm))return;const l=fe(this,wT,kM).call(this,t).closest(".textLayer");if(!l){b(this,Qm)&&((u=b(this,_p))==null||u.hide(),te(this,Qm,null),fe(this,Vo,Jl).call(this,{hasSelectedText:!1}));return}if((p=b(this,_p))==null||p.hide(),te(this,Qm,i),fe(this,Vo,Jl).call(this,{hasSelectedText:!0}),!(b(this,Wa)!==fi.HIGHLIGHT&&b(this,Wa)!==fi.NONE)&&(b(this,Wa)===fi.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),te(this,F1,this.isShiftKeyDown),!this.isShiftKeyDown)){const m=b(this,Wa)===fi.HIGHLIGHT?fe(this,s5,nX).call(this,l):null;if(m==null||m.toggleDrawing(),b(this,yT)){const y=new AbortController,_=this.combinedSignal(y),E=C=>{C.type==="pointerup"&&C.button!==0||(y.abort(),m==null||m.toggleDrawing(!0),C.type==="pointerup"&&fe(this,mE,l4).call(this,"main_toolbar"))};window.addEventListener("pointerup",E,{signal:_}),window.addEventListener("blur",E,{signal:_})}else m==null||m.toggleDrawing(!0),fe(this,mE,l4).call(this,"main_toolbar")}},mE=new WeakSet,l4=function(t=""){b(this,Wa)===fi.HIGHLIGHT?this.highlightSelection(t):b(this,XN)&&fe(this,x9,a2e).call(this)},I9=new WeakSet,l2e=function(){document.addEventListener("selectionchange",fe(this,A9,o2e).bind(this),{signal:this._signal})},N9=new WeakSet,c2e=function(){if(b(this,U1))return;te(this,U1,new AbortController);const t=this.combinedSignal(b(this,U1));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},O9=new WeakSet,d2e=function(){var t;(t=b(this,U1))==null||t.abort(),te(this,U1,null)},a5=new WeakSet,iX=function(){if(b(this,V1))return;te(this,V1,new AbortController);const t=this.combinedSignal(b(this,V1));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},P9=new WeakSet,u2e=function(){var t;(t=b(this,V1))==null||t.abort(),te(this,V1,null)},o5=new WeakSet,rX=function(){if(b(this,M1))return;te(this,M1,new AbortController);const t=this.combinedSignal(b(this,M1));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},l5=new WeakSet,sX=function(){var t;(t=b(this,M1))==null||t.abort(),te(this,M1,null)},L9=new WeakSet,h2e=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Vo=new WeakSet,Jl=function(t){Object.entries(t).some(([s,l])=>b(this,n5)[s]!==l)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(b(this,n5),t)}),b(this,Wa)===fi.HIGHLIGHT&&t.hasSelectedEditor===!1&&fe(this,Qh,Fm).call(this,[[cr.HIGHLIGHT_FREE,!0]]))},Qh=new WeakSet,Fm=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},D9=new WeakSet,f2e=async function(){if(!b(this,B1)){te(this,B1,!0);const t=[];for(const i of b(this,Bo).values())t.push(i.enable());await Promise.all(t);for(const i of b(this,Ga).values())i.enable()}},k9=new WeakSet,p2e=function(){if(this.unselectAll(),b(this,B1)){te(this,B1,!1);for(const t of b(this,Bo).values())t.disable();for(const t of b(this,Ga).values())t.disable()}},c5=new WeakSet,aX=function(t){const i=b(this,Bo).get(t.pageIndex);i?i.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},M9=new WeakSet,m2e=function(){let t=null;for(t of b(this,Br));return t},gE=new WeakSet,c4=function(){if(b(this,Ga).size===0)return!0;if(b(this,Ga).size===1)for(const t of b(this,Ga).values())return t.isEmpty();return!1},d5=new WeakSet,oX=function(t){for(const i of b(this,Br))i.unselect();b(this,Br).clear();for(const i of t)i.isEmpty()||(b(this,Br).add(i),i.select());fe(this,Vo,Jl).call(this,{hasSelectedEditor:this.hasSelection})},sn(kC,"TRANSLATE_SMALL",1),sn(kC,"TRANSLATE_BIG",10);let J2=kC;var po,wp,Zh,ST,Sp,Id,bT,bp,qc,eg,vE,Cp,$1,yE,d4,CT,MM;const Ql=class Ql{constructor(t){J(this,yE);J(this,CT);J(this,po,null);J(this,wp,!1);J(this,Zh,null);J(this,ST,null);J(this,Sp,null);J(this,Id,null);J(this,bT,!1);J(this,bp,null);J(this,qc,null);J(this,eg,null);J(this,vE,null);J(this,Cp,!1);te(this,qc,t),te(this,Cp,t._uiManager.useNewAltTextFlow),b(Ql,$1)||te(Ql,$1,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(t){Ql._l10n??(Ql._l10n=t)}async render(){const t=te(this,Zh,document.createElement("button"));t.className="altText",t.tabIndex="0";const i=te(this,ST,document.createElement("span"));t.append(i),b(this,Cp)?(t.classList.add("new"),t.setAttribute("data-l10n-id",b(Ql,$1).missing),i.setAttribute("data-l10n-id",b(Ql,$1)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const s=b(this,qc)._uiManager._signal;t.addEventListener("contextmenu",fh,{signal:s}),t.addEventListener("pointerdown",d=>d.stopPropagation(),{signal:s});const l=d=>{d.preventDefault(),b(this,qc)._uiManager.editAltText(b(this,qc)),b(this,Cp)&&b(this,qc)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:b(this,yE,d4)}})};return t.addEventListener("click",l,{capture:!0,signal:s}),t.addEventListener("keydown",d=>{d.target===t&&d.key==="Enter"&&(te(this,bT,!0),l(d))},{signal:s}),await fe(this,CT,MM).call(this),t}finish(){b(this,Zh)&&(b(this,Zh).focus({focusVisible:b(this,bT)}),te(this,bT,!1))}isEmpty(){return b(this,Cp)?b(this,po)===null:!b(this,po)&&!b(this,wp)}hasData(){return b(this,Cp)?b(this,po)!==null||!!b(this,eg):this.isEmpty()}get guessedText(){return b(this,eg)}async setGuessedText(t){b(this,po)===null&&(te(this,eg,t),te(this,vE,await Ql._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),fe(this,CT,MM).call(this))}toggleAltTextBadge(t=!1){var i;if(!b(this,Cp)||b(this,po)){(i=b(this,bp))==null||i.remove(),te(this,bp,null);return}if(!b(this,bp)){const s=te(this,bp,document.createElement("div"));s.className="noAltTextBadge",b(this,qc).div.append(s)}b(this,bp).classList.toggle("hidden",!t)}serialize(t){let i=b(this,po);return!t&&b(this,eg)===i&&(i=b(this,vE)),{altText:i,decorative:b(this,wp),guessedText:b(this,eg),textWithDisclaimer:b(this,vE)}}get data(){return{altText:b(this,po),decorative:b(this,wp)}}set data({altText:t,decorative:i,guessedText:s,textWithDisclaimer:l,cancel:d=!1}){s&&(te(this,eg,s),te(this,vE,l)),!(b(this,po)===t&&b(this,wp)===i)&&(d||(te(this,po,t),te(this,wp,i)),fe(this,CT,MM).call(this))}toggle(t=!1){b(this,Zh)&&(!t&&b(this,Id)&&(clearTimeout(b(this,Id)),te(this,Id,null)),b(this,Zh).disabled=!t)}shown(){b(this,qc)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:b(this,yE,d4)}})}destroy(){var t,i;(t=b(this,Zh))==null||t.remove(),te(this,Zh,null),te(this,ST,null),te(this,Sp,null),(i=b(this,bp))==null||i.remove(),te(this,bp,null)}};po=new WeakMap,wp=new WeakMap,Zh=new WeakMap,ST=new WeakMap,Sp=new WeakMap,Id=new WeakMap,bT=new WeakMap,bp=new WeakMap,qc=new WeakMap,eg=new WeakMap,vE=new WeakMap,Cp=new WeakMap,$1=new WeakMap,yE=new WeakSet,d4=function(){return b(this,po)&&"added"||b(this,po)===null&&this.guessedText&&"review"||"missing"},CT=new WeakSet,MM=async function(){var l,d,u;const t=b(this,Zh);if(!t)return;if(b(this,Cp)){if(t.classList.toggle("done",!!b(this,po)),t.setAttribute("data-l10n-id",b(Ql,$1)[b(this,yE,d4)]),(l=b(this,ST))==null||l.setAttribute("data-l10n-id",b(Ql,$1)[`${b(this,yE,d4)}-label`]),!b(this,po)){(d=b(this,Sp))==null||d.remove();return}}else{if(!b(this,po)&&!b(this,wp)){t.classList.remove("done"),(u=b(this,Sp))==null||u.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=b(this,Sp);if(!i){te(this,Sp,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${b(this,qc).id}`;const p=100,m=b(this,qc)._uiManager._signal;m.addEventListener("abort",()=>{clearTimeout(b(this,Id)),te(this,Id,null)},{once:!0}),t.addEventListener("mouseenter",()=>{te(this,Id,setTimeout(()=>{te(this,Id,null),b(this,Sp).classList.add("show"),b(this,qc)._reportTelemetry({action:"alt_text_tooltip"})},p))},{signal:m}),t.addEventListener("mouseleave",()=>{var y;b(this,Id)&&(clearTimeout(b(this,Id)),te(this,Id,null)),(y=b(this,Sp))==null||y.classList.remove("show")},{signal:m})}b(this,wp)?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=b(this,po)),i.parentNode||t.append(i);const s=b(this,qc).getElementForAltText();s==null||s.setAttribute("aria-describedby",i.id)},J(Ql,$1,null),sn(Ql,"_l10n",null);let r9=Ql;var Tp,_E,ef,u5,tg,TT,K1;class eM{constructor(t){J(this,Tp,null);J(this,_E,!1);J(this,ef,null);J(this,u5,null);J(this,tg,null);J(this,TT,null);J(this,K1,!1);te(this,ef,t),this.toolbar=null}render(){if(!b(this,ef)._uiManager.hasCommentManager())return null;const t=te(this,Tp,document.createElement("button"));t.className="comment",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");const i=b(this,ef)._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",fh,{signal:i}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:i});const s=l=>{l.preventDefault(),this.edit()};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(te(this,_E,!0),s(l))},{signal:i}),t}edit(){const{bottom:t,left:i,right:s}=b(this,ef).getClientDimensions(),l={top:t};b(this,ef)._uiManager.direction==="ltr"?l.right=s:l.left=i,b(this,ef)._uiManager.editComment(b(this,ef),l)}finish(){b(this,Tp)&&(b(this,Tp).focus({focusVisible:b(this,_E)}),te(this,_E,!1))}isDeleted(){return b(this,K1)||b(this,tg)===""}hasBeenEdited(){return this.isDeleted()||b(this,tg)!==b(this,u5)}serialize(){return this.data}get data(){return{text:b(this,tg),date:b(this,TT),deleted:b(this,K1)}}set data(t){if(t===null){te(this,tg,""),te(this,K1,!0);return}te(this,tg,t),te(this,TT,new Date),te(this,K1,!1)}setInitialText(t){te(this,u5,t),this.data=t}toggle(t=!1){b(this,Tp)&&(b(this,Tp).disabled=!t)}shown(){}destroy(){var t;(t=b(this,Tp))==null||t.remove(),te(this,Tp,null),te(this,tg,""),te(this,TT,null),te(this,ef,null),te(this,_E,!1),te(this,K1,!1)}}Tp=new WeakMap,_E=new WeakMap,ef=new WeakMap,u5=new WeakMap,tg=new WeakMap,TT=new WeakMap,K1=new WeakMap;var RT,EE,h5,f5,p5,m5,g5,ng,wE,ig,SE,rg,j9,g2e,U9,v2e,F9,y2e;const Ree=class Ree{constructor({container:t,isPinchingDisabled:i=null,isPinchingStopped:s=null,onPinchStart:l=null,onPinching:d=null,onPinchEnd:u=null,signal:p}){J(this,j9);J(this,U9);J(this,F9);J(this,RT,void 0);J(this,EE,!1);J(this,h5,null);J(this,f5,void 0);J(this,p5,void 0);J(this,m5,void 0);J(this,g5,void 0);J(this,ng,null);J(this,wE,void 0);J(this,ig,null);J(this,SE,void 0);J(this,rg,null);te(this,RT,t),te(this,h5,s),te(this,f5,i),te(this,p5,l),te(this,m5,d),te(this,g5,u),te(this,SE,new AbortController),te(this,wE,AbortSignal.any([p,b(this,SE).signal])),t.addEventListener("touchstart",fe(this,j9,g2e).bind(this),{passive:!1,signal:b(this,wE)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Kp.pixelRatio}destroy(){var t,i;(t=b(this,SE))==null||t.abort(),te(this,SE,null),(i=b(this,ng))==null||i.abort(),te(this,ng,null)}};RT=new WeakMap,EE=new WeakMap,h5=new WeakMap,f5=new WeakMap,p5=new WeakMap,m5=new WeakMap,g5=new WeakMap,ng=new WeakMap,wE=new WeakMap,ig=new WeakMap,SE=new WeakMap,rg=new WeakMap,j9=new WeakSet,g2e=function(t){var l,d,u;if((l=b(this,f5))!=null&&l.call(this))return;if(t.touches.length===1){if(b(this,ng))return;const p=te(this,ng,new AbortController),m=AbortSignal.any([b(this,wE),p.signal]),y=b(this,RT),_={capture:!0,signal:m,passive:!1},E=C=>{var x;C.pointerType==="touch"&&((x=b(this,ng))==null||x.abort(),te(this,ng,null))};y.addEventListener("pointerdown",C=>{C.pointerType==="touch"&&(Oa(C),E(C))},_),y.addEventListener("pointerup",E,_),y.addEventListener("pointercancel",E,_);return}if(!b(this,rg)){te(this,rg,new AbortController);const p=AbortSignal.any([b(this,wE),b(this,rg).signal]),m=b(this,RT),y={signal:p,capture:!1,passive:!1};m.addEventListener("touchmove",fe(this,U9,v2e).bind(this),y);const _=fe(this,F9,y2e).bind(this);m.addEventListener("touchend",_,y),m.addEventListener("touchcancel",_,y),y.capture=!0,m.addEventListener("pointerdown",Oa,y),m.addEventListener("pointermove",Oa,y),m.addEventListener("pointercancel",Oa,y),m.addEventListener("pointerup",Oa,y),(d=b(this,p5))==null||d.call(this)}if(Oa(t),t.touches.length!==2||(u=b(this,h5))!=null&&u.call(this)){te(this,ig,null);return}let[i,s]=t.touches;i.identifier>s.identifier&&([i,s]=[s,i]),te(this,ig,{touch0X:i.screenX,touch0Y:i.screenY,touch1X:s.screenX,touch1Y:s.screenY})},U9=new WeakSet,v2e=function(t){var V;if(!b(this,ig)||t.touches.length!==2)return;Oa(t);let[i,s]=t.touches;i.identifier>s.identifier&&([i,s]=[s,i]);const{screenX:l,screenY:d}=i,{screenX:u,screenY:p}=s,m=b(this,ig),{touch0X:y,touch0Y:_,touch1X:E,touch1Y:C}=m,x=E-y,N=C-_,O=u-l,D=p-d,P=Math.hypot(O,D)||1,j=Math.hypot(x,N)||1;if(!b(this,EE)&&Math.abs(j-P)<=Ree.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(m.touch0X=l,m.touch0Y=d,m.touch1X=u,m.touch1Y=p,!b(this,EE)){te(this,EE,!0);return}const M=[(l+u)/2,(d+p)/2];(V=b(this,m5))==null||V.call(this,M,j,P)},F9=new WeakSet,y2e=function(t){var i;t.touches.length>=2||(b(this,rg)&&(b(this,rg).abort(),te(this,rg,null),(i=b(this,g5))==null||i.call(this)),b(this,ig)&&(Oa(t),te(this,ig,null),te(this,EE,!1)))};let s9=Ree;var bE,tf,Ds,zo,xT,q1,v5,CE,Ho,TE,sg,Y1,y5,RE,Nd,_5,xE,ag,Rp,AT,IT,Qu,AE,E5,B9,w5,lX,S5,cX,NT,jM,V9,_2e,z9,E2e,b5,dX,OT,UM,C5,uX,H9,w2e,G9,S2e,W9,b2e,T5,hX,$9,C2e,R5,fX,K9,T2e,q9,R2e,Y9,x2e,x5,pX,IE,u4;const Vi=class Vi{constructor(t){J(this,w5);J(this,NT);J(this,V9);J(this,z9);J(this,b5);J(this,OT);J(this,C5);J(this,H9);J(this,G9);J(this,W9);J(this,T5);J(this,$9);J(this,R5);J(this,K9);J(this,q9);J(this,Y9);J(this,x5);J(this,IE);J(this,bE,null);J(this,tf,null);J(this,Ds,null);J(this,zo,null);J(this,xT,!1);J(this,q1,null);J(this,v5,"");J(this,CE,!1);J(this,Ho,null);J(this,TE,null);J(this,sg,null);J(this,Y1,null);J(this,y5,"");J(this,RE,!1);J(this,Nd,null);J(this,_5,!1);J(this,xE,!1);J(this,ag,!1);J(this,Rp,null);J(this,AT,0);J(this,IT,0);J(this,Qu,null);J(this,AE,null);sn(this,"isSelected",!1);sn(this,"_isCopy",!1);sn(this,"_editToolbar",null);sn(this,"_initialOptions",Object.create(null));sn(this,"_initialData",null);sn(this,"_isVisible",!0);sn(this,"_uiManager",null);sn(this,"_focusEventsAllowed",!0);J(this,E5,!1);J(this,B9,Vi._zIndex++);this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null;const{rotation:i,rawDims:{pageWidth:s,pageHeight:l,pageX:d,pageY:u}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,l],this.pageTranslation=[d,u];const[p,m]=this.parentDimensions;this.x=t.x/p,this.y=t.y/m,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=Vi.prototype._resizeWithKeyboard,i=J2.TRANSLATE_SMALL,s=J2.TRANSLATE_BIG;return Ki(this,"_resizerKeyboardManager",new OP([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-s,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[s,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-s]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,s]}],[["Escape","mac+Escape"],Vi.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Ki(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const i=new ZQe({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});i.annotationElementId=t.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(t,i){if(Vi._l10n??(Vi._l10n=t),Vi._l10nResizer||(Vi._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),Vi._borderLineWidth!==-1)return;const s=getComputedStyle(document.documentElement);Vi._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,i){ns("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return b(this,E5)}set _isDraggable(t){var i;te(this,E5,t),(i=this.div)==null||i.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(t*2),this.y+=this.width*t/(i*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(t*2),this.y-=this.width*t/(i*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=b(this,B9)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):fe(this,IE,u4).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(b(this,RE)?te(this,RE,!1):this.parent.setSelected(this))}focusout(t){var s;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const i=t.relatedTarget;i!=null&&i.closest(`#${this.id}`)||(t.preventDefault(),(s=this.parent)!=null&&s.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,i,s,l){const[d,u]=this.parentDimensions;[s,l]=this.screenToPageTranslation(s,l),this.x=(t+s)/d,this.y=(i+l)/u,this.fixAndSetPosition()}_moveAfterPaste(t,i){const[s,l]=this.parentDimensions;this.setAt(t*s,i*l,this.width*s,this.height*l),this._onTranslated()}translate(t,i){fe(this,w5,lX).call(this,this.parentDimensions,t,i)}translateInPage(t,i){b(this,Nd)||te(this,Nd,[this.x,this.y,this.width,this.height]),fe(this,w5,lX).call(this,this.pageDimensions,t,i),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,i){b(this,Nd)||te(this,Nd,[this.x,this.y,this.width,this.height]);const{div:s,parentDimensions:[l,d]}=this;if(this.x+=t/l,this.y+=i/d,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:E,y:C}=this.div.getBoundingClientRect();this.parent.findNewParent(this,E,C)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:u,y:p}=this;const[m,y]=this.getBaseTranslation();u+=m,p+=y;const{style:_}=s;_.left=`${(100*u).toFixed(2)}%`,_.top=`${(100*p).toFixed(2)}%`,this._onTranslating(u,p),s.scrollIntoView({block:"nearest"})}_onTranslating(t,i){}_onTranslated(t,i){}get _hasBeenMoved(){return!!b(this,Nd)&&(b(this,Nd)[0]!==this.x||b(this,Nd)[1]!==this.y)}get _hasBeenResized(){return!!b(this,Nd)&&(b(this,Nd)[2]!==this.width||b(this,Nd)[3]!==this.height)}getBaseTranslation(){const[t,i]=this.parentDimensions,{_borderLineWidth:s}=Vi,l=s/t,d=s/i;switch(this.rotation){case 90:return[-l,d];case 180:return[l,d];case 270:return[l,-d];default:return[-l,-d]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:i},pageDimensions:[s,l]}=this;let{x:d,y:u,width:p,height:m}=this;if(p*=s,m*=l,d*=s,u*=l,this._mustFixPosition)switch(t){case 0:d=ac(d,0,s-p),u=ac(u,0,l-m);break;case 90:d=ac(d,0,s-m),u=ac(u,p,l);break;case 180:d=ac(d,p,s),u=ac(u,m,l);break;case 270:d=ac(d,m,s),u=ac(u,0,l-p);break}this.x=d/=s,this.y=u/=l;const[y,_]=this.getBaseTranslation();d+=y,u+=_,i.left=`${(100*d).toFixed(2)}%`,i.top=`${(100*u).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,i){var s;return fe(s=Vi,S5,cX).call(s,t,i,this.parentRotation)}pageTranslationToScreen(t,i){var s;return fe(s=Vi,S5,cX).call(s,t,i,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[i,s]}=this;return[i*t,s*t]}setDims(t,i){const[s,l]=this.parentDimensions,{style:d}=this.div;d.width=`${(100*t/s).toFixed(2)}%`,b(this,CE)||(d.height=`${(100*i/l).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:i,width:s}=t,l=s.endsWith("%"),d=!b(this,CE)&&i.endsWith("%");if(l&&d)return;const[u,p]=this.parentDimensions;l||(t.width=`${(100*parseFloat(s)/u).toFixed(2)}%`),!b(this,CE)&&!d&&(t.height=`${(100*parseFloat(i)/p).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){var t;(t=b(this,Ds))==null||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||b(this,xE))return this._editToolbar;this._editToolbar=new QY(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[i,s]of t)await this._editToolbar.addButton(i,s);return this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){var t;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(t=b(this,Ds))==null||t.destroy())}addContainer(t){var s;const i=(s=this._editToolbar)==null?void 0:s.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return b(this,Ds)||(r9.initialize(Vi._l10n),te(this,Ds,new r9(this)),b(this,bE)&&(b(this,Ds).data=b(this,bE),te(this,bE,null))),b(this,Ds)}get altTextData(){var t;return(t=b(this,Ds))==null?void 0:t.data}set altTextData(t){b(this,Ds)&&(b(this,Ds).data=t)}get guessedAltText(){var t;return(t=b(this,Ds))==null?void 0:t.guessedText}async setGuessedAltText(t){var i;await((i=b(this,Ds))==null?void 0:i.setGuessedText(t))}serializeAltText(t){var i;return(i=b(this,Ds))==null?void 0:i.serialize(t)}hasAltText(){return!!b(this,Ds)&&!b(this,Ds).isEmpty()}hasAltTextData(){var t;return((t=b(this,Ds))==null?void 0:t.hasData())??!1}addCommentButton(){return b(this,zo)?b(this,zo):te(this,zo,new eM(this))}get commentColor(){return null}get comment(){const t=b(this,zo);return{text:t.data.text,date:t.data.date,deleted:t.isDeleted(),color:this.commentColor}}set comment(t){b(this,zo)||te(this,zo,new eM(this)),b(this,zo).data=t}setCommentData(t){b(this,zo)||te(this,zo,new eM(this)),b(this,zo).setInitialText(t)}get hasEditedComment(){var t;return(t=b(this,zo))==null?void 0:t.hasBeenEdited()}async editComment(){b(this,zo)||te(this,zo,new eM(this)),b(this,zo).edit()}addComment(t){if(this.hasEditedComment){const[,,,l]=t.rect,[d]=this.pageDimensions,[u]=this.pageTranslation,p=u+d+1,m=l-100,y=p+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[p,m,y,l]}}}render(){var u;const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=b(this,xT)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),fe(this,R5,fX).call(this);const[i,s]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*s/i).toFixed(2)}%`,t.style.maxHeight=`${(100*i/s).toFixed(2)}%`);const[l,d]=this.getInitialTranslation();return this.translate(l,d),r2e(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(b(this,AE)||te(this,AE,new s9({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:fe(this,H9,w2e).bind(this),onPinching:fe(this,G9,S2e).bind(this),onPinchEnd:fe(this,W9,b2e).bind(this),signal:this._uiManager._signal}))),(u=this._uiManager._editorUndoBar)==null||u.hide(),t}pointerdown(t){const{isMac:i}=Zo.platform;if(t.button!==0||t.ctrlKey&&i){t.preventDefault();return}if(te(this,RE,!0),this._isDraggable){fe(this,$9,C2e).call(this,t);return}fe(this,T5,hX).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){b(this,Rp)&&clearTimeout(b(this,Rp)),te(this,Rp,setTimeout(()=>{var t;te(this,Rp,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,i,s){t.changeParent(this),this.x=i,this.y=s,this.fixAndSetPosition(),this._onTranslated()}getRect(t,i,s=this.rotation){const l=this.parentScale,[d,u]=this.pageDimensions,[p,m]=this.pageTranslation,y=t/l,_=i/l,E=this.x*d,C=this.y*u,x=this.width*d,N=this.height*u;switch(s){case 0:return[E+y+p,u-C-_-N+m,E+y+x+p,u-C-_+m];case 90:return[E+_+p,u-C+y+m,E+_+N+p,u-C+y+x+m];case 180:return[E-y-x+p,u-C+_+m,E-y+p,u-C+_+N+m];case 270:return[E-_-N+p,u-C-y-x+m,E-_+p,u-C-y+m];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,i){const[s,l,d,u]=t,p=d-s,m=u-l;switch(this.rotation){case 0:return[s,i-u,p,m];case 90:return[s,i-l,m,p];case 180:return[d,i-l,p,m];case 270:return[d,i-u,m,p];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),te(this,xE,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),te(this,xE,!1),!0):!1}isInEditMode(){return b(this,xE)}shouldGetKeyboardEvents(){return b(this,ag)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:i,bottom:s,right:l}=this.getClientDimensions(),{innerHeight:d,innerWidth:u}=window;return i<u&&l>0&&t<d&&s>0}rebuild(){fe(this,R5,fX).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((t=this._initialData)==null?void 0:t.popupRef)||""}}serialize(t=!1,i=null){ns("An editor must be serializable")}static async deserialize(t,i,s){const l=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:s,annotationElementId:t.annotationElementId});l.rotation=t.rotation,te(l,bE,t.accessibilityData),l._isCopy=t.isCopy||!1;const[d,u]=l.pageDimensions,[p,m,y,_]=l.getRectInCurrentCoords(t.rect,u);return l.x=p/d,l.y=m/u,l.width=y/d,l.height=_/u,l}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,i;if((t=b(this,Y1))==null||t.abort(),te(this,Y1,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),b(this,Rp)&&(clearTimeout(b(this,Rp)),te(this,Rp,null)),fe(this,IE,u4).call(this),this.removeEditToolbar(),b(this,Qu)){for(const s of b(this,Qu).values())clearTimeout(s);te(this,Qu,null)}this.parent=null,(i=b(this,AE))==null||i.destroy(),te(this,AE,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(fe(this,V9,_2e).call(this),b(this,Ho).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),te(this,sg,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const i=b(this,Ho).children;if(!b(this,tf)){te(this,tf,Array.from(i));const u=fe(this,K9,T2e).bind(this),p=fe(this,q9,R2e).bind(this),m=this._uiManager._signal;for(const y of b(this,tf)){const _=y.getAttribute("data-resizer-name");y.setAttribute("role","spinbutton"),y.addEventListener("keydown",u,{signal:m}),y.addEventListener("blur",p,{signal:m}),y.addEventListener("focus",fe(this,Y9,x2e).bind(this,_),{signal:m}),y.setAttribute("data-l10n-id",Vi._l10nResizer[_])}}const s=b(this,tf)[0];let l=0;for(const u of i){if(u===s)break;l++}const d=(360-this.rotation+this.parentRotation)%360/90*(b(this,tf).length/4);if(d!==l){if(d<l)for(let p=0;p<l-d;p++)b(this,Ho).append(b(this,Ho).firstChild);else if(d>l)for(let p=0;p<d-l;p++)b(this,Ho).firstChild.before(b(this,Ho).lastChild);let u=0;for(const p of i){const y=b(this,tf)[u++].getAttribute("data-resizer-name");p.setAttribute("data-l10n-id",Vi._l10nResizer[y])}}fe(this,x5,pX).call(this,0),te(this,ag,!0),b(this,Ho).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,i){b(this,ag)&&fe(this,C5,uX).call(this,b(this,y5),{deltaX:t,deltaY:i,fromKeyboard:!0})}_stopResizingWithKeyboard(){fe(this,IE,u4).call(this),this.div.focus()}select(){var t,i,s;if(!(this.isSelected&&this._editToolbar)){if(this.isSelected=!0,this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var l,d;(l=this.div)!=null&&l.classList.contains("selectedEditor")&&((d=this._editToolbar)==null||d.show())});return}(i=this._editToolbar)==null||i.show(),(s=b(this,Ds))==null||s.toggleAltTextBadge(!1)}}unselect(){var t,i,s,l,d;this.isSelected&&(this.isSelected=!1,(t=b(this,Ho))==null||t.classList.add("hidden"),(i=this.div)==null||i.classList.remove("selectedEditor"),(s=this.div)!=null&&s.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(l=this._editToolbar)==null||l.hide(),(d=b(this,Ds))==null||d.toggleAltTextBadge(!0))}updateParams(t,i){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return b(this,_5)}set isEditing(t){te(this,_5,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,i){te(this,CE,!0);const s=t/i,{style:l}=this.div;l.aspectRatio=s,l.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,i=!1){if(i){b(this,Qu)||te(this,Qu,new Map);const{action:s}=t;let l=b(this,Qu).get(s);l&&clearTimeout(l),l=setTimeout(()=>{this._reportTelemetry(t),b(this,Qu).delete(s),b(this,Qu).size===0&&te(this,Qu,null)},Vi._telemetryTimeout),b(this,Qu).set(s,l);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),te(this,xT,!1)}disable(){this.div&&(this.div.tabIndex=-1),te(this,xT,!0)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let i=t.container.querySelector(".annotationContent");if(!i)i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),t.container.prepend(i);else if(i.nodeName==="CANVAS"){const s=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),s.before(i)}return i}resetAnnotationElement(t){const{firstChild:i}=t.container;(i==null?void 0:i.nodeName)==="DIV"&&i.classList.contains("annotationContent")&&i.remove()}};bE=new WeakMap,tf=new WeakMap,Ds=new WeakMap,zo=new WeakMap,xT=new WeakMap,q1=new WeakMap,v5=new WeakMap,CE=new WeakMap,Ho=new WeakMap,TE=new WeakMap,sg=new WeakMap,Y1=new WeakMap,y5=new WeakMap,RE=new WeakMap,Nd=new WeakMap,_5=new WeakMap,xE=new WeakMap,ag=new WeakMap,Rp=new WeakMap,AT=new WeakMap,IT=new WeakMap,Qu=new WeakMap,AE=new WeakMap,E5=new WeakMap,B9=new WeakMap,w5=new WeakSet,lX=function([t,i],s,l){[s,l]=this.screenToPageTranslation(s,l),this.x+=s/t,this.y+=l/i,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},S5=new WeakSet,cX=function(t,i,s){switch(s){case 90:return[i,-t];case 180:return[-t,-i];case 270:return[-i,t];default:return[t,i]}},NT=new WeakSet,jM=function(t){switch(t){case 90:{const[i,s]=this.pageDimensions;return[0,-i/s,s/i,0]}case 180:return[-1,0,0,-1];case 270:{const[i,s]=this.pageDimensions;return[0,i/s,-s/i,0]}default:return[1,0,0,1]}},V9=new WeakSet,_2e=function(){if(b(this,Ho))return;te(this,Ho,document.createElement("div")),b(this,Ho).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],i=this._uiManager._signal;for(const s of t){const l=document.createElement("div");b(this,Ho).append(l),l.classList.add("resizer",s),l.setAttribute("data-resizer-name",s),l.addEventListener("pointerdown",fe(this,z9,E2e).bind(this,s),{signal:i}),l.addEventListener("contextmenu",fh,{signal:i}),l.tabIndex=-1}this.div.prepend(b(this,Ho))},z9=new WeakSet,E2e=function(t,i){var _;i.preventDefault();const{isMac:s}=Zo.platform;if(i.button!==0||i.ctrlKey&&s)return;(_=b(this,Ds))==null||_.toggle(!1);const l=this._isDraggable;this._isDraggable=!1,te(this,TE,[i.screenX,i.screenY]);const d=new AbortController,u=this._uiManager.combinedSignal(d);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",fe(this,C5,uX).bind(this,t),{passive:!0,capture:!0,signal:u}),window.addEventListener("touchmove",Oa,{passive:!1,signal:u}),window.addEventListener("contextmenu",fh,{signal:u}),te(this,sg,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const p=this.parent.div.style.cursor,m=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(i.target).cursor;const y=()=>{var E;d.abort(),this.parent.togglePointerEvents(!0),(E=b(this,Ds))==null||E.toggle(!0),this._isDraggable=l,this.parent.div.style.cursor=p,this.div.style.cursor=m,fe(this,OT,UM).call(this)};window.addEventListener("pointerup",y,{signal:u}),window.addEventListener("blur",y,{signal:u})},b5=new WeakSet,dX=function(t,i,s,l){this.width=s,this.height=l,this.x=t,this.y=i;const[d,u]=this.parentDimensions;this.setDims(d*s,u*l),this.fixAndSetPosition(),this._onResized()},OT=new WeakSet,UM=function(){if(!b(this,sg))return;const{savedX:t,savedY:i,savedWidth:s,savedHeight:l}=b(this,sg);te(this,sg,null);const d=this.x,u=this.y,p=this.width,m=this.height;d===t&&u===i&&p===s&&m===l||this.addCommands({cmd:fe(this,b5,dX).bind(this,d,u,p,m),undo:fe(this,b5,dX).bind(this,t,i,s,l),mustExec:!0})},C5=new WeakSet,uX=function(t,i){const[s,l]=this.parentDimensions,d=this.x,u=this.y,p=this.width,m=this.height,y=Vi.MIN_SIZE/s,_=Vi.MIN_SIZE/l,E=fe(this,NT,jM).call(this,this.rotation),C=(me,Ce)=>[E[0]*me+E[2]*Ce,E[1]*me+E[3]*Ce],x=fe(this,NT,jM).call(this,360-this.rotation),N=(me,Ce)=>[x[0]*me+x[2]*Ce,x[1]*me+x[3]*Ce];let O,D,P=!1,j=!1;switch(t){case"topLeft":P=!0,O=(me,Ce)=>[0,0],D=(me,Ce)=>[me,Ce];break;case"topMiddle":O=(me,Ce)=>[me/2,0],D=(me,Ce)=>[me/2,Ce];break;case"topRight":P=!0,O=(me,Ce)=>[me,0],D=(me,Ce)=>[0,Ce];break;case"middleRight":j=!0,O=(me,Ce)=>[me,Ce/2],D=(me,Ce)=>[0,Ce/2];break;case"bottomRight":P=!0,O=(me,Ce)=>[me,Ce],D=(me,Ce)=>[0,0];break;case"bottomMiddle":O=(me,Ce)=>[me/2,Ce],D=(me,Ce)=>[me/2,0];break;case"bottomLeft":P=!0,O=(me,Ce)=>[0,Ce],D=(me,Ce)=>[me,0];break;case"middleLeft":j=!0,O=(me,Ce)=>[0,Ce/2],D=(me,Ce)=>[me,Ce/2];break}const M=O(p,m),V=D(p,m);let G=C(...V);const $=Vi._round(d+G[0]),ne=Vi._round(u+G[1]);let Y=1,le=1,re,ee;if(i.fromKeyboard)({deltaX:re,deltaY:ee}=i);else{const{screenX:me,screenY:Ce}=i,[he,pe]=b(this,TE);[re,ee]=this.screenToPageTranslation(me-he,Ce-pe),b(this,TE)[0]=me,b(this,TE)[1]=Ce}if([re,ee]=N(re/s,ee/l),P){const me=Math.hypot(p,m);Y=le=Math.max(Math.min(Math.hypot(V[0]-M[0]-re,V[1]-M[1]-ee)/me,1/p,1/m),y/p,_/m)}else j?Y=ac(Math.abs(V[0]-M[0]-re),y,1)/p:le=ac(Math.abs(V[1]-M[1]-ee),_,1)/m;const de=Vi._round(p*Y),H=Vi._round(m*le);G=C(...D(de,H));const ae=$-G[0],_e=ne-G[1];b(this,Nd)||te(this,Nd,[this.x,this.y,this.width,this.height]),this.width=de,this.height=H,this.x=ae,this.y=_e,this.setDims(s*de,l*H),this.fixAndSetPosition(),this._onResizing()},H9=new WeakSet,w2e=function(){var t;te(this,sg,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=b(this,Ds))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},G9=new WeakSet,S2e=function(t,i,s){let d=.7*(s/i)+1-.7;if(d===1)return;const u=fe(this,NT,jM).call(this,this.rotation),p=($,ne)=>[u[0]*$+u[2]*ne,u[1]*$+u[3]*ne],[m,y]=this.parentDimensions,_=this.x,E=this.y,C=this.width,x=this.height,N=Vi.MIN_SIZE/m,O=Vi.MIN_SIZE/y;d=Math.max(Math.min(d,1/C,1/x),N/C,O/x);const D=Vi._round(C*d),P=Vi._round(x*d);if(D===C&&P===x)return;b(this,Nd)||te(this,Nd,[_,E,C,x]);const j=p(C/2,x/2),M=Vi._round(_+j[0]),V=Vi._round(E+j[1]),G=p(D/2,P/2);this.x=M-G[0],this.y=V-G[1],this.width=D,this.height=P,this.setDims(m*D,y*P),this.fixAndSetPosition(),this._onResizing()},W9=new WeakSet,b2e=function(){var t;(t=b(this,Ds))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),fe(this,OT,UM).call(this)},T5=new WeakSet,hX=function(t){const{isMac:i}=Zo.platform;t.ctrlKey&&!i||t.shiftKey||t.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this)},$9=new WeakSet,C2e=function(t){const{isSelected:i}=this;this._uiManager.setUpDragSession();let s=!1;const l=new AbortController,d=this._uiManager.combinedSignal(l),u={capture:!0,passive:!1,signal:d},p=y=>{l.abort(),te(this,q1,null),te(this,RE,!1),this._uiManager.endDragSession()||fe(this,T5,hX).call(this,y),s&&this._onStopDragging()};i&&(te(this,AT,t.clientX),te(this,IT,t.clientY),te(this,q1,t.pointerId),te(this,v5,t.pointerType),window.addEventListener("pointermove",y=>{s||(s=!0,this._onStartDragging());const{clientX:_,clientY:E,pointerId:C}=y;if(C!==b(this,q1)){Oa(y);return}const[x,N]=this.screenToPageTranslation(_-b(this,AT),E-b(this,IT));te(this,AT,_),te(this,IT,E),this._uiManager.dragSelectedEditors(x,N)},u),window.addEventListener("touchmove",Oa,u),window.addEventListener("pointerdown",y=>{y.pointerType===b(this,v5)&&(b(this,AE)||y.isPrimary)&&p(y),Oa(y)},u));const m=y=>{if(!b(this,q1)||b(this,q1)===y.pointerId){p(y);return}Oa(y)};window.addEventListener("pointerup",m,{signal:d}),window.addEventListener("blur",m,{signal:d})},R5=new WeakSet,fX=function(){if(b(this,Y1)||!this.div)return;te(this,Y1,new AbortController);const t=this._uiManager.combinedSignal(b(this,Y1));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},K9=new WeakSet,T2e=function(t){Vi._resizerKeyboardManager.exec(this,t)},q9=new WeakSet,R2e=function(t){var i;b(this,ag)&&((i=t.relatedTarget)==null?void 0:i.parentNode)!==b(this,Ho)&&fe(this,IE,u4).call(this)},Y9=new WeakSet,x2e=function(t){te(this,y5,b(this,ag)?t:"")},x5=new WeakSet,pX=function(t){if(b(this,tf))for(const i of b(this,tf))i.tabIndex=t},IE=new WeakSet,u4=function(){te(this,ag,!1),fe(this,x5,pX).call(this,-1),fe(this,OT,UM).call(this)},J(Vi,S5),sn(Vi,"_l10n",null),sn(Vi,"_l10nResizer",null),sn(Vi,"_borderLineWidth",-1),sn(Vi,"_colorManager",new tX),sn(Vi,"_zIndex",1),sn(Vi,"_telemetryTimeout",1e3);let fs=Vi;class ZQe extends fs{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Yfe=3285377520,Vu=4294901760,ap=65535;class A2e{constructor(t){this.h1=t?t&4294967295:Yfe,this.h2=t?t&4294967295:Yfe}update(t){let i,s;if(typeof t=="string"){i=new Uint8Array(t.length*2),s=0;for(let O=0,D=t.length;O<D;O++){const P=t.charCodeAt(O);P<=255?i[s++]=P:(i[s++]=P>>>8,i[s++]=P&255)}}else if(ArrayBuffer.isView(t))i=t.slice(),s=i.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const l=s>>2,d=s-l*4,u=new Uint32Array(i.buffer,0,l);let p=0,m=0,y=this.h1,_=this.h2;const E=3432918353,C=461845907,x=E&ap,N=C&ap;for(let O=0;O<l;O++)O&1?(p=u[O],p=p*E&Vu|p*x&ap,p=p<<15|p>>>17,p=p*C&Vu|p*N&ap,y^=p,y=y<<13|y>>>19,y=y*5+3864292196):(m=u[O],m=m*E&Vu|m*x&ap,m=m<<15|m>>>17,m=m*C&Vu|m*N&ap,_^=m,_=_<<13|_>>>19,_=_*5+3864292196);switch(p=0,d){case 3:p^=i[l*4+2]<<16;case 2:p^=i[l*4+1]<<8;case 1:p^=i[l*4],p=p*E&Vu|p*x&ap,p=p<<15|p>>>17,p=p*C&Vu|p*N&ap,l&1?y^=p:_^=p}this.h1=y,this.h2=_}hexdigest(){let t=this.h1,i=this.h2;return t^=i>>>1,t=t*3981806797&Vu|t*36045&ap,i=i*4283543511&Vu|((i<<16|t>>>16)*2950163797&Vu)>>>16,t^=i>>>1,t=t*444984403&Vu|t*60499&ap,i=i*3301882366&Vu|((i<<16|t>>>16)*3120437893&Vu)>>>16,t^=i>>>1,(t>>>0).toString(16).padStart(8,"0")+(i>>>0).toString(16).padStart(8,"0")}}const mX=Object.freeze({map:null,hash:"",transfer:void 0});var NE,OE,Go,X9,I2e;class BZ{constructor(){J(this,X9);J(this,NE,!1);J(this,OE,null);J(this,Go,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,i){const s=b(this,Go).get(t);return s===void 0?i:Object.assign(i,s)}getRawValue(t){return b(this,Go).get(t)}remove(t){if(b(this,Go).delete(t),b(this,Go).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of b(this,Go).values())if(i instanceof fs)return;this.onAnnotationEditor(null)}}setValue(t,i){const s=b(this,Go).get(t);let l=!1;if(s!==void 0)for(const[d,u]of Object.entries(i))s[d]!==u&&(l=!0,s[d]=u);else l=!0,b(this,Go).set(t,i);l&&fe(this,X9,I2e).call(this),i instanceof fs&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(t){return b(this,Go).has(t)}get size(){return b(this,Go).size}resetModified(){b(this,NE)&&(te(this,NE,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new N2e(this)}get serializable(){if(b(this,Go).size===0)return mX;const t=new Map,i=new A2e,s=[],l=Object.create(null);let d=!1;for(const[u,p]of b(this,Go)){const m=p instanceof fs?p.serialize(!1,l):p;m&&(t.set(u,m),i.update(`${u}:${JSON.stringify(m)}`),d||(d=!!m.bitmap))}if(d)for(const u of t.values())u.bitmap&&s.push(u.bitmap);return t.size>0?{map:t,hash:i.hexdigest(),transfer:s}:mX}get editorStats(){let t=null;const i=new Map;for(const s of b(this,Go).values()){if(!(s instanceof fs))continue;const l=s.telemetryFinalData;if(!l)continue;const{type:d}=l;i.has(d)||i.set(d,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const u=t[d]||(t[d]=new Map);for(const[p,m]of Object.entries(l)){if(p==="type")continue;let y=u.get(p);y||(y=new Map,u.set(p,y));const _=y.get(m)??0;y.set(m,_+1)}}for(const[s,l]of i)t[s]=l.computeTelemetryFinalData(t[s]);return t}resetModifiedIds(){te(this,OE,null)}get modifiedIds(){if(b(this,OE))return b(this,OE);const t=[];for(const i of b(this,Go).values())!(i instanceof fs)||!i.annotationElementId||!i.serialize()||t.push(i.annotationElementId);return te(this,OE,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return b(this,Go).entries()}}NE=new WeakMap,OE=new WeakMap,Go=new WeakMap,X9=new WeakSet,I2e=function(){b(this,NE)||(te(this,NE,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var A5;class N2e extends BZ{constructor(i){super();J(this,A5,void 0);const{map:s,hash:l,transfer:d}=i.serializable,u=structuredClone(s,d?{transfer:d}:null);te(this,A5,{map:u,hash:l,transfer:d})}get print(){ns("Should not call PrintAnnotationStorage.print")}get serializable(){return b(this,A5)}get modifiedIds(){return Ki(this,"modifiedIds",{ids:new Set,hash:""})}}A5=new WeakMap;var PT;class eZe{constructor({ownerDocument:t=globalThis.document,styleElement:i=null}){J(this,PT,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),b(this,PT).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:i,_inspectFont:s}){if(!(!t||b(this,PT).has(t.loadedName))){if(La(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:l,src:d,style:u}=t,p=new FontFace(l,d,u);this.addNativeFontFace(p);try{await p.load(),b(this,PT).add(l),s==null||s(t)}catch{Ei(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(p)}return}ns("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const s=t.createNativeFontFace();if(s){this.addNativeFontFace(s);try{await s.loaded}catch(l){throw Ei(`Failed to load font '${s.family}': '${l}'.`),t.disableFontFace=!0,l}}return}const i=t.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise(s=>{const l=this._queueLoadingCallback(s);this._prepareFontLoadEvent(t,l)})}}get isFontLoadingAPISupported(){var i;const t=!!((i=this._document)!=null&&i.fonts);return Ki(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return Ki(this,"isSyncFontLoadingSupported",sc||Zo.platform.isFirefox)}_queueLoadingCallback(t){function i(){for(La(!l.done,"completeRequest() cannot be called twice."),l.done=!0;s.length>0&&s[0].done;){const d=s.shift();setTimeout(d.callback,0)}}const{loadingRequests:s}=this,l={done:!1,complete:i,callback:t};return s.push(l),l}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Ki(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,i){function s(V,G){return V.charCodeAt(G)<<24|V.charCodeAt(G+1)<<16|V.charCodeAt(G+2)<<8|V.charCodeAt(G+3)&255}function l(V,G,$,ne){const Y=V.substring(0,G),le=V.substring(G+$);return Y+ne+le}let d,u;const p=this._document.createElement("canvas");p.width=1,p.height=1;const m=p.getContext("2d");let y=0;function _(V,G){if(++y>30){Ei("Load test font never loaded."),G();return}if(m.font="30px "+V,m.fillText(".",0,20),m.getImageData(0,0,1,1).data[3]>0){G();return}setTimeout(_.bind(null,V,G))}const E=`lt${Date.now()}${this.loadTestFontId++}`;let C=this._loadTestFont;C=l(C,976,E.length,E);const N=16,O=1482184792;let D=s(C,N);for(d=0,u=E.length-3;d<u;d+=4)D=D-O+s(E,d)|0;d<E.length&&(D=D-O+s(E+"XXX",d)|0),C=l(C,N,4,UQe(D));const P=`url(data:font/opentype;base64,${btoa(C)});`,j=`@font-face {font-family:"${E}";src:${P}}`;this.insertRule(j);const M=this._document.createElement("div");M.style.visibility="hidden",M.style.width=M.style.height="10px",M.style.position="absolute",M.style.top=M.style.left="0px";for(const V of[t.loadedName,E]){const G=this._document.createElement("span");G.textContent="Hi",G.style.fontFamily=V,M.append(G)}this._document.body.append(M),_(E,()=>{M.remove(),i.complete()})}}PT=new WeakMap;class tZe{constructor(t,i=null){this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this._inspectFont=i}createNativeFontFace(){var i;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const s={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(s.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,s)}return(i=this._inspectFont)==null||i.call(this,this),t}createFontFaceRule(){var s;if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${QEe(this.data)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let l=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(l+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${l}src:${t}}`}return(s=this._inspectFont)==null||s.call(this,this,t),i}getPathGenerator(t,i){if(this.compiledGlyphs[i]!==void 0)return this.compiledGlyphs[i];const s=this.loadedName+"_path_"+i;let l;try{l=t.get(s)}catch(u){Ei(`getPathGenerator - ignoring character: "${u}".`)}const d=new Path2D(l||"");return this.fontExtraProperties||t.delete(s),this.compiledGlyphs[i]=d}}function nZe(n){if(n instanceof URL)return n.href;if(typeof n=="string"){if(sc)return n;const t=URL.parse(n,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function iZe(n){if(sc&&typeof D7<"u"&&n instanceof D7)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return AP(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n==null?void 0:n.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function tM(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}const gX=n=>typeof n=="object"&&Number.isInteger(n==null?void 0:n.num)&&n.num>=0&&Number.isInteger(n==null?void 0:n.gen)&&n.gen>=0,rZe=n=>typeof n=="object"&&typeof(n==null?void 0:n.name)=="string",sZe=HQe.bind(null,gX,rZe);var og,J9;class aZe{constructor(){J(this,og,new Map);J(this,J9,Promise.resolve())}postMessage(t,i){const s={data:structuredClone(t,i?{transfer:i}:null)};b(this,J9).then(()=>{for(const[l]of b(this,og))l.call(this,s)})}addEventListener(t,i,s=null){let l=null;if((s==null?void 0:s.signal)instanceof AbortSignal){const{signal:d}=s;if(d.aborted){Ei("LoopbackPort - cannot use an `aborted` signal.");return}const u=()=>this.removeEventListener(t,i);l=()=>d.removeEventListener("abort",u),d.addEventListener("abort",u)}b(this,og).set(i,l)}removeEventListener(t,i){const s=b(this,og).get(i);s==null||s(),b(this,og).delete(i)}terminate(){for(const[,t]of b(this,og))t==null||t();b(this,og).clear()}}og=new WeakMap,J9=new WeakMap;const nM={DATA:1,ERROR:2},Ia={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Xfe(){}function Wc(n){if(n instanceof Zv||n instanceof YY||n instanceof $fe||n instanceof n9||n instanceof LK)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||ns('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new Zv(n.message);case"InvalidPDFException":return new YY(n.message);case"PasswordException":return new $fe(n.message,n.code);case"ResponseException":return new n9(n.message,n.status,n.missing);case"UnknownErrorException":return new LK(n.message,n.details)}return new LK(n.message,n.toString())}var LT,Q9,O2e,Z9,P2e,ej,L2e,DT,FM;class h4{constructor(t,i,s){J(this,Q9);J(this,Z9);J(this,ej);J(this,DT);J(this,LT,new AbortController);this.sourceName=t,this.targetName=i,this.comObj=s,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),s.addEventListener("message",fe(this,Q9,O2e).bind(this),{signal:b(this,LT).signal})}on(t,i){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${t}"`);s[t]=i}send(t,i,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:i},s)}sendWithPromise(t,i,s){const l=this.callbackId++,d=Promise.withResolvers();this.callbackCapabilities[l]=d;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:l,data:i},s)}catch(u){d.reject(u)}return d.promise}sendWithStream(t,i,s,l){const d=this.streamId++,u=this.sourceName,p=this.targetName,m=this.comObj;return new ReadableStream({start:y=>{const _=Promise.withResolvers();return this.streamControllers[d]={controller:y,startCall:_,pullCall:null,cancelCall:null,isClosed:!1},m.postMessage({sourceName:u,targetName:p,action:t,streamId:d,data:i,desiredSize:y.desiredSize},l),_.promise},pull:y=>{const _=Promise.withResolvers();return this.streamControllers[d].pullCall=_,m.postMessage({sourceName:u,targetName:p,stream:Ia.PULL,streamId:d,desiredSize:y.desiredSize}),_.promise},cancel:y=>{La(y instanceof Error,"cancel must have a valid reason");const _=Promise.withResolvers();return this.streamControllers[d].cancelCall=_,this.streamControllers[d].isClosed=!0,m.postMessage({sourceName:u,targetName:p,stream:Ia.CANCEL,streamId:d,reason:Wc(y)}),_.promise}},s)}destroy(){var t;(t=b(this,LT))==null||t.abort(),te(this,LT,null)}}LT=new WeakMap,Q9=new WeakSet,O2e=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){fe(this,ej,L2e).call(this,t);return}if(t.callback){const s=t.callbackId,l=this.callbackCapabilities[s];if(!l)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],t.callback===nM.DATA)l.resolve(t.data);else if(t.callback===nM.ERROR)l.reject(Wc(t.reason));else throw new Error("Unexpected callback case");return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const s=this.sourceName,l=t.sourceName,d=this.comObj;Promise.try(i,t.data).then(function(u){d.postMessage({sourceName:s,targetName:l,callback:nM.DATA,callbackId:t.callbackId,data:u})},function(u){d.postMessage({sourceName:s,targetName:l,callback:nM.ERROR,callbackId:t.callbackId,reason:Wc(u)})});return}if(t.streamId){fe(this,Z9,P2e).call(this,t);return}i(t.data)},Z9=new WeakSet,P2e=function(t){const i=t.streamId,s=this.sourceName,l=t.sourceName,d=this.comObj,u=this,p=this.actionHandler[t.action],m={enqueue(y,_=1,E){if(this.isCancelled)return;const C=this.desiredSize;this.desiredSize-=_,C>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),d.postMessage({sourceName:s,targetName:l,stream:Ia.ENQUEUE,streamId:i,chunk:y},E)},close(){this.isCancelled||(this.isCancelled=!0,d.postMessage({sourceName:s,targetName:l,stream:Ia.CLOSE,streamId:i}),delete u.streamSinks[i])},error(y){La(y instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,d.postMessage({sourceName:s,targetName:l,stream:Ia.ERROR,streamId:i,reason:Wc(y)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};m.sinkCapability.resolve(),m.ready=m.sinkCapability.promise,this.streamSinks[i]=m,Promise.try(p,t.data,m).then(function(){d.postMessage({sourceName:s,targetName:l,stream:Ia.START_COMPLETE,streamId:i,success:!0})},function(y){d.postMessage({sourceName:s,targetName:l,stream:Ia.START_COMPLETE,streamId:i,reason:Wc(y)})})},ej=new WeakSet,L2e=function(t){const i=t.streamId,s=this.sourceName,l=t.sourceName,d=this.comObj,u=this.streamControllers[i],p=this.streamSinks[i];switch(t.stream){case Ia.START_COMPLETE:t.success?u.startCall.resolve():u.startCall.reject(Wc(t.reason));break;case Ia.PULL_COMPLETE:t.success?u.pullCall.resolve():u.pullCall.reject(Wc(t.reason));break;case Ia.PULL:if(!p){d.postMessage({sourceName:s,targetName:l,stream:Ia.PULL_COMPLETE,streamId:i,success:!0});break}p.desiredSize<=0&&t.desiredSize>0&&p.sinkCapability.resolve(),p.desiredSize=t.desiredSize,Promise.try(p.onPull||Xfe).then(function(){d.postMessage({sourceName:s,targetName:l,stream:Ia.PULL_COMPLETE,streamId:i,success:!0})},function(y){d.postMessage({sourceName:s,targetName:l,stream:Ia.PULL_COMPLETE,streamId:i,reason:Wc(y)})});break;case Ia.ENQUEUE:if(La(u,"enqueue should have stream controller"),u.isClosed)break;u.controller.enqueue(t.chunk);break;case Ia.CLOSE:if(La(u,"close should have stream controller"),u.isClosed)break;u.isClosed=!0,u.controller.close(),fe(this,DT,FM).call(this,u,i);break;case Ia.ERROR:La(u,"error should have stream controller"),u.controller.error(Wc(t.reason)),fe(this,DT,FM).call(this,u,i);break;case Ia.CANCEL_COMPLETE:t.success?u.cancelCall.resolve():u.cancelCall.reject(Wc(t.reason)),fe(this,DT,FM).call(this,u,i);break;case Ia.CANCEL:if(!p)break;const m=Wc(t.reason);Promise.try(p.onCancel||Xfe,m).then(function(){d.postMessage({sourceName:s,targetName:l,stream:Ia.CANCEL_COMPLETE,streamId:i,success:!0})},function(y){d.postMessage({sourceName:s,targetName:l,stream:Ia.CANCEL_COMPLETE,streamId:i,reason:Wc(y)})}),p.sinkCapability.reject(m),p.isCancelled=!0,delete this.streamSinks[i];break;default:throw new Error("Unexpected stream case")}},DT=new WeakSet,FM=async function(t,i){var s,l,d;await Promise.allSettled([(s=t.startCall)==null?void 0:s.promise,(l=t.pullCall)==null?void 0:l.promise,(d=t.cancelCall)==null?void 0:d.promise]),delete this.streamControllers[i]};var I5;class D2e{constructor({enableHWA:t=!1}){J(this,I5,!1);te(this,I5,t)}create(t,i){if(t<=0||i<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,i);return{canvas:s,context:s.getContext("2d",{willReadFrequently:!b(this,I5)})}}reset(t,i,s){if(!t.canvas)throw new Error("Canvas is not specified");if(i<=0||s<=0)throw new Error("Invalid canvas size");t.canvas.width=i,t.canvas.height=s}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,i){ns("Abstract method `_createCanvas` called.")}}I5=new WeakMap;class oZe extends D2e{constructor({ownerDocument:t=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=t}_createCanvas(t,i){const s=this._document.createElement("canvas");return s.width=t,s.height=i,s}}class k2e{constructor({baseUrl:t=null,isCompressed:i=!0}){this.baseUrl=t,this.isCompressed=i}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const i=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(i).then(s=>({cMapData:s,isCompressed:this.isCompressed})).catch(s=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}async _fetch(t){ns("Abstract method `_fetch` called.")}}class Jfe extends k2e{async _fetch(t){const i=await IP(t,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):AP(i)}}class M2e{addFilter(t){return"none"}addHCMFilter(t,i){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,i,s,l,d){return"none"}destroy(t=!1){}}var PE,kT,lg,cg,_l,LE,DE,mo,vl,kE,f4,X1,hC,MT,BM,J1,fC,tj,j2e,N5,vX,Q1,pC,ME,p4,jE,m4,O5,yX,UE,g4;class lZe extends M2e{constructor({docId:i,ownerDocument:s=globalThis.document}){super();J(this,mo);J(this,kE);J(this,X1);J(this,MT);J(this,J1);J(this,tj);J(this,N5);J(this,Q1);J(this,ME);J(this,jE);J(this,O5);J(this,UE);J(this,PE,void 0);J(this,kT,void 0);J(this,lg,void 0);J(this,cg,void 0);J(this,_l,void 0);J(this,LE,void 0);J(this,DE,0);te(this,cg,i),te(this,_l,s)}addFilter(i){if(!i)return"none";let s=b(this,mo,vl).get(i);if(s)return s;const[l,d,u]=fe(this,MT,BM).call(this,i),p=i.length===1?l:`${l}${d}${u}`;if(s=b(this,mo,vl).get(p),s)return b(this,mo,vl).set(i,s),s;const m=`g_${b(this,cg)}_transfer_map_${ea(this,DE)._++}`,y=fe(this,J1,fC).call(this,m);b(this,mo,vl).set(i,y),b(this,mo,vl).set(p,y);const _=fe(this,Q1,pC).call(this,m);return fe(this,jE,m4).call(this,l,d,u,_),y}addHCMFilter(i,s){var N;const l=`${i}-${s}`,d="base";let u=b(this,kE,f4).get(d);if((u==null?void 0:u.key)===l||(u?((N=u.filter)==null||N.remove(),u.key=l,u.url="none",u.filter=null):(u={key:l,url:"none",filter:null},b(this,kE,f4).set(d,u)),!i||!s))return u.url;const p=fe(this,UE,g4).call(this,i);i=In.makeHexColor(...p);const m=fe(this,UE,g4).call(this,s);if(s=In.makeHexColor(...m),b(this,X1,hC).style.color="",i==="#000000"&&s==="#ffffff"||i===s)return u.url;const y=new Array(256);for(let O=0;O<=255;O++){const D=O/255;y[O]=D<=.03928?D/12.92:((D+.055)/1.055)**2.4}const _=y.join(","),E=`g_${b(this,cg)}_hcm_filter`,C=u.filter=fe(this,Q1,pC).call(this,E);fe(this,jE,m4).call(this,_,_,_,C),fe(this,N5,vX).call(this,C);const x=(O,D)=>{const P=p[O]/255,j=m[O]/255,M=new Array(D+1);for(let V=0;V<=D;V++)M[V]=P+V/D*(j-P);return M.join(",")};return fe(this,jE,m4).call(this,x(0,5),x(1,5),x(2,5),C),u.url=fe(this,J1,fC).call(this,E),u.url}addAlphaFilter(i){let s=b(this,mo,vl).get(i);if(s)return s;const[l]=fe(this,MT,BM).call(this,[i]),d=`alpha_${l}`;if(s=b(this,mo,vl).get(d),s)return b(this,mo,vl).set(i,s),s;const u=`g_${b(this,cg)}_alpha_map_${ea(this,DE)._++}`,p=fe(this,J1,fC).call(this,u);b(this,mo,vl).set(i,p),b(this,mo,vl).set(d,p);const m=fe(this,Q1,pC).call(this,u);return fe(this,O5,yX).call(this,l,m),p}addLuminosityFilter(i){let s=b(this,mo,vl).get(i||"luminosity");if(s)return s;let l,d;if(i?([l]=fe(this,MT,BM).call(this,[i]),d=`luminosity_${l}`):d="luminosity",s=b(this,mo,vl).get(d),s)return b(this,mo,vl).set(i,s),s;const u=`g_${b(this,cg)}_luminosity_map_${ea(this,DE)._++}`,p=fe(this,J1,fC).call(this,u);b(this,mo,vl).set(i,p),b(this,mo,vl).set(d,p);const m=fe(this,Q1,pC).call(this,u);return fe(this,tj,j2e).call(this,m),i&&fe(this,O5,yX).call(this,l,m),p}addHighlightHCMFilter(i,s,l,d,u){var j;const p=`${s}-${l}-${d}-${u}`;let m=b(this,kE,f4).get(i);if((m==null?void 0:m.key)===p||(m?((j=m.filter)==null||j.remove(),m.key=p,m.url="none",m.filter=null):(m={key:p,url:"none",filter:null},b(this,kE,f4).set(i,m)),!s||!l))return m.url;const[y,_]=[s,l].map(fe(this,UE,g4).bind(this));let E=Math.round(.2126*y[0]+.7152*y[1]+.0722*y[2]),C=Math.round(.2126*_[0]+.7152*_[1]+.0722*_[2]),[x,N]=[d,u].map(fe(this,UE,g4).bind(this));C<E&&([E,C,x,N]=[C,E,N,x]),b(this,X1,hC).style.color="";const O=(M,V,G)=>{const $=new Array(256),ne=(C-E)/G,Y=M/255,le=(V-M)/(255*G);let re=0;for(let ee=0;ee<=G;ee++){const de=Math.round(E+ee*ne),H=Y+ee*le;for(let ae=re;ae<=de;ae++)$[ae]=H;re=de+1}for(let ee=re;ee<256;ee++)$[ee]=$[re-1];return $.join(",")},D=`g_${b(this,cg)}_hcm_${i}_filter`,P=m.filter=fe(this,Q1,pC).call(this,D);return fe(this,N5,vX).call(this,P),fe(this,jE,m4).call(this,O(x[0],N[0],5),O(x[1],N[1],5),O(x[2],N[2],5),P),m.url=fe(this,J1,fC).call(this,D),m.url}destroy(i=!1){var s,l,d,u;i&&((s=b(this,LE))!=null&&s.size)||((l=b(this,lg))==null||l.parentNode.parentNode.remove(),te(this,lg,null),(d=b(this,kT))==null||d.clear(),te(this,kT,null),(u=b(this,LE))==null||u.clear(),te(this,LE,null),te(this,DE,0))}}PE=new WeakMap,kT=new WeakMap,lg=new WeakMap,cg=new WeakMap,_l=new WeakMap,LE=new WeakMap,DE=new WeakMap,mo=new WeakSet,vl=function(){return b(this,kT)||te(this,kT,new Map)},kE=new WeakSet,f4=function(){return b(this,LE)||te(this,LE,new Map)},X1=new WeakSet,hC=function(){if(!b(this,lg)){const i=b(this,_l).createElement("div"),{style:s}=i;s.visibility="hidden",s.contain="strict",s.width=s.height=0,s.position="absolute",s.top=s.left=0,s.zIndex=-1;const l=b(this,_l).createElementNS(Um,"svg");l.setAttribute("width",0),l.setAttribute("height",0),te(this,lg,b(this,_l).createElementNS(Um,"defs")),i.append(l),l.append(b(this,lg)),b(this,_l).body.append(i)}return b(this,lg)},MT=new WeakSet,BM=function(i){if(i.length===1){const y=i[0],_=new Array(256);for(let C=0;C<256;C++)_[C]=y[C]/255;const E=_.join(",");return[E,E,E]}const[s,l,d]=i,u=new Array(256),p=new Array(256),m=new Array(256);for(let y=0;y<256;y++)u[y]=s[y]/255,p[y]=l[y]/255,m[y]=d[y]/255;return[u.join(","),p.join(","),m.join(",")]},J1=new WeakSet,fC=function(i){if(b(this,PE)===void 0){te(this,PE,"");const s=b(this,_l).URL;s!==b(this,_l).baseURI&&(TF(s)?Ei('#createUrl: ignore "data:"-URL for performance reasons.'):te(this,PE,YEe(s,"")))}return`url(${b(this,PE)}#${i})`},tj=new WeakSet,j2e=function(i){const s=b(this,_l).createElementNS(Um,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),i.append(s)},N5=new WeakSet,vX=function(i){const s=b(this,_l).createElementNS(Um,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),i.append(s)},Q1=new WeakSet,pC=function(i){const s=b(this,_l).createElementNS(Um,"filter");return s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("id",i),b(this,X1,hC).append(s),s},ME=new WeakSet,p4=function(i,s,l){const d=b(this,_l).createElementNS(Um,s);d.setAttribute("type","discrete"),d.setAttribute("tableValues",l),i.append(d)},jE=new WeakSet,m4=function(i,s,l,d){const u=b(this,_l).createElementNS(Um,"feComponentTransfer");d.append(u),fe(this,ME,p4).call(this,u,"feFuncR",i),fe(this,ME,p4).call(this,u,"feFuncG",s),fe(this,ME,p4).call(this,u,"feFuncB",l)},O5=new WeakSet,yX=function(i,s){const l=b(this,_l).createElementNS(Um,"feComponentTransfer");s.append(l),fe(this,ME,p4).call(this,l,"feFuncA",i)},UE=new WeakSet,g4=function(i){return b(this,X1,hC).style.color=i,RF(getComputedStyle(b(this,X1,hC)).getPropertyValue("color"))};class U2e{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch(s=>{throw new Error(`Unable to load font data at: ${i}`)})}async _fetch(t){ns("Abstract method `_fetch` called.")}}class Qfe extends U2e{async _fetch(t){const i=await IP(t,"arraybuffer");return new Uint8Array(i)}}class F2e{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch(s=>{throw new Error(`Unable to load wasm data at: ${i}`)})}async _fetch(t){ns("Abstract method `_fetch` called.")}}class Zfe extends F2e{async _fetch(t){const i=await IP(t,"arraybuffer");return new Uint8Array(i)}}sc&&Ei("Please use the `legacy` build in Node.js environments.");async function VZ(n){const i=await lc.getBuiltinModule("fs").promises.readFile(n);return new Uint8Array(i)}class cZe extends M2e{}class dZe extends D2e{_createCanvas(t,i){return lc.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,i)}}class uZe extends k2e{async _fetch(t){return VZ(t)}}class hZe extends U2e{async _fetch(t){return VZ(t)}}class fZe extends F2e{async _fetch(t){return VZ(t)}}const nC="__forcedDependency";var Od,tc,jT,xp,UT,dg,Vr,Zr,ug,Pd,Z1,FT,ev,tv;class pZe{constructor(t){J(this,Od,{__proto__:null});J(this,tc,{__proto__:null,transform:[],moveText:[],sameLineText:[],[nC]:[]});J(this,jT,new Map);J(this,xp,[]);J(this,UT,[]);J(this,dg,[[1,0,0,1,0,0]]);J(this,Vr,[-1/0,-1/0,1/0,1/0]);J(this,Zr,new Float64Array([1/0,1/0,-1/0,-1/0]));J(this,ug,-1);J(this,Pd,new Set);J(this,Z1,new Map);J(this,FT,new Map);J(this,ev,void 0);J(this,tv,void 0);te(this,ev,t.width),te(this,tv,t.height)}save(t){return te(this,Od,{__proto__:b(this,Od)}),te(this,tc,{__proto__:b(this,tc),transform:{__proto__:b(this,tc).transform},moveText:{__proto__:b(this,tc).moveText},sameLineText:{__proto__:b(this,tc).sameLineText},[nC]:{__proto__:b(this,tc)[nC]}}),te(this,Vr,{__proto__:b(this,Vr)}),b(this,xp).push([t,null]),this}restore(t){const i=Object.getPrototypeOf(b(this,Od));if(i===null)return this;te(this,Od,i),te(this,tc,Object.getPrototypeOf(b(this,tc))),te(this,Vr,Object.getPrototypeOf(b(this,Vr)));const s=b(this,xp).pop();return s!==void 0&&(s[1]=t),this}recordOpenMarker(t){return b(this,xp).push([t,null]),this}getOpenMarker(){return b(this,xp).length===0?null:b(this,xp).at(-1)[0]}recordCloseMarker(t){const i=b(this,xp).pop();return i!==void 0&&(i[1]=t),this}beginMarkedContent(t){return b(this,UT).push([t,null]),this}endMarkedContent(t){const i=b(this,UT).pop();return i!==void 0&&(i[1]=t),this}pushBaseTransform(t){return b(this,dg).push(In.multiplyByDOMMatrix(b(this,dg).at(-1),t.getTransform())),this}popBaseTransform(){return b(this,dg).length>1&&b(this,dg).pop(),this}recordSimpleData(t,i){return b(this,Od)[t]=i,this}recordIncrementalData(t,i){return b(this,tc)[t].push(i),this}resetIncrementalData(t,i){return b(this,tc)[t].length=0,this}recordNamedData(t,i){return b(this,jT).set(t,i),this}recordFutureForcedDependency(t,i){return this.recordIncrementalData(nC,i),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const i of t)i in b(this,Od)&&this.recordFutureForcedDependency(i,b(this,Od)[i]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of b(this,Pd))this.recordFutureForcedDependency(nC,t);return this}resetBBox(t){return te(this,ug,t),b(this,Zr)[0]=1/0,b(this,Zr)[1]=1/0,b(this,Zr)[2]=-1/0,b(this,Zr)[3]=-1/0,this}get hasPendingBBox(){return b(this,ug)!==-1}recordClipBox(t,i,s,l,d,u){const p=In.multiplyByDOMMatrix(b(this,dg).at(-1),i.getTransform()),m=[1/0,1/0,-1/0,-1/0];In.axialAlignedBoundingBox([s,d,l,u],p,m);const y=In.intersect(b(this,Vr),m);return y?(b(this,Vr)[0]=y[0],b(this,Vr)[1]=y[1],b(this,Vr)[2]=y[2],b(this,Vr)[3]=y[3]):(b(this,Vr)[0]=b(this,Vr)[1]=1/0,b(this,Vr)[2]=b(this,Vr)[3]=-1/0),this}recordBBox(t,i,s,l,d,u){const p=b(this,Vr);if(p[0]===1/0)return this;const m=In.multiplyByDOMMatrix(b(this,dg).at(-1),i.getTransform());if(p[0]===-1/0)return In.axialAlignedBoundingBox([s,d,l,u],m,b(this,Zr)),this;const y=[1/0,1/0,-1/0,-1/0];return In.axialAlignedBoundingBox([s,d,l,u],m,y),b(this,Zr)[0]=Math.min(b(this,Zr)[0],Math.max(y[0],p[0])),b(this,Zr)[1]=Math.min(b(this,Zr)[1],Math.max(y[1],p[1])),b(this,Zr)[2]=Math.max(b(this,Zr)[2],Math.min(y[2],p[2])),b(this,Zr)[3]=Math.max(b(this,Zr)[3],Math.min(y[3],p[3])),this}recordCharacterBBox(t,i,s,l=1,d=0,u=0,p){const m=s.bbox;let y,_;if(m&&(y=m[2]!==m[0]&&m[3]!==m[1]&&b(this,FT).get(s),y!==!1&&(_=[0,0,0,0],In.axialAlignedBoundingBox(m,s.fontMatrix,_),(l!==1||d!==0||u!==0)&&In.scaleMinMax([l,0,0,-l,d,u],_),y)))return this.recordBBox(t,i,_[0],_[2],_[1],_[3]);if(!p)return this.recordFullPageBBox(t);const E=p();return m&&_&&y===void 0&&(y=_[0]<=d-E.actualBoundingBoxLeft&&_[2]>=d+E.actualBoundingBoxRight&&_[1]<=u-E.actualBoundingBoxAscent&&_[3]>=u+E.actualBoundingBoxDescent,b(this,FT).set(s,y),y)?this.recordBBox(t,i,_[0],_[2],_[1],_[3]):this.recordBBox(t,i,d-E.actualBoundingBoxLeft,d+E.actualBoundingBoxRight,u-E.actualBoundingBoxAscent,u+E.actualBoundingBoxDescent)}recordFullPageBBox(t){return b(this,Zr)[0]=Math.max(0,b(this,Vr)[0]),b(this,Zr)[1]=Math.max(0,b(this,Vr)[1]),b(this,Zr)[2]=Math.min(b(this,ev),b(this,Vr)[2]),b(this,Zr)[3]=Math.min(b(this,tv),b(this,Vr)[3]),this}getSimpleIndex(t){return b(this,Od)[t]}recordDependencies(t,i){const s=b(this,Pd),l=b(this,Od),d=b(this,tc);for(const u of i)u in b(this,Od)?s.add(l[u]):u in d&&d[u].forEach(s.add,s);return this}copyDependenciesFromIncrementalOperation(t,i){const s=b(this,Z1),l=b(this,Pd);for(const d of b(this,tc)[i])s.get(d).dependencies.forEach(l.add,l.add(d));return this}recordNamedDependency(t,i){return b(this,jT).has(i)&&b(this,Pd).add(b(this,jT).get(i)),this}recordOperation(t,i=!1){this.recordDependencies(t,[nC]);const s=new Set(b(this,Pd)),l=b(this,xp).concat(b(this,UT)),d=b(this,ug)===t?{minX:b(this,Zr)[0],minY:b(this,Zr)[1],maxX:b(this,Zr)[2],maxY:b(this,Zr)[3]}:null;return b(this,Z1).set(t,{bbox:d,pairs:l,dependencies:s}),i||te(this,ug,-1),b(this,Pd).clear(),this}bboxToClipBoxDropOperation(t){return b(this,ug)!==-1&&(te(this,ug,-1),b(this,Vr)[0]=Math.max(b(this,Vr)[0],b(this,Zr)[0]),b(this,Vr)[1]=Math.max(b(this,Vr)[1],b(this,Zr)[1]),b(this,Vr)[2]=Math.min(b(this,Vr)[2],b(this,Zr)[2]),b(this,Vr)[3]=Math.min(b(this,Vr)[3],b(this,Zr)[3])),b(this,Pd).clear(),this}_takePendingDependencies(){const t=b(this,Pd);return te(this,Pd,new Set),t}_extractOperation(t){const i=b(this,Z1).get(t);return b(this,Z1).delete(t),i}_pushPendingDependencies(t){for(const i of t)b(this,Pd).add(i)}take(){return b(this,FT).clear(),Array.from(b(this,Z1),([t,{bbox:i,pairs:s,dependencies:l}])=>(s.forEach(d=>d.forEach(l.add,l)),l.delete(t),{minX:((i==null?void 0:i.minX)??0)/b(this,ev),maxX:((i==null?void 0:i.maxX)??b(this,ev))/b(this,ev),minY:((i==null?void 0:i.minY)??0)/b(this,tv),maxY:((i==null?void 0:i.maxY)??b(this,tv))/b(this,tv),dependencies:Array.from(l).sort((d,u)=>d-u),idx:t}))}}Od=new WeakMap,tc=new WeakMap,jT=new WeakMap,xp=new WeakMap,UT=new WeakMap,dg=new WeakMap,Vr=new WeakMap,Zr=new WeakMap,ug=new WeakMap,Pd=new WeakMap,Z1=new WeakMap,FT=new WeakMap,ev=new WeakMap,tv=new WeakMap;var Dr,zs,BT,nv,VT;const xee=class xee{constructor(t,i){J(this,Dr,void 0);J(this,zs,void 0);J(this,BT,0);J(this,nv,void 0);J(this,VT,0);if(t instanceof xee)return t;te(this,Dr,t),te(this,nv,t._takePendingDependencies()),te(this,zs,i)}save(t){return ea(this,VT)._++,b(this,Dr).save(b(this,zs)),this}restore(t){return b(this,VT)>0&&(b(this,Dr).restore(b(this,zs)),ea(this,VT)._--),this}recordOpenMarker(t){return ea(this,BT)._++,this}getOpenMarker(){return b(this,BT)>0?b(this,zs):b(this,Dr).getOpenMarker()}recordCloseMarker(t){return ea(this,BT)._--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return b(this,Dr).pushBaseTransform(t),this}popBaseTransform(){return b(this,Dr).popBaseTransform(),this}recordSimpleData(t,i){return b(this,Dr).recordSimpleData(t,b(this,zs)),this}recordIncrementalData(t,i){return b(this,Dr).recordIncrementalData(t,b(this,zs)),this}resetIncrementalData(t,i){return b(this,Dr).resetIncrementalData(t,b(this,zs)),this}recordNamedData(t,i){return this}recordFutureForcedDependency(t,i){return b(this,Dr).recordFutureForcedDependency(t,b(this,zs)),this}inheritSimpleDataAsFutureForcedDependencies(t){return b(this,Dr).inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return b(this,Dr).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return b(this,Dr).hasPendingBBox||b(this,Dr).resetBBox(b(this,zs)),this}get hasPendingBBox(){return b(this,Dr).hasPendingBBox}recordClipBox(t,i,s,l,d,u){return b(this,Dr).recordClipBox(b(this,zs),i,s,l,d,u),this}recordBBox(t,i,s,l,d,u){return b(this,Dr).recordBBox(b(this,zs),i,s,l,d,u),this}recordCharacterBBox(t,i,s,l,d,u,p){return b(this,Dr).recordCharacterBBox(b(this,zs),i,s,l,d,u,p),this}recordFullPageBBox(t){return b(this,Dr).recordFullPageBBox(b(this,zs)),this}getSimpleIndex(t){return b(this,Dr).getSimpleIndex(t)}recordDependencies(t,i){return b(this,Dr).recordDependencies(b(this,zs),i),this}copyDependenciesFromIncrementalOperation(t,i){return b(this,Dr).copyDependenciesFromIncrementalOperation(b(this,zs),i),this}recordNamedDependency(t,i){return b(this,Dr).recordNamedDependency(b(this,zs),i),this}recordOperation(t){b(this,Dr).recordOperation(b(this,zs),!0);const i=b(this,Dr)._extractOperation(b(this,zs));for(const s of i.dependencies)b(this,nv).add(s);return b(this,nv).delete(b(this,zs)),b(this,nv).delete(null),this}bboxToClipBoxDropOperation(t){return b(this,Dr).bboxToClipBoxDropOperation(b(this,zs)),this}recordNestedDependencies(){b(this,Dr)._pushPendingDependencies(b(this,nv))}take(){throw new Error("Unreachable")}};Dr=new WeakMap,zs=new WeakMap,BT=new WeakMap,nv=new WeakMap,VT=new WeakMap;let a9=xee;const zu={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation"],transform:["transform"],transformAndFill:["transform","fillColor"]},qo={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function _X(n,t){if(!t)return;const i=t[2]-t[0],s=t[3]-t[1],l=new Path2D;l.rect(t[0],t[1],i,s),n.clip(l)}class zZ{isModifyingCurrentTransform(){return!1}getPattern(){ns("Abstract method `getPattern` called.")}}class mZe extends zZ{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let i;this._type==="axial"?i=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(i=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const s of this._colorStops)i.addColorStop(s[0],s[1]);return i}getPattern(t,i,s,l){let d;if(l===qo.STROKE||l===qo.FILL){const u=i.current.getClippedPathBoundingBox(l,Hs(t))||[0,0,0,0],p=Math.ceil(u[2]-u[0])||1,m=Math.ceil(u[3]-u[1])||1,y=i.cachedCanvases.getCanvas("pattern",p,m),_=y.context;_.clearRect(0,0,_.canvas.width,_.canvas.height),_.beginPath(),_.rect(0,0,_.canvas.width,_.canvas.height),_.translate(-u[0],-u[1]),s=In.transform(s,[1,0,0,1,u[0],u[1]]),_.transform(...i.baseTransform),this.matrix&&_.transform(...this.matrix),_X(_,this._bbox),_.fillStyle=this._createGradient(_),_.fill(),d=t.createPattern(y.canvas,"no-repeat");const E=new DOMMatrix(s);d.setTransform(E)}else _X(t,this._bbox),d=this._createGradient(t);return d}}function MK(n,t,i,s,l,d,u,p){const m=t.coords,y=t.colors,_=n.data,E=n.width*4;let C;m[i+1]>m[s+1]&&(C=i,i=s,s=C,C=d,d=u,u=C),m[s+1]>m[l+1]&&(C=s,s=l,l=C,C=u,u=p,p=C),m[i+1]>m[s+1]&&(C=i,i=s,s=C,C=d,d=u,u=C);const x=(m[i]+t.offsetX)*t.scaleX,N=(m[i+1]+t.offsetY)*t.scaleY,O=(m[s]+t.offsetX)*t.scaleX,D=(m[s+1]+t.offsetY)*t.scaleY,P=(m[l]+t.offsetX)*t.scaleX,j=(m[l+1]+t.offsetY)*t.scaleY;if(N>=j)return;const M=y[d],V=y[d+1],G=y[d+2],$=y[u],ne=y[u+1],Y=y[u+2],le=y[p],re=y[p+1],ee=y[p+2],de=Math.round(N),H=Math.round(j);let ae,_e,me,Ce,he,pe,Oe,Fe;for(let Ue=de;Ue<=H;Ue++){if(Ue<D){const we=Ue<N?0:(N-Ue)/(N-D);ae=x-(x-O)*we,_e=M-(M-$)*we,me=V-(V-ne)*we,Ce=G-(G-Y)*we}else{let we;Ue>j?we=1:D===j?we=0:we=(D-Ue)/(D-j),ae=O-(O-P)*we,_e=$-($-le)*we,me=ne-(ne-re)*we,Ce=Y-(Y-ee)*we}let Ve;Ue<N?Ve=0:Ue>j?Ve=1:Ve=(N-Ue)/(N-j),he=x-(x-P)*Ve,pe=M-(M-le)*Ve,Oe=V-(V-re)*Ve,Fe=G-(G-ee)*Ve;const Re=Math.round(Math.min(ae,he)),Be=Math.round(Math.max(ae,he));let Xe=E*Ue+Re*4;for(let we=Re;we<=Be;we++)Ve=(ae-we)/(ae-he),Ve<0?Ve=0:Ve>1&&(Ve=1),_[Xe++]=_e-(_e-pe)*Ve|0,_[Xe++]=me-(me-Oe)*Ve|0,_[Xe++]=Ce-(Ce-Fe)*Ve|0,_[Xe++]=255}}function gZe(n,t,i){const s=t.coords,l=t.colors;let d,u;switch(t.type){case"lattice":const p=t.verticesPerRow,m=Math.floor(s.length/p)-1,y=p-1;for(d=0;d<m;d++){let _=d*p;for(let E=0;E<y;E++,_++)MK(n,i,s[_],s[_+1],s[_+p],l[_],l[_+1],l[_+p]),MK(n,i,s[_+p+1],s[_+1],s[_+p],l[_+p+1],l[_+1],l[_+p])}break;case"triangles":for(d=0,u=s.length;d<u;d+=3)MK(n,i,s[d],s[d+1],s[d+2],l[d],l[d+1],l[d+2]);break;default:throw new Error("illegal figure")}}class vZe extends zZ{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,i,s){const p=Math.floor(this._bounds[0]),m=Math.floor(this._bounds[1]),y=Math.ceil(this._bounds[2])-p,_=Math.ceil(this._bounds[3])-m,E=Math.min(Math.ceil(Math.abs(y*t[0]*1.1)),3e3),C=Math.min(Math.ceil(Math.abs(_*t[1]*1.1)),3e3),x=y/E,N=_/C,O={coords:this._coords,colors:this._colors,offsetX:-p,offsetY:-m,scaleX:1/x,scaleY:1/N},D=E+2*2,P=C+2*2,j=s.getCanvas("mesh",D,P),M=j.context,V=M.createImageData(E,C);if(i){const $=V.data;for(let ne=0,Y=$.length;ne<Y;ne+=4)$[ne]=i[0],$[ne+1]=i[1],$[ne+2]=i[2],$[ne+3]=255}for(const $ of this._figures)gZe(V,$,O);return M.putImageData(V,2,2),{canvas:j.canvas,offsetX:p-2*x,offsetY:m-2*N,scaleX:x,scaleY:N}}isModifyingCurrentTransform(){return!0}getPattern(t,i,s,l){_X(t,this._bbox);const d=new Float32Array(2);if(l===qo.SHADING)In.singularValueDecompose2dScale(Hs(t),d);else if(this.matrix){In.singularValueDecompose2dScale(this.matrix,d);const[p,m]=d;In.singularValueDecompose2dScale(i.baseTransform,d),d[0]*=p,d[1]*=m}else In.singularValueDecompose2dScale(i.baseTransform,d);const u=this._createMeshCanvas(d,l===qo.SHADING?null:this._background,i.cachedCanvases);return l!==qo.SHADING&&(t.setTransform(...i.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(u.offsetX,u.offsetY),t.scale(u.scaleX,u.scaleY),t.createPattern(u.canvas,"no-repeat")}}class yZe extends zZ{getPattern(){return"hotpink"}}function _Ze(n){switch(n[0]){case"RadialAxial":return new mZe(n);case"Mesh":return new vZe(n);case"Dummy":return new yZe}throw new Error(`Unknown IR type: ${n[0]}`)}const epe={COLORED:1,UNCOLORED:2},nj=class nj{constructor(t,i,s,l){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=i,this.canvasGraphicsFactory=s,this.baseTransform=l}createPatternCanvas(t){var he,pe,Oe,Fe;const{bbox:i,operatorList:s,paintType:l,tilingType:d,color:u,canvasGraphicsFactory:p}=this;let{xstep:m,ystep:y}=this;m=Math.abs(m),y=Math.abs(y),CF("TilingType: "+d);const _=i[0],E=i[1],C=i[2],x=i[3],N=C-_,O=x-E,D=new Float32Array(2);In.singularValueDecompose2dScale(this.matrix,D);const[P,j]=D;In.singularValueDecompose2dScale(this.baseTransform,D);const M=P*D[0],V=j*D[1];let G=N,$=O,ne=!1,Y=!1;const le=Math.ceil(m*M),re=Math.ceil(y*V),ee=Math.ceil(N*M),de=Math.ceil(O*V);le>=ee?G=m:ne=!0,re>=de?$=y:Y=!0;const H=this.getSizeAndScale(G,this.ctx.canvas.width,M),ae=this.getSizeAndScale($,this.ctx.canvas.height,V),_e=t.cachedCanvases.getCanvas("pattern",H.size,ae.size),me=_e.context,Ce=p.createCanvasGraphics(me);if(Ce.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(Ce,l,u),me.translate(-H.scale*_,-ae.scale*E),Ce.transform(0,H.scale,0,0,ae.scale,0,0),me.save(),(he=Ce.dependencyTracker)==null||he.save(),this.clipBbox(Ce,_,E,C,x),Ce.baseTransform=Hs(Ce.ctx),Ce.executeOperatorList(s),Ce.endDrawing(),(Fe=(pe=Ce.dependencyTracker)==null?void 0:(Oe=pe.restore()).recordNestedDependencies)==null||Fe.call(Oe),me.restore(),ne||Y){const Ue=_e.canvas;ne&&(G=m),Y&&($=y);const Ve=this.getSizeAndScale(G,this.ctx.canvas.width,M),Re=this.getSizeAndScale($,this.ctx.canvas.height,V),Be=Ve.size,Xe=Re.size,we=t.cachedCanvases.getCanvas("pattern-workaround",Be,Xe),We=we.context,st=ne?Math.floor(N/m):0,pt=Y?Math.floor(O/y):0;for(let Qe=0;Qe<=st;Qe++)for(let Je=0;Je<=pt;Je++)We.drawImage(Ue,Be*Qe,Xe*Je,Be,Xe,0,0,Be,Xe);return{canvas:we.canvas,scaleX:Ve.scale,scaleY:Re.scale,offsetX:_,offsetY:E}}return{canvas:_e.canvas,scaleX:H.scale,scaleY:ae.scale,offsetX:_,offsetY:E}}getSizeAndScale(t,i,s){const l=Math.max(nj.MAX_PATTERN_SIZE,i);let d=Math.ceil(t*s);return d>=l?d=l:s=d/t,{scale:s,size:d}}clipBbox(t,i,s,l,d){const u=l-i,p=d-s;t.ctx.rect(i,s,u,p),In.axialAlignedBoundingBox([i,s,l,d],Hs(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,i,s){const l=t.ctx,d=t.current;switch(i){case epe.COLORED:const{fillStyle:u,strokeStyle:p}=this.ctx;l.fillStyle=d.fillColor=u,l.strokeStyle=d.strokeColor=p;break;case epe.UNCOLORED:l.fillStyle=l.strokeStyle=s,d.fillColor=d.strokeColor=s;break;default:throw new jQe(`Unsupported paint type: ${i}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,i,s,l){let d=s;l!==qo.SHADING&&(d=In.transform(d,i.baseTransform),this.matrix&&(d=In.transform(d,this.matrix)));const u=this.createPatternCanvas(i);let p=new DOMMatrix(d);p=p.translate(u.offsetX,u.offsetY),p=p.scale(1/u.scaleX,1/u.scaleY);const m=t.createPattern(u.canvas,"repeat");return m.setTransform(p),m}};sn(nj,"MAX_PATTERN_SIZE",3e3);let EX=nj;function EZe({src:n,srcPos:t=0,dest:i,width:s,height:l,nonBlackColor:d=4294967295,inverseDecode:u=!1}){const p=Zo.isLittleEndian?4278190080:255,[m,y]=u?[d,p]:[p,d],_=s>>3,E=s&7,C=n.length;i=new Uint32Array(i.buffer);let x=0;for(let N=0;N<l;N++){for(const D=t+_;t<D;t++){const P=t<C?n[t]:255;i[x++]=P&128?y:m,i[x++]=P&64?y:m,i[x++]=P&32?y:m,i[x++]=P&16?y:m,i[x++]=P&8?y:m,i[x++]=P&4?y:m,i[x++]=P&2?y:m,i[x++]=P&1?y:m}if(E===0)continue;const O=t<C?n[t++]:255;for(let D=0;D<E;D++)i[x++]=O&1<<7-D?y:m}return{srcPos:t,destPos:x}}const tpe=16,npe=100,wZe=15,ipe=10,Jc=16,jK=new DOMMatrix,qd=new Float32Array(2),LC=new Float32Array([1/0,1/0,-1/0,-1/0]);function SZe(n,t){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){t.save(),this.__originalSave()},n.restore=function(){t.restore(),this.__originalRestore()},n.translate=function(i,s){t.translate(i,s),this.__originalTranslate(i,s)},n.scale=function(i,s){t.scale(i,s),this.__originalScale(i,s)},n.transform=function(i,s,l,d,u,p){t.transform(i,s,l,d,u,p),this.__originalTransform(i,s,l,d,u,p)},n.setTransform=function(i,s,l,d,u,p){t.setTransform(i,s,l,d,u,p),this.__originalSetTransform(i,s,l,d,u,p)},n.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},n.rotate=function(i){t.rotate(i),this.__originalRotate(i)},n.clip=function(i){t.clip(i),this.__originalClip(i)},n.moveTo=function(i,s){t.moveTo(i,s),this.__originalMoveTo(i,s)},n.lineTo=function(i,s){t.lineTo(i,s),this.__originalLineTo(i,s)},n.bezierCurveTo=function(i,s,l,d,u,p){t.bezierCurveTo(i,s,l,d,u,p),this.__originalBezierCurveTo(i,s,l,d,u,p)},n.rect=function(i,s,l,d){t.rect(i,s,l,d),this.__originalRect(i,s,l,d)},n.closePath=function(){t.closePath(),this.__originalClosePath()},n.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class bZe{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,i,s){let l;return this.cache[t]!==void 0?(l=this.cache[t],this.canvasFactory.reset(l,i,s)):(l=this.canvasFactory.create(i,s),this.cache[t]=l),l}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const i=this.cache[t];this.canvasFactory.destroy(i),delete this.cache[t]}}}function iM(n,t,i,s,l,d,u,p,m,y){const[_,E,C,x,N,O]=Hs(n);if(E===0&&C===0){const j=u*_+N,M=Math.round(j),V=p*x+O,G=Math.round(V),$=(u+m)*_+N,ne=Math.abs(Math.round($)-M)||1,Y=(p+y)*x+O,le=Math.abs(Math.round(Y)-G)||1;return n.setTransform(Math.sign(_),0,0,Math.sign(x),M,G),n.drawImage(t,i,s,l,d,0,0,ne,le),n.setTransform(_,E,C,x,N,O),[ne,le]}if(_===0&&x===0){const j=p*C+N,M=Math.round(j),V=u*E+O,G=Math.round(V),$=(p+y)*C+N,ne=Math.abs(Math.round($)-M)||1,Y=(u+m)*E+O,le=Math.abs(Math.round(Y)-G)||1;return n.setTransform(0,Math.sign(E),Math.sign(C),0,M,G),n.drawImage(t,i,s,l,d,0,0,le,ne),n.setTransform(_,E,C,x,N,O),[le,ne]}n.drawImage(t,i,s,l,d,u,p,m,y);const D=Math.hypot(_,E),P=Math.hypot(C,x);return[D*m,P*y]}class rpe{constructor(t,i,s){sn(this,"alphaIsShape",!1);sn(this,"fontSize",0);sn(this,"fontSizeScale",1);sn(this,"textMatrix",null);sn(this,"textMatrixScale",1);sn(this,"fontMatrix",qY);sn(this,"leading",0);sn(this,"x",0);sn(this,"y",0);sn(this,"lineX",0);sn(this,"lineY",0);sn(this,"charSpacing",0);sn(this,"wordSpacing",0);sn(this,"textHScale",1);sn(this,"textRenderingMode",Fo.FILL);sn(this,"textRise",0);sn(this,"fillColor","#000000");sn(this,"strokeColor","#000000");sn(this,"patternFill",!1);sn(this,"patternStroke",!1);sn(this,"fillAlpha",1);sn(this,"strokeAlpha",1);sn(this,"lineWidth",1);sn(this,"activeSMask",null);sn(this,"transferMaps","none");s==null||s(this),this.clipBox=new Float32Array([0,0,t,i]),this.minMax=LC.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=qo.FILL,i=null){const s=this.minMax.slice();if(t===qo.STROKE){i||ns("Stroke bounding box must include transform."),In.singularValueDecompose2dScale(i,qd);const l=qd[0]*this.lineWidth/2,d=qd[1]*this.lineWidth/2;s[0]-=l,s[1]-=d,s[2]+=l,s[3]+=d}return s}updateClipFromPath(){const t=In.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(LC,0)}getClippedPathBoundingBox(t=qo.FILL,i=null){return In.intersect(this.clipBox,this.getPathBoundingBox(t,i))}}function spe(n,t){if(t instanceof ImageData){n.putImageData(t,0,0);return}const i=t.height,s=t.width,l=i%Jc,d=(i-l)/Jc,u=l===0?d:d+1,p=n.createImageData(s,Jc);let m=0,y;const _=t.data,E=p.data;let C,x,N,O;if(t.kind===PM.GRAYSCALE_1BPP){const D=_.byteLength,P=new Uint32Array(E.buffer,0,E.byteLength>>2),j=P.length,M=s+7>>3,V=4294967295,G=Zo.isLittleEndian?4278190080:255;for(C=0;C<u;C++){for(N=C<d?Jc:l,y=0,x=0;x<N;x++){const $=D-m;let ne=0;const Y=$>M?s:$*8-7,le=Y&-8;let re=0,ee=0;for(;ne<le;ne+=8)ee=_[m++],P[y++]=ee&128?V:G,P[y++]=ee&64?V:G,P[y++]=ee&32?V:G,P[y++]=ee&16?V:G,P[y++]=ee&8?V:G,P[y++]=ee&4?V:G,P[y++]=ee&2?V:G,P[y++]=ee&1?V:G;for(;ne<Y;ne++)re===0&&(ee=_[m++],re=128),P[y++]=ee&re?V:G,re>>=1}for(;y<j;)P[y++]=0;n.putImageData(p,0,C*Jc)}}else if(t.kind===PM.RGBA_32BPP){for(x=0,O=s*Jc*4,C=0;C<d;C++)E.set(_.subarray(m,m+O)),m+=O,n.putImageData(p,0,x),x+=Jc;C<u&&(O=s*l*4,E.set(_.subarray(m,m+O)),n.putImageData(p,0,x))}else if(t.kind===PM.RGB_24BPP)for(N=Jc,O=s*N,C=0;C<u;C++){for(C>=d&&(N=l,O=s*N),y=0,x=O;x--;)E[y++]=_[m++],E[y++]=_[m++],E[y++]=_[m++],E[y++]=255;n.putImageData(p,0,C*Jc)}else throw new Error(`bad image kind: ${t.kind}`)}function ape(n,t){if(t.bitmap){n.drawImage(t.bitmap,0,0);return}const i=t.height,s=t.width,l=i%Jc,d=(i-l)/Jc,u=l===0?d:d+1,p=n.createImageData(s,Jc);let m=0;const y=t.data,_=p.data;for(let E=0;E<u;E++){const C=E<d?Jc:l;({srcPos:m}=EZe({src:y,srcPos:m,dest:_,width:s,height:C,nonBlackColor:0})),n.putImageData(p,0,E*Jc)}}function z3(n,t){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of i)n[s]!==void 0&&(t[s]=n[s]);n.setLineDash!==void 0&&(t.setLineDash(n.getLineDash()),t.lineDashOffset=n.lineDashOffset)}function rM(n){n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0);const{filter:t}=n;t!=="none"&&t!==""&&(n.filter="none")}function ope(n,t){if(t)return!0;In.singularValueDecompose2dScale(n,qd);const i=Math.fround(Kp.pixelRatio*ey.PDF_TO_CSS_UNITS);return qd[0]<=i&&qd[1]<=i}const CZe=["butt","round","square"],TZe=["miter","round","bevel"],RZe={},lpe={};var P5,wX,L5,SX,D5,bX;const Aee=class Aee{constructor(t,i,s,l,d,{optionalContentConfig:u,markedContentStack:p=null},m,y,_){J(this,P5);J(this,L5);J(this,D5);this.ctx=t,this.current=new rpe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=s,this.canvasFactory=l,this.filterFactory=d,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=p||[],this.optionalContentConfig=u,this.cachedCanvases=new bZe(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=m,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=y,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=_??null}getObject(t,i,s=null){var l;return typeof i=="string"?((l=this.dependencyTracker)==null||l.recordNamedDependency(t,i),i.startsWith("g_")?this.commonObjs.get(i):this.objs.get(i)):s}beginDrawing({transform:t,viewport:i,transparency:s=!1,background:l=null}){const d=this.ctx.canvas.width,u=this.ctx.canvas.height,p=this.ctx.fillStyle;if(this.ctx.fillStyle=l||"#ffffff",this.ctx.fillRect(0,0,d,u),this.ctx.fillStyle=p,s){const m=this.cachedCanvases.getCanvas("transparent",d,u);this.compositeCtx=this.ctx,this.transparentCanvas=m.canvas,this.ctx=m.context,this.ctx.save(),this.ctx.transform(...Hs(this.compositeCtx))}this.ctx.save(),rM(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=Hs(this.ctx)}executeOperatorList(t,i,s,l,d){var P;const u=t.argsArray,p=t.fnArray;let m=i||0;const y=u.length;if(y===m)return m;const _=y-m>ipe&&typeof s=="function",E=_?Date.now()+wZe:0;let C=0;const x=this.commonObjs,N=this.objs;let O,D;for(;;){if(l!==void 0&&m===l.nextBreakPoint)return l.breakIt(m,s),m;if(!d||d.has(m))if(O=p[m],D=u[m]??null,O!==RN.dependency)D===null?this[O](m):this[O](m,...D);else for(const j of D){(P=this.dependencyTracker)==null||P.recordNamedData(j,m);const M=j.startsWith("g_")?x:N;if(!M.has(j))return M.get(j,s),m}if(m++,m===y)return m;if(_&&++C>ipe){if(Date.now()>E)return s(),m;C=0}}}endDrawing(){fe(this,P5,wX).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const i of t.values())typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);t.clear()}this._cachedBitmapsMap.clear(),fe(this,L5,SX).call(this)}_scaleImage(t,i){const s=t.width??t.displayWidth,l=t.height??t.displayHeight;let d=Math.max(Math.hypot(i[0],i[1]),1),u=Math.max(Math.hypot(i[2],i[3]),1),p=s,m=l,y="prescale1",_,E;for(;d>2&&p>1||u>2&&m>1;){let C=p,x=m;d>2&&p>1&&(C=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p/2),d/=p/C),u>2&&m>1&&(x=m>=16384?Math.floor(m/2)-1||1:Math.ceil(m)/2,u/=m/x),_=this.cachedCanvases.getCanvas(y,C,x),E=_.context,E.clearRect(0,0,C,x),E.drawImage(t,0,0,p,m,0,0,C,x),t=_.canvas,p=C,m=x,y=y==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:p,paintHeight:m}}_createMaskCanvas(t,i){var re,ee;const s=this.ctx,{width:l,height:d}=i,u=this.current.fillColor,p=this.current.patternFill,m=Hs(s);let y,_,E,C;if((i.bitmap||i.data)&&i.count>1){const de=i.bitmap||i.data.buffer;_=JSON.stringify(p?m:[m.slice(0,4),u]),y=this._cachedBitmapsMap.get(de),y||(y=new Map,this._cachedBitmapsMap.set(de,y));const H=y.get(_);if(H&&!p){const ae=Math.round(Math.min(m[0],m[2])+m[4]),_e=Math.round(Math.min(m[1],m[3])+m[5]);return(re=this.dependencyTracker)==null||re.recordDependencies(t,zu.transformAndFill),{canvas:H,offsetX:ae,offsetY:_e}}E=H}E||(C=this.cachedCanvases.getCanvas("maskCanvas",l,d),ape(C.context,i));let x=In.transform(m,[1/l,0,0,-1/d,0,0]);x=In.transform(x,[1,0,0,1,0,-d]);const N=LC.slice();In.axialAlignedBoundingBox([0,0,l,d],x,N);const[O,D,P,j]=N,M=Math.round(P-O)||1,V=Math.round(j-D)||1,G=this.cachedCanvases.getCanvas("fillCanvas",M,V),$=G.context,ne=O,Y=D;$.translate(-ne,-Y),$.transform(...x),E||(E=this._scaleImage(C.canvas,sp($)),E=E.img,y&&p&&y.set(_,E)),$.imageSmoothingEnabled=ope(Hs($),i.interpolate),iM($,E,0,0,E.width,E.height,0,0,l,d),$.globalCompositeOperation="source-in";const le=In.transform(sp($),[1,0,0,1,-ne,-Y]);return $.fillStyle=p?u.getPattern(s,this,le,qo.FILL):u,$.fillRect(0,0,l,d),y&&!p&&(this.cachedCanvases.delete("fillCanvas"),y.set(_,G.canvas)),(ee=this.dependencyTracker)==null||ee.recordDependencies(t,zu.transformAndFill),{canvas:G.canvas,offsetX:Math.round(ne),offsetY:Math.round(Y)}}setLineWidth(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("lineWidth",t),i!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=i,this.ctx.lineWidth=i}setLineCap(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("lineCap",t),this.ctx.lineCap=CZe[i]}setLineJoin(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("lineJoin",t),this.ctx.lineJoin=TZe[i]}setMiterLimit(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("miterLimit",t),this.ctx.miterLimit=i}setDash(t,i,s){var d;(d=this.dependencyTracker)==null||d.recordSimpleData("dash",t);const l=this.ctx;l.setLineDash!==void 0&&(l.setLineDash(i),l.lineDashOffset=s)}setRenderingIntent(t,i){}setFlatness(t,i){}setGState(t,i){var s,l,d,u,p;for(const[m,y]of i)switch(m){case"LW":this.setLineWidth(t,y);break;case"LC":this.setLineCap(t,y);break;case"LJ":this.setLineJoin(t,y);break;case"ML":this.setMiterLimit(t,y);break;case"D":this.setDash(t,y[0],y[1]);break;case"RI":this.setRenderingIntent(t,y);break;case"FL":this.setFlatness(t,y);break;case"Font":this.setFont(t,y[0],y[1]);break;case"CA":(s=this.dependencyTracker)==null||s.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=y;break;case"ca":(l=this.dependencyTracker)==null||l.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=y;break;case"BM":(d=this.dependencyTracker)==null||d.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=y;break;case"SMask":(u=this.dependencyTracker)==null||u.recordSimpleData("SMask",t),this.current.activeSMask=y?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":(p=this.dependencyTracker)==null||p.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(y);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const i=this.ctx.canvas.width,s=this.ctx.canvas.height,l="smaskGroupAt"+this.groupLevel,d=this.cachedCanvases.getCanvas(l,i,s);this.suspendedCtx=this.ctx;const u=this.ctx=d.context;u.setTransform(this.suspendedCtx.getTransform()),z3(this.suspendedCtx,u),SZe(u,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),z3(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const i=this.current.activeSMask,s=this.suspendedCtx;this.composeSMask(s,i,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,i,s,l){const d=l[0],u=l[1],p=l[2]-d,m=l[3]-u;p===0||m===0||(this.genericComposeSMask(i.context,s,p,m,i.subtype,i.backdrop,i.transferMap,d,u,i.offsetX,i.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(s.canvas,0,0),t.restore())}genericComposeSMask(t,i,s,l,d,u,p,m,y,_,E){let C=t.canvas,x=m-_,N=y-E;if(u)if(x<0||N<0||x+s>C.width||N+l>C.height){const D=this.cachedCanvases.getCanvas("maskExtension",s,l),P=D.context;P.drawImage(C,-x,-N),P.globalCompositeOperation="destination-atop",P.fillStyle=u,P.fillRect(0,0,s,l),P.globalCompositeOperation="source-over",C=D.canvas,x=N=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const D=new Path2D;D.rect(x,N,s,l),t.clip(D),t.globalCompositeOperation="destination-atop",t.fillStyle=u,t.fillRect(x,N,s,l),t.restore()}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),d==="Alpha"&&p?i.filter=this.filterFactory.addAlphaFilter(p):d==="Luminosity"&&(i.filter=this.filterFactory.addLuminosityFilter(p));const O=new Path2D;O.rect(m,y,s,l),i.clip(O),i.globalCompositeOperation="destination-in",i.drawImage(C,x,N,s,l,m,y,s,l),i.restore()}save(t){var s;this.inSMaskMode&&z3(this.ctx,this.suspendedCtx),this.ctx.save();const i=this.current;this.stateStack.push(i),this.current=i.clone(),(s=this.dependencyTracker)==null||s.save(t)}restore(t){var i;if((i=this.dependencyTracker)==null||i.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&z3(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,i,s,l,d,u,p){var m;(m=this.dependencyTracker)==null||m.recordIncrementalData("transform",t),this.ctx.transform(i,s,l,d,u,p),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,i,s,l){let[d]=s;if(!l){d||(d=s[0]=new Path2D),this[i](t,d);return}if(this.dependencyTracker!==null){const u=i===RN.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,l[0]-u,l[2]+u,l[1]-u,l[3]+u).recordDependencies(t,["transform"])}if(!(d instanceof Path2D)){const u=s[0]=new Path2D;for(let p=0,m=d.length;p<m;)switch(d[p++]){case Z8.moveTo:u.moveTo(d[p++],d[p++]);break;case Z8.lineTo:u.lineTo(d[p++],d[p++]);break;case Z8.curveTo:u.bezierCurveTo(d[p++],d[p++],d[p++],d[p++],d[p++],d[p++]);break;case Z8.closePath:u.closePath();break;default:Ei(`Unrecognized drawing path operator: ${d[p-1]}`);break}d=u}In.axialAlignedBoundingBox(l,Hs(this.ctx),this.current.minMax),this[i](t,d),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,i,s=!0){var u;const l=this.ctx,d=this.current.strokeColor;if(l.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof d=="object"&&(d!=null&&d.getPattern)){const p=d.isModifyingCurrentTransform()?l.getTransform():null;if(l.save(),l.strokeStyle=d.getPattern(l,this,sp(l),qo.STROKE),p){const m=new Path2D;m.addPath(i,l.getTransform().invertSelf().multiplySelf(p)),i=m}this.rescaleAndStroke(i,!1),l.restore()}else this.rescaleAndStroke(i,!0);(u=this.dependencyTracker)==null||u.recordDependencies(t,zu.stroke),s&&this.consumePath(t,i,this.current.getClippedPathBoundingBox(qo.STROKE,Hs(this.ctx))),l.globalAlpha=this.current.fillAlpha}closeStroke(t,i){this.stroke(t,i)}fill(t,i,s=!0){var y,_,E;const l=this.ctx,d=this.current.fillColor,u=this.current.patternFill;let p=!1;if(u){const C=d.isModifyingCurrentTransform()?l.getTransform():null;if((y=this.dependencyTracker)==null||y.save(t),l.save(),l.fillStyle=d.getPattern(l,this,sp(l),qo.FILL),C){const x=new Path2D;x.addPath(i,l.getTransform().invertSelf().multiplySelf(C)),i=x}p=!0}const m=this.current.getClippedPathBoundingBox();this.contentVisible&&m!==null&&(this.pendingEOFill?(l.fill(i,"evenodd"),this.pendingEOFill=!1):l.fill(i)),(_=this.dependencyTracker)==null||_.recordDependencies(t,zu.fill),p&&(l.restore(),(E=this.dependencyTracker)==null||E.restore(t)),s&&this.consumePath(t,i,m)}eoFill(t,i){this.pendingEOFill=!0,this.fill(t,i)}fillStroke(t,i){this.fill(t,i,!1),this.stroke(t,i,!1),this.consumePath(t,i)}eoFillStroke(t,i){this.pendingEOFill=!0,this.fillStroke(t,i)}closeFillStroke(t,i){this.fillStroke(t,i)}closeEOFillStroke(t,i){this.pendingEOFill=!0,this.fillStroke(t,i)}endPath(t,i){this.consumePath(t,i)}rawFillPath(t,i){var s;this.ctx.fill(i),(s=this.dependencyTracker)==null||s.recordDependencies(t,zu.rawFillPath).recordOperation(t)}clip(t){var i;(i=this.dependencyTracker)==null||i.recordFutureForcedDependency("clipMode",t),this.pendingClip=RZe}eoClip(t){var i;(i=this.dependencyTracker)==null||i.recordFutureForcedDependency("clipMode",t),this.pendingClip=lpe}beginText(t){var i;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,(i=this.dependencyTracker)==null||i.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const i=this.pendingTextPaths,s=this.ctx;if(this.dependencyTracker){const{dependencyTracker:l}=this;i!==void 0&&l.recordFutureForcedDependency("textClip",l.getOpenMarker()).recordFutureForcedDependency("textClip",t),l.recordCloseMarker(t)}if(i!==void 0){const l=new Path2D,d=s.getTransform().invertSelf();for(const{transform:u,x:p,y:m,fontSize:y,path:_}of i)_&&l.addPath(_,new DOMMatrix(u).preMultiplySelf(d).translate(p,m).scale(y,-y));s.clip(l)}delete this.pendingTextPaths}setCharSpacing(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("charSpacing",t),this.current.charSpacing=i}setWordSpacing(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("wordSpacing",t),this.current.wordSpacing=i}setHScale(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("hScale",t),this.current.textHScale=i/100}setLeading(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("leading",t),this.current.leading=-i}setFont(t,i,s){var E,C;(E=this.dependencyTracker)==null||E.recordSimpleData("font",t).recordNamedDependency(t,i);const l=this.commonObjs.get(i),d=this.current;if(!l)throw new Error(`Can't find font for ${i}`);if(d.fontMatrix=l.fontMatrix||qY,(d.fontMatrix[0]===0||d.fontMatrix[3]===0)&&Ei("Invalid font matrix for font "+i),s<0?(s=-s,d.fontDirection=-1):d.fontDirection=1,this.current.font=l,this.current.fontSize=s,l.isType3Font)return;const u=l.loadedName||"sans-serif",p=((C=l.systemFontInfo)==null?void 0:C.css)||`"${u}", ${l.fallbackName}`;let m="normal";l.black?m="900":l.bold&&(m="bold");const y=l.italic?"italic":"normal";let _=s;s<tpe?_=tpe:s>npe&&(_=npe),this.current.fontSizeScale=s/_,this.ctx.font=`${y} ${m} ${_}px ${p}`}setTextRenderingMode(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=i}setTextRise(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("textRise",t),this.current.textRise=i}moveText(t,i,s){var l;(l=this.dependencyTracker)==null||l.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=i,this.current.y=this.current.lineY+=s}setLeadingMoveText(t,i,s){this.setLeading(t,-s),this.moveText(t,i,s)}setTextMatrix(t,i){var l;(l=this.dependencyTracker)==null||l.recordSimpleData("textMatrix",t);const{current:s}=this;s.textMatrix=i,s.textMatrixScale=Math.hypot(i[0],i[1]),s.x=s.lineX=0,s.y=s.lineY=0}nextLine(t){var i;this.moveText(t,0,this.current.leading),(i=this.dependencyTracker)==null||i.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}paintChar(t,i,s,l,d,u){var P,j,M,V;const p=this.ctx,m=this.current,y=m.font,_=m.textRenderingMode,E=m.fontSize/m.fontSizeScale,C=_&Fo.FILL_STROKE_MASK,x=!!(_&Fo.ADD_TO_PATH_FLAG),N=m.patternFill&&!y.missingFile,O=m.patternStroke&&!y.missingFile;let D;if((y.disableFontFace||x||N||O)&&!y.missingFile&&(D=y.getPathGenerator(this.commonObjs,i)),D&&(y.disableFontFace||N||O)){p.save(),p.translate(s,l),p.scale(E,-E),(P=this.dependencyTracker)==null||P.recordCharacterBBox(t,p,y);let G;if(C===Fo.FILL||C===Fo.FILL_STROKE)if(d){G=p.getTransform(),p.setTransform(...d);const $=fe(this,D5,bX).call(this,D,G,d);p.fill($)}else p.fill(D);if(C===Fo.STROKE||C===Fo.FILL_STROKE)if(u){G||(G=p.getTransform()),p.setTransform(...u);const{a:$,b:ne,c:Y,d:le}=G,re=In.inverseTransform(u),ee=In.transform([$,ne,Y,le,0,0],re);In.singularValueDecompose2dScale(ee,qd),p.lineWidth*=Math.max(qd[0],qd[1])/E,p.stroke(fe(this,D5,bX).call(this,D,G,u))}else p.lineWidth/=E,p.stroke(D);p.restore()}else(C===Fo.FILL||C===Fo.FILL_STROKE)&&(p.fillText(i,s,l),(j=this.dependencyTracker)==null||j.recordCharacterBBox(t,p,y,E,s,l,()=>p.measureText(i))),(C===Fo.STROKE||C===Fo.FILL_STROKE)&&(this.dependencyTracker&&((M=this.dependencyTracker)==null||M.recordCharacterBBox(t,p,y,E,s,l,()=>p.measureText(i)).recordDependencies(t,zu.stroke)),p.strokeText(i,s,l));x&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Hs(p),x:s,y:l,fontSize:E,path:D}),(V=this.dependencyTracker)==null||V.recordCharacterBBox(t,p,y,E,s,l))}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const i=t.getImageData(0,0,10,10).data;let s=!1;for(let l=3;l<i.length;l+=4)if(i[l]>0&&i[l]<255){s=!0;break}return Ki(this,"isFontSubpixelAAEnabled",s)}showText(t,i){var Y,le,re,ee;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,zu.showText).copyDependenciesFromIncrementalOperation(t,"sameLineText").resetBBox(t),this.current.textRenderingMode&Fo.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const s=this.current,l=s.font;if(l.isType3Font){this.showType3Text(t,i),(Y=this.dependencyTracker)==null||Y.recordOperation(t).recordIncrementalData("sameLineText",t);return}const d=s.fontSize;if(d===0){(le=this.dependencyTracker)==null||le.recordOperation(t);return}const u=this.ctx,p=s.fontSizeScale,m=s.charSpacing,y=s.wordSpacing,_=s.fontDirection,E=s.textHScale*_,C=i.length,x=l.vertical,N=x?1:-1,O=l.defaultVMetrics,D=d*s.fontMatrix[0],P=s.textRenderingMode===Fo.FILL&&!l.disableFontFace&&!s.patternFill;u.save(),s.textMatrix&&u.transform(...s.textMatrix),u.translate(s.x,s.y+s.textRise),_>0?u.scale(E,-1):u.scale(E,1);let j,M;if(s.patternFill){u.save();const de=s.fillColor.getPattern(u,this,sp(u),qo.FILL);j=Hs(u),u.restore(),u.fillStyle=de}if(s.patternStroke){u.save();const de=s.strokeColor.getPattern(u,this,sp(u),qo.STROKE);M=Hs(u),u.restore(),u.strokeStyle=de}let V=s.lineWidth;const G=s.textMatrixScale;if(G===0||V===0){const de=s.textRenderingMode&Fo.FILL_STROKE_MASK;(de===Fo.STROKE||de===Fo.FILL_STROKE)&&(V=this.getSinglePixelWidth())}else V/=G;if(p!==1&&(u.scale(p,p),V/=p),u.lineWidth=V,l.isInvalidPDFjsFont){const de=[];let H=0;for(const _e of i)de.push(_e.unicode),H+=_e.width;const ae=de.join("");if(u.fillText(ae,0,0),this.dependencyTracker!==null){const _e=u.measureText(ae);this.dependencyTracker.recordBBox(t,this.ctx,-_e.actualBoundingBoxLeft,_e.actualBoundingBoxRight,-_e.actualBoundingBoxAscent,_e.actualBoundingBoxDescent).recordOperation(t).recordIncrementalData("sameLineText",t)}s.x+=H*D*E,u.restore(),this.compose();return}let $=0,ne;for(ne=0;ne<C;++ne){const de=i[ne];if(typeof de=="number"){$+=N*de*d/1e3;continue}let H=!1;const ae=(de.isSpace?y:0)+m,_e=de.fontChar,me=de.accent;let Ce,he,pe=de.width;if(x){const Ue=de.vmetric||O,Ve=-(de.vmetric?Ue[1]:pe*.5)*D,Re=Ue[2]*D;pe=Ue?-Ue[0]:pe,Ce=Ve/p,he=($+Re)/p}else Ce=$/p,he=0;let Oe;if(l.remeasure&&pe>0){Oe=u.measureText(_e);const Ue=Oe.width*1e3/d*p;if(pe<Ue&&this.isFontSubpixelAAEnabled){const Ve=pe/Ue;H=!0,u.save(),u.scale(Ve,1),Ce/=Ve}else pe!==Ue&&(Ce+=(pe-Ue)/2e3*d/p)}if(this.contentVisible&&(de.isInFont||l.missingFile)){if(P&&!me)u.fillText(_e,Ce,he),(re=this.dependencyTracker)==null||re.recordCharacterBBox(t,u,Oe?{bbox:null}:l,d/p,Ce,he,()=>Oe??u.measureText(_e));else if(this.paintChar(t,_e,Ce,he,j,M),me){const Ue=Ce+d*me.offset.x/p,Ve=he-d*me.offset.y/p;this.paintChar(t,me.fontChar,Ue,Ve,j,M)}}const Fe=x?pe*D-ae*_:pe*D+ae*_;$+=Fe,H&&u.restore()}x?s.y-=$:s.x+=$*E,u.restore(),this.compose(),(ee=this.dependencyTracker)==null||ee.recordOperation(t).recordIncrementalData("sameLineText",t)}showType3Text(t,i){const s=this.ctx,l=this.current,d=l.font,u=l.fontSize,p=l.fontDirection,m=d.vertical?1:-1,y=l.charSpacing,_=l.wordSpacing,E=l.textHScale*p,C=l.fontMatrix||qY,x=i.length,N=l.textRenderingMode===Fo.INVISIBLE;let O,D,P,j;if(N||u===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,s.save(),l.textMatrix&&s.transform(...l.textMatrix),s.translate(l.x,l.y+l.textRise),s.scale(E,p);const M=this.dependencyTracker;for(this.dependencyTracker=M?new a9(M,t):null,O=0;O<x;++O){if(D=i[O],typeof D=="number"){j=m*D*u/1e3,this.ctx.translate(j,0),l.x+=j*E;continue}const V=(D.isSpace?_:0)+y,G=d.charProcOperatorList[D.operatorListId];G?this.contentVisible&&(this.save(),s.scale(u,u),s.transform(...C),this.executeOperatorList(G),this.restore()):Ei(`Type3 character "${D.operatorListId}" is not available.`);const $=[D.width,0];In.applyTransform($,C),P=$[0]*u+V,s.translate(P,0),l.x+=P*E}s.restore(),M&&(this.dependencyTracker.recordNestedDependencies(),this.dependencyTracker=M)}setCharWidth(t,i,s){}setCharWidthAndBounds(t,i,s,l,d,u,p){var y;const m=new Path2D;m.rect(l,d,u-l,p-d),this.ctx.clip(m),(y=this.dependencyTracker)==null||y.recordBBox(t,this.ctx,l,u,d,p).recordClipBox(t,this.ctx,l,u,d,p),this.endPath(t)}getColorN_Pattern(t,i){let s;if(i[0]==="TilingPattern"){const l=this.baseTransform||Hs(this.ctx),d={createCanvasGraphics:u=>new Aee(u,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new a9(this.dependencyTracker,t):null)};s=new EX(i,this.ctx,d,l)}else s=this._getPattern(t,i[1],i[2]);return s}setStrokeColorN(t,...i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,i),this.current.patternStroke=!0}setFillColorN(t,...i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,i),this.current.patternFill=!0}setStrokeRGBColor(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=i,this.current.patternStroke=!1}setStrokeTransparent(t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=i,this.current.patternFill=!1}setFillTransparent(t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,i,s=null){let l;return this.cachedPatterns.has(i)?l=this.cachedPatterns.get(i):(l=_Ze(this.getObject(t,i)),this.cachedPatterns.set(i,l)),s&&(l.matrix=s),l}shadingFill(t,i){var u;if(!this.contentVisible)return;const s=this.ctx;this.save(t);const l=this._getPattern(t,i);s.fillStyle=l.getPattern(s,this,sp(s),qo.SHADING);const d=sp(s);if(d){const{width:p,height:m}=s.canvas,y=LC.slice();In.axialAlignedBoundingBox([0,0,p,m],d,y);const[_,E,C,x]=y;this.ctx.fillRect(_,E,C-_,x-E)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(u=this.dependencyTracker)==null||u.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,zu.transform).recordDependencies(t,zu.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){ns("Should not call beginInlineImage")}beginImageData(){ns("Should not call beginImageData")}paintFormXObjectBegin(t,i,s){var l;if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),i&&this.transform(t,...i),this.baseTransform=Hs(this.ctx),s)){In.axialAlignedBoundingBox(s,this.baseTransform,this.current.minMax);const[d,u,p,m]=s,y=new Path2D;y.rect(d,u,p-d,m-u),this.ctx.clip(y),(l=this.dependencyTracker)==null||l.recordClipBox(t,this.ctx,d,p,u,m),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,i){var M;if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const s=this.ctx;i.isolated||CF("TODO: Support non-isolated groups."),i.knockout&&Ei("Knockout groups not supported.");const l=Hs(s);if(i.matrix&&s.transform(...i.matrix),!i.bbox)throw new Error("Bounding box is required.");let d=LC.slice();In.axialAlignedBoundingBox(i.bbox,Hs(s),d);const u=[0,0,s.canvas.width,s.canvas.height];d=In.intersect(d,u)||[0,0,0,0];const p=Math.floor(d[0]),m=Math.floor(d[1]),y=Math.max(Math.ceil(d[2])-p,1),_=Math.max(Math.ceil(d[3])-m,1);this.current.startNewPathAndClipBox([0,0,y,_]);let E="groupAt"+this.groupLevel;i.smask&&(E+="_smask_"+this.smaskCounter++%2);const C=this.cachedCanvases.getCanvas(E,y,_),x=C.context;x.translate(-p,-m),x.transform(...l);let N=new Path2D;const[O,D,P,j]=i.bbox;if(N.rect(O,D,P-O,j-D),i.matrix){const V=new Path2D;V.addPath(N,new DOMMatrix(i.matrix)),N=V}x.clip(N),i.smask&&this.smaskStack.push({canvas:C.canvas,context:x,offsetX:p,offsetY:m,subtype:i.smask.subtype,backdrop:i.smask.backdrop,transferMap:i.smask.transferMap||null,startTransformInverse:null}),(!i.smask||this.dependencyTracker)&&(s.setTransform(1,0,0,1,0,0),s.translate(p,m),s.save()),z3(s,x),this.ctx=x,(M=this.dependencyTracker)==null||M.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(s),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(s),this.groupLevel++}endGroup(t,i){var d;if(!this.contentVisible)return;this.groupLevel--;const s=this.ctx,l=this.groupStack.pop();if(this.ctx=l,this.ctx.imageSmoothingEnabled=!1,(d=this.dependencyTracker)==null||d.popBaseTransform(),i.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const u=Hs(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...u);const p=LC.slice();In.axialAlignedBoundingBox([0,0,s.canvas.width,s.canvas.height],u,p),this.ctx.drawImage(s.canvas,0,0),this.ctx.restore(),this.compose(p)}}beginAnnotation(t,i,s,l,d,u){if(fe(this,P5,wX).call(this),rM(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),s){const p=s[2]-s[0],m=s[3]-s[1];if(u&&this.annotationCanvasMap){l=l.slice(),l[4]-=s[0],l[5]-=s[1],s=s.slice(),s[0]=s[1]=0,s[2]=p,s[3]=m,In.singularValueDecompose2dScale(Hs(this.ctx),qd);const{viewportScale:y}=this,_=Math.ceil(p*this.outputScaleX*y),E=Math.ceil(m*this.outputScaleY*y);this.annotationCanvas=this.canvasFactory.create(_,E);const{canvas:C,context:x}=this.annotationCanvas;this.annotationCanvasMap.set(i,C),this.annotationCanvas.savedCtx=this.ctx,this.ctx=x,this.ctx.save(),this.ctx.setTransform(qd[0],0,0,-qd[1],0,m*qd[1]),rM(this.ctx)}else{rM(this.ctx),this.endPath(t);const y=new Path2D;y.rect(s[0],s[1],p,m),this.ctx.clip(y)}}this.current=new rpe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...l),this.transform(t,...d)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),fe(this,L5,SX).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,i){var p;if(!this.contentVisible)return;const s=i.count;i=this.getObject(t,i.data,i),i.count=s;const l=this.ctx,d=this._createMaskCanvas(t,i),u=d.canvas;l.save(),l.setTransform(1,0,0,1,0,0),l.drawImage(u,d.offsetX,d.offsetY),(p=this.dependencyTracker)==null||p.resetBBox(t).recordBBox(t,this.ctx,d.offsetX,d.offsetX+u.width,d.offsetY,d.offsetY+u.height).recordOperation(t),l.restore(),this.compose()}paintImageMaskXObjectRepeat(t,i,s,l=0,d=0,u,p){var E,C,x;if(!this.contentVisible)return;i=this.getObject(t,i.data,i);const m=this.ctx;m.save();const y=Hs(m);m.transform(s,l,d,u,0,0);const _=this._createMaskCanvas(t,i);m.setTransform(1,0,0,1,_.offsetX-y[4],_.offsetY-y[5]),(E=this.dependencyTracker)==null||E.resetBBox(t);for(let N=0,O=p.length;N<O;N+=2){const D=In.transform(y,[s,l,d,u,p[N],p[N+1]]);m.drawImage(_.canvas,D[4],D[5]),(C=this.dependencyTracker)==null||C.recordBBox(t,this.ctx,D[4],D[4]+_.canvas.width,D[5],D[5]+_.canvas.height)}m.restore(),this.compose(),(x=this.dependencyTracker)==null||x.recordOperation(t)}paintImageMaskXObjectGroup(t,i){var u,p,m;if(!this.contentVisible)return;const s=this.ctx,l=this.current.fillColor,d=this.current.patternFill;(u=this.dependencyTracker)==null||u.resetBBox(t).recordDependencies(t,zu.transformAndFill);for(const y of i){const{data:_,width:E,height:C,transform:x}=y,N=this.cachedCanvases.getCanvas("maskCanvas",E,C),O=N.context;O.save();const D=this.getObject(t,_,y);ape(O,D),O.globalCompositeOperation="source-in",O.fillStyle=d?l.getPattern(O,this,sp(s),qo.FILL):l,O.fillRect(0,0,E,C),O.restore(),s.save(),s.transform(...x),s.scale(1,-1),iM(s,N.canvas,0,0,E,C,0,-1,1,1),(p=this.dependencyTracker)==null||p.recordBBox(t,s,0,E,0,C),s.restore()}this.compose(),(m=this.dependencyTracker)==null||m.recordOperation(t)}paintImageXObject(t,i){if(!this.contentVisible)return;const s=this.getObject(t,i);if(!s){Ei("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,s)}paintImageXObjectRepeat(t,i,s,l,d){if(!this.contentVisible)return;const u=this.getObject(t,i);if(!u){Ei("Dependent image isn't ready yet");return}const p=u.width,m=u.height,y=[];for(let _=0,E=d.length;_<E;_+=2)y.push({transform:[s,0,0,l,d[_],d[_+1]],x:0,y:0,w:p,h:m});this.paintInlineImageXObjectGroup(t,u,y)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:i,width:s,height:l}=t,d=this.cachedCanvases.getCanvas("inlineImage",s,l),u=d.context;return u.filter=this.current.transferMaps,u.drawImage(i,0,0),u.filter="none",d.canvas}paintInlineImageXObject(t,i){var y;if(!this.contentVisible)return;const s=i.width,l=i.height,d=this.ctx;this.save(t);const{filter:u}=d;u!=="none"&&u!==""&&(d.filter="none"),d.scale(1/s,-1/l);let p;if(i.bitmap)p=this.applyTransferMapsToBitmap(i);else if(typeof HTMLElement=="function"&&i instanceof HTMLElement||!i.data)p=i;else{const E=this.cachedCanvases.getCanvas("inlineImage",s,l).context;spe(E,i),p=this.applyTransferMapsToCanvas(E)}const m=this._scaleImage(p,sp(d));d.imageSmoothingEnabled=ope(Hs(d),i.interpolate),(y=this.dependencyTracker)==null||y.resetBBox(t).recordBBox(t,d,0,s,-l,0).recordDependencies(t,zu.imageXObject).recordOperation(t),iM(d,m.img,0,0,m.paintWidth,m.paintHeight,0,-l,s,l),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,i,s){var u,p,m;if(!this.contentVisible)return;const l=this.ctx;let d;if(i.bitmap)d=i.bitmap;else{const y=i.width,_=i.height,C=this.cachedCanvases.getCanvas("inlineImage",y,_).context;spe(C,i),d=this.applyTransferMapsToCanvas(C)}(u=this.dependencyTracker)==null||u.resetBBox(t);for(const y of s)l.save(),l.transform(...y.transform),l.scale(1,-1),iM(l,d,y.x,y.y,y.w,y.h,0,-1,1,1),(p=this.dependencyTracker)==null||p.recordBBox(t,l,0,1,-1,0),l.restore();(m=this.dependencyTracker)==null||m.recordOperation(t),this.compose()}paintSolidColorImageMask(t){var i;this.contentVisible&&((i=this.dependencyTracker)==null||i.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,zu.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,i){}markPointProps(t,i,s){}beginMarkedContent(t,i){var s;(s=this.dependencyTracker)==null||s.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,i,s){var l;(l=this.dependencyTracker)==null||l.beginMarkedContent(t),i==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(s)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){var i;(i=this.dependencyTracker)==null||i.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,i,s){var u,p;const l=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const d=this.ctx;this.pendingClip?(l||(this.pendingClip===lpe?d.clip(i,"evenodd"):d.clip(i)),this.pendingClip=null,(u=this.dependencyTracker)==null||u.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):(p=this.dependencyTracker)==null||p.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Hs(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const i=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),l=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,l)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:i,b:s,c:l,d}=this.ctx.getTransform();let u,p;if(s===0&&l===0){const m=Math.abs(i),y=Math.abs(d);if(m===y)if(t===0)u=p=1/m;else{const _=m*t;u=p=_<1?1/_:1}else if(t===0)u=1/m,p=1/y;else{const _=m*t,E=y*t;u=_<1?1/_:1,p=E<1?1/E:1}}else{const m=Math.abs(i*d-s*l),y=Math.hypot(i,s),_=Math.hypot(l,d);if(t===0)u=_/m,p=y/m;else{const E=t*m;u=_>E?_/E:1,p=y>E?y/E:1}}this._cachedScaleForStroking[0]=u,this._cachedScaleForStroking[1]=p}return this._cachedScaleForStroking}rescaleAndStroke(t,i){const{ctx:s,current:{lineWidth:l}}=this,[d,u]=this.getScaleForStroking();if(d===u){s.lineWidth=(l||1)*d,s.stroke(t);return}const p=s.getLineDash();i&&s.save(),s.scale(d,u),jK.a=1/d,jK.d=1/u;const m=new Path2D;if(m.addPath(t,jK),p.length>0){const y=Math.max(d,u);s.setLineDash(p.map(_=>_/y)),s.lineDashOffset/=y}s.lineWidth=l||1,s.stroke(m),i&&s.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};P5=new WeakSet,wX=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},L5=new WeakSet,SX=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const i=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=i}}},D5=new WeakSet,bX=function(t,i,s){const l=new Path2D;return l.addPath(t,new DOMMatrix(s).invertSelf().multiplySelf(i)),l};let WC=Aee;for(const n in RN)WC.prototype[n]!==void 0&&(WC.prototype[RN[n]]=WC.prototype[n]);var k5,M5;class Vp{static get workerPort(){return b(this,k5)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");te(this,k5,t)}static get workerSrc(){return b(this,M5)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");te(this,M5,t)}}k5=new WeakMap,M5=new WeakMap,J(Vp,k5,null),J(Vp,M5,"");var zT,j5;class xZe{constructor({parsedData:t,rawData:i}){J(this,zT,void 0);J(this,j5,void 0);te(this,zT,t),te(this,j5,i)}getRaw(){return b(this,j5)}get(t){return b(this,zT).get(t)??null}[Symbol.iterator](){return b(this,zT).entries()}}zT=new WeakMap,j5=new WeakMap;const mC=Symbol("INTERNAL");var U5,F5,B5,HT;class AZe{constructor(t,{name:i,intent:s,usage:l,rbGroups:d}){J(this,U5,!1);J(this,F5,!1);J(this,B5,!1);J(this,HT,!0);te(this,U5,!!(t&Wd.DISPLAY)),te(this,F5,!!(t&Wd.PRINT)),this.name=i,this.intent=s,this.usage=l,this.rbGroups=d}get visible(){if(b(this,B5))return b(this,HT);if(!b(this,HT))return!1;const{print:t,view:i}=this.usage;return b(this,U5)?(i==null?void 0:i.viewState)!=="OFF":b(this,F5)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,i,s=!1){t!==mC&&ns("Internal method `_setVisible` called."),te(this,B5,s),te(this,HT,i)}}U5=new WeakMap,F5=new WeakMap,B5=new WeakMap,HT=new WeakMap;var iv,es,GT,WT,V5,CX;class IZe{constructor(t,i=Wd.DISPLAY){J(this,V5);J(this,iv,null);J(this,es,new Map);J(this,GT,null);J(this,WT,null);if(this.renderingIntent=i,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,te(this,WT,t.order);for(const s of t.groups)b(this,es).set(s.id,new AZe(i,s));if(t.baseState==="OFF")for(const s of b(this,es).values())s._setVisible(mC,!1);for(const s of t.on)b(this,es).get(s)._setVisible(mC,!0);for(const s of t.off)b(this,es).get(s)._setVisible(mC,!1);te(this,GT,this.getHash())}}isVisible(t){if(b(this,es).size===0)return!0;if(!t)return CF("Optional content group not defined."),!0;if(t.type==="OCG")return b(this,es).has(t.id)?b(this,es).get(t.id).visible:(Ei(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return fe(this,V5,CX).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const i of t.ids){if(!b(this,es).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(b(this,es).get(i).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const i of t.ids){if(!b(this,es).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(!b(this,es).get(i).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const i of t.ids){if(!b(this,es).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(!b(this,es).get(i).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const i of t.ids){if(!b(this,es).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(b(this,es).get(i).visible)return!1}return!0}return Ei(`Unknown optional content policy ${t.policy}.`),!0}return Ei(`Unknown group type ${t.type}.`),!0}setVisibility(t,i=!0,s=!0){var d;const l=b(this,es).get(t);if(!l){Ei(`Optional content group not found: ${t}`);return}if(s&&i&&l.rbGroups.length)for(const u of l.rbGroups)for(const p of u)p!==t&&((d=b(this,es).get(p))==null||d._setVisible(mC,!1,!0));l._setVisible(mC,!!i,!0),te(this,iv,null)}setOCGState({state:t,preserveRB:i}){let s;for(const l of t){switch(l){case"ON":case"OFF":case"Toggle":s=l;continue}const d=b(this,es).get(l);if(d)switch(s){case"ON":this.setVisibility(l,!0,i);break;case"OFF":this.setVisibility(l,!1,i);break;case"Toggle":this.setVisibility(l,!d.visible,i);break}}te(this,iv,null)}get hasInitialVisibility(){return b(this,GT)===null||this.getHash()===b(this,GT)}getOrder(){return b(this,es).size?b(this,WT)?b(this,WT).slice():[...b(this,es).keys()]:null}getGroup(t){return b(this,es).get(t)||null}getHash(){if(b(this,iv)!==null)return b(this,iv);const t=new A2e;for(const[i,s]of b(this,es))t.update(`${i}:${s.visible}`);return te(this,iv,t.hexdigest())}[Symbol.iterator](){return b(this,es).entries()}}iv=new WeakMap,es=new WeakMap,GT=new WeakMap,WT=new WeakMap,V5=new WeakSet,CX=function(t){const i=t.length;if(i<2)return!0;const s=t[0];for(let l=1;l<i;l++){const d=t[l];let u;if(Array.isArray(d))u=fe(this,V5,CX).call(this,d);else if(b(this,es).has(d))u=b(this,es).get(d).visible;else return Ei(`Optional content group not found: ${d}`),!0;switch(s){case"And":if(!u)return!1;break;case"Or":if(u)return!0;break;case"Not":return!u;default:return!0}}return s==="And"};class NZe{constructor(t,{disableRange:i=!1,disableStream:s=!1}){La(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:l,initialData:d,progressiveDone:u,contentDispositionFilename:p}=t;if(this._queuedChunks=[],this._progressiveDone=u,this._contentDispositionFilename=p,(d==null?void 0:d.length)>0){const m=d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength?d.buffer:new Uint8Array(d).buffer;this._queuedChunks.push(m)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!s,this._isRangeSupported=!i,this._contentLength=l,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((m,y)=>{this._onReceiveData({begin:m,chunk:y})}),t.addProgressListener((m,y)=>{this._onProgress({loaded:m,total:y})}),t.addProgressiveReadListener(m=>{this._onReceiveData({chunk:m})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:i}){const s=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const l=this._rangeReaders.some(function(d){return d._begin!==t?!1:(d._enqueue(s),!0)});La(l,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}_onProgress(t){var i,s,l,d;t.total===void 0?(s=(i=this._rangeReaders[0])==null?void 0:i.onProgress)==null||s.call(i,{loaded:t.loaded}):(d=(l=this._fullRequestReader)==null?void 0:l.onProgress)==null||d.call(l,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;(t=this._fullRequestReader)==null||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const i=this._rangeReaders.indexOf(t);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){La(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new OZe(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const s=new PZe(this,t,i);return this._pdfDataRangeTransport.requestDataRange(t,i),this._rangeReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeReaders.slice(0))s.cancel(t);this._pdfDataRangeTransport.abort()}}class OZe{constructor(t,i,s=!1,l=null){this._stream=t,this._done=s||!1,this._filename=FZ(l)?l:null,this._queuedChunks=i||[],this._loaded=0;for(const d of this._queuedChunks)this._loaded+=d.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PZe{constructor(t,i,s){this._stream=t,this._begin=i,this._end=s,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function LZe(n){let t=!0,i=s("filename\\*","i").exec(n);if(i){i=i[1];let _=p(i);return _=unescape(_),_=m(_),_=y(_),d(_)}if(i=u(n),i){const _=y(i);return d(_)}if(i=s("filename","i").exec(n),i){i=i[1];let _=p(i);return _=y(_),d(_)}function s(_,E){return new RegExp("(?:^|;)\\s*"+_+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',E)}function l(_,E){if(_){if(!/^[\x00-\xFF]+$/.test(E))return E;try{const C=new TextDecoder(_,{fatal:!0}),x=AP(E);E=C.decode(x),t=!1}catch{}}return E}function d(_){return t&&/[\x80-\xff]/.test(_)&&(_=l("utf-8",_),t&&(_=l("iso-8859-1",_))),_}function u(_){const E=[];let C;const x=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(C=x.exec(_))!==null;){let[,O,D,P]=C;if(O=parseInt(O,10),O in E){if(O===0)break;continue}E[O]=[D,P]}const N=[];for(let O=0;O<E.length&&O in E;++O){let[D,P]=E[O];P=p(P),D&&(P=unescape(P),O===0&&(P=m(P))),N.push(P)}return N.join("")}function p(_){if(_.startsWith('"')){const E=_.slice(1).split('\\"');for(let C=0;C<E.length;++C){const x=E[C].indexOf('"');x!==-1&&(E[C]=E[C].slice(0,x),E.length=C+1),E[C]=E[C].replaceAll(/\\(.)/g,"$1")}_=E.join('"')}return _}function m(_){const E=_.indexOf("'");if(E===-1)return _;const C=_.slice(0,E),N=_.slice(E+1).replace(/^[^']*'/,"");return l(C,N)}function y(_){return!_.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(_)?_:_.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(E,C,x,N){if(x==="q"||x==="Q")return N=N.replaceAll("_"," "),N=N.replaceAll(/=([0-9a-fA-F]{2})/g,function(O,D){return String.fromCharCode(parseInt(D,16))}),l(C,N);try{N=atob(N)}catch{}return l(C,N)})}return""}function B2e(n,t){const i=new Headers;if(!n||!t||typeof t!="object")return i;for(const s in t){const l=t[s];l!==void 0&&i.append(s,l)}return i}function xF(n){var t;return((t=URL.parse(n))==null?void 0:t.origin)??null}function V2e({responseHeaders:n,isHttp:t,rangeChunkSize:i,disableRange:s}){const l={allowRangeRequests:!1,suggestedLength:void 0},d=parseInt(n.get("Content-Length"),10);return!Number.isInteger(d)||(l.suggestedLength=d,d<=2*i)||s||!t||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(l.allowRangeRequests=!0),l}function z2e(n){const t=n.get("Content-Disposition");if(t){let i=LZe(t);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(FZ(i))return i}return null}function PP(n,t){return new n9(`Unexpected server response (${n}) while retrieving PDF "${t}".`,n,n===404||n===0&&t.startsWith("file:"))}function H2e(n){return n===200||n===206}function G2e(n,t,i){return{method:"GET",headers:n,signal:i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function W2e(n){return n instanceof Uint8Array?n.buffer:n instanceof ArrayBuffer?n:(Ei(`getArrayBuffer - unexpected data format: ${n}`),new Uint8Array(n).buffer)}class DZe{constructor(t){sn(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=B2e(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return La(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new kZe(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const s=new MZe(this,t,i);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class kZe{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const i=t.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const s=new Headers(t.headers),l=i.url;fetch(l,G2e(s,this._withCredentials,this._abortController)).then(d=>{if(t._responseOrigin=xF(d.url),!H2e(d.status))throw PP(d.status,l);this._reader=d.body.getReader(),this._headersCapability.resolve();const u=d.headers,{allowRangeRequests:p,suggestedLength:m}=V2e({responseHeaders:u,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=p,this._contentLength=m||this._contentLength,this._filename=z2e(u),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Zv("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;await this._headersCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded,total:this._contentLength}),{value:W2e(t),done:!1})}cancel(t){var i;(i=this._reader)==null||i.cancel(t),this._abortController.abort()}}class MZe{constructor(t,i,s){this._stream=t,this._reader=null,this._loaded=0;const l=t.source;this._withCredentials=l.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!l.disableStream,this._abortController=new AbortController;const d=new Headers(t.headers);d.append("Range",`bytes=${i}-${s-1}`);const u=l.url;fetch(u,G2e(d,this._withCredentials,this._abortController)).then(p=>{const m=xF(p.url);if(m!==t._responseOrigin)throw new Error(`Expected range response-origin "${m}" to match "${t._responseOrigin}".`);if(!H2e(p.status))throw PP(p.status,u);this._readCapability.resolve(),this._reader=p.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded}),{value:W2e(t),done:!1})}cancel(t){var i;(i=this._reader)==null||i.cancel(t),this._abortController.abort()}}const UK=200,FK=206;function jZe(n){const t=n.response;return typeof t!="string"?t:AP(t).buffer}class UZe{constructor({url:t,httpHeaders:i,withCredentials:s}){sn(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=B2e(this.isHttp,i),this.withCredentials=s||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const i=new XMLHttpRequest,s=this.currXhrId++,l=this.pendingRequests[s]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[d,u]of this.headers)i.setRequestHeader(d,u);return this.isHttp&&"begin"in t&&"end"in t?(i.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),l.expectedStatus=FK):l.expectedStatus=UK,i.responseType="arraybuffer",La(t.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{t.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,s),i.onprogress=this.onProgress.bind(this,s),l.onHeadersReceived=t.onHeadersReceived,l.onDone=t.onDone,l.onError=t.onError,l.onProgress=t.onProgress,i.send(null),s}onProgress(t,i){var l;const s=this.pendingRequests[t];s&&((l=s.onProgress)==null||l.call(s,i))}onStateChange(t,i){const s=this.pendingRequests[t];if(!s)return;const l=s.xhr;if(l.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),l.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],l.status===0&&this.isHttp){s.onError(l.status);return}const d=l.status||UK;if(!(d===UK&&s.expectedStatus===FK)&&d!==s.expectedStatus){s.onError(l.status);return}const p=jZe(l);if(d===FK){const m=l.getResponseHeader("Content-Range"),y=/bytes (\d+)-(\d+)\/(\d+)/.exec(m);y?s.onDone({begin:parseInt(y[1],10),chunk:p}):(Ei('Missing or invalid "Content-Range" header.'),s.onError(0))}else p?s.onDone({begin:0,chunk:p}):s.onError(l.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const i=this.pendingRequests[t].xhr;delete this.pendingRequests[t],i.abort()}}class FZe{constructor(t){this._source=t,this._manager=new UZe(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const i=this._rangeRequestReaders.indexOf(t);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return La(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new BZe(this._manager,this._source),this._fullRequestReader}getRangeReader(t,i){const s=new VZe(this._manager,t,i);return s.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class BZe{constructor(t,i){this._manager=t,this._url=i.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,i=this._manager.getRequestXhr(t);this._manager._responseOrigin=xF(i.responseURL);const s=i.getAllResponseHeaders(),l=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(p=>{const[m,...y]=p.split(": ");return[m,y.join(": ")]}):[]),{allowRangeRequests:d,suggestedLength:u}=V2e({responseHeaders:l,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});d&&(this._isRangeSupported=!0),this._contentLength=u||this._contentLength,this._filename=z2e(l),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=PP(t,this._url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var i;(i=this.onProgress)==null||i.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class VZe{constructor(t,i,s){this._manager=t,this._url=t.url,this._requestId=t.request({begin:i,end:s,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var i;const t=xF((i=this._manager.getRequestXhr(this._requestId))==null?void 0:i.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var t;(t=this.onClosed)==null||t.call(this,this)}_onDone(t){const i=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??(this._storedError=PP(t,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var i;this.isStreamingSupported||(i=this.onProgress)==null||i.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const zZe=/^[a-z][a-z0-9\-+.]+:/i;function HZe(n){if(zZe.test(n))return new URL(n);const t=lc.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}class GZe{constructor(t){this.source=t,this.url=HZe(t.url),La(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return La(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new WZe(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const s=new $Ze(this,t,i);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class WZe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=t.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const s=lc.getBuiltinModule("fs");s.promises.lstat(this._url).then(l=>{this._contentLength=l.size,this._setReadableStream(s.createReadStream(this._url)),this._headersCapability.resolve()},l=>{l.code==="ENOENT"&&(l=PP(0,this._url.href)),this._storedError=l,this._headersCapability.reject(l)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",i=>{this._error(i)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Zv("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class $Ze{constructor(t,i,s){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const l=t.source;this._isStreamingSupported=!l.disableStream;const d=lc.getBuiltinModule("fs");this._setReadableStream(d.createReadStream(this._url,{start:i,end:s-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",i=>{this._error(i)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const H3=Symbol("INITIAL_DATA");var Ld,z5,TX;class $2e{constructor(){J(this,z5);J(this,Ld,Object.create(null))}get(t,i=null){if(i){const l=fe(this,z5,TX).call(this,t);return l.promise.then(()=>i(l.data)),null}const s=b(this,Ld)[t];if(!s||s.data===H3)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){const i=b(this,Ld)[t];return!!i&&i.data!==H3}delete(t){const i=b(this,Ld)[t];return!i||i.data===H3?!1:(delete b(this,Ld)[t],!0)}resolve(t,i=null){const s=fe(this,z5,TX).call(this,t);s.data=i,s.resolve()}clear(){var t;for(const i in b(this,Ld)){const{data:s}=b(this,Ld)[i];(t=s==null?void 0:s.bitmap)==null||t.close()}te(this,Ld,Object.create(null))}*[Symbol.iterator](){for(const t in b(this,Ld)){const{data:i}=b(this,Ld)[t];i!==H3&&(yield[t,i])}}}Ld=new WeakMap,z5=new WeakSet,TX=function(t){var i;return(i=b(this,Ld))[t]||(i[t]={...Promise.withResolvers(),data:H3})};const KZe=1e5,cpe=30;var wme,rv,Yc,H5,G5,FE,hg,W5,$5,BE,$T,KT,sv,qT,K5,YT,VE,q5,Y5,XT,zE,X5,av,JT,ij,K2e,rj,q2e,J5,RX,QT,VM,Q5,xX,sj,Y2e,aj,X2e;const ta=class ta{constructor({textContentSource:t,container:i,viewport:s}){J(this,ij);J(this,rj);J(this,J5);J(this,rv,Promise.withResolvers());J(this,Yc,null);J(this,H5,!1);J(this,G5,!!((wme=globalThis.FontInspector)!=null&&wme.enabled));J(this,FE,null);J(this,hg,null);J(this,W5,0);J(this,$5,0);J(this,BE,null);J(this,$T,null);J(this,KT,0);J(this,sv,0);J(this,qT,Object.create(null));J(this,K5,[]);J(this,YT,null);J(this,VE,[]);J(this,q5,new WeakMap);J(this,Y5,null);var m;if(t instanceof ReadableStream)te(this,YT,t);else if(typeof t=="object")te(this,YT,new ReadableStream({start(y){y.enqueue(t),y.close()}}));else throw new Error('No "textContentSource" parameter specified.');te(this,Yc,te(this,$T,i)),te(this,sv,s.scale*Kp.pixelRatio),te(this,KT,s.rotation),te(this,hg,{div:null,properties:null,ctx:null});const{pageWidth:l,pageHeight:d,pageX:u,pageY:p}=s.rawDims;te(this,Y5,[1,0,0,-1,-u,p+d]),te(this,$5,l),te(this,W5,d),fe(m=ta,sj,Y2e).call(m),X2(i,s),b(this,rv).promise.finally(()=>{b(ta,JT).delete(this),te(this,hg,null),te(this,qT,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:i}=Zo.platform;return Ki(this,"fontFamilyMap",new Map([["sans-serif",`${t&&i?"Calibri, ":""}sans-serif`],["monospace",`${t&&i?"Lucida Console, ":""}monospace`]]))}render(){const t=()=>{b(this,BE).read().then(({value:i,done:s})=>{if(s){b(this,rv).resolve();return}b(this,FE)??te(this,FE,i.lang),Object.assign(b(this,qT),i.styles),fe(this,ij,K2e).call(this,i.items),t()},b(this,rv).reject)};return te(this,BE,b(this,YT).getReader()),b(ta,JT).add(this),t(),b(this,rv).promise}update({viewport:t,onBefore:i=null}){var d;const s=t.scale*Kp.pixelRatio,l=t.rotation;if(l!==b(this,KT)&&(i==null||i(),te(this,KT,l),X2(b(this,$T),{rotation:l})),s!==b(this,sv)){i==null||i(),te(this,sv,s);const u={div:null,properties:null,ctx:fe(d=ta,QT,VM).call(d,b(this,FE))};for(const p of b(this,VE))u.properties=b(this,q5).get(p),u.div=p,fe(this,J5,RX).call(this,u)}}cancel(){var i;const t=new Zv("TextLayer task cancelled.");(i=b(this,BE))==null||i.cancel(t).catch(()=>{}),te(this,BE,null),b(this,rv).reject(t)}get textDivs(){return b(this,VE)}get textContentItemsStr(){return b(this,K5)}static cleanup(){if(!(b(this,JT).size>0)){b(this,XT).clear();for(const{canvas:t}of b(this,zE).values())t.remove();b(this,zE).clear()}}};rv=new WeakMap,Yc=new WeakMap,H5=new WeakMap,G5=new WeakMap,FE=new WeakMap,hg=new WeakMap,W5=new WeakMap,$5=new WeakMap,BE=new WeakMap,$T=new WeakMap,KT=new WeakMap,sv=new WeakMap,qT=new WeakMap,K5=new WeakMap,YT=new WeakMap,VE=new WeakMap,q5=new WeakMap,Y5=new WeakMap,XT=new WeakMap,zE=new WeakMap,X5=new WeakMap,av=new WeakMap,JT=new WeakMap,ij=new WeakSet,K2e=function(t){var l,d;if(b(this,H5))return;(d=b(this,hg)).ctx??(d.ctx=fe(l=ta,QT,VM).call(l,b(this,FE)));const i=b(this,VE),s=b(this,K5);for(const u of t){if(i.length>KZe){Ei("Ignoring additional textDivs for performance reasons."),te(this,H5,!0);return}if(u.str===void 0){if(u.type==="beginMarkedContentProps"||u.type==="beginMarkedContent"){const p=b(this,Yc);te(this,Yc,document.createElement("span")),b(this,Yc).classList.add("markedContent"),u.id&&b(this,Yc).setAttribute("id",`${u.id}`),p.append(b(this,Yc))}else u.type==="endMarkedContent"&&te(this,Yc,b(this,Yc).parentNode);continue}s.push(u.str),fe(this,rj,q2e).call(this,u)}},rj=new WeakSet,q2e=function(t){var O;const i=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};b(this,VE).push(i);const l=In.transform(b(this,Y5),t.transform);let d=Math.atan2(l[1],l[0]);const u=b(this,qT)[t.fontName];u.vertical&&(d+=Math.PI/2);let p=b(this,G5)&&u.fontSubstitution||u.fontFamily;p=ta.fontFamilyMap.get(p)||p;const m=Math.hypot(l[2],l[3]),y=m*fe(O=ta,aj,X2e).call(O,p,u,b(this,FE));let _,E;d===0?(_=l[4],E=l[5]-y):(_=l[4]+y*Math.sin(d),E=l[5]-y*Math.cos(d));const C="calc(var(--total-scale-factor) *",x=i.style;b(this,Yc)===b(this,$T)?(x.left=`${(100*_/b(this,$5)).toFixed(2)}%`,x.top=`${(100*E/b(this,W5)).toFixed(2)}%`):(x.left=`${C}${_.toFixed(2)}px)`,x.top=`${C}${E.toFixed(2)}px)`),x.fontSize=`${C}${(b(ta,av)*m).toFixed(2)}px)`,x.fontFamily=p,s.fontSize=m,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,b(this,G5)&&(i.dataset.fontName=u.fontSubstitutionLoadedName||t.fontName),d!==0&&(s.angle=d*(180/Math.PI));let N=!1;if(t.str.length>1)N=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const D=Math.abs(t.transform[0]),P=Math.abs(t.transform[3]);D!==P&&Math.max(D,P)/Math.min(D,P)>1.5&&(N=!0)}if(N&&(s.canvasWidth=u.vertical?t.height:t.width),b(this,q5).set(i,s),b(this,hg).div=i,b(this,hg).properties=s,fe(this,J5,RX).call(this,b(this,hg)),s.hasText&&b(this,Yc).append(i),s.hasEOL){const D=document.createElement("br");D.setAttribute("role","presentation"),b(this,Yc).append(D)}},J5=new WeakSet,RX=function(t){var p;const{div:i,properties:s,ctx:l}=t,{style:d}=i;let u="";if(b(ta,av)>1&&(u=`scale(${1/b(ta,av)})`),s.canvasWidth!==0&&s.hasText){const{fontFamily:m}=d,{canvasWidth:y,fontSize:_}=s;fe(p=ta,Q5,xX).call(p,l,_*b(this,sv),m);const{width:E}=l.measureText(i.textContent);E>0&&(u=`scaleX(${y*b(this,sv)/E}) ${u}`)}s.angle!==0&&(u=`rotate(${s.angle}deg) ${u}`),u.length>0&&(d.transform=u)},QT=new WeakSet,VM=function(t=null){let i=b(this,zE).get(t||(t=""));if(!i){const s=document.createElement("canvas");s.className="hiddenCanvasElement",s.lang=t,document.body.append(s),i=s.getContext("2d",{alpha:!1,willReadFrequently:!0}),b(this,zE).set(t,i),b(this,X5).set(i,{size:0,family:""})}return i},Q5=new WeakSet,xX=function(t,i,s){const l=b(this,X5).get(t);i===l.size&&s===l.family||(t.font=`${i}px ${s}`,l.size=i,l.family=s)},sj=new WeakSet,Y2e=function(){if(b(this,av)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),te(this,av,t.getBoundingClientRect().height),t.remove()},aj=new WeakSet,X2e=function(t,i,s){const l=b(this,XT).get(t);if(l)return l;const d=fe(this,QT,VM).call(this,s);d.canvas.width=d.canvas.height=cpe,fe(this,Q5,xX).call(this,d,cpe,t);const u=d.measureText(""),p=u.fontBoundingBoxAscent,m=Math.abs(u.fontBoundingBoxDescent);d.canvas.width=d.canvas.height=0;let y=.8;return p?y=p/(p+m):(Zo.platform.isFirefox&&Ei("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),i.ascent?y=i.ascent:i.descent&&(y=1+i.descent)),b(this,XT).set(t,y),y},J(ta,QT),J(ta,Q5),J(ta,sj),J(ta,aj),J(ta,XT,new Map),J(ta,zE,new Map),J(ta,X5,new WeakMap),J(ta,av,null),J(ta,JT,new Set);let xN=ta;class AN{static textContent(t){const i=[],s={items:i,styles:Object.create(null)};function l(d){var m;if(!d)return;let u=null;const p=d.name;if(p==="#text")u=d.value;else if(AN.shouldBuildText(p))(m=d==null?void 0:d.attributes)!=null&&m.textContent?u=d.attributes.textContent:d.value&&(u=d.value);else return;if(u!==null&&i.push({str:u}),!!d.children)for(const y of d.children)l(y)}return l(t),s}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const qZe=100;function J2e(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});const t=new AX,{docId:i}=t,s=n.url?nZe(n.url):null,l=n.data?iZe(n.data):null,d=n.httpHeaders||null,u=n.withCredentials===!0,p=n.password??null,m=n.range instanceof Q2e?n.range:null,y=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:2**16;let _=n.worker instanceof IN?n.worker:null;const E=n.verbosity,C=typeof n.docBaseUrl=="string"&&!TF(n.docBaseUrl)?n.docBaseUrl:null,x=tM(n.cMapUrl),N=n.cMapPacked!==!1,O=n.CMapReaderFactory||(sc?uZe:Jfe),D=tM(n.iccUrl),P=tM(n.standardFontDataUrl),j=n.StandardFontDataFactory||(sc?hZe:Qfe),M=tM(n.wasmUrl),V=n.WasmFactory||(sc?fZe:Zfe),G=n.stopAtErrors!==!0,$=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,ne=n.isEvalSupported!==!1,Y=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!sc,le=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!sc&&(Zo.platform.isFirefox||!globalThis.chrome),re=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,ee=typeof n.disableFontFace=="boolean"?n.disableFontFace:sc,de=n.fontExtraProperties===!0,H=n.enableXfa===!0,ae=n.ownerDocument||globalThis.document,_e=n.disableRange===!0,me=n.disableStream===!0,Ce=n.disableAutoFetch===!0,he=n.pdfBug===!0,pe=n.CanvasFactory||(sc?dZe:oZe),Oe=n.FilterFactory||(sc?cZe:lZe),Fe=n.enableHWA===!0,Ue=n.useWasm!==!1,Ve=m?m.length:n.length??NaN,Re=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!sc&&!ee,Be=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:!!(O===Jfe&&j===Qfe&&V===Zfe&&x&&P&&M&&a4(x,document.baseURI)&&a4(P,document.baseURI)&&a4(M,document.baseURI)),Xe=null;DQe(E);const we={canvasFactory:new pe({ownerDocument:ae,enableHWA:Fe}),filterFactory:new Oe({docId:i,ownerDocument:ae}),cMapReaderFactory:Be?null:new O({baseUrl:x,isCompressed:N}),standardFontDataFactory:Be?null:new j({baseUrl:P}),wasmFactory:Be?null:new V({baseUrl:M})};_||(_=IN.create({verbosity:E,port:Vp.workerPort}),t._worker=_);const We={docId:i,apiVersion:"5.4.149",data:l,password:p,disableAutoFetch:Ce,rangeChunkSize:y,length:Ve,docBaseUrl:C,enableXfa:H,evaluatorOptions:{maxImageSize:$,disableFontFace:ee,ignoreErrors:G,isEvalSupported:ne,isOffscreenCanvasSupported:Y,isImageDecoderSupported:le,canvasMaxAreaInBytes:re,fontExtraProperties:de,useSystemFonts:Re,useWasm:Ue,useWorkerFetch:Be,cMapUrl:x,iccUrl:D,standardFontDataUrl:P,wasmUrl:M}},st={ownerDocument:ae,pdfBug:he,styleElement:Xe,loadingParams:{disableAutoFetch:Ce,enableXfa:H}};return _.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(_.destroyed)throw new Error("Worker was destroyed");const pt=_.messageHandler.sendWithPromise("GetDocRequest",We,l?[l.buffer]:null);let Qe;if(m)Qe=new NZe(m,{disableRange:_e,disableStream:me});else if(!l){if(!s)throw new Error("getDocument - no `url` parameter provided.");const Je=a4(s)?DZe:sc?GZe:FZe;Qe=new Je({url:s,length:Ve,httpHeaders:d,withCredentials:u,rangeChunkSize:y,disableRange:_e,disableStream:me})}return pt.then(Je=>{if(t.destroyed)throw new Error("Loading aborted");if(_.destroyed)throw new Error("Worker was destroyed");const St=new h4(i,Je,_.port),Xt=new JZe(St,t,Qe,st,we,Fe);t._transport=Xt,St.send("Ready",null)})}).catch(t._capability.reject),t}var oj;const lj=class lj{constructor(){sn(this,"_capability",Promise.withResolvers());sn(this,"_transport",null);sn(this,"_worker",null);sn(this,"docId",`d${ea(lj,oj)._++}`);sn(this,"destroyed",!1);sn(this,"onPassword",null);sn(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t,i,s,l;this.destroyed=!0;try{(t=this._worker)!=null&&t.port&&(this._worker._pendingDestroy=!0),await((i=this._transport)==null?void 0:i.destroy())}catch(d){throw(s=this._worker)!=null&&s.port&&delete this._worker._pendingDestroy,d}this._transport=null,(l=this._worker)==null||l.destroy(),this._worker=null}async getData(){return this._transport.getData()}};oj=new WeakMap,J(lj,oj,0);let AX=lj;var HE,Z5,eO,tO,nO;class Q2e{constructor(t,i,s=!1,l=null){J(this,HE,Promise.withResolvers());J(this,Z5,[]);J(this,eO,[]);J(this,tO,[]);J(this,nO,[]);this.length=t,this.initialData=i,this.progressiveDone=s,this.contentDispositionFilename=l}addRangeListener(t){b(this,nO).push(t)}addProgressListener(t){b(this,tO).push(t)}addProgressiveReadListener(t){b(this,eO).push(t)}addProgressiveDoneListener(t){b(this,Z5).push(t)}onDataRange(t,i){for(const s of b(this,nO))s(t,i)}onDataProgress(t,i){b(this,HE).promise.then(()=>{for(const s of b(this,tO))s(t,i)})}onDataProgressiveRead(t){b(this,HE).promise.then(()=>{for(const i of b(this,eO))i(t)})}onDataProgressiveDone(){b(this,HE).promise.then(()=>{for(const t of b(this,Z5))t()})}transportReady(){b(this,HE).resolve()}requestDataRange(t,i){ns("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}HE=new WeakMap,Z5=new WeakMap,eO=new WeakMap,tO=new WeakMap,nO=new WeakMap;class YZe{constructor(t,i){this._pdfInfo=t,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Ki(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(t,i){return this._transport.getAnnotationsByType(t,i)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(i)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var fg,GE,v4;class XZe{constructor(t,i,s,l=!1){J(this,GE);J(this,fg,!1);this._pageIndex=t,this._pageInfo=i,this._transport=s,this._stats=l?new qfe:null,this._pdfBug=l,this.commonObjs=s.commonObjs,this.objs=new $2e,this._intentStates=new Map,this.destroyed=!1,this.recordedGroups=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:i=this.rotate,offsetX:s=0,offsetY:l=0,dontFlip:d=!1}={}){return new NP({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:i,offsetX:s,offsetY:l,dontFlip:d})}getAnnotations({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Ki(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return((t=this._transport._htmlForXfa)==null?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,canvas:i=t.canvas,viewport:s,intent:l="display",annotationMode:d=C1.ENABLE,transform:u=null,background:p=null,optionalContentConfigPromise:m=null,annotationCanvasMap:y=null,pageColors:_=null,printAnnotationStorage:E=null,isEditing:C=!1,recordOperations:x=!1,filteredOperationIndexes:N=null}){var Y,le,re;(Y=this._stats)==null||Y.time("Overall");const O=this._transport.getRenderingIntent(l,d,E,C),{renderingIntent:D,cacheKey:P}=O;te(this,fg,!1),m||(m=this._transport.getOptionalContentConfig(D));let j=this._intentStates.get(P);j||(j=Object.create(null),this._intentStates.set(P,j)),j.streamReaderCancelTimeout&&(clearTimeout(j.streamReaderCancelTimeout),j.streamReaderCancelTimeout=null);const M=!!(D&Wd.PRINT);j.displayReadyCapability||(j.displayReadyCapability=Promise.withResolvers(),j.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(le=this._stats)==null||le.time("Page Request"),this._pumpOperatorList(O));const V=!this.recordedGroups&&(x||this._pdfBug&&((re=globalThis.StepperManager)==null?void 0:re.enabled)),G=ee=>{var de,H,ae;if(j.renderTasks.delete($),V){const _e=(de=$.gfx)==null?void 0:de.dependencyTracker.take();_e?((H=$.stepper)==null||H.setOperatorGroups(_e),x&&(this.recordedGroups=_e)):x&&(this.recordedGroups=[])}M&&te(this,fg,!0),fe(this,GE,v4).call(this),ee?($.capability.reject(ee),this._abortOperatorList({intentState:j,reason:ee instanceof Error?ee:new Error(ee)})):$.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(ae=globalThis.Stats)!=null&&ae.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},$=new IX({callback:G,params:{canvas:i,canvasContext:t,dependencyTracker:V?new pZe(i):null,viewport:s,transform:u,background:p},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:y,operatorList:j.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!M,pdfBug:this._pdfBug,pageColors:_,enableHWA:this._transport.enableHWA,filteredOperationIndexes:N});(j.renderTasks||(j.renderTasks=new Set)).add($);const ne=$.task;return Promise.all([j.displayReadyCapability.promise,m]).then(([ee,de])=>{var H;if(this.destroyed){G();return}if((H=this._stats)==null||H.time("Rendering"),!(de.renderingIntent&D))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");$.initializeGraphics({transparency:ee,optionalContentConfig:de}),$.operatorListChanged()}).catch(G),ne}getOperatorList({intent:t="display",annotationMode:i=C1.ENABLE,printAnnotationStorage:s=null,isEditing:l=!1}={}){var y;function d(){p.operatorList.lastChunk&&(p.opListReadCapability.resolve(p.operatorList),p.renderTasks.delete(m))}const u=this._transport.getRenderingIntent(t,i,s,l,!0);let p=this._intentStates.get(u.cacheKey);p||(p=Object.create(null),this._intentStates.set(u.cacheKey,p));let m;return p.opListReadCapability||(m=Object.create(null),m.operatorListChanged=d,p.opListReadCapability=Promise.withResolvers(),(p.renderTasks||(p.renderTasks=new Set)).add(m),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(y=this._stats)==null||y.time("Page Request"),this._pumpOperatorList(u)),p.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:i===!0},{highWaterMark:100,size(l){return l.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(s=>AN.textContent(s));const i=this.streamTextContent(t);return new Promise(function(s,l){function d(){u.read().then(function({value:m,done:y}){if(y){s(p);return}p.lang??(p.lang=m.lang),Object.assign(p.styles,m.styles),p.items.push(...m.items),d()},l)}const u=i.getReader(),p={items:[],styles:Object.create(null),lang:null};d()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const s of i.renderTasks)t.push(s.completed),s.cancel();return this.objs.clear(),te(this,fg,!1),Promise.all(t)}cleanup(t=!1){te(this,fg,!0);const i=fe(this,GE,v4).call(this);return t&&i&&this._stats&&(this._stats=new qfe),i}_startRenderPage(t,i){var l,d;const s=this._intentStates.get(i);s&&((l=this._stats)==null||l.timeEnd("Page Request"),(d=s.displayReadyCapability)==null||d.resolve(t))}_renderPageChunk(t,i){for(let s=0,l=t.length;s<l;s++)i.operatorList.fnArray.push(t.fnArray[s]),i.operatorList.argsArray.push(t.argsArray[s]);i.operatorList.lastChunk=t.lastChunk,i.operatorList.separateAnnots=t.separateAnnots;for(const s of i.renderTasks)s.operatorListChanged();t.lastChunk&&fe(this,GE,v4).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:i,annotationStorageSerializable:s,modifiedIds:l}){const{map:d,transfer:u}=s,m=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:i,annotationStorage:d,modifiedIds:l},u).getReader(),y=this._intentStates.get(i);y.streamReader=m;const _=()=>{m.read().then(({value:E,done:C})=>{if(C){y.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(E,y),_())},E=>{if(y.streamReader=null,!this._transport.destroyed){if(y.operatorList){y.operatorList.lastChunk=!0;for(const C of y.renderTasks)C.operatorListChanged();fe(this,GE,v4).call(this)}if(y.displayReadyCapability)y.displayReadyCapability.reject(E);else if(y.opListReadCapability)y.opListReadCapability.reject(E);else throw E}})};_()}_abortOperatorList({intentState:t,reason:i,force:s=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!s){if(t.renderTasks.size>0)return;if(i instanceof UZ){let l=qZe;i.extraDelay>0&&i.extraDelay<1e3&&(l+=i.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:i,force:!0})},l);return}}if(t.streamReader.cancel(new Zv(i.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[l,d]of this._intentStates)if(d===t){this._intentStates.delete(l);break}this.cleanup()}}}get stats(){return this._stats}}fg=new WeakMap,GE=new WeakSet,v4=function(){if(!b(this,fg)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:i}of this._intentStates.values())if(t.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),te(this,fg,!1),!0};var ov,nf,pg,WE,cj,$E,KE,ZT,zM,dj,Z2e,uj,ewe,qE,y4,eR,HM;const Ls=class Ls{constructor({name:t=null,port:i=null,verbosity:s=kQe()}={}){J(this,ZT);J(this,dj);J(this,uj);J(this,qE);J(this,ov,Promise.withResolvers());J(this,nf,null);J(this,pg,null);J(this,WE,null);if(this.name=t,this.destroyed=!1,this.verbosity=s,i){if(b(Ls,KE).has(i))throw new Error("Cannot use more than one PDFWorker per port.");b(Ls,KE).set(i,this),fe(this,dj,Z2e).call(this,i)}else fe(this,uj,ewe).call(this)}get promise(){return b(this,ov).promise}get port(){return b(this,pg)}get messageHandler(){return b(this,nf)}destroy(){var t,i;this.destroyed=!0,(t=b(this,WE))==null||t.terminate(),te(this,WE,null),b(Ls,KE).delete(b(this,pg)),te(this,pg,null),(i=b(this,nf))==null||i.destroy(),te(this,nf,null)}static create(t){const i=b(this,KE).get(t==null?void 0:t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new Ls(t)}static get workerSrc(){if(Vp.workerSrc)return Vp.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Ki(this,"_setupFakeWorkerGlobal",(async()=>b(this,eR,HM)?b(this,eR,HM):(await lr(()=>import(this.workerSrc),__vite__mapDeps([]))).WorkerMessageHandler)())}};ov=new WeakMap,nf=new WeakMap,pg=new WeakMap,WE=new WeakMap,cj=new WeakMap,$E=new WeakMap,KE=new WeakMap,ZT=new WeakSet,zM=function(){b(this,ov).resolve(),b(this,nf).send("configure",{verbosity:this.verbosity})},dj=new WeakSet,Z2e=function(t){te(this,pg,t),te(this,nf,new h4("main","worker",t)),b(this,nf).on("ready",()=>{}),fe(this,ZT,zM).call(this)},uj=new WeakSet,ewe=function(){if(b(Ls,$E)||b(Ls,eR,HM)){fe(this,qE,y4).call(this);return}let{workerSrc:t}=Ls;try{Ls._isSameOrigin(window.location,t)||(t=Ls._createCDNWrapper(new URL(t,window.location).href));const i=new Worker(t,{type:"module"}),s=new h4("main","worker",i),l=()=>{d.abort(),s.destroy(),i.terminate(),this.destroyed?b(this,ov).reject(new Error("Worker was destroyed")):fe(this,qE,y4).call(this)},d=new AbortController;i.addEventListener("error",()=>{b(this,WE)||l()},{signal:d.signal}),s.on("test",p=>{if(d.abort(),this.destroyed||!p){l();return}te(this,nf,s),te(this,pg,i),te(this,WE,i),fe(this,ZT,zM).call(this)}),s.on("ready",p=>{if(d.abort(),this.destroyed){l();return}try{u()}catch{fe(this,qE,y4).call(this)}});const u=()=>{const p=new Uint8Array;s.send("test",p,[p.buffer])};u();return}catch{CF("The worker has been disabled.")}fe(this,qE,y4).call(this)},qE=new WeakSet,y4=function(){b(Ls,$E)||(Ei("Setting up fake worker."),te(Ls,$E,!0)),Ls._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){b(this,ov).reject(new Error("Worker was destroyed"));return}const i=new aZe;te(this,pg,i);const s=`fake${ea(Ls,cj)._++}`,l=new h4(s+"_worker",s,i);t.setup(l,i),te(this,nf,new h4(s,s+"_worker",i)),fe(this,ZT,zM).call(this)}).catch(t=>{b(this,ov).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},eR=new WeakSet,HM=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},J(Ls,eR),J(Ls,cj,0),J(Ls,$E,!1),J(Ls,KE,new WeakMap),sc&&(te(Ls,$E,!0),Vp.workerSrc||(Vp.workerSrc="./pdf.worker.mjs")),Ls._isSameOrigin=(t,i)=>{const s=URL.parse(t);if(!(s!=null&&s.origin)||s.origin==="null")return!1;const l=new URL(i,s);return s.origin===l.origin},Ls._createCDNWrapper=t=>{const i=`await import("${t}");`;return URL.createObjectURL(new Blob([i],{type:"text/javascript"}))},Ls.fromPort=t=>{if(KQe("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Ls.create(t)};let IN=Ls;var mg,Ap,tR,nR,gg,YE,_4;class JZe{constructor(t,i,s,l,d,u){J(this,YE);J(this,mg,new Map);J(this,Ap,new Map);J(this,tR,new Map);J(this,nR,new Map);J(this,gg,null);this.messageHandler=t,this.loadingTask=i,this.commonObjs=new $2e,this.fontLoader=new eZe({ownerDocument:l.ownerDocument,styleElement:l.styleElement}),this.loadingParams=l.loadingParams,this._params=l,this.canvasFactory=d.canvasFactory,this.filterFactory=d.filterFactory,this.cMapReaderFactory=d.cMapReaderFactory,this.standardFontDataFactory=d.standardFontDataFactory,this.wasmFactory=d.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=s,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=u,this.setupMessageHandler()}get annotationStorage(){return Ki(this,"annotationStorage",new BZ)}getRenderingIntent(t,i=C1.ENABLE,s=null,l=!1,d=!1){let u=Wd.DISPLAY,p=mX;switch(t){case"any":u=Wd.ANY;break;case"display":break;case"print":u=Wd.PRINT;break;default:Ei(`getRenderingIntent - invalid intent: ${t}`)}const m=u&Wd.PRINT&&s instanceof N2e?s:this.annotationStorage;switch(i){case C1.DISABLE:u+=Wd.ANNOTATIONS_DISABLE;break;case C1.ENABLE:break;case C1.ENABLE_FORMS:u+=Wd.ANNOTATIONS_FORMS;break;case C1.ENABLE_STORAGE:u+=Wd.ANNOTATIONS_STORAGE,p=m.serializable;break;default:Ei(`getRenderingIntent - invalid annotationMode: ${i}`)}l&&(u+=Wd.IS_EDITING),d&&(u+=Wd.OPLIST);const{ids:y,hash:_}=m.modifiedIds,E=[u,p.hash,_];return{renderingIntent:u,cacheKey:E.join("_"),annotationStorageSerializable:p,modifiedIds:y}}destroy(){var s;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(s=b(this,gg))==null||s.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const l of b(this,Ap).values())t.push(l._destroy());b(this,Ap).clear(),b(this,tR).clear(),b(this,nR).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return t.push(i),Promise.all(t).then(()=>{var l,d;this.commonObjs.clear(),this.fontLoader.clear(),b(this,mg).clear(),this.filterFactory.destroy(),xN.cleanup(),(l=this._networkStream)==null||l.cancelAllRequests(new Zv("Worker was terminated.")),(d=this.messageHandler)==null||d.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:i}=this;t.on("GetReader",(s,l)=>{La(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=d=>{this._lastProgress={loaded:d.loaded,total:d.total}},l.onPull=()=>{this._fullReader.read().then(function({value:d,done:u}){if(u){l.close();return}La(d instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),l.enqueue(new Uint8Array(d),1,[d])}).catch(d=>{l.error(d)})},l.onCancel=d=>{this._fullReader.cancel(d),l.ready.catch(u=>{if(!this.destroyed)throw u})}}),t.on("ReaderHeadersReady",async s=>{var p;await this._fullReader.headersReady;const{isStreamingSupported:l,isRangeSupported:d,contentLength:u}=this._fullReader;return(!l||!d)&&(this._lastProgress&&((p=i.onProgress)==null||p.call(i,this._lastProgress)),this._fullReader.onProgress=m=>{var y;(y=i.onProgress)==null||y.call(i,{loaded:m.loaded,total:m.total})}),{isStreamingSupported:l,isRangeSupported:d,contentLength:u}}),t.on("GetRangeReader",(s,l)=>{La(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const d=this._networkStream.getRangeReader(s.begin,s.end);if(!d){l.close();return}l.onPull=()=>{d.read().then(function({value:u,done:p}){if(p){l.close();return}La(u instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),l.enqueue(new Uint8Array(u),1,[u])}).catch(u=>{l.error(u)})},l.onCancel=u=>{d.cancel(u),l.ready.catch(p=>{if(!this.destroyed)throw p})}}),t.on("GetDoc",({pdfInfo:s})=>{this._numPages=s.numPages,this._htmlForXfa=s.htmlForXfa,delete s.htmlForXfa,i._capability.resolve(new YZe(s,this))}),t.on("DocException",s=>{i._capability.reject(Wc(s))}),t.on("PasswordRequest",s=>{te(this,gg,Promise.withResolvers());try{if(!i.onPassword)throw Wc(s);const l=d=>{d instanceof Error?b(this,gg).reject(d):b(this,gg).resolve({password:d})};i.onPassword(l,s.code)}catch(l){b(this,gg).reject(l)}return b(this,gg).promise}),t.on("DataLoaded",s=>{var l;(l=i.onProgress)==null||l.call(i,{loaded:s.length,total:s.length}),this.downloadInfoCapability.resolve(s)}),t.on("StartRenderPage",s=>{if(this.destroyed)return;b(this,Ap).get(s.pageIndex)._startRenderPage(s.transparency,s.cacheKey)}),t.on("commonobj",([s,l,d])=>{var u;if(this.destroyed||this.commonObjs.has(s))return null;switch(l){case"Font":if("error"in d){const _=d.error;Ei(`Error during font loading: ${_}`),this.commonObjs.resolve(s,_);break}const p=this._params.pdfBug&&((u=globalThis.FontInspector)!=null&&u.enabled)?(_,E)=>globalThis.FontInspector.fontAdded(_,E):null,m=new tZe(d,p);this.fontLoader.bind(m).catch(()=>t.sendWithPromise("FontFallback",{id:s})).finally(()=>{!m.fontExtraProperties&&m.data&&(m.data=null),this.commonObjs.resolve(s,m)});break;case"CopyLocalImage":const{imageRef:y}=d;La(y,"The imageRef must be defined.");for(const _ of b(this,Ap).values())for(const[,E]of _.objs)if((E==null?void 0:E.ref)===y)return E.dataLen?(this.commonObjs.resolve(s,structuredClone(E)),E.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(s,d);break;default:throw new Error(`Got unknown common object type ${l}`)}return null}),t.on("obj",([s,l,d,u])=>{var m;if(this.destroyed)return;const p=b(this,Ap).get(l);if(!p.objs.has(s)){if(p._intentStates.size===0){(m=u==null?void 0:u.bitmap)==null||m.close();return}switch(d){case"Image":case"Pattern":p.objs.resolve(s,u);break;default:throw new Error(`Got unknown object type ${d}`)}}}),t.on("DocProgress",s=>{var l;this.destroyed||(l=i.onProgress)==null||l.call(i,{loaded:s.loaded,total:s.total})}),t.on("FetchBinaryData",async s=>{if(this.destroyed)throw new Error("Worker was destroyed.");const l=this[s.type];if(!l)throw new Error(`${s.type} not initialized, see the \`useWorkerFetch\` parameter.`);return l.fetch(s)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var s;this.annotationStorage.size<=0&&Ei("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:((s=this._fullReader)==null?void 0:s.filename)??null},i).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=t-1,s=b(this,tR).get(i);if(s)return s;const l=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(d=>{if(this.destroyed)throw new Error("Transport destroyed");d.refStr&&b(this,nR).set(d.refStr,t);const u=new XZe(i,d,this,this._params.pdfBug);return b(this,Ap).set(i,u),u});return b(this,tR).set(i,l),l}getPageIndex(t){return gX(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:i})}getFieldObjects(){return fe(this,YE,_4).call(this,"GetFieldObjects")}hasJSActions(){return fe(this,YE,_4).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(t,i){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:i})}getDocJSActions(){return fe(this,YE,_4).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return fe(this,YE,_4).call(this,"GetOptionalContentConfig").then(i=>new IZe(i,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",i=b(this,mg).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,null).then(l=>{var d,u;return{info:l[0],metadata:l[1]?new xZe(l[1]):null,contentDispositionFilename:((d=this._fullReader)==null?void 0:d.filename)??null,contentLength:((u=this._fullReader)==null?void 0:u.contentLength)??null}});return b(this,mg).set(t,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const i of b(this,Ap).values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),b(this,mg).clear(),this.filterFactory.destroy(!0),xN.cleanup()}}cachedPageNumber(t){if(!gX(t))return null;const i=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return b(this,nR).get(i)??null}}mg=new WeakMap,Ap=new WeakMap,tR=new WeakMap,nR=new WeakMap,gg=new WeakMap,YE=new WeakSet,_4=function(t,i=null){const s=b(this,mg).get(t);if(s)return s;const l=this.messageHandler.sendWithPromise(t,i);return b(this,mg).set(t,l),l};var lv;class QZe{constructor(t){J(this,lv,null);sn(this,"onContinue",null);sn(this,"onError",null);te(this,lv,t)}get promise(){return b(this,lv).capability.promise}cancel(t=0){b(this,lv).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=b(this,lv).operatorList;if(!t)return!1;const{annotationCanvasMap:i}=b(this,lv);return t.form||t.canvas&&(i==null?void 0:i.size)>0}}lv=new WeakMap;var cv,XE;const K_=class K_{constructor({callback:t,params:i,objs:s,commonObjs:l,annotationCanvasMap:d,operatorList:u,pageIndex:p,canvasFactory:m,filterFactory:y,useRequestAnimationFrame:_=!1,pdfBug:E=!1,pageColors:C=null,enableHWA:x=!1,filteredOperationIndexes:N=null}){J(this,cv,null);this.callback=t,this.params=i,this.objs=s,this.commonObjs=l,this.annotationCanvasMap=d,this.operatorListIdx=null,this.operatorList=u,this._pageIndex=p,this.canvasFactory=m,this.filterFactory=y,this._pdfBug=E,this.pageColors=C,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=_===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new QZe(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvas,this._canvasContext=i.canvas?null:i.canvasContext,this._enableHWA=x,this._dependencyTracker=i.dependencyTracker,this._filteredOperationIndexes=N}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:i}){var m,y;if(this.cancelled)return;if(this._canvas){if(b(K_,XE).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");b(K_,XE).add(this._canvas)}this._pdfBug&&((m=globalThis.StepperManager)!=null&&m.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:s,transform:l,background:d,dependencyTracker:u}=this.params,p=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new WC(p,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors,u),this.gfx.beginDrawing({transform:l,viewport:s,transparency:t,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,(y=this.graphicsReadyCallback)==null||y.call(this)}cancel(t=null,i=0){var s,l,d;this.running=!1,this.cancelled=!0,(s=this.gfx)==null||s.endDrawing(),b(this,cv)&&(window.cancelAnimationFrame(b(this,cv)),te(this,cv,null)),b(K_,XE).delete(this._canvas),t||(t=new UZ(`Rendering cancelled, page ${this._pageIndex+1}`,i)),this.callback(t),(d=(l=this.task).onError)==null||d.call(l,t)}operatorListChanged(){var t;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.stepper)==null||t.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?te(this,cv,window.requestAnimationFrame(()=>{te(this,cv,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._filteredOperationIndexes),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),b(K_,XE).delete(this._canvas),this.callback())))}};cv=new WeakMap,XE=new WeakMap,J(K_,XE,new WeakSet);let IX=K_;const ZZe="5.4.149",eet="9e2e9e209";var Dd,JE,iR,$a,iO,rR,vg,rO,dv,rf,sO,aO,NX,oO,OX,lO,PX,yg,B_,hj,twe,Ip,v1;const $c=class $c{constructor({editor:t=null,uiManager:i=null}){J(this,aO);J(this,oO);J(this,lO);J(this,yg);J(this,hj);J(this,Ip);J(this,Dd,null);J(this,JE,null);J(this,iR,void 0);J(this,$a,null);J(this,iO,!1);J(this,rR,!1);J(this,vg,null);J(this,rO,void 0);J(this,dv,null);J(this,rf,null);var s,l;t?(te(this,rR,!1),te(this,vg,t)):te(this,rR,!0),te(this,rf,(t==null?void 0:t._uiManager)||i),te(this,rO,b(this,rf)._eventBus),te(this,iR,((s=t==null?void 0:t.color)==null?void 0:s.toUpperCase())||((l=b(this,rf))==null?void 0:l.highlightColors.values().next().value)||"#FFFF98"),b($c,sO)||te($c,sO,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return Ki(this,"_keyboardManager",new OP([[["Escape","mac+Escape"],$c.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],$c.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],$c.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],$c.prototype._moveToPrevious],[["Home","mac+Home"],$c.prototype._moveToBeginning],[["End","mac+End"],$c.prototype._moveToEnd]]))}renderButton(){const t=te(this,Dd,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",b(this,vg)&&(t.ariaControls=`${b(this,vg).id}_colorpicker_dropdown`);const i=b(this,rf)._signal;t.addEventListener("click",fe(this,yg,B_).bind(this),{signal:i}),t.addEventListener("keydown",fe(this,lO,PX).bind(this),{signal:i});const s=te(this,JE,document.createElement("span"));return s.className="swatch",s.ariaHidden="true",s.style.backgroundColor=b(this,iR),t.append(s),t}renderMainDropdown(){const t=te(this,$a,fe(this,aO,NX).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===b(this,Dd)){fe(this,yg,B_).call(this,t);return}const i=t.target.getAttribute("data-color");i&&fe(this,oO,OX).call(this,i,t)}_moveToNext(t){var i,s;if(!b(this,Ip,v1)){fe(this,yg,B_).call(this,t);return}if(t.target===b(this,Dd)){(i=b(this,$a).firstChild)==null||i.focus();return}(s=t.target.nextSibling)==null||s.focus()}_moveToPrevious(t){var i,s;if(t.target===((i=b(this,$a))==null?void 0:i.firstChild)||t.target===b(this,Dd)){b(this,Ip,v1)&&this._hideDropdownFromKeyboard();return}b(this,Ip,v1)||fe(this,yg,B_).call(this,t),(s=t.target.previousSibling)==null||s.focus()}_moveToBeginning(t){var i;if(!b(this,Ip,v1)){fe(this,yg,B_).call(this,t);return}(i=b(this,$a).firstChild)==null||i.focus()}_moveToEnd(t){var i;if(!b(this,Ip,v1)){fe(this,yg,B_).call(this,t);return}(i=b(this,$a).lastChild)==null||i.focus()}hideDropdown(){var t,i;(t=b(this,$a))==null||t.classList.add("hidden"),b(this,Dd).ariaExpanded="false",(i=b(this,dv))==null||i.abort(),te(this,dv,null)}_hideDropdownFromKeyboard(){var t;if(!b(this,rR)){if(!b(this,Ip,v1)){(t=b(this,vg))==null||t.unselect();return}this.hideDropdown(),b(this,Dd).focus({preventScroll:!0,focusVisible:b(this,iO)})}}updateColor(t){if(b(this,JE)&&(b(this,JE).style.backgroundColor=t),!b(this,$a))return;const i=b(this,rf).highlightColors.values();for(const s of b(this,$a).children)s.ariaSelected=i.next().value===t.toUpperCase()}destroy(){var t,i;(t=b(this,Dd))==null||t.remove(),te(this,Dd,null),te(this,JE,null),(i=b(this,$a))==null||i.remove(),te(this,$a,null)}};Dd=new WeakMap,JE=new WeakMap,iR=new WeakMap,$a=new WeakMap,iO=new WeakMap,rR=new WeakMap,vg=new WeakMap,rO=new WeakMap,dv=new WeakMap,rf=new WeakMap,sO=new WeakMap,aO=new WeakSet,NX=function(){const t=document.createElement("div"),i=b(this,rf)._signal;t.addEventListener("contextmenu",fh,{signal:i}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),b(this,vg)&&(t.id=`${b(this,vg).id}_colorpicker_dropdown`);for(const[s,l]of b(this,rf).highlightColors){const d=document.createElement("button");d.tabIndex="0",d.role="option",d.setAttribute("data-color",l),d.title=s,d.setAttribute("data-l10n-id",b($c,sO)[s]);const u=document.createElement("span");d.append(u),u.className="swatch",u.style.backgroundColor=l,d.ariaSelected=l===b(this,iR),d.addEventListener("click",fe(this,oO,OX).bind(this,l),{signal:i}),t.append(d)}return t.addEventListener("keydown",fe(this,lO,PX).bind(this),{signal:i}),t},oO=new WeakSet,OX=function(t,i){i.stopPropagation(),b(this,rO).dispatch("switchannotationeditorparams",{source:this,type:cr.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},lO=new WeakSet,PX=function(t){$c._keyboardManager.exec(this,t)},yg=new WeakSet,B_=function(t){if(b(this,Ip,v1)){this.hideDropdown();return}if(te(this,iO,t.detail===0),b(this,dv)||(te(this,dv,new AbortController),window.addEventListener("pointerdown",fe(this,hj,twe).bind(this),{signal:b(this,rf).combinedSignal(b(this,dv))})),b(this,Dd).ariaExpanded="true",b(this,$a)){b(this,$a).classList.remove("hidden");return}const i=te(this,$a,fe(this,aO,NX).call(this));b(this,Dd).append(i)},hj=new WeakSet,twe=function(t){var i;(i=b(this,$a))!=null&&i.contains(t.target)||this.hideDropdown()},Ip=new WeakSet,v1=function(){return b(this,$a)&&!b(this,$a).classList.contains("hidden")},J($c,sO,null);let o9=$c;var Np,cO,sR,dO;const q_=class q_{constructor(t){J(this,Np,null);J(this,cO,null);J(this,sR,null);te(this,cO,t),te(this,sR,t._uiManager),b(q_,dO)||te(q_,dO,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(b(this,Np))return b(this,Np);const{editorType:t,colorType:i,colorValue:s}=b(this,cO),l=te(this,Np,document.createElement("input"));return l.type="color",l.value=s||"#000000",l.className="basicColorPicker",l.tabIndex=0,l.setAttribute("data-l10n-id",b(q_,dO)[t]),l.addEventListener("input",()=>{b(this,sR).updateParams(i,l.value)},{signal:b(this,sR)._signal}),l}update(t){b(this,Np)&&(b(this,Np).value=t)}destroy(){var t;(t=b(this,Np))==null||t.remove(),te(this,Np,null)}hideDropdown(){}};Np=new WeakMap,cO=new WeakMap,sR=new WeakMap,dO=new WeakMap,J(q_,dO,null);let l9=q_;function dpe(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function G3(n){return Math.max(0,Math.min(255,255*n))}class upe{static CMYK_G([t,i,s,l]){return["G",1-Math.min(1,.3*t+.59*s+.11*i+l)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=G3(t),[t,t,t]}static G_HTML([t]){const i=dpe(t);return`#${i}${i}${i}`}static RGB_G([t,i,s]){return["G",.3*t+.59*i+.11*s]}static RGB_rgb(t){return t.map(G3)}static RGB_HTML(t){return`#${t.map(dpe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,i,s,l]){return["RGB",1-Math.min(1,t+l),1-Math.min(1,s+l),1-Math.min(1,i+l)]}static CMYK_rgb([t,i,s,l]){return[G3(1-Math.min(1,t+l)),G3(1-Math.min(1,s+l)),G3(1-Math.min(1,i+l))]}static CMYK_HTML(t){const i=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([t,i,s]){const l=1-t,d=1-i,u=1-s,p=Math.min(l,d,u);return["CMYK",l,d,u,p]}}class tet{create(t,i,s=!1){if(t<=0||i<=0)throw new Error("Invalid SVG dimensions");const l=this._createSVG("svg:svg");return l.setAttribute("version","1.1"),s||(l.setAttribute("width",`${t}px`),l.setAttribute("height",`${i}px`)),l.setAttribute("preserveAspectRatio","none"),l.setAttribute("viewBox",`0 0 ${t} ${i}`),l}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){ns("Abstract method `_createSVG` called.")}}class c9 extends tet{_createSVG(t){return document.createElementNS(Um,t)}}class nwe{static setupStorage(t,i,s,l,d){const u=l.getValue(i,{value:null});switch(s.name){case"textarea":if(u.value!==null&&(t.textContent=u.value),d==="print")break;t.addEventListener("input",p=>{l.setValue(i,{value:p.target.value})});break;case"input":if(s.attributes.type==="radio"||s.attributes.type==="checkbox"){if(u.value===s.attributes.xfaOn?t.setAttribute("checked",!0):u.value===s.attributes.xfaOff&&t.removeAttribute("checked"),d==="print")break;t.addEventListener("change",p=>{l.setValue(i,{value:p.target.checked?p.target.getAttribute("xfaOn"):p.target.getAttribute("xfaOff")})})}else{if(u.value!==null&&t.setAttribute("value",u.value),d==="print")break;t.addEventListener("input",p=>{l.setValue(i,{value:p.target.value})})}break;case"select":if(u.value!==null){t.setAttribute("value",u.value);for(const p of s.children)p.attributes.value===u.value?p.attributes.selected=!0:p.attributes.hasOwnProperty("selected")&&delete p.attributes.selected}t.addEventListener("input",p=>{const m=p.target.options,y=m.selectedIndex===-1?"":m[m.selectedIndex].value;l.setValue(i,{value:y})});break}}static setAttributes({html:t,element:i,storage:s=null,intent:l,linkService:d}){const{attributes:u}=i,p=t instanceof HTMLAnchorElement;u.type==="radio"&&(u.name=`${u.name}-${l}`);for(const[m,y]of Object.entries(u))if(y!=null)switch(m){case"class":y.length&&t.setAttribute(m,y.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",y);break;case"style":Object.assign(t.style,y);break;case"textContent":t.textContent=y;break;default:(!p||m!=="href"&&m!=="newWindow")&&t.setAttribute(m,y)}p&&d.addLinkAttributes(t,u.href,u.newWindow),s&&u.dataId&&this.setupStorage(t,u.dataId,i,s)}static render(t){var E,C;const i=t.annotationStorage,s=t.linkService,l=t.xfaHtml,d=t.intent||"display",u=document.createElement(l.name);l.attributes&&this.setAttributes({html:u,element:l,intent:d,linkService:s});const p=d!=="richText",m=t.div;if(m.append(u),t.viewport){const x=`matrix(${t.viewport.transform.join(",")})`;m.style.transform=x}p&&m.setAttribute("class","xfaLayer xfaFont");const y=[];if(l.children.length===0){if(l.value){const x=document.createTextNode(l.value);u.append(x),p&&AN.shouldBuildText(l.name)&&y.push(x)}return{textDivs:y}}const _=[[l,-1,u]];for(;_.length>0;){const[x,N,O]=_.at(-1);if(N+1===x.children.length){_.pop();continue}const D=x.children[++_.at(-1)[1]];if(D===null)continue;const{name:P}=D;if(P==="#text"){const M=document.createTextNode(D.value);y.push(M),O.append(M);continue}const j=(E=D==null?void 0:D.attributes)!=null&&E.xmlns?document.createElementNS(D.attributes.xmlns,P):document.createElement(P);if(O.append(j),D.attributes&&this.setAttributes({html:j,element:D,storage:i,intent:d,linkService:s}),((C=D.children)==null?void 0:C.length)>0)_.push([D,-1,j]);else if(D.value){const M=document.createTextNode(D.value);p&&AN.shouldBuildText(P)&&y.push(M),j.append(M)}}for(const x of m.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))x.setAttribute("readOnly",!0);return{textDivs:y}}static update(t){const i=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=i,t.div.hidden=!1}}const net=9,Q2=new WeakSet,iet=new Date().getTimezoneOffset()*60*1e3;class hpe{static create(t){switch(t.data.annotationType){case Na.LINK:return new HZ(t);case Na.TEXT:return new ret(t);case Na.WIDGET:switch(t.data.fieldType){case"Tx":return new set(t);case"Btn":return t.data.radioButton?new awe(t):t.data.checkBox?new oet(t):new cet(t);case"Ch":return new det(t);case"Sig":return new aet(t)}return new yw(t);case Na.POPUP:return new DX(t);case Na.FREETEXT:return new fwe(t);case Na.LINE:return new het(t);case Na.SQUARE:return new fet(t);case Na.CIRCLE:return new pet(t);case Na.POLYLINE:return new pwe(t);case Na.CARET:return new get(t);case Na.INK:return new GZ(t);case Na.POLYGON:return new met(t);case Na.HIGHLIGHT:return new mwe(t);case Na.UNDERLINE:return new vet(t);case Na.SQUIGGLY:return new yet(t);case Na.STRIKEOUT:return new _et(t);case Na.STAMP:return new gwe(t);case Na.FILEATTACHMENT:return new Eet(t);default:return new Ea(t)}}}var QE,aR,_g,fj,iwe,uO,LX;const Iee=class Iee{constructor(t,{isRenderable:i=!1,ignoreBorder:s=!1,createQuadrilaterals:l=!1}={}){J(this,fj);J(this,uO);J(this,QE,null);J(this,aR,!1);J(this,_g,null);this.isRenderable=i,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,i&&(this.container=this._createContainer(s)),l&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:i}){return!!(t!=null&&t.str||i!=null&&i.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Iee._hasPopupData(this.data)}get hasCommentButton(){return this.enableComment&&this._isEditable&&this.hasPopupElement}get commentButtonPosition(){const{quadPoints:t,rect:i}=this.data;let s=-1/0,l=-1/0;if((t==null?void 0:t.length)>=8){for(let d=0;d<t.length;d+=8)t[d+1]>l?(l=t[d+1],s=t[d+2]):t[d+1]===l&&(s=Math.max(s,t[d+2]));return[s,l]}return i?[i[2],i[3]]:null}get commentButtonColor(){if(!this.data.color)return null;const[t,i,s]=this.data.color,d=255*(1-(this.data.opacity??1));return fe(this,fj,iwe).call(this,Math.min(t+d,255),Math.min(i+d,255),Math.min(s+d,255))}_normalizePoint(t){const{page:{view:i},viewport:{rawDims:{pageWidth:s,pageHeight:l,pageX:d,pageY:u}}}=this.parent;return t[1]=i[3]-t[1]+i[1],t[0]=100*(t[0]-d)/s,t[1]=100*(t[1]-u)/l,t}updateEdited(t){var d;if(!this.container)return;t.rect&&(b(this,QE)||te(this,QE,{rect:this.data.rect.slice(0)}));const{rect:i,popup:s}=t;i&&fe(this,uO,LX).call(this,i);let l=((d=b(this,_g))==null?void 0:d.popup)||this.popup;!l&&(s!=null&&s.text)&&(this._createPopup(s),l=b(this,_g).popup),l&&(l.updateEdited(t),s!=null&&s.deleted&&(l.remove(),te(this,_g,null),this.popup=null))}resetEdited(){var t;b(this,QE)&&(fe(this,uO,LX).call(this,b(this,QE).rect),(t=b(this,_g))==null||t.popup.resetEdited(),te(this,QE,null))}_createContainer(t){const{data:i,parent:{page:s,viewport:l}}=this,d=document.createElement("section");d.setAttribute("data-annotation-id",i.id),!(this instanceof yw)&&!(this instanceof HZ)&&(d.tabIndex=0);const{style:u}=d;if(u.zIndex=this.parent.zIndex,this.parent.zIndex+=2,i.alternativeText&&(d.title=i.alternativeText),i.noRotate&&d.classList.add("norotate"),!i.rect||this instanceof DX){const{rotation:O}=i;return!i.hasOwnCanvas&&O!==0&&this.setRotation(O,d),d}const{width:p,height:m}=this;if(!t&&i.borderStyle.width>0){u.borderWidth=`${i.borderStyle.width}px`;const O=i.borderStyle.horizontalCornerRadius,D=i.borderStyle.verticalCornerRadius;if(O>0||D>0){const j=`calc(${O}px * var(--total-scale-factor)) / calc(${D}px * var(--total-scale-factor))`;u.borderRadius=j}else if(this instanceof awe){const j=`calc(${p}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`;u.borderRadius=j}switch(i.borderStyle.style){case dC.SOLID:u.borderStyle="solid";break;case dC.DASHED:u.borderStyle="dashed";break;case dC.BEVELED:Ei("Unimplemented border style: beveled");break;case dC.INSET:Ei("Unimplemented border style: inset");break;case dC.UNDERLINE:u.borderBottomStyle="solid";break}const P=i.borderColor||null;P?(te(this,aR,!0),u.borderColor=In.makeHexColor(P[0]|0,P[1]|0,P[2]|0)):u.borderWidth=0}const y=In.normalizeRect([i.rect[0],s.view[3]-i.rect[1]+s.view[1],i.rect[2],s.view[3]-i.rect[3]+s.view[1]]),{pageWidth:_,pageHeight:E,pageX:C,pageY:x}=l.rawDims;u.left=`${100*(y[0]-C)/_}%`,u.top=`${100*(y[1]-x)/E}%`;const{rotation:N}=i;return i.hasOwnCanvas||N===0?(u.width=`${100*p/_}%`,u.height=`${100*m/E}%`):this.setRotation(N,d),d}setRotation(t,i=this.container){if(!this.data.rect)return;const{pageWidth:s,pageHeight:l}=this.parent.viewport.rawDims;let{width:d,height:u}=this;t%180!==0&&([d,u]=[u,d]),i.style.width=`${100*d/s}%`,i.style.height=`${100*u/l}%`,i.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(i,s,l)=>{const d=l.detail[i],u=d[0],p=d.slice(1);l.target.style[s]=upe[`${u}_HTML`](p),this.annotationStorage.setValue(this.data.id,{[s]:upe[`${u}_rgb`](p)})};return Ki(this,"_commonActions",{display:i=>{const{display:s}=i.detail,l=s%2===1;this.container.style.visibility=l?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:l,noPrint:s===1||s===2})},print:i=>{this.annotationStorage.setValue(this.data.id,{noPrint:!i.detail.print})},hidden:i=>{const{hidden:s}=i.detail;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:s,noView:s})},focus:i=>{setTimeout(()=>i.target.focus({preventScroll:!1}),0)},userName:i=>{i.target.title=i.detail.userName},readonly:i=>{i.target.disabled=i.detail.readonly},required:i=>{this._setRequired(i.target,i.detail.required)},bgColor:i=>{t("bgColor","backgroundColor",i)},fillColor:i=>{t("fillColor","backgroundColor",i)},fgColor:i=>{t("fgColor","color",i)},textColor:i=>{t("textColor","color",i)},borderColor:i=>{t("borderColor","borderColor",i)},strokeColor:i=>{t("strokeColor","borderColor",i)},rotation:i=>{const s=i.detail.rotation;this.setRotation(s),this.annotationStorage.setValue(this.data.id,{rotation:s})}})}_dispatchEventFromSandbox(t,i){const s=this._commonActions;for(const l of Object.keys(i.detail)){const d=t[l]||s[l];d==null||d(i)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const s=this._commonActions;for(const[l,d]of Object.entries(i)){const u=s[l];if(u){const p={detail:{[l]:d},target:t};u(p),delete i[l]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[i,s,l,d]=this.data.rect.map(O=>Math.fround(O));if(t.length===8){const[O,D,P,j]=t.subarray(2,6);if(l===O&&d===D&&i===P&&s===j)return}const{style:u}=this.container;let p;if(b(this,aR)){const{borderColor:O,borderWidth:D}=u;u.borderWidth=0,p=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${O}" stroke-width="${D}">`],this.container.classList.add("hasBorder")}const m=l-i,y=d-s,{svgFactory:_}=this,E=_.createElement("svg");E.classList.add("quadrilateralsContainer"),E.setAttribute("width",0),E.setAttribute("height",0),E.role="none";const C=_.createElement("defs");E.append(C);const x=_.createElement("clipPath"),N=`clippath_${this.data.id}`;x.setAttribute("id",N),x.setAttribute("clipPathUnits","objectBoundingBox"),C.append(x);for(let O=2,D=t.length;O<D;O+=8){const P=t[O],j=t[O+1],M=t[O+2],V=t[O+3],G=_.createElement("rect"),$=(M-i)/m,ne=(d-j)/y,Y=(P-M)/m,le=(j-V)/y;G.setAttribute("x",$),G.setAttribute("y",ne),G.setAttribute("width",Y),G.setAttribute("height",le),x.append(G),p==null||p.push(`<rect vector-effect="non-scaling-stroke" x="${$}" y="${ne}" width="${Y}" height="${le}"/>`)}b(this,aR)&&(p.push("</g></svg>')"),u.backgroundImage=p.join("")),this.container.append(E),this.container.style.clipPath=`url(#${N})`}_createPopup(t=null){const{data:i}=this;let s,l;t?(s={str:t.text},l=t.date):(s=i.contentsObj,l=i.modificationDate);const d=te(this,_g,new DX({data:{color:i.color,titleObj:i.titleObj,modificationDate:l,contentsObj:s,richText:i.richText,parentRect:i.rect,borderStyle:0,id:`popup_${i.id}`,rotation:i.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent.div.append(d.render())}get hasPopupElement(){return!!(b(this,_g)||this.popup||this.data.popupRef)}render(){ns("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,i=null){const s=[];if(this._fieldObjects){const l=this._fieldObjects[t];if(l)for(const{page:d,id:u,exportValues:p}of l){if(d===-1||u===i)continue;const m=typeof p=="string"?p:null,y=document.querySelector(`[data-element-id="${u}"]`);if(y&&!Q2.has(y)){Ei(`_getElementsByName - element not allowed: ${u}`);continue}s.push({id:u,exportValue:m,domElement:y})}return s}for(const l of document.getElementsByName(t)){const{exportValue:d}=l,u=l.getAttribute("data-element-id");u!==i&&Q2.has(l)&&s.push({id:u,exportValue:d,domElement:l})}return s}show(){var t;this.container&&(this.container.hidden=!1),(t=this.popup)==null||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),(t=this.popup)==null||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const i of t)i.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:i}}=this;this.container.addEventListener("dblclick",()=>{var s;(s=this.linkService.eventBus)==null||s.dispatch("switchannotationeditormode",{source:this,mode:t,editId:i,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};QE=new WeakMap,aR=new WeakMap,_g=new WeakMap,fj=new WeakSet,iwe=function(t,i,s){t/=255,i/=255,s/=255;const l=Math.max(t,i,s),d=Math.min(t,i,s),u=(l+d)/2,p=((1+Math.sqrt(u))/2*100).toFixed(2);if(l===d)return`hsl(0, 0%, ${p}%)`;const m=l-d;let y;l===t?y=(i-s)/m+(i<s?6:0):l===i?y=(s-t)/m+2:y=(t-i)/m+4,y=(y*60).toFixed(2);const _=(m/(1-Math.abs(2*u-1))*100).toFixed(2);return`hsl(${y}, ${_}%, ${p}%)`},uO=new WeakSet,LX=function(t){const{container:{style:i},data:{rect:s,rotation:l},parent:{viewport:{rawDims:{pageWidth:d,pageHeight:u,pageX:p,pageY:m}}}}=this;s==null||s.splice(0,4,...t),i.left=`${100*(t[0]-p)/d}%`,i.top=`${100*(u-t[3]+m)/u}%`,l===0?(i.width=`${100*(t[2]-t[0])/d}%`,i.height=`${100*(t[3]-t[1])/u}%`):this.setRotation(l)};let Ea=Iee;var Eg,V_,pj,rwe,mj,swe;class HZ extends Ea{constructor(i,s=null){super(i,{isRenderable:!0,ignoreBorder:!!(s!=null&&s.ignoreBorder),createQuadrilaterals:!0});J(this,Eg);J(this,pj);J(this,mj);this.isTooltipOnly=i.data.isTooltipOnly}render(){const{data:i,linkService:s}=this,l=document.createElement("a");l.setAttribute("data-element-id",i.id);let d=!1;return i.url?(s.addLinkAttributes(l,i.url,i.newWindow),d=!0):i.action?(this._bindNamedAction(l,i.action,i.overlaidText),d=!0):i.attachment?(fe(this,pj,rwe).call(this,l,i.attachment,i.overlaidText,i.attachmentDest),d=!0):i.setOCGState?(fe(this,mj,swe).call(this,l,i.setOCGState,i.overlaidText),d=!0):i.dest?(this._bindLink(l,i.dest,i.overlaidText),d=!0):(i.actions&&(i.actions.Action||i.actions["Mouse Up"]||i.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(l,i),d=!0),i.resetForm?(this._bindResetFormAction(l,i.resetForm),d=!0):this.isTooltipOnly&&!d&&(this._bindLink(l,""),d=!0)),this.container.classList.add("linkAnnotation"),d&&this.container.append(l),this.container}_bindLink(i,s,l=""){i.href=this.linkService.getDestinationHash(s),i.onclick=()=>(s&&this.linkService.goToDestination(s),!1),(s||s==="")&&fe(this,Eg,V_).call(this),l&&(i.title=l)}_bindNamedAction(i,s,l=""){i.href=this.linkService.getAnchorUrl(""),i.onclick=()=>(this.linkService.executeNamedAction(s),!1),l&&(i.title=l),fe(this,Eg,V_).call(this)}_bindJSAction(i,s){i.href=this.linkService.getAnchorUrl("");const l=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const d of Object.keys(s.actions)){const u=l.get(d);u&&(i[u]=()=>{var p;return(p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s.id,name:d}}),!1})}s.overlaidText&&(i.title=s.overlaidText),i.onclick||(i.onclick=()=>!1),fe(this,Eg,V_).call(this)}_bindResetFormAction(i,s){const l=i.onclick;if(l||(i.href=this.linkService.getAnchorUrl("")),fe(this,Eg,V_).call(this),!this._fieldObjects){Ei('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),l||(i.onclick=()=>!1);return}i.onclick=()=>{var E;l==null||l();const{fields:d,refs:u,include:p}=s,m=[];if(d.length!==0||u.length!==0){const C=new Set(u);for(const x of d){const N=this._fieldObjects[x]||[];for(const{id:O}of N)C.add(O)}for(const x of Object.values(this._fieldObjects))for(const N of x)C.has(N.id)===p&&m.push(N)}else for(const C of Object.values(this._fieldObjects))m.push(...C);const y=this.annotationStorage,_=[];for(const C of m){const{id:x}=C;switch(_.push(x),C.type){case"text":{const O=C.defaultValue||"";y.setValue(x,{value:O});break}case"checkbox":case"radiobutton":{const O=C.defaultValue===C.exportValues;y.setValue(x,{value:O});break}case"combobox":case"listbox":{const O=C.defaultValue||"";y.setValue(x,{value:O});break}default:continue}const N=document.querySelector(`[data-element-id="${x}"]`);if(N){if(!Q2.has(N)){Ei(`_bindResetFormAction - element not allowed: ${x}`);continue}}else continue;N.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((E=this.linkService.eventBus)==null||E.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:_,name:"ResetForm"}})),!1}}}Eg=new WeakSet,V_=function(){this.container.setAttribute("data-internal-link","")},pj=new WeakSet,rwe=function(i,s,l="",d=null){i.href=this.linkService.getAnchorUrl(""),s.description?i.title=s.description:l&&(i.title=l),i.onclick=()=>{var u;return(u=this.downloadManager)==null||u.openOrDownloadData(s.content,s.filename,d),!1},fe(this,Eg,V_).call(this)},mj=new WeakSet,swe=function(i,s,l=""){i.href=this.linkService.getAnchorUrl(""),i.onclick=()=>(this.linkService.executeSetOCGState(s),!1),l&&(i.title=l),fe(this,Eg,V_).call(this)};class ret extends Ea{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class yw extends Ea{render(){return this.container}showElementAndHideCanvas(t){var i;this.data.hasOwnCanvas&&(((i=t.previousSibling)==null?void 0:i.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Zo.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,i,s,l,d){s.includes("mouse")?t.addEventListener(s,u=>{var p;(p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:l,value:d(u),shift:u.shiftKey,modifier:this._getKeyModifier(u)}})}):t.addEventListener(s,u=>{var p;if(s==="blur"){if(!i.focused||!u.relatedTarget)return;i.focused=!1}else if(s==="focus"){if(i.focused)return;i.focused=!0}d&&((p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:l,value:d(u)}}))})}_setEventListeners(t,i,s,l){var d,u,p;for(const[m,y]of s)(y==="Action"||(d=this.data.actions)!=null&&d[y])&&((y==="Focus"||y==="Blur")&&(i||(i={focused:!1})),this._setEventListener(t,i,m,y,l),y==="Focus"&&!((u=this.data.actions)!=null&&u.Blur)?this._setEventListener(t,i,"blur","Blur",null):y==="Blur"&&!((p=this.data.actions)!=null&&p.Focus)&&this._setEventListener(t,i,"focus","Focus",null))}_setBackgroundColor(t){const i=this.data.backgroundColor||null;t.style.backgroundColor=i===null?"transparent":In.makeHexColor(i[0],i[1],i[2])}_setTextStyle(t){const i=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,l=this.data.defaultAppearanceData.fontSize||net,d=t.style;let u;const p=2,m=y=>Math.round(10*y)/10;if(this.data.multiLine){const y=Math.abs(this.data.rect[3]-this.data.rect[1]-p),_=Math.round(y/(PK*l))||1,E=y/_;u=Math.min(l,m(E/PK))}else{const y=Math.abs(this.data.rect[3]-this.data.rect[1]-p);u=Math.min(l,m(y/PK))}d.fontSize=`calc(${u}px * var(--total-scale-factor))`,d.color=In.makeHexColor(s[0],s[1],s[2]),this.data.textAlignment!==null&&(d.textAlign=i[this.data.textAlignment])}_setRequired(t,i){i?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",i)}}class set extends yw{constructor(t){const i=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:i})}setPropertyOnSiblings(t,i,s,l){const d=this.annotationStorage;for(const u of this._getElementsByName(t.name,t.id))u.domElement&&(u.domElement[i]=s),d.setValue(u.id,{[l]:s})}render(){var l,d;const t=this.annotationStorage,i=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const u=t.getValue(i,{value:this.data.fieldValue});let p=u.value||"";const m=t.getValue(i,{charLimit:this.data.maxLen}).charLimit;m&&p.length>m&&(p=p.slice(0,m));let y=u.formattedValue||((l=this.data.textContent)==null?void 0:l.join(`
`))||null;y&&this.data.comb&&(y=y.replaceAll(/\s+/g,""));const _={userValue:p,formattedValue:y,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=y??p,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",y??p),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),Q2.add(s),s.setAttribute("data-element-id",i),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:E,datetimeType:C,timeStep:x}=this.data,N=!!C&&this.enableScripting;E&&(s.title=E),this._setRequired(s,this.data.required),m&&(s.maxLength=m),s.addEventListener("input",D=>{t.setValue(i,{value:D.target.value}),this.setPropertyOnSiblings(s,"value",D.target.value,"value"),_.formattedValue=null}),s.addEventListener("resetform",D=>{const P=this.data.defaultFieldValue??"";s.value=_.userValue=P,_.formattedValue=null});let O=D=>{const{formattedValue:P}=_;P!=null&&(D.target.value=P),D.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",P=>{var M;if(_.focused)return;const{target:j}=P;if(N&&(j.type=C,x&&(j.step=x)),_.userValue){const V=_.userValue;if(N)if(C==="time"){const G=new Date(V),$=[G.getHours(),G.getMinutes(),G.getSeconds()];j.value=$.map(ne=>ne.toString().padStart(2,"0")).join(":")}else j.value=new Date(V-iet).toISOString().split(C==="date"?"T":".",1)[0];else j.value=V}_.lastCommittedValue=j.value,_.commitKey=1,(M=this.data.actions)!=null&&M.Focus||(_.focused=!0)}),s.addEventListener("updatefromsandbox",P=>{this.showElementAndHideCanvas(P.target);const j={value(M){_.userValue=M.detail.value??"",N||t.setValue(i,{value:_.userValue.toString()}),M.target.value=_.userValue},formattedValue(M){const{formattedValue:V}=M.detail;_.formattedValue=V,V!=null&&M.target!==document.activeElement&&(M.target.value=V);const G={formattedValue:V};N&&(G.value=V),t.setValue(i,G)},selRange(M){M.target.setSelectionRange(...M.detail.selRange)},charLimit:M=>{var ne;const{charLimit:V}=M.detail,{target:G}=M;if(V===0){G.removeAttribute("maxLength");return}G.setAttribute("maxLength",V);let $=_.userValue;!$||$.length<=V||($=$.slice(0,V),G.value=_.userValue=$,t.setValue(i,{value:$}),(ne=this.linkService.eventBus)==null||ne.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:$,willCommit:!0,commitKey:1,selStart:G.selectionStart,selEnd:G.selectionEnd}}))}};this._dispatchEventFromSandbox(j,P)}),s.addEventListener("keydown",P=>{var V;_.commitKey=1;let j=-1;if(P.key==="Escape"?j=0:P.key==="Enter"&&!this.data.multiLine?j=2:P.key==="Tab"&&(_.commitKey=3),j===-1)return;const{value:M}=P.target;_.lastCommittedValue!==M&&(_.lastCommittedValue=M,_.userValue=M,(V=this.linkService.eventBus)==null||V.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:M,willCommit:!0,commitKey:j,selStart:P.target.selectionStart,selEnd:P.target.selectionEnd}}))});const D=O;O=null,s.addEventListener("blur",P=>{var V,G;if(!_.focused||!P.relatedTarget)return;(V=this.data.actions)!=null&&V.Blur||(_.focused=!1);const{target:j}=P;let{value:M}=j;if(N){if(M&&C==="time"){const $=M.split(":").map(ne=>parseInt(ne,10));M=new Date(2e3,0,1,$[0],$[1],$[2]||0).valueOf(),j.step=""}else M=new Date(M).valueOf();j.type="text"}_.userValue=M,_.lastCommittedValue!==M&&((G=this.linkService.eventBus)==null||G.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:M,willCommit:!0,commitKey:_.commitKey,selStart:P.target.selectionStart,selEnd:P.target.selectionEnd}})),D(P)}),(d=this.data.actions)!=null&&d.Keystroke&&s.addEventListener("beforeinput",P=>{var le;_.lastCommittedValue=null;const{data:j,target:M}=P,{value:V,selectionStart:G,selectionEnd:$}=M;let ne=G,Y=$;switch(P.inputType){case"deleteWordBackward":{const re=V.substring(0,G).match(/\w*[^\w]*$/);re&&(ne-=re[0].length);break}case"deleteWordForward":{const re=V.substring(G).match(/^[^\w]*\w*/);re&&(Y+=re[0].length);break}case"deleteContentBackward":G===$&&(ne-=1);break;case"deleteContentForward":G===$&&(Y+=1);break}P.preventDefault(),(le=this.linkService.eventBus)==null||le.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:V,change:j||"",willCommit:!1,selStart:ne,selEnd:Y}})}),this._setEventListeners(s,_,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],P=>P.target.value)}if(O&&s.addEventListener("blur",O),this.data.comb){const P=(this.data.rect[2]-this.data.rect[0])/m;s.classList.add("comb"),s.style.letterSpacing=`calc(${P}px * var(--total-scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class aet extends yw{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class oet extends yw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,i=this.data,s=i.id;let l=t.getValue(s,{value:i.exportValue===i.fieldValue}).value;typeof l=="string"&&(l=l!=="Off",t.setValue(s,{value:l})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const d=document.createElement("input");return Q2.add(d),d.setAttribute("data-element-id",s),d.disabled=i.readOnly,this._setRequired(d,this.data.required),d.type="checkbox",d.name=i.fieldName,l&&d.setAttribute("checked",!0),d.setAttribute("exportValue",i.exportValue),d.tabIndex=0,d.addEventListener("change",u=>{const{name:p,checked:m}=u.target;for(const y of this._getElementsByName(p,s)){const _=m&&y.exportValue===i.exportValue;y.domElement&&(y.domElement.checked=_),t.setValue(y.id,{value:_})}t.setValue(s,{value:m})}),d.addEventListener("resetform",u=>{const p=i.defaultFieldValue||"Off";u.target.checked=p===i.exportValue}),this.enableScripting&&this.hasJSActions&&(d.addEventListener("updatefromsandbox",u=>{const p={value(m){m.target.checked=m.detail.value!=="Off",t.setValue(s,{value:m.target.checked})}};this._dispatchEventFromSandbox(p,u)}),this._setEventListeners(d,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],u=>u.target.checked)),this._setBackgroundColor(d),this._setDefaultPropertiesFromJS(d),this.container.append(d),this.container}}class awe extends yw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,i=this.data,s=i.id;let l=t.getValue(s,{value:i.fieldValue===i.buttonValue}).value;if(typeof l=="string"&&(l=l!==i.buttonValue,t.setValue(s,{value:l})),l)for(const u of this._getElementsByName(i.fieldName,s))t.setValue(u.id,{value:!1});const d=document.createElement("input");if(Q2.add(d),d.setAttribute("data-element-id",s),d.disabled=i.readOnly,this._setRequired(d,this.data.required),d.type="radio",d.name=i.fieldName,l&&d.setAttribute("checked",!0),d.tabIndex=0,d.addEventListener("change",u=>{const{name:p,checked:m}=u.target;for(const y of this._getElementsByName(p,s))t.setValue(y.id,{value:!1});t.setValue(s,{value:m})}),d.addEventListener("resetform",u=>{const p=i.defaultFieldValue;u.target.checked=p!=null&&p===i.buttonValue}),this.enableScripting&&this.hasJSActions){const u=i.buttonValue;d.addEventListener("updatefromsandbox",p=>{const m={value:y=>{const _=u===y.detail.value;for(const E of this._getElementsByName(y.target.name)){const C=_&&E.id===s;E.domElement&&(E.domElement.checked=C),t.setValue(E.id,{value:C})}}};this._dispatchEventFromSandbox(m,p)}),this._setEventListeners(d,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],p=>p.target.checked)}return this._setBackgroundColor(d),this._setDefaultPropertiesFromJS(d),this.container.append(d),this.container}}class cet extends HZ{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const i=t.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",s=>{this._dispatchEventFromSandbox({},s)})),t}}class det extends yw{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,i=this.data.id,s=t.getValue(i,{value:this.data.fieldValue}),l=document.createElement("select");Q2.add(l),l.setAttribute("data-element-id",i),l.disabled=this.data.readOnly,this._setRequired(l,this.data.required),l.name=this.data.fieldName,l.tabIndex=0;let d=this.data.combo&&this.data.options.length>0;this.data.combo||(l.size=this.data.options.length,this.data.multiSelect&&(l.multiple=!0)),l.addEventListener("resetform",_=>{const E=this.data.defaultFieldValue;for(const C of l.options)C.selected=C.value===E});for(const _ of this.data.options){const E=document.createElement("option");E.textContent=_.displayValue,E.value=_.exportValue,s.value.includes(_.exportValue)&&(E.setAttribute("selected",!0),d=!1),l.append(E)}let u=null;if(d){const _=document.createElement("option");_.value=" ",_.setAttribute("hidden",!0),_.setAttribute("selected",!0),l.prepend(_),u=()=>{_.remove(),l.removeEventListener("input",u),u=null},l.addEventListener("input",u)}const p=_=>{const E=_?"value":"textContent",{options:C,multiple:x}=l;return x?Array.prototype.filter.call(C,N=>N.selected).map(N=>N[E]):C.selectedIndex===-1?null:C[C.selectedIndex][E]};let m=p(!1);const y=_=>{const E=_.target.options;return Array.prototype.map.call(E,C=>({displayValue:C.textContent,exportValue:C.value}))};return this.enableScripting&&this.hasJSActions?(l.addEventListener("updatefromsandbox",_=>{const E={value(C){u==null||u();const x=C.detail.value,N=new Set(Array.isArray(x)?x:[x]);for(const O of l.options)O.selected=N.has(O.value);t.setValue(i,{value:p(!0)}),m=p(!1)},multipleSelection(C){l.multiple=!0},remove(C){const x=l.options,N=C.detail.remove;x[N].selected=!1,l.remove(N),x.length>0&&Array.prototype.findIndex.call(x,D=>D.selected)===-1&&(x[0].selected=!0),t.setValue(i,{value:p(!0),items:y(C)}),m=p(!1)},clear(C){for(;l.length!==0;)l.remove(0);t.setValue(i,{value:null,items:[]}),m=p(!1)},insert(C){const{index:x,displayValue:N,exportValue:O}=C.detail.insert,D=l.children[x],P=document.createElement("option");P.textContent=N,P.value=O,D?D.before(P):l.append(P),t.setValue(i,{value:p(!0),items:y(C)}),m=p(!1)},items(C){const{items:x}=C.detail;for(;l.length!==0;)l.remove(0);for(const N of x){const{displayValue:O,exportValue:D}=N,P=document.createElement("option");P.textContent=O,P.value=D,l.append(P)}l.options.length>0&&(l.options[0].selected=!0),t.setValue(i,{value:p(!0),items:y(C)}),m=p(!1)},indices(C){const x=new Set(C.detail.indices);for(const N of C.target.options)N.selected=x.has(N.index);t.setValue(i,{value:p(!0)}),m=p(!1)},editable(C){C.target.disabled=!C.detail.editable}};this._dispatchEventFromSandbox(E,_)}),l.addEventListener("input",_=>{var x;const E=p(!0),C=p(!1);t.setValue(i,{value:E}),_.preventDefault(),(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:m,change:C,changeEx:E,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(l,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],_=>_.target.value)):l.addEventListener("input",function(_){t.setValue(i,{value:p(!0)})}),this.data.combo&&this._setTextStyle(l),this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class DX extends Ea{constructor(t){const{data:i,elements:s}=t;super(t,{isRenderable:Ea._hasPopupData(i)}),this.elements=s,this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const i=this.popup=new uet({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,eventBus:this.linkService.eventBus}),s=[];for(const l of this.elements)l.popup=i,l.container.ariaHasPopup="dialog",s.push(l.data.id),l.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(l=>`${jZ}${l}`).join(",")),this.container}}var ZE,gj,vj,e2,oR,ia,wg,uv,Sg,hO,fO,lR,Op,kd,bg,Cg,pO,hv,cR,mO,Tg,dR,t2,fv,uR,GM,yj,owe,_j,lwe,hR,WM,gO,kX,Ej,cwe,wj,dwe,Sj,uwe,bj,hwe,fR,$M,pR,KM,vO,MX;class uet{constructor({container:t,color:i,elements:s,titleObj:l,modificationDate:d,contentsObj:u,richText:p,parent:m,rect:y,parentRect:_,open:E,eventBus:C=null}){J(this,uR);J(this,yj);J(this,_j);J(this,hR);J(this,gO);J(this,Ej);J(this,wj);J(this,Sj);J(this,bj);J(this,fR);J(this,pR);J(this,vO);J(this,ZE,fe(this,Sj,uwe).bind(this));J(this,gj,fe(this,vO,MX).bind(this));J(this,vj,fe(this,pR,KM).bind(this));J(this,e2,fe(this,fR,$M).bind(this));J(this,oR,null);J(this,ia,null);J(this,wg,null);J(this,uv,null);J(this,Sg,null);J(this,hO,null);J(this,fO,null);J(this,lR,null);J(this,Op,!1);J(this,kd,null);J(this,bg,null);J(this,Cg,null);J(this,pO,null);J(this,hv,null);J(this,cR,null);J(this,mO,null);J(this,Tg,null);J(this,dR,null);J(this,t2,null);J(this,fv,!1);te(this,ia,t),te(this,dR,l),te(this,wg,u),te(this,Tg,p),te(this,fO,m),te(this,oR,i),te(this,mO,y),te(this,lR,_),te(this,Sg,s),te(this,hO,C),te(this,uv,i9.toDateObject(d)),this.trigger=s.flatMap(x=>x.getElementsToTriggerPopup()),fe(this,uR,GM).call(this),b(this,ia).hidden=!0,E&&fe(this,fR,$M).call(this)}render(){var l;if(b(this,kd))return;const t=te(this,kd,document.createElement("div"));if(t.className="popup",b(this,oR)){const d=t.style.outlineColor=In.makeHexColor(...b(this,oR));t.style.backgroundColor=`color-mix(in srgb, ${d} 30%, white)`}const i=document.createElement("span");if(i.className="header",(l=b(this,dR))!=null&&l.str){const d=document.createElement("span");d.className="title",i.append(d),{dir:d.dir,str:d.textContent}=b(this,dR)}if(t.append(i),b(this,uv)){const d=document.createElement("time");d.className="popupDate",d.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),d.setAttribute("data-l10n-args",JSON.stringify({dateObj:b(this,uv).valueOf()})),d.dateTime=b(this,uv).toISOString(),i.append(d)}const s=b(this,hR,WM);if(s)nwe.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const d=this._formatContents(b(this,wg));t.append(d)}b(this,ia).append(t)}_formatContents({str:t,dir:i}){const s=document.createElement("p");s.classList.add("popupContent"),s.dir=i;const l=t.split(/(?:\r\n?|\n)/);for(let d=0,u=l.length;d<u;++d){const p=l[d];s.append(document.createTextNode(p)),d<u-1&&s.append(document.createElement("br"))}return s}updateEdited({rect:t,popup:i,deleted:s}){var l;if(s||i!=null&&i.deleted){this.remove();return}fe(this,uR,GM).call(this),b(this,t2)||te(this,t2,{contentsObj:b(this,wg),richText:b(this,Tg)}),t&&te(this,Cg,null),i&&(te(this,Tg,fe(this,wj,dwe).call(this,i.text)),te(this,uv,i9.toDateObject(i.date)),te(this,wg,null)),(l=b(this,kd))==null||l.remove(),te(this,kd,null)}resetEdited(){var t;b(this,t2)&&({contentsObj:ea(this,wg)._,richText:ea(this,Tg)._}=b(this,t2),te(this,t2,null),(t=b(this,kd))==null||t.remove(),te(this,kd,null),te(this,Cg,null))}remove(){var t,i;(t=b(this,bg))==null||t.abort(),te(this,bg,null),(i=b(this,kd))==null||i.remove(),te(this,kd,null),te(this,fv,!1),te(this,Op,!1);for(const s of this.trigger)s.classList.remove("popupTriggerArea")}forceHide(){te(this,fv,this.isVisible),b(this,fv)&&(b(this,ia).hidden=!0)}maybeShow(){fe(this,uR,GM).call(this),b(this,fv)&&(b(this,kd)||fe(this,pR,KM).call(this),te(this,fv,!1),b(this,ia).hidden=!1)}get isVisible(){return b(this,ia).hidden===!1}}ZE=new WeakMap,gj=new WeakMap,vj=new WeakMap,e2=new WeakMap,oR=new WeakMap,ia=new WeakMap,wg=new WeakMap,uv=new WeakMap,Sg=new WeakMap,hO=new WeakMap,fO=new WeakMap,lR=new WeakMap,Op=new WeakMap,kd=new WeakMap,bg=new WeakMap,Cg=new WeakMap,pO=new WeakMap,hv=new WeakMap,cR=new WeakMap,mO=new WeakMap,Tg=new WeakMap,dR=new WeakMap,t2=new WeakMap,fv=new WeakMap,uR=new WeakSet,GM=function(){var i;if(b(this,bg))return;te(this,bg,new AbortController);const{signal:t}=b(this,bg);for(const s of this.trigger)s.addEventListener("click",b(this,e2),{signal:t}),s.addEventListener("mouseenter",b(this,vj),{signal:t}),s.addEventListener("mouseleave",b(this,gj),{signal:t}),s.classList.add("popupTriggerArea");for(const s of b(this,Sg))(i=s.container)==null||i.addEventListener("keydown",b(this,ZE),{signal:t});fe(this,_j,lwe).call(this)},yj=new WeakSet,owe=function(){const t=b(this,Sg).find(i=>i.hasCommentButton);t&&(te(this,hv,t._normalizePoint(t.commentButtonPosition)),te(this,cR,t.commentButtonColor))},_j=new WeakSet,lwe=function(){if(b(this,pO)||(b(this,hv)||fe(this,yj,owe).call(this),!b(this,hv)))return;const t=te(this,pO,document.createElement("button"));t.className="annotationCommentButton";const i=b(this,Sg)[0].container;t.style.zIndex=i.style.zIndex+1,t.tabIndex=0;const{signal:s}=b(this,bg);t.addEventListener("hover",b(this,e2),{signal:s}),t.addEventListener("keydown",b(this,ZE),{signal:s}),t.addEventListener("click",()=>{var p;const[{data:{id:d},annotationEditorType:u}]=b(this,Sg);(p=b(this,hO))==null||p.dispatch("switchannotationeditormode",{source:this,editId:d,mode:u,editComment:!0})},{signal:s});const{style:l}=t;l.left=`calc(${b(this,hv)[0]}%)`,l.top=`calc(${b(this,hv)[1]}% - var(--comment-button-dim))`,b(this,cR)&&(l.backgroundColor=b(this,cR)),i.after(t)},hR=new WeakSet,WM=function(){const t=b(this,Tg),i=b(this,wg);return t!=null&&t.str&&(!(i!=null&&i.str)||i.str===t.str)&&b(this,Tg).html||null},gO=new WeakSet,kX=function(){var t,i,s;return((s=(i=(t=b(this,hR,WM))==null?void 0:t.attributes)==null?void 0:i.style)==null?void 0:s.fontSize)||0},Ej=new WeakSet,cwe=function(){var t,i,s;return((s=(i=(t=b(this,hR,WM))==null?void 0:t.attributes)==null?void 0:i.style)==null?void 0:s.color)||null},wj=new WeakSet,dwe=function(t){const i=[],s={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:i}]}},l={style:{color:b(this,Ej,cwe),fontSize:b(this,gO,kX)?`calc(${b(this,gO,kX)}px * var(--total-scale-factor))`:""}};for(const d of t.split(`
`))i.push({name:"span",value:d,attributes:l});return s},Sj=new WeakSet,uwe=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&b(this,Op))&&fe(this,fR,$M).call(this)},bj=new WeakSet,hwe=function(){if(b(this,Cg)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:s,pageX:l,pageY:d}}}=b(this,fO);let u=!!b(this,lR),p=u?b(this,lR):b(this,mO);for(const N of b(this,Sg))if(!p||In.intersect(N.data.rect,p)!==null){p=N.data.rect,u=!0;break}const m=In.normalizeRect([p[0],t[3]-p[1]+t[1],p[2],t[3]-p[3]+t[1]]),_=u?p[2]-p[0]+5:0,E=m[0]+_,C=m[1];te(this,Cg,[100*(E-l)/i,100*(C-d)/s]);const{style:x}=b(this,ia);x.left=`${b(this,Cg)[0]}%`,x.top=`${b(this,Cg)[1]}%`},fR=new WeakSet,$M=function(){te(this,Op,!b(this,Op)),b(this,Op)?(fe(this,pR,KM).call(this),b(this,ia).addEventListener("click",b(this,e2)),b(this,ia).addEventListener("keydown",b(this,ZE))):(fe(this,vO,MX).call(this),b(this,ia).removeEventListener("click",b(this,e2)),b(this,ia).removeEventListener("keydown",b(this,ZE)))},pR=new WeakSet,KM=function(){b(this,kd)||this.render(),this.isVisible?b(this,Op)&&b(this,ia).classList.add("focused"):(fe(this,bj,hwe).call(this),b(this,ia).hidden=!1,b(this,ia).style.zIndex=parseInt(b(this,ia).style.zIndex)+1e3)},vO=new WeakSet,MX=function(){b(this,ia).classList.remove("focused"),!(b(this,Op)||!this.isVisible)&&(b(this,ia).hidden=!0,b(this,ia).style.zIndex=parseInt(b(this,ia).style.zIndex)-1e3)};class fwe extends Ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=fi.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const i of this.textContent){const s=document.createElement("span");s.textContent=i,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var yO;class het extends Ea{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});J(this,yO,null)}render(){this.container.classList.add("lineAnnotation");const{data:i,width:s,height:l}=this,d=this.svgFactory.create(s,l,!0),u=te(this,yO,this.svgFactory.createElement("svg:line"));return u.setAttribute("x1",i.rect[2]-i.lineCoordinates[0]),u.setAttribute("y1",i.rect[3]-i.lineCoordinates[1]),u.setAttribute("x2",i.rect[2]-i.lineCoordinates[2]),u.setAttribute("y2",i.rect[3]-i.lineCoordinates[3]),u.setAttribute("stroke-width",i.borderStyle.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),d.append(u),this.container.append(d),!i.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return b(this,yO)}addHighlightArea(){this.container.classList.add("highlightArea")}}yO=new WeakMap;var _O;class fet extends Ea{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});J(this,_O,null)}render(){this.container.classList.add("squareAnnotation");const{data:i,width:s,height:l}=this,d=this.svgFactory.create(s,l,!0),u=i.borderStyle.width,p=te(this,_O,this.svgFactory.createElement("svg:rect"));return p.setAttribute("x",u/2),p.setAttribute("y",u/2),p.setAttribute("width",s-u),p.setAttribute("height",l-u),p.setAttribute("stroke-width",u||1),p.setAttribute("stroke","transparent"),p.setAttribute("fill","transparent"),d.append(p),this.container.append(d),!i.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return b(this,_O)}addHighlightArea(){this.container.classList.add("highlightArea")}}_O=new WeakMap;var EO;class pet extends Ea{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});J(this,EO,null)}render(){this.container.classList.add("circleAnnotation");const{data:i,width:s,height:l}=this,d=this.svgFactory.create(s,l,!0),u=i.borderStyle.width,p=te(this,EO,this.svgFactory.createElement("svg:ellipse"));return p.setAttribute("cx",s/2),p.setAttribute("cy",l/2),p.setAttribute("rx",s/2-u/2),p.setAttribute("ry",l/2-u/2),p.setAttribute("stroke-width",u||1),p.setAttribute("stroke","transparent"),p.setAttribute("fill","transparent"),d.append(p),this.container.append(d),!i.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return b(this,EO)}addHighlightArea(){this.container.classList.add("highlightArea")}}EO=new WeakMap;var wO;class pwe extends Ea{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});J(this,wO,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:i,vertices:s,borderStyle:l,popupRef:d},width:u,height:p}=this;if(!s)return this.container;const m=this.svgFactory.create(u,p,!0);let y=[];for(let E=0,C=s.length;E<C;E+=2){const x=s[E]-i[0],N=i[3]-s[E+1];y.push(`${x},${N}`)}y=y.join(" ");const _=te(this,wO,this.svgFactory.createElement(this.svgElementName));return _.setAttribute("points",y),_.setAttribute("stroke-width",l.width||1),_.setAttribute("stroke","transparent"),_.setAttribute("fill","transparent"),m.append(_),this.container.append(m),!d&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return b(this,wO)}addHighlightArea(){this.container.classList.add("highlightArea")}}wO=new WeakMap;class met extends pwe{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class get extends Ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var SO,n2,bO,jX;class GZ extends Ea{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});J(this,bO);J(this,SO,null);J(this,n2,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?fi.HIGHLIGHT:fi.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:i,rotation:s,inkLists:l,borderStyle:d,popupRef:u}}=this,{transform:p,width:m,height:y}=fe(this,bO,jX).call(this,s,i),_=this.svgFactory.create(m,y,!0),E=te(this,SO,this.svgFactory.createElement("svg:g"));_.append(E),E.setAttribute("stroke-width",d.width||1),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),E.setAttribute("stroke-miterlimit",10),E.setAttribute("stroke","transparent"),E.setAttribute("fill","transparent"),E.setAttribute("transform",p);for(let C=0,x=l.length;C<x;C++){const N=this.svgFactory.createElement(this.svgElementName);b(this,n2).push(N),N.setAttribute("points",l[C].join(",")),E.append(N)}return!u&&this.hasPopupData&&this._createPopup(),this.container.append(_),this._editOnDoubleClick(),this.container}updateEdited(i){super.updateEdited(i);const{thickness:s,points:l,rect:d}=i,u=b(this,SO);if(s>=0&&u.setAttribute("stroke-width",s||1),l)for(let p=0,m=b(this,n2).length;p<m;p++)b(this,n2)[p].setAttribute("points",l[p].join(","));if(d){const{transform:p,width:m,height:y}=fe(this,bO,jX).call(this,this.data.rotation,d);u.parentElement.setAttribute("viewBox",`0 0 ${m} ${y}`),u.setAttribute("transform",p)}}getElementsToTriggerPopup(){return b(this,n2)}addHighlightArea(){this.container.classList.add("highlightArea")}get commentButtonPosition(){const{inkLists:i,rect:s}=this.data;if((i==null?void 0:i.length)>=1){let l=-1/0,d=-1/0;for(const u of i)for(let p=0,m=u.length;p<m;p+=2)u[p+1]>d?(d=u[p+1],l=u[p]):u[p+1]===d&&(l=Math.max(l,u[p]));if(l!==1/0)return[l,d]}return s?[s[2],s[3]]:null}}SO=new WeakMap,n2=new WeakMap,bO=new WeakSet,jX=function(i,s){switch(i){case 90:return{transform:`rotate(90) translate(${-s[0]},${s[1]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};case 180:return{transform:`rotate(180) translate(${-s[2]},${s[1]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]};case 270:return{transform:`rotate(270) translate(${-s[2]},${s[3]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};default:return{transform:`translate(${-s[0]},${s[3]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]}}};class mwe extends Ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=fi.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const s=document.createElement("mark");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class vet extends Ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class yet extends Ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class _et extends Ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const s=document.createElement("s");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class gwe extends Ea{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=fi.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var CO,TO,UX;class Eet extends Ea{constructor(i){var l;super(i,{isRenderable:!0});J(this,TO);J(this,CO,null);const{file:s}=this.data;this.filename=s.filename,this.content=s.content,(l=this.linkService.eventBus)==null||l.dispatch("fileattachmentannotation",{source:this,...s})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:i,data:s}=this;let l;s.hasAppearance||s.fillAlpha===0?l=document.createElement("div"):(l=document.createElement("img"),l.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(s.name)?"paperclip":"pushpin"}.svg`,s.fillAlpha&&s.fillAlpha<1&&(l.style=`filter: opacity(${Math.round(s.fillAlpha*100)}%);`)),l.addEventListener("dblclick",fe(this,TO,UX).bind(this)),te(this,CO,l);const{isMac:d}=Zo.platform;return i.addEventListener("keydown",u=>{u.key==="Enter"&&(d?u.metaKey:u.ctrlKey)&&fe(this,TO,UX).call(this)}),!s.popupRef&&this.hasPopupData?this._createPopup():l.classList.add("popupTriggerArea"),i.append(l),i}getElementsToTriggerPopup(){return b(this,CO)}addHighlightArea(){this.container.classList.add("highlightArea")}}CO=new WeakMap,TO=new WeakSet,UX=function(){var i;(i=this.downloadManager)==null||i.openOrDownloadData(this.content,this.filename)};var RO,i2,pv,xO,AO,BX,IO,VX;const Nee=class Nee{constructor({div:t,accessibilityManager:i,annotationCanvasMap:s,annotationEditorUIManager:l,page:d,viewport:u,structTreeLayer:p}){J(this,AO);J(this,IO);J(this,RO,null);J(this,i2,null);J(this,pv,new Map);J(this,xO,null);this.div=t,te(this,RO,i),te(this,i2,s),te(this,xO,p||null),this.page=d,this.viewport=u,this.zIndex=0,this._annotationEditorUIManager=l}hasEditableAnnotations(){return b(this,pv).size>0}async render(t){var u;const{annotations:i}=t,s=this.div;X2(s,this.viewport);const l=new Map,d={data:null,layer:s,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new c9,annotationStorage:t.annotationStorage||new BZ,enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const p of i){if(p.noHTML)continue;const m=p.annotationType===Na.POPUP;if(m){const E=l.get(p.id);if(!E)continue;d.elements=E}else if(p.rect[2]===p.rect[0]||p.rect[3]===p.rect[1])continue;d.data=p;const y=hpe.create(d);if(!y.isRenderable)continue;if(!m&&p.popupRef){const E=l.get(p.popupRef);E?E.push(y):l.set(p.popupRef,[y])}const _=y.render();p.hidden&&(_.style.visibility="hidden"),await fe(this,AO,BX).call(this,_,p.id,d.elements),y._isEditable&&(b(this,pv).set(y.data.id,y),(u=this._annotationEditorUIManager)==null||u.renderAnnotationElement(y))}fe(this,IO,VX).call(this)}async addLinkAnnotations(t,i){const s={data:null,layer:this.div,linkService:i,svgFactory:new c9,parent:this};for(const l of t){l.borderStyle||(l.borderStyle=Nee._defaultBorderStyle),s.data=l;const d=hpe.create(s);if(!d.isRenderable)continue;const u=d.render();await fe(this,AO,BX).call(this,u,l.id,null)}}update({viewport:t}){const i=this.div;this.viewport=t,X2(i,{rotation:t.rotation}),fe(this,IO,VX).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from(b(this,pv).values())}getEditableAnnotation(t){return b(this,pv).get(t)}static get _defaultBorderStyle(){return Ki(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:dC.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};RO=new WeakMap,i2=new WeakMap,pv=new WeakMap,xO=new WeakMap,AO=new WeakSet,BX=async function(t,i,s){var p,m;const l=t.firstChild||t,d=l.id=`${jZ}${i}`,u=await((p=b(this,xO))==null?void 0:p.getAriaAttributes(d));if(u)for(const[y,_]of u)l.setAttribute(y,_);s?s.at(-1).container.after(t):(this.div.append(t),(m=b(this,RO))==null||m.moveElementInDOM(this.div,t,l,!1))},IO=new WeakSet,VX=function(){var i;if(!b(this,i2))return;const t=this.div;for(const[s,l]of b(this,i2)){const d=t.querySelector(`[data-annotation-id="${s}"]`);if(!d)continue;l.className="annotationContent";const{firstChild:u}=d;u?u.nodeName==="CANVAS"?u.replaceWith(l):u.classList.contains("annotationContent")?u.after(l):u.before(l):d.append(l);const p=b(this,pv).get(s);p&&(p._hasNoCanvas?((i=this._annotationEditorUIManager)==null||i.setMissingCanvas(s,d.id,l),p._hasNoCanvas=!1):p.canvas=l)}b(this,i2).clear()};let FX=Nee;const sM=/\r\n?|\n/g;var Zu,Md,NO,r2,jd,Cj,vwe,Tj,ywe,Rj,_we,mR,qM,gR,YM,vR,XM,xj,Ewe,OO,HX,Aj,wwe;const ds=class ds extends fs{constructor(i){super({...i,name:"freeTextEditor"});J(this,Cj);J(this,Tj);J(this,Rj);J(this,mR);J(this,vR);J(this,xj);J(this,Aj);J(this,Zu,void 0);J(this,Md,"");J(this,NO,`${this.id}-editor`);J(this,r2,null);J(this,jd,void 0);sn(this,"_colorPicker",null);te(this,Zu,i.color||ds._defaultColor||fs._defaultLineColor),te(this,jd,i.fontSize||ds._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const i=ds.prototype,s=u=>u.isEmpty(),l=J2.TRANSLATE_SMALL,d=J2.TRANSLATE_BIG;return Ki(this,"_keyboardManager",new OP([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],i.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],i.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],i._translateEmpty,{args:[-l,0],checker:s}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],i._translateEmpty,{args:[-d,0],checker:s}],[["ArrowRight","mac+ArrowRight"],i._translateEmpty,{args:[l,0],checker:s}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],i._translateEmpty,{args:[d,0],checker:s}],[["ArrowUp","mac+ArrowUp"],i._translateEmpty,{args:[0,-l],checker:s}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],i._translateEmpty,{args:[0,-d],checker:s}],[["ArrowDown","mac+ArrowDown"],i._translateEmpty,{args:[0,l],checker:s}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],i._translateEmpty,{args:[0,d],checker:s}]]))}static initialize(i,s){fs.initialize(i,s);const l=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(l.getPropertyValue("--freetext-padding"))}static updateDefaultParams(i,s){switch(i){case cr.FREETEXT_SIZE:ds._defaultFontSize=s;break;case cr.FREETEXT_COLOR:ds._defaultColor=s;break}}updateParams(i,s){switch(i){case cr.FREETEXT_SIZE:fe(this,Cj,vwe).call(this,s);break;case cr.FREETEXT_COLOR:fe(this,Tj,ywe).call(this,s);break}}static get defaultPropertiesToUpdate(){return[[cr.FREETEXT_SIZE,ds._defaultFontSize],[cr.FREETEXT_COLOR,ds._defaultColor||fs._defaultLineColor]]}get propertiesToUpdate(){return[[cr.FREETEXT_SIZE,b(this,jd)],[cr.FREETEXT_COLOR,b(this,Zu)]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new l9(this)),[["colorPicker",this._colorPicker]]}get colorType(){return cr.FREETEXT_COLOR}get colorValue(){return b(this,Zu)}_translateEmpty(i,s){this._uiManager.translateSelectedEditors(i,s,!0)}getInitialTranslation(){const i=this.parentScale;return[-ds._internalPadding*i,-(ds._internalPadding+b(this,jd))*i]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),te(this,r2,new AbortController);const i=this._uiManager.combinedSignal(b(this,r2));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:i}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:i}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:i}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:i}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:i}),!0}disableEditMode(){var i;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",b(this,NO)),this._isDraggable=!0,(i=b(this,r2))==null||i.abort(),te(this,r2,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(i){this._focusEventsAllowed&&(super.focusin(i),i.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(i){var s;this.width||(this.enableEditMode(),i&&this.editorDiv.focus(),(s=this._initialOptions)!=null&&s.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const i=b(this,Md),s=te(this,Md,fe(this,Rj,_we).call(this).trimEnd());if(i===s)return;const l=d=>{if(te(this,Md,d),!d){this.remove();return}fe(this,vR,XM).call(this),this._uiManager.rebuild(this),fe(this,mR,qM).call(this)};this.addCommands({cmd:()=>{l(s)},undo:()=>{l(i)},mustExec:!1}),fe(this,mR,qM).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(i){i.target===this.div&&i.key==="Enter"&&(this.enterInEditMode(),i.preventDefault())}editorDivKeydown(i){ds._keyboardManager.exec(this,i)}editorDivFocus(i){this.isEditing=!0}editorDivBlur(i){this.isEditing=!1}editorDivInput(i){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let i,s;(this._isCopy||this.annotationElementId)&&(i=this.x,s=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",b(this,NO)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:l}=this.editorDiv;if(l.fontSize=`calc(${b(this,jd)}px * var(--total-scale-factor))`,l.color=b(this,Zu),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[d,u]=this.parentDimensions;if(this.annotationElementId){const{position:p}=this._initialData;let[m,y]=this.getInitialTranslation();[m,y]=this.pageTranslationToScreen(m,y);const[_,E]=this.pageDimensions,[C,x]=this.pageTranslation;let N,O;switch(this.rotation){case 0:N=i+(p[0]-C)/_,O=s+this.height-(p[1]-x)/E;break;case 90:N=i+(p[0]-C)/_,O=s-(p[1]-x)/E,[m,y]=[y,-m];break;case 180:N=i-this.width+(p[0]-C)/_,O=s-(p[1]-x)/E,[m,y]=[-m,-y];break;case 270:N=i+(p[0]-C-this.height*E)/_,O=s+(p[1]-x-this.width*_)/E,[m,y]=[-y,m];break}this.setAt(N*d,O*u,m,y)}else this._moveAfterPaste(i,s);fe(this,vR,XM).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(i){var N,O,D;const s=i.clipboardData||window.clipboardData,{types:l}=s;if(l.length===1&&l[0]==="text/plain")return;i.preventDefault();const d=fe(N=ds,OO,HX).call(N,s.getData("text")||"").replaceAll(sM,`
`);if(!d)return;const u=window.getSelection();if(!u.rangeCount)return;this.editorDiv.normalize(),u.deleteFromDocument();const p=u.getRangeAt(0);if(!d.includes(`
`)){p.insertNode(document.createTextNode(d)),this.editorDiv.normalize(),u.collapseToStart();return}const{startContainer:m,startOffset:y}=p,_=[],E=[];if(m.nodeType===Node.TEXT_NODE){const P=m.parentElement;if(E.push(m.nodeValue.slice(y).replaceAll(sM,"")),P!==this.editorDiv){let j=_;for(const M of this.editorDiv.childNodes){if(M===P){j=E;continue}j.push(fe(O=ds,gR,YM).call(O,M))}}_.push(m.nodeValue.slice(0,y).replaceAll(sM,""))}else if(m===this.editorDiv){let P=_,j=0;for(const M of this.editorDiv.childNodes)j++===y&&(P=E),P.push(fe(D=ds,gR,YM).call(D,M))}te(this,Md,`${_.join(`
`)}${d}${E.join(`
`)}`),fe(this,vR,XM).call(this);const C=new Range;let x=Math.sumPrecise(_.map(P=>P.length));for(const{firstChild:P}of this.editorDiv.childNodes)if(P.nodeType===Node.TEXT_NODE){const j=P.nodeValue.length;if(x<=j){C.setStart(P,x),C.setEnd(P,x);break}x-=j}u.removeAllRanges(),u.addRange(C)}get contentDiv(){return this.editorDiv}getPDFRect(){const i=ds._internalPadding*this.parentScale;return this.getRect(i,i)}static async deserialize(i,s,l){var p;let d=null;if(i instanceof fwe){const{data:{defaultAppearanceData:{fontSize:m,fontColor:y},rect:_,rotation:E,id:C,popupRef:x,contentsObj:N},textContent:O,textPosition:D,parent:{page:{pageNumber:P}}}=i;if(!O||O.length===0)return null;d=i={annotationType:fi.FREETEXT,color:Array.from(y),fontSize:m,value:O.join(`
`),position:D,pageIndex:P-1,rect:_.slice(0),rotation:E,annotationElementId:C,id:C,deleted:!1,popupRef:x,comment:(N==null?void 0:N.str)||null}}const u=await super.deserialize(i,s,l);return te(u,jd,i.fontSize),te(u,Zu,In.makeHexColor(...i.color)),te(u,Md,fe(p=ds,OO,HX).call(p,i.value)),u._initialData=d,i.comment&&u.setCommentData(i.comment),u}serialize(i=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=this.getPDFRect(),l=fs._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:b(this,Zu)),d={annotationType:fi.FREETEXT,color:l,fontSize:b(this,jd),value:fe(this,xj,Ewe).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(d),i?(d.isCopy=!0,d):this.annotationElementId&&!fe(this,Aj,wwe).call(this,d)?null:(d.id=this.annotationElementId,d)}renderAnnotationElement(i){const s=super.renderAnnotationElement(i);if(!s)return null;const{style:l}=s;l.fontSize=`calc(${b(this,jd)}px * var(--total-scale-factor))`,l.color=b(this,Zu),s.replaceChildren();for(const u of b(this,Md).split(`
`)){const p=document.createElement("div");p.append(u?document.createTextNode(u):document.createElement("br")),s.append(p)}const d={rect:this.getPDFRect()};return d.popup=this.hasEditedComment?this.comment:{text:b(this,Md)},i.updateEdited(d),s}resetAnnotationElement(i){super.resetAnnotationElement(i),i.resetEdited()}};Zu=new WeakMap,Md=new WeakMap,NO=new WeakMap,r2=new WeakMap,jd=new WeakMap,Cj=new WeakSet,vwe=function(i){const s=d=>{this.editorDiv.style.fontSize=`calc(${d}px * var(--total-scale-factor))`,this.translate(0,-(d-b(this,jd))*this.parentScale),te(this,jd,d),fe(this,mR,qM).call(this)},l=b(this,jd);this.addCommands({cmd:s.bind(this,i),undo:s.bind(this,l),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Tj=new WeakSet,ywe=function(i){const s=d=>{var u;te(this,Zu,this.editorDiv.style.color=d),(u=this._colorPicker)==null||u.update(d)},l=b(this,Zu);this.addCommands({cmd:s.bind(this,i),undo:s.bind(this,l),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Rj=new WeakSet,_we=function(){var l;const i=[];this.editorDiv.normalize();let s=null;for(const d of this.editorDiv.childNodes)(s==null?void 0:s.nodeType)===Node.TEXT_NODE&&d.nodeName==="BR"||(i.push(fe(l=ds,gR,YM).call(l,d)),s=d);return i.join(`
`)},mR=new WeakSet,qM=function(){const[i,s]=this.parentDimensions;let l;if(this.isAttachedToDOM)l=this.div.getBoundingClientRect();else{const{currentLayer:d,div:u}=this,p=u.style.display,m=u.classList.contains("hidden");u.classList.remove("hidden"),u.style.display="hidden",d.div.append(this.div),l=u.getBoundingClientRect(),u.remove(),u.style.display=p,u.classList.toggle("hidden",m)}this.rotation%180===this.parentRotation%180?(this.width=l.width/i,this.height=l.height/s):(this.width=l.height/i,this.height=l.width/s),this.fixAndSetPosition()},gR=new WeakSet,YM=function(i){return(i.nodeType===Node.TEXT_NODE?i.nodeValue:i.innerText).replaceAll(sM,"")},vR=new WeakSet,XM=function(){if(this.editorDiv.replaceChildren(),!!b(this,Md))for(const i of b(this,Md).split(`
`)){const s=document.createElement("div");s.append(i?document.createTextNode(i):document.createElement("br")),this.editorDiv.append(s)}},xj=new WeakSet,Ewe=function(){return b(this,Md).replaceAll(" "," ")},OO=new WeakSet,HX=function(i){return i.replaceAll(" "," ")},Aj=new WeakSet,wwe=function(i){const{value:s,fontSize:l,color:d,pageIndex:u}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||i.value!==s||i.fontSize!==l||i.color.some((p,m)=>p!==d[m])||i.pageIndex!==u},J(ds,gR),J(ds,OO),sn(ds,"_freeTextDefaultContent",""),sn(ds,"_internalPadding",0),sn(ds,"_defaultColor",null),sn(ds,"_defaultFontSize",10),sn(ds,"_type","freetext"),sn(ds,"_editorType",fi.FREETEXT);let zX=ds;class xn{toSVGPath(){ns("Abstract method `toSVGPath` must be implemented.")}get box(){ns("Abstract getter `box` must be implemented.")}serialize(t,i){ns("Abstract method `serialize` must be implemented.")}static _rescale(t,i,s,l,d,u){u||(u=new Float32Array(t.length));for(let p=0,m=t.length;p<m;p+=2)u[p]=i+t[p]*l,u[p+1]=s+t[p+1]*d;return u}static _rescaleAndSwap(t,i,s,l,d,u){u||(u=new Float32Array(t.length));for(let p=0,m=t.length;p<m;p+=2)u[p]=i+t[p+1]*l,u[p+1]=s+t[p]*d;return u}static _translate(t,i,s,l){l||(l=new Float32Array(t.length));for(let d=0,u=t.length;d<u;d+=2)l[d]=i+t[d],l[d+1]=s+t[d+1];return l}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,i,s,l,d){switch(d){case 90:return[1-i/s,t/l];case 180:return[1-t/s,1-i/l];case 270:return[i/s,1-t/l];default:return[t/s,i/l]}}static _normalizePagePoint(t,i,s){switch(s){case 90:return[1-i,t];case 180:return[1-t,1-i];case 270:return[i,1-t];default:return[t,i]}}static createBezierPoints(t,i,s,l,d,u){return[(t+5*s)/6,(i+5*l)/6,(5*s+d)/6,(5*l+u)/6,(s+d)/2,(l+u)/2]}}sn(xn,"PRECISION",1e-4);var Ud,sf,yR,_R,Pp,$i,s2,a2,PO,LO,ER,wR,mv,DO,Ij,Nj,o2,E4,Oj,Swe,Pj,bwe,Lj,Cwe,Dj,Twe,kj,Rwe,Mj,xwe;const Gm=class Gm{constructor({x:t,y:i},s,l,d,u,p=0){J(this,o2);J(this,Oj);J(this,Pj);J(this,Lj);J(this,Dj);J(this,kj);J(this,Mj);J(this,Ud,void 0);J(this,sf,[]);J(this,yR,void 0);J(this,_R,void 0);J(this,Pp,[]);J(this,$i,new Float32Array(18));J(this,s2,void 0);J(this,a2,void 0);J(this,PO,void 0);J(this,LO,void 0);J(this,ER,void 0);J(this,wR,void 0);J(this,mv,[]);te(this,Ud,s),te(this,wR,d*l),te(this,_R,u),b(this,$i).set([NaN,NaN,NaN,NaN,t,i],6),te(this,yR,p),te(this,LO,b(Gm,DO)*l),te(this,PO,b(Gm,Nj)*l),te(this,ER,l),b(this,mv).push(t,i)}isEmpty(){return isNaN(b(this,$i)[8])}add({x:t,y:i}){var le;te(this,s2,t),te(this,a2,i);const[s,l,d,u]=b(this,Ud);let[p,m,y,_]=b(this,$i).subarray(8,12);const E=t-y,C=i-_,x=Math.hypot(E,C);if(x<b(this,PO))return!1;const N=x-b(this,LO),O=N/x,D=O*E,P=O*C;let j=p,M=m;p=y,m=_,y+=D,_+=P,(le=b(this,mv))==null||le.push(t,i);const V=-P/N,G=D/N,$=V*b(this,wR),ne=G*b(this,wR);return b(this,$i).set(b(this,$i).subarray(2,8),0),b(this,$i).set([y+$,_+ne],4),b(this,$i).set(b(this,$i).subarray(14,18),12),b(this,$i).set([y-$,_-ne],16),isNaN(b(this,$i)[6])?(b(this,Pp).length===0&&(b(this,$i).set([p+$,m+ne],2),b(this,Pp).push(NaN,NaN,NaN,NaN,(p+$-s)/d,(m+ne-l)/u),b(this,$i).set([p-$,m-ne],14),b(this,sf).push(NaN,NaN,NaN,NaN,(p-$-s)/d,(m-ne-l)/u)),b(this,$i).set([j,M,p,m,y,_],6),!this.isEmpty()):(b(this,$i).set([j,M,p,m,y,_],6),Math.abs(Math.atan2(M-m,j-p)-Math.atan2(P,D))<Math.PI/2?([p,m,y,_]=b(this,$i).subarray(2,6),b(this,Pp).push(NaN,NaN,NaN,NaN,((p+y)/2-s)/d,((m+_)/2-l)/u),[p,m,j,M]=b(this,$i).subarray(14,18),b(this,sf).push(NaN,NaN,NaN,NaN,((j+p)/2-s)/d,((M+m)/2-l)/u),!0):([j,M,p,m,y,_]=b(this,$i).subarray(0,6),b(this,Pp).push(((j+5*p)/6-s)/d,((M+5*m)/6-l)/u,((5*p+y)/6-s)/d,((5*m+_)/6-l)/u,((p+y)/2-s)/d,((m+_)/2-l)/u),[y,_,p,m,j,M]=b(this,$i).subarray(12,18),b(this,sf).push(((j+5*p)/6-s)/d,((M+5*m)/6-l)/u,((5*p+y)/6-s)/d,((5*m+_)/6-l)/u,((p+y)/2-s)/d,((m+_)/2-l)/u),!0))}toSVGPath(){if(this.isEmpty())return"";const t=b(this,Pp),i=b(this,sf);if(isNaN(b(this,$i)[6])&&!this.isEmpty())return fe(this,Oj,Swe).call(this);const s=[];s.push(`M${t[4]} ${t[5]}`);for(let l=6;l<t.length;l+=6)isNaN(t[l])?s.push(`L${t[l+4]} ${t[l+5]}`):s.push(`C${t[l]} ${t[l+1]} ${t[l+2]} ${t[l+3]} ${t[l+4]} ${t[l+5]}`);fe(this,Lj,Cwe).call(this,s);for(let l=i.length-6;l>=6;l-=6)isNaN(i[l])?s.push(`L${i[l+4]} ${i[l+5]}`):s.push(`C${i[l]} ${i[l+1]} ${i[l+2]} ${i[l+3]} ${i[l+4]} ${i[l+5]}`);return fe(this,Pj,bwe).call(this,s),s.join(" ")}newFreeDrawOutline(t,i,s,l,d,u){return new Awe(t,i,s,l,d,u)}getOutlines(){var E;const t=b(this,Pp),i=b(this,sf),s=b(this,$i),[l,d,u,p]=b(this,Ud),m=new Float32Array((((E=b(this,mv))==null?void 0:E.length)??0)+2);for(let C=0,x=m.length-2;C<x;C+=2)m[C]=(b(this,mv)[C]-l)/u,m[C+1]=(b(this,mv)[C+1]-d)/p;if(m[m.length-2]=(b(this,s2)-l)/u,m[m.length-1]=(b(this,a2)-d)/p,isNaN(s[6])&&!this.isEmpty())return fe(this,Dj,Twe).call(this,m);const y=new Float32Array(b(this,Pp).length+24+b(this,sf).length);let _=t.length;for(let C=0;C<_;C+=2){if(isNaN(t[C])){y[C]=y[C+1]=NaN;continue}y[C]=t[C],y[C+1]=t[C+1]}_=fe(this,Mj,xwe).call(this,y,_);for(let C=i.length-6;C>=6;C-=6)for(let x=0;x<6;x+=2){if(isNaN(i[C+x])){y[_]=y[_+1]=NaN,_+=2;continue}y[_]=i[C+x],y[_+1]=i[C+x+1],_+=2}return fe(this,kj,Rwe).call(this,y,_),this.newFreeDrawOutline(y,m,b(this,Ud),b(this,ER),b(this,yR),b(this,_R))}};Ud=new WeakMap,sf=new WeakMap,yR=new WeakMap,_R=new WeakMap,Pp=new WeakMap,$i=new WeakMap,s2=new WeakMap,a2=new WeakMap,PO=new WeakMap,LO=new WeakMap,ER=new WeakMap,wR=new WeakMap,mv=new WeakMap,DO=new WeakMap,Ij=new WeakMap,Nj=new WeakMap,o2=new WeakSet,E4=function(){const t=b(this,$i).subarray(4,6),i=b(this,$i).subarray(16,18),[s,l,d,u]=b(this,Ud);return[(b(this,s2)+(t[0]-i[0])/2-s)/d,(b(this,a2)+(t[1]-i[1])/2-l)/u,(b(this,s2)+(i[0]-t[0])/2-s)/d,(b(this,a2)+(i[1]-t[1])/2-l)/u]},Oj=new WeakSet,Swe=function(){const[t,i,s,l]=b(this,Ud),[d,u,p,m]=fe(this,o2,E4).call(this);return`M${(b(this,$i)[2]-t)/s} ${(b(this,$i)[3]-i)/l} L${(b(this,$i)[4]-t)/s} ${(b(this,$i)[5]-i)/l} L${d} ${u} L${p} ${m} L${(b(this,$i)[16]-t)/s} ${(b(this,$i)[17]-i)/l} L${(b(this,$i)[14]-t)/s} ${(b(this,$i)[15]-i)/l} Z`},Pj=new WeakSet,bwe=function(t){const i=b(this,sf);t.push(`L${i[4]} ${i[5]} Z`)},Lj=new WeakSet,Cwe=function(t){const[i,s,l,d]=b(this,Ud),u=b(this,$i).subarray(4,6),p=b(this,$i).subarray(16,18),[m,y,_,E]=fe(this,o2,E4).call(this);t.push(`L${(u[0]-i)/l} ${(u[1]-s)/d} L${m} ${y} L${_} ${E} L${(p[0]-i)/l} ${(p[1]-s)/d}`)},Dj=new WeakSet,Twe=function(t){const i=b(this,$i),[s,l,d,u]=b(this,Ud),[p,m,y,_]=fe(this,o2,E4).call(this),E=new Float32Array(36);return E.set([NaN,NaN,NaN,NaN,(i[2]-s)/d,(i[3]-l)/u,NaN,NaN,NaN,NaN,(i[4]-s)/d,(i[5]-l)/u,NaN,NaN,NaN,NaN,p,m,NaN,NaN,NaN,NaN,y,_,NaN,NaN,NaN,NaN,(i[16]-s)/d,(i[17]-l)/u,NaN,NaN,NaN,NaN,(i[14]-s)/d,(i[15]-l)/u],0),this.newFreeDrawOutline(E,t,b(this,Ud),b(this,ER),b(this,yR),b(this,_R))},kj=new WeakSet,Rwe=function(t,i){const s=b(this,sf);return t.set([NaN,NaN,NaN,NaN,s[4],s[5]],i),i+=6},Mj=new WeakSet,xwe=function(t,i){const s=b(this,$i).subarray(4,6),l=b(this,$i).subarray(16,18),[d,u,p,m]=b(this,Ud),[y,_,E,C]=fe(this,o2,E4).call(this);return t.set([NaN,NaN,NaN,NaN,(s[0]-d)/p,(s[1]-u)/m,NaN,NaN,NaN,NaN,y,_,NaN,NaN,NaN,NaN,E,C,NaN,NaN,NaN,NaN,(l[0]-d)/p,(l[1]-u)/m],i),i+=24},J(Gm,DO,8),J(Gm,Ij,2),J(Gm,Nj,b(Gm,DO)+b(Gm,Ij));let d9=Gm;var SR,l2,Rg,kO,Fd,MO,va,jj,Iwe;class Awe extends xn{constructor(i,s,l,d,u,p){super();J(this,jj);J(this,SR,void 0);J(this,l2,new Float32Array(4));J(this,Rg,void 0);J(this,kO,void 0);J(this,Fd,void 0);J(this,MO,void 0);J(this,va,void 0);te(this,va,i),te(this,Fd,s),te(this,SR,l),te(this,MO,d),te(this,Rg,u),te(this,kO,p),this.lastPoint=[NaN,NaN],fe(this,jj,Iwe).call(this,p);const[m,y,_,E]=b(this,l2);for(let C=0,x=i.length;C<x;C+=2)i[C]=(i[C]-m)/_,i[C+1]=(i[C+1]-y)/E;for(let C=0,x=s.length;C<x;C+=2)s[C]=(s[C]-m)/_,s[C+1]=(s[C+1]-y)/E}toSVGPath(){const i=[`M${b(this,va)[4]} ${b(this,va)[5]}`];for(let s=6,l=b(this,va).length;s<l;s+=6){if(isNaN(b(this,va)[s])){i.push(`L${b(this,va)[s+4]} ${b(this,va)[s+5]}`);continue}i.push(`C${b(this,va)[s]} ${b(this,va)[s+1]} ${b(this,va)[s+2]} ${b(this,va)[s+3]} ${b(this,va)[s+4]} ${b(this,va)[s+5]}`)}return i.push("Z"),i.join(" ")}serialize([i,s,l,d],u){const p=l-i,m=d-s;let y,_;switch(u){case 0:y=xn._rescale(b(this,va),i,d,p,-m),_=xn._rescale(b(this,Fd),i,d,p,-m);break;case 90:y=xn._rescaleAndSwap(b(this,va),i,s,p,m),_=xn._rescaleAndSwap(b(this,Fd),i,s,p,m);break;case 180:y=xn._rescale(b(this,va),l,s,-p,m),_=xn._rescale(b(this,Fd),l,s,-p,m);break;case 270:y=xn._rescaleAndSwap(b(this,va),l,d,-p,-m),_=xn._rescaleAndSwap(b(this,Fd),l,d,-p,-m);break}return{outline:Array.from(y),points:[Array.from(_)]}}get box(){return b(this,l2)}newOutliner(i,s,l,d,u,p=0){return new d9(i,s,l,d,u,p)}getNewOutline(i,s){const[l,d,u,p]=b(this,l2),[m,y,_,E]=b(this,SR),C=u*_,x=p*E,N=l*_+m,O=d*E+y,D=this.newOutliner({x:b(this,Fd)[0]*C+N,y:b(this,Fd)[1]*x+O},b(this,SR),b(this,MO),i,b(this,kO),s??b(this,Rg));for(let P=2;P<b(this,Fd).length;P+=2)D.add({x:b(this,Fd)[P]*C+N,y:b(this,Fd)[P+1]*x+O});return D.getOutlines()}}SR=new WeakMap,l2=new WeakMap,Rg=new WeakMap,kO=new WeakMap,Fd=new WeakMap,MO=new WeakMap,va=new WeakMap,jj=new WeakSet,Iwe=function(i){const s=b(this,va);let l=s[4],d=s[5];const u=[l,d,l,d];let p=l,m=d;const y=i?Math.max:Math.min;for(let E=6,C=s.length;E<C;E+=6){const x=s[E+4],N=s[E+5];if(isNaN(s[E]))In.pointBoundingBox(x,N,u),m<N?(p=x,m=N):m===N&&(p=y(p,x));else{const O=[1/0,1/0,-1/0,-1/0];In.bezierBoundingBox(l,d,...s.slice(E,E+6),O),In.rectBoundingBox(...O,u),m<O[3]?(p=O[2],m=O[3]):m===O[3]&&(p=y(p,O[2]))}l=x,d=N}const _=b(this,l2);_[0]=u[0]-b(this,Rg),_[1]=u[1]-b(this,Rg),_[2]=u[2]-u[0]+2*b(this,Rg),_[3]=u[3]-u[1]+2*b(this,Rg),this.lastPoint=[p,m]};var jO,UO,gv,af,Uj,Nwe,bR,JM,Fj,Owe,Bj,Pwe,FO,WX;class GX{constructor(t,i=0,s=0,l=!0){J(this,Uj);J(this,bR);J(this,Fj);J(this,Bj);J(this,FO);J(this,jO,void 0);J(this,UO,void 0);J(this,gv,[]);J(this,af,[]);const d=[1/0,1/0,-1/0,-1/0],p=10**-4;for(const{x:N,y:O,width:D,height:P}of t){const j=Math.floor((N-i)/p)*p,M=Math.ceil((N+D+i)/p)*p,V=Math.floor((O-i)/p)*p,G=Math.ceil((O+P+i)/p)*p,$=[j,V,G,!0],ne=[M,V,G,!1];b(this,gv).push($,ne),In.rectBoundingBox(j,V,M,G,d)}const m=d[2]-d[0]+2*s,y=d[3]-d[1]+2*s,_=d[0]-s,E=d[1]-s,C=b(this,gv).at(l?-1:-2),x=[C[0],C[2]];for(const N of b(this,gv)){const[O,D,P]=N;N[0]=(O-_)/m,N[1]=(D-E)/y,N[2]=(P-E)/y}te(this,jO,new Float32Array([_,E,m,y])),te(this,UO,x)}getOutlines(){b(this,gv).sort((i,s)=>i[0]-s[0]||i[1]-s[1]||i[2]-s[2]);const t=[];for(const i of b(this,gv))i[3]?(t.push(...fe(this,FO,WX).call(this,i)),fe(this,Fj,Owe).call(this,i)):(fe(this,Bj,Pwe).call(this,i),t.push(...fe(this,FO,WX).call(this,i)));return fe(this,Uj,Nwe).call(this,t)}}jO=new WeakMap,UO=new WeakMap,gv=new WeakMap,af=new WeakMap,Uj=new WeakSet,Nwe=function(t){const i=[],s=new Set;for(const u of t){const[p,m,y]=u;i.push([p,m,u],[p,y,u])}i.sort((u,p)=>u[1]-p[1]||u[0]-p[0]);for(let u=0,p=i.length;u<p;u+=2){const m=i[u][2],y=i[u+1][2];m.push(y),y.push(m),s.add(m),s.add(y)}const l=[];let d;for(;s.size>0;){const u=s.values().next().value;let[p,m,y,_,E]=u;s.delete(u);let C=p,x=m;for(d=[p,y],l.push(d);;){let N;if(s.has(_))N=_;else if(s.has(E))N=E;else break;s.delete(N),[p,m,y,_,E]=N,C!==p&&(d.push(C,x,p,x===m?m:y),C=p),x=x===m?y:m}d.push(C,x)}return new wet(l,b(this,jO),b(this,UO))},bR=new WeakSet,JM=function(t){const i=b(this,af);let s=0,l=i.length-1;for(;s<=l;){const d=s+l>>1,u=i[d][0];if(u===t)return d;u<t?s=d+1:l=d-1}return l+1},Fj=new WeakSet,Owe=function([,t,i]){const s=fe(this,bR,JM).call(this,t);b(this,af).splice(s,0,[t,i])},Bj=new WeakSet,Pwe=function([,t,i]){const s=fe(this,bR,JM).call(this,t);for(let l=s;l<b(this,af).length;l++){const[d,u]=b(this,af)[l];if(d!==t)break;if(d===t&&u===i){b(this,af).splice(l,1);return}}for(let l=s-1;l>=0;l--){const[d,u]=b(this,af)[l];if(d!==t)break;if(d===t&&u===i){b(this,af).splice(l,1);return}}},FO=new WeakSet,WX=function(t){const[i,s,l]=t,d=[[i,s,l]],u=fe(this,bR,JM).call(this,l);for(let p=0;p<u;p++){const[m,y]=b(this,af)[p];for(let _=0,E=d.length;_<E;_++){const[,C,x]=d[_];if(!(y<=C||x<=m)){if(C>=m){if(x>y)d[_][1]=y;else{if(E===1)return[];d.splice(_,1),_--,E--}continue}d[_][2]=m,x>y&&d.push([i,y,x])}}}return d};var BO,CR;class wet extends xn{constructor(i,s,l){super();J(this,BO,void 0);J(this,CR,void 0);te(this,CR,i),te(this,BO,s),this.lastPoint=l}toSVGPath(){const i=[];for(const s of b(this,CR)){let[l,d]=s;i.push(`M${l} ${d}`);for(let u=2;u<s.length;u+=2){const p=s[u],m=s[u+1];p===l?(i.push(`V${m}`),d=m):m===d&&(i.push(`H${p}`),l=p)}i.push("Z")}return i.join(" ")}serialize([i,s,l,d],u){const p=[],m=l-i,y=d-s;for(const _ of b(this,CR)){const E=new Array(_.length);for(let C=0;C<_.length;C+=2)E[C]=i+_[C]*m,E[C+1]=d-_[C+1]*y;p.push(E)}return p}get box(){return b(this,BO)}get classNamesForOutlining(){return["highlightOutline"]}}BO=new WeakMap,CR=new WeakMap;class $X extends d9{newFreeDrawOutline(t,i,s,l,d,u){return new bet(t,i,s,l,d,u)}}class bet extends Awe{newOutliner(t,i,s,l,d,u=0){return new $X(t,i,s,l,d,u)}}var TR,VO,xg,c2,zO,Xc,HO,GO,d2,eh,Bd,Wo,RR,Ag,El,xR,th,WO,$O,KX,AR,QM,Vj,Lwe,zj,Dwe,Hj,kwe,KO,qX,Ig,z_,vv,gC,Gj,Mwe,IR,ZM,u2,w4,Wj,jwe,$j,Uwe,Kj,Fwe,qj,Bwe,Yj,Vwe;const _r=class _r extends fs{constructor(i){super({...i,name:"highlightEditor"});J(this,$O);J(this,AR);J(this,Vj);J(this,zj);J(this,Hj);J(this,KO);J(this,Ig);J(this,Gj);J(this,IR);J(this,u2);J(this,Wj);J(this,$j);J(this,Yj);J(this,TR,null);J(this,VO,0);J(this,xg,void 0);J(this,c2,null);J(this,zO,null);J(this,Xc,null);J(this,HO,null);J(this,GO,0);J(this,d2,null);J(this,eh,null);J(this,Bd,null);J(this,Wo,!1);J(this,RR,null);J(this,Ag,void 0);J(this,El,null);J(this,xR,"");J(this,th,void 0);J(this,WO,"");this.color=i.color||_r._defaultColor,te(this,th,i.thickness||_r._defaultThickness),te(this,Ag,i.opacity||_r._defaultOpacity),te(this,xg,i.boxes||null),te(this,WO,i.methodOfCreation||""),te(this,xR,i.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",i.highlightId>-1?(te(this,Wo,!0),fe(this,AR,QM).call(this,i),fe(this,Ig,z_).call(this)):b(this,xg)&&(te(this,TR,i.anchorNode),te(this,VO,i.anchorOffset),te(this,HO,i.focusNode),te(this,GO,i.focusOffset),fe(this,$O,KX).call(this),fe(this,Ig,z_).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const i=_r.prototype;return Ki(this,"_keyboardManager",new OP([[["ArrowLeft","mac+ArrowLeft"],i._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],i._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],i._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],i._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:b(this,Wo)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:b(this,th),methodOfCreation:b(this,WO)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(i){return{numberOfColors:i.get("color").size}}static initialize(i,s){var l;fs.initialize(i,s),_r._defaultColor||(_r._defaultColor=((l=s.highlightColors)==null?void 0:l.values().next().value)||"#fff066")}static updateDefaultParams(i,s){switch(i){case cr.HIGHLIGHT_COLOR:_r._defaultColor=s;break;case cr.HIGHLIGHT_THICKNESS:_r._defaultThickness=s;break}}translateInPage(i,s){}get toolbarPosition(){return b(this,RR)}updateParams(i,s){switch(i){case cr.HIGHLIGHT_COLOR:fe(this,Vj,Lwe).call(this,s);break;case cr.HIGHLIGHT_THICKNESS:fe(this,zj,Dwe).call(this,s);break}}static get defaultPropertiesToUpdate(){return[[cr.HIGHLIGHT_COLOR,_r._defaultColor],[cr.HIGHLIGHT_THICKNESS,_r._defaultThickness]]}get propertiesToUpdate(){return[[cr.HIGHLIGHT_COLOR,this.color||_r._defaultColor],[cr.HIGHLIGHT_THICKNESS,b(this,th)||_r._defaultThickness],[cr.HIGHLIGHT_FREE,b(this,Wo)]]}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",te(this,zO,new o9({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(fe(this,u2,w4).call(this))}getBaseTranslation(){return[0,0]}getRect(i,s){return super.getRect(i,s,fe(this,u2,w4).call(this))}onceAdded(i){this.annotationElementId||this.parent.addUndoableEditor(this),i&&this.div.focus()}remove(){fe(this,KO,qX).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(fe(this,Ig,z_).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(i){var l;let s=!1;this.parent&&!i?fe(this,KO,qX).call(this):i&&(fe(this,Ig,z_).call(this,i),s=!this.parent&&((l=this.div)==null?void 0:l.classList.contains("selectedEditor"))),super.setParent(i),this.show(this._isVisible),s&&this.select()}rotate(i){var d,u,p;const{drawLayer:s}=this.parent;let l;b(this,Wo)?(i=(i-this.rotation+360)%360,l=fe(d=_r,vv,gC).call(d,b(this,eh).box,i)):l=fe(u=_r,vv,gC).call(u,[this.x,this.y,this.width,this.height],i),s.updateProperties(b(this,Bd),{bbox:l,root:{"data-main-rotation":i}}),s.updateProperties(b(this,El),{bbox:fe(p=_r,vv,gC).call(p,b(this,Xc).box,i),root:{"data-main-rotation":i}})}render(){if(this.div)return this.div;const i=super.render();b(this,xR)&&(i.setAttribute("aria-label",b(this,xR)),i.setAttribute("role","mark")),b(this,Wo)?i.classList.add("free"):this.div.addEventListener("keydown",fe(this,Gj,Mwe).bind(this),{signal:this._uiManager._signal});const s=te(this,d2,document.createElement("div"));i.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",s.style.clipPath=b(this,c2);const[l,d]=this.parentDimensions;return this.setDims(this.width*l,this.height*d),r2e(this,b(this,d2),["pointerover","pointerleave"]),this.enableEditing(),i}pointerover(){var i;this.isSelected||(i=this.parent)==null||i.drawLayer.updateProperties(b(this,El),{rootClass:{hovered:!0}})}pointerleave(){var i;this.isSelected||(i=this.parent)==null||i.drawLayer.updateProperties(b(this,El),{rootClass:{hovered:!1}})}_moveCaret(i){switch(this.parent.unselect(this),i){case 0:case 2:fe(this,IR,ZM).call(this,!0);break;case 1:case 3:fe(this,IR,ZM).call(this,!1);break}}select(){var i;super.select(),b(this,El)&&((i=this.parent)==null||i.drawLayer.updateProperties(b(this,El),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var i;super.unselect(),b(this,El)&&((i=this.parent)==null||i.drawLayer.updateProperties(b(this,El),{rootClass:{selected:!1}}),b(this,Wo)||fe(this,IR,ZM).call(this,!1))}get _mustFixPosition(){return!b(this,Wo)}show(i=this._isVisible){super.show(i),this.parent&&(this.parent.drawLayer.updateProperties(b(this,Bd),{rootClass:{hidden:!i}}),this.parent.drawLayer.updateProperties(b(this,El),{rootClass:{hidden:!i}}))}static startHighlighting(i,s,{target:l,x:d,y:u}){const{x:p,y:m,width:y,height:_}=l.getBoundingClientRect(),E=new AbortController,C=i.combinedSignal(E),x=N=>{E.abort(),fe(this,qj,Bwe).call(this,i,N)};window.addEventListener("blur",x,{signal:C}),window.addEventListener("pointerup",x,{signal:C}),window.addEventListener("pointerdown",Oa,{capture:!0,passive:!1,signal:C}),window.addEventListener("contextmenu",fh,{signal:C}),l.addEventListener("pointermove",fe(this,Kj,Fwe).bind(this,i),{signal:C}),this._freeHighlight=new $X({x:d,y:u},[p,m,y,_],i.scale,this._defaultThickness/2,s,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(i,s,l){var O,D,P,j;let d=null;if(i instanceof mwe){const{data:{quadPoints:M,rect:V,rotation:G,id:$,color:ne,opacity:Y,popupRef:le,contentsObj:re},parent:{page:{pageNumber:ee}}}=i;d=i={annotationType:fi.HIGHLIGHT,color:Array.from(ne),opacity:Y,quadPoints:M,boxes:null,pageIndex:ee-1,rect:V.slice(0),rotation:G,annotationElementId:$,id:$,deleted:!1,popupRef:le,comment:(re==null?void 0:re.str)||null}}else if(i instanceof GZ){const{data:{inkLists:M,rect:V,rotation:G,id:$,color:ne,borderStyle:{rawWidth:Y},popupRef:le,contentsObj:re},parent:{page:{pageNumber:ee}}}=i;d=i={annotationType:fi.HIGHLIGHT,color:Array.from(ne),thickness:Y,inkLists:M,boxes:null,pageIndex:ee-1,rect:V.slice(0),rotation:G,annotationElementId:$,id:$,deleted:!1,popupRef:le,comment:(re==null?void 0:re.str)||null}}const{color:u,quadPoints:p,inkLists:m,opacity:y}=i,_=await super.deserialize(i,s,l);_.color=In.makeHexColor(...u),te(_,Ag,y||1),m&&te(_,th,i.thickness),_._initialData=d,i.comment&&_.setCommentData(i.comment);const[E,C]=_.pageDimensions,[x,N]=_.pageTranslation;if(p){const M=te(_,xg,[]);for(let V=0;V<p.length;V+=8)M.push({x:(p[V]-x)/E,y:1-(p[V+1]-N)/C,width:(p[V+2]-p[V])/E,height:(p[V+1]-p[V+5])/C});fe(O=_,$O,KX).call(O),fe(D=_,Ig,z_).call(D),_.rotate(_.rotation)}else if(m){te(_,Wo,!0);const M=m[0],V={x:M[0]-x,y:C-(M[1]-N)},G=new $X(V,[0,0,E,C],1,b(_,th)/2,!0,.001);for(let Y=0,le=M.length;Y<le;Y+=2)V.x=M[Y]-x,V.y=C-(M[Y+1]-N),G.add(V);const{id:$,clipPathId:ne}=s.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:_.color,"fill-opacity":_._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:G.toSVGPath()}},!0,!0);fe(P=_,AR,QM).call(P,{highlightOutlines:G.getOutlines(),highlightId:$,clipPathId:ne}),fe(j=_,Ig,z_).call(j),_.rotate(_.parentRotation)}return _}serialize(i=!1){if(this.isEmpty()||i)return null;if(this.deleted)return this.serializeDeleted();const s=this.getPDFRect(),l=fs._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),d={annotationType:fi.HIGHLIGHT,color:l,opacity:b(this,Ag),thickness:b(this,th),quadPoints:fe(this,Wj,jwe).call(this),outlines:fe(this,$j,Uwe).call(this,s),pageIndex:this.pageIndex,rect:s,rotation:fe(this,u2,w4).call(this),structTreeParentId:this._structTreeParentId};return this.addComment(d),this.annotationElementId&&!fe(this,Yj,Vwe).call(this,d)?null:(d.id=this.annotationElementId,d)}renderAnnotationElement(i){if(this.deleted)return i.hide(),null;const s={rect:this.getPDFRect()};return this.hasEditedComment&&(s.popup=this.comment),i.updateEdited(s),null}static canCreateNewEmptyEditor(){return!1}};TR=new WeakMap,VO=new WeakMap,xg=new WeakMap,c2=new WeakMap,zO=new WeakMap,Xc=new WeakMap,HO=new WeakMap,GO=new WeakMap,d2=new WeakMap,eh=new WeakMap,Bd=new WeakMap,Wo=new WeakMap,RR=new WeakMap,Ag=new WeakMap,El=new WeakMap,xR=new WeakMap,th=new WeakMap,WO=new WeakMap,$O=new WeakSet,KX=function(){const i=new GX(b(this,xg),.001);te(this,eh,i.getOutlines()),[this.x,this.y,this.width,this.height]=b(this,eh).box;const s=new GX(b(this,xg),.0025,.001,this._uiManager.direction==="ltr");te(this,Xc,s.getOutlines());const{lastPoint:l}=b(this,Xc);te(this,RR,[(l[0]-this.x)/this.width,(l[1]-this.y)/this.height])},AR=new WeakSet,QM=function({highlightOutlines:i,highlightId:s,clipPathId:l}){var E,C;if(te(this,eh,i),te(this,Xc,i.getNewOutline(b(this,th)/2+1.5,.0025)),s>=0)te(this,Bd,s),te(this,c2,l),this.parent.drawLayer.finalizeDraw(s,{bbox:i.box,path:{d:i.toSVGPath()}}),te(this,El,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:b(this,Xc).box,path:{d:b(this,Xc).toSVGPath()}},!0));else if(this.parent){const x=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(b(this,Bd),{bbox:fe(E=_r,vv,gC).call(E,b(this,eh).box,(x-this.rotation+360)%360),path:{d:i.toSVGPath()}}),this.parent.drawLayer.updateProperties(b(this,El),{bbox:fe(C=_r,vv,gC).call(C,b(this,Xc).box,x),path:{d:b(this,Xc).toSVGPath()}})}const[u,p,m,y]=i.box;switch(this.rotation){case 0:this.x=u,this.y=p,this.width=m,this.height=y;break;case 90:{const[x,N]=this.parentDimensions;this.x=p,this.y=1-u,this.width=m*N/x,this.height=y*x/N;break}case 180:this.x=1-u,this.y=1-p,this.width=m,this.height=y;break;case 270:{const[x,N]=this.parentDimensions;this.x=1-p,this.y=u,this.width=m*N/x,this.height=y*x/N;break}}const{lastPoint:_}=b(this,Xc);te(this,RR,[(_[0]-u)/m,(_[1]-p)/y])},Vj=new WeakSet,Lwe=function(i){const s=(u,p)=>{var m,y;this.color=u,te(this,Ag,p),(m=this.parent)==null||m.drawLayer.updateProperties(b(this,Bd),{root:{fill:u,"fill-opacity":p}}),(y=b(this,zO))==null||y.updateColor(u)},l=this.color,d=b(this,Ag);this.addCommands({cmd:s.bind(this,i,_r._defaultOpacity),undo:s.bind(this,l,d),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(i)},!0)},zj=new WeakSet,Dwe=function(i){const s=b(this,th),l=d=>{te(this,th,d),fe(this,Hj,kwe).call(this,d)};this.addCommands({cmd:l.bind(this,i),undo:l.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:i},!0)},Hj=new WeakSet,kwe=function(i){if(!b(this,Wo))return;fe(this,AR,QM).call(this,{highlightOutlines:b(this,eh).getNewOutline(i/2)}),this.fixAndSetPosition();const[s,l]=this.parentDimensions;this.setDims(this.width*s,this.height*l)},KO=new WeakSet,qX=function(){b(this,Bd)===null||!this.parent||(this.parent.drawLayer.remove(b(this,Bd)),te(this,Bd,null),this.parent.drawLayer.remove(b(this,El)),te(this,El,null))},Ig=new WeakSet,z_=function(i=this.parent){b(this,Bd)===null&&({id:ea(this,Bd)._,clipPathId:ea(this,c2)._}=i.drawLayer.draw({bbox:b(this,eh).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":b(this,Ag)},rootClass:{highlight:!0,free:b(this,Wo)},path:{d:b(this,eh).toSVGPath()}},!1,!0),te(this,El,i.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:b(this,Wo)},bbox:b(this,Xc).box,path:{d:b(this,Xc).toSVGPath()}},b(this,Wo))),b(this,d2)&&(b(this,d2).style.clipPath=b(this,c2)))},vv=new WeakSet,gC=function([i,s,l,d],u){switch(u){case 90:return[1-s-d,i,d,l];case 180:return[1-i-l,1-s-d,l,d];case 270:return[s,1-i-l,d,l]}return[i,s,l,d]},Gj=new WeakSet,Mwe=function(i){_r._keyboardManager.exec(this,i)},IR=new WeakSet,ZM=function(i){if(!b(this,TR))return;const s=window.getSelection();i?s.setPosition(b(this,TR),b(this,VO)):s.setPosition(b(this,HO),b(this,GO))},u2=new WeakSet,w4=function(){return b(this,Wo)?this.rotation:0},Wj=new WeakSet,jwe=function(){if(b(this,Wo))return null;const[i,s]=this.pageDimensions,[l,d]=this.pageTranslation,u=b(this,xg),p=new Float32Array(u.length*8);let m=0;for(const{x:y,y:_,width:E,height:C}of u){const x=y*i+l,N=(1-_)*s+d;p[m]=p[m+4]=x,p[m+1]=p[m+3]=N,p[m+2]=p[m+6]=x+E*i,p[m+5]=p[m+7]=N-C*s,m+=8}return p},$j=new WeakSet,Uwe=function(i){return b(this,eh).serialize(i,fe(this,u2,w4).call(this))},Kj=new WeakSet,Fwe=function(i,s){this._freeHighlight.add(s)&&i.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},qj=new WeakSet,Bwe=function(i,s){this._freeHighlight.isEmpty()?i.drawLayer.remove(this._freeHighlightId):i.createAndAddNewEditor(s,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},Yj=new WeakSet,Vwe=function(i){const{color:s}=this._initialData;return this.hasEditedComment||i.color.some((l,d)=>l!==s[d])},J(_r,vv),J(_r,Kj),J(_r,qj),sn(_r,"_defaultColor",null),sn(_r,"_defaultOpacity",1),sn(_r,"_defaultThickness",12),sn(_r,"_type","highlight"),sn(_r,"_editorType",fi.HIGHLIGHT),sn(_r,"_freeHighlightId",-1),sn(_r,"_freeHighlight",null),sn(_r,"_freeHighlightClipId","");let u9=_r;var h2;class zwe{constructor(){J(this,h2,Object.create(null))}updateProperty(t,i){this[t]=i,this.updateSVGProperty(t,i)}updateProperties(t){if(t)for(const[i,s]of Object.entries(t))i.startsWith("_")||this.updateProperty(i,s)}updateSVGProperty(t,i){b(this,h2)[t]=i}toSVGProperties(){const t=b(this,h2);return te(this,h2,Object.create(null)),{root:t}}reset(){te(this,h2,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){ns("Not implemented")}}h2=new WeakMap;var Vd,NR,go,f2,p2,yv,_v,Ev,m2,qO,YX,YO,XX,XO,JX,g2,S4,Xj,Hwe,OR,e7,v2,b4,wv,vC;const Nn=class Nn extends fs{constructor(i){super(i);J(this,qO);J(this,YO);J(this,XO);J(this,g2);J(this,Xj);J(this,OR);J(this,v2);J(this,wv);J(this,Vd,null);J(this,NR,void 0);sn(this,"_colorPicker",null);sn(this,"_drawId",null);te(this,NR,i.mustBeCommitted||!1),this._addOutlines(i)}_addOutlines(i){i.drawOutlines&&(fe(this,qO,YX).call(this,i),fe(this,g2,S4).call(this))}static _mergeSVGProperties(i,s){const l=new Set(Object.keys(i));for(const[d,u]of Object.entries(s))l.has(d)?Object.assign(i[d],u):i[d]=u;return i}static getDefaultDrawingOptions(i){ns("Not implemented")}static get typesMap(){ns("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(i,s){const l=this.typesMap.get(i);l&&this._defaultDrawingOptions.updateProperty(l,s),this._currentParent&&(b(Nn,go).updateProperty(l,s),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(i,s){const l=this.constructor.typesMap.get(i);l&&this._updateProperty(i,l,s)}static get defaultPropertiesToUpdate(){const i=[],s=this._defaultDrawingOptions;for(const[l,d]of this.typesMap)i.push([l,s[d]]);return i}get propertiesToUpdate(){const i=[],{_drawingOptions:s}=this;for(const[l,d]of this.constructor.typesMap)i.push([l,s[d]]);return i}_updateProperty(i,s,l){const d=this._drawingOptions,u=d[s],p=m=>{var _,E;d.updateProperty(s,m);const y=b(this,Vd).updateProperty(s,m);y&&fe(this,v2,b4).call(this,y),(_=this.parent)==null||_.drawLayer.updateProperties(this._drawId,d.toSVGProperties()),i===this.colorType&&((E=this._colorPicker)==null||E.update(m))};this.addCommands({cmd:p.bind(this,l),undo:p.bind(this,u),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:i,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,Nn._mergeSVGProperties(b(this,Vd).getPathResizingSVGProperties(fe(this,OR,e7).call(this)),{bbox:fe(this,wv,vC).call(this)}))}_onResized(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,Nn._mergeSVGProperties(b(this,Vd).getPathResizedSVGProperties(fe(this,OR,e7).call(this)),{bbox:fe(this,wv,vC).call(this)}))}_onTranslating(i,s){var l;(l=this.parent)==null||l.drawLayer.updateProperties(this._drawId,{bbox:fe(this,wv,vC).call(this)})}_onTranslated(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,Nn._mergeSVGProperties(b(this,Vd).getPathTranslatedSVGProperties(fe(this,OR,e7).call(this),this.parentDimensions),{bbox:fe(this,wv,vC).call(this)}))}_onStartDragging(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(i){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,b(this,NR)&&(te(this,NR,!1),this.commit(),this.parent.setSelected(this),i&&this.isOnScreen&&this.div.focus())}remove(){fe(this,XO,JX).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(fe(this,g2,S4).call(this),fe(this,v2,b4).call(this,b(this,Vd).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(i){var l;let s=!1;this.parent&&!i?(this._uiManager.removeShouldRescale(this),fe(this,XO,JX).call(this)):i&&(this._uiManager.addShouldRescale(this),fe(this,g2,S4).call(this,i),s=!this.parent&&((l=this.div)==null?void 0:l.classList.contains("selectedEditor"))),super.setParent(i),s&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Nn._mergeSVGProperties({bbox:fe(this,wv,vC).call(this)},b(this,Vd).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&fe(this,v2,b4).call(this,b(this,Vd).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let i,s;this._isCopy&&(i=this.x,s=this.y);const l=super.render();l.classList.add("draw");const d=document.createElement("div");l.append(d),d.setAttribute("aria-hidden","true"),d.className="internal";const[u,p]=this.parentDimensions;return this.setDims(this.width*u,this.height*p),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(i,s),l}static createDrawerInstance(i,s,l,d,u){ns("Not implemented")}static startDrawing(i,s,l,d){var D;const{target:u,offsetX:p,offsetY:m,pointerId:y,pointerType:_}=d;if(b(Nn,_v)&&b(Nn,_v)!==_)return;const{viewport:{rotation:E}}=i,{width:C,height:x}=u.getBoundingClientRect(),N=te(Nn,f2,new AbortController),O=i.combinedSignal(N);if(b(Nn,yv)||te(Nn,yv,y),b(Nn,_v)??te(Nn,_v,_),window.addEventListener("pointerup",P=>{var j;b(Nn,yv)===P.pointerId?this._endDraw(P):(j=b(Nn,Ev))==null||j.delete(P.pointerId)},{signal:O}),window.addEventListener("pointercancel",P=>{var j;b(Nn,yv)===P.pointerId?this._currentParent.endDrawingSession():(j=b(Nn,Ev))==null||j.delete(P.pointerId)},{signal:O}),window.addEventListener("pointerdown",P=>{b(Nn,_v)===P.pointerType&&((b(Nn,Ev)||te(Nn,Ev,new Set)).add(P.pointerId),b(Nn,go).isCancellable()&&(b(Nn,go).removeLastElement(),b(Nn,go).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:O}),window.addEventListener("contextmenu",fh,{signal:O}),u.addEventListener("pointermove",this._drawMove.bind(this),{signal:O}),u.addEventListener("touchmove",P=>{P.timeStamp===b(Nn,m2)&&Oa(P)},{signal:O}),i.toggleDrawing(),(D=s._editorUndoBar)==null||D.hide(),b(Nn,go)){i.drawLayer.updateProperties(this._currentDrawId,b(Nn,go).startNew(p,m,C,x,E));return}s.updateUIForDefaultProperties(this),te(Nn,go,this.createDrawerInstance(p,m,C,x,E)),te(Nn,p2,this.getDefaultDrawingOptions()),this._currentParent=i,{id:this._currentDrawId}=i.drawLayer.draw(this._mergeSVGProperties(b(Nn,p2).toSVGProperties(),b(Nn,go).defaultSVGProperties),!0,!1)}static _drawMove(i){var u;if(te(Nn,m2,-1),!b(Nn,go))return;const{offsetX:s,offsetY:l,pointerId:d}=i;if(b(Nn,yv)===d){if(((u=b(Nn,Ev))==null?void 0:u.size)>=1){this._endDraw(i);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,b(Nn,go).add(s,l)),te(Nn,m2,i.timeStamp),Oa(i)}}static _cleanup(i){i&&(this._currentDrawId=-1,this._currentParent=null,te(Nn,go,null),te(Nn,p2,null),te(Nn,_v,null),te(Nn,m2,NaN)),b(Nn,f2)&&(b(Nn,f2).abort(),te(Nn,f2,null),te(Nn,yv,NaN),te(Nn,Ev,null))}static _endDraw(i){const s=this._currentParent;if(s){if(s.toggleDrawing(!0),this._cleanup(!1),(i==null?void 0:i.target)===s.div&&s.drawLayer.updateProperties(this._currentDrawId,b(Nn,go).end(i.offsetX,i.offsetY)),this.supportMultipleDrawings){const l=b(Nn,go),d=this._currentDrawId,u=l.getLastElement();s.addCommands({cmd:()=>{s.drawLayer.updateProperties(d,l.setLastElement(u))},undo:()=>{s.drawLayer.updateProperties(d,l.removeLastElement())},mustExec:!1,type:cr.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(i){const s=this._currentParent;if(!s)return null;if(s.toggleDrawing(!0),s.cleanUndoStack(cr.DRAW_STEP),!b(Nn,go).isEmpty()){const{pageDimensions:[l,d],scale:u}=s,p=s.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:b(Nn,go).getOutlines(l*u,d*u,u,this._INNER_MARGIN),drawingOptions:b(Nn,p2),mustBeCommitted:!i});return this._cleanup(!0),p}return s.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(i){}static deserializeDraw(i,s,l,d,u,p){ns("Not implemented")}static async deserialize(i,s,l){var E,C;const{rawDims:{pageWidth:d,pageHeight:u,pageX:p,pageY:m}}=s.viewport,y=this.deserializeDraw(p,m,d,u,this._INNER_MARGIN,i),_=await super.deserialize(i,s,l);return _.createDrawingOptions(i),fe(E=_,qO,YX).call(E,{drawOutlines:y}),fe(C=_,g2,S4).call(C),_.onScaleChanging(),_.rotate(),_}serializeDraw(i){const[s,l]=this.pageTranslation,[d,u]=this.pageDimensions;return b(this,Vd).serialize([s,l,d,u],i)}renderAnnotationElement(i){return i.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Vd=new WeakMap,NR=new WeakMap,go=new WeakMap,f2=new WeakMap,p2=new WeakMap,yv=new WeakMap,_v=new WeakMap,Ev=new WeakMap,m2=new WeakMap,qO=new WeakSet,YX=function({drawOutlines:i,drawId:s,drawingOptions:l}){te(this,Vd,i),this._drawingOptions||(this._drawingOptions=l),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),s>=0?(this._drawId=s,this.parent.drawLayer.finalizeDraw(s,i.defaultProperties)):this._drawId=fe(this,YO,XX).call(this,i,this.parent),fe(this,v2,b4).call(this,i.box)},YO=new WeakSet,XX=function(i,s){const{id:l}=s.drawLayer.draw(Nn._mergeSVGProperties(this._drawingOptions.toSVGProperties(),i.defaultSVGProperties),!1,!1);return l},XO=new WeakSet,JX=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},g2=new WeakSet,S4=function(i=this.parent){if(!(this._drawId!==null&&this.parent===i)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,i.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=fe(this,YO,XX).call(this,b(this,Vd),i)}},Xj=new WeakSet,Hwe=function([i,s,l,d]){const{parentDimensions:[u,p],rotation:m}=this;switch(m){case 90:return[s,1-i,l*(p/u),d*(u/p)];case 180:return[1-i,1-s,l,d];case 270:return[1-s,i,l*(p/u),d*(u/p)];default:return[i,s,l,d]}},OR=new WeakSet,e7=function(){const{x:i,y:s,width:l,height:d,parentDimensions:[u,p],rotation:m}=this;switch(m){case 90:return[1-s,i,l*(u/p),d*(p/u)];case 180:return[1-i,1-s,l,d];case 270:return[s,1-i,l*(u/p),d*(p/u)];default:return[i,s,l,d]}},v2=new WeakSet,b4=function(i){if([this.x,this.y,this.width,this.height]=fe(this,Xj,Hwe).call(this,i),this.div){this.fixAndSetPosition();const[s,l]=this.parentDimensions;this.setDims(this.width*s,this.height*l)}this._onResized()},wv=new WeakSet,vC=function(){const{x:i,y:s,width:l,height:d,rotation:u,parentRotation:p,parentDimensions:[m,y]}=this;switch((u*4+p)/90){case 1:return[1-s-d,i,d,l];case 2:return[1-i-l,1-s-d,l,d];case 3:return[s,1-i-l,d,l];case 4:return[i,s-l*(m/y),d*(y/m),l*(m/y)];case 5:return[1-s,i,l*(m/y),d*(y/m)];case 6:return[1-i-d*(y/m),1-s,d*(y/m),l*(m/y)];case 7:return[s-l*(m/y),1-i-d*(y/m),l*(m/y),d*(y/m)];case 8:return[i-l,s-d,l,d];case 9:return[1-s,i-l,d,l];case 10:return[1-i,1-s,l,d];case 11:return[s-d,1-i,d,l];case 12:return[i-d*(y/m),s,d*(y/m),l*(m/y)];case 13:return[1-s-l*(m/y),i-d*(y/m),l*(m/y),d*(y/m)];case 14:return[1-i,1-s-l*(m/y),d*(y/m),l*(m/y)];case 15:return[s,1-i,l*(m/y),d*(y/m)];default:return[i,s,l,d]}},sn(Nn,"_currentDrawId",-1),sn(Nn,"_currentParent",null),J(Nn,go,null),J(Nn,f2,null),J(Nn,p2,null),J(Nn,yv,NaN),J(Nn,_v,null),J(Nn,Ev,null),J(Nn,m2,NaN),sn(Nn,"_INNER_MARGIN",3);let h9=Nn;var Lp,vo,yo,y2,PR,nc,$o,nh,_2,E2,w2,LR,t7;class Cet{constructor(t,i,s,l,d,u){J(this,LR);J(this,Lp,new Float64Array(6));J(this,vo,void 0);J(this,yo,void 0);J(this,y2,void 0);J(this,PR,void 0);J(this,nc,void 0);J(this,$o,"");J(this,nh,0);J(this,_2,new LP);J(this,E2,void 0);J(this,w2,void 0);te(this,E2,s),te(this,w2,l),te(this,y2,d),te(this,PR,u),[t,i]=fe(this,LR,t7).call(this,t,i);const p=te(this,vo,[NaN,NaN,NaN,NaN,t,i]);te(this,nc,[t,i]),te(this,yo,[{line:p,points:b(this,nc)}]),b(this,Lp).set(p,0)}updateProperty(t,i){t==="stroke-width"&&te(this,PR,i)}isEmpty(){return!b(this,yo)||b(this,yo).length===0}isCancellable(){return b(this,nc).length<=10}add(t,i){[t,i]=fe(this,LR,t7).call(this,t,i);const[s,l,d,u]=b(this,Lp).subarray(2,6),p=t-d,m=i-u;return Math.hypot(b(this,E2)*p,b(this,w2)*m)<=2?null:(b(this,nc).push(t,i),isNaN(s)?(b(this,Lp).set([d,u,t,i],2),b(this,vo).push(NaN,NaN,NaN,NaN,t,i),{path:{d:this.toSVGPath()}}):(isNaN(b(this,Lp)[0])&&b(this,vo).splice(6,6),b(this,Lp).set([s,l,d,u,t,i],0),b(this,vo).push(...xn.createBezierPoints(s,l,d,u,t,i)),{path:{d:this.toSVGPath()}}))}end(t,i){const s=this.add(t,i);return s||(b(this,nc).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,i,s,l,d){te(this,E2,s),te(this,w2,l),te(this,y2,d),[t,i]=fe(this,LR,t7).call(this,t,i);const u=te(this,vo,[NaN,NaN,NaN,NaN,t,i]);te(this,nc,[t,i]);const p=b(this,yo).at(-1);return p&&(p.line=new Float32Array(p.line),p.points=new Float32Array(p.points)),b(this,yo).push({line:u,points:b(this,nc)}),b(this,Lp).set(u,0),te(this,nh,0),this.toSVGPath(),null}getLastElement(){return b(this,yo).at(-1)}setLastElement(t){return b(this,yo)?(b(this,yo).push(t),te(this,vo,t.line),te(this,nc,t.points),te(this,nh,0),{path:{d:this.toSVGPath()}}):b(this,_2).setLastElement(t)}removeLastElement(){if(!b(this,yo))return b(this,_2).removeLastElement();b(this,yo).pop(),te(this,$o,"");for(let t=0,i=b(this,yo).length;t<i;t++){const{line:s,points:l}=b(this,yo)[t];te(this,vo,s),te(this,nc,l),te(this,nh,0),this.toSVGPath()}return{path:{d:b(this,$o)}}}toSVGPath(){const t=xn.svgRound(b(this,vo)[4]),i=xn.svgRound(b(this,vo)[5]);if(b(this,nc).length===2)return te(this,$o,`${b(this,$o)} M ${t} ${i} Z`),b(this,$o);if(b(this,nc).length<=6){const l=b(this,$o).lastIndexOf("M");te(this,$o,`${b(this,$o).slice(0,l)} M ${t} ${i}`),te(this,nh,6)}if(b(this,nc).length===4){const l=xn.svgRound(b(this,vo)[10]),d=xn.svgRound(b(this,vo)[11]);return te(this,$o,`${b(this,$o)} L ${l} ${d}`),te(this,nh,12),b(this,$o)}const s=[];b(this,nh)===0&&(s.push(`M ${t} ${i}`),te(this,nh,6));for(let l=b(this,nh),d=b(this,vo).length;l<d;l+=6){const[u,p,m,y,_,E]=b(this,vo).slice(l,l+6).map(xn.svgRound);s.push(`C${u} ${p} ${m} ${y} ${_} ${E}`)}return te(this,$o,b(this,$o)+s.join(" ")),te(this,nh,b(this,vo).length),b(this,$o)}getOutlines(t,i,s,l){const d=b(this,yo).at(-1);return d.line=new Float32Array(d.line),d.points=new Float32Array(d.points),b(this,_2).build(b(this,yo),t,i,s,b(this,y2),b(this,PR),l),te(this,Lp,null),te(this,vo,null),te(this,yo,null),te(this,$o,null),b(this,_2)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Lp=new WeakMap,vo=new WeakMap,yo=new WeakMap,y2=new WeakMap,PR=new WeakMap,nc=new WeakMap,$o=new WeakMap,nh=new WeakMap,_2=new WeakMap,E2=new WeakMap,w2=new WeakMap,LR=new WeakSet,t7=function(t,i){return xn._normalizePoint(t,i,b(this,E2),b(this,w2),b(this,y2))};var ic,JO,QO,zd,Dp,kp,DR,kR,S2,of,Bm,Jj,Gwe,Qj,Wwe,Zj,$we;class LP extends xn{constructor(){super(...arguments);J(this,of);J(this,Jj);J(this,Qj);J(this,Zj);J(this,ic,void 0);J(this,JO,0);J(this,QO,void 0);J(this,zd,void 0);J(this,Dp,void 0);J(this,kp,void 0);J(this,DR,void 0);J(this,kR,void 0);J(this,S2,void 0)}build(i,s,l,d,u,p,m){te(this,Dp,s),te(this,kp,l),te(this,DR,d),te(this,kR,u),te(this,S2,p),te(this,QO,m??0),te(this,zd,i),fe(this,Qj,Wwe).call(this)}get thickness(){return b(this,S2)}setLastElement(i){return b(this,zd).push(i),{path:{d:this.toSVGPath()}}}removeLastElement(){return b(this,zd).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const i=[];for(const{line:s}of b(this,zd)){if(i.push(`M${xn.svgRound(s[4])} ${xn.svgRound(s[5])}`),s.length===6){i.push("Z");continue}if(s.length===12&&isNaN(s[6])){i.push(`L${xn.svgRound(s[10])} ${xn.svgRound(s[11])}`);continue}for(let l=6,d=s.length;l<d;l+=6){const[u,p,m,y,_,E]=s.subarray(l,l+6).map(xn.svgRound);i.push(`C${u} ${p} ${m} ${y} ${_} ${E}`)}}return i.join("")}serialize([i,s,l,d],u){const p=[],m=[],[y,_,E,C]=fe(this,Jj,Gwe).call(this);let x,N,O,D,P,j,M,V,G;switch(b(this,kR)){case 0:G=xn._rescale,x=i,N=s+d,O=l,D=-d,P=i+y*l,j=s+(1-_-C)*d,M=i+(y+E)*l,V=s+(1-_)*d;break;case 90:G=xn._rescaleAndSwap,x=i,N=s,O=l,D=d,P=i+_*l,j=s+y*d,M=i+(_+C)*l,V=s+(y+E)*d;break;case 180:G=xn._rescale,x=i+l,N=s,O=-l,D=d,P=i+(1-y-E)*l,j=s+_*d,M=i+(1-y)*l,V=s+(_+C)*d;break;case 270:G=xn._rescaleAndSwap,x=i+l,N=s+d,O=-l,D=-d,P=i+(1-_-C)*l,j=s+(1-y-E)*d,M=i+(1-_)*l,V=s+(1-y)*d;break}for(const{line:$,points:ne}of b(this,zd))p.push(G($,x,N,O,D,u?new Array($.length):null)),m.push(G(ne,x,N,O,D,u?new Array(ne.length):null));return{lines:p,points:m,rect:[P,j,M,V]}}static deserialize(i,s,l,d,u,{paths:{lines:p,points:m},rotation:y,thickness:_}){const E=[];let C,x,N,O,D;switch(y){case 0:D=xn._rescale,C=-i/l,x=s/d+1,N=1/l,O=-1/d;break;case 90:D=xn._rescaleAndSwap,C=-s/d,x=-i/l,N=1/d,O=1/l;break;case 180:D=xn._rescale,C=i/l+1,x=-s/d,N=-1/l,O=1/d;break;case 270:D=xn._rescaleAndSwap,C=s/d+1,x=i/l+1,N=-1/d,O=-1/l;break}if(!p){p=[];for(const j of m){const M=j.length;if(M===2){p.push(new Float32Array([NaN,NaN,NaN,NaN,j[0],j[1]]));continue}if(M===4){p.push(new Float32Array([NaN,NaN,NaN,NaN,j[0],j[1],NaN,NaN,NaN,NaN,j[2],j[3]]));continue}const V=new Float32Array(3*(M-2));p.push(V);let[G,$,ne,Y]=j.subarray(0,4);V.set([NaN,NaN,NaN,NaN,G,$],0);for(let le=4;le<M;le+=2){const re=j[le],ee=j[le+1];V.set(xn.createBezierPoints(G,$,ne,Y,re,ee),(le-2)*3),[G,$,ne,Y]=[ne,Y,re,ee]}}}for(let j=0,M=p.length;j<M;j++)E.push({line:D(p[j].map(V=>V??NaN),C,x,N,O),points:D(m[j].map(V=>V??NaN),C,x,N,O)});const P=new this.prototype.constructor;return P.build(E,l,d,1,y,_,u),P}get box(){return b(this,ic)}updateProperty(i,s){return i==="stroke-width"?fe(this,Zj,$we).call(this,s):null}updateParentDimensions([i,s],l){const[d,u]=fe(this,of,Bm).call(this);te(this,Dp,i),te(this,kp,s),te(this,DR,l);const[p,m]=fe(this,of,Bm).call(this),y=p-d,_=m-u,E=b(this,ic);return E[0]-=y,E[1]-=_,E[2]+=2*y,E[3]+=2*_,E}updateRotation(i){return te(this,JO,i),{path:{transform:this.rotationTransform}}}get viewBox(){return b(this,ic).map(xn.svgRound).join(" ")}get defaultProperties(){const[i,s]=b(this,ic);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`}}}get rotationTransform(){const[,,i,s]=b(this,ic);let l=0,d=0,u=0,p=0,m=0,y=0;switch(b(this,JO)){case 90:d=s/i,u=-i/s,m=i;break;case 180:l=-1,p=-1,m=i,y=s;break;case 270:d=-s/i,u=i/s,y=s;break;default:return""}return`matrix(${l} ${d} ${u} ${p} ${xn.svgRound(m)} ${xn.svgRound(y)})`}getPathResizingSVGProperties([i,s,l,d]){const[u,p]=fe(this,of,Bm).call(this),[m,y,_,E]=b(this,ic);if(Math.abs(_-u)<=xn.PRECISION||Math.abs(E-p)<=xn.PRECISION){const D=i+l/2-(m+_/2),P=s+d/2-(y+E/2);return{path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`,transform:`${this.rotationTransform} translate(${D} ${P})`}}}const C=(l-2*u)/(_-2*u),x=(d-2*p)/(E-2*p),N=_/l,O=E/d;return{path:{"transform-origin":`${xn.svgRound(m)} ${xn.svgRound(y)}`,transform:`${this.rotationTransform} scale(${N} ${O}) translate(${xn.svgRound(u)} ${xn.svgRound(p)}) scale(${C} ${x}) translate(${xn.svgRound(-u)} ${xn.svgRound(-p)})`}}}getPathResizedSVGProperties([i,s,l,d]){const[u,p]=fe(this,of,Bm).call(this),m=b(this,ic),[y,_,E,C]=m;if(m[0]=i,m[1]=s,m[2]=l,m[3]=d,Math.abs(E-u)<=xn.PRECISION||Math.abs(C-p)<=xn.PRECISION){const P=i+l/2-(y+E/2),j=s+d/2-(_+C/2);for(const{line:M,points:V}of b(this,zd))xn._translate(M,P,j,M),xn._translate(V,P,j,V);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const x=(l-2*u)/(E-2*u),N=(d-2*p)/(C-2*p),O=-x*(y+u)+i+u,D=-N*(_+p)+s+p;if(x!==1||N!==1||O!==0||D!==0)for(const{line:P,points:j}of b(this,zd))xn._rescale(P,O,D,x,N,P),xn._rescale(j,O,D,x,N,j);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([i,s],l){const[d,u]=l,p=b(this,ic),m=i-p[0],y=s-p[1];if(b(this,Dp)===d&&b(this,kp)===u)for(const{line:_,points:E}of b(this,zd))xn._translate(_,m,y,_),xn._translate(E,m,y,E);else{const _=b(this,Dp)/d,E=b(this,kp)/u;te(this,Dp,d),te(this,kp,u);for(const{line:C,points:x}of b(this,zd))xn._rescale(C,m,y,_,E,C),xn._rescale(x,m,y,_,E,x);p[2]*=_,p[3]*=E}return p[0]=i,p[1]=s,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`}}}get defaultSVGProperties(){const i=b(this,ic);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${xn.svgRound(i[0])} ${xn.svgRound(i[1])}`,transform:this.rotationTransform||null},bbox:i}}}ic=new WeakMap,JO=new WeakMap,QO=new WeakMap,zd=new WeakMap,Dp=new WeakMap,kp=new WeakMap,DR=new WeakMap,kR=new WeakMap,S2=new WeakMap,of=new WeakSet,Bm=function(i=b(this,S2)){const s=b(this,QO)+i/2*b(this,DR);return b(this,kR)%180===0?[s/b(this,Dp),s/b(this,kp)]:[s/b(this,kp),s/b(this,Dp)]},Jj=new WeakSet,Gwe=function(){const[i,s,l,d]=b(this,ic),[u,p]=fe(this,of,Bm).call(this,0);return[i+u,s+p,l-2*u,d-2*p]},Qj=new WeakSet,Wwe=function(){const i=te(this,ic,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:d}of b(this,zd)){if(d.length<=12){for(let m=4,y=d.length;m<y;m+=6)In.pointBoundingBox(d[m],d[m+1],i);continue}let u=d[4],p=d[5];for(let m=6,y=d.length;m<y;m+=6){const[_,E,C,x,N,O]=d.subarray(m,m+6);In.bezierBoundingBox(u,p,_,E,C,x,N,O,i),u=N,p=O}}const[s,l]=fe(this,of,Bm).call(this);i[0]=ac(i[0]-s,0,1),i[1]=ac(i[1]-l,0,1),i[2]=ac(i[2]+s,0,1),i[3]=ac(i[3]+l,0,1),i[2]-=i[0],i[3]-=i[1]},Zj=new WeakSet,$we=function(i){const[s,l]=fe(this,of,Bm).call(this);te(this,S2,i);const[d,u]=fe(this,of,Bm).call(this),[p,m]=[d-s,u-l],y=b(this,ic);return y[0]-=p,y[1]-=m,y[2]+=2*p,y[3]+=2*m,y};class AF extends zwe{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:fs._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,i){t==="stroke-width"&&(i??(i=this["stroke-width"]),i*=this._viewParameters.realScale),super.updateSVGProperty(t,i)}clone(){const t=new AF(this._viewParameters);return t.updateAll(this),t}}var eU,Kwe;const MC=class MC extends h9{constructor(i){super({...i,name:"inkEditor"});J(this,eU);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(i,s){fs.initialize(i,s),this._defaultDrawingOptions=new AF(s.viewParameters)}static getDefaultDrawingOptions(i){const s=this._defaultDrawingOptions.clone();return s.updateProperties(i),s}static get supportMultipleDrawings(){return!0}static get typesMap(){return Ki(this,"typesMap",new Map([[cr.INK_THICKNESS,"stroke-width"],[cr.INK_COLOR,"stroke"],[cr.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(i,s,l,d,u){return new Cet(i,s,l,d,u,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(i,s,l,d,u,p){return LP.deserialize(i,s,l,d,u,p)}static async deserialize(i,s,l){let d=null;if(i instanceof GZ){const{data:{inkLists:p,rect:m,rotation:y,id:_,color:E,opacity:C,borderStyle:{rawWidth:x},popupRef:N,contentsObj:O},parent:{page:{pageNumber:D}}}=i;d=i={annotationType:fi.INK,color:Array.from(E),thickness:x,opacity:C,paths:{points:p},boxes:null,pageIndex:D-1,rect:m.slice(0),rotation:y,annotationElementId:_,id:_,deleted:!1,popupRef:N,comment:(O==null?void 0:O.str)||null}}const u=await super.deserialize(i,s,l);return u._initialData=d,i.comment&&u.setCommentData(i.comment),u}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new l9(this)),[["colorPicker",this._colorPicker]]}get colorType(){return cr.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:i,_drawingOptions:s,parent:l}=this;s.updateSVGProperty("stroke-width"),l.drawLayer.updateProperties(i,s.toSVGProperties())}static onScaleChangingWhenDrawing(){const i=this._currentParent;i&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:i,thickness:s,opacity:l}){this._drawingOptions=MC.getDefaultDrawingOptions({stroke:In.makeHexColor(...i),"stroke-width":s,"stroke-opacity":l})}serialize(i=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:s,points:l,rect:d}=this.serializeDraw(i),{_drawingOptions:{stroke:u,"stroke-opacity":p,"stroke-width":m}}=this,y={annotationType:fi.INK,color:fs._colorManager.convert(u),opacity:p,thickness:m,paths:{lines:s,points:l},pageIndex:this.pageIndex,rect:d,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(y),i?(y.isCopy=!0,y):this.annotationElementId&&!fe(this,eU,Kwe).call(this,y)?null:(y.id=this.annotationElementId,y)}renderAnnotationElement(i){if(this.deleted)return i.hide(),null;const{points:s,rect:l}=this.serializeDraw(!1),d={rect:l,thickness:this._drawingOptions["stroke-width"],points:s};return this.hasEditedComment&&(d.popup=this.comment),i.updateEdited(d),null}};eU=new WeakSet,Kwe=function(i){const{color:s,thickness:l,opacity:d,pageIndex:u}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||i.color.some((p,m)=>p!==s[m])||i.thickness!==l||i.opacity!==d||i.pageIndex!==u},sn(MC,"_type","ink"),sn(MC,"_editorType",fi.INK),sn(MC,"_defaultDrawingOptions",null);let QX=MC;class ZX extends LP{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}const aM=8,W3=3;var b2,ZO,eJ,lf,tU,qwe,nU,Ywe,eP,tJ,MR,n7,iU,Xwe,rU,Jwe,sU,Qwe,tP,nJ,nP,iJ,aU,Zwe;class qa{static extractContoursFromText(t,{fontFamily:i,fontStyle:s,fontWeight:l},d,u,p,m){let y=new OffscreenCanvas(1,1),_=y.getContext("2d",{alpha:!1});const E=200,C=_.font=`${s} ${l} ${E}px ${i}`,{actualBoundingBoxLeft:x,actualBoundingBoxRight:N,actualBoundingBoxAscent:O,actualBoundingBoxDescent:D,fontBoundingBoxAscent:P,fontBoundingBoxDescent:j,width:M}=_.measureText(t),V=1.5,G=Math.ceil(Math.max(Math.abs(x)+Math.abs(N)||0,M)*V),$=Math.ceil(Math.max(Math.abs(O)+Math.abs(D)||E,Math.abs(P)+Math.abs(j)||E)*V);y=new OffscreenCanvas(G,$),_=y.getContext("2d",{alpha:!0,willReadFrequently:!0}),_.font=C,_.filter="grayscale(1)",_.fillStyle="white",_.fillRect(0,0,G,$),_.fillStyle="black",_.fillText(t,G*(V-1)/2,$*(3-V)/2);const ne=fe(this,tP,nJ).call(this,_.getImageData(0,0,G,$).data),Y=fe(this,sU,Qwe).call(this,ne),le=fe(this,nP,iJ).call(this,Y),re=fe(this,eP,tJ).call(this,ne,G,$,le);return this.processDrawnLines({lines:{curves:re,width:G,height:$},pageWidth:d,pageHeight:u,rotation:p,innerMargin:m,mustSmooth:!0,areContours:!0})}static process(t,i,s,l,d){const[u,p,m]=fe(this,aU,Zwe).call(this,t),[y,_]=fe(this,rU,Jwe).call(this,u,p,m,Math.hypot(p,m)*b(this,b2).sigmaSFactor,b(this,b2).sigmaR,b(this,b2).kernelSize),E=fe(this,nP,iJ).call(this,_),C=fe(this,eP,tJ).call(this,y,p,m,E);return this.processDrawnLines({lines:{curves:C,width:p,height:m},pageWidth:i,pageHeight:s,rotation:l,innerMargin:d,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:i,pageHeight:s,rotation:l,innerMargin:d,mustSmooth:u,areContours:p}){l%180!==0&&([i,s]=[s,i]);const{curves:m,width:y,height:_}=t,E=t.thickness??0,C=[],x=Math.min(i/y,s/_),N=x/i,O=x/s,D=[];for(const{points:j}of m){const M=u?fe(this,iU,Xwe).call(this,j):j;if(!M)continue;D.push(M);const V=M.length,G=new Float32Array(V),$=new Float32Array(3*(V===2?2:V-2));if(C.push({line:$,points:G}),V===2){G[0]=M[0]*N,G[1]=M[1]*O,$.set([NaN,NaN,NaN,NaN,G[0],G[1]],0);continue}let[ne,Y,le,re]=M;ne*=N,Y*=O,le*=N,re*=O,G.set([ne,Y,le,re],0),$.set([NaN,NaN,NaN,NaN,ne,Y],0);for(let ee=4;ee<V;ee+=2){const de=G[ee]=M[ee]*N,H=G[ee+1]=M[ee+1]*O;$.set(xn.createBezierPoints(ne,Y,le,re,de,H),(ee-2)*3),[ne,Y,le,re]=[le,re,de,H]}}if(C.length===0)return null;const P=p?new ZX:new LP;return P.build(C,i,s,1,l,p?0:E,d),{outline:P,newCurves:D,areContours:p,thickness:E,width:y,height:_}}static async compressSignature({outlines:t,areContours:i,thickness:s,width:l,height:d}){let u=1/0,p=-1/0,m=0;for(const M of t){m+=M.length;for(let V=2,G=M.length;V<G;V++){const $=M[V]-M[V-2];u=Math.min(u,$),p=Math.max(p,$)}}let y;u>=-128&&p<=127?y=Int8Array:u>=-32768&&p<=32767?y=Int16Array:y=Int32Array;const _=t.length,E=aM+W3*_,C=new Uint32Array(E);let x=0;C[x++]=E*Uint32Array.BYTES_PER_ELEMENT+(m-2*_)*y.BYTES_PER_ELEMENT,C[x++]=0,C[x++]=l,C[x++]=d,C[x++]=i?0:1,C[x++]=Math.max(0,Math.floor(s??0)),C[x++]=_,C[x++]=y.BYTES_PER_ELEMENT;for(const M of t)C[x++]=M.length-2,C[x++]=M[0],C[x++]=M[1];const N=new CompressionStream("deflate-raw"),O=N.writable.getWriter();await O.ready,O.write(C);const D=y.prototype.constructor;for(const M of t){const V=new D(M.length-2);for(let G=2,$=M.length;G<$;G++)V[G-2]=M[G]-M[G-2];O.write(V)}O.close();const P=await new Response(N.readable).arrayBuffer(),j=new Uint8Array(P);return QEe(j)}static async decompressSignature(t){try{const i=GQe(t),{readable:s,writable:l}=new DecompressionStream("deflate-raw"),d=l.getWriter();await d.ready,d.write(i).then(async()=>{await d.ready,await d.close()}).catch(()=>{});let u=null,p=0;for await(const M of s)u||(u=new Uint8Array(new Uint32Array(M.buffer,0,4)[0])),u.set(M,p),p+=M.length;const m=new Uint32Array(u.buffer,0,u.length>>2),y=m[1];if(y!==0)throw new Error(`Invalid version: ${y}`);const _=m[2],E=m[3],C=m[4]===0,x=m[5],N=m[6],O=m[7],D=[],P=(aM+W3*N)*Uint32Array.BYTES_PER_ELEMENT;let j;switch(O){case Int8Array.BYTES_PER_ELEMENT:j=new Int8Array(u.buffer,P);break;case Int16Array.BYTES_PER_ELEMENT:j=new Int16Array(u.buffer,P);break;case Int32Array.BYTES_PER_ELEMENT:j=new Int32Array(u.buffer,P);break}p=0;for(let M=0;M<N;M++){const V=m[W3*M+aM],G=new Float32Array(V+2);D.push(G);for(let $=0;$<W3-1;$++)G[$]=m[W3*M+aM+$+1];for(let $=0;$<V;$++)G[$+2]=G[$]+j[p++]}return{areContours:C,thickness:x,outlines:D,width:_,height:E}}catch(i){return Ei(`decompressSignature: ${i}`),null}}}b2=new WeakMap,ZO=new WeakSet,eJ=function(t,i,s,l){return s-=t,l-=i,s===0?l>0?0:4:s===1?l+6:2-l},lf=new WeakMap,tU=new WeakSet,qwe=function(t,i,s,l,d,u,p){const m=fe(this,ZO,eJ).call(this,s,l,d,u);for(let y=0;y<8;y++){const _=(-y+m-p+16)%8,E=b(this,lf)[2*_],C=b(this,lf)[2*_+1];if(t[(s+E)*i+(l+C)]!==0)return _}return-1},nU=new WeakSet,Ywe=function(t,i,s,l,d,u,p){const m=fe(this,ZO,eJ).call(this,s,l,d,u);for(let y=0;y<8;y++){const _=(y+m+p+16)%8,E=b(this,lf)[2*_],C=b(this,lf)[2*_+1];if(t[(s+E)*i+(l+C)]!==0)return _}return-1},eP=new WeakSet,tJ=function(t,i,s,l){const d=t.length,u=new Int32Array(d);for(let _=0;_<d;_++)u[_]=t[_]<=l?1:0;for(let _=1;_<s-1;_++)u[_*i]=u[_*i+i-1]=0;for(let _=0;_<i;_++)u[_]=u[i*s-1-_]=0;let p=1,m;const y=[];for(let _=1;_<s-1;_++){m=1;for(let E=1;E<i-1;E++){const C=_*i+E,x=u[C];if(x===0)continue;let N=_,O=E;if(x===1&&u[C-1]===0)p+=1,O-=1;else if(x>=1&&u[C+1]===0)p+=1,O+=1,x>1&&(m=x);else{x!==1&&(m=Math.abs(x));continue}const D=[E,_],P=O===E+1,j={isHole:P,points:D,id:p,parent:0};y.push(j);let M;for(const ee of y)if(ee.id===m){M=ee;break}M?M.isHole?j.parent=P?M.parent:m:j.parent=P?m:M.parent:j.parent=P?m:0;const V=fe(this,tU,qwe).call(this,u,i,_,E,N,O,0);if(V===-1){u[C]=-p,u[C]!==1&&(m=Math.abs(u[C]));continue}let G=b(this,lf)[2*V],$=b(this,lf)[2*V+1];const ne=_+G,Y=E+$;N=ne,O=Y;let le=_,re=E;for(;;){const ee=fe(this,nU,Ywe).call(this,u,i,le,re,N,O,1);G=b(this,lf)[2*ee],$=b(this,lf)[2*ee+1];const de=le+G,H=re+$;D.push(H,de);const ae=le*i+re;if(u[ae+1]===0?u[ae]=-p:u[ae]===1&&(u[ae]=p),de===_&&H===E&&le===ne&&re===Y){u[C]!==1&&(m=Math.abs(u[C]));break}else N=le,O=re,le=de,re=H}}}return y},MR=new WeakSet,n7=function(t,i,s,l){if(s-i<=4){for(let ne=i;ne<s-2;ne+=2)l.push(t[ne],t[ne+1]);return}const d=t[i],u=t[i+1],p=t[s-4]-d,m=t[s-3]-u,y=Math.hypot(p,m),_=p/y,E=m/y,C=_*u-E*d,x=m/p,N=1/y,O=Math.atan(x),D=Math.cos(O),P=Math.sin(O),j=N*(Math.abs(D)+Math.abs(P)),M=N*(1-j+j**2),V=Math.max(Math.atan(Math.abs(P+D)*M),Math.atan(Math.abs(P-D)*M));let G=0,$=i;for(let ne=i+2;ne<s-2;ne+=2){const Y=Math.abs(C-_*t[ne+1]+E*t[ne]);Y>G&&($=ne,G=Y)}G>(y*V)**2?(fe(this,MR,n7).call(this,t,i,$+2,l),fe(this,MR,n7).call(this,t,$,s,l)):l.push(d,u)},iU=new WeakSet,Xwe=function(t){const i=[],s=t.length;return fe(this,MR,n7).call(this,t,0,s,i),i.push(t[s-2],t[s-1]),i.length<=4?null:i},rU=new WeakSet,Jwe=function(t,i,s,l,d,u){const p=new Float32Array(u**2),m=-2*l**2,y=u>>1;for(let O=0;O<u;O++){const D=(O-y)**2;for(let P=0;P<u;P++)p[O*u+P]=Math.exp((D+(P-y)**2)/m)}const _=new Float32Array(256),E=-2*d**2;for(let O=0;O<256;O++)_[O]=Math.exp(O**2/E);const C=t.length,x=new Uint8Array(C),N=new Uint32Array(256);for(let O=0;O<s;O++)for(let D=0;D<i;D++){const P=O*i+D,j=t[P];let M=0,V=0;for(let $=0;$<u;$++){const ne=O+$-y;if(!(ne<0||ne>=s))for(let Y=0;Y<u;Y++){const le=D+Y-y;if(le<0||le>=i)continue;const re=t[ne*i+le],ee=p[$*u+Y]*_[Math.abs(re-j)];M+=re*ee,V+=ee}}const G=x[P]=Math.round(M/V);N[G]++}return[x,N]},sU=new WeakSet,Qwe=function(t){const i=new Uint32Array(256);for(const s of t)i[s]++;return i},tP=new WeakSet,nJ=function(t){const i=t.length,s=new Uint8ClampedArray(i>>2);let l=-1/0,d=1/0;for(let p=0,m=s.length;p<m;p++){const y=s[p]=t[p<<2];l=Math.max(l,y),d=Math.min(d,y)}const u=255/(l-d);for(let p=0,m=s.length;p<m;p++)s[p]=(s[p]-d)*u;return s},nP=new WeakSet,iJ=function(t){let i,s=-1/0,l=-1/0;const d=t.findIndex(m=>m!==0);let u=d,p=d;for(i=d;i<256;i++){const m=t[i];m>s&&(i-u>l&&(l=i-u,p=i-1),s=m,u=i)}for(i=p-1;i>=0&&!(t[i]>t[i+1]);i--);return i},aU=new WeakSet,Zwe=function(t){const i=t,{width:s,height:l}=t,{maxDim:d}=b(this,b2);let u=s,p=l;if(s>d||l>d){let C=s,x=l,N=Math.log2(Math.max(s,l)/d);const O=Math.floor(N);N=N===O?O-1:O;for(let P=0;P<N;P++){u=Math.ceil(C/2),p=Math.ceil(x/2);const j=new OffscreenCanvas(u,p);j.getContext("2d").drawImage(t,0,0,C,x,0,0,u,p),C=u,x=p,t!==i&&t.close(),t=j.transferToImageBitmap()}const D=Math.min(d/u,d/p);u=Math.round(u*D),p=Math.round(p*D)}const y=new OffscreenCanvas(u,p).getContext("2d",{willReadFrequently:!0});y.fillStyle="white",y.fillRect(0,0,u,p),y.filter="grayscale(1)",y.drawImage(t,0,0,t.width,t.height,0,0,u,p);const _=y.getImageData(0,0,u,p).data;return[fe(this,tP,nJ).call(this,_),u,p]},J(qa,ZO),J(qa,tU),J(qa,nU),J(qa,eP),J(qa,MR),J(qa,iU),J(qa,rU),J(qa,sU),J(qa,tP),J(qa,nP),J(qa,aU),J(qa,b2,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),J(qa,lf,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class WZ extends zwe{constructor(){super(),super.updateProperties({fill:fs._defaultLineColor,"stroke-width":0})}clone(){const t=new WZ;return t.updateAll(this),t}}class $Z extends AF{constructor(t){super(t),super.updateProperties({stroke:fs._defaultLineColor,"stroke-width":1})}clone(){const t=new $Z(this._viewParameters);return t.updateAll(this),t}}var Sv,Mp,bv,C2;const xd=class xd extends h9{constructor(i){super({...i,mustBeCommitted:!0,name:"signatureEditor"});J(this,Sv,!1);J(this,Mp,null);J(this,bv,null);J(this,C2,null);this._willKeepAspectRatio=!0,te(this,bv,i.signatureData||null),te(this,Mp,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(i,s){fs.initialize(i,s),this._defaultDrawingOptions=new WZ,this._defaultDrawnSignatureOptions=new $Z(s.viewParameters)}static getDefaultDrawingOptions(i){const s=this._defaultDrawingOptions.clone();return s.updateProperties(i),s}static get supportMultipleDrawings(){return!1}static get typesMap(){return Ki(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!b(this,Mp)}}static computeTelemetryFinalData(i){const s=i.get("hasDescription");return{hasAltText:s.get(!0)??0,hasNoAltText:s.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let i,s;const{_isCopy:l}=this;if(l&&(this._isCopy=!1,i=this.x,s=this.y),super.render(),this._drawId===null)if(b(this,bv)){const{lines:d,mustSmooth:u,areContours:p,description:m,uuid:y,heightInPage:_}=b(this,bv),{rawDims:{pageWidth:E,pageHeight:C},rotation:x}=this.parent.viewport,N=qa.processDrawnLines({lines:d,pageWidth:E,pageHeight:C,rotation:x,innerMargin:xd._INNER_MARGIN,mustSmooth:u,areContours:p});this.addSignature(N,_,m,y)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:b(this,Mp)||""}));return l&&(this._isCopy=!0,this._moveAfterPaste(i,s)),this.div}setUuid(i){te(this,C2,i),this.addEditToolbar()}getUuid(){return b(this,C2)}get description(){return b(this,Mp)}set description(i){te(this,Mp,i),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:i})),super.addEditToolbar().then(s=>{s==null||s.updateEditSignatureButton(i)}))}getSignaturePreview(){const{newCurves:i,areContours:s,thickness:l,width:d,height:u}=b(this,bv),p=Math.max(d,u),m=qa.processDrawnLines({lines:{curves:i.map(y=>({points:y})),thickness:l,width:d,height:u},pageWidth:p,pageHeight:p,rotation:0,innerMargin:0,mustSmooth:!1,areContours:s});return{areContours:s,outline:m.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(i,s,l,d){const{x:u,y:p}=this,{outline:m}=te(this,bv,i);te(this,Sv,m instanceof ZX),this.description=l;let y;b(this,Sv)?y=xd.getDefaultDrawingOptions():(y=xd._defaultDrawnSignatureOptions.clone(),y.updateProperties({"stroke-width":m.thickness})),this._addOutlines({drawOutlines:m,drawingOptions:y});const[_,E]=this.parentDimensions,[,C]=this.pageDimensions;let x=s/C;x=x>=1?.5:x,this.width*=x/this.height,this.width>=1&&(x*=.9/this.width,this.width=.9),this.height=x,this.setDims(_*this.width,E*this.height),this.x=u,this.y=p,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(d),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!d,hasDescription:!!l}}),this.div.hidden=!1}getFromImage(i){const{rawDims:{pageWidth:s,pageHeight:l},rotation:d}=this.parent.viewport;return qa.process(i,s,l,d,xd._INNER_MARGIN)}getFromText(i,s){const{rawDims:{pageWidth:l,pageHeight:d},rotation:u}=this.parent.viewport;return qa.extractContoursFromText(i,s,l,d,u,xd._INNER_MARGIN)}getDrawnSignature(i){const{rawDims:{pageWidth:s,pageHeight:l},rotation:d}=this.parent.viewport;return qa.processDrawnLines({lines:i,pageWidth:s,pageHeight:l,rotation:d,innerMargin:xd._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:i,thickness:s}){i?this._drawingOptions=xd.getDefaultDrawingOptions():(this._drawingOptions=xd._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":s}))}serialize(i=!1){if(this.isEmpty())return null;const{lines:s,points:l,rect:d}=this.serializeDraw(i),{_drawingOptions:{"stroke-width":u}}=this,p={annotationType:fi.SIGNATURE,isSignature:!0,areContours:b(this,Sv),color:[0,0,0],thickness:b(this,Sv)?0:u,pageIndex:this.pageIndex,rect:d,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(p),i?(p.paths={lines:s,points:l},p.uuid=b(this,C2),p.isCopy=!0):p.lines=s,b(this,Mp)&&(p.accessibilityData={type:"Figure",alt:b(this,Mp)}),p}static deserializeDraw(i,s,l,d,u,p){return p.areContours?ZX.deserialize(i,s,l,d,u,p):LP.deserialize(i,s,l,d,u,p)}static async deserialize(i,s,l){var u;const d=await super.deserialize(i,s,l);return te(d,Sv,i.areContours),d.description=((u=i.accessibilityData)==null?void 0:u.alt)||"",te(d,C2,i.uuid),d}};Sv=new WeakMap,Mp=new WeakMap,bv=new WeakMap,C2=new WeakMap,sn(xd,"_type","signature"),sn(xd,"_editorType",fi.SIGNATURE),sn(xd,"_defaultDrawingOptions",null);let rJ=xd;var ks,_o,Cv,Ng,Tv,jR,Og,T2,jp,Hd,UR,R2,C4,x2,T4,FR,i7,BR,r7,VR,s7,iP,aJ,zR,a7,oU,eSe;class sJ extends fs{constructor(i){super({...i,name:"stampEditor"});J(this,R2);J(this,x2);J(this,FR);J(this,BR);J(this,VR);J(this,iP);J(this,zR);J(this,oU);J(this,ks,null);J(this,_o,null);J(this,Cv,null);J(this,Ng,null);J(this,Tv,null);J(this,jR,"");J(this,Og,null);J(this,T2,!1);J(this,jp,null);J(this,Hd,!1);J(this,UR,!1);te(this,Ng,i.bitmapUrl),te(this,Tv,i.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(i,s){fs.initialize(i,s)}static isHandlingMimeForPasting(i){return JY.includes(i)}static paste(i,s){s.pasteEditor({mode:fi.STAMP},{bitmapFile:i.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var i;return{type:"stamp",hasAltText:!!((i=this.altTextData)!=null&&i.altText)}}static computeTelemetryFinalData(i){const s=i.get("hasAltText");return{hasAltText:s.get(!0)??0,hasNoAltText:s.get(!1)??0}}async mlGuessAltText(i=null,s=!0){if(this.hasAltTextData())return null;const{mlManager:l}=this._uiManager;if(!l)throw new Error("No ML.");if(!await l.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:d,width:u,height:p}=i||this.copyCanvas(null,null,!0).imageData,m=await l.guess({name:"altText",request:{data:d,width:u,height:p,channels:d.length/(u*p)}});if(!m)throw new Error("No response from the AI service.");if(m.error)throw new Error("Error from the AI service.");if(m.cancel)return null;if(!m.output)throw new Error("No valid response from the AI service.");const y=m.output;return await this.setGuessedAltText(y),s&&!this.hasAltTextData()&&(this.altTextData={alt:y,decorative:!1}),y}remove(){var i;b(this,_o)&&(te(this,ks,null),this._uiManager.imageManager.deleteId(b(this,_o)),(i=b(this,Og))==null||i.remove(),te(this,Og,null),b(this,jp)&&(clearTimeout(b(this,jp)),te(this,jp,null))),super.remove()}rebuild(){if(!this.parent){b(this,_o)&&fe(this,FR,i7).call(this);return}super.rebuild(),this.div!==null&&(b(this,_o)&&b(this,Og)===null&&fe(this,FR,i7).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(i){this._isDraggable=!0,i&&this.div.focus()}isEmpty(){return!(b(this,Cv)||b(this,ks)||b(this,Ng)||b(this,Tv)||b(this,_o)||b(this,T2))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let i,s;return this._isCopy&&(i=this.x,s=this.y),super.render(),this.div.hidden=!0,this.createAltText(),b(this,T2)||(b(this,ks)?fe(this,BR,r7).call(this):fe(this,FR,i7).call(this)),this._isCopy&&this._moveAfterPaste(i,s),this._uiManager.addShouldRescale(this),this.div}setCanvas(i,s){const{id:l,bitmap:d}=this._uiManager.imageManager.getFromCanvas(i,s);s.remove(),l&&this._uiManager.imageManager.isValidId(l)&&(te(this,_o,l),d&&te(this,ks,d),te(this,T2,!1),fe(this,BR,r7).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;b(this,jp)!==null&&clearTimeout(b(this,jp)),te(this,jp,setTimeout(()=>{te(this,jp,null),fe(this,iP,aJ).call(this)},200))}copyCanvas(i,s,l=!1){var x;i||(i=224);const{width:d,height:u}=b(this,ks),p=new Kp;let m=b(this,ks),y=d,_=u,E=null;if(s){if(d>s||u>s){const Y=Math.min(s/d,s/u);y=Math.floor(d*Y),_=Math.floor(u*Y)}E=document.createElement("canvas");const N=E.width=Math.ceil(y*p.sx),O=E.height=Math.ceil(_*p.sy);b(this,Hd)||(m=fe(this,VR,s7).call(this,N,O));const D=E.getContext("2d");D.filter=this._uiManager.hcmFilter;let P="white",j="#cfcfd8";this._uiManager.hcmFilter!=="none"?j="black":(x=window.matchMedia)!=null&&x.call(window,"(prefers-color-scheme: dark)").matches&&(P="#8f8f9d",j="#42414d");const M=15,V=M*p.sx,G=M*p.sy,$=new OffscreenCanvas(V*2,G*2),ne=$.getContext("2d");ne.fillStyle=P,ne.fillRect(0,0,V*2,G*2),ne.fillStyle=j,ne.fillRect(0,0,V,G),ne.fillRect(V,G,V,G),D.fillStyle=D.createPattern($,"repeat"),D.fillRect(0,0,N,O),D.drawImage(m,0,0,m.width,m.height,0,0,N,O)}let C=null;if(l){let N,O;if(p.symmetric&&m.width<i&&m.height<i)N=m.width,O=m.height;else if(m=b(this,ks),d>i||u>i){const j=Math.min(i/d,i/u);N=Math.floor(d*j),O=Math.floor(u*j),b(this,Hd)||(m=fe(this,VR,s7).call(this,N,O))}const P=new OffscreenCanvas(N,O).getContext("2d",{willReadFrequently:!0});P.drawImage(m,0,0,m.width,m.height,0,0,N,O),C={width:N,height:O,data:P.getImageData(0,0,N,O).data}}return{canvas:E,width:y,height:_,imageData:C}}static async deserialize(i,s,l){var D;let d=null,u=!1;if(i instanceof gwe){const{data:{rect:P,rotation:j,id:M,structParent:V,popupRef:G,contentsObj:$},container:ne,parent:{page:{pageNumber:Y}},canvas:le}=i;let re,ee;le?(delete i.canvas,{id:re,bitmap:ee}=l.imageManager.getFromCanvas(ne.id,le),le.remove()):(u=!0,i._hasNoCanvas=!0);const de=((D=await s._structTree.getAriaAttributes(`${jZ}${M}`))==null?void 0:D.get("aria-label"))||"";d=i={annotationType:fi.STAMP,bitmapId:re,bitmap:ee,pageIndex:Y-1,rect:P.slice(0),rotation:j,annotationElementId:M,id:M,deleted:!1,accessibilityData:{decorative:!1,altText:de},isSvg:!1,structParent:V,popupRef:G,comment:($==null?void 0:$.str)||null}}const p=await super.deserialize(i,s,l),{rect:m,bitmap:y,bitmapUrl:_,bitmapId:E,isSvg:C,accessibilityData:x}=i;u?(l.addMissingCanvas(i.id,p),te(p,T2,!0)):E&&l.imageManager.isValidId(E)?(te(p,_o,E),y&&te(p,ks,y)):te(p,Ng,_),te(p,Hd,C);const[N,O]=p.pageDimensions;return p.width=(m[2]-m[0])/N,p.height=(m[3]-m[1])/O,x&&(p.altTextData=x),p._initialData=d,i.comment&&p.setCommentData(i.comment),te(p,UR,!!d),p}serialize(i=!1,s=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const l={annotationType:fi.STAMP,bitmapId:b(this,_o),pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,isSvg:b(this,Hd),structTreeParentId:this._structTreeParentId};if(this.addComment(l),i)return l.bitmapUrl=fe(this,zR,a7).call(this,!0),l.accessibilityData=this.serializeAltText(!0),l.isCopy=!0,l;const{decorative:d,altText:u}=this.serializeAltText(!1);if(!d&&u&&(l.accessibilityData={type:"Figure",alt:u}),this.annotationElementId){const m=fe(this,oU,eSe).call(this,l);if(m.isSame)return null;m.isSameAltText?delete l.accessibilityData:l.accessibilityData.structParent=this._initialData.structParent??-1}if(l.id=this.annotationElementId,s===null)return l;s.stamps||(s.stamps=new Map);const p=b(this,Hd)?(l.rect[2]-l.rect[0])*(l.rect[3]-l.rect[1]):null;if(!s.stamps.has(b(this,_o)))s.stamps.set(b(this,_o),{area:p,serialized:l}),l.bitmap=fe(this,zR,a7).call(this,!1);else if(b(this,Hd)){const m=s.stamps.get(b(this,_o));p>m.area&&(m.area=p,m.serialized.bitmap.close(),m.serialized.bitmap=fe(this,zR,a7).call(this,!1))}return l}renderAnnotationElement(i){if(this.deleted)return i.hide(),null;const s={rect:this.getPDFRect()};return this.hasEditedComment&&(s.popup=this.comment),i.updateEdited(s),null}}ks=new WeakMap,_o=new WeakMap,Cv=new WeakMap,Ng=new WeakMap,Tv=new WeakMap,jR=new WeakMap,Og=new WeakMap,T2=new WeakMap,jp=new WeakMap,Hd=new WeakMap,UR=new WeakMap,R2=new WeakSet,C4=function(i,s=!1){if(!i){this.remove();return}te(this,ks,i.bitmap),s||(te(this,_o,i.id),te(this,Hd,i.isSvg)),i.file&&te(this,jR,i.file.name),fe(this,BR,r7).call(this)},x2=new WeakSet,T4=function(){if(te(this,Cv,null),this._uiManager.enableWaiting(!1),!!b(this,Og)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&b(this,ks)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&b(this,ks)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},FR=new WeakSet,i7=function(){if(b(this,_o)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(b(this,_o)).then(l=>fe(this,R2,C4).call(this,l,!0)).finally(()=>fe(this,x2,T4).call(this));return}if(b(this,Ng)){const l=b(this,Ng);te(this,Ng,null),this._uiManager.enableWaiting(!0),te(this,Cv,this._uiManager.imageManager.getFromUrl(l).then(d=>fe(this,R2,C4).call(this,d)).finally(()=>fe(this,x2,T4).call(this)));return}if(b(this,Tv)){const l=b(this,Tv);te(this,Tv,null),this._uiManager.enableWaiting(!0),te(this,Cv,this._uiManager.imageManager.getFromFile(l).then(d=>fe(this,R2,C4).call(this,d)).finally(()=>fe(this,x2,T4).call(this)));return}const i=document.createElement("input");i.type="file",i.accept=JY.join(",");const s=this._uiManager._signal;te(this,Cv,new Promise(l=>{i.addEventListener("change",async()=>{if(!i.files||i.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const d=await this._uiManager.imageManager.getFromFile(i.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),fe(this,R2,C4).call(this,d)}l()},{signal:s}),i.addEventListener("cancel",()=>{this.remove(),l()},{signal:s})}).finally(()=>fe(this,x2,T4).call(this))),i.click()},BR=new WeakSet,r7=function(){var E;const{div:i}=this;let{width:s,height:l}=b(this,ks);const[d,u]=this.pageDimensions,p=.75;if(this.width)s=this.width*d,l=this.height*u;else if(s>p*d||l>p*u){const C=Math.min(p*d/s,p*u/l);s*=C,l*=C}const[m,y]=this.parentDimensions;this.setDims(s*m/d,l*y/u),this._uiManager.enableWaiting(!1);const _=te(this,Og,document.createElement("canvas"));_.setAttribute("role","img"),this.addContainer(_),this.width=s/d,this.height=l/u,(E=this._initialOptions)!=null&&E.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(i.hidden=!1),fe(this,iP,aJ).call(this),b(this,UR)||(this.parent.addUndoableEditor(this),te(this,UR,!0)),this._reportTelemetry({action:"inserted_image"}),b(this,jR)&&this.div.setAttribute("aria-description",b(this,jR)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},VR=new WeakSet,s7=function(i,s){const{width:l,height:d}=b(this,ks);let u=l,p=d,m=b(this,ks);for(;u>2*i||p>2*s;){const y=u,_=p;u>2*i&&(u=u>=16384?Math.floor(u/2)-1:Math.ceil(u/2)),p>2*s&&(p=p>=16384?Math.floor(p/2)-1:Math.ceil(p/2));const E=new OffscreenCanvas(u,p);E.getContext("2d").drawImage(m,0,0,y,_,0,0,u,p),m=E.transferToImageBitmap()}return m},iP=new WeakSet,aJ=function(){const[i,s]=this.parentDimensions,{width:l,height:d}=this,u=new Kp,p=Math.ceil(l*i*u.sx),m=Math.ceil(d*s*u.sy),y=b(this,Og);if(!y||y.width===p&&y.height===m)return;y.width=p,y.height=m;const _=b(this,Hd)?b(this,ks):fe(this,VR,s7).call(this,p,m),E=y.getContext("2d");E.filter=this._uiManager.hcmFilter,E.drawImage(_,0,0,_.width,_.height,0,0,p,m)},zR=new WeakSet,a7=function(i){if(i){if(b(this,Hd)){const d=this._uiManager.imageManager.getSvgUrl(b(this,_o));if(d)return d}const s=document.createElement("canvas");return{width:s.width,height:s.height}=b(this,ks),s.getContext("2d").drawImage(b(this,ks),0,0),s.toDataURL()}if(b(this,Hd)){const[s,l]=this.pageDimensions,d=Math.round(this.width*s*ey.PDF_TO_CSS_UNITS),u=Math.round(this.height*l*ey.PDF_TO_CSS_UNITS),p=new OffscreenCanvas(d,u);return p.getContext("2d").drawImage(b(this,ks),0,0,b(this,ks).width,b(this,ks).height,0,0,d,u),p.transferToImageBitmap()}return structuredClone(b(this,ks))},oU=new WeakSet,eSe=function(i){var p;const{pageIndex:s,accessibilityData:{altText:l}}=this._initialData,d=i.pageIndex===s,u=(((p=i.accessibilityData)==null?void 0:p.alt)||"")===l;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&d&&u,isSameAltText:u}},sn(sJ,"_type","stamp"),sn(sJ,"_editorType",fi.STAMP);var A2,HR,Up,Rv,Pg,Gd,xv,GR,I2,cf,Lg,Eo,Dg,Av,WR,Bn,Iv,lU,tSe,ih,lp,rP,lJ,sP,cJ,$R,o7;const qh=class qh{constructor({uiManager:t,pageIndex:i,div:s,structTreeLayer:l,accessibilityManager:d,annotationLayer:u,drawLayer:p,textLayer:m,viewport:y,l10n:_}){J(this,lU);J(this,ih);J(this,rP);J(this,sP);J(this,$R);J(this,A2,void 0);J(this,HR,!1);J(this,Up,null);J(this,Rv,null);J(this,Pg,null);J(this,Gd,new Map);J(this,xv,!1);J(this,GR,!1);J(this,I2,!1);J(this,cf,null);J(this,Lg,null);J(this,Eo,null);J(this,Dg,null);J(this,Av,null);J(this,WR,-1);J(this,Bn,void 0);const E=[...b(qh,Iv).values()];if(!qh._initialized){qh._initialized=!0;for(const C of E)C.initialize(_,t)}t.registerEditorTypes(E),te(this,Bn,t),this.pageIndex=i,this.div=s,te(this,A2,d),te(this,Up,u),this.viewport=y,te(this,Eo,m),this.drawLayer=p,this._structTree=l,b(this,Bn).addLayer(this)}get isEmpty(){return b(this,Gd).size===0}get isInvisible(){return this.isEmpty&&b(this,Bn).getMode()===fi.NONE}updateToolbar(t){b(this,Bn).updateToolbar(t)}updateMode(t=b(this,Bn).getMode()){switch(fe(this,$R,o7).call(this),t){case fi.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case fi.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case fi.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:i}=this.div;for(const s of b(qh,Iv).values())i.toggle(`${s._type}Editing`,t===s._editorType);this.div.hidden=!1}hasTextLayer(t){var i;return t===((i=b(this,Eo))==null?void 0:i.div)}setEditingState(t){b(this,Bn).setEditingState(t)}addCommands(t){b(this,Bn).addCommands(t)}cleanUndoStack(t){b(this,Bn).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var i;(i=b(this,Up))==null||i.div.classList.toggle("disabled",!t)}async enable(){var s;te(this,I2,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),(s=b(this,Av))==null||s.abort(),te(this,Av,null);const t=new Set;for(const l of b(this,Gd).values())l.enableEditing(),l.show(!0),l.annotationElementId&&(b(this,Bn).removeChangedExistingAnnotation(l),t.add(l.annotationElementId));if(!b(this,Up)){te(this,I2,!1);return}const i=b(this,Up).getEditableAnnotations();for(const l of i){if(l.hide(),b(this,Bn).isDeletedAnnotationElement(l.data.id)||t.has(l.data.id))continue;const d=await this.deserialize(l);d&&(this.addOrRebuild(d),d.enableEditing())}te(this,I2,!1)}disable(){var l;if(te(this,GR,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),b(this,Eo)&&!b(this,Av)){te(this,Av,new AbortController);const d=b(this,Bn).combinedSignal(b(this,Av));b(this,Eo).div.addEventListener("pointerdown",u=>{const{clientX:m,clientY:y,timeStamp:_}=u,E=b(this,WR);if(_-E>500){te(this,WR,_);return}te(this,WR,-1);const{classList:C}=this.div;C.toggle("getElements",!0);const x=document.elementsFromPoint(m,y);if(C.toggle("getElements",!1),!this.div.contains(x[0]))return;let N;const O=new RegExp(`^${KEe}[0-9]+$`);for(const P of x)if(O.test(P.id)){N=P.id;break}if(!N)return;const D=b(this,Gd).get(N);(D==null?void 0:D.annotationElementId)===null&&(u.stopPropagation(),u.preventDefault(),D.dblclick())},{signal:d,capture:!0})}const t=new Map,i=new Map;for(const d of b(this,Gd).values())if(d.disableEditing(),!!d.annotationElementId){if(d.serialize()!==null){t.set(d.annotationElementId,d);continue}else i.set(d.annotationElementId,d);(l=this.getEditableAnnotation(d.annotationElementId))==null||l.show(),d.remove()}if(b(this,Up)){const d=b(this,Up).getEditableAnnotations();for(const u of d){const{id:p}=u.data;if(b(this,Bn).isDeletedAnnotationElement(p)){u.updateEdited({deleted:!0});continue}let m=i.get(p);if(m){m.resetAnnotationElement(u),m.show(!1),u.show();continue}m=t.get(p),m&&(b(this,Bn).addChangedExistingAnnotation(m),m.renderAnnotationElement(u)&&m.show(!1)),u.show()}}fe(this,$R,o7).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:s}=this.div;for(const d of b(qh,Iv).values())s.remove(`${d._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),te(this,GR,!1)}getEditableAnnotation(t){var i;return((i=b(this,Up))==null?void 0:i.getEditableAnnotation(t))||null}setActiveEditor(t){b(this,Bn).getActive()!==t&&b(this,Bn).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(t=b(this,Eo))!=null&&t.div&&!b(this,Dg)){te(this,Dg,new AbortController);const i=b(this,Bn).combinedSignal(b(this,Dg));b(this,Eo).div.addEventListener("pointerdown",fe(this,lU,tSe).bind(this),{signal:i}),b(this,Eo).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(t=b(this,Eo))!=null&&t.div&&b(this,Dg)&&(b(this,Dg).abort(),te(this,Dg,null),b(this,Eo).div.classList.remove("highlighting"))}enableClick(){if(b(this,Rv))return;te(this,Rv,new AbortController);const t=b(this,Bn).combinedSignal(b(this,Rv));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const i=this.pointerup.bind(this);this.div.addEventListener("pointerup",i,{signal:t}),this.div.addEventListener("pointercancel",i,{signal:t})}disableClick(){var t;(t=b(this,Rv))==null||t.abort(),te(this,Rv,null)}attach(t){b(this,Gd).set(t.id,t);const{annotationElementId:i}=t;i&&b(this,Bn).isDeletedAnnotationElement(i)&&b(this,Bn).removeDeletedAnnotationElement(t)}detach(t){var i;b(this,Gd).delete(t.id),(i=b(this,A2))==null||i.removePointerInTextLayer(t.contentDiv),!b(this,GR)&&t.annotationElementId&&b(this,Bn).addDeletedAnnotationElement(t)}remove(t){this.detach(t),b(this,Bn).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var i;t.parent!==this&&(t.parent&&t.annotationElementId&&(b(this,Bn).addDeletedAnnotationElement(t.annotationElementId),fs.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),(i=t.parent)==null||i.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),b(this,Bn).addEditor(t),this.attach(t),!t.isAttachedToDOM){const i=t.render();this.div.append(i),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!b(this,I2)),b(this,Bn).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var s;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!b(this,Pg)&&(t._focusEventsAllowed=!1,te(this,Pg,setTimeout(()=>{te(this,Pg,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:b(this,Bn)._signal}),i.focus())},0))),t._structTreeParentId=(s=b(this,A2))==null?void 0:s.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const i=()=>t._uiManager.rebuild(t),s=()=>{t.remove()};this.addCommands({cmd:i,undo:s,mustExec:!1})}getNextId(){return b(this,Bn).getId()}combinedSignal(t){return b(this,Bn).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return(t=b(this,ih,lp))==null?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,i){this.updateToolbar(t),await b(this,Bn).updateMode(t.mode);const{offsetX:s,offsetY:l}=fe(this,sP,cJ).call(this),d=this.getNextId(),u=fe(this,rP,lJ).call(this,{parent:this,id:d,x:s,y:l,uiManager:b(this,Bn),isCentered:!0,...i});u&&this.add(u)}async deserialize(t){var i;return await((i=b(qh,Iv).get(t.annotationType??t.annotationEditorType))==null?void 0:i.deserialize(t,this,b(this,Bn)))||null}createAndAddNewEditor(t,i,s={}){const l=this.getNextId(),d=fe(this,rP,lJ).call(this,{parent:this,id:l,x:t.offsetX,y:t.offsetY,uiManager:b(this,Bn),isCentered:i,...s});return d&&this.add(d),d}addNewEditor(t={}){this.createAndAddNewEditor(fe(this,sP,cJ).call(this),!0,t)}setSelected(t){b(this,Bn).setSelected(t)}toggleSelected(t){b(this,Bn).toggleSelected(t)}unselect(t){b(this,Bn).unselect(t)}pointerup(t){var l;const{isMac:i}=Zo.platform;if(t.button!==0||t.ctrlKey&&i||t.target!==this.div||!b(this,xv)||(te(this,xv,!1),(l=b(this,ih,lp))!=null&&l.isDrawer&&b(this,ih,lp).supportMultipleDrawings))return;if(!b(this,HR)){te(this,HR,!0);return}const s=b(this,Bn).getMode();if(s===fi.STAMP||s===fi.SIGNATURE){b(this,Bn).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){var l;if(b(this,Bn).getMode()===fi.HIGHLIGHT&&this.enableTextSelection(),b(this,xv)){te(this,xv,!1);return}const{isMac:i}=Zo.platform;if(t.button!==0||t.ctrlKey&&i||t.target!==this.div)return;if(te(this,xv,!0),(l=b(this,ih,lp))!=null&&l.isDrawer){this.startDrawingSession(t);return}const s=b(this,Bn).getActive();te(this,HR,!s||s.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),b(this,cf)){b(this,ih,lp).startDrawing(this,b(this,Bn),!1,t);return}b(this,Bn).setCurrentDrawingSession(this),te(this,cf,new AbortController);const i=b(this,Bn).combinedSignal(b(this,cf));this.div.addEventListener("blur",({relatedTarget:s})=>{s&&!this.div.contains(s)&&(te(this,Lg,null),this.commitOrRemove())},{signal:i}),b(this,ih,lp).startDrawing(this,b(this,Bn),!1,t)}pause(t){if(t){const{activeElement:i}=document;this.div.contains(i)&&te(this,Lg,i);return}b(this,Lg)&&setTimeout(()=>{var i;(i=b(this,Lg))==null||i.focus(),te(this,Lg,null)},0)}endDrawingSession(t=!1){return b(this,cf)?(b(this,Bn).setCurrentDrawingSession(null),b(this,cf).abort(),te(this,cf,null),te(this,Lg,null),b(this,ih,lp).endDrawing(t)):null}findNewParent(t,i,s){const l=b(this,Bn).findParent(i,s);return l===null||l===this?!1:(l.changeParent(t),!0)}commitOrRemove(){return b(this,cf)?(this.endDrawingSession(),!0):!1}onScaleChanging(){b(this,cf)&&b(this,ih,lp).onScaleChangingWhenDrawing(this)}destroy(){var t,i;this.commitOrRemove(),((t=b(this,Bn).getActive())==null?void 0:t.parent)===this&&(b(this,Bn).commitOrRemove(),b(this,Bn).setActiveEditor(null)),b(this,Pg)&&(clearTimeout(b(this,Pg)),te(this,Pg,null));for(const s of b(this,Gd).values())(i=b(this,A2))==null||i.removePointerInTextLayer(s.contentDiv),s.setParent(null),s.isAttachedToDOM=!1,s.div.remove();this.div=null,b(this,Gd).clear(),b(this,Bn).removeLayer(this)}render({viewport:t}){this.viewport=t,X2(this.div,t);for(const i of b(this,Bn).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update({viewport:t}){b(this,Bn).commitOrRemove(),fe(this,$R,o7).call(this);const i=this.viewport.rotation,s=t.rotation;if(this.viewport=t,X2(this.div,{rotation:s}),i!==s)for(const l of b(this,Gd).values())l.rotate(s)}get pageDimensions(){const{pageWidth:t,pageHeight:i}=this.viewport.rawDims;return[t,i]}get scale(){return b(this,Bn).viewParameters.realScale}};A2=new WeakMap,HR=new WeakMap,Up=new WeakMap,Rv=new WeakMap,Pg=new WeakMap,Gd=new WeakMap,xv=new WeakMap,GR=new WeakMap,I2=new WeakMap,cf=new WeakMap,Lg=new WeakMap,Eo=new WeakMap,Dg=new WeakMap,Av=new WeakMap,WR=new WeakMap,Bn=new WeakMap,Iv=new WeakMap,lU=new WeakSet,tSe=function(t){b(this,Bn).unselectAll();const{target:i}=t;if(i===b(this,Eo).div||(i.getAttribute("role")==="img"||i.classList.contains("endOfContent"))&&b(this,Eo).div.contains(i)){const{isMac:s}=Zo.platform;if(t.button!==0||t.ctrlKey&&s)return;b(this,Bn).showAllEditors("highlight",!0,!0),b(this,Eo).div.classList.add("free"),this.toggleDrawing(),u9.startHighlighting(this,b(this,Bn).direction==="ltr",{target:b(this,Eo).div,x:t.x,y:t.y}),b(this,Eo).div.addEventListener("pointerup",()=>{b(this,Eo).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:b(this,Bn)._signal}),t.preventDefault()}},ih=new WeakSet,lp=function(){return b(qh,Iv).get(b(this,Bn).getMode())},rP=new WeakSet,lJ=function(t){const i=b(this,ih,lp);return i?new i.prototype.constructor(t):null},sP=new WeakSet,cJ=function(){const{x:t,y:i,width:s,height:l}=this.div.getBoundingClientRect(),d=Math.max(0,t),u=Math.max(0,i),p=Math.min(window.innerWidth,t+s),m=Math.min(window.innerHeight,i+l),y=(d+p)/2-t,_=(u+m)/2-i,[E,C]=this.viewport.rotation%180===0?[y,_]:[_,y];return{offsetX:E,offsetY:C}},$R=new WeakSet,o7=function(){for(const t of b(this,Gd).values())t.isEmpty()&&t.remove()},sn(qh,"_initialized",!1),J(qh,Iv,new Map([zX,QX,sJ,u9,rJ].map(t=>[t._editorType,t])));let oJ=qh;var df,rc,N2,aP,cU,nSe,oP,uJ,dU,iSe,lP,hJ;const Ha=class Ha{constructor({pageIndex:t}){J(this,oP);J(this,dU);J(this,lP);J(this,df,null);J(this,rc,new Map);J(this,N2,new Map);this.pageIndex=t}setParent(t){if(!b(this,df)){te(this,df,t);return}if(b(this,df)!==t){if(b(this,rc).size>0)for(const i of b(this,rc).values())i.remove(),t.append(i);te(this,df,t)}}static get _svgFactory(){return Ki(this,"_svgFactory",new c9)}draw(t,i=!1,s=!1){const l=ea(Ha,aP)._++,d=fe(this,oP,uJ).call(this),u=Ha._svgFactory.createElement("defs");d.append(u);const p=Ha._svgFactory.createElement("path");u.append(p);const m=`path_p${this.pageIndex}_${l}`;p.setAttribute("id",m),p.setAttribute("vector-effect","non-scaling-stroke"),i&&b(this,N2).set(l,p);const y=s?fe(this,dU,iSe).call(this,u,m):null,_=Ha._svgFactory.createElement("use");return d.append(_),_.setAttribute("href",`#${m}`),this.updateProperties(d,t),b(this,rc).set(l,d),{id:l,clipPathId:`url(#${y})`}}drawOutline(t,i){const s=ea(Ha,aP)._++,l=fe(this,oP,uJ).call(this),d=Ha._svgFactory.createElement("defs");l.append(d);const u=Ha._svgFactory.createElement("path");d.append(u);const p=`path_p${this.pageIndex}_${s}`;u.setAttribute("id",p),u.setAttribute("vector-effect","non-scaling-stroke");let m;if(i){const E=Ha._svgFactory.createElement("mask");d.append(E),m=`mask_p${this.pageIndex}_${s}`,E.setAttribute("id",m),E.setAttribute("maskUnits","objectBoundingBox");const C=Ha._svgFactory.createElement("rect");E.append(C),C.setAttribute("width","1"),C.setAttribute("height","1"),C.setAttribute("fill","white");const x=Ha._svgFactory.createElement("use");E.append(x),x.setAttribute("href",`#${p}`),x.setAttribute("stroke","none"),x.setAttribute("fill","black"),x.setAttribute("fill-rule","nonzero"),x.classList.add("mask")}const y=Ha._svgFactory.createElement("use");l.append(y),y.setAttribute("href",`#${p}`),m&&y.setAttribute("mask",`url(#${m})`);const _=y.cloneNode();return l.append(_),y.classList.add("mainOutline"),_.classList.add("secondaryOutline"),this.updateProperties(l,t),b(this,rc).set(s,l),s}finalizeDraw(t,i){b(this,N2).delete(t),this.updateProperties(t,i)}updateProperties(t,i){var m;if(!i)return;const{root:s,bbox:l,rootClass:d,path:u}=i,p=typeof t=="number"?b(this,rc).get(t):t;if(p){if(s&&fe(this,lP,hJ).call(this,p,s),l&&fe(m=Ha,cU,nSe).call(m,p,l),d){const{classList:y}=p;for(const[_,E]of Object.entries(d))y.toggle(_,E)}if(u){const _=p.firstChild.firstChild;fe(this,lP,hJ).call(this,_,u)}}}updateParent(t,i){if(i===this)return;const s=b(this,rc).get(t);s&&(b(i,df).append(s),b(this,rc).delete(t),b(i,rc).set(t,s))}remove(t){b(this,N2).delete(t),b(this,df)!==null&&(b(this,rc).get(t).remove(),b(this,rc).delete(t))}destroy(){te(this,df,null);for(const t of b(this,rc).values())t.remove();b(this,rc).clear(),b(this,N2).clear()}};df=new WeakMap,rc=new WeakMap,N2=new WeakMap,aP=new WeakMap,cU=new WeakSet,nSe=function(t,[i,s,l,d]){const{style:u}=t;u.top=`${100*s}%`,u.left=`${100*i}%`,u.width=`${100*l}%`,u.height=`${100*d}%`},oP=new WeakSet,uJ=function(){const t=Ha._svgFactory.create(1,1,!0);return b(this,df).append(t),t.setAttribute("aria-hidden",!0),t},dU=new WeakSet,iSe=function(t,i){const s=Ha._svgFactory.createElement("clipPath");t.append(s);const l=`clip_${i}`;s.setAttribute("id",l),s.setAttribute("clipPathUnits","objectBoundingBox");const d=Ha._svgFactory.createElement("use");return s.append(d),d.setAttribute("href",`#${i}`),d.classList.add("clip"),l},lP=new WeakSet,hJ=function(t,i){for(const[s,l]of Object.entries(i))l===null?t.removeAttribute(s):t.setAttribute(s,l)},J(Ha,cU),J(Ha,aP,0);let dJ=Ha;globalThis._pdfjsTestingUtils={HighlightOutliner:GX};globalThis.pdfjsLib={AbortException:Zv,AnnotationEditorLayer:oJ,AnnotationEditorParamsType:cr,AnnotationEditorType:fi,AnnotationEditorUIManager:J2,AnnotationLayer:FX,AnnotationMode:C1,AnnotationType:Na,build:eet,ColorPicker:o9,createValidAbsoluteUrl:qEe,DOMSVGFactory:c9,DrawLayer:dJ,FeatureTest:Zo,fetchData:IP,getDocument:J2e,getFilenameFromUrl:WQe,getPdfFilenameFromUrl:$Qe,getRGB:RF,getUuid:JEe,getXfaPageViewport:qQe,GlobalWorkerOptions:Vp,ImageKind:PM,InvalidPDFException:YY,isDataScheme:TF,isPdfFile:FZ,isValidExplicitDest:sZe,MathClamp:ac,noContextMenu:fh,normalizeUnicode:zQe,OPS:RN,OutputScale:Kp,PasswordResponses:LQe,PDFDataRangeTransport:Q2e,PDFDateString:i9,PDFWorker:IN,PermissionFlag:PQe,PixelsPerInch:ey,RenderingCancelledException:UZ,ResponseException:n9,setLayerDimensions:X2,shadow:Ki,SignatureExtractor:qa,stopEvent:Oa,SupportedImageMimeTypes:JY,TextLayer:xN,TouchManager:s9,updateUrlHash:YEe,Util:In,VerbosityLevel:SF,version:ZZe,XfaLayer:nwe};const Tet="/assets/pdf.worker-BQQyum15.mjs";Vp.workerSrc=Tet;function KZ({fileUrl:n,isModalOpen:t,className:i=""}){const s=k.useRef(null),[l,d]=k.useState(1),[u,p]=k.useState(null),[m,y]=k.useState(0);k.useEffect(()=>{J2e(n).promise.then(C=>{p(C),y(C.numPages)})},[n]),k.useEffect(()=>{u&&_()},[u,l]);const _=async()=>{const E=s.current;E.innerHTML="";for(let C=1;C<=u.numPages;C++){const x=await u.getPage(C),N=x.getViewport({scale:l}),O=document.createElement("canvas"),D=O.getContext("2d");O.height=N.height,O.width=N.width,O.style.display="block",O.style.margin="0 auto",O.style.width="100%",E.appendChild(O),await x.render({canvasContext:D,viewport:N}).promise}m===1?(E.style.display="block",E.style.height="content-fit"):(E.style.display="block",E.style.height="auto")};return h.jsx("div",{className:`${i}`,style:{height:"100%"},children:h.jsx("div",{ref:s,style:{width:"100%",height:"auto",overflowY:m>1?"auto":"hidden",backgroundColor:"#fff",textAlign:"center",WebkitOverflowScrolling:"touch"}})})}const rSe="carousel",sSe="controller",Ret="navigation",xet="no-scroll",qZ="portal",Aet="root",aSe="toolbar",fpe="zoom",BK="loading",VK="error",zK="complete",Iet="placeholder",Net=n=>`active-slide-${n}`,Oet="fullsize",YZ="flex_center",Pet="no_scroll",oSe="no_scroll_padding",lSe="slide_wrapper",Let="slide_wrapper_interactive",G_="prev",W_="next",ppe="swipe",lx="close",cSe="onPointerDown",dSe="onPointerMove",uSe="onPointerUp",hSe="onPointerLeave",fSe="onPointerCancel",XZ="onKeyDown",Det="onKeyUp",JZ="onWheel",ket="Escape",Met="ArrowLeft",jet="ArrowRight",Uet="button",fJ="icon",pSe="contain",mpe="cover",mSe="Unknown action type",gSe="yarl__";function Wp(...n){return[...n].filter(Boolean).join(" ")}function Er(n){return`${gSe}${n}`}function ed(n){return`--${gSe}${n}`}function DP(n,t){return`${n}${t?`_${t}`:""}`}function QZ(n){return t=>DP(n,t)}function Fet(n,t){var i;return(i=n==null?void 0:n[t])!==null&&i!==void 0?i:t}function ZZ(...n){return()=>{n.forEach(t=>{t()})}}function ly(n,t,i){return()=>{const s=k.useContext(i);if(!s)throw new Error(`${n} must be used within a ${t}.Provider`);return s}}function eee(){return typeof window<"u"}function tee(n,t=0){const i=10**t;return Math.round((n+Number.EPSILON)*i)/i}function xx(n){return n.type===void 0||n.type==="image"}function nee(n,t){return n.imageFit===mpe||n.imageFit!==pSe&&t===mpe}function IF(n){return typeof n=="string"?Number.parseInt(n,10):n}function f9(n){if(typeof n=="number")return{pixel:n};if(typeof n=="string"){const t=IF(n);return n.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Bet(n,t){const i=f9(t),s=i.percent!==void 0?n.width/100*i.percent:i.pixel;return{width:Math.max(n.width-2*s,0),height:Math.max(n.height-2*s,0)}}function Vet(){return(eee()?window==null?void 0:window.devicePixelRatio:void 0)||1}function vSe(n,t){return t>0?(n%t+t)%t:0}function ySe(n){return n.length>0}function _Se(n,t){return n[vSe(t,n.length)]}function pJ(n,t){return ySe(n)?_Se(n,t):void 0}function zet(n){return xx(n)?n.src:void 0}function Het(n,t,i){if(!i)return n;const{buttons:s,...l}=n,d=s.findIndex(p=>p===t),u=k.isValidElement(i)?k.cloneElement(i,{key:t},null):i;if(d>=0){const p=[...s];return p.splice(d,1,u),{buttons:p,...l}}return{buttons:[u,...s],...l}}function Get(n,t,i=0){return Math.min(n.preload,Math.max(n.finite?t.length-1:Math.floor(t.length/2),i))}const mJ={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[lx]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:pSe,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function cy(n,t){return{name:n,component:t}}function So(n,t){return{module:n,children:t}}function ESe(n,t,i){return n.module.name===t?i(n):n.children?[So(n.module,n.children.flatMap(s=>{var l;return(l=ESe(s,t,i))!==null&&l!==void 0?l:[]}))]:[n]}function iC(n,t,i){return n.flatMap(s=>{var l;return(l=ESe(s,t,i))!==null&&l!==void 0?l:[]})}function Wet(n,t=[],i=[]){let s=n;const l=x=>{const N=[...s];for(;N.length>0;){const O=N.pop();if((O==null?void 0:O.module.name)===x)return!0;O!=null&&O.children&&N.push(...O.children)}return!1},d=(x,N)=>{if(x===""){s=[So(N,s)];return}s=iC(s,x,O=>[So(N,[O])])},u=(x,N)=>{s=iC(s,x,O=>[So(O.module,[So(N,O.children)])])},p=(x,N,O)=>{s=iC(s,x,D=>{var P;return[So(D.module,[...O?[So(N)]:[],...(P=D.children)!==null&&P!==void 0?P:[],...O?[]:[So(N)]])]})},m=(x,N,O)=>{s=iC(s,x,D=>[...O?[So(N)]:[],D,...O?[]:[So(N)]])},y=x=>{u(sSe,x)},_=(x,N)=>{s=iC(s,x,O=>[So(N,O.children)])},E=x=>{s=iC(s,x,N=>N.children)},C=x=>{i.push(x)};return t.forEach(x=>{x({contains:l,addParent:d,append:u,addChild:p,addSibling:m,addModule:y,replace:_,remove:E,augment:C})}),{config:s,augmentation:x=>i.reduce((N,O)=>O(N),x)}}const wSe=k.createContext(null),iee=ly("useDocument","DocumentContext",wSe);function $et({nodeRef:n,children:t}){const i=k.useMemo(()=>{const s=d=>{var u;return((u=d||n.current)===null||u===void 0?void 0:u.ownerDocument)||document};return{getOwnerDocument:s,getOwnerWindow:d=>{var u;return((u=s(d))===null||u===void 0?void 0:u.defaultView)||window}}},[n]);return k.createElement(wSe.Provider,{value:i},t)}const SSe=k.createContext(null),NF=ly("useEvents","EventsContext",SSe);function Ket({children:n}){const[t]=k.useState({});k.useEffect(()=>()=>{Object.keys(t).forEach(s=>delete t[s])},[t]);const i=k.useMemo(()=>{const s=(u,p)=>{var m;(m=t[u])===null||m===void 0||m.splice(0,t[u].length,...t[u].filter(y=>y!==p))};return{publish:(...[u,p])=>{var m;(m=t[u])===null||m===void 0||m.forEach(y=>y(p))},subscribe:(u,p)=>(t[u]||(t[u]=[]),t[u].push(p),()=>s(u,p)),unsubscribe:s}},[t]);return k.createElement(SSe.Provider,{value:i},n)}const bSe=k.createContext(null),ph=ly("useLightboxProps","LightboxPropsContext",bSe);function qet({children:n,...t}){return k.createElement(bSe.Provider,{value:t},n)}const CSe=k.createContext(null),dy=ly("useLightboxState","LightboxStateContext",CSe),TSe=k.createContext(null),Yet=ly("useLightboxDispatch","LightboxDispatchContext",TSe);function Xet(n,t){switch(t.type){case"swipe":{const{slides:i}=n,s=(t==null?void 0:t.increment)||0,l=n.globalIndex+s,d=vSe(l,i.length),u=pJ(i,d),p=s||t.duration?{increment:s,duration:t.duration,easing:t.easing}:void 0;return{slides:i,currentIndex:d,globalIndex:l,currentSlide:u,animation:p}}case"update":return t.slides!==n.slides||t.index!==n.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:pJ(t.slides,t.index)}:n;default:throw new Error(mSe)}}function Jet({slides:n,index:t,children:i}){const[s,l]=k.useReducer(Xet,{slides:n,currentIndex:t,globalIndex:t,currentSlide:pJ(n,t)});k.useEffect(()=>{l({type:"update",slides:n,index:t})},[n,t]);const d=k.useMemo(()=>({...s,state:s,dispatch:l}),[s,l]);return k.createElement(TSe.Provider,{value:l},k.createElement(CSe.Provider,{value:d},i))}const RSe=k.createContext(null),OF=ly("useTimeouts","TimeoutsContext",RSe);function Qet({children:n}){const[t]=k.useState([]);k.useEffect(()=>()=>{t.forEach(s=>window.clearTimeout(s)),t.splice(0,t.length)},[t]);const i=k.useMemo(()=>{const s=u=>{t.splice(0,t.length,...t.filter(p=>p!==u))};return{setTimeout:(u,p)=>{const m=window.setTimeout(()=>{s(m),u()},p);return t.push(m),m},clearTimeout:u=>{u!==void 0&&(s(u),window.clearTimeout(u))}}},[t]);return k.createElement(RSe.Provider,{value:i},n)}const ree=k.forwardRef(function({label:t,className:i,icon:s,renderIcon:l,onClick:d,style:u,...p},m){const{styles:y,labels:_}=ph(),E=Fet(_,t);return k.createElement("button",{ref:m,type:"button",title:E,"aria-label":E,className:Wp(Er(Uet),i),onClick:d,style:{...u,...y.button},...p},l?l():k.createElement(s,{className:Er(fJ),style:y.icon}))});function Zet(n,t){const i=s=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...s},t);return i.displayName=n,i}function _w(n,t){return Zet(n,k.createElement("g",{fill:"currentColor"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}const ett=_w("Close",k.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),ttt=_w("Previous",k.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),ntt=_w("Next",k.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),itt=_w("Loading",k.createElement(k.Fragment,null,Array.from({length:8}).map((n,t,i)=>k.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/i.length*(t+1),transform:`rotate(${360/i.length*t}, 12, 12)`})))),rtt=_w("Error",k.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),qp=eee()?k.useLayoutEffect:k.useEffect;function see(){const[n,t]=k.useState(!1);return k.useEffect(()=>{var i,s;const l=(i=window.matchMedia)===null||i===void 0?void 0:i.call(window,"(prefers-reduced-motion: reduce)");t(l==null?void 0:l.matches);const d=u=>t(u.matches);return(s=l==null?void 0:l.addEventListener)===null||s===void 0||s.call(l,"change",d),()=>{var u;return(u=l==null?void 0:l.removeEventListener)===null||u===void 0?void 0:u.call(l,"change",d)}},[]),n}function stt(n){let t=0,i=0,s=0;const d=window.getComputedStyle(n).transform.match(/matrix.*\((.+)\)/);if(d){const u=d[1].split(",").map(IF);u.length===6?(t=u[4],i=u[5]):u.length===16&&(t=u[12],i=u[13],s=u[14])}return{x:t,y:i,z:s}}function gpe(n,t){const i=k.useRef(),s=k.useRef(),l=see();return qp(()=>{var d,u,p;if(n.current&&i.current!==void 0&&!l){const{keyframes:m,duration:y,easing:_,onfinish:E}=t(i.current,n.current.getBoundingClientRect(),stt(n.current))||{};if(m&&y){(d=s.current)===null||d===void 0||d.cancel(),s.current=void 0;try{s.current=(p=(u=n.current).animate)===null||p===void 0?void 0:p.call(u,m,{duration:y,easing:_})}catch(C){console.error(C)}s.current&&(s.current.onfinish=()=>{s.current=void 0,E==null||E()})}}i.current=void 0}),{prepareAnimation:d=>{i.current=d},isAnimationPlaying:()=>{var d;return((d=s.current)===null||d===void 0?void 0:d.playState)==="running"}}}function xSe(){const n=k.useRef(null),t=k.useRef(),[i,s]=k.useState();return{setContainerRef:k.useCallback(d=>{n.current=d,t.current&&(t.current.disconnect(),t.current=void 0);const u=()=>{if(d){const p=window.getComputedStyle(d),m=y=>parseFloat(y)||0;s({width:Math.round(d.clientWidth-m(p.paddingLeft)-m(p.paddingRight)),height:Math.round(d.clientHeight-m(p.paddingTop)-m(p.paddingBottom))})}else s(void 0)};u(),d&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(u),t.current.observe(d))},[]),containerRef:n,containerRect:i}}function l7(){const n=k.useRef(),{setTimeout:t,clearTimeout:i}=OF();return k.useCallback((s,l)=>{i(n.current),n.current=t(s,l>0?l:0)},[t,i])}function zr(n){const t=k.useRef(n);return qp(()=>{t.current=n}),k.useCallback((...i)=>{var s;return(s=t.current)===null||s===void 0?void 0:s.call(t,...i)},[])}function vpe(n,t){typeof n=="function"?n(t):n&&(n.current=t)}function gJ(n,t){return k.useMemo(()=>n==null&&t==null?null:i=>{vpe(n,i),vpe(t,i)},[n,t])}function att(n,t=!1){const i=k.useRef();qp(()=>{t&&i.current&&(i.current=!1,n())},[t,n]);const s=k.useCallback(()=>{i.current=!0},[]),l=k.useCallback(()=>{i.current=!1},[]);return{onFocus:s,onBlur:l}}function aee(){const[n,t]=k.useState(!1);return qp(()=>{t(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),n}function ott(){const[n]=k.useState({}),t=k.useCallback((l,d)=>{var u;(u=n[l])===null||u===void 0||u.forEach(p=>{d.isPropagationStopped()||p(d)})},[n]),i=k.useMemo(()=>({onPointerDown:l=>t(cSe,l),onPointerMove:l=>t(dSe,l),onPointerUp:l=>t(uSe,l),onPointerLeave:l=>t(hSe,l),onPointerCancel:l=>t(fSe,l),onKeyDown:l=>t(XZ,l),onKeyUp:l=>t(Det,l),onWheel:l=>t(JZ,l)}),[t]),s=k.useCallback((l,d)=>(n[l]||(n[l]=[]),n[l].unshift(d),()=>{const u=n[l];u&&u.splice(0,u.length,...u.filter(p=>p!==d))}),[n]);return{registerSensors:i,subscribeSensors:s}}function ype(n,t){const i=k.useRef(0),s=l7(),l=zr((...d)=>{i.current=Date.now(),n(d)});return k.useCallback((...d)=>{s(()=>{l(d)},t-(Date.now()-i.current))},[t,l,s])}const HK=QZ("slide"),GK=QZ("slide_image");function p9({slide:n,offset:t,render:i,rect:s,imageFit:l,imageProps:d,onClick:u,onLoad:p,onError:m,style:y}){var _,E,C,x,N,O,D;const[P,j]=k.useState(BK),{publish:M}=NF(),{setTimeout:V}=OF(),G=k.useRef(null);k.useEffect(()=>{t===0&&M(Net(P))},[t,P,M]);const $=zr(Fe=>{("decode"in Fe?Fe.decode():Promise.resolve()).catch(()=>{}).then(()=>{Fe.parentNode&&(j(zK),V(()=>{p==null||p(Fe)},0))})}),ne=k.useCallback(Fe=>{G.current=Fe,Fe!=null&&Fe.complete&&$(Fe)},[$]),Y=k.useCallback(Fe=>{$(Fe.currentTarget)},[$]),le=zr(()=>{j(VK),m==null||m()}),re=nee(n,l),ee=(Fe,Ue)=>Number.isFinite(Fe)?Fe:Ue,de=ee(Math.max(...((E=(_=n.srcSet)===null||_===void 0?void 0:_.map(Fe=>Fe.width))!==null&&E!==void 0?E:[]).concat(n.width?[n.width]:[]).filter(Boolean)),((C=G.current)===null||C===void 0?void 0:C.naturalWidth)||0),H=ee(Math.max(...((N=(x=n.srcSet)===null||x===void 0?void 0:x.map(Fe=>Fe.height))!==null&&N!==void 0?N:[]).concat(n.height?[n.height]:[]).filter(Boolean)),((O=G.current)===null||O===void 0?void 0:O.naturalHeight)||0),ae=de&&H?{maxWidth:`min(${de}px, 100%)`,maxHeight:`min(${H}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},_e=(D=n.srcSet)===null||D===void 0?void 0:D.sort((Fe,Ue)=>Fe.width-Ue.width).map(Fe=>`${Fe.src} ${Fe.width}w`).join(", "),me=()=>s&&!re&&n.width&&n.height?s.height/n.height*n.width:Number.MAX_VALUE,Ce=_e&&s&&eee()?`${Math.round(Math.min(me(),s.width))}px`:void 0,{style:he,className:pe,...Oe}=d||{};return k.createElement(k.Fragment,null,k.createElement("img",{ref:ne,onLoad:Y,onError:le,onClick:u,draggable:!1,className:Wp(Er(GK()),re&&Er(GK("cover")),P!==zK&&Er(GK("loading")),pe),style:{...ae,...y,...he},...Oe,alt:n.alt,sizes:Ce,srcSet:_e,src:n.src}),P!==zK&&k.createElement("div",{className:Er(HK(Iet))},P===BK&&(i!=null&&i.iconLoading?i.iconLoading():k.createElement(itt,{className:Wp(Er(fJ),Er(HK(BK)))})),P===VK&&(i!=null&&i.iconError?i.iconError():k.createElement(rtt,{className:Wp(Er(fJ),Er(HK(VK)))}))))}const ltt=k.forwardRef(function({className:t,children:i,...s},l){const d=k.useRef(null);return k.createElement($et,{nodeRef:d},k.createElement("div",{ref:gJ(l,d),className:Wp(Er("root"),t),...s},i))});var wl;(function(n){n[n.NONE=0]="NONE",n[n.SWIPE=1]="SWIPE",n[n.PULL=2]="PULL",n[n.ANIMATION=3]="ANIMATION"})(wl||(wl={}));function ASe(n,t,i,s,l){k.useEffect(()=>l?()=>{}:ZZ(n(cSe,t),n(dSe,i),n(uSe,s),n(hSe,s),n(fSe,s)),[n,t,i,s,l])}var $h;(function(n){n[n.NONE=0]="NONE",n[n.SWIPE=1]="SWIPE",n[n.PULL=2]="PULL"})($h||($h={}));const WK=30;function ctt(n,t,i,s,l,d,u,p,m,y,_,E,C,x){const N=k.useRef(0),O=k.useRef([]),D=k.useRef(),P=k.useRef(0),j=k.useRef($h.NONE),M=k.useCallback(le=>{D.current===le.pointerId&&(D.current=void 0,j.current=$h.NONE);const re=O.current;re.splice(0,re.length,...re.filter(ee=>ee.pointerId!==le.pointerId))},[]),V=k.useCallback(le=>{M(le),le.persist(),O.current.push(le)},[M]),G=zr(le=>{V(le)}),$=(le,re)=>y&&le>re||m&&le<-re,ne=zr(le=>{if(O.current.find(re=>re.pointerId===le.pointerId)&&D.current===le.pointerId){const re=Date.now()-P.current,ee=N.current;j.current===$h.SWIPE?Math.abs(ee)>.3*i||Math.abs(ee)>5&&re<s?u(ee,re):p(ee):j.current===$h.PULL&&($(ee,2*WK)?C(ee,re):x(ee)),N.current=0,j.current=$h.NONE}M(le)}),Y=zr(le=>{const re=O.current.find(ee=>ee.pointerId===le.pointerId);if(re){const ee=D.current===le.pointerId;if(le.buttons===0){ee&&N.current!==0?ne(le):M(re);return}const de=le.clientX-re.clientX,H=le.clientY-re.clientY;if(D.current===void 0){const ae=_e=>{V(le),D.current=le.pointerId,P.current=Date.now(),j.current=_e};Math.abs(de)>Math.abs(H)&&Math.abs(de)>WK&&t(de)?(ae($h.SWIPE),l()):Math.abs(H)>Math.abs(de)&&$(H,WK)&&(ae($h.PULL),_())}else ee&&(j.current===$h.SWIPE?(N.current=de,d(de)):j.current===$h.PULL&&(N.current=H,E(H)))}});ASe(n,G,Y,ne)}function dtt({preventDefaultWheelX:n,preventDefaultWheelY:t}){const i=k.useRef(null),s=zr(l=>{const d=Math.abs(l.deltaX)>Math.abs(l.deltaY);(d&&n||!d&&t||l.ctrlKey)&&l.preventDefault()});return k.useCallback(l=>{var d;l?l.addEventListener("wheel",s,{passive:!1}):(d=i.current)===null||d===void 0||d.removeEventListener("wheel",s),i.current=l},[s])}function utt(n,t,i,s,l,d,u,p,m){const y=k.useRef(0),_=k.useRef(0),E=k.useRef(),C=k.useRef(),x=k.useRef(0),N=k.useRef(0),{setTimeout:O,clearTimeout:D}=OF(),P=k.useCallback(()=>{E.current&&(D(E.current),E.current=void 0)},[D]),j=k.useCallback(()=>{C.current&&(D(C.current),C.current=void 0)},[D]),M=zr(()=>{n!==wl.SWIPE&&(y.current=0,N.current=0,P(),j())});k.useEffect(M,[n,M]);const V=zr($=>{C.current=void 0,y.current===$&&m(y.current)}),G=zr($=>{if(!$.ctrlKey&&!(Math.abs($.deltaY)>Math.abs($.deltaX)))if(n===wl.NONE){if(Math.abs($.deltaX)<=1.2*Math.abs(x.current)){x.current=$.deltaX;return}if(!i(-$.deltaX))return;if(_.current+=$.deltaX,P(),Math.abs(_.current)>30)_.current=0,x.current=0,N.current=Date.now(),d();else{const ne=_.current;E.current=O(()=>{E.current=void 0,ne===_.current&&(_.current=0)},l)}}else if(n===wl.SWIPE){let ne=y.current-$.deltaX;if(ne=Math.min(Math.abs(ne),s)*Math.sign(ne),y.current=ne,u(ne),j(),Math.abs(ne)>.2*s){x.current=$.deltaX,p(ne,Date.now()-N.current);return}C.current=O(()=>V(ne),2*l)}else x.current=$.deltaX});k.useEffect(()=>t(JZ,G),[t,G])}const _pe=QZ("container"),ISe=k.createContext(null),Zg=ly("useController","ControllerContext",ISe);function htt({children:n,...t}){var i;const{carousel:s,animation:l,controller:d,on:u,styles:p,render:m}=t,{closeOnPullUp:y,closeOnPullDown:_,preventDefaultWheelX:E,preventDefaultWheelY:C}=d,[x,N]=k.useState(),O=dy(),D=Yet(),[P,j]=k.useState(wl.NONE),M=k.useRef(0),V=k.useRef(0),G=k.useRef(1),{registerSensors:$,subscribeSensors:ne}=ott(),{subscribe:Y,publish:le}=NF(),re=l7(),ee=l7(),de=l7(),{containerRef:H,setContainerRef:ae,containerRect:_e}=xSe(),me=gJ(dtt({preventDefaultWheelX:E,preventDefaultWheelY:C}),ae),Ce=k.useRef(null),he=gJ(Ce,void 0),{getOwnerDocument:pe}=iee(),Oe=aee(),Fe=it=>(Oe?-1:1)*(typeof it=="number"?it:1),Ue=zr(()=>{var it;return(it=H.current)===null||it===void 0?void 0:it.focus()}),Ve=zr(()=>t),Re=zr(()=>O),Be=k.useCallback(it=>le(G_,it),[le]),Xe=k.useCallback(it=>le(W_,it),[le]),we=k.useCallback(()=>le(lx),[le]),We=it=>!(s.finite&&(Fe(it)>0&&O.currentIndex===0||Fe(it)<0&&O.currentIndex===O.slides.length-1)),st=it=>{var Me;M.current=it,(Me=H.current)===null||Me===void 0||Me.style.setProperty(ed("swipe_offset"),`${Math.round(it)}px`)},pt=it=>{var Me,Ge;V.current=it,G.current=(()=>{const Pt=_&&it>0?it:y&&it<0?-it:0;return Math.min(Math.max(tee(1-Pt/60*(1-.5),2),.5),1)})(),(Me=H.current)===null||Me===void 0||Me.style.setProperty(ed("pull_offset"),`${Math.round(it)}px`),(Ge=H.current)===null||Ge===void 0||Ge.style.setProperty(ed("pull_opacity"),`${G.current}`)},{prepareAnimation:Qe}=gpe(Ce,(it,Me,Ge)=>{if(Ce.current&&_e)return{keyframes:[{transform:`translate(0, ${it.rect.y-Me.y+Ge.y}px)`,opacity:it.opacity},{transform:"translate(0, 0)",opacity:1}],duration:it.duration,easing:l.easing.fade}}),Je=(it,Me)=>{if(y||_){pt(it);let Ge=0;Ce.current&&(Ge=l.fade*(Me?2:1),Qe({rect:Ce.current.getBoundingClientRect(),opacity:G.current,duration:Ge})),de(()=>{pt(0),j(wl.NONE)},Ge),j(wl.ANIMATION),Me||we()}},{prepareAnimation:St,isAnimationPlaying:Xt}=gpe(Ce,(it,Me,Ge)=>{var bt;if(Ce.current&&_e&&(!((bt=O.animation)===null||bt===void 0)&&bt.duration)){const wt=f9(s.spacing),Pt=(wt.percent?wt.percent*_e.width/100:wt.pixel)||0;return{keyframes:[{transform:`translate(${Fe(O.globalIndex-it.index)*(_e.width+Pt)+it.rect.x-Me.x+Ge.x}px, 0)`},{transform:"translate(0, 0)"}],duration:O.animation.duration,easing:O.animation.easing}}}),Ht=zr(it=>{var Me,Ge;const bt=it.offset||0,wt=bt?l.swipe:(Me=l.navigation)!==null&&Me!==void 0?Me:l.swipe,Pt=!bt&&!Xt()?l.easing.navigation:l.easing.swipe;let{direction:en}=it;const un=(Ge=it.count)!==null&&Ge!==void 0?Ge:1;let an=wl.ANIMATION,ye=wt*un;if(!en){const ie=_e==null?void 0:_e.width,Se=it.duration||0,je=ie?wt/ie*Math.abs(bt):wt;un!==0?(Se<je?ye=ye/je*Math.max(Se,je/5):ie&&(ye=wt/ie*(ie-Math.abs(bt))),en=Fe(bt)>0?G_:W_):ye=wt/2}let Q=0;en===G_?We(Fe(1))?Q=-un:(an=wl.NONE,ye=wt):en===W_&&(We(Fe(-1))?Q=un:(an=wl.NONE,ye=wt)),ye=Math.round(ye),ee(()=>{st(0),j(wl.NONE)},ye),Ce.current&&St({rect:Ce.current.getBoundingClientRect(),index:O.globalIndex}),j(an),le(ppe,{type:"swipe",increment:Q,duration:ye,easing:Pt})});k.useEffect(()=>{var it,Me;!((it=O.animation)===null||it===void 0)&&it.increment&&(!((Me=O.animation)===null||Me===void 0)&&Me.duration)&&re(()=>D({type:"swipe",increment:0}),O.animation.duration)},[O.animation,D,re]);const gn=[ne,We,(_e==null?void 0:_e.width)||0,l.swipe,()=>j(wl.SWIPE),it=>st(it),(it,Me)=>Ht({offset:it,duration:Me,count:1}),it=>Ht({offset:it,count:0})],It=[()=>{_&&j(wl.PULL)},it=>pt(it),it=>Je(it),it=>Je(it,!0)];ctt(...gn,y,_,...It),utt(P,...gn);const xt=zr(()=>{d.focus&&pe().querySelector(`.${Er(qZ)} .${Er(_pe())}`)&&Ue()});k.useEffect(xt,[xt]);const mt=zr(()=>{var it;(it=u.view)===null||it===void 0||it.call(u,{index:O.currentIndex})});k.useEffect(mt,[O.globalIndex,mt]),k.useEffect(()=>ZZ(Y(G_,it=>Ht({direction:G_,...it})),Y(W_,it=>Ht({direction:W_,...it})),Y(ppe,it=>D(it))),[Y,Ht,D]);const dt=k.useMemo(()=>({prev:Be,next:Xe,close:we,focus:Ue,slideRect:_e?Bet(_e,s.padding):{width:0,height:0},containerRect:_e||{width:0,height:0},subscribeSensors:ne,containerRef:H,setCarouselRef:he,toolbarWidth:x,setToolbarWidth:N}),[Be,Xe,we,Ue,ne,_e,H,he,x,N,s.padding]);return k.useImperativeHandle(d.ref,()=>({prev:Be,next:Xe,close:we,focus:Ue,getLightboxProps:Ve,getLightboxState:Re}),[Be,Xe,we,Ue,Ve,Re]),k.createElement("div",{ref:me,className:Wp(Er(_pe()),Er(YZ)),style:{...P===wl.SWIPE?{[ed("swipe_offset")]:`${Math.round(M.current)}px`}:null,...P===wl.PULL?{[ed("pull_offset")]:`${Math.round(V.current)}px`,[ed("pull_opacity")]:`${G.current}`}:null,...d.touchAction!=="none"?{[ed("controller_touch_action")]:d.touchAction}:null,...p.container},...d.aria?{role:"presentation","aria-live":"polite"}:null,tabIndex:-1,...$},_e&&k.createElement(ISe.Provider,{value:dt},n,(i=m.controls)===null||i===void 0?void 0:i.call(m)))}const ftt=cy(sSe,htt);function D_(n){return DP(rSe,n)}function Epe(n){return DP("slide",n)}function ptt({slide:n,offset:t}){const i=k.useRef(null),{currentIndex:s}=dy(),{slideRect:l,close:d}=Zg(),{render:u,carousel:{imageFit:p,imageProps:m},on:{click:y},controller:{closeOnBackdropClick:_},styles:{slide:E}}=ph(),C=()=>{var N,O,D,P;let j=(N=u.slide)===null||N===void 0?void 0:N.call(u,{slide:n,offset:t,rect:l});return!j&&xx(n)&&(j=k.createElement(p9,{slide:n,offset:t,render:u,rect:l,imageFit:p,imageProps:m,onClick:t===0?()=>y==null?void 0:y({index:s}):void 0})),j?k.createElement(k.Fragment,null,(O=u.slideHeader)===null||O===void 0?void 0:O.call(u,{slide:n}),((D=u.slideContainer)!==null&&D!==void 0?D:({children:M})=>M)({slide:n,children:j}),(P=u.slideFooter)===null||P===void 0?void 0:P.call(u,{slide:n})):null},x=N=>{const O=i.current,D=N.target instanceof HTMLElement?N.target:void 0;_&&D&&O&&(D===O||Array.from(O.children).find(P=>P===D)&&D.classList.contains(Er(lSe)))&&d()};return k.createElement("div",{ref:i,className:Wp(Er(Epe()),t===0&&Er(Epe("current")),Er(YZ)),onClick:x,style:E},C())}function mtt(){const n=ph().styles.slide;return k.createElement("div",{className:Er("slide"),style:n})}function gtt({carousel:n}){const{slides:t,currentIndex:i,globalIndex:s}=dy(),{setCarouselRef:l}=Zg(),d=f9(n.spacing),u=f9(n.padding),p=Get(n,t,1),m=[];if(ySe(t))for(let y=i-p;y<=i+p;y+=1){const _=_Se(t,y),E=s-i+y,C=n.finite&&(y<0||y>t.length-1);m.push(C?{key:E}:{key:[`${E}`,zet(_)].filter(Boolean).join("|"),offset:y-i,slide:_})}return k.createElement("div",{ref:l,className:Wp(Er(D_()),m.length>0&&Er(D_("with_slides"))),style:{[`${ed(D_("slides_count"))}`]:m.length,[`${ed(D_("spacing_px"))}`]:d.pixel||0,[`${ed(D_("spacing_percent"))}`]:d.percent||0,[`${ed(D_("padding_px"))}`]:u.pixel||0,[`${ed(D_("padding_percent"))}`]:u.percent||0}},m.map(({key:y,slide:_,offset:E})=>_?k.createElement(ptt,{key:y,slide:_,offset:E}):k.createElement(mtt,{key:y})))}const vtt=cy(rSe,gtt);function NSe(){const{carousel:n}=ph(),{slides:t,currentIndex:i}=dy(),s=t.length===0||n.finite&&i===0,l=t.length===0||n.finite&&i===t.length-1;return{prevDisabled:s,nextDisabled:l}}function ytt(n){var t;const i=aee(),{publish:s}=NF(),{animation:l}=ph(),{prevDisabled:d,nextDisabled:u}=NSe(),p=((t=l.navigation)!==null&&t!==void 0?t:l.swipe)/2,m=ype(()=>s(G_),p),y=ype(()=>s(W_),p),_=zr(E=>{switch(E.key){case ket:s(lx);break;case Met:(i?u:d)||(i?y:m)();break;case jet:(i?d:u)||(i?m:y)();break}});k.useEffect(()=>n(XZ,_),[n,_])}function wpe({label:n,icon:t,renderIcon:i,action:s,onClick:l,disabled:d,style:u}){return k.createElement(ree,{label:n,icon:t,renderIcon:i,className:Er(`navigation_${s}`),disabled:d,onClick:l,style:u,...att(Zg().focus,d)})}function _tt({render:{buttonPrev:n,buttonNext:t,iconPrev:i,iconNext:s},styles:l}){const{prev:d,next:u,subscribeSensors:p}=Zg(),{prevDisabled:m,nextDisabled:y}=NSe();return ytt(p),k.createElement(k.Fragment,null,n?n():k.createElement(wpe,{label:"Previous",action:G_,icon:ttt,renderIcon:i,style:l.navigationPrev,disabled:m,onClick:d}),t?t():k.createElement(wpe,{label:"Next",action:W_,icon:ntt,renderIcon:s,style:l.navigationNext,disabled:y,onClick:u}))}const Ett=cy(Ret,_tt),Spe=Er(Pet),wtt=Er(oSe);function Stt(n){return"style"in n}function bpe(n,t,i){const s=window.getComputedStyle(n),l=i?"padding-left":"padding-right",d=i?s.paddingLeft:s.paddingRight,u=n.style.getPropertyValue(l);return n.style.setProperty(l,`${(IF(d)||0)+t}px`),()=>{u?n.style.setProperty(l,u):n.style.removeProperty(l)}}function btt({noScroll:{disabled:n},children:t}){const i=aee(),{getOwnerDocument:s,getOwnerWindow:l}=iee();return k.useEffect(()=>{if(n)return()=>{};const d=[],u=l(),{body:p,documentElement:m}=s(),y=Math.round(u.innerWidth-m.clientWidth);if(y>0){d.push(bpe(p,y,i));const _=p.getElementsByTagName("*");for(let E=0;E<_.length;E+=1){const C=_[E];Stt(C)&&u.getComputedStyle(C).getPropertyValue("position")==="fixed"&&!C.classList.contains(wtt)&&d.push(bpe(C,y,i))}}return p.classList.add(Spe),()=>{p.classList.remove(Spe),d.forEach(_=>_())}},[i,n,s,l]),k.createElement(k.Fragment,null,t)}const Ctt=cy(xet,btt);function Cpe(n){return DP(qZ,n)}function Tpe(n,t,i){const s=n.getAttribute(t);return n.setAttribute(t,i),()=>{s?n.setAttribute(t,s):n.removeAttribute(t)}}function Ttt({children:n,animation:t,styles:i,className:s,on:l,portal:d,close:u}){const[p,m]=k.useState(!1),[y,_]=k.useState(!1),E=k.useRef([]),C=k.useRef(null),{setTimeout:x}=OF(),{subscribe:N}=NF(),D=see()?0:t.fade;k.useEffect(()=>(m(!0),()=>{m(!1),_(!1)}),[]);const P=zr(()=>{E.current.forEach(G=>G()),E.current=[]}),j=zr(()=>{var G;_(!1),P(),(G=l.exiting)===null||G===void 0||G.call(l),x(()=>{var $;($=l.exited)===null||$===void 0||$.call(l),u()},D)});k.useEffect(()=>N(lx,j),[N,j]);const M=zr(G=>{var $,ne,Y;G.scrollTop,_(!0),($=l.entering)===null||$===void 0||$.call(l);const le=(Y=(ne=G.parentNode)===null||ne===void 0?void 0:ne.children)!==null&&Y!==void 0?Y:[];for(let re=0;re<le.length;re+=1){const ee=le[re];["TEMPLATE","SCRIPT","STYLE"].indexOf(ee.tagName)===-1&&ee!==G&&(E.current.push(Tpe(ee,"inert","true")),E.current.push(Tpe(ee,"aria-hidden","true")))}E.current.push(()=>{var re,ee;(ee=(re=C.current)===null||re===void 0?void 0:re.focus)===null||ee===void 0||ee.call(re)}),x(()=>{var re;(re=l.entered)===null||re===void 0||re.call(l)},D)}),V=k.useCallback(G=>{G?M(G):P()},[M,P]);return p?vQ.createPortal(k.createElement(ltt,{ref:V,className:Wp(s,Er(Cpe()),Er(oSe),y&&Er(Cpe("open"))),role:"presentation","aria-live":"polite",style:{...t.fade!==mJ.animation.fade?{[ed("fade_animation_duration")]:`${D}ms`}:null,...t.easing.fade!==mJ.animation.easing.fade?{[ed("fade_animation_timing_function")]:t.easing.fade}:null,...i.root},onFocus:G=>{C.current||(C.current=G.relatedTarget)}},n),d.root||document.body):null}const Rtt=cy(qZ,Ttt);function xtt({children:n}){return k.createElement(k.Fragment,null,n)}const Att=cy(Aet,xtt);function Itt(n){return DP(aSe,n)}function Ntt({toolbar:{buttons:n},render:{buttonClose:t,iconClose:i},styles:s}){const{close:l,setToolbarWidth:d}=Zg(),{setContainerRef:u,containerRect:p}=xSe();qp(()=>{d(p==null?void 0:p.width)},[d,p==null?void 0:p.width]);const m=()=>t?t():k.createElement(ree,{key:lx,label:"Close",icon:ett,renderIcon:i,onClick:l});return k.createElement("div",{ref:u,style:s.toolbar,className:Er(Itt())},n==null?void 0:n.map(y=>y===lx?m():y))}const Ott=cy(aSe,Ntt);function OSe(n,t){var i;return k.createElement(n.module.component,{key:n.module.name,...t},(i=n.children)===null||i===void 0?void 0:i.map(s=>OSe(s,t)))}function Ptt(n,t={}){const{easing:i,...s}=n,{easing:l,...d}=t;return{easing:{...i,...l},...s,...d}}function Ltt({carousel:n,animation:t,render:i,toolbar:s,controller:l,noScroll:d,on:u,plugins:p,slides:m,index:y,..._}){const{animation:E,carousel:C,render:x,toolbar:N,controller:O,noScroll:D,on:P,slides:j,index:M,plugins:V,...G}=mJ,{config:$,augmentation:ne}=Wet([So(Rtt,[So(Ctt,[So(ftt,[So(vtt),So(Ott),So(Ett)])])])],p||V),Y=ne({animation:Ptt(E,t),carousel:{...C,...n},render:{...x,...i},toolbar:{...N,...s},controller:{...O,...l},noScroll:{...D,...d},on:{...P,...u},...G,..._});return Y.open?k.createElement(qet,{...Y},k.createElement(Jet,{slides:m||j,index:IF(y||M)},k.createElement(Qet,null,k.createElement(Ket,null,OSe(So(Att,$),Y))))):null}const Dtt={maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!1},PSe=n=>({...Dtt,...n});function ktt(n,t,i,s){const l=k.useRef(),d=k.useRef(),{zoom:u}=ph().animation,p=see(),m=zr(()=>{var y,_,E;if((y=l.current)===null||y===void 0||y.cancel(),l.current=void 0,d.current&&(s!=null&&s.current)){try{l.current=(E=(_=s.current).animate)===null||E===void 0?void 0:E.call(_,[{transform:d.current},{transform:`scale(${n}) translateX(${t}px) translateY(${i}px)`}],{duration:p?0:u??500,easing:l.current?"ease-out":"ease-in-out"})}catch(C){console.error(C)}d.current=void 0,l.current&&(l.current.onfinish=()=>{l.current=void 0})}});return qp(m,[n,t,i,m]),k.useCallback(()=>{d.current=s!=null&&s.current?window.getComputedStyle(s.current).transform:void 0},[s])}function Mtt(n,t){const{on:i}=ph(),s=zr(()=>{var l;t||(l=i.zoom)===null||l===void 0||l.call(i,{zoom:n})});k.useEffect(s,[n,s])}function PF(){const{zoom:n}=ph();return PSe(n)}function jtt(n,t){var i,s;let l={width:0,height:0},d={width:0,height:0};const{currentSlide:u}=dy(),{imageFit:p}=ph().carousel,{maxZoomPixelRatio:m}=PF();if(n&&u){const _={...u,...t};if(xx(_)){const E=nee(_,p),C=Math.max(...(((i=_.srcSet)===null||i===void 0?void 0:i.map(N=>N.width))||[]).concat(_.width?[_.width]:[])),x=Math.max(...(((s=_.srcSet)===null||s===void 0?void 0:s.map(N=>N.height))||[]).concat(_.height?[_.height]:[]));C>0&&x>0&&n.width>0&&n.height>0&&(d=E?{width:Math.round(Math.min(C,n.width/n.height*x)),height:Math.round(Math.min(x,n.height/n.width*C))}:{width:C,height:x},d={width:d.width*m,height:d.height*m},l=E?{width:Math.min(n.width,d.width,C),height:Math.min(n.height,d.height,x)}:{width:Math.round(Math.min(n.width,n.height/x*C,C)),height:Math.round(Math.min(n.height,n.width/C*x,x))})}}const y=l.width?Math.max(tee(d.width/l.width,5),1):1;return{imageRect:l,maxZoom:y}}function Rpe(n,t){return((n.clientX-t.clientX)**2+(n.clientY-t.clientY)**2)**.5}function Utt(n,t,i,s,l,d){const u=k.useRef([]),p=k.useRef(0),m=k.useRef(),{globalIndex:y}=dy(),{getOwnerWindow:_}=iee(),{containerRef:E,subscribeSensors:C}=Zg(),{keyboardMoveDistance:x,zoomInMultiplier:N,wheelZoomDistanceFactor:O,scrollToZoom:D,doubleTapDelay:P,doubleClickDelay:j,doubleClickMaxStops:M,pinchZoomDistanceFactor:V}=PF(),G=k.useCallback(ae=>{if(E.current){const{pageX:_e,pageY:me}=ae,{scrollX:Ce,scrollY:he}=_(),{left:pe,top:Oe,width:Fe,height:Ue}=E.current.getBoundingClientRect();return[_e-pe-Ce-Fe/2,me-Oe-he-Ue/2]}return[]},[E,_]),$=zr(ae=>{const _e=()=>{ae.preventDefault(),ae.stopPropagation()};if(n>1){const he=(pe,Oe)=>{_e(),l(pe,Oe)};ae.key==="ArrowDown"?he(0,x):ae.key==="ArrowUp"?he(0,-x):ae.key==="ArrowLeft"?he(-x,0):ae.key==="ArrowRight"&&he(x,0)}const me=he=>{_e(),s(he)},Ce=()=>ae.getModifierState("Meta");ae.key==="+"||ae.key==="="&&Ce()?me(n*N):ae.key==="-"||ae.key==="_"&&Ce()?me(n/N):ae.key==="0"&&Ce()&&me(1)}),ne=zr(ae=>{if((ae.ctrlKey||D)&&Math.abs(ae.deltaY)>Math.abs(ae.deltaX)){ae.stopPropagation(),s(n*(1-ae.deltaY/O),!0,...G(ae));return}n>1&&(ae.stopPropagation(),D||l(ae.deltaX,ae.deltaY))}),Y=k.useCallback(ae=>{const _e=u.current;_e.splice(0,_e.length,..._e.filter(me=>me.pointerId!==ae.pointerId))},[]),le=k.useCallback(ae=>{Y(ae),ae.persist(),u.current.push(ae)},[Y]),re=zr(ae=>{var _e;const me=u.current;if(!(!((_e=d==null?void 0:d.current)===null||_e===void 0)&&_e.contains(ae.target)))return;n>1&&ae.stopPropagation();const{timeStamp:Ce}=ae;me.length===0&&Ce-p.current<(ae.pointerType==="touch"?P:j)?(p.current=0,s(n!==t?n*Math.max(t**(1/M),N):1,!1,...G(ae))):p.current=Ce,le(ae),me.length===2&&(m.current=Rpe(me[0],me[1]))}),ee=zr(ae=>{const _e=u.current,me=_e.find(Ce=>Ce.pointerId===ae.pointerId);if(_e.length===2&&m.current){ae.stopPropagation(),le(ae);const Ce=Rpe(_e[0],_e[1]),he=Ce-m.current;Math.abs(he)>0&&(s(n*(1+he/V),!0,..._e.map(pe=>G(pe)).reduce((pe,Oe)=>Oe.map((Fe,Ue)=>pe[Ue]+Fe/2))),m.current=Ce);return}n>1&&(ae.stopPropagation(),me&&(_e.length===1&&l((me.clientX-ae.clientX)/n,(me.clientY-ae.clientY)/n),le(ae)))}),de=k.useCallback(ae=>{const _e=u.current;_e.length===2&&_e.find(me=>me.pointerId===ae.pointerId)&&(m.current=void 0),Y(ae)},[Y]),H=k.useCallback(()=>{const ae=u.current;ae.splice(0,ae.length),p.current=0,m.current=void 0},[]);ASe(C,re,ee,de,i),k.useEffect(H,[y,H]),k.useEffect(()=>i?()=>{}:ZZ(H,C(XZ,$),C(JZ,ne)),[i,C,H,$,ne])}function Ftt(n,t,i){const[s,l]=k.useState(1),[d,u]=k.useState(0),[p,m]=k.useState(0),y=ktt(s,d,p,i),{currentSlide:_,globalIndex:E}=dy(),{containerRect:C,slideRect:x}=Zg(),{zoomInMultiplier:N}=PF(),O=_&&xx(_)?_.src:void 0,D=!O||!(i!=null&&i.current);qp(()=>{l(1),u(0),m(0)},[E,O]);const P=k.useCallback(($,ne,Y)=>{const le=Y||s,re=d-($||0),ee=p-(ne||0),de=(n.width*le-x.width)/2/le,H=(n.height*le-x.height)/2/le;u(Math.min(Math.abs(re),Math.max(de,0))*Math.sign(re)),m(Math.min(Math.abs(ee),Math.max(H,0))*Math.sign(ee))},[s,d,p,x,n.width,n.height]),j=k.useCallback(($,ne,Y,le)=>{const re=tee(Math.min(Math.max($+.001<t?$:t,1),t),5);re!==s&&(ne||y(),P(Y?Y*(1/s-1/re):0,le?le*(1/s-1/re):0,re),l(re))},[s,t,P,y]),M=zr(()=>{s>1&&(s>t&&j(t,!0),P())});qp(M,[C.width,C.height,M]);const V=k.useCallback(()=>j(s*N),[s,N,j]),G=k.useCallback(()=>j(s/N),[s,N,j]);return{zoom:s,offsetX:d,offsetY:p,disabled:D,changeOffsets:P,changeZoom:j,zoomIn:V,zoomOut:G}}const LSe=k.createContext(null),oee=ly("useZoom","ZoomControllerContext",LSe);function Btt({children:n}){const[t,i]=k.useState(),{slideRect:s}=Zg(),{imageRect:l,maxZoom:d}=jtt(s,t==null?void 0:t.imageDimensions),{zoom:u,offsetX:p,offsetY:m,disabled:y,changeZoom:_,changeOffsets:E,zoomIn:C,zoomOut:x}=Ftt(l,d,t==null?void 0:t.zoomWrapperRef);Mtt(u,y),Utt(u,d,y,_,E,t==null?void 0:t.zoomWrapperRef);const N=k.useMemo(()=>({zoom:u,maxZoom:d,offsetX:p,offsetY:m,disabled:y,zoomIn:C,zoomOut:x,changeZoom:_}),[u,d,p,m,y,C,x,_]);k.useImperativeHandle(PF().ref,()=>N,[N]);const O=k.useMemo(()=>({...N,setZoomWrapper:i}),[N,i]);return k.createElement(LSe.Provider,{value:O},n)}const Vtt=_w("ZoomIn",k.createElement(k.Fragment,null,k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),k.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),ztt=_w("ZoomOut",k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),xpe=k.forwardRef(function({zoomIn:t,onLoseFocus:i},s){const l=k.useRef(!1),d=k.useRef(!1),{zoom:u,maxZoom:p,zoomIn:m,zoomOut:y,disabled:_}=oee(),{render:E}=ph(),C=_||(t?u>=p:u<=1);return k.useEffect(()=>{C&&l.current&&d.current&&i(),C||(l.current=!0)},[C,i]),k.createElement(ree,{ref:s,disabled:C,label:t?"Zoom in":"Zoom out",icon:t?Vtt:ztt,renderIcon:t?E.iconZoomIn:E.iconZoomOut,onClick:t?m:y,onFocus:()=>{d.current=!0},onBlur:()=>{d.current=!1}})});function Htt(){const n=k.useRef(null),t=k.useRef(null),{focus:i}=Zg(),s=k.useCallback(u=>{var p,m;!((p=u.current)===null||p===void 0)&&p.disabled?i():(m=u.current)===null||m===void 0||m.focus()},[i]),l=k.useCallback(()=>s(n),[s]),d=k.useCallback(()=>s(t),[s]);return k.createElement(k.Fragment,null,k.createElement(xpe,{zoomIn:!0,ref:n,onLoseFocus:d}),k.createElement(xpe,{ref:t,onLoseFocus:l}))}function Gtt(){const{render:n}=ph(),t=oee();return n.buttonZoom?k.createElement(k.Fragment,null,n.buttonZoom(t)):k.createElement(Htt,null)}function Wtt(n){var t;return(((t=n.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function $tt({current:n,preload:t},{type:i,source:s}){switch(i){case"fetch":return n?{current:n,preload:s}:{current:s};case"done":return s===t?{current:s}:{current:n,preload:t};default:throw new Error(mSe)}}function Ktt(n){var t,i;const[{current:s,preload:l},d]=k.useReducer($tt,{}),{slide:u,rect:p,imageFit:m,render:y,interactive:_}=n,E=u.srcSet.sort((G,$)=>G.width-$.width),C=(t=u.width)!==null&&t!==void 0?t:E[E.length-1].width,x=(i=u.height)!==null&&i!==void 0?i:E[E.length-1].height,N=nee(u,m),O=Math.max(...E.map(G=>G.width)),D=Math.min((N?Math.max:Math.min)(p.width,C*(p.height/x)),O),P=Vet(),j=zr(()=>{var G;const $=(G=E.find(ne=>ne.width>=D*P))!==null&&G!==void 0?G:E[E.length-1];(!s||E.findIndex(ne=>ne.src===s)<E.findIndex(ne=>ne===$))&&d({type:"fetch",source:$.src})});qp(j,[p.width,p.height,P,j]);const M=zr(G=>d({type:"done",source:G})),V={WebkitTransform:_?"initial":"translateZ(0)"};return N||Object.assign(V,p.width/p.height<C/x?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),k.createElement(k.Fragment,null,l&&l!==s&&k.createElement(p9,{key:"preload",...n,slide:{...u,src:l,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...V},onLoad:()=>M(l),render:{...y,iconLoading:()=>null,iconError:()=>null}}),s&&k.createElement(p9,{key:"current",...n,slide:{...u,src:s,srcSet:void 0},style:V}))}function qtt({render:n,slide:t,offset:i,rect:s}){var l;const[d,u]=k.useState(),p=k.useRef(null),{zoom:m,maxZoom:y,offsetX:_,offsetY:E,setZoomWrapper:C}=oee(),x=m>1,{carousel:N,on:O}=ph(),{currentIndex:D}=dy();qp(()=>i===0?(C({zoomWrapperRef:p,imageDimensions:d}),()=>C(void 0)):()=>{},[i,d,C]);let P=(l=n.slide)===null||l===void 0?void 0:l.call(n,{slide:t,offset:i,rect:s,zoom:m,maxZoom:y});if(!P&&xx(t)){const j={slide:t,offset:i,rect:s,render:n,imageFit:N.imageFit,imageProps:N.imageProps,onClick:i===0?()=>{var M;return(M=O.click)===null||M===void 0?void 0:M.call(O,{index:D})}:void 0};P=Wtt(t)?k.createElement(Ktt,{...j,slide:t,interactive:x,rect:i===0?{width:s.width*m,height:s.height*m}:s}):k.createElement(p9,{onLoad:M=>u({width:M.naturalWidth,height:M.naturalHeight}),...j})}return P?k.createElement("div",{ref:p,className:Wp(Er(Oet),Er(YZ),Er(lSe),x&&Er(Let)),style:i===0?{transform:`scale(${m}) translateX(${_}px) translateY(${E}px)`}:void 0},P):null}const Ytt=({augment:n,addModule:t})=>{n(({zoom:i,toolbar:s,render:l,controller:d,...u})=>{const p=PSe(i);return{zoom:p,toolbar:Het(s,fpe,k.createElement(Gtt,null)),render:{...l,slide:m=>{var y;return xx(m.slide)?k.createElement(qtt,{render:l,...m}):(y=l.slide)===null||y===void 0?void 0:y.call(l,m)}},controller:{...d,preventDefaultWheelY:p.scrollToZoom},...u}}),t(cy(fpe,Btt))};function Xtt(n){var N,O,D,P,j,M,V,G,$,ne,Y,le,re,ee,de,H,ae,_e,me,Ce,he,pe,Oe,Fe,Ue,Ve,Re,Be,Xe,we,We,st,pt,Qe,Je,St,Xt,Ht,gn,It;k.useState(!0);const[t,i]=k.useState("details_tab"),[s,l]=k.useState(!1),[d,u]=dn.useState(0),p=Array.isArray((N=n.data)==null?void 0:N.gallery_urls)?(O=n.data)==null?void 0:O.gallery_urls.map(xt=>({src:xt})):[],m=(D=n.data)!=null&&D.media_url?[{src:(P=n.data)==null?void 0:P.media_url}]:[],y=xt=>{console.log("Key in handleSelectedTab =",xt),xt=="details_tab"&&console.log("Entering into details_tab"),xt=="likes_tab"&&(console.log("Entering into likes"),n.likesListHandler(n.parent_id)),xt=="comments_tab"&&n.handleCommentList(n.parent_id),i(xt)},_={shouldSwiperUpdate:!0,rebuildOnUpdate:!0,autoplay:{delay:4e3,disableOnInteraction:!1},effect:"slide",pagination:{el:".swiper-pagination",clickable:!0},spaceBetween:15,grabCursor:!0};let E="16x9";switch((j=n.data)==null?void 0:j.media_type){case"video":E="16x9";break;case"audio":E="21x9";break;case"image":E="16x9";break;default:E="16x9"}const C=((M=n.data)==null?void 0:M.media_type)==="audio"&&{marginTop:"-90px"};function x(xt,mt){console.log("Image clicked = ",xt," Index = ",mt),u(mt),l(!0)}return h.jsxs(h.Fragment,{children:[h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsxs(wn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:`heading-icon ${n.mediaIconClass} d-flex justify-content-center align-items-center rounded-circl font-24`,children:h.jsx(tn,{tag:n.mediaIcon})})}),h.jsx("div",{className:"heading flex-grow-1 ms-2",children:(V=n.data)==null?void 0:V.name})]})}),h.jsx(wn.Body,{className:"no-scrollbar py-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[((G=n.data)==null?void 0:G.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(ne=($=n==null?void 0:n.parentData)==null?void 0:$.user_info)==null?void 0:ne.name]})," ",h.jsx("div",{children:`${(le=(Y=n==null?void 0:n.parentData)==null?void 0:Y.expiry_date)==null?void 0:le.day} ${(ee=(re=n==null?void 0:n.parentData)==null?void 0:re.expiry_date)==null?void 0:ee.month} ${(H=(de=n==null?void 0:n.parentData)==null?void 0:de.expiry_date)==null?void 0:H.year}`})]}),h.jsx("div",{className:"",children:h.jsx("a",{href:`${(ae=n.data)==null?void 0:ae.media_url}`,target:"_system",className:"btn btn-theme btn-sm btn-secondary py-2",children:"View in Browser"})})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(me=(_e=n==null?void 0:n.parentData)==null?void 0:_e.user_info)==null?void 0:me.name]})," "]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx("div",{children:`${(he=(Ce=n==null?void 0:n.parentData)==null?void 0:Ce.expiry_date)==null?void 0:he.day} ${(Oe=(pe=n==null?void 0:n.parentData)==null?void 0:pe.expiry_date)==null?void 0:Oe.month} ${(Ue=(Fe=n==null?void 0:n.parentData)==null?void 0:Fe.expiry_date)==null?void 0:Ue.year}`})})]})}),((Ve=n.data)==null?void 0:Ve.media_type)==="pdf"?h.jsx(h.Fragment,{children:h.jsx(iu,{aspectRatio:"9x16",className:"pdf-container mb-2 overflow-hidden border",style:{height:"calc(100% - 15vh)",borderRadius:10},children:h.jsx(KZ,{fileUrl:(Re=n.data)==null?void 0:Re.media_url,isModalOpen:!0,className:"overflow-scroll mb-2"})})}):h.jsx(h.Fragment,{children:((Be=n.data)==null?void 0:Be.media_type.toLowerCase())==="image"?h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx("img",{src:n.data.media_url,alt:`${(Xe=n.data)==null?void 0:Xe.name} image`,className:"img-fluid mx-auto",onClick:()=>l(!0)})})}):h.jsx(h.Fragment,{children:((we=n.data)==null?void 0:we.media_type.toLowerCase())==="gallery"&&Array.isArray((We=n.data)==null?void 0:We.gallery_urls)?h.jsx(h.Fragment,{children:((pt=(st=n.data)==null?void 0:st.gallery_urls)==null?void 0:pt.length)>0?h.jsx("div",{className:"mb-4",children:h.jsx(CZ,{..._,containerClass:"swiper-container theme-swiper media-gallery-swiper mb-2 position-relative",children:(Qe=n.data)==null?void 0:Qe.gallery_urls.map((xt,mt)=>{var dt,it;return h.jsx(et,{className:"card-slide shadow-sm border-0 overflow-hidden bg-transparent shadow-none",onClick:()=>x(xt,mt),children:h.jsx(et.Body,{className:"p-0",children:h.jsx(Ts,{src:xt,alt:`Magazine Media ${(dt=n.data)==null?void 0:dt.name} image ${mt+1}`})})},`${(it=n.data)==null?void 0:it.name} image ${mt+1}`)})})}):h.jsx(h.Fragment,{})}):h.jsx("div",{className:"media-container mb-2",children:h.jsx(iu,{aspectRatio:`${E}`,style:C,children:h.jsx(gw,{url:(Je=n.data)==null?void 0:Je.media_url,width:"100%",height:"100%",controls:!0,playing:!1})})})})}),h.jsxs(Zn.Container,{id:"media-tabs-example",className:"main_tabs",activeKey:t,onSelect:xt=>y(xt),children:[h.jsx("div",{className:"tab_links position-relative",children:h.jsxs(Un,{variant:"pills",className:"nav-justified",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"likes_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.likeCount} ${(n==null?void 0:n.likeCount)===1?"Like":"Likes"}`})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"comments_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.commentsCount} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"details_tab",children:[h.jsxs("div",{className:"border-to border-botto py-1 d-flex align-items-center justify-content-between",children:[h.jsx("div",{children:h.jsx("span",{className:"font-13 text-gray7 border-en pe-",children:`${(St=n.data)==null?void 0:St.points} Points`})}),h.jsx("div",{children:h.jsxs("span",{className:"font-13 text-gray7 border-en pe-",children:[h.jsx(tn,{tag:"view1",className:"me-1 font-16"}),`${(Xt=n.data)!=null&&Xt.view_count?(Ht=n.data)==null?void 0:Ht.view_count:0} Views`]})})]}),h.jsx("div",{className:"border-to font-14 text-gray7 pb-2 border-botto pt-2 mb-2",children:(gn=n.data)==null?void 0:gn.description})]}),h.jsx(Zn.Pane,{className:"",eventKey:"likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(Rx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:n.parent_id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(mw,{comment_type:n.comment_type,loading:n.loading,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]}),h.jsx(Ltt,{open:s,close:()=>l(!1),index:d,on:{view:({index:xt})=>u(xt)},slides:((It=n.data)==null?void 0:It.media_type.toLowerCase())==="gallery"?p:m,carousel:{finite:p.length<=1},controller:{closeOnBackdropClick:!0},animation:{fade:400,swipe:400},render:{buttonPrev:p.length<=1?()=>null:void 0,buttonNext:p.length<=1?()=>null:void 0},plugins:[Ytt]})]})}function Jtt(n){const t=n.message_title?n.message_title:"",i=n.message_text?n.message_text:"This is a sample message text.",s=n.show_action_button?n.show_action_button:!1,l={closeButton:!0};return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",className:"theme-modal confirmation-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb-2",...l,children:h.jsxs(wn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:"heading-icon d-flex justify-content-center align-items-center rounded-circle font-24",children:h.jsx(KU,{})})}),h.jsx("div",{className:"heading flex-grow-1 ms-3",children:t!==""?h.jsx(h.Fragment,{children:t}):"Information"})]})}),h.jsxs(wn.Body,{children:[h.jsx("div",{className:"modal-helper-text",children:i}),s&&h.jsx("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:h.jsx(Lt,{type:"submit",className:`btn-theme
btn-gray btn-md flex-grow-1 text-capitalize`,onClick:n.handleClose,children:"Cancel"})})]})]})})}function Qtt(n){var Re,Be,Xe,we,We,st,pt,Qe,Je,St,Xt,Ht,gn,It;const[t,i]=k.useState((Re=n.media)==null?void 0:Re.is_liked),[s,l]=k.useState((Be=n.media)==null?void 0:Be.likes_count),[d,u]=k.useState(((Xe=n.media)==null?void 0:Xe.viewed)||!1),[p,m]=k.useState(null),[y,_]=k.useState(!1),[E,C]=k.useState((we=n.media)==null?void 0:we.comments_count),[x,N]=k.useState(!1),[O,D]=k.useState([]),[P,j]=k.useState(!0),[M,V]=k.useState([]),[G,$]=k.useState(!0),[ne,Y]=k.useState({isVisible:!1}),[le,re]=k.useState(!1),ee=(We=n.media)!=null&&We.media_type?(st=n.media)==null?void 0:st.media_type.toLowerCase():"image",{mediaIcon:de,mediaIconClass:H}=ILe(ee);let ae=(pt=n.media)!=null&&pt.media_url?(Qe=n.media)==null?void 0:Qe.media_url:"";const _e=()=>{Y({isVisible:!1})},me=()=>{Y({isVisible:!0})},Ce=()=>{re(!1)},he=()=>{re(!0)},pe=async()=>{var xt,mt;if(!n.is_allowed_to_view){he();return}if(Ve((xt=n.media)==null?void 0:xt.id),ee==="quiz"||ee==="external"||ee==="survey"||ee==="form"){console.log("You will be redirected to a media link - ",ee,`
Media type is `,(mt=n.media)==null?void 0:mt.media_url),ae!==""&&await sx.open({url:ae,toolbarColor:Y2});return}me()};async function Oe(xt){N(!0),xt&&ps.getMagazineMediaLike(xt).then(mt=>{var dt,it;mt.data.status==="success"&&(i((dt=mt.data.data)==null?void 0:dt.is_liked),l((it=mt.data.data)==null?void 0:it.likes_count),Fe(xt),N(!1))}).catch(mt=>{var dt,it;N(!1),i((dt=n.media)==null?void 0:dt.is_liked),l((it=n.media)==null?void 0:it.likes_count),console.log("Error in getMagazineMediaLike = ",mt)})}async function Fe(xt){xt&&ps.getMagazineMediaLikesList(xt).then(mt=>{var dt;mt.data.status==="success"&&(D((dt=mt.data.data)==null?void 0:dt.likes),j(!1))}).catch(mt=>{j(!1),D([]),console.log("Error in getMagazineMediaLikesList = ",mt)})}async function Ue(xt){xt&&ps.getAllMagazineMediaCommentList(xt).then(mt=>{var dt;mt.data.status==="success"&&(V((dt=mt.data.data)==null?void 0:dt.comments),$(!1))}).catch(mt=>{$(!1),V([]),console.log("Error in getAllMagazineMediaCommentList = ",mt)})}async function Ve(xt){_(!0),xt&&ps.getMagazineMediaDetails(xt).then(mt=>{var dt,it,Me;if(console.log("getMagazineMediaDetails RES = ",mt.data),mt.data.status==="success"){const Ge=(dt=mt.data.data)==null?void 0:dt.media,bt=(Me=(it=mt.data.data)==null?void 0:it.media)==null?void 0:Me.viewed;m(Ge),u(bt),_(!1)}}).catch(mt=>{var dt;_(!1),m(null),u((dt=n.media)==null?void 0:dt.viewed),console.log("Error in getMagazineMediaDetails = ",mt)})}return h.jsxs(h.Fragment,{children:[h.jsxs(et,{className:`card-theme media-card border-0 shadow-sm ${((Je=n.media)==null?void 0:Je.viewed)&&"media-viewed"}`,children:[h.jsxs(et.Header,{className:"p-2 p-sm-3 position-relative border-bottom-0",onClick:pe,children:[d&&h.jsx("div",{className:"media-viewed-icon position-absolute",children:h.jsx(tn,{tag:"check1",className:"font-18"})}),h.jsxs("div",{className:"d-flex media-header-container align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:`d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden ${H}`,children:h.jsx(tn,{tag:de,className:"font-28"})})}),h.jsx("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:h.jsx("span",{className:"d-block",children:(St=n.media)==null?void 0:St.name})})]})]}),h.jsx(et.Body,{className:"p-2 px-sm-3 font-14 text-grey",children:h.jsx("div",{className:"media-info text-truncate",children:(Xt=n.media)==null?void 0:Xt.description})}),ee!=="quiz"||ee!=="external"?h.jsx(et.Footer,{className:"p-2 px-sm-3 bg-transparent",children:h.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[h.jsx("div",{className:"d-fl",children:h.jsx("span",{className:"font-13 text-gray7 border-en pe-",children:`${(Ht=n.media)==null?void 0:Ht.points} Points`})}),h.jsxs("div",{className:"btn-wrap",children:[(ee==="quiz"||ee==="external"||ee==="form"||ee==="survey")&&h.jsx(h.Fragment,{children:h.jsxs(Lt,{className:"btn-theme btn-sm btn-secondary-light px-2",onClick:pe,children:[`Open ${vx(ee)} ${ee==="external"?"Link ":""}`,h.jsx(tn,{tag:"arrow-right2",className:"font-14"})]})}),(ee==="video"||ee==="audio"||ee==="image"||ee==="pdf")&&h.jsxs(h.Fragment,{children:[h.jsx(Lt,{className:`btn-theme btn-sm btn-likes-light px-2 pe-none ${t&&"active"}`,children:x?h.jsx(Zi,{animation:"border",size:"sm"}):h.jsxs(h.Fragment,{children:[h.jsx(tn,{tag:"favorite3",className:"font-18"})," ",s]})}),h.jsxs(Lt,{className:"btn-theme btn-sm btn-gray px-2 pe-none",children:[h.jsx(tn,{tag:"message8",className:"font-18"})," ",E]})]})]})]})}):null]}),h.jsx(Xtt,{show:ne,handleClose:_e,data:p,loadingData:y,parentData:n.magazineDetails,mediaIcon:de,mediaIconClass:H,mediaUrl:(gn=n.media)==null?void 0:gn.media_url,likesData:O,likeCount:s,isLiked:t,likeActionHandler:Oe,loadingMediaLike:x,loadingLikesList:P,likesListHandler:Fe,parent_id:(It=n.media)==null?void 0:It.id,parent_owner_id:null,comment_type:"media",loading:G,comments:M,handleCommentList:Ue,setCommentsCount:C,commentsCount:E}),h.jsx(Jtt,{show:le,handleClose:Ce,allow_action_button:!1,message_title:"Media display paused",message_text:"This magazine only allows sequential viewing, limiting simultaneous display."})]})}function Ztt(n){var y;const{magazineId:t}=PU();k.useState(!1);const[i,s]=k.useState(null),[l,d]=k.useState(!0),[u,p]=k.useState([]);async function m(_){ps.getMagazineDetails(_).then(E=>{var C,x;console.log("getMagazineDetails RES = ",E.data),E.data.status==="success"&&(s(E.data.data.magazine),p((x=(C=E.data)==null?void 0:C.data)==null?void 0:x.medias),d(!1))}).catch(E=>{d(!1),s(null),console.log("Error in getMagazineDetails = ",E)})}return k.useEffect(()=>{m(t)},[]),h.jsx(h.Fragment,{children:h.jsx(qi,{className:"magazine-details-page",children:h.jsxs(Yn,{className:"mb-4",children:[l&&h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"}),!l&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"p-2 ps-0 font-15 fw-sb",children:i==null?void 0:i.name}),h.jsx(Ts,{src:i==null?void 0:i.image,alt:`${i==null?void 0:i.name} image`,wrapperClassName:"card-img mb-3"}),h.jsxs("div",{className:"font-13 mb-3",children:[h.jsxs("span",{className:"text-theme-primary fw-sb mb-1",children:["Published By:"," "]})," ",(y=i==null?void 0:i.user_info)==null?void 0:y.name,h.jsx(bP,{text:i==null?void 0:i.description,linesToShow:2,containerClass:"font-13 contest-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}})]}),h.jsx("hr",{}),h.jsx("div",{className:"font-14 fw-sb mb-3",children:"All Media"}),h.jsx("div",{className:"d-grid gap-3",children:u.length>0?h.jsx(h.Fragment,{children:u.map((_,E)=>{var D;const C=i==null?void 0:i.is_sequenced;let x=0,N=!0,O=!0;return C==="yes"&&E>0?(x=E>0?E-1:0,N=x>=0&&((D=u[x])==null?void 0:D.viewed),O=!!N):O=!0,h.jsx(Qtt,{media:_,magazineDetails:i,is_allowed_to_view:O},_.id)})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more media"})})})]})]})})})}var ent=Object.create,LF=Object.defineProperty,tnt=Object.getOwnPropertyDescriptor,nnt=Object.getOwnPropertyNames,int=Object.getPrototypeOf,rnt=Object.prototype.hasOwnProperty,snt=(n,t)=>{for(var i in t)LF(n,i,{get:t[i],enumerable:!0})},DSe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of nnt(t))!rnt.call(n,l)&&l!==i&&LF(n,l,{get:()=>t[l],enumerable:!(s=tnt(t,l))||s.enumerable});return n},lee=(n,t,i)=>(i=n!=null?ent(int(n)):{},DSe(t||!n||!n.__esModule?LF(i,"default",{value:n,enumerable:!0}):i,n)),ant=n=>DSe(LF({},"__esModule",{value:!0}),n),kSe={};snt(kSe,{callPlayer:()=>Snt,getConfig:()=>Ent,getSDK:()=>_nt,isBlobUrl:()=>Cnt,isMediaStream:()=>bnt,lazy:()=>dnt,omit:()=>wnt,parseEndTime:()=>gnt,parseStartTime:()=>mnt,queryString:()=>ynt,randomString:()=>vnt,supportsWebKitPresentationMode:()=>Tnt});var DF=ant(kSe),ont=lee(k),lnt=lee(fEe),cnt=lee(mF);const dnt=n=>ont.default.lazy(async()=>{const t=await n();return typeof t.default=="function"?t:t.default}),unt=/[?&#](?:start|t)=([0-9hms]+)/,hnt=/[?&#]end=([0-9hms]+)/,vJ=/(\d+)(h|m|s)/g,fnt=/^\d+$/;function MSe(n,t){if(n instanceof Array)return;const i=n.match(t);if(i){const s=i[1];if(s.match(vJ))return pnt(s);if(fnt.test(s))return parseInt(s)}}function pnt(n){let t=0,i=vJ.exec(n);for(;i!==null;){const[,s,l]=i;l==="h"&&(t+=parseInt(s,10)*60*60),l==="m"&&(t+=parseInt(s,10)*60),l==="s"&&(t+=parseInt(s,10)),i=vJ.exec(n)}return t}function mnt(n){return MSe(n,unt)}function gnt(n){return MSe(n,hnt)}function vnt(){return Math.random().toString(36).substr(2,5)}function ynt(n){return Object.keys(n).map(t=>`${t}=${n[t]}`).join("&")}function $K(n){return window[n]?window[n]:window.exports&&window.exports[n]?window.exports[n]:window.module&&window.module.exports&&window.module.exports[n]?window.module.exports[n]:null}const rC={},_nt=function(t,i,s=null,l=()=>!0,d=lnt.default){const u=$K(i);return u&&l(u)?Promise.resolve(u):new Promise((p,m)=>{if(rC[t]){rC[t].push({resolve:p,reject:m});return}rC[t]=[{resolve:p,reject:m}];const y=_=>{rC[t].forEach(E=>E.resolve(_))};if(s){const _=window[s];window[s]=function(){_&&_(),y($K(i))}}d(t,_=>{_?(rC[t].forEach(E=>E.reject(_)),rC[t]=null):s||y($K(i))})})};function Ent(n,t){return(0,cnt.default)(t.config,n.config)}function wnt(n,...t){const i=[].concat(...t),s={},l=Object.keys(n);for(const d of l)i.indexOf(d)===-1&&(s[d]=n[d]);return s}function Snt(n,...t){if(!this.player||!this.player[n]){let i=`ReactPlayer: ${this.constructor.displayName} player could not call %c${n}%c – `;return this.player?this.player[n]||(i+="The method was not available"):i+="The player was not available",console.warn(i,"font-weight: bold",""),null}return this.player[n](...t)}function bnt(n){return typeof window<"u"&&typeof window.MediaStream<"u"&&n instanceof window.MediaStream}function Cnt(n){return/^blob:/.test(n)}function Tnt(n=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return n.webkitSupportsPresentationMode&&typeof n.webkitSetPresentationMode=="function"&&t}var cee=Object.defineProperty,Rnt=Object.getOwnPropertyDescriptor,xnt=Object.getOwnPropertyNames,Ant=Object.prototype.hasOwnProperty,Int=(n,t)=>{for(var i in t)cee(n,i,{get:t[i],enumerable:!0})},Nnt=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of xnt(t))!Ant.call(n,l)&&l!==i&&cee(n,l,{get:()=>t[l],enumerable:!(s=Rnt(t,l))||s.enumerable});return n},Ont=n=>Nnt(cee({},"__esModule",{value:!0}),n),jSe={};Int(jSe,{AUDIO_EXTENSIONS:()=>dee,DASH_EXTENSIONS:()=>XSe,FLV_EXTENSIONS:()=>JSe,HLS_EXTENSIONS:()=>hee,MATCH_URL_DAILYMOTION:()=>$Se,MATCH_URL_FACEBOOK:()=>BSe,MATCH_URL_FACEBOOK_WATCH:()=>VSe,MATCH_URL_KALTURA:()=>YSe,MATCH_URL_MIXCLOUD:()=>KSe,MATCH_URL_SOUNDCLOUD:()=>USe,MATCH_URL_STREAMABLE:()=>zSe,MATCH_URL_TWITCH_CHANNEL:()=>WSe,MATCH_URL_TWITCH_VIDEO:()=>GSe,MATCH_URL_VIDYARD:()=>qSe,MATCH_URL_VIMEO:()=>FSe,MATCH_URL_WISTIA:()=>HSe,MATCH_URL_YOUTUBE:()=>yJ,VIDEO_EXTENSIONS:()=>uee,canPlay:()=>Lnt});var Pnt=Ont(jSe),Ape=DF;const yJ=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,USe=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,FSe=/vimeo\.com\/(?!progressive_redirect).+/,BSe=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,VSe=/^https?:\/\/fb\.watch\/.+$/,zSe=/streamable\.com\/([a-z0-9]+)$/,HSe=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,GSe=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,WSe=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,$Se=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,KSe=/mixcloud\.com\/([^/]+\/[^/]+)/,qSe=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,YSe=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,dee=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,uee=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,hee=/\.(m3u8)($|\?)/i,XSe=/\.(mpd)($|\?)/i,JSe=/\.(flv)($|\?)/i,_J=n=>{if(n instanceof Array){for(const t of n)if(typeof t=="string"&&_J(t)||_J(t.src))return!0;return!1}return(0,Ape.isMediaStream)(n)||(0,Ape.isBlobUrl)(n)?!0:dee.test(n)||uee.test(n)||hee.test(n)||XSe.test(n)||JSe.test(n)},Lnt={youtube:n=>n instanceof Array?n.every(t=>yJ.test(t)):yJ.test(n),soundcloud:n=>USe.test(n)&&!dee.test(n),vimeo:n=>FSe.test(n)&&!uee.test(n)&&!hee.test(n),facebook:n=>BSe.test(n)||VSe.test(n),streamable:n=>zSe.test(n),wistia:n=>HSe.test(n),twitch:n=>GSe.test(n)||WSe.test(n),dailymotion:n=>$Se.test(n),mixcloud:n=>KSe.test(n),vidyard:n=>qSe.test(n),kaltura:n=>YSe.test(n),file:_J};var fee=Object.defineProperty,Dnt=Object.getOwnPropertyDescriptor,knt=Object.getOwnPropertyNames,Mnt=Object.prototype.hasOwnProperty,jnt=(n,t)=>{for(var i in t)fee(n,i,{get:t[i],enumerable:!0})},Unt=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of knt(t))!Mnt.call(n,l)&&l!==i&&fee(n,l,{get:()=>t[l],enumerable:!(s=Dnt(t,l))||s.enumerable});return n},Fnt=n=>Unt(fee({},"__esModule",{value:!0}),n),QSe={};jnt(QSe,{default:()=>Vnt});var Bnt=Fnt(QSe),Td=DF,zc=Pnt,Vnt=[{key:"youtube",name:"YouTube",canPlay:zc.canPlay.youtube,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./YouTube-CrvARppZ.js").then(n=>n.Y),__vite__mapDeps([])))},{key:"soundcloud",name:"SoundCloud",canPlay:zc.canPlay.soundcloud,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./SoundCloud-BaG3gB4E.js").then(n=>n.S),__vite__mapDeps([])))},{key:"vimeo",name:"Vimeo",canPlay:zc.canPlay.vimeo,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Vimeo-DM8pTtm_.js").then(n=>n.V),__vite__mapDeps([])))},{key:"facebook",name:"Facebook",canPlay:zc.canPlay.facebook,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Facebook-C6sahV9v.js").then(n=>n.F),__vite__mapDeps([])))},{key:"streamable",name:"Streamable",canPlay:zc.canPlay.streamable,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Streamable-DGJrUccc.js").then(n=>n.S),__vite__mapDeps([])))},{key:"wistia",name:"Wistia",canPlay:zc.canPlay.wistia,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Wistia-BY-E4kPW.js").then(n=>n.W),__vite__mapDeps([])))},{key:"twitch",name:"Twitch",canPlay:zc.canPlay.twitch,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Twitch-2Ng_dShG.js").then(n=>n.T),__vite__mapDeps([])))},{key:"dailymotion",name:"DailyMotion",canPlay:zc.canPlay.dailymotion,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./DailyMotion-BcVX-Qf7.js").then(n=>n.D),__vite__mapDeps([])))},{key:"mixcloud",name:"Mixcloud",canPlay:zc.canPlay.mixcloud,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Mixcloud-CGuM-8L-.js").then(n=>n.M),__vite__mapDeps([])))},{key:"vidyard",name:"Vidyard",canPlay:zc.canPlay.vidyard,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Vidyard-CJtG4x0V.js").then(n=>n.V),__vite__mapDeps([])))},{key:"kaltura",name:"Kaltura",canPlay:zc.canPlay.kaltura,lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./Kaltura-CEZvggyo.js").then(n=>n.K),__vite__mapDeps([])))},{key:"file",name:"FilePlayer",canPlay:zc.canPlay.file,canEnablePIP:n=>zc.canPlay.file(n)&&(document.pictureInPictureEnabled||(0,Td.supportsWebKitPresentationMode)())&&!zc.AUDIO_EXTENSIONS.test(n),lazyPlayer:(0,Td.lazy)(()=>lr(()=>import("./FilePlayer-B7MXX5ut.js").then(n=>n.F),__vite__mapDeps([])))}],znt=Object.create,kF=Object.defineProperty,Hnt=Object.getOwnPropertyDescriptor,Gnt=Object.getOwnPropertyNames,Wnt=Object.getPrototypeOf,$nt=Object.prototype.hasOwnProperty,Knt=(n,t)=>{for(var i in t)kF(n,i,{get:t[i],enumerable:!0})},ZSe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Gnt(t))!$nt.call(n,l)&&l!==i&&kF(n,l,{get:()=>t[l],enumerable:!(s=Hnt(t,l))||s.enumerable});return n},qnt=(n,t,i)=>(i=n!=null?znt(Wnt(n)):{},ZSe(t||!n||!n.__esModule?kF(i,"default",{value:n,enumerable:!0}):i,n)),Ynt=n=>ZSe(kF({},"__esModule",{value:!0}),n),ebe={};Knt(ebe,{defaultProps:()=>Qnt,propTypes:()=>Jnt});var tbe=Ynt(ebe),Xnt=qnt(zQ);const{string:ql,bool:Yl,number:sC,array:KK,oneOfType:$3,shape:Hu,object:Xl,func:za,node:Ipe}=Xnt.default,Jnt={url:$3([ql,KK,Xl]),playing:Yl,loop:Yl,controls:Yl,volume:sC,muted:Yl,playbackRate:sC,width:$3([ql,sC]),height:$3([ql,sC]),style:Xl,progressInterval:sC,playsinline:Yl,pip:Yl,stopOnUnmount:Yl,light:$3([Yl,ql,Xl]),playIcon:Ipe,previewTabIndex:sC,fallback:Ipe,oEmbedUrl:ql,wrapper:$3([ql,za,Hu({render:za.isRequired})]),config:Hu({soundcloud:Hu({options:Xl}),youtube:Hu({playerVars:Xl,embedOptions:Xl,onUnstarted:za}),facebook:Hu({appId:ql,version:ql,playerId:ql,attributes:Xl}),dailymotion:Hu({params:Xl}),vimeo:Hu({playerOptions:Xl,title:ql}),file:Hu({attributes:Xl,tracks:KK,forceVideo:Yl,forceAudio:Yl,forceHLS:Yl,forceSafariHLS:Yl,forceDisableHls:Yl,forceDASH:Yl,forceFLV:Yl,hlsOptions:Xl,hlsVersion:ql,dashVersion:ql,flvVersion:ql}),wistia:Hu({options:Xl,playerId:ql,customControls:KK}),mixcloud:Hu({options:Xl}),twitch:Hu({options:Xl,playerId:ql}),vidyard:Hu({options:Xl})}),onReady:za,onStart:za,onPlay:za,onPause:za,onBuffer:za,onBufferEnd:za,onEnded:za,onError:za,onDuration:za,onSeek:za,onPlaybackRateChange:za,onPlaybackQualityChange:za,onProgress:za,onClickPreview:za,onEnablePIP:za,onDisablePIP:za},Uo=()=>{},Qnt={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:Uo},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:Uo,onStart:Uo,onPlay:Uo,onPause:Uo,onBuffer:Uo,onBufferEnd:Uo,onEnded:Uo,onError:Uo,onDuration:Uo,onSeek:Uo,onPlaybackRateChange:Uo,onPlaybackQualityChange:Uo,onProgress:Uo,onClickPreview:Uo,onEnablePIP:Uo,onDisablePIP:Uo};var Znt=Object.create,kP=Object.defineProperty,eit=Object.getOwnPropertyDescriptor,tit=Object.getOwnPropertyNames,nit=Object.getPrototypeOf,iit=Object.prototype.hasOwnProperty,rit=(n,t,i)=>t in n?kP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,sit=(n,t)=>{for(var i in t)kP(n,i,{get:t[i],enumerable:!0})},nbe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of tit(t))!iit.call(n,l)&&l!==i&&kP(n,l,{get:()=>t[l],enumerable:!(s=eit(t,l))||s.enumerable});return n},ibe=(n,t,i)=>(i=n!=null?Znt(nit(n)):{},nbe(t||!n||!n.__esModule?kP(i,"default",{value:n,enumerable:!0}):i,n)),ait=n=>nbe(kP({},"__esModule",{value:!0}),n),ma=(n,t,i)=>(rit(n,typeof t!="symbol"?t+"":t,i),i),rbe={};sit(rbe,{default:()=>MF});var oit=ait(rbe),Npe=ibe(k),lit=ibe(yF),sbe=tbe,cit=DF;const dit=5e3;class MF extends Npe.Component{constructor(){super(...arguments),ma(this,"mounted",!1),ma(this,"isReady",!1),ma(this,"isPlaying",!1),ma(this,"isLoading",!0),ma(this,"loadOnReady",null),ma(this,"startOnPlay",!0),ma(this,"seekOnPlay",null),ma(this,"onDurationCalled",!1),ma(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),ma(this,"getInternalPlayer",t=>this.player?this.player[t]:null),ma(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,i=this.getSecondsLoaded(),s=this.getDuration();if(s){const l={playedSeconds:t,played:t/s};i!==null&&(l.loadedSeconds=i,l.loaded=i/s),(l.playedSeconds!==this.prevPlayed||l.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(l),this.prevPlayed=l.playedSeconds,this.prevLoaded=l.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),ma(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:i,volume:s,muted:l}=this.props;t(),!l&&s!==null&&this.player.setVolume(s),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):i&&this.player.play(),this.handleDurationCheck()}),ma(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:i,playbackRate:s}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&s!==1&&this.player.setPlaybackRate(s),t(),this.startOnPlay=!1),i(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),ma(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),ma(this,"handleEnded",()=>{const{activePlayer:t,loop:i,onEnded:s}=this.props;t.loopOnEnded&&i&&this.seekTo(0),i||(this.isPlaying=!1,s())}),ma(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),ma(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),ma(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:i,playing:s,volume:l,muted:d,playbackRate:u,pip:p,loop:m,activePlayer:y,disableDeferredLoading:_}=this.props;if(!(0,lit.default)(t.url,i)){if(this.isLoading&&!y.forceLoad&&!_&&!(0,cit.isMediaStream)(i)){console.warn(`ReactPlayer: the attempt to load ${i} is being deferred until the player has loaded`),this.loadOnReady=i;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(i,this.isReady)}!t.playing&&s&&!this.isPlaying&&this.player.play(),t.playing&&!s&&this.isPlaying&&this.player.pause(),!t.pip&&p&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!p&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==l&&l!==null&&this.player.setVolume(l),t.muted!==d&&(d?this.player.mute():(this.player.unmute(),l!==null&&setTimeout(()=>this.player.setVolume(l)))),t.playbackRate!==u&&this.player.setPlaybackRate&&this.player.setPlaybackRate(u),t.loop!==m&&this.player.setLoop&&this.player.setLoop(m)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,i,s){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},dit));return}if(i?i==="fraction":t>0&&t<1){const d=this.player.getDuration();if(!d){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(d*t,s);return}this.player.seekTo(t,s)}render(){const t=this.props.activePlayer;return t?Npe.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}ma(MF,"displayName","Player");ma(MF,"propTypes",sbe.propTypes);ma(MF,"defaultProps",sbe.defaultProps);var uit=Object.create,MP=Object.defineProperty,hit=Object.getOwnPropertyDescriptor,fit=Object.getOwnPropertyNames,pit=Object.getPrototypeOf,mit=Object.prototype.hasOwnProperty,git=(n,t,i)=>t in n?MP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,vit=(n,t)=>{for(var i in t)MP(n,i,{get:t[i],enumerable:!0})},abe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of fit(t))!mit.call(n,l)&&l!==i&&MP(n,l,{get:()=>t[l],enumerable:!(s=hit(t,l))||s.enumerable});return n},jP=(n,t,i)=>(i=n!=null?uit(pit(n)):{},abe(t||!n||!n.__esModule?MP(i,"default",{value:n,enumerable:!0}):i,n)),yit=n=>abe(MP({},"__esModule",{value:!0}),n),fa=(n,t,i)=>(git(n,typeof t!="symbol"?t+"":t,i),i),obe={};vit(obe,{createReactPlayer:()=>xit});var _it=yit(obe),yC=jP(k),Eit=jP(mF),qK=jP(DEe),Ope=jP(yF),R4=tbe,lbe=DF,wit=jP(oit);const Sit=(0,lbe.lazy)(()=>lr(()=>import("./Preview-D4yss-rg.js").then(n=>n.P),__vite__mapDeps([]))),bit=typeof window<"u"&&window.document,Cit=typeof Ws<"u"&&Ws.window&&Ws.window.document,Tit=Object.keys(R4.propTypes),Rit=bit||Cit?yC.Suspense:()=>null,K3=[],xit=(n,t)=>{var i;return i=class extends yC.Component{constructor(){super(...arguments),fa(this,"state",{showPreview:!!this.props.light}),fa(this,"references",{wrapper:s=>{this.wrapper=s},player:s=>{this.player=s}}),fa(this,"handleClickPreview",s=>{this.setState({showPreview:!1}),this.props.onClickPreview(s)}),fa(this,"showPreview",()=>{this.setState({showPreview:!0})}),fa(this,"getDuration",()=>this.player?this.player.getDuration():null),fa(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),fa(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),fa(this,"getInternalPlayer",(s="player")=>this.player?this.player.getInternalPlayer(s):null),fa(this,"seekTo",(s,l,d)=>{if(!this.player)return null;this.player.seekTo(s,l,d)}),fa(this,"handleReady",()=>{this.props.onReady(this)}),fa(this,"getActivePlayer",(0,qK.default)(s=>{for(const l of[...K3,...n])if(l.canPlay(s))return l;return t||null})),fa(this,"getConfig",(0,qK.default)((s,l)=>{const{config:d}=this.props;return Eit.default.all([R4.defaultProps.config,R4.defaultProps.config[l]||{},d,d[l]||{}])})),fa(this,"getAttributes",(0,qK.default)(s=>(0,lbe.omit)(this.props,Tit))),fa(this,"renderActivePlayer",s=>{if(!s)return null;const l=this.getActivePlayer(s);if(!l)return null;const d=this.getConfig(s,l.key);return yC.default.createElement(wit.default,{...this.props,key:l.key,ref:this.references.player,config:d,activePlayer:l.lazyPlayer||l,onReady:this.handleReady})})}shouldComponentUpdate(s,l){return!(0,Ope.default)(this.props,s)||!(0,Ope.default)(this.state,l)}componentDidUpdate(s){const{light:l}=this.props;!s.light&&l&&this.setState({showPreview:!0}),s.light&&!l&&this.setState({showPreview:!1})}renderPreview(s){if(!s)return null;const{light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p}=this.props;return yC.default.createElement(Sit,{url:s,light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p,onClick:this.handleClickPreview})}render(){const{url:s,style:l,width:d,height:u,fallback:p,wrapper:m}=this.props,{showPreview:y}=this.state,_=this.getAttributes(s),E=typeof m=="string"?this.references.wrapper:void 0;return yC.default.createElement(m,{ref:E,style:{...l,width:d,height:u},..._},yC.default.createElement(Rit,{fallback:p},y?this.renderPreview(s):this.renderActivePlayer(s)))}},fa(i,"displayName","ReactPlayer"),fa(i,"propTypes",R4.propTypes),fa(i,"defaultProps",R4.defaultProps),fa(i,"addCustomPlayer",s=>{K3.push(s)}),fa(i,"removeCustomPlayers",()=>{K3.length=0}),fa(i,"canPlay",s=>{for(const l of[...K3,...n])if(l.canPlay(s))return!0;return!1}),fa(i,"canEnablePIP",s=>{for(const l of[...K3,...n])if(l.canEnablePIP&&l.canEnablePIP(s))return!0;return!1}),i};var Ait=Object.create,jF=Object.defineProperty,Iit=Object.getOwnPropertyDescriptor,Nit=Object.getOwnPropertyNames,Oit=Object.getPrototypeOf,Pit=Object.prototype.hasOwnProperty,Lit=(n,t)=>{for(var i in t)jF(n,i,{get:t[i],enumerable:!0})},cbe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Nit(t))!Pit.call(n,l)&&l!==i&&jF(n,l,{get:()=>t[l],enumerable:!(s=Iit(t,l))||s.enumerable});return n},Dit=(n,t,i)=>(i=n!=null?Ait(Oit(n)):{},cbe(t||!n||!n.__esModule?jF(i,"default",{value:n,enumerable:!0}):i,n)),kit=n=>cbe(jF({},"__esModule",{value:!0}),n),dbe={};Lit(dbe,{default:()=>Fit});var Mit=kit(dbe),EJ=Dit(Bnt),jit=_it;const Uit=EJ.default[EJ.default.length-1];var Fit=(0,jit.createReactPlayer)(EJ.default,Uit);const ube=ty(Mit);function pee({url:n,allowControls:t,allowLightMode:i,allowPlaying:s,previewImage:l,className:d,style:u,title:p}){const[m,y]=k.useState(!0),[_,E]=k.useState(""),[C,x]=k.useState(s),[N,O]=k.useState(i),[D,P]=k.useState(t);k.useEffect(()=>{console.log("Inside useeffect"),console.log("CustomMediaViewer loads =",_),n&&(console.log("inside if --- ",n),E(n),y(!1))},[n]);const j=d||"",M=u||null,V=l&&N?l:"/img/default-bg-low-quality.jpg",G=N&&h.jsx("div",{className:"d-flex justify-content-center align-items-center btn-theme btn-lg btn-icon rounded-circle shadow-lg",style:{background:"rgba(255,255,255,0.75)",color:"var(--color-gray2)"},onClick:Y=>$(),children:h.jsx(tn,{tag:"play3",className:"font-30"})});function $(Y){x(!0)}const ne=m&&h.jsx(Zi,{animation:"border",variant:"dark"});return h.jsx(h.Fragment,{children:_?h.jsx("div",{className:`custom-video-viewer-card ratio ratio-16x9 overflow-hidden rounded-2 ${j}`,style:M,children:h.jsx(ube,{url:_,width:"100%",height:"100%",playing:C,controls:D,light:N?V:!1,playIcon:G,fallback:ne})}):h.jsx("div",{className:"fw-sb font-16",children:"Video not found"})})}function mee({url:n,allowControls:t,allowLightMode:i,allowPlaying:s,previewImage:l,className:d,style:u,title:p}){const[m,y]=k.useState(!0),[_,E]=k.useState(""),[C,x]=k.useState(s),[N,O]=k.useState(i),[D,P]=k.useState(t);k.useEffect(()=>{console.log("Inside useeffect"),console.log("CustomMediaViewer loads =",_),n&&(console.log("inside if --- ",n),E(n),y(!1))},[n]);const j=d||"",M=u||null,V=l&&N?l:"/img/default-bg-low-quality.jpg",G=N&&h.jsx("div",{className:"d-flex justify-content-center align-items-center btn-theme btn-lg btn-icon rounded-circle shadow-lg",style:{background:"rgba(255,255,255,0.75)",color:"var(--color-gray2)"},onClick:Y=>$(),children:h.jsx(tn,{tag:"play3",className:"font-30"})});function $(Y){x(!0)}const ne=m&&h.jsx(Zi,{animation:"border",variant:"dark"});return h.jsx(h.Fragment,{children:_?h.jsx("div",{className:`custom-audio-viewer-card ratio ratio-21x9 overflow-hidden rounded-2 ${j}`,style:M,children:h.jsx(ube,{url:_,width:"100%",height:"100%",playing:C,controls:D,light:N?V:!1,playIcon:G,fallback:ne})}):h.jsx("div",{className:"fw-sb font-16",children:"Video not found"})})}function Bit({show:n,handleClose:t,classNames:i,likesData:s,likeCount:l,isLiked:d,loading:u,isHandleLoading:p,parentId:m,handleLike:y}){return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom likes-list-modal",show:n,onHide:t,children:[h.jsx(wn.Header,{className:"",closeButton:!0,children:h.jsxs(wn.Title,{className:"d-flex align-items-center",children:[h.jsx(Lt,{className:`btn-theme btn-s btn-likes-light me-2 px- ${d&&"active"}`,onClick:()=>y(m),children:p?h.jsx(Zi,{size:"sm",className:"me-1"}):h.jsx(tn,{tag:"favorite3",className:"font-20 me-"})}),l," Likes"]})}),h.jsxs(wn.Body,{className:"no-scrollbar",children:[h.jsxs("div",{className:"d-flex justify-content-between align-items-center p-2 bg-gray-lighter3 rounded-3 mb-2",children:[h.jsx("span",{className:"font-13 fw-sb",children:d?"You liked it":"You did not like it yet!"}),h.jsxs(Lt,{className:`btn-theme btn-sm btn-likes-light ms-2 px-2 ${d&&"active"}`,onClick:()=>y(m),children:[p?h.jsx(Zi,{size:"sm",className:"me-1"}):h.jsx(tn,{tag:"favorite3",className:"font-18 me-1"}),h.jsx("span",{className:"",children:d?"Dislike now":"Like now"})]})]}),u&&h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:[0,1,2].map((_,E)=>h.jsx(ci,{type:"likes-list"},E))})}),!u&&(s==null?void 0:s.length)>0&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:s.map(_=>h.jsx(uEe,{item:_,className:"",bodyClassName:"px-0"},_.name+_.date))})})}),!(s!=null&&s.length)>0&&!u&&h.jsx("div",{className:"p-2 font-14 fw-sb",children:"No more likes!"})]})]})})}function Vit(n){var d,u,p,m,y,_,E,C,x,N,O,D,P,j,M,V,G,$,ne,Y,le,re,ee,de,H,ae,_e,me,Ce,he;const[t,i]=k.useState("msg_details_tab");console.log("WallMessageDetailsCard props = ",n);const s=(u=(d=n.data)==null?void 0:d.user_info)!=null&&u.avatar?(m=(p=n.data)==null?void 0:p.user_info)==null?void 0:m.avatar:"/img/profile-pic.png";switch((y=n.data)==null?void 0:y.media_type.toLowerCase()){}const l=pe=>{var Oe;console.log("Key in handleSelectedTab =",pe),pe=="msg_details_tab"&&console.log("Entering into msg_details_tab"),pe=="msg_likes_tab"&&(console.log("Entering into msg_likes_tab"),n.likesListHandler((Oe=n.data)==null?void 0:Oe.id)),pe=="msg_comments_tab"&&(console.log("Entering into msg_comments_tab parent id =",n.parent_id),n.handleCommentList(n.parent_id),console.log(n.loading)),i(pe)};return h.jsxs("div",{className:"wall-message-details-card",children:[h.jsx("div",{className:"p-2 px-0 font-15 fw-sb mb-0",children:(_=n.data)==null?void 0:_.title}),h.jsx("div",{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[((E=n.data)==null?void 0:E.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(x=(C=n==null?void 0:n.data)==null?void 0:C.user_info)==null?void 0:x.name]})," ",h.jsx("div",{children:`${(N=n==null?void 0:n.data)==null?void 0:N.date}`})]}),h.jsx("div",{className:"",children:h.jsx("a",{href:`${(O=n.data)==null?void 0:O.media_url}`,target:"_system",className:"btn btn-theme btn-sm btn-secondary py-2",children:"View in Browser"})})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(P=(D=n==null?void 0:n.data)==null?void 0:D.user_info)==null?void 0:P.name]})," "]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx("div",{children:`${(j=n==null?void 0:n.data)==null?void 0:j.date}`})})]})}),((M=n.data)==null?void 0:M.media_type.toLowerCase())==="pdf"&&h.jsx(h.Fragment,{children:h.jsx(iu,{aspectRatio:"9x16",className:"pdf-container mb-2 overflow-hidden mt-3 border rounded-3",style:{height:"calc(100% - 15vh)"},children:h.jsx(KZ,{fileUrl:(V=n.data)==null?void 0:V.media_url,isModalOpen:!0,className:"overflow-scroll mb-2"})})}),((G=n.data)==null?void 0:G.media_type.toLowerCase())==="video"&&h.jsx(pee,{url:($=n.data)==null?void 0:$.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((ne=n.data)==null?void 0:ne.media_type.toLowerCase())==="audio"&&h.jsx(mee,{url:(Y=n.data)==null?void 0:Y.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((le=n.data)==null?void 0:le.media_type.toLowerCase())==="image"&&h.jsx("div",{className:"media-container text-center mb-2",children:h.jsx(Ts,{src:(re=n.data)==null?void 0:re.media_url,alt:`${(ee=n.data)==null?void 0:ee.title} image`,wrapperClassName:"img-fluid mx-auto"})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:pe=>l(pe),children:[h.jsx("div",{className:"tab_links",children:h.jsxs(Un,{variant:"pills",className:"nav-justified",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${n.likeCount?n.likeCount:0} ${n.likeCount===1?"Like":"Likes"}`})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${n!=null&&n.commentsCount?n==null?void 0:n.commentsCount:0} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_details_tab",children:h.jsxs("div",{className:"py-2",children:[h.jsx(et,{className:"border-0 evaluation-status-card bg-transparent",children:h.jsx(et.Header,{className:"font-13 p-2 px-0 border-0 pb-3",children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:s,className:"rounded-circle media_img",alt:`${(H=(de=n==null?void 0:n.data)==null?void 0:de.user_info)==null?void 0:H.name} profile`})}),h.jsx("div",{className:"media_body ms-1 d-flex justify-content-betwee align-items-center",children:h.jsxs("div",{className:"mb-0 font-12 text-gray6 fw-",children:["Messaged on"," ",h.jsx("span",{className:"font-12 text-gray6",children:(ae=n==null?void 0:n.data)==null?void 0:ae.date}),h.jsxs("div",{className:"d-block",children:["by"," ",h.jsx("span",{className:"fw-sb text-theme-primary",children:(me=(_e=n==null?void 0:n.data)==null?void 0:_e.user_info)==null?void 0:me.name})]})]})})]})})}),h.jsx("div",{className:"font-14 text-gray7",children:(Ce=n.data)==null?void 0:Ce.body})]})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(Rx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:(he=n.data)==null?void 0:he.id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(mw,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})}function zit(){const{msgId:n}=PU(),[t,i]=k.useState(null),[s,l]=k.useState(!0),[d,u]=k.useState(t==null?void 0:t.is_liked),[p,m]=k.useState(t==null?void 0:t.likes_count),[y,_]=k.useState(t==null?void 0:t.comments_count),[E,C]=k.useState(!1),[x,N]=k.useState([]),[O,D]=k.useState(!0),[P,j]=k.useState([]),[M,V]=k.useState(!0);k.useState([]),k.useState({isVisible:!1});async function G(le){console.log("msgId =",le),Ro.getWallMessageDetails(le).then(re=>{var ee,de,H,ae,_e,me;console.log("getWallMessageDetails RES = ",re.data),re.data.status==="success"&&(console.log("Success in getWallMessageDetails =",(ee=re.data.data)==null?void 0:ee.message),i((de=re.data.data)==null?void 0:de.message),_((ae=(H=re.data.data)==null?void 0:H.message)==null?void 0:ae.comments_count),m((me=(_e=re.data.data)==null?void 0:_e.message)==null?void 0:me.likes_count),l(!1))}).catch(re=>{l(!1),i(null),console.log("Error in getWallMessageDetails = ",re)})}async function $(le){console.log("function getWallMessageLike... called for MediaCard =",le),C(!0),le&&Ro.getWallMessageLike(le).then(re=>{var ee,de;console.log("getWallMessageLike RES = ",re.data),re.data.status==="success"&&(console.log("Success in getWallMessageLike =",re.data.data),u((ee=re.data.data)==null?void 0:ee.is_liked),console.log("Success in Wall Message Card =",re.data.data),m((de=re.data.data)==null?void 0:de.likes_count),C(!1),ne(le))}).catch(re=>{var ee,de;C(!1),u((ee=props.media)==null?void 0:ee.is_liked),m((de=props.media)==null?void 0:de.likes_count),console.log("Error in getWallMessageLike = ",re)})}async function ne(le){console.log("function getWallMessageLikesList... called for MediaCard =",le),le&&Ro.getWallMessageLikesList(le).then(re=>{var ee;console.log("getWallMessageLikesList RES = ",re.data),re.data.status==="success"&&(console.log("Success in getWallMessageLikesList =",re.data.data.likes),N((ee=re.data.data)==null?void 0:ee.likes),console.log("Success in WallMessage Card Likes lIst =",re.data.data),D(!1))}).catch(re=>{D(!1),N([]),console.log("Error in getWallMessageLikesList = ",re)})}async function Y(le){console.log("function getAllWallMessageCommentList... called for MediaCard =",le),le&&Ro.getAllWallMessageCommentList(le).then(re=>{var ee;console.log("getAllWallMessageCommentList RES = ",re.data),re.data.status==="success"&&(console.log("Success in getAllWallMessageCommentList =",re.data.data.comments),j((ee=re.data.data)==null?void 0:ee.comments),console.log("Success in WallMessage Card Comments lIst =",re.data.data),V(!1))}).catch(re=>{V(!1),j([]),console.log("Error in getAllWallMessageCommentList = ",re)})}return k.useEffect(()=>{G(n)},[]),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[s&&h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"}),!s&&h.jsx(Vit,{itemDetails:t,data:t,loadingData:s,likesData:x,likeCount:p,isLiked:d,likeActionHandler:$,loadingMediaLike:E,likesListHandler:ne,loadingLikesList:O,comment_type:"message",loadingCommentsList:M,parent_id:t==null?void 0:t.id,parent_owner_id:null,comments:P,handleCommentList:Y,setCommentsCount:_,commentsCount:y})]})})}function Hit(n){var d,u,p,m,y,_,E,C,x,N,O,D,P,j,M,V,G,$,ne,Y,le,re,ee,de,H,ae,_e,me,Ce,he,pe;const[t,i]=k.useState("msg_details_tab"),s=(u=(d=n.data)==null?void 0:d.user_info)!=null&&u.avatar?(m=(p=n.data)==null?void 0:p.user_info)==null?void 0:m.avatar:"/img/profile-pic.png";switch((y=n.data)==null?void 0:y.media_type.toLowerCase()){}(_=n.data)==null||_.media_type;const l=Oe=>{var Fe;console.log("Key in handleSelectedTab =",Oe),Oe=="msg_details_tab"&&console.log("Entering into msg_details_tab"),Oe=="msg_likes_tab"&&(console.log("Entering into msg_likes_tab"),n.likesListHandler((Fe=n.data)==null?void 0:Fe.id)),Oe=="msg_comments_tab"&&(console.log("Entering into msg_comments_tab parent id =",n.parent_id),n.handleCommentList(n.parent_id),console.log(n.loading)),i(Oe)};return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:(E=n.data)==null?void 0:E.title})}),h.jsx(wn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[((C=n.data)==null?void 0:C.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(N=(x=n==null?void 0:n.data)==null?void 0:x.user_info)==null?void 0:N.name]})," ",h.jsx("div",{children:`${(O=n==null?void 0:n.data)==null?void 0:O.date}`})]}),h.jsx("div",{className:"",children:h.jsx("a",{href:`${(D=n.data)==null?void 0:D.media_url}`,target:"_system",className:"btn btn-theme btn-sm btn-secondary py-2",children:"View in Browser"})})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(j=(P=n==null?void 0:n.data)==null?void 0:P.user_info)==null?void 0:j.name]})," "]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx("div",{children:`${(M=n==null?void 0:n.data)==null?void 0:M.date}`})})]})}),((V=n.data)==null?void 0:V.media_type.toLowerCase())==="pdf"&&h.jsx(iu,{aspectRatio:"9x16",className:"pdf-container mb-2 overflow-hidden",style:{height:"calc(100% - 15vh)"},children:h.jsx(KZ,{fileUrl:(G=n.data)==null?void 0:G.media_url,isModalOpen:!0,className:"overflow-scroll mb-2"})}),(($=n.data)==null?void 0:$.media_type.toLowerCase())==="video"&&h.jsx(pee,{url:(ne=n.data)==null?void 0:ne.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((Y=n.data)==null?void 0:Y.media_type.toLowerCase())==="audio"&&h.jsx(mee,{url:(le=n.data)==null?void 0:le.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((re=n.data)==null?void 0:re.media_type.toLowerCase())==="image"&&h.jsx("div",{className:"media-container text-center mb-2",children:h.jsx(Ts,{src:(ee=n.data)==null?void 0:ee.media_url,alt:`${(de=n.data)==null?void 0:de.title} image`,wrapperClassName:"img-fluid mx-auto"})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:Oe=>l(Oe),children:[h.jsx("div",{className:"tab_links",children:h.jsxs(Un,{variant:"pills",className:"nav-justified",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${n.likeCount} ${n.likeCount===1?"Like":"Likes"}`})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.commentsCount} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_details_tab",children:h.jsxs("div",{className:"py-2",children:[h.jsx(et,{className:"border-0 evaluation-status-card",children:h.jsx(et.Header,{className:"font-13 p-2 px-0 bg-transparent border-0 pb-3",children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:s,className:"rounded-circle media_img",alt:`${(ae=(H=n==null?void 0:n.data)==null?void 0:H.user_info)==null?void 0:ae.name} profile`})}),h.jsx("div",{className:"media_body ms-1 d-flex justify-content-betwee align-items-center",children:h.jsxs("div",{className:"mb-0 font-12 text-gray6 fw-",children:["Messaged on"," ",h.jsx("span",{className:"font-12 text-gray6",children:(_e=n==null?void 0:n.data)==null?void 0:_e.date}),h.jsxs("div",{className:"d-block",children:["by"," ",h.jsx("span",{className:"fw-sb text-theme-primary",children:(Ce=(me=n==null?void 0:n.data)==null?void 0:me.user_info)==null?void 0:Ce.name})]})]})})]})})}),h.jsx("div",{className:"font-14 text-gray7",children:(he=n.data)==null?void 0:he.body})]})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(Rx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:(pe=n.data)==null?void 0:pe.id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(mw,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})})}function Git({handleWallMessageCardClick:n,message:t,index:i,className:s}){var we,We,st,pt;const[l,d]=k.useState(t==null?void 0:t.is_liked),[u,p]=k.useState(t==null?void 0:t.likes_count),[m,y]=k.useState(t==null?void 0:t.comments_count),[_,E]=k.useState(null),[C,x]=k.useState(!0),[N,O]=k.useState(!1),[D,P]=k.useState([]),[j,M]=k.useState(!0),[V,G]=k.useState([]),[$,ne]=k.useState(!0),[Y,le]=k.useState(!1),re=s||"",ee=t!=null&&t.title?t==null?void 0:t.title:"Default title",de=t!=null&&t.type?t==null?void 0:t.type:"",H=t!=null&&t.body?t==null?void 0:t.body:"",ae=t!=null&&t.media_type?t==null?void 0:t.media_type:"",_e=t!=null&&t.media_url?t==null?void 0:t.media_url:"/img/default-bg.jpg",me=(we=t==null?void 0:t.user_info)!=null&&we.name?(We=t==null?void 0:t.user_info)==null?void 0:We.name:"",Ce=(st=t==null?void 0:t.user_info)!=null&&st.avatar?(pt=t==null?void 0:t.user_info)==null?void 0:pt.avatar:"/img/profile-pic.png";t!=null&&t.view_count&&(t==null||t.view_count),t!=null&&t.comments_count&&(t==null||t.comments_count),t!=null&&t.likes_count&&(t==null||t.likes_count);const he=t!=null&&t.date?t==null?void 0:t.date:"";switch(ae.toLowerCase()){}t==null||t.media_type;const pe=()=>{le(!1)},Oe=()=>{le(!0),Ve(t==null?void 0:t.id)};function Fe(Qe){Qe.stopPropagation(),console.log("handleMediaAction called...")}function Ue(Qe){Qe.stopPropagation(),console.log("Detials But clicked.."),Oe()}async function Ve(Qe){console.log("msgId =",Qe),Ro.getWallMessageDetails(Qe).then(Je=>{console.log("getWallMessageDetails RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getWallMessageDetails =",Je.data.data.message),E(Je.data.data.message),x(!1))}).catch(Je=>{x(!1),E(null),console.log("Error in getWallMessageDetails = ",Je)})}async function Re(Qe){console.log("function getWallMessageLike... called for MediaCard =",Qe),O(!0),Qe&&Ro.getWallMessageLike(Qe).then(Je=>{var St,Xt;console.log("getWallMessageLike RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getWallMessageLike =",Je.data.data),d((St=Je.data.data)==null?void 0:St.is_liked),console.log("Success in Wall Message Card =",Je.data.data),p((Xt=Je.data.data)==null?void 0:Xt.likes_count),O(!1),Be(Qe))}).catch(Je=>{var St,Xt;O(!1),d((St=props.media)==null?void 0:St.is_liked),p((Xt=props.media)==null?void 0:Xt.likes_count),console.log("Error in getWallMessageLike = ",Je)})}async function Be(Qe){console.log("function getWallMessageLikesList... called for MediaCard =",Qe),Qe&&Ro.getWallMessageLikesList(Qe).then(Je=>{var St;console.log("getWallMessageLikesList RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getWallMessageLikesList =",Je.data.data.likes),P((St=Je.data.data)==null?void 0:St.likes),console.log("Success in WallMessage Card Likes lIst =",Je.data.data),M(!1))}).catch(Je=>{M(!1),P([]),console.log("Error in getWallMessageLikesList = ",Je)})}async function Xe(Qe){console.log("function getAllWallMessageCommentList... called for MediaCard =",Qe),Qe&&Ro.getAllWallMessageCommentList(Qe).then(Je=>{var St;console.log("getAllWallMessageCommentList RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getAllWallMessageCommentList =",Je.data.data.comments),G((St=Je.data.data)==null?void 0:St.comments),console.log("Success in WallMessage Card Comments lIst =",Je.data.data),ne(!1))}).catch(Je=>{ne(!1),G([]),console.log("Error in getAllWallMessageCommentList = ",Je)})}return h.jsxs(h.Fragment,{children:[de==="message"?h.jsxs(et,{className:`border-0 card-theme wall-message-card overflow-hidden ${re}`,onClick:Qe=>{Ue(Qe)},children:[h.jsxs("div",{className:"font-13 mb-1 py-2 px-2 pb-0 d-flex align-items-center",children:[h.jsx("span",{className:"text-theme-prim fw-sb user-img overflow-hidden rounded-cicle d-flex",children:h.jsx(Ts,{src:Ce,alt:me,wrapperClassName:"overflow-hidden rounded-cicle"})})," ",h.jsx("div",{className:"ps-2",children:me})]}),h.jsx(et.Header,{className:"border-bottom-0 p-2 p-sm-3 pt-0 pb-0 line-clamp",children:ee}),h.jsx(et.Body,{className:"p-2 p-sm-3 pt-1",children:h.jsx("div",{className:"line-clamp-3 font-13 text-gray6",children:H})}),_e&&(ae.toLowerCase()==="video"||ae.toLowerCase()==="audio")?h.jsxs("div",{className:"px-2 px-sm-3",onClick:Qe=>{Fe(Qe)},children:[ae.toLowerCase()==="video"&&h.jsx(pee,{url:_e,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null}),ae.toLowerCase()==="audio"&&h.jsx(mee,{url:_e,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null})]}):h.jsx(h.Fragment,{children:ae.toLowerCase()==="pdf"?h.jsx("div",{className:"px-2 mb-2",children:h.jsxs("div",{className:"p-2 py-4 text-center overflow-hidden rounded-2",style:{backgroundColor:"var(--color-likes-lighter)"},children:[h.jsx(tn,{tag:"pdf1",className:"text-danger",style:{fontSize:52}}),h.jsx(To,{className:"d-block text-danger",size:"lg",children:"PDF Document"})]})}):h.jsx("div",{className:"px-2 mb-2",children:h.jsx(Ts,{src:_e,alt:`${ee} image`,wrapperClassName:"card-img"})})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-1 pt-2 border-top- d-flex justify-content-between",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1",style:{maxWidth:"140px"},children:h.jsxs("div",{className:"font-13 text-gray6 d-flex align-items-center",children:[h.jsx(tn,{tag:"events1",className:"font-20"})," ",h.jsx("span",{className:"ms-1",children:he})]})}),h.jsxs("div",{className:"btn-wrap ms-2",children:[h.jsxs(Lt,{className:`btn-theme btn-sm btn-likes-light px-2 pe-none ${l&&"active"}`,children:[h.jsx(tn,{tag:"favorite3",className:"font-18"})," ",u]}),h.jsxs(Lt,{className:"btn-theme btn-sm btn-gray px-2 pe-none",children:[h.jsx(tn,{tag:"message8",className:"font-18"})," ",m]})]})]})]}):h.jsxs(et,{className:`border-0 card-theme wall-message-card wall-message-card-horizontal overflow-hidden ${re}`,onClick:Qe=>{Ue(Qe)},children:[h.jsx(et.Body,{className:"p-2 p-sm-3 ps-0 pt-0",children:h.jsxs("div",{className:"d-flex",children:[h.jsx("div",{className:"img-container flex-shrink-0",style:{width:100,height:100},children:h.jsx(Ts,{src:_e,alt:`${ee} image`,wrapperClassName:"card-img overflow-hidden rounded-3"})}),h.jsxs("div",{className:"flex-grow-1 ps-2 pt-0 ps-sm-3 pt-sm-2",children:[h.jsxs("div",{className:"font-13 mb-1 py-2 px-0 pb-0 d-flex align-items-center",children:[h.jsx("span",{className:"text-theme-prim fw-sb user-img overflow-hidden rounded-cicle d-flex",children:h.jsx(Ts,{src:Ce,alt:me,wrapperClassName:"overflow-hidden rounded-cicle"})})," ",h.jsx("div",{className:"ps-2",children:me})]}),h.jsx(et.Header,{className:"border-bottom-0 p-0 line-clamp mb-1",children:ee}),h.jsx("div",{className:"line-clamp-3 font-13 text-gray6",children:H})]})]})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-1 border-top- d-flex justify-content-between",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1",style:{maxWidth:"140px"},children:h.jsxs("div",{className:"font-13 text-gray6 d-flex align-items-center",children:[h.jsx(tn,{tag:"events1",className:"font-20"})," ",h.jsx("span",{className:"ms-1",children:he})]})}),h.jsxs("div",{className:"btn-wrap ms-2",children:[h.jsxs(Lt,{className:`btn-theme btn-sm btn-likes-light px-2 pe-none ${l&&"active"}`,children:[h.jsx(tn,{tag:"favorite3",className:"font-18"})," ",u]}),h.jsxs(Lt,{className:"btn-theme btn-sm btn-gray px-2 pe-none",children:[h.jsx(tn,{tag:"message8",className:"font-18"})," ",m]})]})]})]}),h.jsx(Hit,{show:Y,handleClose:pe,data:_,loadingData:C,likesData:D,likeCount:u,isLiked:l,likeActionHandler:Re,loadingMediaLike:N,likesListHandler:Be,loadingLikesList:j,comment_type:"message",loadingCommentsList:$,parent_id:t==null?void 0:t.id,parent_owner_id:null,comments:V,handleCommentList:Xe,setCommentsCount:y,commentsCount:m})]})}function Wit(){var le,re;const n=ji(),[t,i]=k.useState([]),[s,l]=k.useState(),[d,u]=k.useState(0),[p,m]=k.useState(null),[y,_]=k.useState(!0),[E,C]=k.useState(!1),[x,N]=k.useState("all");k.useState("");const[O,D]=k.useState(!0),P=k.useRef();async function j(){let ee;p&&(console.log("lastKey = ",p),ee=p),Ro.getAllWallMessages(ee).then(de=>{var H,ae,_e,me,Ce,he,pe,Oe;if(console.log("getAllWallMessages RES = ",de.data),de.data.status==="success"){console.log("Success in getAllWallMessages =",de.data.data.messages);const Fe=(ae=(H=de.data)==null?void 0:H.data)==null?void 0:ae.messages,Ue=(me=(_e=de.data)==null?void 0:_e.data)==null?void 0:me.cansend,Ve=(he=(Ce=de.data)==null?void 0:Ce.data)==null?void 0:he.count,Re=(Oe=(pe=de.data)==null?void 0:pe.data)==null?void 0:Oe.lastkey;i(Be=>[...Be,...Fe]),D(Ue),u(Ve),m(Re),_(!1)}}).catch(de=>{_(!1),i([]),u(0),m(null),console.log("Error in getAllWallMessages = ",de)})}function M(ee){ee&&n(`/messages/${ee}`)}k.useEffect(()=>{j()},[]),k.useEffect(()=>{t&&!y&&l(t);const ee=V(x,t);console.log("filteredData === ",ee),l(ee)},[t]);function V(ee,de){switch(console.log("selectedSegment =",ee,`
data = `,de),ee){case"all":return console.log("case : ",ee),de;default:return $(x,de)}}const G=()=>{P.current.value="",N("all");const ee=V("all",t);l(ee)};function $(ee,de){console.log("searchMessages - filteredData =",de);const H=de.filter((ae,_e)=>{var me;return(ae==null?void 0:ae.title.toLowerCase().includes(ee.toLowerCase()))||(ae==null?void 0:ae.body.toLowerCase().includes(ee.toLowerCase()))||((me=ae==null?void 0:ae.user_info)==null?void 0:me.name.toLowerCase().includes(ee.toLowerCase()))});return console.log("Result =",H),H}const ne=Tx.debounce(ee=>{console.log("This is function from lodash..."),console.log("Search text =",ee),N(ee.trim());const de=V(x,t);ee.trim().length>0?(console.log(ee.trim()),l($(ee.trim(),de))):l(de)},500),Y=()=>{n("/messages/send-message",{state:{pageTitle:"Send a Message",hideFooterNav:!0}})};return h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[y?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((ee,de)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},de))})}):h.jsx(h.Fragment,{children:t.length>0?h.jsxs(h.Fragment,{children:[h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-3 position-relative",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:ee=>{console.log("Search input = ",ee),ne(ee.target.value)},ref:P,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((le=P==null?void 0:P.current)==null?void 0:le.value.length)>0&&h.jsx(Lt,{onClick:G,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6},type:"button",children:h.jsx(ow,{})}),((re=P==null?void 0:P.current)==null?void 0:re.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${s==null?void 0:s.length}`})]}),t.length>0&&!y?h.jsx(h.Fragment,{children:(s==null?void 0:s.length)>0?h.jsx(h.Fragment,{children:h.jsx(lEe,{dataLength:s.length,next:j,scrollThreshold:1,hasMore:!!p,loader:h.jsx(dEe,{}),children:h.jsx("div",{className:"d-grid gap-3",children:s.map((ee,de)=>h.jsx(Git,{message:ee,index:de,className:"shadow-sm ",handleWallMessageCardClick:M},ee.id))})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more messages found."})})})})}):h.jsx(h.Fragment,{})]}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more messages"})})}),O&&h.jsx(NZ,{btnTitle:"Send",className:"",isWide:!1,icon:"send2",loading:E,primaryActionHandler:Y})]})})}function Ppe({type:n,text:t,subText:i,actionHandler:s,className:l}){const d=ji(),u=l||"";function p(){console.log("btnClickHandler"),s(),d("/notifications")}return h.jsxs("div",{className:`${u}`,children:[h.jsx("div",{className:`icon-wrapper ${n==="reject"?"wrapper-fail":""} d-flex justify-content-center align-items-center rounded-circle mx-auto`,children:h.jsx(tn,{tag:`${n==="reject"?"delete7":"check1"}`,className:"font-40"})}),h.jsxs("div",{className:"py-4 px-5 text-center font-15 text-gray-6",children:[h.jsx("div",{className:"fw-sb font-16 mb-1",children:t}),i]}),h.jsx("div",{className:"d-grid gap-2",children:h.jsx(Lt,{className:"btn-theme btn-primary btn-lg",onClick:p,children:"Go Back"})})]})}function $it(n){const[t,i]=k.useState(!1),s={reason:""},l=gc({reason:Ef().required("Required")}),d=async(u,{resetForm:p})=>{i(!0),console.log("Form Values :",u);let m={...u,approval_id:n.approvalId,action:n.action};console.log("Calling rejectReasonForm...",m),FQ.rejectForm(m).then(y=>{console.log("rejectForm RES = ",y.data),y.data.status==="success"&&(console.log("Success in rejectForm =",y.data),i(!1),n.setIsRejected(!0))}).catch(y=>{i(!1),n.setIsRejected(!1),console.log("Error in rejectForm = ",y)})};return h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-flex flex-column",children:h.jsx(od,{initialValues:s,validationSchema:l,onSubmit:d,children:u=>h.jsxs(kt,{className:"form_style",onSubmit:u.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-4",children:[h.jsx(kt.Label,{className:"d-block font-14 text-start",children:"Reason to Reject"}),h.jsx("div",{className:"pt-0 pb-3 text-gray6 font-12 text-start",children:"Your reason to reject will help the submitter to improve and submit again."}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"Reason",name:"reason",...u.getFieldProps("reason"),autoComplete:"off"}),u.touched.reason&&u.errors.reason?h.jsx("p",{className:"error-state-text text-start font-12 text-danger mb-0",children:u.errors.reason}):null]}),h.jsx("div",{className:"btn-wrap d-grid",children:h.jsx(Lt,{type:"submit",className:"btn btn-theme btn-lg btn-red",children:t?h.jsx(h.Fragment,{children:h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})}):"Submit"})})]})})})})}function Kit(n){ji();const[t,i]=k.useState(!1),[s,l]=k.useState(!1),[d,u]=k.useState(!0),p={backdrop:"static",keyboard:!1},m={closeButton:n.action==="reject"&&!t};console.log(n.loading),console.log(n.action),k.useEffect(()=>{if(console.log(n.action),n.action==="approve"&&!s){let _={approval_id:n==null?void 0:n.approvalId,action:n==null?void 0:n.action};console.log("approveData =",_),y(_)}if(n.action==="reject"&&!t){let _={approval_id:n==null?void 0:n.approvalId,action:n==null?void 0:n.action,reason:""};console.log("rejectData =",_)}},[n.action]);async function y(_){console.log("Inside Modal: approveForm()..."),u(!0),FQ.approveForm(_).then(E=>{console.log("approveForm RES = ",E.data),E.data.status==="success"&&(console.log("Success in approveForm =",E.data),l(!0),u(!1))}).catch(E=>{u(!1),l(!1),console.log("Error in approveForm = ",E)})}return h.jsxs(wn,{centered:!0,size:"md",className:"theme-modal approve-reject-form-modal",...p,show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb-0 border-0 pt-2",...m,children:" "}),h.jsxs(wn.Body,{className:"no-scrollbar text-center pt-0",children:[n.action==="approve"&&!s&&h.jsx("div",{className:"p-5 d-flex justify-content-center align-items-center mx-auto",children:h.jsx(Zi,{animation:"border"})}),n.action==="approve"&&s&&h.jsx(h.Fragment,{children:h.jsx(Ppe,{type:"approve",text:"Thanks!",subText:"You have successfully approved the submission.",actionHandler:n.handleClose,className:"pt-3"})}),n.action==="reject"&&!t&&h.jsx($it,{action:n.action,isRejected:t,setIsRejected:i,approvalId:n==null?void 0:n.approvalId}),n.action==="reject"&&t&&h.jsx(h.Fragment,{children:h.jsx(Ppe,{type:"reject",text:"",subText:"You have rejected the submission. We Have notified the submitter about the rejection.",actionHandler:n.handleClose,className:"pt-3"})})]})]})}function Lpe(){const{entityId:n}=PU(),[t,i]=k.useState(null),[s,l]=k.useState(""),[d,u]=k.useState(!0),[p,m]=k.useState(!0);k.useState(!0);const[y,_]=k.useState({isVisible:!1});k.useEffect(()=>{console.log("id = ",n),n?(console.log("id found = ",n),x({entity_id:n})):(console.log("id = ",n),console.log("Id not found"))},[]);const E=()=>{console.log("Closing Form Submission modal"),_({isVisible:!1})},C=D=>{_({isVisible:!0}),l(D)};tl();async function x(D){console.log("Inside ApproveRejectFormSubmission: getFormApprovalInfo()..."),FQ.getFormApprovalInfo(D).then(P=>{var j,M,V,G;console.log("getFormApprovalInfo RES = ",P.data),P.data.status==="success"&&(console.log("Success in getFormApprovalInfo =",(M=(j=P.data)==null?void 0:j.data)==null?void 0:M.preview),i((G=(V=P.data)==null?void 0:V.data)==null?void 0:G.preview),u(!1))}).catch(P=>{handleAlert("something went wrong!","error"),i(null),u(!1),console.log("Error in getFormApprovalInfo = ",P)})}function N(D){console.log("handleApproveBtnClick called...",D),C("approve")}function O(D){console.log("handleRejectBtnClick called...",D),C("reject")}return h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"",children:[d?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"iframe-loader"})}):h.jsx(h.Fragment,{children:h.jsx(iu,{aspectRatio:"1x1",className:"",style:{height:"calc(100vh - 30vh)"},children:h.jsx("iframe",{src:`${t==null?void 0:t.preview_url}`,title:"Approve or Reject Submission",onLoad:()=>m(!1)})})}),h.jsxs("div",{className:"footer-btn-overlay d-flex flex-column",children:[h.jsxs("div",{className:"d-flex justify-content-center pt-2 pb-3",children:[h.jsx("div",{className:"font-14 text-theme-primary",children:"Submitted By: "}),h.jsx("div",{className:"font-14 fw-sb ps-2",children:t==null?void 0:t.submitted_by})]}),h.jsxs("div",{className:"btn-wrap d-flex justify-content-center align-items-center",children:[h.jsx(Lt,{type:"button",className:"btn-theme btn-md btn-green flex-grow-1",onClick:()=>{let D={approval_id:t==null?void 0:t.approval_id,action:"approve"};N(D)},children:"Approve"}),h.jsx(Lt,{type:"button",className:"btn-theme btn-md btn-red flex-grow-1",onClick:()=>{let D={approval_id:t==null?void 0:t.approval_id,action:"reject",reason:"Testing reason"};O(D)},children:"Reject"})]})]}),h.jsx(Kit,{show:y,handleClose:E,action:s,approvalId:t==null?void 0:t.approval_id})]})})})}function qit(n){var j,M,V,G,$,ne,Y,le,re,ee,de,H,ae,_e,me,Ce,he,pe,Oe,Fe,Ue,Ve,Re,Be,Xe,we,We,st,pt,Qe,Je,St,Xt,Ht,gn,It,xt;const t=ji();k.useState(!1),k.useState(!1);let i=n!=null&&n.className?n==null?void 0:n.className:"";const s=(j=n==null?void 0:n.item)!=null&&j.title?(M=n==null?void 0:n.item)==null?void 0:M.title:"Default title",l=(V=n.item)!=null&&V.cover_image?(G=n.item)==null?void 0:G.cover_image:"/img/default-bg.jpg",d=($=n==null?void 0:n.item)!=null&&$.media?(ne=n==null?void 0:n.item)==null?void 0:ne.media:"",u=(Y=n==null?void 0:n.item)!=null&&Y.media_type?(le=n==null?void 0:n.item)==null?void 0:le.media_type:"",p=(re=n.item)!=null&&re.description?(ee=n.item)==null?void 0:ee.description:"",m=(H=(de=n.item)==null?void 0:de.user_info)!=null&&H.name?(_e=(ae=n.item)==null?void 0:ae.user_info)==null?void 0:_e.name:"";(Ce=(me=n.item)==null?void 0:me.user_info)!=null&&Ce.avatar&&((pe=(he=n.item)==null?void 0:he.user_info)==null||pe.avatar);const y=(Fe=(Oe=n.item)==null?void 0:Oe.expiry_date)!=null&&Fe.day?(Ve=(Ue=n.item)==null?void 0:Ue.expiry_date)==null?void 0:Ve.day:"",_=(Be=(Re=n.item)==null?void 0:Re.expiry_date)!=null&&Be.month?(we=(Xe=n.item)==null?void 0:Xe.expiry_date)==null?void 0:we.month:"";(st=(We=n.item)==null?void 0:We.expiry_date)!=null&&st.year&&((Qe=(pt=n.item)==null?void 0:pt.expiry_date)==null||Qe.year);const E=(Je=n.item)==null?void 0:Je.button;(St=n.item)!=null&&St.response_sources&&((Xt=n.item)==null||Xt.response_sources),(Ht=n.item)!=null&&Ht.response_types&&((gn=n.item)==null||gn.response_types);let C="16x9";switch((It=n.item)==null?void 0:It.media_type.toLowerCase()){case"video":C="16x9";break;case"audio":C="21x9";break;case"image":C="16x9";break;default:C="16x9"}const x=((xt=n.item)==null?void 0:xt.media_type)==="audio"&&{marginTop:"-90px"};function N(mt){mt.stopPropagation(),console.log("handleMediaAction called...")}function O(mt){n.handleContestCardClick(mt.id)}function D(mt){mt.stopPropagation(),console.log("handleContestSecondaryAction called",mt),P(n.item)}function P(mt){var dt;console.log("handleRecordResponse called...",mt,event),((dt=mt==null?void 0:mt.button)==null?void 0:dt.action)!=="upload"?n.handleContestCardClick(mt.id):t(`/contests/${mt.id}/upload-response`,{state:{item:mt}})}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`border-0 card-theme contest-card overflow-hidden ${i}`,onClick:()=>O(n.item),children:[h.jsx(et.Header,{className:"border-bottom-0 p-2 p-sm-3",children:s}),d&&(u.toLowerCase()==="video"||u.toLowerCase()==="audio")?h.jsx("div",{className:"px-2 px-sm-3",onClick:mt=>{N(mt)},children:h.jsx(iu,{aspectRatio:`${C}`,style:x,children:h.jsx(gw,{url:d,width:"100%",height:"100%",controls:!0,light:`${l}`,playing:!0,playIcon:h.jsx("div",{className:"d-flex justify-content-center align-items-center btn-theme btn-lg btn-icon rounded-circle shadow-lg",style:{background:"rgba(255,255,255,0.75)",color:"var(--color-gray2)"},children:h.jsx(tn,{tag:"play3",className:"font-30"})})})})}):h.jsx("div",{className:"px-2",children:h.jsx(Ts,{src:l,alt:`${s} image`,wrapperClassName:"card-img"})}),h.jsx(et.Body,{className:"p-2 p-sm-3",children:h.jsxs("div",{className:"font-13 mb-0",children:[h.jsxs("div",{className:"mb-1",children:[h.jsx("span",{className:"text-theme-primary mb-2",children:"Published By: "})," ",m]}),h.jsx(bP,{text:p,linesToShow:2,containerClass:"contest-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}})]})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-3 border-top- d-flex justify-content-between align-items-center",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1 pe-3",children:h.jsx(Lt,{className:"btn-theme btn-primary btn-md py-2 py-sm-3 position-relative font-14 w-100",style:{zIndex:1},onClick:mt=>D(mt),children:E.title})}),h.jsx("div",{className:"btn-wrap ms-2",children:h.jsxs(Lt,{className:"btn-theme btn-sm btn-date btn-transparent px-0 pe-none",children:[h.jsx(tn,{tag:"events1",className:"font-18"})," ",h.jsx("span",{className:"",children:`${y} ${_}`})]})})]})]})})}function Yit(){const n=ji(),[t,i]=k.useState([]),[s,l]=k.useState(!0);async function d(){console.log("Inside Dashboard: getAllContests()..."),Xa.getAllContests().then(p=>{console.log("getAllContests RES = ",p.data),p.data.status==="success"&&(console.log("Success in getAllContests =",p.data.data.contests),i(p.data.data.contests),l(!1))}).catch(p=>{l(!1),i([]),console.log("Error in getAllContests = ",p)})}function u(p){p&&n(`/contests/${p}`,{state:{pageTitle:"Detailing Contest Details"}})}return k.useEffect(()=>{d()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:s?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((p,m)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},m))})}):h.jsx(h.Fragment,{children:t.length>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:t.map((p,m)=>h.jsx(qit,{item:p,className:"shadow-sm ",handleContestCardClick:u},p.id))})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more contests"})})})})})}var hbe={},fbe;Object.defineProperty(hbe,"__esModule",{value:!0});var Kh=h,Gu=k,bo=function(){return bo=Object.assign||function(n){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(n[l]=t[l]);return n},bo.apply(this,arguments)};function Dpe(n,t,i){if(i||arguments.length===2)for(var s,l=0,d=t.length;l<d;l++)!s&&l in t||(s||(s=Array.prototype.slice.call(t,0,l)),s[l]=t[l]);return n.concat(s||Array.prototype.slice.call(t))}function kpe(n){var t=n.size,i=t===void 0?25:t,s=n.SVGstrokeColor,l=s===void 0?"currentColor":s,d=n.SVGstorkeWidth,u=d===void 0?0:d,p=n.SVGclassName,m=p===void 0?"star-svg":p,y=n.SVGstyle;return Kh.jsx("svg",bo({className:m,style:y,stroke:l,fill:"currentColor",strokeWidth:u,viewBox:"0 0 24 24",width:i,height:i,xmlns:"http://www.w3.org/2000/svg"},{children:Kh.jsx("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"})}))}function Xit(n,t){switch(t.type){case"PointerMove":return bo(bo({},n),{hoverValue:t.payload,hoverIndex:t.index});case"PointerLeave":return bo(bo({},n),{ratingValue:n.ratingValue,hoverIndex:0,hoverValue:null});case"MouseClick":return bo(bo({},n),{valueIndex:n.hoverIndex,ratingValue:t.payload});default:return n}}var Jit="style-module_starRatingWrap__q-lJC",Qit="style-module_simpleStarRating__nWUxf",Zit="style-module_fillIcons__6---A",ert="style-module_emptyIcons__Bg-FZ",trt="style-module_tooltip__tKc3i";function Mpe(){return typeof window<"u"&&window.matchMedia("(pointer: coarse)").matches||"ontouchstart"in window||typeof navigator<"u"&&navigator.maxTouchPoints>0}(function(n,t){t===void 0&&(t={});var i=t.insertAt;if(n&&typeof document<"u"){var s=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&s.firstChild?s.insertBefore(l,s.firstChild):s.appendChild(l),l.styleSheet?l.styleSheet.cssText=n:l.appendChild(document.createTextNode(n))}})(".style-module_starRatingWrap__q-lJC{display:inline-block;touch-action:none}.style-module_simpleStarRating__nWUxf{display:inline-block;overflow:hidden;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.style-module_fillIcons__6---A{display:inline-block;overflow:hidden;position:absolute;top:0;white-space:nowrap}.style-module_emptyIcons__Bg-FZ{display:inline-block}.style-module_tooltip__tKc3i{background-color:#333;border-radius:5px;color:#fff;display:inline-block;padding:5px 15px;vertical-align:middle}"),fbe=hbe.Rating=function(n){var t,i,s=n.onClick,l=n.onPointerMove,d=n.onPointerEnter,u=n.onPointerLeave,p=n.initialValue,m=p===void 0?0:p,y=n.iconsCount,_=y===void 0?5:y,E=n.size,C=E===void 0?40:E,x=n.readonly,N=x!==void 0&&x,O=n.rtl,D=O!==void 0&&O,P=n.customIcons,j=P===void 0?[]:P,M=n.allowFraction,V=M!==void 0&&M,G=n.style,$=n.className,ne=$===void 0?"react-simple-star-rating":$,Y=n.transition,le=Y!==void 0&&Y,re=n.allowHover,ee=re===void 0||re,de=n.disableFillHover,H=de!==void 0&&de,ae=n.fillIcon,_e=ae===void 0?null:ae,me=n.fillColor,Ce=me===void 0?"#ffbc0b":me,he=n.fillColorArray,pe=he===void 0?[]:he,Oe=n.fillStyle,Fe=n.fillClassName,Ue=Fe===void 0?"filled-icons":Fe,Ve=n.emptyIcon,Re=Ve===void 0?null:Ve,Be=n.emptyColor,Xe=Be===void 0?"#cccccc":Be,we=n.emptyStyle,We=n.emptyClassName,st=We===void 0?"empty-icons":We,pt=n.allowTitleTag,Qe=pt===void 0||pt,Je=n.showTooltip,St=Je!==void 0&&Je,Xt=n.tooltipDefaultText,Ht=Xt===void 0?"Your Rate":Xt,gn=n.tooltipArray,It=gn===void 0?[]:gn,xt=n.tooltipStyle,mt=n.tooltipClassName,dt=mt===void 0?"react-simple-star-rating-tooltip":mt,it=n.SVGclassName,Me=it===void 0?"star-svg":it,Ge=n.titleSeparator,bt=Ge===void 0?"out of":Ge,wt=n.SVGstyle,Pt=n.SVGstorkeWidth,en=Pt===void 0?0:Pt,un=n.SVGstrokeColor,an=un===void 0?"currentColor":un,ye=Gu.useReducer(Xit,{hoverIndex:0,valueIndex:0,ratingValue:m,hoverValue:null}),Q=ye[0],ie=Q.ratingValue,Se=Q.hoverValue,je=Q.hoverIndex,tt=Q.valueIndex,Te=ye[1];Gu.useEffect(function(){m&&Te({type:"MouseClick",payload:0})},[m]);var Pe=Gu.useMemo(function(){return V?2*_:_},[V,_]),Ze=Gu.useMemo(function(){return m>Pe?0:V||Math.floor(m)===m?Math.round(m/_*100):2*Math.ceil(m)*10},[V,m,_,Pe]),nt=Gu.useMemo(function(){return(V?2*m-1:m-1)||0},[V,m]),$e=Gu.useCallback(function(qt){return _%2!=0?qt/2/10:qt*_/100},[_]),rt=function(qt){for(var Jt=qt.clientX,mn=qt.currentTarget.children[0].getBoundingClientRect(),Kn=mn.left,On=mn.right,Tn=mn.width,Ui=D?On-Jt:Jt-Kn,xr=Pe,bi=Math.round(Tn/Pe),Da=0;Da<=Pe;Da+=1)if(Ui<=bi*Da){xr=Da===0&&Ui<bi?0:Da;break}var Rl=xr-1;xr>0&&(Te({type:"PointerMove",payload:100*xr/Pe,index:Rl}),l&&Se&&l($e(Se),Rl,qt))},yn=function(qt){Se&&(Te({type:"MouseClick",payload:Se}),s&&s($e(Se),je,qt))},Dt=Gu.useMemo(function(){if(ee){if(H){var qt=ie&&ie||Ze;return Se&&Se>qt?Se:qt}return Se&&Se||ie&&ie||Ze}return ie&&ie||Ze},[ee,H,Se,ie,Ze]);Gu.useEffect(function(){It.length>Pe&&console.error("tooltipArray Array length is bigger then Icons Count length.")},[It.length,Pe]);var nn=Gu.useCallback(function(qt){return Se&&qt[je]||ie&&qt[tt]||m&&qt[nt]},[Se,je,ie,tt,m,nt]),Zt=Gu.useMemo(function(){return Se&&$e(Se)||ie&&$e(ie)||m&&$e(Ze)},[Se,$e,ie,m,Ze]);return Kh.jsxs("span",bo({className:Jit,style:{direction:"".concat(D?"rtl":"ltr")}},{children:[Kh.jsxs("span",bo({className:"".concat(Qit," ").concat(ne),style:bo({cursor:N?"":"pointer"},G),onPointerMove:N?void 0:rt,onPointerEnter:N?void 0:function(qt){d&&d(qt),Mpe()&&rt(qt)},onPointerLeave:N?void 0:function(qt){Mpe()&&yn(),Te({type:"PointerLeave"}),u&&u(qt)},onClick:N?void 0:yn,"aria-hidden":"true"},{children:[Kh.jsx("span",bo({className:"".concat(ert," ").concat(st),style:bo({color:Xe},we)},{children:Dpe([],Array(_),!0).map(function(qt,Jt){var mn;return Kh.jsx(Gu.Fragment,{children:((mn=j[Jt])===null||mn===void 0?void 0:mn.icon)||Re||Kh.jsx(kpe,{SVGclassName:Me,SVGstyle:wt,SVGstorkeWidth:en,SVGstrokeColor:an,size:C})},Jt)})})),Kh.jsx("span",bo({className:"".concat(Zit," ").concat(Ue),style:bo((t={},t[D?"right":"left"]=0,t.color=nn(pe)||Ce,t.transition=le?"width .2s ease, color .2s ease":"",t.width="".concat(Dt,"%"),t),Oe),title:Qe?"".concat(Zt," ").concat(bt," ").concat(_):void 0},{children:Dpe([],Array(_),!0).map(function(qt,Jt){var mn;return Kh.jsx(Gu.Fragment,{children:((mn=j[Jt])===null||mn===void 0?void 0:mn.icon)||_e||Kh.jsx(kpe,{SVGclassName:Me,SVGstyle:wt,SVGstorkeWidth:en,SVGstrokeColor:an,size:C})},Jt)})}))]})),St&&Kh.jsx("span",bo({className:"".concat(trt," ").concat(dt),style:bo((i={},i[D?"marginRight":"marginLeft"]=20,i),xt)},{children:(It.length>0?nn(It):Zt)||Ht}))]}))};function nrt(n){k.useState(0);const[t,i]=k.useState(0),s=`custom-rating-tooltip ${n.tooltipSize?n.tooltipSize==="small"?"tooltip-small":"tooltip-large":""} ${n.showTooltipOnHover?"show-hover":""}`,l=n.tooltipStyles?n.tooltipStyles:null,d=n.tooltipArray?n.tooltipArray:[],u={size:n.size?n.size:30,fillColor:"#FFCC80",emptyColor:n.emptyColor?n.emptyColor:"#ccc",readonly:n.readonly?n.readonly:!1,transition:n.transition?n.transition:!1,showTooltip:n.showTooltip?n.showTooltip:!1,allowHover:n.allowHover?n.allowHover:!1,initialValue:n.initialValue?n.initialValue:0,iconsCount:n.iconsCount?n.iconsCount:5,className:`custom-rating ${n.className!==""?n.className:""}`,tooltipClassName:s,tooltipDefaultText:n.tooltipDefaultText?n.tooltipDefaultText:"",tooltipArray:d},p=m=>{console.log("rate =",m),i(m),n.onUserRateChange&&n.onUserRateChange(m,n.parameterId)};return h.jsxs(h.Fragment,{children:[h.jsx(fbe,{onClick:p,emptyIcon:n.emptyIcon,fillIcon:n.fillIcon,tooltipStyles:l,...u}),t!==0&&h.jsxs("span",{className:"mt-1 fw-sb d-inline-flex justify-content-ce align-items-center rounded-3 font-13",style:{maxWidth:160,color:"var(--color-gray6)"},children:[h.jsx("span",{className:"font-12 fw-b me-2 badge rounded-pill",style:{background:"#9E9E9E",color:"#fff"},children:t}),(d==null?void 0:d.length)>0&&h.jsx("span",{className:"font-",children:`${d[t-1]}`})]})]})}function irt({evaluationInfo:n,submissionUserId:t}){var s,l,d,u,p;const i=(s=n==null?void 0:n.user_info)!=null&&s.avatar?(l=n==null?void 0:n.user_info)==null?void 0:l.avatar:"/img/profile-pic.png";return JSON.parse(Ai.getAuthUser()),h.jsxs(et,{className:`border-0 evaluation-status-card ${n!=null&&n.is_self_evaluation?"self-evaluation":""}`,children:[h.jsx(et.Header,{className:`font-13 p-2 ${n!=null&&n.is_self_evaluation?"px-1":"px-0"}`,children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:i,className:"rounded-circle media_img",alt:`${(d=n==null?void 0:n.user_info)==null?void 0:d.name} profile`})}),h.jsx("div",{className:"media_body ms-1 ms-sm-3 d-flex justify-content-betwee align-items-center",children:h.jsxs("div",{className:"mb-0 font-13 text-gray6 fw-",children:[`${n!=null&&n.is_self_evaluation?"Self Evaluated on":"Evaluated on"} `,h.jsx("span",{className:`text-gray6 ${n!=null&&n.is_self_evaluation?"d-block":""}`,children:n==null?void 0:n.createdAt}),!(n!=null&&n.is_self_evaluation)&&h.jsxs("div",{className:"d-block",children:["by"," ",h.jsx("span",{className:"fw-sb text-theme-primary",children:(u=n==null?void 0:n.user_info)==null?void 0:u.name})]})]})}),h.jsx("span",{className:"font-11 fw-b rounded-5",style:{padding:"3px 7px",backgroundColor:"var(--color-green-lighter)",color:"var(--color-gray6)"},children:`${n.marks}/${n.total}`})]})}),h.jsx(et.Body,{className:"p-2 px-0",children:((p=n==null?void 0:n.scores)==null?void 0:p.length)>0&&n.scores.map((m,y)=>{const E=100/m.max*m.scale,C=m.score/m.scale*100;return h.jsxs("div",{className:"d-flex flex-column text-gray7 mb-3",children:[h.jsxs("div",{className:"d-flex justify-content-between align-items-center text-gray6 mb-2",children:[h.jsx("div",{className:"font-13 fw-sb flex-grow-1",children:m.name}),h.jsxs("div",{className:"font-13 fw-sb text-end",style:{width:130},children:[h.jsx("span",{className:"p-1 font-12 fw-sb",children:m.regard}),h.jsxs("span",{children:[h.jsx("span",{className:"fw-b text-danger",children:`${m.score}`}),h.jsx("span",{className:"font-11",children:`/${m.scale}`})]})]})]}),h.jsx("div",{className:"d-flex justify-content-between align-items-center text-gray7",children:h.jsx("div",{className:"d-block w-100",children:h.jsx("div",{className:"",style:{width:`${E}%`},children:h.jsx(eZ,{now:C,className:"flex-grow-1"})})})})]},m.id)})})]})}function rrt(n){var y,_,E,C,x,N,O,D,P,j,M,V;const t=ji(),[i,s]=k.useState(!1),[l,d]=k.useState("evaluations_tab"),u=G=>{var $;console.log("Key in handleSelectedTab =",G),G=="evaluations_tab"&&console.log("Entering into evaluations"),G=="likes_tab"&&(console.log("Entering into likes"),n.likesListHandler(($=n.data)==null?void 0:$.id)),G=="comments_tab"&&(console.log("Entering into comments parent id =",n.parent_id),n.handleCommentList(n.parent_id),console.log(n.loading)),d(G)};let p="16x9";switch((y=n.data)==null?void 0:y.media_type.toLowerCase()){case"video":p="16x9";break;case"audio":p="21x9";break;case"image":p="16x9";break;default:p="16x9"}(_=n.data)==null||_.media_type;function m(){const G={contest_id:n.contestId,contest_title:n.contestTitle,response_id:n.data.id,response_user:n.data.user_name};t(`/contests/${n.contestId}/evaluate`,{state:{data:G,pageTitle:"Evaluate"}})}return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsxs(wn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:`heading-icon ${n.mediaIconClass} d-flex justify-content-center align-items-center rounded-circl font-24`,children:h.jsx(tn,{tag:n.mediaIcon})})}),h.jsx("div",{className:"heading flex-grow-1 ms-2",children:(E=n.data)==null?void 0:E.title})]})}),h.jsx(wn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsxs(h.Fragment,{children:[h.jsx(ci,{type:"details"})," "]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsx("span",{className:"fw-sb",children:(C=n==null?void 0:n.data)==null?void 0:C.user_name})," ",h.jsx("span",{children:(x=n==null?void 0:n.data)==null?void 0:x.created_date})]}),((N=n.data)==null?void 0:N.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"position-relative border-1",children:[i?h.jsx("div",{className:"card position-absolute start-0 end-0 top-0 bottom-0",style:{minHeight:120},children:h.jsx("div",{className:"card-body d-flex justify-content-center align-items-center",children:h.jsx(Zi,{animation:"border"})})}):null,h.jsx(iu,{aspectRatio:"9x16",className:"pdf-container",children:h.jsx("iframe",{width:"100%",src:`http://docs.google.com/gview?url=${n.data.media_url}&embedded=true`,title:(O=n.data)==null?void 0:O.name,onLoad:()=>s(!1)})})]})}):h.jsx(h.Fragment,{children:((D=n.data)==null?void 0:D.media_type.toLowerCase())==="image"?h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx("img",{src:n.data.media_url,alt:`${(P=n.data)==null?void 0:P.title} image`,className:"img-fluid mx-auto"})})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx(iu,{aspectRatio:`${p}`,children:h.jsx(gw,{url:n.data.media_url,width:"100%",height:"100%",controls:!0,light:!1,playing:!1})})})})}),h.jsxs(Zn.Container,{id:"contest-tabs-example",className:"main_tabs",activeKey:l,onSelect:G=>u(G),children:[h.jsx("div",{className:"tab_links",children:h.jsxs(Un,{variant:"pills",className:"nav-justified",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"evaluations_tab",children:h.jsx("div",{className:"",children:"Evaluations"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"likes_tab",children:h.jsx("div",{className:"",children:`${n.likeCount} ${n.likeCount===1?"Like":"Likes"}`})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"comments_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.commentsCount} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2 py-sm-3",children:[h.jsx(Zn.Pane,{className:"",eventKey:"evaluations_tab",children:((M=(j=n.data)==null?void 0:j.evaluations)==null?void 0:M.length)>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"mb-2 d-flex flex-column",children:n.data.evaluations.map((G,$)=>h.jsxs(dn.Fragment,{children:[h.jsx(irt,{evaluationInfo:G,submissionUserId:n.data.user_id},G.id),$+1!==n.data.evaluations.length&&h.jsx("div",{className:"pt-2 pb-3",style:{marginLeft:"-15px",marginRight:"-15px"},children:h.jsx("div",{className:"border-top"})})]},G.id))})}):h.jsxs("div",{className:"d-flex align-items-center justify-content-between rounded-3 p-2 mt-3",style:{backgroundColor:"var(--color-red-lighter)",color:"var(--color-gray5)"},children:[h.jsx("div",{className:"font-14 fw-sb",children:"Not Yet Evaluated!"}),h.jsx("div",{children:(V=n.data)==null?void 0:V.score})]})}),h.jsx(Zn.Pane,{className:"",eventKey:"likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(Rx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:n.data.id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(mw,{comment_type:n.comment_type,loading:n.loading,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})}),n.data.can_evaluate&&l==="evaluations_tab"&&h.jsx(wn.Footer,{className:"justify-content-center pb-0",children:h.jsx(Lt,{className:"btn-theme btn-primary btn-lg w-100",onClick:m,children:`${n.isParticipant?"Self Evaluate":"Evaluate"}`})})]})})}function srt(n){return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom comments-list-modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsxs(wn.Title,{className:"d-flex align-items-center",children:[`${n.commentsCount}`," Comments"]})}),h.jsx(wn.Body,{className:"no-scrollbar pb-0",children:h.jsx(mw,{comment_type:n.comment_type,loading:n.loading,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount})})]})})}function art({submission:n,getContestDetails:t,loadingData:i,contestId:s,contestTitle:l,contestMarks:d,contest:u}){var it;const m=JSON.parse(Ai.getAuthUser()).id===(n==null?void 0:n.user_id),y=u.show_pass_fail_icon.toLowerCase()==="yes"&&u.pass_icon?u.pass_icon:"",_=u.show_pass_fail_icon.toLowerCase()==="yes"&&u.fail_icon?u.fail_icon:"",[E,C]=k.useState(n==null?void 0:n.is_liked),[x,N]=k.useState(n==null?void 0:n.likes_count),[O,D]=k.useState(n==null?void 0:n.comments_count),[P,j]=k.useState(!1),[M,V]=k.useState(!1),[G,$]=k.useState(!0),[ne,Y]=k.useState([]),[le,re]=k.useState([]),[ee,de]=k.useState(!0),[H,ae]=k.useState(!1),[_e,me]=k.useState({isVisible:!1}),[Ce,he]=k.useState({isVisible:!1}),[pe,Oe]=k.useState(!1),[Fe,Ue]=k.useState(!1),Ve=()=>{ae(!1)},Re=()=>{me({isVisible:!1})},Be=()=>{me({isVisible:!0})},Xe=()=>{he({isVisible:!1})},we=()=>{Oe(!1)},We=()=>{Oe(!0)},st=()=>{Ue(!1)},pt=()=>{Ue(!0)},Qe=()=>{console.log("handleShowMediaBtnClick called..."),t(s),Be()},Je=Me=>{Me.stopPropagation(),console.log("handleDeleteBtnClick called..."),We()},St=Me=>{Me.stopPropagation(),console.log("handleDeleteForReattemptBtnClick called..."),pt()};let Xt="play1",Ht="media-video";switch(n==null?void 0:n.media_type.toLowerCase()){case"video":Xt="play1",Ht="media-video";break;case"audio":Xt="consult1",Ht="media-audio";break;case"pdf":Xt="pdf2",Ht="media-doc";break;case"image":Xt="image2",Ht="media-image";break;default:Xt="consult1"}async function gn(Me){console.log("function getContestSubmissionLike... called for MediaCard =",Me),V(!0),Me&&Xa.getContestSubmissionLike(Me).then(Ge=>{var bt,wt;console.log("getContestSubmissionLike RES = ",Ge.data),Ge.data.status==="success"&&(console.log("Success in getContestSubmissionLike =",Ge.data.data),C((bt=Ge.data.data)==null?void 0:bt.is_liked),console.log("Success in Media Card =",Ge.data.data),N((wt=Ge.data.data)==null?void 0:wt.likes_count),It(Me),V(!1))}).catch(Ge=>{V(!1),C(n==null?void 0:n.is_liked),N(n==null?void 0:n.likes_count),console.log("Error in getContestSubmissionLike = ",Ge)})}async function It(Me){console.log("function getContestSubmissionLikesList... called for SubmissionCard =",Me),Me&&Xa.getContestSubmissionLikesList(Me).then(Ge=>{var bt;console.log("getContestSubmissionLikesList RES = ",Ge.data),Ge.data.status==="success"&&(console.log("Success in getContestSubmissionLikesList =",Ge.data.data.likes),Y((bt=Ge.data.data)==null?void 0:bt.likes),console.log("Success in Submission Card Likes lIst =",Ge.data.data),$(!1))}).catch(Ge=>{$(!1),Y([]),console.log("Error in getContestSubmissionLikesList = ",Ge)})}async function xt(Me){console.log("function getAllContestSubmissionCommentList... called for Contest Card =",Me),Me&&Xa.getAllContestSubmissionCommentList(Me).then(Ge=>{var bt;console.log("getAllContestSubmissionCommentList RES = ",Ge.data),Ge.data.status==="success"&&(console.log("Success in getAllContestSubmissionCommentList =",Ge.data.data.comments),re((bt=Ge.data.data)==null?void 0:bt.comments),de(!1),console.log("Success in Submission Card Comments lIst =",Ge.data.data))}).catch(Ge=>{de(!1),re([]),console.log("Error in getAllContestSubmissionCommentList = ",Ge)})}async function mt(Me){console.log("function deleteContestResponseRecord... called for SubmissionCard =",Me),j(!0),Me&&Xa.deleteContestResponseRecord(Me).then(Ge=>{console.log("deleteContestResponseRecord RES = ",Ge.data),Ge.data.status==="success"&&(console.log("Success in deleteContestResponseRecord =",Ge.data.data),j(!1),we(),t(s))}).catch(Ge=>{j(!1),console.log("Error in deleteContestResponseRecord = ",Ge)})}async function dt(Me){console.log("function deleteContestResponseRecordForReattempt... called for SubmissionCard =",Me),j(!0),Me&&Xa.deleteContestResponseRecordForReattempt(Me).then(Ge=>{console.log("deleteContestResponseRecordForReattempt RES = ",Ge.data),Ge.data.status==="success"&&(console.log("Success in deleteContestResponseRecordForReattempt =",Ge.data.data),j(!1),we(),t(s))}).catch(Ge=>{j(!1),console.log("Error in deleteContestResponseRecordForReattempt = ",Ge)})}return h.jsxs(h.Fragment,{children:[h.jsxs(et,{className:"card-theme submission-card border-0 shadow-sm position-relative overflow-hidden",children:[((it=n==null?void 0:n.evaluations)==null?void 0:it.length)>0&&h.jsx("div",{className:"media-viewed-icon position-absolute",children:h.jsx(tn,{tag:"check1",className:"font-18"})}),h.jsx("div",{className:"position-absolute",style:{top:20,right:15},children:(u==null?void 0:u.show_pass_fail_icon.toLowerCase())==="yes"&&n.score>0?n.score>=d?h.jsx(h.Fragment,{children:h.jsx("img",{src:y,className:"position-absolue",width:42,alt:"Pass Icon"})}):h.jsx(h.Fragment,{children:h.jsx("img",{src:_,className:"position-absolue",width:42,alt:"Fail Icon"})}):h.jsx(h.Fragment,{})}),h.jsxs(et.Header,{className:"p-2 px-sm-3 py-3 position-relative border-bottom-0",onClick:Qe,children:[h.jsxs("div",{className:"d-flex justify-content-betwee align-items-center font-13 text-gray6 pb-2 pb-sm-3",children:[h.jsx("div",{className:"mb-0 font-1 text-gra fw-sb",children:n==null?void 0:n.user_name}),h.jsx("span",{className:"dot-seperator"}),h.jsx("div",{className:"font-1 text-gra",children:n==null?void 0:n.created_date})]}),h.jsxs("div",{className:"d-flex media-header-container align-items-center py-2",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:`d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden ${Ht}`,children:h.jsx(tn,{tag:Xt,className:"font-28"})})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:[h.jsx("span",{className:"d-block mb-1 pe-3 pe-sm-5 fw-sb",children:n==null?void 0:n.title}),h.jsxs("div",{className:"d-flex justify-content-betwee align-items-center font-12 text-gray8",children:[h.jsxs("span",{className:"",children:[h.jsx("span",{className:"fw-sb text-gray6",children:n==null?void 0:n.score}),`/${n==null?void 0:n.total} score`]}),h.jsx("span",{className:"dot-seperator"}),h.jsx("span",{className:"",children:`${x} ${x===1?"like":"likes"}`}),h.jsx("span",{className:"dot-seperator"}),h.jsx("span",{className:"border-nd ",children:`${O} ${O===1?"comment":"comments"}`})]}),n.can_delete&&h.jsx(Lt,{size:"sm",className:"btn-theme btn-red btn-sm font-12 px-2 position-absolute top-50",style:{right:8,zIndex:1},onClick:Me=>Je(Me),children:h.jsx(tn,{tag:"delete5",className:"font-16"})})]})]})]}),h.jsxs(et.Footer,{className:"p-0 bg-transparent border-0",children:[(n==null?void 0:n.can_evaluate)&&h.jsx(Lt,{className:"btn-theme btn-md btn-primary-light w-100 rounded-0 text-uppercase fw-sb",style:{letterSpacing:"0.06rem"},onClick:Qe,children:`${m?"Self Evalute":"Evalute"}`}),(n==null?void 0:n.can_reattempt)&&h.jsx(Lt,{className:"btn-theme btn-md btn-red-light w-100 rounded-0 text-uppercase fw-sb",style:{letterSpacing:"0.06rem"},onClick:Me=>St(Me),children:"Re-attempt"}),h.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[h.jsx("div",{className:"d-fl"}),h.jsx("div",{className:"btn-wrap"})]})]})]}),h.jsx(Bit,{classNames:"",show:H,handleClose:Ve,likesData:ne,isLiked:E,likeCount:x,loading:G,isHandleLoading:M,handleLike:gn,parentId:n==null?void 0:n.id}),h.jsx(rrt,{show:_e,handleClose:Re,mediaUrl:n==null?void 0:n.media_url,data:n,loadingData:i,mediaIcon:Xt,mediaIconClass:Ht,likesData:ne,likeCount:x,isLiked:E,likeActionHandler:gn,loadingMediaLike:M,loadingLikesList:G,likesListHandler:It,contestId:s,contestTitle:l,contest:u,isParticipant:m,comment_type:"contest",loading:ee,parent_id:n==null?void 0:n.id,parent_owner_id:null,comments:le,handleCommentList:xt,setCommentsCount:D,commentsCount:O}),h.jsx(srt,{show:Ce,handleClose:Xe,comment_type:"contest",loading:ee,parent_id:n==null?void 0:n.id,parent_owner_id:null,comments:le,handleCommentList:xt,setCommentsCount:D,commentsCount:O}),h.jsx(tx,{show:pe,loading:P,handleClose:we,primaryActionData:n==null?void 0:n.id,content_type:"submission-delete-modal",handlePrimaryAction:mt}),h.jsx(tx,{show:Fe,loading:P,handleClose:st,primaryActionData:n==null?void 0:n.id,content_type:"reattempt-submission-delete-modal",handlePrimaryAction:dt})]})}function ort({itemDetails:n,submissions:t,getContestDetails:i,loading:s}){var j,M,V;const l=ji();JSON.parse(Ai.getAuthUser()),k.useState(!1);const[d,u]=k.useState(t);k.useState(!1);const[p,m]=k.useState("all");k.useEffect(()=>{const G=N(p,t);u(G)},[n,s]);const y=[{key:"All",value:"all"},{key:"Pending",value:"pending"},{key:"Evaluated",value:"evaluated"}],_=k.useRef();let E="16x9";switch(n==null?void 0:n.media_type.toLowerCase()){case"video":E="16x9";break;case"audio":E="21x9";break;case"image":E="1x1";break;default:E="16x9"}const C=(n==null?void 0:n.media_type)==="audio"&&{marginTop:"-90px"};function x(G){const $=G.target.value.toLowerCase();console.log($),m($);const ne=N($,t);u(ne)}function N(G,$){switch(console.log("selectedSegment =",G,`
data = `,$),G){case"all":return console.log("case : ",G),$;case"pending":console.log("case : ",G);const ne=$.filter((le,re)=>!le.evaluations.length>0||le.score===0);return console.log("Result =",ne),ne;case"evaluated":console.log("case : ",G);const Y=$.filter((le,re)=>le.evaluations.length>0);return console.log("Result =",Y),Y}}const O=()=>{_.current.value="";const G=N(p,t);u(G)};function D(G,$){console.log("searchContestResponse - filteredData =",$);const ne=$.filter((Y,le)=>Y.user_name.toLowerCase().includes(G.toLowerCase())||Y.title.toLowerCase().includes(G.toLowerCase()));return console.log("Result =",ne),ne}const P=Tx.debounce(G=>{console.log("This is function from lodash..."),console.log("Search text =",G);const $=N(p,t);G.trim().length>0?(console.log(G.trim()),u(D(G.trim(),$))):u($)},500);return h.jsxs("div",{className:"contest-details-card",children:[h.jsx("div",{className:"p-2 px-0 font-15 fw-sb mb-0",children:n==null?void 0:n.title}),h.jsxs("div",{className:"font-13 mb-3 d-flex align-items-center",children:[h.jsx("span",{className:"text-theme-primary",children:"Published By: "})," ",h.jsx("span",{className:"ps-2",children:(j=n==null?void 0:n.user_info)==null?void 0:j.name})]}),((n==null?void 0:n.media_type.toLowerCase())==="video"||(n==null?void 0:n.media_type.toLowerCase())==="video")&&(n==null?void 0:n.media)!==""?h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx(iu,{aspectRatio:`${E}`,style:C,children:h.jsx(gw,{url:n.media,width:"100%",height:"100%",controls:!0,playing:!1})})})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx(Ts,{src:n==null?void 0:n.cover_image,alt:`${n==null?void 0:n.title} image`,wrapperClassName:"card-img mb-3"})})}),h.jsx(bP,{text:n==null?void 0:n.description,linesToShow:2,containerClass:"font-13 contest-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}}),h.jsx("hr",{}),(n==null?void 0:n.is_result_published)!=="yes"?h.jsx("div",{className:"font-15 fw-sb mb-2 mb-sm-3",children:"Responses"}):h.jsx("div",{className:"font-15 fw-sb mb-2 mb-sm-3",children:"Top Results"}),(t==null?void 0:t.length)>0&&!(n!=null&&n.is_participant)&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"py- pt-1 pb-3",children:h.jsx("div",{className:"custom-segment-btn-group",children:y.map(G=>h.jsxs("div",{className:"segment-btn",children:[h.jsx("input",{type:"radio",name:"segments",id:G.value,value:G.value,onChange:x,checked:p===G.value}),h.jsxs("label",{htmlFor:G.value,children:[h.jsx(tn,{tag:"check1",className:`font-20 text-gray5 ${p===G.value?"d-inline-flex opacity-100 visible":"d-inline-flex opacity-0 invisible"}`}),G.key]})]},G.value))})}),h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-3 position-relative",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:G=>{console.log("Search input = ",G),P(G.target.value)},ref:_,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((M=_==null?void 0:_.current)==null?void 0:M.value.length)>0&&h.jsx(Lt,{onClick:O,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6},type:"button",children:h.jsx(ow,{})}),((V=_==null?void 0:_.current)==null?void 0:V.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${d==null?void 0:d.length}`})]})]}),h.jsx("div",{className:"d-grid gap-3",children:!s&&(t==null?void 0:t.length)>0?h.jsx(h.Fragment,{children:(d==null?void 0:d.length)>0?h.jsx(h.Fragment,{children:d.map(G=>h.jsx(art,{submission:G,getContestDetails:i,loadingData:s,contestId:n==null?void 0:n.id,contestTitle:n==null?void 0:n.title,contestMarks:n==null?void 0:n.marks,contest:n},G.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more responses found."})})})})}):h.jsx(et,{className:"border-0 shadow-sm",children:h.jsxs(et.Body,{className:"text-center",children:[h.jsx("div",{className:"p-2 p-sm-3 font-14 fw-sb",children:"Have not submitted any response yet!"}),(n==null?void 0:n.upload_btn)&&h.jsx(fn,{className:"row-cols-1 justify-content-center pt-2",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Lt,{className:"btn-theme btn-primary btn-md px- position-relative font-14 w-100",onClick:()=>l(`/contests/${n==null?void 0:n.id}/upload-response`,{state:{item:n,pageTitle:"Upload Response"}}),children:"Upload"})})})]})})})]})}function lrt(){const{contestId:n}=PU();tl();const[t,i]=k.useState(null),[s,l]=k.useState(!0);k.useState(!1);const[d,u]=k.useState([]);async function p(m){console.log("contestId =",m),Xa.getContestDetails(m).then(y=>{var _,E;console.log("getContestDetails RES = ",y.data),y.data.status==="success"&&(console.log("Success in getContestDetails =",y.data.data.contest),i(y.data.data.contest),u((E=(_=y.data)==null?void 0:_.data)==null?void 0:E.submissions),l(!1))}).catch(y=>{l(!1),i(null),u([]),console.log("Error in getContestDetails = ",y)})}return k.useEffect(()=>{p(n)},[n]),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[s&&h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"}),!s&&h.jsx(ort,{itemDetails:t,submissions:d,getContestDetails:p,loading:s})]})})}function crt({className:n}){const t=n||"";return h.jsx(h.Fragment,{children:h.jsxs("div",{className:`waves-container ${t}`,children:[h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"})]})})}function pbe(n){k.useState(!1);const[t,i]=k.useState(!1);k.useEffect(()=>{console.log("counter - ",n.counter)},[n.counter]);let s={backdrop:"static",keyboard:!1};function l(){console.log("Inside handleStartRecordingAction btn click handler"),t||(i(!0),n.handleStart(),n.onRecordingStart())}function d(){console.log("Inside handleStopRecordingAction btn click handler"),t&&(n.handlePause(),n.onRecordingStop(),n.handleClose(),i(!1))}function u(){i(!1),n.handleClose()}return h.jsx(h.Fragment,{children:h.jsx(wn,{centered:!0,size:"md",className:"theme-modal confirmation-modal audio-recording-modal",...s,show:n.show,onHide:n.handleClose,children:h.jsxs(wn.Body,{children:[h.jsx(Lt,{type:"button",className:`btn-theme btn-icon btn-sm btn-transparent position-absolute ${t?"d-none":""}`,style:{right:5,top:8},onClick:u,children:h.jsx(tn,{tag:"delete7",className:"font-32 text-gray9"})}),h.jsx("div",{className:"font-18 fw-sb mb-3 text-center",style:{color:"#684609"},children:"Start recording audio"}),h.jsxs("div",{className:"font-16 fw-sb mb-3 text-center",children:["Time:"," ",n.counter<=60?n.counter+"s":OQ(n.counter,":")+"m"]}),h.jsx(crt,{className:`my-3 ${t?"":"d-none"}`}),h.jsxs("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:[!t&&h.jsx(h.Fragment,{children:h.jsx(Lt,{type:"submit",className:`btn-theme
btn-yellow btn-md flex-grow-1`,onClick:l,children:"Start Recording"})}),t&&h.jsx(h.Fragment,{children:h.jsx(Lt,{type:"submit",className:`btn-theme
btn-yellow btn-md flex-grow-1`,onClick:d,children:"Stop Recording"})})]})]})})})}const gee=(n,t)=>{const[i,s]=k.useState(n),[l,d]=k.useState(t),[u,p]=k.useState(!1);let m=k.useRef();return k.useEffect(()=>{m.current=!l&&setTimeout(()=>{s(i+1)},1e3),console.log("counter = ",i)},[i,l,u]),{counter:i,handleStart:()=>{d(!1)},handlePause:()=>{d(!0)},handleIncrement:()=>s(i+1),handleDecrement:()=>s(i-1),handleReset:()=>{s(0),clearTimeout(m.current)},handleStop:()=>{d(!0),s(0),clearTimeout(m.current)},handleChange:D=>{const{value:P}=D.target;s(parseInt(P,0))}}},zp=lu("VoiceRecorder",{web:()=>lr(()=>import("./web-CKoccc5W.js"),__vite__mapDeps([])).then(n=>new n.VoiceRecorderWeb)});function drt({mediaType:n,mediaSource:t,className:i,contestId:s,handleClose:l,data:d,fileSizelimit:u,videoDurationLimit:p,audioDurationLimit:m,minCompressionLimit:y}){const _=ji(),[E,C]=k.useState(),[x,N]=k.useState(null),[O,D]=k.useState(""),[P,j]=k.useState(null),[M,V]=k.useState(""),[G,$]=k.useState(0),[ne,Y]=k.useState(!1);k.useState();const[le,re]=k.useState(0),[ee,de]=k.useState(!1),[H,ae]=k.useState(!1);k.useState(!1);const[_e,me]=k.useState(!1),[Ce,he]=k.useState(null),[pe,Oe]=k.useState(!1);k.useState(!1);const[Fe,Ue]=k.useState(!1),[Ve,Re]=k.useState(!1),{counter:Be,handleStart:Xe,handlePause:we,handleReset:We}=gee(0,!0),st=k.useRef(!1);k.useRef(null);const pt=k.useRef(null),Qe=k.useRef(null);k.useRef(null);const Je=k.useRef(null),St=k.useRef(null);k.useRef(null);const Xt=k.useRef(null),Ht={title:""},gn=gc({title:Ef().required("Required")}),It=n?n==="pdf"?".pdf":`${n}/*`:"image/*",xt=n!==""?"user":"",mt=n?`${n}-gallery-file`:"media-gallery-file",dt=n?`${n}-camera-file`:"media-camera-file",it=()=>{Oe(!1)},Me=Dt=>{console.log("handleShowRecordAudioModal () - MEDIA TYPE = ",Dt),Oe(!0)},Ge=()=>{Ue(!1)},bt=()=>{Ue(!0)};async function wt(){console.log("onRecordingStart called...");const Dt=await zp.startRecording();console.log("recordStartResult = ",Dt)}async function Pt(){console.log("onRecordingStop called...");const Dt=await zp.stopRecording();if(console.log("onRecordingStop counter =",Be),console.log("recordStopResult = ",Dt),Dt.value){const qt=Dt.value;$(Math.round(qt.msDuration/1e3)),Y(!0),me(!0);const Jt=qt.msDuration,mn=Math.round(Jt/1e3);console.log("fileDurationInMS = ",Jt," fileDurationInSec =",mn);const Kn=qt.recordDataBase64,On=qt.mimeType;let Tn=On.substring(0,On.indexOf(";"));const Ui=`data:${Tn};base64,${Kn}`;var nn=en(Ui);console.log("Binary file =",nn);var Zt=new Blob([nn],{type:`${Tn}`});console.log("blob = ",Zt),C({...Dt.value,size:Zt.size}),he(Tn);const xr=ax(Zt.size,{standard:"jedec"});console.log("Recorded Audio fileSize = ",xr),j(xr);const bi=URL.createObjectURL(Zt);console.log("blobUrl = ",bi),N(bi),console.log("File Obj =",E)}else console.log("Unable to record/play audio")}function en(Dt){var nn=";base64,",Zt=Dt.indexOf(nn)+nn.length,qt=Dt.substring(Zt),Jt=window.atob(qt),mn=Jt.length,Kn=new Uint8Array(new ArrayBuffer(mn));for(let On=0;On<mn;On++)Kn[On]=Jt.charCodeAt(On);return Kn}async function un(){if(console.log("onRecordBtnClick called..."),(await zp.canDeviceVoiceRecord()).value){const nn=await zp.hasAudioRecordingPermission();if(nn.value)console.log("hasAudioPermission set",nn),Me();else{console.log("hasAudioPermission not set...request permissions...",nn);const Zt=await zp.requestAudioRecordingPermission();console.log("requestedPermissionResult = ",Zt)}}}function an(Dt){if(console.log("Inside handleChange =",Dt.target.files[0]),Dt.target.files[0]){C(Dt.target.files[0]),Y(!0);const nn=ax(Dt.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",nn),j(nn),n){case"image":let Zt=URL.createObjectURL(Dt.target.files[0]);pt.current.src=Zt,pt.current.className="d-block";break;case"video":let qt=URL.createObjectURL(Dt.target.files[0]);console.log("blobVideoURL =",qt),N(qt),Xt.current.onloadedmetadata=mn=>{console.log("tempVideoRef.current.onloadedmetadata evt = ",mn),URL.revokeObjectURL(qt)};break;case"audio":let Jt=URL.createObjectURL(Dt.target.files[0]);console.log("Case audio: ",Jt),N(Jt);break;case"pdf":console.log("PDF Preview =",Qe.current),Qe.current.className="d-block";break;default:console.log("No case matched...")}}}function ye(){if(E)switch(C(null),Y(!1),V(""),j(null),We(),Je.current&&(Je.current.value=""),St.current&&(St.current.value=""),n){case"image":console.log("Image Preview =",pt.current),pt.current.src="",pt.current.className="d-none";break;case"video":N(null);break;case"audio":N(null),me(!1);break;case"pdf":console.log("PDF Preview =",Qe.current),Qe.current.className="d-none";break;default:console.log("No case matched...")}}const Q=Dt=>new Promise((nn,Zt)=>{const qt=new FileReader;qt.onload=()=>{const Jt=qt.result;nn(Jt)},qt.onerror=()=>{Zt(new Error("Unable to read the file as binary data"))},qt.readAsArrayBuffer(Dt)}),ie=new AbortController,je=Gr.CancelToken.source();k.useEffect(()=>()=>{console.log("Called cancellation from UploadResponseMediaFile..."),st.current&&(console.log("Called cancellation inside if(bool.current)...",st==null?void 0:st.current),je.cancel("Upload cancelled by user"),ie.abort())},[]);function tt(){st.current=!0,l(),je.cancel("Upload cancelled by user"),ie.abort(),ie.signal.aborted&&Qt("Uploading cancelled!","error")}async function Te(Dt){return await ps.getSignedUploadUrl(Dt)}async function Pe(Dt,nn,Zt,qt){const Jt=nn.map((On,Tn)=>{const Ui=new URL(On);console.log("parser = ",Ui);const xr=Ui.pathname;return{url:On,pathName:xr.replace("/","")}});console.log("urls = ",Jt);let mn=null,Kn=[];try{const On=100/qt;let Tn=0,Ui=0,xr=0;for(ae(!0);xr<=E.size;){console.log("Value of start = ",Ui),console.log("Value of end = ",xr),Ui=Tn*Zt,xr=Ui+Zt;const Da=await E.slice(Ui,xr).arrayBuffer(),Rl=V0e.from(Da),_c={headers:{ExposeHeader:"ETag","Access-Control-Expose-Headers":"ETag"},cancelToken:je.token,signal:ie.signal,onUploadProgress:function(cu){const Io=Math.round(Tn*On);re(Io)}};mn=await Gr.put(Jt[Tn].url,Rl,_c),Kn.push({PartNumber:Tn+1,Part:Jt[Tn].pathName}),Tn++}}catch(On){console.log("error in uploading = ",On),Qt("Failed to upload!");return}return console.log("parts_info = ",Kn),mn={...mn,parts_info:Kn},mn}async function Ze(Dt,nn){let Zt=null;if(_e){const mn=E==null?void 0:E.recordDataBase64,Kn=E==null?void 0:E.mimeType,Tn=`data:${Kn.substring(0,Kn.indexOf(";"))};base64,${mn}`;Zt=en(Tn),console.log("Binary file =",Zt)}else Zt=await Q(E),console.log("Normal - else condition binaryData = ",Zt);const qt={headers:{},cancelToken:je.token,signal:ie.signal,onUploadProgress:function(mn){const Kn=Math.round(mn.loaded*100/mn.total);re(Kn)}};return console.log(qt),await Gr.put(nn,Zt,qt)}const nt=async(Dt,{resetForm:nn})=>{var Kn,On,Tn,Ui,xr;if(O===""){console.log("Inside mediaUrl === '' "),Qt("Upload Valid File","error");return}console.log("File for uploading = ",E),de(!0);let Zt="";_e?Zt=Ce.split("/")[1]:Zt=E.name.substring(E.name.lastIndexOf(".")+1),console.log("fileExtension = ",Zt);let qt={fileextention:Zt,modulename:"detailing"};const Jt=25*1024*1024,mn=Math.ceil((E==null?void 0:E.size)/Jt);n==="video"&&(qt={...qt,parts:mn}),console.log("data for getSignedUrl = ",qt);try{const bi=await Te(qt);if(console.log("getSignedUrl response =",bi),((Kn=bi==null?void 0:bi.data)==null?void 0:Kn.status)==="success"&&(bi==null?void 0:bi.status)===200){const Da=(Tn=(On=bi==null?void 0:bi.data)==null?void 0:On.data)==null?void 0:Tn.resourceUrl,Rl=(xr=(Ui=bi==null?void 0:bi.data)==null?void 0:Ui.data)==null?void 0:xr.uploadURL;console.log("--- uploadUrls = ",Rl);let _c=null;if(n==="video"){const cu=await Pe(bi,Rl,Jt,mn);if(cu.status===200){const Io=new URL(Da);console.log("parser = ",Io);const e0=Io.pathname,t0={parts:cu.parts_info,filename:e0.replace("/","")};console.log("completeUploadData = ",t0);try{_c=await ps.completeChunkUpload(t0),Qt("Saving contest response...","success"),console.log("completeUploadRes = ",_c)}catch(Qa){console.log("Error while calliing wallmessage/completechunkupload = ",Qa),Qt("Problem in uploading file! Please try after sometime","error"),ae(!1),re(0),de(!1),C(null),Y(!1),l();return}}else console.log("THERE IS AN ERROR IN uploadConfig...",result1)}else _c=await Ze(bi,Rl);if(console.log("uploadResult =",_c),_c.status===200){console.log("uploadProgress in uploadResult.status === 200 =",le);const cu={contest_id:s,title:Dt.title,media_type:n,media_url:Da};if(console.log("contestResponseData = ",cu),console.log("bool after upload = ",st==null?void 0:st.current),st.current)return;ae(!1),re(0),de(!1),C(null),Y(!1),Xa.addContestResponseRecord(cu).then(Io=>{console.log("addContestResponseRecord RES =",Io.data),Io.data.status==="success"&&(console.log("addContestResponseRecord SUCCESS RES =",Io.data),Qt("Contest Response Saved","success"),re(0),de(!1),C(null),Y(!1),l(),_(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}}))}).catch(Io=>{console.log(Io),Qt("Failed to save Contest Response","error"),de(!1)})}else{console.log("THERE IS AN ERROR IN uploadConfig...",result1),Qt("UploadResult Else: Problem in uploading file! Please try after sometime","error"),ae(!1),re(0),de(!1),C(null),Y(!1),l();return}}else{console.log("Error in signedUrlResponse =",bi),Qt("Problem in uploading file! Please try after sometime","error"),ae(!1),re(0),de(!1),C(null),Y(!1),l();return}}catch(bi){Qt("Problem in uploading file! Please try after sometime","error"),ae(!1),re(0),de(!1),C(null),Y(!1),l(),console.log("ERROR in uploading (get signed urls) = ",bi)}};function $e(Dt){console.log("getDuration called...",Dt),_e||$(Math.round(Dt))}function rt(Dt){console.log("Video player ready --- t = ",Dt),console.log("active layer ---- ",Dt.getActivePlayer()),console.log("getInternalPlayer layer ---- ",Dt.getInternalPlayer())}const yn=({played:Dt,playedSeconds:nn,loaded:Zt,loadedSeconds:qt})=>{var Jt,mn,Kn;console.log("File Obj =",E),console.log("handleProgress called...",Zt),n==="video"&&G>((Jt=d==null?void 0:d.limits)==null?void 0:Jt.video)||n==="audio"&&G>((mn=d==null?void 0:d.limits)==null?void 0:mn.audio)||(E==null?void 0:E.size)>((Kn=d==null?void 0:d.limits)==null?void 0:Kn.size)*1024*1024?(console.log("getDuration condition If part"),console.log("fileDuration = ",G," mediaType = ",n," Size =",E==null?void 0:E.size),D("")):(console.log("getDuration condition else part"),console.log("fileDuration = ",G," mediaType = ",n," Size =",E==null?void 0:E.size," compression Limit =",y),D(E.name),V(""))};return h.jsxs(h.Fragment,{children:[h.jsx(od,{initialValues:Ht,validationSchema:gn,onSubmit:nt,enableReinitialize:!0,children:Dt=>{var nn,Zt,qt,Jt,mn;return h.jsx(h.Fragment,{children:h.jsxs(kt,{className:"form_style",onSubmit:Dt.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-13",children:"Response title"}),h.jsx(kt.Control,{type:"text",placeholder:"title",name:"title",...Dt.getFieldProps("title"),autoComplete:"off"}),Dt.touched.title&&Dt.errors.title?h.jsx("p",{className:"error-state-text font-12 text-danger",children:Dt.errors.title}):null]}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx("div",{className:"font-13",children:"Choose upload type"}),h.jsx("div",{className:"btn-wrap d-flex py-2",children:t.length>0&&h.jsxs(h.Fragment,{children:[(n==="video"||n==="image")&&h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Je,name:dt,id:dt,className:"uploadMediafile",capture:xt,accept:It,onChange:an,disabled:ne}),h.jsx("label",{htmlFor:dt,className:"justify-content-center px-2 capture-btn",children:"Camera"})]}),n==="audio"&&h.jsx("div",{className:"flex-grow-1",children:h.jsx(Lt,{onClick:un,className:"btn-theme btn-primary w-100 font-14 fw-sb",style:{padding:"10px 12px"},children:"Record"})}),h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:St,name:mt,id:mt,className:"uploadMediafile",accept:It,onChange:an,disabled:ne}),h.jsx("label",{htmlFor:mt,className:"justify-content-center px-2 gallery-btn",children:"Gallery"})]})]})})]}),(le>0||H)&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-3",children:[h.jsx("span",{className:"font-13 fw-sb pe-2",children:"Uploading: "}),h.jsx("progress",{value:le,max:"100"}),h.jsx("span",{className:"font-13 fw-sb ps-2",children:`${le}%`})]}),h.jsx("div",{className:"d-flex justify-content-between font-14",children:!E&&G<=0?"No file selected":n==="video"&&G>((nn=d==null?void 0:d.limits)==null?void 0:nn.video)||n==="audio"&&G>((Zt=d==null?void 0:d.limits)==null?void 0:Zt.audio)||(E==null?void 0:E.size)>((qt=d==null?void 0:d.limits)==null?void 0:qt.size)*1024*1024?h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${E?"d-flex":"d-none"}`,style:{background:"var(--color-red-lighter)"},children:[h.jsxs("span",{className:" fw-sb font-13 flex-grow- me-1",children:[h.jsx("span",{className:"text-dange",children:"Upload limit exceeds"})," ",D2(G)]}),h.jsx("span",{className:"fw-sb font-13",children:P?` and ${P}`:""})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${E?"d-flex":"d-none"}`,style:{background:"var(--color-green-lighter)"},children:[h.jsxs("span",{className:"font-13 fw-sb flex-grow- text-break",children:['"Uploaded file: "'," ",D2(G)]}),h.jsx("span",{className:"ms-1 fw-sb font-13",children:P?`and ${P}`:""})]})})}),E&&n==="video"&&G<((Jt=d==null?void 0:d.limits)==null?void 0:Jt.video)&&(E==null?void 0:E.size)<((mn=d==null?void 0:d.limits)==null?void 0:mn.size)*1024*1024?h.jsx("div",{}):h.jsx(h.Fragment,{}),h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Lt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${ne?"d-block":"d-none"} ${ee?"pe-none":""}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:ye,children:h.jsx(tn,{tag:"delete7",className:"font-26"})}),h.jsx(iu,{aspectRatio:`${n==="audio"?"21x9":n==="image"?"1x1":"16x9"}`,className:"preview-container",children:h.jsxs(h.Fragment,{children:[n==="image"&&h.jsx("img",{ref:pt,src:"",alt:"preview image",className:"img-fluid mx-auto d-none"}),(n==="video"||n==="audio")&&h.jsx(gw,{url:x,width:"100%",height:"100%",controls:!0,playing:!1,onDuration:Kn=>$e(Kn),onReady:rt,onProgress:({played:Kn,playedSeconds:On,loaded:Tn,loadedSeconds:Ui})=>yn({played:Kn,playedSeconds:On,loaded:Tn,loadedSeconds:Ui})}),n==="pdf"&&h.jsxs("div",{ref:Qe,className:"d-none",children:[h.jsx(tn,{tag:"pdf1",className:"me-2 font-30 text-danger"}),h.jsx("span",{className:"font-16 fw-sb",children:E==null?void 0:E.name})]})]})})]}),h.jsx("video",{ref:Xt,autoPlay:!1,className:"d-none opacity-0 visibility-hidden",style:{height:"0.1px",width:"0.1px"}}),M&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-flex w-100 p-1 rounded-2 mt-2",style:{background:"var(--color-red-lighter)"},children:h.jsx("span",{className:"d-block text-danger font-13 fw-sb",children:M})})}),h.jsxs("div",{className:"btn-wrap pt-3 pb-4 d-flex justify-content-center position-fixed px-3 bg-white border-top",style:{bottom:0,right:0,left:0},children:[h.jsx(Lt,{type:"button",className:"btn-theme btn-gray btn-md flex-grow-1",onClick:bt,children:"Back"}),h.jsx(Lt,{type:"submit",disabled:!Dt.isValid,className:"btn-theme btn-primary btn-md flex-grow-1",children:ee?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(Dt.isValid,"Submit")})]})]})})}}),h.jsx(pbe,{show:pe,handleClose:it,onRecordingStart:wt,onRecordingStop:Pt,counter:Be,handlePause:we,handleStart:Xe,className:""}),h.jsx(tx,{show:Fe,loading:Ve,handleClose:Ge,primaryActionData:null,content_type:"force-upload-submission-cancel-modal",handlePrimaryAction:tt})]})}var jpe;(function(n){n[n.voice_call=0]="voice_call",n[n.system=1]="system",n[n.ring=2]="ring",n[n.default=3]="default",n[n.music=3]="music",n[n.alarm=4]="alarm",n[n.notification=5]="notification",n[n.dtmf=8]="dtmf"})(jpe||(jpe={}));const ho=lu("Volumes",{web:()=>lr(()=>import("./web-J-AkvR8H.js"),__vite__mapDeps([])).then(n=>new n.VolumesWeb)}),Z2=lu("Device",{web:()=>lr(()=>import("./web-Bt-6tDvg.js"),__vite__mapDeps([])).then(n=>new n.DeviceWeb)}),Upe=30;function urt({show:n,handleClose:t,contestId:i,videoDurationLimit:s,counter:l,handlePause:d,handleStart:u,handleReset:p,handleStop:m,handleSaveAgoraRecording:y}){let _={backdrop:"static",keyboard:!1};const[E,C]=k.useState(!1),x=Yp(),[N,O]=k.useState(null),[D,P]=k.useState(!0),[j,M]=k.useState(!1),[V,G]=k.useState(!0),[$,ne]=k.useState(!1),[Y,le]=k.useState(!1),[re,ee]=k.useState(!1),[de,H]=k.useState(1);async function ae(){console.log("getDeviceVolume called...");const We=await ho.getVolumeLevel({type:0}),st=await ho.getVolumeLevel({type:1}),pt=await ho.getVolumeLevel({type:2}),Qe=await ho.getVolumeLevel({type:3}),Je=await ho.getVolumeLevel({type:4}),St=await ho.getVolumeLevel({type:5}),Xt=await ho.getVolumeLevel({type:6}),Ht=await ho.getVolumeLevel({type:7}),gn=await ho.getVolumeLevel({type:8});We&&H(We.value),console.log("--vol1 = ",JSON.stringify(We)),console.log("--vol2 = ",JSON.stringify(st)),console.log("--vol3 = ",JSON.stringify(pt)),console.log("--vol4 = ",JSON.stringify(Qe)),console.log("--vol5 = ",JSON.stringify(Je)),console.log("--vol6 = ",JSON.stringify(St)),console.log("--vol7 = ",JSON.stringify(Xt)),console.log("--vol8 = ",JSON.stringify(Ht)),console.log("--vol9 = ",JSON.stringify(gn))}async function _e(We){console.log("setDeviceVolume called..."),console.log("setDeviceVolume called...for android");const st=await ho.setVolumeLevel({value:We,type:0});await ho.setVolumeLevel({value:We,type:1}),await ho.setVolumeLevel({value:We,type:2}),await ho.setVolumeLevel({value:We,type:3}),await ho.setVolumeLevel({value:We,type:4}),await ho.setVolumeLevel({value:We,type:5}),await ho.setVolumeLevel({value:We,type:6}),await ho.setVolumeLevel({value:We,type:7}),await ho.setVolumeLevel({value:We,type:8}),console.log("Set --vol = ",JSON.stringify(st))}k.useEffect(()=>{n&&(console.log("Inside useEffect = ",n),console.log("videoCallData = ",N),me(i),ae())},[n]);async function me(We){var st,pt,Qe,Je;if(console.log("Called initializeCallAndGetDetails() from AgoraVideoModal..."),!We){Qt("Unable to initialize...");return}try{const St=await Xa.initializeCallAndGetDetails(We);if(((st=St.data)==null?void 0:st.status)==="success"){console.log("initializeCallAndGetDetails res = ",St.data);const Xt=(Qe=(pt=St.data)==null?void 0:pt.data)==null?void 0:Qe.call_details;O(Xt),P(!1),Ce(),_e(1)}((Je=St.data)==null?void 0:Je.status)==="failed"&&(console.log("initializeCallAndGetDetails res = ",St.data),O(null),P(!1),Qt("Failed to connect to camera!","error"),G(!1),M(!1),we())}catch(St){console.log("Error in initializeCallAndGetDetails Error = ",St),G(!1),M(!1),we()}}function Ce(){C(!0),G(!0),M(!0),Ve.current=setTimeout(pe,Upe*1e3),console.log("idleTimeLimitRef.current = ",Ve.current)}function he(){C(!1),M(!1),G(!1)}function pe(){if($){clearTimeout(Ve.current);return}Qt(`Your are idle for more than ${Upe}s! Closing Camera option`,"error"),setTimeout(()=>{we()},400)}function Oe(){Qt("Recording stopped","info"),Xe()}X0e({appid:N==null?void 0:N.app_id,channel:N==null?void 0:N.channel,token:N!=null&&N.token?N==null?void 0:N.token:null},E);const{localMicrophoneTrack:Fe}=Q0e(j,{encoderConfig:"high_quality_stereo"}),{localCameraTrack:Ue}=Z0e(V);J0e([Fe,Ue]);const Ve=k.useRef(null),Re=k.useRef(null);async function Be(){if(console.log("idleTimeLimitRef.current = ",Ve.current),clearTimeout(Ve.current),M(!0),le(!0),m(),!$&&E&&x)try{const We=await Xa.startVideoRecording(N==null?void 0:N.id);console.log("Called startVideoRecording Res = ",We.data),We.data.status==="success"&&(le(!1),ne(!0),u(),_e(1),Re.current=setTimeout(Oe,(s-5)*1e3)),We.data.status==="failed"&&(Qt("Unable to start recording!","error"),le(!1),m(),we())}catch(We){console.log("Error in startVideoRecording = ",We),Qt("Unable to start recording!","error"),le(!1),m(),we()}}async function Xe(){var We,st;console.log("handleStopRecordingAction called...",$),ee(!0),d();try{Qt("Processing a video","info");const pt=await Xa.stopVideoRecording(N==null?void 0:N.id);if(console.log("Called stopVideoRecording Res = ",pt.data),pt.data.status==="success"){const Qe=(st=(We=pt.data)==null?void 0:We.data)==null?void 0:st.video_url;Qt("Video saved successfully!","success"),ee(!1),ne(!1),d(),y({url:Qe}),he(),we()}pt.data.status==="failed"&&(Qt("Failed to record a video!","error"),ee(!1),ne(!1),m(),we())}catch(pt){console.log("Error in stopVideoRecording = ",pt),Qt("Failed to record a video!","error"),ee(!1),ne(!1),m(),we()}}function we(){Ve!=null&&Ve.current&&clearTimeout(Ve.current),Re!=null&&Re.current&&clearTimeout(Re.current),_e(10),m(),he(),O(null),P(!0),G(!1),M(!1),t()}return h.jsx(h.Fragment,{children:h.jsx(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom agora-video-modal",show:n,onHide:t,..._,children:h.jsx(wn.Body,{className:"no-scrollbar p-2 pb-3",children:D&&!N?h.jsx(et,{className:"shadow-sm rounded-4 bg-gray-md border-0 mt-2",children:h.jsxs(et.Body,{children:[h.jsx("div",{className:"my-2 text-center",children:h.jsx(Zi,{animation:"border",variant:"light"})}),h.jsx("div",{className:"p-2 text-center fw-sb font-16 text-light",children:"Initializing...Please wait!!"})]})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"room",children:x?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"user-list",children:h.jsx("div",{className:"user",children:h.jsx(s1e,{audioTrack:Fe,cameraOn:V,micOn:j,videoTrack:Ue,cover:"https://www.agora.io/en/wp-content/uploads/2022/10/3d-spatial-audio-icon.svg",children:h.jsx("samp",{className:"user-name",children:"You"})})})}),h.jsxs("div",{className:"control",children:[h.jsx("div",{className:"timer-container",children:h.jsx("span",{className:"btn btn-theme btn- btn-red rounded-5 d-flex align-items-center justify-content-center text-white px-2 fw-b",style:{minWidth:60},children:$?h.jsx(h.Fragment,{children:l<=60?l+"s":OQ(l,":")+"m"}):h.jsx(h.Fragment,{children:"0s"})})}),h.jsx("div",{className:"left-control",children:$?h.jsxs("button",{className:"btn btn-theme btn-start-recording btn-white btn- d-flex align-items-center rounded-5 active",onClick:Xe,children:[h.jsx("div",{className:"icon",children:re?h.jsx(Zi,{animation:"border",variant:"light",size:"sm"}):h.jsx("span",{})}),h.jsx("span",{className:"ms-1",children:"Stop"})]}):h.jsxs("button",{className:"btn btn-theme btn-start-recording btn-white btn- d-flex align-items-center rounded-5 ",onClick:Be,children:[h.jsx("div",{className:"icon",children:Y?h.jsx(Zi,{animation:"border",variant:"light",size:"sm"}):h.jsx("span",{})}),h.jsx("span",{className:"ms-1",children:"Start"})]})}),h.jsx("div",{className:"right-control",children:!$&&h.jsx("button",{className:`btn btn-theme btn-white btn- d-flex align-items-center justify-content-center rounded-5 ${$?"opacity-0 pe-none":""}`,style:{minWidth:60},onClick:we,children:h.jsx(tn,{tag:"delete7",className:"font-24"})})})]})]}):h.jsx(h.Fragment,{})})})})})})}function hrt({mediaType:n,mediaSource:t,className:i,contestId:s,handleClose:l,data:d,fileSizelimit:u,videoDurationLimit:p,audioDurationLimit:m,minCompressionLimit:y,deviceOS:_}){const E=ji(),[C,x]=k.useState(),[N,O]=k.useState(null),[D,P]=k.useState(""),[j,M]=k.useState(null),[V,G]=k.useState(""),[$,ne]=k.useState(0),[Y,le]=k.useState(!1),[re,ee]=k.useState(0),[de,H]=k.useState(!1),[ae,_e]=k.useState(!1);k.useState(!1);const[me,Ce]=k.useState(!1),[he,pe]=k.useState(null),[Oe,Fe]=k.useState(!1),[Ue,Ve]=k.useState(!1),{counter:Re,handleStart:Be,handlePause:Xe,handleReset:we,handleStop:We}=gee(0,!0),st=k.useRef(!1);k.useRef(null);const pt=k.useRef(null),Qe=k.useRef(null);k.useRef(null);const Je={title:""},St=gc({title:Ef().required("Required")}),Xt=n?n==="pdf"?".pdf":`${n}/*`:"image/*",Ht=n!==""?"user":"",gn=n?`${n}-gallery-file`:"media-gallery-file",It=n?`${n}-camera-file`:"media-camera-file";function xt(Te){Te&&(pe(Te),O(Te.url),le(!0))}const mt=()=>{Ce(!1)},dt=()=>{console.log("handleShowAgoraVideoModal () - MEDIA TYPE = "),Ce(!0)},it=()=>{Fe(!1)},Me=()=>{Fe(!0)};async function Ge(){console.log("onCameraBtnClick called..."),dt()}function bt(Te){if(console.log("Inside handleChange =",Te.target.files[0]),Te.target.files[0]){x(Te.target.files[0]),le(!0);const Pe=ax(Te.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",Pe),M(Pe),n){case"video":let Ze=URL.createObjectURL(Te.target.files[0]);console.log("Preview Video blobVideoURL =",Ze),O(Ze);break;default:console.log("No case matched...")}}}function wt(){if(C)switch(x(null),le(!1),G(""),M(null),we(),pt.current&&(pt.current.value=""),Qe.current&&(Qe.current.value=""),n){case"video":O(null);break;default:console.log("No case matched...")}he&&(O(null),pe(null),le(!1))}const Pt=new AbortController,un=Gr.CancelToken.source();k.useEffect(()=>()=>{console.log("Called cancellation from UploadResponseMediaFile..."),st.current&&(console.log("Called cancellation inside if(bool.current)...",st==null?void 0:st.current),un.cancel("Upload cancelled by user"),Pt.abort())},[]);function an(){st.current=!0,l(),un.cancel("Upload cancelled by user"),Pt.abort(),Pt.signal.aborted&&Qt("Uploading cancelled!","error")}async function ye(Te){return await ps.getSignedUploadUrl(Te)}async function Q(Te,Pe,Ze,nt){const $e=Pe.map((Dt,nn)=>{const Zt=new URL(Dt);console.log("parser = ",Zt);const qt=Zt.pathname;return{url:Dt,pathName:qt.replace("/","")}});console.log("urls = ",$e);let rt=null,yn=[];try{const Dt=100/nt;let nn=0,Zt=0,qt=0;for(_e(!0);qt<=C.size;){console.log("Value of start = ",Zt),console.log("Value of end = ",qt),Zt=nn*Ze,qt=Zt+Ze;const mn=await C.slice(Zt,qt).arrayBuffer(),Kn=V0e.from(mn),On={headers:{ExposeHeader:"ETag","Access-Control-Expose-Headers":"ETag"},cancelToken:un.token,signal:Pt.signal,onUploadProgress:function(Tn){console.log("progressEvent = ",Tn);const Ui=Math.round(100/nt*nn+Tn.loaded*100/Tn.total/(100/nt));console.log("percentCompleted = ",Ui),ee(Ui>100?100:Ui)}};rt=await Gr.put($e[nn].url,Kn,On),yn.push({PartNumber:nn+1,Part:$e[nn].pathName}),nn++}}catch(Dt){console.log("error in uploading = ",Dt),Qt("Failed to upload!");return}return console.log("parts_info = ",yn),rt={...rt,parts_info:yn},rt}const ie=async(Te,{resetForm:Pe})=>{var yn,Dt,nn,Zt,qt;if(_==="android"&&!he&&!C){Qt("Upload Valid File","error");return}if(_==="android"&&he&&!C){const Jt={contest_id:s,title:Te.title,media_type:n,media_url:he.url};console.log("deviceOS === android in contestResponseData = ",Jt),Xa.addContestResponseRecord(Jt).then(mn=>{console.log("addContestResponseRecord RES =",mn.data),mn.data.status==="success"&&(console.log("addContestResponseRecord SUCCESS RES =",mn.data),Qt("Contest Response Saved","success"),ee(0),H(!1),x(null),le(!1),l(),E(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}}))}).catch(mn=>{console.log(mn),Qt("Failed to save Contest Response","error"),H(!1)});return}if(D===""){console.log("Inside mediaUrl === '' "),Qt("Upload Valid File","error");return}console.log("File for uploading = ",C),H(!0);let Ze=C.name.substring(C.name.lastIndexOf(".")+1);console.log("fileExtension = ",Ze);const nt=25*1024*1024,$e=Math.ceil((C==null?void 0:C.size)/nt);let rt={fileextention:Ze,modulename:"detailing",parts:$e};console.log("data for getSignedUrl = ",rt);try{const Jt=await ye(rt);if(console.log("getSignedUrl response =",Jt),((yn=Jt==null?void 0:Jt.data)==null?void 0:yn.status)==="success"&&(Jt==null?void 0:Jt.status)===200){const mn=(nn=(Dt=Jt==null?void 0:Jt.data)==null?void 0:Dt.data)==null?void 0:nn.resourceUrl,Kn=(qt=(Zt=Jt==null?void 0:Jt.data)==null?void 0:Zt.data)==null?void 0:qt.uploadURL;console.log("--- uploadUrls = ",Kn);let On=null;if(n==="video"){const Tn=await Q(Jt,Kn,nt,$e);if(Tn.status===200){const Ui=new URL(mn);console.log("parser = ",Ui);const xr=Ui.pathname,bi={parts:Tn.parts_info,filename:xr.replace("/","")};console.log("completeUploadData = ",bi);try{On=await ps.completeChunkUpload(bi),Qt("Saving contest response...","success"),console.log("completeUploadRes = ",On)}catch(Da){console.log("Error while calliing wallmessage/completechunkupload = ",Da),Qt("Problem in uploading file! Please try after sometime","error"),_e(!1),ee(0),H(!1),x(null),le(!1),l();return}}else console.log("THERE IS AN ERROR IN uploadConfig...",result1)}if(console.log("uploadResult =",On),On.status===200){console.log("uploadProgress in uploadResult.status === 200 =",re);const Tn={contest_id:s,title:Te.title,media_type:n,media_url:mn};if(console.log("contestResponseData = ",Tn),console.log("bool after upload = ",st==null?void 0:st.current),st.current)return;_e(!1),ee(0),H(!1),x(null),le(!1),Xa.addContestResponseRecord(Tn).then(Ui=>{console.log("addContestResponseRecord RES =",Ui.data),Ui.data.status==="success"&&(console.log("addContestResponseRecord SUCCESS RES =",Ui.data),Qt("Contest Response Saved","success"),ee(0),H(!1),x(null),le(!1),l(),E(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}}))}).catch(Ui=>{console.log(Ui),Qt("Failed to save Contest Response","error"),H(!1)})}else{console.log("THERE IS AN ERROR IN uploadConfig...",result1),Qt("UploadResult Else: Problem in uploading file! Please try after sometime","error"),_e(!1),ee(0),H(!1),x(null),le(!1),l();return}}else{console.log("Error in signedUrlResponse =",Jt),Qt("Problem in uploading file! Please try after sometime","error"),_e(!1),ee(0),H(!1),x(null),le(!1),l();return}}catch(Jt){Qt("Problem in uploading file! Please try after sometime","error"),_e(!1),ee(0),H(!1),x(null),le(!1),l(),console.log("ERROR in uploading (get signed urls) = ",Jt)}};function Se(Te){console.log("getDuration called...",Te),ne(Math.round(Te))}function je(Te){}const tt=({played:Te,playedSeconds:Pe,loaded:Ze,loadedSeconds:nt})=>{var $e,rt;console.log("File Obj =",C),console.log("handleProgress called...",Ze),n==="video"&&$>(($e=d==null?void 0:d.limits)==null?void 0:$e.video)||(C==null?void 0:C.size)>((rt=d==null?void 0:d.limits)==null?void 0:rt.size)*1024*1024?(console.log("getDuration condition If part"),console.log("fileDuration = ",$," mediaType = ",n," Size =",C==null?void 0:C.size),P("")):(console.log("getDuration condition else part"),console.log("fileDuration = ",$," mediaType = ",n," Size =",C==null?void 0:C.size," compression Limit =",y),P(C.name),G(""))};return h.jsxs(h.Fragment,{children:[h.jsx(od,{initialValues:Je,validationSchema:St,onSubmit:ie,enableReinitialize:!0,children:Te=>{var Pe,Ze,nt,$e;return h.jsx(h.Fragment,{children:h.jsxs(kt,{className:"form_style",onSubmit:Te.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-13",children:"Response title"}),h.jsx(kt.Control,{type:"text",placeholder:"title",name:"title",...Te.getFieldProps("title"),autoComplete:"off"}),Te.touched.title&&Te.errors.title?h.jsx("p",{className:"error-state-text font-12 text-danger",children:Te.errors.title}):null]}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx("div",{className:"font-13",children:"Choose upload type"}),h.jsx("div",{className:"btn-wrap d-flex py-2",children:t.length>0&&h.jsxs(h.Fragment,{children:[n==="video"&&_==="android"?h.jsx("div",{className:"flex-grow-1",children:h.jsx(Lt,{onClick:()=>{console.log("On agora btn clicked..."),Ge()},className:"btn-theme btn-secondary w-100 font-14 fw-sb",style:{padding:"10px 12px"},children:"Camera"})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:pt,name:It,id:It,className:"uploadMediafile",capture:Ht,accept:Xt,onChange:bt,disabled:Y}),h.jsx("label",{htmlFor:It,className:"justify-content-center px-2 capture-btn",children:"Camera"})]})}),h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Qe,name:gn,id:gn,className:"uploadMediafile",accept:Xt,onChange:bt,disabled:Y}),h.jsx("label",{htmlFor:gn,className:"justify-content-center px-2 gallery-btn",children:"Gallery"})]})]})})]}),(re>0||ae)&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-3",children:[h.jsx("span",{className:"font-13 fw-sb pe-2",children:"Uploading: "}),h.jsx("progress",{value:re,max:"100"}),h.jsx("span",{className:"font-13 fw-sb ps-2",children:`${re}%`})]}),h.jsx("div",{className:"d-flex justify-content-between font-14",children:!C&&$<=0?"No file selected":n==="video"&&$>((Pe=d==null?void 0:d.limits)==null?void 0:Pe.video)||(C==null?void 0:C.size)>((Ze=d==null?void 0:d.limits)==null?void 0:Ze.size)*1024*1024?h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${C?"d-flex":"d-none"}`,style:{background:"var(--color-red-lighter)"},children:[h.jsxs("span",{className:" fw-sb font-13 flex-grow- me-1",children:[h.jsx("span",{className:"text-dange",children:"Upload limit exceeds"})," ",D2($)]}),h.jsx("span",{className:"fw-sb font-13",children:j?` and ${j}`:""})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${C?"d-flex":"d-none"}`,style:{background:"var(--color-green-lighter)"},children:[h.jsxs("span",{className:"font-13 fw-sb flex-grow- text-break",children:['"Uploaded file: "',D2($)]}),h.jsx("span",{className:"ms-1 fw-sb font-13",children:j?`and ${j}`:""})]})})}),C&&n==="video"&&$<((nt=d==null?void 0:d.limits)==null?void 0:nt.video)&&(C==null?void 0:C.size)<(($e=d==null?void 0:d.limits)==null?void 0:$e.size)*1024*1024?h.jsx("div",{}):h.jsx(h.Fragment,{}),h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Lt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${Y?"d-block":"d-none"} ${de?"pe-none":""}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:wt,children:h.jsx(tn,{tag:"delete7",className:"font-26"})}),h.jsx(iu,{aspectRatio:"16x9",className:"preview-container",children:h.jsx(h.Fragment,{children:n==="video"&&h.jsx(gw,{url:N,width:"100%",height:"100%",controls:!0,playing:!1,onDuration:rt=>Se(rt),onReady:je,onProgress:({played:rt,playedSeconds:yn,loaded:Dt,loadedSeconds:nn})=>tt({played:rt,playedSeconds:yn,loaded:Dt,loadedSeconds:nn})})})})]}),h.jsxs("div",{className:"btn-wrap pt-3 pb-4 d-flex justify-content-center position-fixed px-3 bg-white border-top",style:{bottom:0,right:0,left:0},children:[h.jsx(Lt,{type:"button",className:"btn-theme btn-gray btn-md flex-grow-1",onClick:Me,children:"Back"}),h.jsx(Lt,{type:"submit",disabled:!Te.isValid,className:"btn-theme btn-primary btn-md flex-grow-1",children:de?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(Te.isValid,"Submit")})]})]})})}}),h.jsx(urt,{show:me,handleClose:mt,contestId:s,videoDurationLimit:p,counter:Re,handlePause:Xe,handleStart:Be,handleReset:we,handleStop:We,handleSaveAgoraRecording:xt}),h.jsx(tx,{show:Oe,loading:Ue,handleClose:it,primaryActionData:null,content_type:"force-upload-submission-cancel-modal",handlePrimaryAction:an})]})}function frt(n){var u,p,m,y,_,E,C,x,N,O,D,P,j,M,V,G;k.useState(!1);const t=(p=(u=n.data)==null?void 0:u.limits)!=null&&p.size?(y=(m=n.data)==null?void 0:m.limits)==null?void 0:y.size:"NA",i=(E=(_=n.data)==null?void 0:_.limits)!=null&&E.video?(x=(C=n.data)==null?void 0:C.limits)==null?void 0:x.video:"NA",s=(O=(N=n.data)==null?void 0:N.limits)!=null&&O.audio?(P=(D=n.data)==null?void 0:D.limits)==null?void 0:P.audio:"NA",l=(M=(j=n.data)==null?void 0:j.limits)!=null&&M.min_compression_size?(G=(V=n.data)==null?void 0:V.limits)==null?void 0:G.min_compression_size:0,d=(n==null?void 0:n.deviceOS)||"android";return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom -modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:`Upload ${n.uploadMediaType}`})}),h.jsxs(wn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:[h.jsx(et,{className:"mb-1 mb-sm-2",children:h.jsxs(et.Body,{className:"p-1 p-sm-2 font-13 text-gray4",style:{background:"var(--color-yellow-lighter)"},children:[h.jsx("span",{className:"fw-b font-13",children:"Note: "}),"Upload file size should not exceeds"," ",h.jsx("span",{className:"fw-b text-danger",children:t!=="NA"&&`${t} mb`})," ","and video/audio duration not more than"," ",h.jsx("span",{className:"fw-b text-danger",children:i!=="NA"&&`${i}s`}),"."]})}),n.uploadMediaType.toLowerCase()==="video"?h.jsx(hrt,{mediaType:n.uploadMediaType.toLowerCase(),mediaSource:n==null?void 0:n.resSources,contestId:n.contestId,handleClose:n.handleClose,data:n.data,fileSizelimit:t,videoDurationLimit:i,audioDurationLimit:s,minCompressionLimit:l,deviceOS:d}):h.jsx(drt,{mediaType:n.uploadMediaType.toLowerCase(),mediaSource:n==null?void 0:n.resSources,contestId:n.contestId,handleClose:n.handleClose,data:n.data,fileSizelimit:t,videoDurationLimit:i,audioDurationLimit:s,minCompressionLimit:l})]})]})})}function prt(){var O,D,P,j,M,V,G,$,ne,Y,le,re;const[n,t]=k.useState({isVisible:!1}),[i,s]=k.useState(""),[l,d]=k.useState(""),{state:u}=tl(),p=(O=u==null?void 0:u.item)==null?void 0:O.response_types,m=(D=u==null?void 0:u.item)==null?void 0:D.response_sources,y=(P=u==null?void 0:u.item)==null?void 0:P.title,_=(j=u==null?void 0:u.item)==null?void 0:j.id,E=(V=(M=u==null?void 0:u.item)==null?void 0:M.limits)==null?void 0:V.size;($=(G=u==null?void 0:u.item)==null?void 0:G.limits)==null||$.video,(Y=(ne=u==null?void 0:u.item)==null?void 0:ne.limits)==null||Y.audio,(re=(le=u==null?void 0:u.item)==null?void 0:le.limits)==null||re.min_compression_size;const C=async()=>{const ee=await Z2.getInfo();d(ee.platform)};k.useEffect(()=>{C()},[]);const x=()=>{t({isVisible:!1})},N=ee=>{s(ee),t({isVisible:!0})};return h.jsx(qi,{className:"upload-response-page",children:h.jsxs(Yn,{className:"mb-4",children:[h.jsx("div",{className:"d-flex align-items-center justify-content-between pt-2 mb-3",children:h.jsxs("p",{className:"font-14",children:["Select source for uploading your response for contest."," ",h.jsxs("span",{className:"fw-sb",children:['"',y,'"']})]})}),(p==null?void 0:p.length)>0&&h.jsx(fn,{className:"row-cols-2 mb-3 g-3",children:p==null?void 0:p.map((ee,de)=>h.jsx(Gt,{children:h.jsx(et,{className:"card-theme",onClick:()=>N(ee),children:h.jsxs(et.Body,{className:"p-2 p-sm-3 justify-content-center d-flex flex-column",children:[h.jsxs("div",{className:"icon-wra",children:[ee==="video"&&h.jsx(tn,{tag:"play1",className:"mb-2 font-36 text-theme-primary"}),ee==="audio"&&h.jsx(tn,{tag:"consult1",className:"mb-2 font-36 text-theme-primary"}),ee==="pdf"&&h.jsx(tn,{tag:"pdf1",className:"mb-2 font-36 text-theme-primary"}),ee==="image"&&h.jsx(tn,{tag:"image2",className:"mb-2 font-36 text-theme-primary"})]}),h.jsxs("div",{className:"font-14 fw-sb pt-sm-2",children:[`Upload ${ee}`,h.jsx("small",{className:"d-block fw-sb text-danger font-11",children:E&&h.jsxs(h.Fragment,{children:["max ",E,"mb"]})})]})]})})},`${de}-type`))}),h.jsx(frt,{show:n,handleClose:x,resSources:m,uploadMediaType:i,contestId:_,className:"",data:u==null?void 0:u.item,deviceOS:l})]})})}function mrt(n){var he,pe,Oe,Fe;const t=ji(),{state:i}=tl(),s=(he=i.data)==null?void 0:he.contest_id,l=(pe=i.data)==null?void 0:pe.response_id,d=(Oe=i.data)==null?void 0:Oe.contest_title,u=(Fe=i.data)==null?void 0:Fe.response_user,[p,m]=k.useState([]),[y,_]=k.useState(!0),[E,C]=k.useState(!0),[x,N]=k.useState({}),[O,D]=k.useState({}),[P,j]=k.useState(null),[M,V]=k.useState(!0),[G,$]=k.useState(!1),[ne,Y]=k.useState(!1),le=k.useRef(null);k.useEffect(()=>{console.log("useEffect parameters =",p),N(p.reduce((Ue,Ve)=>({...Ue,[Ve.id]:0}),{}))},[p]),k.useEffect(()=>{s&&re(s)},[]);async function re(Ue){Xa.getDetailingContestParameters(Ue).then(Ve=>{Ve.data.status==="success"&&(m(Ve.data.data.items),_(!1))}).catch(Ve=>{_(!1),m([]),console.log("Error in getDetailingContestParameters = ",Ve)})}const ee=()=>{Y(!1)},de=()=>{Y(!0)},H={feedback:"",evaluations:"",response_id:l,contest_id:s},ae=gc({});async function _e(Ue){console.log("*****************************"),console.log("******** Inside seperate async func evaluateDetailingContestResponse *************"),console.log("evaluateDetailingContestResponse newValues = ",Ue),console.log("*****************************"),$(!0),Xa.evaluateDetailingContestResponse(Ue).then(Ve=>{var Re,Be;if(console.log("evaluateDetailingContestResponse RES = ",Ve.data),Ve.data.status==="success")console.log("Inside Evaluate case : ",Ve.data),Qt("Successfully evaluated!","success"),$(!1),t(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}});else if(Ve.data.status==="failed")if(console.log("ERROR:",Ve.data.error),Qt("Evaluation failed!","error"),$(!1),Ue.hasOwnProperty("force"))console.log("newValues contains force property...",Ue);else{const Xe={btnOptions:(Be=(Re=Ve.data)==null?void 0:Re.data)==null?void 0:Be.options,message:Ve.data.message};j(Xe),de()}}).catch(Ve=>{console.log(Ve),$(!1),Qt("Evaluation failed!","error")})}const me=async(Ue,{resetForm:Ve})=>{if(console.log("Form Values :",Ue),console.log("Evaluation = ",x),le.current.value===""){Ue.feedback===""&&C(!1),Qt("Feedback Required","error");return}Ue.feedback!==""&&C(!0);const Re={...Ue,response_id:l,contest_id:s,evaluations:x};console.log("New values in Compose =",Re),D(Re);for(const[Xe,we]of Object.entries(x))if(we===0){V(!1),Qt("Required Parameters to be selected","error");return}$(!0),console.log("MOved ahead");const Be=await _e(Re);console.log("evalResponse in onSubmit = ",Be)},Ce=(Ue,Ve)=>{console.log(Ue,Ve),N(Re=>({...Re,[Ve]:Ue}))};return h.jsxs(h.Fragment,{children:[h.jsx(qi,{className:"evaluate-page",children:h.jsxs(Yn,{className:"mb-4",children:[h.jsxs("div",{className:"font-14 pt-2 pb-0",children:["Submit your evaluation to contest"," ",h.jsx("span",{className:"fw-sb",children:`"${d}"`})]}),h.jsxs("div",{className:"py-2 font-14",children:[h.jsx("span",{className:"fw-sb me-1",children:"Evaluating:"}),h.jsx("span",{className:"text-theme-primary fw-sb",children:u})]}),h.jsx("div",{className:"py-1",style:{border:"0px solid #999"},children:h.jsx(od,{initialValues:H,validationSchema:ae,onSubmit:me,children:Ue=>h.jsxs(kt,{className:"form_style",onSubmit:Ue.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-0",children:[h.jsx(kt.Label,{className:"font-14",children:"Feedback"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto"},placeholder:"Feedback",name:"feedback",...Ue.getFieldProps("feedback"),autoComplete:"off",ref:le}),E?null:h.jsx(h.Fragment,{children:h.jsx("p",{className:"error-state-text font-13 text-danger",children:"Required"})})]}),h.jsx("hr",{}),h.jsxs("div",{className:"eval-options-wrap d-grid gap-3",children:[y&&h.jsx(ci,{type:""}),!y&&p.length>0&&h.jsx(h.Fragment,{children:p.map(Ve=>h.jsxs("div",{className:"d-flex flex-column",children:[h.jsx("div",{className:"font-14 mb-1",children:Ve.title}),h.jsx(nrt,{initialValue:0,onUserRateChange:Ce,allowHover:!1,transition:!0,showTooltip:!1,tooltipSize:"small",tooltipDefaultText:"",tooltipArray:Ve.regards,iconsCount:Ve.scale,parameterId:Ve.id,size:50,emptyIcon:h.jsx(dBe,{className:"font-28"}),fillIcon:h.jsx(cBe,{className:"font-28"})}),!M&&h.jsx("div",{className:"font-12 text-danger",children:x.hasOwnProperty(Ve.id)&&x[Ve.id]===0&&"Required"})]},Ve.id))})]}),h.jsx(fn,{className:"row-cols-1 justify-content-center pt-5 pb-3",children:h.jsx(Gt,{className:"col-12",children:h.jsx(Lt,{type:"submit",disabled:G,className:"btn-theme btn-primary btn-md w-100",children:G?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(Ue.isValid,"Submit")})})}),h.jsx("div",{className:"btn-wrap pt-3 d-flex justify-content-center"})]})})})]})}),h.jsx(tx,{show:ne,loading:G,handleClose:ee,primaryActionData:O,content_type:"force-evaluation-submission-modal",handlePrimaryAction:_e,data:P})]})}function $C({item:n,className:t,type:i,title:s,subTitle:l,iconImg:d,handleItemSelect:u}){const p=t||"",m=d||((n==null?void 0:n.type)==="group"?"/img/groups-icon.png":"/img/user-profile.jpg"),y=s||"Guest User",_=l||"";return h.jsx(et,{onClick:()=>u(n),className:`card-theme border-0 rounded-1 custom-select-list-btn-card card-md ${p}`,children:h.jsxs(et.Body,{className:"d-flex align-items-center info-container p-2",children:[h.jsx("div",{className:"d-flex flex-shrink-0 img-wra media-icon-wrapper",children:h.jsx(Ts,{src:m,alt:`${y} image`,className:"img-fluid"})}),h.jsxs("div",{className:"flex-grow-1 ps-2 ps-sm-3",children:[h.jsx("div",{className:"welcome-user fw-n",style:{maxWidth:"90%"},children:`${y} `}),h.jsx("div",{className:"d-block w-100 font-13 text-gray6",children:vx(_)})]}),h.jsx(tn,{tag:"circle1",className:"font-20 position-absolute radio-status-icon unchecked-icon"}),h.jsx(tn,{tag:"check2",className:"font-20 position-absolute radio-status-icon checked-icon"})]})})}function vee({className:n,items:t,type:i,handleRemoveItems:s,...l}){const d=n||"",u=t&&(t==null?void 0:t.length)>0?t==null?void 0:t.length:0;function p(m){const y=m.target.getAttribute("data-id"),_=t.filter((E,C)=>E.id===y)[0];s(_)}return h.jsxs("div",{className:`d-flex align-items-center selected-items-list position-relative border-bottom ${d}`,children:[h.jsx("div",{className:"d-flex justify-content-center align-items-center total flex-shrink-0",style:{width:30,height:30,background:"var(--color-gray-light5)",borderRadius:6},children:u}),h.jsx("div",{className:"flex-grow-1 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto border-botto bg-gray-lighte position-relative ps-2",style:{minHeight:40},children:t&&t.length>0?h.jsx(h.Fragment,{children:t.map((m,y)=>{const _=m!=null&&m.avatar&&(m==null?void 0:m.type)==="user"?m==null?void 0:m.avatar:"/img/groups-icon.png";return h.jsxs("div",{className:`d-flex align-items-center p-1 rounded-3 text-wrap position-relative border-0 me-2 ${i==="single"?"pe-none":""}`,children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0 pe-none",style:{width:26,height:26},children:h.jsx("img",{src:_,className:"img-fluid mx-auto",alt:Jv(m==null?void 0:m.firstname,m==null?void 0:m.lastname),style:{objectFit:"cover"}})}),h.jsxs("div",{className:"ms-1 font-13 text-truncate flex-grow-1",children:[Jv(m==null?void 0:m.firstname,m==null?void 0:m.lastname),i!=="single"&&h.jsx(Lt,{type:"button",className:"btn btn-theme btn-white bg-transparent btn-icon btn-sm","data-item":`${JSON.stringify(m)}`,"data-id":m.id,onClick:p,children:h.jsx(tn,{tag:"delete8",className:"text-gray6 font-18 mx-1 pe-none"})})]})]},m.id)})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"font-14 fw-sb text-gray6 ps-2",children:"Please select user"})})})]})}function grt({item:n,className:t,type:i,title:s,subTitle:l,iconImg:d,handleImageSelect:u}){const p=t||"";return h.jsx(et,{onClick:()=>{u(n)},className:`card-theme border-0 rounded-2 custom-select-image-btn-card card-md ${p} h-100 position-relative`,children:h.jsxs(et.Body,{className:"p-0 rounded-1 h-100 d-flex align-items-center",children:[h.jsx("div",{className:"card-overlay bg-gray-normal-overlay",children:h.jsx(tn,{tag:"check2",className:"font-24"})}),h.jsx(Ts,{src:d,alt:`${n==null?void 0:n.id} image`,className:"img-fluid"})]})})}function Sa(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function ew(n){"@babel/helpers - typeof";return ew=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ew(n)}function vrt(n,t){if(ew(n)!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,t||"default");if(ew(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function mbe(n){var t=vrt(n,"string");return ew(t)=="symbol"?t:t+""}function Fpe(n,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,mbe(s.key),s)}}function ba(n,t,i){return t&&Fpe(n.prototype,t),i&&Fpe(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function yrt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function vc(n,t){if(t&&(ew(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yrt(n)}function Cr(n){return Cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cr(n)}function yc(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&V7(n,t)}function Et(n,t,i){return(t=mbe(t))in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function Bpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Vpe(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Bpe(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Bpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function _rt(n,t,i){return t=Cr(t),vc(n,gbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function gbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gbe=function(){return!!n})()}var vbe=function(n){function t(){var i;Sa(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=_rt(this,t,[].concat(l)),Et(i,"state",{scrollToColumn:0,scrollToRow:0,instanceProps:{prevScrollToColumn:0,prevScrollToRow:0}}),Et(i,"_columnStartIndex",0),Et(i,"_columnStopIndex",0),Et(i,"_rowStartIndex",0),Et(i,"_rowStopIndex",0),Et(i,"_onKeyDown",function(u){var p=i.props,m=p.columnCount,y=p.disabled,_=p.mode,E=p.rowCount;if(!y){var C=i._getScrollState(),x=C.scrollToColumn,N=C.scrollToRow,O=i._getScrollState(),D=O.scrollToColumn,P=O.scrollToRow;switch(u.key){case"ArrowDown":P=Math.min(_==="cells"?P+1:i._rowStopIndex+1,E-1);break;case"ArrowLeft":D=Math.max(_==="cells"?D-1:i._columnStartIndex-1,0);break;case"ArrowRight":D=Math.min(_==="cells"?D+1:i._columnStopIndex+1,m-1);break;case"ArrowUp":P=Math.max(_==="cells"?P-1:i._rowStartIndex-1,0);break}(D!==x||P!==N)&&(u.preventDefault(),i._updateScrollState({scrollToColumn:D,scrollToRow:P}))}}),Et(i,"_onSectionRendered",function(u){var p=u.columnStartIndex,m=u.columnStopIndex,y=u.rowStartIndex,_=u.rowStopIndex;i._columnStartIndex=p,i._columnStopIndex=m,i._rowStartIndex=y,i._rowStopIndex=_}),i}return yc(t,n),ba(t,[{key:"setScrollIndexes",value:function(s){var l=s.scrollToColumn,d=s.scrollToRow;this.setState({scrollToRow:d,scrollToColumn:l})}},{key:"render",value:function(){var s=this.props,l=s.className,d=s.children,u=this._getScrollState(),p=u.scrollToColumn,m=u.scrollToRow;return k.createElement("div",{className:l,onKeyDown:this._onKeyDown},d({onSectionRendered:this._onSectionRendered,scrollToColumn:p,scrollToRow:m}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(s){var l=s.scrollToColumn,d=s.scrollToRow,u=this.props,p=u.isControlled,m=u.onScrollToChange;typeof m=="function"&&m({scrollToColumn:l,scrollToRow:d}),p||this.setState({scrollToColumn:l,scrollToRow:d})}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.isControlled?{}:s.scrollToColumn!==l.instanceProps.prevScrollToColumn||s.scrollToRow!==l.instanceProps.prevScrollToRow?Vpe(Vpe({},l),{},{scrollToColumn:s.scrollToColumn,scrollToRow:s.scrollToRow,instanceProps:{prevScrollToColumn:s.scrollToColumn,prevScrollToRow:s.scrollToRow}}):{}}}])}(k.PureComponent);Et(vbe,"defaultProps",{disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0});gP(vbe);function ybe(n,t){var i;typeof t<"u"?i=t:typeof window<"u"?i=window:typeof self<"u"?i=self:i=Xo;var s=typeof i.document<"u"&&i.document.attachEvent;if(!s){var l=function(){var ne=i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||function(Y){return i.setTimeout(Y,20)};return function(Y){return ne(Y)}}(),d=function(){var ne=i.cancelAnimationFrame||i.mozCancelAnimationFrame||i.webkitCancelAnimationFrame||i.clearTimeout;return function(Y){return ne(Y)}}(),u=function(Y){var le=Y.__resizeTriggers__,re=le.firstElementChild,ee=le.lastElementChild,de=re.firstElementChild;ee.scrollLeft=ee.scrollWidth,ee.scrollTop=ee.scrollHeight,de.style.width=re.offsetWidth+1+"px",de.style.height=re.offsetHeight+1+"px",re.scrollLeft=re.scrollWidth,re.scrollTop=re.scrollHeight},p=function(Y){return Y.offsetWidth!=Y.__resizeLast__.width||Y.offsetHeight!=Y.__resizeLast__.height},m=function(Y){if(!(Y.target.className&&typeof Y.target.className.indexOf=="function"&&Y.target.className.indexOf("contract-trigger")<0&&Y.target.className.indexOf("expand-trigger")<0)){var le=this;u(this),this.__resizeRAF__&&d(this.__resizeRAF__),this.__resizeRAF__=l(function(){p(le)&&(le.__resizeLast__.width=le.offsetWidth,le.__resizeLast__.height=le.offsetHeight,le.__resizeListeners__.forEach(function(re){re.call(le,Y)}))})}},y=!1,_="",E="animationstart",C="Webkit Moz O ms".split(" "),x="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),N="";{var O=i.document.createElement("fakeelement");if(O.style.animationName!==void 0&&(y=!0),y===!1){for(var D=0;D<C.length;D++)if(O.style[C[D]+"AnimationName"]!==void 0){N=C[D],_="-"+N.toLowerCase()+"-",E=x[D],y=!0;break}}}var P="resizeanim",j="@"+_+"keyframes "+P+" { from { opacity: 0; } to { opacity: 0; } } ",M=_+"animation: 1ms "+P+"; "}var V=function(Y){if(!Y.getElementById("detectElementResize")){var le=(j||"")+".resize-triggers { "+(M||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',re=Y.head||Y.getElementsByTagName("head")[0],ee=Y.createElement("style");ee.id="detectElementResize",ee.type="text/css",n!=null&&ee.setAttribute("nonce",n),ee.styleSheet?ee.styleSheet.cssText=le:ee.appendChild(Y.createTextNode(le)),re.appendChild(ee)}},G=function(Y,le){if(s)Y.attachEvent("onresize",le);else{if(!Y.__resizeTriggers__){var re=Y.ownerDocument,ee=i.getComputedStyle(Y);ee&&ee.position=="static"&&(Y.style.position="relative"),V(re),Y.__resizeLast__={},Y.__resizeListeners__=[],(Y.__resizeTriggers__=re.createElement("div")).className="resize-triggers";var de=re.createElement("div");de.className="expand-trigger",de.appendChild(re.createElement("div"));var H=re.createElement("div");H.className="contract-trigger",Y.__resizeTriggers__.appendChild(de),Y.__resizeTriggers__.appendChild(H),Y.appendChild(Y.__resizeTriggers__),u(Y),Y.addEventListener("scroll",m,!0),E&&(Y.__resizeTriggers__.__animationListener__=function(_e){_e.animationName==P&&u(Y)},Y.__resizeTriggers__.addEventListener(E,Y.__resizeTriggers__.__animationListener__))}Y.__resizeListeners__.push(le)}},$=function(Y,le){if(s)Y.detachEvent("onresize",le);else if(Y.__resizeListeners__.splice(Y.__resizeListeners__.indexOf(le),1),!Y.__resizeListeners__.length){Y.removeEventListener("scroll",m,!0),Y.__resizeTriggers__.__animationListener__&&(Y.__resizeTriggers__.removeEventListener(E,Y.__resizeTriggers__.__animationListener__),Y.__resizeTriggers__.__animationListener__=null);try{Y.__resizeTriggers__=!Y.removeChild(Y.__resizeTriggers__)}catch{}}};return{addResizeListener:G,removeResizeListener:$}}function zpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Hpe(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?zpe(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):zpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function Ert(n,t,i){return t=Cr(t),vc(n,_be()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function _be(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_be=function(){return!!n})()}var UF=function(n){function t(){var i;Sa(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=Ert(this,t,[].concat(l)),Et(i,"state",{height:i.props.defaultHeight||0,width:i.props.defaultWidth||0}),Et(i,"_parentNode",void 0),Et(i,"_autoSizer",void 0),Et(i,"_window",void 0),Et(i,"_detectElementResize",void 0),Et(i,"_onResize",function(){var u=i.props,p=u.disableHeight,m=u.disableWidth,y=u.onResize;if(i._parentNode){var _=i._parentNode.offsetHeight||0,E=i._parentNode.offsetWidth||0,C=i._window||window,x=C.getComputedStyle(i._parentNode)||{},N=parseInt(x.paddingLeft,10)||0,O=parseInt(x.paddingRight,10)||0,D=parseInt(x.paddingTop,10)||0,P=parseInt(x.paddingBottom,10)||0,j=_-D-P,M=E-N-O;(!p&&i.state.height!==j||!m&&i.state.width!==M)&&(i.setState({height:_-D-P,width:E-N-O}),y({height:_,width:E}))}}),Et(i,"_setRef",function(u){i._autoSizer=u}),i}return yc(t,n),ba(t,[{key:"componentDidMount",value:function(){var s=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._window=this._autoSizer.parentNode.ownerDocument.defaultView,this._detectElementResize=ybe(s,this._window),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var s=this.props,l=s.children,d=s.className,u=s.disableHeight,p=s.disableWidth,m=s.style,y=this.state,_=y.height,E=y.width,C={overflow:"visible"},x={};return u||(C.height=0,x.height=_),p||(C.width=0,x.width=E),k.createElement("div",{className:d,ref:this._setRef,style:Hpe(Hpe({},C),m)},l(x))}}])}(k.Component);Et(UF,"defaultProps",{onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}});function wrt(n,t,i){return t=Cr(t),vc(n,Ebe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Ebe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ebe=function(){return!!n})()}var Srt=function(n){function t(){var i;Sa(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=wrt(this,t,[].concat(l)),Et(i,"_child",k.createRef()),Et(i,"_measure",function(){var u=i.props,p=u.cache,m=u.columnIndex,y=m===void 0?0:m,_=u.parent,E=u.rowIndex,C=E===void 0?i.props.index||0:E,x=i._getCellMeasurements(),N=x.height,O=x.width;(N!==p.getHeight(C,y)||O!==p.getWidth(C,y))&&(p.set(C,y,O,N),_&&typeof _.recomputeGridSize=="function"&&_.recomputeGridSize({columnIndex:y,rowIndex:C}))}),Et(i,"_registerChild",function(u){u&&!(u instanceof Element)&&console.warn("CellMeasurer registerChild expects to be passed Element or null"),i._child.current=u,u&&i._maybeMeasureCell()}),i}return yc(t,n),ba(t,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var s=this,l=this.props.children,d=typeof l=="function"?l({measure:this._measure,registerChild:this._registerChild}):l;return d===null?d:k.cloneElement(d,{ref:function(p){typeof d.ref=="function"?d.ref(p):d.ref&&(d.ref.current=p),s._child.current=p}})}},{key:"_getCellMeasurements",value:function(){var s=this.props.cache,l=this._child.current;if(l&&l.ownerDocument&&l.ownerDocument.defaultView&&l instanceof l.ownerDocument.defaultView.HTMLElement){var d=l.style.width,u=l.style.height;s.hasFixedWidth()||(l.style.width="auto"),s.hasFixedHeight()||(l.style.height="auto");var p=Math.ceil(l.offsetHeight),m=Math.ceil(l.offsetWidth);return d&&(l.style.width=d),u&&(l.style.height=u),{height:p,width:m}}else return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var s=this.props,l=s.cache,d=s.columnIndex,u=d===void 0?0:d,p=s.parent,m=s.rowIndex,y=m===void 0?this.props.index||0:m;if(!l.has(y,u)){var _=this._getCellMeasurements(),E=_.height,C=_.width;l.set(y,u,C,E),p&&typeof p.invalidateCellSizeAfterRender=="function"&&p.invalidateCellSizeAfterRender({columnIndex:u,rowIndex:y})}}}])}(k.PureComponent);Et(Srt,"__internalCellMeasurerFlag",!1);function brt(n){if(n==null)throw new TypeError("Cannot destructure "+n)}function wbe(n){var t,i,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n))for(t=0;t<n.length;t++)n[t]&&(i=wbe(n[t]))&&(s&&(s+=" "),s+=i);else for(t in n)n[t]&&(s&&(s+=" "),s+=t);return s}function pf(){for(var n,t,i=0,s="";i<arguments.length;)(n=arguments[i++])&&(t=wbe(n))&&(s&&(s+=" "),s+=t);return s}function cx(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t={};return function(i){var s=i.callback,l=i.indices,d=Object.keys(l),u=!n||d.every(function(m){var y=l[m];return Array.isArray(y)?y.length>0:y>=0}),p=d.length!==Object.keys(t).length||d.some(function(m){var y=t[m],_=l[m];return Array.isArray(_)?y.join(",")!==_.join(","):y!==_});t=l,u&&p&&s(l)}}function Gpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Wpe(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Gpe(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Gpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function Crt(n,t,i){return t=Cr(t),vc(n,Sbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Sbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Sbe=function(){return!!n})()}var Trt=150,aC={OBSERVED:"observed",REQUESTED:"requested"},FF=function(n){function t(){var i;Sa(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=Crt(this,t,[].concat(l)),Et(i,"state",{isScrolling:!1,scrollLeft:0,scrollTop:0}),Et(i,"_calculateSizeAndPositionDataOnNextUpdate",!1),Et(i,"_onSectionRenderedMemoizer",cx()),Et(i,"_onScrollMemoizer",cx(!1)),Et(i,"_invokeOnSectionRenderedHelper",function(){var u=i.props,p=u.cellLayoutManager,m=u.onSectionRendered;i._onSectionRenderedMemoizer({callback:m,indices:{indices:p.getLastRenderedIndices()}})}),Et(i,"_setScrollingContainerRef",function(u){i._scrollingContainer=u}),Et(i,"_updateScrollPositionForScrollToCell",function(){var u=i.props,p=u.cellLayoutManager,m=u.height,y=u.scrollToAlignment,_=u.scrollToCell,E=u.width,C=i.state,x=C.scrollLeft,N=C.scrollTop;if(_>=0){var O=p.getScrollPositionForCell({align:y,cellIndex:_,height:m,scrollLeft:x,scrollTop:N,width:E});(O.scrollLeft!==x||O.scrollTop!==N)&&i._setScrollPosition(O)}}),Et(i,"_onScroll",function(u){if(u.target===i._scrollingContainer){i._enablePointerEventsAfterDelay();var p=i.props,m=p.cellLayoutManager,y=p.height,_=p.isScrollingChange,E=p.width,C=i._scrollbarSize,x=m.getTotalSize(),N=x.height,O=x.width,D=Math.max(0,Math.min(O-E+C,u.target.scrollLeft)),P=Math.max(0,Math.min(N-y+C,u.target.scrollTop));if(i.state.scrollLeft!==D||i.state.scrollTop!==P){var j=u.cancelable?aC.OBSERVED:aC.REQUESTED;i.state.isScrolling||_(!0),i.setState({isScrolling:!0,scrollLeft:D,scrollPositionChangeReason:j,scrollTop:P})}i._invokeOnScrollMemoizer({scrollLeft:D,scrollTop:P,totalWidth:O,totalHeight:N})}}),i._scrollbarSize=mN(),i._scrollbarSize===void 0?(i._scrollbarSizeMeasured=!1,i._scrollbarSize=0):i._scrollbarSizeMeasured=!0,i}return yc(t,n),ba(t,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var s=this.props,l=s.cellLayoutManager,d=s.scrollLeft,u=s.scrollToCell,p=s.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=mN(),this._scrollbarSizeMeasured=!0,this.setState({})),u>=0?this._updateScrollPositionForScrollToCell():(d>=0||p>=0)&&this._setScrollPosition({scrollLeft:d,scrollTop:p}),this._invokeOnSectionRenderedHelper();var m=l.getTotalSize(),y=m.height,_=m.width;this._invokeOnScrollMemoizer({scrollLeft:d||0,scrollTop:p||0,totalHeight:y,totalWidth:_})}},{key:"componentDidUpdate",value:function(s,l){var d=this.props,u=d.height,p=d.scrollToAlignment,m=d.scrollToCell,y=d.width,_=this.state,E=_.scrollLeft,C=_.scrollPositionChangeReason,x=_.scrollTop;C===aC.REQUESTED&&(E>=0&&E!==l.scrollLeft&&E!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=E),x>=0&&x!==l.scrollTop&&x!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=x)),(u!==s.height||p!==s.scrollToAlignment||m!==s.scrollToCell||y!==s.width)&&this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var s=this.props,l=s.autoHeight,d=s.cellCount,u=s.cellLayoutManager,p=s.className,m=s.height,y=s.horizontalOverscanSize,_=s.id,E=s.noContentRenderer,C=s.style,x=s.verticalOverscanSize,N=s.width,O=this.state,D=O.isScrolling,P=O.scrollLeft,j=O.scrollTop;(this._lastRenderedCellCount!==d||this._lastRenderedCellLayoutManager!==u||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=d,this._lastRenderedCellLayoutManager=u,this._calculateSizeAndPositionDataOnNextUpdate=!1,u.calculateSizeAndPositionData());var M=u.getTotalSize(),V=M.height,G=M.width,$=Math.max(0,P-y),ne=Math.max(0,j-x),Y=Math.min(G,P+N+y),le=Math.min(V,j+m+x),re=m>0&&N>0?u.cellRenderers({height:le-ne,isScrolling:D,width:Y-$,x:$,y:ne}):[],ee={boxSizing:"border-box",direction:"ltr",height:l?"auto":m,position:"relative",WebkitOverflowScrolling:"touch",width:N,willChange:"transform"},de=V>m?this._scrollbarSize:0,H=G>N?this._scrollbarSize:0;return ee.overflowX=G+de<=N?"hidden":"auto",ee.overflowY=V+H<=m?"hidden":"auto",k.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:pf("ReactVirtualized__Collection",p),id:_,onScroll:this._onScroll,role:"grid",style:Wpe(Wpe({},ee),C),tabIndex:0},d>0&&k.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:V,maxHeight:V,maxWidth:G,overflow:"hidden",pointerEvents:D?"none":"",width:G}},re),d===0&&E())}},{key:"_enablePointerEventsAfterDelay",value:function(){var s=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout(function(){var l=s.props.isScrollingChange;l(!1),s._disablePointerEventsTimeoutId=null,s.setState({isScrolling:!1})},Trt)}},{key:"_invokeOnScrollMemoizer",value:function(s){var l=this,d=s.scrollLeft,u=s.scrollTop,p=s.totalHeight,m=s.totalWidth;this._onScrollMemoizer({callback:function(_){var E=_.scrollLeft,C=_.scrollTop,x=l.props,N=x.height,O=x.onScroll,D=x.width;O({clientHeight:N,clientWidth:D,scrollHeight:p,scrollLeft:E,scrollTop:C,scrollWidth:m})},indices:{scrollLeft:d,scrollTop:u}})}},{key:"_setScrollPosition",value:function(s){var l=s.scrollLeft,d=s.scrollTop,u={scrollPositionChangeReason:aC.REQUESTED};l>=0&&(u.scrollLeft=l),d>=0&&(u.scrollTop=d),(l>=0&&l!==this.state.scrollLeft||d>=0&&d!==this.state.scrollTop)&&this.setState(u)}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.cellCount===0&&(l.scrollLeft!==0||l.scrollTop!==0)?{scrollLeft:0,scrollTop:0,scrollPositionChangeReason:aC.REQUESTED}:s.scrollLeft!==l.scrollLeft||s.scrollTop!==l.scrollTop?{scrollLeft:s.scrollLeft!=null?s.scrollLeft:l.scrollLeft,scrollTop:s.scrollTop!=null?s.scrollTop:l.scrollTop,scrollPositionChangeReason:aC.REQUESTED}:null}}])}(k.PureComponent);Et(FF,"defaultProps",{"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0});FF.propTypes={};gP(FF);var Rrt=function(){function n(t){var i=t.height,s=t.width,l=t.x,d=t.y;Sa(this,n),this.height=i,this.width=s,this.x=l,this.y=d,this._indexMap={},this._indices=[]}return ba(n,[{key:"addCellIndex",value:function(i){var s=i.index;this._indexMap[s]||(this._indexMap[s]=!0,this._indices.push(s))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return"".concat(this.x,",").concat(this.y," ").concat(this.width,"x").concat(this.height)}}])}(),xrt=100,Art=function(){function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xrt;Sa(this,n),this._sectionSize=t,this._cellMetadata=[],this._sections={}}return ba(n,[{key:"getCellIndices",value:function(i){var s=i.height,l=i.width,d=i.x,u=i.y,p={};return this.getSections({height:s,width:l,x:d,y:u}).forEach(function(m){return m.getCellIndices().forEach(function(y){p[y]=y})}),Object.keys(p).map(function(m){return p[m]})}},{key:"getCellMetadata",value:function(i){var s=i.index;return this._cellMetadata[s]}},{key:"getSections",value:function(i){for(var s=i.height,l=i.width,d=i.x,u=i.y,p=Math.floor(d/this._sectionSize),m=Math.floor((d+l-1)/this._sectionSize),y=Math.floor(u/this._sectionSize),_=Math.floor((u+s-1)/this._sectionSize),E=[],C=p;C<=m;C++)for(var x=y;x<=_;x++){var N="".concat(C,".").concat(x);this._sections[N]||(this._sections[N]=new Rrt({height:this._sectionSize,width:this._sectionSize,x:C*this._sectionSize,y:x*this._sectionSize})),E.push(this._sections[N])}return E}},{key:"getTotalSectionCount",value:function(){return Object.keys(this._sections).length}},{key:"toString",value:function(){var i=this;return Object.keys(this._sections).map(function(s){return i._sections[s].toString()})}},{key:"registerCell",value:function(i){var s=i.cellMetadatum,l=i.index;this._cellMetadata[l]=s,this.getSections(s).forEach(function(d){return d.addCellIndex({index:l})})}}])}();function Irt(n){for(var t=n.cellCount,i=n.cellSizeAndPositionGetter,s=n.sectionSize,l=[],d=new Art(s),u=0,p=0,m=0;m<t;m++){var y=i({index:m});if(y.height==null||isNaN(y.height)||y.width==null||isNaN(y.width)||y.x==null||isNaN(y.x)||y.y==null||isNaN(y.y))throw Error("Invalid metadata returned for cell ".concat(m,`:
x:`).concat(y.x,", y:").concat(y.y,", width:").concat(y.width,", height:").concat(y.height));u=Math.max(u,y.y+y.height),p=Math.max(p,y.x+y.width),l[m]=y,d.registerCell({cellMetadatum:y,index:m})}return{cellMetadata:l,height:u,sectionManager:d,width:p}}function $pe(n){var t=n.align,i=t===void 0?"auto":t,s=n.cellOffset,l=n.cellSize,d=n.containerSize,u=n.currentOffset,p=s,m=p-d+l;switch(i){case"start":return p;case"end":return m;case"center":return p-(d-l)/2;default:return Math.max(m,Math.min(p,u))}}function Nrt(n,t,i){return t=Cr(t),vc(n,bbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function bbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bbe=function(){return!!n})()}var Cbe=function(n){function t(i,s){var l;return Sa(this,t),l=Nrt(this,t,[i,s]),l._cellMetadata=[],l._lastRenderedCellIndices=[],l._cellCache=[],l._isScrollingChange=l._isScrollingChange.bind(l),l._setCollectionViewRef=l._setCollectionViewRef.bind(l),l}return yc(t,n),ba(t,[{key:"forceUpdate",value:function(){this._collectionView!==void 0&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var s=Qd({},(brt(this.props),this.props));return k.createElement(FF,Qd({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},s))}},{key:"calculateSizeAndPositionData",value:function(){var s=this.props,l=s.cellCount,d=s.cellSizeAndPositionGetter,u=s.sectionSize,p=Irt({cellCount:l,cellSizeAndPositionGetter:d,sectionSize:u});this._cellMetadata=p.cellMetadata,this._sectionManager=p.sectionManager,this._height=p.height,this._width=p.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(s){var l=s.align,d=s.cellIndex,u=s.height,p=s.scrollLeft,m=s.scrollTop,y=s.width,_=this.props.cellCount;if(d>=0&&d<_){var E=this._cellMetadata[d];p=$pe({align:l,cellOffset:E.x,cellSize:E.width,containerSize:y,currentOffset:p,targetIndex:d}),m=$pe({align:l,cellOffset:E.y,cellSize:E.height,containerSize:u,currentOffset:m,targetIndex:d})}return{scrollLeft:p,scrollTop:m}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(s){var l=this,d=s.height,u=s.isScrolling,p=s.width,m=s.x,y=s.y,_=this.props,E=_.cellGroupRenderer,C=_.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:d,width:p,x:m,y}),E({cellCache:this._cellCache,cellRenderer:C,cellSizeAndPositionGetter:function(N){var O=N.index;return l._sectionManager.getCellMetadata({index:O})},indices:this._lastRenderedCellIndices,isScrolling:u})}},{key:"_isScrollingChange",value:function(s){s||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(s){this._collectionView=s}}])}(k.PureComponent);Et(Cbe,"defaultProps",{"aria-label":"grid",cellGroupRenderer:Ort});Cbe.propTypes={};function Ort(n){var t=n.cellCache,i=n.cellRenderer,s=n.cellSizeAndPositionGetter,l=n.indices,d=n.isScrolling;return l.map(function(u){var p=s({index:u}),m={index:u,isScrolling:d,key:u,style:{height:p.height,left:p.x,position:"absolute",top:p.y,width:p.width}};return d?(u in t||(t[u]=i(m)),t[u]):i(m)}).filter(function(u){return!!u})}function Prt(n,t,i){return t=Cr(t),vc(n,Tbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Tbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tbe=function(){return!!n})()}var Lrt=function(n){function t(i,s){var l;return Sa(this,t),l=Prt(this,t,[i,s]),l._registerChild=l._registerChild.bind(l),l}return yc(t,n),ba(t,[{key:"componentDidUpdate",value:function(s){var l=this.props,d=l.columnMaxWidth,u=l.columnMinWidth,p=l.columnCount,m=l.width;(d!==s.columnMaxWidth||u!==s.columnMinWidth||p!==s.columnCount||m!==s.width)&&this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var s=this.props,l=s.children,d=s.columnMaxWidth,u=s.columnMinWidth,p=s.columnCount,m=s.width,y=u||1,_=d?Math.min(d,m):m,E=m/p;E=Math.max(y,E),E=Math.min(_,E),E=Math.floor(E);var C=Math.min(m,E*p);return l({adjustedWidth:C,columnWidth:E,getColumnWidth:function(){return E},registerChild:this._registerChild})}},{key:"_registerChild",value:function(s){if(s&&typeof s.recomputeGridSize!="function")throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=s,this._registeredChild&&this._registeredChild.recomputeGridSize()}}])}(k.PureComponent);Lrt.propTypes={};function Kpe(n){var t=n.cellCount,i=n.cellSize,s=n.computeMetadataCallback,l=n.computeMetadataCallbackProps,d=n.nextCellsCount,u=n.nextCellSize,p=n.nextScrollToIndex,m=n.scrollToIndex,y=n.updateScrollOffsetForScrollToIndex;(t!==d||(typeof i=="number"||typeof u=="number")&&i!==u)&&(s(l),m>=0&&m===p&&y())}function x4(n,t){if(n==null)return{};var i,s,l=BQ(n,t);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(n);for(s=0;s<d.length;s++)i=d[s],t.indexOf(i)===-1&&{}.propertyIsEnumerable.call(n,i)&&(l[i]=n[i])}return l}var Drt=function(){function n(t){var i=t.cellCount,s=t.cellSizeGetter,l=t.estimatedCellSize;Sa(this,n),Et(this,"_cellSizeAndPositionData",{}),Et(this,"_lastMeasuredIndex",-1),Et(this,"_lastBatchedIndex",-1),Et(this,"_cellCount",void 0),Et(this,"_cellSizeGetter",void 0),Et(this,"_estimatedCellSize",void 0),this._cellSizeGetter=s,this._cellCount=i,this._estimatedCellSize=l}return ba(n,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(i){var s=i.cellCount,l=i.estimatedCellSize,d=i.cellSizeGetter;this._cellCount=s,this._estimatedCellSize=l,this._cellSizeGetter=d}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(i){if(i<0||i>=this._cellCount)throw Error("Requested index ".concat(i," is outside of range 0..").concat(this._cellCount));if(i>this._lastMeasuredIndex)for(var s=this.getSizeAndPositionOfLastMeasuredCell(),l=s.offset+s.size,d=this._lastMeasuredIndex+1;d<=i;d++){var u=this._cellSizeGetter({index:d});if(u===void 0||isNaN(u))throw Error("Invalid size returned for cell ".concat(d," of value ").concat(u));u===null?(this._cellSizeAndPositionData[d]={offset:l,size:0},this._lastBatchedIndex=i):(this._cellSizeAndPositionData[d]={offset:l,size:u},l+=u,this._lastMeasuredIndex=i)}return this._cellSizeAndPositionData[i]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var i=this.getSizeAndPositionOfLastMeasuredCell(),s=i.offset+i.size,l=this._cellCount-this._lastMeasuredIndex-1,d=l*this._estimatedCellSize;return s+d}},{key:"getUpdatedOffsetForIndex",value:function(i){var s=i.align,l=s===void 0?"auto":s,d=i.containerSize,u=i.currentOffset,p=i.targetIndex;if(d<=0)return 0;var m=this.getSizeAndPositionOfCell(p),y=m.offset,_=y-d+m.size,E;switch(l){case"start":E=y;break;case"end":E=_;break;case"center":E=y-(d-m.size)/2;break;default:E=Math.max(_,Math.min(y,u));break}var C=this.getTotalSize();return Math.max(0,Math.min(C-d,E))}},{key:"getVisibleCellRange",value:function(i){var s=i.containerSize,l=i.offset,d=this.getTotalSize();if(d===0)return{};var u=l+s,p=this._findNearestCell(l),m=this.getSizeAndPositionOfCell(p);l=m.offset+m.size;for(var y=p;l<u&&y<this._cellCount-1;)y++,l+=this.getSizeAndPositionOfCell(y).size;return{start:p,stop:y}}},{key:"resetCell",value:function(i){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,i-1)}},{key:"_binarySearch",value:function(i,s,l){for(;s<=i;){var d=s+Math.floor((i-s)/2),u=this.getSizeAndPositionOfCell(d).offset;if(u===l)return d;u<l?s=d+1:u>l&&(i=d-1)}return s>0?s-1:0}},{key:"_exponentialSearch",value:function(i,s){for(var l=1;i<this._cellCount&&this.getSizeAndPositionOfCell(i).offset<s;)i+=l,l*=2;return this._binarySearch(Math.min(i,this._cellCount-1),Math.floor(i/2),s)}},{key:"_findNearestCell",value:function(i){if(isNaN(i))throw Error("Invalid offset ".concat(i," specified"));i=Math.max(0,i);var s=this.getSizeAndPositionOfLastMeasuredCell(),l=Math.max(0,this._lastMeasuredIndex);return s.offset>=i?this._binarySearch(l,0,i):this._exponentialSearch(l,i)}}])}(),krt=15e5,Mrt=16777100,jrt=function(){return typeof window<"u"},Urt=function(){return!!window.chrome},Frt=function(){return jrt()&&Urt()?Mrt:krt},Brt=["maxScrollSize"],qpe=function(){function n(t){var i=t.maxScrollSize,s=i===void 0?Frt():i,l=x4(t,Brt);Sa(this,n),Et(this,"_cellSizeAndPositionManager",void 0),Et(this,"_maxScrollSize",void 0),this._cellSizeAndPositionManager=new Drt(l),this._maxScrollSize=s}return ba(n,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(i){this._cellSizeAndPositionManager.configure(i)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(i){var s=i.containerSize,l=i.offset,d=this._cellSizeAndPositionManager.getTotalSize(),u=this.getTotalSize(),p=this._getOffsetPercentage({containerSize:s,offset:l,totalSize:u});return Math.round(p*(u-d))}},{key:"getSizeAndPositionOfCell",value:function(i){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(i)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(i){var s=i.align,l=s===void 0?"auto":s,d=i.containerSize,u=i.currentOffset,p=i.targetIndex;u=this._safeOffsetToOffset({containerSize:d,offset:u});var m=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:l,containerSize:d,currentOffset:u,targetIndex:p});return this._offsetToSafeOffset({containerSize:d,offset:m})}},{key:"getVisibleCellRange",value:function(i){var s=i.containerSize,l=i.offset;return l=this._safeOffsetToOffset({containerSize:s,offset:l}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:s,offset:l})}},{key:"resetCell",value:function(i){this._cellSizeAndPositionManager.resetCell(i)}},{key:"_getOffsetPercentage",value:function(i){var s=i.containerSize,l=i.offset,d=i.totalSize;return d<=s?0:l/(d-s)}},{key:"_offsetToSafeOffset",value:function(i){var s=i.containerSize,l=i.offset,d=this._cellSizeAndPositionManager.getTotalSize(),u=this.getTotalSize();if(d===u)return l;var p=this._getOffsetPercentage({containerSize:s,offset:l,totalSize:d});return Math.round(p*(u-s))}},{key:"_safeOffsetToOffset",value:function(i){var s=i.containerSize,l=i.offset,d=this._cellSizeAndPositionManager.getTotalSize(),u=this.getTotalSize();if(d===u)return l;var p=this._getOffsetPercentage({containerSize:s,offset:l,totalSize:u});return Math.round(p*(d-s))}}])}(),oM=-1,Vm=1;function Vrt(n){var t=n.cellCount,i=n.overscanCellsCount,s=n.scrollDirection,l=n.startIndex,d=n.stopIndex;return s===Vm?{overscanStartIndex:Math.max(0,l),overscanStopIndex:Math.min(t-1,d+i)}:{overscanStartIndex:Math.max(0,l-i),overscanStopIndex:Math.min(t-1,d)}}function Ype(n){var t=n.cellSize,i=n.cellSizeAndPositionManager,s=n.previousCellsCount,l=n.previousCellSize,d=n.previousScrollToAlignment,u=n.previousScrollToIndex,p=n.previousSize,m=n.scrollOffset,y=n.scrollToAlignment,_=n.scrollToIndex,E=n.size,C=n.sizeJustIncreasedFromZero,x=n.updateScrollIndexCallback,N=i.getCellCount(),O=_>=0&&_<N,D=E!==p||C||!l||typeof t=="number"&&t!==l;O&&(D||y!==d||_!==u)?x(_):!O&&N>0&&(E<p||N<s)&&m>i.getTotalSize()-E&&x(N-1)}function zrt(n){for(var t=n.cellCache,i=n.cellRenderer,s=n.columnSizeAndPositionManager,l=n.columnStartIndex,d=n.columnStopIndex,u=n.deferredMeasurementCache,p=n.horizontalOffsetAdjustment,m=n.isScrolling,y=n.isScrollingOptOut,_=n.parent,E=n.rowSizeAndPositionManager,C=n.rowStartIndex,x=n.rowStopIndex,N=n.styleCache,O=n.verticalOffsetAdjustment,D=n.visibleColumnIndices,P=n.visibleRowIndices,j=[],M=s.areOffsetsAdjusted()||E.areOffsetsAdjusted(),V=!m&&!M,G=C;G<=x;G++)for(var $=E.getSizeAndPositionOfCell(G),ne=l;ne<=d;ne++){var Y=s.getSizeAndPositionOfCell(ne),le=ne>=D.start&&ne<=D.stop&&G>=P.start&&G<=P.stop,re="".concat(G,"-").concat(ne),ee=void 0;V&&N[re]?ee=N[re]:u&&!u.has(G,ne)?ee={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(ee={height:$.size,left:Y.offset+p,position:"absolute",top:$.offset+O,width:Y.size},N[re]=ee);var de={columnIndex:ne,isScrolling:m,isVisible:le,key:re,parent:_,rowIndex:G,style:ee},H=void 0;(y||m)&&!p&&!O?(t[re]||(t[re]=i(de)),H=t[re]):H=i(de),!(H==null||H===!1)&&(H.props.role||(H=dn.cloneElement(H,{role:"gridcell"})),j.push(H))}return j}var cc;typeof window<"u"?cc=window:typeof self<"u"?cc=self:cc={};var Hrt=cc.requestAnimationFrame||cc.webkitRequestAnimationFrame||cc.mozRequestAnimationFrame||cc.oRequestAnimationFrame||cc.msRequestAnimationFrame||function(n){return cc.setTimeout(n,1e3/60)},Grt=cc.cancelAnimationFrame||cc.webkitCancelAnimationFrame||cc.mozCancelAnimationFrame||cc.oCancelAnimationFrame||cc.msCancelAnimationFrame||function(n){cc.clearTimeout(n)},Xpe=Hrt,Wrt=Grt,dx=function(t){return Wrt(t.id)},yee=function(t,i){var s;Promise.resolve().then(function(){s=Date.now()});var l=function(){Date.now()-s>=i?t.call():d.id=Xpe(l)},d={id:Xpe(l)};return d};function Jpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Hc(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Jpe(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Jpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function $rt(n,t,i){return t=Cr(t),vc(n,Rbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Rbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rbe=function(){return!!n})()}var Krt=150,YK={OBSERVED:"observed",REQUESTED:"requested"},qrt=function(){return null},kv=function(n){function t(i){var s;Sa(this,t),s=$rt(this,t,[i]),Et(s,"_onGridRenderedMemoizer",cx()),Et(s,"_onScrollMemoizer",cx(!1)),Et(s,"_deferredInvalidateColumnIndex",null),Et(s,"_deferredInvalidateRowIndex",null),Et(s,"_recomputeScrollLeftFlag",!1),Et(s,"_recomputeScrollTopFlag",!1),Et(s,"_horizontalScrollBarSize",0),Et(s,"_verticalScrollBarSize",0),Et(s,"_scrollbarPresenceChanged",!1),Et(s,"_scrollingContainer",void 0),Et(s,"_childrenToDisplay",void 0),Et(s,"_columnStartIndex",void 0),Et(s,"_columnStopIndex",void 0),Et(s,"_rowStartIndex",void 0),Et(s,"_rowStopIndex",void 0),Et(s,"_renderedColumnStartIndex",0),Et(s,"_renderedColumnStopIndex",0),Et(s,"_renderedRowStartIndex",0),Et(s,"_renderedRowStopIndex",0),Et(s,"_initialScrollTop",void 0),Et(s,"_initialScrollLeft",void 0),Et(s,"_disablePointerEventsTimeoutId",void 0),Et(s,"_styleCache",{}),Et(s,"_cellCache",{}),Et(s,"_debounceScrollEndedCallback",function(){s._disablePointerEventsTimeoutId=null,s.setState({isScrolling:!1,needToResetStyleCache:!1})}),Et(s,"_invokeOnGridRenderedHelper",function(){var u=s.props.onSectionRendered;s._onGridRenderedMemoizer({callback:u,indices:{columnOverscanStartIndex:s._columnStartIndex,columnOverscanStopIndex:s._columnStopIndex,columnStartIndex:s._renderedColumnStartIndex,columnStopIndex:s._renderedColumnStopIndex,rowOverscanStartIndex:s._rowStartIndex,rowOverscanStopIndex:s._rowStopIndex,rowStartIndex:s._renderedRowStartIndex,rowStopIndex:s._renderedRowStopIndex}})}),Et(s,"_setScrollingContainerRef",function(u){s._scrollingContainer=u,typeof s.props.elementRef=="function"?s.props.elementRef(u):ew(s.props.elementRef)==="object"&&(s.props.elementRef.current=u)}),Et(s,"_onScroll",function(u){u.target===s._scrollingContainer&&s.handleScrollEvent(u.target)});var l=new qpe({cellCount:i.columnCount,cellSizeGetter:function(p){return t._wrapSizeGetter(i.columnWidth)(p)},estimatedCellSize:t._getEstimatedColumnSize(i)}),d=new qpe({cellCount:i.rowCount,cellSizeGetter:function(p){return t._wrapSizeGetter(i.rowHeight)(p)},estimatedCellSize:t._getEstimatedRowSize(i)});return s.state={instanceProps:{columnSizeAndPositionManager:l,rowSizeAndPositionManager:d,prevColumnWidth:i.columnWidth,prevRowHeight:i.rowHeight,prevColumnCount:i.columnCount,prevRowCount:i.rowCount,prevIsScrolling:i.isScrolling===!0,prevScrollToColumn:i.scrollToColumn,prevScrollToRow:i.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:Vm,scrollDirectionVertical:Vm,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},i.scrollToRow>0&&(s._initialScrollTop=s._getCalculatedScrollTop(i,s.state)),i.scrollToColumn>0&&(s._initialScrollLeft=s._getCalculatedScrollLeft(i,s.state)),s}return yc(t,n),ba(t,[{key:"getOffsetForCell",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.alignment,d=l===void 0?this.props.scrollToAlignment:l,u=s.columnIndex,p=u===void 0?this.props.scrollToColumn:u,m=s.rowIndex,y=m===void 0?this.props.scrollToRow:m,_=Hc(Hc({},this.props),{},{scrollToAlignment:d,scrollToColumn:p,scrollToRow:y});return{scrollLeft:this._getCalculatedScrollLeft(_),scrollTop:this._getCalculatedScrollTop(_)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(s){var l=s.scrollLeft,d=l===void 0?0:l,u=s.scrollTop,p=u===void 0?0:u;if(!(p<0)){this._debounceScrollEnded();var m=this.props,y=m.autoHeight,_=m.autoWidth,E=m.height,C=m.width,x=this.state.instanceProps,N=x.scrollbarSize,O=x.rowSizeAndPositionManager.getTotalSize(),D=x.columnSizeAndPositionManager.getTotalSize(),P=Math.min(Math.max(0,D-C+N),d),j=Math.min(Math.max(0,O-E+N),p);if(this.state.scrollLeft!==P||this.state.scrollTop!==j){var M=P!==this.state.scrollLeft?P>this.state.scrollLeft?Vm:oM:this.state.scrollDirectionHorizontal,V=j!==this.state.scrollTop?j>this.state.scrollTop?Vm:oM:this.state.scrollDirectionVertical,G={isScrolling:!0,scrollDirectionHorizontal:M,scrollDirectionVertical:V,scrollPositionChangeReason:YK.OBSERVED};y||(G.scrollTop=j),_||(G.scrollLeft=P),G.needToResetStyleCache=!1,this.setState(G)}this._invokeOnScrollMemoizer({scrollLeft:P,scrollTop:j,totalColumnsWidth:D,totalRowsHeight:O})}}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.columnIndex,d=s.rowIndex;this._deferredInvalidateColumnIndex=typeof this._deferredInvalidateColumnIndex=="number"?Math.min(this._deferredInvalidateColumnIndex,l):l,this._deferredInvalidateRowIndex=typeof this._deferredInvalidateRowIndex=="number"?Math.min(this._deferredInvalidateRowIndex,d):d}},{key:"measureAllCells",value:function(){var s=this.props,l=s.columnCount,d=s.rowCount,u=this.state.instanceProps;u.columnSizeAndPositionManager.getSizeAndPositionOfCell(l-1),u.rowSizeAndPositionManager.getSizeAndPositionOfCell(d-1)}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u,m=this.props,y=m.scrollToColumn,_=m.scrollToRow,E=this.state.instanceProps;E.columnSizeAndPositionManager.resetCell(d),E.rowSizeAndPositionManager.resetCell(p),this._recomputeScrollLeftFlag=y>=0&&(this.state.scrollDirectionHorizontal===Vm?d<=y:d>=y),this._recomputeScrollTopFlag=_>=0&&(this.state.scrollDirectionVertical===Vm?p<=_:p>=_),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(s){var l=s.columnIndex,d=s.rowIndex,u=this.props.columnCount,p=this.props;u>1&&l!==void 0&&this._updateScrollLeftForScrollToColumn(Hc(Hc({},p),{},{scrollToColumn:l})),d!==void 0&&this._updateScrollTopForScrollToRow(Hc(Hc({},p),{},{scrollToRow:d}))}},{key:"componentDidMount",value:function(){var s=this.props,l=s.getScrollbarSize,d=s.height,u=s.scrollLeft,p=s.scrollToColumn,m=s.scrollTop,y=s.scrollToRow,_=s.width,E=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),E.scrollbarSizeMeasured||this.setState(function(N){var O=Hc(Hc({},N),{},{needToResetStyleCache:!1});return O.instanceProps.scrollbarSize=l(),O.instanceProps.scrollbarSizeMeasured=!0,O}),typeof u=="number"&&u>=0||typeof m=="number"&&m>=0){var C=t._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:u,scrollTop:m});C&&(C.needToResetStyleCache=!1,this.setState(C))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var x=d>0&&_>0;p>=0&&x&&this._updateScrollLeftForScrollToColumn(),y>=0&&x&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:u||0,scrollTop:m||0,totalColumnsWidth:E.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:E.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(s,l){var d=this,u=this.props,p=u.autoHeight,m=u.autoWidth,y=u.columnCount,_=u.height,E=u.rowCount,C=u.scrollToAlignment,x=u.scrollToColumn,N=u.scrollToRow,O=u.width,D=this.state,P=D.scrollLeft,j=D.scrollPositionChangeReason,M=D.scrollTop,V=D.instanceProps;this._handleInvalidatedGridSize();var G=y>0&&s.columnCount===0||E>0&&s.rowCount===0;j===YK.REQUESTED&&(!m&&P>=0&&(P!==this._scrollingContainer.scrollLeft||G)&&(this._scrollingContainer.scrollLeft=P),!p&&M>=0&&(M!==this._scrollingContainer.scrollTop||G)&&(this._scrollingContainer.scrollTop=M));var $=(s.width===0||s.height===0)&&_>0&&O>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):Ype({cellSizeAndPositionManager:V.columnSizeAndPositionManager,previousCellsCount:s.columnCount,previousCellSize:s.columnWidth,previousScrollToAlignment:s.scrollToAlignment,previousScrollToIndex:s.scrollToColumn,previousSize:s.width,scrollOffset:P,scrollToAlignment:C,scrollToIndex:x,size:O,sizeJustIncreasedFromZero:$,updateScrollIndexCallback:function(){return d._updateScrollLeftForScrollToColumn(d.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):Ype({cellSizeAndPositionManager:V.rowSizeAndPositionManager,previousCellsCount:s.rowCount,previousCellSize:s.rowHeight,previousScrollToAlignment:s.scrollToAlignment,previousScrollToIndex:s.scrollToRow,previousSize:s.height,scrollOffset:M,scrollToAlignment:C,scrollToIndex:N,size:_,sizeJustIncreasedFromZero:$,updateScrollIndexCallback:function(){return d._updateScrollTopForScrollToRow(d.props)}}),this._invokeOnGridRenderedHelper(),P!==l.scrollLeft||M!==l.scrollTop){var ne=V.rowSizeAndPositionManager.getTotalSize(),Y=V.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:P,scrollTop:M,totalColumnsWidth:Y,totalRowsHeight:ne})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&dx(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var s=this.props,l=s.autoContainerWidth,d=s.autoHeight,u=s.autoWidth,p=s.className,m=s.containerProps,y=s.containerRole,_=s.containerStyle,E=s.height,C=s.id,x=s.noContentRenderer,N=s.role,O=s.style,D=s.tabIndex,P=s.width,j=this.state,M=j.instanceProps,V=j.needToResetStyleCache,G=this._isScrolling(),$={boxSizing:"border-box",direction:"ltr",height:d?"auto":E,position:"relative",width:u?"auto":P,WebkitOverflowScrolling:"touch",willChange:"transform"};V&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var ne=M.columnSizeAndPositionManager.getTotalSize(),Y=M.rowSizeAndPositionManager.getTotalSize(),le=Y>E?M.scrollbarSize:0,re=ne>P?M.scrollbarSize:0;(re!==this._horizontalScrollBarSize||le!==this._verticalScrollBarSize)&&(this._horizontalScrollBarSize=re,this._verticalScrollBarSize=le,this._scrollbarPresenceChanged=!0),$.overflowX=ne+le<=P?"hidden":"auto",$.overflowY=Y+re<=E?"hidden":"auto";var ee=this._childrenToDisplay,de=ee.length===0&&E>0&&P>0;return k.createElement("div",Qd({ref:this._setScrollingContainerRef},m,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:pf("ReactVirtualized__Grid",p),id:C,onScroll:this._onScroll,role:N,style:Hc(Hc({},$),O),tabIndex:D}),ee.length>0&&k.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:y,style:Hc({width:l?"auto":ne,height:Y,maxWidth:ne,maxHeight:Y,overflow:"hidden",pointerEvents:G?"none":"",position:"relative"},_)},ee),de&&x())}},{key:"_calculateChildrenToRender",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,d=s.cellRenderer,u=s.cellRangeRenderer,p=s.columnCount,m=s.deferredMeasurementCache,y=s.height,_=s.overscanColumnCount,E=s.overscanIndicesGetter,C=s.overscanRowCount,x=s.rowCount,N=s.width,O=s.isScrollingOptOut,D=l.scrollDirectionHorizontal,P=l.scrollDirectionVertical,j=l.instanceProps,M=this._initialScrollTop>0?this._initialScrollTop:l.scrollTop,V=this._initialScrollLeft>0?this._initialScrollLeft:l.scrollLeft,G=this._isScrolling(s,l);if(this._childrenToDisplay=[],y>0&&N>0){var $=j.columnSizeAndPositionManager.getVisibleCellRange({containerSize:N,offset:V}),ne=j.rowSizeAndPositionManager.getVisibleCellRange({containerSize:y,offset:M}),Y=j.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:N,offset:V}),le=j.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:y,offset:M});this._renderedColumnStartIndex=$.start,this._renderedColumnStopIndex=$.stop,this._renderedRowStartIndex=ne.start,this._renderedRowStopIndex=ne.stop;var re=E({direction:"horizontal",cellCount:p,overscanCellsCount:_,scrollDirection:D,startIndex:typeof $.start=="number"?$.start:0,stopIndex:typeof $.stop=="number"?$.stop:-1}),ee=E({direction:"vertical",cellCount:x,overscanCellsCount:C,scrollDirection:P,startIndex:typeof ne.start=="number"?ne.start:0,stopIndex:typeof ne.stop=="number"?ne.stop:-1}),de=re.overscanStartIndex,H=re.overscanStopIndex,ae=ee.overscanStartIndex,_e=ee.overscanStopIndex;if(m){if(!m.hasFixedHeight()){for(var me=ae;me<=_e;me++)if(!m.has(me,0)){de=0,H=p-1;break}}if(!m.hasFixedWidth()){for(var Ce=de;Ce<=H;Ce++)if(!m.has(0,Ce)){ae=0,_e=x-1;break}}}this._childrenToDisplay=u({cellCache:this._cellCache,cellRenderer:d,columnSizeAndPositionManager:j.columnSizeAndPositionManager,columnStartIndex:de,columnStopIndex:H,deferredMeasurementCache:m,horizontalOffsetAdjustment:Y,isScrolling:G,isScrollingOptOut:O,parent:this,rowSizeAndPositionManager:j.rowSizeAndPositionManager,rowStartIndex:ae,rowStopIndex:_e,scrollLeft:V,scrollTop:M,styleCache:this._styleCache,verticalOffsetAdjustment:le,visibleColumnIndices:$,visibleRowIndices:ne}),this._columnStartIndex=de,this._columnStopIndex=H,this._rowStartIndex=ae,this._rowStopIndex=_e}}},{key:"_debounceScrollEnded",value:function(){var s=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&dx(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=yee(this._debounceScrollEndedCallback,s)}},{key:"_handleInvalidatedGridSize",value:function(){if(typeof this._deferredInvalidateColumnIndex=="number"&&typeof this._deferredInvalidateRowIndex=="number"){var s=this._deferredInvalidateColumnIndex,l=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:s,rowIndex:l})}}},{key:"_invokeOnScrollMemoizer",value:function(s){var l=this,d=s.scrollLeft,u=s.scrollTop,p=s.totalColumnsWidth,m=s.totalRowsHeight;this._onScrollMemoizer({callback:function(_){var E=_.scrollLeft,C=_.scrollTop,x=l.props,N=x.height,O=x.onScroll,D=x.width;O({clientHeight:N,clientWidth:D,scrollHeight:m,scrollLeft:E,scrollTop:C,scrollWidth:p})},indices:{scrollLeft:d,scrollTop:u}})}},{key:"_isScrolling",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return Object.hasOwnProperty.call(s,"isScrolling")?!!s.isScrolling:!!l.isScrolling}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var s=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,s({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(s){var l=s.scrollLeft,d=s.scrollTop,u=t._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:l,scrollTop:d});u&&(u.needToResetStyleCache=!1,this.setState(u))}},{key:"_getCalculatedScrollLeft",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return t._getCalculatedScrollLeft(s,l)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,d=t._getScrollLeftForScrollToColumnStateUpdate(s,l);d&&(d.needToResetStyleCache=!1,this.setState(d))}},{key:"_getCalculatedScrollTop",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return t._getCalculatedScrollTop(s,l)}},{key:"_resetStyleCache",value:function(){var s=this._styleCache,l=this._cellCache,d=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var u=this._rowStartIndex;u<=this._rowStopIndex;u++)for(var p=this._columnStartIndex;p<=this._columnStopIndex;p++){var m="".concat(u,"-").concat(p);this._styleCache[m]=s[m],d&&(this._cellCache[m]=l[m])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,d=t._getScrollTopForScrollToRowStateUpdate(s,l);d&&(d.needToResetStyleCache=!1,this.setState(d))}}],[{key:"getDerivedStateFromProps",value:function(s,l){var d={};s.columnCount===0&&l.scrollLeft!==0||s.rowCount===0&&l.scrollTop!==0?(d.scrollLeft=0,d.scrollTop=0):(s.scrollLeft!==l.scrollLeft&&s.scrollToColumn<0||s.scrollTop!==l.scrollTop&&s.scrollToRow<0)&&Object.assign(d,t._getScrollToPositionStateUpdate({prevState:l,scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}));var u=l.instanceProps;d.needToResetStyleCache=!1,(s.columnWidth!==u.prevColumnWidth||s.rowHeight!==u.prevRowHeight)&&(d.needToResetStyleCache=!0),u.columnSizeAndPositionManager.configure({cellCount:s.columnCount,estimatedCellSize:t._getEstimatedColumnSize(s),cellSizeGetter:t._wrapSizeGetter(s.columnWidth)}),u.rowSizeAndPositionManager.configure({cellCount:s.rowCount,estimatedCellSize:t._getEstimatedRowSize(s),cellSizeGetter:t._wrapSizeGetter(s.rowHeight)}),(u.prevColumnCount===0||u.prevRowCount===0)&&(u.prevColumnCount=0,u.prevRowCount=0),s.autoHeight&&s.isScrolling===!1&&u.prevIsScrolling===!0&&Object.assign(d,{isScrolling:!1});var p,m;return Kpe({cellCount:u.prevColumnCount,cellSize:typeof u.prevColumnWidth=="number"?u.prevColumnWidth:null,computeMetadataCallback:function(){return u.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:s,nextCellsCount:s.columnCount,nextCellSize:typeof s.columnWidth=="number"?s.columnWidth:null,nextScrollToIndex:s.scrollToColumn,scrollToIndex:u.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){p=t._getScrollLeftForScrollToColumnStateUpdate(s,l)}}),Kpe({cellCount:u.prevRowCount,cellSize:typeof u.prevRowHeight=="number"?u.prevRowHeight:null,computeMetadataCallback:function(){return u.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:s,nextCellsCount:s.rowCount,nextCellSize:typeof s.rowHeight=="number"?s.rowHeight:null,nextScrollToIndex:s.scrollToRow,scrollToIndex:u.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){m=t._getScrollTopForScrollToRowStateUpdate(s,l)}}),u.prevColumnCount=s.columnCount,u.prevColumnWidth=s.columnWidth,u.prevIsScrolling=s.isScrolling===!0,u.prevRowCount=s.rowCount,u.prevRowHeight=s.rowHeight,u.prevScrollToColumn=s.scrollToColumn,u.prevScrollToRow=s.scrollToRow,u.scrollbarSize=s.getScrollbarSize(),u.scrollbarSize===void 0?(u.scrollbarSizeMeasured=!1,u.scrollbarSize=0):u.scrollbarSizeMeasured=!0,d.instanceProps=u,Hc(Hc(Hc({},d),p),m)}},{key:"_getEstimatedColumnSize",value:function(s){return typeof s.columnWidth=="number"?s.columnWidth:s.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(s){return typeof s.rowHeight=="number"?s.rowHeight:s.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(s){var l=s.prevState,d=s.scrollLeft,u=s.scrollTop,p={scrollPositionChangeReason:YK.REQUESTED};return typeof d=="number"&&d>=0&&(p.scrollDirectionHorizontal=d>l.scrollLeft?Vm:oM,p.scrollLeft=d),typeof u=="number"&&u>=0&&(p.scrollDirectionVertical=u>l.scrollTop?Vm:oM,p.scrollTop=u),typeof d=="number"&&d>=0&&d!==l.scrollLeft||typeof u=="number"&&u>=0&&u!==l.scrollTop?p:{}}},{key:"_wrapSizeGetter",value:function(s){return typeof s=="function"?s:function(){return s}}},{key:"_getCalculatedScrollLeft",value:function(s,l){var d=s.columnCount,u=s.height,p=s.scrollToAlignment,m=s.scrollToColumn,y=s.width,_=l.scrollLeft,E=l.instanceProps;if(d>0){var C=d-1,x=m<0?C:Math.min(C,m),N=E.rowSizeAndPositionManager.getTotalSize(),O=E.scrollbarSizeMeasured&&N>u?E.scrollbarSize:0;return E.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:p,containerSize:y-O,currentOffset:_,targetIndex:x})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(s,l){var d=l.scrollLeft,u=t._getCalculatedScrollLeft(s,l);return typeof u=="number"&&u>=0&&d!==u?t._getScrollToPositionStateUpdate({prevState:l,scrollLeft:u,scrollTop:-1}):{}}},{key:"_getCalculatedScrollTop",value:function(s,l){var d=s.height,u=s.rowCount,p=s.scrollToAlignment,m=s.scrollToRow,y=s.width,_=l.scrollTop,E=l.instanceProps;if(u>0){var C=u-1,x=m<0?C:Math.min(C,m),N=E.columnSizeAndPositionManager.getTotalSize(),O=E.scrollbarSizeMeasured&&N>y?E.scrollbarSize:0;return E.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:p,containerSize:d-O,currentOffset:_,targetIndex:x})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(s,l){var d=l.scrollTop,u=t._getCalculatedScrollTop(s,l);return typeof u=="number"&&u>=0&&d!==u?t._getScrollToPositionStateUpdate({prevState:l,scrollLeft:-1,scrollTop:u}):{}}}])}(k.PureComponent);Et(kv,"defaultProps",{"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:zrt,containerRole:"row",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:mN,noContentRenderer:qrt,onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:Vrt,overscanRowCount:10,role:"grid",scrollingResetTimeInterval:Krt,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1});gP(kv);var Yrt=1;function xbe(n){var t=n.cellCount,i=n.overscanCellsCount,s=n.scrollDirection,l=n.startIndex,d=n.stopIndex;return i=Math.max(1,i),s===Yrt?{overscanStartIndex:Math.max(0,l-1),overscanStopIndex:Math.min(t-1,d+i)}:{overscanStartIndex:Math.max(0,l-i),overscanStopIndex:Math.min(t-1,d+1)}}function wJ(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,s=Array(t);i<t;i++)s[i]=n[i];return s}function Xrt(n){if(Array.isArray(n))return wJ(n)}function Jrt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Abe(n,t){if(n){if(typeof n=="string")return wJ(n,t);var i={}.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?wJ(n,t):void 0}}function Qrt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zrt(n){return Xrt(n)||Jrt(n)||Abe(n)||Qrt()}function est(n,t,i){return t=Cr(t),vc(n,Ibe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Ibe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ibe=function(){return!!n})()}var Nbe=function(n){function t(i,s){var l;return Sa(this,t),l=est(this,t,[i,s]),l._loadMoreRowsMemoizer=cx(),l._onRowsRendered=l._onRowsRendered.bind(l),l._registerChild=l._registerChild.bind(l),l}return yc(t,n),ba(t,[{key:"resetLoadMoreRowsCache",value:function(s){this._loadMoreRowsMemoizer=cx(),s&&this._doStuff(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"render",value:function(){var s=this.props.children;return s({onRowsRendered:this._onRowsRendered,registerChild:this._registerChild})}},{key:"_loadUnloadedRanges",value:function(s){var l=this,d=this.props.loadMoreRows;s.forEach(function(u){var p=d(u);p&&p.then(function(){tst({lastRenderedStartIndex:l._lastRenderedStartIndex,lastRenderedStopIndex:l._lastRenderedStopIndex,startIndex:u.startIndex,stopIndex:u.stopIndex})&&l._registeredChild&&ist(l._registeredChild,l._lastRenderedStartIndex)})})}},{key:"_onRowsRendered",value:function(s){var l=s.startIndex,d=s.stopIndex;this._lastRenderedStartIndex=l,this._lastRenderedStopIndex=d,this._doStuff(l,d)}},{key:"_doStuff",value:function(s,l){var d,u=this,p=this.props,m=p.isRowLoaded,y=p.minimumBatchSize,_=p.rowCount,E=p.threshold,C=nst({isRowLoaded:m,minimumBatchSize:y,rowCount:_,startIndex:Math.max(0,s-E),stopIndex:Math.min(_-1,l+E)}),x=(d=[]).concat.apply(d,Zrt(C.map(function(N){var O=N.startIndex,D=N.stopIndex;return[O,D]})));this._loadMoreRowsMemoizer({callback:function(){u._loadUnloadedRanges(C)},indices:{squashedUnloadedRanges:x}})}},{key:"_registerChild",value:function(s){this._registeredChild=s}}])}(k.PureComponent);Et(Nbe,"defaultProps",{minimumBatchSize:10,rowCount:0,threshold:15});Nbe.propTypes={};function tst(n){var t=n.lastRenderedStartIndex,i=n.lastRenderedStopIndex,s=n.startIndex,l=n.stopIndex;return!(s>i||l<t)}function nst(n){for(var t=n.isRowLoaded,i=n.minimumBatchSize,s=n.rowCount,l=n.startIndex,d=n.stopIndex,u=[],p=null,m=null,y=l;y<=d;y++){var _=t({index:y});_?m!==null&&(u.push({startIndex:p,stopIndex:m}),p=m=null):(m=y,p===null&&(p=y))}if(m!==null){for(var E=Math.min(Math.max(m,p+i-1),s-1),C=m+1;C<=E&&!t({index:C});C++)m=C;u.push({startIndex:p,stopIndex:m})}if(u.length)for(var x=u[0];x.stopIndex-x.startIndex+1<i&&x.startIndex>0;){var N=x.startIndex-1;if(!t({index:N}))x.startIndex=N;else break}return u}function ist(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=typeof n.recomputeGridSize=="function"?n.recomputeGridSize:n.recomputeRowHeights;i?i.call(n,t):n.forceUpdate()}function rst(n,t,i){return t=Cr(t),vc(n,Obe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Obe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Obe=function(){return!!n})()}var BF=function(n){function t(){var i;Sa(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=rst(this,t,[].concat(l)),Et(i,"Grid",void 0),Et(i,"_cellRenderer",function(u){var p=u.parent,m=u.rowIndex,y=u.style,_=u.isScrolling,E=u.isVisible,C=u.key,x=i.props.rowRenderer,N=Object.getOwnPropertyDescriptor(y,"width");return N&&N.writable&&(y.width="100%"),x({index:m,style:y,isScrolling:_,isVisible:E,key:C,parent:p})}),Et(i,"_setRef",function(u){i.Grid=u}),Et(i,"_onScroll",function(u){var p=u.clientHeight,m=u.scrollHeight,y=u.scrollTop,_=i.props.onScroll;_({clientHeight:p,scrollHeight:m,scrollTop:y})}),Et(i,"_onSectionRendered",function(u){var p=u.rowOverscanStartIndex,m=u.rowOverscanStopIndex,y=u.rowStartIndex,_=u.rowStopIndex,E=i.props.onRowsRendered;E({overscanStartIndex:p,overscanStopIndex:m,startIndex:y,stopIndex:_})}),i}return yc(t,n),ba(t,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(s){var l=s.alignment,d=s.index;if(this.Grid){var u=this.Grid.getOffsetForCell({alignment:l,rowIndex:d,columnIndex:0}),p=u.scrollTop;return p}return 0}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.columnIndex,d=s.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:d,columnIndex:l})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u;this.Grid&&this.Grid.recomputeGridSize({rowIndex:p,columnIndex:d})}},{key:"recomputeRowHeights",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:s,columnIndex:0})}},{key:"scrollToPosition",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:s})}},{key:"scrollToRow",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:s})}},{key:"render",value:function(){var s=this.props,l=s.className,d=s.noRowsRenderer,u=s.scrollToIndex,p=s.width,m=pf("ReactVirtualized__List",l);return k.createElement(kv,Qd({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:m,columnWidth:p,columnCount:1,noContentRenderer:d,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:u}))}}])}(k.PureComponent);Et(BF,"defaultProps",{autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:xbe,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}});function sst(n){if(Array.isArray(n))return n}function ast(n,t){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,l,d,u,p=[],m=!0,y=!1;try{if(d=(i=i.call(n)).next,t===0){if(Object(i)!==i)return;m=!1}else for(;!(m=(s=d.call(i)).done)&&(p.push(s.value),p.length!==t);m=!0);}catch(_){y=!0,l=_}finally{try{if(!m&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(y)throw l}}return p}}function ost(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lst(n,t){return sst(n)||ast(n,t)||Abe(n,t)||ost()}function cst(n,t,i,s){for(var l=i+1;t<=i;){var d=t+i>>>1,u=n[d];u>=s?(l=d,i=d-1):t=d+1}return l}function dst(n,t,i,s,l){for(var d=i+1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)>=0?(d=u,i=u-1):t=u+1}return d}function ust(n,t,i,s,l){return typeof i=="function"?dst(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):cst(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function hst(n,t,i,s){for(var l=i+1;t<=i;){var d=t+i>>>1,u=n[d];u>s?(l=d,i=d-1):t=d+1}return l}function fst(n,t,i,s,l){for(var d=i+1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)>0?(d=u,i=u-1):t=u+1}return d}function pst(n,t,i,s,l){return typeof i=="function"?fst(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):hst(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function mst(n,t,i,s){for(var l=t-1;t<=i;){var d=t+i>>>1,u=n[d];u<s?(l=d,t=d+1):i=d-1}return l}function gst(n,t,i,s,l){for(var d=t-1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)<0?(d=u,t=u+1):i=u-1}return d}function vst(n,t,i,s,l){return typeof i=="function"?gst(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):mst(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function yst(n,t,i,s){for(var l=t-1;t<=i;){var d=t+i>>>1,u=n[d];u<=s?(l=d,t=d+1):i=d-1}return l}function _st(n,t,i,s,l){for(var d=t-1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)<=0?(d=u,t=u+1):i=u-1}return d}function Est(n,t,i,s,l){return typeof i=="function"?_st(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):yst(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function wst(n,t,i,s){for(;t<=i;){var l=t+i>>>1,d=n[l];if(d===s)return l;d<=s?t=l+1:i=l-1}return-1}function Sst(n,t,i,s,l){for(;t<=i;){var d=t+i>>>1,u=n[d],p=l(u,s);if(p===0)return d;p<=0?t=d+1:i=d-1}return-1}function bst(n,t,i,s,l){return typeof i=="function"?Sst(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):wst(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}const m9={ge:ust,gt:pst,lt:vst,le:Est,eq:bst};var DC=0,H_=1,c7=2;function _ee(n,t,i,s,l){this.mid=n,this.left=t,this.right=i,this.leftPoints=s,this.rightPoints=l,this.count=(t?t.count:0)+(i?i.count:0)+s.length}var UP=_ee.prototype;function XK(n,t){n.mid=t.mid,n.left=t.left,n.right=t.right,n.leftPoints=t.leftPoints,n.rightPoints=t.rightPoints,n.count=t.count}function Pbe(n,t){var i=ux(t);n.mid=i.mid,n.left=i.left,n.right=i.right,n.leftPoints=i.leftPoints,n.rightPoints=i.rightPoints,n.count=i.count}function Qpe(n,t){var i=n.intervals([]);i.push(t),Pbe(n,i)}function Zpe(n,t){var i=n.intervals([]),s=i.indexOf(t);return s<0?DC:(i.splice(s,1),Pbe(n,i),H_)}UP.intervals=function(n){return n.push.apply(n,this.leftPoints),this.left&&this.left.intervals(n),this.right&&this.right.intervals(n),n};UP.insert=function(n){var t=this.count-this.leftPoints.length;if(this.count+=1,n[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?Qpe(this,n):this.left.insert(n):this.left=ux([n]);else if(n[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?Qpe(this,n):this.right.insert(n):this.right=ux([n]);else{var i=m9.ge(this.leftPoints,n,Eee),s=m9.ge(this.rightPoints,n,wee);this.leftPoints.splice(i,0,n),this.rightPoints.splice(s,0,n)}};UP.remove=function(n){var t=this.count-this.leftPoints;if(n[1]<this.mid){if(!this.left)return DC;var i=this.right?this.right.count:0;if(4*i>3*(t-1))return Zpe(this,n);var s=this.left.remove(n);return s===c7?(this.left=null,this.count-=1,H_):(s===H_&&(this.count-=1),s)}else if(n[0]>this.mid){if(!this.right)return DC;var l=this.left?this.left.count:0;if(4*l>3*(t-1))return Zpe(this,n);var s=this.right.remove(n);return s===c7?(this.right=null,this.count-=1,H_):(s===H_&&(this.count-=1),s)}else{if(this.count===1)return this.leftPoints[0]===n?c7:DC;if(this.leftPoints.length===1&&this.leftPoints[0]===n){if(this.left&&this.right){for(var d=this,u=this.left;u.right;)d=u,u=u.right;if(d===this)u.right=this.right;else{var p=this.left,s=this.right;d.count-=u.count,d.right=u.left,u.left=p,u.right=s}XK(this,u),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?XK(this,this.left):XK(this,this.right);return H_}for(var p=m9.ge(this.leftPoints,n,Eee);p<this.leftPoints.length&&this.leftPoints[p][0]===n[0];++p)if(this.leftPoints[p]===n){this.count-=1,this.leftPoints.splice(p,1);for(var s=m9.ge(this.rightPoints,n,wee);s<this.rightPoints.length&&this.rightPoints[s][1]===n[1];++s)if(this.rightPoints[s]===n)return this.rightPoints.splice(s,1),H_}return DC}};function Lbe(n,t,i){for(var s=0;s<n.length&&n[s][0]<=t;++s){var l=i(n[s]);if(l)return l}}function Dbe(n,t,i){for(var s=n.length-1;s>=0&&n[s][1]>=t;--s){var l=i(n[s]);if(l)return l}}function kbe(n,t){for(var i=0;i<n.length;++i){var s=t(n[i]);if(s)return s}}UP.queryPoint=function(n,t){if(n<this.mid){if(this.left){var i=this.left.queryPoint(n,t);if(i)return i}return Lbe(this.leftPoints,n,t)}else if(n>this.mid){if(this.right){var i=this.right.queryPoint(n,t);if(i)return i}return Dbe(this.rightPoints,n,t)}else return kbe(this.leftPoints,t)};UP.queryInterval=function(n,t,i){if(n<this.mid&&this.left){var s=this.left.queryInterval(n,t,i);if(s)return s}if(t>this.mid&&this.right){var s=this.right.queryInterval(n,t,i);if(s)return s}return t<this.mid?Lbe(this.leftPoints,t,i):n>this.mid?Dbe(this.rightPoints,n,i):kbe(this.leftPoints,i)};function Cst(n,t){return n-t}function Eee(n,t){var i=n[0]-t[0];return i||n[1]-t[1]}function wee(n,t){var i=n[1]-t[1];return i||n[0]-t[0]}function ux(n){if(n.length===0)return null;for(var t=[],i=0;i<n.length;++i)t.push(n[i][0],n[i][1]);t.sort(Cst);for(var s=t[t.length>>1],l=[],d=[],u=[],i=0;i<n.length;++i){var p=n[i];p[1]<s?l.push(p):s<p[0]?d.push(p):u.push(p)}var m=u,y=u.slice();return m.sort(Eee),y.sort(wee),new _ee(s,ux(l),ux(d),m,y)}function SJ(n){this.root=n}var Ax=SJ.prototype;Ax.insert=function(n){this.root?this.root.insert(n):this.root=new _ee(n[0],null,null,[n],[n])};Ax.remove=function(n){if(this.root){var t=this.root.remove(n);return t===c7&&(this.root=null),t!==DC}return!1};Ax.queryPoint=function(n,t){if(this.root)return this.root.queryPoint(n,t)};Ax.queryInterval=function(n,t,i){if(n<=t&&this.root)return this.root.queryInterval(n,t,i)};Object.defineProperty(Ax,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(Ax,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function Tst(n){return!n||n.length===0?new SJ(null):new SJ(ux(n))}var JK=function(){function n(){Sa(this,n),Et(this,"_columnSizeMap",{}),Et(this,"_intervalTree",Tst()),Et(this,"_leftMap",{})}return ba(n,[{key:"estimateTotalHeight",value:function(i,s,l){var d=i-this.count;return this.tallestColumnSize+Math.ceil(d/s)*l}},{key:"range",value:function(i,s,l){var d=this;this._intervalTree.queryInterval(i,i+s,function(u){var p=lst(u,3),m=p[0];p[1];var y=p[2];return l(y,d._leftMap[y],m)})}},{key:"setPosition",value:function(i,s,l,d){this._intervalTree.insert([l,l+d,i]),this._leftMap[i]=s;var u=this._columnSizeMap,p=u[s];p===void 0?u[s]=l+d:u[s]=Math.max(p,l+d)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var i=this._columnSizeMap,s=0;for(var l in i){var d=i[l];s=s===0?d:Math.min(s,d)}return s}},{key:"tallestColumnSize",get:function(){var i=this._columnSizeMap,s=0;for(var l in i){var d=i[l];s=Math.max(s,d)}return s}}])}();function eme(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Rst(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?eme(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):eme(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function xst(n,t,i){return t=Cr(t),vc(n,Mbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Mbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mbe=function(){return!!n})()}var Ast={},Ist=150,jbe=function(n){function t(){var i;Sa(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=xst(this,t,[].concat(l)),Et(i,"state",{isScrolling:!1,scrollTop:0}),Et(i,"_debounceResetIsScrollingId",void 0),Et(i,"_invalidateOnUpdateStartIndex",null),Et(i,"_invalidateOnUpdateStopIndex",null),Et(i,"_positionCache",new JK),Et(i,"_startIndex",null),Et(i,"_startIndexMemoized",null),Et(i,"_stopIndex",null),Et(i,"_stopIndexMemoized",null),Et(i,"_debounceResetIsScrollingCallback",function(){i.setState({isScrolling:!1})}),Et(i,"_setScrollingContainerRef",function(u){i._scrollingContainer=u}),Et(i,"_onScroll",function(u){var p=i.props.height,m=u.currentTarget.scrollTop,y=Math.min(Math.max(0,i._getEstimatedTotalHeight()-p),m);m===y&&(i._debounceResetIsScrolling(),i.state.scrollTop!==y&&i.setState({isScrolling:!0,scrollTop:y}))}),i}return yc(t,n),ba(t,[{key:"clearCellPositions",value:function(){this._positionCache=new JK,this.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.rowIndex;this._invalidateOnUpdateStartIndex===null?(this._invalidateOnUpdateStartIndex=l,this._invalidateOnUpdateStopIndex=l):(this._invalidateOnUpdateStartIndex=Math.min(this._invalidateOnUpdateStartIndex,l),this._invalidateOnUpdateStopIndex=Math.max(this._invalidateOnUpdateStopIndex,l))}},{key:"recomputeCellPositions",value:function(){var s=this._positionCache.count-1;this._positionCache=new JK,this._populatePositionCache(0,s),this.forceUpdate()}},{key:"componentDidMount",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentDidUpdate",value:function(s,l){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback(),this.props.scrollTop!==s.scrollTop&&this._debounceResetIsScrolling()}},{key:"componentWillUnmount",value:function(){this._debounceResetIsScrollingId&&dx(this._debounceResetIsScrollingId)}},{key:"render",value:function(){var s=this,l=this.props,d=l.autoHeight,u=l.cellCount,p=l.cellMeasurerCache,m=l.cellRenderer,y=l.className,_=l.height,E=l.id,C=l.keyMapper,x=l.overscanByPixels,N=l.role,O=l.style,D=l.tabIndex,P=l.width,j=l.rowDirection,M=this.state,V=M.isScrolling,G=M.scrollTop,$=[],ne=this._getEstimatedTotalHeight(),Y=this._positionCache.shortestColumnSize,le=this._positionCache.count,re=0,ee;if(this._positionCache.range(Math.max(0,G-x),_+x*2,function(ae,_e,me){typeof ee>"u"?(re=ae,ee=ae):(re=Math.min(re,ae),ee=Math.max(ee,ae)),$.push(m({index:ae,isScrolling:V,key:C(ae),parent:s,style:Et(Et(Et(Et({height:p.getHeight(ae)},j==="ltr"?"left":"right",_e),"position","absolute"),"top",me),"width",p.getWidth(ae))}))}),Y<G+_+x&&le<u)for(var de=Math.min(u-le,Math.ceil((G+_+x-Y)/p.defaultHeight*P/p.defaultWidth)),H=le;H<le+de;H++)ee=H,$.push(m({index:H,isScrolling:V,key:C(H),parent:this,style:{width:p.getWidth(H)}}));return this._startIndex=re,this._stopIndex=ee,k.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:pf("ReactVirtualized__Masonry",y),id:E,onScroll:this._onScroll,role:N,style:Rst({boxSizing:"border-box",direction:"ltr",height:d?"auto":_,overflowX:"hidden",overflowY:ne<_?"hidden":"auto",position:"relative",width:P,WebkitOverflowScrolling:"touch",willChange:"transform"},O),tabIndex:D},k.createElement("div",{className:"ReactVirtualized__Masonry__innerScrollContainer",style:{width:"100%",height:ne,maxWidth:"100%",maxHeight:ne,overflow:"hidden",pointerEvents:V?"none":"",position:"relative"}},$))}},{key:"_checkInvalidateOnUpdate",value:function(){if(typeof this._invalidateOnUpdateStartIndex=="number"){var s=this._invalidateOnUpdateStartIndex,l=this._invalidateOnUpdateStopIndex;this._invalidateOnUpdateStartIndex=null,this._invalidateOnUpdateStopIndex=null,this._populatePositionCache(s,l),this.forceUpdate()}}},{key:"_debounceResetIsScrolling",value:function(){var s=this.props.scrollingResetTimeInterval;this._debounceResetIsScrollingId&&dx(this._debounceResetIsScrollingId),this._debounceResetIsScrollingId=yee(this._debounceResetIsScrollingCallback,s)}},{key:"_getEstimatedTotalHeight",value:function(){var s=this.props,l=s.cellCount,d=s.cellMeasurerCache,u=s.width,p=Math.max(1,Math.floor(u/d.defaultWidth));return this._positionCache.estimateTotalHeight(l,p,d.defaultHeight)}},{key:"_invokeOnScrollCallback",value:function(){var s=this.props,l=s.height,d=s.onScroll,u=this.state.scrollTop;this._onScrollMemoized!==u&&(d({clientHeight:l,scrollHeight:this._getEstimatedTotalHeight(),scrollTop:u}),this._onScrollMemoized=u)}},{key:"_invokeOnCellsRenderedCallback",value:function(){if(this._startIndexMemoized!==this._startIndex||this._stopIndexMemoized!==this._stopIndex){var s=this.props.onCellsRendered;s({startIndex:this._startIndex,stopIndex:this._stopIndex}),this._startIndexMemoized=this._startIndex,this._stopIndexMemoized=this._stopIndex}}},{key:"_populatePositionCache",value:function(s,l){for(var d=this.props,u=d.cellMeasurerCache,p=d.cellPositioner,m=s;m<=l;m++){var y=p(m),_=y.left,E=y.top;this._positionCache.setPosition(m,_,E,u.getHeight(m))}}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.scrollTop!==void 0&&l.scrollTop!==s.scrollTop?{isScrolling:!0,scrollTop:s.scrollTop}:null}}])}(k.PureComponent);Et(jbe,"defaultProps",{autoHeight:!1,keyMapper:Nst,onCellsRendered:tme,onScroll:tme,overscanByPixels:20,role:"grid",scrollingResetTimeInterval:Ist,style:Ast,tabIndex:0,rowDirection:"ltr"});function Nst(n){return n}function tme(){}gP(jbe);var QK=function(){function n(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sa(this,n),Et(this,"_cellMeasurerCache",void 0),Et(this,"_columnIndexOffset",void 0),Et(this,"_rowIndexOffset",void 0),Et(this,"columnWidth",function(m){var y=m.index;t._cellMeasurerCache.columnWidth({index:y+t._columnIndexOffset})}),Et(this,"rowHeight",function(m){var y=m.index;t._cellMeasurerCache.rowHeight({index:y+t._rowIndexOffset})});var s=i.cellMeasurerCache,l=i.columnIndexOffset,d=l===void 0?0:l,u=i.rowIndexOffset,p=u===void 0?0:u;this._cellMeasurerCache=s,this._columnIndexOffset=d,this._rowIndexOffset=p}return ba(n,[{key:"clear",value:function(i,s){this._cellMeasurerCache.clear(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.getHeight(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"getWidth",value:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.getWidth(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"has",value:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.has(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"set",value:function(i,s,l,d){this._cellMeasurerCache.set(i+this._rowIndexOffset,s+this._columnIndexOffset,l,d)}}])}(),Ost=["rowIndex"],Pst=["columnIndex","rowIndex"],Lst=["columnIndex"],Dst=["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"];function nme(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function as(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?nme(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):nme(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function kst(n,t,i){return t=Cr(t),vc(n,Ube()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Ube(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ube=function(){return!!n})()}var ime=20,See=function(n){function t(i,s){var l;Sa(this,t),l=kst(this,t,[i,s]),Et(l,"state",{scrollLeft:0,scrollTop:0,scrollbarSize:0,showHorizontalScrollbar:!1,showVerticalScrollbar:!1}),Et(l,"_deferredInvalidateColumnIndex",null),Et(l,"_deferredInvalidateRowIndex",null),Et(l,"_bottomLeftGridRef",function(m){l._bottomLeftGrid=m}),Et(l,"_bottomRightGridRef",function(m){l._bottomRightGrid=m}),Et(l,"_cellRendererBottomLeftGrid",function(m){var y=m.rowIndex,_=x4(m,Ost),E=l.props,C=E.cellRenderer,x=E.fixedRowCount,N=E.rowCount;return y===N-x?k.createElement("div",{key:_.key,style:as(as({},_.style),{},{height:ime})}):C(as(as({},_),{},{parent:l,rowIndex:y+x}))}),Et(l,"_cellRendererBottomRightGrid",function(m){var y=m.columnIndex,_=m.rowIndex,E=x4(m,Pst),C=l.props,x=C.cellRenderer,N=C.fixedColumnCount,O=C.fixedRowCount;return x(as(as({},E),{},{columnIndex:y+N,parent:l,rowIndex:_+O}))}),Et(l,"_cellRendererTopRightGrid",function(m){var y=m.columnIndex,_=x4(m,Lst),E=l.props,C=E.cellRenderer,x=E.columnCount,N=E.fixedColumnCount;return y===x-N?k.createElement("div",{key:_.key,style:as(as({},_.style),{},{width:ime})}):C(as(as({},_),{},{columnIndex:y+N,parent:l}))}),Et(l,"_columnWidthRightGrid",function(m){var y=m.index,_=l.props,E=_.columnCount,C=_.fixedColumnCount,x=_.columnWidth,N=l.state,O=N.scrollbarSize,D=N.showHorizontalScrollbar;return D&&y===E-C?O:typeof x=="function"?x({index:y+C}):x}),Et(l,"_onScroll",function(m){var y=m.scrollLeft,_=m.scrollTop;l.setState({scrollLeft:y,scrollTop:_});var E=l.props.onScroll;E&&E(m)}),Et(l,"_onScrollbarPresenceChange",function(m){var y=m.horizontal,_=m.size,E=m.vertical,C=l.state,x=C.showHorizontalScrollbar,N=C.showVerticalScrollbar;if(y!==x||E!==N){l.setState({scrollbarSize:_,showHorizontalScrollbar:y,showVerticalScrollbar:E});var O=l.props.onScrollbarPresenceChange;typeof O=="function"&&O({horizontal:y,size:_,vertical:E})}}),Et(l,"_onScrollLeft",function(m){var y=m.scrollLeft;l._onScroll({scrollLeft:y,scrollTop:l.state.scrollTop})}),Et(l,"_onScrollTop",function(m){var y=m.scrollTop;l._onScroll({scrollTop:y,scrollLeft:l.state.scrollLeft})}),Et(l,"_rowHeightBottomGrid",function(m){var y=m.index,_=l.props,E=_.fixedRowCount,C=_.rowCount,x=_.rowHeight,N=l.state,O=N.scrollbarSize,D=N.showVerticalScrollbar;return D&&y===C-E?O:typeof x=="function"?x({index:y+E}):x}),Et(l,"_topLeftGridRef",function(m){l._topLeftGrid=m}),Et(l,"_topRightGridRef",function(m){l._topRightGrid=m});var d=i.deferredMeasurementCache,u=i.fixedColumnCount,p=i.fixedRowCount;return l._maybeCalculateCachedStyles(!0),d&&(l._deferredMeasurementCacheBottomLeftGrid=p>0?new QK({cellMeasurerCache:d,columnIndexOffset:0,rowIndexOffset:p}):d,l._deferredMeasurementCacheBottomRightGrid=u>0||p>0?new QK({cellMeasurerCache:d,columnIndexOffset:u,rowIndexOffset:p}):d,l._deferredMeasurementCacheTopRightGrid=u>0?new QK({cellMeasurerCache:d,columnIndexOffset:u,rowIndexOffset:0}):d),l}return yc(t,n),ba(t,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u;this._deferredInvalidateColumnIndex=typeof this._deferredInvalidateColumnIndex=="number"?Math.min(this._deferredInvalidateColumnIndex,d):d,this._deferredInvalidateRowIndex=typeof this._deferredInvalidateRowIndex=="number"?Math.min(this._deferredInvalidateRowIndex,p):p}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u,m=this.props,y=m.fixedColumnCount,_=m.fixedRowCount,E=Math.max(0,d-y),C=Math.max(0,p-_);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:d,rowIndex:C}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:E,rowIndex:C}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:d,rowIndex:p}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:E,rowIndex:p}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(!0)}},{key:"componentDidMount",value:function(){var s=this.props,l=s.scrollLeft,d=s.scrollTop;if(l>0||d>0){var u={};l>0&&(u.scrollLeft=l),d>0&&(u.scrollTop=d),this.setState(u)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"render",value:function(){var s=this.props,l=s.onScroll,d=s.onSectionRendered;s.onScrollbarPresenceChange,s.scrollLeft;var u=s.scrollToColumn;s.scrollTop;var p=s.scrollToRow,m=x4(s,Dst);if(this._prepareForRender(),this.props.width===0||this.props.height===0)return null;var y=this.state,_=y.scrollLeft,E=y.scrollTop;return k.createElement("div",{style:this._containerOuterStyle},k.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(m),this._renderTopRightGrid(as(as({},m),{},{onScroll:l,scrollLeft:_}))),k.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid(as(as({},m),{},{onScroll:l,scrollTop:E})),this._renderBottomRightGrid(as(as({},m),{},{onScroll:l,onSectionRendered:d,scrollLeft:_,scrollToColumn:u,scrollToRow:p,scrollTop:E}))))}},{key:"_getBottomGridHeight",value:function(s){var l=s.height,d=this._getTopGridHeight(s);return l-d}},{key:"_getLeftGridWidth",value:function(s){var l=s.fixedColumnCount,d=s.columnWidth;if(this._leftGridWidth==null)if(typeof d=="function"){for(var u=0,p=0;p<l;p++)u+=d({index:p});this._leftGridWidth=u}else this._leftGridWidth=d*l;return this._leftGridWidth}},{key:"_getRightGridWidth",value:function(s){var l=s.width,d=this._getLeftGridWidth(s);return l-d}},{key:"_getTopGridHeight",value:function(s){var l=s.fixedRowCount,d=s.rowHeight;if(this._topGridHeight==null)if(typeof d=="function"){for(var u=0,p=0;p<l;p++)u+=d({index:p});this._topGridHeight=u}else this._topGridHeight=d*l;return this._topGridHeight}},{key:"_handleInvalidatedGridSize",value:function(){if(typeof this._deferredInvalidateColumnIndex=="number"){var s=this._deferredInvalidateColumnIndex,l=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:s,rowIndex:l}),this.forceUpdate()}}},{key:"_maybeCalculateCachedStyles",value:function(s){var l=this.props,d=l.columnWidth,u=l.enableFixedColumnScroll,p=l.enableFixedRowScroll,m=l.height,y=l.fixedColumnCount,_=l.fixedRowCount,E=l.rowHeight,C=l.style,x=l.styleBottomLeftGrid,N=l.styleBottomRightGrid,O=l.styleTopLeftGrid,D=l.styleTopRightGrid,P=l.width,j=s||m!==this._lastRenderedHeight||P!==this._lastRenderedWidth,M=s||d!==this._lastRenderedColumnWidth||y!==this._lastRenderedFixedColumnCount,V=s||_!==this._lastRenderedFixedRowCount||E!==this._lastRenderedRowHeight;(s||j||C!==this._lastRenderedStyle)&&(this._containerOuterStyle=as({height:m,overflow:"visible",width:P},C)),(s||j||V)&&(this._containerTopStyle={height:this._getTopGridHeight(this.props),position:"relative",width:P},this._containerBottomStyle={height:m-this._getTopGridHeight(this.props),overflow:"visible",position:"relative",width:P}),(s||x!==this._lastRenderedStyleBottomLeftGrid)&&(this._bottomLeftGridStyle=as({left:0,overflowX:"hidden",overflowY:u?"auto":"hidden",position:"absolute"},x)),(s||M||N!==this._lastRenderedStyleBottomRightGrid)&&(this._bottomRightGridStyle=as({left:this._getLeftGridWidth(this.props),position:"absolute"},N)),(s||O!==this._lastRenderedStyleTopLeftGrid)&&(this._topLeftGridStyle=as({left:0,overflowX:"hidden",overflowY:"hidden",position:"absolute",top:0},O)),(s||M||D!==this._lastRenderedStyleTopRightGrid)&&(this._topRightGridStyle=as({left:this._getLeftGridWidth(this.props),overflowX:p?"auto":"hidden",overflowY:"hidden",position:"absolute",top:0},D)),this._lastRenderedColumnWidth=d,this._lastRenderedFixedColumnCount=y,this._lastRenderedFixedRowCount=_,this._lastRenderedHeight=m,this._lastRenderedRowHeight=E,this._lastRenderedStyle=C,this._lastRenderedStyleBottomLeftGrid=x,this._lastRenderedStyleBottomRightGrid=N,this._lastRenderedStyleTopLeftGrid=O,this._lastRenderedStyleTopRightGrid=D,this._lastRenderedWidth=P}},{key:"_prepareForRender",value:function(){(this._lastRenderedColumnWidth!==this.props.columnWidth||this._lastRenderedFixedColumnCount!==this.props.fixedColumnCount)&&(this._leftGridWidth=null),(this._lastRenderedFixedRowCount!==this.props.fixedRowCount||this._lastRenderedRowHeight!==this.props.rowHeight)&&(this._topGridHeight=null),this._maybeCalculateCachedStyles(),this._lastRenderedColumnWidth=this.props.columnWidth,this._lastRenderedFixedColumnCount=this.props.fixedColumnCount,this._lastRenderedFixedRowCount=this.props.fixedRowCount,this._lastRenderedRowHeight=this.props.rowHeight}},{key:"_renderBottomLeftGrid",value:function(s){var l=s.enableFixedColumnScroll,d=s.fixedColumnCount,u=s.fixedRowCount,p=s.rowCount,m=s.hideBottomLeftGridScrollbar,y=this.state.showVerticalScrollbar;if(!d)return null;var _=y?1:0,E=this._getBottomGridHeight(s),C=this._getLeftGridWidth(s),x=this.state.showVerticalScrollbar?this.state.scrollbarSize:0,N=m?C+x:C,O=k.createElement(kv,Qd({},s,{cellRenderer:this._cellRendererBottomLeftGrid,className:this.props.classNameBottomLeftGrid,columnCount:d,deferredMeasurementCache:this._deferredMeasurementCacheBottomLeftGrid,height:E,onScroll:l?this._onScrollTop:void 0,ref:this._bottomLeftGridRef,rowCount:Math.max(0,p-u)+_,rowHeight:this._rowHeightBottomGrid,style:this._bottomLeftGridStyle,tabIndex:null,width:N}));return m?k.createElement("div",{className:"BottomLeftGrid_ScrollWrapper",style:as(as({},this._bottomLeftGridStyle),{},{height:E,width:C,overflowY:"hidden"})},O):O}},{key:"_renderBottomRightGrid",value:function(s){var l=s.columnCount,d=s.fixedColumnCount,u=s.fixedRowCount,p=s.rowCount,m=s.scrollToColumn,y=s.scrollToRow;return k.createElement(kv,Qd({},s,{cellRenderer:this._cellRendererBottomRightGrid,className:this.props.classNameBottomRightGrid,columnCount:Math.max(0,l-d),columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheBottomRightGrid,height:this._getBottomGridHeight(s),onScroll:this._onScroll,onScrollbarPresenceChange:this._onScrollbarPresenceChange,ref:this._bottomRightGridRef,rowCount:Math.max(0,p-u),rowHeight:this._rowHeightBottomGrid,scrollToColumn:m-d,scrollToRow:y-u,style:this._bottomRightGridStyle,width:this._getRightGridWidth(s)}))}},{key:"_renderTopLeftGrid",value:function(s){var l=s.fixedColumnCount,d=s.fixedRowCount;return!l||!d?null:k.createElement(kv,Qd({},s,{className:this.props.classNameTopLeftGrid,columnCount:l,height:this._getTopGridHeight(s),ref:this._topLeftGridRef,rowCount:d,style:this._topLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(s)}))}},{key:"_renderTopRightGrid",value:function(s){var l=s.columnCount,d=s.enableFixedRowScroll,u=s.fixedColumnCount,p=s.fixedRowCount,m=s.scrollLeft,y=s.hideTopRightGridScrollbar,_=this.state,E=_.showHorizontalScrollbar,C=_.scrollbarSize;if(!p)return null;var x=E?1:0,N=this._getTopGridHeight(s),O=this._getRightGridWidth(s),D=E?C:0,P=N,j=this._topRightGridStyle;y&&(P=N+D,j=as(as({},this._topRightGridStyle),{},{left:0}));var M=k.createElement(kv,Qd({},s,{cellRenderer:this._cellRendererTopRightGrid,className:this.props.classNameTopRightGrid,columnCount:Math.max(0,l-u)+x,columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheTopRightGrid,height:P,onScroll:d?this._onScrollLeft:void 0,ref:this._topRightGridRef,rowCount:p,scrollLeft:m,style:j,tabIndex:null,width:O}));return y?k.createElement("div",{className:"TopRightGrid_ScrollWrapper",style:as(as({},this._topRightGridStyle),{},{height:N,width:O,overflowX:"hidden"})},M):M}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.scrollLeft!==l.scrollLeft||s.scrollTop!==l.scrollTop?{scrollLeft:s.scrollLeft!=null&&s.scrollLeft>=0?s.scrollLeft:l.scrollLeft,scrollTop:s.scrollTop!=null&&s.scrollTop>=0?s.scrollTop:l.scrollTop}:null}}])}(k.PureComponent);Et(See,"defaultProps",{classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{},hideTopRightGridScrollbar:!1,hideBottomLeftGridScrollbar:!1});See.propTypes={};gP(See);function Mst(n,t,i){return t=Cr(t),vc(n,Fbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Fbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fbe=function(){return!!n})()}var jst=function(n){function t(i,s){var l;return Sa(this,t),l=Mst(this,t,[i,s]),l.state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},l._onScroll=l._onScroll.bind(l),l}return yc(t,n),ba(t,[{key:"render",value:function(){var s=this.props.children,l=this.state,d=l.clientHeight,u=l.clientWidth,p=l.scrollHeight,m=l.scrollLeft,y=l.scrollTop,_=l.scrollWidth;return s({clientHeight:d,clientWidth:u,onScroll:this._onScroll,scrollHeight:p,scrollLeft:m,scrollTop:y,scrollWidth:_})}},{key:"_onScroll",value:function(s){var l=s.clientHeight,d=s.clientWidth,u=s.scrollHeight,p=s.scrollLeft,m=s.scrollTop,y=s.scrollWidth;this.setState({clientHeight:l,clientWidth:d,scrollHeight:u,scrollLeft:p,scrollTop:m,scrollWidth:y})}}])}(k.PureComponent);jst.propTypes={};function Ust(n){var t=n.dataKey,i=n.rowData;return typeof i.get=="function"?i.get(t):i[t]}function Fst(n){var t=n.cellData;return t==null?"":String(t)}function Bst(n){var t=n.className,i=n.columns,s=n.style;return k.createElement("div",{className:t,role:"row",style:s},i)}var Mv={ASC:"ASC",DESC:"DESC"};function Bbe(n){var t=n.sortDirection,i=pf("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":t===Mv.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":t===Mv.DESC});return k.createElement("svg",{className:i,width:18,height:18,viewBox:"0 0 24 24"},t===Mv.ASC?k.createElement("path",{d:"M7 14l5-5 5 5z"}):k.createElement("path",{d:"M7 10l5 5 5-5z"}),k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}Bbe.propTypes={};function Vst(n){var t=n.dataKey,i=n.label,s=n.sortBy,l=n.sortDirection,d=s===t,u=[k.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:typeof i=="string"?i:null},i)];return d&&u.push(k.createElement(Bbe,{key:"SortIndicator",sortDirection:l})),u}function zst(n){var t=n.className,i=n.columns,s=n.index,l=n.key,d=n.onRowClick,u=n.onRowDoubleClick,p=n.onRowMouseOut,m=n.onRowMouseOver,y=n.onRowRightClick,_=n.rowData,E=n.style,C={"aria-rowindex":s+1};return(d||u||p||m||y)&&(C["aria-label"]="row",C.tabIndex=0,d&&(C.onClick=function(x){return d({event:x,index:s,rowData:_})}),u&&(C.onDoubleClick=function(x){return u({event:x,index:s,rowData:_})}),p&&(C.onMouseOut=function(x){return p({event:x,index:s,rowData:_})}),m&&(C.onMouseOver=function(x){return m({event:x,index:s,rowData:_})}),y&&(C.onContextMenu=function(x){return y({event:x,index:s,rowData:_})})),k.createElement("div",Qd({},C,{className:t,key:l,role:"row",style:E}),i)}function Hst(n,t,i){return t=Cr(t),vc(n,Vbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Vbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Vbe=function(){return!!n})()}var bee=function(n){function t(){return Sa(this,t),Hst(this,t,arguments)}return yc(t,n),ba(t)}(k.Component);Et(bee,"defaultProps",{cellDataGetter:Ust,cellRenderer:Fst,defaultSortDirection:Mv.ASC,flexGrow:0,flexShrink:1,headerRenderer:Vst,style:{}});bee.propTypes={};function rme(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function op(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?rme(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):rme(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function Gst(n,t,i){return t=Cr(t),vc(n,zbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function zbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zbe=function(){return!!n})()}var Hbe=function(n){function t(i){var s;return Sa(this,t),s=Gst(this,t,[i]),s.state={scrollbarWidth:0},s._createColumn=s._createColumn.bind(s),s._createRow=s._createRow.bind(s),s._onScroll=s._onScroll.bind(s),s._onSectionRendered=s._onSectionRendered.bind(s),s._setRef=s._setRef.bind(s),s._setGridElementRef=s._setGridElementRef.bind(s),s}return yc(t,n),ba(t,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(s){var l=s.alignment,d=s.index;if(this.Grid){var u=this.Grid.getOffsetForCell({alignment:l,rowIndex:d}),p=u.scrollTop;return p}return 0}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.columnIndex,d=s.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:d,columnIndex:l})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u;this.Grid&&this.Grid.recomputeGridSize({rowIndex:p,columnIndex:d})}},{key:"recomputeRowHeights",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:s})}},{key:"scrollToPosition",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:s})}},{key:"scrollToRow",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:s})}},{key:"getScrollbarWidth",value:function(){if(this.GridElement){var s=this.GridElement,l=s.clientWidth||0,d=s.offsetWidth||0;return d-l}return 0}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var s=this,l=this.props,d=l.children,u=l.className,p=l.disableHeader,m=l.gridClassName,y=l.gridStyle,_=l.headerHeight,E=l.headerRowRenderer,C=l.height,x=l.id,N=l.noRowsRenderer,O=l.rowClassName,D=l.rowStyle,P=l.scrollToIndex,j=l.style,M=l.width,V=this.state.scrollbarWidth,G=p?C:C-_,$=typeof O=="function"?O({index:-1}):O,ne=typeof D=="function"?D({index:-1}):D;return this._cachedColumnStyles=[],k.Children.toArray(d).forEach(function(Y,le){var re=s._getFlexStyleForColumn(Y,Y.props.style||bee.defaultProps.style);s._cachedColumnStyles[le]=op({overflow:"hidden"},re)}),k.createElement("div",{"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-colcount":k.Children.toArray(d).length,"aria-rowcount":this.props.rowCount,className:pf("ReactVirtualized__Table",u),id:x,role:"grid",style:j},!p&&E({className:pf("ReactVirtualized__Table__headerRow",$),columns:this._getHeaderColumns(),style:op({height:_,overflow:"hidden",paddingRight:V,width:M},ne)}),k.createElement(kv,Qd({},this.props,{elementRef:this._setGridElementRef,"aria-readonly":null,autoContainerWidth:!0,className:pf("ReactVirtualized__Table__Grid",m),cellRenderer:this._createRow,columnWidth:M,columnCount:1,height:G,id:void 0,noContentRenderer:N,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:V,scrollToRow:P,style:op(op({},y),{},{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(s){var l=s.column,d=s.columnIndex,u=s.isScrolling,p=s.parent,m=s.rowData,y=s.rowIndex,_=this.props.onColumnClick,E=l.props,C=E.cellDataGetter,x=E.cellRenderer,N=E.className,O=E.columnData,D=E.dataKey,P=E.id,j=C({columnData:O,dataKey:D,rowData:m}),M=x({cellData:j,columnData:O,columnIndex:d,dataKey:D,isScrolling:u,parent:p,rowData:m,rowIndex:y}),V=function(Y){_&&_({columnData:O,dataKey:D,event:Y})},G=this._cachedColumnStyles[d],$=typeof M=="string"?M:null;return k.createElement("div",{"aria-colindex":d+1,"aria-describedby":P,className:pf("ReactVirtualized__Table__rowColumn",N),key:"Row"+y+"-Col"+d,onClick:V,role:"gridcell",style:G,title:$},M)}},{key:"_createHeader",value:function(s){var l=s.column,d=s.index,u=this.props,p=u.headerClassName,m=u.headerStyle,y=u.onHeaderClick,_=u.sort,E=u.sortBy,C=u.sortDirection,x=l.props,N=x.columnData,O=x.dataKey,D=x.defaultSortDirection,P=x.disableSort,j=x.headerRenderer,M=x.id,V=x.label,G=!P&&_,$=pf("ReactVirtualized__Table__headerColumn",p,l.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:G}),ne=this._getFlexStyleForColumn(l,op(op({},m),l.props.headerStyle)),Y=j({columnData:N,dataKey:O,disableSort:P,label:V,sortBy:E,sortDirection:C}),le,re,ee,de,H;if(G||y){var ae=E!==O,_e=ae?D:C===Mv.DESC?Mv.ASC:Mv.DESC,me=function(pe){G&&_({defaultSortDirection:D,event:pe,sortBy:O,sortDirection:_e}),y&&y({columnData:N,dataKey:O,event:pe})},Ce=function(pe){(pe.key==="Enter"||pe.key===" ")&&me(pe)};H=l.props["aria-label"]||V||O,de="none",ee=0,le=me,re=Ce}return E===O&&(de=C===Mv.ASC?"ascending":"descending"),k.createElement("div",{"aria-label":H,"aria-sort":de,className:$,id:M,key:"Header-Col"+d,onClick:le,onKeyDown:re,role:"columnheader",style:ne,tabIndex:ee},Y)}},{key:"_createRow",value:function(s){var l=this,d=s.rowIndex,u=s.isScrolling,p=s.key,m=s.parent,y=s.style,_=this.props,E=_.children,C=_.onRowClick,x=_.onRowDoubleClick,N=_.onRowRightClick,O=_.onRowMouseOver,D=_.onRowMouseOut,P=_.rowClassName,j=_.rowGetter,M=_.rowRenderer,V=_.rowStyle,G=this.state.scrollbarWidth,$=typeof P=="function"?P({index:d}):P,ne=typeof V=="function"?V({index:d}):V,Y=j({index:d}),le=k.Children.toArray(E).map(function(de,H){return l._createColumn({column:de,columnIndex:H,isScrolling:u,parent:m,rowData:Y,rowIndex:d,scrollbarWidth:G})}),re=pf("ReactVirtualized__Table__row",$),ee=op(op({},y),{},{height:this._getRowHeight(d),overflow:"hidden",paddingRight:G},ne);return M({className:re,columns:le,index:d,isScrolling:u,key:p,onRowClick:C,onRowDoubleClick:x,onRowRightClick:N,onRowMouseOver:O,onRowMouseOut:D,rowData:Y,style:ee})}},{key:"_getFlexStyleForColumn",value:function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d="".concat(s.props.flexGrow," ").concat(s.props.flexShrink," ").concat(s.props.width,"px"),u=op(op({},l),{},{flex:d,msFlex:d,WebkitFlex:d});return s.props.maxWidth&&(u.maxWidth=s.props.maxWidth),s.props.minWidth&&(u.minWidth=s.props.minWidth),u}},{key:"_getHeaderColumns",value:function(){var s=this,l=this.props,d=l.children,u=l.disableHeader,p=u?[]:k.Children.toArray(d);return p.map(function(m,y){return s._createHeader({column:m,index:y})})}},{key:"_getRowHeight",value:function(s){var l=this.props.rowHeight;return typeof l=="function"?l({index:s}):l}},{key:"_onScroll",value:function(s){var l=s.clientHeight,d=s.scrollHeight,u=s.scrollTop,p=this.props.onScroll;p({clientHeight:l,scrollHeight:d,scrollTop:u})}},{key:"_onSectionRendered",value:function(s){var l=s.rowOverscanStartIndex,d=s.rowOverscanStopIndex,u=s.rowStartIndex,p=s.rowStopIndex,m=this.props.onRowsRendered;m({overscanStartIndex:l,overscanStopIndex:d,startIndex:u,stopIndex:p})}},{key:"_setRef",value:function(s){this.Grid=s}},{key:"_setGridElementRef",value:function(s){this.GridElement=s}},{key:"_setScrollbarWidth",value:function(){var s=this.getScrollbarWidth();this.setState({scrollbarWidth:s})}}])}(k.PureComponent);Et(Hbe,"defaultProps",{disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:xbe,overscanRowCount:10,rowRenderer:zst,headerRowRenderer:Bst,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}});Hbe.propTypes={};var qv=[],z4=null,U2=null;function Gbe(){U2&&(U2=null,document.body&&z4!=null&&(document.body.style.pointerEvents=z4),z4=null)}function Wst(){Gbe(),qv.forEach(function(n){return n.__resetIsScrolling()})}function $st(){U2&&dx(U2);var n=0;qv.forEach(function(t){n=Math.max(n,t.props.scrollingResetTimeInterval)}),U2=yee(Wst,n)}function Wbe(n){n.currentTarget===window&&z4==null&&document.body&&(z4=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),$st(),qv.forEach(function(t){t.props.scrollElement===n.currentTarget&&t.__handleWindowScrollEvent()})}function sme(n,t){qv.some(function(i){return i.props.scrollElement===t})||t.addEventListener("scroll",Wbe),qv.push(n)}function ame(n,t){qv=qv.filter(function(i){return i!==n}),qv.length||(t.removeEventListener("scroll",Wbe),U2&&(dx(U2),Gbe()))}var Cee=function(t){return t===window},A4=function(t){return t.getBoundingClientRect()};function ome(n,t){if(n)if(Cee(n)){var i=window,s=i.innerHeight,l=i.innerWidth;return{height:typeof s=="number"?s:0,width:typeof l=="number"?l:0}}else return A4(n);else return{height:t.serverHeight,width:t.serverWidth}}function Kst(n,t){if(Cee(t)&&document.documentElement){var i=document.documentElement,s=A4(n),l=A4(i);return{top:s.top-l.top,left:s.left-l.left}}else{var d=$be(t),u=A4(n),p=A4(t);return{top:u.top+d.top-p.top,left:u.left+d.left-p.left}}}function $be(n){return Cee(n)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:n.scrollTop,left:n.scrollLeft}}function lme(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function cme(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?lme(Object(i),!0).forEach(function(s){Et(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):lme(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function qst(n,t,i){return t=Cr(t),vc(n,Kbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function Kbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kbe=function(){return!!n})()}var Yst=150,qbe=function(){return typeof window<"u"?window:void 0},Xst=function(n){function t(){var i;Sa(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=qst(this,t,[].concat(l)),Et(i,"_window",qbe()),Et(i,"_isMounted",!1),Et(i,"_positionFromTop",0),Et(i,"_positionFromLeft",0),Et(i,"_detectElementResize",void 0),Et(i,"_child",void 0),Et(i,"_windowScrollerRef",k.createRef()),Et(i,"state",cme(cme({},ome(i.props.scrollElement,i.props)),{},{isScrolling:!1,scrollLeft:0,scrollTop:0})),Et(i,"_registerChild",function(u){u&&!(u instanceof Element)&&console.warn("WindowScroller registerChild expects to be passed Element or null"),i._child=u,i.updatePosition()}),Et(i,"_onChildScroll",function(u){var p=u.scrollTop;if(i.state.scrollTop!==p){var m=i.props.scrollElement;m&&(typeof m.scrollTo=="function"?m.scrollTo(0,p+i._positionFromTop):m.scrollTop=p+i._positionFromTop)}}),Et(i,"_registerResizeListener",function(u){u===window?window.addEventListener("resize",i._onResize,!1):i._detectElementResize.addResizeListener(u,i._onResize)}),Et(i,"_unregisterResizeListener",function(u){u===window?window.removeEventListener("resize",i._onResize,!1):u&&i._detectElementResize.removeResizeListener(u,i._onResize)}),Et(i,"_onResize",function(){i.updatePosition()}),Et(i,"__handleWindowScrollEvent",function(){if(i._isMounted){var u=i.props.onScroll,p=i.props.scrollElement;if(p){var m=$be(p),y=Math.max(0,m.left-i._positionFromLeft),_=Math.max(0,m.top-i._positionFromTop);i.setState({isScrolling:!0,scrollLeft:y,scrollTop:_}),u({scrollLeft:y,scrollTop:_})}}}),Et(i,"__resetIsScrolling",function(){i.setState({isScrolling:!1})}),i}return yc(t,n),ba(t,[{key:"updatePosition",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollElement,l=this.props.onResize,d=this.state,u=d.height,p=d.width,m=this._child||this._windowScrollerRef.current;if(m instanceof Element&&s){var y=Kst(m,s);this._positionFromTop=y.top,this._positionFromLeft=y.left}var _=ome(s,this.props);(u!==_.height||p!==_.width)&&(this.setState({height:_.height,width:_.width}),l({height:_.height,width:_.width})),this.props.updateScrollTopOnUpdatePosition===!0&&(this.__handleWindowScrollEvent(),this.__resetIsScrolling())}},{key:"componentDidMount",value:function(){var s=this.props.scrollElement;this._detectElementResize=ybe(),this.updatePosition(s),s&&(sme(this,s),this._registerResizeListener(s)),this._isMounted=!0}},{key:"componentDidUpdate",value:function(s,l){var d=this.props.scrollElement,u=s.scrollElement;u!==d&&u!=null&&d!=null&&(this.updatePosition(d),ame(this,u),sme(this,d),this._unregisterResizeListener(u),this._registerResizeListener(d))}},{key:"componentWillUnmount",value:function(){var s=this.props.scrollElement;s&&(ame(this,s),this._unregisterResizeListener(s)),this._isMounted=!1}},{key:"render",value:function(){var s=this.props.children,l=this.state,d=l.isScrolling,u=l.scrollTop,p=l.scrollLeft,m=l.height,y=l.width;return k.createElement("div",{ref:this._windowScrollerRef},s({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:m,isScrolling:d,scrollLeft:p,scrollTop:u,width:y}))}}])}(k.PureComponent);Et(Xst,"defaultProps",{onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:Yst,scrollElement:qbe(),serverHeight:0,serverWidth:0});function Jst(){var Ue,Ve;const n=ji(),t=JSON.parse(Ai.getAuthUser()),i=["name","designation"],s="appreciation",[l,d]=k.useState(0),[u,p]=k.useState([]),[m,y]=k.useState([]),[_,E]=k.useState([]),[C,x]=k.useState(""),[N,O]=k.useState(""),[D,P]=k.useState(""),[j,M]=k.useState(!1),V=async({queryKey:Re})=>{var we,We;const[Be,Xe]=Re;try{const st=await ps.getAllRecipients(Xe);if(st.data.status==="success"){const pt=((We=(we=st.data)==null?void 0:we.data)==null?void 0:We.recipients)||[],Qe=new Set;return pt.filter(St=>Qe.has(St.id)?!1:(Qe.add(St.id),!0))}return[]}catch{throw new Error("Error fetching all recipients")}};async function G(){var Re,Be;try{const Xe=await CN.getAppreciationCreationHelpers();return Xe.data.status==="success"?{images:(Re=Xe.data)==null?void 0:Re.data.images,reasons:(Be=Xe.data)==null?void 0:Be.data.reasons}:null}catch{throw new Error("Error fetching appreciation creation helpers")}}const{isPending:$,isError:ne,data:Y,error:le}=ru({queryKey:["appreciationRecipients",s],queryFn:V}),{data:re}=ru({queryKey:["appreciationCreationHelpers"],queryFn:G}),ee=k.useMemo(()=>pP(Y,C,i),[Y,C]),de=(Re,Be="single")=>{p(Be==="single"?[Re]:Xe=>Xe.some(we=>we.id===Re.id)?Xe.filter(we=>we.id!==Re.id):[...Xe,Re])},H=(Re,Be="single")=>{y(Be==="single"?[Re]:Xe=>Xe.some(we=>we.id===Re.id)?Xe.filter(we=>we.id!==Re.id):[...Xe,Re])},ae=(Re,Be="single")=>{E(Be==="single"?[Re]:Xe=>Xe.some(we=>we.id===Re.id)?Xe.filter(we=>we.id!==Re.id):[...Xe,Re])},_e=({index:Re,key:Be,style:Xe})=>{const we=ee[Re];return h.jsx("div",{style:Xe,children:h.jsx($C,{item:we,className:`user-card ${u.some(We=>We.id===we.id)?"selected":""} ${ee.length!==Re+1?"border-bottom":""}`,type:"single",title:we!=null&&we.firstname?Jv(we==null?void 0:we.firstname,we==null?void 0:we.lastname):we==null?void 0:we.name,subTitle:we==null?void 0:we.designation,iconImg:we==null?void 0:we.avatar,isRoundedIcon:!0,handleItemSelect:de})},Be)},me=()=>u.length===0?(Qt("Users not selected!","error"),!1):!0,Ce=()=>(m==null?void 0:m.length)===0?(Qt("Reason not selected!","error"),!1):m.some(Re=>Re.id==="other")&&N===""?(Qt("Own Reason is empty!","error"),!1):!0,he=()=>!_&&(_==null?void 0:_.length)===0?(Qt("Graphics not selected!","error"),!1):!0;function pe(Re){d(Number(Re))}const Oe=()=>{l===0&&me()?d(1):l===1&&Ce()?d(2):l===2&&he()&&Fe()};async function Fe(){var pt;console.log("## Inside handleSubmit ##"),M(!0);const Re=u[0],Be=m[0];console.log("selectedReason = ",Be);const Xe={};if(Be!=null&&Be.id&&((Be==null?void 0:Be.id)==="other"?(Xe.reason=N,Xe.points=0,Xe.icon="/img/default-profile.jpg"):(Xe.reason=Be==null?void 0:Be.reason,Xe.points=Be==null?void 0:Be.points,Xe.icon=Be==null?void 0:Be.icon)),!_&&!_.length>0){Qt("Graphics not selected!","error");return}const we=(pt=_[0])==null?void 0:pt.image,We=`${t.name} appreciated ${Re==null?void 0:Re.firstname} ${Re==null?void 0:Re.lastname}`,st={receiver_id:Re==null?void 0:Re.id,receiver_info:Re,title:We,reason:Xe==null?void 0:Xe.reason,icon:Xe==null?void 0:Xe.icon,image:we,points:Xe==null?void 0:Xe.points,message:D};CN.sendAppreciation(st).then(Qe=>{console.log("sendAppreciation response result = ",Qe.data),Qe.data.status==="success"&&(M(!1),Qt("Appreciation sent successfully!","success"),n("/appreciations",{state:{data:"sent"}}))}).catch(Qe=>{console.log(Qe),Qt("Failed to Send Appreciation!","error")}).finally(()=>{M(!1)})}return $?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(ci,{type:"details"})})}):ne?h.jsx(To,{className:"mt-5",children:le.message}):h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx("div",{className:"send-appreciation-page",children:h.jsxs($U,{activeKey:l,onSelect:pe,id:"stepper-tabs",children:[h.jsxs(Zn,{eventKey:0,title:"Step 1",unmountOnExit:!0,children:[h.jsxs("div",{className:"py-0 pt-2 sticky-top",style:{top:"var(--navbar-height)",padding:"0 0rem",background:"var(--color-body-bg-light)"},children:[h.jsxs(To,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to appreciate?"]}),h.jsxs("div",{className:"py-1 pb-0",children:[h.jsx(CP,{filters:i,onSearch:Re=>x(Re),className:"mb-"}),(ee==null?void 0:ee.length)>0&&(C==null?void 0:C.length)>0&&h.jsx(To,{size:"sm",className:"px-1 text-gray9",children:`Results found ${ee==null?void 0:ee.length}`})]}),h.jsx("div",{className:"px-1 d-block mb-1",children:h.jsx(vee,{items:u,className:"",type:"single",handleRemoveItems:de})})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{height:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:h.jsx(UF,{children:({height:Re,width:Be})=>h.jsx(BF,{width:Be,height:Re,rowHeight:60,rowCount:ee.length,rowRenderer:_e})})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Oe,children:"Next"},"step2_handler")})]})})]}),h.jsx(Zn,{eventKey:1,title:"Step 2",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsxs(To,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select appreciation reason"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:h.jsxs(h.Fragment,{children:[((Ue=re==null?void 0:re.reasons)==null?void 0:Ue.length)>0&&(re==null?void 0:re.reasons.map(Re=>h.jsx(h.Fragment,{children:h.jsx($C,{item:Re,className:`user-card ${m.some(Be=>Be.id===(Re==null?void 0:Re.id))?"selected":""}`,type:"single",title:Re==null?void 0:Re.reason,subTitle:"",iconImg:Re==null?void 0:Re.icon,isRoundedIcon:!1,handleItemSelect:H},Re==null?void 0:Re.id)}))),h.jsx($C,{item:{id:"other"},className:`user-card ${m.some(Re=>Re.id==="other")?"selected":""}`,type:"single",title:"Write your own",subTitle:"",iconImg:"/img/default-profile.jpg",isRoundedIcon:!1,handleItemSelect:H},"other")]})}),m.some(Re=>Re.id==="other")&&h.jsx(h.Fragment,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-3",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Write your own reason"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},value:N,onChange:Re=>O(Re.target.value),placeholder:"",name:"own_reason",autoComplete:"off"})]})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>d(0),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Oe,children:"Next"},"step3_handler")})]})})]})}),h.jsx(Zn,{eventKey:2,title:"Step 3",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsx(To,{size:"",className:"mb-1",children:"Choose a graphic and write a personalised message"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Personal Note (optional)"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},value:D,onChange:Re=>P(Re.target.value),placeholder:"",name:"message",autoComplete:"off"})]}),h.jsxs("div",{className:"pt-2",children:[h.jsxs(To,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Choose a graphic"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto"},children:h.jsx(fn,{className:"row-cols-3 g-2",children:(Ve=re==null?void 0:re.images)==null?void 0:Ve.map(Re=>h.jsx(Gt,{children:h.jsx(grt,{item:Re,className:`${_.some(Be=>Be.id===Re.id)?"selected":""}`,type:"single",title:Re==null?void 0:Re.id,subTitle:"",iconImg:Re==null?void 0:Re.image,handleImageSelect:ae})},Re.id))})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>d(1),children:"Prev"},"prev_step2_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Lt,{type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Oe,children:j?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):"Submit"})})})]})})]})})]})})})})})}function H4({className:n,type:t,item:i,name:s,title:l,subTitle:d,id:u,iconImg:p,isDisabled:m,isChecked:y,handleChange:_,selectedUserList:E,setSelectedUserList:C}){const x=n||"",N=t||"radio",O=p||((i==null?void 0:i.type)==="group"?"/img/groups-icon.png":"/img/user-profile.jpg"),D=l||"Guest User",P=d||"",j={};m?j.disabled=!0:j.disabled=!1;function M(V){console.log(V.target),console.log(JSON.stringify(V.target.value)),_(V),C&&C(G=>[{id:V.target.value,name:D,image:O}])}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`card-theme border-0 rounded-1 custom-radio-list-btn-card card-md ${x}`,children:[h.jsx("input",{type:N,id:u,name:s,value:i.id,onChange:M,...j,checked:y||!1}),h.jsx("label",{htmlFor:u,children:h.jsxs(et.Body,{className:"position-relative rounded-1",children:[h.jsx("div",{className:"d-flex profile-info-container align-items-center",children:h.jsxs("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex align-items-center",children:[h.jsx("div",{className:"media-icon-wrapper flex-shrink-0",children:h.jsx(Ts,{src:O,alt:`${D} image`,className:"img-fluid"})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container d-flex flex-wrap",children:[h.jsx("span",{className:"welcome-user fw-n",style:{maxWidth:"90%"},children:`${D} `}),h.jsx("div",{className:"d-block w-100 font-13 text-gray6",children:vx(P)})]})]})}),h.jsx(tn,{tag:"circle1",className:"font-20 position-absolute radio-status-icon unchecked-icon"}),h.jsx(tn,{tag:"check2",className:"font-20 position-absolute radio-status-icon checked-icon"})]})})]})})}function Qst({className:n,item:t,name:i,title:s,id:l,iconImg:d,isDisabled:u,isChecked:p,handleChange:m}){const y=n||"",_={};u?_.disabled=!0:_.disabled=!1;function E(C){console.log(C.target),console.log(JSON.stringify(C.target.value)),m(C)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`card-theme border-0 rounded-2 overflow-hidden custom-radio-img-gallery-btn-card card-md ${y} h-100`,children:[h.jsx("input",{type:"radio",id:l,name:i,value:t.id,onChange:E,..._}),h.jsx("label",{htmlFor:l,className:"h-100",children:h.jsxs(et.Body,{className:"position-relative rounded-1 h-100 d-flex align-items-center",children:[h.jsx("div",{className:"card-overlay bg-gray-normal-overlay",children:h.jsx(tn,{tag:"check2",className:"font-24"})}),h.jsx(Ts,{src:d,alt:`${l} image`,className:"img-fluid"})]})})]})})}const g9=lu("Preferences",{web:()=>lr(()=>import("./web-eBprFveF.js"),__vite__mapDeps([])).then(n=>new n.PreferencesWeb)});function Zst(){ji();const[n,t]=k.useState([]),[i,s]=k.useState([]),[l,d]=k.useState([]),[u,p]=k.useState(!1),[m,y]=k.useState([]),[_,E]=k.useState([]),[C,x]=k.useState("step1"),[N,O]=k.useState(!1),D=JSON.parse(Ai.getAuthUser()),P=k.useRef(),j=()=>{P.current.value="",s(n)};function M(de,H){console.log("searchItems - filteredData =",H);const ae=H.filter((_e,me)=>_e.name.toLowerCase().includes(de.toLowerCase())||_e.designation.toLowerCase().includes(de.toLowerCase()));return console.log("Result =",ae),ae}const V=Tx.debounce(de=>{console.log("This is function from lodash..."),console.log("Search text =",de);const H=n;de.trim().length>0?(console.log(de.trim()),s(M(de.trim(),H))):s(H)},500),G=(de,H)=>{var ae,_e,me;if(console.log("Key in handleSelectedTab =",de),console.log("formik in handleSelected Tag = ",H),C==="step1"&&(H!=null&&H.values)&&!((ae=H.values)!=null&&ae.receiver_id)){Qt("User not selected!","error");return}if(C==="step2"&&(H!=null&&H.values)&&!((_e=H.values)!=null&&_e.reason)){Qt("Reason not selected!","error");return}if(C==="step2"&&(H!=null&&H.values)&&((me=H.values)==null?void 0:me.reason.toLowerCase())==="other"&&!H.values.own_reason){Qt("Own Reason is empty!","error");return}x(de)},$={receiver_id:"",reason:"",own_reason:"",icon:"",image:"",points:"",message:""},ne=gc({}),Y=async(de,{resetForm:H})=>{var Oe;if(console.log("Form Values :",de),C==="step3"&&de&&!(de!=null&&de.image)){Qt("Graphics not selected!","error");return}const ae=n.filter(Fe=>Fe.id===de.receiver_id)[0];console.log("receiver_info = ",ae);const _e=m.filter(Fe=>Fe.id===de.reason)[0];console.log("selectedReason = ",_e);const me={};!_e&&de.own_reason?(me.reason=de.own_reason,me.points=0,me.icon="/img/default-profile.jpg"):(me.reason=_e.reason,me.points=_e.points,me.icon=_e.icon),console.log("reasonInfo = ",me);const Ce=(Oe=_.filter(Fe=>Fe.id===de.image)[0])==null?void 0:Oe.image,he=`${D.name} appreciated ${ae.firstname} ${ae.lastname}`,pe={receiver_id:de.receiver_id,receiver_info:ae,title:he,reason:me.reason,icon:me.icon,image:Ce,points:me.points,message:de.message};console.log("Final formData = ",pe)};async function le(de){p(!0),ps.getAllRecipients(de).then(H=>{var ae,_e;if(console.log("getAllRecipients called == ",H.data),H.data.status==="success"){const me=(_e=(ae=H.data)==null?void 0:ae.data)==null?void 0:_e.recipients;t(me),s(me),p(!1)}}).catch(H=>{console.log("ERROR in getAllRecipients ",H),t([]),s([]),p(!1)})}async function re(){CN.getAppreciationCreationHelpers().then(de=>{var H,ae;if(console.log("getAppreciationCreationHelpers called == ",de.data),de.data.status==="success"){const _e=(H=de.data)==null?void 0:H.data.images,me=(ae=de.data)==null?void 0:ae.data.reasons;E(_e),y(me)}}).catch(de=>{console.log("ERROR in getAppreciationCreationHelpers ",e),E([]),y([])})}const ee=async()=>{p(!0);const{value:de}=await g9.get({key:"appreciationUsers"});if(console.log("Appreciation Users:",JSON.parse(de)),de){let H=JSON.parse(de);t(H),s(H),p(!1)}else le("appreciation")};return k.useEffect(()=>{ee(),re()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(od,{initialValues:$,validationSchema:ne,onSubmit:Y,children:de=>{var H,ae,_e;return h.jsxs(kt,{className:"form_style",onSubmit:de.handleSubmit,children:[h.jsxs(Zn.Container,{id:"appreciation-step-form",className:"main_tabs",activeKey:C,onSelect:me=>G(me),children:[h.jsx("div",{className:"tab_links d-none",children:h.jsxs(Un,{variant:"pills",className:"nav-stepper justify-content-center",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step1",children:h.jsx("div",{className:"",children:"1"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step2",children:h.jsx("div",{className:"",children:"2"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step3",children:h.jsx("div",{children:"3"})})})]})}),h.jsxs(Zn.Content,{className:"p-2 pt-0",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"step1",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-1 pt-0",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to appreciate?"]}),!u&&(n==null?void 0:n.length)>0?h.jsx("div",{className:"py-1",children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-1",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:me=>{console.log("Search input = ",me),V(me.target.value)},ref:P,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((H=P==null?void 0:P.current)==null?void 0:H.value.length)>0&&h.jsx(Lt,{onClick:j,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(ow,{})},"search-clear-btn"),((ae=P==null?void 0:P.current)==null?void 0:ae.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${i==null?void 0:i.length}`})]})}):h.jsx(h.Fragment,{}),l&&l.length>0?h.jsx("div",{className:"p-2 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto mb-1 border-bottom bg-gray-lighter2",children:h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-14 me-2",children:"Selected: "}),l.map((me,Ce)=>h.jsxs("div",{className:"d-flex align-items-center p-1 rounded-3 text-wrap border me-2 bg-white",children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0",style:{width:24,height:24},children:h.jsx("img",{src:me.image,className:"img-fluid mx-auto",alt:me.name,style:{objectFit:"cover"}})}),h.jsx("div",{className:"ms-2 font-12 text-truncate flex-grow-1",children:me.name})]},me.id))]})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{maxHeight:"calc(100vh - 35vh)",overflowY:"auto"},children:u?h.jsx(ci,{type:"details"}):h.jsx(h.Fragment,{children:!u&&(n==null?void 0:n.length)>0?h.jsx(h.Fragment,{children:(i==null?void 0:i.length)>0?h.jsx(h.Fragment,{children:i.map((me,Ce)=>h.jsx(H4,{className:`${i.length!==Ce+1?"border-bottom":""}`,name:"receiver_id",item:me,inputName:"users",title:Jv(me==null?void 0:me.firstname,me==null?void 0:me.lastname),subTitle:me==null?void 0:me.designation,id:me==null?void 0:me.id,iconImg:me==null?void 0:me.avatar,handleChange:de.handleChange,isDisabled:!1,isChecked:de.values.receiver_id.indexOf(me==null?void 0:me.id)>-1,initialValues:$==null?void 0:$.receiver_id,selectedUserList:l,setSelectedUserList:d},me.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No user found."})})})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more records"})})})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>G("step2",de),children:"Next"},"step2_handler")})]})})]}),h.jsxs(Zn.Pane,{className:"",eventKey:"step2",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-2",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select appreciation reason"]}),h.jsxs("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:[(m==null?void 0:m.length)>0&&m.map(me=>{var Ce;return h.jsx(H4,{className:"card-normal-radius",name:"reason",item:me,inputName:"reasons",title:me.reason,subTitle:"",id:me==null?void 0:me.id,iconImg:me==null?void 0:me.icon,handleChange:de.handleChange,isDisabled:!1,isChecked:((Ce=de.values)==null?void 0:Ce.reason.indexOf(me.id))>-1,initialValues:$==null?void 0:$.reason},me.id)}),h.jsx(H4,{className:"card-normal-radius",name:"reason",item:{id:"other"},inputName:"reasons",title:"Write your own",subTitle:"",id:"other",iconImg:"/img/default-profile.jpg",handleChange:de.handleChange,isDisabled:!1,isChecked:((_e=de.values)==null?void 0:_e.reason.indexOf("other"))>-1,initialValues:null})]})]}),h.jsx("div",{children:de.values.reason==="other"&&h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Write your own reason"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"own_reason",...de.getFieldProps("own_reason"),autoComplete:"off"})]})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>G("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>G("step3",de),children:"Next"},"step3_handler")})]})})]}),h.jsx(Zn.Pane,{className:"",eventKey:"step3",children:h.jsxs("div",{className:"form-step-container",children:[h.jsx("div",{className:"font-14 fw-sb py-2",children:"Choose a graphic and write a personalised message"}),h.jsx("div",{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Personal Note"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"message",...de.getFieldProps("message"),autoComplete:"off"}),de.touched.message&&de.errors.message?h.jsx("p",{className:"error-state-text font-12 text-danger",children:de.errors.message}):null]})}),h.jsxs("div",{className:"pt-2",children:[h.jsxs("div",{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Choose a graphic"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto"},children:h.jsx(fn,{className:"row-cols-3 g-2",children:(_==null?void 0:_.length)>0&&_.map(me=>h.jsx(Gt,{children:h.jsx(Qst,{className:"",name:"image",item:me,inputName:"images",title:me.id,subTitle:"",id:me==null?void 0:me.id,iconImg:me==null?void 0:me.image,handleChange:de.handleChange,isDisabled:!1,initialValues:$==null?void 0:$.image})},me.id))})})]})]})})]})]}),C==="step3"&&h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>G("step2"),children:"Prev"},"prev_step2_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Lt,{type:"submit",className:"btn-theme btn-primary btn-md w-100",children:N?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):de.isValid?"Submit":"Please fill out all info"})})})]})})]})}})})})}function eat({contest:n,className:t,handleCompetitionContestBtnClick:i}){const s=t||"",l=n!=null&&n.role?n==null?void 0:n.role:"",d=n!=null&&n.contest_name?n==null?void 0:n.contest_name:"";n!=null&&n.cover_image&&(n==null||n.cover_image);const u=n!=null&&n.points_unit?n==null?void 0:n.points_unit:"Points",p=n!=null&&n.points?n==null?void 0:n.points:0,m=n!=null&&n.team_points?n==null?void 0:n.team_points:0,y=n!=null&&n.team_rank?n==null?void 0:n.team_rank:0,_=n!=null&&n.team_rank_out_of?n==null?void 0:n.team_rank_out_of:0,E=n!=null&&n.rank_in_team?n==null?void 0:n.rank_in_team:0,C=n!=null&&n.rank_in_team_out_of?n==null?void 0:n.rank_in_team_out_of:0,x=n!=null&&n.team_dashboard?n==null?void 0:n.team_dashboard:null,N=n!=null&&n.contest_dashboard?n==null?void 0:n.contest_dashboard:null,O=n!=null&&n.top3?n==null?void 0:n.top3:[];function D(P,j){console.log("----- Inside handleBtnClick ----"),i(P,j)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`border-0 card-theme shadow-sm campaigns-card overflow-hidden ${s}`,children:[h.jsx(et.Header,{className:"border-bottom-0 p-2 pb-1 p-sm-3 line-clamp",children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"ms-",children:d})})}),h.jsxs(et.Body,{className:"p-2 p-sm-3",children:[l.toLowerCase()==="player"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-0 py-3 bg-primary-lighter rounded-3 mb-1",children:[h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-primary-lighter bg-transparent border-botto border-end rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:`Team ${u}`}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(tn,{tag:"insights1",className:"font-20 text-theme-secondary"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-secondary",children:[m," ",h.jsx("span",{className:"font-13 text-gray8"})]})})]})}),h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-botto rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:"Team Rank"}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(tn,{tag:"crown1",className:"font-20 text-theme-secondary"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-secondary",children:[y," ",h.jsxs("span",{className:"font-13 text-gray8",children:["(",_,")"]})]})})]})})]}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Lt,{type:"button",className:"btn-theme btn-md btn-secondary w-100",onClick:()=>{D(n,N)},children:"Contest Dashboard"})})})]}),h.jsxs("div",{className:"px-0 py-3 bg-warning-lighter rounded-3",children:[h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-end rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:`My ${u}`}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(tn,{tag:"insights1",className:"font-20 text-theme-secondary"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[p," ",h.jsx("span",{className:"font-13 text-gray8"})]})})]})}),h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-star rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:"Rank in Team"}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(tn,{tag:"crown1",className:"font-20 text-theme-warning"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[E," ",h.jsxs("span",{className:"font-13 text-gray8",children:["(",C,")"]})]})})]})})]}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Lt,{type:"button",className:"btn-theme btn-md btn-badges w-100",onClick:()=>{D(n,x)},children:"Team Dashboard"})})})]})]}),l.toLowerCase()==="observer"&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"px-0 py-3 bg-primary-lighter rounded-3",children:[h.jsxs("div",{className:"font-13 fw-sb text-uppercase flex-grow-1 px-1 d-flex align-items-center justify-content-center mb-2",children:[h.jsx(Lt,{type:"button",className:"btn btn-theme btn-secondary btn-sm rounded-circle btn-icon pe-none",children:h.jsx(tn,{tag:"crown1",className:"font-18"})}),h.jsx("span",{className:"lh-1 ms-1",children:"Toppers"})]}),(O==null?void 0:O.length)>0?h.jsxs(h.Fragment,{children:[h.jsx(fn,{className:"row-cols-3 g-0",children:O==null?void 0:O.map((P,j)=>{const M=P!=null&&P.team_image?P==null?void 0:P.team_image:"/img/default-bg.jpg",V=P!=null&&P.team_name?P==null?void 0:P.team_name:"",G=P!=null&&P.rank?P==null?void 0:P.rank:"";return h.jsx(Gt,{className:"",children:h.jsxs(et,{className:`border-0 campaigns-counter-card bg-primary-lighter bg-transparent rounded-0 h-100 ${j+1!==(O==null?void 0:O.length)?"border-end":""}`,children:[h.jsx(et.Header,{className:"border-0 text-center pt-3 pb-0 px-2",children:h.jsx("div",{className:"ms-2 font-13 fw-sb text-center lh-sm text-gray6",children:V})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center justify-content-center p-2 pt- position-relative",children:h.jsx("div",{className:"d-flex align-items-center mb-2",children:h.jsx("div",{className:"flex-shrink-0",style:{width:60},children:h.jsx(Ts,{src:M,alt:V,wrapperClassName:"img-fluid"})})})}),h.jsx(et.Footer,{className:"border-theme-top border-0 p-2 pt-0 bg-transparent text-center",children:h.jsx("div",{className:"btn btn-theme btn-icon btn-sm bg-primary-light-overlay rounded-circle fw-sb shadow-sm",children:G})})]})},P==null?void 0:P.team_name)})}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Lt,{type:"button",className:"btn-theme btn-md btn-secondary w-100",onClick:()=>{D(n,N)},children:"Contest Dashboard"})})})]}):h.jsx("div",{children:"No toppers found"})]})}),l.toLowerCase()==="non_player"&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"px-0 py-3 bg-warning-lighter rounded-3",children:[h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-end rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:`Team ${u}`}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(tn,{tag:"insights1",className:"font-20 text-theme-warning"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[m," ",h.jsx("span",{className:"font-13 text-gray8"})]})})]})}),h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-star rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:"Team Rank"}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(tn,{tag:"crown1",className:"font-20 text-theme-warning"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[y," ",h.jsxs("span",{className:"font-13 text-gray8",children:["(",_,")"]})]})})]})})]}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Lt,{type:"button",className:"btn-theme btn-badges w-100",onClick:()=>{D(n,N)},children:"Contest Dashboard"})})})]})})]})]})})}function tat(){const n=ji(),[t,i]=k.useState([1,2]),[s,l]=k.useState(!0);async function d(){console.log("Inside Dashboard: getAllCompetitionContests()..."),Xa.getAllCompetitionContests().then(p=>{console.log("getAllCompetitionContests RES = ",p.data),p.data.status==="success"&&(i(p.data.data.items),l(!1))}).catch(p=>{l(!1),i([]),console.log("Error in getAllCompetitionContests = ",p)})}k.useEffect(()=>{d()},[]);function u(p,m){p&&n("/competition-contests/competition-contest-details",{state:{item:p,url:m,pageTitle:p==null?void 0:p.contest_name}})}return h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:s?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((p,m)=>h.jsx(ci,{type:"competition-contest",className:"card-theme overflow-hidden"},m))})}):h.jsx(h.Fragment,{children:t.length>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-4",children:t.map((p,m)=>h.jsx(eat,{className:"",contest:p,handleCompetitionContestBtnClick:u},m))})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more contests"})})})})})}function nat(){const[n,t]=k.useState(!0),{state:i}=tl();return console.log("Data passed via navigate = ",i),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"rati0 ratio-1x1 position-relativ px-0",style:{height:"calc(100vh - 160px)",zIndex:1},children:[n?h.jsx(ci,{type:"iframe-loader"}):null,h.jsx("iframe",{src:`${i.url}`,title:"Competition Contest Details",onLoad:()=>t(!1),className:`no-scrollbar ${n?"opacity-0":""}`,sandbox:"allow-scripts",height:"100%",width:"100%"})]})})}function iat(){const n=ji(),t=["name","firstname","lastname","designation"],i="badges",[s,l]=k.useState(0),[d,u]=k.useState([]),[p,m]=k.useState([]),[y,_]=k.useState(""),[E,C]=k.useState(!1),x=async({queryKey:H})=>{var me,Ce;const[ae,_e]=H;try{const he=await ps.getAllRecipients(_e);if(he.data.status==="success"){const pe=((Ce=(me=he.data)==null?void 0:me.data)==null?void 0:Ce.recipients)||[],Oe=new Set;return pe.filter(Ue=>Oe.has(Ue.id)?!1:(Oe.add(Ue.id),!0))}return[]}catch{throw new Error("Error fetching all recipients")}};async function N(){var H,ae,_e;try{const me=await bN.getBadgeCreationHelpers();return((H=me==null?void 0:me.data)==null?void 0:H.status)==="success"?(_e=(ae=me==null?void 0:me.data)==null?void 0:ae.data)==null?void 0:_e.badges:null}catch{throw new Error("Error fetching appreciation creation helpers")}}const{isPending:O,isError:D,data:P,error:j}=ru({queryKey:["badgeRecipients",i],queryFn:x}),{data:M}=ru({queryKey:["badgeCreationHelpers"],queryFn:N}),V=k.useMemo(()=>pP(P,y,t),[P,y]),G=(H,ae="single")=>{u(ae==="single"?[H]:_e=>_e.some(me=>me.id===H.id)?_e.filter(me=>me.id!==H.id):[..._e,H])},$=(H,ae="single")=>{m(ae==="single"?[H]:_e=>_e.some(me=>me.id===H.id)?_e.filter(me=>me.id!==H.id):[..._e,H])},ne=({index:H,key:ae,style:_e})=>{const me=V[H];return h.jsx("div",{style:_e,children:h.jsx($C,{item:me,className:`user-card ${d.some(Ce=>Ce.id===me.id)?"selected":""} ${V.length!==H+1?"border-bottom":""}`,type:"single",title:me!=null&&me.firstname?Jv(me==null?void 0:me.firstname,me==null?void 0:me.lastname):me==null?void 0:me.name,subTitle:me==null?void 0:me.designation,iconImg:me==null?void 0:me.avatar,isRoundedIcon:!0,handleItemSelect:G})},ae)},Y=()=>d.length===0?(Qt("Users not selected!","error"),!1):!0,le=()=>(p==null?void 0:p.length)===0?(Qt("Badge not selected!","error"),!1):!0;function re(H){l(Number(H))}const ee=()=>{s===0&&Y()?l(1):s===1&&le()&&de()};async function de(){C(!0);const H=d[0],ae=p[0],_e={receiver_id:H==null?void 0:H.id,receiver_info:H,badge_id:ae.id,status:"active"};bN.sendBadge(_e).then(me=>{console.log("sendBadge response result = ",me.data),me.data.status==="success"&&(C(!1),Qt("Badge sent successfully!","success"),n("/badges",{state:{data:"sent"}}))}).catch(me=>{console.log(me),Qt("Failed to Send Badge!","error")}).finally(()=>{C(!1)})}return O?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(ci,{type:"details"})})}):D?h.jsx(To,{className:"mt-5",children:j.message}):h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx("div",{className:"send-badges-page",children:h.jsxs($U,{activeKey:s,onSelect:re,id:"stepper-tabs",children:[h.jsxs(Zn,{eventKey:0,title:"Step 1",unmountOnExit:!0,children:[h.jsxs("div",{className:"py-0 pt-2 sticky-top",style:{top:"var(--navbar-height)",padding:"0 0rem",background:"var(--color-body-bg-light)"},children:[h.jsxs(To,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to give a badge?"]}),h.jsxs("div",{className:"py-1 pb-0",children:[h.jsx(CP,{filters:t,onSearch:H=>_(H),className:"mb-"}),(V==null?void 0:V.length)>0&&(y==null?void 0:y.length)>0&&h.jsx(To,{size:"sm",className:"px-1 text-gray9",children:`Results found ${V==null?void 0:V.length}`})]}),h.jsx("div",{className:"px-1 d-block mb-1",children:h.jsx(vee,{items:d,className:"",type:"single",handleRemoveItems:G})})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{height:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:h.jsx(UF,{children:({height:H,width:ae})=>h.jsx(BF,{width:ae,height:H,rowHeight:60,rowCount:V.length,rowRenderer:ne})})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:ee,children:"Next"},"step2_handler")})]})})]}),h.jsx(Zn,{eventKey:1,title:"Step 2",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsxs(To,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select a badge"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:h.jsx(h.Fragment,{children:(M==null?void 0:M.length)>0&&M.map(H=>h.jsx(h.Fragment,{children:h.jsx($C,{item:H,className:`user-card ${p.some(ae=>ae.id===(H==null?void 0:H.id))?"selected":""}`,type:"single",title:H==null?void 0:H.title,subTitle:"",iconImg:H==null?void 0:H.image,isRoundedIcon:!1,handleItemSelect:$},H==null?void 0:H.id)}))})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>l(0),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:ee,children:E?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):"Submit"},"submit_handler")})]})})]})})]})})})})})}function rat(){const n=ji(),[t,i]=k.useState([]),[s,l]=k.useState([]),[d,u]=k.useState([]),[p,m]=k.useState(!1),[y,_]=k.useState([]),[E,C]=k.useState("step1"),[x,N]=k.useState(!1);JSON.parse(Ai.getAuthUser());const O=k.useRef(),D=()=>{O.current.value="",l(t)};function P(ee,de){console.log("searchItems - filteredData =",de);const H=de.filter((ae,_e)=>ae.firstname.toLowerCase().includes(ee.toLowerCase())||ae.lastname.toLowerCase().includes(ee.toLowerCase())||ae.designation.toLowerCase().includes(ee.toLowerCase()));return console.log("Result =",H),H}const j=Tx.debounce(ee=>{console.log("This is function from lodash..."),console.log("Search text =",ee);const de=t;ee.trim().length>0?(console.log(ee.trim()),l(P(ee.trim(),de))):l(de)},500),M=(ee,de)=>{var H;if(console.log("Key in handleSelectedTab =",ee),console.log("formik in handleSelected Tag = ",de),E==="step1"&&(de!=null&&de.values)&&!((H=de.values)!=null&&H.receiver_id)){Qt("User not selected!","error");return}C(ee)},V={receiver_id:"",badge_id:"",points:""},G=gc({}),$=async(ee,{resetForm:de})=>{if(console.log("Form Values :",ee),E==="step2"&&ee&&!(ee!=null&&ee.badge)){Qt("badge not selected!","error");return}const H=t.filter(Ce=>Ce.id===ee.receiver_id)[0];console.log("receiver_info = ",H);const ae=y.filter(Ce=>Ce.id===ee.badge)[0];console.log("selectedBadge = ",ae);const _e={receiver_id:ee.receiver_id,receiver_info:H,badge_id:ae.id,status:"active"};console.log("Final formData = ",_e);const me=await le(_e);console.log("sendBadgeResponse in onSubmit = ",me)};async function ne(ee){m(!0),ps.getAllRecipients(ee).then(de=>{var H,ae;if(console.log("getAllRecipients called == ",de.data),de.data.status==="success"){const _e=(ae=(H=de.data)==null?void 0:H.data)==null?void 0:ae.recipients;i(_e),l(_e),m(!1)}}).catch(de=>{console.log("ERROR in getAllRecipients ",de),i([]),l([]),m(!1)})}async function Y(){bN.getBadgeCreationHelpers().then(ee=>{var de;if(console.log("getBadgeCreationHelpers called == ",ee.data),ee.data.status==="success"){const H=(de=ee.data)==null?void 0:de.data.badges;_(H)}}).catch(ee=>{console.log("ERROR in getBadgeCreationHelpers ",e),_([])})}async function le(ee){console.log("called sendBadge in sendBadge comp...",ee),N(!0),bN.sendBadge(ee).then(de=>{console.log("sendBadge response result = ",de.data),de.data.status==="success"&&(N(!1),Qt("Badge sent successfully!","success"),n("/badges",{state:{data:"sent"}}))}).catch(de=>{console.log(de),N(!1),Qt("Failed to Send Badge!","error")})}const re=async()=>{m(!0);const{value:ee}=await g9.get({key:"badgeUsers"});if(console.log("Badge Users:",JSON.parse(ee)),ee){let de=JSON.parse(ee);i(de),l(de),m(!1)}else ne("badges")};return k.useEffect(()=>{re(),Y()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(od,{initialValues:V,validationSchema:G,onSubmit:$,children:ee=>{var de,H;return h.jsxs(kt,{className:"form_style",onSubmit:ee.handleSubmit,children:[h.jsxs(Zn.Container,{id:"badge-step-form",className:"main_tabs",activeKey:E,onSelect:ae=>M(ae),children:[h.jsx("div",{className:"tab_links d-none",children:h.jsxs(Un,{variant:"pills",className:"nav-stepper justify-content-center",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step1",children:h.jsx("div",{className:"",children:"1"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step2",children:h.jsx("div",{className:"",children:"2"})})})]})}),h.jsxs(Zn.Content,{className:"p-2 pt-0",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"step1",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-1 pt-0",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to give a badge?"]}),!p&&(t==null?void 0:t.length)>0?h.jsx("div",{className:"py-1",children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-1",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:ae=>{console.log("Search input = ",ae),j(ae.target.value)},ref:O,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((de=O==null?void 0:O.current)==null?void 0:de.value.length)>0&&h.jsx(Lt,{onClick:D,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(ow,{})},"search-clear-btn"),((H=O==null?void 0:O.current)==null?void 0:H.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${s==null?void 0:s.length}`})]})}):h.jsx(h.Fragment,{}),d&&d.length>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"p-2 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto mb-1 border-bottom bg-gray-lighter2",children:h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-14 me-2",children:"Selected: "}),d.map((ae,_e)=>h.jsxs("div",{className:"d-flex align-items-center p-1 rounded-3 text-wrap border me-2 bg-white",children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0",style:{width:24,height:24},children:h.jsx("img",{src:ae.image,className:"img-fluid mx-auto",alt:ae.name,style:{objectFit:"cover"}})}),h.jsx("div",{className:"ms-2 font-12 text-truncate flex-grow-1",children:ae.name})]},ae.id))]})})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{maxHeight:"calc(100vh - 35vh)",overflowY:"auto"},children:p?h.jsx(ci,{type:"details"}):h.jsx(h.Fragment,{children:!p&&(t==null?void 0:t.length)>0?h.jsx(h.Fragment,{children:(s==null?void 0:s.length)>0?h.jsx(h.Fragment,{children:s.map((ae,_e)=>h.jsx(H4,{className:`${s.length!==_e+1?"border-bottom":""}`,name:"receiver_id",item:ae,inputName:"users",title:Jv(ae==null?void 0:ae.firstname,ae==null?void 0:ae.lastname),subTitle:ae==null?void 0:ae.designation,id:ae==null?void 0:ae.id,iconImg:ae==null?void 0:ae.avatar,handleChange:ee.handleChange,isDisabled:!1,isChecked:ee.values.receiver_id.indexOf(ae==null?void 0:ae.id)>-1,initialValues:V==null?void 0:V.receiver_id,selectedUserList:d,setSelectedUserList:u},ae.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No user found."})})})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more records"})})})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>M("step2",ee),children:"Next"},"step2_handler")})]})})]}),h.jsxs(Zn.Pane,{className:"",eventKey:"step2",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-2",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select badge"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:(y==null?void 0:y.length)>0&&y.map(ae=>{var _e,me;return h.jsx(H4,{className:"card-normal-radius",name:"badge",item:ae,inputName:"badges",title:ae.title,subTitle:`${ae.points} Points`,id:ae==null?void 0:ae.id,iconImg:ae==null?void 0:ae.image,handleChange:ee.handleChange,isDisabled:!1,isChecked:((me=(_e=ee.values)==null?void 0:_e.badge)==null?void 0:me.indexOf(ae.id))>-1,initialValues:V==null?void 0:V.badge_id},ae.id)})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>M("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>M("step3",ee),children:"Next"},"step3_handler")})]})})]})]})]}),E==="step2"&&h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>M("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Lt,{type:"submit",className:"btn-theme btn-primary btn-md w-100",children:x?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):ee.isValid?"Submit":"Please fill out all info"})})})]})})]})}})})})}function sat({mediaType:n,mediaSource:t,setUploadMediaUrl:i,className:s,contestId:l,handleClose:d,data:u,fileSizelimit:p,videoDurationLimit:m,audioDurationLimit:y}){console.log("mediaSource = ",t),ji();const[_,E]=k.useState(),[C,x]=k.useState(null),[N,O]=k.useState(""),[D,P]=k.useState(null),[j,M]=k.useState(""),[V,G]=k.useState(0),[$,ne]=k.useState(!1),[Y,le]=k.useState(0),[re,ee]=k.useState(!1);k.useState(!1);const[de,H]=k.useState(!1),[ae,_e]=k.useState(null),[me,Ce]=k.useState(!1),{counter:he,handleStart:pe,handlePause:Oe,handleReset:Fe}=gee(0,!0),Ue=k.useRef(!1);k.useRef(null);const Ve=k.useRef(null),Re=k.useRef(null);k.useRef(null);const Be=k.useRef(null),Xe=k.useRef(null);k.useRef(null);const we={title:""},We=gc({}),st=n?n==="pdf"?".pdf":`${n}/*`:"image/*",pt=n!==""?"user":"",Qe=n?`${n}-gallery-file`:"media-gallery-file",Je=n?`${n}-camera-file`:"media-camera-file",St=()=>{Ce(!1)},Xt=an=>{console.log("handleShowRecordAudioModal () - MEDIA TYPE = ",an),Ce(!0)};async function Ht(){console.log("onRecordingStart called...");const an=await zp.startRecording();console.log("recordStartResult = ",an)}async function gn(){console.log("onRecordingStop called...");const an=await zp.stopRecording();if(console.log("onRecordingStop counter =",he),console.log("recordStopResult = ",an),an.value){const ie=an.value;G(Math.round(ie.msDuration/1e3)),ne(!0),H(!0);const Se=ie.msDuration,je=Math.round(Se/1e3);console.log("fileDurationInMS = ",Se," fileDurationInSec =",je);const tt=ie.recordDataBase64,Te=ie.mimeType;let Pe=Te.substring(0,Te.indexOf(";"));const Ze=`data:${Pe};base64,${tt}`;var ye=It(Ze);console.log("Binary file =",ye);var Q=new Blob([ye],{type:`${Pe}`});console.log("blob = ",Q),E({...an.value,size:Q.size}),_e(Pe);const nt=ax(Q.size,{standard:"jedec"});console.log("Recorded Audio fileSize = ",nt),P(nt);const $e=URL.createObjectURL(Q);console.log("blobUrl = ",$e),x($e),console.log("File Obj =",_)}else console.log("Unable to record/play audio")}function It(an){var ye=";base64,",Q=an.indexOf(ye)+ye.length,ie=an.substring(Q),Se=window.atob(ie),je=Se.length,tt=new Uint8Array(new ArrayBuffer(je));for(let Te=0;Te<je;Te++)tt[Te]=Se.charCodeAt(Te);return tt}async function xt(){if(console.log("onRecordBtnClick called..."),(await zp.canDeviceVoiceRecord()).value){const ye=await zp.hasAudioRecordingPermission();if(ye.value)console.log("hasAudioPermission set",ye),Xt();else{console.log("hasAudioPermission not set...request permissions...",ye);const Q=await zp.requestAudioRecordingPermission();console.log("requestedPermissionResult = ",Q)}}}function mt(an){if(console.log("Inside handleChange =",an.target.files[0]),an.target.files[0]){E(an.target.files[0]),ne(!0);const ye=ax(an.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",ye),P(ye),n){case"image":let Q=URL.createObjectURL(an.target.files[0]);Ve.current.src=Q,Ve.current.className="d-block",O(an.target.files[0].name);break;case"video":let ie=URL.createObjectURL(an.target.files[0]);console.log("blobVideoURL =",ie),x(ie);break;case"audio":let Se=URL.createObjectURL(an.target.files[0]);console.log("Case audio: ",Se),x(Se);break;case"pdf":console.log("PDF Preview =",Re.current),Re.current.className="d-block",O(an.target.files[0].name);break;default:console.log("No case matched...")}}}function dt(){if(_)switch(E(null),ne(!1),O(""),M(""),P(null),Fe(),Be.current&&(Be.current.value=""),Xe.current&&(Xe.current.value=""),n){case"image":console.log("Image Preview =",Ve.current),Ve.current.src="",Ve.current.className="d-none";break;case"video":x(null);break;case"audio":x(null),H(!1);break;case"pdf":console.log("PDF Preview =",Re.current),Re.current.className="d-none";break;default:console.log("No case matched...")}}const it=an=>new Promise((ye,Q)=>{const ie=new FileReader;ie.onload=()=>{const Se=ie.result;ye(Se)},ie.onerror=()=>{Q(new Error("Unable to read the file as binary data"))},ie.readAsArrayBuffer(an)}),Me=new AbortController,bt=Gr.CancelToken.source();k.useEffect(()=>()=>{console.log("Called cancellation from UploadResponseMediaFile..."),Ue.current&&(console.log("Called cancellation inside if(bool.current)...",Ue==null?void 0:Ue.current),bt.cancel("Upload cancelled by user"),Me.abort())},[Ue.current]);function wt(){Ue.current=!0,d(),bt.cancel("Upload cancelled by user"),Me.abort(),Me.signal.aborted&&Qt("Uploading cancelled!","error")}const Pt=async(an,{resetForm:ye})=>{if(console.log("Form Values :",an),console.log("bool at start of onSubmit = ",Ue==null?void 0:Ue.current),N===""){console.log('Inside if (mediaUrl === "")'),Qt("Upload Valid File","error");return}ee(!0);let Q="";de?Q=ae.split("/")[1]:Q=_.name.substring(_.name.lastIndexOf(".")+1);const ie={fileextention:Q,modulename:"wallmessage"};console.log("data for getSignedUrl = ",ie);const Se=await ps.getSignedUploadUrl(ie);let je=null;if(de){const Pe=_==null?void 0:_.recordDataBase64,Ze=_==null?void 0:_.mimeType,$e=`data:${Ze.substring(0,Ze.indexOf(";"))};base64,${Pe}`;je=It($e),console.log("Binary file =",je)}else je=await it(_);const tt={headers:{},cancelToken:bt.token,signal:Me.signal,onUploadProgress:function(Pe){const Ze=Math.round(Pe.loaded*100/Pe.total);le(Ze)}};console.log(tt);const Te=await Gr.put(Se.data.data.uploadURL,je,tt);if(console.log("result =",Te),console.log("result status =",Te.status),Te.status===200){if(console.log("uploadProgress =",Y),console.log("bool after upload = ",Ue==null?void 0:Ue.current),Ue.current){i("");return}i(Se.data.data.resourceUrl),setTimeout(()=>{d()},500)}else console.log("THERE IS AN ERROR IN uploadConfig...");console.log("Outside if uploadProgress =",Y)};function en(an){console.log("getDuration called...",an),de||G(Math.round(an))}const un=({played:an,playedSeconds:ye,loaded:Q,loadedSeconds:ie})=>{var Se,je,tt;console.log("File Obj =",_),console.log("handleProgress called...",Q),n==="video"&&V>((Se=u==null?void 0:u.limits)==null?void 0:Se.video)||n==="audio"&&V>((je=u==null?void 0:u.limits)==null?void 0:je.audio)||(_==null?void 0:_.size)>((tt=u==null?void 0:u.limits)==null?void 0:tt.size)*1024*1024?(console.log("getDuration condition If part"),console.log("fileDuration = ",V," mediaType = ",n," Size =",_==null?void 0:_.size),O("")):(console.log("getDuration condition else part"),console.log("fileDuration = ",V," mediaType = ",n," Size =",_==null?void 0:_.size),O(_.name),M(""))};return console.log("Duaration in minutes = ",D2(V)),console.log("D in minutes using secondsToTime = ",OQ(V,":")),h.jsxs(h.Fragment,{children:[h.jsx(od,{initialValues:we,validationSchema:We,onSubmit:Pt,enableReinitialize:!0,children:an=>{var ye,Q,ie;return h.jsxs(kt,{className:"form_style",onSubmit:an.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx("div",{className:"font-13",children:"Choose upload from"}),h.jsx("div",{className:"btn-wrap d-flex py-2",children:t.length>0&&h.jsx(h.Fragment,{children:t.map((Se,je)=>Se.toLowerCase()!=="camera"?h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Xe,name:Qe,id:Qe,className:"uploadMediafile",accept:st,onChange:mt,disabled:$}),h.jsx("label",{htmlFor:Qe,className:"justify-content-center px-2 gallery-btn",children:"Gallery"})]},`${Se}-${je}`):h.jsxs(dn.Fragment,{children:[(n==="video"||n==="image")&&h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Be,name:Je,id:Je,className:"uploadMediafile",capture:pt,accept:st,onChange:mt,disabled:$}),h.jsx("label",{htmlFor:Je,className:"justify-content-center px-2 capture-btn",children:"Camera"})]}),n==="audio"&&h.jsx("div",{className:"flex-grow-1",children:h.jsx(Lt,{onClick:xt,className:"btn-theme btn-primary btn-md w-100 font-14 fw-sb",style:{padding:"10px 12px"},children:"Record"})})]},`${Se}-${je}`))})})]}),Y>0&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-0",children:[h.jsx("progress",{value:Y,max:"100"}),h.jsx("span",{className:"font-12 fw-sb ps-2",children:`${Y}%`})]}),h.jsx("div",{className:"d-flex justify-content-between font-14",children:!_&&V<=0?"No file selected":n==="video"&&V>((ye=u==null?void 0:u.limits)==null?void 0:ye.video)||n==="audio"&&V>((Q=u==null?void 0:u.limits)==null?void 0:Q.audio)||(_==null?void 0:_.size)>((ie=u==null?void 0:u.limits)==null?void 0:ie.size)*1024*1024?h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${_?"d-flex":"d-none"}`,style:{background:"var(--color-red-lighter)"},children:[h.jsxs("span",{className:" fw-sb font-13 flex-grow- me-1",children:[h.jsx("span",{className:"text-dange",children:"Upload limit exceeds"})," ",D2(V)]}),h.jsx("span",{className:"fw-sb font-13",children:D?` and ${D}`:""})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${_?"d-flex":"d-none"}`,style:{background:"var(--color-green-lighter)"},children:[n==="video"||n==="audio"&&h.jsxs("span",{className:"font-13 fw-sb flex-grow- text-break",children:["Uploaded file: ",D2(V)," ","+ ' and '"]}),h.jsx("span",{className:"ms-1 fw-sb font-13",children:D?`${D}`:""})]})})}),h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Lt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${$?"d-block":"d-none"} ${re?"pe-none":""}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:dt,children:h.jsx(tn,{tag:"delete7",className:"font-26"})}),h.jsx(iu,{aspectRatio:`${n==="audio"?"21x9":n==="image"?"1x1":"16x9"}`,className:"preview-container",children:h.jsxs(h.Fragment,{children:[n==="image"&&h.jsx("img",{ref:Ve,src:"",alt:"preview image",className:"img-fluid mx-auto d-none"}),(n==="video"||n==="audio")&&h.jsx(gw,{url:C,width:"100%",height:"100%",controls:!0,playing:!1,onDuration:Se=>en(Se),onProgress:({played:Se,playedSeconds:je,loaded:tt,loadedSeconds:Te})=>un({played:Se,playedSeconds:je,loaded:tt,loadedSeconds:Te})}),n==="pdf"&&h.jsxs("div",{ref:Re,className:"d-none",children:[h.jsx(tn,{tag:"pdf1",className:"me-2 font-30 text-danger"}),h.jsx("span",{className:"font-16 fw-sb",children:_==null?void 0:_.name})]})]})})]}),j&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-flex w-100 p-1 rounded-2 mt-2",style:{background:"var(--color-red-lighter)"},children:h.jsx("span",{className:"d-block text-danger font-13 fw-sb",children:j})})}),h.jsxs("div",{className:"btn-wrap pt-3 pb-4 d-flex justify-content-center position-fixed px-3 bg-white border-top",style:{bottom:0,right:0,left:0},children:[h.jsx(Lt,{type:"button",className:"btn-theme btn-gray btn-md flex-grow-1",onClick:wt,children:"Back"}),h.jsx(Lt,{type:"submit",disabled:!an.isValid,className:"btn-theme btn-primary btn-md flex-grow-1",children:re?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(an.isValid,"Confirm Upload")})]})]})}}),h.jsx(pbe,{show:me,handleClose:St,onRecordingStart:Ht,onRecordingStop:gn,counter:he,handlePause:Oe,handleStart:pe,className:""})]})}function Ybe(n){var l,d,u,p,m,y,_,E,C,x,N,O;console.log("UploadMessageMediaTypeModal props - ",n),k.useState(!1);const t=(d=(l=n.data)==null?void 0:l.limits)!=null&&d.size?(p=(u=n.data)==null?void 0:u.limits)==null?void 0:p.size:"NA",i=(y=(m=n.data)==null?void 0:m.limits)!=null&&y.video?(E=(_=n.data)==null?void 0:_.limits)==null?void 0:E.video:"NA",s=(x=(C=n.data)==null?void 0:C.limits)!=null&&x.audio?(O=(N=n.data)==null?void 0:N.limits)==null?void 0:O.audio:"NA";return h.jsx(h.Fragment,{children:h.jsxs(wn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom -modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(wn.Header,{className:"pb",closeButton:!0,children:h.jsx(wn.Title,{className:"d-flex align-items-center",children:`Upload ${n.uploadMediaType}`})}),h.jsxs(wn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:[h.jsx(et,{className:"mb-2 mb-sm-2",children:h.jsxs(et.Body,{className:"p-1 p-sm-2 font-13 text-gray4",style:{background:"var(--color-yellow-lighter)"},children:[h.jsx("span",{className:"fw-b font-13",children:"Note: "}),"Upload file size should not exceeds"," ",h.jsx("span",{className:"fw-b text-danger",children:t!=="NA"&&`${t} mb`})," ",n.uploadMediaType.toLowerCase()==="audio"||n.uploadMediaType.toLowerCase()==="video"&&h.jsxs(h.Fragment,{children:["and video/audio duration not more than"," ",h.jsx("span",{className:"fw-b text-danger",children:i!=="NA"&&`${i}s`})]}),"."]})}),h.jsx(sat,{mediaType:n.uploadMediaType.toLowerCase(),mediaSource:n==null?void 0:n.resSources,setUploadMediaUrl:n.setUploadMediaUrl,handleClose:n.handleClose,fileSizelimit:t,videoDurationLimit:i,audioDurationLimit:s})]})]})})}function aat({className:n,type:t,item:i,name:s,title:l,subTitle:d,id:u,iconImg:p,isDisabled:m,isChecked:y,handleChange:_,selectedUserList:E,setSelectedUserList:C}){const x=n||"",N=t||"radio",O=p||((i==null?void 0:i.type)==="group"?"/img/groups-icon.png":"/img/user-profile.jpg"),D=l||"Guest User",P=d||"",j={};m?j.disabled=!0:j.disabled=!1;function M(V){console.log(V.target),console.log(JSON.stringify(V.target.value)),_(V),C&&(!E.includes(V.target.value)&&!y?C(G=>{let $={id:V.target.value,name:D,image:O};return console.log("tempUserObj = ",$),[...G,$]}):(console.log("isCHecked = ",y),y&&C(G=>{let $=G.filter(ne=>ne.id!==V.target.value);return console.log("tempUserObj = ",$),$})))}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`card-theme border-0 rounded-1 custom-radio-list-btn-card card-md ${x}`,children:[h.jsx("input",{type:N,id:u,name:s,value:i.id,onChange:M,...j,checked:y||!1}),h.jsx("label",{htmlFor:u,children:h.jsxs(et.Body,{className:"position-relative rounded-1",children:[h.jsx("div",{className:"d-flex profile-info-container align-items-center",children:h.jsxs("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex align-items-center",children:[h.jsx("div",{className:"media-icon-wrapper",children:h.jsx(Ts,{src:O,alt:`${D} image`,className:"img-fluid"})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container d-flex flex-wrap",children:[h.jsx("span",{className:"welcome-user fw-n",style:{maxWidth:"90%"},children:`${D} `}),h.jsx("div",{className:"d-block w-100 font-13 text-gray6",children:vx(P)})]})]})}),h.jsx(tn,{tag:"circle1",className:"font-20 position-absolute radio-status-icon unchecked-icon"}),h.jsx(tn,{tag:"check2",className:"font-20 position-absolute radio-status-icon checked-icon"})]})})]})})}function oat(){const n=ji();JSON.parse(Ai.getAuthUser());const t=["name","designation"],i="message",s=["audio","video","image","pdf"],l=["gallery"],d=500,[u,p]=k.useState(0),[m,y]=k.useState(""),[_,E]=k.useState([]),[C,x]=k.useState(""),[N,O]=k.useState(""),[D,P]=k.useState(""),[j,M]=k.useState(""),[V,G]=k.useState(""),[$,ne]=k.useState(!1),[Y,le]=k.useState({isVisible:!1});k.useRef(),k.useRef();const re=async()=>{const st=await Z2.getInfo();y(st.platform)};k.useEffect(()=>{re()},[]);const ee=()=>{le({isVisible:!1})},de=st=>{O(st),le({isVisible:!0})},H=async({queryKey:st})=>{var Je,St;const[pt,Qe]=st;try{const Xt=await ps.getAllRecipients(Qe);if(Xt.data.status==="success"){const Ht=((St=(Je=Xt.data)==null?void 0:Je.data)==null?void 0:St.recipients)||[],gn=new Set;return Ht.filter(xt=>gn.has(xt.id)?!1:(gn.add(xt.id),!0))}return[]}catch{throw new Error("Error fetching all recipients")}},{isLoading:ae,isPending:_e,isFetching:me,isError:Ce,data:he,error:pe}=ru({queryKey:["messageRecipients",i],queryFn:H}),Oe=k.useMemo(()=>pP(he,C,t),[he,C]),Fe=(st,pt="multi")=>{E(pt==="single"?[st]:Qe=>Qe.some(Je=>Je.id===st.id)?Qe.filter(Je=>Je.id!==st.id):[...Qe,st])},Ue=({index:st,key:pt,style:Qe})=>{const Je=Oe[st];return h.jsx("div",{style:Qe,children:h.jsx($C,{item:Je,className:`user-card ${_.some(St=>St.id===Je.id)?"selected":""} ${Oe.length!==st+1?"border-bottom":""}`,type:"multi",title:Je!=null&&Je.firstname?Jv(Je==null?void 0:Je.firstname,Je==null?void 0:Je.lastname):Je==null?void 0:Je.name,subTitle:Je==null?void 0:Je.designation,iconImg:Je==null?void 0:Je.avatar,isRoundedIcon:!0,handleItemSelect:Fe})},pt)},Ve=()=>_.length===0?(Qt("Users not selected!","error"),!1):!0,Re=()=>!j||j===""?(Qt("Title required!","error"),!1):!V||V===""?(Qt("Message required!","error"),!1):!0;function Be(st){p(Number(st))}const Xe=()=>{u===0&&Ve()?p(1):u===1&&Re()?p(2):u===2&&we()};async function we(){ne(!0);const st=_.filter(Je=>Je.type==="user").map(Je=>Je.id),pt=_.filter(Je=>Je.type==="group").map(Je=>Je.id),Qe={title:j,body:V,media_type:N,media_url:D,groups:pt,users:st};Ro.sendWallMessage(Qe).then(Je=>{console.log("sendWallMessage response result = ",Je.data),Je.data.status==="success"&&(ne(!1),Qt("Message sent successfully!","success"),n("/messages",{state:{data:"sent"}}))}).catch(Je=>{console.log(Je),ne(!1),Qt("Failed to Send Message!","error")})}function We(st){st&&P(st)}return _e?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(ci,{type:"details"})})}):Ce?h.jsx(To,{className:"mt-5",children:pe.message}):h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsxs("div",{className:"send-messages-page",children:[h.jsxs($U,{activeKey:u,onSelect:Be,id:"stepper-tabs",children:[h.jsxs(Zn,{eventKey:0,title:"Step 1",unmountOnExit:!0,children:[h.jsxs("div",{className:"py-0 pt-2 sticky-top",style:{top:"var(--navbar-height)",padding:"0 0rem",background:"var(--color-body-bg-light)"},children:[h.jsxs(To,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to appreciate?"]}),h.jsxs("div",{className:"py-1 pb-0",children:[h.jsx(CP,{filters:t,onSearch:st=>x(st),className:"mb-"}),(Oe==null?void 0:Oe.length)>0&&(C==null?void 0:C.length)>0&&h.jsx(To,{size:"sm",className:"px-1 text-gray9",children:`Results found ${Oe==null?void 0:Oe.length}`})]}),h.jsx("div",{className:"px-1 d-block mb-1",children:h.jsx(vee,{items:_,className:"",type:"single",handleRemoveItems:Fe})})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{height:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:h.jsx(UF,{children:({height:st,width:pt})=>h.jsx(BF,{width:pt,height:st,rowHeight:60,rowCount:Oe.length,rowRenderer:Ue})})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Xe,children:"Next"},"step2_handler")})]})})]}),h.jsx(Zn,{eventKey:1,title:"Step 2",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container pt-2",children:[h.jsx(To,{size:"",className:"mb-1",children:"Write a Message"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Message Title"]}),h.jsx(kt.Control,{type:"text",placeholder:"",name:"title",value:j,onChange:st=>M(st.target.value),autoComplete:"off"})]}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Brief Message"]}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"body",value:V,onChange:st=>G(st.target.value),autoComplete:"off"})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>p(0),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Xe,children:"Next"},"step3_handler")})]})})]})}),h.jsx(Zn,{eventKey:2,title:"Step 3",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsxs(To,{size:"",className:"mb-1",children:["Choose a media type to upload"," ",h.jsx("span",{className:"d-block font-13 text-gray6",children:"(Optional)"})]}),h.jsxs("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto",overflowX:"hidden"},children:[(s==null?void 0:s.length)>0&&h.jsx(fn,{className:"row-cols-2 mb-3 g-3",children:s==null?void 0:s.map((st,pt)=>h.jsx(Gt,{children:h.jsx(et,{className:"card-theme",onClick:()=>de(st),children:h.jsxs(et.Body,{className:"p-2 p-sm-3 justify-content-center d-flex flex-column",children:[h.jsxs("div",{className:"icon-wra",children:[st==="video"&&h.jsx(tn,{tag:"play1",className:"mb-2 font-36 text-theme-primary"}),st==="audio"&&h.jsx(tn,{tag:"consult1",className:"mb-2 font-36 text-theme-primary"}),st==="pdf"&&h.jsx(tn,{tag:"pdf1",className:"mb-2 font-36 text-theme-primary"}),st==="image"&&h.jsx(tn,{tag:"image2",className:"mb-2 font-36 text-theme-primary"})]}),h.jsxs("div",{className:"font-14 fw-sb pt-sm-2",children:[`Upload ${st}`,h.jsx("small",{className:"d-block fw-sb text-danger font-11",children:h.jsxs(h.Fragment,{children:["max ",d,"mb"]})})]})]})})},`${pt}-${st}`))}),h.jsx("div",{children:D&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"card card-theme shadow-sm rounded-3 border-0 mb-3 p-2",style:{backgroundColor:"var(--color-green-lighter)"},children:h.jsxs("div",{className:"d-flex media-header-container align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:"d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden rounded-circle",style:{backgroundColor:"var(--color-green-light)"},children:h.jsx(tn,{tag:"check1",className:"font-28 text-success"})})}),h.jsx("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:h.jsxs("span",{className:"d-block font-14",children:["Successfully uploaded selected ",N,". Click submit button to send a message."]})})]})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>p(1),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Xe,children:$?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):"Submit"},"submit_handler")})]})})]})})]}),h.jsx(Ybe,{show:Y,handleClose:ee,resSources:l,uploadMediaType:N,className:"",setUploadMediaUrl:P,saveUploadFile:We,deviceOS:m})]})})})}function lat(){ji();const[n,t]=k.useState(""),[i,s]=k.useState([]),[l,d]=k.useState([]),[u,p]=k.useState([]),[m,y]=k.useState(!1);k.useState([]),k.useState([]);const[_,E]=k.useState("step1"),[C,x]=k.useState(!1),[N,O]=k.useState({isVisible:!1}),[D,P]=k.useState(""),[j,M]=k.useState(""),[V,G]=k.useState(!1),$=k.useRef();JSON.parse(Ai.getAuthUser());const ne=["audio","video","image","pdf"],Y=["gallery"],le=500,re=async()=>{const Re=await Z2.getInfo();t(Re.platform)};k.useEffect(()=>{re()},[]);const ee=()=>{O({isVisible:!1})},de=Re=>{P(Re),O({isVisible:!0})},H=()=>{$.current.value="",d(i)};function ae(Re,Be){console.log("searchItems - filteredData =",Be);const Xe=Be.filter((we,We)=>we.name.toLowerCase().includes(Re.toLowerCase()));return console.log("Result =",Xe),Xe}const _e=Tx.debounce(Re=>{console.log("This is function from lodash..."),console.log("Search text =",Re);const Be=i;Re.trim().length>0?(console.log(Re.trim()),d(ae(Re.trim(),Be))):d(Be)},500),me=(Re,Be)=>{var Xe,we,We;if(console.log("Key in handleSelectedTab =",Re),console.log("formik in handleSelected Tag = ",Be),_==="step1"&&(Be!=null&&Be.values)&&!((Xe=Be.values)!=null&&Xe.receiver_ids)){Qt("User not selected!","error");return}if(_==="step2"&&(Be!=null&&Be.values)&&!((we=Be.values)!=null&&we.title)){Qt("Title required!","error");return}if(_==="step2"&&(Be!=null&&Be.values)&&!((We=Be.values)!=null&&We.body)){Qt("Message required!","error");return}E(Re)},Ce={receiver_ids:[],title:"",body:"",media_type:"",media_url:""},he=gc({}),pe=async(Re,{resetForm:Be})=>{console.log("Form Values :",Re);const Xe=i.filter((pt,Qe)=>Re.receiver_ids.includes(pt.id));console.log("receivers_info = ",Xe);const we=Xe.filter(pt=>pt.type==="user"),We=Xe.filter(pt=>pt.type=="group"),st={title:Re.title,body:Re.body,media_type:D,media_url:j,groups:We,users:we};console.log("Final formData = ",st),console.log("sendWallMessageResponse in onSubmit = ",sendWallMessageResponse)};async function Oe(Re){var Be,Xe;y(!0);try{const we=await ps.getAllRecipients(Re);if(we.data.status==="success"){console.log("getAllRecipients called == ",we.data);const We=(Xe=(Be=we.data)==null?void 0:Be.data)==null?void 0:Xe.recipients;console.log("userList == ",We);const st=[],pt=We.filter(Je=>st.includes(Je.id)?!1:(st.push(Je.id),!0));console.log("uniqueUserList == ",pt);const Qe=Date.now();console.log(Qe),localStorage.setItem(aYe,Qe),s(pt),d(pt),await Fe(pt),y(!1)}}catch(we){console.log("ERROR in getAllRecipients in send messages ",we),s([]),d([]),y(!1)}}const Fe=async Re=>{await g9.set({key:Afe,value:JSON.stringify(Re)}),console.log("Message user list stored")},Ue=async()=>{console.log("getUsers called..."),y(!0);const{value:Re}=await g9.get({key:Afe});if(console.log("messageUsers Users:",JSON.parse(Re)),Re){let Be=JSON.parse(Re);s(Be),d(Be),y(!1)}};k.useEffect(()=>{Ue()},[]);function Ve(Re){Re&&M(Re)}return h.jsx(qi,{className:"position-relative",children:h.jsxs(Yn,{className:"mb-4",children:[_==="step1"&&h.jsx(Lt,{type:"button",className:"btn-theme btn-sm btn-gray position-absolute px-1 py-1",style:{top:12,right:10,zIndex:1040},onClick:()=>Oe("message"),disabled:m,children:m?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ",h.jsx("span",{className:"ms-1",children:"Loading"})]}):h.jsxs(h.Fragment,{children:[h.jsx(tn,{tag:"reload4",className:"font-16 me-1"}),h.jsx("span",{className:"fw-sb font-13 btn-title",children:"Force Reload"})]})}),h.jsx(od,{initialValues:Ce,validationSchema:he,onSubmit:pe,children:Re=>{var Be,Xe;return console.log("initialValues - Receivers = ",Ce),console.log("formik.values - Receivers = ",Re.values),h.jsxs(kt,{className:"form_style",onSubmit:Re.handleSubmit,children:[h.jsxs(Zn.Container,{id:"appreciation-step-form",className:"main_tabs",activeKey:_,onSelect:we=>me(we),children:[h.jsx("div",{className:"tab_links d-none",children:h.jsxs(Un,{variant:"pills",className:"nav-stepper justify-content-center",children:[h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step1",children:h.jsx("div",{className:"",children:"1"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step2",children:h.jsx("div",{className:"",children:"2"})})}),h.jsx(Un.Item,{children:h.jsx(Un.Link,{className:"normal_link",eventKey:"step3",children:h.jsx("div",{children:"3"})})})]})}),h.jsxs(Zn.Content,{className:"p-2 pt-0",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"step1",unmountOnExit:!0,children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-1 pt-0 d-flex justify-content-between",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-danger",children:"*"})," Select Recipients"]}),h.jsxs("span",{className:"self-align-end font-13 text-gray6",children:["Selected: ",u==null?void 0:u.length]})]}),!m&&(i==null?void 0:i.length)>0?h.jsx("div",{className:"py-1",children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-1",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:we=>{console.log("Search input = ",we),_e(we.target.value)},ref:$,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((Be=$==null?void 0:$.current)==null?void 0:Be.value.length)>0&&h.jsx(Lt,{onClick:H,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(ow,{})},"search-clear-btn"),((Xe=$==null?void 0:$.current)==null?void 0:Xe.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${l==null?void 0:l.length}`})]})}):h.jsx(h.Fragment,{}),u&&u.length>0?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"d-flex justify-content-en",children:h.jsxs(Lt,{type:"button",className:"btn-theme btn-link btn-gray py-0 px-2 font-13 fw-sb text-gray6",onClick:()=>G(!V),"aria-controls":"selected-userlist-collapse","aria-expanded":open,children:[u==null?void 0:u.length," Selected",h.jsx(tn,{tag:"arrow-down2",className:"ms-1"})]},"show-select-user-toggle-btn")}),h.jsx(WQ,{in:V,children:h.jsx("div",{id:"selected-userlist-collapse",children:h.jsx("div",{className:"p-2 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto mb-1 border-bottom bg-gray-lighter2",children:h.jsx(h.Fragment,{children:u.map((we,We)=>h.jsxs("div",{className:"d-flex align-items-center p-1 rounded-3 text-wrap border me-2 bg-white",style:{maxWidth:100},children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0",style:{width:24,height:24},children:h.jsx("img",{src:we.image,className:"img-fluid mx-auto",alt:we.name,style:{objectFit:"cover"}})}),h.jsx("div",{className:"ms-1 font-11 text-truncate pt-1 flex-grow-1",children:we.name})]},we.id))})})})})]}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{maxHeight:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:m?h.jsx(ci,{type:"details"}):h.jsx(h.Fragment,{children:!m&&(i==null?void 0:i.length)>0?h.jsx(h.Fragment,{children:(l==null?void 0:l.length)>0?h.jsx(h.Fragment,{children:l.map((we,We)=>h.jsx(aat,{className:`${l.length!==We+1?"border-bottom":""}`,type:"checkbox",name:"receiver_ids",item:we,title:we==null?void 0:we.name,subTitle:we==null?void 0:we.type,id:we==null?void 0:we.id,iconImg:we==null?void 0:we.avatar,handleChange:Re.handleChange,isDisabled:!1,isChecked:Re.values.receiver_ids.indexOf(we==null?void 0:we.id)>-1,selectedUserList:u,setSelectedUserList:p},we.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No user found."})})})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more records"})})})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>me("step2",Re),children:"Next"},"step2_handler")})]})})]}),h.jsxs(Zn.Pane,{className:"",eventKey:"step2",unmountOnExit:!0,children:[h.jsxs("div",{className:"form-step-container",children:[h.jsx("div",{className:"font-14 fw-sb py-2",children:"Write a Message"}),h.jsx("div",{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Message Title"]}),h.jsx(kt.Control,{type:"text",placeholder:"",name:"title",...Re.getFieldProps("title"),autoComplete:"off"})]})}),h.jsx("div",{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Brief Message"]}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"body",...Re.getFieldProps("body"),autoComplete:"off"}),Re.touched.body&&Re.errors.body?h.jsx("p",{className:"error-state-text font-12 text-danger",children:Re.errors.body}):null]})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>me("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>me("step3",Re),children:"Next"},"step3_handler")})]})})]}),h.jsx(Zn.Pane,{className:"",eventKey:"step3",unmountOnExit:!0,children:h.jsx("div",{className:"form-step-container",children:h.jsxs("div",{className:"pt-2",children:[h.jsxs("div",{className:"font-14 fw-sb",children:["Choose a media type to upload"," ",h.jsx("span",{className:"d-block font-13 text-gray6",children:"(Optional)"})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto",overflowX:"hidden"},children:(ne==null?void 0:ne.length)>0&&h.jsx(fn,{className:"row-cols-2 mb-3 g-3",children:ne==null?void 0:ne.map((we,We)=>h.jsx(Gt,{children:h.jsx(et,{className:"card-theme",onClick:()=>de(we),children:h.jsxs(et.Body,{className:"p-2 p-sm-3 justify-content-center d-flex flex-column",children:[h.jsxs("div",{className:"icon-wra",children:[we==="video"&&h.jsx(tn,{tag:"play1",className:"mb-2 font-36 text-theme-primary"}),we==="audio"&&h.jsx(tn,{tag:"consult1",className:"mb-2 font-36 text-theme-primary"}),we==="pdf"&&h.jsx(tn,{tag:"pdf1",className:"mb-2 font-36 text-theme-primary"}),we==="image"&&h.jsx(tn,{tag:"image2",className:"mb-2 font-36 text-theme-primary"})]}),h.jsxs("div",{className:"font-14 fw-sb pt-sm-2",children:[`Upload ${we}`,h.jsx("small",{className:"d-block fw-sb text-danger font-11",children:h.jsxs(h.Fragment,{children:["max ",le,"mb"]})})]})]})})},`${We}-type`))})}),j&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"card card-theme shadow-sm rounded-3 border-0 mb-3 p-2",style:{backgroundColor:"var(--color-green-lighter)"},children:h.jsxs("div",{className:"d-flex media-header-container align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:"d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden rounded-circle",style:{backgroundColor:"var(--color-green-light)"},children:h.jsx(tn,{tag:"check1",className:"font-28 text-success"})})}),h.jsx("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:h.jsxs("span",{className:"d-block font-14",children:["Successfully uploaded selected"," ",D,". Click submit button to send a message."]})})]})})})]})})})]})]}),h.jsx(Ybe,{show:N,handleClose:ee,resSources:Y,uploadMediaType:D,className:"",setUploadMediaUrl:M,saveUploadFile:Ve,deviceOS:n}),_==="step3"&&h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Lt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>me("step2"),children:"Prev"},"prev_step2_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Lt,{type:"submit",className:"btn-theme btn-primary btn-md w-100",children:C?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):Re.isValid?"Submit":"Please fill out all info"})})})]})})]})}})]})})}function cat(){const n=ji(),[t,i]=k.useState(!1),s={password:""},l=gc().shape({password:Ef().required("Please enter a valid password")});async function d(u,{resetForm:p}){console.log("Executing change password on submit = ",u),i(!0),Ai.changePassword(u).then(m=>{console.log("changePassword Response: ",m),m.data.status==="success"&&(console.log("Success response =",m.data),Qt("Password changed successfully!","success"),i(!1),n("/dashboard")),m.data.status==="failed"&&(console.log("Failed ERROR response : ",m.data),Qt("Failed to change password!","error"),i(!1))}).catch(m=>{var y,_,E;i(!1),((y=m.response)==null?void 0:y.data.status)==="failed"&&Qt((_=m.response)==null?void 0:_.data.message,"error"),console.log("Change Password Error = ",m),console.log("Change Password Error response = ",(E=m.response)==null?void 0:E.data)})}return h.jsx(h.Fragment,{children:h.jsx(qi,{className:"change-password-page",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsx(et.Body,{children:h.jsx("div",{className:"form-container",children:h.jsx(od,{initialValues:s,validationSchema:l,onSubmit:d,children:u=>h.jsxs(kt,{onSubmit:u.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group mb-3",children:[h.jsx(kt.Label,{className:"pe-none",children:"New Password"}),h.jsx(kt.Control,{type:"password",placeholder:"New Password",name:"password",value:u.values.password,onBlur:u.handleBlur,onChange:u.handleChange,required:!0,autoComplete:"off"}),u.touched.password&&u.errors.password?h.jsx("p",{className:"form-error",children:u.errors.password}):null]}),h.jsx("div",{className:"btn-wrapper pt-3",children:h.jsx(Lt,{type:"submit",size:"lg",disabled:!u.isValid,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:t?h.jsxs(h.Fragment,{children:[h.jsx(Zi,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):u.isValid?"Submit":"Please fill out all info"})})]})})})})})})})})}var NN;(function(n){n.Dark="DARK",n.Light="LIGHT",n.Default="DEFAULT"})(NN||(NN={}));var dme;(function(n){n.None="NONE",n.Slide="SLIDE",n.Fade="FADE"})(dme||(dme={}));const G4=lu("StatusBar"),Xbe=lu("EdgeToEdge",{});var ume;(function(n){n.WHITE="#FFFFFF",n.BLACK="#000000",n.TRANSPARENT="transparent"})(ume||(ume={}));const Jbe=lu("NavigationBar",{web:()=>lr(()=>import("./web-nZM4McFF.js"),__vite__mapDeps([])).then(n=>new n.NavigationBarWeb)}),dat=({component:n,...t})=>{const i=async()=>{const m=await Z2.getInfo();m.platform!=="web"&&l(),m.platform==="android"&&s()},s=async()=>{u(oEe)},l=async()=>{d()},d=async()=>{await G4.setStyle({style:NN.Light})},u=async m=>{await G4.setBackgroundColor({color:m}),await Xbe.setBackgroundColor({color:m}),await Jbe.setNavigationBarColor({color:"#000000"})};k.useEffect(()=>{i()},[]);let p=Ai.getToken();return h.jsx(h.Fragment,{children:p?h.jsx(v1e,{to:"/dashboard"}):h.jsx(n,{...t})})},Gc=({component:n,auth:t,...i})=>{const{backLink:s}=k.useContext(qU);let l=localStorage.getItem("auth_token");const{page:d}={...i},u=async()=>{const C=await Z2.getInfo();C.platform!=="web"&&E(),C.platform==="android"&&_()},p=async()=>{console.log("setStatusBarStyleDark called"),await G4.setStyle({style:NN.Dark})},m=async()=>{console.log("setStatusBarStyleLight called"),await G4.setStyle({style:NN.Light})},y=async C=>{console.log("setBackgroundColor called"),await G4.setBackgroundColor({color:C}),await Xbe.setBackgroundColor({color:C}),await Jbe.setNavigationBarColor({color:"#000000"})},_=async()=>{d!=="login"?(console.log("Inside if (page !== 'login')"),y(Y2)):(console.log("Inside Else (page === 'login')"),y(oEe))},E=async()=>{d!=="login"?(console.log("Inside if (page !== 'login')"),p()):(console.log("Inside Else (page === 'login')"),m())};return k.useEffect(()=>{u()},[]),k.useEffect(()=>{SN.addListener("backButton",({canGoBack:C})=>{console.log("Got the canGoBack in backButton listener...",C),C?(console.log("Got the canGoBack in backButton listener Else ...",C),window.location.href=s):(console.log("Got the canGoBack in backButton listener if ...",C),SN.exitApp())})},[s]),h.jsx(h.Fragment,{children:l?h.jsx(n,{...i}):h.jsx(v1e,{to:"/"})})},uat=k.createContext(),hat={name:"Bhavee Khune",imgUrl:"",desig:"Area Business Manager",email:"bhaveshkhune@gmail.com",mobile:"9823432230",address:{HQ:"Pune East",terrytory:"Pune East",area:"Pune",region:"Maharashtra",zone:"Central India",city:"Pune",state:"Maharashtra",pincode:411041,address:"Flat no 1706, Manhattan, Pride World City"}},fat=lu("SplashScreen",{web:()=>lr(()=>import("./web-C2gEL8jM.js"),__vite__mapDeps([])).then(n=>new n.SplashScreenWeb)}),oC=lu("PushNotifications",{});function pat(){fat.hide();const[n,t]=k.useState(!1),[i,s]=k.useState("light"),[l,d]=k.useState(hat),[u,p]=k.useState("/"),[m,y]=k.useState(null),_=async()=>{const x=await Z2.getInfo(),N=await Z2.getId(),O=await SN.getInfo();localStorage.setItem("deviceInfo",JSON.stringify(x)),localStorage.setItem("appCurrentVersion",O.version),localStorage.setItem("appID",O.id),localStorage.setItem("deviceID",N.identifier)};k.useEffect(()=>{_()},[Ai.getToken()]),k.useEffect(()=>{const x=localStorage.getItem("theme");xLe(x||i,s),Ai.getToken()&&t(!0)},[]),k.useEffect(()=>{console.log("refreshToken() and appStateChange listener useEffect");const x=SN.addListener("appStateChange",({isActive:N})=>{N&&console.log("App foregrounded and about to call refreshToken()")});return()=>{x.remove()}},[]);async function E(){cEe.getNotificationStats().then(x=>{var N;x.data.status==="success"&&(console.log("Response from getNotificationsStats on SUCCESS =",x),y((N=x.data)==null?void 0:N.data))}).catch(x=>{y(null),console.log("Error in catch in getNotificationsStats =",x)})}k.useEffect(()=>{Ai.getToken()&&(console.log("...Calling registerDeviceForPushNotification() from App useEffect..."),Ai.registerDeviceForPushNotification(),E())},[]),k.useEffect(()=>{console.log("--**********************--"),console.log("Push notification code useEffect runs..."),console.log("--**********************--"),oC.checkPermissions().then(x=>{x.receive!=="granted"?oC.requestPermissions().then(N=>{N.receive==="denied"?console.log("Push Notification permission denied"):(console.log("Push Notification permission granted"),C())}):(console.log("if (res.receive !== 'granted') Else Part calling registerNotifications() ",x==null?void 0:x.receive),C())})},[]);async function C(){console.log("--**********************--"),console.log("Initializing HomePage - registerNotifications () called"),console.log("--**********************--"),await oC.register(),await oC.addListener("registration",x=>{console.log("PushNotifications.addListener - registration runs Token = ",x),localStorage.setItem("notificationToken",x.value)}),await oC.addListener("registrationError",x=>{console.log("PushNotifications.addListener - registrationError runs"),console.log("Error on PushNotifications registration: "+JSON.stringify(x))}),oC.addListener("pushNotificationActionPerformed",x=>{var O;console.log("PushNotifications.addListener - pushNotificationActionPerformed"),console.log("Tapped on notification: ",x);let N=Ai.getToken();if(console.log("-- ** user_token = ",N),N){console.log("--**********************--",N);let D=q1e((O=x==null?void 0:x.notification)==null?void 0:O.data);window.location.href=D}else window.location.href="/"})}return h.jsx(h.Fragment,{children:h.jsxs("div",{className:"app-wrapper",children:[h.jsx(RLe,{position:"bottom-center",hideProgressBar:!0,transition:CLe,theme:"dark",className:"custom-toast",autoClose:3e3}),h.jsx(qU.Provider,{value:{userProfile:l,notificationStats:m,backLink:u,setBackLink:p},children:h.jsx(uat.Provider,{value:{theme:i,setTheme:s},children:h.jsx(dLe,{children:h.jsxs(iLe,{children:[h.jsx(gi,{path:"/",element:h.jsx(dat,{component:s$e})}),h.jsx(gi,{path:"/app-icons",element:h.jsx(BBe,{})}),h.jsx(gi,{path:"/dashboard",element:h.jsx(Gc,{auth:n,component:Bc,page:"dashboard"}),children:h.jsx(gi,{index:!0,element:h.jsx(gYe,{})})}),h.jsxs(gi,{path:"/profile",element:h.jsx(Gc,{auth:n,component:Bc,page:"profile"}),children:[h.jsx(gi,{path:"change-password",element:h.jsx(cat,{})}),h.jsx(gi,{index:!0,element:h.jsx(yXe,{})})]}),h.jsx(gi,{path:"/quick-actions",element:h.jsx(Gc,{auth:n,component:Bc,page:"quick-actions"}),children:h.jsx(gi,{index:!0,element:h.jsx(SYe,{})})}),h.jsx(gi,{path:"/quick-actions-content",element:h.jsx(Gc,{auth:n,component:Bc,page:"quick-actions-content"}),children:h.jsx(gi,{index:!0,element:h.jsx(EXe,{})})}),h.jsx(gi,{path:"/notifications",element:h.jsx(Gc,{auth:n,component:Bc,page:"notifications"}),children:h.jsx(gi,{index:!0,element:h.jsx(EYe,{})})}),h.jsxs(gi,{path:"/appreciations",element:h.jsx(Gc,{auth:n,component:Bc,page:"appreciations"}),children:[h.jsx(gi,{path:"send-appreciations2",element:h.jsx(Zst,{})}),h.jsx(gi,{path:"send-appreciations",element:h.jsx(Jst,{})}),h.jsx(gi,{index:!0,element:h.jsx(MYe,{})})]}),h.jsxs(gi,{path:"/badges",element:h.jsx(Gc,{auth:n,component:Bc,page:"badges"}),children:[h.jsx(gi,{path:"send-badges2",element:h.jsx(rat,{})}),h.jsx(gi,{path:"send-badges",element:h.jsx(iat,{})}),h.jsx(gi,{index:!0,element:h.jsx(NYe,{})})]}),h.jsx(gi,{path:"/rewards",element:h.jsx(Gc,{auth:n,component:Bc,page:"rewards"}),children:h.jsx(gi,{index:!0,element:h.jsx(PYe,{})})}),h.jsx(gi,{path:"/metric-reports",element:h.jsx(Gc,{auth:n,component:Bc,page:"metric-reports"}),children:h.jsx(gi,{index:!0,element:h.jsx(_Xe,{})})}),h.jsxs(gi,{path:"/approve-reject-form-submission",element:h.jsx(Gc,{auth:n,component:Bc,page:"approve-reject-form-submission"}),children:[h.jsx(gi,{path:":entityId",element:h.jsx(Lpe,{})}),h.jsx(gi,{index:!0,element:h.jsx(Lpe,{})})]}),h.jsxs(gi,{path:"/magazines",element:h.jsx(Gc,{auth:n,component:Bc,page:"magazines"}),children:[h.jsx(gi,{path:":magazineId",element:h.jsx(Ztt,{})}),h.jsx(gi,{index:!0,element:h.jsx(SXe,{})})]}),h.jsxs(gi,{path:"/messages",element:h.jsx(Gc,{auth:n,component:Bc,page:"messages"}),children:[h.jsx(gi,{path:"send-message2",element:h.jsx(lat,{})}),h.jsx(gi,{path:"send-message",element:h.jsx(oat,{})}),h.jsx(gi,{path:":msgId",element:h.jsx(zit,{})}),h.jsx(gi,{index:!0,element:h.jsx(Wit,{})})]}),h.jsxs(gi,{path:"/contests",element:h.jsx(Gc,{auth:n,component:Bc,page:"contests"}),children:[h.jsx(gi,{path:":contestId",element:h.jsx(lrt,{})}),h.jsx(gi,{path:":contestId/upload-response",element:h.jsx(prt,{})}),h.jsx(gi,{path:":contestId/evaluate",element:h.jsx(mrt,{})}),h.jsx(gi,{index:!0,element:h.jsx(Yit,{})})]}),h.jsxs(gi,{path:"/competition-contests",element:h.jsx(Gc,{auth:n,component:Bc,page:"competition-contests"}),children:[h.jsx(gi,{path:"competition-contest-details",element:h.jsx(nat,{})}),h.jsx(gi,{index:!0,element:h.jsx(tat,{})})]})]})})})})]})})}const mat=new Pqe,gat=l1e.createClient({mode:"rtc",codec:"h264"});ZK.createRoot(document.getElementById("root")).render(h.jsx(jqe,{client:mat,children:h.jsx(q0e,{client:gat,children:h.jsx(pat,{})})}));export{aEe as W,DF as a,Pnt as b,ty as g,gJe as p,k as r,vF as u};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = []
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}