(()=>{"use strict";const e={d:(t,n)=>{if(Array.isArray(n))for(var s=0;sObject.prototype.hasOwnProperty.call(e,t),e.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.dn=e=>{(Object.getOwnPropertyDescriptor(e,"name")||{}).writable||Object.defineProperty(e,"name",{value:"default",configurable:!0})};var t={};function n(e,t){return function(){return e.apply(t,arguments)}}e.r(t),e.d(t,{hasBrowserEnv:()=>Oe,hasStandardBrowserEnv:()=>Ae,hasStandardBrowserWebWorkerEnv:()=>Te,navigator:()=>Re,origin:()=>Ce});const{toString:s}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:r,toStringTag:o}=Symbol,a=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),l=(e,t)=>{let n=e;const s=[];for(;null!=n&&n!==Object.prototype;){if(-1!==s.indexOf(n))return!1;if(s.push(n),a(n,t))return!0;n=i(n)}return!1},d=(c=Object.create(null),e=>{const t=s.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const h=e=>(e=e.toLowerCase(),t=>d(t)===e),u=e=>t=>typeof t===e,{isArray:f}=Array,p=u("undefined");function m(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&w(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g=h("ArrayBuffer"),_=u("string"),w=u("function"),b=u("number"),v=e=>null!==e&&"object"==typeof e,y=e=>{if(!v(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==i(t)||l(e,o)||l(e,r))},E=h("Date"),S=h("File"),k=h("Blob"),x=h("FileList"),O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e.g?e.g:{},R=void 0!==O.FormData?O.FormData:void 0,A=h("URLSearchParams"),[T,C,I,U]=["ReadableStream","Request","Response","Headers"].map(h);function D(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let s,i;if("object"!=typeof e&&(e=[e]),f(e))for(s=0,i=e.length;s0;)if(s=n[i],t===s.toLowerCase())return s;return null}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e.g,N=e=>!p(e)&&e!==L,z=(B="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>B&&e instanceof B);var B;const F=h("HTMLFormElement"),{propertyIsEnumerable:j}=Object.prototype,M=h("RegExp"),H=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};D(n,(n,i)=>{let r;!1!==(r=t(n,i,e))&&(s[i]=r||n)}),Object.defineProperties(e,s)},Z=h("AsyncFunction"),q=($="function"==typeof setImmediate,W=w(L.postMessage),$?setImmediate:W?(K=`axios@${Math.random()}`,V=[],L.addEventListener("message",({source:e,data:t})=>{e===L&&t===K&&V.length&&V.shift()()},!1),e=>{V.push(e),L.postMessage(K,"*")}):e=>setTimeout(e));var $,W,K,V;const X="undefined"!=typeof queueMicrotask?queueMicrotask.bind(L):"undefined"!=typeof process&&process.nextTick||q,J=e=>null!=e&&w(e[r]),Y={isArray:f,isArrayBuffer:g,isBuffer:m,isFormData:e=>{if(!e)return!1;if(R&&e instanceof R)return!0;const t=i(e);if(!t||t===Object.prototype)return!1;if(!w(e.append))return!1;const n=d(e);return"formdata"===n||"object"===n&&w(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t},isString:_,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:y,isEmptyObject:e=>{if(!v(e)||m(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:T,isRequest:C,isResponse:I,isHeaders:U,isUndefined:p,isDate:E,isFile:S,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:k,isRegExp:M,isFunction:w,isStream:e=>v(e)&&w(e.pipe),isURLSearchParams:A,isTypedArray:z,isFileList:x,forEach:D,merge:function e(...t){const{caseless:n,skipUndefined:s}=N(this)&&this||{},i={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=n&&"string"==typeof r&&P(i,r)||r,l=a(i,o)?i[o]:void 0;y(l)&&y(t)?i[o]=e(l,t):y(t)?i[o]=e({},t):f(t)?i[o]=t.slice():s&&p(t)||(i[o]=t)};for(let e=0,n=t.length;e(D(t,(t,i)=>{s&&w(t)?Object.defineProperty(e,i,{__proto__:null,value:n(t,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,s)=>{let r,o,a;const l={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)a=r[o],s&&!s(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:d,kindOfTest:h,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return-1!==s&&s===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let s;for(;(s=n.next())&&!s.done;){const n=s.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const s=[];for(;null!==(n=e.exec(t));)s.push(n);return s},isHTMLForm:F,hasOwnProperty:a,hasOwnProp:a,hasOwnInPrototypeChain:l,getSafeProp:(e,t)=>null!=e&&l(e,t)?e[t]:void 0,reduceDescriptors:H,freezeMethods:e=>{H(e,(t,n)=>{if(w(e)&&["arguments","caller","callee"].includes(n))return!1;const s=e[n];w(s)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},s=e=>{e.forEach(e=>{n[e]=!0})};return f(e)?s(e):s(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:P,global:L,isContextDefined:N,isSpecCompliantForm:function(e){return!!(e&&w(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(v(e)){if(t.has(e))return;if(m(e))return e;if(!("toJSON"in e)){t.add(e);const s=f(e)?[]:{};return D(e,(e,t)=>{const i=n(e);!p(i)&&(s[t]=i)}),t.delete(e),s}}return e};return n(e)},isAsyncFn:Z,isThenable:e=>e&&(v(e)||w(e))&&w(e.then)&&w(e.catch),setImmediate:q,asap:X,isIterable:J,isSafeIterable:e=>null!=e&&l(e,r)&&J(e)},G=Y.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"]),Q=e=>{const t={};let n,s,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),s=e.substring(i+1).trim(),!n||t[n]&&G[n]||("set-cookie"===n?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t};e.dn(Q);const ee=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),te=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ne(e,t){return Y.isArray(e)?e.map(e=>ne(e,t)):function(e){let t=0,n=e.length;for(;tt;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function se(e){const t=Object.create(null);return Y.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ne(e,te))(e)}),t}const ie=Symbol("internals");function re(e){return e&&String(e).trim().toLowerCase()}function oe(e){return!1===e||null==e?e:Y.isArray(e)?e.map(oe):(e=>ne(e,ee))(String(e))}function ae(e,t,n,s,i){return Y.isFunction(s)?s.call(this,t,n):(i&&(t=n),Y.isString(t)?Y.isString(s)?-1!==t.indexOf(s):Y.isRegExp(s)?s.test(t):void 0:void 0)}class le{constructor(e){e&&this.set(e)}set(e,t,n){const s=this;function i(e,t,n){const i=re(t);if(!i)return;const r=Y.findKey(s,i);(!r||void 0===s[r]||!0===n||void 0===n&&!1!==s[r])&&(s[r||t]=oe(e))}const r=(e,t)=>Y.forEach(e,(e,n)=>i(e,n,t));if(Y.isPlainObject(e)||e instanceof this.constructor)r(e,t);else if(Y.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))r(Q(e),t);else if(Y.isObject(e)&&Y.isSafeIterable(e)){let n,s,i=Object.create(null);for(const t of e){if(!Y.isArray(t))throw new TypeError("Object iterator must return a key-value pair");s=t[0],Y.hasOwnProp(i,s)?(n=i[s],i[s]=Y.isArray(n)?[...n,t[1]]:[n,t[1]]):i[s]=t[1]}r(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=re(e)){const n=Y.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}(e);if(Y.isFunction(t))return t.call(this,e,n);if(Y.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=re(e)){const n=Y.findKey(this,e);return!(!n||void 0===this[n]||t&&!ae(0,this[n],n,t))}return!1}delete(e,t){const n=this;let s=!1;function i(e){if(e=re(e)){const i=Y.findKey(n,e);!i||t&&!ae(0,n[i],i,t)||(delete n[i],s=!0)}}return Y.isArray(e)?e.forEach(i):i(e),s}clear(e){const t=Object.keys(this);let n=t.length,s=!1;for(;n--;){const i=t[n];e&&!ae(0,this[i],i,e,!0)||(delete this[i],s=!0)}return s}normalize(e){const t=this,n={};return Y.forEach(this,(s,i)=>{const r=Y.findKey(n,i);if(r)return t[r]=oe(s),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();o!==i&&delete t[i],t[o]=oe(s),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Y.forEach(this,(n,s)=>{null!=n&&!1!==n&&(t[s]=e&&Y.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,n=this.prototype;function s(e){const s=re(e);t[s]||(function(e,t){const n=Y.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{__proto__:null,value:function(e,n,i){return this[s].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[s]=!0)}return Y.isArray(e)?e.forEach(s):s(e),this}}le.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(le.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Y.freezeMethods(le);const de=le;class ce extends Error{static from(e,t,n,s,i,r){const o=new ce(e.message,t||e.code,n,s,i);return Object.defineProperty(o,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),r&&Object.assign(o,r),o}constructor(e,t,n,s,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&Y.hasOwnProp(e,"redact")?e.redact:void 0,n=Y.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),s=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(Y.isBuffer(e))return e;if(-1!==s.indexOf(e))return;let t;if(e instanceof de&&(e=e.toJSON()),s.push(e),Y.isArray(e))t=[],e.forEach((e,n)=>{const s=i(e);Y.isUndefined(s)||(t[n]=s)});else{if(!Y.isPlainObject(e)&&function(e){if(Y.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Y.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return s.pop(),e;t=Object.create(null);for(const[s,r]of Object.entries(e)){const e=n.has(s.toLowerCase())?"[REDACTED ****]":i(r);Y.isUndefined(e)||(t[s]=e)}}return s.pop(),t};return i(e)}(e,t):Y.toJSONObject(e);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:n,code:this.code,status:this.status}}}ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ce.ERR_BAD_OPTION="ERR_BAD_OPTION",ce.ECONNABORTED="ECONNABORTED",ce.ETIMEDOUT="ETIMEDOUT",ce.ECONNREFUSED="ECONNREFUSED",ce.ERR_NETWORK="ERR_NETWORK",ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ce.ERR_DEPRECATED="ERR_DEPRECATED",ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ce.ERR_CANCELED="ERR_CANCELED",ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ce.ERR_INVALID_URL="ERR_INVALID_URL",ce.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const he=ce;function ue(e){return Y.isPlainObject(e)||Y.isArray(e)}function fe(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function pe(e,t,n){return e?e.concat(t).map(function(e,t){return e=fe(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const me=Y.toFlatObject(Y,{},null,function(e){return/^is[A-Z]/.test(e)}),ge=function(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const s=(n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Y.isUndefined(t[e])})).metaTokens,i=n.visitor||f,r=n.dots,o=n.indexes,a=n.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===n.maxDepth?100:n.maxDepth,d=a&&Y.isSpecCompliantForm(t),c=[];if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function h(e){if(null===e)return"";if(Y.isDate(e))return e.toISOString();if(Y.isBoolean(e))return e.toString();if(!d&&Y.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");if(Y.isArrayBuffer(e)||Y.isTypedArray(e)){if(d&&"function"==typeof a)return new a([e]);if("undefined"!=typeof Buffer)return Buffer.from(e);throw new he("Blob is not supported. Use a Buffer instead.",he.ERR_NOT_SUPPORT)}return e}function u(e){if(e>l)throw new he("Object is too deeply nested ("+e+" levels). Max depth: "+l,he.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,i){let a=e;if(Y.isReactNative(t)&&Y.isReactNativeBlob(e))return t.append(pe(i,n,r),h(e)),!1;if(e&&!i&&"object"==typeof e)if(Y.endsWith(n,"{}"))n=s?n:n.slice(0,-2),e=function(e){if(l===1/0)return JSON.stringify(e);const t=[];return JSON.stringify(e,function(e,n){if(!Y.isObject(n))return n;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(n),u(1+t.length-1),n})}(e);else if(Y.isArray(e)&&function(e){return Y.isArray(e)&&!e.some(ue)}(e)||(Y.isFileList(e)||Y.endsWith(n,"[]"))&&(a=Y.toArray(e)))return n=fe(n),a.forEach(function(e,s){!Y.isUndefined(e)&&null!==e&&t.append(!0===o?pe([n],s,r):null===o?n:n+"[]",h(e))}),!1;return!!ue(e)||(t.append(pe(i,n,r),h(e)),!1)}const p=Object.assign(me,{defaultVisitor:f,convertValue:h,isVisitable:ue});if(!Y.isObject(e))throw new TypeError("data must be an object");return function e(n,s,r=0){if(!Y.isUndefined(n)){if(u(r),-1!==c.indexOf(n))throw new Error("Circular reference detected in "+s.join("."));c.push(n),Y.forEach(n,function(n,o){!0===(!(Y.isUndefined(n)||null===n)&&i.call(t,n,Y.isString(o)?o.trim():o,s,p))&&e(n,s?s.concat(o):[o],r+1)}),c.pop()}}(e),t};function _e(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function we(e,t){this._pairs=[],e&&ge(e,this,t)}const be=we.prototype;be.append=function(e,t){this._pairs.push([e,t])},be.toString=function(e){const t=e?t=>e.call(this,t,_e):_e;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ve=we;function ye(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ee(e,t,n){if(!t)return e;e=e||"";const s=Y.isFunction(n)?{serialize:n}:n,i=Y.getSafeProp(s,"encode")||ye,r=Y.getSafeProp(s,"serialize");let o;if(o=r?r(t,s):Y.isURLSearchParams(t)?t.toString():new ve(t,s).toString(i),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const Se=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,function(t){null!==t&&e(t)})}},ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},xe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ve,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Oe="undefined"!=typeof window&&"undefined"!=typeof document,Re="object"==typeof navigator&&navigator||void 0,Ae=Oe&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Te="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ce=Oe&&window.location.href||"http://localhost",Ie={...t,...xe};function Ue(e){if(e>100)throw new he("FormData field is too deeply nested ("+e+" levels). Max depth: 100",he.ERR_FORM_DATA_DEPTH_EXCEEDED)}const De=function(e){function t(e,n,s,i){Ue(i);let r=e[i++];if("__proto__"===r)return!0;const o=Number.isFinite(+r),a=i>=e.length;return r=!r&&Y.isArray(s)?s.length:r,a?(Y.hasOwnProp(s,r)?s[r]=Y.isArray(s[r])?s[r].concat(n):[s[r],n]:s[r]=n,!o):(Y.hasOwnProp(s,r)&&Y.isObject(s[r])||(s[r]=[]),t(e,n,s[r],i)&&Y.isArray(s[r])&&(s[r]=function(e){const t={},n=Object.keys(e);let s;const i=n.length;let r;for(s=0;s{t(function(e){const t=[],n=/\w+|\[(\w*)]/g;let s;for(;null!==(s=n.exec(e));)Ue(t.length),t.push("[]"===s[0]?"":s[1]||s[0]);return t}(e),s,n,0)}),n}return null},Pe=(e,t)=>null!=e&&Y.hasOwnProp(e,t)?e[t]:void 0,Le={transitional:ke,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=Y.isObject(e);if(i&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return s?JSON.stringify(De(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e)||Y.isReadableStream(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(i){const t=Pe(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ge(e,new Ie.classes.URLSearchParams,{visitor:function(e,t,n,s){return Ie.isNode&&Y.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((r=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Pe(this,"env"),s=n&&n.FormData;return ge(r?{"files[]":e}:e,s&&new s,t)}}return i||s?(t.setContentType("application/json",!1),function(e){if(Y.isString(e))try{return(0,JSON.parse)(e),Y.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Pe(this,"transitional")||Le.transitional,n=t&&t.forcedJSONParsing,s=Pe(this,"responseType"),i="json"===s;if(Y.isResponse(e)||Y.isReadableStream(e))return e;if(e&&Y.isString(e)&&(n&&!s||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Pe(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,Pe(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ie.classes.FormData,Blob:Ie.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch","query"],e=>{Le.headers[e]={}});const Ne=Le;function ze(e,t){const n=this||Ne,s=t||n,i=de.from(s.headers);let r=s.data;return Y.forEach(e,function(e){r=e.call(n,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Be(e){return!(!e||!e.__CANCEL__)}const Fe=class extends he{constructor(e,t,n){super(e??"canceled",he.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function je(e,t,n){const s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(new he("Request failed with status code "+n.status,n.status>=400&&n.status<500?he.ERR_BAD_REQUEST:he.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Me=(e,t,n=3)=>{let s=0;const i=function(e,t){e=e||10;const n=new Array(e),s=new Array(e);let i,r=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),d=s[o];i||(i=l),n[r]=a,s[r]=l;let c=o,h=0;for(;c!==r;)h+=n[c++],c%=e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),l-i{i=r,n=null,s&&(clearTimeout(s),s=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=r?o(e,t):(n=e,s||(s=setTimeout(()=>{s=null,o(n)},r-a)))},()=>n&&o(n)]}(n=>{if(!n||"number"!=typeof n.loaded)return;const r=n.loaded,o=n.lengthComputable?n.total:void 0,a=null!=o?Math.min(r,o):r,l=Math.max(0,a-s),d=i(l);s=Math.max(s,a),e({loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:d||void 0,estimated:d&&o?(o-a)/d:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})},n)},He=(e,t)=>{const n=null!=e;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Ze=e=>(...t)=>Y.asap(()=>e(...t)),qe=Ie.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ie.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ie.origin),Ie.navigator&&/(msie|trident)/i.test(Ie.navigator.userAgent)):()=>!0,$e=Ie.hasStandardBrowserEnv?{write(e,t,n,s,i,r,o){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Y.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Y.isString(s)&&a.push(`path=${s}`),Y.isString(i)&&a.push(`domain=${i}`),!0===r&&a.push("secure"),Y.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;nnull,remove(){}},We=/^https?:(?!\/\/)/i,Ke=/[\t\n\r]/g;function Ve(e,t){if("string"==typeof e&&We.test(function(e){return function(e){let t=0;for(;te instanceof de?{...e}:e;function Ye(e,t){e=e||{},t=t||{};const n=Object.create(null);function s(e,t,n,s){return Y.isPlainObject(e)&&Y.isPlainObject(t)?Y.merge.call({caseless:s},e,t):Y.isPlainObject(t)?Y.merge({},t):Y.isArray(t)?t.slice():t}function i(e,t,n,i){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:s(void 0,e,0,i):s(e,t,0,i)}function r(e,t){if(!Y.isUndefined(t))return s(void 0,t)}function o(e,t){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function a(n,i,r){return Y.hasOwnProp(t,r)?s(n,i):Y.hasOwnProp(e,r)?s(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const l={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:a,headers:(e,t,n)=>i(Je(e),Je(t),0,!0)};return Y.forEach(Object.keys({...e,...t}),function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const r=Y.hasOwnProp(l,s)?l[s]:i,o=r(Y.hasOwnProp(e,s)?e[s]:void 0,Y.hasOwnProp(t,s)?t[s]:void 0,s);Y.isUndefined(o)&&r!==a||(n[s]=o)}),Y.hasOwnProp(t,"validateStatus")&&Y.isUndefined(t.validateStatus)&&!1===function(n){const s=Y.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Y.isUndefined(s)){if(!Y.isPlainObject(s))return;if(Y.hasOwnProp(s,n))return s[n]}const i=Y.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Y.isPlainObject(i)&&Y.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Y.hasOwnProp(e,"validateStatus")?n.validateStatus=s(void 0,e.validateStatus):delete n.validateStatus),n}const Ge=["content-type","content-length"],Qe=function(e){const t=Ye({},e),n=e=>Y.hasOwnProp(t,e)?t[e]:void 0,s=n("data");let i=n("withXSRFToken");const r=n("xsrfHeaderName"),o=n("xsrfCookieName");let a=n("headers");const l=n("auth"),d=n("baseURL"),c=n("allowAbsoluteUrls"),h=n("url");if(t.headers=a=de.from(a),t.url=Ee(Xe(d,h,c,t),n("params"),n("paramsSerializer")),l){const t=Y.getSafeProp(l,"username")||"",n=Y.getSafeProp(l,"password")||"";try{a.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw he.from(t,he.ERR_BAD_OPTION_VALUE,e)}}if(Y.isFormData(s)&&(Ie.hasStandardBrowserEnv||Ie.hasStandardBrowserWebWorkerEnv||Y.isReactNative(s)?a.setContentType(void 0):Y.isFunction(s.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{Ge.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(a,s.getHeaders(),n("formDataHeaderPolicy"))),Ie.hasStandardBrowserEnv&&(Y.isFunction(i)&&(i=i(t)),!0===i||null==i&&qe(t.url))){const e=r&&o&&$e.read(o);e&&a.set(r,e)}return t},et="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const s=Qe(e);let i=s.data;const r=de.from(s.headers).normalize();let o,a,l,d,c,{responseType:h,onUploadProgress:u,onDownloadProgress:f}=s;function p(){d&&d(),c&&c(),s.cancelToken&&s.cancelToken.unsubscribe(o),s.signal&&s.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const s=de.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());je(function(e){t(e),p()},function(e){n(e),p()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:s,config:e,request:m}),m=null}m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new he("Request aborted",he.ECONNABORTED,e,m)),p(),m=null)},m.onerror=function(t){const s=t&&t.message?t.message:"Network Error",i=new he(s,he.ERR_NETWORK,e,m);i.event=t||null,n(i),p(),m=null},m.ontimeout=function(){let t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const i=s.transitional||ke;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),n(new he(t,i.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,m)),p(),m=null},void 0===i&&r.setContentType(null),"setRequestHeader"in m&&Y.forEach(se(r),function(e,t){m.setRequestHeader(t,e)}),Y.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),h&&"json"!==h&&(m.responseType=s.responseType),f&&([l,c]=Me(f,!0),m.addEventListener("progress",l)),u&&m.upload&&([a,d]=Me(u),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",d)),(s.cancelToken||s.signal)&&(o=t=>{m&&(n(!t||t.type?new Fe(null,e,m):t),m.abort(),p(),m=null)},s.cancelToken&&s.cancelToken.subscribe(o),s.signal&&(s.signal.aborted?o():s.signal.addEventListener("abort",o)));const _=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(s.url);if(_&&!Ie.protocols.includes(_))return n(new he("Unsupported protocol "+_+":",he.ERR_BAD_REQUEST,e)),void p();m.send(i||null)})},tt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let s=!1;const i=function(e){if(!s){s=!0,o();const t=e instanceof Error?e:this.reason;n.abort(t instanceof he?t:new Fe(t instanceof Error?t.message:t))}};let r=t&&setTimeout(()=>{r=null,i(new he(`timeout of ${t}ms exceeded`,he.ETIMEDOUT))},t);const o=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i,{once:!0}));const{signal:a}=n;return a.unsubscribe=()=>Y.asap(o),a},nt=function*(e,t){let n=e.byteLength;if(!t||n{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*nt(n,t)}(e,t);let r,o=0,a=e=>{r||(r=!0,s&&s(e))};return new ReadableStream({async pull(e){try{const{done:t,value:s}=await i.next();if(t)return a(),void e.close();let r=s.byteLength;if(n){let e=o+=r;n(e)}e.enqueue(new Uint8Array(s))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},it=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,rt=(e,t,n)=>t+2{if(!Y.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},lt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},dt=e=>{const t=void 0!==Y.global&&null!==Y.global?Y.global:globalThis,{ReadableStream:n,TextEncoder:s}=t;e=Y.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:r,Response:o}=e,a=i?ot(i):"function"==typeof fetch,l=ot(r),d=ot(o);if(!a)return!1;const c=a&&ot(n),h=a&&("function"==typeof s?(u=new s,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const f=l&&c&<(()=>{let e=!1;const t=new r(Ie.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),s=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!s}),p=d&&c&<(()=>Y.isReadableStream(new o("").body)),m={stream:p&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let s=t&&t[e];if(s)return s.call(t);throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,n)})});const g=async e=>{if(null==e)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e)){const t=new r(Ie.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Y.isArrayBufferView(e)||Y.isArrayBuffer(e)?e.byteLength:(Y.isURLSearchParams(e)&&(e+=""),Y.isString(e)?(await h(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:a,signal:d,cancelToken:h,timeout:u,onDownloadProgress:_,onUploadProgress:w,responseType:b,headers:v,withCredentials:y="same-origin",fetchOptions:E,maxContentLength:S,maxBodyLength:k}=Qe(e);const x=Y.isNumber(S)&&S>-1,O=Y.isNumber(k)&&k>-1;let R=i||fetch;b=b?(b+"").toLowerCase():"text";let A=tt([d,h&&h.toAbortSignal()],u),T=null;const C=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let I,U=null;const D=()=>new he("Request body larger than maxBodyLength limit",he.ERR_BAD_REQUEST,e,T);try{let i;const d=(L="auth",Y.hasOwnProp(e,L)?e[L]:void 0);if(d){i={username:Y.getSafeProp(d,"username")||"",password:Y.getSafeProp(d,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,Ie.origin);if(!i&&(e.username||e.password)){i={username:at(e.username),password:at(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(i&&(v.delete("authorization"),v.set("Authorization","Basic "+btoa((P=(i.username||"")+":"+(i.password||""),encodeURIComponent(P).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),x&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),s=e.slice(t+1);if(/;base64/i.test(n)){let e=s.length;const t=s.length;for(let n=0;ne>=2&&37===s.charCodeAt(e-2)&&51===s.charCodeAt(e-1)&&(68===s.charCodeAt(e)||100===s.charCodeAt(e));i>=0&&(61===s.charCodeAt(i)?(n++,i--):r(i)&&(n++,i-=3)),1===n&&i>=0&&(61===s.charCodeAt(i)||r(i))&&n++;const o=3*Math.floor(e/4)-(n||0);return o>0?o:0}let i=0;for(let e=0,t=s.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}(t);if(n>S)throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,T)}if(O&&"get"!==n&&"head"!==n){const e=await g(a);if("number"==typeof e&&isFinite(e)&&(I=e,e>k))throw D()}const h=O&&(Y.isReadableStream(a)||Y.isStream(a)),u=(e,t,n)=>st(e,65536,e=>{if(O&&e>k)throw U=D();t&&t(e)},n);if(f&&"get"!==n&&"head"!==n&&(w||h)){if(I=I??await(async(e,t)=>Y.toFiniteNumber(e.getContentLength())??g(t))(v,a),0!==I||h){let e,n=new r(t,{method:"POST",body:a,duplex:"half"});if(Y.isFormData(a)&&(e=n.headers.get("content-type"))&&v.setContentType(e),n.body){const[e,t]=w&&He(I,Me(Ze(w)))||[];a=u(n.body,e,t)}}}else if(h&&!l&&c&&"get"!==n&&"head"!==n)a=u(a);else if(h&&l&&!f&&"get"!==n&&"head"!==n)throw new he("Stream request bodies are not supported by the current fetch implementation",he.ERR_NOT_SUPPORT,e,T);Y.isString(y)||(y=y?"include":"omit");const N=l&&"credentials"in r.prototype;if(Y.isFormData(a)){const e=v.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&v.delete("content-type")}v.set("User-Agent","axios/1.18.1",!1);const z={...E,signal:A,method:n.toUpperCase(),headers:se(v.normalize()),body:a,duplex:"half",credentials:N?y:void 0};T=l&&new r(t,z);let B=await(l?R(T,E):R(t,z));const F=de.from(B.headers);if(x){const t=Y.toFiniteNumber(F.getContentLength());if(null!=t&&t>S)throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,T)}const j=p&&("stream"===b||"response"===b);if(p&&B.body&&(_||x||j&&C)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=B[e]});const n=Y.toFiniteNumber(F.getContentLength()),[s,i]=_&&He(n,Me(Ze(_),!0))||[];let r=0;const a=t=>{if(x&&(r=t,r>S))throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,T);s&&s(t)};B=new o(st(B.body,65536,a,()=>{i&&i(),C&&C()}),t)}b=b||"text";let M=await m[Y.findKey(m,b)||"text"](B,e);if(x&&!p&&!j){let t;if(null!=M&&("number"==typeof M.byteLength?t=M.byteLength:"number"==typeof M.size?t=M.size:"string"==typeof M&&(t="function"==typeof s?(new s).encode(M).byteLength:M.length)),"number"==typeof t&&t>S)throw new he("maxContentLength size of "+S+" exceeded",he.ERR_BAD_RESPONSE,e,T)}return!j&&C&&C(),await new Promise((t,n)=>{je(t,n,{data:M,headers:de.from(B.headers),status:B.status,statusText:B.statusText,config:e,request:T})})}catch(t){if(C&&C(),A&&A.aborted&&A.reason instanceof he){const n=A.reason;throw n.config=e,T&&(n.request=T),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(U)throw T&&!U.request&&(U.request=T),U;if(t instanceof he)throw T&&!t.request&&(t.request=T),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new he("Network Error",he.ERR_NETWORK,e,T,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw he.from(t,t&&t.code,e,T,t&&t.response)}var P,L}},ct=new Map,ht=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:i}=t,r=[s,i,n];let o,a,l=r.length,d=ct;for(;l--;)o=r[l],a=d.get(o),void 0===a&&d.set(o,a=l?new Map:dt(t)),d=a;return a},ut=(ht(),{http:null,xhr:et,fetch:{get:ht}});Y.forEach(ut,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const ft=e=>`- ${e}`,pt=e=>Y.isFunction(e)||null===e||!1===e,mt=function(e,t){e=Y.isArray(e)?e:[e];const{length:n}=e;let s,i;const r={};for(let o=0;o`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(ft).join("\n"):" "+ft(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+t,he.ERR_NOT_SUPPORT)}return i};function gt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fe(null,e)}function _t(e){return gt(e),e.headers=de.from(e.headers),e.data=ze.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),mt(e.adapter||Ne.adapter,e)(e).then(function(t){gt(e),e.response=t;try{t.data=ze.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=de.from(t.headers),t},function(t){if(!Be(t)&&(gt(e),t&&t.response)){e.response=t.response;try{t.response.data=ze.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=de.from(t.response.headers)}return Promise.reject(t)})}const wt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const bt={};wt.transitional=function(e,t,n){function s(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,r)=>{if(!1===e)throw new he(s(i," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!bt[i]&&(bt[i]=!0,console.warn(s(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,r)}},wt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const vt={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let i=s.length;for(;i-- >0;){const r=s[i],o=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(o){const t=e[r],n=void 0===t||o(t,r,e);if(!0!==n)throw new he("option "+r+" must be "+n,he.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new he("Unknown option "+r,he.ERR_BAD_OPTION)}},validators:wt},yt=vt.validators;class Et{constructor(e){this.defaults=e||{},this.interceptors={request:new Se,response:new Se}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),s=-1===t?-1:n.indexOf("\n",t+1),i=-1===s?"":n.slice(s+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ye(this.defaults,t);const{transitional:n,paramsSerializer:s,headers:i}=t;void 0!==n&&vt.assertOptions(n,{silentJSONParsing:yt.transitional(yt.boolean),forcedJSONParsing:yt.transitional(yt.boolean),clarifyTimeoutError:yt.transitional(yt.boolean),legacyInterceptorReqResOrdering:yt.transitional(yt.boolean),advertiseZstdAcceptEncoding:yt.transitional(yt.boolean),validateStatusUndefinedResolves:yt.transitional(yt.boolean)},!1),null!=s&&(Y.isFunction(s)?t.paramsSerializer={serialize:s}:vt.assertOptions(s,{encode:yt.function,serialize:yt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),vt.assertOptions(t,{baseUrl:yt.spelling("baseURL"),withXsrfToken:yt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=i&&Y.merge(i.common,i[t.method]);i&&Y.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete i[e]}),t.headers=de.concat(r,i);const o=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||ke;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});const l=[];let d;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let c,h=0;if(!a){const e=[_t.bind(this),void 0];for(e.unshift(...o),e.push(...l),c=e.length,d=Promise.resolve(t);h{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const s=new Promise(e=>{n.subscribe(e),t=e}).then(e);return s.cancel=function(){n.unsubscribe(t)},s},e(function(e,s,i){n.reason||(n.reason=new Fe(e,s,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new kt(function(t){e=t}),cancel:e}}}const xt=kt,Ot={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ot).forEach(([e,t])=>{Ot[t]=e});const Rt=Ot,At=function e(t){const s=new St(t),i=n(St.prototype.request,s);return Y.extend(i,St.prototype,s,{allOwnKeys:!0}),Y.extend(i,s,null,{allOwnKeys:!0}),i.create=function(n){return e(Ye(t,n))},i}(Ne);At.Axios=St,At.CanceledError=Fe,At.CancelToken=xt,At.isCancel=Be,At.VERSION="1.18.1",At.toFormData=ge,At.AxiosError=he,At.Cancel=At.CanceledError,At.all=function(e){return Promise.all(e)},At.spread=function(e){return function(t){return e.apply(null,t)}},At.isAxiosError=function(e){return Y.isObject(e)&&!0===e.isAxiosError},At.mergeConfig=Ye,At.AxiosHeaders=de,At.formToJSON=e=>De(Y.isHTMLForm(e)?new FormData(e):e),At.getAdapter=mt,At.HttpStatusCode=Rt,At.default=At;const Tt=At;const Ct=()=>{let e;const t=navigator.userAgent;return e=t.indexOf("Firefox")>-1?"firefox":t.indexOf("SamsungBrowser")>-1?"samsung-internet":t.indexOf("Opera")>-1||t.indexOf("OPR")>-1?"opera":t.indexOf("Trident")>-1?"ie":t.indexOf("Edge")>-1?"edge":t.indexOf("Chrome")>-1?"chrome":t.indexOf("Safari")>-1?"safari":"unknown",e},It=e=>{return t=void 0,n=void 0,i=function*(){const{url:t,headers:n={},method:s}=e;let{payload:i}=e;return n.Authorization=`Bearer ${e.authToken}`,null==n["Content-Type"]&&(n["Content-Type"]="application/json",i=JSON.stringify(i)),Tt({method:s,url:t,headers:n,data:i}).then(e=>e.data).catch(e=>{var t,n;if(null!=(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error))throw e.response.data.error;throw e})},new((s=void 0)||(s=Promise))(function(e,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s(function(e){e(n)})).then(o,a)}l((i=i.apply(t,n||[])).next())});var t,n,s,i},Ut=Ct,Dt=()=>null!=window.flutter_inappwebview;function Pt(){var e,t,n,s,i,r,o,a,l,d;const c=navigator.userAgent,h=Ct();let u="Unknown";return/Chrome/.test(c)?u=null!==(t=null===(e=c.match(/Chrome\/(\d+\.\d+)/))||void 0===e?void 0:e[1])&&void 0!==t?t:u:/Firefox/.test(c)?u=null!==(s=null===(n=c.match(/Firefox\/(\d+\.\d+)/))||void 0===n?void 0:n[1])&&void 0!==s?s:u:/Safari/.test(c)?u=null!==(r=null===(i=c.match(/Version\/(\d+\.\d+)/))||void 0===i?void 0:i[1])&&void 0!==r?r:u:/Edge/.test(c)?u=null!==(a=null===(o=c.match(/Edge\/(\d+\.\d+)/))||void 0===o?void 0:o[1])&&void 0!==a?a:u:/Trident/.test(c)&&(u=null!==(d=null===(l=c.match(/rv:(\d+\.\d+)/))||void 0===l?void 0:l[1])&&void 0!==d?d:u),{name:h,version:u}}function Lt(){const e=navigator.userAgent,{platform:t}=navigator;let n="Unknown";return-1!==t.indexOf("Win")?n="Windows":-1!==t.indexOf("Mac")?n="macOS":-1!==e.indexOf("Android")?n="Android":-1!==e.indexOf("Linux")?n="Linux":-1!==e.indexOf("iPhone")&&(n="iOS"),n}function Nt(){const e=navigator.userAgent;let t="Unknown";return-1!==navigator.appVersion.indexOf("Win")?t=String(parseFloat(e.split("Windows NT")[1].split(";")[0])):-1!==e.indexOf("Mac")?[t]=e.split("Mac OS X")[1].split(")")[0].split("_"):-1!==e.indexOf("Android")?[t]=e.split("Android")[1].split(";"):-1!==e.indexOf("iPhone")&&([t]=e.split("iPhone OS")[1].split("_")),t}var zt,Bt,Ft,jt;function Mt(e){let t=e.length;for(;--t>=0;)e[t]=0}!function(e){e.camera="camera",e.screen="screen",e.navigation="navigation"}(zt||(zt={})),function(e){e.notready="notready",e.started="started",e.stopped="stopped"}(Bt||(Bt={})),function(e){e.monitor="monitor",e.application="application",e.tab="tab",e.unknown="unknown"}(Ft||(Ft={})),function(e){e.click="click",e.dblclick="dblclick",e.copy="copy",e.cut="cut",e.paste="paste",e.load="load",e.online="online",e.offline="offline",e.blur="blur",e.focus="focus",e.beforeunload="beforeunload",e.contextmenu="contextmenu",e.change="change",e.drag="drag",e.select="select",e.resize="resize",e.afterresize="afterresize",e.scroll="scroll",e.mouseout="mouseout",e.key="key",e.unfocus="unfocus",e.mousespeed="mousespeed",e.keystrokespeed="keystrokespeed"}(jt||(jt={}));const Ht=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]),Zt=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]),qt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),$t=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Wt=new Array(576);Mt(Wt);const Kt=new Array(60);Mt(Kt);const Vt=new Array(512);Mt(Vt);const Xt=new Array(256);Mt(Xt);const Jt=new Array(29);Mt(Jt);const Yt=new Array(30);function Gt(e,t,n,s,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=s,this.max_length=i,this.has_stree=e&&e.length}let Qt,en,tn;function nn(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Mt(Yt);const sn=e=>e<256?Vt[e]:Vt[256+(e>>>7)],rn=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},on=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<{on(e,n[2*t],n[2*t+1])},ln=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},dn=(e,t,n)=>{const s=new Array(16);let i,r,o=0;for(i=1;i<=15;i++)o=o+n[i-1]<<1,s[i]=o;for(r=0;r<=t;r++){let t=e[2*r+1];0!==t&&(e[2*r]=ln(s[t]++,t))}},cn=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},hn=e=>{e.bi_valid>8?rn(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},un=(e,t,n,s)=>{const i=2*t,r=2*n;return e[i]{const s=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i{let s,i,r,o,a=0;if(0!==e.sym_next)do{s=255&e.pending_buf[e.sym_buf+a++],s+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0===s?an(e,i,t):(r=Xt[i],an(e,r+256+1,t),o=Ht[r],0!==o&&(i-=Jt[r],on(e,i,o)),s--,r=sn(s),an(e,r,n),o=Zt[r],0!==o&&(s-=Yt[r],on(e,s,o)))}while(a{const n=t.dyn_tree,s=t.stat_desc.static_tree,i=t.stat_desc.has_stree,r=t.stat_desc.elems;let o,a,l,d=-1;for(e.heap_len=0,e.heap_max=573,o=0;o>1;o>=1;o--)fn(e,n,o);l=r;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fn(e,n,1),a=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=a,n[2*l]=n[2*o]+n[2*a],e.depth[l]=(e.depth[o]>=e.depth[a]?e.depth[o]:e.depth[a])+1,n[2*o+1]=n[2*a+1]=l,e.heap[1]=l++,fn(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,s=t.max_code,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,l=t.stat_desc.max_length;let d,c,h,u,f,p,m=0;for(u=0;u<=15;u++)e.bl_count[u]=0;for(n[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)c=e.heap[d],u=n[2*n[2*c+1]+1]+1,u>l&&(u=l,m++),n[2*c+1]=u,c>s||(e.bl_count[u]++,f=0,c>=a&&(f=o[c-a]),p=n[2*c],e.opt_len+=p*(u+f),r&&(e.static_len+=p*(i[2*c+1]+f)));if(0!==m){do{for(u=l-1;0===e.bl_count[u];)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(u=l;0!==u;u--)for(c=e.bl_count[u];0!==c;)h=e.heap[--d],h>s||(n[2*h+1]!==u&&(e.opt_len+=(u-n[2*h+1])*n[2*h],n[2*h+1]=u),c--)}})(e,t),dn(n,d,e.bl_count)},gn=(e,t,n)=>{let s,i,r=-1,o=t[1],a=0,l=7,d=4;for(0===o&&(l=138,d=3),t[2*(n+1)+1]=65535,s=0;s<=n;s++)i=o,o=t[2*(s+1)+1],++a{let s,i,r=-1,o=t[1],a=0,l=7,d=4;for(0===o&&(l=138,d=3),s=0;s<=n;s++)if(i=o,o=t[2*(s+1)+1],!(++a{on(e,0+(s?1:0),3),hn(e),rn(e,n),rn(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var vn={_tr_init:e=>{wn||((()=>{let e,t,n,s,i;const r=new Array(16);for(n=0,s=0;s<28;s++)for(Jt[s]=n,e=0;e<1<>=7;s<30;s++)for(Yt[s]=i<<7,e=0;e<1<{let i,r,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),mn(e,e.l_desc),mn(e,e.d_desc),o=(e=>{let t;for(gn(e,e.dyn_ltree,e.l_desc.max_code),gn(e,e.dyn_dtree,e.d_desc.max_code),mn(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*$t[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=i&&(i=r)):i=r=n+5,n+4<=i&&-1!==t?bn(e,t,n,s):4===e.strategy||r===i?(on(e,2+(s?1:0),3),pn(e,Wt,Kt)):(on(e,4+(s?1:0),3),((e,t,n,s)=>{let i;for(on(e,t-257,5),on(e,n-1,5),on(e,s-4,4),i=0;i(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Xt[n]+256+1)]++,e.dyn_dtree[2*sn(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{on(e,2,3),an(e,256,Wt),(e=>{16===e.bi_valid?(rn(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},yn=(e,t,n,s)=>{let i=65535&e,r=e>>>16&65535,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do{i=i+t[s++]|0,r=r+i|0}while(--o);i%=65521,r%=65521}return i|r<<16};const En=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var s=0;s<8;s++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var Sn=(e,t,n,s)=>{const i=En,r=s+n;e^=-1;for(let n=s;n>>8^i[255&(e^t[n])];return-1^e},kn={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"},xn={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};const{_tr_init:On,_tr_stored_block:Rn,_tr_flush_block:An,_tr_tally:Tn,_tr_align:Cn}=vn,{Z_NO_FLUSH:In,Z_PARTIAL_FLUSH:Un,Z_FULL_FLUSH:Dn,Z_FINISH:Pn,Z_BLOCK:Ln,Z_OK:Nn,Z_STREAM_END:zn,Z_STREAM_ERROR:Bn,Z_DATA_ERROR:Fn,Z_BUF_ERROR:jn,Z_DEFAULT_COMPRESSION:Mn,Z_FILTERED:Hn,Z_HUFFMAN_ONLY:Zn,Z_RLE:qn,Z_FIXED:$n,Z_DEFAULT_STRATEGY:Wn,Z_UNKNOWN:Kn,Z_DEFLATED:Vn}=xn,Xn=258,Jn=262,Yn=42,Gn=113,Qn=666,es=(e,t)=>(e.msg=kn[t],t),ts=e=>2*e-(e>4?9:0),ns=e=>{let t=e.length;for(;--t>=0;)e[t]=0},ss=e=>{let t,n,s,i=e.w_size;t=e.hash_size,s=t;do{n=e.head[--s],e.head[s]=n>=i?n-i:0}while(--t);t=i,s=t;do{n=e.prev[--s],e.prev[s]=n>=i?n-i:0}while(--t)};let is=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},os=(e,t)=>{An(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,rs(e.strm)},as=(e,t)=>{e.pending_buf[e.pending++]=t},ls=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},ds=(e,t,n,s)=>{let i=e.avail_in;return i>s&&(i=s),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=yn(e.adler,t,i,n):2===e.state.wrap&&(e.adler=Sn(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},cs=(e,t)=>{let n,s,i=e.max_chain_length,r=e.strstart,o=e.prev_length,a=e.nice_match;const l=e.strstart>e.w_size-Jn?e.strstart-(e.w_size-Jn):0,d=e.window,c=e.w_mask,h=e.prev,u=e.strstart+Xn;let f=d[r+o-1],p=d[r+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(n=t,d[n+o]===p&&d[n+o-1]===f&&d[n]===d[r]&&d[++n]===d[r+1]){r+=2,n++;do{}while(d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&ro){if(e.match_start=t,o=s,s>=a)break;f=d[r+o-1],p=d[r+o]}}}while((t=h[t&c])>l&&0!==--i);return o<=e.lookahead?o:e.lookahead},hs=e=>{const t=e.w_size;let n,s,i;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Jn)&&(e.window.set(e.window.subarray(t,t+t-s),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),ss(e),s+=t),0===e.strm.avail_in)break;if(n=ds(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=is(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=is(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let n,s,i,r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,a=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_outs+e.strm.avail_in&&(n=s+e.strm.avail_in),n>i&&(n=i),n>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,rs(e.strm),s&&(s>n&&(s=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+s),e.strm.next_out),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s,e.block_start+=s,n-=s),n&&(ds(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===o);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_wateri&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(ds(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,r=i>e.w_size?e.w_size:i,s=e.strstart-e.block_start,(s>=r||(s||t===Pn)&&t!==In&&0===e.strm.avail_in&&s<=i)&&(n=s>i?i:s,o=t===Pn&&0===e.strm.avail_in&&n===s?1:0,Rn(e,e.block_start,n,o),e.block_start+=n,rs(e.strm)),o?3:1)},fs=(e,t)=>{let n,s;for(;;){if(e.lookahead=3&&(e.ins_h=is(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-Jn&&(e.match_length=cs(e,n)),e.match_length>=3)if(s=Tn(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=is(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=is(e,e.ins_h,e.window[e.strstart+1]);else s=Tn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(s&&(os(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Pn?(os(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(os(e,!1),0===e.strm.avail_out)?1:2},ps=(e,t)=>{let n,s,i;for(;;){if(e.lookahead=3&&(e.ins_h=is(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,s=Tn(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=is(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!==--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,s&&(os(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(s=Tn(e,0,e.window[e.strstart-1]),s&&os(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(s=Tn(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Pn?(os(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(os(e,!1),0===e.strm.avail_out)?1:2};function ms(e,t,n,s,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=s,this.func=i}const gs=[new ms(0,0,0,0,us),new ms(4,4,8,4,fs),new ms(4,5,16,8,fs),new ms(4,6,32,32,fs),new ms(4,4,16,16,ps),new ms(8,16,32,32,ps),new ms(8,16,128,128,ps),new ms(8,32,128,256,ps),new ms(32,128,258,1024,ps),new ms(32,258,258,4096,ps)];function _s(){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=Vn,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(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ns(this.dyn_ltree),ns(this.dyn_dtree),ns(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ns(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ns(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}const ws=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Yn&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Gn&&t.status!==Qn?1:0},bs=e=>{if(ws(e))return es(e,Bn);e.total_in=e.total_out=0,e.data_type=Kn;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Yn:Gn,e.adler=2===t.wrap?0:1,t.last_flush=-2,On(t),Nn},vs=e=>{const t=bs(e);var n;return t===Nn&&((n=e.state).window_size=2*n.w_size,ns(n.head),n.max_lazy_match=gs[n.level].max_lazy,n.good_match=gs[n.level].good_length,n.nice_match=gs[n.level].nice_length,n.max_chain_length=gs[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},ys=(e,t,n,s,i,r)=>{if(!e)return Bn;let o=1;if(t===Mn&&(t=6),s<0?(o=0,s=-s):s>15&&(o=2,s-=16),i<1||i>9||n!==Vn||s<8||s>15||t<0||t>9||r<0||r>$n||8===s&&1!==o)return es(e,Bn);8===s&&(s=9);const a=new _s;return e.state=a,a.strm=e,a.status=Yn,a.wrap=o,a.gzhead=null,a.w_bits=s,a.w_size=1<ws(e)||2!==e.state.wrap?Bn:(e.state.gzhead=t,Nn),ks=(e,t)=>{if(ws(e)||t>Ln||t<0)return e?es(e,Bn):Bn;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===Qn&&t!==Pn)return es(e,0===e.avail_out?jn:Bn);const s=n.last_flush;if(n.last_flush=t,0!==n.pending){if(rs(e),0===e.avail_out)return n.last_flush=-1,Nn}else if(0===e.avail_in&&ts(t)<=ts(s)&&t!==Pn)return es(e,jn);if(n.status===Qn&&0!==e.avail_in)return es(e,jn);if(n.status===Yn&&0===n.wrap&&(n.status=Gn),n.status===Yn){let t=Vn+(n.w_bits-8<<4)<<8,s=-1;if(s=n.strategy>=Zn||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=s<<6,0!==n.strstart&&(t|=32),t+=31-t%31,ls(n,t),0!==n.strstart&&(ls(n,e.adler>>>16),ls(n,65535&e.adler)),e.adler=1,n.status=Gn,rs(e),0!==n.pending)return n.last_flush=-1,Nn}if(57===n.status)if(e.adler=0,as(n,31),as(n,139),as(n,8),n.gzhead)as(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),as(n,255&n.gzhead.time),as(n,n.gzhead.time>>8&255),as(n,n.gzhead.time>>16&255),as(n,n.gzhead.time>>24&255),as(n,9===n.level?2:n.strategy>=Zn||n.level<2?4:0),as(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(as(n,255&n.gzhead.extra.length),as(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Sn(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(as(n,0),as(n,0),as(n,0),as(n,0),as(n,0),as(n,9===n.level?2:n.strategy>=Zn||n.level<2?4:0),as(n,3),n.status=Gn,rs(e),0!==n.pending)return n.last_flush=-1,Nn;if(69===n.status){if(n.gzhead.extra){let t=n.pending,s=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=Sn(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,rs(e),0!==n.pending)return n.last_flush=-1,Nn;t=0,s-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>t&&(e.adler=Sn(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,s=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>s&&(e.adler=Sn(e.adler,n.pending_buf,n.pending-s,s)),rs(e),0!==n.pending)return n.last_flush=-1,Nn;s=0}t=n.gzindexs&&(e.adler=Sn(e.adler,n.pending_buf,n.pending-s,s)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,s=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>s&&(e.adler=Sn(e.adler,n.pending_buf,n.pending-s,s)),rs(e),0!==n.pending)return n.last_flush=-1,Nn;s=0}t=n.gzindexs&&(e.adler=Sn(e.adler,n.pending_buf,n.pending-s,s))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(rs(e),0!==n.pending))return n.last_flush=-1,Nn;as(n,255&e.adler),as(n,e.adler>>8&255),e.adler=0}if(n.status=Gn,rs(e),0!==n.pending)return n.last_flush=-1,Nn}if(0!==e.avail_in||0!==n.lookahead||t!==In&&n.status!==Qn){let s=0===n.level?us(n,t):n.strategy===Zn?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(hs(e),0===e.lookahead)){if(t===In)return 1;break}if(e.match_length=0,n=Tn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(os(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Pn?(os(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(os(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===qn?((e,t)=>{let n,s,i,r;const o=e.window;for(;;){if(e.lookahead<=Xn){if(hs(e),e.lookahead<=Xn&&t===In)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,s=o[i],s===o[++i]&&s===o[++i]&&s===o[++i])){r=e.strstart+Xn;do{}while(s===o[++i]&&s===o[++i]&&s===o[++i]&&s===o[++i]&&s===o[++i]&&s===o[++i]&&s===o[++i]&&s===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Tn(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Tn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(os(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Pn?(os(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(os(e,!1),0===e.strm.avail_out)?1:2})(n,t):gs[n.level].func(n,t);if(3!==s&&4!==s||(n.status=Qn),1===s||3===s)return 0===e.avail_out&&(n.last_flush=-1),Nn;if(2===s&&(t===Un?Cn(n):t!==Ln&&(Rn(n,0,0,!1),t===Dn&&(ns(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),rs(e),0===e.avail_out))return n.last_flush=-1,Nn}return t!==Pn?Nn:n.wrap<=0?zn:(2===n.wrap?(as(n,255&e.adler),as(n,e.adler>>8&255),as(n,e.adler>>16&255),as(n,e.adler>>24&255),as(n,255&e.total_in),as(n,e.total_in>>8&255),as(n,e.total_in>>16&255),as(n,e.total_in>>24&255)):(ls(n,e.adler>>>16),ls(n,65535&e.adler)),rs(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Nn:zn)},xs=e=>{if(ws(e))return Bn;const t=e.state.status;return e.state=null,t===Gn?es(e,Fn):Nn},Os=(e,t)=>{let n=t.length;if(ws(e))return Bn;const s=e.state,i=s.wrap;if(2===i||1===i&&s.status!==Yn||s.lookahead)return Bn;if(1===i&&(e.adler=yn(e.adler,t,n,0)),s.wrap=0,n>=s.w_size){0===i&&(ns(s.head),s.strstart=0,s.block_start=0,s.insert=0);let e=new Uint8Array(s.w_size);e.set(t.subarray(n-s.w_size,n),0),t=e,n=s.w_size}const r=e.avail_in,o=e.next_in,a=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,hs(s);s.lookahead>=3;){let e=s.strstart,t=s.lookahead-2;do{s.ins_h=is(s,s.ins_h,s.window[e+3-1]),s.prev[e&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=e,e++}while(--t);s.strstart=e,s.lookahead=2,hs(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=2,s.match_available=0,e.next_in=o,e.input=a,e.avail_in=r,s.wrap=i,Nn};const Rs=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var As=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)Rs(n,t)&&(e[t]=n[t])}}return e},Ts=e=>{let t=0;for(let n=0,s=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Is[254]=Is[254]=1;var Us=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,s,i,r,o=e.length,a=0;for(i=0;i>>6,t[r++]=128|63&n):n<65536?(t[r++]=224|n>>>12,t[r++]=128|n>>>6&63,t[r++]=128|63&n):(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63,t[r++]=128|n>>>6&63,t[r++]=128|63&n);return t},Ds=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let s,i;const r=new Array(2*n);for(i=0,s=0;s4)r[i++]=65533,s+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&s1?r[i++]=65533:t<65536?r[i++]=t:(t-=65536,r[i++]=55296|t>>10&1023,r[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Cs)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let s=0;s{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Is[e[n]]>t?n:t},Ls=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};const Ns=Object.prototype.toString,{Z_NO_FLUSH:zs,Z_SYNC_FLUSH:Bs,Z_FULL_FLUSH:Fs,Z_FINISH:js,Z_OK:Ms,Z_STREAM_END:Hs,Z_DEFAULT_COMPRESSION:Zs,Z_DEFAULT_STRATEGY:qs,Z_DEFLATED:$s}=xn;function Ws(e){this.options=As({level:Zs,method:$s,chunkSize:16384,windowBits:15,memLevel:8,strategy:qs},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ls,this.strm.avail_out=0;let n=Es(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Ms)throw new Error(kn[n]);if(t.header&&Ss(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Us(t.dictionary):"[object ArrayBuffer]"===Ns.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=Os(this.strm,e),n!==Ms)throw new Error(kn[n]);this._dict_set=!0}}function Ks(e,t){const n=new Ws(t);if(n.push(e,!0),n.err)throw n.msg||kn[n.err];return n.result}Ws.prototype.push=function(e,t){const n=this.strm,s=this.options.chunkSize;let i,r;if(this.ended)return!1;for(r=t===~~t?t:!0===t?js:zs,"string"==typeof e?n.input=Us(e):"[object ArrayBuffer]"===Ns.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),(r===Bs||r===Fs)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=ks(n,r),i===Hs)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=xs(this.strm),this.onEnd(i),this.ended=!0,i===Ms;if(0!==n.avail_out){if(r>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Ws.prototype.onData=function(e){this.chunks.push(e)},Ws.prototype.onEnd=function(e){e===Ms&&(this.result=Ts(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Vs={Deflate:Ws,deflate:Ks,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Ks(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Ks(e,t)},constants:xn};const Xs=16209;var Js=function(e,t){let n,s,i,r,o,a,l,d,c,h,u,f,p,m,g,_,w,b,v,y,E,S,k,x;const O=e.state;n=e.next_in,k=e.input,s=n+(e.avail_in-5),i=e.next_out,x=e.output,r=i-(t-e.avail_out),o=i+(e.avail_out-257),a=O.dmax,l=O.wsize,d=O.whave,c=O.wnext,h=O.window,u=O.hold,f=O.bits,p=O.lencode,m=O.distcode,g=(1<>>24,u>>>=b,f-=b,b=w>>>16&255,0===b)x[i++]=65535&w;else{if(!(16&b)){if(64&b){if(32&b){O.mode=16191;break e}e.msg="invalid literal/length code",O.mode=Xs;break e}w=p[(65535&w)+(u&(1<>>=b,f-=b),f<15&&(u+=k[n++]<>>24,u>>>=b,f-=b,b=w>>>16&255,16&b){if(y=65535&w,b&=15,fa){e.msg="invalid distance too far back",O.mode=Xs;break e}if(u>>>=b,f-=b,b=i-r,y>b){if(b=y-b,b>d&&O.sane){e.msg="invalid distance too far back",O.mode=Xs;break e}if(E=0,S=h,0===c){if(E+=l-b,b2;)x[i++]=S[E++],x[i++]=S[E++],x[i++]=S[E++],v-=3;v&&(x[i++]=S[E++],v>1&&(x[i++]=S[E++]))}else{E=i-y;do{x[i++]=x[E++],x[i++]=x[E++],x[i++]=x[E++],v-=3}while(v>2);v&&(x[i++]=x[E++],v>1&&(x[i++]=x[E++]))}break}if(64&b){e.msg="invalid distance code",O.mode=Xs;break e}w=m[(65535&w)+(u&(1<>3,n-=v,f-=v<<3,u&=(1<{const l=a.bits;let d,c,h,u,f,p,m=0,g=0,_=0,w=0,b=0,v=0,y=0,E=0,S=0,k=0,x=null;const O=new Uint16Array(16),R=new Uint16Array(16);let A,T,C,I=null;for(m=0;m<=15;m++)O[m]=0;for(g=0;g=1&&0===O[w];w--);if(b>w&&(b=w),0===w)return i[r++]=20971520,i[r++]=20971520,a.bits=1,0;for(_=1;_0&&(0===e||1!==w))return-1;for(R[1]=0,m=1;m<15;m++)R[m+1]=R[m]+O[m];for(g=0;g852||2===e&&S>592)return 1;for(;;){A=m-y,o[g]+1=p?(T=I[o[g]-p],C=x[o[g]-p]):(T=96,C=0),d=1<>y)+c]=A<<24|T<<16|C}while(0!==c);for(d=1<>=1;if(0!==d?(k&=d-1,k+=d):k=0,g++,0===--O[m]){if(m===w)break;m=t[n+o[g]]}if(m>b&&(k&u)!==h){for(0===y&&(y=b),f+=_,v=m-y,E=1<852||2===e&&S>592)return 1;h=k&u,i[h]=b<<24|v<<16|f-r}}return 0!==k&&(i[f+k]=m-y<<24|64<<16),a.bits=b,0};const{Z_FINISH:ni,Z_BLOCK:si,Z_TREES:ii,Z_OK:ri,Z_STREAM_END:oi,Z_NEED_DICT:ai,Z_STREAM_ERROR:li,Z_DATA_ERROR:di,Z_MEM_ERROR:ci,Z_BUF_ERROR:hi,Z_DEFLATED:ui}=xn,fi=16180,pi=16190,mi=16191,gi=16192,_i=16194,wi=16199,bi=16200,vi=16206,yi=16209,Ei=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Si(){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}const ki=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},xi=e=>{if(ki(e))return li;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=fi,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,ri},Oi=e=>{if(ki(e))return li;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,xi(e)},Ri=(e,t)=>{let n;if(ki(e))return li;const s=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?li:(null!==s.window&&s.wbits!==t&&(s.window=null),s.wrap=n,s.wbits=t,Oi(e))},Ai=(e,t)=>{if(!e)return li;const n=new Si;e.state=n,n.strm=e,n.window=null,n.mode=fi;const s=Ri(e,t);return s!==ri&&(e.state=null),s};let Ti,Ci,Ii=!0;const Ui=e=>{if(Ii){Ti=new Int32Array(512),Ci=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ti(1,e.lens,0,288,Ti,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ti(2,e.lens,0,32,Ci,0,e.work,{bits:5}),Ii=!1}e.lencode=Ti,e.lenbits=9,e.distcode=Ci,e.distbits=5},Di=(e,t,n,s)=>{let i;const r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(r.window.set(t.subarray(n-r.wsize,n),0),r.wnext=0,r.whave=r.wsize):(i=r.wsize-r.wnext,i>s&&(i=s),r.window.set(t.subarray(n-s,n-s+i),r.wnext),(s-=i)?(r.window.set(t.subarray(n-s,n),0),r.wnext=s,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave{let n,s,i,r,o,a,l,d,c,h,u,f,p,m,g,_,w,b,v,y,E,S,k=0;const x=new Uint8Array(4);let O,R;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ki(e)||!e.output||!e.input&&0!==e.avail_in)return li;n=e.state,n.mode===mi&&(n.mode=gi),o=e.next_out,i=e.output,l=e.avail_out,r=e.next_in,s=e.input,a=e.avail_in,d=n.hold,c=n.bits,h=a,u=l,S=ri;e:for(;;)switch(n.mode){case fi:if(0===n.wrap){n.mode=gi;break}for(;c<16;){if(0===a)break e;a--,d+=s[r++]<>>8&255,n.check=Sn(n.check,x,2,0),d=0,c=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",n.mode=yi;break}if((15&d)!==ui){e.msg="unknown compression method",n.mode=yi;break}if(d>>>=4,c-=4,E=8+(15&d),0===n.wbits&&(n.wbits=E),E>15||E>n.wbits){e.msg="invalid window size",n.mode=yi;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(x[0]=255&d,x[1]=d>>>8&255,n.check=Sn(n.check,x,2,0)),d=0,c=0,n.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,d+=s[r++]<>>8&255,x[2]=d>>>16&255,x[3]=d>>>24&255,n.check=Sn(n.check,x,4,0)),d=0,c=0,n.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,d+=s[r++]<>8),512&n.flags&&4&n.wrap&&(x[0]=255&d,x[1]=d>>>8&255,n.check=Sn(n.check,x,2,0)),d=0,c=0,n.mode=16184;case 16184:if(1024&n.flags){for(;c<16;){if(0===a)break e;a--,d+=s[r++]<>>8&255,n.check=Sn(n.check,x,2,0)),d=0,c=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(f=n.length,f>a&&(f=a),f&&(n.head&&(E=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(s.subarray(r,r+f),E)),512&n.flags&&4&n.wrap&&(n.check=Sn(n.check,s,f,r)),a-=f,r+=f,n.length-=f),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break e;f=0;do{E=s[r+f++],n.head&&E&&n.length<65536&&(n.head.name+=String.fromCharCode(E))}while(E&&f>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=mi;break;case 16189:for(;c<32;){if(0===a)break e;a--,d+=s[r++]<>>=7&c,c-=7&c,n.mode=vi;break}for(;c<3;){if(0===a)break e;a--,d+=s[r++]<>>=1,c-=1,3&d){case 0:n.mode=16193;break;case 1:if(Ui(n),n.mode=wi,t===ii){d>>>=2,c-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=yi}d>>>=2,c-=2;break;case 16193:for(d>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,d+=s[r++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=yi;break}if(n.length=65535&d,d=0,c=0,n.mode=_i,t===ii)break e;case _i:n.mode=16195;case 16195:if(f=n.length,f){if(f>a&&(f=a),f>l&&(f=l),0===f)break e;i.set(s.subarray(r,r+f),o),a-=f,r+=f,l-=f,o+=f,n.length-=f;break}n.mode=mi;break;case 16196:for(;c<14;){if(0===a)break e;a--,d+=s[r++]<>>=5,c-=5,n.ndist=1+(31&d),d>>>=5,c-=5,n.ncode=4+(15&d),d>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=yi;break}n.have=0,n.mode=16197;case 16197:for(;n.have>>=3,c-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,O={bits:n.lenbits},S=ti(0,n.lens,0,19,n.lencode,0,n.work,O),n.lenbits=O.bits,S){e.msg="invalid code lengths set",n.mode=yi;break}n.have=0,n.mode=16198;case 16198:for(;n.have>>24,_=k>>>16&255,w=65535&k,!(g<=c);){if(0===a)break e;a--,d+=s[r++]<>>=g,c-=g,n.lens[n.have++]=w;else{if(16===w){for(R=g+2;c>>=g,c-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=yi;break}E=n.lens[n.have-1],f=3+(3&d),d>>>=2,c-=2}else if(17===w){for(R=g+3;c>>=g,c-=g,E=0,f=3+(7&d),d>>>=3,c-=3}else{for(R=g+7;c>>=g,c-=g,E=0,f=11+(127&d),d>>>=7,c-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=yi;break}for(;f--;)n.lens[n.have++]=E}}if(n.mode===yi)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=yi;break}if(n.lenbits=9,O={bits:n.lenbits},S=ti(1,n.lens,0,n.nlen,n.lencode,0,n.work,O),n.lenbits=O.bits,S){e.msg="invalid literal/lengths set",n.mode=yi;break}if(n.distbits=6,n.distcode=n.distdyn,O={bits:n.distbits},S=ti(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,O),n.distbits=O.bits,S){e.msg="invalid distances set",n.mode=yi;break}if(n.mode=wi,t===ii)break e;case wi:n.mode=bi;case bi:if(a>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=r,e.avail_in=a,n.hold=d,n.bits=c,Js(e,u),o=e.next_out,i=e.output,l=e.avail_out,r=e.next_in,s=e.input,a=e.avail_in,d=n.hold,c=n.bits,n.mode===mi&&(n.back=-1);break}for(n.back=0;k=n.lencode[d&(1<>>24,_=k>>>16&255,w=65535&k,!(g<=c);){if(0===a)break e;a--,d+=s[r++]<>b)],g=k>>>24,_=k>>>16&255,w=65535&k,!(b+g<=c);){if(0===a)break e;a--,d+=s[r++]<>>=b,c-=b,n.back+=b}if(d>>>=g,c-=g,n.back+=g,n.length=w,0===_){n.mode=16205;break}if(32&_){n.back=-1,n.mode=mi;break}if(64&_){e.msg="invalid literal/length code",n.mode=yi;break}n.extra=15&_,n.mode=16201;case 16201:if(n.extra){for(R=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;k=n.distcode[d&(1<>>24,_=k>>>16&255,w=65535&k,!(g<=c);){if(0===a)break e;a--,d+=s[r++]<>b)],g=k>>>24,_=k>>>16&255,w=65535&k,!(b+g<=c);){if(0===a)break e;a--,d+=s[r++]<>>=b,c-=b,n.back+=b}if(d>>>=g,c-=g,n.back+=g,64&_){e.msg="invalid distance code",n.mode=yi;break}n.offset=w,n.extra=15&_,n.mode=16203;case 16203:if(n.extra){for(R=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=yi;break}n.mode=16204;case 16204:if(0===l)break e;if(f=u-l,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=yi;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),m=n.window}else m=i,p=o-n.offset,f=n.length;f>l&&(f=l),l-=f,n.length-=f;do{i[o++]=m[p++]}while(--f);0===n.length&&(n.mode=bi);break;case 16205:if(0===l)break e;i[o++]=n.length,l--,n.mode=bi;break;case vi:if(n.wrap){for(;c<32;){if(0===a)break e;a--,d|=s[r++]<{if(ki(e))return li;let t=e.state;return t.window&&(t.window=null),e.state=null,ri},Bi=(e,t)=>{if(ki(e))return li;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,ri):li},Fi=(e,t)=>{const n=t.length;let s,i,r;return ki(e)?li:(s=e.state,0!==s.wrap&&s.mode!==pi?li:s.mode===pi&&(i=1,i=yn(i,t,n,0),i!==s.check)?di:(r=Di(e,t,n,n),r?(s.mode=16210,ci):(s.havedict=1,ri)))},ji=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};const Mi=Object.prototype.toString,{Z_NO_FLUSH:Hi,Z_FINISH:Zi,Z_OK:qi,Z_STREAM_END:$i,Z_NEED_DICT:Wi,Z_STREAM_ERROR:Ki,Z_DATA_ERROR:Vi,Z_MEM_ERROR:Xi}=xn;function Ji(e){this.options=As({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ls,this.strm.avail_out=0;let n=Li(this.strm,t.windowBits);if(n!==qi)throw new Error(kn[n]);if(this.header=new ji,Bi(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Us(t.dictionary):"[object ArrayBuffer]"===Mi.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Fi(this.strm,t.dictionary),n!==qi)))throw new Error(kn[n])}function Yi(e,t){const n=new Ji(t);if(n.push(e),n.err)throw n.msg||kn[n.err];return n.result}Ji.prototype.push=function(e,t){const n=this.strm,s=this.options.chunkSize,i=this.options.dictionary;let r,o,a;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Zi:Hi,"[object ArrayBuffer]"===Mi.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),r=Ni(n,o),r===Wi&&i&&(r=Fi(n,i),r===qi?r=Ni(n,o):r===Vi&&(r=Wi));n.avail_in>0&&r===$i&&n.state.wrap>0&&0!==e[n.next_in];)Pi(n),r=Ni(n,o);switch(r){case Ki:case Vi:case Wi:case Xi:return this.onEnd(r),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||r===$i))if("string"===this.options.to){let e=Ps(n.output,n.next_out),t=n.next_out-e,i=Ds(n.output,e);n.next_out=t,n.avail_out=s-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(r!==qi||0!==a){if(r===$i)return r=zi(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Ji.prototype.onData=function(e){this.chunks.push(e)},Ji.prototype.onEnd=function(e){e===qi&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ts(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Gi={Inflate:Ji,inflate:Yi,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Yi(e,t)},ungzip:Yi,constants:xn};const{Deflate:Qi,deflate:er,deflateRaw:tr,gzip:nr}=Vs,{Inflate:sr,inflate:ir,inflateRaw:rr,ungzip:or}=Gi;var ar,lr=nr;!function(e){e.success="success",e.not_supported="not_supported",e.permission_denied="permission_denied",e.device_not_found="device_not_found",e.device_in_use="device_in_use"}(ar||(ar={}));var dr=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};const cr=class{constructor(e,t){this.plasm=t,this.validateOptions(e),this.options=e}setup(){return dr(this,void 0,void 0,function*(){return!1===this.plasm.supportedCollectors.includes(this.id)?this.buildSetupResult(ar.not_supported):this.setupCollector()})}validateOptions(e){}buildSetupResult(e){return{id:this.id,status:e,meta:this.buildSetupMeta()}}stop(){return dr(this,void 0,void 0,function*(){yield this.stopInner(),this.plasm.debug(`[${this.id}] stopped`)})}setOptions(e){this.validateOptions(e),this.options=e}setPubSubEventCollector(e){}};class hr extends Error{constructor(e){super(e.msg||e.code),this.code=e.code}}class ur extends hr{constructor(){super(...arguments),this.name="PlasmIntegrationError"}}class fr extends hr{constructor(){super(...arguments),this.name="PlasmInternalError",this.isHandled=!1}}class pr{static parseDSN(e){const t=e.match(/^(?\w+):\/\/(?\w+)(?::(?\w+))?@(?[\w.-]+)(?\/[\w/-]+)?\/(?\w+)$/);if(null==t)throw new fr({msg:"failed to parse sentry dsn"});const{protocol:n,host:s,path:i,projectId:r,publicKey:o}=t.groups;return{baseApiUrl:`${n}://${s}${null!=i?i:""}/api/${r}`,publicKey:o}}static buildSentryExceptionFromAppError(e,t={isHandled:!1}){const n=e.name||"Error",s=e.message||e.description||e.toString(),i=this.formatStackTraceForSentry(e);return{type:n,value:s,stacktrace:i.length>0?{frames:i}:void 0,mechanism:{type:"generic",handled:t.isHandled}}}static formatStackTraceForSentry(e){return(e.stack||"").split("\n").slice(1).map(e=>{const t=e.trim().match(/at\s+(.*?)\s+\((.*?):(\d+):(\d+)\)/);if(t){const[,e,n,s,i]=t;return{function:e,filename:n,lineno:parseInt(s,10),colno:parseInt(i,10)}}return{function:"",filename:e,lineno:void 0,colno:void 0}}).reverse()}static buildExceptionContexts(){return{browser:Pt(),os:{name:Lt(),version:Nt()}}}}class mr{constructor(e){this.name=e}error(...e){console.error(...e)}warn(e){console.warn(`[${this.name}] ${e}`)}debug(e){console.log(`[${this.name}] ${(new Date).toLocaleTimeString()}: ${e}`)}}var gr;class _r extends pr{static init(e){const{baseApiUrl:t,publicKey:n}=this.parseDSN(e.sentryDSN);this.options=e,this.BASE_API_URL=t,this.PUBLIC_KEY=n,this.isInitialized=!0}static captureError(e,t){if(this.isInitialized)try{const n=this.buildSentryExceptionFromAppError(e,{isHandled:!0});this.processException(n,t)}catch(e){this.logger.error('"captureError" failed',e)}}static processException(e,t){const n=function(){let e="";const t=window.crypto.getRandomValues(new Uint8Array(16));for(let n=0;n{this.isApiRequestsSuppressed=!1},1e3*n)}}gr=_r,_r.logger=new mr("Sentry"),_r.isInitialized=!1,_r.isApiRequestsSuppressed=!1,_r.handleRequestError=e=>{429===e.status?gr.handleRateLimitExceededError(e):gr.logger.error(e)};var wr=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};const br=class extends cr{constructor(){super(...arguments),this.drawAndSendImage=e=>wr(this,void 0,void 0,function*(){const t=yield this.drawImage();null!=t&&(yield this.sendImage(t,e))}),this.drawImageFromMobileApp=()=>wr(this,void 0,void 0,function*(){const e=yield window.flutter_inappwebview.callHandler("captureStream");if(0===e.length)return null;const t=`data:image/jpeg;base64,${e}`,n=new Image;return new Promise(e=>{n.onload=()=>e(n),n.onerror=t=>{_r.captureError(t),e(null)},n.src=t})}),this.drawImage=()=>wr(this,void 0,void 0,function*(){const{width:e,height:t}=this.IMAGE_DIMENSIONS,n=Number(this.IMAGE_QUALITY)/100;let s,i,r;if(Dt()&&this.id===zt.screen){const e=yield this.drawImageFromMobileApp();if(null==e)return null;s=e,i=e.width,r=e.height}else{const{videoWidth:e,videoHeight:t}=this.video;s=this.video,i=e,r=t}const o=Math.min(e/i,t/r),a=i*o,l=r*o;return this.canvas.width=a,this.canvas.height=l,this.context.clearRect(0,0,a,l),this.context.drawImage(s,0,0,a,l),new Promise(e=>{this.canvas.toBlob(t=>{if(null!=t)return t.arrayBuffer().then(e);e(null)},"image/jpeg",n)})}),this.stopInner=()=>wr(this,void 0,void 0,function*(){null!=this.timerId&&clearTimeout(this.timerId),null!=this.stream&&this.stream.getTracks().forEach(e=>e.stop())})}validateOptions(e){const{snapshotsMinInterval:t,screenshotsMinInterval:n}=this.plasm.config;if(this.id===zt.camera&&e.intervalthis.drawAndSendImage({trigger:"interval"}),this.options.interval)}generateExtraData(){return wr(this,void 0,void 0,function*(){const e=function(){const{userAgent:e}=navigator;return/Mobi|Android|iPhone|iPad|iPod/i.test(e)}(),{shotsExtraDataGenerator:t}=this.plasm.options;let n={isTakenFromMobile:e};if(null!=t){const e=this.id,s=yield t({type:e});null!=s&&(n=Object.assign(Object.assign({},n),s))}return JSON.stringify(n)})}};var vr;!function(e){e.SESSION_SNAPSHOTS_LIMIT_REACHED="SESSION_SNAPSHOTS_LIMIT_REACHED",e.SESSION_SCREENSHOTS_LIMIT_REACHED="SESSION_SCREENSHOTS_LIMIT_REACHED",e.SESSION_EXPIRED="SESSION_EXPIRED",e.SESSION_LIMIT_REACHED="SESSION_LIMIT_REACHED"}(vr||(vr={}));const yr=vr;var Er=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};const Sr=class extends br{constructor(e,t){super(e,t),this.state={isShotsLimitReached:!1};const{snapshotWidth:n,snapshotHeight:s,snapshotQuality:i}=t.config;this.id=zt.camera,this.IMAGE_DIMENSIONS={width:n,height:s},this.IMAGE_QUALITY=i}setupStream(){return Er(this,void 0,void 0,function*(){return this.stream=yield navigator.mediaDevices.getUserMedia({audio:!1,video:!0}),this.video.srcObject=this.stream,new Promise(e=>{this.video.oncanplay=()=>e()})})}buildSetupMeta(){return{stream:this.stream}}sendImage(e,t){return Er(this,void 0,void 0,function*(){var n,s,i,r;const{trigger:o}=t,{sessionUuid:a}=this.plasm,l=this.plasm.options.clientToken,d=new Blob([lr(new Uint8Array(e))],{type:"application/octet-stream"}),c=yield this.generateExtraData(),h=`${this.plasm.options.plasmApiUrl}/snapshots`,u={Authorization:`Bearer ${l}`},f={sessionUuid:a,trigger:o,image:d,extraData:c};try{yield Tt.postForm(h,f,{headers:u}),this.plasm.debug(`snapshot sent. trigger: ${o}`)}catch(e){switch(null===(r=null===(i=null===(s=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===s?void 0:s.error)||void 0===i?void 0:i.details)||void 0===r?void 0:r.reason){case yr.SESSION_SNAPSHOTS_LIMIT_REACHED:this.plasm.debug("session snapshots limit reached"),this.state.isShotsLimitReached=!0,yield this.stop();break;case yr.SESSION_EXPIRED:yield this.plasm.stop();break;default:throw e}}})}};var kr=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};const xr=class extends br{constructor(e,t){super(e,t),this.state={isShotsLimitReached:!1};const{screenshotWidth:n,screenshotHeight:s,screenshotQuality:i}=t.config;this.id=zt.screen,this.IMAGE_DIMENSIONS={width:n,height:s},this.IMAGE_QUALITY=i}setupStream(){return kr(this,void 0,void 0,function*(){if(Dt()){if(!1===(yield window.flutter_inappwebview.callHandler("selectScreenSourceDialog")))throw new DOMException("App screen access failed","NotAllowedError");return new Promise(e=>{e()})}return this.stream=yield navigator.mediaDevices.getDisplayMedia(),this.video.srcObject=this.stream,new Promise(e=>{this.video.oncanplay=()=>e()})})}buildSetupMeta(){return{selectedArea:this.getSelectedArea(),stream:this.stream}}getSelectedArea(){if(Dt())return Ft.monitor;if(null==this.stream)return Ft.unknown;const e=this.stream.getVideoTracks()[0],{label:t}=e,n=e.getSettings();return"monitor"===(null==n?void 0:n.displaySurface)||"Primary Monitor"===t?Ft.monitor:"window"===(null==n?void 0:n.displaySurface)||t.includes("Mozilla Firefox")?Ft.application:"browser"===(null==n?void 0:n.displaySurface)?Ft.tab:"safari"===Ut()?Ft.monitor:Ft.unknown}sendImage(e,t){return kr(this,void 0,void 0,function*(){var n,s,i,r;const{sessionUuid:o}=this.plasm,{trigger:a}=t,l=!1===document.hasFocus(),d=new Blob([lr(new Uint8Array(e))],{type:"application/octet-stream"}),c=yield this.generateExtraData(),h=`${this.plasm.options.plasmApiUrl}/screenshots`,u={Authorization:`Bearer ${this.plasm.options.clientToken}`},f={sessionUuid:o,trigger:a,isPageUnfocused:l,image:d,extraData:c};try{yield Tt.postForm(h,f,{headers:u}),this.plasm.debug(`screenshot sent. trigger: ${a}, isPageUnfocused: ${l}`)}catch(e){switch(null===(r=null===(i=null===(s=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===s?void 0:s.error)||void 0===i?void 0:i.details)||void 0===r?void 0:r.reason){case yr.SESSION_SCREENSHOTS_LIMIT_REACHED:this.plasm.debug("session screenshots limit reached"),this.state.isShotsLimitReached=!0,yield this.stop();break;case yr.SESSION_EXPIRED:yield this.plasm.stop();break;default:throw e}}})}};var Or=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};class Rr extends cr{constructor(e,t){super(e,t),this.logger=new mr("NavigationCollector"),this.state={lastUnfocusedShotTakenTime:null},this.unfocusedShotsTimersIds=[],this.checkAndHandleUnfocused=()=>{const e=document.hasFocus();this.storedIsPageFocused!==e&&(this.storedIsPageFocused=e,!1===e&&this.handlePageUnfocused())},this.id=zt.navigation,this.storedIsPageFocused=document.hasFocus()}setupCollector(){return Or(this,void 0,void 0,function*(){return this.buildSetupResult(ar.success)})}buildSetupMeta(){return{}}getReady(){return Or(this,void 0,void 0,function*(){})}start(){return Or(this,void 0,void 0,function*(){this.startWatchUnfocused(),this.screenshotsCollector=this.plasm.configuredCollectors.find(e=>e.id===zt.screen)})}startWatchUnfocused(){null!=this.unfocusCheckTimerId&&clearInterval(this.unfocusCheckTimerId),this.unfocusCheckTimerId=setInterval(this.checkAndHandleUnfocused,Rr.UNFOCUSED_CHECK_INTERVAL)}handlePageUnfocused(){return Or(this,void 0,void 0,function*(){try{this.plasm.debug("unfocused"),null!=this.unfocusPubSubEvent&&this.unfocusPubSubEvent.addLog(new Event(this.unfocusPubSubEvent.id),this.unfocusPubSubEvent.id);const{screenshotsMinInterval:e}=this.plasm.config;this.options.enableUnfocusedShots&&null!=this.screenshotsCollector&&!1===this.screenshotsCollector.state.isShotsLimitReached&&(null==this.state.lastUnfocusedShotTakenTime||this.state.lastUnfocusedShotTakenTime+e<=Date.now())&&(yield this.initUnfocusedShots())}catch(e){this.logger.error(e),_r.captureError(e)}})}initUnfocusedShots(){return Or(this,void 0,void 0,function*(){this.clearUnfocusedShotsTimers(),yield this.delayUnfocusedShots();const e=this.plasm.config.unfocusedShotsMaxIterations,t=this.plasm.config.unfocusedShotsInterval;this.state.lastUnfocusedShotTakenTime=Date.now()+(e-1)*t;for(let n=0;n{!1===document.hasFocus()&&this.screenshotsCollector.drawAndSendImage({trigger:"unfocus"})},e);this.unfocusedShotsTimersIds.push(t)}}})}clearUnfocusedShotsTimers(){this.unfocusedShotsTimersIds.forEach(e=>clearTimeout(e)),this.unfocusedShotsTimersIds=[]}delayUnfocusedShots(){return Or(this,void 0,void 0,function*(){const e=this.plasm.config.unfocusedShotsDelay;e>0&&(yield new Promise(t=>{setTimeout(t,e)}))})}stopInner(){return Or(this,void 0,void 0,function*(){this.stopTimers()})}stopTimers(){null!=this.unfocusCheckTimerId&&clearInterval(this.unfocusCheckTimerId),this.unfocusedShotsTimersIds.forEach(e=>clearTimeout(e))}setPubSubEventCollector(e){e.id===jt.unfocus&&(this.unfocusPubSubEvent=e)}}Rr.UNFOCUSED_CHECK_INTERVAL=500;const Ar=Rr;var Tr=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};const Cr=class{constructor(e,t,n){this.iframeBehaviorListeners=[],this.plasm=e,this.appName=t,this.addMetadata=n,this.handler=e=>this.addLog(e,this.id)}captureScreenshot(e){return Tr(this,void 0,void 0,function*(){null!=this.plasm.configuredCollectors.find(e=>e.id===zt.screen)&&(yield this.plasm.createScreenshot(e))})}start(){window.addEventListener(this.id,this.handler),this.plasm.debug(`Behavior ${this.id} started`)}stop(){window.removeEventListener(this.id,this.handler),this.plasm.debug(`Behavior ${this.id} stopped`)}shouldAddIsTrustedMeta(e){return![jt.offline,jt.online,jt.load,jt.beforeunload,jt.unfocus,jt.mousespeed,jt.keystrokespeed].includes(e)}addLog(e,t,n){const s={app:this.appName,event:t,clientTime:(new Date).toISOString(),sessionId:this.plasm.sessionUuid};null!=this.addMetadata&&(s.meta=this.addMetadata(e)),null!=n&&(s.meta=Object.assign(Object.assign({},s.meta),n)),this.shouldAddIsTrustedMeta(t)&&(s.meta=Object.assign(Object.assign({},s.meta),{isTrusted:e.isTrusted})),this.plasm.behaviorData.push(s),1===this.plasm.behaviorData.length&&this.sendLog()}retrySendLog(){return Tr(this,void 0,void 0,function*(){const{state:e}=this.plasm;e===Bt.started?(yield new Promise(e=>{setTimeout(()=>{e(void 0)},5e3)}),this.sendLog()):this.plasm.behaviorData=[]})}sendLog(){return Tr(this,void 0,void 0,function*(){const{state:e,options:t}=this.plasm,{plasmApiUrl:n}=t;if(e!==Bt.started)return void(this.plasm.behaviorData=[]);const s=`${n}/events`,i=Object.assign(Object.assign({},this.plasm.behaviorData[0]),{sendTime:(new Date).toISOString()});try{yield It({url:s,method:"POST",authToken:"",payload:i}),this.plasm.debug(`Log behavior ${i.event} success`),this.plasm.behaviorData.shift(),this.plasm.behaviorData.length>0&&this.sendLog()}catch(e){this.plasm.debug(`Log behavior ${i.event} failed`),_r.captureError(e,i),this.retrySendLog()}})}},Ir=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.click,this.handler=e=>this.onClick(e),this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}onClick(e){this.isOnHandler||(this.isOnHandler=!0,setTimeout(()=>{this.addLog(e,this.id),this.isOnHandler=!1},1e3))}},Ur=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.copy,this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}},Dr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.load,this.handler=()=>{}}getWebGlInfo(){var e;try{const t=document.createElement("canvas"),n=t.getContext("webgl")||t.getContext("experimental-webgl");if(null==n)return null;const s=n.getExtension("WEBGL_debug_renderer_info"),i=n.getParameter(null!=s?s.UNMASKED_VENDOR_WEBGL:n.VENDOR),r=n.getParameter(null!=s?s.UNMASKED_RENDERER_WEBGL:n.RENDERER);return null===(e=n.getExtension("WEBGL_lose_context"))||void 0===e||e.loseContext(),{vendor:i,renderer:r}}catch(e){return null}}getTimezone(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return null}}start(){var e;const{innerWidth:t,innerHeight:n,screen:s}=window,{width:i,height:r,orientation:o,availHeight:a,availWidth:l}=s,d={angle:o.angle,type:o.type},{userAgent:c}=navigator,h={hardwareConcurrency:navigator.hardwareConcurrency,userAgent:navigator.userAgent,platform:navigator.platform,vendor:navigator.vendor,appVersion:navigator.appVersion,screen:{width:s.width,height:s.height,orientation:d,availWidth:s.availWidth,availHeight:s.availHeight},pdfViewerEnabled:navigator.pdfViewerEnabled,timezoneOffset:(new Date).getTimezoneOffset(),timezone:this.getTimezone(),language:navigator.language,languages:navigator.languages,webdriver:null!==(e=navigator.webdriver)&&void 0!==e?e:null,pluginsCount:null!=navigator.plugins?navigator.plugins.length:null,webGl:this.getWebGlInfo()};null!=navigator.deviceMemory&&(h.deviceMemory=navigator.deviceMemory);const u={width:i,height:r,orientation:d,availHeight:a,availWidth:l,innerWidth:t,innerHeight:n,userAgent:c,buildVersion:this.plasm.config.buildVersion,deviceInfo:h};"isExtended"in s&&(u.isExtended=window.screen.isExtended),this.plasm.debug(`Behavior ${this.id} started`),this.addLog(new Event(this.id),this.id,u)}},Pr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.online}},Lr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.offline}},Nr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.blur}},zr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.focus}},Br=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.beforeunload}},Fr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.contextmenu,this.handler=e=>this.onContextMenu(e),this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}onContextMenu(e){if(null!=this.addMetadata){const t=this.addMetadata(e),{questionId:n}=t;null!=n&&setTimeout(()=>{this.captureScreenshot({trigger:"question-selection-context-menu-called"})},200)}this.addLog(e,this.id)}},jr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.change,this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}},Mr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.cut,this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}},Hr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.paste,this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}},Zr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.dblclick,this.handler=e=>this.onDoubleClick(e),this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}onDoubleClick(e){this.isOnHandler||(this.isOnHandler=!0,setTimeout(()=>{this.addLog(e,this.id),this.isOnHandler=!1},1e3))}},qr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.drag,this.handler=e=>this.onDrag(e)}onDrag(e){this.isOnHandler||(this.isOnHandler=!0,setTimeout(()=>{this.addLog(e,this.id),this.isOnHandler=!1},1e4))}},$r=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.select,this.iframeBehaviorListeners=[{type:this.id,listener:this.handler}]}},Wr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.resize,this.handler=e=>this.onResize(e)}onResize(e){this.isOnHandler||(this.isOnHandler=!0,this.addLog(e,this.id),setTimeout(()=>{this.addLog(e,jt.afterresize,{windowSize:{width:window.innerWidth,height:window.innerHeight}})},5e3),setTimeout(()=>{this.isOnHandler=!1},1e4))}},Kr=class extends Cr{constructor(e,t,n){super(e,t,n),this.oldScrollY=0,this.oldScrollX=0,this.id=jt.scroll,this.oldScrollY=window.scrollY,this.oldScrollX=window.scrollY,this.handler=e=>this.onScroll(e)}onScroll(e){const{scrollY:t,scrollX:n}=window;if(this.isOnHandler)return this.oldScrollY=t,void(this.oldScrollX=n);this.isOnHandler=!0;let s="";t!==this.oldScrollY?s=this.oldScrollY{this.isOnHandler=!1},1e4)}},Vr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.mouseout,this.handler=e=>this.onMouseOut(e)}onMouseOut(e){const{clientX:t,clientY:n,relatedTarget:s}=e;if(null==s){const{innerWidth:s,innerHeight:i}=window;let r="";t<0?r="left":n<0?r="top":s0&&this.addLog(e,this.id,{direction:r})}}},Xr=class extends Cr{constructor(e,t,n){super(e,t,n),this.whitelistKeyCodes=["Control","Alt","Escape","Meta","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],this.pressedKeyCodes=[],this.id=jt.key,this.keyDownHandler=e=>this.onKeyDown(e),this.keyUpHandler=()=>this.onKeyUp(),this.iframeBehaviorListeners=[{type:"keydown",listener:this.keyDownHandler},{type:"keyup",listener:this.keyUpHandler}]}onKeyDown(e){!1===this.pressedKeyCodes.includes(e.key)&&(this.pressedKeyCodes.push(e.key),this.whitelistKeyCodes.includes(this.pressedKeyCodes[0])&&this.addLog(e,this.id,{pressedKeys:this.pressedKeyCodes}))}onKeyUp(){this.pressedKeyCodes=[]}start(){window.addEventListener("keydown",this.keyDownHandler),window.addEventListener("keyup",this.keyUpHandler),this.plasm.debug(`Behavior ${this.id} started`)}stop(){window.removeEventListener("keydown",this.keyDownHandler),window.removeEventListener("keyup",this.keyUpHandler),this.plasm.debug(`Behavior ${this.id} stopped`)}},Jr=class extends Cr{constructor(e,t,n){super(e,t,n),this.id=jt.unfocus,this.handler=()=>{}}start(){this.plasm.debug(`Behavior ${this.id} started`)}stop(){this.plasm.debug(`Behavior ${this.id} stopped`)}},Yr=e=>{try{const t=e.contentWindow;return null!=t&&null!=t.document?t:null}catch(e){return null}},Gr=e=>{try{return Array.from(e.document.querySelectorAll("iframe"))}catch(e){return[]}},Qr=class{constructor(e,t){this.hookedIframes=new WeakSet,this.stopped=!1,this.plasm=e,this.listeners=t}attachListenersTo(e){if(this.stopped)return;const t=Yr(e);null!=t&&this.listeners.forEach(e=>{t.document.addEventListener(e.type,e.listener,!0)})}detachListenersFrom(e){const t=Yr(e);null!=t&&this.listeners.forEach(e=>{t.document.removeEventListener(e.type,e.listener,!0)})}hookLoad(e){this.hookedIframes.has(e)||(this.hookedIframes.add(e),e.addEventListener("load",()=>{if(this.stopped)return;this.attachListenersTo(e);const t=Yr(e);null!=t&&this.sweepFrom(t)}))}sweepFrom(e){this.stopped||Gr(e).forEach(e=>{this.hookLoad(e),this.attachListenersTo(e);const t=Yr(e);null!=t&&this.sweepFrom(t)})}detachFrom(e){Gr(e).forEach(e=>{const t=Yr(e);null!=t&&this.detachFrom(t),this.detachListenersFrom(e)})}start(){this.stopped=!1,this.sweepFrom(window),this.sweepIntervalId=setInterval(()=>this.sweepFrom(window),1e3),this.plasm.debug("Iframe behavior collector started")}stop(){this.stopped=!0,clearInterval(this.sweepIntervalId),this.sweepIntervalId=void 0,this.detachFrom(window),this.plasm.debug("Iframe behavior collector stopped")}},eo=class extends Cr{constructor(e,t,n){super(e,t,n),this.collectIntervalDuration=1e4,this.movementHistory=[],this.lastIntervalRunTime=Date.now(),this.collectInterval=null,this.id=jt.mousespeed,this.handler=()=>{},this.init(),this.iframeBehaviorListeners=[{type:"mousemove",listener:this.mousemoveHandler}]}onMousemove(e){this.movementHistory.push({x:e.clientX,y:e.clientY,time:Date.now()})}init(){const e=new Event("mousemove");this.mousemoveHandler=e=>this.onMousemove(e),this.collectInterval=setInterval(()=>{const{movementHistory:t}=this,n=t.length,s=Date.now();let i=0;if(n>=2){const e=(t[n-1].time-t[0].time)/1e3;if(e>0){let s=0;for(let e=1;e{},this.init(),this.iframeBehaviorListeners=[{type:"keydown",listener:this.keydownHandler}]}onKeydown(){this.keystrokesCount+=1}init(){const e=new Event("keydown");this.keydownHandler=()=>this.onKeydown(),this.collectInterval=setInterval(()=>{const t=Date.now(),n={fromTime:new Date(this.lastIntervalRunTime).toISOString(),toTime:new Date(t).toISOString(),keystrokesCount:this.keystrokesCount};this.addLog(e,this.id,n),this.keystrokesCount=0,this.lastIntervalRunTime=t},this.collectIntervalDuration)}start(){window.addEventListener("keydown",this.keydownHandler),this.plasm.debug(`Behavior ${this.id} started`)}stop(){window.removeEventListener("keydown",this.keydownHandler),null!=this.collectInterval&&clearInterval(this.collectInterval),this.plasm.debug(`Behavior ${this.id} stopped`)}},no=class extends Cr{constructor(e,t,n){super(e,t,n),this.eventDispatched=!1,this.onTouchEnd=e=>{var t;if((null===(t=window.getSelection())||void 0===t?void 0:t.toString())&&!this.eventDispatched){if(this.eventDispatched=!0,null!=this.addMetadata){const t=this.addMetadata(e),{questionId:n}=t;null!=n&&setTimeout(()=>{this.captureScreenshot({trigger:"question-selection-context-menu-called"})},200)}this.addLog(e,this.id),setTimeout(()=>{this.eventDispatched=!1},200)}},this.id=jt.contextmenu,this.handler=()=>{},this.iframeBehaviorListeners=[{type:"touchend",listener:this.onTouchEnd}]}start(){window.addEventListener("touchend",this.onTouchEnd),this.plasm.debug(`Behavior ${this.id} started`)}stop(){window.removeEventListener("touchend",this.onTouchEnd),this.plasm.debug(`Behavior ${this.id} stopped`)}};var so=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};class io{constructor(e){this.logger=new mr("Plasm"),this.state=Bt.notready,this.configuredCollectors=[],this.configuredBehaviors=[],this.behaviorData=[],this.iframeBehaviorListeners=[];try{io.validateOptions(e),this.options=e,this.supportedCollectors=io.getSupportedCollectors(),e.sessionUuid&&(this.sessionUuid=e.sessionUuid)}catch(e){this.handleExceptionInPublicApi(e)}}handleExceptionInPublicApi(e){const t=e instanceof fr&&e.isHandled;if(t||this.logger.error(e),e instanceof ur||t)throw e;_r.captureError(e);const n=new fr({code:"general"});throw n.isHandled=!0,n}init(){return so(this,void 0,void 0,function*(){try{this.config=yield this.fetchConfig(),this.setApplicationMetadata(),this.initSentrySafely()}catch(e){this.handleExceptionInPublicApi(e)}})}initSentrySafely(){if(null!=this.config.sentryDSN)try{_r.init({buildVersion:this.config.buildVersion,sentryDSN:this.config.sentryDSN,env:this.config.sentryEnv,integrationApp:this.options.appName})}catch(e){this.logger.error("Sentry setup failed",e)}}static validateOptions(e){if(null!=e.expiresIn&&e.expiresIn<1)throw new ur({code:"invalid_input",msg:'"expiresIn" should be greater than or equal 1'})}static getSupportedCollectors(){const e=[];return Object.keys(zt).forEach(t=>{var n,s;switch(t){case zt.camera:void 0!==(null===(n=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===n?void 0:n.getUserMedia)&&e.push(t);break;case zt.screen:(void 0!==(null===(s=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===s?void 0:s.getDisplayMedia)||Dt())&&e.push(t);break;case zt.navigation:e.push(t)}}),e}setupCollector(e,t){return so(this,void 0,void 0,function*(){try{yield this.stopCollectorIfRunning(e);const n=this.createCollector(e,t),s=yield n.setup();return s.status===ar.success&&this.configuredCollectors.push(n),s}catch(e){this.handleExceptionInPublicApi(e)}})}stopCollectorIfRunning(e){return so(this,void 0,void 0,function*(){const t=this.configuredCollectors.find(t=>t.id===e);null!=t&&(yield t.stop(),this.configuredCollectors=this.configuredCollectors.filter(t=>t.id!==e))})}createCollector(e,t){switch(e){case zt.camera:return new Sr(t,this);case zt.screen:return new xr(t,this);case zt.navigation:return new Ar(t,this);default:throw new ur({msg:"unknown collector id"})}}getReady(){return so(this,void 0,void 0,function*(){this.validateStart();try{yield Promise.all(this.configuredCollectors.map(e=>e.getReady())),this.state=Bt.stopped}catch(e){this.handleExceptionInPublicApi(e)}})}startCollectors(e){return so(this,void 0,void 0,function*(){yield Promise.all(this.configuredCollectors.map(e=>e.start())),this.state=Bt.started,this.debug(`started. collectors: [${this.configuredCollectors.map(e=>e.id).join(", ")}]`);const{appName:t}=this.config;if(null!=e&&null!=e.collectibles){const{collectibles:n,addMetadata:s}=e;this.startBehavior(n,t,s,e.iframesUsed)}})}clearIntervalAndTimeoutStartChecker(){null!=this.startCheckerTimeoutId&&clearTimeout(this.startCheckerTimeoutId),null!=this.startCheckerIntervalId&&clearInterval(this.startCheckerIntervalId)}startWithChecker(e){return so(this,void 0,void 0,function*(){if(this.state===Bt.started)return;const{startChecker:t}=this.options;this.startCheckerTimeoutId=setTimeout(()=>so(this,void 0,void 0,function*(){this.state!==Bt.started&&(yield this.startCollectors(e),this.clearIntervalAndTimeoutStartChecker())}),t.timeout),this.startCheckerIntervalId=setInterval(()=>so(this,void 0,void 0,function*(){this.state!==Bt.started&&t.isCollectorsCanStartWithInterval()&&(yield this.startCollectors(e),this.clearIntervalAndTimeoutStartChecker())}),t.interval)})}start(e){return so(this,void 0,void 0,function*(){try{switch(null!=e&&this.updateOptions(e),yield this.prepareStart(),this.state){case Bt.notready:this.logger.warn('not yet ready. You need to call "getReady" prior to "start"');break;case Bt.started:this.logger.warn("already started");break;case Bt.stopped:null==this.options.startChecker?yield this.startCollectors(e):yield this.startWithChecker(e)}return this.sessionUuid}catch(e){this.handleExceptionInPublicApi(e)}})}updateOptions(e){const{sessionUuid:t,snapshotInterval:n,screenshotInterval:s}=e;null!=t&&(this.sessionUuid=t),this.configuredCollectors.forEach(e=>{e.id===zt.camera&&null!=n&&e.setOptions({interval:n}),e.id===zt.screen&&null!=s&&e.setOptions({interval:s})})}prepareStart(){return so(this,void 0,void 0,function*(){this.validateStart(),yield this.prepareSession()})}validateStart(){if(0===this.configuredCollectors.length)throw new ur({msg:"failed to start: no configured collectors"})}prepareSession(){return so(this,void 0,void 0,function*(){if(void 0===this.sessionUuid){const e=yield this.createSessionRequest();this.sessionUuid=e.uuid}})}fetchConfig(){return so(this,void 0,void 0,function*(){const e=`${this.options.plasmApiUrl}/config`;return It({authToken:this.options.clientToken,method:"GET",url:e})})}stop(){return so(this,void 0,void 0,function*(){if(this.state!==Bt.stopped)try{this.configuredCollectors.forEach(e=>e.stop()),this.stopBehavior(),this.state=Bt.stopped,this.debug("Plasm stopped")}catch(e){this.handleExceptionInPublicApi(e)}})}createSessionRequest(){return so(this,void 0,void 0,function*(){const e={expiresIn:this.options.expiresIn},t=`${this.options.plasmApiUrl}/sessions`;return It({authToken:this.options.clientToken,method:"POST",url:t,payload:e})})}debug(e){this.options.debug&&this.logger.debug(e)}startBehavior(e,t,n,s){this.configuredBehaviors.length>0&&this.configuredBehaviors.forEach(e=>e.stop()),this.configuredBehaviors=[],e.forEach(e=>{let i=null;switch(e){case jt.click:i=new Ir(this,t,n);break;case jt.dblclick:i=new Zr(this,t,n);break;case jt.copy:i=new Ur(this,t,n);break;case jt.cut:i=new Mr(this,t,n);break;case jt.paste:i=new Hr(this,t,n);break;case jt.load:i=new Dr(this,t,n);break;case jt.online:i=new Pr(this,t,n);break;case jt.offline:i=new Lr(this,t,n);break;case jt.blur:i=new Nr(this,t,n);break;case jt.focus:i=new zr(this,t,n);break;case jt.beforeunload:i=new Br(this,t,n);break;case jt.contextmenu:i=(()=>{const e="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;return/iPhone|iPad/i.test(navigator.userAgent)||e})()?new no(this,t,n):new Fr(this,t,n);break;case jt.change:i=new jr(this,t,n);break;case jt.drag:i=new qr(this,t,n);break;case jt.select:i=new $r(this,t,n);break;case jt.resize:i=new Wr(this,t,n);break;case jt.scroll:i=new Kr(this,t,n);break;case jt.mouseout:i=new Vr(this,t,n);break;case jt.key:i=new Xr(this,t,n);break;case jt.unfocus:{i=new Jr(this,t,n);const e=this.configuredCollectors.find(e=>e.id===zt.navigation);null!=e&&e.setPubSubEventCollector(i);break}case jt.mousespeed:i=new eo(this,t,n);break;case jt.keystrokespeed:i=new to(this,t,n);break;default:throw new ur({msg:"unknown behavior id"})}null!=i&&(i.start(),this.configuredBehaviors.push(i),s&&i.iframeBehaviorListeners.length>0&&(this.iframeBehaviorListeners=[...this.iframeBehaviorListeners,...i.iframeBehaviorListeners]))}),s&&this.iframeBehaviorListeners.length>0&&(this.iframeBehaviorCollector=new Qr(this,this.iframeBehaviorListeners),this.iframeBehaviorCollector.start())}stopBehavior(){this.configuredBehaviors.forEach(e=>e.stop()),null!=this.iframeBehaviorCollector&&this.iframeBehaviorCollector.stop()}createSnapshot(e){return so(this,void 0,void 0,function*(){if(this.state!==Bt.started)throw new ur({msg:"failed create snapshot. Plasm not started"});try{const t=this.configuredCollectors.find(e=>e.id===zt.camera);if(null==t)throw new ur({msg:"snapshot collector not configured"});yield t.drawAndSendImage(e)}catch(e){this.handleExceptionInPublicApi(e)}})}createScreenshot(e){return so(this,void 0,void 0,function*(){if(this.state!==Bt.started)throw new ur({msg:"failed create screenshot.fo Plasm not started"});try{const t=this.configuredCollectors.find(e=>e.id===zt.screen);if(null==t)throw new ur({msg:"screenshot collector not configured"});yield t.drawAndSendImage(e)}catch(e){this.handleExceptionInPublicApi(e)}})}setApplicationMetadata(){return so(this,void 0,void 0,function*(){const{applicationMetadata:e,clientToken:t,plasmApiUrl:n}=this.options;null!=e&&It({authToken:t,method:"POST",url:`${n}/applications/set-metadata`,payload:e})})}refreshCollector(e){return so(this,void 0,void 0,function*(){const t=this.configuredCollectors.find(t=>t.id===e);if(null==t)return this.logger.warn(`[PLASM] collector "${e}" not found`),null;const{options:n}=t;try{yield t.stop();const s=this.createCollector(e,n),i=yield s.setup();return this.configuredCollectors=this.configuredCollectors.map(t=>t.id===e?s:t),this.state===Bt.started&&(yield s.getReady(),yield s.start()),i}catch(e){return _r.captureError(e),null}})}}window.Plasm=io})(); //# sourceMappingURL=collector.min.js.map