@astropay/payments-lib 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astropay-payments-lib.es.js +1 -1
- package/dist/astropay-payments-lib.umd.js +142 -130
- package/dist/{main-DcyIcTY7.js → main-6waZa7Q3.js} +3938 -3741
- package/dist/{profiler-DOjJT9RY.js → profiler-xDfSQSgI.js} +1 -1
- package/dist/{startRecording-CKIy7MKJ.js → startRecording-DynnLqeo.js} +1 -1
- package/dist/types/index.d.ts +159 -4
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Ce,Be){typeof exports=="object"&&typeof module<"u"?Be(exports):typeof define=="function"&&define.amd?define(["exports"],Be):(Ce=typeof globalThis<"u"?globalThis:Ce||self,Be(Ce.AstroPay={}))})(this,function(Ce){"use strict";var xv=Object.defineProperty;var Tv=(Ce,Be,Jt)=>Be in Ce?xv(Ce,Be,{enumerable:!0,configurable:!0,writable:!0,value:Jt}):Ce[Be]=Jt;var A=(Ce,Be,Jt)=>Tv(Ce,typeof Be!="symbol"?Be+"":Be,Jt);const Be=["production","sandbox"],Jt=["light","dark"],Md=["en","pt","es"],Dd=["iso","symbol"],As=async e=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).catch(t=>{console.error("Error to copy:",t)}):new Promise((t,n)=>{const r=document.createElement("textarea");r.value=e,r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?t():n(new Error("Failed to copy text using execCommand"))}catch(s){n(s)}finally{document.body.removeChild(r)}}),Fd=async(e,t,n)=>{if(navigator.share)try{const r={title:e,text:t,...n&&{url:n}};await navigator.share(r)}catch(r){console.error("Failed to share information:",r)}else{console.warn("Web Share API not supported");const r=`${e}
|
|
2
2
|
${t}${n?`
|
|
3
|
-
${n}`:""}`;await Ts(r)}};function yr(e,t,n){return t.includes(e)?e:n}const At=class At{static init(t){const n=yr(t==null?void 0:t.environment,Fe,"production"),r=yr(t==null?void 0:t.currencyMode,Pd,"iso");At.environment=n,At.currencyMode=r}static getEnvironment(){return At.environment}static getCurrencyMode(){return At.currencyMode}};T(At,"environment"),T(At,"currencyMode");let Nn=At;const D=e=>typeof e=="string",Mn=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},To=e=>e==null?"":""+e,Nd=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Md=/###/g,Ao=e=>e&&e.indexOf("###")>-1?e.replace(Md,"."):e,Ro=e=>!e||D(e),Dn=(e,t,n)=>{const r=D(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if(Ro(e))return{};const i=Ao(r[s]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++s}return Ro(e)?{}:{obj:e,k:Ao(r[s])}},Io=(e,t,n)=>{const{obj:r,k:s}=Dn(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let i=t[t.length-1],o=t.slice(0,t.length-1),a=Dn(e,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=Dn(e,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Dd=(e,t,n,r)=>{const{obj:s,k:i}=Dn(e,t,Object);s[i]=s[i]||[],s[i].push(n)},br=(e,t)=>{const{obj:n,k:r}=Dn(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Fd=(e,t,n)=>{const r=br(e,n);return r!==void 0?r:br(t,n)},ko=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?D(e[r])||e[r]instanceof String||D(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ko(e[r],t[r],n):e[r]=t[r]);return e},Jt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Bd={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Ud=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>Bd[t]):e;class $d{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Vd=[" ",",","?","!",";"],zd=new $d(20),Hd=(e,t,n)=>{t=t||"",n=n||"";const r=Vd.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=zd.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(e);if(!i){const o=e.indexOf(n);o>0&&!s.test(e.substring(0,o))&&(i=!0)}return i},As=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let s=e;for(let i=0;i<r.length;){if(!s||typeof s!="object")return;let o,a="";for(let c=i;c<r.length;++c)if(c!==i&&(a+=n),a+=r[c],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;i+=c-i+1;break}s=o}return s},wr=e=>e==null?void 0:e.replace("_","-"),jd={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class Sr{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||jd,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Sr(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Sr(this.logger,t)}}var Xe=new Sr;class _r{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[a,c]=o;for(let l=0;l<c;l++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,c]=o;for(let l=0;l<c;l++)a.apply(a,[t,...r])})}}class Oo extends _r{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){var l,u;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):D(r)&&i?a.push(...r.split(i)):a.push(r)));const c=br(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!o||!D(r)?c:As((u=(l=this.data)==null?void 0:l[t])==null?void 0:u[n],r,i)}addResource(t,n,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(a=t.split("."),s=n,n=a[1]),this.addNamespaces(n),Io(this.data,a,s),i.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(D(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=br(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?ko(c,r,i):c={...c,...r},Io(this.data,a,c),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var Po={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(i=>{var o;t=((o=this.processors[i])==null?void 0:o.process(t,n,r,s))??t}),t}};const Lo={},No=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class vr extends _r{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Nd(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Xe.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return(r==null?void 0:r.res)!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Hd(t,r,s);if(o&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:D(i)?[i]:i};const l=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),t=l.join(s)}return{key:t,namespaces:D(i)?[i]:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],l=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((l==null?void 0:l.toLowerCase())==="cimode"){if(u){const A=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${A}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${A}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const d=this.resolve(t,n);let f=d==null?void 0:d.res;const h=(d==null?void 0:d.usedKey)||o,p=(d==null?void 0:d.exactUsedKey)||o,g=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,v=n.count!==void 0&&!D(n.count),b=vr.hasDefaultValue(n),_=v?this.pluralResolver.getSuffix(l,n.count,n):"",k=n.ordinal&&v?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):"",x=v&&!n.ordinal&&n.count===0,y=x&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${_}`]||n[`defaultValue${k}`]||n.defaultValue;let R=f;w&&!f&&b&&(R=y);const C=No(R),I=Object.prototype.toString.apply(R);if(w&&R&&C&&g.indexOf(I)<0&&!(D(m)&&Array.isArray(R))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,R,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(d.res=A,d.usedParams=this.getUsedParamsDetails(n),d):A}if(i){const A=Array.isArray(R),O=A?[]:{},P=A?p:h;for(const N in R)if(Object.prototype.hasOwnProperty.call(R,N)){const Q=`${P}${i}${N}`;b&&!f?O[N]=this.translate(Q,{...n,defaultValue:No(y)?y[N]:void 0,joinArrays:!1,ns:a}):O[N]=this.translate(Q,{...n,joinArrays:!1,ns:a}),O[N]===Q&&(O[N]=R[N])}f=O}}else if(w&&D(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,n,r));else{let A=!1,O=!1;!this.isValidLookup(f)&&b&&(A=!0,f=y),this.isValidLookup(f)||(O=!0,f=o);const N=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&O?void 0:f,Q=b&&y!==f&&this.options.updateMissing;if(O||A||Q){if(this.logger.log(Q?"updateKey":"missingKey",l,c,o,Q?y:f),i){const X=this.resolve(o,{...n,keySeparator:!1});X&&X.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ge=[];const $e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&$e&&$e[0])for(let X=0;X<$e.length;X++)ge.push($e[X]);else this.options.saveMissingTo==="all"?ge=this.languageUtils.toResolveHierarchy(n.lng||this.language):ge.push(n.lng||this.language);const qe=(X,ne,ee)=>{var ve;const Re=b&&ee!==f?ee:N;this.options.missingKeyHandler?this.options.missingKeyHandler(X,c,ne,Re,Q,n):(ve=this.backendConnector)!=null&&ve.saveMissing&&this.backendConnector.saveMissing(X,c,ne,Re,Q,n),this.emit("missingKey",X,c,ne,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?ge.forEach(X=>{const ne=this.pluralResolver.getSuffixes(X,n);x&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ne.indexOf(`${this.options.pluralSeparator}zero`)<0&&ne.push(`${this.options.pluralSeparator}zero`),ne.forEach(ee=>{qe([X],o+ee,n[`defaultValue${ee}`]||y)})}):qe(ge,o,y))}f=this.extendTranslation(f,t,n,d,r),O&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(O||A)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,A?f:void 0))}return s?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,n,r,s,i){var l,u;var o=this;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=D(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const p=t.match(this.interpolator.nestingRegexp);f=p&&p.length}let h=r.replace&&!D(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||s.usedLng,r),d){const p=t.match(this.interpolator.nestingRegexp),g=p&&p.length;f<g&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var p=arguments.length,g=new Array(p),m=0;m<p;m++)g[m]=arguments[m];return(i==null?void 0:i[0])===g[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):o.translate(...g,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=D(a)?[a]:a;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=Po.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,o,a;return D(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const l=this.extractFromKey(c,n),u=l.key;s=u;let d=l.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&!D(n.count),h=f&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(D(n.context)||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(m=>{var w,v;this.isValidLookup(r)||(a=m,!Lo[`${g[0]}-${m}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((v=this.utils)!=null&&v.hasLoadedNamespace(a))&&(Lo[`${g[0]}-${m}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(b=>{var x;if(this.isValidLookup(r))return;o=b;const _=[u];if((x=this.i18nFormat)!=null&&x.addLookupKeys)this.i18nFormat.addLookupKeys(_,u,b,m,n);else{let y;f&&(y=this.pluralResolver.getSuffix(b,n.count,n));const R=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(_.push(u+y),n.ordinal&&y.indexOf(C)===0&&_.push(u+y.replace(C,this.options.pluralSeparator)),h&&_.push(u+R)),p){const I=`${u}${this.options.contextSeparator}${n.context}`;_.push(I),f&&(_.push(I+y),n.ordinal&&y.indexOf(C)===0&&_.push(I+y.replace(C,this.options.pluralSeparator)),h&&_.push(I+R))}}let k;for(;k=_.pop();)this.isValidLookup(r)||(i=k,r=this.getResource(b,m,k,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){var i;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!D(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class Mo{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xe.create("languageUtils")}getScriptPartFromCode(t){if(t=wr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=wr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(D(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),D(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return D(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):D(t)&&i(this.formatLanguageCode(t)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const Do={zero:0,one:1,two:2,few:3,many:4,other:5},Fo={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Wd{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Xe.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=wr(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Fo;if(!t.match(/-|_/))return Fo;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[i]=o,o}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>Do[s]-Do[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Bo=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=Fd(e,t,n);return!i&&s&&D(n)&&(i=As(e,n,r),i===void 0&&(i=As(t,n,r))),i},Rs=e=>e.replace(/\$/g,"$$$$");class qd{constructor(){var n;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xe.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:m,maxReplaces:w,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:Ud,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Jt(i):o||"{{",this.suffix=a?Jt(a):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?Jt(f):h||Jt("$t("),this.nestingSuffix=p?Jt(p):g||Jt(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=w||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){var h;let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=p=>{if(p.indexOf(this.formatSeparator)<0){const v=Bo(n,c,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...s,...n,interpolationkey:p}):v}const g=p.split(this.formatSeparator),m=g.shift().trim(),w=g.join(this.formatSeparator).trim();return this.format(Bo(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...s,...n,interpolationkey:m})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((h=s==null?void 0:s.interpolation)==null?void 0:h.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>Rs(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?Rs(this.escape(p)):Rs(p)}].forEach(p=>{for(a=0;i=p.regex.exec(t);){const g=i[1].trim();if(o=l(g),o===void 0)if(typeof u=="function"){const w=u(t,i,s);o=D(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))o="";else if(d){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),o="";else!D(o)&&!this.useRawValueToEscape&&(o=To(o));const m=p.safeValue(o);if(t=t.replace(i[0],m),d?(p.regex.lastIndex+=o.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;const a=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const d=c.split(new RegExp(`${u}[ ]*{`));let f=`{${d[1]}`;c=d[0],f=this.interpolate(f,o);const h=f.match(/'/g),p=f.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),l&&(o={...l,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${u}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(t);){let c=[];o={...r},o=o.replace&&!D(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(d=>d.trim());s[1]=u.shift(),c=u,l=!0}if(i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===t&&!D(i))return i;D(i)||(i=To(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),i=""),l&&(i=c.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),t=t.replace(s[0],i),this.regexp.lastIndex=0}return t}}const Kd=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();n[u]||(n[u]=l),l==="false"&&(n[u]=!1),l==="true"&&(n[u]=!0),isNaN(l)||(n[u]=parseInt(l,10))}})}return{formatName:t,formatOptions:n}},Zt=e=>{const t={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=t[o];return a||(a=e(wr(r),s),t[o]=a),a(n)}};class Gd{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xe.create("formatter"),this.options=t,this.formats={number:Zt((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Zt((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Zt((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Zt((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Zt((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Zt(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{var d;const{formatName:l,formatOptions:u}=Kd(c);if(this.formats[l]){let f=a;try{const h=((d=s==null?void 0:s.formatParams)==null?void 0:d[s.interpolationkey])||{},p=h.locale||h.lng||s.locale||s.lng||r;f=this.formats[l](a,p,{...u,...s,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${l}`);return a},t)}}const Yd=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Jd extends _r{constructor(t,n,r){var i,o;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Xe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,r,s.backend,s)}queueLoad(t,n,r,s){const i={},o={},a={},c={};return t.forEach(l=>{let u=!0;n.forEach(d=>{const f=`${l}|${d}`;!r.reload&&this.store.hasResourceBundle(l,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,u=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),c[d]===void 0&&(c[d]=!0)))}),u||(a[l]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const s=t.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(c=>{Dd(c.loaded,[i],o),Yd(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{a[l]||(a[l]={});const u=c.loaded[l];u.length&&u.forEach(d=>{a[l][d]===void 0&&(a[l][d]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(l&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,i*2,o)},i);return}o(l,u)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const l=c(t,n);l&&typeof l.then=="function"?l.then(u=>a(null,u)).catch(a):a(null,l)}catch(l){a(l)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const i=this.queueLoad(t,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(t,o,a)})}saveMissing(t,n,r,s,i){var c,l,u,d,f;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((d=(u=this.services)==null?void 0:u.utils)!=null&&d.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((f=this.backend)!=null&&f.create){const h={...o,isUpdate:i},p=this.backend.create.bind(this.backend);if(p.length<6)try{let g;p.length===5?g=p(t,n,r,s,h):g=p(t,n,r,s),g&&typeof g.then=="function"?g.then(m=>a(null,m)).catch(a):a(null,g)}catch(g){a(g)}else p(t,n,r,s,a,h)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Uo=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),D(e[1])&&(t.defaultValue=e[1]),D(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),$o=e=>{var t,n;return D(e.ns)&&(e.ns=[e.ns]),D(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),D(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Er=()=>{},Zd=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Fn extends _r{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=$o(t),this.services={},this.logger=Xe,this.modules={external:[]},Zd(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(D(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Uo();this.options={...s,...this.options,...$o(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Xe.init(i(this.modules.logger),this.options):Xe.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Gd;const d=new Mo(this.options);this.store=new Oo(this.options.resources,this.options);const f=this.services;f.logger=Xe,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new Wd(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=i(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new qd(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Jd(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),m=1;m<p;m++)g[m-1]=arguments[m];t.emit(h,...g)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new vr(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),m=1;m<p;m++)g[m-1]=arguments[m];t.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Er),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const c=Mn(),l=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),r(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),c}loadResources(t){var i,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Er;const s=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(d=>{d!=="cimode"&&a.indexOf(d)<0&&a.push(d)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>c(u)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,l=>c(l)),this.services.backendConnector.load(a,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const s=Mn();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Er),this.services.backendConnector.reload(t,n,i=>{s.resolve(),r(i)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Po.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=Mn();this.emit("languageChanging",t);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,l)=>{l?(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{var u,d;!t&&!c&&this.services.languageDetector&&(c=[]);const l=D(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);l&&(this.language||i(l),this.translator.language||this.translator.changeLanguage(l),(d=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||d.call(u,l)),this.loadResources(l,f=>{o(f,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),s}getFixedT(t,n,r){var s=this;const i=function(o,a){let c;if(typeof a!="object"){for(var l=arguments.length,u=new Array(l>2?l-2:0),d=2;d<l;d++)u[d-2]=arguments[d];c=s.options.overloadTranslationOptionHandler([o,a].concat(u))}else c={...a};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||i.keyPrefix);const f=s.options.keySeparator||".";let h;return c.keyPrefix&&Array.isArray(o)?h=o.map(p=>`${c.keyPrefix}${f}${p}`):h=c.keyPrefix?`${c.keyPrefix}${f}${o}`:o,s.t(h,c)};return D(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){var s;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(s=this.translator)==null?void 0:s.translate(...n)}exists(){var s;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(s=this.translator)==null?void 0:s.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const l=this.services.backendConnector.state[`${a}|${c}`];return l===-1||l===0||l===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!s||o(i,t)))}loadNamespaces(t,n){const r=Mn();return this.options.ns?(D(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Mn();D(t)&&(t=[t]);const s=this.options.preload||[],i=t.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){var s,i;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new Mo(Uo());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Fn(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Er;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},i=new Fn(s);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},Object.keys(c[l]).reduce((u,d)=>(u[d]={...c[l][d]},u),{})),{});i.store=new Oo(a,s),i.services.resourceStore=i.store}return i.translator=new vr(i.services,s),i.translator.on("*",function(a){for(var c=arguments.length,l=new Array(c>1?c-1:0),u=1;u<c;u++)l[u-1]=arguments[u];i.emit(a,...l)}),i.init(s,n),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ue=Fn.createInstance();ue.createInstance=Fn.createInstance,ue.createInstance,ue.dir,ue.init,ue.loadResources,ue.reloadResources,ue.use,ue.changeLanguage,ue.getFixedT,ue.t,ue.exists,ue.setDefaultNamespace,ue.hasLoadedNamespace,ue.loadNamespaces,ue.loadLanguages;const Xd={en:{translation:{almost_done:"Almost done...",astro_express_checkout:"Express checkout",enter_country_code:"Please enter a country or code",enter_your_phone:"Enter your phone number",continue:"Continue",copied:"Copied!",copy_payment_link:"Copy payment link",do_not_close_window:"Please do not close this window.",didnt_receive:"Didn't receive it?",generic_error:"An error occurred. Please try again.",push_notification_sent:"We sent a push notification to your app",qr_code:"QR code",scan_qr_copy_link:"Scan the QR code or copy the link.",select:"Select",select_item:"Select an item",time_up:"Time's up!",try_again:"Try again",waiting_confirmation:"Waiting for confirmation..."}},es:{translation:{almost_done:"Casi listo...",astro_express_checkout:"Pago express",enter_country_code:"Introduce el país o código del país",enter_your_phone:"Introduzca su número de teléfono",continue:"Continuar",copied:"Copiado!",copy_payment_link:"Copiar enlace de pago",do_not_close_window:"Por favor, no cierres esta ventana.",didnt_receive:"No lo recibiste?",generic_error:"Ocurrió un error. Por favor, inténtelo de nuevo.",push_notification_sent:"Enviamos una notificación push a tu app",qr_code:"código QR",scan_qr_copy_link:"Escaneá el código QR o copiá el enlace.",select:"Seleccionar",select_item:"Selecciona una opción",time_up:"Se acabó el tiempo!",try_again:"Inténtalo de nuevo",waiting_confirmation:"Esperando confirmación..."}},pt:{translation:{almost_done:"Finalizando...",astro_express_checkout:"Pagamento expresso",enter_country_code:"Informe um país ou código",enter_your_phone:"Digite seu número de telefone",continue:"Continuar",copied:"Copiado!",copy_payment_link:"Copiar link de pagamento",do_not_close_window:"Por favor, não feche esta janela.",didnt_receive:"Não recebeu?",generic_error:"Ocorreu um erro. Por favor, tente novamente.",push_notification_sent:"Enviamos uma notificação push para seu app",qr_code:"QR code",scan_qr_copy_link:"Escaneie o QR code ou copie o link.",select:"Selecione",select_item:"Selecione um item",time_up:"Tempo esgotado!",try_again:"Tente novamente",waiting_confirmation:"Aguardando confirmação..."}}};class te{static init(t){const n=yr(t==null?void 0:t.language,Od,"en");return ue.init({lng:n,fallbackLng:"en",resources:Xd,interpolation:{escapeValue:!1}})}static getCurrent(){return ue.language}static translate(t,n){return ue.t(t,n??{})}}const Qd={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Vo={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},re={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Ce={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},gt={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class E{static getFirstMatch(t,n){const r=n.match(t);return r&&r.length>0&&r[1]||""}static getSecondMatch(t,n){const r=n.match(t);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(t,n,r){if(t.test(n))return r}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5)){if(n[0]===1&&n[1]<6)return"Cupcake";if(n[0]===1&&n[1]>=6)return"Donut";if(n[0]===2&&n[1]<2)return"Eclair";if(n[0]===2&&n[1]===2)return"Froyo";if(n[0]===2&&n[1]>2)return"Gingerbread";if(n[0]===3)return"Honeycomb";if(n[0]===4&&n[1]<1)return"Ice Cream Sandwich";if(n[0]===4&&n[1]<4)return"Jelly Bean";if(n[0]===4&&n[1]>=4)return"KitKat";if(n[0]===5)return"Lollipop";if(n[0]===6)return"Marshmallow";if(n[0]===7)return"Nougat";if(n[0]===8)return"Oreo";if(n[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,n,r=!1){const s=E.getVersionPrecision(t),i=E.getVersionPrecision(n);let o=Math.max(s,i),a=0;const c=E.map([t,n],l=>{const u=o-E.getVersionPrecision(l),d=l+new Array(u+1).join(".0");return E.map(d.split("."),f=>new Array(20-f.length).join("0")+f).reverse()});for(r&&(a=o-Math.min(s,i)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}}static map(t,n){const r=[];let s;if(Array.prototype.map)return Array.prototype.map.call(t,n);for(s=0;s<t.length;s+=1)r.push(n(t[s]));return r}static find(t,n){let r,s;if(Array.prototype.find)return Array.prototype.find.call(t,n);for(r=0,s=t.length;r<s;r+=1){const i=t[r];if(n(i,r))return i}}static assign(t,...n){const r=t;let s,i;if(Object.assign)return Object.assign(t,...n);for(s=0,i=n.length;s<i;s+=1){const o=n[s];typeof o=="object"&&o!==null&&Object.keys(o).forEach(c=>{r[c]=o[c]})}return t}static getBrowserAlias(t){return Qd[t]}static getBrowserTypeByAlias(t){return Vo[t]||""}}const J=/version\/(\d+(\.?_?\d+)+)/i,ef=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=E.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=E.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=E.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=E.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=E.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=E.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=E.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=E.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=E.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=E.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=E.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=E.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=E.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=E.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=E.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=E.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=E.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=E.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=E.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=E.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=E.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=E.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=E.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=E.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=E.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=E.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=E.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,n=/^(.*)\/(.*)[ \t]\((.*)/,s=e.search("\\(")!==-1?n:t;return{name:E.getFirstMatch(s,e),version:E.getSecondMatch(s,e)}}}],tf=[{test:[/Roku\/DVP/],describe(e){const t=E.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Ce.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=E.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Ce.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=E.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=E.getWindowsVersionName(t);return{name:Ce.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Ce.iOS},n=E.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=E.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=E.getMacOSVersionName(t),r={name:Ce.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=E.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Ce.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=E.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=E.getAndroidVersionName(t),r={name:Ce.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=E.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:Ce.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=E.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||E.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||E.getFirstMatch(/\bbb(\d+)/i,e);return{name:Ce.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=E.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Ce.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=E.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Ce.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:Ce.Linux}}},{test:[/CrOS/],describe(){return{name:Ce.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=E.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Ce.PlayStation4,version:t}}}],nf=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(e){const t=E.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:re.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:re.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:re.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:re.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:re.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:re.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:re.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=E.getFirstMatch(/(ipod|iphone)/i,e);return{type:re.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:re.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:re.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:re.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:re.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:re.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:re.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:re.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:re.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:re.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:re.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:re.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:re.tv}}}],rf=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:gt.Blink};const n=E.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:gt.EdgeHTML,version:n}}},{test:[/trident/i],describe(e){const t={name:gt.Trident},n=E.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:gt.Presto},n=E.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:gt.Gecko},n=E.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:gt.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:gt.WebKit},n=E.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class zo{constructor(t,n=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=E.find(ef,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=E.find(tf,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:n}=this.getOS();return t?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:n}=this.getPlatform();return t?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const t=E.find(nf,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=E.find(rf,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return E.assign({},this.parsedResult)}satisfies(t){const n={};let r=0;const s={};let i=0;if(Object.keys(t).forEach(a=>{const c=t[a];typeof c=="string"?(s[a]=c,i+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=E.find(a,u=>this.isOS(u));if(c){const u=this.satisfies(n[c]);if(u!==void 0)return u}const l=E.find(a,u=>this.isPlatform(u));if(l){const u=this.satisfies(n[l]);if(u!==void 0)return u}}if(i>0){const a=Object.keys(s),c=E.find(a,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(s[c])}}isBrowser(t,n=!1){const r=this.getBrowserName().toLowerCase();let s=t.toLowerCase();const i=E.getBrowserTypeByAlias(s);return n&&i&&(s=i.toLowerCase()),s===r}compareVersion(t){let n=[0],r=t,s=!1;const i=this.getBrowserVersion();if(typeof i=="string")return t[0]===">"||t[0]==="<"?(r=t.substr(1),t[1]==="="?(s=!0,r=t.substr(2)):n=[],t[0]===">"?n.push(1):n.push(-1)):t[0]==="="?r=t.substr(1):t[0]==="~"&&(s=!0,r=t.substr(1)),n.indexOf(E.compareVersions(i,r,s))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,n=!1){return this.isBrowser(t,n)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(n=>this.is(n))}}/*!
|
|
3
|
+
${n}`:""}`;await As(r)}};function yr(e,t,n){return t.includes(e)?e:n}const kt=class kt{static init(t){const n=yr(t==null?void 0:t.environment,Be,"production"),r=yr(t==null?void 0:t.currencyMode,Dd,"iso");kt.environment=n,kt.currencyMode=r}static getEnvironment(){return kt.environment}static getCurrencyMode(){return kt.currencyMode}};A(kt,"environment"),A(kt,"currencyMode");let Mn=kt;const D=e=>typeof e=="string",Dn=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},Ro=e=>e==null?"":""+e,Bd=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},$d=/###/g,ko=e=>e&&e.indexOf("###")>-1?e.replace($d,"."):e,Io=e=>!e||D(e),Fn=(e,t,n)=>{const r=D(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if(Io(e))return{};const i=ko(r[s]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++s}return Io(e)?{}:{obj:e,k:ko(r[s])}},Oo=(e,t,n)=>{const{obj:r,k:s}=Fn(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let i=t[t.length-1],o=t.slice(0,t.length-1),a=Fn(e,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=Fn(e,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Ud=(e,t,n,r)=>{const{obj:s,k:i}=Fn(e,t,Object);s[i]=s[i]||[],s[i].push(n)},wr=(e,t)=>{const{obj:n,k:r}=Fn(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Vd=(e,t,n)=>{const r=wr(e,n);return r!==void 0?r:wr(t,n)},Lo=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?D(e[r])||e[r]instanceof String||D(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Lo(e[r],t[r],n):e[r]=t[r]);return e},Zt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var zd={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Hd=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>zd[t]):e;class jd{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Wd=[" ",",","?","!",";"],qd=new jd(20),Kd=(e,t,n)=>{t=t||"",n=n||"";const r=Wd.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=qd.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(e);if(!i){const o=e.indexOf(n);o>0&&!s.test(e.substring(0,o))&&(i=!0)}return i},Rs=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let s=e;for(let i=0;i<r.length;){if(!s||typeof s!="object")return;let o,a="";for(let c=i;c<r.length;++c)if(c!==i&&(a+=n),a+=r[c],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;i+=c-i+1;break}s=o}return s},Sr=e=>e==null?void 0:e.replace("_","-"),Gd={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class _r{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Gd,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new _r(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new _r(this.logger,t)}}var Qe=new _r;class vr{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[a,c]=o;for(let l=0;l<c;l++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,c]=o;for(let l=0;l<c;l++)a.apply(a,[t,...r])})}}class Po extends vr{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){var l,u;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):D(r)&&i?a.push(...r.split(i)):a.push(r)));const c=wr(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!o||!D(r)?c:Rs((u=(l=this.data)==null?void 0:l[t])==null?void 0:u[n],r,i)}addResource(t,n,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(a=t.split("."),s=n,n=a[1]),this.addNamespaces(n),Oo(this.data,a,s),i.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(D(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=wr(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?Lo(c,r,i):c={...c,...r},Oo(this.data,a,c),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var No={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(i=>{var o;t=((o=this.processors[i])==null?void 0:o.process(t,n,r,s))??t}),t}};const Mo={},Do=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class Er extends vr{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Bd(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Qe.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return(r==null?void 0:r.res)!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Kd(t,r,s);if(o&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:D(i)?[i]:i};const l=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),t=l.join(s)}return{key:t,namespaces:D(i)?[i]:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(t[t.length-1],n),c=a[a.length-1],l=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((l==null?void 0:l.toLowerCase())==="cimode"){if(u){const R=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${R}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${R}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const d=this.resolve(t,n);let f=d==null?void 0:d.res;const h=(d==null?void 0:d.usedKey)||o,p=(d==null?void 0:d.exactUsedKey)||o,g=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,v=n.count!==void 0&&!D(n.count),y=Er.hasDefaultValue(n),_=v?this.pluralResolver.getSuffix(l,n.count,n):"",O=n.ordinal&&v?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):"",T=v&&!n.ordinal&&n.count===0,b=T&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${_}`]||n[`defaultValue${O}`]||n.defaultValue;let k=f;w&&!f&&y&&(k=b);const x=Do(k),I=Object.prototype.toString.apply(k);if(w&&k&&x&&g.indexOf(I)<0&&!(D(m)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,k,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(d.res=R,d.usedParams=this.getUsedParamsDetails(n),d):R}if(i){const R=Array.isArray(k),L=R?[]:{},P=R?p:h;for(const N in k)if(Object.prototype.hasOwnProperty.call(k,N)){const Q=`${P}${i}${N}`;y&&!f?L[N]=this.translate(Q,{...n,defaultValue:Do(b)?b[N]:void 0,joinArrays:!1,ns:a}):L[N]=this.translate(Q,{...n,joinArrays:!1,ns:a}),L[N]===Q&&(L[N]=k[N])}f=L}}else if(w&&D(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,t,n,r));else{let R=!1,L=!1;!this.isValidLookup(f)&&y&&(R=!0,f=b),this.isValidLookup(f)||(L=!0,f=o);const N=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:f,Q=y&&b!==f&&this.options.updateMissing;if(L||R||Q){if(this.logger.log(Q?"updateKey":"missingKey",l,c,o,Q?b:f),i){const X=this.resolve(o,{...n,keySeparator:!1});X&&X.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let me=[];const Ve=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ve&&Ve[0])for(let X=0;X<Ve.length;X++)me.push(Ve[X]);else this.options.saveMissingTo==="all"?me=this.languageUtils.toResolveHierarchy(n.lng||this.language):me.push(n.lng||this.language);const Ke=(X,re,ee)=>{var Ee;const ke=y&&ee!==f?ee:N;this.options.missingKeyHandler?this.options.missingKeyHandler(X,c,re,ke,Q,n):(Ee=this.backendConnector)!=null&&Ee.saveMissing&&this.backendConnector.saveMissing(X,c,re,ke,Q,n),this.emit("missingKey",X,c,re,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?me.forEach(X=>{const re=this.pluralResolver.getSuffixes(X,n);T&&n[`defaultValue${this.options.pluralSeparator}zero`]&&re.indexOf(`${this.options.pluralSeparator}zero`)<0&&re.push(`${this.options.pluralSeparator}zero`),re.forEach(ee=>{Ke([X],o+ee,n[`defaultValue${ee}`]||b)})}):Ke(me,o,b))}f=this.extendTranslation(f,t,n,d,r),L&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(L||R)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,R?f:void 0))}return s?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,n,r,s,i){var l,u;var o=this;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=D(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const p=t.match(this.interpolator.nestingRegexp);f=p&&p.length}let h=r.replace&&!D(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||s.usedLng,r),d){const p=t.match(this.interpolator.nestingRegexp),g=p&&p.length;f<g&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var p=arguments.length,g=new Array(p),m=0;m<p;m++)g[m]=arguments[m];return(i==null?void 0:i[0])===g[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):o.translate(...g,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=D(a)?[a]:a;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=No.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,o,a;return D(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const l=this.extractFromKey(c,n),u=l.key;s=u;let d=l.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&!D(n.count),h=f&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(D(n.context)||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(m=>{var w,v;this.isValidLookup(r)||(a=m,!Mo[`${g[0]}-${m}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((v=this.utils)!=null&&v.hasLoadedNamespace(a))&&(Mo[`${g[0]}-${m}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(y=>{var T;if(this.isValidLookup(r))return;o=y;const _=[u];if((T=this.i18nFormat)!=null&&T.addLookupKeys)this.i18nFormat.addLookupKeys(_,u,y,m,n);else{let b;f&&(b=this.pluralResolver.getSuffix(y,n.count,n));const k=`${this.options.pluralSeparator}zero`,x=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(_.push(u+b),n.ordinal&&b.indexOf(x)===0&&_.push(u+b.replace(x,this.options.pluralSeparator)),h&&_.push(u+k)),p){const I=`${u}${this.options.contextSeparator}${n.context}`;_.push(I),f&&(_.push(I+b),n.ordinal&&b.indexOf(x)===0&&_.push(I+b.replace(x,this.options.pluralSeparator)),h&&_.push(I+k))}}let O;for(;O=_.pop();)this.isValidLookup(r)||(i=O,r=this.getResource(y,m,O,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){var i;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!D(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class Fo{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Qe.create("languageUtils")}getScriptPartFromCode(t){if(t=Sr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Sr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(D(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),D(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return D(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):D(t)&&i(this.formatLanguageCode(t)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const Bo={zero:0,one:1,two:2,few:3,many:4,other:5},$o={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Yd{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Qe.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Sr(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),$o;if(!t.match(/-|_/))return $o;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[i]=o,o}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>Bo[s]-Bo[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Uo=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=Vd(e,t,n);return!i&&s&&D(n)&&(i=Rs(e,n,r),i===void 0&&(i=Rs(t,n,r))),i},ks=e=>e.replace(/\$/g,"$$$$");class Jd{constructor(){var n;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Qe.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:m,maxReplaces:w,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:Hd,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Zt(i):o||"{{",this.suffix=a?Zt(a):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?Zt(f):h||Zt("$t("),this.nestingSuffix=p?Zt(p):g||Zt(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=w||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){var h;let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=p=>{if(p.indexOf(this.formatSeparator)<0){const v=Uo(n,c,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...s,...n,interpolationkey:p}):v}const g=p.split(this.formatSeparator),m=g.shift().trim(),w=g.join(this.formatSeparator).trim();return this.format(Uo(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...s,...n,interpolationkey:m})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((h=s==null?void 0:s.interpolation)==null?void 0:h.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>ks(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?ks(this.escape(p)):ks(p)}].forEach(p=>{for(a=0;i=p.regex.exec(t);){const g=i[1].trim();if(o=l(g),o===void 0)if(typeof u=="function"){const w=u(t,i,s);o=D(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))o="";else if(d){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),o="";else!D(o)&&!this.useRawValueToEscape&&(o=Ro(o));const m=p.safeValue(o);if(t=t.replace(i[0],m),d?(p.regex.lastIndex+=o.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;const a=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const d=c.split(new RegExp(`${u}[ ]*{`));let f=`{${d[1]}`;c=d[0],f=this.interpolate(f,o);const h=f.match(/'/g),p=f.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),l&&(o={...l,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${u}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(t);){let c=[];o={...r},o=o.replace&&!D(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(d=>d.trim());s[1]=u.shift(),c=u,l=!0}if(i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===t&&!D(i))return i;D(i)||(i=Ro(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),i=""),l&&(i=c.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),t=t.replace(s[0],i),this.regexp.lastIndex=0}return t}}const Zd=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();n[u]||(n[u]=l),l==="false"&&(n[u]=!1),l==="true"&&(n[u]=!0),isNaN(l)||(n[u]=parseInt(l,10))}})}return{formatName:t,formatOptions:n}},Xt=e=>{const t={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=t[o];return a||(a=e(Sr(r),s),t[o]=a),a(n)}};class Xd{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Qe.create("formatter"),this.options=t,this.formats={number:Xt((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Xt((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Xt((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Xt((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Xt((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Xt(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{var d;const{formatName:l,formatOptions:u}=Zd(c);if(this.formats[l]){let f=a;try{const h=((d=s==null?void 0:s.formatParams)==null?void 0:d[s.interpolationkey])||{},p=h.locale||h.lng||s.locale||s.lng||r;f=this.formats[l](a,p,{...u,...s,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${l}`);return a},t)}}const Qd=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class ef extends vr{constructor(t,n,r){var i,o;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Qe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,r,s.backend,s)}queueLoad(t,n,r,s){const i={},o={},a={},c={};return t.forEach(l=>{let u=!0;n.forEach(d=>{const f=`${l}|${d}`;!r.reload&&this.store.hasResourceBundle(l,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,u=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),c[d]===void 0&&(c[d]=!0)))}),u||(a[l]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const s=t.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(c=>{Ud(c.loaded,[i],o),Qd(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{a[l]||(a[l]={});const u=c.loaded[l];u.length&&u.forEach(d=>{a[l][d]===void 0&&(a[l][d]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(l&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,i*2,o)},i);return}o(l,u)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const l=c(t,n);l&&typeof l.then=="function"?l.then(u=>a(null,u)).catch(a):a(null,l)}catch(l){a(l)}return}return c(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const i=this.queueLoad(t,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(t,o,a)})}saveMissing(t,n,r,s,i){var c,l,u,d,f;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((d=(u=this.services)==null?void 0:u.utils)!=null&&d.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((f=this.backend)!=null&&f.create){const h={...o,isUpdate:i},p=this.backend.create.bind(this.backend);if(p.length<6)try{let g;p.length===5?g=p(t,n,r,s,h):g=p(t,n,r,s),g&&typeof g.then=="function"?g.then(m=>a(null,m)).catch(a):a(null,g)}catch(g){a(g)}else p(t,n,r,s,a,h)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Vo=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),D(e[1])&&(t.defaultValue=e[1]),D(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),zo=e=>{var t,n;return D(e.ns)&&(e.ns=[e.ns]),D(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),D(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Cr=()=>{},tf=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Bn extends vr{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=zo(t),this.services={},this.logger=Qe,this.modules={external:[]},tf(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(D(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Vo();this.options={...s,...this.options,...zo(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Qe.init(i(this.modules.logger),this.options):Qe.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Xd;const d=new Fo(this.options);this.store=new Po(this.options.resources,this.options);const f=this.services;f.logger=Qe,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new Yd(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=i(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Jd(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new ef(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),m=1;m<p;m++)g[m-1]=arguments[m];t.emit(h,...g)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Er(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),m=1;m<p;m++)g[m-1]=arguments[m];t.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Cr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const c=Dn(),l=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),r(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),c}loadResources(t){var i,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cr;const s=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(d=>{d!=="cimode"&&a.indexOf(d)<0&&a.push(d)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>c(u)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,l=>c(l)),this.services.backendConnector.load(a,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const s=Dn();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Cr),this.services.backendConnector.reload(t,n,i=>{s.resolve(),r(i)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&No.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=Dn();this.emit("languageChanging",t);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,l)=>{l?(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{var u,d;!t&&!c&&this.services.languageDetector&&(c=[]);const l=D(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);l&&(this.language||i(l),this.translator.language||this.translator.changeLanguage(l),(d=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||d.call(u,l)),this.loadResources(l,f=>{o(f,l)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),s}getFixedT(t,n,r){var s=this;const i=function(o,a){let c;if(typeof a!="object"){for(var l=arguments.length,u=new Array(l>2?l-2:0),d=2;d<l;d++)u[d-2]=arguments[d];c=s.options.overloadTranslationOptionHandler([o,a].concat(u))}else c={...a};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||i.keyPrefix);const f=s.options.keySeparator||".";let h;return c.keyPrefix&&Array.isArray(o)?h=o.map(p=>`${c.keyPrefix}${f}${p}`):h=c.keyPrefix?`${c.keyPrefix}${f}${o}`:o,s.t(h,c)};return D(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){var s;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(s=this.translator)==null?void 0:s.translate(...n)}exists(){var s;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(s=this.translator)==null?void 0:s.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const l=this.services.backendConnector.state[`${a}|${c}`];return l===-1||l===0||l===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!s||o(i,t)))}loadNamespaces(t,n){const r=Dn();return this.options.ns?(D(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Dn();D(t)&&(t=[t]);const s=this.options.preload||[],i=t.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){var s,i;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new Fo(Vo());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Bn(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cr;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},i=new Bn(s);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},Object.keys(c[l]).reduce((u,d)=>(u[d]={...c[l][d]},u),{})),{});i.store=new Po(a,s),i.services.resourceStore=i.store}return i.translator=new Er(i.services,s),i.translator.on("*",function(a){for(var c=arguments.length,l=new Array(c>1?c-1:0),u=1;u<c;u++)l[u-1]=arguments[u];i.emit(a,...l)}),i.init(s,n),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const de=Bn.createInstance();de.createInstance=Bn.createInstance,de.createInstance,de.dir,de.init,de.loadResources,de.reloadResources,de.use,de.changeLanguage,de.getFixedT,de.t,de.exists,de.setDefaultNamespace,de.hasLoadedNamespace,de.loadNamespaces,de.loadLanguages;const nf={en:{translation:{almost_done:"Almost done...",astro_express_checkout:"Express checkout",enter_country_code:"Please enter a country or code",enter_your_phone:"Enter your phone number",continue:"Continue",copied:"Copied!",copy_payment_link:"Copy payment link",do_not_close_window:"Please do not close this window.",didnt_receive:"Didn't receive it?",generic_error:"An error occurred. Please try again.",push_notification_sent:"We sent a push notification to your app",qr_code:"QR code",scan_qr_copy_link:"Scan the QR code or copy the link.",select:"Select",select_item:"Select an item",time_up:"Time's up!",try_again:"Try again",waiting_confirmation:"Waiting for confirmation..."}},es:{translation:{almost_done:"Casi listo...",astro_express_checkout:"Pago express",enter_country_code:"Introduce el país o código del país",enter_your_phone:"Introduzca su número de teléfono",continue:"Continuar",copied:"Copiado!",copy_payment_link:"Copiar enlace de pago",do_not_close_window:"Por favor, no cierres esta ventana.",didnt_receive:"No lo recibiste?",generic_error:"Ocurrió un error. Por favor, inténtelo de nuevo.",push_notification_sent:"Enviamos una notificación push a tu app",qr_code:"código QR",scan_qr_copy_link:"Escaneá el código QR o copiá el enlace.",select:"Seleccionar",select_item:"Selecciona una opción",time_up:"Se acabó el tiempo!",try_again:"Inténtalo de nuevo",waiting_confirmation:"Esperando confirmación..."}},pt:{translation:{almost_done:"Finalizando...",astro_express_checkout:"Pagamento expresso",enter_country_code:"Informe um país ou código",enter_your_phone:"Digite seu número de telefone",continue:"Continuar",copied:"Copiado!",copy_payment_link:"Copiar link de pagamento",do_not_close_window:"Por favor, não feche esta janela.",didnt_receive:"Não recebeu?",generic_error:"Ocorreu um erro. Por favor, tente novamente.",push_notification_sent:"Enviamos uma notificação push para seu app",qr_code:"QR code",scan_qr_copy_link:"Escaneie o QR code ou copie o link.",select:"Selecione",select_item:"Selecione um item",time_up:"Tempo esgotado!",try_again:"Tente novamente",waiting_confirmation:"Aguardando confirmação..."}}};class te{static init(t){const n=yr(t==null?void 0:t.language,Md,"en");return de.init({lng:n,fallbackLng:"en",resources:nf,interpolation:{escapeValue:!1}})}static getCurrent(){return de.language}static translate(t,n){return de.t(t,n??{})}}const rf={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Ho={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},se={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},xe={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},bt={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class E{static getFirstMatch(t,n){const r=n.match(t);return r&&r.length>0&&r[1]||""}static getSecondMatch(t,n){const r=n.match(t);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(t,n,r){if(t.test(n))return r}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5)){if(n[0]===1&&n[1]<6)return"Cupcake";if(n[0]===1&&n[1]>=6)return"Donut";if(n[0]===2&&n[1]<2)return"Eclair";if(n[0]===2&&n[1]===2)return"Froyo";if(n[0]===2&&n[1]>2)return"Gingerbread";if(n[0]===3)return"Honeycomb";if(n[0]===4&&n[1]<1)return"Ice Cream Sandwich";if(n[0]===4&&n[1]<4)return"Jelly Bean";if(n[0]===4&&n[1]>=4)return"KitKat";if(n[0]===5)return"Lollipop";if(n[0]===6)return"Marshmallow";if(n[0]===7)return"Nougat";if(n[0]===8)return"Oreo";if(n[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,n,r=!1){const s=E.getVersionPrecision(t),i=E.getVersionPrecision(n);let o=Math.max(s,i),a=0;const c=E.map([t,n],l=>{const u=o-E.getVersionPrecision(l),d=l+new Array(u+1).join(".0");return E.map(d.split("."),f=>new Array(20-f.length).join("0")+f).reverse()});for(r&&(a=o-Math.min(s,i)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}}static map(t,n){const r=[];let s;if(Array.prototype.map)return Array.prototype.map.call(t,n);for(s=0;s<t.length;s+=1)r.push(n(t[s]));return r}static find(t,n){let r,s;if(Array.prototype.find)return Array.prototype.find.call(t,n);for(r=0,s=t.length;r<s;r+=1){const i=t[r];if(n(i,r))return i}}static assign(t,...n){const r=t;let s,i;if(Object.assign)return Object.assign(t,...n);for(s=0,i=n.length;s<i;s+=1){const o=n[s];typeof o=="object"&&o!==null&&Object.keys(o).forEach(c=>{r[c]=o[c]})}return t}static getBrowserAlias(t){return rf[t]}static getBrowserTypeByAlias(t){return Ho[t]||""}}const J=/version\/(\d+(\.?_?\d+)+)/i,sf=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=E.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=E.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=E.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=E.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=E.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=E.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=E.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=E.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=E.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=E.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=E.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=E.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=E.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=E.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=E.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=E.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=E.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=E.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=E.getFirstMatch(J,e)||E.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=E.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=E.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=E.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=E.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=E.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=E.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=E.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=E.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=E.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=E.getFirstMatch(J,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,n=/^(.*)\/(.*)[ \t]\((.*)/,s=e.search("\\(")!==-1?n:t;return{name:E.getFirstMatch(s,e),version:E.getSecondMatch(s,e)}}}],of=[{test:[/Roku\/DVP/],describe(e){const t=E.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:xe.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=E.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:xe.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=E.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=E.getWindowsVersionName(t);return{name:xe.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:xe.iOS},n=E.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=E.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=E.getMacOSVersionName(t),r={name:xe.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=E.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:xe.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=E.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=E.getAndroidVersionName(t),r={name:xe.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=E.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:xe.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=E.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||E.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||E.getFirstMatch(/\bbb(\d+)/i,e);return{name:xe.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=E.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:xe.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=E.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:xe.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:xe.Linux}}},{test:[/CrOS/],describe(){return{name:xe.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=E.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:xe.PlayStation4,version:t}}}],af=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(e){const t=E.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:se.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:se.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:se.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:se.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:se.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:se.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:se.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=E.getFirstMatch(/(ipod|iphone)/i,e);return{type:se.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:se.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:se.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:se.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:se.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:se.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:se.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:se.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:se.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:se.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:se.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:se.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:se.tv}}}],cf=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:bt.Blink};const n=E.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:bt.EdgeHTML,version:n}}},{test:[/trident/i],describe(e){const t={name:bt.Trident},n=E.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:bt.Presto},n=E.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:bt.Gecko},n=E.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:bt.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:bt.WebKit},n=E.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class jo{constructor(t,n=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=E.find(sf,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=E.find(of,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:n}=this.getOS();return t?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:n}=this.getPlatform();return t?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const t=E.find(af,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=E.find(cf,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return E.assign({},this.parsedResult)}satisfies(t){const n={};let r=0;const s={};let i=0;if(Object.keys(t).forEach(a=>{const c=t[a];typeof c=="string"?(s[a]=c,i+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=E.find(a,u=>this.isOS(u));if(c){const u=this.satisfies(n[c]);if(u!==void 0)return u}const l=E.find(a,u=>this.isPlatform(u));if(l){const u=this.satisfies(n[l]);if(u!==void 0)return u}}if(i>0){const a=Object.keys(s),c=E.find(a,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(s[c])}}isBrowser(t,n=!1){const r=this.getBrowserName().toLowerCase();let s=t.toLowerCase();const i=E.getBrowserTypeByAlias(s);return n&&i&&(s=i.toLowerCase()),s===r}compareVersion(t){let n=[0],r=t,s=!1;const i=this.getBrowserVersion();if(typeof i=="string")return t[0]===">"||t[0]==="<"?(r=t.substr(1),t[1]==="="?(s=!0,r=t.substr(2)):n=[],t[0]===">"?n.push(1):n.push(-1)):t[0]==="="?r=t.substr(1):t[0]==="~"&&(s=!0,r=t.substr(1)),n.indexOf(E.compareVersions(i,r,s))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,n=!1){return this.isBrowser(t,n)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(n=>this.is(n))}}/*!
|
|
4
4
|
* Bowser - a browser detector
|
|
5
5
|
* https://github.com/lancedikson/bowser
|
|
6
6
|
* MIT License | (c) Dustin Diaz 2012-2015
|
|
7
7
|
* MIT License | (c) Denis Demchenko 2015-2019
|
|
8
|
-
*/class Ho{static getParser(t,n=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new zo(t,n)}static parse(t){return new zo(t).getResult()}static get BROWSER_MAP(){return Vo}static get ENGINE_MAP(){return gt}static get OS_MAP(){return Ce}static get PLATFORMS_MAP(){return re}}var Bn=(e=>(e.IOS="IOS",e.ANDROID="ANDROID",e.DESKTOP="DESKTOP",e))(Bn||{}),jo=(e=>(e.FIREFOX="Firefox",e.CHROME="Chrome",e.SAFARI="Safari",e.EDGE="Edge",e.OPERA="Opera",e))(jo||{});const Wo=()=>{const t=Ho.getParser(window.navigator.userAgent).getOSName().toUpperCase();return t&&Object.values(Bn).includes(t)?t:Bn.DESKTOP},sf=()=>{const e=Wo();return e===Bn.ANDROID||e===Bn.IOS},of=e=>{const t=Ho.getParser(window.navigator.userAgent).getBrowserName();return Array.isArray(e)?e.includes(t):t===e},af=e=>e.toLowerCase().replace(/(?:^|[^a-zA-Z0-9]+)([a-zA-Z0-9])/g,(t,n,r)=>r===0?n.toLowerCase():n.toUpperCase()),cf=e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").toLowerCase(),qo=e=>{const t=JSON.stringify(e);return btoa(t)},Xt=Array.isArray,It=e=>e!==null&&typeof e=="object"&&!Xt(e),Cr=e=>Object.entries(e).reduce((t,[n,r])=>({...t,[af(n)]:It(r)?Cr(r):Xt(r)?r.map(s=>It(s)?Cr(s):s):r}),{}),lf=e=>{if(Xt(e))return e.map(t=>It(t)?Cr(t):t);throw new Error("Input is not an array")},xr=e=>Object.entries(e).reduce((t,[n,r])=>({...t,[cf(n)]:It(r)?xr(r):Xt(r)?r.map(s=>It(s)?xr(s):s):r}),{}),uf=e=>{if(Xt(e))return e.map(t=>It(t)?xr(t):t);throw new Error("Input is not an array")},Ko=(e,t)=>Xt(e)?t==="snake_case-to-camelCase"?lf(e):uf(e):It(e)?t==="snake_case-to-camelCase"?Cr(e):xr(e):e;function Go(e,t){return function(){return e.apply(t,arguments)}}const{toString:df}=Object.prototype,{getPrototypeOf:Is}=Object,{iterator:Tr,toStringTag:Yo}=Symbol,Ar=(e=>t=>{const n=df.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ke=e=>(e=e.toLowerCase(),t=>Ar(t)===e),Rr=e=>t=>typeof t===e,{isArray:Qt}=Array,Un=Rr("undefined");function ff(e){return e!==null&&!Un(e)&&e.constructor!==null&&!Un(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Jo=Ke("ArrayBuffer");function pf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Jo(e.buffer),t}const hf=Rr("string"),Ie=Rr("function"),Zo=Rr("number"),Ir=e=>e!==null&&typeof e=="object",gf=e=>e===!0||e===!1,kr=e=>{if(Ar(e)!=="object")return!1;const t=Is(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Yo in e)&&!(Tr in e)},mf=Ke("Date"),yf=Ke("File"),bf=Ke("Blob"),wf=Ke("FileList"),Sf=e=>Ir(e)&&Ie(e.pipe),_f=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Ar(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},vf=Ke("URLSearchParams"),[Ef,Cf,xf,Tf]=["ReadableStream","Request","Response","Headers"].map(Ke),Af=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $n(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Qt(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function Xo(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const kt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Qo=e=>!Un(e)&&e!==kt;function ks(){const{caseless:e}=Qo(this)&&this||{},t={},n=(r,s)=>{const i=e&&Xo(t,s)||s;kr(t[i])&&kr(r)?t[i]=ks(t[i],r):kr(r)?t[i]=ks({},r):Qt(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&$n(arguments[r],n);return t}const Rf=(e,t,n,{allOwnKeys:r}={})=>($n(t,(s,i)=>{n&&Ie(s)?e[i]=Go(s,n):e[i]=s},{allOwnKeys:r}),e),If=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),kf=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Of=(e,t,n,r)=>{let s,i,o;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Is(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Pf=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Lf=e=>{if(!e)return null;if(Qt(e))return e;let t=e.length;if(!Zo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Nf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Is(Uint8Array)),Mf=(e,t)=>{const r=(e&&e[Tr]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Df=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Ff=Ke("HTMLFormElement"),Bf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ea=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Uf=Ke("RegExp"),ta=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$n(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},$f=e=>{ta(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ie(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Vf=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Qt(e)?r(e):r(String(e).split(t)),n},zf=()=>{},Hf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function jf(e){return!!(e&&Ie(e.append)&&e[Yo]==="FormData"&&e[Tr])}const Wf=e=>{const t=new Array(10),n=(r,s)=>{if(Ir(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=Qt(r)?[]:{};return $n(r,(o,a)=>{const c=n(o,s+1);!Un(c)&&(i[a]=c)}),t[s]=void 0,i}}return r};return n(e,0)},qf=Ke("AsyncFunction"),Kf=e=>e&&(Ir(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),na=((e,t)=>e?setImmediate:t?((n,r)=>(kt.addEventListener("message",({source:s,data:i})=>{s===kt&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),kt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(kt.postMessage)),Gf=typeof queueMicrotask<"u"?queueMicrotask.bind(kt):typeof process<"u"&&process.nextTick||na,S={isArray:Qt,isArrayBuffer:Jo,isBuffer:ff,isFormData:_f,isArrayBufferView:pf,isString:hf,isNumber:Zo,isBoolean:gf,isObject:Ir,isPlainObject:kr,isReadableStream:Ef,isRequest:Cf,isResponse:xf,isHeaders:Tf,isUndefined:Un,isDate:mf,isFile:yf,isBlob:bf,isRegExp:Uf,isFunction:Ie,isStream:Sf,isURLSearchParams:vf,isTypedArray:Nf,isFileList:wf,forEach:$n,merge:ks,extend:Rf,trim:Af,stripBOM:If,inherits:kf,toFlatObject:Of,kindOf:Ar,kindOfTest:Ke,endsWith:Pf,toArray:Lf,forEachEntry:Mf,matchAll:Df,isHTMLForm:Ff,hasOwnProperty:ea,hasOwnProp:ea,reduceDescriptors:ta,freezeMethods:$f,toObjectSet:Vf,toCamelCase:Bf,noop:zf,toFiniteNumber:Hf,findKey:Xo,global:kt,isContextDefined:Qo,isSpecCompliantForm:jf,toJSONObject:Wf,isAsyncFn:qf,isThenable:Kf,setImmediate:na,asap:Gf,isIterable:e=>e!=null&&Ie(e[Tr])};function F(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}S.inherits(F,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const ra=F.prototype,sa={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{sa[e]={value:e}}),Object.defineProperties(F,sa),Object.defineProperty(ra,"isAxiosError",{value:!0}),F.from=(e,t,n,r,s,i)=>{const o=Object.create(ra);return S.toFlatObject(e,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),F.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Yf=null;function Os(e){return S.isPlainObject(e)||S.isArray(e)}function ia(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function oa(e,t,n){return e?e.concat(t).map(function(s,i){return s=ia(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function Jf(e){return S.isArray(e)&&!e.some(Os)}const Zf=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Or(e,t,n){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=S.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!S.isUndefined(m[g])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(S.isDate(p))return p.toISOString();if(!c&&S.isBlob(p))throw new F("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(p)||S.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,m){let w=p;if(p&&!m&&typeof p=="object"){if(S.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(S.isArray(p)&&Jf(p)||(S.isFileList(p)||S.endsWith(g,"[]"))&&(w=S.toArray(p)))return g=ia(g),w.forEach(function(b,_){!(S.isUndefined(b)||b===null)&&t.append(o===!0?oa([g],_,i):o===null?g:g+"[]",l(b))}),!1}return Os(p)?!0:(t.append(oa(m,g,i),l(p)),!1)}const d=[],f=Object.assign(Zf,{defaultVisitor:u,convertValue:l,isVisitable:Os});function h(p,g){if(!S.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),S.forEach(p,function(w,v){(!(S.isUndefined(w)||w===null)&&s.call(t,w,S.isString(v)?v.trim():v,g,f))===!0&&h(w,g?g.concat(v):[v])}),d.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return h(e),t}function aa(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ps(e,t){this._pairs=[],e&&Or(e,this,t)}const ca=Ps.prototype;ca.append=function(t,n){this._pairs.push([t,n])},ca.toString=function(t){const n=t?function(r){return t.call(this,r,aa)}:aa;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Xf(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function la(e,t,n){if(!t)return e;const r=n&&n.encode||Xf;S.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=S.isURLSearchParams(t)?t.toString():new Ps(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class ua{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(r){r!==null&&t(r)})}}const da={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qf={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ps,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ls=typeof window<"u"&&typeof document<"u",Ns=typeof navigator=="object"&&navigator||void 0,ep=Ls&&(!Ns||["ReactNative","NativeScript","NS"].indexOf(Ns.product)<0),tp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",np=Ls&&window.location.href||"http://localhost",we={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ls,hasStandardBrowserEnv:ep,hasStandardBrowserWebWorkerEnv:tp,navigator:Ns,origin:np},Symbol.toStringTag,{value:"Module"})),...Qf};function rp(e,t){return Or(e,new we.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return we.isNode&&S.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function sp(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ip(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function fa(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=n.length;return o=!o&&S.isArray(s)?s.length:o,c?(S.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!S.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&S.isArray(s[o])&&(s[o]=ip(s[o])),!a)}if(S.isFormData(e)&&S.isFunction(e.entries)){const n={};return S.forEachEntry(e,(r,s)=>{t(sp(r),s,n,0)}),n}return null}function op(e,t,n){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Vn={transitional:da,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return s?JSON.stringify(fa(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return rp(t,this.formSerializer).toString();if((a=S.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Or(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),op(t)):t}],transformResponse:[function(t){const n=this.transitional||Vn.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?F.from(a,F.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:we.classes.FormData,Blob:we.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{Vn.headers[e]={}});const ap=S.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"]),cp=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
9
|
-
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&
|
|
10
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[pa]=this[pa]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=zn(o);r[a]||(fp(s,o),r[a]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(ke.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),S.freezeMethods(ke);function Ds(e,t){const n=this||Vn,r=t||n,s=ke.from(r.headers);let i=r.data;return S.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ha(e){return!!(e&&e.__CANCEL__)}function en(e,t,n){F.call(this,e??"canceled",F.ERR_CANCELED,t,n),this.name="CanceledError"}S.inherits(en,F,{__CANCEL__:!0});function ga(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function hp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[i];o||(o=l),n[s]=c,r[s]=l;let d=i,f=0;for(;d!==s;)f+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function gp(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-d)))},()=>s&&o(s)]}const Lr=(e,t,n=3)=>{let r=0;const s=hp(50,250);return gp(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-r,l=s(c),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},ma=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ya=e=>(...t)=>S.asap(()=>e(...t)),mp=we.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,we.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(we.origin),we.navigator&&/(msie|trident)/i.test(we.navigator.userAgent)):()=>!0,yp=we.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];S.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),S.isString(r)&&o.push("path="+r),S.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function bp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ba(e,t,n){let r=!bp(t);return e&&(r||n==!1)?wp(e,t):t}const wa=e=>e instanceof ke?{...e}:e;function Ot(e,t){t=t||{};const n={};function r(l,u,d,f){return S.isPlainObject(l)&&S.isPlainObject(u)?S.merge.call({caseless:f},l,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function s(l,u,d,f){if(S.isUndefined(u)){if(!S.isUndefined(l))return r(void 0,l,d,f)}else return r(l,u,d,f)}function i(l,u){if(!S.isUndefined(u))return r(void 0,u)}function o(l,u){if(S.isUndefined(u)){if(!S.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:i,method:i,data:i,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,responseEncoding:o,validateStatus:a,headers:(l,u,d)=>s(wa(l),wa(u),d,!0)};return S.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||s,f=d(e[u],t[u],u);S.isUndefined(f)&&d!==a||(n[u]=f)}),n}const Sa=e=>{const t=Ot({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=ke.from(o),t.url=la(ba(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(S.isFormData(n)){if(we.hasStandardBrowserEnv||we.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(we.hasStandardBrowserEnv&&(r&&S.isFunction(r)&&(r=r(t)),r||r!==!1&&mp(t.url))){const l=s&&i&&yp.read(i);l&&o.set(s,l)}return t},Sp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Sa(e);let i=s.data;const o=ke.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,u,d,f,h,p;function g(){h&&h(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function w(){if(!m)return;const b=ke.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:b,config:e,request:m};ga(function(y){n(y),g()},function(y){r(y),g()},k),m=null}"onloadend"in m?m.onloadend=w:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(w)},m.onabort=function(){m&&(r(new F("Request aborted",F.ECONNABORTED,e,m)),m=null)},m.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||da;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new F(_,k.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&S.forEach(o.toJSON(),function(_,k){m.setRequestHeader(k,_)}),S.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),a&&a!=="json"&&(m.responseType=s.responseType),l&&([f,p]=Lr(l,!0),m.addEventListener("progress",f)),c&&m.upload&&([d,h]=Lr(c),m.upload.addEventListener("progress",d),m.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=b=>{m&&(r(!b||b.type?new en(null,e,m):b),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const v=pp(s.url);if(v&&we.protocols.indexOf(v)===-1){r(new F("Unsupported protocol "+v+":",F.ERR_BAD_REQUEST,e));return}m.send(i||null)})},_p=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof F?u:new en(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new F(`timeout ${t} of ms exceeded`,F.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>S.asap(a),c}},vp=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Ep=async function*(e,t){for await(const n of Cp(e))yield*vp(n,t)},Cp=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},_a=(e,t,n,r)=>{const s=Ep(e,t);let i=0,o,a=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await s.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let f=i+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Nr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",va=Nr&&typeof ReadableStream=="function",xp=Nr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ea=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Tp=va&&Ea(()=>{let e=!1;const t=new Request(we.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ca=64*1024,Fs=va&&Ea(()=>S.isReadableStream(new Response("").body)),Mr={stream:Fs&&(e=>e.body)};Nr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Mr[t]&&(Mr[t]=S.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new F(`Response type '${t}' is not supported`,F.ERR_NOT_SUPPORT,r)})})})(new Response);const Ap=async e=>{if(e==null)return 0;if(S.isBlob(e))return e.size;if(S.isSpecCompliantForm(e))return(await new Request(we.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(S.isArrayBufferView(e)||S.isArrayBuffer(e))return e.byteLength;if(S.isURLSearchParams(e)&&(e=e+""),S.isString(e))return(await xp(e)).byteLength},Rp=async(e,t)=>{const n=S.toFiniteNumber(e.getContentLength());return n??Ap(t)},Bs={http:Yf,xhr:Sp,fetch:Nr&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Sa(e);l=l?(l+"").toLowerCase():"text";let h=_p([s,i&&i.toAbortSignal()],o),p;const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&Tp&&n!=="get"&&n!=="head"&&(m=await Rp(u,r))!==0){let k=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(S.isFormData(r)&&(x=k.headers.get("content-type"))&&u.setContentType(x),k.body){const[y,R]=ma(m,Lr(ya(c)));r=_a(k.body,Ca,y,R)}}S.isString(d)||(d=d?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:w?d:void 0});let v=await fetch(p);const b=Fs&&(l==="stream"||l==="response");if(Fs&&(a||b&&g)){const k={};["status","statusText","headers"].forEach(C=>{k[C]=v[C]});const x=S.toFiniteNumber(v.headers.get("content-length")),[y,R]=a&&ma(x,Lr(ya(a),!0))||[];v=new Response(_a(v.body,Ca,y,()=>{R&&R(),g&&g()}),k)}l=l||"text";let _=await Mr[S.findKey(Mr,l)||"text"](v,e);return!b&&g&&g(),await new Promise((k,x)=>{ga(k,x,{data:_,headers:ke.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:p})})}catch(w){throw g&&g(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,e,p),{cause:w.cause||w}):F.from(w,w&&w.code,e,p)}})};S.forEach(Bs,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xa=e=>`- ${e}`,Ip=e=>S.isFunction(e)||e===null||e===!1,Ta={getAdapter:e=>{e=S.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!Ip(n)&&(r=Bs[(o=String(n)).toLowerCase()],r===void 0))throw new F(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
11
|
-
`+i.map(
|
|
12
|
-
`):" "+
|
|
13
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ot(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Fr.assertOptions(r,{silentJSONParsing:Qe.transitional(Qe.boolean),forcedJSONParsing:Qe.transitional(Qe.boolean),clarifyTimeoutError:Qe.transitional(Qe.boolean)},!1),s!=null&&(S.isFunction(s)?n.paramsSerializer={serialize:s}:Fr.assertOptions(s,{encode:Qe.function,serialize:Qe.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fr.assertOptions(n,{baseUrl:Qe.spelling("baseURL"),withXsrfToken:Qe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&S.merge(i.common,i[n.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=ke.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let u,d=0,f;if(!c){const p=[Aa.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const p=a[d++],g=a[d++];try{h=p(h)}catch(m){g.call(this,m);break}}try{u=Aa.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Ot(this.defaults,t);const n=ba(t.baseURL,t.url,t.allowAbsoluteUrls);return la(n,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){Pt.prototype[t]=function(n,r){return this.request(Ot(r||{},{method:t,url:n,data:(r||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(Ot(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Pt.prototype[t]=n(),Pt.prototype[t+"Form"]=n(!0)});let Op=class kd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,a){r.reason||(r.reason=new en(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kd(function(s){t=s}),cancel:t}}};function Pp(e){return function(n){return e.apply(null,n)}}function Lp(e){return S.isObject(e)&&e.isAxiosError===!0}const $s={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($s).forEach(([e,t])=>{$s[t]=e});function ka(e){const t=new Pt(e),n=Go(Pt.prototype.request,t);return S.extend(n,Pt.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ka(Ot(e,s))},n}const se=ka(Vn);se.Axios=Pt,se.CanceledError=en,se.CancelToken=Op,se.isCancel=ha,se.VERSION=Ra,se.toFormData=Or,se.AxiosError=F,se.Cancel=se.CanceledError,se.all=function(t){return Promise.all(t)},se.spread=Pp,se.isAxiosError=Lp,se.mergeConfig=Ot,se.AxiosHeaders=ke,se.formToJSON=e=>fa(S.isHTMLForm(e)?new FormData(e):e),se.getAdapter=Ta.getAdapter,se.HttpStatusCode=$s,se.default=se;const{Axios:Dv,AxiosError:Fv,CanceledError:Bv,isCancel:Uv,CancelToken:$v,VERSION:Vv,all:zv,Cancel:Hv,isAxiosError:jv,spread:Wv,toFormData:qv,AxiosHeaders:Kv,HttpStatusCode:Gv,formToJSON:Yv,getAdapter:Jv,mergeConfig:Zv}=se,Hn=(e,t)=>e,Y=class Y{static getAxiosInstance(){if(!this.axiosInstance)throw new Error("AstroPay Payments Library: Not initialized.");return this.axiosInstance}};T(Y,"axiosInstance"),T(Y,"config"),T(Y,"init",t=>{Y.config=t,Y.axiosInstance=se.create({baseURL:t.baseURL,timeout:t.timeout??5e3,withCredentials:!0,headers:{"Accept-Language":te.getCurrent(),...t.headers}}),Y.setupInterceptors()}),T(Y,"GET",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().get(i,o)}),T(Y,"POST",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().post(i,n,o)}),T(Y,"PUT",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s}};return await Y.getAxiosInstance().put(i,n,o)}),T(Y,"PATCH",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().patch(i,n,o)}),T(Y,"DELETE",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=Hn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().delete(i,o)}),T(Y,"setupInterceptors",()=>{Y.axiosInstance.interceptors.request.use(t=>{const{useQueryParams:n,...r}=t.params||{};return n?t.params={...r,data:Y.getEncodeParams()}:t.params=r,t.data&&(t.data=Ko(t.data,"camelCase-to-snake_case")),t}),Y.axiosInstance.interceptors.response.use(t=>Y.handleResponse(t),t=>Y.handleError(t))}),T(Y,"handleResponse",t=>{const n=t.status===202,r=Ko(t.data,"snake_case-to-camelCase");return n?{...r,statusCode:t.status}:r}),T(Y,"handleError",t=>{var r,s,i,o,a,c,l,u;const n={error:((s=(r=t.response)==null?void 0:r.data)==null?void 0:s.error)||"UNKNOWN_ERROR",internalTerm:((o=(i=t.response)==null?void 0:i.data)==null?void 0:o.internalTerm)||"",message:((c=(a=t.response)==null?void 0:a.data)==null?void 0:c.message)||te.translate("generic_error"),description:((u=(l=t.response)==null?void 0:l.data)==null?void 0:u.description)||"Network error"};return Promise.reject(n)}),T(Y,"getEncodeParams",()=>{const t={app_name:Y.config.appName,app_id:rt.getToken(),environment:Nn.getEnvironment(),platform:Wo(),version:"0.1.2"};return qo(t)});let mt=Y;const L={surface_dark:"#041311",surface_light:"#FFFFFF",neutral_lightest:"#FFFFFF",neutral_light:"#F3F6F6",neutral_lighter:"#E2E9E8",neutral_base:"#B4C5C3",neutral_darker:"#7C9995",neutral_dark:"#536663",neutral_darkest:"#151E1D",primary_lightest:"#DBFFFB",primary_light:"#AAF6EC",primary_base:"#00DBBF",primary_darker:"#0FC3AC",primary_dark:"#059986",primary_darkest:"#07544A",warning_light:"#FFEBA8",warning_darkest:"#755A00",error_lightest:"#FFDCD6",error_lighter:"#FF8470",error_base:"#FF2C0A",error_dark:"#A31600"},Br={matter:"Poppins"},Np=async()=>{try{const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap",e.rel="stylesheet",document.head.appendChild(e),await document.fonts.ready}catch(e){console.error("Font loading failed:",e)}},Mp={backgroundColor:L.surface_dark,primaryColor:L.primary_base,secondaryColor:L.primary_darkest,textPrimaryColor:L.neutral_lightest,textSecondaryColor:L.primary_lightest,fontFamily:Br.matter,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",apFontFamily:Br.matter,apWarningBgColor:L.warning_darkest,apWarningTxtColor:L.error_lightest,apPillBgColor:L.primary_darkest,apPillTxtColor:L.primary_light,apPillDisableBgColor:L.neutral_dark,apPillDisableTxtColor:L.neutral_light,apPrimaryColor:L.primary_base,apButtonPrimaryBgColor:L.primary_base,apButtonPrimaryTxtColor:L.neutral_darkest,apButtonSecondaryBgColor:L.primary_darkest,apButtonSecondaryTxtColor:L.primary_base,apButtonTextTxtColor:L.primary_base,apButtonDisableBgColor:L.neutral_base,apButtonDisableTextColor:L.neutral_dark,apInputBgColor:L.neutral_darkest,apInputTxtColor:L.neutral_lightest,apInputPlaceholderColor:L.neutral_darker,apInputBorderActiveColor:L.primary_base,apInputBorderErrorColor:L.error_base,apSelectBgHoverColor:L.neutral_dark,apSelectBorderColor:L.neutral_base,apErrorText:L.error_lighter,apSuccessText:L.primary_base},Oa={backgroundColor:L.surface_light,primaryColor:L.primary_base,secondaryColor:L.primary_lightest,textPrimaryColor:L.neutral_darkest,textSecondaryColor:L.primary_darker,fontFamily:Br.matter,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",apFontFamily:Br.matter,apWarningBgColor:L.warning_light,apWarningTxtColor:L.error_dark,apPillBgColor:L.primary_lightest,apPillTxtColor:L.primary_dark,apPillDisableBgColor:L.neutral_light,apPillDisableTxtColor:L.neutral_dark,apPrimaryColor:L.primary_base,apButtonPrimaryBgColor:L.primary_base,apButtonPrimaryTxtColor:L.neutral_darkest,apButtonSecondaryBgColor:L.primary_lightest,apButtonSecondaryTxtColor:L.primary_dark,apButtonTextTxtColor:L.primary_dark,apButtonDisableBgColor:L.neutral_base,apButtonDisableTextColor:L.neutral_dark,apInputBgColor:L.neutral_light,apInputTxtColor:L.neutral_darkest,apInputPlaceholderColor:L.neutral_dark,apInputBorderActiveColor:L.primary_base,apInputBorderErrorColor:L.error_dark,apSelectBgHoverColor:L.neutral_lighter,apSelectBorderColor:L.neutral_base,apErrorText:L.error_dark,apSuccessText:L.primary_darker},Dp={light:Oa,dark:Mp},Rt=class Rt{static init(t){const n=yr(t==null?void 0:t.theme,Yt,"light");Rt.currentTheme=n,Rt.styles={...Dp[n],...t==null?void 0:t.styles}}static getStyles(){return Rt.styles}static getTheme(){return Rt.currentTheme}};T(Rt,"currentTheme","light"),T(Rt,"styles",Oa);let $=Rt;const Ur={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},ut=console,tn={};Object.keys(Ur).forEach(e=>{tn[e]=ut[e]});const jn="Datadog Browser SDK:",V={debug:tn.debug.bind(ut,jn),log:tn.log.bind(ut,jn),info:tn.info.bind(ut,jn),warn:tn.warn.bind(ut,jn),error:tn.error.bind(ut,jn)},$r="https://docs.datadoghq.com",Fp=`${$r}/real_user_monitoring/browser/troubleshooting`,Vs="More details:";function Pa(e,t){return(...n)=>{try{return e(...n)}catch(r){V.error(t,r)}}}function yt(e){return e!==0&&Math.random()*100<=e}function Vr(e,t){return+e.toFixed(t)}function Bp(e){return Wn(e)&&e>=0&&e<=100}function Wn(e){return typeof e=="number"}const Se=1e3,Oe=60*Se,La=60*Oe,Na=365*(24*La);function zr(e){return{relative:e,timeStamp:$p(e)}}function Up(e){return{relative:zs(e),timeStamp:e}}function $p(e){const t=Ve()-performance.now();return t>qn()?Math.round(nn(t,e)):zp(e)}function Vp(){return Math.round(Ve()-nn(qn(),performance.now()))}function B(e){return Wn(e)?Vr(e*1e6,0):e}function Ve(){return new Date().getTime()}function de(){return Ve()}function ze(){return performance.now()}function xe(){return{relative:ze(),timeStamp:de()}}function Ma(){return{relative:0,timeStamp:qn()}}function me(e,t){return t-e}function nn(e,t){return e+t}function zs(e){return e-qn()}function zp(e){return Math.round(nn(qn(),e))}function Hp(e){return e<Na}let Hs;function qn(){return Hs===void 0&&(Hs=performance.timing.navigationStart),Hs}const Kn=1024,Da=1024*Kn,jp=/[^\u0000-\u007F]/;function Fa(e){return jp.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function Wp(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Gn(e){return{...e}}function Hr(e,t){return Object.keys(e).some(n=>e[n]===t)}function Lt(e){return Object.keys(e).length===0}function qp(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function et(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}function bt(e,t){const n=et();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let js,Ba=!1;function Kp(e){js=e}function Gp(e){Ba=e}function U(e){return function(){return Nt(e,this,arguments)}}function Nt(e,t,n){try{return e.apply(t,n)}catch(r){dt(r)}}function dt(e){if(Ws(e),js)try{js(e)}catch(t){Ws(t)}}function Ws(...e){Ba&&V.error("[MONITOR]",...e)}function fe(e,t){return bt(et(),"setTimeout")(U(e),t)}function Pe(e){bt(et(),"clearTimeout")(e)}function rn(e,t){return bt(et(),"setInterval")(U(e),t)}function jr(e){bt(et(),"clearInterval")(e)}class G{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach(n=>n(t))}}function Ua(...e){return new G(t=>{const n=e.map(r=>r.subscribe(s=>t.notify(s)));return()=>n.forEach(r=>r.unsubscribe())})}function wt(e,t,n){const r=n&&n.leading!==void 0?n.leading:!0,s=n&&n.trailing!==void 0?n.trailing:!0;let i=!1,o,a;return{throttled:(...c)=>{if(i){o=c;return}r?e(...c):o=c,i=!0,a=fe(()=>{s&&o&&e(...o),i=!1,o=void 0},t)},cancel:()=>{Pe(a),i=!1,o=void 0}}}function z(){}function ye(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,ye)}const Wr=/([\w-]+)\s*=\s*([^;]+)/g;function Yn(e,t){for(Wr.lastIndex=0;;){const n=Wr.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function Yp(e){const t=new Map;for(Wr.lastIndex=0;;){const n=Wr.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function $a(e,t,n=""){const r=e.charCodeAt(t-1),i=r>=55296&&r<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${n}`}function Jp(){return Va()===0}function Zp(){return Va()===1}let qr;function Va(){return qr??(qr=Xp())}function Xp(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function Jn(e,t,n=0,r){const s=new Date;s.setTime(s.getTime()+n);const i=`expires=${s.toUTCString()}`,o=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",l=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${o}${a}${c}${l}`}function qs(e){return Yn(document.cookie,e)}let Ks;function St(e){return Ks||(Ks=Yp(document.cookie)),Ks.get(e)}function za(e,t){Jn(e,"",0,t)}function Qp(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${ye()}`,n="test";Jn(t,n,Oe,e);const r=qs(t)===n;return za(t,e),r}catch(t){return V.error(t),!1}}let Gs;function eh(){if(Gs===void 0){const e=`dd_site_test_${ye()}`,t="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!qs(e);)r=`${n.pop()}.${r}`,Jn(e,t,Se,{domain:r});za(e,{domain:r}),Gs=r}return Gs}const sn="_dd_s";function th(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function Ha(e){return Object.values(e)}function Ys(e){return Object.entries(e)}const Mt=4*La,ja=15*Oe,nh=Na,Zn={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},Wa=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Js="&";function rh(e){return!!e&&(e.indexOf(Js)!==-1||Wa.test(e))}const sh="1";function Dt(e,t){const n={isExpired:sh};return t.trackAnonymousUser&&(e!=null&&e.anonymousId?n.anonymousId=e==null?void 0:e.anonymousId:n.anonymousId=ye()),n}function Kr(e){return Lt(e)}function qa(e){return!Kr(e)}function Gr(e){return e.isExpired!==void 0||!ih(e)}function ih(e){return(e.created===void 0||Ve()-Number(e.created)<Mt)&&(e.expire===void 0||Ve()<Number(e.expire))}function Ka(e){e.expire=String(Ve()+ja)}function Zs(e){return Ys(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(Js)}function Ga(e){const t={};return rh(e)&&e.split(Js).forEach(n=>{const r=Wa.exec(n);if(r!==null){const[,s,i]=r;s==="aid"?t.anonymousId=i:t[s]=i}}),t}const oh="_dd",ah="_dd_r",ch="_dd_l",lh="rum",uh="logs";function dh(e){if(!St(sn)){const n=St(oh),r=St(ah),s=St(ch),i={};n&&(i.id=n),s&&/^[01]$/.test(s)&&(i[uh]=s),r&&/^[012]$/.test(r)&&(i[lh]=r),qa(i)&&(Ka(i),e.persistSession(i))}}function Ya(e){const t=mh(e);return Qp(t)?{type:Zn.COOKIE,cookieOptions:t}:void 0}function fh(e,t){const n={isLockEnabled:Jp(),persistSession:ph(t),retrieveSession:gh,expireSession:r=>hh(t,r,e)};return dh(n),n}function ph(e){return t=>{Jn(sn,Zs(t),ja,e)}}function hh(e,t,n){const r=Dt(t,n);Jn(sn,Zs(r),n.trackAnonymousUser?nh:Mt,e)}function gh(){const e=qs(sn);return Ga(e)}function mh(e){const t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=eh()),t}const yh="_dd_test_";function Ja(){try{const e=ye(),t=`${yh}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Zn.LOCAL_STORAGE}:void 0}catch{return}}function bh(e){return{isLockEnabled:!1,persistSession:Za,retrieveSession:wh,expireSession:t=>Sh(t,e)}}function Za(e){localStorage.setItem(sn,Zs(e))}function wh(){const e=localStorage.getItem(sn);return Ga(e)}function Sh(e,t){Za(Dt(e,t))}const _h=10,vh=100,Xa=[];let Yr;function Ft(e,t,n=0){var r;const{isLockEnabled:s,persistSession:i,expireSession:o}=t,a=f=>i({...f,lock:l}),c=()=>{const f=t.retrieveSession(),h=f.lock;return f.lock&&delete f.lock,{session:f,lock:h}};if(Yr||(Yr=e),e!==Yr){Xa.push(e);return}if(s&&n>=vh){Qa(t);return}let l,u=c();if(s){if(u.lock){Jr(e,t,n);return}if(l=ye(),a(u.session),u=c(),u.lock!==l){Jr(e,t,n);return}}let d=e.process(u.session);if(s&&(u=c(),u.lock!==l)){Jr(e,t,n);return}if(d&&(Gr(d)?o(d):(Ka(d),s?a(d):i(d))),s&&!(d&&Gr(d))){if(u=c(),u.lock!==l){Jr(e,t,n);return}i(u.session),d=u.session}(r=e.after)===null||r===void 0||r.call(e,d||u.session),Qa(t)}function Jr(e,t,n){fe(()=>{Ft(e,t,n+1)},_h)}function Qa(e){Yr=void 0;const t=Xa.shift();t&&Ft(t,e)}const ec=Se;function Eh(e){switch(e.sessionPersistence){case Zn.COOKIE:return Ya(e);case Zn.LOCAL_STORAGE:return Ja();case void 0:{let t=Ya(e);return!t&&e.allowFallbackToLocalStorage&&(t=Ja()),t}default:V.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Ch(e,t,n,r){const s=new G,i=new G,o=new G,a=e.type===Zn.COOKIE?fh(t,e.cookieOptions):bh(t),{expireSession:c}=a,l=rn(p,ec);let u;m();const{throttled:d,cancel:f}=wt(()=>{Ft({process:y=>{if(Kr(y))return;const R=g(y);return w(R),R},after:y=>{qa(y)&&!v()&&k(y),u=y}},a)},ec);function h(){Ft({process:y=>v()?g(y):void 0},a)}function p(){Ft({process:y=>Gr(y)?Dt(y,t):void 0,after:g},a)}function g(y){return Gr(y)&&(y=Dt(y,t)),v()&&(b(y)?_():(o.notify({previousState:u,newState:y}),u=y)),y}function m(){Ft({process:y=>{if(Kr(y))return Dt(y,t)},after:y=>{u=y}},a)}function w(y){if(Kr(y))return!1;const{trackingType:R,isTracked:C}=r(y[n]);y[n]=R,delete y.isExpired,C&&!y.id&&(y.id=ye(),y.created=String(Ve()))}function v(){return u[n]!==void 0}function b(y){return u.id!==y.id||u[n]!==y[n]}function _(){u=Dt(u,t),i.notify()}function k(y){u=y,s.notify()}function x(y){Ft({process:R=>({...R,...y}),after:g},a)}return{expandOrRenewSession:d,expandSession:h,getSession:()=>u,renewObservable:s,expireObservable:i,sessionStateUpdateObservable:o,restartSession:m,expire:()=>{f(),c(u),g(Dt(u,t))},stop:()=>{jr(l)},updateSessionState:x}}const Xs={GRANTED:"granted",NOT_GRANTED:"not-granted"};function xh(e){const t=new G;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===Xs.GRANTED},observable:t}}function on(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=an(Object.prototype),s=an(Array.prototype),i=an(Object.getPrototypeOf(e)),o=an(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),s(),i(),o()}}function an(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):z}function Qs(e){return Zr(e,location.href).href}function Th(e){try{return!!Zr(e)}catch{return!1}}function Ah(e){const t=Zr(e).pathname;return t[0]==="/"?t:`/${t}`}function Zr(e,t){const n=Rh();if(n)try{return t!==void 0?new n(e,t):new n(e)}catch(i){throw new Error(`Failed to construct URL: ${String(i)} ${on({url:e,base:t})}`)}if(t===void 0&&!/:/.test(e))throw new Error(`Invalid URL: '${e}'`);let r=document;const s=r.createElement("a");if(t!==void 0){r=document.implementation.createHTMLDocument("");const i=r.createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(s)}return s.href=e,s}const tc=URL;let Xr;function Rh(){if(Xr===void 0)try{Xr=new tc("http://test/path").href==="http://test/path"}catch{Xr=!1}return Xr?tc:void 0}const nc="datad0g.com",Ih="dd0g-gov.com",Bt="datadoghq.com",kh="datadoghq.eu",Oh="ddog-gov.com",Ph="pci.browser-intake-datadoghq.com",Lh=["ddsource","ddtags"];function cn(e,t,n){const r=Nh(e,t);return{build(s,i){const o=Mh(e,t,n,s,i);return r(o)},tags:n,urlPrefix:r(""),trackType:t}}function Nh(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const i=Qs(r);return o=>`${i}?ddforward=${encodeURIComponent(`${n}?${o}`)}`}if(typeof r=="function")return i=>r({path:n,parameters:i});const s=rc(t,e);return i=>`https://${s}${n}?${i}`}function rc(e,t){const{site:n=Bt,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===Bt)return Ph;if(r&&n===Bt)return`${r}.${Bt}`;if(n===Ih)return`http-intake.logs.${n}`;const s=n.split("."),i=s.pop();return`browser-intake-${s.join("-")}.${i}`}function Mh({clientToken:e,internalAnalyticsSubdomain:t},n,r,s,{retry:i,encoding:o}){const a=["sdk_version:6.6.3",`api:${s}`].concat(r);i&&a.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const c=["ddsource=browser",`ddtags=${encodeURIComponent(a.join(","))}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.6.3")}`,"dd-evp-origin=browser",`dd-request-id=${ye()}`];return o&&c.push(`dd-evp-encoding=${o}`),n==="rum"&&c.push(`batch_time=${de()}`),t&&c.reverse(),c.join("&")}const Dh=200;function Fh(e){const{env:t,service:n,version:r,datacenter:s}=e,i=[];return t&&i.push(Qr("env",t)),n&&i.push(Qr("service",n)),r&&i.push(Qr("version",r)),s&&i.push(Qr("datacenter",s)),i}function Qr(e,t){const n=Dh-e.length-1;(t.length>n||Bh(t))&&V.warn(`${e} value doesn't meet tag requirements and will be sanitized. ${Vs} ${$r}/getting_started/tagging/#defining-tags`);const r=t.replace(/,/g,"_");return`${e}:${r}`}function Bh(e){return Uh()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function Uh(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function $h(e){const t=e.site||Bt,n=Fh(e),r=Vh(e,n);return{replica:zh(e,n),site:t,...r}}function Vh(e,t){return{logsEndpointBuilder:cn(e,"logs",t),rumEndpointBuilder:cn(e,"rum",t),profilingEndpointBuilder:cn(e,"profile",t),sessionReplayEndpointBuilder:cn(e,"replay",t)}}function zh(e,t){if(!e.replica)return;const n={...e,site:Bt,clientToken:e.replica.clientToken},r={logsEndpointBuilder:cn(n,"logs",t),rumEndpointBuilder:cn(n,"rum",t)};return{applicationId:e.replica.applicationId,...r}}function Hh(e){return Lh.every(t=>e.includes(t))}const Xn={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ei={ALL:"all",SAMPLED:"sampled"};function ti(e,t){return e!=null&&typeof e!="string"?(V.error(`${t} must be defined as a string`),!1):!0}function jh(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(V.error(`Site should be a valid Datadog site. ${Vs} ${$r}/getting_started/site/.`),!1):!0}function ln(e,t){return e!==void 0&&!Bp(e)?(V.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function Wh(e){var t,n,r,s,i,o;if(!e||!e.clientToken){V.error("Client Token is not configured, we will not send any data.");return}if(!(!jh(e.site)||!ln(e.sessionSampleRate,"Session")||!ln(e.telemetrySampleRate,"Telemetry")||!ln(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!ln(e.telemetryUsageSampleRate,"Telemetry Usage")||!ti(e.version,"Version")||!ti(e.env,"Env")||!ti(e.service,"Service"))){if(e.trackingConsent!==void 0&&!Hr(Xs,e.trackingConsent)){V.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&Pa(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Eh(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(r=e.telemetryConfigurationSampleRate)!==null&&r!==void 0?r:5,telemetryUsageSampleRate:(s=e.telemetryUsageSampleRate)!==null&&s!==void 0?s:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(i=e.trackingConsent)!==null&&i!==void 0?i:Xs.GRANTED,trackAnonymousUser:(o=e.trackAnonymousUser)!==null&&o!==void 0?o:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*Kn,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Se,batchMessagesLimit:50,messageBytesLimit:256*Kn,...$h(e)}}}function qh(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent}}var Ut;(function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.MISSING_URL_CONTEXT_TELEMETRY="missing_url_context_telemetry",e.USER_ACCOUNT_TRACE_HEADER="user_account_trace_header",e.PROFILING="profiling"})(Ut||(Ut={}));const ni=new Set;function Kh(e){Array.isArray(e)&&Gh(e.filter(t=>Hr(Ut,t)))}function Gh(e){e.forEach(t=>{ni.add(t)})}function es(e){return ni.has(e)}function Yh(){return ni}const Qn="?";function _t(e){const t=[];let n=ri(e,"stack");const r=String(e);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split(`
|
|
14
|
-
`).forEach(s=>{const i=
|
|
15
|
-
at ${r}${s} @ ${n.url}${i}${o}`}),t}function ic(e){return`${e.name||"Error"}: ${e.message}`}function Le(e,t,n,{computeHandlingStack:r}={}){let s=e[t];if(typeof s!="function")if(t in e&&t.startsWith("on"))s=z;else return{stop:z};let i=!1;const o=function(){if(i)return s.apply(this,arguments);const a=Array.from(arguments);let c;Nt(n,null,[{target:this,parameters:a,onPostCall:u=>{c=u},handlingStack:r?ts("instrumented method"):void 0}]);const l=s.apply(this,a);return c&&Nt(c,null,[l]),l};return e[t]=o,{stop:()=>{i=!0,e[t]===o&&(e[t]=s)}}}function er(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:z};const s=z;let i=(a,c)=>{fe(()=>{i!==s&&n(a,c)},0)};const o=function(a){r.set.call(this,a),i(this,a)};return Object.defineProperty(e,t,{set:o}),{stop:()=>{var a;((a=Object.getOwnPropertyDescriptor(e,t))===null||a===void 0?void 0:a.set)===o&&Object.defineProperty(e,t,r),i=s}}}const lg=220*Kn,ug="$",dg=3;function ie(e,t=lg){const n=an(Object.prototype),r=an(Array.prototype),s=[],i=new WeakMap,o=si(e,ug,void 0,s,i),a=JSON.stringify(o);let c=a?a.length:0;if(c>t){oi(t,"discarded",e);return}for(;s.length>0&&c<t;){const l=s.shift();let u=0;if(Array.isArray(l.source))for(let d=0;d<l.source.length;d++){const f=si(l.source[d],l.path,d,s,i);if(f!==void 0?c+=JSON.stringify(f).length:c+=4,c+=u,u=1,c>t){oi(t,"truncated",e);break}l.target[d]=f}else for(const d in l.source)if(Object.prototype.hasOwnProperty.call(l.source,d)){const f=si(l.source[d],l.path,d,s,i);if(f!==void 0&&(c+=JSON.stringify(f).length+u+d.length+dg,u=1),c>t){oi(t,"truncated",e);break}l.target[d]=f}}return n(),r(),o}function si(e,t,n,r,s){const i=hg(e);if(!i||typeof i!="object")return fg(i);const o=ii(i);if(o!=="[Object]"&&o!=="[Array]"&&o!=="[Error]")return o;const a=e;if(s.has(a))return`[Reference seen at ${s.get(a)}]`;const c=n!==void 0?`${t}.${n}`:t,l=Array.isArray(i)?[]:{};return s.set(a,c),r.push({source:i,target:l,path:c}),l}function fg(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function ii(e){try{if(e instanceof Event)return pg(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch{}return"[Unserializable]"}function pg(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?ii(e.currentTarget):null,target:e.target?ii(e.target):null}}function hg(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function oi(e,t,n){V.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const oc="No stack, consider using an instance of Error";function ac({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:s,nonErrorPrefix:i,source:o,handling:a}){const c=vt(t),l=gg(e,c,i,t),u=mg(c,e)?dn(e):oc,d=c?uc(t,o):void 0,f=e?e.name:void 0,h=cc(t),p=lc(t);return{startClocks:s,source:o,handling:a,handlingStack:n,componentStack:r,originalError:t,type:f,message:l,stack:u,causes:d,fingerprint:h,context:p}}function gg(e,t,n,r){return e!=null&&e.message&&(e!=null&&e.name)?e.message:t?"Empty message":`${n} ${on(ie(r))}`}function mg(e,t){return t===void 0?!1:e?!0:t.stack.length>0&&(t.stack.length>1||t.stack[0].url!==void 0)}function cc(e){return vt(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function lc(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function vt(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function uc(e,t){let n=e;const r=[];for(;vt(n==null?void 0:n.cause)&&r.length<10;){const s=_t(n.cause);r.push({message:n.cause.message,source:t,type:s==null?void 0:s.name,stack:s&&dn(s)}),n=n.cause}return r.length?r:void 0}const fn={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function yg(e){const t=(s,i)=>{const o=ac({stackTrace:s,originalError:i,startClocks:xe(),nonErrorPrefix:"Uncaught",source:fn.SOURCE,handling:"unhandled"});e.notify(o)},{stop:n}=bg(t),{stop:r}=wg(t);return{stop:()=>{n(),r()}}}function bg(e){return Le(window,"onerror",({parameters:[t,n,r,s,i]})=>{let o;vt(i)?o=_t(i):o=og(t,n,r,s),e(o,i??t)})}function wg(e){return Le(window,"onunhandledrejection",({parameters:[t]})=>{const n=t.reason||"Empty reason",r=_t(n);e(r,n)})}function Sg(e){const t={version:"6.6.3",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return Gp},enumerable:!1}),t}function _g(e,t,n){const r=e[t];r&&!r.q&&r.version&&V.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,r&&r.q&&r.q.forEach(s=>Pa(s,"onReady callback threw an error:")())}function dc(e,t){t.silentMultipleInit||V.error(`${e} is already initialized.`)}function Z(e,t,n,r,s){return Ne(e,t,[n],r,s)}function Ne(e,t,n,r,{once:s,capture:i,passive:o}={}){const a=U(f=>{!f.isTrusted&&!f.__ddIsTrusted&&!e.allowUntrustedEvents||(s&&d(),r(f))}),c=o?{capture:i,passive:o}:i,l=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,u=bt(l,"addEventListener");n.forEach(f=>u.call(t,f,a,c));function d(){const f=bt(l,"removeEventListener");n.forEach(h=>f.call(t,h,a,c))}return{stop:d}}const tr={intervention:"intervention",cspViolation:"csp_violation"};function vg(e,t){const n=[];t.includes(tr.cspViolation)&&n.push(Cg(e));const r=t.filter(s=>s!==tr.cspViolation);return r.length&&n.push(Eg(r)),Ua(...n)}function Eg(e){return new G(t=>{if(!window.ReportingObserver)return;const n=U((s,i)=>s.forEach(o=>t.notify(xg(o)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function Cg(e){return new G(t=>{const{stop:n}=Z(e,document,"securitypolicyviolation",r=>{t.notify(Tg(r))});return n})}function xg(e){const{type:t,body:n}=e;return fc({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:pc(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function Tg(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return fc({type:e.effectiveDirective,message:`${tr.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:pc(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${$a(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function fc(e){return{startClocks:xe(),source:fn.REPORT,handling:"unhandled",...e}}function pc(e,t,n,r,s){return n?dn({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:s??void 0}]}):void 0}function ai(e,t){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function $t(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function ns(e,t,n=Ag()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const s=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,s)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const s=Array.isArray(e)?e:[];for(let i=0;i<t.length;++i)s[i]=ns(s[i],t[i],n);return s}const r=$t(e)==="object"?e:{};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=ns(r[s],t[s],n));return r}function ci(e){return ns(void 0,e)}function Ge(...e){let t;for(const n of e)n!=null&&(t=ns(t,n));return t}function Ag(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(n){const r=t.has(n);return r||t.add(n),r}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}function hc(){var e;const t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function gc(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const Rg=500;function mc(){const e=[];return{add:s=>{e.push(s)>Rg&&e.splice(0,1)},remove:s=>{gc(e,s)},drain:s=>{e.forEach(i=>i(s)),e.length=0}}}const Vt={log:"log",configuration:"configuration",usage:"usage"},Ig=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],kg=[Oh];let yc=mc(),pn=e=>{yc.add(()=>pn(e))};function Og(e,t){let n;const r=new G,s=new Set,i=!kg.includes(t.site)&&yt(t.telemetrySampleRate),o={[Vt.log]:i,[Vt.configuration]:i&&yt(t.telemetryConfigurationSampleRate),[Vt.usage]:i&&yt(t.telemetryUsageSampleRate)},a=Pg();pn=l=>{const u=on(l);if(o[l.type]&&s.size<t.maxTelemetryEventsPerPage&&!s.has(u)){const d=c(e,l,a);r.notify(d),ai("telemetry",d),s.add(u)}},Kp(li);function c(l,u,d){return Ge({type:"telemetry",date:de(),service:l,version:"6.6.3",source:"browser",_dd:{format_version:2},telemetry:Ge(u,{runtime_env:d,connectivity:hc(),sdk_setup:"npm"}),experimental_features:Array.from(Yh())},n!==void 0?n():{})}return{setContextProvider:l=>{n=l},observable:r,enabled:i}}function Pg(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function Lg(){yc.drain()}function Ng(e){return e.site===nc}function ft(e,t){Ws(Ur.debug,e,t),pn({type:Vt.log,message:e,status:"debug",...t})}function li(e,t){pn({type:Vt.log,status:"error",...Dg(e),...t})}function Mg(e){pn({type:Vt.configuration,configuration:e})}function Te(e){pn({type:Vt.usage,usage:e})}function Dg(e){if(vt(e)){const t=_t(e);return{error:{kind:t.name,stack:dn(Fg(t))},message:t.message}}return{error:{stack:oc},message:`Uncaught ${on(e)}`}}function Fg(e){return e.stack=e.stack.filter(t=>!t.url||Ig.some(n=>t.url.startsWith(n))),e}const nr=1/0,Bg=Oe;let rr=null;const rs=new Set;function Ug(){rs.forEach(e=>e())}function hn({expireDelay:e,maxEntries:t}){let n=[];const r=[];rr||(rr=rn(()=>Ug(),Bg));const s=()=>{const h=ze()-e;for(;n.length>0&&n[n.length-1].endTime<h;){const p=n.pop();p&&r.push(p.startTime)}};rs.add(s);function i(h,p){const g={value:h,startTime:p,endTime:nr,remove:()=>{gc(n,g)},close:m=>{g.endTime=m}};return t&&n.length>=t&&n.pop(),n.unshift(g),g}function o(h=nr,p={returnInactive:!1}){for(const g of n)if(g.startTime<=h){if(p.returnInactive||h<=g.endTime)return g.value;break}}function a(h){const p=n[0];p&&p.endTime===nr&&p.close(h)}function c(h=nr,p=0){const g=nn(h,p);return n.filter(m=>m.startTime<=g&&h<=m.endTime).map(m=>m.value)}function l(){return n.map(({startTime:h,endTime:p,value:g})=>({startTime:h,endTime:p===nr?"Infinity":p,value:g}))}function u(){return r}function d(){n=[]}function f(){rs.delete(s),rs.size===0&&rr&&(jr(rr),rr=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f,getAllEntries:l,getDeletedEntries:u}}const $g=Oe,Vg=Mt;function zg(e,t,n,r){const s=new G,i=new G,o=Ch(e.sessionStoreStrategyType,e,t,n),a=hn({expireDelay:Vg});o.renewObservable.subscribe(()=>{a.add(c(),ze()),s.notify()}),o.expireObservable.subscribe(()=>{i.notify(),a.closeActive(ze())}),o.expandOrRenewSession(),a.add(c(),Ma().relative),r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire()}),Hg(e,()=>{r.isGranted()&&o.expandOrRenewSession()}),jg(e,()=>o.expandSession()),Wg(e,()=>o.restartSession());function c(){return{id:o.getSession().id,trackingType:o.getSession()[t],isReplayForced:!!o.getSession().forcedReplay,anonymousId:o.getSession().anonymousId}}return{findSession:(l,u)=>a.find(l,u),renewObservable:s,expireObservable:i,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function Hg(e,t){const{stop:n}=Ne(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function jg(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Z(e,document,"visibilitychange",n);rn(n,$g)}function Wg(e,t){const{stop:n}=Z(e,window,"resume",t,{capture:!0})}function qg(e){return e>=500}function Kg(e){try{return e.clone()}catch{return}}const Gg=80*Kn,Yg=32,bc=3*Da,Jg=Oe,wc=Se;function Sc(e,t,n,r,s){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?vc(e,t,n,{onSuccess:()=>Ec(0,t,n,r,s),onFailure:()=>{t.queuedPayloads.enqueue(e),_c(t,n,r,s)}}):t.queuedPayloads.enqueue(e)}function _c(e,t,n,r){e.transportStatus===2&&fe(()=>{const s=e.queuedPayloads.first();vc(s,e,t,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=wc,Ec(1,e,t,n,r)},onFailure:()=>{e.currentBackoffTime=Math.min(Jg,e.currentBackoffTime*2),_c(e,t,n,r)}})},e.currentBackoffTime)}function vc(e,t,n,{onSuccess:r,onFailure:s}){t.bandwidthMonitor.add(e),n(e,i=>{t.bandwidthMonitor.remove(e),Zg(i)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:i.status},s()):(t.transportStatus=0,r())})}function Ec(e,t,n,r,s){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(s({message:`Reached max ${r} events size queued for upload: ${bc/Da}MiB`,source:fn.AGENT,startClocks:xe()}),t.queueFullReported=!0);const i=t.queuedPayloads;for(t.queuedPayloads=Cc();i.size()>0;)Sc(i.dequeue(),t,n,r,s)}function Zg(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||qg(e.status))}function Xg(){return{transportStatus:0,currentBackoffTime:wc,bandwidthMonitor:Qg(),queuedPayloads:Cc(),queueFullReported:!1}}function Cc(){const e=[];return{bytesCount:0,enqueue(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=bc}}}function Qg(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=Gg&&this.ongoingRequestCount<Yg},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}}}function xc(e,t,n){const r=Xg(),s=(i,o)=>nm(e,t,i,o);return{send:i=>{Sc(i,r,s,e.trackType,n)},sendOnExit:i=>{em(e,t,i)}}}function em(e,t,n){if(!!navigator.sendBeacon&&n.bytesCount<t)try{const s=e.build("beacon",n);if(navigator.sendBeacon(s,n.data))return}catch(s){tm(s)}ui(e,n)}let Tc=!1;function tm(e){Tc||(Tc=!0,dt(e))}function nm(e,t,n,r){if(rm()&&n.bytesCount<t){const i=e.build("fetch-keepalive",n);fetch(i,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(U(o=>r==null?void 0:r({status:o.status,type:o.type}))).catch(U(()=>ui(e,n,r)))}else ui(e,n,r)}function ui(e,t,n){const r=e.build("fetch",t);fetch(r,{method:"POST",body:t.data,mode:"cors"}).then(U(s=>n==null?void 0:n({status:s.status,type:s.type}))).catch(U(()=>n==null?void 0:n({status:0})))}function rm(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function gn(){const e=sm();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){const s=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:s}))}}}function Ac(e){const t=gn();return!!t&&t.getCapabilities().includes(e)}function zt(e){var t;e===void 0&&(e=(t=et().location)===null||t===void 0?void 0:t.hostname);const n=gn();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function sm(){return et().DatadogEventBridge}const mn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function im(e){return new G(t=>{const{stop:n}=Ne(e,window,["visibilitychange","freeze"],s=>{s.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:mn.HIDDEN}):s.type==="freeze"&&t.notify({reason:mn.FROZEN})},{capture:!0}),r=Z(e,window,"beforeunload",()=>{t.notify({reason:mn.UNLOADING})}).stop;return()=>{n(),r()}})}function Rc(e){return Ha(mn).includes(e)}function om({encoder:e,request:t,flushController:n,messageBytesLimit:r}){let s={};const i=n.flushObservable.subscribe(d=>u(d));function o(d,f,h){n.notifyBeforeAddMessage(f),h!==void 0?(s[h]=d,n.notifyAfterAddMessage()):e.write(e.isEmpty?d:`
|
|
16
|
-
${d}`,p=>{n.notifyAfterAddMessage(p-f)})}function a(d){return d!==void 0&&s[d]!==void 0}function c(d){const f=s[d];delete s[d];const h=e.estimateEncodedBytesCount(f);n.notifyAfterRemoveMessage(h)}function l(d,f){const h=
|
|
17
|
-
`);s={};const h=
|
|
18
|
-
`);m&&p({data:m,bytesCount:
|
|
19
|
-
${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.unsubscribe}}function Ic(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function am({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:s}){const i=r.subscribe(p=>u(p.reason)),o=s.subscribe(()=>u("session_expire")),a=new G(()=>()=>{i.unsubscribe(),o.unsubscribe()});let c=0,l=0;function u(p){if(l===0)return;const g=l,m=c;l=0,c=0,h(),a.notify({reason:p,messagesCount:g,bytesCount:m})}let d;function f(){d===void 0&&(d=fe(()=>{u("duration_limit")},n))}function h(){Pe(d),d=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(p){c+p>=t&&u("bytes_limit"),l+=1,c+=p,f()},notifyAfterAddMessage(p=0){c+=p,l>=e?u("messages_limit"):c>=t&&u("bytes_limit")},notifyAfterRemoveMessage(p){c-=p,l-=1,l===0&&h()}}}function cm(e,t,n,r,s,i,o=om){const a=l(e,t),c=n&&l(e,n);function l(u,{endpoint:d,encoder:f}){return o({encoder:f,request:xc(d,u.batchBytesLimit,r),flushController:am({messagesLimit:u.batchMessagesLimit,bytesLimit:u.batchBytesLimit,durationLimit:u.flushTimeout,pageMayExitObservable:s,sessionExpireObservable:i}),messageBytesLimit:u.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(u,d=!0){a.add(u),c&&d&&c.add(n.transformMessage?n.transformMessage(u):u)},upsert:(u,d)=>{a.upsert(u,d),c&&c.upsert(n.transformMessage?n.transformMessage(u):u,d)},stop:()=>{a.stop(),c&&c.stop()}}}function lm(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const s=Fa(n);t+=s,e+=n,r&&r(s)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class um{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(s=>s(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}function di(e,t,n){let r=0,s=!1;return{isLimitReached(){if(r===0&&fe(()=>{r=0},Oe),r+=1,r<=t||s)return s=!1,!1;if(r===t+1){s=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:fn.AGENT,startClocks:xe()})}finally{s=!1}}return!0}}}function fi(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:z}):Z(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function dm(e,t){return new Promise(n=>{fi(e,t,n)})}let pi;const hi=new WeakMap;function fm(e){return pi||(pi=pm(e)),pi}function pm(e){return new G(t=>{const{stop:n}=Le(XMLHttpRequest.prototype,"open",hm),{stop:r}=Le(XMLHttpRequest.prototype,"send",i=>{gm(i,e,t)},{computeHandlingStack:!0}),{stop:s}=Le(XMLHttpRequest.prototype,"abort",mm);return()=>{n(),r(),s()}})}function hm({target:e,parameters:[t,n]}){hi.set(e,{state:"open",method:String(t).toUpperCase(),url:Qs(String(n))})}function gm({target:e,handlingStack:t},n,r){const s=hi.get(e);if(!s)return;const i=s;i.state="start",i.startClocks=xe(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let o=!1;const{stop:a}=Le(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&c()}),c=()=>{if(l(),a(),o)return;o=!0;const u=s;u.state="complete",u.duration=me(i.startClocks.timeStamp,de()),u.status=e.status,r.notify(Gn(u))},{stop:l}=Z(n,e,"loadend",c);r.notify(i)}function mm({target:e}){const t=hi.get(e);t&&(t.isAborted=!0)}let gi;function kc(){return gi||(gi=ym()),gi}function ym(){return new G(e=>{if(!window.fetch)return;const{stop:t}=Le(window,"fetch",n=>bm(n,e),{computeHandlingStack:!0});return t})}function bm({parameters:e,onPostCall:t,handlingStack:n},r){const[s,i]=e;let o=i&&i.method;o===void 0&&s instanceof Request&&(o=s.method);const a=o!==void 0?String(o).toUpperCase():"GET",c=s instanceof Request?s.url:Qs(String(s)),l=xe(),u={state:"start",init:i,input:s,method:a,startClocks:l,url:c,handlingStack:n};r.notify(u),e[0]=u.input,e[1]=u.init,t(d=>wm(r,d,u))}function wm(e,t,n){const r=n;function s(i){r.state="resolve",Object.assign(r,i),e.notify(r)}t.then(U(i=>{s({response:i,responseType:i.type,status:i.status,isAborted:!1})}),U(i=>{var o,a;s({status:0,isAborted:((a=(o=r.init)===null||o===void 0?void 0:o.signal)===null||a===void 0?void 0:a.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function Oc(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(U(e),t);return()=>window.cancelIdleCallback(n)}return _m(e)}const Sm=50;function _m(e){const t=Ve(),n=fe(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,Sm-(Ve()-t))})},0);return()=>Pe(n)}const vm=Se,Em=30;function Cm(){const e=[];function t(r){let s;if(r.didTimeout){const i=performance.now();s=()=>Em-(performance.now()-i)}else s=r.timeRemaining.bind(r);for(;s()>0&&e.length;)e.shift()();e.length&&n()}function n(){Oc(t,{timeout:vm})}return{push(r){e.push(r)===1&&n()}}}let mi={};function xm(e){const t=e.map(n=>(mi[n]||(mi[n]=Tm(n)),mi[n]));return Ua(...t)}function Tm(e){return new G(t=>{const n=ut[e];return ut[e]=(...r)=>{n.apply(console,r);const s=ts("console error");Nt(()=>{t.notify(Am(r,e,s))})},()=>{ut[e]=n}})}function Am(e,t,n){const r=e.map(i=>Rm(i)).join(" ");let s;if(t===Ur.error){const i=e.find(vt);s={stack:i?dn(_t(i)):void 0,fingerprint:cc(i),causes:i?uc(i,"console"):void 0,startClocks:xe(),message:r,source:fn.CONSOLE,handling:"handled",handlingStack:n,context:lc(i),originalError:i}}return{api:t,message:r,error:s,handlingStack:n}}function Rm(e){return typeof e=="string"?ie(e):vt(e)?ic(_t(e)):on(ie(e),void 0,2)}function Im(e){const t=$t(e)==="object";return t||V.error("Unsupported context:",e),t}function yi(e,t,n){const r={...e};for(const[s,{required:i,type:o}]of Object.entries(t))o==="string"&&s in r&&(r[s]=String(r[s])),i&&!(s in e)&&V.warn(`The property ${s} of ${n} is required; context will not be sent to the intake.`);return r}function ss(e="",{propertiesConfig:t={}}={}){let n={};const r=new G,s={getContext:()=>ci(n),setContext:i=>{Im(i)?n=ie(yi(i,t,e)):s.clearContext(),r.notify()},setContextProperty:(i,o)=>{n=ie(yi({...n,[i]:o},t,e)),r.notify()},removeContextProperty:i=>{delete n[i],yi(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return s}const km="_dd_c",Om=[];function bi(e,t,n,r){const s=Pm(n,r);Om.push(Z(e,window,"storage",({key:l})=>{s===l&&o()})),t.changeObservable.subscribe(a);const i=Ge(c(),t.getContext());Lt(i)||t.setContext(i);function o(){t.setContext(c())}function a(){localStorage.setItem(s,JSON.stringify(t.getContext()))}function c(){const l=localStorage.getItem(s);return l?JSON.parse(l):{}}}function Pm(e,t){return`${km}_${e}_${t}`}const pe={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Ae={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function Lm(e,t,n){const r=e.getReader();let s=0;i();function i(){r.read().then(U(a=>{if(a.done){o();return}s+=a.value.length,s>n.bytesLimit?o():i()}),U(a=>t(a)))}function o(){r.cancel().catch(z),t(void 0,void 0,void 0)}}const Nm="datadog-synthetics-public-id",Mm="datadog-synthetics-result-id",Dm="datadog-synthetics-injects-rum";function Pc(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||St(Dm))}function Fm(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||St(Nm);return typeof e=="string"?e:void 0}function Bm(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||St(Mm);return typeof e=="string"?e:void 0}function wi(e){const t=$t(e);return t==="string"||t==="function"||e instanceof RegExp}function Lc(e,t,n=!1){return e.some(r=>{try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?t.startsWith(r):r===t}catch(s){V.error(s)}return!1})}function Um(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function $m(e,t,n){function r(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function s(i){r(i)&&e.notify(12,zm(i))}return{addDurationVital:s,startDurationVital:(i,o={})=>Nc(n,i,o),stopDurationVital:(i,o={})=>{Mc(s,n,i,o)}}}function Nc({vitalsByName:e,vitalsByReference:t},n,r={}){const s={name:n,startClocks:xe(),context:r.context,description:r.description},i={__dd_vital_reference:!0};return e.set(n,s),t.set(i,s),i}function Mc(e,{vitalsByName:t,vitalsByReference:n},r,s={}){const i=typeof r=="string"?t.get(r):n.get(r);i&&(e(Vm(i,i.startClocks,s,xe())),typeof r=="string"?t.delete(r):n.delete(r))}function Vm(e,t,n,r){var s;return{name:e.name,type:"duration",startClocks:t,duration:me(t.timeStamp,r.timeStamp),context:Ge(e.context,n.context),description:(s=n.description)!==null&&s!==void 0?s:e.description}}function zm(e,t){const n={date:e.startClocks.timeStamp,vital:{id:ye(),type:e.type,name:e.name,duration:B(e.duration),description:e.description},type:"vital"};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,customerContext:e.context,domainContext:{}}}function Dc(e,t,n){if(e)for(const r of e){const s=r[t];s&&s(n)}}function Hm(){return Bc(64)}function Fc(){return Bc(63)}function Bc(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],s=t[0],i="";do{const o=r%n*4294967296+s;r=Math.floor(r/n),s=Math.floor(o/n),i=(o%n).toString(n)+i}while(r||s);return i}}}function yn(e){return e.toString(16).padStart(16,"0")}let is;function jm(e,t){if(t===100)return!0;if(t===0)return!1;if(is&&e===is.sessionId)return is.decision;let n;return window.BigInt?n=Wm(BigInt(`0x${e.split("-")[4]}`),t):n=yt(t),is={sessionId:e,decision:n},n}function Wm(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),s=e*n%r;return Number(s)<=t/100*Number(r)}function qm(e){const t=e;return $t(t)==="object"&&wi(t.match)&&Array.isArray(t.propagatorTypes)}function Km(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Gm(e,t,n){return{clearTracingIfNeeded:Km,traceFetch:r=>Uc(e,r,t,n,s=>{var i;if(r.input instanceof Request&&!(!((i=r.init)===null||i===void 0)&&i.headers))r.input=new Request(r.input),Object.keys(s).forEach(o=>{r.input.headers.append(o,s[o])});else{r.init=Gn(r.init);const o=[];r.init.headers instanceof Headers?r.init.headers.forEach((a,c)=>{o.push([c,a])}):Array.isArray(r.init.headers)?r.init.headers.forEach(a=>{o.push(a)}):r.init.headers&&Object.keys(r.init.headers).forEach(a=>{o.push([a,r.init.headers[a]])}),r.init.headers=o.concat(Ys(s))}}),traceXhr:(r,s)=>Uc(e,r,t,n,i=>{Object.keys(i).forEach(o=>{s.setRequestHeader(o,i[o])})})}}function Uc(e,t,n,r,s){const i=n.findTrackedSession();if(!i)return;const o=e.allowedTracingUrls.find(l=>Lc([l.match],t.url,!0));if(!o)return;const a=jm(i.id,e.traceSampleRate);(a||e.traceContextInjection===ei.ALL)&&(t.traceSampled=a,t.traceId=Hm(),t.spanId=Fc(),s(Ym(t.traceId,t.spanId,t.traceSampled,o.propagatorTypes,r,e)))}function Ym(e,t,n,r,s,i){const o={};if(r.forEach(a=>{switch(a){case"datadog":{Object.assign(o,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(o,{traceparent:`00-0000000000000000${yn(e)}-${yn(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(o,{b3:`${yn(e)}-${yn(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(o,{"X-B3-TraceId":yn(e),"X-B3-SpanId":yn(t),"X-B3-Sampled":n?"1":"0"});break}}}),es(Ut.USER_ACCOUNT_TRACE_HEADER)&&i.propagateTraceBaggage){const a=s().user.id,c=s().account.id,l=[];typeof a=="string"&&l.push(`usr.id=${encodeURIComponent(a)}`),typeof c=="string"&&l.push(`account.id=${encodeURIComponent(c)}`),l.length>0&&(o.baggage=l.join(","))}return o}const $c=["tracecontext","datadog"];function Jm(e){var t,n,r,s,i,o,a;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&V.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){V.error("Application ID is not configured, no RUM data will be collected.");return}if(!ln(e.sessionReplaySampleRate,"Session Replay")||!ln(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){V.error("Excluded Activity Urls should be an array");return}const c=Zm(e);if(!c)return;const l=Wh(e);if(!l)return;const u=es(Ut.PROFILING),d=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,version:e.version||void 0,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:d,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:d===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:Wn(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:c,excludedActivityUrls:(r=e.excludedActivityUrls)!==null&&r!==void 0?r:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((s=e.trackUserInteractions)!==null&&s!==void 0)||s),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((o=e.trackLongTasks)!==null&&o!==void 0)||o),subdomain:e.subdomain,defaultPrivacyLevel:Hr(Xn,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Xn.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:Hr(ei,e.traceContextInjection)?e.traceContextInjection:ei.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:u&&(a=e.profilingSampleRate)!==null&&a!==void 0?a:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...l}}function Zm(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){V.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){V.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{wi(n)?t.push({match:n,propagatorTypes:$c}):qm(n)?t.push(n):V.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Xm(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{wi(n)?$c.forEach(r=>t.add(r)):$t(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Qm(e){var t;const n=qh(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:Xm(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var s;return{name:r.name,...(s=r.getConfigurationTelemetry)===null||s===void 0?void 0:s.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,...n}}const e1="v1";function t1(e,t){r1(e,n=>{t(n1(e,n))})}function n1(e,t){return{...e,...t}}function r1(e,t){const n=new XMLHttpRequest;Z(e,n,"load",function(){if(n.status===200){const r=JSON.parse(n.responseText);t(r.rum)}else Vc()}),Z(e,n,"error",function(){Vc()}),n.open("GET",s1(e)),n.send()}function s1(e){return`https://sdk-configuration.${rc("rum",e)}/${e1}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Vc(){V.error("Error fetching the remote configuration.")}function i1(e){const t=zc();return e.storeContextsAcrossPages&&bi(e,t,"rum",2),t}function zc(){return ss("global context")}function o1(e){const t=Hc();return e.storeContextsAcrossPages&&bi(e,t,"rum",1),t}function Hc(){return ss("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}function a1(e){const t=jc();return e.storeContextsAcrossPages&&bi(e,t,"rum",4),t}function jc(){return ss("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function c1({ignoreInitIfSyntheticsWillInjectRum:e,startDeflateWorker:t},n,r,s){const i=mc(),o=zc();Si(o,pe.globalContext,i);const a=Hc();Si(a,pe.userContext,i);const c=jc();Si(c,pe.accountContext,i);let l,u,d,f;const h=n.observable.subscribe(g),p={};function g(){if(!d||!f||!n.isGranted())return;h.unsubscribe();let b;if(f.trackViewsManually){if(!l)return;i.remove(l.callback),b=l.options}const _=s(f,u,b);i.drain(_)}function m(b){const _=zt();if(_&&(b=l1(b)),d=b,Mg(Qm(b)),f){dc("DD_RUM",b);return}const k=Jm(b);if(k){if(!_&&!k.sessionStoreStrategyType){V.warn("No storage available for session. We will not send any data.");return}k.compressIntakeRequests&&!_&&t&&(u=t(k,"Datadog RUM",z),!u)||(f=k,kc().subscribe(z),n.tryToInit(k.trackingConsent),g())}}const w=b=>{i.add(_=>_.addDurationVital(b))};return{init(b,_){if(!b){V.error("Missing configuration");return}Kh(b.enableExperimentalFeatures),d=b,!(e&&Pc())&&(Dc(b.plugins,"onInit",{initConfiguration:b,publicApi:_}),b.remoteConfigurationId?t1(b,m):m(b))},get initConfiguration(){return d},getInternalContext:z,stopSession:z,addTiming(b,_=de()){i.add(k=>k.addTiming(b,_))},startView(b,_=xe()){const k=x=>{x.startView(b,_)};i.add(k),l||(l={options:b,callback:k},g())},setViewName(b){i.add(_=>_.setViewName(b))},setViewContext(b){i.add(_=>_.setViewContext(b))},setViewContextProperty(b,_){i.add(k=>k.setViewContextProperty(b,_))},getViewContext:()=>p,globalContext:o,userContext:a,accountContext:c,addAction(b){i.add(_=>_.addAction(b))},addError(b){i.add(_=>_.addError(b))},addFeatureFlagEvaluation(b,_){i.add(k=>k.addFeatureFlagEvaluation(b,_))},startDurationVital(b,_){return Nc(r,b,_)},stopDurationVital(b,_){Mc(w,r,b,_)},addDurationVital:w}}function l1(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=gn())===null||n===void 0?void 0:n.getPrivacyLevel()}}function Si(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(s=>s[t].setContext(r))})}function u1(e,t,n,r={}){const s=xh(),i=Um();let o=c1(r,s,i,(u,d,f)=>{const h=e(u,t,n,f,d&&r.createDeflateEncoder?p=>r.createDeflateEncoder(u,d,p):lm,s,i);return t.onRumStart(h.lifeCycle,u,h.session,h.viewHistory,d),n.onRumStart(h.lifeCycle,u,h.session,h.viewHistory),o=d1(o,h),Dc(u.plugins,"onRumStart",{strategy:o}),h});const a=U(u=>{const d=typeof u=="object"?u:{name:u};o.startView(d),Te({feature:"start-view"})});function c(u,d,f){return U((...h)=>(Te({feature:f}),o[u][d](...h)))}const l=Sg({init:U(u=>{o.init(u,l)}),setTrackingConsent:U(u=>{s.update(u),Te({feature:"set-tracking-consent",tracking_consent:u})}),setViewName:U(u=>{o.setViewName(u),Te({feature:"set-view-name"})}),setViewContext:U(u=>{o.setViewContext(u),Te({feature:"set-view-context"})}),setViewContextProperty:U((u,d)=>{o.setViewContextProperty(u,d),Te({feature:"set-view-context-property"})}),getViewContext:U(()=>(Te({feature:"set-view-context-property"}),o.getViewContext())),getInternalContext:U(u=>o.getInternalContext(u)),getInitConfiguration:U(()=>ci(o.initConfiguration)),addAction:(u,d)=>{const f=ts("action");Nt(()=>{o.addAction({name:ie(u),context:ie(d),startClocks:xe(),type:"custom",handlingStack:f}),Te({feature:"add-action"})})},addError:(u,d)=>{const f=ts("error");Nt(()=>{o.addError({error:u,handlingStack:f,context:ie(d),startClocks:xe()}),Te({feature:"add-error"})})},addTiming:U((u,d)=>{o.addTiming(ie(u),d)}),setGlobalContext:c(pe.globalContext,Ae.setContext,"set-global-context"),getGlobalContext:c(pe.globalContext,Ae.getContext,"get-global-context"),setGlobalContextProperty:c(pe.globalContext,Ae.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:c(pe.globalContext,Ae.removeContextProperty,"remove-global-context-property"),clearGlobalContext:c(pe.globalContext,Ae.clearContext,"clear-global-context"),setUser:c(pe.userContext,Ae.setContext,"set-user"),getUser:c(pe.userContext,Ae.getContext,"get-user"),setUserProperty:c(pe.userContext,Ae.setContextProperty,"set-user-property"),removeUserProperty:c(pe.userContext,Ae.removeContextProperty,"remove-user-property"),clearUser:c(pe.userContext,Ae.clearContext,"clear-user"),setAccount:c(pe.accountContext,Ae.setContext,"set-account"),getAccount:c(pe.accountContext,Ae.getContext,"get-account"),setAccountProperty:c(pe.accountContext,Ae.setContextProperty,"set-account-property"),removeAccountProperty:c(pe.accountContext,Ae.removeContextProperty,"remove-account-property"),clearAccount:c(pe.accountContext,Ae.clearContext,"clear-account"),startView:a,stopSession:U(()=>{o.stopSession(),Te({feature:"stop-session"})}),addFeatureFlagEvaluation:U((u,d)=>{o.addFeatureFlagEvaluation(ie(u),ie(d)),Te({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:U(()=>t.getSessionReplayLink()),startSessionReplayRecording:U(u=>{t.start(u),Te({feature:"start-session-replay-recording",force:u&&u.force})}),stopSessionReplayRecording:U(()=>t.stop()),addDurationVital:U((u,d)=>{Te({feature:"add-duration-vital"}),o.addDurationVital({name:ie(u),type:"duration",startClocks:Up(d.startTime),duration:d.duration,context:ie(d&&d.context),description:ie(d&&d.description)})}),startDurationVital:U((u,d)=>(Te({feature:"start-duration-vital"}),o.startDurationVital(ie(u),{context:ie(d&&d.context),description:ie(d&&d.description)}))),stopDurationVital:U((u,d)=>{Te({feature:"stop-duration-vital"}),o.stopDurationVital(typeof u=="string"?ie(u):u,{context:ie(d&&d.context),description:ie(d&&d.description)})})});return l}function d1(e,t){return{init:n=>{dc("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function f1(){const e=Wc();return new G(t=>{if(!e)return;const n=new e(U(()=>t.notify()));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Wc(){let e;const t=window;if(t.Zone&&(e=bt(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(z),r=bt(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function p1(){const e=new G,{stop:t}=Le(window,"open",()=>e.notify());return{observable:e,stop:t}}function h1(e,t,n,r,s){return{get:i=>{const o=n.findView(i),a=s.findUrl(i),c=t.findTrackedSession(i);if(c&&o&&a){const l=r.findActionId(i);return{application_id:e,session_id:c.id,user_action:l?{id:l}:void 0,view:{id:o.id,name:o.name,referrer:a.referrer,url:a.url}}}}}}const g1=um,m1=Mt;function y1(e){const t=hn({expireDelay:m1});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const s=t.find(r.startClocks.relative);s&&r.name&&(s.name=r.name),s&&r.context&&(s.context=r.context)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),getAllEntries:()=>t.getAllEntries(),getDeletedEntries:()=>t.getDeletedEntries(),stop:()=>{t.stop()}}}const qc="initial_document",b1=[["document",e=>qc===e],["xhr",e=>e==="xmlhttprequest"],["fetch",e=>e==="fetch"],["beacon",e=>e==="beacon"],["css",(e,t)=>/\.css$/i.test(t)],["js",(e,t)=>/\.js$/i.test(t)],["image",(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],["font",(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],["media",(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function w1(e){const t=e.name;if(!Th(t))return ft(`Failed to construct URL for "${e.name}"`),"other";const n=Ah(t);for(const[r,s]of b1)if(s(e.initiatorType,n))return r;return"other"}function Kc(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function S1(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Gc(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?me(n,r):t}function _1(e){if(!Jc(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:s,redirectEnd:i,domainLookupStart:o,domainLookupEnd:a,connectStart:c,secureConnectionStart:l,connectEnd:u,requestStart:d,responseStart:f,responseEnd:h}=e,p={download:Ht(t,f,h),first_byte:Ht(t,d,f)};return 0<r&&r<n&&(p.worker=Ht(t,r,n)),n<u&&(p.connect=Ht(t,c,u),c<=l&&l<=u&&(p.ssl=Ht(t,l,u))),n<a&&(p.dns=Ht(t,o,a)),t<i&&(p.redirect=Ht(t,s,i)),p}function Yc(e){return e.duration>=0}function Jc(e){const t=Kc(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=v1(e)?Kc(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function v1(e){return e.redirectEnd>e.startTime}function Ht(e,t,n){if(e<=t&&t<=n)return{duration:B(me(t,n)),start:B(me(e,t))}}function Zc(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Xc(e){return e.deliveryType===""?"other":e.deliveryType}function E1(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function _i(e){return e&&!Hh(e)}const C1=/data:(.+)?(;base64)?,/g,Qc=24e3;function el(e){return e.length<=Qc?!1:e.substring(0,5)==="data:"?(e=e.substring(0,Qc),!0):!1}function tl(e){return`${e.match(C1)[0]}[...]`}let nl=1;function x1(e,t,n,r){const s=Gm(t,n,r);T1(e,t,s),A1(e,s)}function T1(e,t,n){const r=fm(t).subscribe(s=>{const i=s;if(_i(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=rl(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:"xhr",url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>r.unsubscribe()}}function A1(e,t){const n=kc().subscribe(r=>{const s=r;if(_i(s.url))switch(s.state){case"start":t.traceFetch(s),s.requestIndex=rl(),e.notify(7,{requestIndex:s.requestIndex,url:s.url});break;case"resolve":R1(s,i=>{t.clearTracingIfNeeded(s),e.notify(8,{duration:i,method:s.method,requestIndex:s.requestIndex,responseType:s.responseType,spanId:s.spanId,startClocks:s.startClocks,status:s.status,traceId:s.traceId,traceSampled:s.traceSampled,type:"fetch",url:s.url,response:s.response,init:s.init,input:s.input,isAborted:s.isAborted,handlingStack:s.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function rl(){const e=nl;return nl+=1,e}function R1(e,t){const n=e.response&&Kg(e.response);!n||!n.body?t(me(e.startClocks.timeStamp,de())):Lm(n.body,()=>{t(me(e.startClocks.timeStamp,de()))},{bytesLimit:Number.POSITIVE_INFINITY})}function sl(e){return Wn(e)&&e<0?void 0:e}function il({lifeCycle:e,isChildEvent:t,onChange:n=z}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},s=e.subscribe(13,i=>{var o;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case"error":r.errorCount+=1,n();break;case"action":r.actionCount+=1,i.action.frustration&&(r.frustrationCount+=i.action.frustration.type.length),n();break;case"long_task":r.longTaskCount+=1,n();break;case"resource":!((o=i._dd)===null||o===void 0)&&o.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{s.unsubscribe()},eventCounts:r}}function I1(e,t){const n=Ve();let r=!1;const{stop:s}=Ne(e,window,["click","mousedown","keydown","touchstart","pointerdown"],a=>{if(!a.cancelable)return;const c={entryType:"first-input",processingStart:ze(),processingEnd:ze(),startTime:a.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};a.type==="pointerdown"?i(e,c):o(c)},{passive:!0,capture:!0});return{stop:s};function i(a,c){Ne(a,window,["pointerup","pointercancel"],l=>{l.type==="pointerup"&&o(c)},{once:!0})}function o(a){if(!r){r=!0,s();const c=a.processingStart-a.startTime;c>=0&&c<Ve()-n&&t(a)}}}var H;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(H||(H={}));function tt(e,t){return new G(n=>{if(!window.PerformanceObserver)return;const r=c=>{const l=P1(c);l.length>0&&n.notify(l)};let s,i=!0;const o=new PerformanceObserver(U(c=>{i?s=fe(()=>r(c.getEntries())):r(c.getEntries())}));try{o.observe(t)}catch{if([H.RESOURCE,H.NAVIGATION,H.LONG_TASK,H.PAINT].includes(t.type)){t.buffered&&(s=fe(()=>r(performance.getEntriesByType(t.type))));try{o.observe({entryTypes:[t.type]})}catch{return}}}i=!1,k1(e);let a;return!jt(H.FIRST_INPUT)&&t.type===H.FIRST_INPUT&&({stop:a}=I1(e,c=>{r([c])})),()=>{o.disconnect(),a&&a(),Pe(s)}})}let sr;function k1(e){return!sr&&O1()&&"addEventListener"in performance&&(sr=Z(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{sr==null||sr.stop()}}function O1(){return window.performance!==void 0&&"getEntries"in performance}function jt(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function P1(e){return e.filter(t=>!L1(t))}function L1(e){return e.entryType===H.RESOURCE&&(!_i(e.name)||!Yc(e))}const ol=100,N1=100;function vi(e,t,n,r,s,i){const o=D1(e,t,n,r);return M1(o,s,i)}function M1(e,t,n){let r,s=!1;const i=fe(U(()=>l({hadActivity:!1})),ol),o=n!==void 0?fe(U(()=>l({hadActivity:!0,end:de()})),n):void 0,a=e.subscribe(({isBusy:u})=>{Pe(i),Pe(r);const d=de();u||(r=fe(U(()=>l({hadActivity:!0,end:d})),N1))}),c=()=>{s=!0,Pe(i),Pe(r),Pe(o),a.unsubscribe()};function l(u){s||(c(),t(u))}return{stop:c}}function D1(e,t,n,r){return new G(s=>{const i=[];let o,a=0;return i.push(t.subscribe(c),n.subscribe(c),tt(r,{type:H.RESOURCE}).subscribe(l=>{l.some(u=>!Ei(r,u.name))&&c()}),e.subscribe(7,l=>{Ei(r,l.url)||(o===void 0&&(o=l.requestIndex),a+=1,c())}),e.subscribe(8,l=>{Ei(r,l.url)||o===void 0||l.requestIndex<o||(a-=1,c())})),()=>{i.forEach(l=>l.unsubscribe())};function c(){s.notify({isBusy:a>0})}})}function Ei(e,t){return Lc(e.excludedActivityUrls,t)}function al(e){return e.nodeType===Node.TEXT_NODE}function F1(e){return e.nodeType===Node.COMMENT_NODE}function bn(e){return e.nodeType===Node.ELEMENT_NODE}function os(e){return bn(e)&&!!e.shadowRoot}function Ci(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&bn(t.host)}function B1(e){return e.childNodes.length>0||os(e)}function cl(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;os(e)&&t(e.shadowRoot)}function as(e){return Ci(e)?e.host:e.parentNode}const M={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Xn.ALLOW,MASK:Xn.MASK,MASK_USER_INPUT:Xn.MASK_USER_INPUT},xi="data-dd-privacy",U1="hidden",$1="dd-privacy-",Et="***",ll="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",V1={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},z1="x";function nt(e,t,n){if(n&&n.has(e))return n.get(e);const r=as(e),s=r?nt(r,t,n):t,i=dl(e),o=ul(i,s);return n&&n.set(e,o),o}function ul(e,t){switch(t){case M.HIDDEN:case M.IGNORE:return t}switch(e){case M.ALLOW:case M.MASK:case M.MASK_USER_INPUT:case M.HIDDEN:case M.IGNORE:return e;default:return t}}function dl(e){if(bn(e)){if(e.tagName==="BASE")return M.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return M.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return M.MASK}if(e.matches(wn(M.HIDDEN)))return M.HIDDEN;if(e.matches(wn(M.MASK)))return M.MASK;if(e.matches(wn(M.MASK_USER_INPUT)))return M.MASK_USER_INPUT;if(e.matches(wn(M.ALLOW)))return M.ALLOW;if(j1(e))return M.IGNORE}}function cs(e,t){switch(t){case M.MASK:case M.HIDDEN:case M.IGNORE:return!0;case M.MASK_USER_INPUT:return al(e)?fl(e.parentNode):fl(e);default:return!1}}function fl(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!V1[t.tagName]}const H1=e=>e.replace(/\S/g,z1);function pl(e,t,n){var r;const s=(r=e.parentElement)===null||r===void 0?void 0:r.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const o=n;if(s==="SCRIPT")i=Et;else if(o===M.HIDDEN)i=Et;else if(cs(e,o))if(s==="DATALIST"||s==="SELECT"||s==="OPTGROUP"){if(!i.trim())return}else s==="OPTION"?i=Et:i=H1(i);return i}function j1(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),s=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(s)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(s)||/^product:/.test(s)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function wn(e){return`[${xi}="${e}"], .${$1}${e}`}const Ti="data-dd-action-name",W1="Masked Element";function q1(e,{enablePrivacyForActionName:t,actionNameAttribute:n},r){const s=hl(e,Ti)||n&&hl(e,n);return s?{name:s,nameSource:"custom_attribute"}:r===M.MASK?{name:W1,nameSource:"mask_placeholder"}:gl(e,n,K1,t)||gl(e,n,G1,t)||{name:"",nameSource:"blank"}}function hl(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return yl(ml(r.trim()))}const K1=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return ls(e.labels[0],t)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return ls(e,t,n)},e=>ir(e,"aria-label"),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(s=>J1(e,s)).filter(s=>!!s).map(s=>bl(s,t,n)).join(" "),nameSource:"text_content"}},e=>ir(e,"alt"),e=>ir(e,"name"),e=>ir(e,"title"),e=>ir(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return ls(e.options[0],t)}],G1=[(e,t,n)=>ls(e,t,n)],Y1=10;function gl(e,t,n,r){let s=e,i=0;for(;i<=Y1&&s&&s.nodeName!=="BODY"&&s.nodeName!=="HTML"&&s.nodeName!=="HEAD";){for(const o of n){const a=o(s,t,r);if(a){const{name:c,nameSource:l}=a,u=c&&c.trim();if(u)return{name:yl(ml(u)),nameSource:l}}}if(s.nodeName==="FORM")break;s=s.parentElement,i+=1}}function ml(e){return e.replace(/\s+/g," ")}function yl(e){return e.length>100?`${$a(e,100)} [...]`:e}function J1(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function ir(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function ls(e,t,n){return{name:bl(e,t,n)||"",nameSource:"text_content"}}function bl(e,t,n){if(!e.isContentEditable){if("innerText"in e){let r=e.innerText;const s=i=>{const o=e.querySelectorAll(i);for(let a=0;a<o.length;a+=1){const c=o[a];if("innerText"in c){const l=c.innerText;l&&l.trim().length>0&&(r=r.replace(l,""))}}};return s(`[${Ti}]`),t&&s(`[${t}]`),n&&s(`${wn(M.HIDDEN)}, ${wn(M.MASK)}`),r}return e.textContent}}const wl=[Ti,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Z1=[_l,Q1],X1=[_l,e0,t0];function or(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const s=vl(r,Z1,r0,t,n);if(s)return s;n=vl(r,X1,s0,t,n)||us(n0(r),n),r=r.parentElement}return n}function Sl(e){return/[0-9]/.test(e)}function Q1(e){if(e.id&&!Sl(e.id))return`#${CSS.escape(e.id)}`}function e0(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!Sl(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function t0(e){return CSS.escape(e.tagName)}function _l(e,t){if(t){const r=n(t);if(r)return r}for(const r of wl){const s=n(r);if(s)return s}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function n0(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function vl(e,t,n,r,s){for(const i of t){const o=i(e,r);if(o&&n(e,o,s))return us(o,s)}}function r0(e,t,n){return e.ownerDocument.querySelectorAll(us(t,n)).length===1}function s0(e,t,n){let r;if(n===void 0)r=o=>o.matches(t);else{const o=us(`${t}:scope`,n);r=a=>a.querySelector(o)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&r(i))return!1;i=i.nextElementSibling}return!0}function us(e,t){return t?`${e}>${t}`:e}const El=Se,i0=100;function o0(e,t){const n=[];let r=0,s;i(e);function i(c){c.stopObservable.subscribe(o),n.push(c),Pe(s),s=fe(a,El)}function o(){r===1&&n.every(c=>c.isStopped())&&(r=2,t(n))}function a(){Pe(s),r===0&&(r=1,o())}return{tryAppend:c=>r!==0?!1:n.length>0&&!a0(n[n.length-1].event,c.event)?(a(),!1):(i(c),!0),stop:()=>{a()}}}function a0(e,t){return e.target===t.target&&c0(e,t)<=i0&&e.timeStamp-t.timeStamp<=El}function c0(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function l0(e,{onPointerDown:t,onPointerUp:n}){let r,s={selection:!1,input:!1,scroll:!1},i;const o=[Z(e,window,"pointerdown",a=>{xl(a)&&(r=Cl(),s={selection:!1,input:!1,scroll:!1},i=t(a))},{capture:!0}),Z(e,window,"selectionchange",()=>{(!r||!Cl())&&(s.selection=!0)},{capture:!0}),Z(e,window,"scroll",()=>{s.scroll=!0},{capture:!0,passive:!0}),Z(e,window,"pointerup",a=>{if(xl(a)&&i){const c=s;n(i,a,()=>c),i=void 0}},{capture:!0}),Z(e,window,"input",()=>{s.input=!0},{capture:!0})];return{stop:()=>{o.forEach(a=>a.stop())}}}function Cl(){const e=window.getSelection();return!e||e.isCollapsed}function xl(e){return e.target instanceof Element&&e.isPrimary!==!1}const Tl=3;function u0(e,t){if(d0(e))return t.addFrustration("rage_click"),e.some(Al)&&t.addFrustration("dead_click"),t.hasError&&t.addFrustration("error_click"),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration("error_click"),Al(r)&&!n&&r.addFrustration("dead_click")}),{isRage:!1}}function d0(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(Tl-1);t+=1)if(e[t+Tl-1].event.timeStamp-e[t].event.timeStamp<=Se)return!0;return!1}const f0='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Al(e){return e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll?!1:!e.event.target.matches(f0)}const Rl=10*Se,ar=new Map;function p0(e){const t=ar.get(e);return ar.delete(e),t}function Il(e,t){ar.set(e,t),ar.forEach((n,r)=>{me(r,ze())>Rl&&ar.delete(r)})}const h0=5*Oe;function g0(e,t,n,r){const s=hn({expireDelay:h0}),i=new G;let o;e.subscribe(10,()=>{s.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===mn.UNLOADING&&u()});const{stop:a}=l0(r,{onPointerDown:d=>m0(r,e,t,d,n),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},h,p)=>{y0(r,e,t,n,s,i,l,d,h,p,f)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:d=>s.findAll(d)}};function l(d){if(!o||!o.tryAppend(d)){const f=d.clone();o=o0(d,h=>{w0(h,f)})}}function u(){o&&o.stop()}}function m0(e,t,n,r,s){const i=e.enablePrivacyForActionName?nt(r.target,e.defaultPrivacyLevel):M.ALLOW;if(i===M.HIDDEN)return;const o=b0(r,i,e);let a=!1;return vi(t,n,s,e,c=>{a=c.hadActivity},ol),{clickActionBase:o,hadActivityOnPointerDown:()=>a}}function y0(e,t,n,r,s,i,o,a,c,l,u){var d;const f=kl(t,s,l,a,c);o(f);const h=(d=a==null?void 0:a.target)===null||d===void 0?void 0:d.selector;h&&Il(c.timeStamp,h);const{stop:p}=vi(t,n,r,e,w=>{w.hadActivity&&w.end<f.startClocks.timeStamp?f.discard():w.hadActivity?f.stop(w.end):u()?f.stop(f.startClocks.timeStamp):f.stop()},Rl),g=t.subscribe(5,({endClocks:w})=>{f.stop(w.timeStamp)}),m=i.subscribe(()=>{f.stop()});f.stopObservable.subscribe(()=>{g.unsubscribe(),p(),m.unsubscribe()})}function b0(e,t,n){const r=e.target.getBoundingClientRect(),s=or(e.target,n.actionNameAttribute);s&&Il(e.timeStamp,s);const i=q1(e.target,n,t);return{type:"click",target:{width:Math.round(r.width),height:Math.round(r.height),selector:s},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:i.name,nameSource:i.nameSource}}function kl(e,t,n,r,s){const i=ye(),o=xe(),a=t.add(i,o.relative),c=il({lifeCycle:e,isChildEvent:p=>p.action!==void 0&&(Array.isArray(p.action.id)?p.action.id.includes(i):p.action.id===i)});let l=0,u;const d=[],f=new G;function h(p){l===0&&(u=p,l=1,u?a.close(zs(u)):a.remove(),c.stop(),f.notify())}return{event:s,stop:h,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return u!==void 0},getUserActivity:n,addFrustration:p=>{d.push(p)},startClocks:o,isStopped:()=>l===1||l===2,clone:()=>kl(e,t,n,r,s),validate:p=>{if(h(),l!==1)return;const{resourceCount:g,errorCount:m,longTaskCount:w}=c.eventCounts,v={duration:u&&me(o.timeStamp,u),startClocks:o,id:i,frustrationTypes:d,counts:{resourceCount:g,errorCount:m,longTaskCount:w},events:p??[s],event:s,...r};e.notify(0,v),l=2},discard:()=>{h(),l=2}}}function w0(e,t){const{isRage:n}=u0(e,t);n?(e.forEach(r=>r.discard()),t.stop(de()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function S0(e,t,n,r,s){e.subscribe(0,a=>e.notify(12,Ol(a))),t.register(0,({startTime:a,eventType:c})=>{if(c!=="error"&&c!=="resource"&&c!=="long_task")return;const l=i.findActionId(a);if(l)return{type:c,action:{id:l}}});let i={findActionId:z},o=z;return s.trackUserInteractions&&({actionContexts:i,stop:o}=g0(e,n,r,s)),{addAction:a=>{e.notify(12,Ol(a))},actionContexts:i,stop:o}}function Ol(e){const t=ds(e)?{action:{id:e.id,loading_time:sl(B(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:void 0,n=Ge({action:{id:ye(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:"action"},t),r=ds(e)?e.duration:void 0,s=ds(e)?void 0:e.context,i=ds(e)?{events:e.events}:{handlingStack:e.handlingStack};return{customerContext:s,rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function ds(e){return e.type!=="custom"}function _0(e){const t=xm([Ur.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function v0(e,t){const n=vg(e,[tr.cspViolation,tr.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function E0(e,t){const n=new G;return _0(n),yg(n),v0(t,n),n.subscribe(r=>e.notify(14,{error:r})),C0(e)}function C0(e){return e.subscribe(14,({error:t,customerContext:n})=>{n=Ge(t.context,n),e.notify(12,{customerContext:n,...x0(t)})}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:s,context:i})=>{const o=vt(t)?_t(t):void 0,a=ac({stackTrace:o,originalError:t,handlingStack:n,componentStack:r,startClocks:s,nonErrorPrefix:"Provided",source:fn.CUSTOM,handling:"handled"});e.notify(14,{customerContext:i,error:a})}}}function x0(e){const t={date:e.startClocks.timeStamp,error:{id:ye(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:"error"},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const Pl=new WeakSet;function T0(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!Pl.has(r)).filter(r=>Yc(r)&&Jc(r)).filter(r=>A0(r,e.startClocks.relative,Ll({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return Pl.add(n[0]),n[0].toJSON()}function Ll(e){return nn(e.startTime,e.duration)}function A0(e,t,n){return e.startTime>=t-1&&Ll(e)<=nn(n,1)}const R0=2*Oe;function I0(e){const t=k0(e)||O0(e);if(!(!t||t.traceTime<=Ve()-R0))return t.traceId}function k0(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return Nl(t&&t.content,n&&n.content)}function O0(e){const t=P0(e);if(t)return Nl(Yn(t,"trace-id"),Yn(t,"trace-time"))}function Nl(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function P0(e){for(let t=0;t<e.childNodes.length;t+=1){const n=Ml(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=Ml(n);if(r)return r;if(!al(n))break}}function Ml(e){if(e&&F1(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function Dl(){if(jt(H.NAVIGATION)){const n=performance.getEntriesByType(H.NAVIGATION)[0];if(n)return n}const e=L0(),t={entryType:H.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function L0(){const e={},t=performance.timing;for(const n in t)if(Wn(t[n])){const r=n,s=t[r];e[r]=s===0?0:zs(s)}return e}function N0(e,t,n=Dl){fi(e,"interactive",()=>{const r=n(),s=Object.assign(r.toJSON(),{entryType:H.RESOURCE,initiatorType:qc,duration:r.responseEnd,traceId:I0(document),toJSON:()=>({...s,toJSON:void 0})});t(s)})}function M0(e,t,n,r=Cm(),s=N0){e.subscribe(8,a=>{o(()=>D0(a,t,n))});const i=tt(t,{type:H.RESOURCE,buffered:!0}).subscribe(a=>{for(const c of a)S1(c)||o(()=>Fl(c,t))});s(t,a=>{o(()=>Fl(a,t))});function o(a){r.push(()=>{const c=a();c&&e.notify(12,c)})}return{stop:()=>{i.unsubscribe()}}}function D0(e,t,n){const r=T0(e),s=r?zr(r.startTime):e.startClocks,i=F0(e,t);if(!t.trackResources&&!i)return;const o=e.type==="xhr"?"xhr":"fetch",a=r?Bl(r):void 0,c=r?Gc(r):U0(n,s,e.duration),l=Ge({date:s.timeStamp,resource:{id:ye(),type:o,duration:B(c),method:e.method,status_code:e.status,protocol:r&&Zc(r),url:el(e.url)?tl(e.url):e.url,delivery_type:r&&Xc(r)},type:"resource",_dd:{discarded:!t.trackResources}},i,a);return{startTime:s.relative,duration:c,rawRumEvent:l,domainContext:{performanceEntry:r,xhr:e.xhr,response:e.response,requestInput:e.input,requestInit:e.init,error:e.error,isAborted:e.isAborted,handlingStack:e.handlingStack}}}function Fl(e,t){const n=zr(e.startTime),r=B0(e,t);if(!t.trackResources&&!r)return;const s=w1(e),i=Bl(e),o=Gc(e),a=Ge({date:n.timeStamp,resource:{id:ye(),type:s,duration:B(o),url:e.name,status_code:$0(e.responseStatus),protocol:Zc(e),delivery_type:Xc(e)},type:"resource",_dd:{discarded:!t.trackResources}},r,i);return{startTime:n.relative,duration:o,rawRumEvent:a,domainContext:{performanceEntry:e}}}function Bl(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...E1(e),..._1(e)}}}function F0(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function B0(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Fc().toString(),rule_psr:t.rulePsr}}}function U0(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function $0(e){return e===0?void 0:e}function V0(e,t,n){const{stop:r,eventCounts:s}=il({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:r,eventCounts:s}}const z0=10*Oe;function H0(e,t,n){return{stop:tt(e,{type:H.PAINT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.name==="first-contentful-paint"&&o.startTime<t.timeStamp&&o.startTime<z0);i&&n(i.startTime)}).unsubscribe}}function j0(e,t,n){const r=tt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.startTime<t.timeStamp);if(i){const o=me(i.startTime,i.processingStart);let a;i.target&&bn(i.target)&&(a=or(i.target,e.actionNameAttribute)),n({delay:o>=0?o:0,time:i.startTime,targetSelector:a})}});return{stop:()=>{r.unsubscribe()}}}function W0(e,t,n=Dl){return G0(e,()=>{const r=n();K0(r)||t(q0(r))})}function q0(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=ze()?e.responseStart:void 0}}function K0(e){return e.loadEventEnd<=0}function G0(e,t){let n;const{stop:r}=fi(e,"complete",()=>{n=fe(()=>t())});return{stop:()=>{r(),Pe(n)}}}const Y0=10*Oe;function J0(e,t,n,r){let s=1/0;const{stop:i}=Ne(e,n,["pointerdown","keydown"],c=>{s=c.timeStamp},{capture:!0,once:!0});let o=0;const a=tt(e,{type:H.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(c=>{const l=th(c,u=>u.entryType===H.LARGEST_CONTENTFUL_PAINT&&u.startTime<s&&u.startTime<t.timeStamp&&u.startTime<Y0&&u.size>o);if(l){let u;l.element&&(u=or(l.element,e.actionNameAttribute)),r({value:l.startTime,targetSelector:u,resourceUrl:Z0(l)}),o=l.size}});return{stop:()=>{i(),a.unsubscribe()}}}function Z0(e){return e.url===""?void 0:e.url}function Ul(e,t=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:z};if(jt(H.VISIBILITY_STATE)){const s=performance.getEntriesByType(H.VISIBILITY_STATE).find(i=>i.name==="hidden");if(s)return{timeStamp:s.startTime,stop:z}}let n=1/0;const{stop:r}=Ne(e,t,["pagehide","visibilitychange"],s=>{(s.type==="pagehide"||document.visibilityState==="hidden")&&(n=s.timeStamp,r())},{capture:!0});return{get timeStamp(){return n},stop:r}}function X0(e,t,n){const r={},{stop:s}=W0(e,u=>{t(u.loadEvent),r.navigationTimings=u,n()}),i=Ul(e),{stop:o}=H0(e,i,u=>{r.firstContentfulPaint=u,n()}),{stop:a}=J0(e,i,window,u=>{r.largestContentfulPaint=u,n()}),{stop:c}=j0(e,i,u=>{r.firstInput=u,n()});function l(){s(),o(),a(),c(),i.stop()}return{stop:l,initialViewMetrics:r}}function Q0(e,t,n){if(!sy())return{stop:z};let r=0,s;n({value:0});const i=ry(),o=tt(e,{type:H.LAYOUT_SHIFT,buffered:!0}).subscribe(a=>{var c;for(const l of a){if(l.hadRecentInput||l.startTime<t)continue;const{cumulatedValue:u,isMaxValue:d}=i.update(l);if(d){const f=ey(l.sources);s={target:f!=null&&f.node?new WeakRef(f.node):void 0,time:me(t,l.startTime),previousRect:f==null?void 0:f.previousRect,currentRect:f==null?void 0:f.currentRect,devicePixelRatio:window.devicePixelRatio}}if(u>r){r=u;const f=(c=s==null?void 0:s.target)===null||c===void 0?void 0:c.deref();n({value:Vr(r,4),targetSelector:f&&or(f,e.actionNameAttribute),time:s==null?void 0:s.time,previousRect:s!=null&&s.previousRect?$l(s.previousRect):void 0,currentRect:s!=null&&s.currentRect?$l(s.currentRect):void 0,devicePixelRatio:s==null?void 0:s.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function ey(e){return e.find(t=>!!t.node&&bn(t.node))}function $l({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const ty=5*Se,ny=Se;function ry(){let e=0,t,n,r=0;return{update:s=>{const i=t===void 0||s.startTime-n>=ny||s.startTime-t>=ty;let o;return i?(t=n=s.startTime,r=e=s.value,o=!0):(e+=s.value,n=s.startTime,o=s.value>r,o&&(r=s.value)),{cumulatedValue:e,isMaxValue:o}}}}function sy(){return jt(H.LAYOUT_SHIFT)&&"WeakRef"in window}let fs,Vl=0,Ai=1/0,Ri=0;function iy(){"interactionCount"in performance||fs||(fs=new window.PerformanceObserver(U(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(Ai=Math.min(Ai,n.interactionId),Ri=Math.max(Ri,n.interactionId),Vl=(Ri-Ai)/7+1)})})),fs.observe({type:"event",buffered:!0,durationThreshold:0}))}const zl=()=>fs?Vl:window.performance.interactionCount||0,Hl=10,oy=1*Oe;function ay(e,t,n){if(!uy())return{getInteractionToNextPaint:()=>{},setViewEnd:z,stop:z};const{getViewInteractionCount:r,stopViewInteractionCount:s}=ly(n);let i=1/0;const o=cy(r);let a=-1,c,l;function u(h){for(const g of h)g.interactionId&&g.startTime>=t&&g.startTime<=i&&o.process(g);const p=o.estimateP98Interaction();p&&p.duration!==a&&(a=p.duration,l=me(t,p.startTime),c=p0(p.startTime),!c&&p.target&&bn(p.target)&&(c=or(p.target,e.actionNameAttribute)))}const d=tt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(u),f=tt(e,{type:H.EVENT,durationThreshold:40,buffered:!0}).subscribe(u);return{getInteractionToNextPaint:()=>{if(a>=0)return{value:Math.min(a,oy),targetSelector:c,time:l};if(r())return{value:0}},setViewEnd:h=>{i=h,s()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function cy(e){const t=[];function n(){t.sort((r,s)=>s.duration-r.duration).splice(Hl)}return{process(r){const s=t.findIndex(o=>r.interactionId===o.interactionId),i=t[t.length-1];s!==-1?r.duration>t[s].duration&&(t[s]=r,n()):(t.length<Hl||r.duration>i.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function ly(e){iy();const t=e==="initial_load"?0:zl();let n={stopped:!1};function r(){return zl()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function uy(){return jt(H.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function dy(e,t,n,r,s,i,o){let a=s==="initial_load",c=!0;const l=[],u=Ul(r);function d(){if(!c&&!a&&l.length>0){const h=Math.max(...l);h<u.timeStamp&&o(h)}}const{stop:f}=vi(e,t,n,r,h=>{c&&(c=!1,h.hadActivity&&l.push(me(i.timeStamp,h.end)),d())});return{stop:()=>{f(),u.stop()},setLoadEvent:h=>{a&&(a=!1,l.push(h),d())}}}function jl(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Ii(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let ki;function Wl(e){return ki||(ki=fy(e)),ki}function fy(e){return new G(t=>{const{throttled:n}=wt(()=>{t.notify(ps())},200);return Z(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function ps(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const py=Se;function hy(e,t,n,r=my(e)){let s=0,i=0,o=0;const a=r.subscribe(({scrollDepth:c,scrollTop:l,scrollHeight:u})=>{let d=!1;if(c>s&&(s=c,d=!0),u>i){i=u;const f=ze();o=me(t.relative,f),d=!0}d&&n({maxDepth:Math.min(s,i),maxDepthScrollTop:l,maxScrollHeight:i,maxScrollHeightTime:o})});return{stop:()=>a.unsubscribe()}}function gy(){const e=Ii(),{height:t}=ps(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function my(e,t=py){return new G(n=>{function r(){n.notify(gy())}if(window.ResizeObserver){const s=wt(r,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,o=new ResizeObserver(U(s.throttled));i&&o.observe(i);const a=Z(e,window,"scroll",s.throttled,{passive:!0});return()=>{s.cancel(),o.disconnect(),a.stop()}}})}function yy(e,t,n,r,s,i,o){const a={},{stop:c,setLoadEvent:l}=dy(e,t,n,r,i,o,g=>{a.loadingTime=g,s()}),{stop:u}=hy(r,o,g=>{a.scroll=g}),{stop:d}=Q0(r,o.relative,g=>{a.cumulativeLayoutShift=g,s()}),{stop:f,getInteractionToNextPaint:h,setViewEnd:p}=ay(r,o.relative,i);return{stop:()=>{c(),d(),u()},stopINPTracking:f,setLoadEvent:l,setViewEnd:p,getCommonViewMetrics:()=>(a.interactionToNextPaint=h(),a)}}const by=3e3,wy=5*Oe,Sy=5*Oe;function _y(e,t,n,r,s,i,o,a){const c=new Set;let l=d("initial_load",Ma(),a);f();let u;o&&(u=h(i));function d(p,g,m){const w=vy(t,n,r,s,e,p,g,m);return c.add(w),w.stopObservable.subscribe(()=>{c.delete(w)}),w}function f(){t.subscribe(10,()=>{l=d("route_change",void 0,{name:l.name,service:l.service,version:l.version,context:l.contextManager.getContext()})}),t.subscribe(9,()=>{l.end({sessionIsActive:!1})})}function h(p){return p.subscribe(({oldLocation:g,newLocation:m})=>{Cy(g,m)&&(l.end(),l=d("route_change"))})}return{addTiming:(p,g=de())=>{l.addTiming(p,g)},startView:(p,g)=>{l.end({endClocks:g}),l=d("route_change",g,p)},setViewContext:p=>{l.contextManager.setContext(p)},setViewContextProperty:(p,g)=>{l.contextManager.setContextProperty(p,g)},setViewName:p=>{l.setViewName(p)},getViewContext:()=>l.contextManager.getContext(),stop:()=>{u&&u.unsubscribe(),l.end(),c.forEach(p=>p.stop())}}}function vy(e,t,n,r,s,i,o=xe(),a){const c=ye(),l=new G,u={};let d=0,f;const h=Gn(s),p=ss();let g=!0,m=a==null?void 0:a.name;const w=(a==null?void 0:a.service)||r.service,v=(a==null?void 0:a.version)||r.version,b=a==null?void 0:a.context;b&&p.setContext(b);const _={id:c,name:m,startClocks:o,service:w,version:v,context:b};e.notify(1,_),e.notify(2,_);const{throttled:k,cancel:x}=wt(ne,by,{leading:!1}),{setLoadEvent:y,setViewEnd:R,stop:C,stopINPTracking:I,getCommonViewMetrics:A}=yy(e,t,n,r,X,i,o),{stop:O,initialViewMetrics:P}=i==="initial_load"?X0(r,y,X):{stop:z,initialViewMetrics:{}},{stop:N,eventCounts:Q}=V0(e,c,X),ge=rn(ne,wy),$e=e.subscribe(11,ee=>{ee.reason===mn.UNLOADING&&ne()});ne(),p.changeObservable.subscribe(X);function qe(){e.notify(3,{id:c,name:m,context:p.getContext(),startClocks:o})}function X(){qe(),k()}function ne(){x(),qe(),d+=1;const ee=f===void 0?de():f.timeStamp;e.notify(4,{customTimings:u,documentVersion:d,id:c,name:m,service:w,version:v,context:p.getContext(),loadingType:i,location:h,startClocks:o,commonViewMetrics:A(),initialViewMetrics:P,duration:me(o.timeStamp,ee),isActive:f===void 0,sessionIsActive:g,eventCounts:Q})}return{get name(){return m},service:w,version:v,contextManager:p,stopObservable:l,end(ee={}){var Re,ve;f||(f=(Re=ee.endClocks)!==null&&Re!==void 0?Re:xe(),g=(ve=ee.sessionIsActive)!==null&&ve!==void 0?ve:!0,e.notify(5,{endClocks:f}),e.notify(6,{endClocks:f}),jr(ge),R(f.relative),C(),$e.unsubscribe(),ne(),fe(()=>{this.stop()},Sy))},stop(){O(),N(),I(),l.notify()},addTiming(ee,Re){if(f)return;const ve=Hp(Re)?Re:me(o.timeStamp,Re);u[Ey(ee)]=ve,X()},setViewName(ee){m=ee,ne()}}}function Ey(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&V.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Cy(e,t){return e.pathname!==t.pathname||!xy(t.hash)&&ql(t.hash)!==ql(e.hash)}function xy(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function ql(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Ty(e,t,n,r,s,i,o,a,c,l){return e.subscribe(4,u=>e.notify(12,Ay(u,n,a))),t.register(0,({startTime:u,eventType:d})=>{const{service:f,version:h,id:p,name:g,context:m}=c.findView(u);return{type:d,service:f,version:h,context:m,view:{id:p,name:g}}}),_y(r,e,s,i,n,o,!n.trackViewsManually,l)}function Ay(e,t,n){var r,s,i,o,a,c,l,u,d,f,h,p,g,m,w,v,b,_;const k=n.getReplayStats(e.id),x=(s=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||s===void 0?void 0:s.devicePixelRatio,y={_dd:{document_version:e.documentVersion,replay_stats:k,cls:x?{device_pixel_ratio:x}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:"view",view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:B((o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.time),cumulative_layout_shift_target_selector:(a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.targetSelector,first_byte:B((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:B((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.domComplete),dom_content_loaded:B((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domContentLoaded),dom_interactive:B((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:B(e.initialViewMetrics.firstContentfulPaint),first_input_delay:B((f=e.initialViewMetrics.firstInput)===null||f===void 0?void 0:f.delay),first_input_time:B((h=e.initialViewMetrics.firstInput)===null||h===void 0?void 0:h.time),first_input_target_selector:(p=e.initialViewMetrics.firstInput)===null||p===void 0?void 0:p.targetSelector,interaction_to_next_paint:B((g=e.commonViewMetrics.interactionToNextPaint)===null||g===void 0?void 0:g.value),interaction_to_next_paint_time:B((m=e.commonViewMetrics.interactionToNextPaint)===null||m===void 0?void 0:m.time),interaction_to_next_paint_target_selector:(w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:B((v=e.initialViewMetrics.largestContentfulPaint)===null||v===void 0?void 0:v.value),largest_contentful_paint_target_selector:(b=e.initialViewMetrics.largestContentfulPaint)===null||b===void 0?void 0:b.targetSelector,load_event:B((_=e.initialViewMetrics.navigationTimings)===null||_===void 0?void 0:_.loadEvent),loading_time:sl(B(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Ry(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:B(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:B(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:k?!0:void 0,is_active:e.sessionIsActive?void 0:!1},privacy:{replay_level:t.defaultPrivacyLevel}};return Lt(e.customTimings)||(y.view.custom_timings=qp(e.customTimings,B)),{rawRumEvent:y,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Ry({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:s}){return{cls:e&&{score:e.value,timestamp:B(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:B(n)},fid:r&&{duration:B(r.delay),timestamp:B(r.time),target_selector:r.targetSelector},inp:t&&{duration:B(t.value),timestamp:B(t.time),target_selector:t.targetSelector},lcp:s&&{timestamp:B(s.value),target_selector:s.targetSelector,resource_url:s.resourceUrl}}}const Iy="rum";function ky(e,t,n){const r=zg(e,Iy,s=>Py(e,s),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:s,newState:i})=>{if(!s.forcedReplay&&i.forcedReplay){const o=r.findSession();o&&(o.isReplayForced=!0)}}),{findTrackedSession:s=>{const i=r.findSession(s);if(!(!i||!Kl(i.trackingType)))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function Oy(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Ac("records")?1:0};return{findTrackedSession:()=>e,expire:z,expireObservable:new G,setForcedReplay:z}}function Py(e,t){let n;return Ly(t)?n=t:yt(e.sessionSampleRate)?yt(e.sessionReplaySampleRate)?n="1":n="2":n="0",{trackingType:n,isTracked:Kl(n)}}function Ly(e){return e==="0"||e==="1"||e==="2"}function Kl(e){return e==="2"||e==="1"}function Ny(e,t,n,r,s,i,o){const a=e.replica,c=cm(e,{endpoint:e.rumEndpointBuilder,encoder:o(2)},a&&{endpoint:a.rumEndpointBuilder,transformMessage:l=>Ge(l,{application:{id:a.applicationId}}),encoder:o(3)},r,s,i);return t.subscribe(13,l=>{l.type==="view"?c.upsert(l,l.view.id):c.add(l)}),n.subscribe(l=>c.add(l,Ng(e))),c}function My(e){const t=gn();e.subscribe(13,n=>{t.send("rum",n)})}const Dy=Mt;function Fy(e,t,n,r){const s=hn({expireDelay:Dy});let i;e.subscribe(1,({startClocks:c})=>{const l=r.href;s.add(a({url:l,referrer:i||document.referrer}),c.relative),i=l}),e.subscribe(6,({endClocks:c})=>{s.closeActive(c.relative)});const o=n.subscribe(({newLocation:c})=>{const l=s.find();if(l){const u=ze();s.closeActive(u),s.add(a({url:c.href,referrer:l.referrer}),u)}});function a({url:c,referrer:l}){return{url:c,referrer:l}}return t.register(0,({startTime:c,eventType:l})=>{const{url:u,referrer:d}=s.find(c);return{type:l,view:{url:u,referrer:d}}}),{findUrl:c=>s.find(c),getAllEntries:()=>s.getAllEntries(),getDeletedEntries:()=>s.getDeletedEntries(),stop:()=>{o.unsubscribe(),s.stop()}}}function By(e,t){let n=Gn(t);return new G(r=>{const{stop:s}=Uy(e,o),{stop:i}=$y(e,o);function o(){if(n.href===t.href)return;const a=Gn(t);r.notify({newLocation:a,oldLocation:n}),n=a}return()=>{s(),i()}})}function Uy(e,t){const{stop:n}=Le(Gl("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:r}=Le(Gl("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:s}=Z(e,window,"popstate",t);return{stop:()=>{n(),r(),s()}}}function $y(e,t){return Z(e,window,"hashchange",t)}function Gl(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Vy=Mt;function zy(e,t,n){const r=hn({expireDelay:Vy});return e.subscribe(1,({startClocks:s})=>{r.add({},s.relative)}),e.subscribe(6,({endClocks:s})=>{r.closeActive(s.relative)}),t.register(0,({startTime:s,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat(["view","error"]).includes(i))return;const a=r.find(s);if(!(!a||Lt(a)))return{type:i,feature_flags:a}}),{addFeatureFlagEvaluation:(s,i)=>{const o=r.find();o&&(o[s]=i)}}}const Hy=10*Se;let Sn,Oi;function jy(e,t,n,r){t.enabled&&yt(e.customerDataTelemetrySampleRate)&&(Zl(),Oi=!1,n.subscribe(13,()=>{Oi=!0}),r.subscribe(({bytesCount:i,messagesCount:o})=>{Oi&&(Sn.batchCount+=1,Jl(Sn.batchBytesCount,i),Jl(Sn.batchMessagesCount,o))}),rn(Wy,Hy))}function Wy(){Sn.batchCount!==0&&(ft("Customer data measures",Sn),Zl())}function Yl(){return{min:1/0,max:0,sum:0}}function Jl(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function Zl(){Sn={batchCount:0,batchBytesCount:Yl(),batchMessagesCount:Yl()}}const qy=4e3,Ky=500,Gy=Mt;function Yy(e,t,n=Ky){const r=hn({expireDelay:Gy,maxEntries:qy});let s;o(Xl(),ze());const{stop:i}=Ne(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],c=>{o(Zy(c),c.timeStamp)},{capture:!0});function o(c,l=ze()){c!==s&&(s=c,r.closeActive(l),r.add({state:s,startTime:l},l))}function a(c,l,u){return r.findAll(l,u).some(d=>d.state===c)}return e.register(0,({startTime:c,duration:l=0,eventType:u})=>{if(u==="view"){const d=r.findAll(c,l);return{type:u,_dd:{page_states:Jy(d,c,n)}}}if(u==="action"||u==="error")return{type:u,view:{in_foreground:a("active",c,0)}}}),{wasInPageStateDuringPeriod:a,addPageState:o,stop:()=>{i(),r.stop()}}}function Jy(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:s})=>({state:r,start:B(me(t,s))}))}function Zy(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":Xl()}function Xl(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Xy(e){let t;const n=requestAnimationFrame(U(()=>{t=ps()})),r=Wl(e).subscribe(s=>{t=s}).unsubscribe;return{get:()=>t?{viewport:t}:void 0,stop:()=>{r(),n&&cancelAnimationFrame(n)}}}const Qy=Se;function eb(e){return new G(t=>tb(e,n=>t.notify(n)))}function tb(e,t){const n=Yn(document.cookie,e),r=rn(()=>{const s=Yn(document.cookie,e);s!==n&&t(s)},Qy);return()=>jr(r)}const Ql="datadog-ci-visibility-test-execution-id";function nb(e,t=eb(Ql)){var n;let r=St(Ql)||((n=window.Cypress)===null||n===void 0?void 0:n.env("traceId"));const s=t.subscribe(i=>{r=i});return e.register(0,({eventType:i})=>{if(typeof r=="string")return{type:i,session:{type:"ci_test"},ci_test:{test_execution_id:r}}}),{stop:()=>{s.unsubscribe()}}}function rb(e,t){const n=tt(t,{type:H.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const s of r){const i=zr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-animation-frame",duration:B(s.duration),blocking_duration:B(s.blockingDuration),first_ui_event_timestamp:B(s.firstUIEventTimestamp),render_start:B(s.renderStart),style_and_layout_start:B(s.styleAndLayoutStart),start_time:B(s.startTime),scripts:s.scripts.map(a=>({duration:B(a.duration),pause_duration:B(a.pauseDuration),forced_style_and_layout_duration:B(a.forcedStyleAndLayoutDuration),start_time:B(a.startTime),execution_start:B(a.executionStart),source_url:a.sourceURL,source_function_name:a.sourceFunctionName,source_char_position:a.sourceCharPosition,invoker:a.invoker,invoker_type:a.invokerType,window_attribution:a.windowAttribution}))},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop:()=>n.unsubscribe()}}function sb(e,t){const n=tt(t,{type:H.LONG_TASK,buffered:!0}).subscribe(r=>{for(const s of r){if(s.entryType!==H.LONG_TASK||!t.trackLongTasks)break;const i=zr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-task",duration:B(s.duration)},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop(){n.unsubscribe()}}}function ib(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const s=(e[t]||[]).map(i=>i(n));return Ge(...s)}}}function ob(e){e.register(0,({eventType:t})=>{const n=Fm(),r=Bm();if(!(!n||!r))return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:Pc()}}})}function ab(e,t,n){const r=ci(e),s=n(r);return Ys(t).forEach(([i,o])=>Pi(e,r,i.split(/\.|(?=\[\])/),o)),s}function Pi(e,t,n,r){const[s,...i]=n;if(s==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((o,a)=>Pi(o,t[a],i,r));return}if(!(!eu(e)||!eu(t))){if(i.length>0)return Pi(e[s],t[s],i,r);cb(e,s,t[s],r)}}function cb(e,t,n,r){const s=$t(n);s===r?e[t]=ie(n):r==="object"&&(s==="undefined"||s==="null")&&(e[t]={})}function eu(e){return $t(e)==="object"}const _n={"view.name":"string","view.url":"string","view.referrer":"string"},vn={context:"object"},Li={service:"string",version:"string"};let tu;function lb(e,t,n,r,s,i,o,a,c){tu={view:{"view.performance.lcp.resource_url":"string",...vn,..._n},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...vn,..._n,...Li},resource:{"resource.url":"string",...es(Ut.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...vn,..._n,...Li},action:{"action.target.name":"string",...vn,..._n,...Li},long_task:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...vn,..._n},vital:{...vn,..._n}};const l={error:di("error",e.eventRateLimiterThreshold,c),action:di("action",e.eventRateLimiterThreshold,c),vital:di("vital",e.eventRateLimiterThreshold,c)};t.subscribe(12,({startTime:u,duration:d,rawRumEvent:f,domainContext:h,customerContext:p})=>{const g=s.findView(u),m=i.findUrl(u),w=r.findTrackedSession(u);if(w&&g&&!m&&es(Ut.MISSING_URL_CONTEXT_TELEMETRY)&&ft("Missing URL entry",{debug:{eventType:f.type,startTime:u,urlEntries:i.getAllEntries(),urlDeletedEntries:i.getDeletedEntries(),viewEntries:s.getAllEntries(),viewDeletedEntries:s.getDeletedEntries()}}),w&&g&&m){const v=a(),b={_dd:{format_version:2,drift:Vp(),configuration:{session_sample_rate:Vr(e.sessionSampleRate,3),session_replay_sample_rate:Vr(e.sessionReplaySampleRate,3)},browser_sdk_version:zt()?"6.6.3":void 0},application:{id:e.applicationId},date:de(),source:"browser",session:{id:w.id,type:"user"},display:o.get(),connectivity:hc(),context:v.context},_=Ge(b,n.triggerHook(0,{eventType:f.type,startTime:u,duration:d}),{context:p},f);"has_replay"in _.session||(_.session.has_replay=v.hasReplay),_.type==="view"&&(_.session.sampled_for_replay=w.sessionReplay===1),w.anonymousId&&!v.user.anonymous_id&&e.trackAnonymousUser&&(v.user.anonymous_id=w.anonymousId),Lt(v.user)||(_.usr=v.user),!Lt(v.account)&&v.account.id&&(_.account=v.account),ub(_,e.beforeSend,h,l)&&(Lt(_.context)&&delete _.context,t.notify(13,_))}})}function ub(e,t,n,r){var s;if(t){const o=ab(e,tu[e.type],a=>t(a,n));if(o===!1&&e.type!=="view")return!1;o===!1&&V.warn("Can't dismiss view events using beforeSend!")}return!((s=r[e.type])===null||s===void 0?void 0:s.isLimitReached())}function db(e,t,n,r){return{context:e.getContext(),user:t.getContext(),account:n.getContext(),hasReplay:r.isRecording()?!0:void 0}}function fb(e,t,n,r,s,i,o){const a=[],c=new g1,l=ib();c.subscribe(13,ce=>ai("rum",ce));const u=pb(e);u.setContextProvider(()=>{var ce,Pn;return{application:{id:e.applicationId},session:{id:(ce=p.findTrackedSession())===null||ce===void 0?void 0:ce.id},view:{id:(Pn=v.findView())===null||Pn===void 0?void 0:Pn.id},action:{id:A.findActionId()}}});const d=ce=>{c.notify(14,{error:ce}),ft("Error reported to customer",{"error.message":ce.message})},f=im(e),h=f.subscribe(ce=>{c.notify(11,ce)});a.push(()=>h.unsubscribe());const p=zt()?Oy():ky(e,c,i);if(zt())My(c);else{const ce=Ny(e,c,u.observable,d,f,p.expireObservable,s);a.push(()=>ce.stop()),jy(e,u,c,ce.flushObservable)}const g=f1(),m=By(e,location),w=Yy(l,e),v=y1(c),b=Fy(c,l,m,location),_=zy(c,l,e),{observable:k,stop:x}=p1();a.push(x);const y=i1(e),R=o1(e),C=a1(e),I=()=>db(y,R,C,t),{actionContexts:A,addAction:O,stop:P}=hb(c,l,e,p,w,g,k,b,v,I,d);a.push(P),Lg();const{addTiming:N,startView:Q,setViewName:ge,setViewContext:$e,setViewContextProperty:qe,getViewContext:X,stop:ne}=Ty(c,l,e,location,g,k,m,t,v,r);a.push(ne);const{stop:ee}=M0(c,e,w);if(a.push(ee),e.trackLongTasks)if(jt(H.LONG_ANIMATION_FRAME)){const{stop:ce}=rb(c,e);a.push(ce)}else sb(c,e);const{addError:Re}=E0(c,e);x1(c,e,p,I);const ve=$m(c,w,o),Co=h1(e.applicationId,p,v,A,b);return a.push(()=>n.stop()),{addAction:O,addError:Re,addTiming:N,addFeatureFlagEvaluation:_.addFeatureFlagEvaluation,startView:Q,setViewContext:$e,setViewContextProperty:qe,getViewContext:X,setViewName:ge,lifeCycle:c,viewHistory:v,session:p,stopSession:()=>p.expire(),getInternalContext:Co.get,startDurationVital:ve.startDurationVital,stopDurationVital:ve.stopDurationVital,addDurationVital:ve.addDurationVital,globalContext:y,userContext:R,accountContext:C,stop:()=>{a.forEach(ce=>ce())}}}function pb(e){const t=Og("browser-rum-sdk",e);if(zt()){const n=gn();t.observable.subscribe(r=>n.send("internal_telemetry",r))}return t}function hb(e,t,n,r,s,i,o,a,c,l,u){const d=S0(e,t,i,o,n),f=Xy(n),h=nb(t);return ob(t),lb(n,e,t,r,c,a,f,l,u),{pageStateHistory:s,addAction:d.addAction,actionContexts:d.actionContexts,stop:()=>{d.stop(),h.stop(),f.stop(),c.stop(),s.stop(),a.stop()}}}function gb(e,{session:t,viewContext:n,errorType:r}){const s=t?t.id:"no-session-id",i=[];r!==void 0&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const o=mb(e),a=`/rum/replay/sessions/${s}`;return`${o}${a}?${i.join("&")}`}function mb(e){const t=e.site,n=e.subdomain||yb(e);return`https://${n?`${n}.`:""}${t}`}function yb(e){switch(e.site){case Bt:case kh:return"app";case nc:return"dd";default:return}}const bb=1e3;let He;function wb(e){return hs(e).segments_count}function Sb(e){hs(e).segments_count+=1}function _b(e){hs(e).records_count+=1}function vb(e,t){hs(e).segments_total_raw_size+=t}function Eb(e){return He==null?void 0:He.get(e)}function hs(e){He||(He=new Map);let t;return He.has(e)?t=He.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},He.set(e,t),He.size>bb&&Cb()),t}function Cb(){if(!He)return;const e=He.keys().next().value;e&&He.delete(e)}function nu(e,t,n){let r=0,s=[],i,o=0;const a=[],{stop:c}=Z(e,t,"message",({data:d})=>{if(d.type!=="wrote"||d.streamId!==n)return;r+=d.additionalBytesCount,s.push(d.result),i=d.trailer;const f=a.shift();f&&f.id===d.id?f.writeCallback?f.writeCallback(d.result.byteLength):f.finishCallback&&f.finishCallback():(c(),ft("Worker responses received out of order."))});function l(){const d=s.length===0?new Uint8Array(0):Wp(s.concat(i)),f={rawBytesCount:r,output:d,outputBytesCount:d.byteLength,encoding:"deflate"};return r=0,s=[],f}function u(){o>0&&(t.postMessage({action:"reset",streamId:n}),o=0)}return{isAsync:!0,get isEmpty(){return o===0},write(d,f){t.postMessage({action:"write",id:o,data:d,streamId:n}),a.push({id:o,writeCallback:f,data:d}),o+=1},finish(d){u(),a.length?(a.forEach(f=>{delete f.writeCallback}),a[a.length-1].finishCallback=()=>d(l())):d(l())},finishSync(){u();const d=a.map(f=>(delete f.writeCallback,delete f.finishCallback,f.data)).join("");return{...l(),pendingData:d}},estimateEncodedBytesCount(d){return d.length/8},stop(){c()}}}function Ni({configuredUrl:e,error:t,source:n,scriptType:r}){if(V.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&xb(t.message)){let s;e?s=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:s="Please make sure CSP is correctly configured.",V.error(`${s} See documentation at ${$r}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&li(t)}function xb(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Tb=30*Se;function ru(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=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]),n=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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},O={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"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},et=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-J)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=L(s.adler,h,o,l):2===s.state.wrap&&(s.adler=T(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},at=function(t,e){for(var a,n;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},nt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var it=[new rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(et(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)})),new rt(4,4,8,4,at),new rt(4,5,16,8,at),new rt(4,6,32,32,at),new rt(4,4,16,16,nt),new rt(8,16,32,32,nt),new rt(8,16,128,128,nt),new rt(8,32,128,256,nt),new rt(32,128,258,1024,nt),new rt(32,258,258,4096,nt)];function st(){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=8,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),V(this.dyn_ltree),V(this.dyn_dtree),V(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),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var ht=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=it[e.level].max_lazy,e.good_match=it[e.level].good_length,e.nice_match=it[e.level].nice_length,e.max_chain_length=it[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},lt=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(et(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(et(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):it[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},_t=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},ot=new Uint8Array(256),dt=0;dt<256;dt++)ot[dt]=dt>=252?6:dt>=248?5:dt>=240?4:dt>=224?3:dt>=192?2:1;ot[254]=ot[254]=1;var ut=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},ft=Object.prototype.toString;function ct(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var 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 ut,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new st;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,ht(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ft.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,et(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function pt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function gt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}ct.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ft.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=lt(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=_t(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ct.prototype.onData=function(t){this.chunks.push(t)},ct.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.6.3"};case"write":{let n=e.get(a.streamId);n||(n=new ct,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:gt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){pt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){pt(e,t)}}()})();'])))}let oe={status:0};function su(e,t,n,r=ru){switch(oe.status===0&&Ab(e,t,r),oe.status){case 1:return oe.initializationFailureCallbacks.push(n),oe.worker;case 3:return oe.worker}}function iu(){return oe.status}function Ab(e,t,n=ru){try{const r=n(e),{stop:s}=Z(e,r,"error",a=>{Mi(e,t,a)}),{stop:i}=Z(e,r,"message",({data:a})=>{a.type==="errored"?Mi(e,t,a.error,a.streamId):a.type==="initialized"&&Ib(a.version)});r.postMessage({action:"init"}),fe(()=>Rb(t),Tb),oe={status:1,worker:r,stop:()=>{s(),i()},initializationFailureCallbacks:[]}}catch(r){Mi(e,t,r)}}function Rb(e){oe.status===1&&(V.error(`${e} failed to start: a timeout occurred while initializing the Worker`),oe.initializationFailureCallbacks.forEach(t=>t()),oe={status:2})}function Ib(e){oe.status===1&&(oe={status:3,worker:oe.worker,stop:oe.stop,version:e})}function Mi(e,t,n,r){oe.status===1||oe.status===0?(Ni({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),oe.status===1&&oe.initializationFailureCallbacks.forEach(s=>s()),oe={status:2}):li(n,{worker_version:oe.status===3&&oe.version,stream_id:r})}function ou(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function kb(e,t,n,r){const s=t.findTrackedSession(),i=Ob(s,r),o=n.findView();return gb(e,{viewContext:o,errorType:i,session:s})}function Ob(e,t){if(!ou())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function Pb(e,t,n,r,s,i){let o=0,a;t.subscribe(9,()=>{(o===2||o===3)&&(u(),o=1)}),t.subscribe(10,()=>{o===1&&l()});const c=async()=>{const[d]=await Promise.all([s(),dm(e,"interactive")]);if(o!==2)return;const f=i();if(!f||!d){o=0;return}({stop:a}=d(t,e,n,r,f)),o=3};function l(d){const f=n.findTrackedSession();if(Lb(f,d)){o=1;return}Nb(o)||(o=2,c().catch(dt),Mb(f,d)&&n.setForcedReplay())}function u(){o===3&&(a==null||a()),o=0}return{start:l,stop:u,getSessionReplayLink(){return kb(e,n,r,o!==0)},isRecording:()=>o===3}}function Lb(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function Nb(e){return e===2||e===3}function Mb(e,t){return t&&t.force&&e.sessionReplay===0}function Db(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:z},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Fb(e,t){if(zt()&&!Ac("records")||!ou())return{start:z,stop:z,getReplayStats:()=>{},onRumStart:z,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=Db();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:s,isRecording:()=>iu()===3&&n.isRecording(),getReplayStats:i=>iu()===3?Eb(i):void 0};function s(i,o,a,c,l){let u;function d(){return u||(l??(l=su(o,"Datadog Session Replay",()=>{n.stop()},t)),l&&(u=nu(o,l,1))),u}n=Pb(o,i,a,c,e,d),r(o)&&n.start()}}async function Bb(e=Ub){try{return await e()}catch(t){Ni({error:t,source:"Recorder",scriptType:"module"})}}async function Ub(){return(await Promise.resolve().then(()=>ov)).startRecording}function $b(){return et().Profiler!==void 0}async function Vb(e=zb){try{return await e()}catch(t){Ni({error:t,source:"Profiler",scriptType:"module"})}}async function zb(){return(await Promise.resolve().then(()=>Sv)).createRumProfiler}function Hb(){let e;function t(n,r,s,i){!$b()||!yt(r.profilingSampleRate)||Vb().then(o=>{if(!o){ft("[DD_RUM] Failed to lazy load the RUM Profiler");return}e=o(r,n,s),e.start(i.findView())}).catch(dt)}return{onRumStart:t,stop:()=>{e==null||e.stop().catch(dt)}}}const jb=Fb(Bb),Wb=Hb(),Be=u1(fb,jb,Wb,{startDeflateWorker:su,createDeflateEncoder:nu});_g(et(),"DD_RUM",Be);const On=class On{init(){if(On.isInitialized){console.info("Tracker [DD]: already initialized");return}Be.init({applicationId:"3ea6bf90-69cc-42fe-9e69-d461f783221d",clientToken:"pub51a171e3f587fb85f6d3f0ed2bf8f531",site:"datadoghq.com",service:"astropay-payments-library",env:"production",version:"0.1.2",sessionSampleRate:50,sessionReplaySampleRate:10,defaultPrivacyLevel:"mask-user-input",trackViewsManually:!0,trackResources:!1,trackUserInteractions:!1,beforeSend:t=>this.filterEvents(t)}),Be.startView({name:"ap_cl_view_mounted"}),Be.startSessionReplayRecording(),On.isInitialized=!0,console.info("Tracker [DD]: initialized")}track(t,n){Be==null||Be.addAction(t,n||{})}trackError(t,n){Be==null||Be.addError(t,{context:n})}destroy(){console.info("Tracker [DD]: destroying"),typeof Be.stopSessionReplayRecording=="function"&&Be.stopSessionReplayRecording(),Be.addAction("ap_cl_view_unmounted",{reason:"component_destroyed"}),On.isInitialized=!1}filterEvents(t){var n,r,s;return!!(t.type==="view"&&((n=t.view.name)!=null&&n.startsWith("ap_cl_"))||t.type==="action"&&typeof((r=t.action.target)==null?void 0:r.name)=="string"&&t.action.target.name.startsWith("ap_cl_")||t.type==="error"&&((s=t.error)==null?void 0:s.source)==="custom")}};T(On,"isInitialized",!1);let Di=On,En=[];class je{static init(t){if(!t){console.info("Tracking disabled");return}En=[new Di],En.forEach(n=>n.init())}static trackEvent(t,n){En.forEach(r=>r.track(t,n))}static trackError(t,n){En.forEach(r=>r.trackError(t,n))}static destroy(){En.forEach(t=>t.destroy()),En=[]}}const he=class he{static init(t,n){if(!t)throw console.error('AstroPay Payments Library: Missing "app-id". Call init function first.'),new Error("app-id is required for authentication.");if(he.isInitialized){console.warn("AstroPay Payments Library: Already initialized.");return}he.token=t,je.init((n==null?void 0:n.tracking)??!0),$.init({theme:(n==null?void 0:n.theme)??"light",styles:(n==null?void 0:n.styles)??{}}),te.init({language:(n==null?void 0:n.language)??"en"}),Nn.init({environment:(n==null?void 0:n.environment)??"production",currencyMode:(n==null?void 0:n.currencyMode)??"iso"}),mt.init({appName:"ap-cl",baseURL:"https://partners-api.astropay.com/api",timeout:5e3}),je.trackEvent("ap_cl_init",{app_id:t,origin:window.location.origin}),he.isInitialized=!0}static registerComponent(t){he.components.add(t)}static unregisterComponent(t){he.components.delete(t)}static getToken(){if(!he.isInitialized){const t="AstroPay Payments Library: Not initialized.";throw console.error(t),new Error(t)}return he.token}static destroy(){he.isInitialized&&(he.components.forEach(t=>t.destroy()),he.components.clear(),he.isInitialized=!1,je.destroy(),he.token="")}static isLibInitialized(){return he.isInitialized}};T(he,"isInitialized",!1),T(he,"token"),T(he,"components",new Set);let rt=he;class ae{constructor({tag:t,elementId:n,styles:r}){T(this,"element");if(this.element=document.createElement(t),n&&this.element.setAttribute("id",n),r){const s=$.getStyles(),i=r(s);this.element.className=i}}addStyleClass(t){this.element.classList.add(t)}render(t){t instanceof ae?t.element.appendChild(this.element):t.appendChild(this.element)}destroy(){this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}function qb(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Kb(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Gb=function(){function e(n){var r=this;this._insertTag=function(s){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,i),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Kb(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var i=qb(s);try{i.insertRule(r,i.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),_e="-ms-",gs="-moz-",j="-webkit-",au="comm",Fi="rule",Bi="decl",Yb="@import",cu="@keyframes",Jb="@layer",Zb=Math.abs,ms=String.fromCharCode,Xb=Object.assign;function Qb(e,t){return be(e,0)^45?(((t<<2^be(e,0))<<2^be(e,1))<<2^be(e,2))<<2^be(e,3):0}function lu(e){return e.trim()}function ew(e,t){return(e=t.exec(e))?e[0]:e}function W(e,t,n){return e.replace(t,n)}function Ui(e,t){return e.indexOf(t)}function be(e,t){return e.charCodeAt(t)|0}function cr(e,t,n){return e.slice(t,n)}function st(e){return e.length}function $i(e){return e.length}function ys(e,t){return t.push(e),e}function tw(e,t){return e.map(t).join("")}var bs=1,Cn=1,uu=0,Me=0,le=0,xn="";function ws(e,t,n,r,s,i,o){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:bs,column:Cn,length:o,return:""}}function lr(e,t){return Xb(ws("",null,null,"",null,null,0),e,{length:-e.length},t)}function nw(){return le}function rw(){return le=Me>0?be(xn,--Me):0,Cn--,le===10&&(Cn=1,bs--),le}function Ue(){return le=Me<uu?be(xn,Me++):0,Cn++,le===10&&(Cn=1,bs++),le}function it(){return be(xn,Me)}function Ss(){return Me}function ur(e,t){return cr(xn,e,t)}function dr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function du(e){return bs=Cn=1,uu=st(xn=e),Me=0,[]}function fu(e){return xn="",e}function _s(e){return lu(ur(Me-1,Vi(e===91?e+2:e===40?e+1:e)))}function sw(e){for(;(le=it())&&le<33;)Ue();return dr(e)>2||dr(le)>3?"":" "}function iw(e,t){for(;--t&&Ue()&&!(le<48||le>102||le>57&&le<65||le>70&&le<97););return ur(e,Ss()+(t<6&&it()==32&&Ue()==32))}function Vi(e){for(;Ue();)switch(le){case e:return Me;case 34:case 39:e!==34&&e!==39&&Vi(le);break;case 40:e===41&&Vi(e);break;case 92:Ue();break}return Me}function ow(e,t){for(;Ue()&&e+le!==57;)if(e+le===84&&it()===47)break;return"/*"+ur(t,Me-1)+"*"+ms(e===47?e:Ue())}function aw(e){for(;!dr(it());)Ue();return ur(e,Me)}function cw(e){return fu(vs("",null,null,null,[""],e=du(e),0,[0],e))}function vs(e,t,n,r,s,i,o,a,c){for(var l=0,u=0,d=o,f=0,h=0,p=0,g=1,m=1,w=1,v=0,b="",_=s,k=i,x=r,y=b;m;)switch(p=v,v=Ue()){case 40:if(p!=108&&be(y,d-1)==58){Ui(y+=W(_s(v),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:y+=_s(v);break;case 9:case 10:case 13:case 32:y+=sw(p);break;case 92:y+=iw(Ss()-1,7);continue;case 47:switch(it()){case 42:case 47:ys(lw(ow(Ue(),Ss()),t,n),c);break;default:y+="/"}break;case 123*g:a[l++]=st(y)*w;case 125*g:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+u:w==-1&&(y=W(y,/\f/g,"")),h>0&&st(y)-d&&ys(h>32?hu(y+";",r,n,d-1):hu(W(y," ","")+";",r,n,d-2),c);break;case 59:y+=";";default:if(ys(x=pu(y,t,n,l,u,s,a,b,_=[],k=[],d),i),v===123)if(u===0)vs(y,t,x,x,_,i,d,a,k);else switch(f===99&&be(y,3)===110?100:f){case 100:case 108:case 109:case 115:vs(e,x,x,r&&ys(pu(e,x,x,0,0,s,a,b,s,_=[],d),k),s,k,d,a,r?_:k);break;default:vs(y,x,x,x,[""],k,0,a,k)}}l=u=h=0,g=w=1,b=y="",d=o;break;case 58:d=1+st(y),h=p;default:if(g<1){if(v==123)--g;else if(v==125&&g++==0&&rw()==125)continue}switch(y+=ms(v),v*g){case 38:w=u>0?1:(y+="\f",-1);break;case 44:a[l++]=(st(y)-1)*w,w=1;break;case 64:it()===45&&(y+=_s(Ue())),f=it(),u=d=st(b=y+=aw(Ss())),v++;break;case 45:p===45&&st(y)==2&&(g=0)}}return i}function pu(e,t,n,r,s,i,o,a,c,l,u){for(var d=s-1,f=s===0?i:[""],h=$i(f),p=0,g=0,m=0;p<r;++p)for(var w=0,v=cr(e,d+1,d=Zb(g=o[p])),b=e;w<h;++w)(b=lu(g>0?f[w]+" "+v:W(v,/&\f/g,f[w])))&&(c[m++]=b);return ws(e,t,n,s===0?Fi:a,c,l,u)}function lw(e,t,n){return ws(e,t,n,au,ms(nw()),cr(e,2,-2),0)}function hu(e,t,n,r){return ws(e,t,n,Bi,cr(e,0,r),cr(e,r+1,-1),r)}function Tn(e,t){for(var n="",r=$i(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function uw(e,t,n,r){switch(e.type){case Jb:if(e.children.length)break;case Yb:case Bi:return e.return=e.return||e.value;case au:return"";case cu:return e.return=e.value+"{"+Tn(e.children,r)+"}";case Fi:e.value=e.props.join(",")}return st(n=Tn(e.children,r))?e.return=e.value+"{"+n+"}":""}function dw(e){var t=$i(e);return function(n,r,s,i){for(var o="",a=0;a<t;a++)o+=e[a](n,r,s,i)||"";return o}}function fw(e){return function(t){t.root||(t=t.return)&&e(t)}}function pw(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var hw=function(t,n,r){for(var s=0,i=0;s=i,i=it(),s===38&&i===12&&(n[r]=1),!dr(i);)Ue();return ur(t,Me)},gw=function(t,n){var r=-1,s=44;do switch(dr(s)){case 0:s===38&&it()===12&&(n[r]=1),t[r]+=hw(Me-1,n,r);break;case 2:t[r]+=_s(s);break;case 4:if(s===44){t[++r]=it()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=ms(s)}while(s=Ue());return t},mw=function(t,n){return fu(gw(du(t),n))},gu=new WeakMap,yw=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!gu.get(r))&&!s){gu.set(t,!0);for(var i=[],o=mw(n,i),a=r.props,c=0,l=0;c<o.length;c++)for(var u=0;u<a.length;u++,l++)t.props[l]=i[c]?o[c].replace(/&\f/g,a[u]):a[u]+" "+o[c]}}},bw=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function mu(e,t){switch(Qb(e,t)){case 5103:return j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return j+e+gs+e+_e+e+e;case 6828:case 4268:return j+e+_e+e+e;case 6165:return j+e+_e+"flex-"+e+e;case 5187:return j+e+W(e,/(\w+).+(:[^]+)/,j+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return j+e+_e+"flex-item-"+W(e,/flex-|-self/,"")+e;case 4675:return j+e+_e+"flex-line-pack"+W(e,/align-content|flex-|-self/,"")+e;case 5548:return j+e+_e+W(e,"shrink","negative")+e;case 5292:return j+e+_e+W(e,"basis","preferred-size")+e;case 6060:return j+"box-"+W(e,"-grow","")+j+e+_e+W(e,"grow","positive")+e;case 4554:return j+W(e,/([^-])(transform)/g,"$1"+j+"$2")+e;case 6187:return W(W(W(e,/(zoom-|grab)/,j+"$1"),/(image-set)/,j+"$1"),e,"")+e;case 5495:case 3959:return W(e,/(image-set\([^]*)/,j+"$1$`$1");case 4968:return W(W(e,/(.+:)(flex-)?(.*)/,j+"box-pack:$3"+_e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+j+e+e;case 4095:case 3583:case 4068:case 2532:return W(e,/(.+)-inline(.+)/,j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(st(e)-1-t>6)switch(be(e,t+1)){case 109:if(be(e,t+4)!==45)break;case 102:return W(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+gs+(be(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ui(e,"stretch")?mu(W(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(be(e,t+1)!==115)break;case 6444:switch(be(e,st(e)-3-(~Ui(e,"!important")&&10))){case 107:return W(e,":",":"+j)+e;case 101:return W(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j+(be(e,14)===45?"inline-":"")+"box$3$1"+j+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(be(e,t+11)){case 114:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+_e+W(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return j+e+_e+e+e}return e}var ww=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case Bi:t.return=mu(t.value,t.length);break;case cu:return Tn([lr(t,{value:W(t.value,"@","@"+j)})],s);case Fi:if(t.length)return tw(t.props,function(i){switch(ew(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Tn([lr(t,{props:[W(i,/:(read-\w+)/,":"+gs+"$1")]})],s);case"::placeholder":return Tn([lr(t,{props:[W(i,/:(plac\w+)/,":"+j+"input-$1")]}),lr(t,{props:[W(i,/:(plac\w+)/,":"+gs+"$1")]}),lr(t,{props:[W(i,/:(plac\w+)/,_e+"input-$1")]})],s)}return""})}},Sw=[ww],_w=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var s=t.stylisPlugins||Sw,i={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),w=1;w<m.length;w++)i[m[w]]=!0;a.push(g)});var c,l=[yw,bw];{var u,d=[uw,fw(function(g){u.insert(g)})],f=dw(l.concat(s,d)),h=function(m){return Tn(cw(m),f)};c=function(m,w,v,b){u=v,h(m?m+"{"+w.styles+"}":w.styles),b&&(p.inserted[w.name]=!0)}}var p={key:n,sheet:new Gb({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return p.sheet.hydrate(a),p};function vw(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Ew={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Cw=/[A-Z]|^ms/g,xw=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yu=function(t){return t.charCodeAt(1)===45},bu=function(t){return t!=null&&typeof t!="boolean"},zi=pw(function(e){return yu(e)?e:e.replace(Cw,"-$&").toLowerCase()}),wu=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(xw,function(r,s,i){return Ct={name:s,styles:i,next:Ct},s})}return Ew[t]!==1&&!yu(t)&&typeof n=="number"&&n!==0?n+"px":n};function Es(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return Ct={name:s.name,styles:s.styles,next:Ct},s.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)Ct={name:o.name,styles:o.styles,next:Ct},o=o.next;var a=i.styles+";";return a}return Tw(e,t,n)}}var c=n;if(t==null)return c;var l=t[c];return l!==void 0?l:c}function Tw(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=Es(e,t,n[s])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=i+"{"+t[a]+"}":bu(a)&&(r+=zi(i)+":"+wu(i,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)bu(o[c])&&(r+=zi(i)+":"+wu(i,o[c])+";");else{var l=Es(e,t,o);switch(i){case"animation":case"animationName":{r+=zi(i)+":"+l+";";break}default:r+=i+"{"+l+"}"}}}return r}var Su=/label:\s*([^\s;{]+)\s*(;|$)/g,Ct;function Hi(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";Ct=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,s+=Es(n,t,i);else{var o=i;s+=o[0]}for(var a=1;a<e.length;a++)if(s+=Es(n,t,e[a]),r){var c=i;s+=c[a]}Su.lastIndex=0;for(var l="",u;(u=Su.exec(s))!==null;)l+="-"+u[1];var d=vw(s)+l;return{name:d,styles:s,next:Ct}}function _u(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var Aw=function(t,n,r){var s=t.key+"-"+n.name;t.registered[s]===void 0&&(t.registered[s]=n.styles)},Rw=function(t,n,r){Aw(t,n);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+s:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function vu(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Eu(e,t,n){var r=[],s=_u(e,r,n);return r.length<2?n:s+t(r)}var Iw=function(t){var n=_w(t);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered,void 0);return Rw(n,d),n.key+"-"+d.name},s=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered),f="animation-"+d.name;return vu(n,{name:d.name,styles:"@keyframes "+f+"{"+d.styles+"}"}),f},i=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=Hi(l,n.registered);vu(n,d)},o=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];return Eu(n.registered,r,kw(l))};return{css:r,cx:o,injectGlobal:i,keyframes:s,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:_u.bind(null,n.registered),merge:Eu.bind(null,n.registered,r)}},kw=function e(t){for(var n="",r=0;r<t.length;r++){var s=t[r];if(s!=null){var i=void 0;switch(typeof s){case"boolean":break;case"object":{if(Array.isArray(s))i=e(s);else{i="";for(var o in s)s[o]&&o&&(i&&(i+=" "),i+=o)}break}default:i=s}i&&(n&&(n+=" "),n+=i)}}return n},ji=Iw({key:"css"}),Ow=ji.cx,fr=ji.keyframes,K=ji.css;const Pw=(e,t)=>K`
|
|
8
|
+
*/class Wo{static getParser(t,n=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new jo(t,n)}static parse(t){return new jo(t).getResult()}static get BROWSER_MAP(){return Ho}static get ENGINE_MAP(){return bt}static get OS_MAP(){return xe}static get PLATFORMS_MAP(){return se}}var $n=(e=>(e.IOS="IOS",e.ANDROID="ANDROID",e.DESKTOP="DESKTOP",e))($n||{}),qo=(e=>(e.FIREFOX="Firefox",e.CHROME="Chrome",e.SAFARI="Safari",e.EDGE="Edge",e.OPERA="Opera",e))(qo||{});const Ko=()=>{const t=Wo.getParser(window.navigator.userAgent).getOSName().toUpperCase();return t&&Object.values($n).includes(t)?t:$n.DESKTOP},lf=()=>{const e=Ko();return e===$n.ANDROID||e===$n.IOS},uf=e=>{const t=Wo.getParser(window.navigator.userAgent).getBrowserName();return Array.isArray(e)?e.includes(t):t===e},df=e=>e.toLowerCase().replace(/(?:^|[^a-zA-Z0-9]+)([a-zA-Z0-9])/g,(t,n,r)=>r===0?n.toLowerCase():n.toUpperCase()),ff=e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").toLowerCase(),Go=e=>{const t=JSON.stringify(e);return btoa(t)},Qt=Array.isArray,dt=e=>e!==null&&typeof e=="object"&&!Qt(e),xr=e=>Object.entries(e).reduce((t,[n,r])=>({...t,[df(n)]:dt(r)?xr(r):Qt(r)?r.map(s=>dt(s)?xr(s):s):r}),{}),pf=e=>{if(Qt(e))return e.map(t=>dt(t)?xr(t):t);throw new Error("Input is not an array")},Tr=e=>Object.entries(e).reduce((t,[n,r])=>({...t,[ff(n)]:dt(r)?Tr(r):Qt(r)?r.map(s=>dt(s)?Tr(s):s):r}),{}),hf=e=>{if(Qt(e))return e.map(t=>dt(t)?Tr(t):t);throw new Error("Input is not an array")},Yo=(e,t)=>Qt(e)?t==="snake_case-to-camelCase"?pf(e):hf(e):dt(e)?t==="snake_case-to-camelCase"?xr(e):Tr(e):e,Jo=(e,t)=>{if(!t)return e;const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const s=t[r],i=e[r];dt(s)&&dt(i)?n[r]=Jo(i,s):s!==void 0&&(n[r]=s)}return n};function Zo(e,t){return function(){return e.apply(t,arguments)}}const{toString:gf}=Object.prototype,{getPrototypeOf:Is}=Object,{iterator:Ar,toStringTag:Xo}=Symbol,Rr=(e=>t=>{const n=gf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ge=e=>(e=e.toLowerCase(),t=>Rr(t)===e),kr=e=>t=>typeof t===e,{isArray:en}=Array,Un=kr("undefined");function mf(e){return e!==null&&!Un(e)&&e.constructor!==null&&!Un(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qo=Ge("ArrayBuffer");function bf(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Qo(e.buffer),t}const yf=kr("string"),Ie=kr("function"),ea=kr("number"),Ir=e=>e!==null&&typeof e=="object",wf=e=>e===!0||e===!1,Or=e=>{if(Rr(e)!=="object")return!1;const t=Is(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Xo in e)&&!(Ar in e)},Sf=Ge("Date"),_f=Ge("File"),vf=Ge("Blob"),Ef=Ge("FileList"),Cf=e=>Ir(e)&&Ie(e.pipe),xf=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Rr(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},Tf=Ge("URLSearchParams"),[Af,Rf,kf,If]=["ReadableStream","Request","Response","Headers"].map(Ge),Of=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),en(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function ta(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,na=e=>!Un(e)&&e!==Ot;function Os(){const{caseless:e}=na(this)&&this||{},t={},n=(r,s)=>{const i=e&&ta(t,s)||s;Or(t[i])&&Or(r)?t[i]=Os(t[i],r):Or(r)?t[i]=Os({},r):en(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Vn(arguments[r],n);return t}const Lf=(e,t,n,{allOwnKeys:r}={})=>(Vn(t,(s,i)=>{n&&Ie(s)?e[i]=Zo(s,n):e[i]=s},{allOwnKeys:r}),e),Pf=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Nf=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Mf=(e,t,n,r)=>{let s,i,o;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Is(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Df=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ff=e=>{if(!e)return null;if(en(e))return e;let t=e.length;if(!ea(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Bf=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Is(Uint8Array)),$f=(e,t)=>{const r=(e&&e[Ar]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Uf=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Vf=Ge("HTMLFormElement"),zf=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ra=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Hf=Ge("RegExp"),sa=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Vn(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},jf=e=>{sa(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ie(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Wf=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return en(e)?r(e):r(String(e).split(t)),n},qf=()=>{},Kf=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Gf(e){return!!(e&&Ie(e.append)&&e[Xo]==="FormData"&&e[Ar])}const Yf=e=>{const t=new Array(10),n=(r,s)=>{if(Ir(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=en(r)?[]:{};return Vn(r,(o,a)=>{const c=n(o,s+1);!Un(c)&&(i[a]=c)}),t[s]=void 0,i}}return r};return n(e,0)},Jf=Ge("AsyncFunction"),Zf=e=>e&&(Ir(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),ia=((e,t)=>e?setImmediate:t?((n,r)=>(Ot.addEventListener("message",({source:s,data:i})=>{s===Ot&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Ot.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(Ot.postMessage)),Xf=typeof queueMicrotask<"u"?queueMicrotask.bind(Ot):typeof process<"u"&&process.nextTick||ia,S={isArray:en,isArrayBuffer:Qo,isBuffer:mf,isFormData:xf,isArrayBufferView:bf,isString:yf,isNumber:ea,isBoolean:wf,isObject:Ir,isPlainObject:Or,isReadableStream:Af,isRequest:Rf,isResponse:kf,isHeaders:If,isUndefined:Un,isDate:Sf,isFile:_f,isBlob:vf,isRegExp:Hf,isFunction:Ie,isStream:Cf,isURLSearchParams:Tf,isTypedArray:Bf,isFileList:Ef,forEach:Vn,merge:Os,extend:Lf,trim:Of,stripBOM:Pf,inherits:Nf,toFlatObject:Mf,kindOf:Rr,kindOfTest:Ge,endsWith:Df,toArray:Ff,forEachEntry:$f,matchAll:Uf,isHTMLForm:Vf,hasOwnProperty:ra,hasOwnProp:ra,reduceDescriptors:sa,freezeMethods:jf,toObjectSet:Wf,toCamelCase:zf,noop:qf,toFiniteNumber:Kf,findKey:ta,global:Ot,isContextDefined:na,isSpecCompliantForm:Gf,toJSONObject:Yf,isAsyncFn:Jf,isThenable:Zf,setImmediate:ia,asap:Xf,isIterable:e=>e!=null&&Ie(e[Ar])};function F(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}S.inherits(F,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const oa=F.prototype,aa={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{aa[e]={value:e}}),Object.defineProperties(F,aa),Object.defineProperty(oa,"isAxiosError",{value:!0}),F.from=(e,t,n,r,s,i)=>{const o=Object.create(oa);return S.toFlatObject(e,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),F.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Qf=null;function Ls(e){return S.isPlainObject(e)||S.isArray(e)}function ca(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function la(e,t,n){return e?e.concat(t).map(function(s,i){return s=ca(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function ep(e){return S.isArray(e)&&!e.some(Ls)}const tp=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Lr(e,t,n){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=S.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!S.isUndefined(m[g])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(S.isDate(p))return p.toISOString();if(!c&&S.isBlob(p))throw new F("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(p)||S.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,m){let w=p;if(p&&!m&&typeof p=="object"){if(S.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(S.isArray(p)&&ep(p)||(S.isFileList(p)||S.endsWith(g,"[]"))&&(w=S.toArray(p)))return g=ca(g),w.forEach(function(y,_){!(S.isUndefined(y)||y===null)&&t.append(o===!0?la([g],_,i):o===null?g:g+"[]",l(y))}),!1}return Ls(p)?!0:(t.append(la(m,g,i),l(p)),!1)}const d=[],f=Object.assign(tp,{defaultVisitor:u,convertValue:l,isVisitable:Ls});function h(p,g){if(!S.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),S.forEach(p,function(w,v){(!(S.isUndefined(w)||w===null)&&s.call(t,w,S.isString(v)?v.trim():v,g,f))===!0&&h(w,g?g.concat(v):[v])}),d.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return h(e),t}function ua(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ps(e,t){this._pairs=[],e&&Lr(e,this,t)}const da=Ps.prototype;da.append=function(t,n){this._pairs.push([t,n])},da.toString=function(t){const n=t?function(r){return t.call(this,r,ua)}:ua;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function np(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fa(e,t,n){if(!t)return e;const r=n&&n.encode||np;S.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=S.isURLSearchParams(t)?t.toString():new Ps(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class pa{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ha={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rp={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ps,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ns=typeof window<"u"&&typeof document<"u",Ms=typeof navigator=="object"&&navigator||void 0,sp=Ns&&(!Ms||["ReactNative","NativeScript","NS"].indexOf(Ms.product)<0),ip=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",op=Ns&&window.location.href||"http://localhost",Se={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ns,hasStandardBrowserEnv:sp,hasStandardBrowserWebWorkerEnv:ip,navigator:Ms,origin:op},Symbol.toStringTag,{value:"Module"})),...rp};function ap(e,t){return Lr(e,new Se.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return Se.isNode&&S.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function cp(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function lp(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ga(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=n.length;return o=!o&&S.isArray(s)?s.length:o,c?(S.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!S.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&S.isArray(s[o])&&(s[o]=lp(s[o])),!a)}if(S.isFormData(e)&&S.isFunction(e.entries)){const n={};return S.forEachEntry(e,(r,s)=>{t(cp(r),s,n,0)}),n}return null}function up(e,t,n){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const zn={transitional:ha,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return s?JSON.stringify(ga(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ap(t,this.formSerializer).toString();if((a=S.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Lr(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),up(t)):t}],transformResponse:[function(t){const n=this.transitional||zn.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?F.from(a,F.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Se.classes.FormData,Blob:Se.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{zn.headers[e]={}});const dp=S.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"]),fp=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
9
|
+
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&dp[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ma=Symbol("internals");function Hn(e){return e&&String(e).trim().toLowerCase()}function Pr(e){return e===!1||e==null?e:S.isArray(e)?e.map(Pr):String(e)}function pp(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const hp=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ds(e,t,n,r,s){if(S.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!S.isString(t)){if(S.isString(r))return t.indexOf(r)!==-1;if(S.isRegExp(r))return r.test(t)}}function gp(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function mp(e,t){const n=S.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let Oe=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(a,c,l){const u=Hn(c);if(!u)throw new Error("header name must be a non-empty string");const d=S.findKey(s,u);(!d||s[d]===void 0||l===!0||l===void 0&&s[d]!==!1)&&(s[d||c]=Pr(a))}const o=(a,c)=>S.forEach(a,(l,u)=>i(l,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(S.isString(t)&&(t=t.trim())&&!hp(t))o(fp(t),n);else if(S.isObject(t)&&S.isIterable(t)){let a={},c,l;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[l=u[0]]=(c=a[l])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}o(a,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Hn(t),t){const r=S.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return pp(s);if(S.isFunction(n))return n.call(this,s,r);if(S.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Hn(t),t){const r=S.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ds(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=Hn(o),o){const a=S.findKey(r,o);a&&(!n||Ds(r,r[a],a,n))&&(delete r[a],s=!0)}}return S.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Ds(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return S.forEach(this,(s,i)=>{const o=S.findKey(r,i);if(o){n[o]=Pr(s),delete n[i];return}const a=t?gp(i):String(i).trim();a!==i&&delete n[i],n[a]=Pr(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return S.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&S.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
10
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[ma]=this[ma]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=Hn(o);r[a]||(mp(s,o),r[a]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(Oe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),S.freezeMethods(Oe);function Fs(e,t){const n=this||zn,r=t||n,s=Oe.from(r.headers);let i=r.data;return S.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ba(e){return!!(e&&e.__CANCEL__)}function tn(e,t,n){F.call(this,e??"canceled",F.ERR_CANCELED,t,n),this.name="CanceledError"}S.inherits(tn,F,{__CANCEL__:!0});function ya(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bp(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yp(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[i];o||(o=l),n[s]=c,r[s]=l;let d=i,f=0;for(;d!==s;)f+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function wp(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-d)))},()=>s&&o(s)]}const Nr=(e,t,n=3)=>{let r=0;const s=yp(50,250);return wp(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-r,l=s(c),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},wa=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Sa=e=>(...t)=>S.asap(()=>e(...t)),Sp=Se.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Se.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Se.origin),Se.navigator&&/(msie|trident)/i.test(Se.navigator.userAgent)):()=>!0,_p=Se.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];S.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),S.isString(r)&&o.push("path="+r),S.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function vp(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ep(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _a(e,t,n){let r=!vp(t);return e&&(r||n==!1)?Ep(e,t):t}const va=e=>e instanceof Oe?{...e}:e;function Lt(e,t){t=t||{};const n={};function r(l,u,d,f){return S.isPlainObject(l)&&S.isPlainObject(u)?S.merge.call({caseless:f},l,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function s(l,u,d,f){if(S.isUndefined(u)){if(!S.isUndefined(l))return r(void 0,l,d,f)}else return r(l,u,d,f)}function i(l,u){if(!S.isUndefined(u))return r(void 0,u)}function o(l,u){if(S.isUndefined(u)){if(!S.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:i,method:i,data:i,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,responseEncoding:o,validateStatus:a,headers:(l,u,d)=>s(va(l),va(u),d,!0)};return S.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||s,f=d(e[u],t[u],u);S.isUndefined(f)&&d!==a||(n[u]=f)}),n}const Ea=e=>{const t=Lt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=Oe.from(o),t.url=fa(_a(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(S.isFormData(n)){if(Se.hasStandardBrowserEnv||Se.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(Se.hasStandardBrowserEnv&&(r&&S.isFunction(r)&&(r=r(t)),r||r!==!1&&Sp(t.url))){const l=s&&i&&_p.read(i);l&&o.set(s,l)}return t},Cp=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Ea(e);let i=s.data;const o=Oe.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,u,d,f,h,p;function g(){h&&h(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function w(){if(!m)return;const y=Oe.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),O={data:!a||a==="text"||a==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:y,config:e,request:m};ya(function(b){n(b),g()},function(b){r(b),g()},O),m=null}"onloadend"in m?m.onloadend=w:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(w)},m.onabort=function(){m&&(r(new F("Request aborted",F.ECONNABORTED,e,m)),m=null)},m.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||ha;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new F(_,O.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&S.forEach(o.toJSON(),function(_,O){m.setRequestHeader(O,_)}),S.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),a&&a!=="json"&&(m.responseType=s.responseType),l&&([f,p]=Nr(l,!0),m.addEventListener("progress",f)),c&&m.upload&&([d,h]=Nr(c),m.upload.addEventListener("progress",d),m.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=y=>{m&&(r(!y||y.type?new tn(null,e,m):y),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const v=bp(s.url);if(v&&Se.protocols.indexOf(v)===-1){r(new F("Unsupported protocol "+v+":",F.ERR_BAD_REQUEST,e));return}m.send(i||null)})},xp=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof F?u:new tn(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new F(`timeout ${t} of ms exceeded`,F.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>S.asap(a),c}},Tp=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Ap=async function*(e,t){for await(const n of Rp(e))yield*Tp(n,t)},Rp=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ca=(e,t,n,r)=>{const s=Ap(e,t);let i=0,o,a=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await s.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let f=i+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Mr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",xa=Mr&&typeof ReadableStream=="function",kp=Mr&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ta=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ip=xa&&Ta(()=>{let e=!1;const t=new Request(Se.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Aa=64*1024,Bs=xa&&Ta(()=>S.isReadableStream(new Response("").body)),Dr={stream:Bs&&(e=>e.body)};Mr&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Dr[t]&&(Dr[t]=S.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new F(`Response type '${t}' is not supported`,F.ERR_NOT_SUPPORT,r)})})})(new Response);const Op=async e=>{if(e==null)return 0;if(S.isBlob(e))return e.size;if(S.isSpecCompliantForm(e))return(await new Request(Se.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(S.isArrayBufferView(e)||S.isArrayBuffer(e))return e.byteLength;if(S.isURLSearchParams(e)&&(e=e+""),S.isString(e))return(await kp(e)).byteLength},Lp=async(e,t)=>{const n=S.toFiniteNumber(e.getContentLength());return n??Op(t)},$s={http:Qf,xhr:Cp,fetch:Mr&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Ea(e);l=l?(l+"").toLowerCase():"text";let h=xp([s,i&&i.toAbortSignal()],o),p;const g=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&Ip&&n!=="get"&&n!=="head"&&(m=await Lp(u,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(S.isFormData(r)&&(T=O.headers.get("content-type"))&&u.setContentType(T),O.body){const[b,k]=wa(m,Nr(Sa(c)));r=Ca(O.body,Aa,b,k)}}S.isString(d)||(d=d?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:w?d:void 0});let v=await fetch(p);const y=Bs&&(l==="stream"||l==="response");if(Bs&&(a||y&&g)){const O={};["status","statusText","headers"].forEach(x=>{O[x]=v[x]});const T=S.toFiniteNumber(v.headers.get("content-length")),[b,k]=a&&wa(T,Nr(Sa(a),!0))||[];v=new Response(Ca(v.body,Aa,b,()=>{k&&k(),g&&g()}),O)}l=l||"text";let _=await Dr[S.findKey(Dr,l)||"text"](v,e);return!y&&g&&g(),await new Promise((O,T)=>{ya(O,T,{data:_,headers:Oe.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:p})})}catch(w){throw g&&g(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,e,p),{cause:w.cause||w}):F.from(w,w&&w.code,e,p)}})};S.forEach($s,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ra=e=>`- ${e}`,Pp=e=>S.isFunction(e)||e===null||e===!1,ka={getAdapter:e=>{e=S.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!Pp(n)&&(r=$s[(o=String(n)).toLowerCase()],r===void 0))throw new F(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
11
|
+
`+i.map(Ra).join(`
|
|
12
|
+
`):" "+Ra(i[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:$s};function Us(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tn(null,e)}function Ia(e){return Us(e),e.headers=Oe.from(e.headers),e.data=Fs.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ka.getAdapter(e.adapter||zn.adapter)(e).then(function(r){return Us(e),r.data=Fs.call(e,e.transformResponse,r),r.headers=Oe.from(r.headers),r},function(r){return ba(r)||(Us(e),r&&r.response&&(r.response.data=Fs.call(e,e.transformResponse,r.response),r.response.headers=Oe.from(r.response.headers))),Promise.reject(r)})}const Oa="1.9.0",Fr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Fr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const La={};Fr.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Oa+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(t===!1)throw new F(s(o," has been removed"+(n?" in "+n:"")),F.ERR_DEPRECATED);return n&&!La[o]&&(La[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,a):!0}},Fr.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Np(e,t,n){if(typeof e!="object")throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const a=e[i],c=a===void 0||o(a,i,e);if(c!==!0)throw new F("option "+i+" must be "+c,F.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new F("Unknown option "+i,F.ERR_BAD_OPTION)}}const Br={assertOptions:Np,validators:Fr},et=Br.validators;let Pt=class{constructor(t){this.defaults=t||{},this.interceptors={request:new pa,response:new pa}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
13
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Lt(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Br.assertOptions(r,{silentJSONParsing:et.transitional(et.boolean),forcedJSONParsing:et.transitional(et.boolean),clarifyTimeoutError:et.transitional(et.boolean)},!1),s!=null&&(S.isFunction(s)?n.paramsSerializer={serialize:s}:Br.assertOptions(s,{encode:et.function,serialize:et.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Br.assertOptions(n,{baseUrl:et.spelling("baseURL"),withXsrfToken:et.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&S.merge(i.common,i[n.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Oe.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let u,d=0,f;if(!c){const p=[Ia.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const p=a[d++],g=a[d++];try{h=p(h)}catch(m){g.call(this,m);break}}try{u=Ia.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Lt(this.defaults,t);const n=_a(t.baseURL,t.url,t.allowAbsoluteUrls);return fa(n,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){Pt.prototype[t]=function(n,r){return this.request(Lt(r||{},{method:t,url:n,data:(r||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(Lt(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Pt.prototype[t]=n(),Pt.prototype[t+"Form"]=n(!0)});let Mp=class Nd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,a){r.reason||(r.reason=new tn(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Nd(function(s){t=s}),cancel:t}}};function Dp(e){return function(n){return e.apply(null,n)}}function Fp(e){return S.isObject(e)&&e.isAxiosError===!0}const Vs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Vs).forEach(([e,t])=>{Vs[t]=e});function Pa(e){const t=new Pt(e),n=Zo(Pt.prototype.request,t);return S.extend(n,Pt.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Pa(Lt(e,s))},n}const ie=Pa(zn);ie.Axios=Pt,ie.CanceledError=tn,ie.CancelToken=Mp,ie.isCancel=ba,ie.VERSION=Oa,ie.toFormData=Lr,ie.AxiosError=F,ie.Cancel=ie.CanceledError,ie.all=function(t){return Promise.all(t)},ie.spread=Dp,ie.isAxiosError=Fp,ie.mergeConfig=Lt,ie.AxiosHeaders=Oe,ie.formToJSON=e=>ga(S.isHTMLForm(e)?new FormData(e):e),ie.getAdapter=ka.getAdapter,ie.HttpStatusCode=Vs,ie.default=ie;const{Axios:Uv,AxiosError:Vv,CanceledError:zv,isCancel:Hv,CancelToken:jv,VERSION:Wv,all:qv,Cancel:Kv,isAxiosError:Gv,spread:Yv,toFormData:Jv,AxiosHeaders:Zv,HttpStatusCode:Xv,formToJSON:Qv,getAdapter:eE,mergeConfig:tE}=ie,jn=(e,t)=>e,Y=class Y{static getAxiosInstance(){if(!this.axiosInstance)throw new Error("AstroPay Payments Library: Not initialized.");return this.axiosInstance}};A(Y,"axiosInstance"),A(Y,"config"),A(Y,"init",t=>{Y.config=t,Y.axiosInstance=ie.create({baseURL:t.baseURL,timeout:t.timeout??5e3,withCredentials:!0,headers:{"Accept-Language":te.getCurrent(),...t.headers}}),Y.setupInterceptors()}),A(Y,"GET",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=jn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().get(i,o)}),A(Y,"POST",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=jn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().post(i,n,o)}),A(Y,"PUT",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=jn(t,r),o={params:{useQueryParams:s}};return await Y.getAxiosInstance().put(i,n,o)}),A(Y,"PATCH",async({url:t,data:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=jn(t,r),o={params:{useQueryParams:s},headers:{"Content-Type":"text/plain"}};return await Y.getAxiosInstance().patch(i,n,o)}),A(Y,"DELETE",async({url:t,params:n={},mock:r=!1,useQueryParams:s=!0})=>{const i=jn(t,r),o={params:{useQueryParams:s,...n}};return await Y.getAxiosInstance().delete(i,o)}),A(Y,"setupInterceptors",()=>{Y.axiosInstance.interceptors.request.use(t=>{const{useQueryParams:n,...r}=t.params||{};return n?t.params={...r,data:Y.getEncodeParams()}:t.params=r,t.data&&(t.data=Yo(t.data,"camelCase-to-snake_case")),t}),Y.axiosInstance.interceptors.response.use(t=>Y.handleResponse(t),t=>Y.handleError(t))}),A(Y,"handleResponse",t=>{const n=t.status===202,r=Yo(t.data,"snake_case-to-camelCase");return n?{...r,statusCode:t.status}:r}),A(Y,"handleError",t=>{var r,s,i,o,a,c,l,u;const n={error:((s=(r=t.response)==null?void 0:r.data)==null?void 0:s.error)||"UNKNOWN_ERROR",internalTerm:(o=(i=t.response)==null?void 0:i.data)==null?void 0:o.internalTerm,message:((c=(a=t.response)==null?void 0:a.data)==null?void 0:c.message)||te.translate("generic_error"),description:(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.description};return Promise.reject(n)}),A(Y,"getEncodeParams",()=>{const t={app_name:Y.config.appName,app_id:st.getToken(),environment:Mn.getEnvironment(),platform:Ko(),version:"0.1.4"};return Go(t)});let yt=Y;const C={transparent:"transparent",surface_dark:"#041311",surface_light:"#FFFFFF",neutral_lightest:"#FFFFFF",neutral_light:"#F3F6F6",neutral_lighter:"#E2E9E8",neutral_base:"#B4C5C3",neutral_darker:"#7C9995",neutral_dark:"#536663",neutral_darkest:"#151E1D",primary_lightest:"#DBFFFB",primary_light:"#AAF6EC",primary_base:"#00DBBF",primary_darker:"#0FC3AC",primary_dark:"#059986",primary_darkest:"#07544A",warning_light:"#FFEBA8",warning_darkest:"#755A00",error_lightest:"#FFDCD6",error_lighter:"#FF8470",error_base:"#FF2C0A",error_dark:"#A31600"},$r={poppins:"Poppins"},Bp=async()=>{try{const e=document.createElement("link");e.href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap",e.rel="stylesheet",document.head.appendChild(e),await document.fonts.ready}catch(e){console.error("Font loading failed:",e)}},$p={backgroundColor:C.surface_dark,fontFamily:$r.poppins,textColor:C.neutral_light,primaryColor:C.primary_base,secondaryColor:C.primary_darkest,textPrimaryColor:C.neutral_lightest,textSecondaryColor:C.primary_lightest,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",input:{normal:{textColor:C.neutral_lightest,backgroundColor:C.neutral_darkest,hintTextColor:C.neutral_darker,placeholderTextColor:C.neutral_dark,borderColor:C.transparent,borderRadius:8,borderWidth:3},focus:{textColor:C.neutral_lightest,backgroundColor:C.neutral_darkest,hintTextColor:C.neutral_darker,placeholderTextColor:C.neutral_darker,borderColor:C.primary_base,borderRadius:8,borderWidth:3},disabled:{textColor:C.neutral_darker,backgroundColor:C.neutral_dark,hintTextColor:C.neutral_darker,placeholderTextColor:C.neutral_base,borderColor:C.neutral_dark,borderRadius:8,borderWidth:3},error:{textColor:C.neutral_lightest,backgroundColor:C.neutral_darkest,hintTextColor:C.error_base,placeholderTextColor:C.neutral_darker,borderColor:C.error_base,borderRadius:8,borderWidth:3}},button:{small:{borderRadius:4},medium:{borderRadius:8},large:{borderRadius:8},primary:{textColor:C.neutral_lightest,backgroundColor:C.primary_base,borderColor:"transparent",borderWidth:0},secondary:{textColor:C.primary_lightest,backgroundColor:C.primary_darkest,borderColor:"transparent",borderWidth:0},text:{textColor:C.primary_base,backgroundColor:"unset",borderColor:C.primary_base,borderWidth:1},disabled:{textColor:C.neutral_dark,backgroundColor:C.neutral_base,borderColor:"transparent",borderWidth:0}},apFontFamily:$r.poppins,apWarningBgColor:C.warning_darkest,apWarningTxtColor:C.error_lightest,apPillBgColor:C.primary_darkest,apPillTxtColor:C.primary_light,apPillDisableBgColor:C.neutral_dark,apPillDisableTxtColor:C.neutral_light,apPrimaryColor:C.primary_base,apButtonPrimaryBgColor:C.primary_base,apButtonPrimaryTxtColor:C.neutral_darkest,apButtonSecondaryBgColor:C.primary_darkest,apButtonSecondaryTxtColor:C.primary_base,apButtonTextTxtColor:C.primary_base,apButtonDisableBgColor:C.neutral_base,apButtonDisableTextColor:C.neutral_dark,apSelectBgHoverColor:C.neutral_dark,apSelectBorderColor:C.neutral_base,apErrorText:C.error_lighter,apSuccessText:C.primary_base},Na={backgroundColor:C.surface_light,fontFamily:$r.poppins,textColor:C.neutral_darkest,primaryColor:C.primary_base,secondaryColor:C.primary_lightest,textPrimaryColor:C.neutral_darkest,textSecondaryColor:C.primary_darker,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",input:{normal:{textColor:C.neutral_darkest,backgroundColor:C.neutral_lighter,hintTextColor:C.neutral_dark,placeholderTextColor:C.neutral_dark,borderColor:C.transparent,borderRadius:8,borderWidth:3},focus:{textColor:C.neutral_darkest,backgroundColor:C.neutral_lighter,hintTextColor:C.neutral_dark,placeholderTextColor:C.neutral_dark,borderColor:C.primary_darker,borderRadius:8,borderWidth:3},disabled:{textColor:C.neutral_dark,backgroundColor:C.neutral_base,hintTextColor:C.neutral_dark,placeholderTextColor:C.neutral_darker,borderColor:C.neutral_base,borderRadius:8,borderWidth:3},error:{textColor:C.neutral_darkest,backgroundColor:C.neutral_lighter,hintTextColor:C.error_dark,placeholderTextColor:C.neutral_dark,borderColor:C.error_dark,borderRadius:8,borderWidth:3}},button:{small:{borderRadius:4},medium:{borderRadius:8},large:{borderRadius:8},primary:{textColor:C.neutral_darkest,backgroundColor:C.primary_base,borderColor:"transparent",borderWidth:0},secondary:{textColor:C.primary_darker,backgroundColor:C.primary_lightest,borderColor:"transparent",borderWidth:0},text:{textColor:C.primary_base,backgroundColor:"unset",borderColor:C.primary_base,borderWidth:1},disabled:{textColor:C.neutral_dark,backgroundColor:C.neutral_base,borderColor:"transparent",borderWidth:0}},apFontFamily:$r.poppins,apWarningBgColor:C.warning_light,apWarningTxtColor:C.error_dark,apPillBgColor:C.primary_lightest,apPillTxtColor:C.primary_dark,apPillDisableBgColor:C.neutral_light,apPillDisableTxtColor:C.neutral_dark,apPrimaryColor:C.primary_base,apButtonPrimaryBgColor:C.primary_base,apButtonPrimaryTxtColor:C.neutral_darkest,apButtonSecondaryBgColor:C.primary_lightest,apButtonSecondaryTxtColor:C.primary_dark,apButtonTextTxtColor:C.primary_dark,apButtonDisableBgColor:C.neutral_base,apButtonDisableTextColor:C.neutral_dark,apSelectBgHoverColor:C.neutral_lighter,apSelectBorderColor:C.neutral_base,apErrorText:C.error_dark,apSuccessText:C.primary_darker},Up={light:Na,dark:$p},It=class It{static init(t){const n=yr(t==null?void 0:t.theme,Jt,"light");It.currentTheme=n,It.styles=Jo(Up[n],t==null?void 0:t.styles)}static getStyles(){return It.styles}static getTheme(){return It.currentTheme}};A(It,"currentTheme","light"),A(It,"styles",Na);let U=It;const Ur={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},ft=console,nn={};Object.keys(Ur).forEach(e=>{nn[e]=ft[e]});const Wn="Datadog Browser SDK:",V={debug:nn.debug.bind(ft,Wn),log:nn.log.bind(ft,Wn),info:nn.info.bind(ft,Wn),warn:nn.warn.bind(ft,Wn),error:nn.error.bind(ft,Wn)},Vr="https://docs.datadoghq.com",Vp=`${Vr}/real_user_monitoring/browser/troubleshooting`,zs="More details:";function Ma(e,t){return(...n)=>{try{return e(...n)}catch(r){V.error(t,r)}}}function wt(e){return e!==0&&Math.random()*100<=e}function zr(e,t){return+e.toFixed(t)}function zp(e){return qn(e)&&e>=0&&e<=100}function qn(e){return typeof e=="number"}const _e=1e3,Le=60*_e,Da=60*Le,Fa=365*(24*Da);function Hr(e){return{relative:e,timeStamp:jp(e)}}function Hp(e){return{relative:Hs(e),timeStamp:e}}function jp(e){const t=ze()-performance.now();return t>Kn()?Math.round(rn(t,e)):qp(e)}function Wp(){return Math.round(ze()-rn(Kn(),performance.now()))}function B(e){return qn(e)?zr(e*1e6,0):e}function ze(){return new Date().getTime()}function fe(){return ze()}function He(){return performance.now()}function Te(){return{relative:He(),timeStamp:fe()}}function Ba(){return{relative:0,timeStamp:Kn()}}function be(e,t){return t-e}function rn(e,t){return e+t}function Hs(e){return e-Kn()}function qp(e){return Math.round(rn(Kn(),e))}function Kp(e){return e<Fa}let js;function Kn(){return js===void 0&&(js=performance.timing.navigationStart),js}const Gn=1024,$a=1024*Gn,Gp=/[^\u0000-\u007F]/;function Ua(e){return Gp.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function Yp(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Yn(e){return{...e}}function jr(e,t){return Object.keys(e).some(n=>e[n]===t)}function Nt(e){return Object.keys(e).length===0}function Jp(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function tt(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}function St(e,t){const n=tt();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let Ws,Va=!1;function Zp(e){Ws=e}function Xp(e){Va=e}function $(e){return function(){return Mt(e,this,arguments)}}function Mt(e,t,n){try{return e.apply(t,n)}catch(r){pt(r)}}function pt(e){if(qs(e),Ws)try{Ws(e)}catch(t){qs(t)}}function qs(...e){Va&&V.error("[MONITOR]",...e)}function pe(e,t){return St(tt(),"setTimeout")($(e),t)}function Pe(e){St(tt(),"clearTimeout")(e)}function sn(e,t){return St(tt(),"setInterval")($(e),t)}function Wr(e){St(tt(),"clearInterval")(e)}class G{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach(n=>n(t))}}function za(...e){return new G(t=>{const n=e.map(r=>r.subscribe(s=>t.notify(s)));return()=>n.forEach(r=>r.unsubscribe())})}function _t(e,t,n){const r=n&&n.leading!==void 0?n.leading:!0,s=n&&n.trailing!==void 0?n.trailing:!0;let i=!1,o,a;return{throttled:(...c)=>{if(i){o=c;return}r?e(...c):o=c,i=!0,a=pe(()=>{s&&o&&e(...o),i=!1,o=void 0},t)},cancel:()=>{Pe(a),i=!1,o=void 0}}}function z(){}function ye(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,ye)}const qr=/([\w-]+)\s*=\s*([^;]+)/g;function Jn(e,t){for(qr.lastIndex=0;;){const n=qr.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function Qp(e){const t=new Map;for(qr.lastIndex=0;;){const n=qr.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function Ha(e,t,n=""){const r=e.charCodeAt(t-1),i=r>=55296&&r<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${n}`}function eh(){return ja()===0}function th(){return ja()===1}let Kr;function ja(){return Kr??(Kr=nh())}function nh(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function Zn(e,t,n=0,r){const s=new Date;s.setTime(s.getTime()+n);const i=`expires=${s.toUTCString()}`,o=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",l=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${o}${a}${c}${l}`}function Ks(e){return Jn(document.cookie,e)}let Gs;function vt(e){return Gs||(Gs=Qp(document.cookie)),Gs.get(e)}function Wa(e,t){Zn(e,"",0,t)}function rh(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${ye()}`,n="test";Zn(t,n,Le,e);const r=Ks(t)===n;return Wa(t,e),r}catch(t){return V.error(t),!1}}let Ys;function sh(){if(Ys===void 0){const e=`dd_site_test_${ye()}`,t="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!Ks(e);)r=`${n.pop()}.${r}`,Zn(e,t,_e,{domain:r});Wa(e,{domain:r}),Ys=r}return Ys}const on="_dd_s";function ih(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function qa(e){return Object.values(e)}function Js(e){return Object.entries(e)}const Dt=4*Da,Ka=15*Le,oh=Fa,Xn={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},Ga=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Zs="&";function ah(e){return!!e&&(e.indexOf(Zs)!==-1||Ga.test(e))}const ch="1";function Ft(e,t){const n={isExpired:ch};return t.trackAnonymousUser&&(e!=null&&e.anonymousId?n.anonymousId=e==null?void 0:e.anonymousId:n.anonymousId=ye()),n}function Gr(e){return Nt(e)}function Ya(e){return!Gr(e)}function Yr(e){return e.isExpired!==void 0||!lh(e)}function lh(e){return(e.created===void 0||ze()-Number(e.created)<Dt)&&(e.expire===void 0||ze()<Number(e.expire))}function Ja(e){e.expire=String(ze()+Ka)}function Xs(e){return Js(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(Zs)}function Za(e){const t={};return ah(e)&&e.split(Zs).forEach(n=>{const r=Ga.exec(n);if(r!==null){const[,s,i]=r;s==="aid"?t.anonymousId=i:t[s]=i}}),t}const uh="_dd",dh="_dd_r",fh="_dd_l",ph="rum",hh="logs";function gh(e){if(!vt(on)){const n=vt(uh),r=vt(dh),s=vt(fh),i={};n&&(i.id=n),s&&/^[01]$/.test(s)&&(i[hh]=s),r&&/^[012]$/.test(r)&&(i[ph]=r),Ya(i)&&(Ja(i),e.persistSession(i))}}function Xa(e){const t=Sh(e);return rh(t)?{type:Xn.COOKIE,cookieOptions:t}:void 0}function mh(e,t){const n={isLockEnabled:eh(),persistSession:bh(t),retrieveSession:wh,expireSession:r=>yh(t,r,e)};return gh(n),n}function bh(e){return t=>{Zn(on,Xs(t),Ka,e)}}function yh(e,t,n){const r=Ft(t,n);Zn(on,Xs(r),n.trackAnonymousUser?oh:Dt,e)}function wh(){const e=Ks(on);return Za(e)}function Sh(e){const t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=sh()),t}const _h="_dd_test_";function Qa(){try{const e=ye(),t=`${_h}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Xn.LOCAL_STORAGE}:void 0}catch{return}}function vh(e){return{isLockEnabled:!1,persistSession:ec,retrieveSession:Eh,expireSession:t=>Ch(t,e)}}function ec(e){localStorage.setItem(on,Xs(e))}function Eh(){const e=localStorage.getItem(on);return Za(e)}function Ch(e,t){ec(Ft(e,t))}const xh=10,Th=100,tc=[];let Jr;function Bt(e,t,n=0){var r;const{isLockEnabled:s,persistSession:i,expireSession:o}=t,a=f=>i({...f,lock:l}),c=()=>{const f=t.retrieveSession(),h=f.lock;return f.lock&&delete f.lock,{session:f,lock:h}};if(Jr||(Jr=e),e!==Jr){tc.push(e);return}if(s&&n>=Th){nc(t);return}let l,u=c();if(s){if(u.lock){Zr(e,t,n);return}if(l=ye(),a(u.session),u=c(),u.lock!==l){Zr(e,t,n);return}}let d=e.process(u.session);if(s&&(u=c(),u.lock!==l)){Zr(e,t,n);return}if(d&&(Yr(d)?o(d):(Ja(d),s?a(d):i(d))),s&&!(d&&Yr(d))){if(u=c(),u.lock!==l){Zr(e,t,n);return}i(u.session),d=u.session}(r=e.after)===null||r===void 0||r.call(e,d||u.session),nc(t)}function Zr(e,t,n){pe(()=>{Bt(e,t,n+1)},xh)}function nc(e){Jr=void 0;const t=tc.shift();t&&Bt(t,e)}const rc=_e;function Ah(e){switch(e.sessionPersistence){case Xn.COOKIE:return Xa(e);case Xn.LOCAL_STORAGE:return Qa();case void 0:{let t=Xa(e);return!t&&e.allowFallbackToLocalStorage&&(t=Qa()),t}default:V.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Rh(e,t,n,r){const s=new G,i=new G,o=new G,a=e.type===Xn.COOKIE?mh(t,e.cookieOptions):vh(t),{expireSession:c}=a,l=sn(p,rc);let u;m();const{throttled:d,cancel:f}=_t(()=>{Bt({process:b=>{if(Gr(b))return;const k=g(b);return w(k),k},after:b=>{Ya(b)&&!v()&&O(b),u=b}},a)},rc);function h(){Bt({process:b=>v()?g(b):void 0},a)}function p(){Bt({process:b=>Yr(b)?Ft(b,t):void 0,after:g},a)}function g(b){return Yr(b)&&(b=Ft(b,t)),v()&&(y(b)?_():(o.notify({previousState:u,newState:b}),u=b)),b}function m(){Bt({process:b=>{if(Gr(b))return Ft(b,t)},after:b=>{u=b}},a)}function w(b){if(Gr(b))return!1;const{trackingType:k,isTracked:x}=r(b[n]);b[n]=k,delete b.isExpired,x&&!b.id&&(b.id=ye(),b.created=String(ze()))}function v(){return u[n]!==void 0}function y(b){return u.id!==b.id||u[n]!==b[n]}function _(){u=Ft(u,t),i.notify()}function O(b){u=b,s.notify()}function T(b){Bt({process:k=>({...k,...b}),after:g},a)}return{expandOrRenewSession:d,expandSession:h,getSession:()=>u,renewObservable:s,expireObservable:i,sessionStateUpdateObservable:o,restartSession:m,expire:()=>{f(),c(u),g(Ft(u,t))},stop:()=>{Wr(l)},updateSessionState:T}}const Qs={GRANTED:"granted",NOT_GRANTED:"not-granted"};function kh(e){const t=new G;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===Qs.GRANTED},observable:t}}function an(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=cn(Object.prototype),s=cn(Array.prototype),i=cn(Object.getPrototypeOf(e)),o=cn(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),s(),i(),o()}}function cn(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):z}function ei(e){return Xr(e,location.href).href}function Ih(e){try{return!!Xr(e)}catch{return!1}}function Oh(e){const t=Xr(e).pathname;return t[0]==="/"?t:`/${t}`}function Xr(e,t){const n=Lh();if(n)try{return t!==void 0?new n(e,t):new n(e)}catch(i){throw new Error(`Failed to construct URL: ${String(i)} ${an({url:e,base:t})}`)}if(t===void 0&&!/:/.test(e))throw new Error(`Invalid URL: '${e}'`);let r=document;const s=r.createElement("a");if(t!==void 0){r=document.implementation.createHTMLDocument("");const i=r.createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(s)}return s.href=e,s}const sc=URL;let Qr;function Lh(){if(Qr===void 0)try{Qr=new sc("http://test/path").href==="http://test/path"}catch{Qr=!1}return Qr?sc:void 0}const ic="datad0g.com",Ph="dd0g-gov.com",$t="datadoghq.com",Nh="datadoghq.eu",Mh="ddog-gov.com",Dh="pci.browser-intake-datadoghq.com",Fh=["ddsource","ddtags"];function ln(e,t,n){const r=Bh(e,t);return{build(s,i){const o=$h(e,t,n,s,i);return r(o)},tags:n,urlPrefix:r(""),trackType:t}}function Bh(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const i=ei(r);return o=>`${i}?ddforward=${encodeURIComponent(`${n}?${o}`)}`}if(typeof r=="function")return i=>r({path:n,parameters:i});const s=oc(t,e);return i=>`https://${s}${n}?${i}`}function oc(e,t){const{site:n=$t,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===$t)return Dh;if(r&&n===$t)return`${r}.${$t}`;if(n===Ph)return`http-intake.logs.${n}`;const s=n.split("."),i=s.pop();return`browser-intake-${s.join("-")}.${i}`}function $h({clientToken:e,internalAnalyticsSubdomain:t},n,r,s,{retry:i,encoding:o}){const a=["sdk_version:6.6.3",`api:${s}`].concat(r);i&&a.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const c=["ddsource=browser",`ddtags=${encodeURIComponent(a.join(","))}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.6.3")}`,"dd-evp-origin=browser",`dd-request-id=${ye()}`];return o&&c.push(`dd-evp-encoding=${o}`),n==="rum"&&c.push(`batch_time=${fe()}`),t&&c.reverse(),c.join("&")}const Uh=200;function Vh(e){const{env:t,service:n,version:r,datacenter:s}=e,i=[];return t&&i.push(es("env",t)),n&&i.push(es("service",n)),r&&i.push(es("version",r)),s&&i.push(es("datacenter",s)),i}function es(e,t){const n=Uh-e.length-1;(t.length>n||zh(t))&&V.warn(`${e} value doesn't meet tag requirements and will be sanitized. ${zs} ${Vr}/getting_started/tagging/#defining-tags`);const r=t.replace(/,/g,"_");return`${e}:${r}`}function zh(e){return Hh()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function Hh(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function jh(e){const t=e.site||$t,n=Vh(e),r=Wh(e,n);return{replica:qh(e,n),site:t,...r}}function Wh(e,t){return{logsEndpointBuilder:ln(e,"logs",t),rumEndpointBuilder:ln(e,"rum",t),profilingEndpointBuilder:ln(e,"profile",t),sessionReplayEndpointBuilder:ln(e,"replay",t)}}function qh(e,t){if(!e.replica)return;const n={...e,site:$t,clientToken:e.replica.clientToken},r={logsEndpointBuilder:ln(n,"logs",t),rumEndpointBuilder:ln(n,"rum",t)};return{applicationId:e.replica.applicationId,...r}}function Kh(e){return Fh.every(t=>e.includes(t))}const Qn={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ti={ALL:"all",SAMPLED:"sampled"};function ni(e,t){return e!=null&&typeof e!="string"?(V.error(`${t} must be defined as a string`),!1):!0}function Gh(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(V.error(`Site should be a valid Datadog site. ${zs} ${Vr}/getting_started/site/.`),!1):!0}function un(e,t){return e!==void 0&&!zp(e)?(V.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function Yh(e){var t,n,r,s,i,o;if(!e||!e.clientToken){V.error("Client Token is not configured, we will not send any data.");return}if(!(!Gh(e.site)||!un(e.sessionSampleRate,"Session")||!un(e.telemetrySampleRate,"Telemetry")||!un(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!un(e.telemetryUsageSampleRate,"Telemetry Usage")||!ni(e.version,"Version")||!ni(e.env,"Env")||!ni(e.service,"Service"))){if(e.trackingConsent!==void 0&&!jr(Qs,e.trackingConsent)){V.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&Ma(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Ah(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(r=e.telemetryConfigurationSampleRate)!==null&&r!==void 0?r:5,telemetryUsageSampleRate:(s=e.telemetryUsageSampleRate)!==null&&s!==void 0?s:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(i=e.trackingConsent)!==null&&i!==void 0?i:Qs.GRANTED,trackAnonymousUser:(o=e.trackAnonymousUser)!==null&&o!==void 0?o:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*Gn,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*_e,batchMessagesLimit:50,messageBytesLimit:256*Gn,...jh(e)}}}function Jh(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent}}var Ut;(function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.MISSING_URL_CONTEXT_TELEMETRY="missing_url_context_telemetry",e.USER_ACCOUNT_TRACE_HEADER="user_account_trace_header",e.PROFILING="profiling"})(Ut||(Ut={}));const ri=new Set;function Zh(e){Array.isArray(e)&&Xh(e.filter(t=>jr(Ut,t)))}function Xh(e){e.forEach(t=>{ri.add(t)})}function ts(e){return ri.has(e)}function Qh(){return ri}const er="?";function Et(e){const t=[];let n=si(e,"stack");const r=String(e);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split(`
|
|
14
|
+
`).forEach(s=>{const i=ng(s)||sg(s)||og(s)||lg(s);i&&(!i.func&&i.line&&(i.func=er),t.push(i))}),{message:si(e,"message"),name:si(e,"name"),stack:t}}const ac="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",dn="(?::(\\d+))",eg=new RegExp(`^\\s*at (.*?) ?\\(${ac}${dn}?${dn}?\\)?\\s*$`,"i"),tg=new RegExp(`\\((\\S*)${dn}${dn}\\)`);function ng(e){const t=eg.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,s=tg.exec(t[2]);return r&&s&&(t[2]=s[1],t[3]=s[2],t[4]=s[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||er,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const rg=new RegExp(`^\\s*at ?${ac}${dn}?${dn}??\\s*$`,"i");function sg(e){const t=rg.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:er,line:t[2]?+t[2]:void 0,url:t[1]}}const ig=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function og(e){const t=ig.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||er,line:+t[3],url:t[2]}}const ag=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,cg=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function lg(e){const t=ag.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,r=cg.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||er,line:t[4]?+t[4]:void 0,url:t[3]}}function si(e,t){if(typeof e!="object"||!e||!(t in e))return;const n=e[t];return typeof n=="string"?n:void 0}function ug(e,t,n,r){const s=[{url:t,column:r,line:n}],{name:i,message:o}=fg(e);return{name:i,message:o,stack:s}}const dg=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function fg(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=dg.exec(e)),{name:t,message:n}}function ns(e){const n=new Error(e);n.name="HandlingStack";let r;return Mt(()=>{const s=Et(n);s.stack=s.stack.slice(2),r=fn(s)}),r}function fn(e){let t=cc(e);return e.stack.forEach(n=>{const r=n.func==="?"?"<anonymous>":n.func,s=n.args&&n.args.length>0?`(${n.args.join(", ")})`:"",i=n.line?`:${n.line}`:"",o=n.line&&n.column?`:${n.column}`:"";t+=`
|
|
15
|
+
at ${r}${s} @ ${n.url}${i}${o}`}),t}function cc(e){return`${e.name||"Error"}: ${e.message}`}function Ne(e,t,n,{computeHandlingStack:r}={}){let s=e[t];if(typeof s!="function")if(t in e&&t.startsWith("on"))s=z;else return{stop:z};let i=!1;const o=function(){if(i)return s.apply(this,arguments);const a=Array.from(arguments);let c;Mt(n,null,[{target:this,parameters:a,onPostCall:u=>{c=u},handlingStack:r?ns("instrumented method"):void 0}]);const l=s.apply(this,a);return c&&Mt(c,null,[l]),l};return e[t]=o,{stop:()=>{i=!0,e[t]===o&&(e[t]=s)}}}function tr(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:z};const s=z;let i=(a,c)=>{pe(()=>{i!==s&&n(a,c)},0)};const o=function(a){r.set.call(this,a),i(this,a)};return Object.defineProperty(e,t,{set:o}),{stop:()=>{var a;((a=Object.getOwnPropertyDescriptor(e,t))===null||a===void 0?void 0:a.set)===o&&Object.defineProperty(e,t,r),i=s}}}const pg=220*Gn,hg="$",gg=3;function oe(e,t=pg){const n=cn(Object.prototype),r=cn(Array.prototype),s=[],i=new WeakMap,o=ii(e,hg,void 0,s,i),a=JSON.stringify(o);let c=a?a.length:0;if(c>t){ai(t,"discarded",e);return}for(;s.length>0&&c<t;){const l=s.shift();let u=0;if(Array.isArray(l.source))for(let d=0;d<l.source.length;d++){const f=ii(l.source[d],l.path,d,s,i);if(f!==void 0?c+=JSON.stringify(f).length:c+=4,c+=u,u=1,c>t){ai(t,"truncated",e);break}l.target[d]=f}else for(const d in l.source)if(Object.prototype.hasOwnProperty.call(l.source,d)){const f=ii(l.source[d],l.path,d,s,i);if(f!==void 0&&(c+=JSON.stringify(f).length+u+d.length+gg,u=1),c>t){ai(t,"truncated",e);break}l.target[d]=f}}return n(),r(),o}function ii(e,t,n,r,s){const i=yg(e);if(!i||typeof i!="object")return mg(i);const o=oi(i);if(o!=="[Object]"&&o!=="[Array]"&&o!=="[Error]")return o;const a=e;if(s.has(a))return`[Reference seen at ${s.get(a)}]`;const c=n!==void 0?`${t}.${n}`:t,l=Array.isArray(i)?[]:{};return s.set(a,c),r.push({source:i,target:l,path:c}),l}function mg(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function oi(e){try{if(e instanceof Event)return bg(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch{}return"[Unserializable]"}function bg(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?oi(e.currentTarget):null,target:e.target?oi(e.target):null}}function yg(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function ai(e,t,n){V.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const lc="No stack, consider using an instance of Error";function uc({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:s,nonErrorPrefix:i,source:o,handling:a}){const c=Ct(t),l=wg(e,c,i,t),u=Sg(c,e)?fn(e):lc,d=c?pc(t,o):void 0,f=e?e.name:void 0,h=dc(t),p=fc(t);return{startClocks:s,source:o,handling:a,handlingStack:n,componentStack:r,originalError:t,type:f,message:l,stack:u,causes:d,fingerprint:h,context:p}}function wg(e,t,n,r){return e!=null&&e.message&&(e!=null&&e.name)?e.message:t?"Empty message":`${n} ${an(oe(r))}`}function Sg(e,t){return t===void 0?!1:e?!0:t.stack.length>0&&(t.stack.length>1||t.stack[0].url!==void 0)}function dc(e){return Ct(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function fc(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function Ct(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function pc(e,t){let n=e;const r=[];for(;Ct(n==null?void 0:n.cause)&&r.length<10;){const s=Et(n.cause);r.push({message:n.cause.message,source:t,type:s==null?void 0:s.name,stack:s&&fn(s)}),n=n.cause}return r.length?r:void 0}const pn={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function _g(e){const t=(s,i)=>{const o=uc({stackTrace:s,originalError:i,startClocks:Te(),nonErrorPrefix:"Uncaught",source:pn.SOURCE,handling:"unhandled"});e.notify(o)},{stop:n}=vg(t),{stop:r}=Eg(t);return{stop:()=>{n(),r()}}}function vg(e){return Ne(window,"onerror",({parameters:[t,n,r,s,i]})=>{let o;Ct(i)?o=Et(i):o=ug(t,n,r,s),e(o,i??t)})}function Eg(e){return Ne(window,"onunhandledrejection",({parameters:[t]})=>{const n=t.reason||"Empty reason",r=Et(n);e(r,n)})}function Cg(e){const t={version:"6.6.3",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return Xp},enumerable:!1}),t}function xg(e,t,n){const r=e[t];r&&!r.q&&r.version&&V.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,r&&r.q&&r.q.forEach(s=>Ma(s,"onReady callback threw an error:")())}function hc(e,t){t.silentMultipleInit||V.error(`${e} is already initialized.`)}function Z(e,t,n,r,s){return Me(e,t,[n],r,s)}function Me(e,t,n,r,{once:s,capture:i,passive:o}={}){const a=$(f=>{!f.isTrusted&&!f.__ddIsTrusted&&!e.allowUntrustedEvents||(s&&d(),r(f))}),c=o?{capture:i,passive:o}:i,l=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,u=St(l,"addEventListener");n.forEach(f=>u.call(t,f,a,c));function d(){const f=St(l,"removeEventListener");n.forEach(h=>f.call(t,h,a,c))}return{stop:d}}const nr={intervention:"intervention",cspViolation:"csp_violation"};function Tg(e,t){const n=[];t.includes(nr.cspViolation)&&n.push(Rg(e));const r=t.filter(s=>s!==nr.cspViolation);return r.length&&n.push(Ag(r)),za(...n)}function Ag(e){return new G(t=>{if(!window.ReportingObserver)return;const n=$((s,i)=>s.forEach(o=>t.notify(kg(o)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function Rg(e){return new G(t=>{const{stop:n}=Z(e,document,"securitypolicyviolation",r=>{t.notify(Ig(r))});return n})}function kg(e){const{type:t,body:n}=e;return gc({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:mc(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function Ig(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return gc({type:e.effectiveDirective,message:`${nr.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:mc(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${Ha(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function gc(e){return{startClocks:Te(),source:pn.REPORT,handling:"unhandled",...e}}function mc(e,t,n,r,s){return n?fn({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:s??void 0}]}):void 0}function ci(e,t){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Vt(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function rs(e,t,n=Og()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const s=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,s)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const s=Array.isArray(e)?e:[];for(let i=0;i<t.length;++i)s[i]=rs(s[i],t[i],n);return s}const r=Vt(e)==="object"?e:{};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=rs(r[s],t[s],n));return r}function li(e){return rs(void 0,e)}function Ye(...e){let t;for(const n of e)n!=null&&(t=rs(t,n));return t}function Og(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(n){const r=t.has(n);return r||t.add(n),r}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}function bc(){var e;const t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function yc(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const Lg=500;function wc(){const e=[];return{add:s=>{e.push(s)>Lg&&e.splice(0,1)},remove:s=>{yc(e,s)},drain:s=>{e.forEach(i=>i(s)),e.length=0}}}const zt={log:"log",configuration:"configuration",usage:"usage"},Pg=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Ng=[Mh];let Sc=wc(),hn=e=>{Sc.add(()=>hn(e))};function Mg(e,t){let n;const r=new G,s=new Set,i=!Ng.includes(t.site)&&wt(t.telemetrySampleRate),o={[zt.log]:i,[zt.configuration]:i&&wt(t.telemetryConfigurationSampleRate),[zt.usage]:i&&wt(t.telemetryUsageSampleRate)},a=Dg();hn=l=>{const u=an(l);if(o[l.type]&&s.size<t.maxTelemetryEventsPerPage&&!s.has(u)){const d=c(e,l,a);r.notify(d),ci("telemetry",d),s.add(u)}},Zp(ui);function c(l,u,d){return Ye({type:"telemetry",date:fe(),service:l,version:"6.6.3",source:"browser",_dd:{format_version:2},telemetry:Ye(u,{runtime_env:d,connectivity:bc(),sdk_setup:"npm"}),experimental_features:Array.from(Qh())},n!==void 0?n():{})}return{setContextProvider:l=>{n=l},observable:r,enabled:i}}function Dg(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function Fg(){Sc.drain()}function Bg(e){return e.site===ic}function ht(e,t){qs(Ur.debug,e,t),hn({type:zt.log,message:e,status:"debug",...t})}function ui(e,t){hn({type:zt.log,status:"error",...Ug(e),...t})}function $g(e){hn({type:zt.configuration,configuration:e})}function Ae(e){hn({type:zt.usage,usage:e})}function Ug(e){if(Ct(e)){const t=Et(e);return{error:{kind:t.name,stack:fn(Vg(t))},message:t.message}}return{error:{stack:lc},message:`Uncaught ${an(e)}`}}function Vg(e){return e.stack=e.stack.filter(t=>!t.url||Pg.some(n=>t.url.startsWith(n))),e}const rr=1/0,zg=Le;let sr=null;const ss=new Set;function Hg(){ss.forEach(e=>e())}function gn({expireDelay:e,maxEntries:t}){let n=[];const r=[];sr||(sr=sn(()=>Hg(),zg));const s=()=>{const h=He()-e;for(;n.length>0&&n[n.length-1].endTime<h;){const p=n.pop();p&&r.push(p.startTime)}};ss.add(s);function i(h,p){const g={value:h,startTime:p,endTime:rr,remove:()=>{yc(n,g)},close:m=>{g.endTime=m}};return t&&n.length>=t&&n.pop(),n.unshift(g),g}function o(h=rr,p={returnInactive:!1}){for(const g of n)if(g.startTime<=h){if(p.returnInactive||h<=g.endTime)return g.value;break}}function a(h){const p=n[0];p&&p.endTime===rr&&p.close(h)}function c(h=rr,p=0){const g=rn(h,p);return n.filter(m=>m.startTime<=g&&h<=m.endTime).map(m=>m.value)}function l(){return n.map(({startTime:h,endTime:p,value:g})=>({startTime:h,endTime:p===rr?"Infinity":p,value:g}))}function u(){return r}function d(){n=[]}function f(){ss.delete(s),ss.size===0&&sr&&(Wr(sr),sr=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f,getAllEntries:l,getDeletedEntries:u}}const jg=Le,Wg=Dt;function qg(e,t,n,r){const s=new G,i=new G,o=Rh(e.sessionStoreStrategyType,e,t,n),a=gn({expireDelay:Wg});o.renewObservable.subscribe(()=>{a.add(c(),He()),s.notify()}),o.expireObservable.subscribe(()=>{i.notify(),a.closeActive(He())}),o.expandOrRenewSession(),a.add(c(),Ba().relative),r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire()}),Kg(e,()=>{r.isGranted()&&o.expandOrRenewSession()}),Gg(e,()=>o.expandSession()),Yg(e,()=>o.restartSession());function c(){return{id:o.getSession().id,trackingType:o.getSession()[t],isReplayForced:!!o.getSession().forcedReplay,anonymousId:o.getSession().anonymousId}}return{findSession:(l,u)=>a.find(l,u),renewObservable:s,expireObservable:i,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function Kg(e,t){const{stop:n}=Me(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function Gg(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Z(e,document,"visibilitychange",n);sn(n,jg)}function Yg(e,t){const{stop:n}=Z(e,window,"resume",t,{capture:!0})}function Jg(e){return e>=500}function Zg(e){try{return e.clone()}catch{return}}const Xg=80*Gn,Qg=32,_c=3*$a,em=Le,vc=_e;function Ec(e,t,n,r,s){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?xc(e,t,n,{onSuccess:()=>Tc(0,t,n,r,s),onFailure:()=>{t.queuedPayloads.enqueue(e),Cc(t,n,r,s)}}):t.queuedPayloads.enqueue(e)}function Cc(e,t,n,r){e.transportStatus===2&&pe(()=>{const s=e.queuedPayloads.first();xc(s,e,t,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=vc,Tc(1,e,t,n,r)},onFailure:()=>{e.currentBackoffTime=Math.min(em,e.currentBackoffTime*2),Cc(e,t,n,r)}})},e.currentBackoffTime)}function xc(e,t,n,{onSuccess:r,onFailure:s}){t.bandwidthMonitor.add(e),n(e,i=>{t.bandwidthMonitor.remove(e),tm(i)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:i.status},s()):(t.transportStatus=0,r())})}function Tc(e,t,n,r,s){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(s({message:`Reached max ${r} events size queued for upload: ${_c/$a}MiB`,source:pn.AGENT,startClocks:Te()}),t.queueFullReported=!0);const i=t.queuedPayloads;for(t.queuedPayloads=Ac();i.size()>0;)Ec(i.dequeue(),t,n,r,s)}function tm(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||Jg(e.status))}function nm(){return{transportStatus:0,currentBackoffTime:vc,bandwidthMonitor:rm(),queuedPayloads:Ac(),queueFullReported:!1}}function Ac(){const e=[];return{bytesCount:0,enqueue(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=_c}}}function rm(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=Xg&&this.ongoingRequestCount<Qg},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}}}function Rc(e,t,n){const r=nm(),s=(i,o)=>om(e,t,i,o);return{send:i=>{Ec(i,r,s,e.trackType,n)},sendOnExit:i=>{sm(e,t,i)}}}function sm(e,t,n){if(!!navigator.sendBeacon&&n.bytesCount<t)try{const s=e.build("beacon",n);if(navigator.sendBeacon(s,n.data))return}catch(s){im(s)}di(e,n)}let kc=!1;function im(e){kc||(kc=!0,pt(e))}function om(e,t,n,r){if(am()&&n.bytesCount<t){const i=e.build("fetch-keepalive",n);fetch(i,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then($(o=>r==null?void 0:r({status:o.status,type:o.type}))).catch($(()=>di(e,n,r)))}else di(e,n,r)}function di(e,t,n){const r=e.build("fetch",t);fetch(r,{method:"POST",body:t.data,mode:"cors"}).then($(s=>n==null?void 0:n({status:s.status,type:s.type}))).catch($(()=>n==null?void 0:n({status:0})))}function am(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function mn(){const e=cm();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){const s=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:s}))}}}function Ic(e){const t=mn();return!!t&&t.getCapabilities().includes(e)}function Ht(e){var t;e===void 0&&(e=(t=tt().location)===null||t===void 0?void 0:t.hostname);const n=mn();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function cm(){return tt().DatadogEventBridge}const bn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function lm(e){return new G(t=>{const{stop:n}=Me(e,window,["visibilitychange","freeze"],s=>{s.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:bn.HIDDEN}):s.type==="freeze"&&t.notify({reason:bn.FROZEN})},{capture:!0}),r=Z(e,window,"beforeunload",()=>{t.notify({reason:bn.UNLOADING})}).stop;return()=>{n(),r()}})}function Oc(e){return qa(bn).includes(e)}function um({encoder:e,request:t,flushController:n,messageBytesLimit:r}){let s={};const i=n.flushObservable.subscribe(d=>u(d));function o(d,f,h){n.notifyBeforeAddMessage(f),h!==void 0?(s[h]=d,n.notifyAfterAddMessage()):e.write(e.isEmpty?d:`
|
|
16
|
+
${d}`,p=>{n.notifyAfterAddMessage(p-f)})}function a(d){return d!==void 0&&s[d]!==void 0}function c(d){const f=s[d];delete s[d];const h=e.estimateEncodedBytesCount(f);n.notifyAfterRemoveMessage(h)}function l(d,f){const h=an(d),p=e.estimateEncodedBytesCount(h);if(p>=r){V.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${zs} ${Vp}/#technical-limitations`);return}a(f)&&c(f),o(h,p,f)}function u(d){const f=qa(s).join(`
|
|
17
|
+
`);s={};const h=Oc(d.reason),p=h?t.sendOnExit:t.send;if(h&&e.isAsync){const g=e.finishSync();g.outputBytesCount&&p(Lc(g));const m=[g.pendingData,f].filter(Boolean).join(`
|
|
18
|
+
`);m&&p({data:m,bytesCount:Ua(m)})}else f&&e.write(e.isEmpty?f:`
|
|
19
|
+
${f}`),e.finish(g=>{p(Lc(g))})}return{flushController:n,add:l,upsert:l,stop:i.unsubscribe}}function Lc(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function dm({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:s}){const i=r.subscribe(p=>u(p.reason)),o=s.subscribe(()=>u("session_expire")),a=new G(()=>()=>{i.unsubscribe(),o.unsubscribe()});let c=0,l=0;function u(p){if(l===0)return;const g=l,m=c;l=0,c=0,h(),a.notify({reason:p,messagesCount:g,bytesCount:m})}let d;function f(){d===void 0&&(d=pe(()=>{u("duration_limit")},n))}function h(){Pe(d),d=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(p){c+p>=t&&u("bytes_limit"),l+=1,c+=p,f()},notifyAfterAddMessage(p=0){c+=p,l>=e?u("messages_limit"):c>=t&&u("bytes_limit")},notifyAfterRemoveMessage(p){c-=p,l-=1,l===0&&h()}}}function fm(e,t,n,r,s,i,o=um){const a=l(e,t),c=n&&l(e,n);function l(u,{endpoint:d,encoder:f}){return o({encoder:f,request:Rc(d,u.batchBytesLimit,r),flushController:dm({messagesLimit:u.batchMessagesLimit,bytesLimit:u.batchBytesLimit,durationLimit:u.flushTimeout,pageMayExitObservable:s,sessionExpireObservable:i}),messageBytesLimit:u.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(u,d=!0){a.add(u),c&&d&&c.add(n.transformMessage?n.transformMessage(u):u)},upsert:(u,d)=>{a.upsert(u,d),c&&c.upsert(n.transformMessage?n.transformMessage(u):u,d)},stop:()=>{a.stop(),c&&c.stop()}}}function pm(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const s=Ua(n);t+=s,e+=n,r&&r(s)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class hm{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(s=>s(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}function fi(e,t,n){let r=0,s=!1;return{isLimitReached(){if(r===0&&pe(()=>{r=0},Le),r+=1,r<=t||s)return s=!1,!1;if(r===t+1){s=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:pn.AGENT,startClocks:Te()})}finally{s=!1}}return!0}}}function pi(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:z}):Z(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function gm(e,t){return new Promise(n=>{pi(e,t,n)})}let hi;const gi=new WeakMap;function mm(e){return hi||(hi=bm(e)),hi}function bm(e){return new G(t=>{const{stop:n}=Ne(XMLHttpRequest.prototype,"open",ym),{stop:r}=Ne(XMLHttpRequest.prototype,"send",i=>{wm(i,e,t)},{computeHandlingStack:!0}),{stop:s}=Ne(XMLHttpRequest.prototype,"abort",Sm);return()=>{n(),r(),s()}})}function ym({target:e,parameters:[t,n]}){gi.set(e,{state:"open",method:String(t).toUpperCase(),url:ei(String(n))})}function wm({target:e,handlingStack:t},n,r){const s=gi.get(e);if(!s)return;const i=s;i.state="start",i.startClocks=Te(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let o=!1;const{stop:a}=Ne(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&c()}),c=()=>{if(l(),a(),o)return;o=!0;const u=s;u.state="complete",u.duration=be(i.startClocks.timeStamp,fe()),u.status=e.status,r.notify(Yn(u))},{stop:l}=Z(n,e,"loadend",c);r.notify(i)}function Sm({target:e}){const t=gi.get(e);t&&(t.isAborted=!0)}let mi;function Pc(){return mi||(mi=_m()),mi}function _m(){return new G(e=>{if(!window.fetch)return;const{stop:t}=Ne(window,"fetch",n=>vm(n,e),{computeHandlingStack:!0});return t})}function vm({parameters:e,onPostCall:t,handlingStack:n},r){const[s,i]=e;let o=i&&i.method;o===void 0&&s instanceof Request&&(o=s.method);const a=o!==void 0?String(o).toUpperCase():"GET",c=s instanceof Request?s.url:ei(String(s)),l=Te(),u={state:"start",init:i,input:s,method:a,startClocks:l,url:c,handlingStack:n};r.notify(u),e[0]=u.input,e[1]=u.init,t(d=>Em(r,d,u))}function Em(e,t,n){const r=n;function s(i){r.state="resolve",Object.assign(r,i),e.notify(r)}t.then($(i=>{s({response:i,responseType:i.type,status:i.status,isAborted:!1})}),$(i=>{var o,a;s({status:0,isAborted:((a=(o=r.init)===null||o===void 0?void 0:o.signal)===null||a===void 0?void 0:a.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function Nc(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback($(e),t);return()=>window.cancelIdleCallback(n)}return xm(e)}const Cm=50;function xm(e){const t=ze(),n=pe(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,Cm-(ze()-t))})},0);return()=>Pe(n)}const Tm=_e,Am=30;function Rm(){const e=[];function t(r){let s;if(r.didTimeout){const i=performance.now();s=()=>Am-(performance.now()-i)}else s=r.timeRemaining.bind(r);for(;s()>0&&e.length;)e.shift()();e.length&&n()}function n(){Nc(t,{timeout:Tm})}return{push(r){e.push(r)===1&&n()}}}let bi={};function km(e){const t=e.map(n=>(bi[n]||(bi[n]=Im(n)),bi[n]));return za(...t)}function Im(e){return new G(t=>{const n=ft[e];return ft[e]=(...r)=>{n.apply(console,r);const s=ns("console error");Mt(()=>{t.notify(Om(r,e,s))})},()=>{ft[e]=n}})}function Om(e,t,n){const r=e.map(i=>Lm(i)).join(" ");let s;if(t===Ur.error){const i=e.find(Ct);s={stack:i?fn(Et(i)):void 0,fingerprint:dc(i),causes:i?pc(i,"console"):void 0,startClocks:Te(),message:r,source:pn.CONSOLE,handling:"handled",handlingStack:n,context:fc(i),originalError:i}}return{api:t,message:r,error:s,handlingStack:n}}function Lm(e){return typeof e=="string"?oe(e):Ct(e)?cc(Et(e)):an(oe(e),void 0,2)}function Pm(e){const t=Vt(e)==="object";return t||V.error("Unsupported context:",e),t}function yi(e,t,n){const r={...e};for(const[s,{required:i,type:o}]of Object.entries(t))o==="string"&&s in r&&(r[s]=String(r[s])),i&&!(s in e)&&V.warn(`The property ${s} of ${n} is required; context will not be sent to the intake.`);return r}function is(e="",{propertiesConfig:t={}}={}){let n={};const r=new G,s={getContext:()=>li(n),setContext:i=>{Pm(i)?n=oe(yi(i,t,e)):s.clearContext(),r.notify()},setContextProperty:(i,o)=>{n=oe(yi({...n,[i]:o},t,e)),r.notify()},removeContextProperty:i=>{delete n[i],yi(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return s}const Nm="_dd_c",Mm=[];function wi(e,t,n,r){const s=Dm(n,r);Mm.push(Z(e,window,"storage",({key:l})=>{s===l&&o()})),t.changeObservable.subscribe(a);const i=Ye(c(),t.getContext());Nt(i)||t.setContext(i);function o(){t.setContext(c())}function a(){localStorage.setItem(s,JSON.stringify(t.getContext()))}function c(){const l=localStorage.getItem(s);return l?JSON.parse(l):{}}}function Dm(e,t){return`${Nm}_${e}_${t}`}const he={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Re={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function Fm(e,t,n){const r=e.getReader();let s=0;i();function i(){r.read().then($(a=>{if(a.done){o();return}s+=a.value.length,s>n.bytesLimit?o():i()}),$(a=>t(a)))}function o(){r.cancel().catch(z),t(void 0,void 0,void 0)}}const Bm="datadog-synthetics-public-id",$m="datadog-synthetics-result-id",Um="datadog-synthetics-injects-rum";function Mc(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||vt(Um))}function Vm(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||vt(Bm);return typeof e=="string"?e:void 0}function zm(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||vt($m);return typeof e=="string"?e:void 0}function Si(e){const t=Vt(e);return t==="string"||t==="function"||e instanceof RegExp}function Dc(e,t,n=!1){return e.some(r=>{try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?t.startsWith(r):r===t}catch(s){V.error(s)}return!1})}function Hm(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function jm(e,t,n){function r(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function s(i){r(i)&&e.notify(12,qm(i))}return{addDurationVital:s,startDurationVital:(i,o={})=>Fc(n,i,o),stopDurationVital:(i,o={})=>{Bc(s,n,i,o)}}}function Fc({vitalsByName:e,vitalsByReference:t},n,r={}){const s={name:n,startClocks:Te(),context:r.context,description:r.description},i={__dd_vital_reference:!0};return e.set(n,s),t.set(i,s),i}function Bc(e,{vitalsByName:t,vitalsByReference:n},r,s={}){const i=typeof r=="string"?t.get(r):n.get(r);i&&(e(Wm(i,i.startClocks,s,Te())),typeof r=="string"?t.delete(r):n.delete(r))}function Wm(e,t,n,r){var s;return{name:e.name,type:"duration",startClocks:t,duration:be(t.timeStamp,r.timeStamp),context:Ye(e.context,n.context),description:(s=n.description)!==null&&s!==void 0?s:e.description}}function qm(e,t){const n={date:e.startClocks.timeStamp,vital:{id:ye(),type:e.type,name:e.name,duration:B(e.duration),description:e.description},type:"vital"};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,customerContext:e.context,domainContext:{}}}function $c(e,t,n){if(e)for(const r of e){const s=r[t];s&&s(n)}}function Km(){return Vc(64)}function Uc(){return Vc(63)}function Vc(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],s=t[0],i="";do{const o=r%n*4294967296+s;r=Math.floor(r/n),s=Math.floor(o/n),i=(o%n).toString(n)+i}while(r||s);return i}}}function yn(e){return e.toString(16).padStart(16,"0")}let os;function Gm(e,t){if(t===100)return!0;if(t===0)return!1;if(os&&e===os.sessionId)return os.decision;let n;return window.BigInt?n=Ym(BigInt(`0x${e.split("-")[4]}`),t):n=wt(t),os={sessionId:e,decision:n},n}function Ym(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),s=e*n%r;return Number(s)<=t/100*Number(r)}function Jm(e){const t=e;return Vt(t)==="object"&&Si(t.match)&&Array.isArray(t.propagatorTypes)}function Zm(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Xm(e,t,n){return{clearTracingIfNeeded:Zm,traceFetch:r=>zc(e,r,t,n,s=>{var i;if(r.input instanceof Request&&!(!((i=r.init)===null||i===void 0)&&i.headers))r.input=new Request(r.input),Object.keys(s).forEach(o=>{r.input.headers.append(o,s[o])});else{r.init=Yn(r.init);const o=[];r.init.headers instanceof Headers?r.init.headers.forEach((a,c)=>{o.push([c,a])}):Array.isArray(r.init.headers)?r.init.headers.forEach(a=>{o.push(a)}):r.init.headers&&Object.keys(r.init.headers).forEach(a=>{o.push([a,r.init.headers[a]])}),r.init.headers=o.concat(Js(s))}}),traceXhr:(r,s)=>zc(e,r,t,n,i=>{Object.keys(i).forEach(o=>{s.setRequestHeader(o,i[o])})})}}function zc(e,t,n,r,s){const i=n.findTrackedSession();if(!i)return;const o=e.allowedTracingUrls.find(l=>Dc([l.match],t.url,!0));if(!o)return;const a=Gm(i.id,e.traceSampleRate);(a||e.traceContextInjection===ti.ALL)&&(t.traceSampled=a,t.traceId=Km(),t.spanId=Uc(),s(Qm(t.traceId,t.spanId,t.traceSampled,o.propagatorTypes,r,e)))}function Qm(e,t,n,r,s,i){const o={};if(r.forEach(a=>{switch(a){case"datadog":{Object.assign(o,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(o,{traceparent:`00-0000000000000000${yn(e)}-${yn(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(o,{b3:`${yn(e)}-${yn(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(o,{"X-B3-TraceId":yn(e),"X-B3-SpanId":yn(t),"X-B3-Sampled":n?"1":"0"});break}}}),ts(Ut.USER_ACCOUNT_TRACE_HEADER)&&i.propagateTraceBaggage){const a=s().user.id,c=s().account.id,l=[];typeof a=="string"&&l.push(`usr.id=${encodeURIComponent(a)}`),typeof c=="string"&&l.push(`account.id=${encodeURIComponent(c)}`),l.length>0&&(o.baggage=l.join(","))}return o}const Hc=["tracecontext","datadog"];function e1(e){var t,n,r,s,i,o,a;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&V.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){V.error("Application ID is not configured, no RUM data will be collected.");return}if(!un(e.sessionReplaySampleRate,"Session Replay")||!un(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){V.error("Excluded Activity Urls should be an array");return}const c=t1(e);if(!c)return;const l=Yh(e);if(!l)return;const u=ts(Ut.PROFILING),d=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,version:e.version||void 0,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:d,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:d===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:qn(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:c,excludedActivityUrls:(r=e.excludedActivityUrls)!==null&&r!==void 0?r:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((s=e.trackUserInteractions)!==null&&s!==void 0)||s),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((o=e.trackLongTasks)!==null&&o!==void 0)||o),subdomain:e.subdomain,defaultPrivacyLevel:jr(Qn,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Qn.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:jr(ti,e.traceContextInjection)?e.traceContextInjection:ti.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:u&&(a=e.profilingSampleRate)!==null&&a!==void 0?a:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...l}}function t1(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){V.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){V.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{Si(n)?t.push({match:n,propagatorTypes:Hc}):Jm(n)?t.push(n):V.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function n1(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{Si(n)?Hc.forEach(r=>t.add(r)):Vt(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function r1(e){var t;const n=Jh(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:n1(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var s;return{name:r.name,...(s=r.getConfigurationTelemetry)===null||s===void 0?void 0:s.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,...n}}const s1="v1";function i1(e,t){a1(e,n=>{t(o1(e,n))})}function o1(e,t){return{...e,...t}}function a1(e,t){const n=new XMLHttpRequest;Z(e,n,"load",function(){if(n.status===200){const r=JSON.parse(n.responseText);t(r.rum)}else jc()}),Z(e,n,"error",function(){jc()}),n.open("GET",c1(e)),n.send()}function c1(e){return`https://sdk-configuration.${oc("rum",e)}/${s1}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function jc(){V.error("Error fetching the remote configuration.")}function l1(e){const t=Wc();return e.storeContextsAcrossPages&&wi(e,t,"rum",2),t}function Wc(){return is("global context")}function u1(e){const t=qc();return e.storeContextsAcrossPages&&wi(e,t,"rum",1),t}function qc(){return is("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}function d1(e){const t=Kc();return e.storeContextsAcrossPages&&wi(e,t,"rum",4),t}function Kc(){return is("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function f1({ignoreInitIfSyntheticsWillInjectRum:e,startDeflateWorker:t},n,r,s){const i=wc(),o=Wc();_i(o,he.globalContext,i);const a=qc();_i(a,he.userContext,i);const c=Kc();_i(c,he.accountContext,i);let l,u,d,f;const h=n.observable.subscribe(g),p={};function g(){if(!d||!f||!n.isGranted())return;h.unsubscribe();let y;if(f.trackViewsManually){if(!l)return;i.remove(l.callback),y=l.options}const _=s(f,u,y);i.drain(_)}function m(y){const _=Ht();if(_&&(y=p1(y)),d=y,$g(r1(y)),f){hc("DD_RUM",y);return}const O=e1(y);if(O){if(!_&&!O.sessionStoreStrategyType){V.warn("No storage available for session. We will not send any data.");return}O.compressIntakeRequests&&!_&&t&&(u=t(O,"Datadog RUM",z),!u)||(f=O,Pc().subscribe(z),n.tryToInit(O.trackingConsent),g())}}const w=y=>{i.add(_=>_.addDurationVital(y))};return{init(y,_){if(!y){V.error("Missing configuration");return}Zh(y.enableExperimentalFeatures),d=y,!(e&&Mc())&&($c(y.plugins,"onInit",{initConfiguration:y,publicApi:_}),y.remoteConfigurationId?i1(y,m):m(y))},get initConfiguration(){return d},getInternalContext:z,stopSession:z,addTiming(y,_=fe()){i.add(O=>O.addTiming(y,_))},startView(y,_=Te()){const O=T=>{T.startView(y,_)};i.add(O),l||(l={options:y,callback:O},g())},setViewName(y){i.add(_=>_.setViewName(y))},setViewContext(y){i.add(_=>_.setViewContext(y))},setViewContextProperty(y,_){i.add(O=>O.setViewContextProperty(y,_))},getViewContext:()=>p,globalContext:o,userContext:a,accountContext:c,addAction(y){i.add(_=>_.addAction(y))},addError(y){i.add(_=>_.addError(y))},addFeatureFlagEvaluation(y,_){i.add(O=>O.addFeatureFlagEvaluation(y,_))},startDurationVital(y,_){return Fc(r,y,_)},stopDurationVital(y,_){Bc(w,r,y,_)},addDurationVital:w}}function p1(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=mn())===null||n===void 0?void 0:n.getPrivacyLevel()}}function _i(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(s=>s[t].setContext(r))})}function h1(e,t,n,r={}){const s=kh(),i=Hm();let o=f1(r,s,i,(u,d,f)=>{const h=e(u,t,n,f,d&&r.createDeflateEncoder?p=>r.createDeflateEncoder(u,d,p):pm,s,i);return t.onRumStart(h.lifeCycle,u,h.session,h.viewHistory,d),n.onRumStart(h.lifeCycle,u,h.session,h.viewHistory),o=g1(o,h),$c(u.plugins,"onRumStart",{strategy:o}),h});const a=$(u=>{const d=typeof u=="object"?u:{name:u};o.startView(d),Ae({feature:"start-view"})});function c(u,d,f){return $((...h)=>(Ae({feature:f}),o[u][d](...h)))}const l=Cg({init:$(u=>{o.init(u,l)}),setTrackingConsent:$(u=>{s.update(u),Ae({feature:"set-tracking-consent",tracking_consent:u})}),setViewName:$(u=>{o.setViewName(u),Ae({feature:"set-view-name"})}),setViewContext:$(u=>{o.setViewContext(u),Ae({feature:"set-view-context"})}),setViewContextProperty:$((u,d)=>{o.setViewContextProperty(u,d),Ae({feature:"set-view-context-property"})}),getViewContext:$(()=>(Ae({feature:"set-view-context-property"}),o.getViewContext())),getInternalContext:$(u=>o.getInternalContext(u)),getInitConfiguration:$(()=>li(o.initConfiguration)),addAction:(u,d)=>{const f=ns("action");Mt(()=>{o.addAction({name:oe(u),context:oe(d),startClocks:Te(),type:"custom",handlingStack:f}),Ae({feature:"add-action"})})},addError:(u,d)=>{const f=ns("error");Mt(()=>{o.addError({error:u,handlingStack:f,context:oe(d),startClocks:Te()}),Ae({feature:"add-error"})})},addTiming:$((u,d)=>{o.addTiming(oe(u),d)}),setGlobalContext:c(he.globalContext,Re.setContext,"set-global-context"),getGlobalContext:c(he.globalContext,Re.getContext,"get-global-context"),setGlobalContextProperty:c(he.globalContext,Re.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:c(he.globalContext,Re.removeContextProperty,"remove-global-context-property"),clearGlobalContext:c(he.globalContext,Re.clearContext,"clear-global-context"),setUser:c(he.userContext,Re.setContext,"set-user"),getUser:c(he.userContext,Re.getContext,"get-user"),setUserProperty:c(he.userContext,Re.setContextProperty,"set-user-property"),removeUserProperty:c(he.userContext,Re.removeContextProperty,"remove-user-property"),clearUser:c(he.userContext,Re.clearContext,"clear-user"),setAccount:c(he.accountContext,Re.setContext,"set-account"),getAccount:c(he.accountContext,Re.getContext,"get-account"),setAccountProperty:c(he.accountContext,Re.setContextProperty,"set-account-property"),removeAccountProperty:c(he.accountContext,Re.removeContextProperty,"remove-account-property"),clearAccount:c(he.accountContext,Re.clearContext,"clear-account"),startView:a,stopSession:$(()=>{o.stopSession(),Ae({feature:"stop-session"})}),addFeatureFlagEvaluation:$((u,d)=>{o.addFeatureFlagEvaluation(oe(u),oe(d)),Ae({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:$(()=>t.getSessionReplayLink()),startSessionReplayRecording:$(u=>{t.start(u),Ae({feature:"start-session-replay-recording",force:u&&u.force})}),stopSessionReplayRecording:$(()=>t.stop()),addDurationVital:$((u,d)=>{Ae({feature:"add-duration-vital"}),o.addDurationVital({name:oe(u),type:"duration",startClocks:Hp(d.startTime),duration:d.duration,context:oe(d&&d.context),description:oe(d&&d.description)})}),startDurationVital:$((u,d)=>(Ae({feature:"start-duration-vital"}),o.startDurationVital(oe(u),{context:oe(d&&d.context),description:oe(d&&d.description)}))),stopDurationVital:$((u,d)=>{Ae({feature:"stop-duration-vital"}),o.stopDurationVital(typeof u=="string"?oe(u):u,{context:oe(d&&d.context),description:oe(d&&d.description)})})});return l}function g1(e,t){return{init:n=>{hc("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function m1(){const e=Gc();return new G(t=>{if(!e)return;const n=new e($(()=>t.notify()));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function Gc(){let e;const t=window;if(t.Zone&&(e=St(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(z),r=St(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function b1(){const e=new G,{stop:t}=Ne(window,"open",()=>e.notify());return{observable:e,stop:t}}function y1(e,t,n,r,s){return{get:i=>{const o=n.findView(i),a=s.findUrl(i),c=t.findTrackedSession(i);if(c&&o&&a){const l=r.findActionId(i);return{application_id:e,session_id:c.id,user_action:l?{id:l}:void 0,view:{id:o.id,name:o.name,referrer:a.referrer,url:a.url}}}}}}const w1=hm,S1=Dt;function _1(e){const t=gn({expireDelay:S1});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const s=t.find(r.startClocks.relative);s&&r.name&&(s.name=r.name),s&&r.context&&(s.context=r.context)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),getAllEntries:()=>t.getAllEntries(),getDeletedEntries:()=>t.getDeletedEntries(),stop:()=>{t.stop()}}}const Yc="initial_document",v1=[["document",e=>Yc===e],["xhr",e=>e==="xmlhttprequest"],["fetch",e=>e==="fetch"],["beacon",e=>e==="beacon"],["css",(e,t)=>/\.css$/i.test(t)],["js",(e,t)=>/\.js$/i.test(t)],["image",(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],["font",(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],["media",(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function E1(e){const t=e.name;if(!Ih(t))return ht(`Failed to construct URL for "${e.name}"`),"other";const n=Oh(t);for(const[r,s]of v1)if(s(e.initiatorType,n))return r;return"other"}function Jc(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function C1(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Zc(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?be(n,r):t}function x1(e){if(!Qc(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:s,redirectEnd:i,domainLookupStart:o,domainLookupEnd:a,connectStart:c,secureConnectionStart:l,connectEnd:u,requestStart:d,responseStart:f,responseEnd:h}=e,p={download:jt(t,f,h),first_byte:jt(t,d,f)};return 0<r&&r<n&&(p.worker=jt(t,r,n)),n<u&&(p.connect=jt(t,c,u),c<=l&&l<=u&&(p.ssl=jt(t,l,u))),n<a&&(p.dns=jt(t,o,a)),t<i&&(p.redirect=jt(t,s,i)),p}function Xc(e){return e.duration>=0}function Qc(e){const t=Jc(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=T1(e)?Jc(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function T1(e){return e.redirectEnd>e.startTime}function jt(e,t,n){if(e<=t&&t<=n)return{duration:B(be(t,n)),start:B(be(e,t))}}function el(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function tl(e){return e.deliveryType===""?"other":e.deliveryType}function A1(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function vi(e){return e&&!Kh(e)}const R1=/data:(.+)?(;base64)?,/g,nl=24e3;function rl(e){return e.length<=nl?!1:e.substring(0,5)==="data:"?(e=e.substring(0,nl),!0):!1}function sl(e){return`${e.match(R1)[0]}[...]`}let il=1;function k1(e,t,n,r){const s=Xm(t,n,r);I1(e,t,s),O1(e,s)}function I1(e,t,n){const r=mm(t).subscribe(s=>{const i=s;if(vi(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=ol(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:"xhr",url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>r.unsubscribe()}}function O1(e,t){const n=Pc().subscribe(r=>{const s=r;if(vi(s.url))switch(s.state){case"start":t.traceFetch(s),s.requestIndex=ol(),e.notify(7,{requestIndex:s.requestIndex,url:s.url});break;case"resolve":L1(s,i=>{t.clearTracingIfNeeded(s),e.notify(8,{duration:i,method:s.method,requestIndex:s.requestIndex,responseType:s.responseType,spanId:s.spanId,startClocks:s.startClocks,status:s.status,traceId:s.traceId,traceSampled:s.traceSampled,type:"fetch",url:s.url,response:s.response,init:s.init,input:s.input,isAborted:s.isAborted,handlingStack:s.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function ol(){const e=il;return il+=1,e}function L1(e,t){const n=e.response&&Zg(e.response);!n||!n.body?t(be(e.startClocks.timeStamp,fe())):Fm(n.body,()=>{t(be(e.startClocks.timeStamp,fe()))},{bytesLimit:Number.POSITIVE_INFINITY})}function al(e){return qn(e)&&e<0?void 0:e}function cl({lifeCycle:e,isChildEvent:t,onChange:n=z}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},s=e.subscribe(13,i=>{var o;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case"error":r.errorCount+=1,n();break;case"action":r.actionCount+=1,i.action.frustration&&(r.frustrationCount+=i.action.frustration.type.length),n();break;case"long_task":r.longTaskCount+=1,n();break;case"resource":!((o=i._dd)===null||o===void 0)&&o.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{s.unsubscribe()},eventCounts:r}}function P1(e,t){const n=ze();let r=!1;const{stop:s}=Me(e,window,["click","mousedown","keydown","touchstart","pointerdown"],a=>{if(!a.cancelable)return;const c={entryType:"first-input",processingStart:He(),processingEnd:He(),startTime:a.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};a.type==="pointerdown"?i(e,c):o(c)},{passive:!0,capture:!0});return{stop:s};function i(a,c){Me(a,window,["pointerup","pointercancel"],l=>{l.type==="pointerup"&&o(c)},{once:!0})}function o(a){if(!r){r=!0,s();const c=a.processingStart-a.startTime;c>=0&&c<ze()-n&&t(a)}}}var H;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(H||(H={}));function nt(e,t){return new G(n=>{if(!window.PerformanceObserver)return;const r=c=>{const l=D1(c);l.length>0&&n.notify(l)};let s,i=!0;const o=new PerformanceObserver($(c=>{i?s=pe(()=>r(c.getEntries())):r(c.getEntries())}));try{o.observe(t)}catch{if([H.RESOURCE,H.NAVIGATION,H.LONG_TASK,H.PAINT].includes(t.type)){t.buffered&&(s=pe(()=>r(performance.getEntriesByType(t.type))));try{o.observe({entryTypes:[t.type]})}catch{return}}}i=!1,N1(e);let a;return!Wt(H.FIRST_INPUT)&&t.type===H.FIRST_INPUT&&({stop:a}=P1(e,c=>{r([c])})),()=>{o.disconnect(),a&&a(),Pe(s)}})}let ir;function N1(e){return!ir&&M1()&&"addEventListener"in performance&&(ir=Z(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{ir==null||ir.stop()}}function M1(){return window.performance!==void 0&&"getEntries"in performance}function Wt(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function D1(e){return e.filter(t=>!F1(t))}function F1(e){return e.entryType===H.RESOURCE&&(!vi(e.name)||!Xc(e))}const ll=100,B1=100;function Ei(e,t,n,r,s,i){const o=U1(e,t,n,r);return $1(o,s,i)}function $1(e,t,n){let r,s=!1;const i=pe($(()=>l({hadActivity:!1})),ll),o=n!==void 0?pe($(()=>l({hadActivity:!0,end:fe()})),n):void 0,a=e.subscribe(({isBusy:u})=>{Pe(i),Pe(r);const d=fe();u||(r=pe($(()=>l({hadActivity:!0,end:d})),B1))}),c=()=>{s=!0,Pe(i),Pe(r),Pe(o),a.unsubscribe()};function l(u){s||(c(),t(u))}return{stop:c}}function U1(e,t,n,r){return new G(s=>{const i=[];let o,a=0;return i.push(t.subscribe(c),n.subscribe(c),nt(r,{type:H.RESOURCE}).subscribe(l=>{l.some(u=>!Ci(r,u.name))&&c()}),e.subscribe(7,l=>{Ci(r,l.url)||(o===void 0&&(o=l.requestIndex),a+=1,c())}),e.subscribe(8,l=>{Ci(r,l.url)||o===void 0||l.requestIndex<o||(a-=1,c())})),()=>{i.forEach(l=>l.unsubscribe())};function c(){s.notify({isBusy:a>0})}})}function Ci(e,t){return Dc(e.excludedActivityUrls,t)}function ul(e){return e.nodeType===Node.TEXT_NODE}function V1(e){return e.nodeType===Node.COMMENT_NODE}function wn(e){return e.nodeType===Node.ELEMENT_NODE}function as(e){return wn(e)&&!!e.shadowRoot}function xi(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&wn(t.host)}function z1(e){return e.childNodes.length>0||as(e)}function dl(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;as(e)&&t(e.shadowRoot)}function cs(e){return xi(e)?e.host:e.parentNode}const M={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Qn.ALLOW,MASK:Qn.MASK,MASK_USER_INPUT:Qn.MASK_USER_INPUT},Ti="data-dd-privacy",H1="hidden",j1="dd-privacy-",xt="***",fl="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",W1={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},q1="x";function rt(e,t,n){if(n&&n.has(e))return n.get(e);const r=cs(e),s=r?rt(r,t,n):t,i=hl(e),o=pl(i,s);return n&&n.set(e,o),o}function pl(e,t){switch(t){case M.HIDDEN:case M.IGNORE:return t}switch(e){case M.ALLOW:case M.MASK:case M.MASK_USER_INPUT:case M.HIDDEN:case M.IGNORE:return e;default:return t}}function hl(e){if(wn(e)){if(e.tagName==="BASE")return M.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return M.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return M.MASK}if(e.matches(Sn(M.HIDDEN)))return M.HIDDEN;if(e.matches(Sn(M.MASK)))return M.MASK;if(e.matches(Sn(M.MASK_USER_INPUT)))return M.MASK_USER_INPUT;if(e.matches(Sn(M.ALLOW)))return M.ALLOW;if(G1(e))return M.IGNORE}}function ls(e,t){switch(t){case M.MASK:case M.HIDDEN:case M.IGNORE:return!0;case M.MASK_USER_INPUT:return ul(e)?gl(e.parentNode):gl(e);default:return!1}}function gl(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!W1[t.tagName]}const K1=e=>e.replace(/\S/g,q1);function ml(e,t,n){var r;const s=(r=e.parentElement)===null||r===void 0?void 0:r.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const o=n;if(s==="SCRIPT")i=xt;else if(o===M.HIDDEN)i=xt;else if(ls(e,o))if(s==="DATALIST"||s==="SELECT"||s==="OPTGROUP"){if(!i.trim())return}else s==="OPTION"?i=xt:i=K1(i);return i}function G1(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),s=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(s)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(s)||/^product:/.test(s)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function Sn(e){return`[${Ti}="${e}"], .${j1}${e}`}const Ai="data-dd-action-name",Y1="Masked Element";function J1(e,{enablePrivacyForActionName:t,actionNameAttribute:n},r){const s=bl(e,Ai)||n&&bl(e,n);return s?{name:s,nameSource:"custom_attribute"}:r===M.MASK?{name:Y1,nameSource:"mask_placeholder"}:yl(e,n,Z1,t)||yl(e,n,X1,t)||{name:"",nameSource:"blank"}}function bl(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return Sl(wl(r.trim()))}const Z1=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return us(e.labels[0],t)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return us(e,t,n)},e=>or(e,"aria-label"),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(s=>e0(e,s)).filter(s=>!!s).map(s=>_l(s,t,n)).join(" "),nameSource:"text_content"}},e=>or(e,"alt"),e=>or(e,"name"),e=>or(e,"title"),e=>or(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return us(e.options[0],t)}],X1=[(e,t,n)=>us(e,t,n)],Q1=10;function yl(e,t,n,r){let s=e,i=0;for(;i<=Q1&&s&&s.nodeName!=="BODY"&&s.nodeName!=="HTML"&&s.nodeName!=="HEAD";){for(const o of n){const a=o(s,t,r);if(a){const{name:c,nameSource:l}=a,u=c&&c.trim();if(u)return{name:Sl(wl(u)),nameSource:l}}}if(s.nodeName==="FORM")break;s=s.parentElement,i+=1}}function wl(e){return e.replace(/\s+/g," ")}function Sl(e){return e.length>100?`${Ha(e,100)} [...]`:e}function e0(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function or(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function us(e,t,n){return{name:_l(e,t,n)||"",nameSource:"text_content"}}function _l(e,t,n){if(!e.isContentEditable){if("innerText"in e){let r=e.innerText;const s=i=>{const o=e.querySelectorAll(i);for(let a=0;a<o.length;a+=1){const c=o[a];if("innerText"in c){const l=c.innerText;l&&l.trim().length>0&&(r=r.replace(l,""))}}};return s(`[${Ai}]`),t&&s(`[${t}]`),n&&s(`${Sn(M.HIDDEN)}, ${Sn(M.MASK)}`),r}return e.textContent}}const vl=[Ai,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],t0=[Cl,r0],n0=[Cl,s0,i0];function ar(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const s=xl(r,t0,a0,t,n);if(s)return s;n=xl(r,n0,c0,t,n)||ds(o0(r),n),r=r.parentElement}return n}function El(e){return/[0-9]/.test(e)}function r0(e){if(e.id&&!El(e.id))return`#${CSS.escape(e.id)}`}function s0(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!El(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function i0(e){return CSS.escape(e.tagName)}function Cl(e,t){if(t){const r=n(t);if(r)return r}for(const r of vl){const s=n(r);if(s)return s}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function o0(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function xl(e,t,n,r,s){for(const i of t){const o=i(e,r);if(o&&n(e,o,s))return ds(o,s)}}function a0(e,t,n){return e.ownerDocument.querySelectorAll(ds(t,n)).length===1}function c0(e,t,n){let r;if(n===void 0)r=o=>o.matches(t);else{const o=ds(`${t}:scope`,n);r=a=>a.querySelector(o)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&r(i))return!1;i=i.nextElementSibling}return!0}function ds(e,t){return t?`${e}>${t}`:e}const Tl=_e,l0=100;function u0(e,t){const n=[];let r=0,s;i(e);function i(c){c.stopObservable.subscribe(o),n.push(c),Pe(s),s=pe(a,Tl)}function o(){r===1&&n.every(c=>c.isStopped())&&(r=2,t(n))}function a(){Pe(s),r===0&&(r=1,o())}return{tryAppend:c=>r!==0?!1:n.length>0&&!d0(n[n.length-1].event,c.event)?(a(),!1):(i(c),!0),stop:()=>{a()}}}function d0(e,t){return e.target===t.target&&f0(e,t)<=l0&&e.timeStamp-t.timeStamp<=Tl}function f0(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function p0(e,{onPointerDown:t,onPointerUp:n}){let r,s={selection:!1,input:!1,scroll:!1},i;const o=[Z(e,window,"pointerdown",a=>{Rl(a)&&(r=Al(),s={selection:!1,input:!1,scroll:!1},i=t(a))},{capture:!0}),Z(e,window,"selectionchange",()=>{(!r||!Al())&&(s.selection=!0)},{capture:!0}),Z(e,window,"scroll",()=>{s.scroll=!0},{capture:!0,passive:!0}),Z(e,window,"pointerup",a=>{if(Rl(a)&&i){const c=s;n(i,a,()=>c),i=void 0}},{capture:!0}),Z(e,window,"input",()=>{s.input=!0},{capture:!0})];return{stop:()=>{o.forEach(a=>a.stop())}}}function Al(){const e=window.getSelection();return!e||e.isCollapsed}function Rl(e){return e.target instanceof Element&&e.isPrimary!==!1}const kl=3;function h0(e,t){if(g0(e))return t.addFrustration("rage_click"),e.some(Il)&&t.addFrustration("dead_click"),t.hasError&&t.addFrustration("error_click"),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration("error_click"),Il(r)&&!n&&r.addFrustration("dead_click")}),{isRage:!1}}function g0(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(kl-1);t+=1)if(e[t+kl-1].event.timeStamp-e[t].event.timeStamp<=_e)return!0;return!1}const m0='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Il(e){return e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll?!1:!e.event.target.matches(m0)}const Ol=10*_e,cr=new Map;function b0(e){const t=cr.get(e);return cr.delete(e),t}function Ll(e,t){cr.set(e,t),cr.forEach((n,r)=>{be(r,He())>Ol&&cr.delete(r)})}const y0=5*Le;function w0(e,t,n,r){const s=gn({expireDelay:y0}),i=new G;let o;e.subscribe(10,()=>{s.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===bn.UNLOADING&&u()});const{stop:a}=p0(r,{onPointerDown:d=>S0(r,e,t,d,n),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},h,p)=>{_0(r,e,t,n,s,i,l,d,h,p,f)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:d=>s.findAll(d)}};function l(d){if(!o||!o.tryAppend(d)){const f=d.clone();o=u0(d,h=>{E0(h,f)})}}function u(){o&&o.stop()}}function S0(e,t,n,r,s){const i=e.enablePrivacyForActionName?rt(r.target,e.defaultPrivacyLevel):M.ALLOW;if(i===M.HIDDEN)return;const o=v0(r,i,e);let a=!1;return Ei(t,n,s,e,c=>{a=c.hadActivity},ll),{clickActionBase:o,hadActivityOnPointerDown:()=>a}}function _0(e,t,n,r,s,i,o,a,c,l,u){var d;const f=Pl(t,s,l,a,c);o(f);const h=(d=a==null?void 0:a.target)===null||d===void 0?void 0:d.selector;h&&Ll(c.timeStamp,h);const{stop:p}=Ei(t,n,r,e,w=>{w.hadActivity&&w.end<f.startClocks.timeStamp?f.discard():w.hadActivity?f.stop(w.end):u()?f.stop(f.startClocks.timeStamp):f.stop()},Ol),g=t.subscribe(5,({endClocks:w})=>{f.stop(w.timeStamp)}),m=i.subscribe(()=>{f.stop()});f.stopObservable.subscribe(()=>{g.unsubscribe(),p(),m.unsubscribe()})}function v0(e,t,n){const r=e.target.getBoundingClientRect(),s=ar(e.target,n.actionNameAttribute);s&&Ll(e.timeStamp,s);const i=J1(e.target,n,t);return{type:"click",target:{width:Math.round(r.width),height:Math.round(r.height),selector:s},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:i.name,nameSource:i.nameSource}}function Pl(e,t,n,r,s){const i=ye(),o=Te(),a=t.add(i,o.relative),c=cl({lifeCycle:e,isChildEvent:p=>p.action!==void 0&&(Array.isArray(p.action.id)?p.action.id.includes(i):p.action.id===i)});let l=0,u;const d=[],f=new G;function h(p){l===0&&(u=p,l=1,u?a.close(Hs(u)):a.remove(),c.stop(),f.notify())}return{event:s,stop:h,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return u!==void 0},getUserActivity:n,addFrustration:p=>{d.push(p)},startClocks:o,isStopped:()=>l===1||l===2,clone:()=>Pl(e,t,n,r,s),validate:p=>{if(h(),l!==1)return;const{resourceCount:g,errorCount:m,longTaskCount:w}=c.eventCounts,v={duration:u&&be(o.timeStamp,u),startClocks:o,id:i,frustrationTypes:d,counts:{resourceCount:g,errorCount:m,longTaskCount:w},events:p??[s],event:s,...r};e.notify(0,v),l=2},discard:()=>{h(),l=2}}}function E0(e,t){const{isRage:n}=h0(e,t);n?(e.forEach(r=>r.discard()),t.stop(fe()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function C0(e,t,n,r,s){e.subscribe(0,a=>e.notify(12,Nl(a))),t.register(0,({startTime:a,eventType:c})=>{if(c!=="error"&&c!=="resource"&&c!=="long_task")return;const l=i.findActionId(a);if(l)return{type:c,action:{id:l}}});let i={findActionId:z},o=z;return s.trackUserInteractions&&({actionContexts:i,stop:o}=w0(e,n,r,s)),{addAction:a=>{e.notify(12,Nl(a))},actionContexts:i,stop:o}}function Nl(e){const t=fs(e)?{action:{id:e.id,loading_time:al(B(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:void 0,n=Ye({action:{id:ye(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:"action"},t),r=fs(e)?e.duration:void 0,s=fs(e)?void 0:e.context,i=fs(e)?{events:e.events}:{handlingStack:e.handlingStack};return{customerContext:s,rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function fs(e){return e.type!=="custom"}function x0(e){const t=km([Ur.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function T0(e,t){const n=Tg(e,[nr.cspViolation,nr.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function A0(e,t){const n=new G;return x0(n),_g(n),T0(t,n),n.subscribe(r=>e.notify(14,{error:r})),R0(e)}function R0(e){return e.subscribe(14,({error:t,customerContext:n})=>{n=Ye(t.context,n),e.notify(12,{customerContext:n,...k0(t)})}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:s,context:i})=>{const o=Ct(t)?Et(t):void 0,a=uc({stackTrace:o,originalError:t,handlingStack:n,componentStack:r,startClocks:s,nonErrorPrefix:"Provided",source:pn.CUSTOM,handling:"handled"});e.notify(14,{customerContext:i,error:a})}}}function k0(e){const t={date:e.startClocks.timeStamp,error:{id:ye(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:"error"},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const Ml=new WeakSet;function I0(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!Ml.has(r)).filter(r=>Xc(r)&&Qc(r)).filter(r=>O0(r,e.startClocks.relative,Dl({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return Ml.add(n[0]),n[0].toJSON()}function Dl(e){return rn(e.startTime,e.duration)}function O0(e,t,n){return e.startTime>=t-1&&Dl(e)<=rn(n,1)}const L0=2*Le;function P0(e){const t=N0(e)||M0(e);if(!(!t||t.traceTime<=ze()-L0))return t.traceId}function N0(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return Fl(t&&t.content,n&&n.content)}function M0(e){const t=D0(e);if(t)return Fl(Jn(t,"trace-id"),Jn(t,"trace-time"))}function Fl(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function D0(e){for(let t=0;t<e.childNodes.length;t+=1){const n=Bl(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=Bl(n);if(r)return r;if(!ul(n))break}}function Bl(e){if(e&&V1(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function $l(){if(Wt(H.NAVIGATION)){const n=performance.getEntriesByType(H.NAVIGATION)[0];if(n)return n}const e=F0(),t={entryType:H.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function F0(){const e={},t=performance.timing;for(const n in t)if(qn(t[n])){const r=n,s=t[r];e[r]=s===0?0:Hs(s)}return e}function B0(e,t,n=$l){pi(e,"interactive",()=>{const r=n(),s=Object.assign(r.toJSON(),{entryType:H.RESOURCE,initiatorType:Yc,duration:r.responseEnd,traceId:P0(document),toJSON:()=>({...s,toJSON:void 0})});t(s)})}function $0(e,t,n,r=Rm(),s=B0){e.subscribe(8,a=>{o(()=>U0(a,t,n))});const i=nt(t,{type:H.RESOURCE,buffered:!0}).subscribe(a=>{for(const c of a)C1(c)||o(()=>Ul(c,t))});s(t,a=>{o(()=>Ul(a,t))});function o(a){r.push(()=>{const c=a();c&&e.notify(12,c)})}return{stop:()=>{i.unsubscribe()}}}function U0(e,t,n){const r=I0(e),s=r?Hr(r.startTime):e.startClocks,i=V0(e,t);if(!t.trackResources&&!i)return;const o=e.type==="xhr"?"xhr":"fetch",a=r?Vl(r):void 0,c=r?Zc(r):H0(n,s,e.duration),l=Ye({date:s.timeStamp,resource:{id:ye(),type:o,duration:B(c),method:e.method,status_code:e.status,protocol:r&&el(r),url:rl(e.url)?sl(e.url):e.url,delivery_type:r&&tl(r)},type:"resource",_dd:{discarded:!t.trackResources}},i,a);return{startTime:s.relative,duration:c,rawRumEvent:l,domainContext:{performanceEntry:r,xhr:e.xhr,response:e.response,requestInput:e.input,requestInit:e.init,error:e.error,isAborted:e.isAborted,handlingStack:e.handlingStack}}}function Ul(e,t){const n=Hr(e.startTime),r=z0(e,t);if(!t.trackResources&&!r)return;const s=E1(e),i=Vl(e),o=Zc(e),a=Ye({date:n.timeStamp,resource:{id:ye(),type:s,duration:B(o),url:e.name,status_code:j0(e.responseStatus),protocol:el(e),delivery_type:tl(e)},type:"resource",_dd:{discarded:!t.trackResources}},r,i);return{startTime:n.relative,duration:o,rawRumEvent:a,domainContext:{performanceEntry:e}}}function Vl(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...A1(e),...x1(e)}}}function V0(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function z0(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Uc().toString(),rule_psr:t.rulePsr}}}function H0(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function j0(e){return e===0?void 0:e}function W0(e,t,n){const{stop:r,eventCounts:s}=cl({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:r,eventCounts:s}}const q0=10*Le;function K0(e,t,n){return{stop:nt(e,{type:H.PAINT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.name==="first-contentful-paint"&&o.startTime<t.timeStamp&&o.startTime<q0);i&&n(i.startTime)}).unsubscribe}}function G0(e,t,n){const r=nt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(s=>{const i=s.find(o=>o.startTime<t.timeStamp);if(i){const o=be(i.startTime,i.processingStart);let a;i.target&&wn(i.target)&&(a=ar(i.target,e.actionNameAttribute)),n({delay:o>=0?o:0,time:i.startTime,targetSelector:a})}});return{stop:()=>{r.unsubscribe()}}}function Y0(e,t,n=$l){return X0(e,()=>{const r=n();Z0(r)||t(J0(r))})}function J0(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=He()?e.responseStart:void 0}}function Z0(e){return e.loadEventEnd<=0}function X0(e,t){let n;const{stop:r}=pi(e,"complete",()=>{n=pe(()=>t())});return{stop:()=>{r(),Pe(n)}}}const Q0=10*Le;function eb(e,t,n,r){let s=1/0;const{stop:i}=Me(e,n,["pointerdown","keydown"],c=>{s=c.timeStamp},{capture:!0,once:!0});let o=0;const a=nt(e,{type:H.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(c=>{const l=ih(c,u=>u.entryType===H.LARGEST_CONTENTFUL_PAINT&&u.startTime<s&&u.startTime<t.timeStamp&&u.startTime<Q0&&u.size>o);if(l){let u;l.element&&(u=ar(l.element,e.actionNameAttribute)),r({value:l.startTime,targetSelector:u,resourceUrl:tb(l)}),o=l.size}});return{stop:()=>{i(),a.unsubscribe()}}}function tb(e){return e.url===""?void 0:e.url}function zl(e,t=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:z};if(Wt(H.VISIBILITY_STATE)){const s=performance.getEntriesByType(H.VISIBILITY_STATE).find(i=>i.name==="hidden");if(s)return{timeStamp:s.startTime,stop:z}}let n=1/0;const{stop:r}=Me(e,t,["pagehide","visibilitychange"],s=>{(s.type==="pagehide"||document.visibilityState==="hidden")&&(n=s.timeStamp,r())},{capture:!0});return{get timeStamp(){return n},stop:r}}function nb(e,t,n){const r={},{stop:s}=Y0(e,u=>{t(u.loadEvent),r.navigationTimings=u,n()}),i=zl(e),{stop:o}=K0(e,i,u=>{r.firstContentfulPaint=u,n()}),{stop:a}=eb(e,i,window,u=>{r.largestContentfulPaint=u,n()}),{stop:c}=G0(e,i,u=>{r.firstInput=u,n()});function l(){s(),o(),a(),c(),i.stop()}return{stop:l,initialViewMetrics:r}}function rb(e,t,n){if(!cb())return{stop:z};let r=0,s;n({value:0});const i=ab(),o=nt(e,{type:H.LAYOUT_SHIFT,buffered:!0}).subscribe(a=>{var c;for(const l of a){if(l.hadRecentInput||l.startTime<t)continue;const{cumulatedValue:u,isMaxValue:d}=i.update(l);if(d){const f=sb(l.sources);s={target:f!=null&&f.node?new WeakRef(f.node):void 0,time:be(t,l.startTime),previousRect:f==null?void 0:f.previousRect,currentRect:f==null?void 0:f.currentRect,devicePixelRatio:window.devicePixelRatio}}if(u>r){r=u;const f=(c=s==null?void 0:s.target)===null||c===void 0?void 0:c.deref();n({value:zr(r,4),targetSelector:f&&ar(f,e.actionNameAttribute),time:s==null?void 0:s.time,previousRect:s!=null&&s.previousRect?Hl(s.previousRect):void 0,currentRect:s!=null&&s.currentRect?Hl(s.currentRect):void 0,devicePixelRatio:s==null?void 0:s.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function sb(e){return e.find(t=>!!t.node&&wn(t.node))}function Hl({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const ib=5*_e,ob=_e;function ab(){let e=0,t,n,r=0;return{update:s=>{const i=t===void 0||s.startTime-n>=ob||s.startTime-t>=ib;let o;return i?(t=n=s.startTime,r=e=s.value,o=!0):(e+=s.value,n=s.startTime,o=s.value>r,o&&(r=s.value)),{cumulatedValue:e,isMaxValue:o}}}}function cb(){return Wt(H.LAYOUT_SHIFT)&&"WeakRef"in window}let ps,jl=0,Ri=1/0,ki=0;function lb(){"interactionCount"in performance||ps||(ps=new window.PerformanceObserver($(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(Ri=Math.min(Ri,n.interactionId),ki=Math.max(ki,n.interactionId),jl=(ki-Ri)/7+1)})})),ps.observe({type:"event",buffered:!0,durationThreshold:0}))}const Wl=()=>ps?jl:window.performance.interactionCount||0,ql=10,ub=1*Le;function db(e,t,n){if(!hb())return{getInteractionToNextPaint:()=>{},setViewEnd:z,stop:z};const{getViewInteractionCount:r,stopViewInteractionCount:s}=pb(n);let i=1/0;const o=fb(r);let a=-1,c,l;function u(h){for(const g of h)g.interactionId&&g.startTime>=t&&g.startTime<=i&&o.process(g);const p=o.estimateP98Interaction();p&&p.duration!==a&&(a=p.duration,l=be(t,p.startTime),c=b0(p.startTime),!c&&p.target&&wn(p.target)&&(c=ar(p.target,e.actionNameAttribute)))}const d=nt(e,{type:H.FIRST_INPUT,buffered:!0}).subscribe(u),f=nt(e,{type:H.EVENT,durationThreshold:40,buffered:!0}).subscribe(u);return{getInteractionToNextPaint:()=>{if(a>=0)return{value:Math.min(a,ub),targetSelector:c,time:l};if(r())return{value:0}},setViewEnd:h=>{i=h,s()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function fb(e){const t=[];function n(){t.sort((r,s)=>s.duration-r.duration).splice(ql)}return{process(r){const s=t.findIndex(o=>r.interactionId===o.interactionId),i=t[t.length-1];s!==-1?r.duration>t[s].duration&&(t[s]=r,n()):(t.length<ql||r.duration>i.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function pb(e){lb();const t=e==="initial_load"?0:Wl();let n={stopped:!1};function r(){return Wl()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function hb(){return Wt(H.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function gb(e,t,n,r,s,i,o){let a=s==="initial_load",c=!0;const l=[],u=zl(r);function d(){if(!c&&!a&&l.length>0){const h=Math.max(...l);h<u.timeStamp&&o(h)}}const{stop:f}=Ei(e,t,n,r,h=>{c&&(c=!1,h.hadActivity&&l.push(be(i.timeStamp,h.end)),d())});return{stop:()=>{f(),u.stop()},setLoadEvent:h=>{a&&(a=!1,l.push(h),d())}}}function Kl(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Ii(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Oi;function Gl(e){return Oi||(Oi=mb(e)),Oi}function mb(e){return new G(t=>{const{throttled:n}=_t(()=>{t.notify(hs())},200);return Z(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function hs(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const bb=_e;function yb(e,t,n,r=Sb(e)){let s=0,i=0,o=0;const a=r.subscribe(({scrollDepth:c,scrollTop:l,scrollHeight:u})=>{let d=!1;if(c>s&&(s=c,d=!0),u>i){i=u;const f=He();o=be(t.relative,f),d=!0}d&&n({maxDepth:Math.min(s,i),maxDepthScrollTop:l,maxScrollHeight:i,maxScrollHeightTime:o})});return{stop:()=>a.unsubscribe()}}function wb(){const e=Ii(),{height:t}=hs(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function Sb(e,t=bb){return new G(n=>{function r(){n.notify(wb())}if(window.ResizeObserver){const s=_t(r,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,o=new ResizeObserver($(s.throttled));i&&o.observe(i);const a=Z(e,window,"scroll",s.throttled,{passive:!0});return()=>{s.cancel(),o.disconnect(),a.stop()}}})}function _b(e,t,n,r,s,i,o){const a={},{stop:c,setLoadEvent:l}=gb(e,t,n,r,i,o,g=>{a.loadingTime=g,s()}),{stop:u}=yb(r,o,g=>{a.scroll=g}),{stop:d}=rb(r,o.relative,g=>{a.cumulativeLayoutShift=g,s()}),{stop:f,getInteractionToNextPaint:h,setViewEnd:p}=db(r,o.relative,i);return{stop:()=>{c(),d(),u()},stopINPTracking:f,setLoadEvent:l,setViewEnd:p,getCommonViewMetrics:()=>(a.interactionToNextPaint=h(),a)}}const vb=3e3,Eb=5*Le,Cb=5*Le;function xb(e,t,n,r,s,i,o,a){const c=new Set;let l=d("initial_load",Ba(),a);f();let u;o&&(u=h(i));function d(p,g,m){const w=Tb(t,n,r,s,e,p,g,m);return c.add(w),w.stopObservable.subscribe(()=>{c.delete(w)}),w}function f(){t.subscribe(10,()=>{l=d("route_change",void 0,{name:l.name,service:l.service,version:l.version,context:l.contextManager.getContext()})}),t.subscribe(9,()=>{l.end({sessionIsActive:!1})})}function h(p){return p.subscribe(({oldLocation:g,newLocation:m})=>{Rb(g,m)&&(l.end(),l=d("route_change"))})}return{addTiming:(p,g=fe())=>{l.addTiming(p,g)},startView:(p,g)=>{l.end({endClocks:g}),l=d("route_change",g,p)},setViewContext:p=>{l.contextManager.setContext(p)},setViewContextProperty:(p,g)=>{l.contextManager.setContextProperty(p,g)},setViewName:p=>{l.setViewName(p)},getViewContext:()=>l.contextManager.getContext(),stop:()=>{u&&u.unsubscribe(),l.end(),c.forEach(p=>p.stop())}}}function Tb(e,t,n,r,s,i,o=Te(),a){const c=ye(),l=new G,u={};let d=0,f;const h=Yn(s),p=is();let g=!0,m=a==null?void 0:a.name;const w=(a==null?void 0:a.service)||r.service,v=(a==null?void 0:a.version)||r.version,y=a==null?void 0:a.context;y&&p.setContext(y);const _={id:c,name:m,startClocks:o,service:w,version:v,context:y};e.notify(1,_),e.notify(2,_);const{throttled:O,cancel:T}=_t(re,vb,{leading:!1}),{setLoadEvent:b,setViewEnd:k,stop:x,stopINPTracking:I,getCommonViewMetrics:R}=_b(e,t,n,r,X,i,o),{stop:L,initialViewMetrics:P}=i==="initial_load"?nb(r,b,X):{stop:z,initialViewMetrics:{}},{stop:N,eventCounts:Q}=W0(e,c,X),me=sn(re,Eb),Ve=e.subscribe(11,ee=>{ee.reason===bn.UNLOADING&&re()});re(),p.changeObservable.subscribe(X);function Ke(){e.notify(3,{id:c,name:m,context:p.getContext(),startClocks:o})}function X(){Ke(),O()}function re(){T(),Ke(),d+=1;const ee=f===void 0?fe():f.timeStamp;e.notify(4,{customTimings:u,documentVersion:d,id:c,name:m,service:w,version:v,context:p.getContext(),loadingType:i,location:h,startClocks:o,commonViewMetrics:R(),initialViewMetrics:P,duration:be(o.timeStamp,ee),isActive:f===void 0,sessionIsActive:g,eventCounts:Q})}return{get name(){return m},service:w,version:v,contextManager:p,stopObservable:l,end(ee={}){var ke,Ee;f||(f=(ke=ee.endClocks)!==null&&ke!==void 0?ke:Te(),g=(Ee=ee.sessionIsActive)!==null&&Ee!==void 0?Ee:!0,e.notify(5,{endClocks:f}),e.notify(6,{endClocks:f}),Wr(me),k(f.relative),x(),Ve.unsubscribe(),re(),pe(()=>{this.stop()},Cb))},stop(){L(),N(),I(),l.notify()},addTiming(ee,ke){if(f)return;const Ee=Kp(ke)?ke:be(o.timeStamp,ke);u[Ab(ee)]=Ee,X()},setViewName(ee){m=ee,re()}}}function Ab(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&V.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Rb(e,t){return e.pathname!==t.pathname||!kb(t.hash)&&Yl(t.hash)!==Yl(e.hash)}function kb(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function Yl(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Ib(e,t,n,r,s,i,o,a,c,l){return e.subscribe(4,u=>e.notify(12,Ob(u,n,a))),t.register(0,({startTime:u,eventType:d})=>{const{service:f,version:h,id:p,name:g,context:m}=c.findView(u);return{type:d,service:f,version:h,context:m,view:{id:p,name:g}}}),xb(r,e,s,i,n,o,!n.trackViewsManually,l)}function Ob(e,t,n){var r,s,i,o,a,c,l,u,d,f,h,p,g,m,w,v,y,_;const O=n.getReplayStats(e.id),T=(s=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||s===void 0?void 0:s.devicePixelRatio,b={_dd:{document_version:e.documentVersion,replay_stats:O,cls:T?{device_pixel_ratio:T}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:"view",view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:B((o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.time),cumulative_layout_shift_target_selector:(a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.targetSelector,first_byte:B((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:B((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.domComplete),dom_content_loaded:B((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domContentLoaded),dom_interactive:B((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:B(e.initialViewMetrics.firstContentfulPaint),first_input_delay:B((f=e.initialViewMetrics.firstInput)===null||f===void 0?void 0:f.delay),first_input_time:B((h=e.initialViewMetrics.firstInput)===null||h===void 0?void 0:h.time),first_input_target_selector:(p=e.initialViewMetrics.firstInput)===null||p===void 0?void 0:p.targetSelector,interaction_to_next_paint:B((g=e.commonViewMetrics.interactionToNextPaint)===null||g===void 0?void 0:g.value),interaction_to_next_paint_time:B((m=e.commonViewMetrics.interactionToNextPaint)===null||m===void 0?void 0:m.time),interaction_to_next_paint_target_selector:(w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:B((v=e.initialViewMetrics.largestContentfulPaint)===null||v===void 0?void 0:v.value),largest_contentful_paint_target_selector:(y=e.initialViewMetrics.largestContentfulPaint)===null||y===void 0?void 0:y.targetSelector,load_event:B((_=e.initialViewMetrics.navigationTimings)===null||_===void 0?void 0:_.loadEvent),loading_time:al(B(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Lb(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:B(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:B(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:O?!0:void 0,is_active:e.sessionIsActive?void 0:!1},privacy:{replay_level:t.defaultPrivacyLevel}};return Nt(e.customTimings)||(b.view.custom_timings=Jp(e.customTimings,B)),{rawRumEvent:b,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Lb({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:s}){return{cls:e&&{score:e.value,timestamp:B(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:B(n)},fid:r&&{duration:B(r.delay),timestamp:B(r.time),target_selector:r.targetSelector},inp:t&&{duration:B(t.value),timestamp:B(t.time),target_selector:t.targetSelector},lcp:s&&{timestamp:B(s.value),target_selector:s.targetSelector,resource_url:s.resourceUrl}}}const Pb="rum";function Nb(e,t,n){const r=qg(e,Pb,s=>Db(e,s),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:s,newState:i})=>{if(!s.forcedReplay&&i.forcedReplay){const o=r.findSession();o&&(o.isReplayForced=!0)}}),{findTrackedSession:s=>{const i=r.findSession(s);if(!(!i||!Jl(i.trackingType)))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function Mb(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Ic("records")?1:0};return{findTrackedSession:()=>e,expire:z,expireObservable:new G,setForcedReplay:z}}function Db(e,t){let n;return Fb(t)?n=t:wt(e.sessionSampleRate)?wt(e.sessionReplaySampleRate)?n="1":n="2":n="0",{trackingType:n,isTracked:Jl(n)}}function Fb(e){return e==="0"||e==="1"||e==="2"}function Jl(e){return e==="2"||e==="1"}function Bb(e,t,n,r,s,i,o){const a=e.replica,c=fm(e,{endpoint:e.rumEndpointBuilder,encoder:o(2)},a&&{endpoint:a.rumEndpointBuilder,transformMessage:l=>Ye(l,{application:{id:a.applicationId}}),encoder:o(3)},r,s,i);return t.subscribe(13,l=>{l.type==="view"?c.upsert(l,l.view.id):c.add(l)}),n.subscribe(l=>c.add(l,Bg(e))),c}function $b(e){const t=mn();e.subscribe(13,n=>{t.send("rum",n)})}const Ub=Dt;function Vb(e,t,n,r){const s=gn({expireDelay:Ub});let i;e.subscribe(1,({startClocks:c})=>{const l=r.href;s.add(a({url:l,referrer:i||document.referrer}),c.relative),i=l}),e.subscribe(6,({endClocks:c})=>{s.closeActive(c.relative)});const o=n.subscribe(({newLocation:c})=>{const l=s.find();if(l){const u=He();s.closeActive(u),s.add(a({url:c.href,referrer:l.referrer}),u)}});function a({url:c,referrer:l}){return{url:c,referrer:l}}return t.register(0,({startTime:c,eventType:l})=>{const{url:u,referrer:d}=s.find(c);return{type:l,view:{url:u,referrer:d}}}),{findUrl:c=>s.find(c),getAllEntries:()=>s.getAllEntries(),getDeletedEntries:()=>s.getDeletedEntries(),stop:()=>{o.unsubscribe(),s.stop()}}}function zb(e,t){let n=Yn(t);return new G(r=>{const{stop:s}=Hb(e,o),{stop:i}=jb(e,o);function o(){if(n.href===t.href)return;const a=Yn(t);r.notify({newLocation:a,oldLocation:n}),n=a}return()=>{s(),i()}})}function Hb(e,t){const{stop:n}=Ne(Zl("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:r}=Ne(Zl("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:s}=Z(e,window,"popstate",t);return{stop:()=>{n(),r(),s()}}}function jb(e,t){return Z(e,window,"hashchange",t)}function Zl(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Wb=Dt;function qb(e,t,n){const r=gn({expireDelay:Wb});return e.subscribe(1,({startClocks:s})=>{r.add({},s.relative)}),e.subscribe(6,({endClocks:s})=>{r.closeActive(s.relative)}),t.register(0,({startTime:s,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat(["view","error"]).includes(i))return;const a=r.find(s);if(!(!a||Nt(a)))return{type:i,feature_flags:a}}),{addFeatureFlagEvaluation:(s,i)=>{const o=r.find();o&&(o[s]=i)}}}const Kb=10*_e;let _n,Li;function Gb(e,t,n,r){t.enabled&&wt(e.customerDataTelemetrySampleRate)&&(eu(),Li=!1,n.subscribe(13,()=>{Li=!0}),r.subscribe(({bytesCount:i,messagesCount:o})=>{Li&&(_n.batchCount+=1,Ql(_n.batchBytesCount,i),Ql(_n.batchMessagesCount,o))}),sn(Yb,Kb))}function Yb(){_n.batchCount!==0&&(ht("Customer data measures",_n),eu())}function Xl(){return{min:1/0,max:0,sum:0}}function Ql(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function eu(){_n={batchCount:0,batchBytesCount:Xl(),batchMessagesCount:Xl()}}const Jb=4e3,Zb=500,Xb=Dt;function Qb(e,t,n=Zb){const r=gn({expireDelay:Xb,maxEntries:Jb});let s;o(tu(),He());const{stop:i}=Me(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],c=>{o(ty(c),c.timeStamp)},{capture:!0});function o(c,l=He()){c!==s&&(s=c,r.closeActive(l),r.add({state:s,startTime:l},l))}function a(c,l,u){return r.findAll(l,u).some(d=>d.state===c)}return e.register(0,({startTime:c,duration:l=0,eventType:u})=>{if(u==="view"){const d=r.findAll(c,l);return{type:u,_dd:{page_states:ey(d,c,n)}}}if(u==="action"||u==="error")return{type:u,view:{in_foreground:a("active",c,0)}}}),{wasInPageStateDuringPeriod:a,addPageState:o,stop:()=>{i(),r.stop()}}}function ey(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:s})=>({state:r,start:B(be(t,s))}))}function ty(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":tu()}function tu(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function ny(e){let t;const n=requestAnimationFrame($(()=>{t=hs()})),r=Gl(e).subscribe(s=>{t=s}).unsubscribe;return{get:()=>t?{viewport:t}:void 0,stop:()=>{r(),n&&cancelAnimationFrame(n)}}}const ry=_e;function sy(e){return new G(t=>iy(e,n=>t.notify(n)))}function iy(e,t){const n=Jn(document.cookie,e),r=sn(()=>{const s=Jn(document.cookie,e);s!==n&&t(s)},ry);return()=>Wr(r)}const nu="datadog-ci-visibility-test-execution-id";function oy(e,t=sy(nu)){var n;let r=vt(nu)||((n=window.Cypress)===null||n===void 0?void 0:n.env("traceId"));const s=t.subscribe(i=>{r=i});return e.register(0,({eventType:i})=>{if(typeof r=="string")return{type:i,session:{type:"ci_test"},ci_test:{test_execution_id:r}}}),{stop:()=>{s.unsubscribe()}}}function ay(e,t){const n=nt(t,{type:H.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const s of r){const i=Hr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-animation-frame",duration:B(s.duration),blocking_duration:B(s.blockingDuration),first_ui_event_timestamp:B(s.firstUIEventTimestamp),render_start:B(s.renderStart),style_and_layout_start:B(s.styleAndLayoutStart),start_time:B(s.startTime),scripts:s.scripts.map(a=>({duration:B(a.duration),pause_duration:B(a.pauseDuration),forced_style_and_layout_duration:B(a.forcedStyleAndLayoutDuration),start_time:B(a.startTime),execution_start:B(a.executionStart),source_url:a.sourceURL,source_function_name:a.sourceFunctionName,source_char_position:a.sourceCharPosition,invoker:a.invoker,invoker_type:a.invokerType,window_attribution:a.windowAttribution}))},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop:()=>n.unsubscribe()}}function cy(e,t){const n=nt(t,{type:H.LONG_TASK,buffered:!0}).subscribe(r=>{for(const s of r){if(s.entryType!==H.LONG_TASK||!t.trackLongTasks)break;const i=Hr(s.startTime),o={date:i.timeStamp,long_task:{id:ye(),entry_type:"long-task",duration:B(s.duration)},type:"long_task",_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:i.relative,duration:s.duration,domainContext:{performanceEntry:s}})}});return{stop(){n.unsubscribe()}}}function ly(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const s=(e[t]||[]).map(i=>i(n));return Ye(...s)}}}function uy(e){e.register(0,({eventType:t})=>{const n=Vm(),r=zm();if(!(!n||!r))return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:Mc()}}})}function dy(e,t,n){const r=li(e),s=n(r);return Js(t).forEach(([i,o])=>Pi(e,r,i.split(/\.|(?=\[\])/),o)),s}function Pi(e,t,n,r){const[s,...i]=n;if(s==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((o,a)=>Pi(o,t[a],i,r));return}if(!(!ru(e)||!ru(t))){if(i.length>0)return Pi(e[s],t[s],i,r);fy(e,s,t[s],r)}}function fy(e,t,n,r){const s=Vt(n);s===r?e[t]=oe(n):r==="object"&&(s==="undefined"||s==="null")&&(e[t]={})}function ru(e){return Vt(e)==="object"}const vn={"view.name":"string","view.url":"string","view.referrer":"string"},En={context:"object"},Ni={service:"string",version:"string"};let su;function py(e,t,n,r,s,i,o,a,c){su={view:{"view.performance.lcp.resource_url":"string",...En,...vn},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...En,...vn,...Ni},resource:{"resource.url":"string",...ts(Ut.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...En,...vn,...Ni},action:{"action.target.name":"string",...En,...vn,...Ni},long_task:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...En,...vn},vital:{...En,...vn}};const l={error:fi("error",e.eventRateLimiterThreshold,c),action:fi("action",e.eventRateLimiterThreshold,c),vital:fi("vital",e.eventRateLimiterThreshold,c)};t.subscribe(12,({startTime:u,duration:d,rawRumEvent:f,domainContext:h,customerContext:p})=>{const g=s.findView(u),m=i.findUrl(u),w=r.findTrackedSession(u);if(w&&g&&!m&&ts(Ut.MISSING_URL_CONTEXT_TELEMETRY)&&ht("Missing URL entry",{debug:{eventType:f.type,startTime:u,urlEntries:i.getAllEntries(),urlDeletedEntries:i.getDeletedEntries(),viewEntries:s.getAllEntries(),viewDeletedEntries:s.getDeletedEntries()}}),w&&g&&m){const v=a(),y={_dd:{format_version:2,drift:Wp(),configuration:{session_sample_rate:zr(e.sessionSampleRate,3),session_replay_sample_rate:zr(e.sessionReplaySampleRate,3)},browser_sdk_version:Ht()?"6.6.3":void 0},application:{id:e.applicationId},date:fe(),source:"browser",session:{id:w.id,type:"user"},display:o.get(),connectivity:bc(),context:v.context},_=Ye(y,n.triggerHook(0,{eventType:f.type,startTime:u,duration:d}),{context:p},f);"has_replay"in _.session||(_.session.has_replay=v.hasReplay),_.type==="view"&&(_.session.sampled_for_replay=w.sessionReplay===1),w.anonymousId&&!v.user.anonymous_id&&e.trackAnonymousUser&&(v.user.anonymous_id=w.anonymousId),Nt(v.user)||(_.usr=v.user),!Nt(v.account)&&v.account.id&&(_.account=v.account),hy(_,e.beforeSend,h,l)&&(Nt(_.context)&&delete _.context,t.notify(13,_))}})}function hy(e,t,n,r){var s;if(t){const o=dy(e,su[e.type],a=>t(a,n));if(o===!1&&e.type!=="view")return!1;o===!1&&V.warn("Can't dismiss view events using beforeSend!")}return!((s=r[e.type])===null||s===void 0?void 0:s.isLimitReached())}function gy(e,t,n,r){return{context:e.getContext(),user:t.getContext(),account:n.getContext(),hasReplay:r.isRecording()?!0:void 0}}function my(e,t,n,r,s,i,o){const a=[],c=new w1,l=ly();c.subscribe(13,le=>ci("rum",le));const u=by(e);u.setContextProvider(()=>{var le,Pn;return{application:{id:e.applicationId},session:{id:(le=p.findTrackedSession())===null||le===void 0?void 0:le.id},view:{id:(Pn=v.findView())===null||Pn===void 0?void 0:Pn.id},action:{id:R.findActionId()}}});const d=le=>{c.notify(14,{error:le}),ht("Error reported to customer",{"error.message":le.message})},f=lm(e),h=f.subscribe(le=>{c.notify(11,le)});a.push(()=>h.unsubscribe());const p=Ht()?Mb():Nb(e,c,i);if(Ht())$b(c);else{const le=Bb(e,c,u.observable,d,f,p.expireObservable,s);a.push(()=>le.stop()),Gb(e,u,c,le.flushObservable)}const g=m1(),m=zb(e,location),w=Qb(l,e),v=_1(c),y=Vb(c,l,m,location),_=qb(c,l,e),{observable:O,stop:T}=b1();a.push(T);const b=l1(e),k=u1(e),x=d1(e),I=()=>gy(b,k,x,t),{actionContexts:R,addAction:L,stop:P}=yy(c,l,e,p,w,g,O,y,v,I,d);a.push(P),Fg();const{addTiming:N,startView:Q,setViewName:me,setViewContext:Ve,setViewContextProperty:Ke,getViewContext:X,stop:re}=Ib(c,l,e,location,g,O,m,t,v,r);a.push(re);const{stop:ee}=$0(c,e,w);if(a.push(ee),e.trackLongTasks)if(Wt(H.LONG_ANIMATION_FRAME)){const{stop:le}=ay(c,e);a.push(le)}else cy(c,e);const{addError:ke}=A0(c,e);k1(c,e,p,I);const Ee=jm(c,w,o),To=y1(e.applicationId,p,v,R,y);return a.push(()=>n.stop()),{addAction:L,addError:ke,addTiming:N,addFeatureFlagEvaluation:_.addFeatureFlagEvaluation,startView:Q,setViewContext:Ve,setViewContextProperty:Ke,getViewContext:X,setViewName:me,lifeCycle:c,viewHistory:v,session:p,stopSession:()=>p.expire(),getInternalContext:To.get,startDurationVital:Ee.startDurationVital,stopDurationVital:Ee.stopDurationVital,addDurationVital:Ee.addDurationVital,globalContext:b,userContext:k,accountContext:x,stop:()=>{a.forEach(le=>le())}}}function by(e){const t=Mg("browser-rum-sdk",e);if(Ht()){const n=mn();t.observable.subscribe(r=>n.send("internal_telemetry",r))}return t}function yy(e,t,n,r,s,i,o,a,c,l,u){const d=C0(e,t,i,o,n),f=ny(n),h=oy(t);return uy(t),py(n,e,t,r,c,a,f,l,u),{pageStateHistory:s,addAction:d.addAction,actionContexts:d.actionContexts,stop:()=>{d.stop(),h.stop(),f.stop(),c.stop(),s.stop(),a.stop()}}}function wy(e,{session:t,viewContext:n,errorType:r}){const s=t?t.id:"no-session-id",i=[];r!==void 0&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const o=Sy(e),a=`/rum/replay/sessions/${s}`;return`${o}${a}?${i.join("&")}`}function Sy(e){const t=e.site,n=e.subdomain||_y(e);return`https://${n?`${n}.`:""}${t}`}function _y(e){switch(e.site){case $t:case Nh:return"app";case ic:return"dd";default:return}}const vy=1e3;let je;function Ey(e){return gs(e).segments_count}function Cy(e){gs(e).segments_count+=1}function xy(e){gs(e).records_count+=1}function Ty(e,t){gs(e).segments_total_raw_size+=t}function Ay(e){return je==null?void 0:je.get(e)}function gs(e){je||(je=new Map);let t;return je.has(e)?t=je.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},je.set(e,t),je.size>vy&&Ry()),t}function Ry(){if(!je)return;const e=je.keys().next().value;e&&je.delete(e)}function iu(e,t,n){let r=0,s=[],i,o=0;const a=[],{stop:c}=Z(e,t,"message",({data:d})=>{if(d.type!=="wrote"||d.streamId!==n)return;r+=d.additionalBytesCount,s.push(d.result),i=d.trailer;const f=a.shift();f&&f.id===d.id?f.writeCallback?f.writeCallback(d.result.byteLength):f.finishCallback&&f.finishCallback():(c(),ht("Worker responses received out of order."))});function l(){const d=s.length===0?new Uint8Array(0):Yp(s.concat(i)),f={rawBytesCount:r,output:d,outputBytesCount:d.byteLength,encoding:"deflate"};return r=0,s=[],f}function u(){o>0&&(t.postMessage({action:"reset",streamId:n}),o=0)}return{isAsync:!0,get isEmpty(){return o===0},write(d,f){t.postMessage({action:"write",id:o,data:d,streamId:n}),a.push({id:o,writeCallback:f,data:d}),o+=1},finish(d){u(),a.length?(a.forEach(f=>{delete f.writeCallback}),a[a.length-1].finishCallback=()=>d(l())):d(l())},finishSync(){u();const d=a.map(f=>(delete f.writeCallback,delete f.finishCallback,f.data)).join("");return{...l(),pendingData:d}},estimateEncodedBytesCount(d){return d.length/8},stop(){c()}}}function Mi({configuredUrl:e,error:t,source:n,scriptType:r}){if(V.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&ky(t.message)){let s;e?s=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:s="Please make sure CSP is correctly configured.",V.error(`${s} See documentation at ${Vr}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&ui(t)}function ky(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Iy=30*_e;function ou(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=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]),n=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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},O={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"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},et=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-J)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=L(s.adler,h,o,l):2===s.state.wrap&&(s.adler=T(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},at=function(t,e){for(var a,n;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},nt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var it=[new rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(et(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)})),new rt(4,4,8,4,at),new rt(4,5,16,8,at),new rt(4,6,32,32,at),new rt(4,4,16,16,nt),new rt(8,16,32,32,nt),new rt(8,16,128,128,nt),new rt(8,32,128,256,nt),new rt(32,128,258,1024,nt),new rt(32,258,258,4096,nt)];function st(){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=8,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),V(this.dyn_ltree),V(this.dyn_dtree),V(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),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var ht=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=it[e.level].max_lazy,e.good_match=it[e.level].good_length,e.nice_match=it[e.level].nice_length,e.max_chain_length=it[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},lt=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(et(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(et(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):it[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},_t=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},ot=new Uint8Array(256),dt=0;dt<256;dt++)ot[dt]=dt>=252?6:dt>=248?5:dt>=240?4:dt>=224?3:dt>=192?2:1;ot[254]=ot[254]=1;var ut=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},ft=Object.prototype.toString;function ct(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var 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 ut,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new st;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,ht(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ft.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,et(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function pt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function gt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}ct.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ft.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=lt(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=_t(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ct.prototype.onData=function(t){this.chunks.push(t)},ct.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.6.3"};case"write":{let n=e.get(a.streamId);n||(n=new ct,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:gt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){pt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){pt(e,t)}}()})();'])))}let ae={status:0};function au(e,t,n,r=ou){switch(ae.status===0&&Oy(e,t,r),ae.status){case 1:return ae.initializationFailureCallbacks.push(n),ae.worker;case 3:return ae.worker}}function cu(){return ae.status}function Oy(e,t,n=ou){try{const r=n(e),{stop:s}=Z(e,r,"error",a=>{Di(e,t,a)}),{stop:i}=Z(e,r,"message",({data:a})=>{a.type==="errored"?Di(e,t,a.error,a.streamId):a.type==="initialized"&&Py(a.version)});r.postMessage({action:"init"}),pe(()=>Ly(t),Iy),ae={status:1,worker:r,stop:()=>{s(),i()},initializationFailureCallbacks:[]}}catch(r){Di(e,t,r)}}function Ly(e){ae.status===1&&(V.error(`${e} failed to start: a timeout occurred while initializing the Worker`),ae.initializationFailureCallbacks.forEach(t=>t()),ae={status:2})}function Py(e){ae.status===1&&(ae={status:3,worker:ae.worker,stop:ae.stop,version:e})}function Di(e,t,n,r){ae.status===1||ae.status===0?(Mi({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),ae.status===1&&ae.initializationFailureCallbacks.forEach(s=>s()),ae={status:2}):ui(n,{worker_version:ae.status===3&&ae.version,stream_id:r})}function lu(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function Ny(e,t,n,r){const s=t.findTrackedSession(),i=My(s,r),o=n.findView();return wy(e,{viewContext:o,errorType:i,session:s})}function My(e,t){if(!lu())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function Dy(e,t,n,r,s,i){let o=0,a;t.subscribe(9,()=>{(o===2||o===3)&&(u(),o=1)}),t.subscribe(10,()=>{o===1&&l()});const c=async()=>{const[d]=await Promise.all([s(),gm(e,"interactive")]);if(o!==2)return;const f=i();if(!f||!d){o=0;return}({stop:a}=d(t,e,n,r,f)),o=3};function l(d){const f=n.findTrackedSession();if(Fy(f,d)){o=1;return}By(o)||(o=2,c().catch(pt),$y(f,d)&&n.setForcedReplay())}function u(){o===3&&(a==null||a()),o=0}return{start:l,stop:u,getSessionReplayLink(){return Ny(e,n,r,o!==0)},isRecording:()=>o===3}}function Fy(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function By(e){return e===2||e===3}function $y(e,t){return t&&t.force&&e.sessionReplay===0}function Uy(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:z},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function Vy(e,t){if(Ht()&&!Ic("records")||!lu())return{start:z,stop:z,getReplayStats:()=>{},onRumStart:z,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=Uy();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:s,isRecording:()=>cu()===3&&n.isRecording(),getReplayStats:i=>cu()===3?Ay(i):void 0};function s(i,o,a,c,l){let u;function d(){return u||(l??(l=au(o,"Datadog Session Replay",()=>{n.stop()},t)),l&&(u=iu(o,l,1))),u}n=Dy(o,i,a,c,e,d),r(o)&&n.start()}}async function zy(e=Hy){try{return await e()}catch(t){Mi({error:t,source:"Recorder",scriptType:"module"})}}async function Hy(){return(await Promise.resolve().then(()=>uv)).startRecording}function jy(){return tt().Profiler!==void 0}async function Wy(e=qy){try{return await e()}catch(t){Mi({error:t,source:"Profiler",scriptType:"module"})}}async function qy(){return(await Promise.resolve().then(()=>Cv)).createRumProfiler}function Ky(){let e;function t(n,r,s,i){!jy()||!wt(r.profilingSampleRate)||Wy().then(o=>{if(!o){ht("[DD_RUM] Failed to lazy load the RUM Profiler");return}e=o(r,n,s),e.start(i.findView())}).catch(pt)}return{onRumStart:t,stop:()=>{e==null||e.stop().catch(pt)}}}const Gy=Vy(zy),Yy=Ky(),$e=h1(my,Gy,Yy,{startDeflateWorker:au,createDeflateEncoder:iu});xg(tt(),"DD_RUM",$e);const Ln=class Ln{init(){if(Ln.isInitialized){console.info("Tracker [DD]: already initialized");return}$e.init({applicationId:"3ea6bf90-69cc-42fe-9e69-d461f783221d",clientToken:"pub51a171e3f587fb85f6d3f0ed2bf8f531",site:"datadoghq.com",service:"astropay-payments-library",env:"production",version:"0.1.4",sessionSampleRate:50,sessionReplaySampleRate:10,defaultPrivacyLevel:"mask-user-input",trackViewsManually:!0,trackResources:!1,trackUserInteractions:!1,beforeSend:t=>this.filterEvents(t)}),$e.startView({name:"ap_cl_view_mounted"}),$e.startSessionReplayRecording(),Ln.isInitialized=!0,console.info("Tracker [DD]: initialized")}track(t,n){$e==null||$e.addAction(t,n||{})}trackError(t,n){$e==null||$e.addError(t,{context:n})}destroy(){console.info("Tracker [DD]: destroying"),typeof $e.stopSessionReplayRecording=="function"&&$e.stopSessionReplayRecording(),$e.addAction("ap_cl_view_unmounted",{reason:"component_destroyed"}),Ln.isInitialized=!1}filterEvents(t){var n,r,s;return!!(t.type==="view"&&((n=t.view.name)!=null&&n.startsWith("ap_cl_"))||t.type==="action"&&typeof((r=t.action.target)==null?void 0:r.name)=="string"&&t.action.target.name.startsWith("ap_cl_")||t.type==="error"&&((s=t.error)==null?void 0:s.source)==="custom")}};A(Ln,"isInitialized",!1);let Fi=Ln,Cn=[];class We{static init(t){if(!t){console.info("Tracking disabled");return}Cn=[new Fi],Cn.forEach(n=>n.init())}static trackEvent(t,n){Cn.forEach(r=>r.track(t,n))}static trackError(t,n){Cn.forEach(r=>r.trackError(t,n))}static destroy(){Cn.forEach(t=>t.destroy()),Cn=[]}}const ge=class ge{static init(t,n){if(!t)throw console.error('AstroPay Payments Library: Missing "app-id". Call init function first.'),new Error("app-id is required for authentication.");if(ge.isInitialized){console.warn("AstroPay Payments Library: Already initialized.");return}ge.token=t,We.init((n==null?void 0:n.tracking)??!0),U.init({theme:(n==null?void 0:n.theme)??"light",styles:(n==null?void 0:n.styles)??{}}),te.init({language:(n==null?void 0:n.language)??"en"}),Mn.init({environment:(n==null?void 0:n.environment)??"production",currencyMode:(n==null?void 0:n.currencyMode)??"iso"}),yt.init({appName:"ap-cl",baseURL:"https://partners-api.astropay.com/api",timeout:5e3}),We.trackEvent("ap_cl_init",{app_id:t,origin:window.location.origin}),ge.isInitialized=!0}static registerComponent(t){ge.components.add(t)}static unregisterComponent(t){ge.components.delete(t)}static getToken(){if(!ge.isInitialized){const t="AstroPay Payments Library: Not initialized.";throw console.error(t),new Error(t)}return ge.token}static destroy(){ge.isInitialized&&(ge.components.forEach(t=>t.destroy()),ge.components.clear(),ge.isInitialized=!1,We.destroy(),ge.token="")}static isLibInitialized(){return ge.isInitialized}};A(ge,"isInitialized",!1),A(ge,"token"),A(ge,"components",new Set);let st=ge;class ce{constructor({tag:t,elementId:n,styles:r}){A(this,"element");if(this.element=document.createElement(t),n&&this.element.setAttribute("id",n),r){const s=U.getStyles(),i=r(s);this.element.className=i}}addStyleClass(t){this.element.classList.add(t)}render(t){t instanceof ce?t.element.appendChild(this.element):t.appendChild(this.element)}destroy(){this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}function Jy(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Zy(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Xy=function(){function e(n){var r=this;this._insertTag=function(s){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,i),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Zy(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Jy(s);try{i.insertRule(r,i.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),ve="-ms-",ms="-moz-",j="-webkit-",uu="comm",Bi="rule",$i="decl",Qy="@import",du="@keyframes",ew="@layer",tw=Math.abs,bs=String.fromCharCode,nw=Object.assign;function rw(e,t){return we(e,0)^45?(((t<<2^we(e,0))<<2^we(e,1))<<2^we(e,2))<<2^we(e,3):0}function fu(e){return e.trim()}function sw(e,t){return(e=t.exec(e))?e[0]:e}function W(e,t,n){return e.replace(t,n)}function Ui(e,t){return e.indexOf(t)}function we(e,t){return e.charCodeAt(t)|0}function lr(e,t,n){return e.slice(t,n)}function it(e){return e.length}function Vi(e){return e.length}function ys(e,t){return t.push(e),e}function iw(e,t){return e.map(t).join("")}var ws=1,xn=1,pu=0,De=0,ue=0,Tn="";function Ss(e,t,n,r,s,i,o){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:ws,column:xn,length:o,return:""}}function ur(e,t){return nw(Ss("",null,null,"",null,null,0),e,{length:-e.length},t)}function ow(){return ue}function aw(){return ue=De>0?we(Tn,--De):0,xn--,ue===10&&(xn=1,ws--),ue}function Ue(){return ue=De<pu?we(Tn,De++):0,xn++,ue===10&&(xn=1,ws++),ue}function ot(){return we(Tn,De)}function _s(){return De}function dr(e,t){return lr(Tn,e,t)}function fr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function hu(e){return ws=xn=1,pu=it(Tn=e),De=0,[]}function gu(e){return Tn="",e}function vs(e){return fu(dr(De-1,zi(e===91?e+2:e===40?e+1:e)))}function cw(e){for(;(ue=ot())&&ue<33;)Ue();return fr(e)>2||fr(ue)>3?"":" "}function lw(e,t){for(;--t&&Ue()&&!(ue<48||ue>102||ue>57&&ue<65||ue>70&&ue<97););return dr(e,_s()+(t<6&&ot()==32&&Ue()==32))}function zi(e){for(;Ue();)switch(ue){case e:return De;case 34:case 39:e!==34&&e!==39&&zi(ue);break;case 40:e===41&&zi(e);break;case 92:Ue();break}return De}function uw(e,t){for(;Ue()&&e+ue!==57;)if(e+ue===84&&ot()===47)break;return"/*"+dr(t,De-1)+"*"+bs(e===47?e:Ue())}function dw(e){for(;!fr(ot());)Ue();return dr(e,De)}function fw(e){return gu(Es("",null,null,null,[""],e=hu(e),0,[0],e))}function Es(e,t,n,r,s,i,o,a,c){for(var l=0,u=0,d=o,f=0,h=0,p=0,g=1,m=1,w=1,v=0,y="",_=s,O=i,T=r,b=y;m;)switch(p=v,v=Ue()){case 40:if(p!=108&&we(b,d-1)==58){Ui(b+=W(vs(v),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:b+=vs(v);break;case 9:case 10:case 13:case 32:b+=cw(p);break;case 92:b+=lw(_s()-1,7);continue;case 47:switch(ot()){case 42:case 47:ys(pw(uw(Ue(),_s()),t,n),c);break;default:b+="/"}break;case 123*g:a[l++]=it(b)*w;case 125*g:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+u:w==-1&&(b=W(b,/\f/g,"")),h>0&&it(b)-d&&ys(h>32?bu(b+";",r,n,d-1):bu(W(b," ","")+";",r,n,d-2),c);break;case 59:b+=";";default:if(ys(T=mu(b,t,n,l,u,s,a,y,_=[],O=[],d),i),v===123)if(u===0)Es(b,t,T,T,_,i,d,a,O);else switch(f===99&&we(b,3)===110?100:f){case 100:case 108:case 109:case 115:Es(e,T,T,r&&ys(mu(e,T,T,0,0,s,a,y,s,_=[],d),O),s,O,d,a,r?_:O);break;default:Es(b,T,T,T,[""],O,0,a,O)}}l=u=h=0,g=w=1,y=b="",d=o;break;case 58:d=1+it(b),h=p;default:if(g<1){if(v==123)--g;else if(v==125&&g++==0&&aw()==125)continue}switch(b+=bs(v),v*g){case 38:w=u>0?1:(b+="\f",-1);break;case 44:a[l++]=(it(b)-1)*w,w=1;break;case 64:ot()===45&&(b+=vs(Ue())),f=ot(),u=d=it(y=b+=dw(_s())),v++;break;case 45:p===45&&it(b)==2&&(g=0)}}return i}function mu(e,t,n,r,s,i,o,a,c,l,u){for(var d=s-1,f=s===0?i:[""],h=Vi(f),p=0,g=0,m=0;p<r;++p)for(var w=0,v=lr(e,d+1,d=tw(g=o[p])),y=e;w<h;++w)(y=fu(g>0?f[w]+" "+v:W(v,/&\f/g,f[w])))&&(c[m++]=y);return Ss(e,t,n,s===0?Bi:a,c,l,u)}function pw(e,t,n){return Ss(e,t,n,uu,bs(ow()),lr(e,2,-2),0)}function bu(e,t,n,r){return Ss(e,t,n,$i,lr(e,0,r),lr(e,r+1,-1),r)}function An(e,t){for(var n="",r=Vi(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function hw(e,t,n,r){switch(e.type){case ew:if(e.children.length)break;case Qy:case $i:return e.return=e.return||e.value;case uu:return"";case du:return e.return=e.value+"{"+An(e.children,r)+"}";case Bi:e.value=e.props.join(",")}return it(n=An(e.children,r))?e.return=e.value+"{"+n+"}":""}function gw(e){var t=Vi(e);return function(n,r,s,i){for(var o="",a=0;a<t;a++)o+=e[a](n,r,s,i)||"";return o}}function mw(e){return function(t){t.root||(t=t.return)&&e(t)}}function bw(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var yw=function(t,n,r){for(var s=0,i=0;s=i,i=ot(),s===38&&i===12&&(n[r]=1),!fr(i);)Ue();return dr(t,De)},ww=function(t,n){var r=-1,s=44;do switch(fr(s)){case 0:s===38&&ot()===12&&(n[r]=1),t[r]+=yw(De-1,n,r);break;case 2:t[r]+=vs(s);break;case 4:if(s===44){t[++r]=ot()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=bs(s)}while(s=Ue());return t},Sw=function(t,n){return gu(ww(hu(t),n))},yu=new WeakMap,_w=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!yu.get(r))&&!s){yu.set(t,!0);for(var i=[],o=Sw(n,i),a=r.props,c=0,l=0;c<o.length;c++)for(var u=0;u<a.length;u++,l++)t.props[l]=i[c]?o[c].replace(/&\f/g,a[u]):a[u]+" "+o[c]}}},vw=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function wu(e,t){switch(rw(e,t)){case 5103:return j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return j+e+ms+e+ve+e+e;case 6828:case 4268:return j+e+ve+e+e;case 6165:return j+e+ve+"flex-"+e+e;case 5187:return j+e+W(e,/(\w+).+(:[^]+)/,j+"box-$1$2"+ve+"flex-$1$2")+e;case 5443:return j+e+ve+"flex-item-"+W(e,/flex-|-self/,"")+e;case 4675:return j+e+ve+"flex-line-pack"+W(e,/align-content|flex-|-self/,"")+e;case 5548:return j+e+ve+W(e,"shrink","negative")+e;case 5292:return j+e+ve+W(e,"basis","preferred-size")+e;case 6060:return j+"box-"+W(e,"-grow","")+j+e+ve+W(e,"grow","positive")+e;case 4554:return j+W(e,/([^-])(transform)/g,"$1"+j+"$2")+e;case 6187:return W(W(W(e,/(zoom-|grab)/,j+"$1"),/(image-set)/,j+"$1"),e,"")+e;case 5495:case 3959:return W(e,/(image-set\([^]*)/,j+"$1$`$1");case 4968:return W(W(e,/(.+:)(flex-)?(.*)/,j+"box-pack:$3"+ve+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+j+e+e;case 4095:case 3583:case 4068:case 2532:return W(e,/(.+)-inline(.+)/,j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(it(e)-1-t>6)switch(we(e,t+1)){case 109:if(we(e,t+4)!==45)break;case 102:return W(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+ms+(we(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ui(e,"stretch")?wu(W(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(we(e,t+1)!==115)break;case 6444:switch(we(e,it(e)-3-(~Ui(e,"!important")&&10))){case 107:return W(e,":",":"+j)+e;case 101:return W(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j+(we(e,14)===45?"inline-":"")+"box$3$1"+j+"$2$3$1"+ve+"$2box$3")+e}break;case 5936:switch(we(e,t+11)){case 114:return j+e+ve+W(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+ve+W(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+ve+W(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return j+e+ve+e+e}return e}var Ew=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case $i:t.return=wu(t.value,t.length);break;case du:return An([ur(t,{value:W(t.value,"@","@"+j)})],s);case Bi:if(t.length)return iw(t.props,function(i){switch(sw(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return An([ur(t,{props:[W(i,/:(read-\w+)/,":"+ms+"$1")]})],s);case"::placeholder":return An([ur(t,{props:[W(i,/:(plac\w+)/,":"+j+"input-$1")]}),ur(t,{props:[W(i,/:(plac\w+)/,":"+ms+"$1")]}),ur(t,{props:[W(i,/:(plac\w+)/,ve+"input-$1")]})],s)}return""})}},Cw=[Ew],xw=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var s=t.stylisPlugins||Cw,i={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),w=1;w<m.length;w++)i[m[w]]=!0;a.push(g)});var c,l=[_w,vw];{var u,d=[hw,mw(function(g){u.insert(g)})],f=gw(l.concat(s,d)),h=function(m){return An(fw(m),f)};c=function(m,w,v,y){u=v,h(m?m+"{"+w.styles+"}":w.styles),y&&(p.inserted[w.name]=!0)}}var p={key:n,sheet:new Xy({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return p.sheet.hydrate(a),p};function Tw(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Aw={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Rw=/[A-Z]|^ms/g,kw=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Su=function(t){return t.charCodeAt(1)===45},_u=function(t){return t!=null&&typeof t!="boolean"},Hi=bw(function(e){return Su(e)?e:e.replace(Rw,"-$&").toLowerCase()}),vu=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(kw,function(r,s,i){return Tt={name:s,styles:i,next:Tt},s})}return Aw[t]!==1&&!Su(t)&&typeof n=="number"&&n!==0?n+"px":n};function Cs(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return Tt={name:s.name,styles:s.styles,next:Tt},s.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)Tt={name:o.name,styles:o.styles,next:Tt},o=o.next;var a=i.styles+";";return a}return Iw(e,t,n)}}var c=n;if(t==null)return c;var l=t[c];return l!==void 0?l:c}function Iw(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=Cs(e,t,n[s])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=i+"{"+t[a]+"}":_u(a)&&(r+=Hi(i)+":"+vu(i,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)_u(o[c])&&(r+=Hi(i)+":"+vu(i,o[c])+";");else{var l=Cs(e,t,o);switch(i){case"animation":case"animationName":{r+=Hi(i)+":"+l+";";break}default:r+=i+"{"+l+"}"}}}return r}var Eu=/label:\s*([^\s;{]+)\s*(;|$)/g,Tt;function ji(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";Tt=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,s+=Cs(n,t,i);else{var o=i;s+=o[0]}for(var a=1;a<e.length;a++)if(s+=Cs(n,t,e[a]),r){var c=i;s+=c[a]}Eu.lastIndex=0;for(var l="",u;(u=Eu.exec(s))!==null;)l+="-"+u[1];var d=Tw(s)+l;return{name:d,styles:s,next:Tt}}function Cu(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var Ow=function(t,n,r){var s=t.key+"-"+n.name;t.registered[s]===void 0&&(t.registered[s]=n.styles)},Lw=function(t,n,r){Ow(t,n);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+s:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function xu(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Tu(e,t,n){var r=[],s=Cu(e,r,n);return r.length<2?n:s+t(r)}var Pw=function(t){var n=xw(t);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=ji(l,n.registered,void 0);return Lw(n,d),n.key+"-"+d.name},s=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=ji(l,n.registered),f="animation-"+d.name;return xu(n,{name:d.name,styles:"@keyframes "+f+"{"+d.styles+"}"}),f},i=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var d=ji(l,n.registered);xu(n,d)},o=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];return Tu(n.registered,r,Nw(l))};return{css:r,cx:o,injectGlobal:i,keyframes:s,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:Cu.bind(null,n.registered),merge:Tu.bind(null,n.registered,r)}},Nw=function e(t){for(var n="",r=0;r<t.length;r++){var s=t[r];if(s!=null){var i=void 0;switch(typeof s){case"boolean":break;case"object":{if(Array.isArray(s))i=e(s);else{i="";for(var o in s)s[o]&&o&&(i&&(i+=" "),i+=o)}break}default:i=s}i&&(n&&(n+=" "),n+=i)}}return n},Wi=Pw({key:"css"}),Mw=Wi.cx,pr=Wi.keyframes,K=Wi.css;const Dw=(e,t)=>K`
|
|
20
20
|
font-family: ${e.fontFamily};
|
|
21
|
-
color: ${(t==null?void 0:t.color)||e.
|
|
21
|
+
color: ${(t==null?void 0:t.color)||e.textColor};
|
|
22
22
|
|
|
23
23
|
font-size: ${t.size}px;
|
|
24
24
|
font-weight: ${t.weight};
|
|
@@ -26,7 +26,7 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
26
26
|
|
|
27
27
|
line-height: ${t.lineHeight}px;
|
|
28
28
|
text-transform: ${t.uppercase?"uppercase":"none"};
|
|
29
|
-
`;class q extends
|
|
29
|
+
`;class q extends ce{constructor({text:t,variant:n="span",weight:r=500,size:s=12,lineHeight:i=18,align:o="left",color:a,uppercase:c=!1}){const l={size:s,weight:r,lineHeight:i,align:o,color:a,uppercase:c};super({tag:n,styles:u=>Dw(u,l)}),this.element.textContent=t}}const Fw=({borderType:e,color:t})=>K`
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
gap: 10px;
|
|
@@ -39,15 +39,15 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
39
39
|
border-top: 1px ${e} ${t};
|
|
40
40
|
margin: 0;
|
|
41
41
|
}
|
|
42
|
-
`;class Cu extends ae{constructor({text:t,borderType:n="solid",color:r=L.neutral_base}){super({tag:"div",styles:()=>Lw({borderType:n,color:r})});const s=document.createElement("hr");if(s.classList.add("divider-line"),this.element.appendChild(s),t){const i=new q({text:t,size:16,weight:600,lineHeight:24}),o=document.createElement("hr");o.classList.add("divider-line"),i.render(this.element),this.element.appendChild(o)}}}const Nw={astropay_logo:{svg:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="Logo"><path id="Vector" fill-rule="evenodd" clip-rule="evenodd" d="M15.166 10.7383C16.0308 10.7383 16.8793 10.8059 17.7074 10.9372L19.7866 16.0843C18.3684 15.4763 16.8067 15.1396 15.166 15.1396C11.4591 15.1396 8.154 16.8578 6.00304 19.541H0.786621C3.45841 14.3156 8.8949 10.7383 15.166 10.7383Z" fill="#143534"/><path id="Vector_2" fill-rule="evenodd" clip-rule="evenodd" d="M13.3258 0.101402L17.0783 9.37359C16.4499 9.30594 15.8109 9.27089 15.1645 9.27089C14.2199 9.27089 13.2932 9.34506 12.3884 9.48851L10.9588 5.95031L9.19826 10.3068C6.78974 11.1741 4.62493 12.5515 2.83423 14.3088L8.57474 0.100586H13.3258V0.101402Z" fill="#151E1D"/></g></svg>'},alert_line:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 8C12.5523 8 13 8.44772 13 9V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V9C11 8.44772 11.4477 8 12 8Z" fill="currentColor"/><path d="M12 17C12.5523 17 13 16.5523 13 16C13 15.4477 12.5523 15 12 15C11.4477 15 11 15.4477 11 16C11 16.5523 11.4477 17 12 17Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10.7009 3.14771C11.2783 2.14771 12.7217 2.1477 13.299 3.1477L21.933 18.1022C22.5103 19.1022 21.7887 20.3522 20.634 20.3522H3.36601C2.21131 20.3522 1.48962 19.1022 2.06697 18.1022L10.7009 3.14771ZM12 4.8977L4.23203 18.3522H19.7679L12 4.8977Z" fill="currentColor"/></svg>'},arrow_right_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.0626 5.63603L20.7194 11.2929C21.1099 11.6834 21.1099 12.3166 20.7194 12.7071L15.0626 18.364C14.672 18.7545 14.0389 18.7545 13.6483 18.364C13.2578 17.9734 13.2578 17.3403 13.6483 16.9497L17.5981 13H4.35547C3.80318 13 3.35547 12.5523 3.35547 12C3.35547 11.4477 3.80318 11 4.35547 11H17.5981L13.6483 7.05025C13.2578 6.65972 13.2578 6.02656 13.6483 5.63603C14.0389 5.24551 14.672 5.24551 15.0626 5.63603Z" fill="currentColor"/></svg>'},arrow_down_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.0626 15.7071C12.6721 16.0976 12.0389 16.0976 11.6484 15.7071L5.99151 10.0502C5.60098 9.6597 5.60098 9.02653 5.99151 8.63601C6.38203 8.24549 7.0152 8.24549 7.40572 8.63601L12.3555 13.5858L17.3052 8.63601C17.6957 8.24549 18.3289 8.24549 18.7194 8.63601C19.11 9.02653 19.11 9.6597 18.7194 10.0502L13.0626 15.7071Z" fill="currentColor"/></svg>'},bank_card_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.3555 13C13.8032 13 13.3555 13.4477 13.3555 14C13.3555 14.5523 13.8032 15 14.3555 15H17.3555C17.9078 15 18.3555 14.5523 18.3555 14C18.3555 13.4477 17.9078 13 17.3555 13H14.3555Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.35547 7C2.35547 5.34315 3.69861 4 5.35547 4H19.3555C21.0123 4 22.3555 5.34315 22.3555 7V17C22.3555 18.6569 21.0123 20 19.3555 20H5.35547C3.69861 20 2.35547 18.6569 2.35547 17V7ZM5.35547 6C4.80318 6 4.35547 6.44772 4.35547 7V8H20.3555V7C20.3555 6.44772 19.9078 6 19.3555 6H5.35547ZM4.35547 17V10H20.3555V17C20.3555 17.5523 19.9078 18 19.3555 18H5.35547C4.80318 18 4.35547 17.5523 4.35547 17Z" fill="currentColor"/></svg>'},check_circle_line:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.9496 9.79545C17.3401 9.40493 17.3401 8.77176 16.9496 8.38124C16.5591 7.99071 15.9259 7.99071 15.5354 8.38124L10.5856 13.331L8.46431 11.2097C8.07379 10.8191 7.44063 10.8191 7.0501 11.2097C6.65958 11.6002 6.65958 12.2334 7.0501 12.6239L9.80782 15.3816C10.2374 15.8112 10.9339 15.8112 11.3635 15.3816L16.9496 9.79545Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z" fill="currentColor"/></svg>'},close_circle_line:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.46452 8.46443C8.85505 8.07391 9.48821 8.07391 9.87874 8.46443L12 10.5857L14.1213 8.46441C14.5118 8.07388 15.145 8.07388 15.5355 8.46441C15.926 8.85493 15.926 9.4881 15.5355 9.87862L13.4142 11.9999L15.5356 14.1213C15.9261 14.5118 15.9261 15.145 15.5356 15.5355C15.1451 15.926 14.5119 15.926 14.1214 15.5355L12 13.4141L9.87864 15.5355C9.48812 15.926 8.85496 15.926 8.46443 15.5355C8.07391 15.145 8.07391 14.5118 8.46443 14.1213L10.5858 11.9999L8.46452 9.87864C8.074 9.48812 8.074 8.85496 8.46452 8.46443Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z" fill="currentColor"/></svg>'},copy_2_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M19.3555 2C20.46 2 21.3555 2.89543 21.3555 4V16C21.3555 17.1046 20.46 18 19.3555 18H17.3555V20C17.3555 21.1046 16.46 22 15.3555 22H5.35547C4.2509 22 3.35547 21.1046 3.35547 20V8C3.35547 6.89543 4.2509 6 5.35547 6H7.35547V4C7.35547 2.89543 8.2509 2 9.35547 2H19.3555ZM9.35547 6H15.3555C16.46 6 17.3555 6.89543 17.3555 8V16H19.3555V4L9.35547 4V6ZM5.35547 8L15.3555 8V20H5.35547V8Z" fill="currentColor"/></svg>'},notification_fill:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.9998 19C15 19.5046 14.8094 19.9906 14.4664 20.3605C14.1233 20.7305 13.653 20.9572 13.1498 20.995L12.9998 21H10.9998C10.4953 21.0002 10.0093 20.8096 9.6393 20.4665C9.26932 20.1234 9.04269 19.6532 9.00485 19.15L8.99985 19H14.9998ZM11.9998 2C13.8148 1.99997 15.5589 2.70489 16.8641 3.96607C18.1693 5.22726 18.9336 6.94609 18.9958 8.76L18.9998 9V12.764L20.8218 16.408C20.9014 16.567 20.9412 16.7429 20.9378 16.9206C20.9345 17.0984 20.8881 17.2727 20.8027 17.4286C20.7173 17.5845 20.5953 17.7174 20.4473 17.8158C20.2993 17.9143 20.1297 17.9754 19.9528 17.994L19.8378 18H4.16185C3.98401 18.0001 3.80882 17.957 3.65127 17.8745C3.49372 17.792 3.35853 17.6725 3.25727 17.5264C3.156 17.3802 3.0917 17.2116 3.06985 17.0351C3.04801 16.8586 3.06928 16.6795 3.13185 16.513L3.17785 16.408L4.99985 12.764V9C4.99985 7.14348 5.73735 5.36301 7.0501 4.05025C8.36286 2.7375 10.1433 2 11.9998 2Z" fill="currentColor"/></svg>'},refresh_2_fill:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.4981 12.184C1.4881 10.917 2.8451 10.197 3.8771 10.778L3.9901 10.848L6.6681 12.652C8.0921 13.612 7.2061 15.798 5.5681 15.567L5.4311 15.542L5.3221 15.518C5.93702 16.7185 6.86412 17.731 8.00586 18.4491C9.1476 19.1671 10.4618 19.5642 11.8101 19.5985C13.1584 19.6327 14.4911 19.303 15.6679 18.6439C16.8446 17.9848 17.822 17.0207 18.4971 15.853C18.5955 15.6823 18.7265 15.5326 18.8827 15.4126C19.0389 15.2925 19.2172 15.2043 19.4075 15.1532C19.5978 15.102 19.7962 15.0888 19.9916 15.1144C20.187 15.1399 20.3754 15.2037 20.5461 15.302C20.7168 15.4004 20.8665 15.5314 20.9866 15.6876C21.1067 15.8438 21.1948 16.0222 21.246 16.2124C21.2971 16.4027 21.3103 16.6012 21.2848 16.7965C21.2592 16.9919 21.1955 17.1803 21.0971 17.351C18.7801 21.371 13.9781 23.503 9.2821 22.244C7.06294 21.6494 5.09998 20.3434 3.69403 18.5264C2.28808 16.7093 1.5167 14.4814 1.4981 12.184ZM2.9041 6.85404C5.2201 2.83304 10.0221 0.70204 14.7181 1.95904C16.9373 2.55373 18.9002 3.85965 20.3062 5.67669C21.7121 7.49373 22.4835 9.72165 22.5021 12.019C22.5121 13.286 21.1551 14.006 20.1231 13.426L20.0101 13.356L17.3321 11.551C15.9081 10.592 16.7941 8.40604 18.4311 8.63704L18.5691 8.66204L18.6771 8.68504C18.062 7.48471 17.1347 6.47234 15.9929 5.75447C14.8511 5.03659 13.5368 4.63973 12.1885 4.60565C10.8402 4.57158 9.50758 4.90153 8.33093 5.56081C7.15427 6.22009 6.17706 7.18431 5.5021 8.35204C5.40669 8.52821 5.27695 8.68348 5.12054 8.80868C4.96414 8.93389 4.78423 9.02649 4.59145 9.08103C4.39867 9.13556 4.19692 9.15093 3.9981 9.12621C3.79928 9.1015 3.60743 9.03721 3.43387 8.93713C3.26031 8.83706 3.10855 8.70323 2.98756 8.54354C2.86656 8.38385 2.77879 8.20154 2.72941 8.00738C2.68003 7.81321 2.67005 7.61112 2.70005 7.41303C2.73005 7.21494 2.79944 7.02487 2.9041 6.85404Z" fill="currentColor"/></svg>'},system_pix:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="System"><g id="add_circle_fill"><g id="Group 489"><path id="path2376" d="M17.4574 17.167C16.6924 17.167 15.9728 16.8691 15.4318 16.3283L12.5069 13.4034C12.3015 13.1975 11.9436 13.1981 11.7383 13.4034L8.80277 16.339C8.26174 16.8798 7.54215 17.1777 6.77709 17.1777H6.20068L9.90515 20.8821C11.062 22.0389 12.9378 22.0389 14.0947 20.8821L17.8097 17.167H17.4574Z" fill="currentColor"/><path id="path2380" d="M6.77692 6.822C7.54198 6.822 8.26158 7.11989 8.8026 7.66066L11.7382 10.5967C11.9496 10.8082 12.2948 10.809 12.5067 10.5965L15.4316 7.67136C15.9726 7.1306 16.6922 6.83271 17.4572 6.83271H17.8096L14.0947 3.11772C12.9376 1.96076 11.0619 1.96076 9.90498 3.11772L6.20068 6.82202L6.77692 6.822Z" fill="currentColor"/><path id="path2384" d="M20.8825 9.90525L18.6375 7.66028C18.5881 7.68007 18.5346 7.69243 18.4781 7.69243H17.4573C16.9296 7.69243 16.413 7.90647 16.0402 8.27963L13.1154 11.2045C12.8417 11.4782 12.482 11.6151 12.1227 11.6151C11.763 11.6151 11.4036 11.4782 11.13 11.2048L8.19419 8.26894C7.8213 7.8957 7.30472 7.68174 6.77701 7.68174H5.52192C5.46839 7.68174 5.41836 7.66912 5.37114 7.65134L3.11723 9.90525C1.96027 11.0622 1.96027 12.9379 3.11723 14.0948L5.37105 16.3487C5.41836 16.3309 5.46839 16.3183 5.52192 16.3183H6.77701C7.30472 16.3183 7.8213 16.1043 8.19419 15.7312L11.1297 12.7956C11.6603 12.2654 12.5853 12.2653 13.1154 12.7958L16.0402 15.7205C16.413 16.0936 16.9296 16.3076 17.4573 16.3076H18.4781C18.5346 16.3076 18.5881 16.32 18.6375 16.3398L20.8825 14.0948C22.0394 12.9379 22.0394 11.0622 20.8825 9.90523" fill="currentColor"/></g></g></g></svg>'}},Wi=(e,t)=>{let n=e;return Object.keys(t).forEach(r=>{n=n.replace(`:${r}`,t[r])}),n},Mw=(e,t,n)=>{const r=new URL(e);return t&&(r.pathname=t),n&&Object.entries(n).forEach(([s,i])=>{r.searchParams.append(s,i)}),r},Dw=e=>{try{return new URL(e).pathname.toLowerCase().endsWith(".svg")}catch{return!1}},Fw=e=>{if(/^#/.test(e)){const t=e.substring(1),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16),i=t.length===8?parseInt(t.substring(6,8),16)/255:1,o=i%1===0?i:+i.toFixed(2);return{r:n,g:r,b:s,a:o}}return e},qi=(e,t)=>{if(/^#/.test(e)){const n=Fw(e);return typeof n=="string"?n:`rgba(${n.r}, ${n.g}, ${n.b}, ${t})`}else if(/^rgb/.test(e)){const n=e.replace(/^rgba?\(|\s+|\)$/g,"").split(",");return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t})`}else return e},xu=e=>["#ffffff","#fff","white","#000000","#000","black","#808080","gray","grey"].includes(e.toLowerCase()),Bw=(e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),s=Math.min(e,t,n);let i=0;if(r!==s){const o=r-s;switch(r){case e:i=(t-n)/o+(t<n?6:0);break;case t:i=(n-e)/o+2;break;case n:i=(e-t)/o+4;break}i/=6}return Math.round(i*360)},Uw=e=>{if(!e||e==="currentColor"||xu(e))return 0;const t=document.createElement("div");t.style.color=e,document.body.appendChild(t);const n=getComputedStyle(t).color;document.body.removeChild(t);const r=n.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!r)return 0;const[s,i,o,a]=r.map(Number);return Bw(i,o,a)},$w=e=>!e||e==="currentColor"?"none":xu(e)?e.toLowerCase().includes("fff")||e==="white"?"brightness(0) invert(100%)":"brightness(0)":`brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(4299%)
|
|
43
|
-
hue-rotate(${
|
|
42
|
+
`;class Au extends ce{constructor({text:t,borderType:n="solid",color:r=C.neutral_base}){super({tag:"div",styles:()=>Fw({borderType:n,color:r})});const s=document.createElement("hr");if(s.classList.add("divider-line"),this.element.appendChild(s),t){const i=new q({text:t,size:16,weight:600,lineHeight:24}),o=document.createElement("hr");o.classList.add("divider-line"),i.render(this.element),this.element.appendChild(o)}}}const Bw={astropay_logo:{svg:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="Logo"><path id="Vector" fill-rule="evenodd" clip-rule="evenodd" d="M15.166 10.7383C16.0308 10.7383 16.8793 10.8059 17.7074 10.9372L19.7866 16.0843C18.3684 15.4763 16.8067 15.1396 15.166 15.1396C11.4591 15.1396 8.154 16.8578 6.00304 19.541H0.786621C3.45841 14.3156 8.8949 10.7383 15.166 10.7383Z" fill="#143534"/><path id="Vector_2" fill-rule="evenodd" clip-rule="evenodd" d="M13.3258 0.101402L17.0783 9.37359C16.4499 9.30594 15.8109 9.27089 15.1645 9.27089C14.2199 9.27089 13.2932 9.34506 12.3884 9.48851L10.9588 5.95031L9.19826 10.3068C6.78974 11.1741 4.62493 12.5515 2.83423 14.3088L8.57474 0.100586H13.3258V0.101402Z" fill="#151E1D"/></g></svg>'},alert_line:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 8C12.5523 8 13 8.44772 13 9V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V9C11 8.44772 11.4477 8 12 8Z" fill="currentColor"/><path d="M12 17C12.5523 17 13 16.5523 13 16C13 15.4477 12.5523 15 12 15C11.4477 15 11 15.4477 11 16C11 16.5523 11.4477 17 12 17Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10.7009 3.14771C11.2783 2.14771 12.7217 2.1477 13.299 3.1477L21.933 18.1022C22.5103 19.1022 21.7887 20.3522 20.634 20.3522H3.36601C2.21131 20.3522 1.48962 19.1022 2.06697 18.1022L10.7009 3.14771ZM12 4.8977L4.23203 18.3522H19.7679L12 4.8977Z" fill="currentColor"/></svg>'},arrow_right_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.0626 5.63603L20.7194 11.2929C21.1099 11.6834 21.1099 12.3166 20.7194 12.7071L15.0626 18.364C14.672 18.7545 14.0389 18.7545 13.6483 18.364C13.2578 17.9734 13.2578 17.3403 13.6483 16.9497L17.5981 13H4.35547C3.80318 13 3.35547 12.5523 3.35547 12C3.35547 11.4477 3.80318 11 4.35547 11H17.5981L13.6483 7.05025C13.2578 6.65972 13.2578 6.02656 13.6483 5.63603C14.0389 5.24551 14.672 5.24551 15.0626 5.63603Z" fill="currentColor"/></svg>'},arrow_down_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.0626 15.7071C12.6721 16.0976 12.0389 16.0976 11.6484 15.7071L5.99151 10.0502C5.60098 9.6597 5.60098 9.02653 5.99151 8.63601C6.38203 8.24549 7.0152 8.24549 7.40572 8.63601L12.3555 13.5858L17.3052 8.63601C17.6957 8.24549 18.3289 8.24549 18.7194 8.63601C19.11 9.02653 19.11 9.6597 18.7194 10.0502L13.0626 15.7071Z" fill="currentColor"/></svg>'},bank_card_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.3555 13C13.8032 13 13.3555 13.4477 13.3555 14C13.3555 14.5523 13.8032 15 14.3555 15H17.3555C17.9078 15 18.3555 14.5523 18.3555 14C18.3555 13.4477 17.9078 13 17.3555 13H14.3555Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.35547 7C2.35547 5.34315 3.69861 4 5.35547 4H19.3555C21.0123 4 22.3555 5.34315 22.3555 7V17C22.3555 18.6569 21.0123 20 19.3555 20H5.35547C3.69861 20 2.35547 18.6569 2.35547 17V7ZM5.35547 6C4.80318 6 4.35547 6.44772 4.35547 7V8H20.3555V7C20.3555 6.44772 19.9078 6 19.3555 6H5.35547ZM4.35547 17V10H20.3555V17C20.3555 17.5523 19.9078 18 19.3555 18H5.35547C4.80318 18 4.35547 17.5523 4.35547 17Z" fill="currentColor"/></svg>'},check_circle_line:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.9496 9.79545C17.3401 9.40493 17.3401 8.77176 16.9496 8.38124C16.5591 7.99071 15.9259 7.99071 15.5354 8.38124L10.5856 13.331L8.46431 11.2097C8.07379 10.8191 7.44063 10.8191 7.0501 11.2097C6.65958 11.6002 6.65958 12.2334 7.0501 12.6239L9.80782 15.3816C10.2374 15.8112 10.9339 15.8112 11.3635 15.3816L16.9496 9.79545Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z" fill="currentColor"/></svg>'},close_circle_line:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.46452 8.46443C8.85505 8.07391 9.48821 8.07391 9.87874 8.46443L12 10.5857L14.1213 8.46441C14.5118 8.07388 15.145 8.07388 15.5355 8.46441C15.926 8.85493 15.926 9.4881 15.5355 9.87862L13.4142 11.9999L15.5356 14.1213C15.9261 14.5118 15.9261 15.145 15.5356 15.5355C15.1451 15.926 14.5119 15.926 14.1214 15.5355L12 13.4141L9.87864 15.5355C9.48812 15.926 8.85496 15.926 8.46443 15.5355C8.07391 15.145 8.07391 14.5118 8.46443 14.1213L10.5858 11.9999L8.46452 9.87864C8.074 9.48812 8.074 8.85496 8.46452 8.46443Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z" fill="currentColor"/></svg>'},copy_2_line:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M19.3555 2C20.46 2 21.3555 2.89543 21.3555 4V16C21.3555 17.1046 20.46 18 19.3555 18H17.3555V20C17.3555 21.1046 16.46 22 15.3555 22H5.35547C4.2509 22 3.35547 21.1046 3.35547 20V8C3.35547 6.89543 4.2509 6 5.35547 6H7.35547V4C7.35547 2.89543 8.2509 2 9.35547 2H19.3555ZM9.35547 6H15.3555C16.46 6 17.3555 6.89543 17.3555 8V16H19.3555V4L9.35547 4V6ZM5.35547 8L15.3555 8V20H5.35547V8Z" fill="currentColor"/></svg>'},notification_fill:{svg:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.9998 19C15 19.5046 14.8094 19.9906 14.4664 20.3605C14.1233 20.7305 13.653 20.9572 13.1498 20.995L12.9998 21H10.9998C10.4953 21.0002 10.0093 20.8096 9.6393 20.4665C9.26932 20.1234 9.04269 19.6532 9.00485 19.15L8.99985 19H14.9998ZM11.9998 2C13.8148 1.99997 15.5589 2.70489 16.8641 3.96607C18.1693 5.22726 18.9336 6.94609 18.9958 8.76L18.9998 9V12.764L20.8218 16.408C20.9014 16.567 20.9412 16.7429 20.9378 16.9206C20.9345 17.0984 20.8881 17.2727 20.8027 17.4286C20.7173 17.5845 20.5953 17.7174 20.4473 17.8158C20.2993 17.9143 20.1297 17.9754 19.9528 17.994L19.8378 18H4.16185C3.98401 18.0001 3.80882 17.957 3.65127 17.8745C3.49372 17.792 3.35853 17.6725 3.25727 17.5264C3.156 17.3802 3.0917 17.2116 3.06985 17.0351C3.04801 16.8586 3.06928 16.6795 3.13185 16.513L3.17785 16.408L4.99985 12.764V9C4.99985 7.14348 5.73735 5.36301 7.0501 4.05025C8.36286 2.7375 10.1433 2 11.9998 2Z" fill="currentColor"/></svg>'},refresh_2_fill:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.4981 12.184C1.4881 10.917 2.8451 10.197 3.8771 10.778L3.9901 10.848L6.6681 12.652C8.0921 13.612 7.2061 15.798 5.5681 15.567L5.4311 15.542L5.3221 15.518C5.93702 16.7185 6.86412 17.731 8.00586 18.4491C9.1476 19.1671 10.4618 19.5642 11.8101 19.5985C13.1584 19.6327 14.4911 19.303 15.6679 18.6439C16.8446 17.9848 17.822 17.0207 18.4971 15.853C18.5955 15.6823 18.7265 15.5326 18.8827 15.4126C19.0389 15.2925 19.2172 15.2043 19.4075 15.1532C19.5978 15.102 19.7962 15.0888 19.9916 15.1144C20.187 15.1399 20.3754 15.2037 20.5461 15.302C20.7168 15.4004 20.8665 15.5314 20.9866 15.6876C21.1067 15.8438 21.1948 16.0222 21.246 16.2124C21.2971 16.4027 21.3103 16.6012 21.2848 16.7965C21.2592 16.9919 21.1955 17.1803 21.0971 17.351C18.7801 21.371 13.9781 23.503 9.2821 22.244C7.06294 21.6494 5.09998 20.3434 3.69403 18.5264C2.28808 16.7093 1.5167 14.4814 1.4981 12.184ZM2.9041 6.85404C5.2201 2.83304 10.0221 0.70204 14.7181 1.95904C16.9373 2.55373 18.9002 3.85965 20.3062 5.67669C21.7121 7.49373 22.4835 9.72165 22.5021 12.019C22.5121 13.286 21.1551 14.006 20.1231 13.426L20.0101 13.356L17.3321 11.551C15.9081 10.592 16.7941 8.40604 18.4311 8.63704L18.5691 8.66204L18.6771 8.68504C18.062 7.48471 17.1347 6.47234 15.9929 5.75447C14.8511 5.03659 13.5368 4.63973 12.1885 4.60565C10.8402 4.57158 9.50758 4.90153 8.33093 5.56081C7.15427 6.22009 6.17706 7.18431 5.5021 8.35204C5.40669 8.52821 5.27695 8.68348 5.12054 8.80868C4.96414 8.93389 4.78423 9.02649 4.59145 9.08103C4.39867 9.13556 4.19692 9.15093 3.9981 9.12621C3.79928 9.1015 3.60743 9.03721 3.43387 8.93713C3.26031 8.83706 3.10855 8.70323 2.98756 8.54354C2.86656 8.38385 2.77879 8.20154 2.72941 8.00738C2.68003 7.81321 2.67005 7.61112 2.70005 7.41303C2.73005 7.21494 2.79944 7.02487 2.9041 6.85404Z" fill="currentColor"/></svg>'},system_pix:{svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="System"><g id="add_circle_fill"><g id="Group 489"><path id="path2376" d="M17.4574 17.167C16.6924 17.167 15.9728 16.8691 15.4318 16.3283L12.5069 13.4034C12.3015 13.1975 11.9436 13.1981 11.7383 13.4034L8.80277 16.339C8.26174 16.8798 7.54215 17.1777 6.77709 17.1777H6.20068L9.90515 20.8821C11.062 22.0389 12.9378 22.0389 14.0947 20.8821L17.8097 17.167H17.4574Z" fill="currentColor"/><path id="path2380" d="M6.77692 6.822C7.54198 6.822 8.26158 7.11989 8.8026 7.66066L11.7382 10.5967C11.9496 10.8082 12.2948 10.809 12.5067 10.5965L15.4316 7.67136C15.9726 7.1306 16.6922 6.83271 17.4572 6.83271H17.8096L14.0947 3.11772C12.9376 1.96076 11.0619 1.96076 9.90498 3.11772L6.20068 6.82202L6.77692 6.822Z" fill="currentColor"/><path id="path2384" d="M20.8825 9.90525L18.6375 7.66028C18.5881 7.68007 18.5346 7.69243 18.4781 7.69243H17.4573C16.9296 7.69243 16.413 7.90647 16.0402 8.27963L13.1154 11.2045C12.8417 11.4782 12.482 11.6151 12.1227 11.6151C11.763 11.6151 11.4036 11.4782 11.13 11.2048L8.19419 8.26894C7.8213 7.8957 7.30472 7.68174 6.77701 7.68174H5.52192C5.46839 7.68174 5.41836 7.66912 5.37114 7.65134L3.11723 9.90525C1.96027 11.0622 1.96027 12.9379 3.11723 14.0948L5.37105 16.3487C5.41836 16.3309 5.46839 16.3183 5.52192 16.3183H6.77701C7.30472 16.3183 7.8213 16.1043 8.19419 15.7312L11.1297 12.7956C11.6603 12.2654 12.5853 12.2653 13.1154 12.7958L16.0402 15.7205C16.413 16.0936 16.9296 16.3076 17.4573 16.3076H18.4781C18.5346 16.3076 18.5881 16.32 18.6375 16.3398L20.8825 14.0948C22.0394 12.9379 22.0394 11.0622 20.8825 9.90523" fill="currentColor"/></g></g></g></svg>'}},qi=(e,t)=>{let n=e;return Object.keys(t).forEach(r=>{n=n.replace(`:${r}`,t[r])}),n},$w=(e,t,n)=>{const r=new URL(e);return t&&(r.pathname=t),n&&Object.entries(n).forEach(([s,i])=>{r.searchParams.append(s,i)}),r},Uw=e=>{try{return new URL(e).pathname.toLowerCase().endsWith(".svg")}catch{return!1}},Vw=e=>{if(/^#/.test(e)){const t=e.substring(1),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16),i=t.length===8?parseInt(t.substring(6,8),16)/255:1,o=i%1===0?i:+i.toFixed(2);return{r:n,g:r,b:s,a:o}}return e},Ki=(e,t)=>{if(/^#/.test(e)){const n=Vw(e);return typeof n=="string"?n:`rgba(${n.r}, ${n.g}, ${n.b}, ${t})`}else if(/^rgb/.test(e)){const n=e.replace(/^rgba?\(|\s+|\)$/g,"").split(",");return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t})`}else return e},Ru=e=>["#ffffff","#fff","white","#000000","#000","black","#808080","gray","grey"].includes(e.toLowerCase()),zw=(e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),s=Math.min(e,t,n);let i=0;if(r!==s){const o=r-s;switch(r){case e:i=(t-n)/o+(t<n?6:0);break;case t:i=(n-e)/o+2;break;case n:i=(e-t)/o+4;break}i/=6}return Math.round(i*360)},Hw=e=>{if(!e||e==="currentColor"||Ru(e))return 0;const t=document.createElement("div");t.style.color=e,document.body.appendChild(t);const n=getComputedStyle(t).color;document.body.removeChild(t);const r=n.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!r)return 0;const[s,i,o,a]=r.map(Number);return zw(i,o,a)},jw=e=>!e||e==="currentColor"?"none":Ru(e)?e.toLowerCase().includes("fff")||e==="white"?"brightness(0) invert(100%)":"brightness(0)":`brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(4299%)
|
|
43
|
+
hue-rotate(${Hw(e)}deg) brightness(97%) contrast(113%)`,Ww=e=>K`
|
|
44
44
|
background-image: var(--icon-url);
|
|
45
45
|
background-repeat: no-repeat;
|
|
46
46
|
background-size: contain;
|
|
47
47
|
background-position: center;
|
|
48
48
|
background-color: transparent;
|
|
49
|
-
filter: ${
|
|
50
|
-
`,
|
|
49
|
+
filter: ${jw(e)};
|
|
50
|
+
`,qw=e=>K`
|
|
51
51
|
background-color: ${e};
|
|
52
52
|
-webkit-mask-box-image: var(--icon-url);
|
|
53
53
|
-webkit-mask-image: var(--icon-url);
|
|
@@ -58,7 +58,7 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
58
58
|
mask-repeat: no-repeat;
|
|
59
59
|
mask-size: contain;
|
|
60
60
|
mask-position: center;
|
|
61
|
-
`,
|
|
61
|
+
`,Kw=({size:e,color:t,isSvgResource:n,isAlternativeStyles:r})=>K`
|
|
62
62
|
display: inline-flex;
|
|
63
63
|
align-items: center;
|
|
64
64
|
justify-content: center;
|
|
@@ -80,9 +80,9 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
80
80
|
width: ${e}px;
|
|
81
81
|
height: ${e}px;
|
|
82
82
|
|
|
83
|
-
${r?
|
|
83
|
+
${r?Ww(t):qw(t)}
|
|
84
84
|
`}
|
|
85
|
-
`;class
|
|
85
|
+
`;class Je extends ce{constructor({name:t,color:n="currentColor",size:r=16,alt:s}){const i=Uw(t),o=uf(qo.FIREFOX);super({tag:"span",styles:()=>Kw({size:r,color:n,isSvgResource:i,isAlternativeStyles:o})});const a=Bw[t];if(a)this.element.innerHTML=a.svg;else if(i){const c=document.createElement("div");c.classList.add("icon"),this.element.append(c),this.element.style.setProperty("--icon-url",`url(${t})`)}else{const c=document.createElement("img");c.src=t,c.alt=s??"icon",this.element.append(c)}}}class Gw extends ce{constructor({content:t}){super({tag:"div"}),this.element.classList.add("accordion-content"),typeof t=="function"?this.element.appendChild(t()):this.element.appendChild(t)}}const Yw=()=>K`
|
|
86
86
|
.accordion-header {
|
|
87
87
|
display: flex;
|
|
88
88
|
justify-content: space-between;
|
|
@@ -110,11 +110,11 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
110
110
|
height: auto;
|
|
111
111
|
padding: 12px 0;
|
|
112
112
|
}
|
|
113
|
-
`;class
|
|
113
|
+
`;class Jw extends ce{constructor({icon:n,title:r,content:s,isOpen:i=!1,onClick:o}){super({tag:"div",styles:()=>Yw()});A(this,"isOpen");A(this,"content");A(this,"onClick");A(this,"accordionContent",null);A(this,"arrowWrapper");this.isOpen=i,this.content=s,this.onClick=o;const a=document.createElement("div");a.classList.add("accordion-header"),a.addEventListener("click",this.handleClick.bind(this));const c=new Je({name:n,size:16,color:U.getStyles().textPrimaryColor}).element,l=new q({variant:"div",size:16,weight:500,text:r}).element;this.arrowWrapper=document.createElement("span"),this.arrowWrapper.classList.add("arrow-wrapper");const u=new Je({name:"arrow_down_line",size:24,color:U.getStyles().textPrimaryColor}).element;this.arrowWrapper.appendChild(u),a.append(c,l,this.arrowWrapper),this.element.appendChild(a),this.isOpen&&(this.renderContent(),this.arrowWrapper.classList.add("rotated"))}handleClick(){this.onClick()}toggleContent(){this.isOpen||(this.renderContent(),this.arrowWrapper.classList.add("rotated")),this.isOpen=!0}destroyContent(){var n;this.isOpen&&((n=this.accordionContent)==null||n.destroy(),this.accordionContent=null,this.arrowWrapper.classList.remove("rotated")),this.isOpen=!1}renderContent(){this.accordionContent||(this.accordionContent=new Gw({content:this.content}),this.element.appendChild(this.accordionContent.element))}}class Zw extends ce{constructor({items:n}){super({tag:"div"});A(this,"openIndex",null);A(this,"accordionItems",[]);this.accordionItems=n.map((r,s)=>{const i=new Jw({icon:r.icon,title:r.title,content:r.content,isOpen:this.openIndex===s,onClick:()=>this.handleItemClick(s)});if(this.element.appendChild(i.element),s!==n.length-1){const o=new Au({borderType:"dashed"}).element;o.style.padding="4px 0",this.element.appendChild(o)}return i})}handleItemClick(n){this.openIndex===n?this.openIndex=null:this.openIndex=n,this.updateItems()}updateItems(){this.accordionItems.forEach((n,r)=>{this.openIndex===r?n.toggleContent():n.destroyContent()})}}const Xw=pr`
|
|
114
114
|
100% {
|
|
115
115
|
transform: rotate(360deg);
|
|
116
116
|
}
|
|
117
|
-
`,
|
|
117
|
+
`,Qw=pr`
|
|
118
118
|
0% {
|
|
119
119
|
clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0);
|
|
120
120
|
}
|
|
@@ -130,16 +130,16 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
130
130
|
100% {
|
|
131
131
|
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
|
|
132
132
|
}
|
|
133
|
-
`,
|
|
133
|
+
`,eS=pr`
|
|
134
134
|
100% {
|
|
135
135
|
transform: rotate(1turn);
|
|
136
136
|
}
|
|
137
|
-
`,
|
|
137
|
+
`,tS=(e,t)=>K`
|
|
138
138
|
width: ${e}px;
|
|
139
139
|
height: ${e}px;
|
|
140
140
|
border-radius: 50%;
|
|
141
141
|
position: relative;
|
|
142
|
-
animation: ${
|
|
142
|
+
animation: ${Xw} 1s linear infinite;
|
|
143
143
|
|
|
144
144
|
&::before {
|
|
145
145
|
content: '';
|
|
@@ -148,9 +148,9 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
148
148
|
inset: 0px;
|
|
149
149
|
border-radius: 50%;
|
|
150
150
|
border: 2.5px solid ${t};
|
|
151
|
-
animation: ${
|
|
151
|
+
animation: ${Qw} 2s linear infinite;
|
|
152
152
|
}
|
|
153
|
-
`,
|
|
153
|
+
`,nS=(e,t)=>K`
|
|
154
154
|
width: ${e}px;
|
|
155
155
|
aspect-ratio: 1;
|
|
156
156
|
border-radius: 50%;
|
|
@@ -158,88 +158,92 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
158
158
|
radial-gradient(farthest-side, ${t} 94%, transparent) top/8px 8px no-repeat,
|
|
159
159
|
conic-gradient(transparent 30%, ${t});
|
|
160
160
|
mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 0);
|
|
161
|
-
animation: ${
|
|
162
|
-
`;class
|
|
161
|
+
animation: ${eS} 1s infinite linear;
|
|
162
|
+
`;class At extends ce{constructor({size:t=24,color:n="currentColor",variant:r="inline"}){super({tag:r==="inline"?"span":"div",styles:()=>r==="inline"?tS(t,n):nS(t,n)})}}const hr={small:"32px",medium:"40px",large:"48px"},rS=(e="medium")=>`calc(${hr[e]} + 8px * 2 )`,sS=pr`
|
|
163
163
|
0% { transform: none; }
|
|
164
164
|
12.5% { transform: none; }
|
|
165
165
|
25% { transform: scale(1.1); }
|
|
166
166
|
37.5% { transform: scale(1.1); }
|
|
167
167
|
50% { transform: none; }
|
|
168
168
|
100% { transform: none; }
|
|
169
|
-
`,
|
|
169
|
+
`,iS=(e="medium")=>{const t=hr[e],n=`calc(${t} * -1)`,r=`calc(${t} * -2)`;return pr`
|
|
170
170
|
0% { transform: translateY(0); }
|
|
171
171
|
12.5% { transform: translateY(${n}); }
|
|
172
172
|
25% { transform: translateY(${n}); }
|
|
173
173
|
37.5% { transform: translateY(${r}); }
|
|
174
174
|
87.5% { transform: translateY(${r}); }
|
|
175
175
|
100% { transform: translateY(0); }
|
|
176
|
-
`},
|
|
176
|
+
`},oS=(e,t="medium")=>{switch(t){case"small":return K`
|
|
177
177
|
padding: 8px;
|
|
178
|
-
height: ${
|
|
178
|
+
height: ${hr[t]};
|
|
179
179
|
font-size: 12px;
|
|
180
180
|
line-height: 16px;
|
|
181
|
-
border-radius:
|
|
181
|
+
border-radius: ${e.button.small.borderRadius}px;
|
|
182
182
|
font-weight: 600;
|
|
183
183
|
`;case"medium":return K`
|
|
184
184
|
padding: 8px 16px;
|
|
185
|
-
height: ${
|
|
185
|
+
height: ${hr[t]};
|
|
186
186
|
line-height: 24px;
|
|
187
|
-
border-radius:
|
|
187
|
+
border-radius: ${e.button.medium.borderRadius}px;
|
|
188
188
|
font-size: 14px;
|
|
189
|
-
`;case"large":return K`
|
|
189
|
+
`;case"large":default:return K`
|
|
190
190
|
padding: 8px 16px;
|
|
191
|
-
height: ${
|
|
191
|
+
height: ${hr[t]};
|
|
192
192
|
line-height: 32px;
|
|
193
|
-
border-radius:
|
|
193
|
+
border-radius: ${e.button.large.borderRadius}px;
|
|
194
194
|
font-size: 16px;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
`}},Gi=(e,t)=>K`
|
|
196
|
+
cursor: not-allowed;
|
|
197
|
+
background-color: ${t?e.apButtonDisableBgColor:e.button.disabled.backgroundColor};
|
|
198
|
+
color: ${t?e.apButtonDisableTextColor:e.button.disabled.textColor};
|
|
199
|
+
`,aS=(e,t,n)=>{switch(e){case"primary":return K`
|
|
200
|
+
background-color: ${n.isApTheme?t.apButtonPrimaryBgColor:t.button.primary.backgroundColor};
|
|
201
|
+
color: ${n.isApTheme?t.apButtonPrimaryTxtColor:t.button.primary.textColor};
|
|
202
|
+
border: ${n.isApTheme?"unset":`${t.button.primary.borderWidth}px solid ${t.button.primary.borderColor}`};
|
|
198
203
|
&:hover {
|
|
199
|
-
background-color: ${
|
|
204
|
+
background-color: ${Ki(n.isApTheme?t.apButtonPrimaryBgColor:t.button.primary.backgroundColor,.7)};
|
|
200
205
|
}
|
|
201
206
|
&:disabled {
|
|
202
|
-
|
|
203
|
-
color: ${t.apButtonDisableTextColor};
|
|
204
|
-
cursor: not-allowed;
|
|
207
|
+
${Gi(t,n.isApTheme)}
|
|
205
208
|
}
|
|
206
209
|
`;case"secondary":return K`
|
|
207
|
-
background-color: ${n.isApTheme?t.apButtonSecondaryBgColor:t.
|
|
208
|
-
color: ${n.isApTheme?t.apButtonSecondaryTxtColor:t.
|
|
210
|
+
background-color: ${n.isApTheme?t.apButtonSecondaryBgColor:t.button.secondary.backgroundColor};
|
|
211
|
+
color: ${n.isApTheme?t.apButtonSecondaryTxtColor:t.button.secondary.textColor};
|
|
212
|
+
border: ${n.isApTheme?"unset":`${t.button.secondary.borderWidth}px solid ${t.button.secondary.borderColor}`};
|
|
209
213
|
&:hover {
|
|
210
|
-
background-color: ${
|
|
214
|
+
background-color: ${Ki(n.isApTheme?t.apButtonSecondaryBgColor:t.button.secondary.backgroundColor,.7)};
|
|
211
215
|
}
|
|
212
216
|
&:disabled {
|
|
213
|
-
|
|
214
|
-
color: ${t.apButtonDisableTextColor};
|
|
215
|
-
cursor: not-allowed;
|
|
217
|
+
${Gi(t,n.isApTheme)}
|
|
216
218
|
}
|
|
217
219
|
`;case"text":return K`
|
|
218
|
-
background-color: unset;
|
|
219
|
-
color: ${n.isApTheme?t.apButtonTextTxtColor:t.
|
|
220
|
-
border:
|
|
220
|
+
background-color: ${n.isApTheme?"unset":t.button.text.backgroundColor};
|
|
221
|
+
color: ${n.isApTheme?t.apButtonTextTxtColor:t.button.text.textColor};
|
|
222
|
+
border: ${n.isApTheme?1:t.button.text.borderWidth}px solid
|
|
223
|
+
${n.isApTheme?t.apButtonTextTxtColor:t.button.text.borderColor};
|
|
224
|
+
|
|
221
225
|
&:disabled {
|
|
222
|
-
color: ${t.apButtonDisableTextColor};
|
|
226
|
+
color: ${n.isApTheme?t.apButtonDisableTextColor:t.button.disabled.textColor};
|
|
227
|
+
background-color: ${n.isApTheme?"unset":t.button.disabled.backgroundColor};
|
|
223
228
|
cursor: not-allowed;
|
|
224
229
|
}
|
|
225
230
|
`;case"copy-to-clipboard":return K`
|
|
226
|
-
background-color: ${n.isApTheme?t.apButtonSecondaryBgColor:t.
|
|
227
|
-
color: ${n.isApTheme?t.apButtonSecondaryTxtColor:t.
|
|
231
|
+
background-color: ${n.isApTheme?t.apButtonSecondaryBgColor:t.button.secondary.backgroundColor};
|
|
232
|
+
color: ${n.isApTheme?t.apButtonSecondaryTxtColor:t.button.secondary.textColor};
|
|
233
|
+
border: ${n.isApTheme?"unset":`${t.button.secondary.borderWidth}px solid ${t.button.secondary.borderColor}`};
|
|
228
234
|
&:hover {
|
|
229
|
-
background-color: ${
|
|
235
|
+
background-color: ${Ki(n.isApTheme?t.apButtonSecondaryBgColor:t.button.secondary.backgroundColor,.7)};
|
|
230
236
|
}
|
|
231
237
|
&:disabled {
|
|
232
|
-
|
|
233
|
-
color: ${t.apButtonDisableTextColor};
|
|
234
|
-
cursor: not-allowed;
|
|
238
|
+
${Gi(t,n.isApTheme)}
|
|
235
239
|
}
|
|
236
240
|
&[data-is-copied='true'] {
|
|
237
|
-
background-color: ${t.
|
|
238
|
-
color: ${t.
|
|
241
|
+
background-color: ${n.isApTheme?t.apButtonPrimaryBgColor:t.button.primary.backgroundColor};
|
|
242
|
+
color: ${n.isApTheme?t.apButtonPrimaryTxtColor:t.button.primary.textColor};
|
|
239
243
|
box-shadow: none;
|
|
240
|
-
animation: ${
|
|
244
|
+
animation: ${sS} 3s cubic-bezier(1, -0.5, 0, 1.5) forwards;
|
|
241
245
|
}
|
|
242
|
-
`;default:return K``}},
|
|
246
|
+
`;default:return K``}},cS=(e,t)=>{const{size:n,variant:r,isFullWidth:s}=t,i=K`
|
|
243
247
|
border: none;
|
|
244
248
|
cursor: pointer;
|
|
245
249
|
display: inline-flex;
|
|
@@ -281,12 +285,12 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
281
285
|
opacity 0.3s ease,
|
|
282
286
|
visibility 0.3s ease;
|
|
283
287
|
|
|
284
|
-
margin-top: ${
|
|
288
|
+
margin-top: ${rS(n)};
|
|
285
289
|
}
|
|
286
290
|
|
|
287
291
|
&[data-is-copied='true'] {
|
|
288
292
|
.content-wrapper {
|
|
289
|
-
animation: ${
|
|
293
|
+
animation: ${iS(n)} 3s cubic-bezier(1, -0.5, 0, 1.5) forwards;
|
|
290
294
|
}
|
|
291
295
|
|
|
292
296
|
.content-copy {
|
|
@@ -294,7 +298,7 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
294
298
|
opacity: 1;
|
|
295
299
|
}
|
|
296
300
|
}
|
|
297
|
-
`;return
|
|
301
|
+
`;return Mw(i,oS(e,n),aS(r,e,t))};class Rn extends ce{constructor({text:n,size:r="large",variant:s="primary",iconLeft:i,iconRight:o,isLoading:a=!1,isDisabled:c=!1,isFullWidth:l=!1,onClick:u,copyText:d=te.translate("copied"),isApTheme:f=!1}){const h={size:r,variant:s,isFullWidth:l,isApTheme:f};super({tag:"button",styles:p=>cS(p,h)});A(this,"isLoading");A(this,"isDisabled");A(this,"iconLeft");A(this,"iconRight");A(this,"originalText");A(this,"originalIconLeft");A(this,"originalIconRight");A(this,"variant");A(this,"copyText");A(this,"onClick");this.isLoading=a,this.isDisabled=c,this.onClick=u,this.copyText=d,this.element.disabled=c,this.originalText=n,this.originalIconLeft=i,this.originalIconRight=o,this.variant=s,this.updateContent({text:n,iconLeft:i,iconRight:o}),this.element.addEventListener("click",this.handleClick.bind(this))}updateContent({text:n,iconLeft:r,iconRight:s}){this.element.innerHTML="";const i=document.createElement("div");if(i.classList.add("content-wrapper"),this.isLoading){const o=new At({size:16}).element;o.style.margin="auto",i.append(o),this.element.append(i)}else{const o=document.createElement("div");if(o.classList.add("content-info"),r&&(this.iconLeft=new Je({name:r}),o.append(this.iconLeft.element)),n&&o.appendChild(document.createTextNode(n)),s&&(this.iconRight=new Je({name:s}),o.append(this.iconRight.element)),i.append(o),this.variant==="copy-to-clipboard"){const a=document.createElement("div");a.classList.add("content-copy"),a.append(document.createTextNode(this.copyText)),i.append(a)}this.element.append(i)}}handleClick(n){this.variant==="copy-to-clipboard"&&this.copyText&&(this.element.setAttribute("data-is-copied","true"),setTimeout(()=>{this.element.setAttribute("data-is-copied","false")},3e3)),this.onClick&&!this.isLoading&&!this.isDisabled&&this.onClick(n)}setLoading(n){this.isLoading=n,this.updateContent({text:this.originalText,iconLeft:this.originalIconLeft,iconRight:this.originalIconRight})}setDisabled(n){this.isDisabled=n,this.element.disabled=n}}const lS=e=>{switch(e){case"end":return"flex-end";case"center":return"center";case"space-between":return"space-between";case"start":default:return"flex-start"}},uS=({bgColor:e,isFullWidth:t,align:n})=>K`
|
|
298
302
|
box-sizing: border-box;
|
|
299
303
|
display: flex;
|
|
300
304
|
align-items: center;
|
|
@@ -305,7 +309,7 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
305
309
|
background-color: ${e};
|
|
306
310
|
padding: 2px 6px;
|
|
307
311
|
border-radius: 4px;
|
|
308
|
-
justify-content: ${
|
|
312
|
+
justify-content: ${lS(n)};
|
|
309
313
|
|
|
310
314
|
.pill-content {
|
|
311
315
|
display: flex;
|
|
@@ -313,28 +317,27 @@ ${f}`),e.finish(g=>{p(Ic(g))})}return{flushController:n,add:l,upsert:l,stop:i.un
|
|
|
313
317
|
gap: 4px;
|
|
314
318
|
flex-wrap: wrap;
|
|
315
319
|
}
|
|
316
|
-
`;class
|
|
317
|
-
]))+`;
|
|
318
|
-
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),r.put(i,13)}},
|
|
319
|
-
Suggested mode is: `+t.toString(_));switch(
|
|
320
|
+
`;class Yi extends ce{constructor({items:t,color:n=U.getStyles().apPillTxtColor,bgColor:r=U.getStyles().apPillBgColor,isFullWidth:s=!1,align:i="start"}){super({tag:"div",styles:()=>uS({bgColor:r,isFullWidth:s,align:i})}),t.forEach(({title:o,icon:a})=>{const c=document.createElement("div");if(c.classList.add("pill-content"),a){const u=new Je({name:a,size:12,color:n}).element;c.append(u)}const l=new q({text:o,weight:500,color:n}).element;c.append(l),this.element.append(c)})}}function dS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kn={},Ji,ku;function fS(){return ku||(ku=1,Ji=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ji}var Zi={},Rt={},Iu;function qt(){if(Iu)return Rt;Iu=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Rt.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},Rt.getSymbolTotalCodewords=function(r){return t[r]},Rt.getBCHDigit=function(n){let r=0;for(;n!==0;)r++,n>>>=1;return r},Rt.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},Rt.isKanjiModeEnabled=function(){return typeof e<"u"},Rt.toSJIS=function(r){return e(r)},Rt}var Xi={},Ou;function Qi(){return Ou||(Ou=1,function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}}(Xi)),Xi}var eo,Lu;function pS(){if(Lu)return eo;Lu=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let r=0;r<n;r++)this.putBit((t>>>n-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},eo=e,eo}var to,Pu;function hS(){if(Pu)return to;Pu=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,n,r,s){const i=t*this.size+n;this.data[i]=r,s&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,n){return this.data[t*this.size+n]},e.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},e.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},to=e,to}var no={},Nu;function gS(){return Nu||(Nu=1,function(e){const t=qt().getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=t(r),o=i===145?26:Math.ceil((i-13)/(2*s-2))*2,a=[i-7];for(let c=1;c<s-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},e.getPositions=function(r){const s=[],i=e.getRowColCoords(r),o=i.length;for(let a=0;a<o;a++)for(let c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||s.push([i[a],i[c]]);return s}}(no)),no}var ro={},Mu;function mS(){if(Mu)return ro;Mu=1;const e=qt().getSymbolSize,t=7;return ro.getPositions=function(r){const s=e(r);return[[0,0],[s-t,0],[0,s-t]]},ro}var so={},Du;function bS(){return Du||(Du=1,function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const i=s.size;let o=0,a=0,c=0,l=null,u=null;for(let d=0;d<i;d++){a=c=0,l=u=null;for(let f=0;f<i;f++){let h=s.get(d,f);h===l?a++:(a>=5&&(o+=t.N1+(a-5)),l=h,a=1),h=s.get(f,d),h===u?c++:(c>=5&&(o+=t.N1+(c-5)),u=h,c=1)}a>=5&&(o+=t.N1+(a-5)),c>=5&&(o+=t.N1+(c-5))}return o},e.getPenaltyN2=function(s){const i=s.size;let o=0;for(let a=0;a<i-1;a++)for(let c=0;c<i-1;c++){const l=s.get(a,c)+s.get(a,c+1)+s.get(a+1,c)+s.get(a+1,c+1);(l===4||l===0)&&o++}return o*t.N2},e.getPenaltyN3=function(s){const i=s.size;let o=0,a=0,c=0;for(let l=0;l<i;l++){a=c=0;for(let u=0;u<i;u++)a=a<<1&2047|s.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|s.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*t.N3},e.getPenaltyN4=function(s){let i=0;const o=s.data.length;for(let c=0;c<o;c++)i+=s.data[c];return Math.abs(Math.ceil(i*100/o/5)-10)*t.N4};function n(r,s,i){switch(r){case e.Patterns.PATTERN000:return(s+i)%2===0;case e.Patterns.PATTERN001:return s%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(s+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return s*i%2+s*i%3===0;case e.Patterns.PATTERN110:return(s*i%2+s*i%3)%2===0;case e.Patterns.PATTERN111:return(s*i%3+(s+i)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(s,i){const o=i.size;for(let a=0;a<o;a++)for(let c=0;c<o;c++)i.isReserved(c,a)||i.xor(c,a,n(s,c,a))},e.getBestMask=function(s,i){const o=Object.keys(e.Patterns).length;let a=0,c=1/0;for(let l=0;l<o;l++){i(l),e.applyMask(l,s);const u=e.getPenaltyN1(s)+e.getPenaltyN2(s)+e.getPenaltyN3(s)+e.getPenaltyN4(s);e.applyMask(l,s),u<c&&(c=u,a=l)}return a}}(so)),so}var xs={},Fu;function Bu(){if(Fu)return xs;Fu=1;const e=Qi(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return xs.getBlocksCount=function(s,i){switch(i){case e.L:return t[(s-1)*4+0];case e.M:return t[(s-1)*4+1];case e.Q:return t[(s-1)*4+2];case e.H:return t[(s-1)*4+3];default:return}},xs.getTotalCodewordsCount=function(s,i){switch(i){case e.L:return n[(s-1)*4+0];case e.M:return n[(s-1)*4+1];case e.Q:return n[(s-1)*4+2];case e.H:return n[(s-1)*4+3];default:return}},xs}var io={},gr={},$u;function yS(){if($u)return gr;$u=1;const e=new Uint8Array(512),t=new Uint8Array(256);return function(){let r=1;for(let s=0;s<255;s++)e[s]=r,t[r]=s,r<<=1,r&256&&(r^=285);for(let s=255;s<512;s++)e[s]=e[s-255]}(),gr.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},gr.exp=function(r){return e[r]},gr.mul=function(r,s){return r===0||s===0?0:e[t[r]+t[s]]},gr}var Uu;function wS(){return Uu||(Uu=1,function(e){const t=yS();e.mul=function(r,s){const i=new Uint8Array(r.length+s.length-1);for(let o=0;o<r.length;o++)for(let a=0;a<s.length;a++)i[o+a]^=t.mul(r[o],s[a]);return i},e.mod=function(r,s){let i=new Uint8Array(r);for(;i.length-s.length>=0;){const o=i[0];for(let c=0;c<s.length;c++)i[c]^=t.mul(s[c],o);let a=0;for(;a<i.length&&i[a]===0;)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(r){let s=new Uint8Array([1]);for(let i=0;i<r;i++)s=e.mul(s,new Uint8Array([1,t.exp(i)]));return s}}(io)),io}var oo,Vu;function SS(){if(Vu)return oo;Vu=1;const e=wS();function t(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(r){this.degree=r,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(r.length+this.degree);s.set(r);const i=e.mod(s,this.genPoly),o=this.degree-i.length;if(o>0){const a=new Uint8Array(this.degree);return a.set(i,o),a}return i},oo=t,oo}var ao={},co={},lo={},zu;function Hu(){return zu||(zu=1,lo.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),lo}var at={},ju;function Wu(){if(ju)return at;ju=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
|
|
321
|
+
]))+`;at.KANJI=new RegExp(n,"g"),at.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),at.BYTE=new RegExp(r,"g"),at.NUMERIC=new RegExp(e,"g"),at.ALPHANUMERIC=new RegExp(t,"g");const s=new RegExp("^"+n+"$"),i=new RegExp("^"+e+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return at.testKanji=function(c){return s.test(c)},at.testNumeric=function(c){return i.test(c)},at.testAlphanumeric=function(c){return o.test(c)},at}var qu;function Kt(){return qu||(qu=1,function(e){const t=Hu(),n=Wu();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,o){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?i.ccBits[0]:o<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(i,o){if(e.isValid(i))return i;try{return r(i)}catch{return o}}}(co)),co}var Ku;function _S(){return Ku||(Ku=1,function(e){const t=qt(),n=Bu(),r=Qi(),s=Kt(),i=Hu(),o=7973,a=t.getBCHDigit(o);function c(f,h,p){for(let g=1;g<=40;g++)if(h<=e.getCapacity(g,p,f))return g}function l(f,h){return s.getCharCountIndicator(f,h)+4}function u(f,h){let p=0;return f.forEach(function(g){const m=l(g.mode,h);p+=m+g.getBitsLength()}),p}function d(f,h){for(let p=1;p<=40;p++)if(u(f,p)<=e.getCapacity(p,h,s.MIXED))return p}e.from=function(h,p){return i.isValid(h)?parseInt(h,10):p},e.getCapacity=function(h,p,g){if(!i.isValid(h))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=s.BYTE);const m=t.getSymbolTotalCodewords(h),w=n.getTotalCodewordsCount(h,p),v=(m-w)*8;if(g===s.MIXED)return v;const y=v-l(g,h);switch(g){case s.NUMERIC:return Math.floor(y/10*3);case s.ALPHANUMERIC:return Math.floor(y/11*2);case s.KANJI:return Math.floor(y/13);case s.BYTE:default:return Math.floor(y/8)}},e.getBestVersionForData=function(h,p){let g;const m=r.from(p,r.M);if(Array.isArray(h)){if(h.length>1)return d(h,m);if(h.length===0)return 1;g=h[0]}else g=h;return c(g.mode,g.getLength(),m)},e.getEncodedBits=function(h){if(!i.isValid(h)||h<7)throw new Error("Invalid QR Code version");let p=h<<12;for(;t.getBCHDigit(p)-a>=0;)p^=o<<t.getBCHDigit(p)-a;return h<<12|p}}(ao)),ao}var uo={},Gu;function vS(){if(Gu)return uo;Gu=1;const e=qt(),t=1335,n=21522,r=e.getBCHDigit(t);return uo.getEncodedBits=function(i,o){const a=i.bit<<3|o;let c=a<<10;for(;e.getBCHDigit(c)-r>=0;)c^=t<<e.getBCHDigit(c)-r;return(a<<10|c)^n},uo}var fo={},po,Yu;function ES(){if(Yu)return po;Yu=1;const e=Kt();function t(n){this.mode=e.NUMERIC,this.data=n.toString()}return t.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let s,i,o;for(s=0;s+3<=this.data.length;s+=3)i=this.data.substr(s,3),o=parseInt(i,10),r.put(o,10);const a=this.data.length-s;a>0&&(i=this.data.substr(s),o=parseInt(i,10),r.put(o,a*3+1))},po=t,po}var ho,Ju;function CS(){if(Ju)return ho;Ju=1;const e=Kt(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(r){this.mode=e.ALPHANUMERIC,this.data=r}return n.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(s){let i;for(i=0;i+2<=this.data.length;i+=2){let o=t.indexOf(this.data[i])*45;o+=t.indexOf(this.data[i+1]),s.put(o,11)}this.data.length%2&&s.put(t.indexOf(this.data[i]),6)},ho=n,ho}var go,Zu;function xS(){if(Zu)return go;Zu=1;const e=Kt();function t(n){this.mode=e.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return t.getBitsLength=function(r){return r*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){for(let r=0,s=this.data.length;r<s;r++)n.put(this.data[r],8)},go=t,go}var mo,Xu;function TS(){if(Xu)return mo;Xu=1;const e=Kt(),t=qt();function n(r){this.mode=e.KANJI,this.data=r}return n.getBitsLength=function(s){return s*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let s;for(s=0;s<this.data.length;s++){let i=t.toSJIS(this.data[s]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
|
|
322
|
+
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),r.put(i,13)}},mo=n,mo}var bo={exports:{}},Qu;function AS(){return Qu||(Qu=1,function(e){var t={single_source_shortest_paths:function(n,r,s){var i={},o={};o[r]=0;var a=t.PriorityQueue.make();a.push(r,0);for(var c,l,u,d,f,h,p,g,m;!a.empty();){c=a.pop(),l=c.value,d=c.cost,f=n[l]||{};for(u in f)f.hasOwnProperty(u)&&(h=f[u],p=d+h,g=o[u],m=typeof o[u]>"u",(m||g>p)&&(o[u]=p,a.push(u,p),i[u]=l))}if(typeof s<"u"&&typeof o[s]>"u"){var w=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(w)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],i=r;i;)s.push(i),n[i],i=n[i];return s.reverse(),s},find_path:function(n,r,s){var i=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t}(bo)),bo.exports}var ed;function RS(){return ed||(ed=1,function(e){const t=Kt(),n=ES(),r=CS(),s=xS(),i=TS(),o=Wu(),a=qt(),c=AS();function l(w){return unescape(encodeURIComponent(w)).length}function u(w,v,y){const _=[];let O;for(;(O=w.exec(y))!==null;)_.push({data:O[0],index:O.index,mode:v,length:O[0].length});return _}function d(w){const v=u(o.NUMERIC,t.NUMERIC,w),y=u(o.ALPHANUMERIC,t.ALPHANUMERIC,w);let _,O;return a.isKanjiModeEnabled()?(_=u(o.BYTE,t.BYTE,w),O=u(o.KANJI,t.KANJI,w)):(_=u(o.BYTE_KANJI,t.BYTE,w),O=[]),v.concat(y,_,O).sort(function(b,k){return b.index-k.index}).map(function(b){return{data:b.data,mode:b.mode,length:b.length}})}function f(w,v){switch(v){case t.NUMERIC:return n.getBitsLength(w);case t.ALPHANUMERIC:return r.getBitsLength(w);case t.KANJI:return i.getBitsLength(w);case t.BYTE:return s.getBitsLength(w)}}function h(w){return w.reduce(function(v,y){const _=v.length-1>=0?v[v.length-1]:null;return _&&_.mode===y.mode?(v[v.length-1].data+=y.data,v):(v.push(y),v)},[])}function p(w){const v=[];for(let y=0;y<w.length;y++){const _=w[y];switch(_.mode){case t.NUMERIC:v.push([_,{data:_.data,mode:t.ALPHANUMERIC,length:_.length},{data:_.data,mode:t.BYTE,length:_.length}]);break;case t.ALPHANUMERIC:v.push([_,{data:_.data,mode:t.BYTE,length:_.length}]);break;case t.KANJI:v.push([_,{data:_.data,mode:t.BYTE,length:l(_.data)}]);break;case t.BYTE:v.push([{data:_.data,mode:t.BYTE,length:l(_.data)}])}}return v}function g(w,v){const y={},_={start:{}};let O=["start"];for(let T=0;T<w.length;T++){const b=w[T],k=[];for(let x=0;x<b.length;x++){const I=b[x],R=""+T+x;k.push(R),y[R]={node:I,lastCount:0},_[R]={};for(let L=0;L<O.length;L++){const P=O[L];y[P]&&y[P].node.mode===I.mode?(_[P][R]=f(y[P].lastCount+I.length,I.mode)-f(y[P].lastCount,I.mode),y[P].lastCount+=I.length):(y[P]&&(y[P].lastCount=I.length),_[P][R]=f(I.length,I.mode)+4+t.getCharCountIndicator(I.mode,v))}}O=k}for(let T=0;T<O.length;T++)_[O[T]].end=0;return{map:_,table:y}}function m(w,v){let y;const _=t.getBestModeForData(w);if(y=t.from(v,_),y!==t.BYTE&&y.bit<_.bit)throw new Error('"'+w+'" cannot be encoded with mode '+t.toString(y)+`.
|
|
323
|
+
Suggested mode is: `+t.toString(_));switch(y===t.KANJI&&!a.isKanjiModeEnabled()&&(y=t.BYTE),y){case t.NUMERIC:return new n(w);case t.ALPHANUMERIC:return new r(w);case t.KANJI:return new i(w);case t.BYTE:return new s(w)}}e.fromArray=function(v){return v.reduce(function(y,_){return typeof _=="string"?y.push(m(_,null)):_.data&&y.push(m(_.data,_.mode)),y},[])},e.fromString=function(v,y){const _=d(v,a.isKanjiModeEnabled()),O=p(_),T=g(O,y),b=c.find_path(T.map,"start","end"),k=[];for(let x=1;x<b.length-1;x++)k.push(T.table[b[x]].node);return e.fromArray(h(k))},e.rawSplit=function(v){return e.fromArray(d(v,a.isKanjiModeEnabled()))}}(fo)),fo}var td;function kS(){if(td)return Zi;td=1;const e=qt(),t=Qi(),n=pS(),r=hS(),s=gS(),i=mS(),o=bS(),a=Bu(),c=SS(),l=_S(),u=vS(),d=Kt(),f=RS();function h(T,b){const k=T.size,x=i.getPositions(b);for(let I=0;I<x.length;I++){const R=x[I][0],L=x[I][1];for(let P=-1;P<=7;P++)if(!(R+P<=-1||k<=R+P))for(let N=-1;N<=7;N++)L+N<=-1||k<=L+N||(P>=0&&P<=6&&(N===0||N===6)||N>=0&&N<=6&&(P===0||P===6)||P>=2&&P<=4&&N>=2&&N<=4?T.set(R+P,L+N,!0,!0):T.set(R+P,L+N,!1,!0))}}function p(T){const b=T.size;for(let k=8;k<b-8;k++){const x=k%2===0;T.set(k,6,x,!0),T.set(6,k,x,!0)}}function g(T,b){const k=s.getPositions(b);for(let x=0;x<k.length;x++){const I=k[x][0],R=k[x][1];for(let L=-2;L<=2;L++)for(let P=-2;P<=2;P++)L===-2||L===2||P===-2||P===2||L===0&&P===0?T.set(I+L,R+P,!0,!0):T.set(I+L,R+P,!1,!0)}}function m(T,b){const k=T.size,x=l.getEncodedBits(b);let I,R,L;for(let P=0;P<18;P++)I=Math.floor(P/3),R=P%3+k-8-3,L=(x>>P&1)===1,T.set(I,R,L,!0),T.set(R,I,L,!0)}function w(T,b,k){const x=T.size,I=u.getEncodedBits(b,k);let R,L;for(R=0;R<15;R++)L=(I>>R&1)===1,R<6?T.set(R,8,L,!0):R<8?T.set(R+1,8,L,!0):T.set(x-15+R,8,L,!0),R<8?T.set(8,x-R-1,L,!0):R<9?T.set(8,15-R-1+1,L,!0):T.set(8,15-R-1,L,!0);T.set(x-8,8,1,!0)}function v(T,b){const k=T.size;let x=-1,I=k-1,R=7,L=0;for(let P=k-1;P>0;P-=2)for(P===6&&P--;;){for(let N=0;N<2;N++)if(!T.isReserved(I,P-N)){let Q=!1;L<b.length&&(Q=(b[L]>>>R&1)===1),T.set(I,P-N,Q),R--,R===-1&&(L++,R=7)}if(I+=x,I<0||k<=I){I-=x,x=-x;break}}}function y(T,b,k){const x=new n;k.forEach(function(N){x.put(N.mode.bit,4),x.put(N.getLength(),d.getCharCountIndicator(N.mode,T)),N.write(x)});const I=e.getSymbolTotalCodewords(T),R=a.getTotalCodewordsCount(T,b),L=(I-R)*8;for(x.getLengthInBits()+4<=L&&x.put(0,4);x.getLengthInBits()%8!==0;)x.putBit(0);const P=(L-x.getLengthInBits())/8;for(let N=0;N<P;N++)x.put(N%2?17:236,8);return _(x,T,b)}function _(T,b,k){const x=e.getSymbolTotalCodewords(b),I=a.getTotalCodewordsCount(b,k),R=x-I,L=a.getBlocksCount(b,k),P=x%L,N=L-P,Q=Math.floor(x/L),me=Math.floor(R/L),Ve=me+1,Ke=Q-me,X=new c(Ke);let re=0;const ee=new Array(L),ke=new Array(L);let Ee=0;const To=new Uint8Array(T.buffer);for(let Nn=0;Nn<L;Nn++){const Ao=Nn<N?me:Ve;ee[Nn]=To.slice(re,re+Ao),ke[Nn]=X.encode(ee[Nn]),re+=Ao,Ee=Math.max(Ee,Ao)}const le=new Uint8Array(x);let Pn=0,gt,mt;for(gt=0;gt<Ee;gt++)for(mt=0;mt<L;mt++)gt<ee[mt].length&&(le[Pn++]=ee[mt][gt]);for(gt=0;gt<Ke;gt++)for(mt=0;mt<L;mt++)le[Pn++]=ke[mt][gt];return le}function O(T,b,k,x){let I;if(Array.isArray(T))I=f.fromArray(T);else if(typeof T=="string"){let Q=b;if(!Q){const me=f.rawSplit(T);Q=l.getBestVersionForData(me,k)}I=f.fromString(T,Q||40)}else throw new Error("Invalid data");const R=l.getBestVersionForData(I,k);if(!R)throw new Error("The amount of data is too big to be stored in a QR Code");if(!b)b=R;else if(b<R)throw new Error(`
|
|
320
324
|
The chosen QR Code version cannot contain this amount of data.
|
|
321
|
-
Minimum version required to store current data is: `+
|
|
322
|
-
`);const
|
|
323
|
-
`;return typeof a=="function"&&a(null,m),m},
|
|
325
|
+
Minimum version required to store current data is: `+R+`.
|
|
326
|
+
`);const L=y(b,k,I),P=e.getSymbolSize(b),N=new r(P);return h(N,b),p(N),g(N,b),w(N,k,0),b>=7&&m(N,b),v(N,L),isNaN(x)&&(x=o.getBestMask(N,w.bind(null,N,k))),o.applyMask(x,N),w(N,k,x),{modules:N,version:b,errorCorrectionLevel:k,maskPattern:x,segments:I}}return Zi.create=function(b,k){if(typeof b>"u"||b==="")throw new Error("No input text");let x=t.M,I,R;return typeof k<"u"&&(x=t.from(k.errorCorrectionLevel,t.M),I=l.from(k.version),R=o.from(k.maskPattern),k.toSJISFunc&&e.setToSJISFunction(k.toSJISFunc)),O(b,I,x,R)},Zi}var yo={},wo={},nd;function rd(){return nd||(nd=1,function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:i,scale:i?4:o,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const i=e.getScale(r,s);return Math.floor((r+s.margin*2)*i)},e.qrToImageData=function(r,s,i){const o=s.modules.size,a=s.modules.data,c=e.getScale(o,i),l=Math.floor((o+i.margin*2)*c),u=i.margin*c,d=[i.color.light,i.color.dark];for(let f=0;f<l;f++)for(let h=0;h<l;h++){let p=(f*l+h)*4,g=i.color.light;if(f>=u&&h>=u&&f<l-u&&h<l-u){const m=Math.floor((f-u)/c),w=Math.floor((h-u)/c);g=d[a[m*o+w]?1:0]}r[p++]=g.r,r[p++]=g.g,r[p++]=g.b,r[p]=g.a}}}(wo)),wo}var sd;function IS(){return sd||(sd=1,function(e){const t=rd();function n(s,i,o){s.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=o,i.width=o,i.style.height=o+"px",i.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,o,a){let c=a,l=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(l=r()),c=t.getOptions(c);const u=t.getImageWidth(i.modules.size,c),d=l.getContext("2d"),f=d.createImageData(u,u);return t.qrToImageData(f.data,i,c),n(d,l,u),d.putImageData(f,0,0),l},e.renderToDataURL=function(i,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const l=e.render(i,o,c),u=c.type||"image/png",d=c.rendererOpts||{};return l.toDataURL(u,d.quality)}}(yo)),yo}var So={},id;function OS(){if(id)return So;id=1;const e=rd();function t(s,i){const o=s.a/255,a=i+'="'+s.hex+'"';return o<1?a+" "+i+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function n(s,i,o){let a=s+i;return typeof o<"u"&&(a+=" "+o),a}function r(s,i,o){let a="",c=0,l=!1,u=0;for(let d=0;d<s.length;d++){const f=Math.floor(d%i),h=Math.floor(d/i);!f&&!l&&(l=!0),s[d]?(u++,d>0&&f>0&&s[d-1]||(a+=l?n("M",f+o,.5+h+o):n("m",c,0),c=0,l=!1),f+1<i&&s[d+1]||(a+=n("h",u),u=0)):c++}return a}return So.render=function(i,o,a){const c=e.getOptions(o),l=i.modules.size,u=i.modules.data,d=l+c.margin*2,f=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",h="<path "+t(c.color.dark,"stroke")+' d="'+r(u,l,c.margin)+'"/>',p='viewBox="0 0 '+d+" "+d+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+p+' shape-rendering="crispEdges">'+f+h+`</svg>
|
|
327
|
+
`;return typeof a=="function"&&a(null,m),m},So}var od;function LS(){if(od)return kn;od=1;const e=fS(),t=kS(),n=IS(),r=OS();function s(i,o,a,c,l){const u=[].slice.call(arguments,1),d=u.length,f=typeof u[d-1]=="function";if(!f&&!e())throw new Error("Callback required as last argument");if(f){if(d<2)throw new Error("Too few arguments provided");d===2?(l=a,a=o,o=c=void 0):d===3&&(o.getContext&&typeof l>"u"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(a=o,o=c=void 0):d===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(h,p){try{const g=t.create(a,c);h(i(g,o,c))}catch(g){p(g)}})}try{const h=t.create(a,c);l(null,i(h,o,c))}catch(h){l(h)}}return kn.create=t.create,kn.toCanvas=s.bind(null,n.render),kn.toDataURL=s.bind(null,n.renderToDataURL),kn.toString=s.bind(null,function(i,o,a){return r.render(i,a)}),kn}var PS=LS();const NS=dS(PS),MS=e=>K`
|
|
324
328
|
padding: 16px;
|
|
325
329
|
border: 1px solid ${e.primaryColor};
|
|
326
330
|
border-radius: 16px;
|
|
327
|
-
background-color: ${
|
|
331
|
+
background-color: ${C.neutral_lightest};
|
|
328
332
|
display: flex;
|
|
329
333
|
justify-content: center;
|
|
330
334
|
align-items: center;
|
|
331
|
-
`;class
|
|
335
|
+
`;class ad extends ce{constructor({value:t,width:n=130,altText:r="QR Code"}){super({tag:"div",styles:s=>MS(s)}),NS.toDataURL(t,{width:n,margin:0}).then(s=>{const i=document.createElement("img");i.src=s,i.alt=r,i.width=n,this.element.append(i)}).catch(s=>{console.error("Failed to generate QR code:",s)})}}const ne=(e,t,n)=>{const r=U.getStyles();return t?r.input.disabled:e?r.input.error:r.input.normal},cd=(e,t,n)=>({label:{size:14,weight:500,color:ne(e,t).textColor},helperText:{size:14,weight:400,color:ne(e,t).hintTextColor}}),DS=(e,{error:t,disabled:n,maxWidth:r})=>K`
|
|
332
336
|
display: flex;
|
|
333
337
|
flex-direction: column;
|
|
334
|
-
gap:
|
|
335
|
-
|
|
338
|
+
gap: 4px;
|
|
336
339
|
font-family: ${e.fontFamily};
|
|
337
|
-
width:
|
|
340
|
+
max-width: ${r};
|
|
338
341
|
|
|
339
342
|
.select-input-container {
|
|
340
343
|
position: relative;
|
|
@@ -344,20 +347,25 @@ Minimum version required to store current data is: `+A+`.
|
|
|
344
347
|
display: flex;
|
|
345
348
|
align-items: center;
|
|
346
349
|
|
|
347
|
-
background-color: ${
|
|
348
|
-
color: ${
|
|
350
|
+
background-color: ${ne(t,n).backgroundColor};
|
|
351
|
+
color: ${ne(t,n).textColor};
|
|
349
352
|
|
|
350
|
-
border:
|
|
353
|
+
border: ${ne(t,n).borderWidth}px solid
|
|
354
|
+
${ne(t,n).borderColor};
|
|
351
355
|
transition: border-color 0.3s ease;
|
|
352
356
|
cursor: pointer;
|
|
353
357
|
|
|
354
358
|
height: 40px;
|
|
355
359
|
padding: 0px;
|
|
356
|
-
border-radius:
|
|
360
|
+
border-radius: ${ne(t,n).borderRadius}px;
|
|
357
361
|
|
|
358
362
|
:hover,
|
|
359
363
|
:focus-within {
|
|
360
|
-
|
|
364
|
+
background-color: ${t||n?void 0:e.input.focus.backgroundColor};
|
|
365
|
+
color: ${t||n?void 0:e.input.focus.textColor};
|
|
366
|
+
border: ${t||n?void 0:e.input.focus.borderWidth}px solid
|
|
367
|
+
${e.input.focus.borderColor};
|
|
368
|
+
border-radius: ${t||n?void 0:e.input.focus.borderRadius}px;
|
|
361
369
|
}
|
|
362
370
|
}
|
|
363
371
|
|
|
@@ -374,27 +382,30 @@ Minimum version required to store current data is: `+A+`.
|
|
|
374
382
|
|
|
375
383
|
font-size: 16px;
|
|
376
384
|
line-height: 24px;
|
|
377
|
-
caret-color: ${e.
|
|
385
|
+
caret-color: ${e.textColor};
|
|
378
386
|
background-color: transparent;
|
|
379
387
|
|
|
380
388
|
border: none;
|
|
381
389
|
outline: none;
|
|
382
|
-
cursor: pointer;
|
|
383
390
|
color: inherit;
|
|
384
391
|
font: inherit;
|
|
385
392
|
|
|
393
|
+
:disabled {
|
|
394
|
+
cursor: not-allowed;
|
|
395
|
+
}
|
|
396
|
+
|
|
386
397
|
&::placeholder {
|
|
387
398
|
font-size: 16px;
|
|
388
|
-
color: ${
|
|
399
|
+
color: ${ne(t,n).placeholderTextColor};
|
|
389
400
|
opacity: 1;
|
|
390
401
|
}
|
|
391
402
|
&:-ms-input-placeholder {
|
|
392
403
|
font-size: 16px;
|
|
393
|
-
color: ${
|
|
404
|
+
color: ${ne(t,n).placeholderTextColor};
|
|
394
405
|
}
|
|
395
406
|
&::-ms-input-placeholder {
|
|
396
407
|
font-size: 16px;
|
|
397
|
-
color: ${
|
|
408
|
+
color: ${ne(t,n).placeholderTextColor};
|
|
398
409
|
}
|
|
399
410
|
|
|
400
411
|
&::-webkit-contacts-auto-fill-button {
|
|
@@ -428,14 +439,14 @@ Minimum version required to store current data is: `+A+`.
|
|
|
428
439
|
overflow-y: auto;
|
|
429
440
|
border: 1px solid ${e.apSelectBorderColor};
|
|
430
441
|
border-radius: 8px;
|
|
431
|
-
background-color: ${
|
|
442
|
+
background-color: ${ne(t,n).backgroundColor};
|
|
432
443
|
z-index: 10;
|
|
433
444
|
list-style-type: none;
|
|
434
445
|
padding: 0;
|
|
435
446
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
436
447
|
|
|
437
448
|
scrollbar-width: thin;
|
|
438
|
-
scrollbar-color: ${e.
|
|
449
|
+
scrollbar-color: ${e.input.focus.borderColor} ${ne().backgroundColor};
|
|
439
450
|
|
|
440
451
|
&::-webkit-scrollbar {
|
|
441
452
|
width: 6px;
|
|
@@ -443,7 +454,7 @@ Minimum version required to store current data is: `+A+`.
|
|
|
443
454
|
}
|
|
444
455
|
|
|
445
456
|
&::-webkit-scrollbar-track {
|
|
446
|
-
background: ${
|
|
457
|
+
background: ${ne().backgroundColor};
|
|
447
458
|
border-radius: 8px;
|
|
448
459
|
}
|
|
449
460
|
|
|
@@ -451,7 +462,7 @@ Minimum version required to store current data is: `+A+`.
|
|
|
451
462
|
background: ${e.apSelectBorderColor};
|
|
452
463
|
border-radius: 3px;
|
|
453
464
|
&:hover {
|
|
454
|
-
background: ${e.
|
|
465
|
+
background: ${e.input.focus.borderColor};
|
|
455
466
|
}
|
|
456
467
|
}
|
|
457
468
|
}
|
|
@@ -463,7 +474,7 @@ Minimum version required to store current data is: `+A+`.
|
|
|
463
474
|
padding: 8px;
|
|
464
475
|
cursor: pointer;
|
|
465
476
|
transition: background-color 0.2s ease;
|
|
466
|
-
color: ${
|
|
477
|
+
color: ${ne(t,n).textColor};
|
|
467
478
|
|
|
468
479
|
&:hover {
|
|
469
480
|
background-color: ${e.apSelectBgHoverColor};
|
|
@@ -482,43 +493,48 @@ Minimum version required to store current data is: `+A+`.
|
|
|
482
493
|
.select-icon {
|
|
483
494
|
margin-left: 8px;
|
|
484
495
|
}
|
|
485
|
-
`;class
|
|
496
|
+
`;class FS extends ce{constructor({name:n,label:r,options:s,helperText:i,placeholder:o=te.translate("select"),emptyMessage:a=te.translate("select_item"),error:c=!1,disabled:l=!1,maxWidth:u="100%"}){super({tag:"div",styles:h=>DS(h,{error:c,disabled:l,maxWidth:u})});A(this,"selectContainer");A(this,"inputElement");A(this,"dropdownIcon");A(this,"optionsList");A(this,"isOpen",!1);A(this,"options");A(this,"emptyMessage");A(this,"selectedValue",null);A(this,"highlightedIndex",-1);A(this,"filteredOptions",[]);const d=cd(c,l);if(this.options=s,this.emptyMessage=a,r){const h=document.createElement("label"),p=new q({text:r,size:d.label.size,weight:d.label.weight,color:d.label.color}).element;h.append(p),h.htmlFor=n,this.element.append(h)}this.selectContainer=document.createElement("div"),this.selectContainer.classList.add("select-input-container"),this.element.append(this.selectContainer),this.inputElement=document.createElement("input"),this.inputElement.classList.add("select-input-field"),this.inputElement.name=n,this.inputElement.id=n,this.inputElement.autocomplete="off",this.inputElement.disabled=l,o&&(this.inputElement.placeholder=o),this.selectContainer.append(this.inputElement),this.dropdownIcon=document.createElement("span"),this.dropdownIcon.classList.add("dropdown-icon-wrapper");const f=new Je({name:"arrow_down_line",size:24}).element;if(this.dropdownIcon.appendChild(f),this.selectContainer.appendChild(this.dropdownIcon),this.optionsList=document.createElement("ul"),this.optionsList.classList.add("select-options-list"),this.selectContainer.append(this.optionsList),this.renderOptions(s),this.selectContainer.addEventListener("click",h=>{this.optionsList.contains(h.target)||(this.toggleDropdown(!0),this.inputElement.setSelectionRange(0,this.inputElement.value.length),this.inputElement.focus())}),this.inputElement.addEventListener("input",h=>this.handleInput(h)),this.inputElement.addEventListener("keydown",h=>this.handleKeyDown(h)),i){const h=new q({text:i,size:d.helperText.size,weight:d.helperText.weight,color:d.helperText.color}).element;this.element.append(h)}document.addEventListener("click",this.handleClickOutside.bind(this))}renderOptions(n){if(this.optionsList.innerHTML="",this.filteredOptions=n,n.length>0)n.forEach(r=>{const s=document.createElement("li");if(s.classList.add("select-option"),r.icon){const o=new Je({name:r.icon,size:20}).element;s.appendChild(o)}const i=new q({text:`${r.name} ${r.value}`,size:16,lineHeight:24,weight:400}).element;s.appendChild(i),s.dataset.value=String(r.value),s.addEventListener("click",()=>this.handleOptionClick(r)),this.optionsList.append(s)});else{const r=document.createElement("div");r.classList.add("empty-option");const s=new q({text:this.emptyMessage}).element;r.append(s),this.optionsList.append(r)}}handleInput(n){const r=n.target.value.toLowerCase();if(r===""){const i=this.selectContainer.querySelector(".select-icon");i&&i.remove(),this.selectedValue=null}const s=this.options.filter(i=>i.name.toLowerCase().includes(r)||String(i.value).toLowerCase().includes(r));this.renderOptions(s),this.toggleDropdown(!0)}toggleDropdown(n){this.isOpen=n,this.optionsList.style.display=this.isOpen?"block":"none",this.dropdownIcon.style.transform=this.isOpen?"rotate(-180deg)":"rotate(0deg)"}handleOptionClick({value:n,icon:r}){const s=this.selectContainer.querySelector(".select-icon");if(s&&s.remove(),r){const o=new Je({name:r,size:24}).element;o.classList.add("select-icon"),this.selectContainer.insertBefore(o,this.inputElement)}this.inputElement.value=String(n),this.selectedValue=n,this.renderOptions(this.options),this.toggleDropdown(!1),this.highlightedIndex=-1;const i=new Event("change",{bubbles:!0});this.inputElement.dispatchEvent(i)}getSelectedValue(){return this.selectedValue}handleClickOutside(n){this.selectContainer.contains(n.target)||this.toggleDropdown(!1)}handleKeyDown(n){const{key:r}=n;if(r==="Escape"){this.toggleDropdown(!1);return}if(!this.isOpen)return;const s=this.optionsList.querySelectorAll(".select-option");switch(r){case"ArrowDown":n.preventDefault(),this.highlightedIndex=(this.highlightedIndex+1)%s.length,this.highlightOption(this.highlightedIndex);break;case"ArrowUp":n.preventDefault(),this.highlightedIndex=(this.highlightedIndex-1+s.length)%s.length,this.highlightOption(this.highlightedIndex);break;case"Enter":if(n.preventDefault(),this.highlightedIndex>=0&&this.highlightedIndex<this.filteredOptions.length){const i=this.filteredOptions[this.highlightedIndex];this.handleOptionClick(i)}break}}highlightOption(n){const r=this.optionsList.querySelectorAll(".select-option");if(r.forEach(s=>s.classList.remove("highlighted")),n>=0&&n<r.length){const s=r[n];s.classList.add("highlighted"),s.scrollIntoView({block:"nearest"})}}destroy(){document.removeEventListener("click",this.handleClickOutside.bind(this)),document.removeEventListener("keydown",this.handleKeyDown.bind(this)),super.destroy()}}const BS=(e,{error:t,disabled:n})=>K`
|
|
486
497
|
display: flex;
|
|
487
498
|
flex-direction: column;
|
|
488
|
-
gap:
|
|
489
|
-
|
|
499
|
+
gap: 4px;
|
|
490
500
|
font-family: ${e.fontFamily};
|
|
491
|
-
width: 100%;
|
|
492
501
|
|
|
493
|
-
.input-
|
|
502
|
+
.input-field {
|
|
494
503
|
-webkit-appearance: none;
|
|
495
504
|
-moz-appearance: none;
|
|
496
505
|
appearance: none;
|
|
497
506
|
box-sizing: border-box;
|
|
498
|
-
|
|
499
507
|
margin: 0;
|
|
500
508
|
padding: 0;
|
|
501
509
|
border: 0;
|
|
502
510
|
background: none;
|
|
503
511
|
font: inherit;
|
|
504
512
|
line-height: normal;
|
|
505
|
-
|
|
506
513
|
height: 40px;
|
|
507
514
|
padding: 8px;
|
|
508
|
-
border-radius:
|
|
515
|
+
border-radius: ${ne(t,n).borderRadius}px;
|
|
509
516
|
font-size: 16px;
|
|
510
517
|
line-height: 24px;
|
|
511
518
|
outline: none;
|
|
512
|
-
caret-color: ${e.
|
|
513
|
-
background-color: ${e.apInputBgColor};
|
|
514
|
-
color: ${e.apInputTxtColor};
|
|
519
|
+
caret-color: ${e.textColor};
|
|
515
520
|
|
|
516
|
-
|
|
521
|
+
background-color: ${ne(t,n).backgroundColor};
|
|
522
|
+
color: ${ne(t,n).textColor};
|
|
523
|
+
border: ${ne(t,n).borderWidth}px solid
|
|
524
|
+
${ne(t,n).borderColor};
|
|
517
525
|
transition: border-color 0.3s ease;
|
|
518
526
|
|
|
519
527
|
:hover,
|
|
520
528
|
:focus {
|
|
521
|
-
|
|
529
|
+
background-color: ${t||n?void 0:e.input.focus.backgroundColor};
|
|
530
|
+
color: ${t||n?void 0:e.input.focus.textColor};
|
|
531
|
+
border: ${t||n?void 0:e.input.focus.borderWidth}px solid
|
|
532
|
+
${e.input.focus.borderColor};
|
|
533
|
+
border-radius: ${t||n?void 0:e.input.focus.borderRadius}px;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
:disabled {
|
|
537
|
+
cursor: not-allowed;
|
|
522
538
|
}
|
|
523
539
|
|
|
524
540
|
&::-webkit-outer-spin-button,
|
|
@@ -530,27 +546,25 @@ Minimum version required to store current data is: `+A+`.
|
|
|
530
546
|
-moz-appearance: textfield;
|
|
531
547
|
appearance: none;
|
|
532
548
|
}
|
|
533
|
-
|
|
534
549
|
&::placeholder {
|
|
535
550
|
font-size: 16px;
|
|
536
|
-
color: ${
|
|
551
|
+
color: ${ne(t,n).placeholderTextColor};
|
|
537
552
|
opacity: 1;
|
|
538
553
|
}
|
|
539
554
|
&:-ms-input-placeholder {
|
|
540
555
|
font-size: 16px;
|
|
541
|
-
color: ${
|
|
556
|
+
color: ${ne(t,n).placeholderTextColor};
|
|
542
557
|
}
|
|
543
558
|
&::-ms-input-placeholder {
|
|
544
559
|
font-size: 16px;
|
|
545
|
-
color: ${
|
|
560
|
+
color: ${ne(t,n).placeholderTextColor};
|
|
546
561
|
}
|
|
547
|
-
|
|
548
562
|
&::-webkit-contacts-auto-fill-button {
|
|
549
563
|
visibility: hidden;
|
|
550
564
|
pointer-events: none;
|
|
551
565
|
}
|
|
552
566
|
}
|
|
553
|
-
`;class
|
|
567
|
+
`;class $S extends ce{constructor({name:n,label:r,helperText:s,type:i="text",placeholder:o,error:a=!1,disabled:c=!1}){super({tag:"div",styles:u=>BS(u,{error:a,disabled:c})});A(this,"inputElement");const l=cd(a,c);if(r){const u=document.createElement("label"),d=new q({text:r,size:l.label.size,weight:l.label.weight,color:l.label.color}).element;u.append(d),u.htmlFor=n,this.element.append(u)}if(this.inputElement=document.createElement("input"),this.inputElement.type="text",this.inputElement.inputMode=i,this.inputElement.name=n,this.inputElement.id=n,this.inputElement.autocomplete="off",this.inputElement.disabled=c,o&&(this.inputElement.placeholder=o),this.inputElement.classList.add("input-field"),this.element.append(this.inputElement),["number","tel"].includes(i)&&this.inputElement.addEventListener("input",this.handleNumericInput.bind(this)),s){const u=new q({text:s,size:l.helperText.size,weight:l.helperText.weight,color:l.helperText.color}).element;this.element.append(u)}}handleNumericInput(n){const r=n.target;r.value=r.value.replace(/[^0-9]/g,"")}getValue(){return this.inputElement.value}setValue(n){this.inputElement.value=n}}const US=e=>`https://rs.astropay.com/img/flags/${e}.webp`,VS=()=>K`
|
|
554
568
|
display: flex;
|
|
555
569
|
flex-direction: column;
|
|
556
570
|
gap: 12px;
|
|
@@ -562,12 +576,12 @@ Minimum version required to store current data is: `+A+`.
|
|
|
562
576
|
|
|
563
577
|
width: 100%;
|
|
564
578
|
}
|
|
565
|
-
`;class
|
|
579
|
+
`;class zS extends ce{constructor({availableCountries:n,onSubmit:r}){super({tag:"form",styles:()=>VS()});A(this,"inputDialCode");A(this,"inputPhoneNumber");A(this,"btnContinue");A(this,"inputsWrapper");A(this,"onSubmit");this.onSubmit=r;const s=n.map(i=>({name:i.name,value:i.callingCode,icon:US(i.iso)}));this.inputsWrapper=document.createElement("div"),this.inputsWrapper.classList.add("inputs-wrapper"),this.inputDialCode=new FS({name:"country",options:s,emptyMessage:te.translate("enter_country_code"),maxWidth:"180px"}),this.inputPhoneNumber=new $S({name:"phone",placeholder:te.translate("enter_your_phone"),type:"tel"}),this.inputsWrapper.append(this.inputDialCode.element,this.inputPhoneNumber.element),this.btnContinue=new Rn({text:te.translate("continue"),iconLeft:"astropay_logo",iconRight:"arrow_right_line",isFullWidth:!0,size:"large",isDisabled:!0,isApTheme:!0,onClick:i=>{i.preventDefault(),this.handleSubmit()}}),this.element.append(this.inputsWrapper,this.btnContinue.element),this.inputDialCode.element.addEventListener("change",()=>this.validateForm()),this.inputPhoneNumber.element.addEventListener("input",()=>this.validateForm()),this.validateForm()}validateForm(){const n=this.inputDialCode.getSelectedValue(),r=this.inputPhoneNumber.getValue(),s=r&&r.toString().length>=5,i=!!n;this.btnContinue.setDisabled(!s||!i)}handleSubmit(){const n=new FormData(this.element),r=n.get("country"),s=n.get("phone"),i=`${r}${s}`;We.trackEvent("ap_cl_identify_user_init",{phoneNumber:i}),this.btnContinue.setLoading(!1),this.onSubmit({phoneNumber:i})}setLoading(n){this.btnContinue.setLoading(n)}setDisable(n){this.btnContinue.setDisabled(n)}}const HS=()=>K`
|
|
566
580
|
display: flex;
|
|
567
581
|
flex-direction: column;
|
|
568
582
|
align-items: center;
|
|
569
583
|
gap: 8px;
|
|
570
|
-
`;class
|
|
584
|
+
`;class ld extends ce{constructor(t){super({tag:"div",styles:()=>HS()});const n=t.type==="success",r=new Je({name:n?"check_circle_line":"close_circle_line",size:96,color:U.getStyles()[n?"apSuccessText":"apErrorText"]}).element;if(this.element.append(r),t.title){const s=new q({text:t.title,size:20,lineHeight:30,weight:600,align:"center"}).element;this.element.append(s)}if(t.description){const s=new q({text:t.description,size:16,lineHeight:24,align:"center"}).element;this.element.append(s)}}}const Ts={createPayment:"/v1/web/payments",identifyUser:"/v1/web/payments/:paymentExternalId/identify-user",paymentStatus:"/v1/web/payments/:paymentExternalId/status",paymentMethodCreation:"/v1/web/payments/:paymentExternalId/pay"};class ct{}A(ct,"postCreatePayment",async(t,n)=>{try{const r=await yt.POST({data:t,url:Ts.createPayment});return We.trackEvent("ap_cl_payment_created",{...t,initializer:n}),r}catch(r){return We.trackError(r),Promise.reject(r)}}),A(ct,"postIdentifyUser",async(t,n)=>{try{const r=await yt.POST({data:n,url:qi(Ts.identifyUser,{paymentExternalId:t})});return We.trackEvent("ap_cl_user_identified",{hasAccount:r.user.hasAccount,user:r.user.otherUserData}),r}catch(r){return We.trackError(r),Promise.reject(r)}}),A(ct,"getPaymentStatus",async t=>{try{return await yt.GET({url:qi(Ts.paymentStatus,{paymentExternalId:t})})}catch(n){return Promise.reject(n)}}),A(ct,"getPollingRequest",async t=>{try{const n=t.replace(/^\/?api\//,"");return await yt.GET({url:n})}catch(n){return Promise.reject(n)}});var In=(e=>(e.ACCEPTED="ACCEPTED",e.FINISHED="FINISHED",e))(In||{});class ud{constructor(t,n,r,s){A(this,"pollingTimeout",null);A(this,"isPollingActive",!1);A(this,"remainingAttempts");this.pollingData=t,this.onWaitingInfo=n,this.onFinished=r,this.onError=s,this.remainingAttempts=t.remainingHits,this.validatePollingData()}startPolling(){if(this.pollingData.remainingHits<=0){this.onError(new Error("Polling attempts exhausted"));return}this.isPollingActive=!0,this.executePoll()}stopPolling(){this.isPollingActive=!1,this.pollingTimeout&&(clearTimeout(this.pollingTimeout),this.pollingTimeout=null)}validatePollingData(){if(!this.pollingData.pollingUrl)throw new Error("Invalid polling URL");if(this.pollingData.nextHitIn<=0)throw new Error("Invalid polling interval")}executePoll(){this.isPollingActive&&(this.pollingTimeout=setTimeout(()=>{this.handlePolling().catch(t=>{this.onError(t),this.stopPolling()})},this.getPollingInterval()))}async handlePolling(){const t=await ct.getPollingRequest(this.pollingData.pollingUrl);t.statusCode===202&&t.pollingStatus===In.ACCEPTED?this.handleAccepted(t):this.handleFinished(t)}handleAccepted(t){var n;if(this.isPollingActive){if(this.remainingAttempts=t.pollingMetadata.remainingHits,this.pollingData=t.pollingMetadata,this.remainingAttempts<=0){const r=t.timeoutInfo.text;this.stopPolling(),this.onError(new Error(r));return}(n=t.waitingInfo)!=null&&n.text&&this.onWaitingInfo&&this.onWaitingInfo(t.waitingInfo.text),this.executePoll()}}handleFinished(t){this.stopPolling(),this.onFinished(t)}getPollingInterval(){return this.pollingData.nextHitIn}}class dd{static generate(t,n={}){const r=this.landingBaseUrl;return $w(r,t,n).toString()}}A(dd,"landingBaseUrl","https://checkout.astropay.com");const jS=()=>K`
|
|
571
585
|
display: flex;
|
|
572
586
|
flex-direction: column;
|
|
573
587
|
gap: 10px;
|
|
@@ -602,13 +616,12 @@ Minimum version required to store current data is: `+A+`.
|
|
|
602
616
|
opacity: 1;
|
|
603
617
|
}
|
|
604
618
|
}
|
|
605
|
-
`;class
|
|
619
|
+
`;class fd extends ce{constructor({paymentExternalId:n,user:r,countries:s,benefits:i,paymentAmount:o,onSuccess:a}){super({tag:"div",styles:()=>jS()});A(this,"paymentExternalId");A(this,"userData");A(this,"countries");A(this,"paymentAmount");A(this,"onSuccess");A(this,"btnAstroPay");A(this,"formCountryPhone");A(this,"pushFeedbackWrapper");A(this,"isRendering",!1);A(this,"pollingService",null);if(this.paymentExternalId=n,this.userData=r,this.countries=s,this.paymentAmount=o,a&&(this.onSuccess=a),this.btnAstroPay=new Rn({text:"AstroPay",onClick:this.handleAstroPayClick.bind(this),isFullWidth:!0,iconLeft:"astropay_logo",iconRight:"arrow_right_line",isApTheme:!0}),this.element.append(this.btnAstroPay.element),i){const c=new Yi({items:i.batch,color:U.getStyles().apPillTxtColor,bgColor:U.getStyles().apPillBgColor,isFullWidth:!0,align:"center"}).element;this.element.append(c)}}handleAstroPayClick(){if(!this.isRendering){if(this.isRendering=!0,lf()){this.handleMobileFlow();return}if(this.userData.hasAccount){this.handleAccountFlow();return}this.renderPhoneInput()}}async fetchIdentifyUser(n,r){var s;try{const i={phoneNumber:n??""};if((await ct.postIdentifyUser(this.paymentExternalId,i)).user.hasAccount){(s=this.formCountryPhone)==null||s.setDisable(!0),this.handleAccountFlow();return}r==null||r()}catch(i){const o=i,a=new q({text:o.message,size:12,color:U.getStyles().apErrorText}).element;this.element.append(a)}}async handlePhoneNumberSubmit(n){try{this.formCountryPhone&&this.formCountryPhone.setLoading(!0),await this.fetchIdentifyUser(n.phoneNumber,()=>this.handleNoAccountFlow())}finally{this.formCountryPhone&&this.formCountryPhone.setLoading(!1)}}renderPhoneInput(){this.element.innerHTML="",this.formCountryPhone=new zS({availableCountries:this.countries??[],onSubmit:n=>{this.handlePhoneNumberSubmit(n)}}),this.element.append(this.formCountryPhone.element)}generateRedirectUrl(){return dd.generate(`checkout-payment/${this.paymentExternalId}`,{data:Go(this.paymentAmount)})}handleMobileFlow(){window.location.href=this.generateRedirectUrl()}handleAccountFlow(){this.renderAlreadySent(),this.checkPaymentStatus()}handleNoAccountFlow(){window.location.href=this.generateRedirectUrl()}renderAlreadySent(){this.pushFeedbackWrapper&&this.pushFeedbackWrapper.remove(),this.btnAstroPay.setDisabled(!0),this.pushFeedbackWrapper=document.createElement("div"),this.pushFeedbackWrapper.classList.add("sent-message-wrapper");const n=new Yi({items:[{title:te.translate("push_notification_sent"),icon:"notification_fill"}],color:U.getStyles().apPillTxtColor,bgColor:U.getStyles().apPillBgColor,isFullWidth:!0,align:"center"}).element,r=document.createElement("div");r.classList.add("sent-message-content");const s=new q({text:te.translate("didnt_receive"),size:16,weight:600}).element,i=new q({text:te.translate("scan_qr_copy_link"),size:14,weight:400}).element;r.append(s,i);const o=new ad({width:100,value:this.generateRedirectUrl(),altText:te.translate("qr_code")}).element,a=new Rn({text:te.translate("copy_payment_link"),variant:"copy-to-clipboard",size:"small",iconRight:"copy_2_line",onClick:()=>{As(this.generateRedirectUrl())}}).element;this.pushFeedbackWrapper.append(n,r,o,a),this.element.append(this.pushFeedbackWrapper)}async checkPaymentStatus(){try{const n=await ct.getPaymentStatus(this.paymentExternalId);n.pollingStatus===In.ACCEPTED?this.initializePollingService(n.pollingMetadata):n.pollingStatus===In.FINISHED&&this.handlePaymentSuccess(n)}catch(n){const r=n;this.showErrorMessage(r.message)}}initializePollingService(n){this.pollingService=new ud(n,r=>this.showWaitingInfo(r),r=>this.handlePaymentSuccess(r),r=>this.handlePollingError(r)),this.pollingService.startPolling()}handlePaymentSuccess(n){var i,o;const r=[],s=new ld({type:"success",title:(i=n.data.successSection)==null?void 0:i.title,description:(o=n.data.successSection)==null?void 0:o.description}).element;r.push(s),this.onSuccess?this.onSuccess(r):(this.element.innerHTML="",r.forEach(a=>this.element.append(a)))}showWaitingInfo(n){if(!this.pushFeedbackWrapper)return;let r=this.pushFeedbackWrapper.querySelector(".loading-pooling");r||(r=document.createElement("div"),r.classList.add("loading-pooling"),this.pushFeedbackWrapper.append(r)),r.innerHTML="";const s=new At({size:12,color:U.getStyles().textPrimaryColor}).element,i=new q({text:n,size:12}).element;r.append(s,i)}handlePollingError(n){const r=n;this.showErrorMessage(r.message),this.stopPolling()}showErrorMessage(n){if(!this.pushFeedbackWrapper)return;const r=document.createElement("div"),s=new q({text:n,size:12,color:U.getStyles().apErrorText}).element;r.append(s),this.pushFeedbackWrapper.append(r)}stopPolling(){this.pollingService&&(this.pollingService.stopPolling(),this.pollingService=null),this.element.querySelectorAll(".loading-pooling").forEach(r=>r.remove())}}const WS=e=>K`
|
|
606
620
|
background-color: ${e.backgroundColor};
|
|
607
621
|
|
|
608
622
|
display: flex;
|
|
609
623
|
flex-direction: column;
|
|
610
624
|
gap: 12px;
|
|
611
|
-
padding: 4px;
|
|
612
625
|
|
|
613
626
|
max-width: ${typeof e.width=="number"?`${e.width}px`:e.width};
|
|
614
627
|
padding: ${typeof e.paddingWrapper=="number"?`${e.paddingWrapper}px`:e.paddingWrapper};
|
|
@@ -637,9 +650,9 @@ Minimum version required to store current data is: `+A+`.
|
|
|
637
650
|
justify-content: center;
|
|
638
651
|
gap: 8px;
|
|
639
652
|
}
|
|
640
|
-
`,
|
|
653
|
+
`,qS=e=>{const t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`},KS=e=>K`
|
|
641
654
|
display: flex;
|
|
642
|
-
flex-wrap: nowrap;
|
|
655
|
+
flex-wrap: nowrap;
|
|
643
656
|
align-items: center;
|
|
644
657
|
gap: 4px;
|
|
645
658
|
width: fit-content;
|
|
@@ -651,7 +664,7 @@ Minimum version required to store current data is: `+A+`.
|
|
|
651
664
|
|
|
652
665
|
min-width: min-content;
|
|
653
666
|
white-space: nowrap;
|
|
654
|
-
`;class
|
|
667
|
+
`;class GS extends ce{constructor(n){super({tag:"div",styles:r=>KS(r)});A(this,"compProps");A(this,"intervalId",null);A(this,"isTimeOver",!1);this.compProps={timeoutText:te.translate("time_up"),...n},this.startTimer(),this.renderTime()}startTimer(){this.intervalId=window.setInterval(()=>{var n,r;this.compProps.time-=1,this.renderTime(),this.compProps.time<=0&&(this.isTimeOver=!0,this.stopTimer(),(r=(n=this.compProps).onTimeOut)==null||r.call(n),this.renderTime())},1e3)}renderTime(){const n=qS(this.compProps.time);if(this.element.innerHTML="",this.compProps.iconLeft){const r=new Je({name:this.compProps.iconLeft,color:U.getStyles().apWarningTxtColor}).element;this.element.append(r)}if(this.compProps.text){const r=this.isTimeOver?this.compProps.timeoutText:this.compProps.text,s=this.isTimeOver?"":n,i=new q({variant:"div",text:r,size:14,weight:400,lineHeight:21,color:U.getStyles().apWarningTxtColor,align:"center"}).element,o=new q({variant:"div",text:s,size:14,weight:600,lineHeight:21,color:U.getStyles().apWarningTxtColor,align:"center"}).element;if(o.style.fontFamily="monospace",this.element.append(i,o),this.compProps.iconRight){const a=new Je({name:this.compProps.iconRight,color:U.getStyles().apWarningTxtColor}).element;this.element.append(a)}}}stopTimer(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}destroy(){this.stopTimer(),super.destroy()}}class pd{}A(pd,"postPaymentMethodCreation",async t=>{try{return await yt.POST({url:qi(Ts.paymentMethodCreation,{paymentExternalId:t.paymentExternalId}),data:t})}catch(n){return Promise.reject(n)}});var Gt=(e=>(e.AMOUNT_DISPLAY="AMOUNT_DISPLAY",e.COPY="COPY",e.DESCRIPTION="DESCRIPTION",e.EXPIRATION_TIMER="EXPIRATION_TIMER",e.QR_CODE="QR_CODE",e.SHARE="SHARE",e))(Gt||{});const YS={AED:"ar-AE",AOA:"pt-AO",AND:"ca-AD",ARS:"es-AR",AUD:"en-AU",BDT:"bn-BD",BGN:"bg-BG",BOB:"es-BO",BRL:"pt-BR",CAD:"en-CA",CDF:"fr-CD",CLP:"es-CL",CNY:"zh-CN",COP:"es-CO",CZK:"cs-CZ",DKK:"da-DK",EGP:"ar-EG",ETB:"am-ET",EUR:"de-DE",GBP:"en-GB",GHS:"en-GH",GTQ:"es-GT",HNL:"es-HN",HKD:"zh-HK",HUF:"hu-HU",IDR:"id-ID",INR:"hi-IN",JPY:"ja-JP",KES:"en-KE",KRW:"ko-KR",KWD:"ar-KW",KZT:"kk-KZ",LKR:"si-LK",LSL:"st-LS",MAD:"ar-MA",MGA:"mg-MG",MKD:"mk-MK",MMK:"my-MM",MNT:"mn-MN",MOP:"zh-MO",MXN:"es-MX",MYR:"ms-MY",MZN:"pt-MZ",NGN:"en-NG",NIO:"es-NI",NOK:"no-NO",NPR:"ne-NP",NZD:"en-NZ",PAB:"es-PA",PEN:"es-PE",PKR:"ur-PK",PLN:"pl-PL",PYG:"es-PY",QAR:"ar-QA",RMB:"zh-CN",RSD:"sr-RS",RUB:"ru-RU",RWF:"rw-RW",SAR:"ar-SA",SEK:"sv-SE",SLL:"en-SL",SVC:"es-SV",THB:"th-TH",TND:"ar-TN",TRY:"tr-TR",TTD:"en-TT",TWD:"zh-TW",TZS:"sw-TZ",UAH:"uk-UA",UGX:"en-UG",USD:"en-US",UYU:"es-UY",UZS:"uz-UZ",VND:"vi-VN",XAF:"fr-CM",XOF:"fr-SN",ZAR:"en-ZA",ZWD:"en-ZW",ZWL:"en-ZW"},hd=(e,t)=>{const n=YS[t]||"en-US";return new Intl.NumberFormat(n,{style:"decimal",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)},JS={AED:"د.إ",AOA:"Kz",AND:"€",ARS:"$",AUD:"$",BDT:"৳",BGN:"лв",BOB:"Bs.",BRL:"R$",CAD:"$",CDF:"FC",CLP:"$",CNY:"¥",COP:"$",CZK:"Kč",DKK:"kr",EGP:"£",ETB:"Br",EUR:"€",GBP:"£",GHS:"₵",GTQ:"Q",HNL:"L",HKD:"$",HUF:"Ft",IDR:"Rp",INR:"₹",JPY:"¥",KES:"KSh",KRW:"₩",KWD:"د.ك",KZT:"₸",LKR:"₨",LSL:"L",MAD:"د.م.",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MXN:"$",MYR:"RM",MZN:"MT",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",PAB:"B/.",PEN:"S/.",PKR:"₨",PLN:"zł",PYG:"₲",QAR:"﷼",RMB:"¥",RSD:"РСД",RUB:"₽",RWF:"FRw",SAR:"ر.س",SEK:"kr",SLL:"Le",SVC:"$",THB:"฿",TND:"د.ت",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"US$",UYU:"$",UZS:"so'm",VND:"₫",XAF:"FCFA",XOF:"CFA",ZAR:"R",ZWD:"$",ZWL:"$"},ZS=e=>e===void 0?"":JS[e.trim()]||e,XS=(e,t,n)=>n==="symbol"?`${ZS(t)} ${hd(e,t)}`:`${t} ${hd(e,t)}`,QS=e=>K`
|
|
655
668
|
display: flex;
|
|
656
669
|
flex-direction: column;
|
|
657
670
|
gap: 10px;
|
|
@@ -672,7 +685,7 @@ Minimum version required to store current data is: `+A+`.
|
|
|
672
685
|
padding: 16px;
|
|
673
686
|
border: 1px solid ${e.primaryColor};
|
|
674
687
|
border-radius: 16px;
|
|
675
|
-
background-color: ${
|
|
688
|
+
background-color: ${C.neutral_lightest};
|
|
676
689
|
}
|
|
677
690
|
|
|
678
691
|
.timeout-container {
|
|
@@ -687,13 +700,12 @@ Minimum version required to store current data is: `+A+`.
|
|
|
687
700
|
align-items: center;
|
|
688
701
|
gap: 8px;
|
|
689
702
|
}
|
|
690
|
-
`;class
|
|
703
|
+
`;class e_ extends ce{constructor({methodCode:n,paymentExternalId:r,onSuccess:s}){super({tag:"div",styles:i=>QS(i)});A(this,"loadingWrapper");A(this,"paymentMethodData");A(this,"onSuccess");A(this,"timerElement",null);A(this,"timerInstance",null);A(this,"pollingService",null);this.paymentMethodData={methodCode:n,paymentExternalId:r},s&&(this.onSuccess=s),this.loadingWrapper=this.createLoadingWrapper(),this.element.append(this.loadingWrapper),this.fetchPaymentMethodData()}createLoadingWrapper(){const n=document.createElement("div");n.classList.add("loading-wrapper");const r=new At({size:100,variant:"fetching",color:U.getStyles().primaryColor}).element,s=new q({text:te.translate("waiting_confirmation"),size:20,lineHeight:30,weight:600}).element;s.style.marginTop="8px";const i=new q({text:te.translate("do_not_close_window"),size:16,lineHeight:24}).element;return n.append(r,s,i),n}async fetchPaymentMethodData(){try{const n=await pd.postPaymentMethodCreation(this.paymentMethodData);this.renderSections(n.sections)}catch(n){const r=n;this.showErrorMessage(r.message)}finally{this.loadingWrapper.remove()}}async checkPaymentStatus(){try{const n=await ct.getPaymentStatus(this.paymentMethodData.paymentExternalId);n.pollingStatus===In.ACCEPTED?this.initializePollingService(n.pollingMetadata):n.pollingStatus===In.FINISHED&&this.renderSuccessPage(n)}catch(n){const r=n;this.showErrorMessage(r.message),this.stopTimer(),this.pollingService&&this.pollingService.stopPolling()}}initializePollingService(n){this.pollingService=new ud(n,r=>this.showWaitingInfo(r),r=>this.renderSuccessPage(r),r=>{const s=r;this.showErrorMessage(s.message)}),this.pollingService.startPolling()}stopTimer(){this.timerInstance&&(this.timerInstance.stopTimer(),this.timerInstance=null,this.timerElement=null)}renderSuccessPage(n){var i,o;const r=[],s=new ld({type:"success",title:(i=n.data.successSection)==null?void 0:i.title,description:(o=n.data.successSection)==null?void 0:o.description}).element;r.push(s),this.onSuccess?this.onSuccess(r):(this.element.innerHTML="",r.forEach(a=>this.element.append(a)))}showErrorMessage(n){this.element.innerHTML="";const r=document.createElement("div");r.classList.add("timeout-container");const s=new q({text:n,size:12,color:U.getStyles().apErrorText}).element;r.append(s,this.renderRetryButton()),this.element.append(r)}showWaitingInfo(n){let r=this.element.querySelector(".loading-pooling");r||(r=document.createElement("div"),r.classList.add("loading-pooling"),this.element.append(r)),r.innerHTML="";const s=new At({size:12,color:U.getStyles().textPrimaryColor}).element,i=new q({text:n}).element;r.append(s,i)}async renderSections(n){n.filter(r=>!!r).sort((r,s)=>r.order-s.order).forEach(r=>{const{componentType:s,metadata:i}=r;switch(s){case Gt.AMOUNT_DISPLAY:this.renderAmountDisplay(i);break;case Gt.COPY:this.renderCopy(i);break;case Gt.DESCRIPTION:this.renderDescription(i);break;case Gt.EXPIRATION_TIMER:this.renderTimer(i);break;case Gt.QR_CODE:this.renderQRCode(i);break;case Gt.SHARE:this.renderShare(i);break;default:console.warn("Unknown component type:",s)}}),await this.checkPaymentStatus()}renderCopy(n){const r=new Rn({text:n.label,variant:"copy-to-clipboard",size:"medium",iconLeft:n.iconLeft,iconRight:n.iconRight??"copy_2_line",onClick:()=>{As(n.value)}}).element;this.element.append(r)}renderShare(n){const r=new Rn({text:n.label,variant:"text",size:"medium",iconRight:n.iconRight,iconLeft:n.iconLeft,onClick:()=>{var s,i,o;Fd(((s=n==null?void 0:n.richTextInfo)==null?void 0:s.title)??"Share",((i=n==null?void 0:n.richTextInfo)==null?void 0:i.description)??n.value,(o=n==null?void 0:n.richTextInfo)==null?void 0:o.url)}}).element;this.element.append(r)}renderDescription(n){const r=new q({text:`${n.text} ${XS(n.amount,n.currency,Mn.getCurrencyMode())}`,size:16,lineHeight:24,weight:600}).element;this.element.append(r)}renderQRCode(n){const r=new ad({value:n.value,altText:te.translate("qr_code")}).element;this.element.append(r)}renderAmountDisplay(n){const r=new q({text:n.value,size:16,lineHeight:24,weight:600}).element;this.element.append(r)}renderTimer(n){this.timerInstance=new GS({time:n.time,text:n.label,iconLeft:n.iconLeft,iconRight:n.iconRight,timeoutText:n.timeoutInfo.description,onTimeOut:()=>{this.handleTimeout(n),this.pollingService&&this.pollingService.stopPolling()}}),this.timerElement=this.timerInstance.element,this.element.append(this.timerElement)}handleTimeout(n){this.pollingService&&this.pollingService.stopPolling(),this.stopTimer();const r=document.createElement("div");r.classList.add("timeout-container"),this.timerElement&&r.append(this.timerElement),n.timeoutInfo.description&&r.append(this.renderExpiredPill(n.timeoutInfo.description)),n.timeoutInfo.retry&&r.append(this.renderRetryButton()),this.element.innerHTML="",this.element.append(r)}renderRetryButton(){return new Rn({text:te.translate("try_again"),variant:"primary",size:"medium",iconRight:"refresh_2_fill",onClick:()=>{this.element.innerHTML="",this.timerElement=null,this.timerInstance=null,this.pollingService&&this.pollingService.stopPolling(),this.element.append(this.loadingWrapper),this.fetchPaymentMethodData()}}).element}renderExpiredPill(n){return new Yi({items:[{title:n,icon:"alert_line"}],bgColor:U.getStyles().apPillDisableBgColor,color:U.getStyles().apPillDisableTxtColor,align:"center"}).element}}const t_={PIX:"system_pix",CREDIT_CARD:"bank_card_line"},n_=({paymentMethods:e,paymentExternalId:t,onSuccess:n})=>e?e.filter(r=>r.enabled).map(r=>({icon:r.logo||t_[r.code],title:r.label,content:()=>new e_({paymentExternalId:t,methodCode:r.code,onSuccess:s=>n(s)}).element})):[];class r_ extends ce{constructor(n){super({tag:"div",elementId:"payment-component",styles:s=>WS(s)});A(this,"loadingWrapper");A(this,"componentProps");if(this.componentProps={showTitle:!0,showDescription:!0,...n},!st.isLibInitialized()){const s="AstroPay Payments Library: Not initialized. Call init function first.";console.error(s),this.element.innerHTML="";const i=new q({text:s,size:12,color:U.getStyles().apErrorText}).element;this.element.append(i);return}st.registerComponent(this),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const r=new At({size:100,variant:"fetching",color:U.getStyles().primaryColor}).element;this.loadingWrapper.append(r),this.element.appendChild(this.loadingWrapper),We.trackEvent("ap_cl_full_checkout_init"),this.createPayment()}async createPayment(){try{const{amount:n,currency:r,country:s,user:i,order:o}=this.componentProps,a={country:s.trim(),currency:r.trim(),amount:n,user:i,order:o},c=await ct.postCreatePayment(a,"full_checkout");this.renderPaymentMethods(c)}catch(n){const r=n;this.componentProps.onError&&this.componentProps.onError();const s=new q({text:r.message,size:12,color:U.getStyles().apErrorText}).element;this.element.appendChild(s)}finally{this.loadingWrapper.remove()}}renderPaymentMethods(n){const{paymentExternalId:r,user:s,paymentMethods:i,countries:o,paymentComponentDescription:a,benefits:c}=n;if(this.element.innerHTML="",this.componentProps.showTitle){const f=new q({text:te.translate("astro_express_checkout"),variant:"div",size:16,weight:600}).element;this.element.append(f)}if(this.componentProps.showDescription&&a){const f=new q({text:a}).element;this.element.append(f)}const l={amount:this.componentProps.amount,currency:this.componentProps.currency},u=new fd({paymentExternalId:r,user:s,countries:o,benefits:c,paymentAmount:l,onSuccess:f=>this.showSuccessContent(f)}).element;this.element.append(u);const d=n_({paymentMethods:i,paymentExternalId:r,onSuccess:f=>this.showSuccessContent(f)});if(d.length>0){const f=new Au({borderType:"dashed"}).element,h=new Zw({items:d}).element;this.element.append(f,h)}}showSuccessContent(n){this.element.innerHTML="";const r=document.createElement("div");if(r.classList.add("payment-success-content"),n.forEach(s=>r.append(s)),this.element.append(r),We.trackEvent("ap_cl_payment_success"),this.componentProps.onSuccess){const s=document.createElement("div");s.classList.add("loading-success-callback");const i=new At({size:12,color:U.getStyles().textPrimaryColor}).element,o=new q({text:te.translate("almost_done"),size:12}).element;s.append(i,o),this.element.append(s),setTimeout(()=>{this.componentProps.onSuccess()},5e3)}}render(n){if(!n)throw new Error("Container element not found");n.appendChild(this.element)}destroy(){this.element.remove(),st.unregisterComponent(this)}}const s_=e=>K`
|
|
691
704
|
background-color: ${e.backgroundColor};
|
|
692
705
|
|
|
693
706
|
display: flex;
|
|
694
707
|
flex-direction: column;
|
|
695
708
|
gap: 12px;
|
|
696
|
-
padding: 4px;
|
|
697
709
|
|
|
698
710
|
max-width: ${typeof e.width=="number"?`${e.width}px`:e.width};
|
|
699
711
|
padding: ${typeof e.paddingWrapper=="number"?`${e.paddingWrapper}px`:e.paddingWrapper};
|
|
@@ -722,5 +734,5 @@ Minimum version required to store current data is: `+A+`.
|
|
|
722
734
|
justify-content: center;
|
|
723
735
|
gap: 8px;
|
|
724
736
|
}
|
|
725
|
-
`;class t_ extends ae{constructor(n){super({tag:"div",styles:s=>e_(s)});T(this,"loadingWrapper");T(this,"componentProps");this.componentProps=n,rt.registerComponent(this),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const r=new xt({size:100,variant:"fetching",color:$.getStyles().primaryColor}).element;this.loadingWrapper.append(r),this.element.appendChild(this.loadingWrapper),je.trackEvent("ap_cl_astropay_payment_init"),this.createPayment()}async createPayment(){try{const{amount:n,currency:r,country:s}=this.componentProps,i={country:s.trim(),currency:r.trim(),amount:n},o=await at.postCreatePayment(i,"astropay_payment");this.renderAstroPayMethod(o)}catch(n){const r=n;this.componentProps.onError&&this.componentProps.onError();const s=new q({text:r.message,size:12,color:$.getStyles().apErrorText}).element;this.element.appendChild(s)}finally{this.loadingWrapper.remove()}}renderAstroPayMethod(n){const{paymentExternalId:r,user:s,countries:i,benefits:o}=n;this.element.innerHTML="";const a={amount:this.componentProps.amount,currency:this.componentProps.currency},c=new cd({paymentExternalId:r,user:s,countries:i,benefits:o,paymentAmount:a,onSuccess:l=>this.showSuccessContent(l)}).element;this.element.append(c)}showSuccessContent(n){this.element.innerHTML="";const r=document.createElement("div");if(r.classList.add("payment-success-content"),n.forEach(s=>r.append(s)),this.element.append(r),this.componentProps.onSuccess){const s=document.createElement("div");s.classList.add("loading-success-callback");const i=new xt({size:12,color:$.getStyles().textPrimaryColor}).element,o=new q({text:te.translate("almost_done"),size:12}).element;s.append(i,o),this.element.append(s),je.trackEvent("ap_cl_payment_success"),setTimeout(()=>{this.componentProps.onSuccess()},5e3)}}render(n){if(!n)throw new Error("Container element not found");n.appendChild(this.element)}destroy(){this.element.remove(),rt.unregisterComponent(this)}}Np();const wo=new WeakMap;function ct(e){return wo.has(e)}function n_(e){let t=e;for(;t;){if(!ct(t)&&!Ci(t))return!1;t=as(t)}return!0}function De(e){return wo.get(e)}function r_(e,t){wo.set(e,t)}function So(e,t){const n=e.tagName,r=e.value;if(cs(e,t)){const s=e.type;return n==="INPUT"&&(s==="button"||s==="submit"||s==="reset")?r:!r||n==="OPTION"?void 0:Et}if(n==="OPTION"||n==="SELECT")return e.value;if(!(n!=="INPUT"&&n!=="TEXTAREA"))return r}const s_=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,i_=/^[A-Za-z]+:|^\/\//,o_=/^data:.*,/i;function a_(e,t){return e.replace(s_,(n,r,s,i,o,a)=>{const c=s||o||a;if(!t||!c||i_.test(c)||o_.test(c))return n;const l=r||i||"";return`url(${l}${c_(c,t)}${l})`})}function c_(e,t){try{return Zr(e,t).href}catch{return e}}const l_=/[^a-z1-6-_]/;function dd(e){const t=e.toLowerCase().trim();return l_.test(t)?"div":t}function fd(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`}const lt={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},Gt={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},We={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},Je={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},pd={Play:0,Pause:1};function hd(e){if(!(e===void 0||e.length===0))return e.map(t=>{const n=t.cssRules||t.rules;return{cssRules:Array.from(n,i=>i.cssText),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}})}function gd(e,t,n,r){if(t===M.HIDDEN)return null;const s=e.getAttribute(n);if(t===M.MASK&&n!==xi&&!wl.includes(n)&&n!==r.actionNameAttribute){const i=e.tagName;switch(n){case"title":case"alt":case"placeholder":return Et}if(i==="IMG"&&(n==="src"||n==="srcset")){const o=e;if(o.naturalWidth>0)return fd(o.naturalWidth,o.naturalHeight);const{width:a,height:c}=e.getBoundingClientRect();return a>0||c>0?fd(a,c):ll}if(i==="SOURCE"&&(n==="src"||n==="srcset"))return ll;if(i==="A"&&n==="href"||s&&n.startsWith("data-")||i==="IFRAME"&&n==="srcdoc")return Et}return!s||typeof s!="string"?s:el(s)?tl(s):s}function u_(e,t,n){if(t===M.HIDDEN)return{};const r={},s=dd(e.tagName),i=e.ownerDocument;for(let u=0;u<e.attributes.length;u+=1){const f=e.attributes.item(u).name,h=gd(e,t,f,n.configuration);h!==null&&(r[f]=h)}if(e.value&&(s==="textarea"||s==="select"||s==="option"||s==="input")){const u=So(e,t);u!==void 0&&(r.value=u)}if(s==="option"&&t===M.ALLOW){const u=e;u.selected&&(r.selected=u.selected)}if(s==="link"){const u=Array.from(i.styleSheets).find(f=>f.href===e.href),d=_o(u);d&&u&&(r._cssText=d)}if(s==="style"&&e.sheet){const u=_o(e.sheet);u&&(r._cssText=u)}const o=e;if(s==="input"&&(o.type==="radio"||o.type==="checkbox")&&(t===M.ALLOW?r.checked=!!o.checked:cs(o,t)&&delete r.checked),s==="audio"||s==="video"){const u=e;r.rr_mediaState=u.paused?"paused":"played"}let a,c;const l=n.serializationContext;switch(l.status){case 0:a=Math.round(e.scrollTop),c=Math.round(e.scrollLeft),(a||c)&&l.elementsScrollPositions.set(e,{scrollTop:a,scrollLeft:c});break;case 1:l.elementsScrollPositions.has(e)&&({scrollTop:a,scrollLeft:c}=l.elementsScrollPositions.get(e));break}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}function _o(e){if(!e)return null;let t;try{t=e.rules||e.cssRules}catch{}if(!t)return null;const n=Array.from(t,Zp()?d_:md).join("");return a_(n,e.href)}function d_(e){if(p_(e)&&e.selectorText.includes(":")){const t=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return e.cssText.replace(t,"$1\\$2")}return md(e)}function md(e){return f_(e)&&_o(e.styleSheet)||e.cssText}function f_(e){return"styleSheet"in e}function p_(e){return"selectorText"in e}function vo(e,t){const n=m_(e,t);if(!n)return null;const r=De(e)||g_(),s=n;return s.id=r,r_(e,r),t.serializedNodeIds&&t.serializedNodeIds.add(r),s}let h_=1;function g_(){return h_++}function Eo(e,t){const n=[];return cl(e,r=>{const s=vo(r,t);s&&n.push(s)}),n}function m_(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return y_(e,t);case e.DOCUMENT_FRAGMENT_NODE:return b_(e,t);case e.DOCUMENT_TYPE_NODE:return w_(e);case e.ELEMENT_NODE:return S_(e,t);case e.TEXT_NODE:return v_(e,t);case e.CDATA_SECTION_NODE:return E_()}}function y_(e,t){return{type:Gt.Document,childNodes:Eo(e,t),adoptedStyleSheets:hd(e.adoptedStyleSheets)}}function b_(e,t){const n=Ci(e);return n&&t.serializationContext.shadowRootsController.addShadowRoot(e),{type:Gt.DocumentFragment,childNodes:Eo(e,t),isShadowRoot:n,adoptedStyleSheets:n?hd(e.adoptedStyleSheets):void 0}}function w_(e){return{type:Gt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId}}function S_(e,t){const n=dd(e.tagName),r=__(e)||void 0,s=ul(dl(e),t.parentNodePrivacyLevel);if(s===M.HIDDEN){const{width:a,height:c}=e.getBoundingClientRect();return{type:Gt.Element,tagName:n,attributes:{rr_width:`${a}px`,rr_height:`${c}px`,[xi]:U1},childNodes:[],isSVG:r}}if(s===M.IGNORE)return;const i=u_(e,s,t);let o=[];if(B1(e)&&n!=="style"){let a;t.parentNodePrivacyLevel===s&&t.ignoreWhiteSpace===(n==="head")?a=t:a={...t,parentNodePrivacyLevel:s,ignoreWhiteSpace:n==="head"},o=Eo(e,a)}return{type:Gt.Element,tagName:n,attributes:i,childNodes:o,isSVG:r}}function __(e){return e.tagName==="svg"||e instanceof SVGElement}function v_(e,t){const n=pl(e,t.ignoreWhiteSpace||!1,t.parentNodePrivacyLevel);if(n!==void 0)return{type:Gt.Text,textContent:n}}function E_(){return{type:Gt.CDATA,textContent:""}}function C_(e,t,n){return vo(e,{serializationContext:n,parentNodePrivacyLevel:t.defaultPrivacyLevel,configuration:t})}function yd(e){return!!e.changedTouches}function gr(e){return e.composed===!0&&os(e.target)?e.composedPath()[0]:e.target}const bd=25;function x_(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>bd||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>bd}const T_=(e,t)=>{const n=window.visualViewport,r={layoutViewportX:e,layoutViewportY:t,visualViewportX:e,visualViewportY:t};if(n)x_(n)?(r.layoutViewportX=Math.round(e+n.offsetLeft),r.layoutViewportY=Math.round(t+n.offsetTop)):(r.visualViewportX=Math.round(e-n.offsetLeft),r.visualViewportY=Math.round(t-n.offsetTop));else return r;return r},wd=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function Ze(e,t){return{data:{source:e,...t},type:lt.IncrementalSnapshot,timestamp:de()}}const A_=50;function R_(e,t){const{throttled:n,cancel:r}=wt(i=>{const o=gr(i);if(ct(o)){const a=Sd(i);if(!a)return;const c={id:De(o),timeOffset:0,x:a.x,y:a.y};t(Ze(yd(i)?We.TouchMove:We.MouseMove,{positions:[c]}))}},A_,{trailing:!1}),{stop:s}=Ne(e,document,["mousemove","touchmove"],n,{capture:!0,passive:!0});return{stop:()=>{s(),r()}}}function Sd(e){let{clientX:t,clientY:n}=yd(e)?e.changedTouches[0]:e;if(window.visualViewport){const{visualViewportX:r,visualViewportY:s}=T_(t,n);t=r,n=s}if(!Number.isFinite(t)||!Number.isFinite(n)){e.isTrusted&&ft("mouse/touch event without x/y");return}return{x:t,y:n}}const _d={pointerup:Je.MouseUp,mousedown:Je.MouseDown,click:Je.Click,contextmenu:Je.ContextMenu,dblclick:Je.DblClick,focus:Je.Focus,blur:Je.Blur,touchstart:Je.TouchStart,touchend:Je.TouchEnd};function I_(e,t,n){const r=s=>{const i=gr(s);if(nt(i,e.defaultPrivacyLevel)===M.HIDDEN||!ct(i))return;const o=De(i),a=_d[s.type];let c;if(a!==Je.Blur&&a!==Je.Focus){const u=Sd(s);if(!u)return;c={id:o,type:a,x:u.x,y:u.y}}else c={id:o,type:a};const l={id:n.getIdForEvent(s),...Ze(We.MouseInteraction,c)};t(l)};return Ne(e,document,Object.keys(_d),r,{capture:!0,passive:!0})}const k_=100;function vd(e,t,n,r=document){const{throttled:s,cancel:i}=wt(a=>{const c=gr(a);if(!c||nt(c,e.defaultPrivacyLevel)===M.HIDDEN||!ct(c))return;const l=De(c),u=c===document?{scrollTop:Ii(),scrollLeft:jl()}:{scrollTop:Math.round(c.scrollTop),scrollLeft:Math.round(c.scrollLeft)};n.set(c,u),t(Ze(We.Scroll,{id:l,x:u.scrollLeft,y:u.scrollTop}))},k_),{stop:o}=Z(e,r,"scroll",s,{capture:!0,passive:!0});return{stop:()=>{o(),i()}}}const O_=200;function P_(e,t){const n=Wl(e).subscribe(r=>{t(Ze(We.ViewportResize,r))});return{stop:()=>{n.unsubscribe()}}}function L_(e,t){const n=window.visualViewport;if(!n)return{stop:z};const{throttled:r,cancel:s}=wt(()=>{t({data:wd(n),type:lt.VisualViewport,timestamp:de()})},O_,{trailing:!1}),{stop:i}=Ne(e,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),s()}}}function N_(e,t){return Ne(e,document,["play","pause"],n=>{const r=gr(n);!r||nt(r,e.defaultPrivacyLevel)===M.HIDDEN||!ct(r)||t(Ze(We.MediaInteraction,{id:De(r),type:n.type==="play"?pd.Play:pd.Pause}))},{capture:!0,passive:!0})}function M_(e){function t(s,i){s&&ct(s.ownerNode)&&i(De(s.ownerNode))}const n=[Le(CSSStyleSheet.prototype,"insertRule",({target:s,parameters:[i,o]})=>{t(s,a=>e(Ze(We.StyleSheetRule,{id:a,adds:[{rule:i,index:o}]})))}),Le(CSSStyleSheet.prototype,"deleteRule",({target:s,parameters:[i]})=>{t(s,o=>e(Ze(We.StyleSheetRule,{id:o,removes:[{index:i}]})))})];typeof CSSGroupingRule<"u"?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule));function r(s){n.push(Le(s.prototype,"insertRule",({target:i,parameters:[o,a]})=>{t(i.parentStyleSheet,c=>{const l=Ed(i);l&&(l.push(a||0),e(Ze(We.StyleSheetRule,{id:c,adds:[{rule:o,index:l}]})))})}),Le(s.prototype,"deleteRule",({target:i,parameters:[o]})=>{t(i.parentStyleSheet,a=>{const c=Ed(i);c&&(c.push(o),e(Ze(We.StyleSheetRule,{id:a,removes:[{index:c}]})))})}))}return{stop:()=>{n.forEach(s=>s.stop())}}}function Ed(e){const t=[];let n=e;for(;n.parentRule;){const o=Array.from(n.parentRule.cssRules).indexOf(n);t.unshift(o),n=n.parentRule}if(!n.parentStyleSheet)return;const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return t.unshift(s),t}function D_(e,t){return Ne(e,window,["focus","blur"],()=>{t({data:{has_focus:document.hasFocus()},type:lt.Focus,timestamp:de()})})}function F_(e,t,n){const r=e.subscribe(12,s=>{var i,o;s.rawRumEvent.type==="action"&&s.rawRumEvent.action.type==="click"&&(!((o=(i=s.rawRumEvent.action.frustration)===null||i===void 0?void 0:i.type)===null||o===void 0)&&o.length)&&"events"in s.domainContext&&s.domainContext.events&&s.domainContext.events.length&&t({timestamp:s.rawRumEvent.date,type:lt.FrustrationRecord,data:{frustrationTypes:s.rawRumEvent.action.frustration.type,recordIds:s.domainContext.events.map(a=>n.getIdForEvent(a))}})});return{stop:()=>{r.unsubscribe()}}}function B_(e,t){const n=e.subscribe(5,()=>{t({timestamp:de(),type:lt.ViewEnd})});return{stop:()=>{n.unsubscribe()}}}function Cd(e,t,n=document){const r=e.defaultPrivacyLevel,s=new WeakMap,i=n!==document,{stop:o}=Ne(e,n,i?["change"]:["input","change"],u=>{const d=gr(u);(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement)&&c(d)},{capture:!0,passive:!0});let a;if(i)a=z;else{const u=[er(HTMLInputElement.prototype,"value",c),er(HTMLInputElement.prototype,"checked",c),er(HTMLSelectElement.prototype,"value",c),er(HTMLTextAreaElement.prototype,"value",c),er(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{u.forEach(d=>d.stop())}}return{stop:()=>{a(),o()}};function c(u){const d=nt(u,r);if(d===M.HIDDEN)return;const f=u.type;let h;if(f==="radio"||f==="checkbox"){if(cs(u,d))return;h={isChecked:u.checked}}else{const g=So(u,d);if(g===void 0)return;h={text:g}}l(u,h);const p=u.name;f==="radio"&&p&&u.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(p)}"]`).forEach(g=>{g!==u&&l(g,{isChecked:!1})})}function l(u,d){if(!ct(u))return;const f=s.get(u);(!f||f.text!==d.text||f.isChecked!==d.isChecked)&&(s.set(u,d),t(Ze(We.Input,{id:De(u),...d})))}}const U_=100,$_=16;function V_(e){let t=z,n=[];function r(){t(),e(n),n=[]}const{throttled:s,cancel:i}=wt(r,$_,{leading:!1});return{addMutations:o=>{n.length===0&&(t=Oc(s,{timeout:U_})),n.push(...o)},flush:r,stop:()=>{t(),i()}}}function xd(e,t,n,r){const s=Wc();if(!s)return{stop:z,flush:z};const i=V_(a=>{z_(a.concat(o.takeRecords()),e,t,n)}),o=new s(U(i.addMutations));return o.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{o.disconnect(),i.stop()},flush:()=>{i.flush()}}}function z_(e,t,n,r){const s=new Map;e.filter(d=>d.type==="childList").forEach(d=>{d.removedNodes.forEach(f=>{Td(f,r.removeShadowRoot)})});const i=e.filter(d=>d.target.isConnected&&n_(d.target)&&nt(d.target,n.defaultPrivacyLevel,s)!==M.HIDDEN),{adds:o,removes:a,hasBeenSerialized:c}=H_(i.filter(d=>d.type==="childList"),n,r,s),l=j_(i.filter(d=>d.type==="characterData"&&!c(d.target)),n,s),u=W_(i.filter(d=>d.type==="attributes"&&!c(d.target)),n,s);!l.length&&!u.length&&!a.length&&!o.length||t(Ze(We.Mutation,{adds:o,removes:a,texts:l,attributes:u}))}function H_(e,t,n,r){const s=new Set,i=new Map;for(const f of e)f.addedNodes.forEach(h=>{s.add(h)}),f.removedNodes.forEach(h=>{s.has(h)||i.set(h,f.target),s.delete(h)});const o=Array.from(s);q_(o);const a=new Set,c=[];for(const f of o){if(u(f))continue;const h=nt(f.parentNode,t.defaultPrivacyLevel,r);if(h===M.HIDDEN||h===M.IGNORE)continue;const p=vo(f,{serializedNodeIds:a,parentNodePrivacyLevel:h,serializationContext:{status:2,shadowRootsController:n},configuration:t});if(!p)continue;const g=as(f);c.push({nextId:d(f),parentId:De(g),node:p})}const l=[];return i.forEach((f,h)=>{ct(h)&&l.push({parentId:De(f),id:De(h)})}),{adds:c,removes:l,hasBeenSerialized:u};function u(f){return ct(f)&&a.has(De(f))}function d(f){let h=f.nextSibling;for(;h;){if(ct(h))return De(h);h=h.nextSibling}return null}}function j_(e,t,n){var r;const s=[],i=new Set,o=e.filter(a=>i.has(a.target)?!1:(i.add(a.target),!0));for(const a of o){if(a.target.textContent===a.oldValue)continue;const l=nt(as(a.target),t.defaultPrivacyLevel,n);l===M.HIDDEN||l===M.IGNORE||s.push({id:De(a.target),value:(r=pl(a.target,!1,l))!==null&&r!==void 0?r:null})}return s}function W_(e,t,n){const r=[],s=new Map,i=e.filter(a=>{const c=s.get(a.target);return c&&c.has(a.attributeName)?!1:(c?c.add(a.attributeName):s.set(a.target,new Set([a.attributeName])),!0)}),o=new Map;for(const a of i){if(a.target.getAttribute(a.attributeName)===a.oldValue)continue;const l=nt(a.target,t.defaultPrivacyLevel,n),u=gd(a.target,l,a.attributeName,t);let d;if(a.attributeName==="value"){const h=So(a.target,l);if(h===void 0)continue;d=h}else typeof u=="string"?d=u:d=null;let f=o.get(a.target);f||(f={id:De(a.target),attributes:{}},r.push(f),o.set(a.target,f)),f.attributes[a.attributeName]=d}return r}function q_(e){e.sort((t,n)=>{const r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_CONTAINS||r&Node.DOCUMENT_POSITION_FOLLOWING?1:r&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function Td(e,t){os(e)&&t(e.shadowRoot),cl(e,n=>Td(n,t))}function K_(){const e=new WeakMap;return{set(t,n){t===document&&!document.scrollingElement||e.set(t===document?document.scrollingElement:t,n)},get(t){return e.get(t)},has(t){return e.has(t)}}}const G_=(e,t,n)=>{const r=new Map,s={addShadowRoot:i=>{if(r.has(i))return;const o=xd(t,e,s,i),a=Cd(e,t,i),c=vd(e,t,n,i);r.set(i,{flush:()=>o.flush(),stop:()=>{o.stop(),a.stop(),c.stop()}})},removeShadowRoot:i=>{const o=r.get(i);o&&(o.stop(),r.delete(i))},stop:()=>{r.forEach(({stop:i})=>i())},flush:()=>{r.forEach(({flush:i})=>i())}};return s};function Y_(e,t,n,r,s,i){const o=(c=de(),l={status:0,elementsScrollPositions:e,shadowRootsController:t})=>{const{width:u,height:d}=ps(),f=[{data:{height:d,href:window.location.href,width:u},type:lt.Meta,timestamp:c},{data:{has_focus:document.hasFocus()},type:lt.Focus,timestamp:c},{data:{node:C_(document,r,l),initialOffset:{left:jl(),top:Ii()}},type:lt.FullSnapshot,timestamp:c}];return window.visualViewport&&f.push({data:wd(window.visualViewport),type:lt.VisualViewport,timestamp:c}),f};i(o());const{unsubscribe:a}=n.subscribe(2,c=>{s(),i(o(c.startClocks.timeStamp,{shadowRootsController:t,status:1,elementsScrollPositions:e}))});return{stop:a}}function J_(){const e=new WeakMap;let t=1;return{getIdForEvent(n){return e.has(n)||e.set(n,t++),e.get(n)}}}function Z_(e){const{emit:t,configuration:n,lifeCycle:r}=e;if(!t)throw new Error("emit function is required");const s=f=>{t(f),ai("record",{record:f});const h=e.viewHistory.findView();_b(h.id)},i=K_(),o=G_(n,s,i),{stop:a}=Y_(i,o,r,n,c,f=>f.forEach(h=>s(h)));function c(){o.flush(),u.flush()}const l=J_(),u=xd(s,n,o,document),d=[u,R_(n,s),I_(n,s,l),vd(n,s,i,document),P_(n,s),Cd(n,s),N_(n,s),M_(s),D_(n,s),L_(n,s),F_(r,s,l),B_(r,f=>{c(),s(f)})];return{stop:()=>{o.stop(),d.forEach(f=>f.stop()),a()},flushMutations:c,shadowRootsController:o}}function X_(e,t,n){const r=new FormData;r.append("segment",new Blob([e],{type:"application/octet-stream"}),`${t.session.id}-${t.start}`);const s={raw_segment_size:n,compressed_segment_size:e.byteLength,...t},i=JSON.stringify(s);return r.append("event",new Blob([i],{type:"application/json"})),{data:r,bytesCount:e.byteLength}}function Q_({context:e,creationReason:t,encoder:n}){let r=0;const s=e.view.id,i={start:1/0,end:-1/0,creation_reason:t,records_count:0,has_full_snapshot:!1,index_in_view:wb(s),source:"browser",...e};Sb(s);function o(c,l){i.start=Math.min(i.start,c.timestamp),i.end=Math.max(i.end,c.timestamp),i.records_count+=1,i.has_full_snapshot||(i.has_full_snapshot=c.type===lt.FullSnapshot);const u=n.isEmpty?'{"records":[':",";n.write(u+JSON.stringify(c),d=>{r+=d,l(r)})}function a(c){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(i).slice(1)}
|
|
726
|
-
`),n.finish(l=>{
|
|
737
|
+
`;class i_ extends ce{constructor(n){super({tag:"div",styles:s=>s_(s)});A(this,"loadingWrapper");A(this,"componentProps");this.componentProps=n,st.registerComponent(this),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const r=new At({size:100,variant:"fetching",color:U.getStyles().primaryColor}).element;this.loadingWrapper.append(r),this.element.appendChild(this.loadingWrapper),We.trackEvent("ap_cl_astropay_payment_init"),this.createPayment()}async createPayment(){try{const{amount:n,currency:r,country:s,user:i,order:o}=this.componentProps,a={country:s.trim(),currency:r.trim(),amount:n,user:i,order:o},c=await ct.postCreatePayment(a,"astropay_payment");this.renderAstroPayMethod(c)}catch(n){const r=n;this.componentProps.onError&&this.componentProps.onError();const s=new q({text:r.message,size:12,color:U.getStyles().apErrorText}).element;this.element.appendChild(s)}finally{this.loadingWrapper.remove()}}renderAstroPayMethod(n){const{paymentExternalId:r,user:s,countries:i,benefits:o}=n;this.element.innerHTML="";const a={amount:this.componentProps.amount,currency:this.componentProps.currency},c=new fd({paymentExternalId:r,user:s,countries:i,benefits:o,paymentAmount:a,onSuccess:l=>this.showSuccessContent(l)}).element;this.element.append(c)}showSuccessContent(n){this.element.innerHTML="";const r=document.createElement("div");if(r.classList.add("payment-success-content"),n.forEach(s=>r.append(s)),this.element.append(r),We.trackEvent("ap_cl_payment_success"),this.componentProps.onSuccess){const s=document.createElement("div");s.classList.add("loading-success-callback");const i=new At({size:12,color:U.getStyles().textPrimaryColor}).element,o=new q({text:te.translate("almost_done"),size:12}).element;s.append(i,o),this.element.append(s),setTimeout(()=>{this.componentProps.onSuccess()},5e3)}}render(n){if(!n)throw new Error("Container element not found");n.appendChild(this.element)}destroy(){this.element.remove(),st.unregisterComponent(this)}}Bp();const _o=new WeakMap;function lt(e){return _o.has(e)}function o_(e){let t=e;for(;t;){if(!lt(t)&&!xi(t))return!1;t=cs(t)}return!0}function Fe(e){return _o.get(e)}function a_(e,t){_o.set(e,t)}function vo(e,t){const n=e.tagName,r=e.value;if(ls(e,t)){const s=e.type;return n==="INPUT"&&(s==="button"||s==="submit"||s==="reset")?r:!r||n==="OPTION"?void 0:xt}if(n==="OPTION"||n==="SELECT")return e.value;if(!(n!=="INPUT"&&n!=="TEXTAREA"))return r}const c_=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,l_=/^[A-Za-z]+:|^\/\//,u_=/^data:.*,/i;function d_(e,t){return e.replace(c_,(n,r,s,i,o,a)=>{const c=s||o||a;if(!t||!c||l_.test(c)||u_.test(c))return n;const l=r||i||"";return`url(${l}${f_(c,t)}${l})`})}function f_(e,t){try{return Xr(e,t).href}catch{return e}}const p_=/[^a-z1-6-_]/;function gd(e){const t=e.toLowerCase().trim();return p_.test(t)?"div":t}function md(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`}const ut={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},Yt={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},qe={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},Ze={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},bd={Play:0,Pause:1};function yd(e){if(!(e===void 0||e.length===0))return e.map(t=>{const n=t.cssRules||t.rules;return{cssRules:Array.from(n,i=>i.cssText),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}})}function wd(e,t,n,r){if(t===M.HIDDEN)return null;const s=e.getAttribute(n);if(t===M.MASK&&n!==Ti&&!vl.includes(n)&&n!==r.actionNameAttribute){const i=e.tagName;switch(n){case"title":case"alt":case"placeholder":return xt}if(i==="IMG"&&(n==="src"||n==="srcset")){const o=e;if(o.naturalWidth>0)return md(o.naturalWidth,o.naturalHeight);const{width:a,height:c}=e.getBoundingClientRect();return a>0||c>0?md(a,c):fl}if(i==="SOURCE"&&(n==="src"||n==="srcset"))return fl;if(i==="A"&&n==="href"||s&&n.startsWith("data-")||i==="IFRAME"&&n==="srcdoc")return xt}return!s||typeof s!="string"?s:rl(s)?sl(s):s}function h_(e,t,n){if(t===M.HIDDEN)return{};const r={},s=gd(e.tagName),i=e.ownerDocument;for(let u=0;u<e.attributes.length;u+=1){const f=e.attributes.item(u).name,h=wd(e,t,f,n.configuration);h!==null&&(r[f]=h)}if(e.value&&(s==="textarea"||s==="select"||s==="option"||s==="input")){const u=vo(e,t);u!==void 0&&(r.value=u)}if(s==="option"&&t===M.ALLOW){const u=e;u.selected&&(r.selected=u.selected)}if(s==="link"){const u=Array.from(i.styleSheets).find(f=>f.href===e.href),d=Eo(u);d&&u&&(r._cssText=d)}if(s==="style"&&e.sheet){const u=Eo(e.sheet);u&&(r._cssText=u)}const o=e;if(s==="input"&&(o.type==="radio"||o.type==="checkbox")&&(t===M.ALLOW?r.checked=!!o.checked:ls(o,t)&&delete r.checked),s==="audio"||s==="video"){const u=e;r.rr_mediaState=u.paused?"paused":"played"}let a,c;const l=n.serializationContext;switch(l.status){case 0:a=Math.round(e.scrollTop),c=Math.round(e.scrollLeft),(a||c)&&l.elementsScrollPositions.set(e,{scrollTop:a,scrollLeft:c});break;case 1:l.elementsScrollPositions.has(e)&&({scrollTop:a,scrollLeft:c}=l.elementsScrollPositions.get(e));break}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}function Eo(e){if(!e)return null;let t;try{t=e.rules||e.cssRules}catch{}if(!t)return null;const n=Array.from(t,th()?g_:Sd).join("");return d_(n,e.href)}function g_(e){if(b_(e)&&e.selectorText.includes(":")){const t=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return e.cssText.replace(t,"$1\\$2")}return Sd(e)}function Sd(e){return m_(e)&&Eo(e.styleSheet)||e.cssText}function m_(e){return"styleSheet"in e}function b_(e){return"selectorText"in e}function Co(e,t){const n=S_(e,t);if(!n)return null;const r=Fe(e)||w_(),s=n;return s.id=r,a_(e,r),t.serializedNodeIds&&t.serializedNodeIds.add(r),s}let y_=1;function w_(){return y_++}function xo(e,t){const n=[];return dl(e,r=>{const s=Co(r,t);s&&n.push(s)}),n}function S_(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return __(e,t);case e.DOCUMENT_FRAGMENT_NODE:return v_(e,t);case e.DOCUMENT_TYPE_NODE:return E_(e);case e.ELEMENT_NODE:return C_(e,t);case e.TEXT_NODE:return T_(e,t);case e.CDATA_SECTION_NODE:return A_()}}function __(e,t){return{type:Yt.Document,childNodes:xo(e,t),adoptedStyleSheets:yd(e.adoptedStyleSheets)}}function v_(e,t){const n=xi(e);return n&&t.serializationContext.shadowRootsController.addShadowRoot(e),{type:Yt.DocumentFragment,childNodes:xo(e,t),isShadowRoot:n,adoptedStyleSheets:n?yd(e.adoptedStyleSheets):void 0}}function E_(e){return{type:Yt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId}}function C_(e,t){const n=gd(e.tagName),r=x_(e)||void 0,s=pl(hl(e),t.parentNodePrivacyLevel);if(s===M.HIDDEN){const{width:a,height:c}=e.getBoundingClientRect();return{type:Yt.Element,tagName:n,attributes:{rr_width:`${a}px`,rr_height:`${c}px`,[Ti]:H1},childNodes:[],isSVG:r}}if(s===M.IGNORE)return;const i=h_(e,s,t);let o=[];if(z1(e)&&n!=="style"){let a;t.parentNodePrivacyLevel===s&&t.ignoreWhiteSpace===(n==="head")?a=t:a={...t,parentNodePrivacyLevel:s,ignoreWhiteSpace:n==="head"},o=xo(e,a)}return{type:Yt.Element,tagName:n,attributes:i,childNodes:o,isSVG:r}}function x_(e){return e.tagName==="svg"||e instanceof SVGElement}function T_(e,t){const n=ml(e,t.ignoreWhiteSpace||!1,t.parentNodePrivacyLevel);if(n!==void 0)return{type:Yt.Text,textContent:n}}function A_(){return{type:Yt.CDATA,textContent:""}}function R_(e,t,n){return Co(e,{serializationContext:n,parentNodePrivacyLevel:t.defaultPrivacyLevel,configuration:t})}function _d(e){return!!e.changedTouches}function mr(e){return e.composed===!0&&as(e.target)?e.composedPath()[0]:e.target}const vd=25;function k_(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>vd||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>vd}const I_=(e,t)=>{const n=window.visualViewport,r={layoutViewportX:e,layoutViewportY:t,visualViewportX:e,visualViewportY:t};if(n)k_(n)?(r.layoutViewportX=Math.round(e+n.offsetLeft),r.layoutViewportY=Math.round(t+n.offsetTop)):(r.visualViewportX=Math.round(e-n.offsetLeft),r.visualViewportY=Math.round(t-n.offsetTop));else return r;return r},Ed=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function Xe(e,t){return{data:{source:e,...t},type:ut.IncrementalSnapshot,timestamp:fe()}}const O_=50;function L_(e,t){const{throttled:n,cancel:r}=_t(i=>{const o=mr(i);if(lt(o)){const a=Cd(i);if(!a)return;const c={id:Fe(o),timeOffset:0,x:a.x,y:a.y};t(Xe(_d(i)?qe.TouchMove:qe.MouseMove,{positions:[c]}))}},O_,{trailing:!1}),{stop:s}=Me(e,document,["mousemove","touchmove"],n,{capture:!0,passive:!0});return{stop:()=>{s(),r()}}}function Cd(e){let{clientX:t,clientY:n}=_d(e)?e.changedTouches[0]:e;if(window.visualViewport){const{visualViewportX:r,visualViewportY:s}=I_(t,n);t=r,n=s}if(!Number.isFinite(t)||!Number.isFinite(n)){e.isTrusted&&ht("mouse/touch event without x/y");return}return{x:t,y:n}}const xd={pointerup:Ze.MouseUp,mousedown:Ze.MouseDown,click:Ze.Click,contextmenu:Ze.ContextMenu,dblclick:Ze.DblClick,focus:Ze.Focus,blur:Ze.Blur,touchstart:Ze.TouchStart,touchend:Ze.TouchEnd};function P_(e,t,n){const r=s=>{const i=mr(s);if(rt(i,e.defaultPrivacyLevel)===M.HIDDEN||!lt(i))return;const o=Fe(i),a=xd[s.type];let c;if(a!==Ze.Blur&&a!==Ze.Focus){const u=Cd(s);if(!u)return;c={id:o,type:a,x:u.x,y:u.y}}else c={id:o,type:a};const l={id:n.getIdForEvent(s),...Xe(qe.MouseInteraction,c)};t(l)};return Me(e,document,Object.keys(xd),r,{capture:!0,passive:!0})}const N_=100;function Td(e,t,n,r=document){const{throttled:s,cancel:i}=_t(a=>{const c=mr(a);if(!c||rt(c,e.defaultPrivacyLevel)===M.HIDDEN||!lt(c))return;const l=Fe(c),u=c===document?{scrollTop:Ii(),scrollLeft:Kl()}:{scrollTop:Math.round(c.scrollTop),scrollLeft:Math.round(c.scrollLeft)};n.set(c,u),t(Xe(qe.Scroll,{id:l,x:u.scrollLeft,y:u.scrollTop}))},N_),{stop:o}=Z(e,r,"scroll",s,{capture:!0,passive:!0});return{stop:()=>{o(),i()}}}const M_=200;function D_(e,t){const n=Gl(e).subscribe(r=>{t(Xe(qe.ViewportResize,r))});return{stop:()=>{n.unsubscribe()}}}function F_(e,t){const n=window.visualViewport;if(!n)return{stop:z};const{throttled:r,cancel:s}=_t(()=>{t({data:Ed(n),type:ut.VisualViewport,timestamp:fe()})},M_,{trailing:!1}),{stop:i}=Me(e,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),s()}}}function B_(e,t){return Me(e,document,["play","pause"],n=>{const r=mr(n);!r||rt(r,e.defaultPrivacyLevel)===M.HIDDEN||!lt(r)||t(Xe(qe.MediaInteraction,{id:Fe(r),type:n.type==="play"?bd.Play:bd.Pause}))},{capture:!0,passive:!0})}function $_(e){function t(s,i){s&<(s.ownerNode)&&i(Fe(s.ownerNode))}const n=[Ne(CSSStyleSheet.prototype,"insertRule",({target:s,parameters:[i,o]})=>{t(s,a=>e(Xe(qe.StyleSheetRule,{id:a,adds:[{rule:i,index:o}]})))}),Ne(CSSStyleSheet.prototype,"deleteRule",({target:s,parameters:[i]})=>{t(s,o=>e(Xe(qe.StyleSheetRule,{id:o,removes:[{index:i}]})))})];typeof CSSGroupingRule<"u"?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule));function r(s){n.push(Ne(s.prototype,"insertRule",({target:i,parameters:[o,a]})=>{t(i.parentStyleSheet,c=>{const l=Ad(i);l&&(l.push(a||0),e(Xe(qe.StyleSheetRule,{id:c,adds:[{rule:o,index:l}]})))})}),Ne(s.prototype,"deleteRule",({target:i,parameters:[o]})=>{t(i.parentStyleSheet,a=>{const c=Ad(i);c&&(c.push(o),e(Xe(qe.StyleSheetRule,{id:a,removes:[{index:c}]})))})}))}return{stop:()=>{n.forEach(s=>s.stop())}}}function Ad(e){const t=[];let n=e;for(;n.parentRule;){const o=Array.from(n.parentRule.cssRules).indexOf(n);t.unshift(o),n=n.parentRule}if(!n.parentStyleSheet)return;const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return t.unshift(s),t}function U_(e,t){return Me(e,window,["focus","blur"],()=>{t({data:{has_focus:document.hasFocus()},type:ut.Focus,timestamp:fe()})})}function V_(e,t,n){const r=e.subscribe(12,s=>{var i,o;s.rawRumEvent.type==="action"&&s.rawRumEvent.action.type==="click"&&(!((o=(i=s.rawRumEvent.action.frustration)===null||i===void 0?void 0:i.type)===null||o===void 0)&&o.length)&&"events"in s.domainContext&&s.domainContext.events&&s.domainContext.events.length&&t({timestamp:s.rawRumEvent.date,type:ut.FrustrationRecord,data:{frustrationTypes:s.rawRumEvent.action.frustration.type,recordIds:s.domainContext.events.map(a=>n.getIdForEvent(a))}})});return{stop:()=>{r.unsubscribe()}}}function z_(e,t){const n=e.subscribe(5,()=>{t({timestamp:fe(),type:ut.ViewEnd})});return{stop:()=>{n.unsubscribe()}}}function Rd(e,t,n=document){const r=e.defaultPrivacyLevel,s=new WeakMap,i=n!==document,{stop:o}=Me(e,n,i?["change"]:["input","change"],u=>{const d=mr(u);(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement)&&c(d)},{capture:!0,passive:!0});let a;if(i)a=z;else{const u=[tr(HTMLInputElement.prototype,"value",c),tr(HTMLInputElement.prototype,"checked",c),tr(HTMLSelectElement.prototype,"value",c),tr(HTMLTextAreaElement.prototype,"value",c),tr(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{u.forEach(d=>d.stop())}}return{stop:()=>{a(),o()}};function c(u){const d=rt(u,r);if(d===M.HIDDEN)return;const f=u.type;let h;if(f==="radio"||f==="checkbox"){if(ls(u,d))return;h={isChecked:u.checked}}else{const g=vo(u,d);if(g===void 0)return;h={text:g}}l(u,h);const p=u.name;f==="radio"&&p&&u.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(p)}"]`).forEach(g=>{g!==u&&l(g,{isChecked:!1})})}function l(u,d){if(!lt(u))return;const f=s.get(u);(!f||f.text!==d.text||f.isChecked!==d.isChecked)&&(s.set(u,d),t(Xe(qe.Input,{id:Fe(u),...d})))}}const H_=100,j_=16;function W_(e){let t=z,n=[];function r(){t(),e(n),n=[]}const{throttled:s,cancel:i}=_t(r,j_,{leading:!1});return{addMutations:o=>{n.length===0&&(t=Nc(s,{timeout:H_})),n.push(...o)},flush:r,stop:()=>{t(),i()}}}function kd(e,t,n,r){const s=Gc();if(!s)return{stop:z,flush:z};const i=W_(a=>{q_(a.concat(o.takeRecords()),e,t,n)}),o=new s($(i.addMutations));return o.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{o.disconnect(),i.stop()},flush:()=>{i.flush()}}}function q_(e,t,n,r){const s=new Map;e.filter(d=>d.type==="childList").forEach(d=>{d.removedNodes.forEach(f=>{Id(f,r.removeShadowRoot)})});const i=e.filter(d=>d.target.isConnected&&o_(d.target)&&rt(d.target,n.defaultPrivacyLevel,s)!==M.HIDDEN),{adds:o,removes:a,hasBeenSerialized:c}=K_(i.filter(d=>d.type==="childList"),n,r,s),l=G_(i.filter(d=>d.type==="characterData"&&!c(d.target)),n,s),u=Y_(i.filter(d=>d.type==="attributes"&&!c(d.target)),n,s);!l.length&&!u.length&&!a.length&&!o.length||t(Xe(qe.Mutation,{adds:o,removes:a,texts:l,attributes:u}))}function K_(e,t,n,r){const s=new Set,i=new Map;for(const f of e)f.addedNodes.forEach(h=>{s.add(h)}),f.removedNodes.forEach(h=>{s.has(h)||i.set(h,f.target),s.delete(h)});const o=Array.from(s);J_(o);const a=new Set,c=[];for(const f of o){if(u(f))continue;const h=rt(f.parentNode,t.defaultPrivacyLevel,r);if(h===M.HIDDEN||h===M.IGNORE)continue;const p=Co(f,{serializedNodeIds:a,parentNodePrivacyLevel:h,serializationContext:{status:2,shadowRootsController:n},configuration:t});if(!p)continue;const g=cs(f);c.push({nextId:d(f),parentId:Fe(g),node:p})}const l=[];return i.forEach((f,h)=>{lt(h)&&l.push({parentId:Fe(f),id:Fe(h)})}),{adds:c,removes:l,hasBeenSerialized:u};function u(f){return lt(f)&&a.has(Fe(f))}function d(f){let h=f.nextSibling;for(;h;){if(lt(h))return Fe(h);h=h.nextSibling}return null}}function G_(e,t,n){var r;const s=[],i=new Set,o=e.filter(a=>i.has(a.target)?!1:(i.add(a.target),!0));for(const a of o){if(a.target.textContent===a.oldValue)continue;const l=rt(cs(a.target),t.defaultPrivacyLevel,n);l===M.HIDDEN||l===M.IGNORE||s.push({id:Fe(a.target),value:(r=ml(a.target,!1,l))!==null&&r!==void 0?r:null})}return s}function Y_(e,t,n){const r=[],s=new Map,i=e.filter(a=>{const c=s.get(a.target);return c&&c.has(a.attributeName)?!1:(c?c.add(a.attributeName):s.set(a.target,new Set([a.attributeName])),!0)}),o=new Map;for(const a of i){if(a.target.getAttribute(a.attributeName)===a.oldValue)continue;const l=rt(a.target,t.defaultPrivacyLevel,n),u=wd(a.target,l,a.attributeName,t);let d;if(a.attributeName==="value"){const h=vo(a.target,l);if(h===void 0)continue;d=h}else typeof u=="string"?d=u:d=null;let f=o.get(a.target);f||(f={id:Fe(a.target),attributes:{}},r.push(f),o.set(a.target,f)),f.attributes[a.attributeName]=d}return r}function J_(e){e.sort((t,n)=>{const r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_CONTAINS||r&Node.DOCUMENT_POSITION_FOLLOWING?1:r&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function Id(e,t){as(e)&&t(e.shadowRoot),dl(e,n=>Id(n,t))}function Z_(){const e=new WeakMap;return{set(t,n){t===document&&!document.scrollingElement||e.set(t===document?document.scrollingElement:t,n)},get(t){return e.get(t)},has(t){return e.has(t)}}}const X_=(e,t,n)=>{const r=new Map,s={addShadowRoot:i=>{if(r.has(i))return;const o=kd(t,e,s,i),a=Rd(e,t,i),c=Td(e,t,n,i);r.set(i,{flush:()=>o.flush(),stop:()=>{o.stop(),a.stop(),c.stop()}})},removeShadowRoot:i=>{const o=r.get(i);o&&(o.stop(),r.delete(i))},stop:()=>{r.forEach(({stop:i})=>i())},flush:()=>{r.forEach(({flush:i})=>i())}};return s};function Q_(e,t,n,r,s,i){const o=(c=fe(),l={status:0,elementsScrollPositions:e,shadowRootsController:t})=>{const{width:u,height:d}=hs(),f=[{data:{height:d,href:window.location.href,width:u},type:ut.Meta,timestamp:c},{data:{has_focus:document.hasFocus()},type:ut.Focus,timestamp:c},{data:{node:R_(document,r,l),initialOffset:{left:Kl(),top:Ii()}},type:ut.FullSnapshot,timestamp:c}];return window.visualViewport&&f.push({data:Ed(window.visualViewport),type:ut.VisualViewport,timestamp:c}),f};i(o());const{unsubscribe:a}=n.subscribe(2,c=>{s(),i(o(c.startClocks.timeStamp,{shadowRootsController:t,status:1,elementsScrollPositions:e}))});return{stop:a}}function ev(){const e=new WeakMap;let t=1;return{getIdForEvent(n){return e.has(n)||e.set(n,t++),e.get(n)}}}function tv(e){const{emit:t,configuration:n,lifeCycle:r}=e;if(!t)throw new Error("emit function is required");const s=f=>{t(f),ci("record",{record:f});const h=e.viewHistory.findView();xy(h.id)},i=Z_(),o=X_(n,s,i),{stop:a}=Q_(i,o,r,n,c,f=>f.forEach(h=>s(h)));function c(){o.flush(),u.flush()}const l=ev(),u=kd(s,n,o,document),d=[u,L_(n,s),P_(n,s,l),Td(n,s,i,document),D_(n,s),Rd(n,s),B_(n,s),$_(s),U_(n,s),F_(n,s),V_(r,s,l),z_(r,f=>{c(),s(f)})];return{stop:()=>{o.stop(),d.forEach(f=>f.stop()),a()},flushMutations:c,shadowRootsController:o}}function nv(e,t,n){const r=new FormData;r.append("segment",new Blob([e],{type:"application/octet-stream"}),`${t.session.id}-${t.start}`);const s={raw_segment_size:n,compressed_segment_size:e.byteLength,...t},i=JSON.stringify(s);return r.append("event",new Blob([i],{type:"application/json"})),{data:r,bytesCount:e.byteLength}}function rv({context:e,creationReason:t,encoder:n}){let r=0;const s=e.view.id,i={start:1/0,end:-1/0,creation_reason:t,records_count:0,has_full_snapshot:!1,index_in_view:Ey(s),source:"browser",...e};Cy(s);function o(c,l){i.start=Math.min(i.start,c.timestamp),i.end=Math.max(i.end,c.timestamp),i.records_count+=1,i.has_full_snapshot||(i.has_full_snapshot=c.type===ut.FullSnapshot);const u=n.isEmpty?'{"records":[':",";n.write(u+JSON.stringify(c),d=>{r+=d,l(r)})}function a(c){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(i).slice(1)}
|
|
738
|
+
`),n.finish(l=>{Ty(i.view.id,l.rawBytesCount),c(i,l)})}return{addRecord:o,flush:a}}const sv=5*_e;let Od=6e4;function iv(e,t,n,r,s,i){return ov(e,()=>av(t.applicationId,n,r),s,i)}function ov(e,t,n,r){let s={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:i}=e.subscribe(2,()=>{a("view_change")}),{unsubscribe:o}=e.subscribe(11,c=>{a(c.reason)});function a(c){s.status===1&&(s.segment.flush((l,u)=>{const d=nv(u.output,l,u.rawBytesCount);Oc(c)?n.sendOnExit(d):n.send(d)}),Pe(s.expirationTimeoutId)),c!=="stop"?s={status:0,nextSegmentCreationReason:c}:s={status:2}}return{addRecord:c=>{if(s.status!==2){if(s.status===0){const l=t();if(!l)return;s={status:1,segment:rv({encoder:r,context:l,creationReason:s.nextSegmentCreationReason}),expirationTimeoutId:pe(()=>{a("segment_duration_limit")},sv)}}s.segment.addRecord(c,l=>{l>Od&&a("segment_bytes_limit")})}},stop:()=>{a("stop"),i(),o()}}}function av(e,t,n){const r=t.findTrackedSession(),s=n.findView();if(!(!r||!s))return{application:{id:e},session:{id:r.id},view:{id:s.id}}}function cv(e){const t=mn();return{addRecord:n=>{const r=e.findView();t.send("record",n,r.id)}}}function lv(e,t,n,r,s,i){const o=[],a=d=>{e.notify(14,{error:d}),ht("Error reported to customer",{"error.message":d.message})},c=i||Rc(t.sessionReplayEndpointBuilder,Od,a);let l;if(Ht())({addRecord:l}=cv(r));else{const d=iv(e,t,n,r,c,s);l=d.addRecord,o.push(d.stop)}const{stop:u}=tv({emit:l,configuration:t,lifeCycle:e,viewHistory:r});return o.push(u),{stop:()=>{o.forEach(d=>d())}}}const uv=Object.freeze(Object.defineProperty({__proto__:null,startRecording:lv},Symbol.toStringTag,{value:"Module"}));function dv(e){let t=0;for(const n of e)n.stackId!==void 0&&t++;return t}const br=new Map;let On=!1;function fv(){On=performance.now()}function pv(){On=!1,br.clear()}function hv(e,t){br.set(t,e)}function Ld(e){if(!(On===!1||e.startTime<On))return br.get(e.startTime)}function gv(e){if(!(On===!1||e<On))for(const t of br.keys())t<e&&br.delete(t)}function mv({rawRumEvent:e,startTime:t}){if(e.type!=="long_task")return;const n=e.long_task.id;hv(n,t)}const bv=(e,t,n,r)=>{const s=yv(e,t,n,r),i=Sv(e,s),o=t.build("fetch",i);return ht("Sending profile to public profiling intake",{profilingIntakeURL:o,applicationId:n,sessionId:r}),fetch(o,{body:i.data,method:"POST"})};function yv(e,t,n,r){const s=t.tags,i=_v(e,n,r),o=wv(s),a=new Date(e.timeOrigin+e.startTime),c=new Date(e.timeOrigin+e.endTime);return{...i,attachments:["wall-time.json"],start:a.toISOString(),end:c.toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:o.join(",")}}function wv(e){return e.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"])}function Sv(e,t){const n=new Blob([JSON.stringify(e)],{type:"application/json"}),r=new FormData;return r.append("event",new Blob([JSON.stringify(t)],{type:"application/json"}),"event.json"),r.append("wall-time.json",n,"wall-time.json"),{data:r,bytesCount:0}}function _v(e,t,n){const r={application:{id:t}};n&&(r.session={id:n});const s=Array.from(new Set(e.views.map(o=>o.viewId)));s.length&&(r.view={id:s});const i=e.longTasks.map(o=>Ld(o)).filter(o=>o!==void 0);return i.length&&(r.long_task={id:i}),r}const vv={sendProfile:bv},Pd={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3,minNumberOfSamples:50};function Ev(e,t,n,r=Pd){const s=Wt(H.LONG_ANIMATION_FRAME);let i;const o=[];let a={state:"stopped"};function c(x){a.state!=="running"&&(i=x?{startTime:x.startClocks.relative,viewId:x.id,viewName:x.name}:void 0,o.push(Z(e,window,"visibilitychange",y).stop,Z(e,window,"beforeunload",_).stop),d())}async function l(){await h("stopped"),pv(),o.forEach(x=>x())}function u(x){if(x.state==="running")return{cleanupTasks:x.cleanupTasks,observer:x.observer};const I=[];let R;if(e.trackLongTasks){R=new PerformanceObserver(w),R.observe({entryTypes:[O()]});const P=t.subscribe(12,N=>{mv(N)});fv(),I.push(()=>R==null?void 0:R.disconnect()),I.push(P.unsubscribe)}const L=t.subscribe(2,P=>{p({viewId:P.id,viewName:P.name,startTime:P.startClocks.relative})});return I.push(L.unsubscribe),{cleanupTasks:I,observer:R}}function d(){const x=tt().Profiler;if(!x)throw new Error("RUM Profiler is not supported in this browser.");f(a).catch(pt);const{cleanupTasks:I,observer:R}=u(a);let L;try{L=new x({sampleInterval:r.sampleIntervalMs,maxBufferSize:Math.round(r.collectIntervalMs*1.5/r.sampleIntervalMs)})}catch(P){V.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",P);return}a={state:"running",startTime:performance.now(),profiler:L,timeoutId:pe(d,r.collectIntervalMs),longTasks:[],views:[],cleanupTasks:I,observer:R},p(i),L.addEventListener("samplebufferfull",m)}async function f(x){var I,R;if(x.state!=="running")return;v((R=(I=x.observer)===null||I===void 0?void 0:I.takeRecords())!==null&&R!==void 0?R:[]),Pe(x.timeoutId),x.profiler.removeEventListener("samplebufferfull",m);const{startTime:L,longTasks:P,views:N}=x,Q=performance.now();await x.profiler.stop().then(me=>{const Ve=performance.now(),Ke=P.length>0,X=Ve-L<r.minProfileDurationMs,re=dv(me.samples)<r.minNumberOfSamples;!Ke&&(X||re)||(g(Object.assign(me,{startTime:L,endTime:Ve,timeOrigin:performance.timeOrigin,longTasks:P,views:N,sampleInterval:r.sampleIntervalMs})),gv(Q))}).catch(pt)}async function h(x){a.state==="running"&&(a.cleanupTasks.forEach(I=>I()),await f(a),a={state:x})}function p(x){a.state!=="running"||!x||a.views.push(x)}function g(x){var I;const R=(I=n.findTrackedSession())===null||I===void 0?void 0:I.id;vv.sendProfile(x,e.profilingEndpointBuilder,e.applicationId,R).catch(pt)}function m(){d()}function w(x){v(x.getEntries())}function v(x){if(a.state==="running")for(const I of x)I.duration<r.sampleIntervalMs||a.longTasks.push({id:Ld(I),duration:I.duration,entryType:I.entryType,startTime:I.startTime})}function y(){document.visibilityState==="hidden"&&a.state==="running"?h("paused").catch(pt):document.visibilityState==="visible"&&a.state==="paused"&&d()}function _(){d()}function O(){return s?"long-animation-frame":"longtask"}function T(){return a.state==="stopped"}function b(){return a.state==="running"}function k(){return a.state==="paused"}return{start:c,stop:l,isStopped:T,isRunning:b,isPaused:k}}const Cv=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_RUM_PROFILER_CONFIGURATION:Pd,createRumProfiler:Ev},Symbol.toStringTag,{value:"Module"}));Ce.AstroPayCore=st,Ce.AstroPayFullCheckout=r_,Ce.AstroPayPayment=i_,Ce.Core=st,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})});
|