@letscooee/web-sdk 12.1.4 → 12.1.5
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/{chunk-AHUK45BO.js → chunk-3LUZ3CSI.js} +1 -1
- package/dist/{chunk-WMTHGLS4.js → chunk-B2UHLONW.js} +1 -1
- package/dist/{chunk-J3Z52YAC.js → chunk-FIRKHNUB.js} +2 -2
- package/dist/main.min.js +3 -3
- package/dist/{share-dialog.component-IWMMENXS.js → share-dialog.component-L2VKZIQS.js} +1 -1
- package/dist/{video-detail-dialog.component-CNC2276R.js → video-detail-dialog.component-LP5FCSFX.js} +1 -1
- package/dist/widget.min.js +2 -2
- package/package.json +1 -1
package/dist/main.min.js
CHANGED
|
@@ -7,7 +7,7 @@ import{a as _,b as Z,c as No,d as Im,e as Oo,f as xr,g as wi}from"./chunk-V7UGKY
|
|
|
7
7
|
|
|
8
8
|
`+ne.message+`
|
|
9
9
|
`+Array(ne.message.length+1).join("=")+`
|
|
10
|
-
`+T(A,U)):ne}}function Ft(A,R){var $;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):($=typeof A=="function"?A:et(A,R),R.cache&&R.name&&R.storage.templates.define(R.name,$),$)}Ae.l.bind(Ae),t.compile=et,t.compileScope=P,t.compileScopeIntoFunction=G,t.compileToString=T,t.defaultConfig=Ae,t.filters=Te,t.getConfig=qe,t.helpers=fe,t.nativeHelpers=Be,t.parse=y,t.render=function(A,R,$,U){var H=qe($||{});if(!H.async)return Ft(A,H)(R,H);if(!U){if(typeof n=="function")return new n(function(ne,he){try{ne(Ft(A,H)(R,H))}catch(Ke){he(Ke)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Ft(A,H)(R,H,U)}catch(ne){return U(ne)}},t.templates=se,Object.defineProperty(t,"__esModule",{value:!0})})});var iu="12.1.
|
|
10
|
+
`+T(A,U)):ne}}function Ft(A,R){var $;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):($=typeof A=="function"?A:et(A,R),R.cache&&R.name&&R.storage.templates.define(R.name,$),$)}Ae.l.bind(Ae),t.compile=et,t.compileScope=P,t.compileScopeIntoFunction=G,t.compileToString=T,t.defaultConfig=Ae,t.filters=Te,t.getConfig=qe,t.helpers=fe,t.nativeHelpers=Be,t.parse=y,t.render=function(A,R,$,U){var H=qe($||{});if(!H.async)return Ft(A,H)(R,H);if(!U){if(typeof n=="function")return new n(function(ne,he){try{ne(Ft(A,H)(R,H))}catch(Ke){he(Ke)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Ft(A,H)(R,H,U)}catch(ne){return U(ne)}},t.templates=se,Object.defineProperty(t,"__esModule",{value:!0})})});var iu="12.1.5";var Qv=iu.split("-")[0].split(".").slice(0,3).map(t=>t.padStart(2,"0")).join(""),Ys="WEB",Tm="CooeeSDK",Cr=iu,xm=parseInt(Qv,10);var Cm=["collection","product","cart"],Rm=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],Am=["View Item","View Cart","View Collection"];var Ks=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Cr}/dist`,Gt={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:Ks,styleURL:`${Ks}/widget.min.css`,widgetURL:`${Ks}/widget.min.js`,swiperStyleURL:`${Ks}/swiper-bundle.min.css`};var zt=xr(Si());var b=class{static debuggerEl;static infoLogs=[];static log(...e){zt.default.info(...e)}static verbose(...e){zt.default.debug(...e)}static error(...e){zt.default.error(...e)}static warn(...e){zt.default.warn(...e)}static info(...e){zt.default.info(...e),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){zt.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function Nm(t=Tm){zt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${Cr}):`)}});let e=ou();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?zt.default.setLevel(zt.default[localStorage.cooeeLogLevel]):zt.default.setLevel(Gt.debug?zt.default.TRACE:zt.default.OFF)}function ou(){return new URL(location.href).searchParams?.get("cooee-debug")}function Om(){let t=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),e=`
|
|
11
11
|
`;e+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
|
|
12
12
|
`,e+=`\u{1F50D} Track real-time visitor intent & optimize engagement
|
|
13
13
|
`,e+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
|
|
@@ -28,7 +28,7 @@ Event: ${Dr(t)}`),!0;if(N_(t,e.denyUrls))return oe&&ee.warn(`Event dropped due t
|
|
|
28
28
|
Event: ${Dr(t)}.
|
|
29
29
|
Url: ${Oa(t)}`),!0;if(!O_(t,e.allowUrls))return oe&&ee.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
30
30
|
Event: ${Dr(t)}.
|
|
31
|
-
Url: ${Oa(t)}`),!0}return!1}function A_(t,e){return e?.length?Ra(t).some(r=>Di(r,e)):!1}function D_(t,e){if(!e?.length)return!1;let r=t.transaction;return r?Di(r,e):!1}function N_(t,e){if(!e?.length)return!1;let r=Oa(t);return r?Di(r,e):!1}function O_(t,e){if(!e?.length)return!0;let r=Oa(t);return r?Di(r,e):!0}function P_(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Oa(t){try{let r=[...t.exception?.values??[]].reverse().find(n=>n.mechanism?.parent_id===void 0&&n.stacktrace?.frames?.length)?.stacktrace?.frames;return r?P_(r):null}catch{return oe&&ee.error(`Cannot extract url for event ${Dr(t)}`),null}}function L_(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function pp(t,e,r,n,i,o){if(!i.exception?.values||!o||!vr(o.originalException,Error))return;let s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=up(t,e,n,o.originalException,r,i.exception.values,s,0))}function up(t,e,r,n,i,o,s,a){if(o.length>=r+1)return o;let c=[...o];if(vr(n[i],Error)){oh(s,a);let p=t(e,n[i]),d=c.length;sh(p,i,d,a),c=up(t,e,r,n[i],i,[p,...c],p,d)}return Array.isArray(n.errors)&&n.errors.forEach((p,d)=>{if(vr(p,Error)){oh(s,a);let f=t(e,p),E=c.length;sh(f,`errors[${d}]`,E,a),c=up(t,e,r,p,i,[f,...c],f,E)}}),c}function oh(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(_(_({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function sh(t,e,r,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(_({},t.mechanism),{type:"chained",source:e,exception_id:r,parent_id:n})}function fp(t){let e="console";Lt(e,t),Mt(e,M_)}function M_(){"console"in pe&&vu.forEach(function(t){t in pe.console&&pt(pe.console,t,function(e){return Ci[t]=e,function(...r){ut("console",{args:r,level:t}),Ci[t]?.apply(pe.console,r)}})})}function mp(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var B_="Dedupe",k_=()=>{let t;return{name:B_,processEvent(e){if(e.type)return e;try{if(U_(e,t))return oe&&ee.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},La=k_;function U_(t,e){return e?!!(F_(t,e)||H_(t,e)):!1}function F_(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!lh(t,e)||!ch(t,e))}function H_(t,e){let r=ah(e),n=ah(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!lh(t,e)||!ch(t,e))}function ch(t,e){let r=aa(t),n=aa(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let o=n[i],s=r[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function lh(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function ah(t){return t.exception?.values?.[0]}function Jo(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}function Ma(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var Qo=pe;function dp(){return"history"in Qo&&!!Qo.history}function V_(){if(!("fetch"in Qo))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Zo(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function hp(){if(typeof EdgeRuntime=="string")return!0;if(!V_())return!1;if(Zo(Qo.fetch))return!0;let t=!1,e=Qo.document;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow?.fetch&&(t=Zo(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){oe&&ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function yp(t,e){let r="fetch";Lt(r,t),Mt(r,()=>$_(void 0,e))}function $_(t,e=!1){e&&!hp()||pt(pe,"fetch",function(r){return function(...n){let i=new Error,{method:o,url:s}=W_(n),a={args:n,fetchData:{method:o,url:s},startTimestamp:Ht()*1e3,virtualError:i,headers:j_(n)};return t||ut("fetch",_({},a)),r.apply(pe,n).then(async c=>(t?t(c):ut("fetch",Z(_({},a),{endTimestamp:Ht()*1e3,response:c})),c),c=>{if(ut("fetch",Z(_({},a),{endTimestamp:Ht()*1e3,error:c})),zn(c)&&c.stack===void 0&&(c.stack=i.stack,qt(c,"framesToPop",1)),c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{let p=new URL(a.fetchData.url);c.message=`${c.message} (${p.host})`}catch{}throw c})}})}function gp(t,e){return!!t&&typeof t=="object"&&!!t[e]}function uh(t){return typeof t=="string"?t:t?gp(t,"url")?t.url:t.toString?t.toString():"":""}function W_(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[r,n]=t;return{url:uh(r),method:gp(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:uh(e),method:gp(e,"method")?String(e.method).toUpperCase():"GET"}}function j_(t){let[e,r]=t;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(Km(e))return new Headers(e.headers)}catch{}}function vp(){return"npm"}var Je=pe,Ep=0;function _p(){return Ep>0}function ib(){Ep++,setTimeout(()=>{Ep--})}function Xn(t,e={}){function r(i){return typeof i=="function"}if(!r(t))return t;try{let i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(Kn(t))return t}catch{return t}let n=function(...i){try{let o=i.map(s=>Xn(s,e));return t.apply(this,o)}catch(o){throw ib(),jo(s=>{s.addEventProcessor(a=>(e.mechanism&&(Ni(a,void 0,void 0),Nr(a,e.mechanism)),a.extra=Z(_({},a.extra),{arguments:i}),a)),Ta(o)}),o}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}fa(n,t),qt(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function ph(){let t=Wo(),{referrer:e}=Je.document||{},{userAgent:r}=Je.navigator||{},n=_(_({},e&&{Referer:e}),r&&{"User-Agent":r});return{url:t,headers:n}}function Ba(t,e){let r=Sp(t,e),n={type:lb(e),value:ub(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function ob(t,e,r,n){let o=Ge()?.getOptions().normalizeDepth,s=mb(e),a={__serialized__:_a(e,o)};if(s)return{exception:{values:[Ba(t,s)]},extra:a};let c={exception:{values:[{type:Yn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:pb(e,{isUnhandledRejection:n})}]},extra:a};if(r){let p=Sp(t,r);p.length&&(c.exception.values[0].stacktrace={frames:p})}return c}function bp(t,e){return{exception:{values:[Ba(t,e)]}}}function Sp(t,e){let r=e.stacktrace||e.stack||"",n=ab(e),i=cb(e);try{return t(r,n,i)}catch{}return[]}var sb=/Minified React error #\d+;/i;function ab(t){return t&&sb.test(t.message)?1:0}function cb(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function fh(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function lb(t){let e=t?.name;return!e&&fh(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function ub(t){let e=t?.message;return fh(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function mh(t,e,r,n){let i=r?.syntheticException||void 0,o=ka(t,e,i,n);return Nr(o),o.level="error",r?.event_id&&(o.event_id=r.event_id),or(o)}function dh(t,e,r="info",n,i){let o=n?.syntheticException||void 0,s=wp(t,e,o,i);return s.level=r,n?.event_id&&(s.event_id=n.event_id),or(s)}function ka(t,e,r,n,i){let o;if(la(e)&&e.error)return bp(t,e.error);if(ua(e)||Cu(e)){let s=e;if("stack"in e)o=bp(t,e);else{let a=s.name||(ua(s)?"DOMError":"DOMException"),c=s.message?`${a}: ${s.message}`:a;o=wp(t,c,r,n),Ni(o,c)}return"code"in s&&(o.tags=Z(_({},o.tags),{"DOMException.code":`${s.code}`})),o}return zn(e)?bp(t,e):nn(e)||Yn(e)?(o=ob(t,e,r,i),Nr(o,{synthetic:!0}),o):(o=wp(t,e,r,n),Ni(o,`${e}`,void 0),Nr(o,{synthetic:!0}),o)}function wp(t,e,r,n){let i={};if(n&&r){let o=Sp(t,r);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]}),Nr(i,{synthetic:!0})}if(Ai(e)){let{__sentry_template_string__:o,__sentry_template_values__:s}=e;return i.logentry={message:o,params:s},i}return i.message=e,i}function pb(t,{isUnhandledRejection:e}){let r=Pu(t),n=e?"promise rejection":"exception";return la(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:Yn(t)?`Event \`${fb(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function fb(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function mb(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}var db=5e3,es=class extends Ko{constructor(e){let r=hb(e),n=Je.SENTRY_SDK_SOURCE||vp();cp(r,"browser",["browser"],n),super(r);let{sendDefaultPii:i,sendClientReports:o,enableLogs:s,_experiments:a}=this._options,c=s??a?.enableLogs;Je.document&&(o||c)&&Je.document.addEventListener("visibilitychange",()=>{Je.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),c&&Xo(this))}),c&&(this.on("flush",()=>{Xo(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{Xo(this)},db)})),i&&(this.on("postprocessEvent",sp),this.on("beforeSendSession",ap))}eventFromException(e,r){return mh(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return dh(this._options.stackParser,e,r,n,this._options.attachStacktrace)}_prepareEvent(e,r,n,i){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n,i)}};function hb(t){return _({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Je.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},t)}var hh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var mt=pe;var gb=1e3,gh,Ip,Tp;function xp(t){Lt("dom",t),Mt("dom",yb)}function yb(){if(!mt.document)return;let t=ut.bind(null,"dom"),e=yh(t,!0);mt.document.addEventListener("click",e,!1),mt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let i=mt[r]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(pt(i,"addEventListener",function(o){return function(s,a,c){if(s==="click"||s=="keypress")try{let p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=p[s]=p[s]||{refCount:0};if(!d.handler){let f=yh(t);d.handler=f,o.call(this,s,f,c)}d.refCount++}catch{}return o.call(this,s,a,c)}}),pt(i,"removeEventListener",function(o){return function(s,a,c){if(s==="click"||s=="keypress")try{let p=this.__sentry_instrumentation_handlers__||{},d=p[s];d&&(d.refCount--,d.refCount<=0&&(o.call(this,s,d.handler,c),d.handler=void 0,delete p[s]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return o.call(this,s,a,c)}}))})}function vb(t){if(t.type!==Ip)return!1;try{if(!t.target||t.target._sentryId!==Tp)return!1}catch{}return!0}function Eb(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function yh(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=_b(r);if(Eb(r.type,n))return;qt(r,"_sentryCaptured",!0),n&&!n._sentryId&&qt(n,"_sentryId",ft());let i=r.type==="keypress"?"input":r.type;vb(r)||(t({event:r,name:i,global:e}),Ip=r.type,Tp=n?n._sentryId:void 0),clearTimeout(gh),gh=mt.setTimeout(()=>{Tp=void 0,Ip=void 0},gb)}}function _b(t){try{return t.target}catch{return null}}var Ua;function ts(t){let e="history";Lt(e,t),Mt(e,bb)}function bb(){if(mt.addEventListener("popstate",()=>{let e=mt.location.href,r=Ua;if(Ua=e,r===e)return;ut("history",{from:r,to:e})}),!dp())return;function t(e){return function(...r){let n=r.length>2?r[2]:void 0;if(n){let i=Ua,o=wb(String(n));if(Ua=o,i===o)return e.apply(this,r);ut("history",{from:i,to:o})}return e.apply(this,r)}}pt(mt.history,"pushState",t),pt(mt.history,"replaceState",t)}function wb(t){try{return new URL(t,mt.location.origin).toString()}catch{return t}}var Fa={};function Cp(t){let e=Fa[t];if(e)return e;let r=mt[t];if(Zo(r))return Fa[t]=r.bind(mt);let n=mt.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let o=i.contentWindow;o?.[t]&&(r=o[t]),n.head.removeChild(i)}catch(i){hh&&ee.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(Fa[t]=r.bind(mt))}function Ha(t){Fa[t]=void 0}var Jn="__sentry_xhr_v3__";function Rp(t){Lt("xhr",t),Mt("xhr",Sb)}function Sb(){if(!mt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,r,n){let i=new Error,o=Ht()*1e3,s=Bt(n[0])?n[0].toUpperCase():void 0,a=Ib(n[1]);if(!s||!a)return e.apply(r,n);r[Jn]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(r.__sentry_own_request__=!0);let c=()=>{let p=r[Jn];if(p&&r.readyState===4){try{p.status_code=r.status}catch{}let d={endTimestamp:Ht()*1e3,startTimestamp:o,xhr:r,virtualError:i};ut("xhr",d)}};return"onreadystatechange"in r&&typeof r.onreadystatechange=="function"?r.onreadystatechange=new Proxy(r.onreadystatechange,{apply(p,d,f){return c(),p.apply(d,f)}}):r.addEventListener("readystatechange",c),r.setRequestHeader=new Proxy(r.setRequestHeader,{apply(p,d,f){let[E,y]=f,T=d[Jn];return T&&Bt(E)&&Bt(y)&&(T.request_headers[E.toLowerCase()]=y),p.apply(d,f)}}),e.apply(r,n)}}),t.send=new Proxy(t.send,{apply(e,r,n){let i=r[Jn];if(!i)return e.apply(r,n);n[0]!==void 0&&(i.body=n[0]);let o={startTimestamp:Ht()*1e3,xhr:r};return ut("xhr",o),e.apply(r,n)}})}function Ib(t){if(Bt(t))return t;try{return t.toString()}catch{}}function Ap(t,e=Cp("fetch")){let r=0,n=0;function i(o){let s=o.body.length;r+=s,n++;let a=_({body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return Ha("fetch"),Sn("No fetch implementation available");try{return e(t.url,a).then(c=>(r-=s,n--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return Ha("fetch"),r-=s,n--,Sn(c)}}return Da(t,i)}var Tb=30;var xb=50;function Dp(t,e,r,n){let i={filename:t,function:e==="<anonymous>"?"?":e,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var Cb=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Rb=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ab=/\((\S*)(?::(\d+))(?::(\d+))\)/,Db=t=>{let e=Cb.exec(t);if(e){let[,n,i,o]=e;return Dp(n,"?",+i,+o)}let r=Rb.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=Ab.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[i,o]=bh(r[1]||"?",r[2]);return Dp(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},vh=[Tb,Db],Nb=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ob=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pb=t=>{let e=Nb.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let o=Ob.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let n=e[3],i=e[1]||"?";return[i,n]=bh(i,n),Dp(n,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Eh=[xb,Pb];var _h=[vh,Eh],Np=wu(..._h),bh=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:"?",r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Mi=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Va=1024,Lb="Breadcrumbs",Mb=(t={})=>{let e=_({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:Lb,setup(r){e.console&&fp(Ub(r)),e.dom&&xp(kb(r,e.dom)),e.xhr&&Rp(Fb(r)),e.fetch&&yp(Hb(r)),e.history&&ts(Vb(r)),e.sentry&&r.on("beforeSendEvent",Bb(r))}}},wh=Mb;function Bb(t){return function(r){Ge()===t&&Lr({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:Dr(r)},{event:r})}}function kb(t,e){return function(n){if(Ge()!==t)return;let i,o,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Va&&(Mi&&ee.warn(`\`dom.maxStringLength\` cannot exceed ${Va}, but a value of ${a} was configured. Sentry will use ${Va} instead.`),a=Va),typeof s=="string"&&(s=[s]);try{let p=n.event,d=$b(p)?p.target:p;i=$o(d,{keyAttrs:s,maxStringLength:a}),o=Ou(d)}catch{i="<unknown>"}if(i.length===0)return;let c={category:`ui.${n.name}`,message:i};o&&(c.data={"ui.component_name":o}),Lr(c,{event:n.event,name:n.name,global:n.global})}}function Ub(t){return function(r){if(Ge()!==t)return;let n={category:"console",data:{arguments:r.args,logger:"console"},level:mp(r.level),message:pa(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${pa(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;Lr(n,{input:r.args,level:r.level})}}function Fb(t){return function(r){if(Ge()!==t)return;let{startTimestamp:n,endTimestamp:i}=r,o=r.xhr[Jn];if(!n||!i||!o)return;let{method:s,url:a,status_code:c,body:p}=o,d={method:s,url:a,status_code:c},f={xhr:r.xhr,input:p,startTimestamp:n,endTimestamp:i},E={category:"xhr",data:d,type:"http",level:Ma(c)};t.emit("beforeOutgoingRequestBreadcrumb",E,f),Lr(E,f)}}function Hb(t){return function(r){if(Ge()!==t)return;let{startTimestamp:n,endTimestamp:i}=r;if(i&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.fetchData.method,r.fetchData.url,r.error){let o=r.fetchData,s={data:r.error,input:r.args,startTimestamp:n,endTimestamp:i},a={category:"fetch",data:o,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,s),Lr(a,s)}else{let o=r.response,s=Z(_({},r.fetchData),{status_code:o?.status});r.fetchData.request_body_size,r.fetchData.response_body_size,o?.status;let a={input:r.args,response:o,startTimestamp:n,endTimestamp:i},c={category:"fetch",data:s,type:"http",level:Ma(s.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",c,a),Lr(c,a)}}}function Vb(t){return function(r){if(Ge()!==t)return;let n=r.from,i=r.to,o=Jo(Je.location.href),s=n?Jo(n):void 0,a=Jo(i);s?.path||(s=o),o.protocol===a.protocol&&o.host===a.host&&(i=a.relative),o.protocol===s.protocol&&o.host===s.host&&(n=s.relative),Lr({category:"navigation",data:{from:n,to:i}})}}function $b(t){return!!t&&!!t.target}var Wb=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],jb="BrowserApiErrors",Gb=(t={})=>{let e=_({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},t);return{name:jb,setupOnce(){e.setTimeout&&pt(Je,"setTimeout",Sh),e.setInterval&&pt(Je,"setInterval",Sh),e.requestAnimationFrame&&pt(Je,"requestAnimationFrame",zb),e.XMLHttpRequest&&"XMLHttpRequest"in Je&&pt(XMLHttpRequest.prototype,"send",qb);let r=e.eventTarget;r&&(Array.isArray(r)?r:Wb).forEach(i=>Yb(i,e))}}},Ih=Gb;function Sh(t){return function(...e){let r=e[0];return e[0]=Xn(r,{mechanism:{data:{function:nr(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function zb(t){return function(e){return t.apply(this,[Xn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:nr(t)},handled:!1,type:"instrument"}})])}}function qb(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in r&&typeof r[i]=="function"&&pt(r,i,function(o){let s={mechanism:{data:{function:i,handler:nr(o)},handled:!1,type:"instrument"}},a=Kn(o);return a&&(s.mechanism.data.handler=nr(a)),Xn(o,s)})}),t.apply(this,e)}}function Yb(t,e){let n=Je[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(pt(n,"addEventListener",function(i){return function(o,s,a){try{Kb(s)&&(s.handleEvent=Xn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:nr(s),target:t},handled:!1,type:"instrument"}}))}catch{}return e.unregisterOriginalCallbacks&&Xb(this,o,s),i.apply(this,[o,Xn(s,{mechanism:{data:{function:"addEventListener",handler:nr(s),target:t},handled:!1,type:"instrument"}}),a])}}),pt(n,"removeEventListener",function(i){return function(o,s,a){try{let c=s.__sentry_wrapped__;c&&i.call(this,o,c,a)}catch{}return i.call(this,o,s,a)}}))}function Kb(t){return typeof t.handleEvent=="function"}function Xb(t,e,r){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,r)}var Th=()=>({name:"BrowserSession",setupOnce(){if(typeof Je.document>"u"){Mi&&ee.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}qo({ignoreDuration:!0}),Yo(),ts(({from:t,to:e})=>{t!==void 0&&t!==e&&(qo({ignoreDuration:!0}),Yo())})}});var Jb="GlobalHandlers",Qb=(t={})=>{let e=_({onerror:!0,onunhandledrejection:!0},t);return{name:Jb,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(Zb(r),xh("onerror")),e.onunhandledrejection&&(ew(r),xh("onunhandledrejection"))}}},Ch=Qb;function Zb(t){Iu(e=>{let{stackParser:r,attachStacktrace:n}=Rh();if(Ge()!==t||_p())return;let{msg:i,url:o,line:s,column:a,error:c}=e,p=nw(ka(r,c||i,void 0,n,!1),o,s,a);p.level="error",zo(p,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function ew(t){xu(e=>{let{stackParser:r,attachStacktrace:n}=Rh();if(Ge()!==t||_p())return;let i=tw(e),o=qn(i)?rw(i):ka(r,i,void 0,n,!0);o.level="error",zo(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function tw(t){if(qn(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function rw(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function nw(t,e,r,n){let i=t.exception=t.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[],p=n,d=r,f=Bt(e)&&e.length>0?e:Wo();return c.length===0&&c.push({colno:p,filename:f,function:"?",in_app:!0,lineno:d}),t}function xh(t){Mi&&ee.log(`Global Handler attached: ${t}`)}function Rh(){return Ge()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Ah=()=>({name:"HttpContext",preprocessEvent(t){if(!Je.navigator&&!Je.location&&!Je.document)return;let e=ph(),r=_(_({},e.headers),t.request?.headers);t.request=Z(_(_({},e),t.request),{headers:r})}});var iw="cause",ow=5,sw="LinkedErrors",aw=(t={})=>{let e=t.limit||ow,r=t.key||iw;return{name:sw,preprocessEvent(n,i,o){let s=o.getOptions();pp(Ba,s.stackParser,r,e,n,i)}}},Dh=aw;function Op(t){return[Pa(),Na(),Ih(),wh(),Ch(),Dh(),La(),Ah(),Th()]}var Wa={},ja,Pp,Nh;(()=>{let t=Op({}).filter(e=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name));Pp=new es({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:Ap,stackParser:Np,integrations:t,environment:Gt.mode,release:`web-sdk@${Cr}`,debug:Gt.debug}),Pp.init()})();function ae(t,e,r){b.error(`${e}:`,t);let n=Lh(r);if(n.setTag("operation",e),t instanceof en){cw(n,t,e);return}n.captureException(t)}function Oh(t,e,r){Lh(r).captureMessage(t,e??"error")}function cw(t,e,r){if(lw(t,e),e.response){let n=e.response;t.setTag("http.status_code",n.status),t.setExtras({responseText:e.responseText,statusText:n.statusText,responseType:n.type,redirected:n.redirected,responseUrl:n.url}),t.captureMessage(`${r} failed with ${n.status}`,"error");return}if(e.request){t.captureMessage(`No response was received for ${r}`,"error");return}}function lw(t,e){let r=e.request;r&&t.setExtras({body:e.requestBody,headers:r.headers,method:r.method,url:r.url})}function Ph(t){Nh=t}function Ga(t,e){Wa[t]=_(_({},Wa[t]),e)}function Bi(t){ja=_(_({},ja),t)}function Lh(t){t??={};let{extra:e,tags:r}=t,n=new It;if(n.setClient(Pp),n.setUser(Nh),t.triggerContext&&!t.engagementTrigger&&(t.engagementTrigger=t.triggerContext.triggerData),t.engagementTrigger){let i=t.engagementTrigger;n.setTags({"engagement.id":i.engagementID,"engagement.short_id":i.shortID,"engagement.objective":i.objective,"engagement.delivery_type":i.onsiteDeliveryType,"engagement.content_id":i.contentID,"engagement.variation":i.variation,"engagement.currency":i.currency})}return e&&n.setExtras(e),r&&n.setTags(r),ja&&n.setTags(ja),Object.keys(Wa).forEach(i=>{n.setContext(i,Wa[i])}),n.setTag("language",navigator.language),n.setTag("timezone",Mh()),uw(n),n}function uw(t){window.Shopify&&(t.setTag("shopify.shop",window.Shopify.shop),t.setTag("shopify.currency",window.Shopify.currency?.active),t.setTag("shopify.locale",window.Shopify.locale),t.setTag("theme.schema_name",window.Shopify.theme?.schema_name),t.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}var za=class{static format(e,r){let n=/{{\s*(\w+)\s*}}/;return r.replace(n,(i,o)=>{switch(o){case"amount":return this.formatWithDelimiters(e,2);case"amount_no_decimals":return this.formatWithDelimiters(e,0);case"amount_with_comma_separator":return this.formatWithDelimiters(e,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(e,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(e,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(e,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(e,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(e,2," ",".");default:return i}})}static formatWithDelimiters(e,r=2,n=",",i="."){if(isNaN(e)||e==null)return"0";let s=(e/100).toFixed(r).split("."),a=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+n),c=s[1]?i+s[1]:"";return a+c}};function ki(t){try{return new URL(t)}catch{return}}function Lp(t){return!t||t==="null"||t==="undefined"}function Bh(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}function kt(t,e,r){return{[t]:Mp(e,r),[t+"_wo_currency"]:e}}function Mp(t,e){if(t==0&&e)return"Free";let r=ve.get(),n=Xe.get(),i=r.shopCurrencyCode||n.currency,o=r.currencyCode;o||b.warn("Currency code is not set in RuntimeData");let s=n.money?.format??r.moneyFormat,a;if(s&&i===o)a=za.format(t*100,s);else{let c;try{c=new Intl.NumberFormat(Uh(),{style:"currency",currency:o||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(p){return ae(p,"format-currency",{extra:{currentCurrency:o,shopCurrency:i}}),""}a=c.format(t),a=a.replace("\u20B9","Rs. "),n.money?.showCurrency&&o!=="INR"&&(a=a.concat(` ${o}`))}return a}function kh(t){let e=Uh();try{return new Intl.NumberFormat(e,{notation:"compact"}).format(t)}catch(r){return ae(r,"format-number",{extra:{lang:e,value:t}}),t.toString()}}function Uh(){let t="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?t=navigator.languages[0]:navigator.language&&(t=navigator.language)),t=t.split(";")[0],t=t.split("-")[0],t||"en"}var qa;function Mh(){if(qa)return qa;try{return qa=Intl.DateTimeFormat().resolvedOptions().timeZone,qa}catch{return""}}function Ui(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}function br(t){let e=document.createElement("span");e.id="snackbar",e.innerText=t,document.body.appendChild(e),e.className="show",setTimeout(()=>{e.classList.remove("show"),document.body.removeChild(e)},5e3)}async function Bp(t,e=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<e;){let o=Math.min(100*2**n,5e3);if(await rr.sleep(o),i=r.querySelectorAll(t),i.length)return b.verbose(`Attempt ${n+1}: ${i.length} elements found with ${t}`),i;b.verbose(`Attempt ${n+1}: Elements not found with ${t}. Retrying after ${o}ms.`),n++}return b.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${t}.`),i}async function Fi(t,e=10,r=document){return(await Bp(t,e,r)).item(0)}async function kp(t){let[e,r,n]=await Promise.all([Ye.get("did"),At.get("id",""),Ye.get("sessionNumber",1)]),i={letscooee_did:e,letscooee_sid:r,letscooee_sn:n,__letscooee_time:new Date().toLocaleString()};return t&&(i.__letscooee_via=t),i}async function Ya(t){let e=await kp(t);return Object.entries(e).map(([r,n])=>({key:r,value:n.toString()}))}function Mr(t,e,r,n=!1){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:n,value:r})}function Fh(t){if(t%100>=11&&t%100<=13)return t+"th";switch(t%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd";default:return t+"th"}}var Qa,xe,jh,Hp,Qn,Hh,Gh,zh,qh,Vp,Up,Fp,pw,ns={},Yh=[],fw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Za=Array.isArray;function cn(t,e){for(var r in e)t[r]=e[r];return t}function $p(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Wp(t,e,r){var n,i,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Qa.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return Xa(t,s,n,i,null)}function Xa(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++jh,__i:-1,__u:0};return i==null&&xe.vnode!=null&&xe.vnode(o),o}function kr(t){return t.children}function Br(t,e){this.props=t,this.context=e}function Hi(t,e){if(e==null)return t.__?Hi(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Hi(t):null}function Kh(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return Kh(t)}}function Vh(t){(!t.__d&&(t.__d=!0)&&Qn.push(t)&&!Ja.__r++||Hh!=xe.debounceRendering)&&((Hh=xe.debounceRendering)||Gh)(Ja)}function Ja(){for(var t,e,r,n,i,o,s,a=1;Qn.length;)Qn.length>a&&Qn.sort(zh),t=Qn.shift(),a=Qn.length,t.__d&&(r=void 0,i=(n=(e=t).__v).__e,o=[],s=[],e.__P&&((r=cn({},n)).__v=n.__v+1,xe.vnode&&xe.vnode(r),jp(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,o,i??Hi(n),!!(32&n.__u),s),r.__v=n.__v,r.__.__k[r.__i]=r,Qh(o,r,s),r.__e!=i&&Kh(r)));Ja.__r=0}function Xh(t,e,r,n,i,o,s,a,c,p,d){var f,E,y,T,D,N,k=n&&n.__k||Yh,G=e.length;for(c=mw(r,e,k,c,G),f=0;f<G;f++)(y=r.__k[f])!=null&&(E=y.__i==-1?ns:k[y.__i]||ns,y.__i=f,N=jp(t,y,E,i,o,s,a,c,p,d),T=y.__e,y.ref&&E.ref!=y.ref&&(E.ref&&Gp(E.ref,null,y),d.push(y.ref,y.__c||T,y)),D==null&&T!=null&&(D=T),4&y.__u||E.__k===y.__k?c=Jh(y,c,t):typeof y.type=="function"&&N!==void 0?c=N:T&&(c=T.nextSibling),y.__u&=-7);return r.__e=D,c}function mw(t,e,r,n,i){var o,s,a,c,p,d=r.length,f=d,E=0;for(t.__k=new Array(i),o=0;o<i;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=o+E,(s=t.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Xa(null,s,null,null,null):Za(s)?Xa(kr,{children:s},null,null,null):s.constructor==null&&s.__b>0?Xa(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,a=null,(p=s.__i=dw(s,r,c,f))!=-1&&(f--,(a=r[p])&&(a.__u|=2)),a==null||a.__v==null?(p==-1&&(i>d?E--:i<d&&E++),typeof s.type!="function"&&(s.__u|=4)):p!=c&&(p==c-1?E--:p==c+1?E++:(p>c?E--:E++,s.__u|=4))):t.__k[o]=null;if(f)for(o=0;o<d;o++)(a=r[o])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=Hi(a)),eg(a,a));return n}function Jh(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=Jh(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=Hi(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function dw(t,e,r,n){var i,o,s=t.key,a=t.type,c=e[r];if(c===null&&t.key==null||c&&s==c.key&&a==c.type&&(2&c.__u)==0)return r;if(n>(c!=null&&(2&c.__u)==0?1:0))for(i=r-1,o=r+1;i>=0||o<e.length;){if(i>=0){if((c=e[i])&&(2&c.__u)==0&&s==c.key&&a==c.type)return i;i--}if(o<e.length){if((c=e[o])&&(2&c.__u)==0&&s==c.key&&a==c.type)return o;o++}}return-1}function $h(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||fw.test(e)?r:r+"px"}function Ka(t,e,r,n,i){var o,s;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||$h(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||$h(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(qh,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n?r.u=n.u:(r.u=Vp,t.addEventListener(e,o?Fp:Up,o)):t.removeEventListener(e,o?Fp:Up,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Wh(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Vp++;else if(e.t<r.u)return;return r(xe.event?xe.event(e):e)}}}function jp(t,e,r,n,i,o,s,a,c,p){var d,f,E,y,T,D,N,k,G,P,Q,_e,X,ce,se,fe,Be,Te=e.type;if(e.constructor!=null)return null;128&r.__u&&(c=!!(32&r.__u),o=[a=e.__e=r.__e]),(d=xe.__b)&&d(e);e:if(typeof Te=="function")try{if(k=e.props,G="prototype"in Te&&Te.prototype.render,P=(d=Te.contextType)&&n[d.__c],Q=d?P?P.props.value:d.__:n,r.__c?N=(f=e.__c=r.__c).__=f.__E:(G?e.__c=f=new Te(k,Q):(e.__c=f=new Br(k,Q),f.constructor=Te,f.render=gw),P&&P.sub(f),f.props=k,f.state||(f.state={}),f.context=Q,f.__n=n,E=f.__d=!0,f.__h=[],f._sb=[]),G&&f.__s==null&&(f.__s=f.state),G&&Te.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=cn({},f.__s)),cn(f.__s,Te.getDerivedStateFromProps(k,f.__s))),y=f.props,T=f.state,f.__v=e,E)G&&Te.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),G&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(G&&Te.getDerivedStateFromProps==null&&k!==y&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(k,Q),!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(k,f.__s,Q)===!1||e.__v==r.__v){for(e.__v!=r.__v&&(f.props=k,f.state=f.__s,f.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(Ae){Ae&&(Ae.__=e)}),_e=0;_e<f._sb.length;_e++)f.__h.push(f._sb[_e]);f._sb=[],f.__h.length&&s.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(k,f.__s,Q),G&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(y,T,D)})}if(f.context=Q,f.props=k,f.__P=t,f.__e=!1,X=xe.__r,ce=0,G){for(f.state=f.__s,f.__d=!1,X&&X(e),d=f.render(f.props,f.state,f.context),se=0;se<f._sb.length;se++)f.__h.push(f._sb[se]);f._sb=[]}else do f.__d=!1,X&&X(e),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++ce<25);f.state=f.__s,f.getChildContext!=null&&(n=cn(cn({},n),f.getChildContext())),G&&!E&&f.getSnapshotBeforeUpdate!=null&&(D=f.getSnapshotBeforeUpdate(y,T)),fe=d,d!=null&&d.type===kr&&d.key==null&&(fe=Zh(d.props.children)),a=Xh(t,Za(fe)?fe:[fe],e,r,n,i,o,s,a,c,p),f.base=e.__e,e.__u&=-161,f.__h.length&&s.push(f),N&&(f.__E=f.__=null)}catch(Ae){if(e.__v=null,c||o!=null)if(Ae.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else for(Be=o.length;Be--;)$p(o[Be]);else e.__e=r.__e,e.__k=r.__k;xe.__e(Ae,e,r)}else o==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=hw(r.__e,e,r,n,i,o,s,c,p);return(d=xe.diffed)&&d(e),128&e.__u?void 0:a}function Qh(t,e,r){for(var n=0;n<r.length;n++)Gp(r[n],r[++n],r[++n]);xe.__c&&xe.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){xe.__e(o,i.__v)}})}function Zh(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Za(t)?t.map(Zh):cn({},t)}function hw(t,e,r,n,i,o,s,a,c){var p,d,f,E,y,T,D,N=r.props,k=e.props,G=e.type;if(G=="svg"?i="http://www.w3.org/2000/svg":G=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(p=0;p<o.length;p++)if((y=o[p])&&"setAttribute"in y==!!G&&(G?y.localName==G:y.nodeType==3)){t=y,o[p]=null;break}}if(t==null){if(G==null)return document.createTextNode(k);t=document.createElementNS(i,G,k.is&&k),a&&(xe.__m&&xe.__m(e,o),a=!1),o=null}if(G==null)N===k||a&&t.data==k||(t.data=k);else{if(o=o&&Qa.call(t.childNodes),N=r.props||ns,!a&&o!=null)for(N={},p=0;p<t.attributes.length;p++)N[(y=t.attributes[p]).name]=y.value;for(p in N)if(y=N[p],p!="children"){if(p=="dangerouslySetInnerHTML")f=y;else if(!(p in k)){if(p=="value"&&"defaultValue"in k||p=="checked"&&"defaultChecked"in k)continue;Ka(t,p,null,y,i)}}for(p in k)y=k[p],p=="children"?E=y:p=="dangerouslySetInnerHTML"?d=y:p=="value"?T=y:p=="checked"?D=y:a&&typeof y!="function"||N[p]===y||Ka(t,p,y,N[p],i);if(d)a||f&&(d.__html==f.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(f&&(t.innerHTML=""),Xh(e.type=="template"?t.content:t,Za(E)?E:[E],e,r,n,G=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:r.__k&&Hi(r,0),a,c),o!=null)for(p=o.length;p--;)$p(o[p]);a||(p="value",G=="progress"&&T==null?t.removeAttribute("value"):T!=null&&(T!==t[p]||G=="progress"&&!T||G=="option"&&T!=N[p])&&Ka(t,p,T,N[p],i),p="checked",D!=null&&D!=t[p]&&Ka(t,p,D,N[p],i))}return t}function Gp(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){xe.__e(i,r)}}function eg(t,e,r){var n,i;if(xe.unmount&&xe.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Gp(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){xe.__e(o,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&eg(n[i],e,r||typeof t.type!="function");r||$p(t.__e),t.__c=t.__=t.__e=void 0}function gw(t,e,r){return this.constructor(t,r)}function tg(t,e,r){var n,i,o,s;e==document&&(e=document.documentElement),xe.__&&xe.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,o=[],s=[],jp(e,t=(!n&&r||e).__k=Wp(kr,null,[t]),i||ns,ns,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?Qa.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n,s),Qh(o,t,s)}Qa=Yh.slice,xe={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},jh=0,Hp=function(t){return t!=null&&t.constructor==null},Br.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=cn({},this.state),typeof t=="function"&&(t=t(cn({},r),this.props)),t&&cn(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Vh(this))},Br.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Vh(this))},Br.prototype.render=kr,Qn=[],Gh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,zh=function(t,e){return t.__v.__b-e.__v.__b},Ja.__r=0,qh=/(PointerCapture)$|Capture$/i,Vp=0,Up=Wh(!1),Fp=Wh(!0),pw=0;var qp,Yt,zp,rg,ng=0,pg=[],dt=xe,ig=dt.__b,og=dt.__r,sg=dt.diffed,ag=dt.__c,cg=dt.unmount,lg=dt.__;function yw(t,e){dt.__h&&dt.__h(Yt,t,ng||e),ng=0;var r=Yt.__H||(Yt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Kp(t,e){var r=yw(qp++,7);return _w(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function vw(){for(var t;t=pg.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ec),t.__H.__h.forEach(Yp),t.__H.__h=[]}catch(e){t.__H.__h=[],dt.__e(e,t.__v)}}dt.__b=function(t){Yt=null,ig&&ig(t)},dt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),lg&&lg(t,e)},dt.__r=function(t){og&&og(t),qp=0;var e=(Yt=t.__c).__H;e&&(zp===Yt?(e.__h=[],Yt.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.forEach(ec),e.__h.forEach(Yp),e.__h=[],qp=0)),zp=Yt},dt.diffed=function(t){sg&&sg(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(pg.push(e)!==1&&rg===dt.requestAnimationFrame||((rg=dt.requestAnimationFrame)||Ew)(vw)),e.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),zp=Yt=null},dt.__c=function(t,e){e.some(function(r){try{r.__h.forEach(ec),r.__h=r.__h.filter(function(n){return!n.__||Yp(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],dt.__e(n,r.__v)}}),ag&&ag(t,e)},dt.unmount=function(t){cg&&cg(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ec(n)}catch(i){e=i}}),r.__H=void 0,e&&dt.__e(e,r.__v))};var ug=typeof requestAnimationFrame=="function";function Ew(t){var e,r=function(){clearTimeout(n),ug&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);ug&&(e=requestAnimationFrame(r))}function ec(t){var e=Yt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Yt=e}function Yp(t){var e=Yt;t.__c=t.__(),Yt=e}function _w(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}var bw=Symbol.for("preact-signals");function Jp(){if(Vi>1)Vi--;else{for(var t,e=!1;is!==void 0;){var r=is;for(is=void 0,Xp++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&mg(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=n}}if(Xp=0,Vi--,e)throw t}}var Ve=void 0;var is=void 0,Vi=0,Xp=0,tc=0;function fg(t){if(Ve!==void 0){var e=t.n;if(e===void 0||e.t!==Ve)return e={i:0,S:t,p:Ve.s,n:void 0,t:Ve,e:void 0,x:void 0,r:e},Ve.s!==void 0&&(Ve.s.n=e),Ve.s=e,t.n=e,32&Ve.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Ve.s,e.n=void 0,Ve.s.n=e,Ve.s=e),e}}function ht(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}ht.prototype.brand=bw;ht.prototype.h=function(){return!0};ht.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};ht.prototype.U=function(t){if(this.t!==void 0){var e=t.e,r=t.x;e!==void 0&&(e.x=r,t.e=void 0),r!==void 0&&(r.e=e,t.x=void 0),t===this.t&&(this.t=r)}};ht.prototype.subscribe=function(t){var e=this;return Tt(function(){var r=e.value,n=Ve;Ve=void 0;try{t(r)}finally{Ve=n}})};ht.prototype.valueOf=function(){return this.value};ht.prototype.toString=function(){return this.value+""};ht.prototype.toJSON=function(){return this.value};ht.prototype.peek=function(){var t=Ve;Ve=void 0;try{return this.value}finally{Ve=t}};Object.defineProperty(ht.prototype,"value",{get:function(){var t=fg(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Xp>100)throw new Error("Cycle detected");this.v=t,this.i++,tc++,Vi++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Jp()}}}});function sr(t){return new ht(t)}function mg(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function dg(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function hg(t){for(var e=t.s,r=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=r}function $i(t){ht.call(this,void 0),this.x=t,this.s=void 0,this.g=tc-1,this.f=4}($i.prototype=new ht).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===tc))return!0;if(this.g=tc,this.f|=1,this.i>0&&!mg(this))return this.f&=-2,!0;var t=Ve;try{dg(this),Ve=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Ve=t,hg(this),this.f&=-2,!0};$i.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ht.prototype.S.call(this,t)};$i.prototype.U=function(t){if(this.t!==void 0&&(ht.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};$i.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty($i.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=fg(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Qp(t){return new $i(t)}function gg(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Vi++;var r=Ve;Ve=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Zp(t),n}finally{Ve=r,Jp()}}}function Zp(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,gg(t)}function ww(t){if(Ve!==this)throw new Error("Out-of-order effect");hg(this),Ve=t,this.f&=-2,8&this.f&&Zp(this),Jp()}function os(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}os.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};os.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,gg(this),dg(this),Vi++;var t=Ve;return Ve=this,ww.bind(this,t)};os.prototype.N=function(){2&this.f||(this.f|=2,this.o=is,is=this)};os.prototype.d=function(){this.f|=8,1&this.f||Zp(this)};function Tt(t){var e=new os(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var tf,ef;function Wi(t,e){xe[t]=e.bind(null,xe[t]||function(){})}function rc(t){ef&&ef(),ef=t&&t.S()}function yg(t){var e=this,r=t.data,n=Iw(r);n.value=r;var i=Kp(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var s,a=e.__$u.S(),c=i.value;a(),Hp(c)||((s=e.base)==null?void 0:s.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=c},Qp(function(){var s=n.value.value;return s===0?0:s===!0?"":s||""})},[]);return i.value}yg.displayName="_st";Object.defineProperties(ht.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:yg},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Wi("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof ht&&(r||(e.__np=r={}),r[i]=o,n[i]=o.peek())}}t(e)});Wi("__r",function(t,e){rc();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=(function(i){var o;return Tt(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o})())),tf=n,rc(r),t(e)});Wi("__e",function(t,e,r,n){rc(),tf=void 0,t(e,r,n)});Wi("diffed",function(t,e){rc(),tf=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,i=e.props;if(n){var o=r.U;if(o)for(var s in o){var a=o[s];a!==void 0&&!(s in n)&&(a.d(),o[s]=void 0)}else r.U=o={};for(var c in n){var p=o[c],d=n[c];p===void 0?(p=Sw(r,c,d,i),o[c]=p):p.o(d,i)}}}t(e)});function Sw(t,e,r,n){var i=e in t&&t.ownerSVGElement===void 0,o=sr(r);return{o:function(s,a){o.value=s,n=a},d:Tt(function(){var s=o.value.value;n[e]!==s&&(n[e]=s,i?t[e]=s:s?t.setAttribute(e,s):t.removeAttribute(e))})}}Wi("unmount",function(t,e){if(typeof e.type=="string"){var r=e.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var s=e.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}t(e)});Wi("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});Br.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u,n=r&&r.s!==void 0;for(var i in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(n||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function Iw(t){return Kp(function(){return sr(t)},[])}var nc=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}};var ic=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}};var rf=class{id;mID;name;groupID;groupName;isSelected;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.name=e.name,this.groupID=e.groupID,this.groupName=e.groupName,this.isSelected=e.isSelected??!1}},Ur=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;selectedSellingPlan;effectivePrice;constructor(e){e=e??{},this.mID=e.mID,this.name=e.name,this.imgs=e.imgs?.map(r=>new nc(r))??[],this.link=e.link,this.price=new ic(e.price),this.sku=e.sku,this.isAvailable=e.isAvailable,this.quantity=e.quantity,this.selectedOptions=e.selectedOptions??[],this.effectivePrice=sr(this.price.effective),e.sellingPlans?.length&&(this.selectedSellingPlan=sr(void 0)),this.sellingPlans=e.sellingPlans?.map(r=>{let n=new rf(r);return n.isSelected&&(this.selectedSellingPlan.value=n),n})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}};var Dt=class{id;mID;name;options;imgs;vars;desc;link;slug;quantity;category;meta;reviews;tags;selectedOrFirstVariant;selected=sr(!0);constructor(e){this.update(e),this.selectedOrFirstVariant=sr(this.selectedVariant)}get firstImageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}set variants(e){this.vars=e,this.selectedOrFirstVariant.value=this.selectedVariant}get selectedVariant(){return this.vars.find(e=>e.isAvailable)??this.vars[0]}hasVariants(){return this.vars?.length>1}setSelectedVariant(e){this.selectedOrFirstVariant.value=e}setSelectedVariantByID(e){if(!e)return;let r=this.vars.find(n=>n.mID===e.toString());r&&this.setSelectedVariant(r)}update(e){return this.id=e.id??this.id,this.mID=e.mID??this.mID,this.name=e.name??this.name,this.imgs=e.imgs??this.imgs,this.desc=e.desc??this.desc,this.link=e.link??this.link,this.slug=e.slug??this.slug,this.quantity=e.quantity??this.quantity,this.meta=e.meta??this.meta,this.category=e.category??this.category,this.reviews=e.reviews??this.reviews,this.options=e.options??this.options,this.tags=e.tags??this.tags,e.vars&&(this.vars=e.vars.map(r=>new Ur(r))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new Rt({id:this.id,mID:this.mID,vID:e.mID,vName:e.name,name:this.name,link:this.link,slug:this.slug,price:e.price.d,imageURL:e.getOneImage()??this.imgs?.[0].url})}getTemplateVariables(){let e=this.selectedOrFirstVariant.value,r=e.price,n=this.name,i=this.category,o=this.variantImage??this.firstImageURL,s=this.meta,a=this.tags?.join(",")??"",c=this.reviews?.rating,p=this.reviews?.totalReviews,d=r.cmp&&r.cmp>r.d,f=Z(_({name:n},kt("price",r.d,!0)),{image_url:o,meta:s,category:i,rating:c,reviews:p,tags:a});if(e.hasEffectivePrice()){let y=kt("effective_price",e.effectivePrice.value,!0);Object.assign(f,y)}if(d){let y=r.cmp-r.d,T={discount_percent:(y/r.cmp*100).toFixed(0)};Object.assign(f,T),Object.assign(f,kt("compare_price",r.cmp)),Object.assign(f,kt("discount_price",y))}let E={name:e.name,quantity:e.quantity};return{product:f,variant:E}}};var oc=class{id;alt;shortID;sources;items;durationMS;thumbnail;card;bestSource;highSource;goodSource;lowSource;m3u8Source;constructor(e={}){if(this.id=e.id,this.alt=e.alt,this.shortID=e.shortID,this.sources=e.sources?.sort((r,n)=>n.height-r.height),this.durationMS=e.durationMS,this.thumbnail=e.thumbnail,this.items=e.items?e.items.map(r=>new Dt(r)):[],this.card=e.card,this.sources){let r=[];for(let n of this.sources)n.format==="mp4"?r.push(n):n.format==="m3u8"&&!this.m3u8Source&&(this.m3u8Source=n);r.length>0&&(this.bestSource=r[0],this.highSource=r.length>1?r[1]:r[0],this.lowSource=r.length>2?r[r.length-1]:r[0])}}};var nf=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new je(e.color)}},of=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new je(e.color)}},sf=class{enabled;delay;constructor(e={}){this.enabled=e.enabled,e.delay&&(this.delay=e.delay>100?e.delay:e.delay*1e3)}},Tn=class{navigation;pagination;autoplay;loop;maxInRow;gap;maxInRowSm;gapSm;speed;marquee;constructor(e){e??={},this.navigation=new of(e.navigation),this.pagination=new nf(e.pagination),this.autoplay=new sf(e.autoplay),this.loop=e.loop??!1,this.maxInRow=e.maxInRow??4,this.gap=e.gap??0,this.maxInRowSm=e.maxInRowSm??this.maxInRow,this.gapSm=e.gapSm??this.gap,e.speed&&(this.speed=e.speed*1e3),this.marquee=e.marquee}};var sc=class{videos;source;template;heading;slidePerViewCount;autoPlay;showMuteButton;footerContent;detailPopup;playlistConfig;constructor(e={}){this.videos=e.videos?.map(r=>new oc(r))??[],this.source=e.source,this.template=e.template,this.detailPopup=e.detailPopup??{template:"VIDEO_ONLY_VIEW"},this.heading=e.heading,this.showMuteButton=e.showMuteButton,this.slidePerViewCount=e.slidePerViewCount??4,this.autoPlay=e.autoPlay??"ON",this.footerContent=e.footerContent??"FIRST_ITEM",this.playlistConfig=e.playlistConfig?.videoSwiper?{videoSwiper:new Tn(e.playlistConfig?.videoSwiper)}:void 0}};var Ut=xr(Eg());Ut.filters.define("default",function(t){return typeof t>"u"||t==null?"":xw(t)});+Ut.filters.define("max",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r>n?e:t});Ut.filters.define("min",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r<n?e:t});Ut.filters.define("fallback",(t,e)=>t==null||t===""?e:t);Ut.filters.define("manipulate_quantity",(t,e,r)=>{if(e??=1,r??=100,e>r)return b.error("Invalid range: min should be less than or equal to max."),t;if(t>=e&&t<=r)return t;let n=t%r;return n<e?e:n});Ut.filters.define("apply_discount_perc",(t,e,r=1/0)=>{if(t=+t,isNaN(t))return b.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return b.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let n=t*e/100;return t-Math.min(r,n)});Ut.filters.define("apply_discount_fixed",(t,e)=>(t=+t,isNaN(t)?(b.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,t-e)));Ut.filters.define("currency",t=>(t=+t,isNaN(t)?(b.error("Need value as a number for `currency` filter"),NaN):Mp(t)));Ut.defaultConfig.defaultFilter="default";Ut.defaultConfig.useWith=!0;Ut.defaultConfig.autoEscape=!1;var Tw={'"':""","\\":"\","\n":"\\n"};function xw(t){return String(t).replace(/["\\\n]/g,e=>Tw[e])}function Cw(t){if(!t)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return t.replace(e,(r,n,i,o)=>`{{ ${(i||o||"").trim()} }}`)}var ji=(t,e,r)=>{e=_({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Ut.render(Cw(t),e)}catch(n){throw ae(n,"squirrelly-render",{extra:{template:t,values:e},triggerContext:r}),n}},Zn=(t,e,r)=>{let n=JSON.stringify(t),i=ji(n,e,r);try{return JSON.parse(i)}catch(o){throw ae(o,"variable-replacement",{extra:{before:t,after:i},triggerContext:r}),o}};function ss(){return!!window.Shopify}function cc(){if(ss())return window.Shopify.shop?.split(".")?.[0]}function _g(t){let n=(t.includes("://")?new URL(t).pathname:t).match(/\/products\/([^/]+?)(?:\.html)?$/);return n?n[1]:null}function Gi(t){return(window.Shopify?.routes?.root??"/")+t.substring(1)}function lc(t){return Gi(t+"?from=cooee")}var ge=class t{static CURRENT;token;items=[];total_price=0;original_total_price=0;items_subtotal_price=0;currency;item_count=0;attributes;cart_level_discount_applications;total_discount=0;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new t),this.CURRENT}async getNormalisedCart(e){return Rw(e)}getCooeeCart(){return af()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.items_subtotal_price=e.items_subtotal_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,this.cart_level_discount_applications=e.cart_level_discount_applications,this.total_discount=e.total_discount,ve.get().currencyCode=this.currency,b.verbose("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}};async function Rw(t){let e=ge.getCurrent();await Dw(e,t);let r=bg(e);return t&&await Ye.set("cart",r),r}function af(){return bg(ge.getCurrent())}function bg(t){return{amount:t.total_price/100,originalAmount:t.original_total_price/100,itemsSubtotalPrice:t.items_subtotal_price/100,currency:t.currency,itemCount:t.item_count,items:Aw(t.items),token:t.token}}function Aw(t){if(!t)return b.error("No item received to be sent"),[];Array.isArray(t)||(t=[t]);let e=[];for(let r of t){if(!r.id||!r.title){b.warn("Invalid item received",r);continue}let n={name:r.title,quantity:+r.quantity||1,mID:r.product_id?.toString(),vID:r.id.toString(),price:+r.price/100||0,finalPrice:+r.final_price/100||0,properties:r.properties,key:r.key},i=r.selling_plan_allocation?.selling_plan;if(!i){e.push(n);continue}n.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:i.fixed_selling_plan,id:i.id,name:i.name,recurringDeliveries:i.recurring_deliveries}},e.push(n)}return e}async function Dw(t,e){if(!e&&t.token){b.verbose("Not fetching cart");return}b.verbose("Fetching cart");let r=lc("/cart.js");try{let n=(await tn(r,{},{retries:2})).data;t.update(n)}catch(n){b.error("Unable to fetch the cart",n)}}var uc=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL}};var cf=class{enabled;constructor(e){this.enabled=e.enabled}},lf=class extends cf{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},pc=class{productQuantity;constructor(e){e??={},this.productQuantity=new lf(e.productQuantity)}};var Kt=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Qr(e.br)),e.shd&&(this.shd=new Uo(e.shd)),e.spc&&(this.spc=new Zr(e.spc)),this.trf=new Wn(e.trf),this.clc=e.clc,this.w=e.w,this.h=e.h,this.x=e.x,this.y=e.y,this.a=e.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return ze[this.t]}get click(){return this.clc}},ze=(P=>(P[P.IMAGE=1]="IMAGE",P[P.TEXT=2]="TEXT",P[P.BUTTON=3]="BUTTON",P[P.FLEXBOX=4]="FLEXBOX",P[P.MULTI_COLUMN=5]="MULTI_COLUMN",P[P.CHECKBOX=6]="CHECKBOX",P[P.PRODUCTS=11]="PRODUCTS",P[P.PRODUCT=12]="PRODUCT",P[P.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",P[P.PRODUCT_TITLE=14]="PRODUCT_TITLE",P[P.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",P[P.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",P[P.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",P[P.PRODUCT_RATING=19]="PRODUCT_RATING",P[P.EMAIL_INPUT=51]="EMAIL_INPUT",P[P.PHONE_INPUT=52]="PHONE_INPUT",P[P.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",P[P.CAROUSEL=62]="CAROUSEL",P[P.SHAPE=100]="SHAPE",P))(ze||{});var ei=class extends Kt{constructor(e){super(e)}};var ln=class extends Kt{src;constructor(e){super(e),this.src=e.src}};var Fr=class extends Kt{typo;constructor(e){super(e);let r=_(_({},e.f),e.typo);e.alg&&(r.ta=e.alg),e.c&&(r.tc=e.c),this.typo=new lt(r)}get color(){return this.typography.tc}get typography(){return this.typo}};var xn=class extends Fr{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}};var fc=class extends Kt{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}};var zi=class{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0}start(e,r){let n=new Date;e===2?(n.setSeconds(n.getSeconds()+this.ss),n.setMinutes(n.getMinutes()+this.mm),n.setHours(n.getHours()+this.hh),n.setDate(n.getDate()+this.dd)):n=this.date??new Date;let i=window.setInterval(()=>{let o=new Date().getTime(),s=n.getTime()-o;if(s<1){clearInterval(i);return}let a=Math.floor(s/(1e3*60*60*24)),c=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),p=Math.floor(s%(1e3*60*60)/(1e3*60)),d=Math.floor(s%(1e3*60)/1e3);r({days:a,hours:c,minutes:p,seconds:d})},1e3);return i}};var qi=class extends Fr{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new zi(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var mc=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new je(e.c??{})}get text(){return this.txt}get color(){return this.c}};var Cn=class extends Fr{ph;constructor(e){super(e),this.ph=new mc(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}};var Yi=class extends Cn{constructor(e){e??={},super(e)}};var Ki=class extends Cn{};var Xi=class extends Cn{};var Ji=class extends ln{};var dc=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}};var hc=15,as=class extends Kt{gvt;max;cover;anim;embedded;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??!0,this.anim=new dc(e.anim),this.spc||(this.spc=new Zr({pl:hc,pr:hc,pt:hc,pb:hc}))}};var gc=class extends as{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new fc(e.cont),this.mob=new as(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(r=>{r.t===1?this.elems.push(new ln(r)):r.t===2?this.elems.push(new xn(r)):r.t===3?this.elems.push(new xn(r)):r.t===100?this.elems.push(new ei(r)):r.t===51?this.elems.push(new Ki(r)):r.t===52?this.elems.push(new Xi(r)):r.t===61?this.elems.push(new qi(r)):r.t===15||r.t===16?this.elems.push(new Yi(r)):r.t===13&&this.elems.push(new Ji(r))})}getStylesForWrapper(){if(this.cover)return{};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:"50%",left:0,transform:"translateY(-50%)"}:e={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},e.overflow="visible",e}getFlexStylesForContainer(){let e={display:"flex",flexDirection:"row"},r,n;return this.gvt===1?(r="flex-start",n="flex-start"):this.gvt===2?(r="center",n="flex-start"):this.gvt===3?(r="flex-end",n="flex-start"):this.gvt===4?(r="flex-start",n="center"):this.gvt===6?(r="flex-end",n="center"):this.gvt===7?(r="flex-start",n="flex-end"):this.gvt===8?(r="center",n="flex-end"):this.gvt===9?(r="flex-end",n="flex-end"):(r="center",n="center"),e.alignItems=n,e.justifyContent=r,e.overflow="visible",e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim}};var Qi=class{gap;dir;wrap;jc;ai;scroll;constructor(e){e??={},this.gap=e.gap??0,this.dir=e.dir??"row",this.wrap=e.wrap??"nowrap",this.jc=e.jc??"flex-start",this.ai=e.ai??"flex-start",this.scroll=e.scroll}};var yc=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(e){e??={},this.of=e.of,this.disp=e.disp,this.pos=e.pos,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.zIndex=e.zIndex}};var vc=class{w;h;maxW;maxH;minW;minH;constructor(e){e??={},this.w=e.w??"100%",this.h=e.h??"auto",this.maxW=e.maxW,this.maxH=e.maxH,this.minW=e.minW,this.minH=e.minH}};var Ec=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Zr(e.spc),e.size&&(this.size=new vc(e.size)),e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Qr(e.br)),e.typo&&(this.typo=new lt(e.typo)),e.lout&&(this.lout=new yc(e.lout)),e.flex&&(this.flex=new Qi(e.flex))}},Zi=class{sm;lg;constructor(e){e??={},this.sm=new Ec(e.sm),this.lg=new Ec(e.lg)}};var yt=class{t;style;hide;when;clc;l;constructor(e,r){r??={},this.t=e,this.style=new Zi(r.style),this.hide=r.hide,this.l=r.l,r.when?.op&&(this.when=r.when),r.clc&&(this.clc=r.clc)}get stringType(){return ze[this.t]}};var vt=class extends yt{text;constructor(e,r){e?.style?.lg?.typo?.s&&delete e.style.lg.typo.s,e?.style?.sm?.typo?.s&&delete e.style.sm.typo.s,super(r??2,e),e??={},this.text=e.text}};var ti=class extends vt{constructor(e,r){super(e,r??3)}};var eo=class extends yt{value;constructor(e){super(6,e),e??={},this.value=e.value}};var to=class extends vt{showChips;optionsConfig;constructor(e=15,r){super(r,e),r??={},this.showChips=r.showChips??!1,this.optionsConfig=r.optionsConfig??{}}};var _c=class extends yt{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new je(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}};var wg=xr(Si());var bc=class extends yt{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e)}update(e){e??={},this.slide=Xt.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new Tn(e.conf),this.allowedTypes=e.allowedTypes}};var wc=class extends vt{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new zi(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var Rn=class extends yt{elems;constructor(e){super(4,e),this.update(e)}update(e){e??={},this.elems??=[],e.elems?.forEach(r=>{let n=Xt.getParsedElement(r);n&&this.elems.push(n)})}};var ri=class extends yt{src;sm;lg;constructor(e,r){super(r??1,e),e&&this.update(e)}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg}};var Xt=class t{static getParsedElements(e){let r=[];return e?.forEach(n=>{let i=t.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(e){switch(e.t){case 2:return new vt(e);case 3:return new ti(e);case 6:return new eo(e);case 11:return new Sc(e);case 12:return new An(e);case 61:return new wc(e);case 4:return new Rn(e);case 1:return new ri(e);case 13:return new ri(e,13);case 14:return new vt(e,14);case 15:case 16:return new to(e.t,e);case 18:return new ti(e,18);case 62:return new bc(e);case 19:return new _c(e);default:wg.default.error("Unknown element type",e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}};var An=class extends yt{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=Xt.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new eo(e.cBox)),this.elems.push(new ri(e.img,13));let r=new vt(e.title,14);r.hide=!e.show?.title,r.text="{{ product.name }}",this.elems.push(r);let n=new vt(e.price);n.text="{{ product.price }}",n.hide=!e.show?.price;let i=new vt(e.compareAt);i.text="{{ product.compare_price }}",i.hide=!e.show?.price,e.compareAt||(i.style=new Zi(n.style),i.style.lg.typo=new lt(Z(_({},i.style.lg.typo),{td:"line-through"})),i.style.sm.typo=new lt(Z(_({},i.style.sm.typo),{td:"line-through"})));let o=new Rn({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:Xt.parseAlignmentToJustifyContent(n.style.lg.typo?.ta)}}}});o.elems.push(i),o.elems.push(n),this.elems.push(o);let s=new to(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let a=new ti(e.btn,18);a.hide=!e.show?.btn,this.elems.push(a)}}e.symbol&&(this.symbol=new vt(e.symbol))}};var Sc=class extends yt{conf;prod;constructor(e){super(11,e),e??={},this.conf=new uf(e.conf),this.prod=new An(e.prod)}};var Ic=class extends Tn{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},uf=class{lg;sm;constructor(e){e??={},this.lg=new Ic(e.lg),this.sm=new Ic(e.sm)}};var Tc=class extends Rn{constructor(e){super(e)}};var ro=class{cont;elems=[];constructor(e){e=e??{},this.cont=new Tc(e.cont),e.elems?.forEach(r=>{this.addRawElement(r)})}addRawElement(e){let r=Xt.getParsedElement(e);return r&&this.elems.push(r),r}};function xc(t,e){return Nw(t,e,0,5)}function Nw(t,e,r=0,n=50){if(e){if(r>n){console.warn("Maximum recursion depth reached in findFirstElementOfType");return}for(let i of e){if(i.t===t)return i;let o="elems"in i?i.elems:[];if(o?.length>0){let s=xc(t,o);if(s)return s}}}}var pf=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===Po.EXCLUSION}isABTesting(){return this.contentType===Po.ABTESTING}isSingleContent(){return this.contentType===Po.SINGLE}},cs=class{videoConfig;savingsBarConfig;afterDeleteJS;afterRenderJS;constructor(e){this.update(e)}update(e){e??={},e.videoConfig&&(this.videoConfig=new sc(e.videoConfig)),e.savingsBarConfig&&(this.savingsBarConfig=new oa(e.savingsBarConfig)),e.afterDeleteJS&&(this.afterDeleteJS=e.afterDeleteJS),e.afterRenderJS&&(this.afterRenderJS=e.afterRenderJS)}},xt=class extends pf{contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;entryAnimation;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;stickyATCConfig;bundleConfig;content;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=sr({});constructor(e){super(e),this.id=e.id,this.currency=ve.get().currencyCode??"USD",this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new ro(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.entryAnimation=e.entryAnimation??"NONE",this.embeddedItems=e.embeddedItems?.map(r=>new Rt(r)),this.items=e.items?.map(r=>new Dt(r))??[],this.nonMutableItems=e.items?.map(r=>new Dt(r))??[],this.collections=e.collections?.map(r=>new uc(r))??[],this.discount=e.discount,this.placement=e.placement,this.customerData=e.customerData,this.ian=e.ian?this.processPopup(e.ian):void 0,this.promotionType=e.promotionType,this.manipulation=new pc(e.manipulation),this.contentSource=e.contentSource,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.skipSubscribedItems=e.skipSubscribedItems,this.stickyATCConfig=e.stickyATCConfig,e.experimentConfig&&(this.experimentConfig=new ra(e.experimentConfig)),e.progressBarConfig&&(this.progressBarConfig=new ia(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new Zs(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new Dt(e.bundleFrom)),e.content&&(this.content=new cs(e.content))}shouldDelay(){return this.delay>0}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===yr.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===Lo.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===Lo.PAGE_EMBED}isProgressBar(){return this.objective===yr.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===yr.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===yr.CART_RECOVERY}isProductPromotion(){return this.objective===yr.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isCollectionPromoted(){return this.isProductPromotion()&&this.collections.length>0&&this.promotionType===cu.COLLECTION}isBYOB(){return this.objective===yr.BYOB}isStickyATC(){return this.objective===yr.STICKY_ATC}isShoppableVideo(){return this.objective===yr.SHOPPABLE_VIDEO}isSavingsBar(){return this.objective===yr.SAVINGS_BAR}processPopup(e){let r=this.items[0],n={},i={};if(r){let a=r.selectedOrFirstVariant.value;n=Z(_(_({name:r.name,id:r.mID,link:r.link,vID:a.mID,image:r.variantImage},kt("price",a.price.d)),kt("comparePrice",a.price.cmp)),{quantity:r.quantity}),i={quantity:a.quantity}}let o={productCount:ge.getCurrent().item_count},s=ji(JSON.stringify(e),{product:n,variant:i,cart:o,discount:this.discount,customer:this.customerData},new Rr(new Date,this));return r&&(s=s.replace(new RegExp("https://cdn.global.letscooee.com/images/placeholders/product.png","gi"),r.variantImage??r.firstImageURL)),new gc(JSON.parse(s))}calculateDiscountData(e,r){let n=Jr.sum(e,s=>s.selectedOrFirstVariant.value.price.d),i=Jr.sum(e,s=>{let a=s.selectedOrFirstVariant.value.price;return a.cmp??a.d}),o={actualPrice:n,totalComparePrice:i,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!e?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(o);return}if(er.BXGY===this.discount.type&&this.discount.values?.length)o.discountPercentage=this.discount.values[0],this.updateEffectivePrice(e,o.discountPercentage,!0),o.discountAmount=o.actualPrice-Jr.sum(e,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([er.UNIQUE_FLAT_ITEMS,er.STATIC,er.UNIQUE_FLAT].includes(this.discount.type)&&this.discount.values?.length)o.discountPercentage=this.discount.values[0],o.discountAmount=o.actualPrice*o.discountPercentage/100,this.updateEffectivePrice(e,o.discountPercentage);else if(this.discount.type===er.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)o.discountAmount=o.actualPrice-this.discount.values[0],o.discountPercentage=o.discountAmount/o.actualPrice*100,this.updateEffectivePrice(e,o.discountPercentage);else if(this.discount.type===er.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((a,c)=>c.selectedOrFirstVariant.value.price.d-a.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,o.discountAmount=s.selectedOrFirstVariant.value.price.d,o.discountPercentage=o.discountAmount/o.actualPrice*100}o.discountedPrice=o.actualPrice-o.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(o)}getPrivateAttributesForLineItem(){return Xe.get().skipItemAttribute?{}:{_via:"Cooee",_letscooee_campaign:this.shortID,_letscooee_content:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return Xe.get().skipItemAttribute?[]:[{key:"_via",value:"Cooee"},{key:"_letscooee_campaign",value:this.shortID},{key:"_letscooee_content",value:this.contentID}]}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){if(xc(62,this.widget?.elems))return!0;let r=xc(11,this.widget?.elems);return r?r.conf.lg.disp===2||r.conf.sm.disp===2:!1}toString(){let e;return this.onsiteDeliveryType===Lo.POPUP?e="Popup":e=Um.toTitle(this.objective),`${e}(id=${this.shortID})`}getCartMagicVariables(){let e=ge.getCurrent(),r=Jr.sum(e.items??[],n=>n.discounts?.reduce((i,o)=>i+(o.amount??0),0)??0);return _(_(_(_({productCount:e.item_count,product_count:e.item_count},kt("amount",e.total_price/100)),kt("originalAmount",e.original_total_price/100)),kt("total_line_items_discount",r/100)),kt("total_discount",e.total_discount/100))}shouldGetVariationImmediately(){return this.hasMultiplePlacement&&!this.isProgressBar()&&!this.isSavingsBar()}shouldSkipVariation(){return this.isSingleContent()||this.isProgressBar()||this.isSavingsBar()||!!this.widget}updateEffectivePrice(e,r,n=!1){let i=ve.get().getCurrentItem();e.forEach(o=>{let s=o.selectedOrFirstVariant.value,a=s.price;if(n&&o.mID===i.mID)s.effectivePrice.value=a.d;else{let c=a.d*r/100;s.effectivePrice.value=a.d-c}})}formatCurrencyAndNumber(e){if(!e)return{};let r={discountPercentage:kh(e.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice","totalComparePrice"].map(n=>{Object.assign(r,kt(n,e[n]))}),r}};function Pw(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Lw=Uw,Mw=Hw,Bw=Ww,Vr=[],cr=[],kw=typeof Uint8Array<"u"?Uint8Array:Array,ff="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ni=0,Sg=ff.length;ni<Sg;++ni)Vr[ni]=ff[ni],cr[ff.charCodeAt(ni)]=ni;var ni,Sg;cr[45]=62;cr[95]=63;function Fg(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Uw(t){var e=Fg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Fw(t,e,r){return(e+r)*3/4-r}function Hw(t){var e,r=Fg(t),n=r[0],i=r[1],o=new kw(Fw(t,n,i)),s=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=cr[t.charCodeAt(c)]<<18|cr[t.charCodeAt(c+1)]<<12|cr[t.charCodeAt(c+2)]<<6|cr[t.charCodeAt(c+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=cr[t.charCodeAt(c)]<<2|cr[t.charCodeAt(c+1)]>>4,o[s++]=e&255),i===1&&(e=cr[t.charCodeAt(c)]<<10|cr[t.charCodeAt(c+1)]<<4|cr[t.charCodeAt(c+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function Vw(t){return Vr[t>>18&63]+Vr[t>>12&63]+Vr[t>>6&63]+Vr[t&63]}function $w(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Vw(n));return i.join("")}function Ww(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push($w(t,s,s+o>a?a:s+o));return n===1?(e=t[r-1],i.push(Vr[e>>2]+Vr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Vr[e>>10]+Vr[e>>4&63]+Vr[e<<2&63]+"=")),i.join("")}var mf={byteLength:Lw,toByteArray:Mw,fromByteArray:Bw};var jw=function(e,r,n,i,o){var s,a,c=o*8-i-1,p=(1<<c)-1,d=p>>1,f=-7,E=n?o-1:0,y=n?-1:1,T=e[r+E];for(E+=y,s=T&(1<<-f)-1,T>>=-f,f+=c;f>0;s=s*256+e[r+E],E+=y,f-=8);for(a=s&(1<<-f)-1,s>>=-f,f+=i;f>0;a=a*256+e[r+E],E+=y,f-=8);if(s===0)s=1-d;else{if(s===p)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-d}return(T?-1:1)*a*Math.pow(2,s-i)},Gw=function(e,r,n,i,o,s){var a,c,p,d=s*8-o-1,f=(1<<d)-1,E=f>>1,y=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=i?0:s-1,D=i?1:-1,N=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+E>=1?r+=y/p:r+=y*Math.pow(2,1-E),r*p>=2&&(a++,p/=2),a+E>=f?(c=0,a=f):a+E>=1?(c=(r*p-1)*Math.pow(2,o),a=a+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),a=0));o>=8;e[n+T]=c&255,T+=D,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;e[n+T]=a&255,T+=D,a/=256,d-=8);e[n+T-D]|=N*128},no={read:jw,write:Gw},Ac=Pw(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=k,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var h=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(h,l),h.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(h){if(h>n)throw new RangeError('The value "'+h+'" is invalid for option "size"');var l=new Uint8Array(h);return Object.setPrototypeOf(l,s.prototype),l}function s(h,l,u){if(typeof h=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(h)}return a(h,l,u)}s.poolSize=8192;function a(h,l,u){if(typeof h=="string")return f(h,l);if(ArrayBuffer.isView(h))return y(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h));if(We(h,ArrayBuffer)||h&&We(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(h,SharedArrayBuffer)||h&&We(h.buffer,SharedArrayBuffer)))return T(h,l,u);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var v=h.valueOf&&h.valueOf();if(v!=null&&v!==h)return s.from(v,l,u);var C=D(h);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return s.from(h[Symbol.toPrimitive]("string"),l,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h))}s.from=function(h,l,u){return a(h,l,u)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function p(h,l,u){return c(h),h<=0?o(h):l!==void 0?typeof u=="string"?o(h).fill(l,u):o(h).fill(l):o(h)}s.alloc=function(h,l,u){return p(h,l,u)};function d(h){return c(h),o(h<0?0:N(h)|0)}s.allocUnsafe=function(h){return d(h)},s.allocUnsafeSlow=function(h){return d(h)};function f(h,l){if((typeof l!="string"||l==="")&&(l="utf8"),!s.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var u=G(h,l)|0,v=o(u),C=v.write(h,l);return C!==u&&(v=v.slice(0,C)),v}function E(h){for(var l=h.length<0?0:N(h.length)|0,u=o(l),v=0;v<l;v+=1)u[v]=h[v]&255;return u}function y(h){if(We(h,Uint8Array)){var l=new Uint8Array(h);return T(l.buffer,l.byteOffset,l.byteLength)}return E(h)}function T(h,l,u){if(l<0||h.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<l+(u||0))throw new RangeError('"length" is outside of buffer bounds');var v;return l===void 0&&u===void 0?v=new Uint8Array(h):u===void 0?v=new Uint8Array(h,l):v=new Uint8Array(h,l,u),Object.setPrototypeOf(v,s.prototype),v}function D(h){if(s.isBuffer(h)){var l=N(h.length)|0,u=o(l);return u.length===0||h.copy(u,0,0,l),u}if(h.length!==void 0)return typeof h.length!="number"||Ne(h.length)?o(0):E(h);if(h.type==="Buffer"&&Array.isArray(h.data))return E(h.data)}function N(h){if(h>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return h|0}function k(h){return+h!=h&&(h=0),s.alloc(+h)}s.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==s.prototype},s.compare=function(l,u){if(We(l,Uint8Array)&&(l=s.from(l,l.offset,l.byteLength)),We(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),!s.isBuffer(l)||!s.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===u)return 0;for(var v=l.length,C=u.length,O=0,W=Math.min(v,C);O<W;++O)if(l[O]!==u[O]){v=l[O],C=u[O];break}return v<C?-1:C<v?1:0},s.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(l,u){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return s.alloc(0);var v;if(u===void 0)for(u=0,v=0;v<l.length;++v)u+=l[v].length;var C=s.allocUnsafe(u),O=0;for(v=0;v<l.length;++v){var W=l[v];if(We(W,Uint8Array))O+W.length>C.length?s.from(W).copy(C,O):Uint8Array.prototype.set.call(C,W,O);else if(s.isBuffer(W))W.copy(C,O);else throw new TypeError('"list" argument must be an Array of Buffers');O+=W.length}return C};function G(h,l){if(s.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||We(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(h));var u=h.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&u===0)return 0;for(var C=!1;;)switch(l){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return St(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return $e(h).length;default:if(C)return v?-1:St(h).length;l=(""+l).toLowerCase(),C=!0}}s.byteLength=G;function P(h,l,u){var v=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,l>>>=0,u<=l))return"";for(h||(h="utf8");;)switch(h){case"hex":return $(this,l,u);case"utf8":case"utf-8":return qe(this,l,u);case"ascii":return A(this,l,u);case"latin1":case"binary":return R(this,l,u);case"base64":return Ae(this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,l,u);default:if(v)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),v=!0}}s.prototype._isBuffer=!0;function Q(h,l,u){var v=h[l];h[l]=h[u],h[u]=v}s.prototype.swap16=function(){var l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<l;u+=2)Q(this,u,u+1);return this},s.prototype.swap32=function(){var l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<l;u+=4)Q(this,u,u+3),Q(this,u+1,u+2);return this},s.prototype.swap64=function(){var l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<l;u+=8)Q(this,u,u+7),Q(this,u+1,u+6),Q(this,u+2,u+5),Q(this,u+3,u+4);return this},s.prototype.toString=function(){var l=this.length;return l===0?"":arguments.length===0?qe(this,0,l):P.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(l){if(!s.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:s.compare(this,l)===0},s.prototype.inspect=function(){var l="",u=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(l+=" ... "),"<Buffer "+l+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(l,u,v,C,O){if(We(l,Uint8Array)&&(l=s.from(l,l.offset,l.byteLength)),!s.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(l));if(u===void 0&&(u=0),v===void 0&&(v=l?l.length:0),C===void 0&&(C=0),O===void 0&&(O=this.length),u<0||v>l.length||C<0||O>this.length)throw new RangeError("out of range index");if(C>=O&&u>=v)return 0;if(C>=O)return-1;if(u>=v)return 1;if(u>>>=0,v>>>=0,C>>>=0,O>>>=0,this===l)return 0;for(var W=O-C,ue=v-u,be=Math.min(W,ue),ye=this.slice(C,O),ke=l.slice(u,v),He=0;He<be;++He)if(ye[He]!==ke[He]){W=ye[He],ue=ke[He];break}return W<ue?-1:ue<W?1:0};function _e(h,l,u,v,C){if(h.length===0)return-1;if(typeof u=="string"?(v=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,Ne(u)&&(u=C?0:h.length-1),u<0&&(u=h.length+u),u>=h.length){if(C)return-1;u=h.length-1}else if(u<0)if(C)u=0;else return-1;if(typeof l=="string"&&(l=s.from(l,v)),s.isBuffer(l))return l.length===0?-1:X(h,l,u,v,C);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(h,l,u):Uint8Array.prototype.lastIndexOf.call(h,l,u):X(h,[l],u,v,C);throw new TypeError("val must be string, number or Buffer")}function X(h,l,u,v,C){var O=1,W=h.length,ue=l.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(h.length<2||l.length<2)return-1;O=2,W/=2,ue/=2,u/=2}function be(mr,Xr){return O===1?mr[Xr]:mr.readUInt16BE(Xr*O)}var ye;if(C){var ke=-1;for(ye=u;ye<W;ye++)if(be(h,ye)===be(l,ke===-1?0:ye-ke)){if(ke===-1&&(ke=ye),ye-ke+1===ue)return ke*O}else ke!==-1&&(ye-=ye-ke),ke=-1}else for(u+ue>W&&(u=W-ue),ye=u;ye>=0;ye--){for(var He=!0,ot=0;ot<ue;ot++)if(be(h,ye+ot)!==be(l,ot)){He=!1;break}if(He)return ye}return-1}s.prototype.includes=function(l,u,v){return this.indexOf(l,u,v)!==-1},s.prototype.indexOf=function(l,u,v){return _e(this,l,u,v,!0)},s.prototype.lastIndexOf=function(l,u,v){return _e(this,l,u,v,!1)};function ce(h,l,u,v){u=Number(u)||0;var C=h.length-u;v?(v=Number(v),v>C&&(v=C)):v=C;var O=l.length;v>O/2&&(v=O/2);for(var W=0;W<v;++W){var ue=parseInt(l.substr(W*2,2),16);if(Ne(ue))return W;h[u+W]=ue}return W}function se(h,l,u,v){return De(St(l,h.length-u),h,u,v)}function fe(h,l,u,v){return De(ct(l),h,u,v)}function Be(h,l,u,v){return De($e(l),h,u,v)}function Te(h,l,u,v){return De(Se(l,h.length-u),h,u,v)}s.prototype.write=function(l,u,v,C){if(u===void 0)C="utf8",v=this.length,u=0;else if(v===void 0&&typeof u=="string")C=u,v=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(v)?(v=v>>>0,C===void 0&&(C="utf8")):(C=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var O=this.length-u;if((v===void 0||v>O)&&(v=O),l.length>0&&(v<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");for(var W=!1;;)switch(C){case"hex":return ce(this,l,u,v);case"utf8":case"utf-8":return se(this,l,u,v);case"ascii":case"latin1":case"binary":return fe(this,l,u,v);case"base64":return Be(this,l,u,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,l,u,v);default:if(W)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),W=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ae(h,l,u){return l===0&&u===h.length?mf.fromByteArray(h):mf.fromByteArray(h.slice(l,u))}function qe(h,l,u){u=Math.min(h.length,u);for(var v=[],C=l;C<u;){var O=h[C],W=null,ue=O>239?4:O>223?3:O>191?2:1;if(C+ue<=u){var be,ye,ke,He;switch(ue){case 1:O<128&&(W=O);break;case 2:be=h[C+1],(be&192)===128&&(He=(O&31)<<6|be&63,He>127&&(W=He));break;case 3:be=h[C+1],ye=h[C+2],(be&192)===128&&(ye&192)===128&&(He=(O&15)<<12|(be&63)<<6|ye&63,He>2047&&(He<55296||He>57343)&&(W=He));break;case 4:be=h[C+1],ye=h[C+2],ke=h[C+3],(be&192)===128&&(ye&192)===128&&(ke&192)===128&&(He=(O&15)<<18|(be&63)<<12|(ye&63)<<6|ke&63,He>65535&&He<1114112&&(W=He))}}W===null?(W=65533,ue=1):W>65535&&(W-=65536,v.push(W>>>10&1023|55296),W=56320|W&1023),v.push(W),C+=ue}return Ft(v)}var et=4096;function Ft(h){var l=h.length;if(l<=et)return String.fromCharCode.apply(String,h);for(var u="",v=0;v<l;)u+=String.fromCharCode.apply(String,h.slice(v,v+=et));return u}function A(h,l,u){var v="";u=Math.min(h.length,u);for(var C=l;C<u;++C)v+=String.fromCharCode(h[C]&127);return v}function R(h,l,u){var v="";u=Math.min(h.length,u);for(var C=l;C<u;++C)v+=String.fromCharCode(h[C]);return v}function $(h,l,u){var v=h.length;(!l||l<0)&&(l=0),(!u||u<0||u>v)&&(u=v);for(var C="",O=l;O<u;++O)C+=jt[h[O]];return C}function U(h,l,u){for(var v=h.slice(l,u),C="",O=0;O<v.length-1;O+=2)C+=String.fromCharCode(v[O]+v[O+1]*256);return C}s.prototype.slice=function(l,u){var v=this.length;l=~~l,u=u===void 0?v:~~u,l<0?(l+=v,l<0&&(l=0)):l>v&&(l=v),u<0?(u+=v,u<0&&(u=0)):u>v&&(u=v),u<l&&(u=l);var C=this.subarray(l,u);return Object.setPrototypeOf(C,s.prototype),C};function H(h,l,u){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+l>u)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=this[l],O=1,W=0;++W<u&&(O*=256);)C+=this[l+W]*O;return C},s.prototype.readUintBE=s.prototype.readUIntBE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=this[l+--u],O=1;u>0&&(O*=256);)C+=this[l+--u]*O;return C},s.prototype.readUint8=s.prototype.readUInt8=function(l,u){return l=l>>>0,u||H(l,1,this.length),this[l]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(l,u){return l=l>>>0,u||H(l,2,this.length),this[l]|this[l+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(l,u){return l=l>>>0,u||H(l,2,this.length),this[l]<<8|this[l+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(l,u){return l=l>>>0,u||H(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(l,u){return l=l>>>0,u||H(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},s.prototype.readIntLE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=this[l],O=1,W=0;++W<u&&(O*=256);)C+=this[l+W]*O;return O*=128,C>=O&&(C-=Math.pow(2,8*u)),C},s.prototype.readIntBE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=u,O=1,W=this[l+--C];C>0&&(O*=256);)W+=this[l+--C]*O;return O*=128,W>=O&&(W-=Math.pow(2,8*u)),W},s.prototype.readInt8=function(l,u){return l=l>>>0,u||H(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},s.prototype.readInt16LE=function(l,u){l=l>>>0,u||H(l,2,this.length);var v=this[l]|this[l+1]<<8;return v&32768?v|4294901760:v},s.prototype.readInt16BE=function(l,u){l=l>>>0,u||H(l,2,this.length);var v=this[l+1]|this[l]<<8;return v&32768?v|4294901760:v},s.prototype.readInt32LE=function(l,u){return l=l>>>0,u||H(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},s.prototype.readInt32BE=function(l,u){return l=l>>>0,u||H(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},s.prototype.readFloatLE=function(l,u){return l=l>>>0,u||H(l,4,this.length),no.read(this,l,!0,23,4)},s.prototype.readFloatBE=function(l,u){return l=l>>>0,u||H(l,4,this.length),no.read(this,l,!1,23,4)},s.prototype.readDoubleLE=function(l,u){return l=l>>>0,u||H(l,8,this.length),no.read(this,l,!0,52,8)},s.prototype.readDoubleBE=function(l,u){return l=l>>>0,u||H(l,8,this.length),no.read(this,l,!1,52,8)};function ne(h,l,u,v,C,O){if(!s.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>C||l<O)throw new RangeError('"value" argument is out of bounds');if(u+v>h.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(l,u,v,C){if(l=+l,u=u>>>0,v=v>>>0,!C){var O=Math.pow(2,8*v)-1;ne(this,l,u,v,O,0)}var W=1,ue=0;for(this[u]=l&255;++ue<v&&(W*=256);)this[u+ue]=l/W&255;return u+v},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(l,u,v,C){if(l=+l,u=u>>>0,v=v>>>0,!C){var O=Math.pow(2,8*v)-1;ne(this,l,u,v,O,0)}var W=v-1,ue=1;for(this[u+W]=l&255;--W>=0&&(ue*=256);)this[u+W]=l/ue&255;return u+v},s.prototype.writeUint8=s.prototype.writeUInt8=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,1,255,0),this[u]=l&255,u+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,65535,0),this[u]=l&255,this[u+1]=l>>>8,u+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,65535,0),this[u]=l>>>8,this[u+1]=l&255,u+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,4294967295,0),this[u+3]=l>>>24,this[u+2]=l>>>16,this[u+1]=l>>>8,this[u]=l&255,u+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,4294967295,0),this[u]=l>>>24,this[u+1]=l>>>16,this[u+2]=l>>>8,this[u+3]=l&255,u+4},s.prototype.writeIntLE=function(l,u,v,C){if(l=+l,u=u>>>0,!C){var O=Math.pow(2,8*v-1);ne(this,l,u,v,O-1,-O)}var W=0,ue=1,be=0;for(this[u]=l&255;++W<v&&(ue*=256);)l<0&&be===0&&this[u+W-1]!==0&&(be=1),this[u+W]=(l/ue>>0)-be&255;return u+v},s.prototype.writeIntBE=function(l,u,v,C){if(l=+l,u=u>>>0,!C){var O=Math.pow(2,8*v-1);ne(this,l,u,v,O-1,-O)}var W=v-1,ue=1,be=0;for(this[u+W]=l&255;--W>=0&&(ue*=256);)l<0&&be===0&&this[u+W+1]!==0&&(be=1),this[u+W]=(l/ue>>0)-be&255;return u+v},s.prototype.writeInt8=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,1,127,-128),l<0&&(l=255+l+1),this[u]=l&255,u+1},s.prototype.writeInt16LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,32767,-32768),this[u]=l&255,this[u+1]=l>>>8,u+2},s.prototype.writeInt16BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,32767,-32768),this[u]=l>>>8,this[u+1]=l&255,u+2},s.prototype.writeInt32LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,2147483647,-2147483648),this[u]=l&255,this[u+1]=l>>>8,this[u+2]=l>>>16,this[u+3]=l>>>24,u+4},s.prototype.writeInt32BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[u]=l>>>24,this[u+1]=l>>>16,this[u+2]=l>>>8,this[u+3]=l&255,u+4};function he(h,l,u,v,C,O){if(u+v>h.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function Ke(h,l,u,v,C){return l=+l,u=u>>>0,C||he(h,l,u,4),no.write(h,l,u,v,23,4),u+4}s.prototype.writeFloatLE=function(l,u,v){return Ke(this,l,u,!0,v)},s.prototype.writeFloatBE=function(l,u,v){return Ke(this,l,u,!1,v)};function nt(h,l,u,v,C){return l=+l,u=u>>>0,C||he(h,l,u,8),no.write(h,l,u,v,52,8),u+8}s.prototype.writeDoubleLE=function(l,u,v){return nt(this,l,u,!0,v)},s.prototype.writeDoubleBE=function(l,u,v){return nt(this,l,u,!1,v)},s.prototype.copy=function(l,u,v,C){if(!s.isBuffer(l))throw new TypeError("argument should be a Buffer");if(v||(v=0),!C&&C!==0&&(C=this.length),u>=l.length&&(u=l.length),u||(u=0),C>0&&C<v&&(C=v),C===v||l.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),l.length-u<C-v&&(C=l.length-u+v);var O=C-v;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,v,C):Uint8Array.prototype.set.call(l,this.subarray(v,C),u),O},s.prototype.fill=function(l,u,v,C){if(typeof l=="string"){if(typeof u=="string"?(C=u,u=0,v=this.length):typeof v=="string"&&(C=v,v=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!s.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(l.length===1){var O=l.charCodeAt(0);(C==="utf8"&&O<128||C==="latin1")&&(l=O)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(u<0||this.length<u||this.length<v)throw new RangeError("Out of range index");if(v<=u)return this;u=u>>>0,v=v===void 0?this.length:v>>>0,l||(l=0);var W;if(typeof l=="number")for(W=u;W<v;++W)this[W]=l;else{var ue=s.isBuffer(l)?l:s.from(l,C),be=ue.length;if(be===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(W=0;W<v-u;++W)this[W+u]=ue[W%be]}return this};var it=/[^+/0-9A-Za-z-_]/g;function wt(h){if(h=h.split("=")[0],h=h.trim().replace(it,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function St(h,l){l=l||1/0;for(var u,v=h.length,C=null,O=[],W=0;W<v;++W){if(u=h.charCodeAt(W),u>55295&&u<57344){if(!C){if(u>56319){(l-=3)>-1&&O.push(239,191,189);continue}else if(W+1===v){(l-=3)>-1&&O.push(239,191,189);continue}C=u;continue}if(u<56320){(l-=3)>-1&&O.push(239,191,189),C=u;continue}u=(C-55296<<10|u-56320)+65536}else C&&(l-=3)>-1&&O.push(239,191,189);if(C=null,u<128){if((l-=1)<0)break;O.push(u)}else if(u<2048){if((l-=2)<0)break;O.push(u>>6|192,u&63|128)}else if(u<65536){if((l-=3)<0)break;O.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((l-=4)<0)break;O.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return O}function ct(h){for(var l=[],u=0;u<h.length;++u)l.push(h.charCodeAt(u)&255);return l}function Se(h,l){for(var u,v,C,O=[],W=0;W<h.length&&!((l-=2)<0);++W)u=h.charCodeAt(W),v=u>>8,C=u%256,O.push(C),O.push(v);return O}function $e(h){return mf.toByteArray(wt(h))}function De(h,l,u,v){for(var C=0;C<v&&!(C+u>=l.length||C>=h.length);++C)l[C+u]=h[C];return C}function We(h,l){return h instanceof l||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===l.name}function Ne(h){return h!==h}var jt=(function(){for(var h="0123456789abcdef",l=new Array(256),u=0;u<16;++u)for(var v=u*16,C=0;C<16;++C)l[v+C]=h[u]+h[C];return l})()}),Ce=Ac.Buffer;Ac.SlowBuffer;Ac.INSPECT_MAX_BYTES;Ac.kMaxLength;var vf=function(e,r){return vf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},vf(e,r)};function Dc(t,e){vf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var oi=(function(t){Dc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e})(Error),Qe=(function(t){Dc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e})(TypeError);function Cc(t){return t&&t.Math==Math&&t}function Hg(){return Cc(typeof globalThis=="object"&&globalThis)||Cc(typeof window=="object"&&window)||Cc(typeof self=="object"&&self)||Cc(typeof global=="object"&&global)||Function("return this")()}function zw(){var t=Hg();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var qw=function(e){var r=zw()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var n=Ce.alloc(e),i=0;i<e;++i)n[i]=Math.floor(Math.random()*256);return n},Yw=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(Ce.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(Ce.alloc(e))}:qw}},Vg=Yw();function Kw(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function _f(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function Xw(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Jw(t){return fs(t)&&Object.prototype.toString.call(t)==="[object Date]"}function fs(t){return typeof t=="object"&&t!==null}function Nc(t,e){var r=!1;function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return r||(console.warn(e),r=!0),t.apply(this,i)}return n}function Rc(t){if(ArrayBuffer.isView(t))return Ce.from(t.buffer,t.byteOffset,t.byteLength);if(Kw(t))return Ce.from(t);throw new Qe("Must use either Buffer or TypedArray")}var Qw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,$g=function(t){return typeof t=="string"&&Qw.test(t)},Ef=function(t){if(!$g(t))throw new Qe('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return Ce.from(e,"hex")},Ig=function(t,e){return e===void 0&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")};var YB=Math.pow(2,63)-1,KB=-Math.pow(2,63),Zw=Math.pow(2,53),eS=-Math.pow(2,53);var Wg=4;var si=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(e!=null&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer)&&!Array.isArray(e))throw new Qe("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??t.BSON_BINARY_SUBTYPE_DEFAULT,e==null?(this.buffer=Ce.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=Ce.from(e,"binary"):Array.isArray(e)?this.buffer=Ce.from(e):this.buffer=Rc(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new Qe("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new Qe("only accepts single character Uint8Array or Array");var r;if(typeof e=="string"?r=e.charCodeAt(0):typeof e=="number"?r=e:r=e[0],r<0||r>255)throw new Qe("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=Ce.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(e,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+e.length){var n=Ce.alloc(this.buffer.length+e.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(e)?(this.buffer.set(Rc(e),r),this.position=r+e.byteLength>this.position?r+e.length:this.position):typeof e=="string"&&(this.buffer.write(e,r,e.length,"binary"),this.position=r+e.length>this.position?r+e.length:this.position)},t.prototype.read=function(e,r){return r=r&&r>0?r:this.position,this.buffer.slice(e,e+r)},t.prototype.value=function(e){return e=!!e,e&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new Tg(this.buffer.slice(0,this.position));throw new oi('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,r){r=r||{};var n,i;if("$binary"in e?r.legacy&&typeof e.$binary=="string"&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=Ce.from(e.$binary,"base64")):typeof e.$binary!="string"&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=Ce.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=Ef(e.$uuid)),!n)throw new Qe("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return i===Wg?new Tg(n):new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t})();Object.defineProperty(si.prototype,"_bsontype",{value:"Binary"});var df=16,Tg=(function(t){Dc(e,t);function e(r){var n=this,i,o;if(r==null)i=e.generate();else if(r instanceof e)i=Ce.from(r.buffer),o=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===df)i=Rc(r);else if(typeof r=="string")i=Ef(r);else throw new Qe("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=t.call(this,i,Wg)||this,n.__id=o,n}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,e.cacheHexString&&(this.__id=Ig(r))},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(r){if(r===void 0&&(r=!0),e.cacheHexString&&this.__id)return this.__id;var n=Ig(this.id,r);return e.cacheHexString&&(this.__id=n),n},e.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(r){if(!r)return!1;if(r instanceof e)return r.id.equals(this.id);try{return new e(r).id.equals(this.id)}catch{return!1}},e.prototype.toBinary=function(){return new si(this.id,si.SUBTYPE_UUID)},e.generate=function(){var r=Vg(df);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ce.from(r)},e.isValid=function(r){return r?r instanceof e?!0:typeof r=="string"?$g(r):_f(r)?r.length!==df?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},e.createFromHexString=function(r){var n=Ef(r);return new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},e})(si),Oc=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},t})();Object.defineProperty(Oc.prototype,"_bsontype",{value:"Code"});function tS(t){return fs(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var us=(function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var o=e.split(".");o.length===2&&(n=o.shift(),e=o.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(e.$db=this.db),e},t.prototype.toExtendedJSON=function(e){e=e||{};var r={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t})();Object.defineProperty(us.prototype,"_bsontype",{value:"DBRef"});var ar=void 0;try{ar=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var xg=65536,rS=1<<24,oo=xg*xg,jg=oo*oo,Cg=jg/2,Rg={},Ag={},ie=(function(){function t(e,r,n){if(e===void 0&&(e=0),!(this instanceof t))return new t(e,r,n);typeof e=="bigint"?Object.assign(this,t.fromBigInt(e,!!r)):typeof e=="string"?Object.assign(this,t.fromString(e,!!r)):(this.low=e|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,i,o;return r?(e>>>=0,(o=0<=e&&e<256)&&(i=Ag[e],i)?i:(n=t.fromBits(e,(e|0)<0?-1:0,!0),o&&(Ag[e]=n),n)):(e|=0,(o=-128<=e&&e<128)&&(i=Rg[e],i)?i:(n=t.fromBits(e,e<0?-1:0,!1),o&&(Rg[e]=n),n))},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=jg)return t.MAX_UNSIGNED_VALUE}else{if(e<=-Cg)return t.MIN_VALUE;if(e+1>=Cg)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%oo|0,e/oo|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return t.fromString(e.substring(1),r,n).neg();for(var o=t.fromNumber(Math.pow(n,8)),s=t.ZERO,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),p=parseInt(e.substring(a,a+c),n);if(c<8){var d=t.fromNumber(Math.pow(n,c));s=s.mul(d).add(t.fromNumber(p))}else s=s.mul(o),s=s.add(t.fromNumber(p))}return s.unsigned=r,s},t.fromBytes=function(e,r,n){return n?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},t.isLong=function(e){return fs(e)&&e.__isLong__===!0},t.fromValue=function(e,r){return typeof e=="number"?t.fromNumber(e,r):typeof e=="string"?t.fromString(e,r):t.fromBits(e.low,e.high,typeof r=="boolean"?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,o=this.low&65535,s=e.high>>>16,a=e.high&65535,c=e.low>>>16,p=e.low&65535,d=0,f=0,E=0,y=0;return y+=o+p,E+=y>>>16,y&=65535,E+=i+c,f+=E>>>16,E&=65535,f+=n+a,d+=f>>>16,f&=65535,d+=r+s,d&=65535,t.fromBits(E<<16|y,d<<16|f,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(e){return this.compare(e)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(ar){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?ar.div_u:ar.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,ar.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;o=t.UZERO}else{if(this.eq(t.MIN_VALUE)){if(e.eq(t.ONE)||e.eq(t.NEG_ONE))return t.MIN_VALUE;if(e.eq(t.MIN_VALUE))return t.ONE;var s=this.shr(1);return n=s.div(e).shl(1),n.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),o=n.add(i.div(e)),o)}else if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:Math.pow(2,a-48),p=t.fromNumber(n),d=p.mul(e);d.isNegative()||d.gt(i);)n-=c,p=t.fromNumber(n,this.unsigned),d=p.mul(e);p.isZero()&&(p=t.ONE),o=o.add(p),i=i.sub(d)}return o},t.prototype.div=function(e){return this.divide(e)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},t.prototype.eq=function(e){return this.equals(e)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(e&1<<r)===0;r--);return this.high!==0?r+33:r+1},t.prototype.greaterThan=function(e){return this.comp(e)>0},t.prototype.gt=function(e){return this.greaterThan(e)},t.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},t.prototype.gte=function(e){return this.greaterThanOrEqual(e)},t.prototype.ge=function(e){return this.greaterThanOrEqual(e)},t.prototype.isEven=function(){return(this.low&1)===0},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return(this.low&1)===1},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return this.high===0&&this.low===0},t.prototype.lessThan=function(e){return this.comp(e)<0},t.prototype.lt=function(e){return this.lessThan(e)},t.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},t.prototype.lte=function(e){return this.lessThanOrEqual(e)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),ar){var r=(this.unsigned?ar.rem_u:ar.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,ar.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(e){return this.modulo(e)},t.prototype.rem=function(e){return this.modulo(e)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),ar){var r=ar.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,ar.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,o=this.low>>>16,s=this.low&65535,a=e.high>>>16,c=e.high&65535,p=e.low>>>16,d=e.low&65535,f=0,E=0,y=0,T=0;return T+=s*d,y+=T>>>16,T&=65535,y+=o*d,E+=y>>>16,y&=65535,y+=s*p,E+=y>>>16,y&=65535,E+=i*d,f+=E>>>16,E&=65535,E+=o*p,f+=E>>>16,E&=65535,E+=s*c,f+=E>>>16,E&=65535,f+=n*d+i*p+o*c+s*a,f&=65535,t.fromBits(y<<16|T,f<<16|E,this.unsigned)},t.prototype.mul=function(e){return this.multiply(e)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(e){return!this.equals(e)},t.prototype.neq=function(e){return this.notEquals(e)},t.prototype.ne=function(e){return this.notEquals(e)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(e){return this.shiftLeft(e)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(e){return this.shiftRight(e)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),e&=63,e===0)return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}else return e===32?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},t.prototype.shru=function(e){return this.shiftRightUnsigned(e)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(e){return this.subtract(e)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*oo+(this.low>>>0):this.high*oo+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},t.prototype.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(t.MIN_VALUE)){var r=t.fromNumber(e),n=this.div(r),i=n.mul(r).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var o=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,a="";;){var c=s.div(o),p=s.sub(c.mul(o)).toInt()>>>0,d=p.toString(e);if(s=c,s.isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(e){return this.lessThanOrEqual(e)},t.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(rS),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t})();Object.defineProperty(ie.prototype,"__isLong__",{value:!0});Object.defineProperty(ie.prototype,"_bsontype",{value:"Long"});var nS=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,iS=/^(\+|-)?(Infinity|inf)$/i,oS=/^(\+|-)?NaN$/i,ls=6111,hf=-6176,Dg=6176,sS=34,gf=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Ng=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Og=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),aS=/^([-+])?(\d+)?$/,cS=31,Pg=16383,lS=30,uS=31;function Lg(t){return!isNaN(parseInt(t,10))}function pS(t){var e=ie.fromNumber(1e9),r=ie.fromNumber(0);if(!t.parts[0]&&!t.parts[1]&&!t.parts[2]&&!t.parts[3])return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new ie(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function fS(t,e){if(!t&&!e)return{high:ie.fromNumber(0),low:ie.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new ie(t.getLowBits(),0),i=e.shiftRightUnsigned(32),o=new ie(e.getLowBits(),0),s=r.multiply(i),a=r.multiply(o),c=n.multiply(i),p=n.multiply(o);return s=s.add(a.shiftRightUnsigned(32)),a=new ie(a.getLowBits(),0).add(c).add(p.shiftRightUnsigned(32)),s=s.add(a.shiftRightUnsigned(32)),p=a.shiftLeft(32).add(new ie(p.getLowBits(),0)),{high:s,low:p}}function mS(t,e){var r=t.high>>>0,n=e.high>>>0;if(r<n)return!0;if(r===n){var i=t.low>>>0,o=e.low>>>0;if(i<o)return!0}return!1}function io(t,e){throw new Qe('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var bf=(function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(_f(e)){if(e.byteLength!==16)throw new Qe("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new Qe("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var r=!1,n=!1,i=!1,o=0,s=0,a=0,c=0,p=0,d=[0],f=0,E=0,y=0,T=0,D=0,N=0,k=new ie(0,0),G=new ie(0,0),P=0,Q=0;if(e.length>=7e3)throw new Qe(""+e+" not a valid Decimal128 string");var _e=e.match(nS),X=e.match(iS),ce=e.match(oS);if(!_e&&!X&&!ce||e.length===0)throw new Qe(""+e+" not a valid Decimal128 string");if(_e){var se=_e[2],fe=_e[4],Be=_e[5],Te=_e[6];fe&&Te===void 0&&io(e,"missing exponent power"),fe&&se===void 0&&io(e,"missing exponent base"),fe===void 0&&(Be||Te)&&io(e,"missing e before exponent")}if((e[Q]==="+"||e[Q]==="-")&&(r=e[Q++]==="-"),!Lg(e[Q])&&e[Q]!=="."){if(e[Q]==="i"||e[Q]==="I")return new t(Ce.from(r?Ng:Og));if(e[Q]==="N")return new t(Ce.from(gf))}for(;Lg(e[Q])||e[Q]===".";){if(e[Q]==="."){n&&io(e,"contains multiple periods"),n=!0,Q=Q+1;continue}f<34&&(e[Q]!=="0"||i)&&(i||(p=s),i=!0,d[E++]=parseInt(e[Q],10),f=f+1),i&&(a=a+1),n&&(c=c+1),s=s+1,Q=Q+1}if(n&&!s)throw new Qe(""+e+" not a valid Decimal128 string");if(e[Q]==="e"||e[Q]==="E"){var Ae=e.substr(++Q).match(aS);if(!Ae||!Ae[2])return new t(Ce.from(gf));D=parseInt(Ae[0],10),Q=Q+Ae[0].length}if(e[Q])return new t(Ce.from(gf));if(y=0,!f)y=0,T=0,d[0]=0,a=1,f=1,o=0;else if(T=f-1,o=a,o!==1)for(;d[p+o-1]===0;)o=o-1;for(D<=c&&c-D>16384?D=hf:D=D-c;D>ls;){if(T=T+1,T-y>sS){var qe=d.join("");if(qe.match(/^0+$/)){D=ls;break}io(e,"overflow")}D=D-1}for(;D<hf||f<a;){if(T===0&&o<f){D=hf,o=0;break}if(f<a?a=a-1:T=T-1,D<ls)D=D+1;else{var qe=d.join("");if(qe.match(/^0+$/)){D=ls;break}io(e,"overflow")}}if(T-y+1<o){var et=s;n&&(p=p+1,et=et+1),r&&(p=p+1,et=et+1);var Ft=parseInt(e[p+T+1],10),A=0;if(Ft>=5&&(A=1,Ft===5)){for(A=d[T]%2===1?1:0,N=p+T+2;N<et;N++)if(parseInt(e[N],10)){A=1;break}}if(A){for(var R=T;R>=0;R--)if(++d[R]>9&&(d[R]=0,R===0))if(D<ls)D=D+1,d[R]=1;else return new t(Ce.from(r?Ng:Og))}}if(k=ie.fromNumber(0),G=ie.fromNumber(0),o===0)k=ie.fromNumber(0),G=ie.fromNumber(0);else if(T-y<17){var R=y;for(G=ie.fromNumber(d[R++]),k=new ie(0,0);R<=T;R++)G=G.multiply(ie.fromNumber(10)),G=G.add(ie.fromNumber(d[R]))}else{var R=y;for(k=ie.fromNumber(d[R++]);R<=T-17;R++)k=k.multiply(ie.fromNumber(10)),k=k.add(ie.fromNumber(d[R]));for(G=ie.fromNumber(d[R++]);R<=T;R++)G=G.multiply(ie.fromNumber(10)),G=G.add(ie.fromNumber(d[R]))}var $=fS(k,ie.fromString("100000000000000000"));$.low=$.low.add(G),mS($.low,G)&&($.high=$.high.add(ie.fromNumber(1))),P=D+Dg;var U={low:ie.fromNumber(0),high:ie.fromNumber(0)};$.high.shiftRightUnsigned(49).and(ie.fromNumber(1)).equals(ie.fromNumber(1))?(U.high=U.high.or(ie.fromNumber(3).shiftLeft(61)),U.high=U.high.or(ie.fromNumber(P).and(ie.fromNumber(16383).shiftLeft(47))),U.high=U.high.or($.high.and(ie.fromNumber(0x7fffffffffff)))):(U.high=U.high.or(ie.fromNumber(P&16383).shiftLeft(49)),U.high=U.high.or($.high.and(ie.fromNumber(562949953421311)))),U.low=$.low,r&&(U.high=U.high.or(ie.fromString("9223372036854775808")));var H=Ce.alloc(16);return Q=0,H[Q++]=U.low.low&255,H[Q++]=U.low.low>>8&255,H[Q++]=U.low.low>>16&255,H[Q++]=U.low.low>>24&255,H[Q++]=U.low.high&255,H[Q++]=U.low.high>>8&255,H[Q++]=U.low.high>>16&255,H[Q++]=U.low.high>>24&255,H[Q++]=U.high.low&255,H[Q++]=U.high.low>>8&255,H[Q++]=U.high.low>>16&255,H[Q++]=U.high.low>>24&255,H[Q++]=U.high.high&255,H[Q++]=U.high.high>>8&255,H[Q++]=U.high.high>>16&255,H[Q++]=U.high.high>>24&255,new t(H)},t.prototype.toString=function(){for(var e,r=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var o=0,s=!1,a,c={parts:[0,0,0,0]},p,d,f=[];o=0;var E=this.bytes,y=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,T=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,D=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,N=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24;o=0;var k={low:new ie(y,T),high:new ie(D,N)};k.high.lessThan(ie.ZERO)&&f.push("-");var G=N>>26&cS;if(G>>3===3){if(G===lS)return f.join("")+"Infinity";if(G===uS)return"NaN";e=N>>15&Pg,a=8+(N>>14&1)}else a=N>>14&7,e=N>>17&Pg;var P=e-Dg;if(c.parts[0]=(N&16383)+((a&15)<<14),c.parts[1]=D,c.parts[2]=T,c.parts[3]=y,c.parts[0]===0&&c.parts[1]===0&&c.parts[2]===0&&c.parts[3]===0)s=!0;else for(d=3;d>=0;d--){var Q=0,_e=pS(c);if(c=_e.quotient,Q=_e.rem.low,!!Q)for(p=8;p>=0;p--)n[d*9+p]=Q%10,Q=Math.floor(Q/10)}if(s)r=1,n[o]=0;else for(r=36;!n[o];)r=r-1,o=o+1;var X=r-1+P;if(X>=34||X<=-7||P>0){if(r>34)return f.push("".concat(0)),P>0?f.push("E+".concat(P)):P<0&&f.push("E".concat(P)),f.join("");f.push("".concat(n[o++])),r=r-1,r&&f.push(".");for(var i=0;i<r;i++)f.push("".concat(n[o++]));f.push("E"),X>0?f.push("+".concat(X)):f.push("".concat(X))}else if(P>=0)for(var i=0;i<r;i++)f.push("".concat(n[o++]));else{var ce=r+P;if(ce>0)for(var i=0;i<ce;i++)f.push("".concat(n[o++]));else f.push("0");for(f.push(".");ce++<0;)f.push("0");for(var i=0;i<r-Math.max(ce-1,0);i++)f.push("".concat(n[o++]))}return f.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t})();Object.defineProperty(bf.prototype,"_bsontype",{value:"Decimal128"});var Pc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},t})();Object.defineProperty(Pc.prototype,"_bsontype",{value:"Double"});var Lc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e|0}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t})();Object.defineProperty(Lc.prototype,"_bsontype",{value:"Int32"});var wf=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t})();Object.defineProperty(wf.prototype,"_bsontype",{value:"MaxKey"});var Sf=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t})();Object.defineProperty(Sf.prototype,"_bsontype",{value:"MinKey"});var dS=new RegExp("^[0-9a-fA-F]{24}$"),ii=null,Hr=Symbol("id"),Et=(function(){function t(e){if(!(this instanceof t))return new t(e);var r;if(typeof e=="object"&&e&&"id"in e){if(typeof e.id!="string"&&!ArrayBuffer.isView(e.id))throw new Qe("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?r=Ce.from(e.toHexString(),"hex"):r=e.id}else r=e;if(r==null||typeof r=="number")this[Hr]=t.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[Hr]=r instanceof Ce?r:Rc(r);else if(typeof r=="string")if(r.length===12){var n=Ce.from(r);if(n.byteLength===12)this[Hr]=n;else throw new Qe("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&dS.test(r))this[Hr]=Ce.from(r,"hex");else throw new Qe("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Qe("Argument passed in does not match the accepted types");t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[Hr]},set:function(e){this[Hr]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){typeof e!="number"&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=Ce.alloc(12);return n.writeUInt32BE(e,0),ii===null&&(ii=Vg(5)),n[4]=ii[0],n[5]=ii[1],n[6]=ii[2],n[7]=ii[3],n[8]=ii[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(e==null)return!1;if(e instanceof t)return this[Hr][11]===e[Hr][11]&&this[Hr].equals(e[Hr]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&_f(this.id))return e===Ce.prototype.toString.call(this.id,"latin1");if(typeof e=="string"&&t.isValid(e)&&e.length===24)return e.toLowerCase()===this.toHexString();if(typeof e=="string"&&t.isValid(e)&&e.length===12)return Ce.from(e).equals(this.id);if(typeof e=="object"&&"toHexString"in e&&typeof e.toHexString=="function"){var r=e.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var e=new Date,r=this.id.readUInt32BE(0);return e.setTime(Math.floor(r)*1e3),e},t.createPk=function(){return new t},t.createFromTime=function(e){var r=Ce.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(typeof e>"u"||e!=null&&e.length!==24)throw new Qe("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(Ce.from(e,"hex"))},t.isValid=function(e){if(e==null)return!1;try{return new t(e),!0}catch{return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(Math.random()*16777215),t})();Object.defineProperty(Et.prototype,"generate",{value:Nc(function(t){return Et.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(Et.prototype,"getInc",{value:Nc(function(){return Et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Et.prototype,"get_inc",{value:Nc(function(){return Et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Et,"get_inc",{value:Nc(function(){return Et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Et.prototype,"_bsontype",{value:"ObjectID"});function hS(t){return t.split("").sort().join("")}var ps=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=hS(r??""),this.pattern.indexOf("\0")!==-1)throw new oi("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new oi("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new oi("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(e){return e?e.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(e){return e=e||{},e.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e)if(typeof e.$regex!="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new t(e.$regex,t.parseOptions(e.$options));if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new Qe("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t})();Object.defineProperty(ps.prototype,"_bsontype",{value:"BSONRegExp"});var If=(function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t})();Object.defineProperty(If.prototype,"_bsontype",{value:"Symbol"});var gS=ie,Gg=(function(t){Dc(e,t);function e(r,n){var i=this;return i instanceof e?(ie.isLong(r)?i=t.call(this,r.low,r.high,!0)||this:fs(r)&&typeof r.t<"u"&&typeof r.i<"u"?i=t.call(this,r.i,r.t,!0)||this:i=t.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new e(r,n)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(r){return new e(ie.fromInt(r,!0))},e.fromNumber=function(r){return new e(ie.fromNumber(r,!0))},e.fromBits=function(r,n){return new e(r,n)},e.fromString=function(r,n){return new e(ie.fromString(r,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(r){return new e(r.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=ie.MAX_UNSIGNED_VALUE,e})(gS);function yS(t){return fs(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var zg=2147483647,qg=-2147483648,Yg=9223372036854776e3,Kg=-9223372036854776e3,vS={$oid:Et,$binary:si,$uuid:si,$symbol:If,$numberInt:Lc,$numberDecimal:bf,$numberDouble:Pc,$numberLong:ie,$minKey:Sf,$maxKey:wf,$regex:ps,$regularExpression:ps,$timestamp:Gg};function Xg(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=qg&&t<=zg)return new Lc(t);if(t>=Kg&&t<=Yg)return ie.fromNumber(t)}return new Pc(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter(function(f){return f.startsWith("$")&&t[f]!=null}),n=0;n<r.length;n++){var i=vS[r[n]];if(i)return i.fromExtendedJSON(t,e)}if(t.$date!=null){var o=t.$date,s=new Date;return e.legacy?typeof o=="number"?s.setTime(o):typeof o=="string"&&s.setTime(Date.parse(o)):typeof o=="string"?s.setTime(Date.parse(o)):ie.isLong(o)?s.setTime(o.toNumber()):typeof o=="number"&&e.relaxed&&s.setTime(o),s}if(t.$code!=null){var a=Object.assign({},t);return t.$scope&&(a.$scope=Xg(t.$scope)),Oc.fromExtendedJSON(t)}if(tS(t)||t.$dbPointer){var c=t.$ref?t:t.$dbPointer;if(c instanceof us)return c;var p=Object.keys(c).filter(function(f){return f.startsWith("$")}),d=!0;if(p.forEach(function(f){["$ref","$id","$db"].indexOf(f)===-1&&(d=!1)}),d)return us.fromExtendedJSON(c)}return t}function ES(t,e){return t.map(function(r,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Dn(r,e)}finally{e.seenObjects.pop()}})}function Mg(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function Dn(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var r=e.seenObjects.findIndex(function(k){return k.obj===t});if(r!==-1){var n=e.seenObjects.map(function(k){return k.propertyName}),i=n.slice(0,r).map(function(k){return"".concat(k," -> ")}).join(""),o=n[r],s=" -> "+n.slice(r+1,n.length-1).map(function(k){return"".concat(k," -> ")}).join(""),a=n[n.length-1],c=" ".repeat(i.length+o.length/2),p="-".repeat(s.length+(o.length+a.length)/2-1);throw new Qe(`Converting circular structure to EJSON:
|
|
31
|
+
Url: ${Oa(t)}`),!0}return!1}function A_(t,e){return e?.length?Ra(t).some(r=>Di(r,e)):!1}function D_(t,e){if(!e?.length)return!1;let r=t.transaction;return r?Di(r,e):!1}function N_(t,e){if(!e?.length)return!1;let r=Oa(t);return r?Di(r,e):!1}function O_(t,e){if(!e?.length)return!0;let r=Oa(t);return r?Di(r,e):!0}function P_(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Oa(t){try{let r=[...t.exception?.values??[]].reverse().find(n=>n.mechanism?.parent_id===void 0&&n.stacktrace?.frames?.length)?.stacktrace?.frames;return r?P_(r):null}catch{return oe&&ee.error(`Cannot extract url for event ${Dr(t)}`),null}}function L_(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function pp(t,e,r,n,i,o){if(!i.exception?.values||!o||!vr(o.originalException,Error))return;let s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=up(t,e,n,o.originalException,r,i.exception.values,s,0))}function up(t,e,r,n,i,o,s,a){if(o.length>=r+1)return o;let c=[...o];if(vr(n[i],Error)){oh(s,a);let p=t(e,n[i]),d=c.length;sh(p,i,d,a),c=up(t,e,r,n[i],i,[p,...c],p,d)}return Array.isArray(n.errors)&&n.errors.forEach((p,d)=>{if(vr(p,Error)){oh(s,a);let f=t(e,p),E=c.length;sh(f,`errors[${d}]`,E,a),c=up(t,e,r,p,i,[f,...c],f,E)}}),c}function oh(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(_(_({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function sh(t,e,r,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(_({},t.mechanism),{type:"chained",source:e,exception_id:r,parent_id:n})}function fp(t){let e="console";Lt(e,t),Mt(e,M_)}function M_(){"console"in pe&&vu.forEach(function(t){t in pe.console&&pt(pe.console,t,function(e){return Ci[t]=e,function(...r){ut("console",{args:r,level:t}),Ci[t]?.apply(pe.console,r)}})})}function mp(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var B_="Dedupe",k_=()=>{let t;return{name:B_,processEvent(e){if(e.type)return e;try{if(U_(e,t))return oe&&ee.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},La=k_;function U_(t,e){return e?!!(F_(t,e)||H_(t,e)):!1}function F_(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!lh(t,e)||!ch(t,e))}function H_(t,e){let r=ah(e),n=ah(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!lh(t,e)||!ch(t,e))}function ch(t,e){let r=aa(t),n=aa(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let o=n[i],s=r[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function lh(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function ah(t){return t.exception?.values?.[0]}function Jo(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}function Ma(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var Qo=pe;function dp(){return"history"in Qo&&!!Qo.history}function V_(){if(!("fetch"in Qo))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Zo(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function hp(){if(typeof EdgeRuntime=="string")return!0;if(!V_())return!1;if(Zo(Qo.fetch))return!0;let t=!1,e=Qo.document;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow?.fetch&&(t=Zo(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){oe&&ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function yp(t,e){let r="fetch";Lt(r,t),Mt(r,()=>$_(void 0,e))}function $_(t,e=!1){e&&!hp()||pt(pe,"fetch",function(r){return function(...n){let i=new Error,{method:o,url:s}=W_(n),a={args:n,fetchData:{method:o,url:s},startTimestamp:Ht()*1e3,virtualError:i,headers:j_(n)};return t||ut("fetch",_({},a)),r.apply(pe,n).then(async c=>(t?t(c):ut("fetch",Z(_({},a),{endTimestamp:Ht()*1e3,response:c})),c),c=>{if(ut("fetch",Z(_({},a),{endTimestamp:Ht()*1e3,error:c})),zn(c)&&c.stack===void 0&&(c.stack=i.stack,qt(c,"framesToPop",1)),c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{let p=new URL(a.fetchData.url);c.message=`${c.message} (${p.host})`}catch{}throw c})}})}function gp(t,e){return!!t&&typeof t=="object"&&!!t[e]}function uh(t){return typeof t=="string"?t:t?gp(t,"url")?t.url:t.toString?t.toString():"":""}function W_(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[r,n]=t;return{url:uh(r),method:gp(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:uh(e),method:gp(e,"method")?String(e.method).toUpperCase():"GET"}}function j_(t){let[e,r]=t;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(Km(e))return new Headers(e.headers)}catch{}}function vp(){return"npm"}var Je=pe,Ep=0;function _p(){return Ep>0}function ib(){Ep++,setTimeout(()=>{Ep--})}function Xn(t,e={}){function r(i){return typeof i=="function"}if(!r(t))return t;try{let i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(Kn(t))return t}catch{return t}let n=function(...i){try{let o=i.map(s=>Xn(s,e));return t.apply(this,o)}catch(o){throw ib(),jo(s=>{s.addEventProcessor(a=>(e.mechanism&&(Ni(a,void 0,void 0),Nr(a,e.mechanism)),a.extra=Z(_({},a.extra),{arguments:i}),a)),Ta(o)}),o}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}fa(n,t),qt(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function ph(){let t=Wo(),{referrer:e}=Je.document||{},{userAgent:r}=Je.navigator||{},n=_(_({},e&&{Referer:e}),r&&{"User-Agent":r});return{url:t,headers:n}}function Ba(t,e){let r=Sp(t,e),n={type:lb(e),value:ub(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function ob(t,e,r,n){let o=Ge()?.getOptions().normalizeDepth,s=mb(e),a={__serialized__:_a(e,o)};if(s)return{exception:{values:[Ba(t,s)]},extra:a};let c={exception:{values:[{type:Yn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:pb(e,{isUnhandledRejection:n})}]},extra:a};if(r){let p=Sp(t,r);p.length&&(c.exception.values[0].stacktrace={frames:p})}return c}function bp(t,e){return{exception:{values:[Ba(t,e)]}}}function Sp(t,e){let r=e.stacktrace||e.stack||"",n=ab(e),i=cb(e);try{return t(r,n,i)}catch{}return[]}var sb=/Minified React error #\d+;/i;function ab(t){return t&&sb.test(t.message)?1:0}function cb(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function fh(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function lb(t){let e=t?.name;return!e&&fh(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function ub(t){let e=t?.message;return fh(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function mh(t,e,r,n){let i=r?.syntheticException||void 0,o=ka(t,e,i,n);return Nr(o),o.level="error",r?.event_id&&(o.event_id=r.event_id),or(o)}function dh(t,e,r="info",n,i){let o=n?.syntheticException||void 0,s=wp(t,e,o,i);return s.level=r,n?.event_id&&(s.event_id=n.event_id),or(s)}function ka(t,e,r,n,i){let o;if(la(e)&&e.error)return bp(t,e.error);if(ua(e)||Cu(e)){let s=e;if("stack"in e)o=bp(t,e);else{let a=s.name||(ua(s)?"DOMError":"DOMException"),c=s.message?`${a}: ${s.message}`:a;o=wp(t,c,r,n),Ni(o,c)}return"code"in s&&(o.tags=Z(_({},o.tags),{"DOMException.code":`${s.code}`})),o}return zn(e)?bp(t,e):nn(e)||Yn(e)?(o=ob(t,e,r,i),Nr(o,{synthetic:!0}),o):(o=wp(t,e,r,n),Ni(o,`${e}`,void 0),Nr(o,{synthetic:!0}),o)}function wp(t,e,r,n){let i={};if(n&&r){let o=Sp(t,r);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]}),Nr(i,{synthetic:!0})}if(Ai(e)){let{__sentry_template_string__:o,__sentry_template_values__:s}=e;return i.logentry={message:o,params:s},i}return i.message=e,i}function pb(t,{isUnhandledRejection:e}){let r=Pu(t),n=e?"promise rejection":"exception";return la(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:Yn(t)?`Event \`${fb(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function fb(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function mb(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}var db=5e3,es=class extends Ko{constructor(e){let r=hb(e),n=Je.SENTRY_SDK_SOURCE||vp();cp(r,"browser",["browser"],n),super(r);let{sendDefaultPii:i,sendClientReports:o,enableLogs:s,_experiments:a}=this._options,c=s??a?.enableLogs;Je.document&&(o||c)&&Je.document.addEventListener("visibilitychange",()=>{Je.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),c&&Xo(this))}),c&&(this.on("flush",()=>{Xo(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{Xo(this)},db)})),i&&(this.on("postprocessEvent",sp),this.on("beforeSendSession",ap))}eventFromException(e,r){return mh(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return dh(this._options.stackParser,e,r,n,this._options.attachStacktrace)}_prepareEvent(e,r,n,i){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n,i)}};function hb(t){return _({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Je.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},t)}var hh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var mt=pe;var gb=1e3,gh,Ip,Tp;function xp(t){Lt("dom",t),Mt("dom",yb)}function yb(){if(!mt.document)return;let t=ut.bind(null,"dom"),e=yh(t,!0);mt.document.addEventListener("click",e,!1),mt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let i=mt[r]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(pt(i,"addEventListener",function(o){return function(s,a,c){if(s==="click"||s=="keypress")try{let p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=p[s]=p[s]||{refCount:0};if(!d.handler){let f=yh(t);d.handler=f,o.call(this,s,f,c)}d.refCount++}catch{}return o.call(this,s,a,c)}}),pt(i,"removeEventListener",function(o){return function(s,a,c){if(s==="click"||s=="keypress")try{let p=this.__sentry_instrumentation_handlers__||{},d=p[s];d&&(d.refCount--,d.refCount<=0&&(o.call(this,s,d.handler,c),d.handler=void 0,delete p[s]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return o.call(this,s,a,c)}}))})}function vb(t){if(t.type!==Ip)return!1;try{if(!t.target||t.target._sentryId!==Tp)return!1}catch{}return!0}function Eb(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function yh(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=_b(r);if(Eb(r.type,n))return;qt(r,"_sentryCaptured",!0),n&&!n._sentryId&&qt(n,"_sentryId",ft());let i=r.type==="keypress"?"input":r.type;vb(r)||(t({event:r,name:i,global:e}),Ip=r.type,Tp=n?n._sentryId:void 0),clearTimeout(gh),gh=mt.setTimeout(()=>{Tp=void 0,Ip=void 0},gb)}}function _b(t){try{return t.target}catch{return null}}var Ua;function ts(t){let e="history";Lt(e,t),Mt(e,bb)}function bb(){if(mt.addEventListener("popstate",()=>{let e=mt.location.href,r=Ua;if(Ua=e,r===e)return;ut("history",{from:r,to:e})}),!dp())return;function t(e){return function(...r){let n=r.length>2?r[2]:void 0;if(n){let i=Ua,o=wb(String(n));if(Ua=o,i===o)return e.apply(this,r);ut("history",{from:i,to:o})}return e.apply(this,r)}}pt(mt.history,"pushState",t),pt(mt.history,"replaceState",t)}function wb(t){try{return new URL(t,mt.location.origin).toString()}catch{return t}}var Fa={};function Cp(t){let e=Fa[t];if(e)return e;let r=mt[t];if(Zo(r))return Fa[t]=r.bind(mt);let n=mt.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let o=i.contentWindow;o?.[t]&&(r=o[t]),n.head.removeChild(i)}catch(i){hh&&ee.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(Fa[t]=r.bind(mt))}function Ha(t){Fa[t]=void 0}var Jn="__sentry_xhr_v3__";function Rp(t){Lt("xhr",t),Mt("xhr",Sb)}function Sb(){if(!mt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,r,n){let i=new Error,o=Ht()*1e3,s=Bt(n[0])?n[0].toUpperCase():void 0,a=Ib(n[1]);if(!s||!a)return e.apply(r,n);r[Jn]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(r.__sentry_own_request__=!0);let c=()=>{let p=r[Jn];if(p&&r.readyState===4){try{p.status_code=r.status}catch{}let d={endTimestamp:Ht()*1e3,startTimestamp:o,xhr:r,virtualError:i};ut("xhr",d)}};return"onreadystatechange"in r&&typeof r.onreadystatechange=="function"?r.onreadystatechange=new Proxy(r.onreadystatechange,{apply(p,d,f){return c(),p.apply(d,f)}}):r.addEventListener("readystatechange",c),r.setRequestHeader=new Proxy(r.setRequestHeader,{apply(p,d,f){let[E,y]=f,T=d[Jn];return T&&Bt(E)&&Bt(y)&&(T.request_headers[E.toLowerCase()]=y),p.apply(d,f)}}),e.apply(r,n)}}),t.send=new Proxy(t.send,{apply(e,r,n){let i=r[Jn];if(!i)return e.apply(r,n);n[0]!==void 0&&(i.body=n[0]);let o={startTimestamp:Ht()*1e3,xhr:r};return ut("xhr",o),e.apply(r,n)}})}function Ib(t){if(Bt(t))return t;try{return t.toString()}catch{}}function Ap(t,e=Cp("fetch")){let r=0,n=0;function i(o){let s=o.body.length;r+=s,n++;let a=_({body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return Ha("fetch"),Sn("No fetch implementation available");try{return e(t.url,a).then(c=>(r-=s,n--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return Ha("fetch"),r-=s,n--,Sn(c)}}return Da(t,i)}var Tb=30;var xb=50;function Dp(t,e,r,n){let i={filename:t,function:e==="<anonymous>"?"?":e,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var Cb=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Rb=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ab=/\((\S*)(?::(\d+))(?::(\d+))\)/,Db=t=>{let e=Cb.exec(t);if(e){let[,n,i,o]=e;return Dp(n,"?",+i,+o)}let r=Rb.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=Ab.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[i,o]=bh(r[1]||"?",r[2]);return Dp(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},vh=[Tb,Db],Nb=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ob=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pb=t=>{let e=Nb.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let o=Ob.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let n=e[3],i=e[1]||"?";return[i,n]=bh(i,n),Dp(n,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Eh=[xb,Pb];var _h=[vh,Eh],Np=wu(..._h),bh=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:"?",r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Mi=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Va=1024,Lb="Breadcrumbs",Mb=(t={})=>{let e=_({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:Lb,setup(r){e.console&&fp(Ub(r)),e.dom&&xp(kb(r,e.dom)),e.xhr&&Rp(Fb(r)),e.fetch&&yp(Hb(r)),e.history&&ts(Vb(r)),e.sentry&&r.on("beforeSendEvent",Bb(r))}}},wh=Mb;function Bb(t){return function(r){Ge()===t&&Lr({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:Dr(r)},{event:r})}}function kb(t,e){return function(n){if(Ge()!==t)return;let i,o,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Va&&(Mi&&ee.warn(`\`dom.maxStringLength\` cannot exceed ${Va}, but a value of ${a} was configured. Sentry will use ${Va} instead.`),a=Va),typeof s=="string"&&(s=[s]);try{let p=n.event,d=$b(p)?p.target:p;i=$o(d,{keyAttrs:s,maxStringLength:a}),o=Ou(d)}catch{i="<unknown>"}if(i.length===0)return;let c={category:`ui.${n.name}`,message:i};o&&(c.data={"ui.component_name":o}),Lr(c,{event:n.event,name:n.name,global:n.global})}}function Ub(t){return function(r){if(Ge()!==t)return;let n={category:"console",data:{arguments:r.args,logger:"console"},level:mp(r.level),message:pa(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${pa(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;Lr(n,{input:r.args,level:r.level})}}function Fb(t){return function(r){if(Ge()!==t)return;let{startTimestamp:n,endTimestamp:i}=r,o=r.xhr[Jn];if(!n||!i||!o)return;let{method:s,url:a,status_code:c,body:p}=o,d={method:s,url:a,status_code:c},f={xhr:r.xhr,input:p,startTimestamp:n,endTimestamp:i},E={category:"xhr",data:d,type:"http",level:Ma(c)};t.emit("beforeOutgoingRequestBreadcrumb",E,f),Lr(E,f)}}function Hb(t){return function(r){if(Ge()!==t)return;let{startTimestamp:n,endTimestamp:i}=r;if(i&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.fetchData.method,r.fetchData.url,r.error){let o=r.fetchData,s={data:r.error,input:r.args,startTimestamp:n,endTimestamp:i},a={category:"fetch",data:o,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,s),Lr(a,s)}else{let o=r.response,s=Z(_({},r.fetchData),{status_code:o?.status});r.fetchData.request_body_size,r.fetchData.response_body_size,o?.status;let a={input:r.args,response:o,startTimestamp:n,endTimestamp:i},c={category:"fetch",data:s,type:"http",level:Ma(s.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",c,a),Lr(c,a)}}}function Vb(t){return function(r){if(Ge()!==t)return;let n=r.from,i=r.to,o=Jo(Je.location.href),s=n?Jo(n):void 0,a=Jo(i);s?.path||(s=o),o.protocol===a.protocol&&o.host===a.host&&(i=a.relative),o.protocol===s.protocol&&o.host===s.host&&(n=s.relative),Lr({category:"navigation",data:{from:n,to:i}})}}function $b(t){return!!t&&!!t.target}var Wb=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],jb="BrowserApiErrors",Gb=(t={})=>{let e=_({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},t);return{name:jb,setupOnce(){e.setTimeout&&pt(Je,"setTimeout",Sh),e.setInterval&&pt(Je,"setInterval",Sh),e.requestAnimationFrame&&pt(Je,"requestAnimationFrame",zb),e.XMLHttpRequest&&"XMLHttpRequest"in Je&&pt(XMLHttpRequest.prototype,"send",qb);let r=e.eventTarget;r&&(Array.isArray(r)?r:Wb).forEach(i=>Yb(i,e))}}},Ih=Gb;function Sh(t){return function(...e){let r=e[0];return e[0]=Xn(r,{mechanism:{data:{function:nr(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function zb(t){return function(e){return t.apply(this,[Xn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:nr(t)},handled:!1,type:"instrument"}})])}}function qb(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in r&&typeof r[i]=="function"&&pt(r,i,function(o){let s={mechanism:{data:{function:i,handler:nr(o)},handled:!1,type:"instrument"}},a=Kn(o);return a&&(s.mechanism.data.handler=nr(a)),Xn(o,s)})}),t.apply(this,e)}}function Yb(t,e){let n=Je[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(pt(n,"addEventListener",function(i){return function(o,s,a){try{Kb(s)&&(s.handleEvent=Xn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:nr(s),target:t},handled:!1,type:"instrument"}}))}catch{}return e.unregisterOriginalCallbacks&&Xb(this,o,s),i.apply(this,[o,Xn(s,{mechanism:{data:{function:"addEventListener",handler:nr(s),target:t},handled:!1,type:"instrument"}}),a])}}),pt(n,"removeEventListener",function(i){return function(o,s,a){try{let c=s.__sentry_wrapped__;c&&i.call(this,o,c,a)}catch{}return i.call(this,o,s,a)}}))}function Kb(t){return typeof t.handleEvent=="function"}function Xb(t,e,r){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,r)}var Th=()=>({name:"BrowserSession",setupOnce(){if(typeof Je.document>"u"){Mi&&ee.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}qo({ignoreDuration:!0}),Yo(),ts(({from:t,to:e})=>{t!==void 0&&t!==e&&(qo({ignoreDuration:!0}),Yo())})}});var Jb="GlobalHandlers",Qb=(t={})=>{let e=_({onerror:!0,onunhandledrejection:!0},t);return{name:Jb,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(Zb(r),xh("onerror")),e.onunhandledrejection&&(ew(r),xh("onunhandledrejection"))}}},Ch=Qb;function Zb(t){Iu(e=>{let{stackParser:r,attachStacktrace:n}=Rh();if(Ge()!==t||_p())return;let{msg:i,url:o,line:s,column:a,error:c}=e,p=nw(ka(r,c||i,void 0,n,!1),o,s,a);p.level="error",zo(p,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function ew(t){xu(e=>{let{stackParser:r,attachStacktrace:n}=Rh();if(Ge()!==t||_p())return;let i=tw(e),o=qn(i)?rw(i):ka(r,i,void 0,n,!0);o.level="error",zo(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function tw(t){if(qn(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function rw(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function nw(t,e,r,n){let i=t.exception=t.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[],p=n,d=r,f=Bt(e)&&e.length>0?e:Wo();return c.length===0&&c.push({colno:p,filename:f,function:"?",in_app:!0,lineno:d}),t}function xh(t){Mi&&ee.log(`Global Handler attached: ${t}`)}function Rh(){return Ge()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Ah=()=>({name:"HttpContext",preprocessEvent(t){if(!Je.navigator&&!Je.location&&!Je.document)return;let e=ph(),r=_(_({},e.headers),t.request?.headers);t.request=Z(_(_({},e),t.request),{headers:r})}});var iw="cause",ow=5,sw="LinkedErrors",aw=(t={})=>{let e=t.limit||ow,r=t.key||iw;return{name:sw,preprocessEvent(n,i,o){let s=o.getOptions();pp(Ba,s.stackParser,r,e,n,i)}}},Dh=aw;function Op(t){return[Pa(),Na(),Ih(),wh(),Ch(),Dh(),La(),Ah(),Th()]}var Wa={},ja,Pp,Nh;(()=>{let t=Op({}).filter(e=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name));Pp=new es({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:Ap,stackParser:Np,integrations:t,environment:Gt.mode,release:`web-sdk@${Cr}`,debug:Gt.debug}),Pp.init()})();function ae(t,e,r){b.error(`${e}:`,t);let n=Lh(r);if(n.setTag("operation",e),t instanceof en){cw(n,t,e);return}n.captureException(t)}function Oh(t,e,r){Lh(r).captureMessage(t,e??"error")}function cw(t,e,r){if(lw(t,e),e.response){let n=e.response,i=e.responseText;t.setTag("http.status_code",n.status),t.setTag("http.status_text",n.statusText),i&&typeof i=="object"&&"error"in i&&(t.setTag("http.error_code",i.error.code),t.setTag("http.error_message",i.error.message)),t.setExtras({responseText:e.responseText,statusText:n.statusText,responseType:n.type,redirected:n.redirected,responseUrl:n.url}),t.captureMessage(`${r} failed with ${n.status}`,"error");return}if(e.request){t.captureMessage(`No response was received for ${r}`,"error");return}}function lw(t,e){let r=e.request;r&&t.setExtras({body:e.requestBody,headers:r.headers,method:r.method,url:r.url})}function Ph(t){Nh=t}function Ga(t,e){Wa[t]=_(_({},Wa[t]),e)}function Bi(t){ja=_(_({},ja),t)}function Lh(t){t??={};let{extra:e,tags:r}=t,n=new It;if(n.setClient(Pp),n.setUser(Nh),t.triggerContext&&!t.engagementTrigger&&(t.engagementTrigger=t.triggerContext.triggerData),t.engagementTrigger){let i=t.engagementTrigger;n.setTags({"engagement.id":i.engagementID,"engagement.short_id":i.shortID,"engagement.objective":i.objective,"engagement.delivery_type":i.onsiteDeliveryType,"engagement.content_id":i.contentID,"engagement.variation":i.variation,"engagement.currency":i.currency})}return e&&n.setExtras(e),r&&n.setTags(r),ja&&n.setTags(ja),Object.keys(Wa).forEach(i=>{n.setContext(i,Wa[i])}),n.setTag("language",navigator.language),n.setTag("timezone",Mh()),uw(n),n}function uw(t){window.Shopify&&(t.setTag("shopify.shop",window.Shopify.shop),t.setTag("shopify.currency",window.Shopify.currency?.active),t.setTag("shopify.locale",window.Shopify.locale),t.setTag("theme.schema_name",window.Shopify.theme?.schema_name),t.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}var za=class{static format(e,r){let n=/{{\s*(\w+)\s*}}/;return r.replace(n,(i,o)=>{switch(o){case"amount":return this.formatWithDelimiters(e,2);case"amount_no_decimals":return this.formatWithDelimiters(e,0);case"amount_with_comma_separator":return this.formatWithDelimiters(e,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(e,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(e,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(e,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(e,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(e,2," ",".");default:return i}})}static formatWithDelimiters(e,r=2,n=",",i="."){if(isNaN(e)||e==null)return"0";let s=(e/100).toFixed(r).split("."),a=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+n),c=s[1]?i+s[1]:"";return a+c}};function ki(t){try{return new URL(t)}catch{return}}function Lp(t){return!t||t==="null"||t==="undefined"}function Bh(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}function kt(t,e,r){return{[t]:Mp(e,r),[t+"_wo_currency"]:e}}function Mp(t,e){if(t==0&&e)return"Free";let r=ve.get(),n=Xe.get(),i=r.shopCurrencyCode||n.currency,o=r.currencyCode;o||b.warn("Currency code is not set in RuntimeData");let s=n.money?.format??r.moneyFormat,a;if(s&&i===o)a=za.format(t*100,s);else{let c;try{c=new Intl.NumberFormat(Uh(),{style:"currency",currency:o||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(p){return ae(p,"format-currency",{extra:{currentCurrency:o,shopCurrency:i}}),""}a=c.format(t),a=a.replace("\u20B9","Rs. "),n.money?.showCurrency&&o!=="INR"&&(a=a.concat(` ${o}`))}return a}function kh(t){let e=Uh();try{return new Intl.NumberFormat(e,{notation:"compact"}).format(t)}catch(r){return ae(r,"format-number",{extra:{lang:e,value:t}}),t.toString()}}function Uh(){let t="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?t=navigator.languages[0]:navigator.language&&(t=navigator.language)),t=t.split(";")[0],t=t.split("-")[0],t||"en"}var qa;function Mh(){if(qa)return qa;try{return qa=Intl.DateTimeFormat().resolvedOptions().timeZone,qa}catch{return""}}function Ui(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}function br(t){let e=document.createElement("span");e.id="snackbar",e.innerText=t,document.body.appendChild(e),e.className="show",setTimeout(()=>{e.classList.remove("show"),document.body.removeChild(e)},5e3)}async function Bp(t,e=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<e;){let o=Math.min(100*2**n,5e3);if(await rr.sleep(o),i=r.querySelectorAll(t),i.length)return b.verbose(`Attempt ${n+1}: ${i.length} elements found with ${t}`),i;b.verbose(`Attempt ${n+1}: Elements not found with ${t}. Retrying after ${o}ms.`),n++}return b.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${t}.`),i}async function Fi(t,e=10,r=document){return(await Bp(t,e,r)).item(0)}async function kp(t){let[e,r,n]=await Promise.all([Ye.get("did"),At.get("id",""),Ye.get("sessionNumber",1)]),i={letscooee_did:e,letscooee_sid:r,letscooee_sn:n,__letscooee_time:new Date().toLocaleString()};return t&&(i.__letscooee_via=t),i}async function Ya(t){let e=await kp(t);return Object.entries(e).map(([r,n])=>({key:r,value:n.toString()}))}function Mr(t,e,r,n=!1){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:n,value:r})}function Fh(t){if(t%100>=11&&t%100<=13)return t+"th";switch(t%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd";default:return t+"th"}}var Qa,xe,jh,Hp,Qn,Hh,Gh,zh,qh,Vp,Up,Fp,pw,ns={},Yh=[],fw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Za=Array.isArray;function cn(t,e){for(var r in e)t[r]=e[r];return t}function $p(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Wp(t,e,r){var n,i,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Qa.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return Xa(t,s,n,i,null)}function Xa(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++jh,__i:-1,__u:0};return i==null&&xe.vnode!=null&&xe.vnode(o),o}function kr(t){return t.children}function Br(t,e){this.props=t,this.context=e}function Hi(t,e){if(e==null)return t.__?Hi(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Hi(t):null}function Kh(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return Kh(t)}}function Vh(t){(!t.__d&&(t.__d=!0)&&Qn.push(t)&&!Ja.__r++||Hh!=xe.debounceRendering)&&((Hh=xe.debounceRendering)||Gh)(Ja)}function Ja(){for(var t,e,r,n,i,o,s,a=1;Qn.length;)Qn.length>a&&Qn.sort(zh),t=Qn.shift(),a=Qn.length,t.__d&&(r=void 0,i=(n=(e=t).__v).__e,o=[],s=[],e.__P&&((r=cn({},n)).__v=n.__v+1,xe.vnode&&xe.vnode(r),jp(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,o,i??Hi(n),!!(32&n.__u),s),r.__v=n.__v,r.__.__k[r.__i]=r,Qh(o,r,s),r.__e!=i&&Kh(r)));Ja.__r=0}function Xh(t,e,r,n,i,o,s,a,c,p,d){var f,E,y,T,D,N,k=n&&n.__k||Yh,G=e.length;for(c=mw(r,e,k,c,G),f=0;f<G;f++)(y=r.__k[f])!=null&&(E=y.__i==-1?ns:k[y.__i]||ns,y.__i=f,N=jp(t,y,E,i,o,s,a,c,p,d),T=y.__e,y.ref&&E.ref!=y.ref&&(E.ref&&Gp(E.ref,null,y),d.push(y.ref,y.__c||T,y)),D==null&&T!=null&&(D=T),4&y.__u||E.__k===y.__k?c=Jh(y,c,t):typeof y.type=="function"&&N!==void 0?c=N:T&&(c=T.nextSibling),y.__u&=-7);return r.__e=D,c}function mw(t,e,r,n,i){var o,s,a,c,p,d=r.length,f=d,E=0;for(t.__k=new Array(i),o=0;o<i;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=o+E,(s=t.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Xa(null,s,null,null,null):Za(s)?Xa(kr,{children:s},null,null,null):s.constructor==null&&s.__b>0?Xa(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,a=null,(p=s.__i=dw(s,r,c,f))!=-1&&(f--,(a=r[p])&&(a.__u|=2)),a==null||a.__v==null?(p==-1&&(i>d?E--:i<d&&E++),typeof s.type!="function"&&(s.__u|=4)):p!=c&&(p==c-1?E--:p==c+1?E++:(p>c?E--:E++,s.__u|=4))):t.__k[o]=null;if(f)for(o=0;o<d;o++)(a=r[o])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=Hi(a)),eg(a,a));return n}function Jh(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=Jh(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=Hi(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function dw(t,e,r,n){var i,o,s=t.key,a=t.type,c=e[r];if(c===null&&t.key==null||c&&s==c.key&&a==c.type&&(2&c.__u)==0)return r;if(n>(c!=null&&(2&c.__u)==0?1:0))for(i=r-1,o=r+1;i>=0||o<e.length;){if(i>=0){if((c=e[i])&&(2&c.__u)==0&&s==c.key&&a==c.type)return i;i--}if(o<e.length){if((c=e[o])&&(2&c.__u)==0&&s==c.key&&a==c.type)return o;o++}}return-1}function $h(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||fw.test(e)?r:r+"px"}function Ka(t,e,r,n,i){var o,s;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||$h(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||$h(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(qh,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n?r.u=n.u:(r.u=Vp,t.addEventListener(e,o?Fp:Up,o)):t.removeEventListener(e,o?Fp:Up,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Wh(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Vp++;else if(e.t<r.u)return;return r(xe.event?xe.event(e):e)}}}function jp(t,e,r,n,i,o,s,a,c,p){var d,f,E,y,T,D,N,k,G,P,Q,_e,X,ce,se,fe,Be,Te=e.type;if(e.constructor!=null)return null;128&r.__u&&(c=!!(32&r.__u),o=[a=e.__e=r.__e]),(d=xe.__b)&&d(e);e:if(typeof Te=="function")try{if(k=e.props,G="prototype"in Te&&Te.prototype.render,P=(d=Te.contextType)&&n[d.__c],Q=d?P?P.props.value:d.__:n,r.__c?N=(f=e.__c=r.__c).__=f.__E:(G?e.__c=f=new Te(k,Q):(e.__c=f=new Br(k,Q),f.constructor=Te,f.render=gw),P&&P.sub(f),f.props=k,f.state||(f.state={}),f.context=Q,f.__n=n,E=f.__d=!0,f.__h=[],f._sb=[]),G&&f.__s==null&&(f.__s=f.state),G&&Te.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=cn({},f.__s)),cn(f.__s,Te.getDerivedStateFromProps(k,f.__s))),y=f.props,T=f.state,f.__v=e,E)G&&Te.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),G&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(G&&Te.getDerivedStateFromProps==null&&k!==y&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(k,Q),!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(k,f.__s,Q)===!1||e.__v==r.__v){for(e.__v!=r.__v&&(f.props=k,f.state=f.__s,f.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(Ae){Ae&&(Ae.__=e)}),_e=0;_e<f._sb.length;_e++)f.__h.push(f._sb[_e]);f._sb=[],f.__h.length&&s.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(k,f.__s,Q),G&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(y,T,D)})}if(f.context=Q,f.props=k,f.__P=t,f.__e=!1,X=xe.__r,ce=0,G){for(f.state=f.__s,f.__d=!1,X&&X(e),d=f.render(f.props,f.state,f.context),se=0;se<f._sb.length;se++)f.__h.push(f._sb[se]);f._sb=[]}else do f.__d=!1,X&&X(e),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++ce<25);f.state=f.__s,f.getChildContext!=null&&(n=cn(cn({},n),f.getChildContext())),G&&!E&&f.getSnapshotBeforeUpdate!=null&&(D=f.getSnapshotBeforeUpdate(y,T)),fe=d,d!=null&&d.type===kr&&d.key==null&&(fe=Zh(d.props.children)),a=Xh(t,Za(fe)?fe:[fe],e,r,n,i,o,s,a,c,p),f.base=e.__e,e.__u&=-161,f.__h.length&&s.push(f),N&&(f.__E=f.__=null)}catch(Ae){if(e.__v=null,c||o!=null)if(Ae.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else for(Be=o.length;Be--;)$p(o[Be]);else e.__e=r.__e,e.__k=r.__k;xe.__e(Ae,e,r)}else o==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=hw(r.__e,e,r,n,i,o,s,c,p);return(d=xe.diffed)&&d(e),128&e.__u?void 0:a}function Qh(t,e,r){for(var n=0;n<r.length;n++)Gp(r[n],r[++n],r[++n]);xe.__c&&xe.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){xe.__e(o,i.__v)}})}function Zh(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Za(t)?t.map(Zh):cn({},t)}function hw(t,e,r,n,i,o,s,a,c){var p,d,f,E,y,T,D,N=r.props,k=e.props,G=e.type;if(G=="svg"?i="http://www.w3.org/2000/svg":G=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(p=0;p<o.length;p++)if((y=o[p])&&"setAttribute"in y==!!G&&(G?y.localName==G:y.nodeType==3)){t=y,o[p]=null;break}}if(t==null){if(G==null)return document.createTextNode(k);t=document.createElementNS(i,G,k.is&&k),a&&(xe.__m&&xe.__m(e,o),a=!1),o=null}if(G==null)N===k||a&&t.data==k||(t.data=k);else{if(o=o&&Qa.call(t.childNodes),N=r.props||ns,!a&&o!=null)for(N={},p=0;p<t.attributes.length;p++)N[(y=t.attributes[p]).name]=y.value;for(p in N)if(y=N[p],p!="children"){if(p=="dangerouslySetInnerHTML")f=y;else if(!(p in k)){if(p=="value"&&"defaultValue"in k||p=="checked"&&"defaultChecked"in k)continue;Ka(t,p,null,y,i)}}for(p in k)y=k[p],p=="children"?E=y:p=="dangerouslySetInnerHTML"?d=y:p=="value"?T=y:p=="checked"?D=y:a&&typeof y!="function"||N[p]===y||Ka(t,p,y,N[p],i);if(d)a||f&&(d.__html==f.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(f&&(t.innerHTML=""),Xh(e.type=="template"?t.content:t,Za(E)?E:[E],e,r,n,G=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:r.__k&&Hi(r,0),a,c),o!=null)for(p=o.length;p--;)$p(o[p]);a||(p="value",G=="progress"&&T==null?t.removeAttribute("value"):T!=null&&(T!==t[p]||G=="progress"&&!T||G=="option"&&T!=N[p])&&Ka(t,p,T,N[p],i),p="checked",D!=null&&D!=t[p]&&Ka(t,p,D,N[p],i))}return t}function Gp(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){xe.__e(i,r)}}function eg(t,e,r){var n,i;if(xe.unmount&&xe.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Gp(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){xe.__e(o,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&eg(n[i],e,r||typeof t.type!="function");r||$p(t.__e),t.__c=t.__=t.__e=void 0}function gw(t,e,r){return this.constructor(t,r)}function tg(t,e,r){var n,i,o,s;e==document&&(e=document.documentElement),xe.__&&xe.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,o=[],s=[],jp(e,t=(!n&&r||e).__k=Wp(kr,null,[t]),i||ns,ns,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?Qa.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n,s),Qh(o,t,s)}Qa=Yh.slice,xe={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},jh=0,Hp=function(t){return t!=null&&t.constructor==null},Br.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=cn({},this.state),typeof t=="function"&&(t=t(cn({},r),this.props)),t&&cn(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Vh(this))},Br.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Vh(this))},Br.prototype.render=kr,Qn=[],Gh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,zh=function(t,e){return t.__v.__b-e.__v.__b},Ja.__r=0,qh=/(PointerCapture)$|Capture$/i,Vp=0,Up=Wh(!1),Fp=Wh(!0),pw=0;var qp,Yt,zp,rg,ng=0,pg=[],dt=xe,ig=dt.__b,og=dt.__r,sg=dt.diffed,ag=dt.__c,cg=dt.unmount,lg=dt.__;function yw(t,e){dt.__h&&dt.__h(Yt,t,ng||e),ng=0;var r=Yt.__H||(Yt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Kp(t,e){var r=yw(qp++,7);return _w(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function vw(){for(var t;t=pg.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ec),t.__H.__h.forEach(Yp),t.__H.__h=[]}catch(e){t.__H.__h=[],dt.__e(e,t.__v)}}dt.__b=function(t){Yt=null,ig&&ig(t)},dt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),lg&&lg(t,e)},dt.__r=function(t){og&&og(t),qp=0;var e=(Yt=t.__c).__H;e&&(zp===Yt?(e.__h=[],Yt.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.forEach(ec),e.__h.forEach(Yp),e.__h=[],qp=0)),zp=Yt},dt.diffed=function(t){sg&&sg(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(pg.push(e)!==1&&rg===dt.requestAnimationFrame||((rg=dt.requestAnimationFrame)||Ew)(vw)),e.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),zp=Yt=null},dt.__c=function(t,e){e.some(function(r){try{r.__h.forEach(ec),r.__h=r.__h.filter(function(n){return!n.__||Yp(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],dt.__e(n,r.__v)}}),ag&&ag(t,e)},dt.unmount=function(t){cg&&cg(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ec(n)}catch(i){e=i}}),r.__H=void 0,e&&dt.__e(e,r.__v))};var ug=typeof requestAnimationFrame=="function";function Ew(t){var e,r=function(){clearTimeout(n),ug&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);ug&&(e=requestAnimationFrame(r))}function ec(t){var e=Yt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Yt=e}function Yp(t){var e=Yt;t.__c=t.__(),Yt=e}function _w(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}var bw=Symbol.for("preact-signals");function Jp(){if(Vi>1)Vi--;else{for(var t,e=!1;is!==void 0;){var r=is;for(is=void 0,Xp++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&mg(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=n}}if(Xp=0,Vi--,e)throw t}}var Ve=void 0;var is=void 0,Vi=0,Xp=0,tc=0;function fg(t){if(Ve!==void 0){var e=t.n;if(e===void 0||e.t!==Ve)return e={i:0,S:t,p:Ve.s,n:void 0,t:Ve,e:void 0,x:void 0,r:e},Ve.s!==void 0&&(Ve.s.n=e),Ve.s=e,t.n=e,32&Ve.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Ve.s,e.n=void 0,Ve.s.n=e,Ve.s=e),e}}function ht(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}ht.prototype.brand=bw;ht.prototype.h=function(){return!0};ht.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};ht.prototype.U=function(t){if(this.t!==void 0){var e=t.e,r=t.x;e!==void 0&&(e.x=r,t.e=void 0),r!==void 0&&(r.e=e,t.x=void 0),t===this.t&&(this.t=r)}};ht.prototype.subscribe=function(t){var e=this;return Tt(function(){var r=e.value,n=Ve;Ve=void 0;try{t(r)}finally{Ve=n}})};ht.prototype.valueOf=function(){return this.value};ht.prototype.toString=function(){return this.value+""};ht.prototype.toJSON=function(){return this.value};ht.prototype.peek=function(){var t=Ve;Ve=void 0;try{return this.value}finally{Ve=t}};Object.defineProperty(ht.prototype,"value",{get:function(){var t=fg(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Xp>100)throw new Error("Cycle detected");this.v=t,this.i++,tc++,Vi++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Jp()}}}});function sr(t){return new ht(t)}function mg(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function dg(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function hg(t){for(var e=t.s,r=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=r}function $i(t){ht.call(this,void 0),this.x=t,this.s=void 0,this.g=tc-1,this.f=4}($i.prototype=new ht).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===tc))return!0;if(this.g=tc,this.f|=1,this.i>0&&!mg(this))return this.f&=-2,!0;var t=Ve;try{dg(this),Ve=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Ve=t,hg(this),this.f&=-2,!0};$i.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ht.prototype.S.call(this,t)};$i.prototype.U=function(t){if(this.t!==void 0&&(ht.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};$i.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty($i.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=fg(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Qp(t){return new $i(t)}function gg(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Vi++;var r=Ve;Ve=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Zp(t),n}finally{Ve=r,Jp()}}}function Zp(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,gg(t)}function ww(t){if(Ve!==this)throw new Error("Out-of-order effect");hg(this),Ve=t,this.f&=-2,8&this.f&&Zp(this),Jp()}function os(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}os.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};os.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,gg(this),dg(this),Vi++;var t=Ve;return Ve=this,ww.bind(this,t)};os.prototype.N=function(){2&this.f||(this.f|=2,this.o=is,is=this)};os.prototype.d=function(){this.f|=8,1&this.f||Zp(this)};function Tt(t){var e=new os(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var tf,ef;function Wi(t,e){xe[t]=e.bind(null,xe[t]||function(){})}function rc(t){ef&&ef(),ef=t&&t.S()}function yg(t){var e=this,r=t.data,n=Iw(r);n.value=r;var i=Kp(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var s,a=e.__$u.S(),c=i.value;a(),Hp(c)||((s=e.base)==null?void 0:s.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=c},Qp(function(){var s=n.value.value;return s===0?0:s===!0?"":s||""})},[]);return i.value}yg.displayName="_st";Object.defineProperties(ht.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:yg},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Wi("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof ht&&(r||(e.__np=r={}),r[i]=o,n[i]=o.peek())}}t(e)});Wi("__r",function(t,e){rc();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=(function(i){var o;return Tt(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o})())),tf=n,rc(r),t(e)});Wi("__e",function(t,e,r,n){rc(),tf=void 0,t(e,r,n)});Wi("diffed",function(t,e){rc(),tf=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,i=e.props;if(n){var o=r.U;if(o)for(var s in o){var a=o[s];a!==void 0&&!(s in n)&&(a.d(),o[s]=void 0)}else r.U=o={};for(var c in n){var p=o[c],d=n[c];p===void 0?(p=Sw(r,c,d,i),o[c]=p):p.o(d,i)}}}t(e)});function Sw(t,e,r,n){var i=e in t&&t.ownerSVGElement===void 0,o=sr(r);return{o:function(s,a){o.value=s,n=a},d:Tt(function(){var s=o.value.value;n[e]!==s&&(n[e]=s,i?t[e]=s:s?t.setAttribute(e,s):t.removeAttribute(e))})}}Wi("unmount",function(t,e){if(typeof e.type=="string"){var r=e.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var s=e.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}t(e)});Wi("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});Br.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u,n=r&&r.s!==void 0;for(var i in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(n||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function Iw(t){return Kp(function(){return sr(t)},[])}var nc=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}};var ic=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}};var rf=class{id;mID;name;groupID;groupName;isSelected;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.name=e.name,this.groupID=e.groupID,this.groupName=e.groupName,this.isSelected=e.isSelected??!1}},Ur=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;selectedSellingPlan;effectivePrice;constructor(e){e=e??{},this.mID=e.mID,this.name=e.name,this.imgs=e.imgs?.map(r=>new nc(r))??[],this.link=e.link,this.price=new ic(e.price),this.sku=e.sku,this.isAvailable=e.isAvailable,this.quantity=e.quantity,this.selectedOptions=e.selectedOptions??[],this.effectivePrice=sr(this.price.effective),e.sellingPlans?.length&&(this.selectedSellingPlan=sr(void 0)),this.sellingPlans=e.sellingPlans?.map(r=>{let n=new rf(r);return n.isSelected&&(this.selectedSellingPlan.value=n),n})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}};var Dt=class{id;mID;name;options;imgs;vars;desc;link;slug;quantity;category;meta;reviews;tags;selectedOrFirstVariant;selected=sr(!0);constructor(e){this.update(e),this.selectedOrFirstVariant=sr(this.selectedVariant)}get firstImageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}set variants(e){this.vars=e,this.selectedOrFirstVariant.value=this.selectedVariant}get selectedVariant(){return this.vars.find(e=>e.isAvailable)??this.vars[0]}hasVariants(){return this.vars?.length>1}setSelectedVariant(e){this.selectedOrFirstVariant.value=e}setSelectedVariantByID(e){if(!e)return;let r=this.vars.find(n=>n.mID===e.toString());r&&this.setSelectedVariant(r)}update(e){return this.id=e.id??this.id,this.mID=e.mID??this.mID,this.name=e.name??this.name,this.imgs=e.imgs??this.imgs,this.desc=e.desc??this.desc,this.link=e.link??this.link,this.slug=e.slug??this.slug,this.quantity=e.quantity??this.quantity,this.meta=e.meta??this.meta,this.category=e.category??this.category,this.reviews=e.reviews??this.reviews,this.options=e.options??this.options,this.tags=e.tags??this.tags,e.vars&&(this.vars=e.vars.map(r=>new Ur(r))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new Rt({id:this.id,mID:this.mID,vID:e.mID,vName:e.name,name:this.name,link:this.link,slug:this.slug,price:e.price.d,imageURL:e.getOneImage()??this.imgs?.[0].url})}getTemplateVariables(){let e=this.selectedOrFirstVariant.value,r=e.price,n=this.name,i=this.category,o=this.variantImage??this.firstImageURL,s=this.meta,a=this.tags?.join(",")??"",c=this.reviews?.rating,p=this.reviews?.totalReviews,d=r.cmp&&r.cmp>r.d,f=Z(_({name:n},kt("price",r.d,!0)),{image_url:o,meta:s,category:i,rating:c,reviews:p,tags:a});if(e.hasEffectivePrice()){let y=kt("effective_price",e.effectivePrice.value,!0);Object.assign(f,y)}if(d){let y=r.cmp-r.d,T={discount_percent:(y/r.cmp*100).toFixed(0)};Object.assign(f,T),Object.assign(f,kt("compare_price",r.cmp)),Object.assign(f,kt("discount_price",y))}let E={name:e.name,quantity:e.quantity};return{product:f,variant:E}}};var oc=class{id;alt;shortID;sources;items;durationMS;thumbnail;card;bestSource;highSource;goodSource;lowSource;m3u8Source;constructor(e={}){if(this.id=e.id,this.alt=e.alt,this.shortID=e.shortID,this.sources=e.sources?.sort((r,n)=>n.height-r.height),this.durationMS=e.durationMS,this.thumbnail=e.thumbnail,this.items=e.items?e.items.map(r=>new Dt(r)):[],this.card=e.card,this.sources){let r=[];for(let n of this.sources)n.format==="mp4"?r.push(n):n.format==="m3u8"&&!this.m3u8Source&&(this.m3u8Source=n);r.length>0&&(this.bestSource=r[0],this.highSource=r.length>1?r[1]:r[0],this.lowSource=r.length>2?r[r.length-1]:r[0])}}};var nf=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new je(e.color)}},of=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new je(e.color)}},sf=class{enabled;delay;constructor(e={}){this.enabled=e.enabled,e.delay&&(this.delay=e.delay>100?e.delay:e.delay*1e3)}},Tn=class{navigation;pagination;autoplay;loop;maxInRow;gap;maxInRowSm;gapSm;speed;marquee;constructor(e){e??={},this.navigation=new of(e.navigation),this.pagination=new nf(e.pagination),this.autoplay=new sf(e.autoplay),this.loop=e.loop??!1,this.maxInRow=e.maxInRow??4,this.gap=e.gap??0,this.maxInRowSm=e.maxInRowSm??this.maxInRow,this.gapSm=e.gapSm??this.gap,e.speed&&(this.speed=e.speed*1e3),this.marquee=e.marquee}};var sc=class{videos;source;template;heading;slidePerViewCount;autoPlay;showMuteButton;footerContent;detailPopup;playlistConfig;constructor(e={}){this.videos=e.videos?.map(r=>new oc(r))??[],this.source=e.source,this.template=e.template,this.detailPopup=e.detailPopup??{template:"VIDEO_ONLY_VIEW"},this.heading=e.heading,this.showMuteButton=e.showMuteButton,this.slidePerViewCount=e.slidePerViewCount??4,this.autoPlay=e.autoPlay??"ON",this.footerContent=e.footerContent??"FIRST_ITEM",this.playlistConfig=e.playlistConfig?.videoSwiper?{videoSwiper:new Tn(e.playlistConfig?.videoSwiper)}:void 0}};var Ut=xr(Eg());Ut.filters.define("default",function(t){return typeof t>"u"||t==null?"":xw(t)});+Ut.filters.define("max",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r>n?e:t});Ut.filters.define("min",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r<n?e:t});Ut.filters.define("fallback",(t,e)=>t==null||t===""?e:t);Ut.filters.define("manipulate_quantity",(t,e,r)=>{if(e??=1,r??=100,e>r)return b.error("Invalid range: min should be less than or equal to max."),t;if(t>=e&&t<=r)return t;let n=t%r;return n<e?e:n});Ut.filters.define("apply_discount_perc",(t,e,r=1/0)=>{if(t=+t,isNaN(t))return b.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return b.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let n=t*e/100;return t-Math.min(r,n)});Ut.filters.define("apply_discount_fixed",(t,e)=>(t=+t,isNaN(t)?(b.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,t-e)));Ut.filters.define("currency",t=>(t=+t,isNaN(t)?(b.error("Need value as a number for `currency` filter"),NaN):Mp(t)));Ut.defaultConfig.defaultFilter="default";Ut.defaultConfig.useWith=!0;Ut.defaultConfig.autoEscape=!1;var Tw={'"':""","\\":"\","\n":"\\n"};function xw(t){return String(t).replace(/["\\\n]/g,e=>Tw[e])}function Cw(t){if(!t)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return t.replace(e,(r,n,i,o)=>`{{ ${(i||o||"").trim()} }}`)}var ji=(t,e,r)=>{e=_({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Ut.render(Cw(t),e)}catch(n){throw ae(n,"squirrelly-render",{extra:{template:t,values:e},triggerContext:r}),n}},Zn=(t,e,r)=>{let n=JSON.stringify(t),i=ji(n,e,r);try{return JSON.parse(i)}catch(o){throw ae(o,"variable-replacement",{extra:{before:t,after:i},triggerContext:r}),o}};function ss(){return!!window.Shopify}function cc(){if(ss())return window.Shopify.shop?.split(".")?.[0]}function _g(t){let n=(t.includes("://")?new URL(t).pathname:t).match(/\/products\/([^/]+?)(?:\.html)?$/);return n?n[1]:null}function Gi(t){return(window.Shopify?.routes?.root??"/")+t.substring(1)}function lc(t){return Gi(t+"?from=cooee")}var ge=class t{static CURRENT;token;items=[];total_price=0;original_total_price=0;items_subtotal_price=0;currency;item_count=0;attributes;cart_level_discount_applications;total_discount=0;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new t),this.CURRENT}async getNormalisedCart(e){return Rw(e)}getCooeeCart(){return af()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.items_subtotal_price=e.items_subtotal_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,this.cart_level_discount_applications=e.cart_level_discount_applications,this.total_discount=e.total_discount,ve.get().currencyCode=this.currency,b.verbose("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}};async function Rw(t){let e=ge.getCurrent();await Dw(e,t);let r=bg(e);return t&&await Ye.set("cart",r),r}function af(){return bg(ge.getCurrent())}function bg(t){return{amount:t.total_price/100,originalAmount:t.original_total_price/100,itemsSubtotalPrice:t.items_subtotal_price/100,currency:t.currency,itemCount:t.item_count,items:Aw(t.items),token:t.token}}function Aw(t){if(!t)return b.error("No item received to be sent"),[];Array.isArray(t)||(t=[t]);let e=[];for(let r of t){if(!r.id||!r.title){b.warn("Invalid item received",r);continue}let n={name:r.title,quantity:+r.quantity||1,mID:r.product_id?.toString(),vID:r.id.toString(),price:+r.price/100||0,finalPrice:+r.final_price/100||0,properties:r.properties,key:r.key},i=r.selling_plan_allocation?.selling_plan;if(!i){e.push(n);continue}n.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:i.fixed_selling_plan,id:i.id,name:i.name,recurringDeliveries:i.recurring_deliveries}},e.push(n)}return e}async function Dw(t,e){if(!e&&t.token){b.verbose("Not fetching cart");return}b.verbose("Fetching cart");let r=lc("/cart.js");try{let n=(await tn(r,{},{retries:2})).data;t.update(n)}catch(n){b.error("Unable to fetch the cart",n)}}var uc=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL}};var cf=class{enabled;constructor(e){this.enabled=e.enabled}},lf=class extends cf{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},pc=class{productQuantity;constructor(e){e??={},this.productQuantity=new lf(e.productQuantity)}};var Kt=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Qr(e.br)),e.shd&&(this.shd=new Uo(e.shd)),e.spc&&(this.spc=new Zr(e.spc)),this.trf=new Wn(e.trf),this.clc=e.clc,this.w=e.w,this.h=e.h,this.x=e.x,this.y=e.y,this.a=e.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return ze[this.t]}get click(){return this.clc}},ze=(P=>(P[P.IMAGE=1]="IMAGE",P[P.TEXT=2]="TEXT",P[P.BUTTON=3]="BUTTON",P[P.FLEXBOX=4]="FLEXBOX",P[P.MULTI_COLUMN=5]="MULTI_COLUMN",P[P.CHECKBOX=6]="CHECKBOX",P[P.PRODUCTS=11]="PRODUCTS",P[P.PRODUCT=12]="PRODUCT",P[P.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",P[P.PRODUCT_TITLE=14]="PRODUCT_TITLE",P[P.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",P[P.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",P[P.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",P[P.PRODUCT_RATING=19]="PRODUCT_RATING",P[P.EMAIL_INPUT=51]="EMAIL_INPUT",P[P.PHONE_INPUT=52]="PHONE_INPUT",P[P.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",P[P.CAROUSEL=62]="CAROUSEL",P[P.SHAPE=100]="SHAPE",P))(ze||{});var ei=class extends Kt{constructor(e){super(e)}};var ln=class extends Kt{src;constructor(e){super(e),this.src=e.src}};var Fr=class extends Kt{typo;constructor(e){super(e);let r=_(_({},e.f),e.typo);e.alg&&(r.ta=e.alg),e.c&&(r.tc=e.c),this.typo=new lt(r)}get color(){return this.typography.tc}get typography(){return this.typo}};var xn=class extends Fr{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}};var fc=class extends Kt{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}};var zi=class{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0}start(e,r){let n=new Date;e===2?(n.setSeconds(n.getSeconds()+this.ss),n.setMinutes(n.getMinutes()+this.mm),n.setHours(n.getHours()+this.hh),n.setDate(n.getDate()+this.dd)):n=this.date??new Date;let i=window.setInterval(()=>{let o=new Date().getTime(),s=n.getTime()-o;if(s<1){clearInterval(i);return}let a=Math.floor(s/(1e3*60*60*24)),c=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),p=Math.floor(s%(1e3*60*60)/(1e3*60)),d=Math.floor(s%(1e3*60)/1e3);r({days:a,hours:c,minutes:p,seconds:d})},1e3);return i}};var qi=class extends Fr{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new zi(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var mc=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new je(e.c??{})}get text(){return this.txt}get color(){return this.c}};var Cn=class extends Fr{ph;constructor(e){super(e),this.ph=new mc(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}};var Yi=class extends Cn{constructor(e){e??={},super(e)}};var Ki=class extends Cn{};var Xi=class extends Cn{};var Ji=class extends ln{};var dc=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}};var hc=15,as=class extends Kt{gvt;max;cover;anim;embedded;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??!0,this.anim=new dc(e.anim),this.spc||(this.spc=new Zr({pl:hc,pr:hc,pt:hc,pb:hc}))}};var gc=class extends as{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new fc(e.cont),this.mob=new as(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(r=>{r.t===1?this.elems.push(new ln(r)):r.t===2?this.elems.push(new xn(r)):r.t===3?this.elems.push(new xn(r)):r.t===100?this.elems.push(new ei(r)):r.t===51?this.elems.push(new Ki(r)):r.t===52?this.elems.push(new Xi(r)):r.t===61?this.elems.push(new qi(r)):r.t===15||r.t===16?this.elems.push(new Yi(r)):r.t===13&&this.elems.push(new Ji(r))})}getStylesForWrapper(){if(this.cover)return{};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:"50%",left:0,transform:"translateY(-50%)"}:e={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},e.overflow="visible",e}getFlexStylesForContainer(){let e={display:"flex",flexDirection:"row"},r,n;return this.gvt===1?(r="flex-start",n="flex-start"):this.gvt===2?(r="center",n="flex-start"):this.gvt===3?(r="flex-end",n="flex-start"):this.gvt===4?(r="flex-start",n="center"):this.gvt===6?(r="flex-end",n="center"):this.gvt===7?(r="flex-start",n="flex-end"):this.gvt===8?(r="center",n="flex-end"):this.gvt===9?(r="flex-end",n="flex-end"):(r="center",n="center"),e.alignItems=n,e.justifyContent=r,e.overflow="visible",e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim}};var Qi=class{gap;dir;wrap;jc;ai;scroll;constructor(e){e??={},this.gap=e.gap??0,this.dir=e.dir??"row",this.wrap=e.wrap??"nowrap",this.jc=e.jc??"flex-start",this.ai=e.ai??"flex-start",this.scroll=e.scroll}};var yc=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(e){e??={},this.of=e.of,this.disp=e.disp,this.pos=e.pos,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.zIndex=e.zIndex}};var vc=class{w;h;maxW;maxH;minW;minH;constructor(e){e??={},this.w=e.w??"100%",this.h=e.h??"auto",this.maxW=e.maxW,this.maxH=e.maxH,this.minW=e.minW,this.minH=e.minH}};var Ec=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Zr(e.spc),e.size&&(this.size=new vc(e.size)),e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Qr(e.br)),e.typo&&(this.typo=new lt(e.typo)),e.lout&&(this.lout=new yc(e.lout)),e.flex&&(this.flex=new Qi(e.flex))}},Zi=class{sm;lg;constructor(e){e??={},this.sm=new Ec(e.sm),this.lg=new Ec(e.lg)}};var yt=class{t;style;hide;when;clc;l;constructor(e,r){r??={},this.t=e,this.style=new Zi(r.style),this.hide=r.hide,this.l=r.l,r.when?.op&&(this.when=r.when),r.clc&&(this.clc=r.clc)}get stringType(){return ze[this.t]}};var vt=class extends yt{text;constructor(e,r){e?.style?.lg?.typo?.s&&delete e.style.lg.typo.s,e?.style?.sm?.typo?.s&&delete e.style.sm.typo.s,super(r??2,e),e??={},this.text=e.text}};var ti=class extends vt{constructor(e,r){super(e,r??3)}};var eo=class extends yt{value;constructor(e){super(6,e),e??={},this.value=e.value}};var to=class extends vt{showChips;optionsConfig;constructor(e=15,r){super(r,e),r??={},this.showChips=r.showChips??!1,this.optionsConfig=r.optionsConfig??{}}};var _c=class extends yt{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new je(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}};var wg=xr(Si());var bc=class extends yt{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e)}update(e){e??={},this.slide=Xt.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new Tn(e.conf),this.allowedTypes=e.allowedTypes}};var wc=class extends vt{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new zi(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var Rn=class extends yt{elems;constructor(e){super(4,e),this.update(e)}update(e){e??={},this.elems??=[],e.elems?.forEach(r=>{let n=Xt.getParsedElement(r);n&&this.elems.push(n)})}};var ri=class extends yt{src;sm;lg;constructor(e,r){super(r??1,e),e&&this.update(e)}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg}};var Xt=class t{static getParsedElements(e){let r=[];return e?.forEach(n=>{let i=t.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(e){switch(e.t){case 2:return new vt(e);case 3:return new ti(e);case 6:return new eo(e);case 11:return new Sc(e);case 12:return new An(e);case 61:return new wc(e);case 4:return new Rn(e);case 1:return new ri(e);case 13:return new ri(e,13);case 14:return new vt(e,14);case 15:case 16:return new to(e.t,e);case 18:return new ti(e,18);case 62:return new bc(e);case 19:return new _c(e);default:wg.default.error("Unknown element type",e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}};var An=class extends yt{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=Xt.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new eo(e.cBox)),this.elems.push(new ri(e.img,13));let r=new vt(e.title,14);r.hide=!e.show?.title,r.text="{{ product.name }}",this.elems.push(r);let n=new vt(e.price);n.text="{{ product.price }}",n.hide=!e.show?.price;let i=new vt(e.compareAt);i.text="{{ product.compare_price }}",i.hide=!e.show?.price,e.compareAt||(i.style=new Zi(n.style),i.style.lg.typo=new lt(Z(_({},i.style.lg.typo),{td:"line-through"})),i.style.sm.typo=new lt(Z(_({},i.style.sm.typo),{td:"line-through"})));let o=new Rn({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:Xt.parseAlignmentToJustifyContent(n.style.lg.typo?.ta)}}}});o.elems.push(i),o.elems.push(n),this.elems.push(o);let s=new to(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let a=new ti(e.btn,18);a.hide=!e.show?.btn,this.elems.push(a)}}e.symbol&&(this.symbol=new vt(e.symbol))}};var Sc=class extends yt{conf;prod;constructor(e){super(11,e),e??={},this.conf=new uf(e.conf),this.prod=new An(e.prod)}};var Ic=class extends Tn{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},uf=class{lg;sm;constructor(e){e??={},this.lg=new Ic(e.lg),this.sm=new Ic(e.sm)}};var Tc=class extends Rn{constructor(e){super(e)}};var ro=class{cont;elems=[];constructor(e){e=e??{},this.cont=new Tc(e.cont),e.elems?.forEach(r=>{this.addRawElement(r)})}addRawElement(e){let r=Xt.getParsedElement(e);return r&&this.elems.push(r),r}};function xc(t,e){return Nw(t,e,0,5)}function Nw(t,e,r=0,n=50){if(e){if(r>n){console.warn("Maximum recursion depth reached in findFirstElementOfType");return}for(let i of e){if(i.t===t)return i;let o="elems"in i?i.elems:[];if(o?.length>0){let s=xc(t,o);if(s)return s}}}}var pf=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===Po.EXCLUSION}isABTesting(){return this.contentType===Po.ABTESTING}isSingleContent(){return this.contentType===Po.SINGLE}},cs=class{videoConfig;savingsBarConfig;afterDeleteJS;afterRenderJS;constructor(e){this.update(e)}update(e){e??={},e.videoConfig&&(this.videoConfig=new sc(e.videoConfig)),e.savingsBarConfig&&(this.savingsBarConfig=new oa(e.savingsBarConfig)),e.afterDeleteJS&&(this.afterDeleteJS=e.afterDeleteJS),e.afterRenderJS&&(this.afterRenderJS=e.afterRenderJS)}},xt=class extends pf{contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;entryAnimation;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;stickyATCConfig;bundleConfig;content;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=sr({});constructor(e){super(e),this.id=e.id,this.currency=ve.get().currencyCode??"USD",this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new ro(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.entryAnimation=e.entryAnimation??"NONE",this.embeddedItems=e.embeddedItems?.map(r=>new Rt(r)),this.items=e.items?.map(r=>new Dt(r))??[],this.nonMutableItems=e.items?.map(r=>new Dt(r))??[],this.collections=e.collections?.map(r=>new uc(r))??[],this.discount=e.discount,this.placement=e.placement,this.customerData=e.customerData,this.ian=e.ian?this.processPopup(e.ian):void 0,this.promotionType=e.promotionType,this.manipulation=new pc(e.manipulation),this.contentSource=e.contentSource,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.skipSubscribedItems=e.skipSubscribedItems,this.stickyATCConfig=e.stickyATCConfig,e.experimentConfig&&(this.experimentConfig=new ra(e.experimentConfig)),e.progressBarConfig&&(this.progressBarConfig=new ia(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new Zs(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new Dt(e.bundleFrom)),e.content&&(this.content=new cs(e.content))}shouldDelay(){return this.delay>0}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===yr.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===Lo.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===Lo.PAGE_EMBED}isProgressBar(){return this.objective===yr.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===yr.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===yr.CART_RECOVERY}isProductPromotion(){return this.objective===yr.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isCollectionPromoted(){return this.isProductPromotion()&&this.collections.length>0&&this.promotionType===cu.COLLECTION}isBYOB(){return this.objective===yr.BYOB}isStickyATC(){return this.objective===yr.STICKY_ATC}isShoppableVideo(){return this.objective===yr.SHOPPABLE_VIDEO}isSavingsBar(){return this.objective===yr.SAVINGS_BAR}processPopup(e){let r=this.items[0],n={},i={};if(r){let a=r.selectedOrFirstVariant.value;n=Z(_(_({name:r.name,id:r.mID,link:r.link,vID:a.mID,image:r.variantImage},kt("price",a.price.d)),kt("comparePrice",a.price.cmp)),{quantity:r.quantity}),i={quantity:a.quantity}}let o={productCount:ge.getCurrent().item_count},s=ji(JSON.stringify(e),{product:n,variant:i,cart:o,discount:this.discount,customer:this.customerData},new Rr(new Date,this));return r&&(s=s.replace(new RegExp("https://cdn.global.letscooee.com/images/placeholders/product.png","gi"),r.variantImage??r.firstImageURL)),new gc(JSON.parse(s))}calculateDiscountData(e,r){let n=Jr.sum(e,s=>s.selectedOrFirstVariant.value.price.d),i=Jr.sum(e,s=>{let a=s.selectedOrFirstVariant.value.price;return a.cmp??a.d}),o={actualPrice:n,totalComparePrice:i,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!e?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(o);return}if(er.BXGY===this.discount.type&&this.discount.values?.length)o.discountPercentage=this.discount.values[0],this.updateEffectivePrice(e,o.discountPercentage,!0),o.discountAmount=o.actualPrice-Jr.sum(e,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([er.UNIQUE_FLAT_ITEMS,er.STATIC,er.UNIQUE_FLAT].includes(this.discount.type)&&this.discount.values?.length)o.discountPercentage=this.discount.values[0],o.discountAmount=o.actualPrice*o.discountPercentage/100,this.updateEffectivePrice(e,o.discountPercentage);else if(this.discount.type===er.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)o.discountAmount=o.actualPrice-this.discount.values[0],o.discountPercentage=o.discountAmount/o.actualPrice*100,this.updateEffectivePrice(e,o.discountPercentage);else if(this.discount.type===er.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((a,c)=>c.selectedOrFirstVariant.value.price.d-a.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,o.discountAmount=s.selectedOrFirstVariant.value.price.d,o.discountPercentage=o.discountAmount/o.actualPrice*100}o.discountedPrice=o.actualPrice-o.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(o)}getPrivateAttributesForLineItem(){return Xe.get().skipItemAttribute?{}:{_via:"Cooee",_letscooee_campaign:this.shortID,_letscooee_content:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return Xe.get().skipItemAttribute?[]:[{key:"_via",value:"Cooee"},{key:"_letscooee_campaign",value:this.shortID},{key:"_letscooee_content",value:this.contentID}]}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){if(xc(62,this.widget?.elems))return!0;let r=xc(11,this.widget?.elems);return r?r.conf.lg.disp===2||r.conf.sm.disp===2:!1}toString(){let e;return this.onsiteDeliveryType===Lo.POPUP?e="Popup":e=Um.toTitle(this.objective),`${e}(id=${this.shortID})`}getCartMagicVariables(){let e=ge.getCurrent(),r=Jr.sum(e.items??[],n=>n.discounts?.reduce((i,o)=>i+(o.amount??0),0)??0);return _(_(_(_({productCount:e.item_count,product_count:e.item_count},kt("amount",e.total_price/100)),kt("originalAmount",e.original_total_price/100)),kt("total_line_items_discount",r/100)),kt("total_discount",e.total_discount/100))}shouldGetVariationImmediately(){return this.hasMultiplePlacement&&!this.isProgressBar()&&!this.isSavingsBar()}shouldSkipVariation(){return this.isSingleContent()||this.isProgressBar()||this.isSavingsBar()||!!this.widget}updateEffectivePrice(e,r,n=!1){let i=ve.get().getCurrentItem();e.forEach(o=>{let s=o.selectedOrFirstVariant.value,a=s.price;if(n&&o.mID===i.mID)s.effectivePrice.value=a.d;else{let c=a.d*r/100;s.effectivePrice.value=a.d-c}})}formatCurrencyAndNumber(e){if(!e)return{};let r={discountPercentage:kh(e.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice","totalComparePrice"].map(n=>{Object.assign(r,kt(n,e[n]))}),r}};function Pw(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Lw=Uw,Mw=Hw,Bw=Ww,Vr=[],cr=[],kw=typeof Uint8Array<"u"?Uint8Array:Array,ff="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ni=0,Sg=ff.length;ni<Sg;++ni)Vr[ni]=ff[ni],cr[ff.charCodeAt(ni)]=ni;var ni,Sg;cr[45]=62;cr[95]=63;function Fg(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Uw(t){var e=Fg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Fw(t,e,r){return(e+r)*3/4-r}function Hw(t){var e,r=Fg(t),n=r[0],i=r[1],o=new kw(Fw(t,n,i)),s=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=cr[t.charCodeAt(c)]<<18|cr[t.charCodeAt(c+1)]<<12|cr[t.charCodeAt(c+2)]<<6|cr[t.charCodeAt(c+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=cr[t.charCodeAt(c)]<<2|cr[t.charCodeAt(c+1)]>>4,o[s++]=e&255),i===1&&(e=cr[t.charCodeAt(c)]<<10|cr[t.charCodeAt(c+1)]<<4|cr[t.charCodeAt(c+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function Vw(t){return Vr[t>>18&63]+Vr[t>>12&63]+Vr[t>>6&63]+Vr[t&63]}function $w(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Vw(n));return i.join("")}function Ww(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push($w(t,s,s+o>a?a:s+o));return n===1?(e=t[r-1],i.push(Vr[e>>2]+Vr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Vr[e>>10]+Vr[e>>4&63]+Vr[e<<2&63]+"=")),i.join("")}var mf={byteLength:Lw,toByteArray:Mw,fromByteArray:Bw};var jw=function(e,r,n,i,o){var s,a,c=o*8-i-1,p=(1<<c)-1,d=p>>1,f=-7,E=n?o-1:0,y=n?-1:1,T=e[r+E];for(E+=y,s=T&(1<<-f)-1,T>>=-f,f+=c;f>0;s=s*256+e[r+E],E+=y,f-=8);for(a=s&(1<<-f)-1,s>>=-f,f+=i;f>0;a=a*256+e[r+E],E+=y,f-=8);if(s===0)s=1-d;else{if(s===p)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-d}return(T?-1:1)*a*Math.pow(2,s-i)},Gw=function(e,r,n,i,o,s){var a,c,p,d=s*8-o-1,f=(1<<d)-1,E=f>>1,y=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=i?0:s-1,D=i?1:-1,N=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+E>=1?r+=y/p:r+=y*Math.pow(2,1-E),r*p>=2&&(a++,p/=2),a+E>=f?(c=0,a=f):a+E>=1?(c=(r*p-1)*Math.pow(2,o),a=a+E):(c=r*Math.pow(2,E-1)*Math.pow(2,o),a=0));o>=8;e[n+T]=c&255,T+=D,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;e[n+T]=a&255,T+=D,a/=256,d-=8);e[n+T-D]|=N*128},no={read:jw,write:Gw},Ac=Pw(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=k,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var h=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(h,l),h.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(h){if(h>n)throw new RangeError('The value "'+h+'" is invalid for option "size"');var l=new Uint8Array(h);return Object.setPrototypeOf(l,s.prototype),l}function s(h,l,u){if(typeof h=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(h)}return a(h,l,u)}s.poolSize=8192;function a(h,l,u){if(typeof h=="string")return f(h,l);if(ArrayBuffer.isView(h))return y(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h));if(We(h,ArrayBuffer)||h&&We(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(h,SharedArrayBuffer)||h&&We(h.buffer,SharedArrayBuffer)))return T(h,l,u);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var v=h.valueOf&&h.valueOf();if(v!=null&&v!==h)return s.from(v,l,u);var C=D(h);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return s.from(h[Symbol.toPrimitive]("string"),l,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h))}s.from=function(h,l,u){return a(h,l,u)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function p(h,l,u){return c(h),h<=0?o(h):l!==void 0?typeof u=="string"?o(h).fill(l,u):o(h).fill(l):o(h)}s.alloc=function(h,l,u){return p(h,l,u)};function d(h){return c(h),o(h<0?0:N(h)|0)}s.allocUnsafe=function(h){return d(h)},s.allocUnsafeSlow=function(h){return d(h)};function f(h,l){if((typeof l!="string"||l==="")&&(l="utf8"),!s.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var u=G(h,l)|0,v=o(u),C=v.write(h,l);return C!==u&&(v=v.slice(0,C)),v}function E(h){for(var l=h.length<0?0:N(h.length)|0,u=o(l),v=0;v<l;v+=1)u[v]=h[v]&255;return u}function y(h){if(We(h,Uint8Array)){var l=new Uint8Array(h);return T(l.buffer,l.byteOffset,l.byteLength)}return E(h)}function T(h,l,u){if(l<0||h.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<l+(u||0))throw new RangeError('"length" is outside of buffer bounds');var v;return l===void 0&&u===void 0?v=new Uint8Array(h):u===void 0?v=new Uint8Array(h,l):v=new Uint8Array(h,l,u),Object.setPrototypeOf(v,s.prototype),v}function D(h){if(s.isBuffer(h)){var l=N(h.length)|0,u=o(l);return u.length===0||h.copy(u,0,0,l),u}if(h.length!==void 0)return typeof h.length!="number"||Ne(h.length)?o(0):E(h);if(h.type==="Buffer"&&Array.isArray(h.data))return E(h.data)}function N(h){if(h>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return h|0}function k(h){return+h!=h&&(h=0),s.alloc(+h)}s.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==s.prototype},s.compare=function(l,u){if(We(l,Uint8Array)&&(l=s.from(l,l.offset,l.byteLength)),We(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),!s.isBuffer(l)||!s.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===u)return 0;for(var v=l.length,C=u.length,O=0,W=Math.min(v,C);O<W;++O)if(l[O]!==u[O]){v=l[O],C=u[O];break}return v<C?-1:C<v?1:0},s.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(l,u){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return s.alloc(0);var v;if(u===void 0)for(u=0,v=0;v<l.length;++v)u+=l[v].length;var C=s.allocUnsafe(u),O=0;for(v=0;v<l.length;++v){var W=l[v];if(We(W,Uint8Array))O+W.length>C.length?s.from(W).copy(C,O):Uint8Array.prototype.set.call(C,W,O);else if(s.isBuffer(W))W.copy(C,O);else throw new TypeError('"list" argument must be an Array of Buffers');O+=W.length}return C};function G(h,l){if(s.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||We(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(h));var u=h.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&u===0)return 0;for(var C=!1;;)switch(l){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return St(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return $e(h).length;default:if(C)return v?-1:St(h).length;l=(""+l).toLowerCase(),C=!0}}s.byteLength=G;function P(h,l,u){var v=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,l>>>=0,u<=l))return"";for(h||(h="utf8");;)switch(h){case"hex":return $(this,l,u);case"utf8":case"utf-8":return qe(this,l,u);case"ascii":return A(this,l,u);case"latin1":case"binary":return R(this,l,u);case"base64":return Ae(this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,l,u);default:if(v)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),v=!0}}s.prototype._isBuffer=!0;function Q(h,l,u){var v=h[l];h[l]=h[u],h[u]=v}s.prototype.swap16=function(){var l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<l;u+=2)Q(this,u,u+1);return this},s.prototype.swap32=function(){var l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<l;u+=4)Q(this,u,u+3),Q(this,u+1,u+2);return this},s.prototype.swap64=function(){var l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<l;u+=8)Q(this,u,u+7),Q(this,u+1,u+6),Q(this,u+2,u+5),Q(this,u+3,u+4);return this},s.prototype.toString=function(){var l=this.length;return l===0?"":arguments.length===0?qe(this,0,l):P.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(l){if(!s.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:s.compare(this,l)===0},s.prototype.inspect=function(){var l="",u=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(l+=" ... "),"<Buffer "+l+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(l,u,v,C,O){if(We(l,Uint8Array)&&(l=s.from(l,l.offset,l.byteLength)),!s.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(l));if(u===void 0&&(u=0),v===void 0&&(v=l?l.length:0),C===void 0&&(C=0),O===void 0&&(O=this.length),u<0||v>l.length||C<0||O>this.length)throw new RangeError("out of range index");if(C>=O&&u>=v)return 0;if(C>=O)return-1;if(u>=v)return 1;if(u>>>=0,v>>>=0,C>>>=0,O>>>=0,this===l)return 0;for(var W=O-C,ue=v-u,be=Math.min(W,ue),ye=this.slice(C,O),ke=l.slice(u,v),He=0;He<be;++He)if(ye[He]!==ke[He]){W=ye[He],ue=ke[He];break}return W<ue?-1:ue<W?1:0};function _e(h,l,u,v,C){if(h.length===0)return-1;if(typeof u=="string"?(v=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,Ne(u)&&(u=C?0:h.length-1),u<0&&(u=h.length+u),u>=h.length){if(C)return-1;u=h.length-1}else if(u<0)if(C)u=0;else return-1;if(typeof l=="string"&&(l=s.from(l,v)),s.isBuffer(l))return l.length===0?-1:X(h,l,u,v,C);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(h,l,u):Uint8Array.prototype.lastIndexOf.call(h,l,u):X(h,[l],u,v,C);throw new TypeError("val must be string, number or Buffer")}function X(h,l,u,v,C){var O=1,W=h.length,ue=l.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(h.length<2||l.length<2)return-1;O=2,W/=2,ue/=2,u/=2}function be(mr,Xr){return O===1?mr[Xr]:mr.readUInt16BE(Xr*O)}var ye;if(C){var ke=-1;for(ye=u;ye<W;ye++)if(be(h,ye)===be(l,ke===-1?0:ye-ke)){if(ke===-1&&(ke=ye),ye-ke+1===ue)return ke*O}else ke!==-1&&(ye-=ye-ke),ke=-1}else for(u+ue>W&&(u=W-ue),ye=u;ye>=0;ye--){for(var He=!0,ot=0;ot<ue;ot++)if(be(h,ye+ot)!==be(l,ot)){He=!1;break}if(He)return ye}return-1}s.prototype.includes=function(l,u,v){return this.indexOf(l,u,v)!==-1},s.prototype.indexOf=function(l,u,v){return _e(this,l,u,v,!0)},s.prototype.lastIndexOf=function(l,u,v){return _e(this,l,u,v,!1)};function ce(h,l,u,v){u=Number(u)||0;var C=h.length-u;v?(v=Number(v),v>C&&(v=C)):v=C;var O=l.length;v>O/2&&(v=O/2);for(var W=0;W<v;++W){var ue=parseInt(l.substr(W*2,2),16);if(Ne(ue))return W;h[u+W]=ue}return W}function se(h,l,u,v){return De(St(l,h.length-u),h,u,v)}function fe(h,l,u,v){return De(ct(l),h,u,v)}function Be(h,l,u,v){return De($e(l),h,u,v)}function Te(h,l,u,v){return De(Se(l,h.length-u),h,u,v)}s.prototype.write=function(l,u,v,C){if(u===void 0)C="utf8",v=this.length,u=0;else if(v===void 0&&typeof u=="string")C=u,v=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(v)?(v=v>>>0,C===void 0&&(C="utf8")):(C=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var O=this.length-u;if((v===void 0||v>O)&&(v=O),l.length>0&&(v<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");for(var W=!1;;)switch(C){case"hex":return ce(this,l,u,v);case"utf8":case"utf-8":return se(this,l,u,v);case"ascii":case"latin1":case"binary":return fe(this,l,u,v);case"base64":return Be(this,l,u,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,l,u,v);default:if(W)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),W=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ae(h,l,u){return l===0&&u===h.length?mf.fromByteArray(h):mf.fromByteArray(h.slice(l,u))}function qe(h,l,u){u=Math.min(h.length,u);for(var v=[],C=l;C<u;){var O=h[C],W=null,ue=O>239?4:O>223?3:O>191?2:1;if(C+ue<=u){var be,ye,ke,He;switch(ue){case 1:O<128&&(W=O);break;case 2:be=h[C+1],(be&192)===128&&(He=(O&31)<<6|be&63,He>127&&(W=He));break;case 3:be=h[C+1],ye=h[C+2],(be&192)===128&&(ye&192)===128&&(He=(O&15)<<12|(be&63)<<6|ye&63,He>2047&&(He<55296||He>57343)&&(W=He));break;case 4:be=h[C+1],ye=h[C+2],ke=h[C+3],(be&192)===128&&(ye&192)===128&&(ke&192)===128&&(He=(O&15)<<18|(be&63)<<12|(ye&63)<<6|ke&63,He>65535&&He<1114112&&(W=He))}}W===null?(W=65533,ue=1):W>65535&&(W-=65536,v.push(W>>>10&1023|55296),W=56320|W&1023),v.push(W),C+=ue}return Ft(v)}var et=4096;function Ft(h){var l=h.length;if(l<=et)return String.fromCharCode.apply(String,h);for(var u="",v=0;v<l;)u+=String.fromCharCode.apply(String,h.slice(v,v+=et));return u}function A(h,l,u){var v="";u=Math.min(h.length,u);for(var C=l;C<u;++C)v+=String.fromCharCode(h[C]&127);return v}function R(h,l,u){var v="";u=Math.min(h.length,u);for(var C=l;C<u;++C)v+=String.fromCharCode(h[C]);return v}function $(h,l,u){var v=h.length;(!l||l<0)&&(l=0),(!u||u<0||u>v)&&(u=v);for(var C="",O=l;O<u;++O)C+=jt[h[O]];return C}function U(h,l,u){for(var v=h.slice(l,u),C="",O=0;O<v.length-1;O+=2)C+=String.fromCharCode(v[O]+v[O+1]*256);return C}s.prototype.slice=function(l,u){var v=this.length;l=~~l,u=u===void 0?v:~~u,l<0?(l+=v,l<0&&(l=0)):l>v&&(l=v),u<0?(u+=v,u<0&&(u=0)):u>v&&(u=v),u<l&&(u=l);var C=this.subarray(l,u);return Object.setPrototypeOf(C,s.prototype),C};function H(h,l,u){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+l>u)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=this[l],O=1,W=0;++W<u&&(O*=256);)C+=this[l+W]*O;return C},s.prototype.readUintBE=s.prototype.readUIntBE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=this[l+--u],O=1;u>0&&(O*=256);)C+=this[l+--u]*O;return C},s.prototype.readUint8=s.prototype.readUInt8=function(l,u){return l=l>>>0,u||H(l,1,this.length),this[l]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(l,u){return l=l>>>0,u||H(l,2,this.length),this[l]|this[l+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(l,u){return l=l>>>0,u||H(l,2,this.length),this[l]<<8|this[l+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(l,u){return l=l>>>0,u||H(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(l,u){return l=l>>>0,u||H(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},s.prototype.readIntLE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=this[l],O=1,W=0;++W<u&&(O*=256);)C+=this[l+W]*O;return O*=128,C>=O&&(C-=Math.pow(2,8*u)),C},s.prototype.readIntBE=function(l,u,v){l=l>>>0,u=u>>>0,v||H(l,u,this.length);for(var C=u,O=1,W=this[l+--C];C>0&&(O*=256);)W+=this[l+--C]*O;return O*=128,W>=O&&(W-=Math.pow(2,8*u)),W},s.prototype.readInt8=function(l,u){return l=l>>>0,u||H(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},s.prototype.readInt16LE=function(l,u){l=l>>>0,u||H(l,2,this.length);var v=this[l]|this[l+1]<<8;return v&32768?v|4294901760:v},s.prototype.readInt16BE=function(l,u){l=l>>>0,u||H(l,2,this.length);var v=this[l+1]|this[l]<<8;return v&32768?v|4294901760:v},s.prototype.readInt32LE=function(l,u){return l=l>>>0,u||H(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},s.prototype.readInt32BE=function(l,u){return l=l>>>0,u||H(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},s.prototype.readFloatLE=function(l,u){return l=l>>>0,u||H(l,4,this.length),no.read(this,l,!0,23,4)},s.prototype.readFloatBE=function(l,u){return l=l>>>0,u||H(l,4,this.length),no.read(this,l,!1,23,4)},s.prototype.readDoubleLE=function(l,u){return l=l>>>0,u||H(l,8,this.length),no.read(this,l,!0,52,8)},s.prototype.readDoubleBE=function(l,u){return l=l>>>0,u||H(l,8,this.length),no.read(this,l,!1,52,8)};function ne(h,l,u,v,C,O){if(!s.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>C||l<O)throw new RangeError('"value" argument is out of bounds');if(u+v>h.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(l,u,v,C){if(l=+l,u=u>>>0,v=v>>>0,!C){var O=Math.pow(2,8*v)-1;ne(this,l,u,v,O,0)}var W=1,ue=0;for(this[u]=l&255;++ue<v&&(W*=256);)this[u+ue]=l/W&255;return u+v},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(l,u,v,C){if(l=+l,u=u>>>0,v=v>>>0,!C){var O=Math.pow(2,8*v)-1;ne(this,l,u,v,O,0)}var W=v-1,ue=1;for(this[u+W]=l&255;--W>=0&&(ue*=256);)this[u+W]=l/ue&255;return u+v},s.prototype.writeUint8=s.prototype.writeUInt8=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,1,255,0),this[u]=l&255,u+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,65535,0),this[u]=l&255,this[u+1]=l>>>8,u+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,65535,0),this[u]=l>>>8,this[u+1]=l&255,u+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,4294967295,0),this[u+3]=l>>>24,this[u+2]=l>>>16,this[u+1]=l>>>8,this[u]=l&255,u+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,4294967295,0),this[u]=l>>>24,this[u+1]=l>>>16,this[u+2]=l>>>8,this[u+3]=l&255,u+4},s.prototype.writeIntLE=function(l,u,v,C){if(l=+l,u=u>>>0,!C){var O=Math.pow(2,8*v-1);ne(this,l,u,v,O-1,-O)}var W=0,ue=1,be=0;for(this[u]=l&255;++W<v&&(ue*=256);)l<0&&be===0&&this[u+W-1]!==0&&(be=1),this[u+W]=(l/ue>>0)-be&255;return u+v},s.prototype.writeIntBE=function(l,u,v,C){if(l=+l,u=u>>>0,!C){var O=Math.pow(2,8*v-1);ne(this,l,u,v,O-1,-O)}var W=v-1,ue=1,be=0;for(this[u+W]=l&255;--W>=0&&(ue*=256);)l<0&&be===0&&this[u+W+1]!==0&&(be=1),this[u+W]=(l/ue>>0)-be&255;return u+v},s.prototype.writeInt8=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,1,127,-128),l<0&&(l=255+l+1),this[u]=l&255,u+1},s.prototype.writeInt16LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,32767,-32768),this[u]=l&255,this[u+1]=l>>>8,u+2},s.prototype.writeInt16BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,2,32767,-32768),this[u]=l>>>8,this[u+1]=l&255,u+2},s.prototype.writeInt32LE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,2147483647,-2147483648),this[u]=l&255,this[u+1]=l>>>8,this[u+2]=l>>>16,this[u+3]=l>>>24,u+4},s.prototype.writeInt32BE=function(l,u,v){return l=+l,u=u>>>0,v||ne(this,l,u,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[u]=l>>>24,this[u+1]=l>>>16,this[u+2]=l>>>8,this[u+3]=l&255,u+4};function he(h,l,u,v,C,O){if(u+v>h.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function Ke(h,l,u,v,C){return l=+l,u=u>>>0,C||he(h,l,u,4),no.write(h,l,u,v,23,4),u+4}s.prototype.writeFloatLE=function(l,u,v){return Ke(this,l,u,!0,v)},s.prototype.writeFloatBE=function(l,u,v){return Ke(this,l,u,!1,v)};function nt(h,l,u,v,C){return l=+l,u=u>>>0,C||he(h,l,u,8),no.write(h,l,u,v,52,8),u+8}s.prototype.writeDoubleLE=function(l,u,v){return nt(this,l,u,!0,v)},s.prototype.writeDoubleBE=function(l,u,v){return nt(this,l,u,!1,v)},s.prototype.copy=function(l,u,v,C){if(!s.isBuffer(l))throw new TypeError("argument should be a Buffer");if(v||(v=0),!C&&C!==0&&(C=this.length),u>=l.length&&(u=l.length),u||(u=0),C>0&&C<v&&(C=v),C===v||l.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),l.length-u<C-v&&(C=l.length-u+v);var O=C-v;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,v,C):Uint8Array.prototype.set.call(l,this.subarray(v,C),u),O},s.prototype.fill=function(l,u,v,C){if(typeof l=="string"){if(typeof u=="string"?(C=u,u=0,v=this.length):typeof v=="string"&&(C=v,v=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!s.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(l.length===1){var O=l.charCodeAt(0);(C==="utf8"&&O<128||C==="latin1")&&(l=O)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(u<0||this.length<u||this.length<v)throw new RangeError("Out of range index");if(v<=u)return this;u=u>>>0,v=v===void 0?this.length:v>>>0,l||(l=0);var W;if(typeof l=="number")for(W=u;W<v;++W)this[W]=l;else{var ue=s.isBuffer(l)?l:s.from(l,C),be=ue.length;if(be===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(W=0;W<v-u;++W)this[W+u]=ue[W%be]}return this};var it=/[^+/0-9A-Za-z-_]/g;function wt(h){if(h=h.split("=")[0],h=h.trim().replace(it,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function St(h,l){l=l||1/0;for(var u,v=h.length,C=null,O=[],W=0;W<v;++W){if(u=h.charCodeAt(W),u>55295&&u<57344){if(!C){if(u>56319){(l-=3)>-1&&O.push(239,191,189);continue}else if(W+1===v){(l-=3)>-1&&O.push(239,191,189);continue}C=u;continue}if(u<56320){(l-=3)>-1&&O.push(239,191,189),C=u;continue}u=(C-55296<<10|u-56320)+65536}else C&&(l-=3)>-1&&O.push(239,191,189);if(C=null,u<128){if((l-=1)<0)break;O.push(u)}else if(u<2048){if((l-=2)<0)break;O.push(u>>6|192,u&63|128)}else if(u<65536){if((l-=3)<0)break;O.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((l-=4)<0)break;O.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return O}function ct(h){for(var l=[],u=0;u<h.length;++u)l.push(h.charCodeAt(u)&255);return l}function Se(h,l){for(var u,v,C,O=[],W=0;W<h.length&&!((l-=2)<0);++W)u=h.charCodeAt(W),v=u>>8,C=u%256,O.push(C),O.push(v);return O}function $e(h){return mf.toByteArray(wt(h))}function De(h,l,u,v){for(var C=0;C<v&&!(C+u>=l.length||C>=h.length);++C)l[C+u]=h[C];return C}function We(h,l){return h instanceof l||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===l.name}function Ne(h){return h!==h}var jt=(function(){for(var h="0123456789abcdef",l=new Array(256),u=0;u<16;++u)for(var v=u*16,C=0;C<16;++C)l[v+C]=h[u]+h[C];return l})()}),Ce=Ac.Buffer;Ac.SlowBuffer;Ac.INSPECT_MAX_BYTES;Ac.kMaxLength;var vf=function(e,r){return vf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},vf(e,r)};function Dc(t,e){vf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var oi=(function(t){Dc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e})(Error),Qe=(function(t){Dc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e})(TypeError);function Cc(t){return t&&t.Math==Math&&t}function Hg(){return Cc(typeof globalThis=="object"&&globalThis)||Cc(typeof window=="object"&&window)||Cc(typeof self=="object"&&self)||Cc(typeof global=="object"&&global)||Function("return this")()}function zw(){var t=Hg();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var qw=function(e){var r=zw()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var n=Ce.alloc(e),i=0;i<e;++i)n[i]=Math.floor(Math.random()*256);return n},Yw=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(Ce.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(Ce.alloc(e))}:qw}},Vg=Yw();function Kw(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function _f(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function Xw(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Jw(t){return fs(t)&&Object.prototype.toString.call(t)==="[object Date]"}function fs(t){return typeof t=="object"&&t!==null}function Nc(t,e){var r=!1;function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return r||(console.warn(e),r=!0),t.apply(this,i)}return n}function Rc(t){if(ArrayBuffer.isView(t))return Ce.from(t.buffer,t.byteOffset,t.byteLength);if(Kw(t))return Ce.from(t);throw new Qe("Must use either Buffer or TypedArray")}var Qw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,$g=function(t){return typeof t=="string"&&Qw.test(t)},Ef=function(t){if(!$g(t))throw new Qe('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return Ce.from(e,"hex")},Ig=function(t,e){return e===void 0&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")};var YB=Math.pow(2,63)-1,KB=-Math.pow(2,63),Zw=Math.pow(2,53),eS=-Math.pow(2,53);var Wg=4;var si=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(e!=null&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer)&&!Array.isArray(e))throw new Qe("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??t.BSON_BINARY_SUBTYPE_DEFAULT,e==null?(this.buffer=Ce.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=Ce.from(e,"binary"):Array.isArray(e)?this.buffer=Ce.from(e):this.buffer=Rc(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new Qe("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new Qe("only accepts single character Uint8Array or Array");var r;if(typeof e=="string"?r=e.charCodeAt(0):typeof e=="number"?r=e:r=e[0],r<0||r>255)throw new Qe("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=Ce.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(e,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+e.length){var n=Ce.alloc(this.buffer.length+e.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(e)?(this.buffer.set(Rc(e),r),this.position=r+e.byteLength>this.position?r+e.length:this.position):typeof e=="string"&&(this.buffer.write(e,r,e.length,"binary"),this.position=r+e.length>this.position?r+e.length:this.position)},t.prototype.read=function(e,r){return r=r&&r>0?r:this.position,this.buffer.slice(e,e+r)},t.prototype.value=function(e){return e=!!e,e&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new Tg(this.buffer.slice(0,this.position));throw new oi('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,r){r=r||{};var n,i;if("$binary"in e?r.legacy&&typeof e.$binary=="string"&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=Ce.from(e.$binary,"base64")):typeof e.$binary!="string"&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=Ce.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=Ef(e.$uuid)),!n)throw new Qe("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return i===Wg?new Tg(n):new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t})();Object.defineProperty(si.prototype,"_bsontype",{value:"Binary"});var df=16,Tg=(function(t){Dc(e,t);function e(r){var n=this,i,o;if(r==null)i=e.generate();else if(r instanceof e)i=Ce.from(r.buffer),o=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===df)i=Rc(r);else if(typeof r=="string")i=Ef(r);else throw new Qe("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=t.call(this,i,Wg)||this,n.__id=o,n}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,e.cacheHexString&&(this.__id=Ig(r))},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(r){if(r===void 0&&(r=!0),e.cacheHexString&&this.__id)return this.__id;var n=Ig(this.id,r);return e.cacheHexString&&(this.__id=n),n},e.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(r){if(!r)return!1;if(r instanceof e)return r.id.equals(this.id);try{return new e(r).id.equals(this.id)}catch{return!1}},e.prototype.toBinary=function(){return new si(this.id,si.SUBTYPE_UUID)},e.generate=function(){var r=Vg(df);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ce.from(r)},e.isValid=function(r){return r?r instanceof e?!0:typeof r=="string"?$g(r):_f(r)?r.length!==df?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},e.createFromHexString=function(r){var n=Ef(r);return new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},e})(si),Oc=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},t})();Object.defineProperty(Oc.prototype,"_bsontype",{value:"Code"});function tS(t){return fs(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var us=(function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var o=e.split(".");o.length===2&&(n=o.shift(),e=o.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(e.$db=this.db),e},t.prototype.toExtendedJSON=function(e){e=e||{};var r={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t})();Object.defineProperty(us.prototype,"_bsontype",{value:"DBRef"});var ar=void 0;try{ar=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var xg=65536,rS=1<<24,oo=xg*xg,jg=oo*oo,Cg=jg/2,Rg={},Ag={},ie=(function(){function t(e,r,n){if(e===void 0&&(e=0),!(this instanceof t))return new t(e,r,n);typeof e=="bigint"?Object.assign(this,t.fromBigInt(e,!!r)):typeof e=="string"?Object.assign(this,t.fromString(e,!!r)):(this.low=e|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,i,o;return r?(e>>>=0,(o=0<=e&&e<256)&&(i=Ag[e],i)?i:(n=t.fromBits(e,(e|0)<0?-1:0,!0),o&&(Ag[e]=n),n)):(e|=0,(o=-128<=e&&e<128)&&(i=Rg[e],i)?i:(n=t.fromBits(e,e<0?-1:0,!1),o&&(Rg[e]=n),n))},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=jg)return t.MAX_UNSIGNED_VALUE}else{if(e<=-Cg)return t.MIN_VALUE;if(e+1>=Cg)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%oo|0,e/oo|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return t.fromString(e.substring(1),r,n).neg();for(var o=t.fromNumber(Math.pow(n,8)),s=t.ZERO,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),p=parseInt(e.substring(a,a+c),n);if(c<8){var d=t.fromNumber(Math.pow(n,c));s=s.mul(d).add(t.fromNumber(p))}else s=s.mul(o),s=s.add(t.fromNumber(p))}return s.unsigned=r,s},t.fromBytes=function(e,r,n){return n?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},t.isLong=function(e){return fs(e)&&e.__isLong__===!0},t.fromValue=function(e,r){return typeof e=="number"?t.fromNumber(e,r):typeof e=="string"?t.fromString(e,r):t.fromBits(e.low,e.high,typeof r=="boolean"?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,o=this.low&65535,s=e.high>>>16,a=e.high&65535,c=e.low>>>16,p=e.low&65535,d=0,f=0,E=0,y=0;return y+=o+p,E+=y>>>16,y&=65535,E+=i+c,f+=E>>>16,E&=65535,f+=n+a,d+=f>>>16,f&=65535,d+=r+s,d&=65535,t.fromBits(E<<16|y,d<<16|f,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(e){return this.compare(e)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(ar){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?ar.div_u:ar.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,ar.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;o=t.UZERO}else{if(this.eq(t.MIN_VALUE)){if(e.eq(t.ONE)||e.eq(t.NEG_ONE))return t.MIN_VALUE;if(e.eq(t.MIN_VALUE))return t.ONE;var s=this.shr(1);return n=s.div(e).shl(1),n.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),o=n.add(i.div(e)),o)}else if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:Math.pow(2,a-48),p=t.fromNumber(n),d=p.mul(e);d.isNegative()||d.gt(i);)n-=c,p=t.fromNumber(n,this.unsigned),d=p.mul(e);p.isZero()&&(p=t.ONE),o=o.add(p),i=i.sub(d)}return o},t.prototype.div=function(e){return this.divide(e)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},t.prototype.eq=function(e){return this.equals(e)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(e&1<<r)===0;r--);return this.high!==0?r+33:r+1},t.prototype.greaterThan=function(e){return this.comp(e)>0},t.prototype.gt=function(e){return this.greaterThan(e)},t.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},t.prototype.gte=function(e){return this.greaterThanOrEqual(e)},t.prototype.ge=function(e){return this.greaterThanOrEqual(e)},t.prototype.isEven=function(){return(this.low&1)===0},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return(this.low&1)===1},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return this.high===0&&this.low===0},t.prototype.lessThan=function(e){return this.comp(e)<0},t.prototype.lt=function(e){return this.lessThan(e)},t.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},t.prototype.lte=function(e){return this.lessThanOrEqual(e)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),ar){var r=(this.unsigned?ar.rem_u:ar.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,ar.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(e){return this.modulo(e)},t.prototype.rem=function(e){return this.modulo(e)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),ar){var r=ar.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,ar.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,o=this.low>>>16,s=this.low&65535,a=e.high>>>16,c=e.high&65535,p=e.low>>>16,d=e.low&65535,f=0,E=0,y=0,T=0;return T+=s*d,y+=T>>>16,T&=65535,y+=o*d,E+=y>>>16,y&=65535,y+=s*p,E+=y>>>16,y&=65535,E+=i*d,f+=E>>>16,E&=65535,E+=o*p,f+=E>>>16,E&=65535,E+=s*c,f+=E>>>16,E&=65535,f+=n*d+i*p+o*c+s*a,f&=65535,t.fromBits(y<<16|T,f<<16|E,this.unsigned)},t.prototype.mul=function(e){return this.multiply(e)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(e){return!this.equals(e)},t.prototype.neq=function(e){return this.notEquals(e)},t.prototype.ne=function(e){return this.notEquals(e)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(e){return this.shiftLeft(e)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(e){return this.shiftRight(e)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),e&=63,e===0)return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}else return e===32?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},t.prototype.shru=function(e){return this.shiftRightUnsigned(e)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(e){return this.subtract(e)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*oo+(this.low>>>0):this.high*oo+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},t.prototype.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(t.MIN_VALUE)){var r=t.fromNumber(e),n=this.div(r),i=n.mul(r).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var o=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,a="";;){var c=s.div(o),p=s.sub(c.mul(o)).toInt()>>>0,d=p.toString(e);if(s=c,s.isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(e){return this.lessThanOrEqual(e)},t.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(rS),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t})();Object.defineProperty(ie.prototype,"__isLong__",{value:!0});Object.defineProperty(ie.prototype,"_bsontype",{value:"Long"});var nS=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,iS=/^(\+|-)?(Infinity|inf)$/i,oS=/^(\+|-)?NaN$/i,ls=6111,hf=-6176,Dg=6176,sS=34,gf=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Ng=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Og=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),aS=/^([-+])?(\d+)?$/,cS=31,Pg=16383,lS=30,uS=31;function Lg(t){return!isNaN(parseInt(t,10))}function pS(t){var e=ie.fromNumber(1e9),r=ie.fromNumber(0);if(!t.parts[0]&&!t.parts[1]&&!t.parts[2]&&!t.parts[3])return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new ie(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function fS(t,e){if(!t&&!e)return{high:ie.fromNumber(0),low:ie.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new ie(t.getLowBits(),0),i=e.shiftRightUnsigned(32),o=new ie(e.getLowBits(),0),s=r.multiply(i),a=r.multiply(o),c=n.multiply(i),p=n.multiply(o);return s=s.add(a.shiftRightUnsigned(32)),a=new ie(a.getLowBits(),0).add(c).add(p.shiftRightUnsigned(32)),s=s.add(a.shiftRightUnsigned(32)),p=a.shiftLeft(32).add(new ie(p.getLowBits(),0)),{high:s,low:p}}function mS(t,e){var r=t.high>>>0,n=e.high>>>0;if(r<n)return!0;if(r===n){var i=t.low>>>0,o=e.low>>>0;if(i<o)return!0}return!1}function io(t,e){throw new Qe('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var bf=(function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(_f(e)){if(e.byteLength!==16)throw new Qe("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new Qe("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var r=!1,n=!1,i=!1,o=0,s=0,a=0,c=0,p=0,d=[0],f=0,E=0,y=0,T=0,D=0,N=0,k=new ie(0,0),G=new ie(0,0),P=0,Q=0;if(e.length>=7e3)throw new Qe(""+e+" not a valid Decimal128 string");var _e=e.match(nS),X=e.match(iS),ce=e.match(oS);if(!_e&&!X&&!ce||e.length===0)throw new Qe(""+e+" not a valid Decimal128 string");if(_e){var se=_e[2],fe=_e[4],Be=_e[5],Te=_e[6];fe&&Te===void 0&&io(e,"missing exponent power"),fe&&se===void 0&&io(e,"missing exponent base"),fe===void 0&&(Be||Te)&&io(e,"missing e before exponent")}if((e[Q]==="+"||e[Q]==="-")&&(r=e[Q++]==="-"),!Lg(e[Q])&&e[Q]!=="."){if(e[Q]==="i"||e[Q]==="I")return new t(Ce.from(r?Ng:Og));if(e[Q]==="N")return new t(Ce.from(gf))}for(;Lg(e[Q])||e[Q]===".";){if(e[Q]==="."){n&&io(e,"contains multiple periods"),n=!0,Q=Q+1;continue}f<34&&(e[Q]!=="0"||i)&&(i||(p=s),i=!0,d[E++]=parseInt(e[Q],10),f=f+1),i&&(a=a+1),n&&(c=c+1),s=s+1,Q=Q+1}if(n&&!s)throw new Qe(""+e+" not a valid Decimal128 string");if(e[Q]==="e"||e[Q]==="E"){var Ae=e.substr(++Q).match(aS);if(!Ae||!Ae[2])return new t(Ce.from(gf));D=parseInt(Ae[0],10),Q=Q+Ae[0].length}if(e[Q])return new t(Ce.from(gf));if(y=0,!f)y=0,T=0,d[0]=0,a=1,f=1,o=0;else if(T=f-1,o=a,o!==1)for(;d[p+o-1]===0;)o=o-1;for(D<=c&&c-D>16384?D=hf:D=D-c;D>ls;){if(T=T+1,T-y>sS){var qe=d.join("");if(qe.match(/^0+$/)){D=ls;break}io(e,"overflow")}D=D-1}for(;D<hf||f<a;){if(T===0&&o<f){D=hf,o=0;break}if(f<a?a=a-1:T=T-1,D<ls)D=D+1;else{var qe=d.join("");if(qe.match(/^0+$/)){D=ls;break}io(e,"overflow")}}if(T-y+1<o){var et=s;n&&(p=p+1,et=et+1),r&&(p=p+1,et=et+1);var Ft=parseInt(e[p+T+1],10),A=0;if(Ft>=5&&(A=1,Ft===5)){for(A=d[T]%2===1?1:0,N=p+T+2;N<et;N++)if(parseInt(e[N],10)){A=1;break}}if(A){for(var R=T;R>=0;R--)if(++d[R]>9&&(d[R]=0,R===0))if(D<ls)D=D+1,d[R]=1;else return new t(Ce.from(r?Ng:Og))}}if(k=ie.fromNumber(0),G=ie.fromNumber(0),o===0)k=ie.fromNumber(0),G=ie.fromNumber(0);else if(T-y<17){var R=y;for(G=ie.fromNumber(d[R++]),k=new ie(0,0);R<=T;R++)G=G.multiply(ie.fromNumber(10)),G=G.add(ie.fromNumber(d[R]))}else{var R=y;for(k=ie.fromNumber(d[R++]);R<=T-17;R++)k=k.multiply(ie.fromNumber(10)),k=k.add(ie.fromNumber(d[R]));for(G=ie.fromNumber(d[R++]);R<=T;R++)G=G.multiply(ie.fromNumber(10)),G=G.add(ie.fromNumber(d[R]))}var $=fS(k,ie.fromString("100000000000000000"));$.low=$.low.add(G),mS($.low,G)&&($.high=$.high.add(ie.fromNumber(1))),P=D+Dg;var U={low:ie.fromNumber(0),high:ie.fromNumber(0)};$.high.shiftRightUnsigned(49).and(ie.fromNumber(1)).equals(ie.fromNumber(1))?(U.high=U.high.or(ie.fromNumber(3).shiftLeft(61)),U.high=U.high.or(ie.fromNumber(P).and(ie.fromNumber(16383).shiftLeft(47))),U.high=U.high.or($.high.and(ie.fromNumber(0x7fffffffffff)))):(U.high=U.high.or(ie.fromNumber(P&16383).shiftLeft(49)),U.high=U.high.or($.high.and(ie.fromNumber(562949953421311)))),U.low=$.low,r&&(U.high=U.high.or(ie.fromString("9223372036854775808")));var H=Ce.alloc(16);return Q=0,H[Q++]=U.low.low&255,H[Q++]=U.low.low>>8&255,H[Q++]=U.low.low>>16&255,H[Q++]=U.low.low>>24&255,H[Q++]=U.low.high&255,H[Q++]=U.low.high>>8&255,H[Q++]=U.low.high>>16&255,H[Q++]=U.low.high>>24&255,H[Q++]=U.high.low&255,H[Q++]=U.high.low>>8&255,H[Q++]=U.high.low>>16&255,H[Q++]=U.high.low>>24&255,H[Q++]=U.high.high&255,H[Q++]=U.high.high>>8&255,H[Q++]=U.high.high>>16&255,H[Q++]=U.high.high>>24&255,new t(H)},t.prototype.toString=function(){for(var e,r=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var o=0,s=!1,a,c={parts:[0,0,0,0]},p,d,f=[];o=0;var E=this.bytes,y=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,T=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,D=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,N=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24;o=0;var k={low:new ie(y,T),high:new ie(D,N)};k.high.lessThan(ie.ZERO)&&f.push("-");var G=N>>26&cS;if(G>>3===3){if(G===lS)return f.join("")+"Infinity";if(G===uS)return"NaN";e=N>>15&Pg,a=8+(N>>14&1)}else a=N>>14&7,e=N>>17&Pg;var P=e-Dg;if(c.parts[0]=(N&16383)+((a&15)<<14),c.parts[1]=D,c.parts[2]=T,c.parts[3]=y,c.parts[0]===0&&c.parts[1]===0&&c.parts[2]===0&&c.parts[3]===0)s=!0;else for(d=3;d>=0;d--){var Q=0,_e=pS(c);if(c=_e.quotient,Q=_e.rem.low,!!Q)for(p=8;p>=0;p--)n[d*9+p]=Q%10,Q=Math.floor(Q/10)}if(s)r=1,n[o]=0;else for(r=36;!n[o];)r=r-1,o=o+1;var X=r-1+P;if(X>=34||X<=-7||P>0){if(r>34)return f.push("".concat(0)),P>0?f.push("E+".concat(P)):P<0&&f.push("E".concat(P)),f.join("");f.push("".concat(n[o++])),r=r-1,r&&f.push(".");for(var i=0;i<r;i++)f.push("".concat(n[o++]));f.push("E"),X>0?f.push("+".concat(X)):f.push("".concat(X))}else if(P>=0)for(var i=0;i<r;i++)f.push("".concat(n[o++]));else{var ce=r+P;if(ce>0)for(var i=0;i<ce;i++)f.push("".concat(n[o++]));else f.push("0");for(f.push(".");ce++<0;)f.push("0");for(var i=0;i<r-Math.max(ce-1,0);i++)f.push("".concat(n[o++]))}return f.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t})();Object.defineProperty(bf.prototype,"_bsontype",{value:"Decimal128"});var Pc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},t})();Object.defineProperty(Pc.prototype,"_bsontype",{value:"Double"});var Lc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e|0}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t})();Object.defineProperty(Lc.prototype,"_bsontype",{value:"Int32"});var wf=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t})();Object.defineProperty(wf.prototype,"_bsontype",{value:"MaxKey"});var Sf=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t})();Object.defineProperty(Sf.prototype,"_bsontype",{value:"MinKey"});var dS=new RegExp("^[0-9a-fA-F]{24}$"),ii=null,Hr=Symbol("id"),Et=(function(){function t(e){if(!(this instanceof t))return new t(e);var r;if(typeof e=="object"&&e&&"id"in e){if(typeof e.id!="string"&&!ArrayBuffer.isView(e.id))throw new Qe("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?r=Ce.from(e.toHexString(),"hex"):r=e.id}else r=e;if(r==null||typeof r=="number")this[Hr]=t.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[Hr]=r instanceof Ce?r:Rc(r);else if(typeof r=="string")if(r.length===12){var n=Ce.from(r);if(n.byteLength===12)this[Hr]=n;else throw new Qe("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&dS.test(r))this[Hr]=Ce.from(r,"hex");else throw new Qe("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Qe("Argument passed in does not match the accepted types");t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[Hr]},set:function(e){this[Hr]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){typeof e!="number"&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=Ce.alloc(12);return n.writeUInt32BE(e,0),ii===null&&(ii=Vg(5)),n[4]=ii[0],n[5]=ii[1],n[6]=ii[2],n[7]=ii[3],n[8]=ii[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(e==null)return!1;if(e instanceof t)return this[Hr][11]===e[Hr][11]&&this[Hr].equals(e[Hr]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&_f(this.id))return e===Ce.prototype.toString.call(this.id,"latin1");if(typeof e=="string"&&t.isValid(e)&&e.length===24)return e.toLowerCase()===this.toHexString();if(typeof e=="string"&&t.isValid(e)&&e.length===12)return Ce.from(e).equals(this.id);if(typeof e=="object"&&"toHexString"in e&&typeof e.toHexString=="function"){var r=e.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var e=new Date,r=this.id.readUInt32BE(0);return e.setTime(Math.floor(r)*1e3),e},t.createPk=function(){return new t},t.createFromTime=function(e){var r=Ce.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(typeof e>"u"||e!=null&&e.length!==24)throw new Qe("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(Ce.from(e,"hex"))},t.isValid=function(e){if(e==null)return!1;try{return new t(e),!0}catch{return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(Math.random()*16777215),t})();Object.defineProperty(Et.prototype,"generate",{value:Nc(function(t){return Et.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(Et.prototype,"getInc",{value:Nc(function(){return Et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Et.prototype,"get_inc",{value:Nc(function(){return Et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Et,"get_inc",{value:Nc(function(){return Et.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Et.prototype,"_bsontype",{value:"ObjectID"});function hS(t){return t.split("").sort().join("")}var ps=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=hS(r??""),this.pattern.indexOf("\0")!==-1)throw new oi("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new oi("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new oi("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(e){return e?e.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(e){return e=e||{},e.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e)if(typeof e.$regex!="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new t(e.$regex,t.parseOptions(e.$options));if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new Qe("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t})();Object.defineProperty(ps.prototype,"_bsontype",{value:"BSONRegExp"});var If=(function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t})();Object.defineProperty(If.prototype,"_bsontype",{value:"Symbol"});var gS=ie,Gg=(function(t){Dc(e,t);function e(r,n){var i=this;return i instanceof e?(ie.isLong(r)?i=t.call(this,r.low,r.high,!0)||this:fs(r)&&typeof r.t<"u"&&typeof r.i<"u"?i=t.call(this,r.i,r.t,!0)||this:i=t.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new e(r,n)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(r){return new e(ie.fromInt(r,!0))},e.fromNumber=function(r){return new e(ie.fromNumber(r,!0))},e.fromBits=function(r,n){return new e(r,n)},e.fromString=function(r,n){return new e(ie.fromString(r,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(r){return new e(r.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=ie.MAX_UNSIGNED_VALUE,e})(gS);function yS(t){return fs(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var zg=2147483647,qg=-2147483648,Yg=9223372036854776e3,Kg=-9223372036854776e3,vS={$oid:Et,$binary:si,$uuid:si,$symbol:If,$numberInt:Lc,$numberDecimal:bf,$numberDouble:Pc,$numberLong:ie,$minKey:Sf,$maxKey:wf,$regex:ps,$regularExpression:ps,$timestamp:Gg};function Xg(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=qg&&t<=zg)return new Lc(t);if(t>=Kg&&t<=Yg)return ie.fromNumber(t)}return new Pc(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter(function(f){return f.startsWith("$")&&t[f]!=null}),n=0;n<r.length;n++){var i=vS[r[n]];if(i)return i.fromExtendedJSON(t,e)}if(t.$date!=null){var o=t.$date,s=new Date;return e.legacy?typeof o=="number"?s.setTime(o):typeof o=="string"&&s.setTime(Date.parse(o)):typeof o=="string"?s.setTime(Date.parse(o)):ie.isLong(o)?s.setTime(o.toNumber()):typeof o=="number"&&e.relaxed&&s.setTime(o),s}if(t.$code!=null){var a=Object.assign({},t);return t.$scope&&(a.$scope=Xg(t.$scope)),Oc.fromExtendedJSON(t)}if(tS(t)||t.$dbPointer){var c=t.$ref?t:t.$dbPointer;if(c instanceof us)return c;var p=Object.keys(c).filter(function(f){return f.startsWith("$")}),d=!0;if(p.forEach(function(f){["$ref","$id","$db"].indexOf(f)===-1&&(d=!1)}),d)return us.fromExtendedJSON(c)}return t}function ES(t,e){return t.map(function(r,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Dn(r,e)}finally{e.seenObjects.pop()}})}function Mg(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function Dn(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var r=e.seenObjects.findIndex(function(k){return k.obj===t});if(r!==-1){var n=e.seenObjects.map(function(k){return k.propertyName}),i=n.slice(0,r).map(function(k){return"".concat(k," -> ")}).join(""),o=n[r],s=" -> "+n.slice(r+1,n.length-1).map(function(k){return"".concat(k," -> ")}).join(""),a=n[n.length-1],c=" ".repeat(i.length+o.length/2),p="-".repeat(s.length+(o.length+a.length)/2-1);throw new Qe(`Converting circular structure to EJSON:
|
|
32
32
|
`+" ".concat(i).concat(o).concat(s).concat(a,`
|
|
33
33
|
`)+" ".concat(c,"\\").concat(p,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return ES(t,e);if(t===void 0)return null;if(t instanceof Date||Jw(t)){var d=t.getTime(),f=d>-1&&d<2534023188e5;return e.legacy?e.relaxed&&f?{$date:t.getTime()}:{$date:Mg(t)}:e.relaxed&&f?{$date:Mg(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(typeof t=="number"&&(!e.relaxed||!isFinite(t))){if(Math.floor(t)===t){var E=t>=qg&&t<=zg,y=t>=Kg&&t<=Yg;if(E)return{$numberInt:t.toString()};if(y)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||Xw(t)){var T=t.flags;if(T===void 0){var D=t.toString().match(/[gimuy]*$/);D&&(T=D[0])}var N=new ps(t.source,T);return N.toExtendedJSON(e)}return t!=null&&typeof t=="object"?bS(t,e):t}var _S={Binary:function(t){return new si(t.value(),t.sub_type)},Code:function(t){return new Oc(t.code,t.scope)},DBRef:function(t){return new us(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new bf(t.bytes)},Double:function(t){return new Pc(t.value)},Int32:function(t){return new Lc(t.value)},Long:function(t){return ie.fromBits(t.low!=null?t.low:t.low_,t.low!=null?t.high:t.high_,t.low!=null?t.unsigned:t.unsigned_)},MaxKey:function(){return new wf},MinKey:function(){return new Sf},ObjectID:function(t){return new Et(t)},ObjectId:function(t){return new Et(t)},BSONRegExp:function(t){return new ps(t.pattern,t.options)},Symbol:function(t){return new If(t.value)},Timestamp:function(t){return Gg.fromBits(t.low,t.high)}};function bS(t,e){if(t==null||typeof t!="object")throw new oi("not an object instance");var r=t._bsontype;if(typeof r>"u"){var n={};for(var i in t){e.seenObjects.push({propertyName:i,obj:null});try{var o=Dn(t[i],e);i==="__proto__"?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{e.seenObjects.pop()}}return n}else if(yS(t)){var s=t;if(typeof s.toExtendedJSON!="function"){var a=_S[t._bsontype];if(!a)throw new Qe("Unrecognized or invalid _bsontype: "+t._bsontype);s=a(s)}return r==="Code"&&s.scope?s=new Oc(s.code,Dn(s.scope,e)):r==="DBRef"&&s.oid&&(s=new us(Dn(s.collection,e),Dn(s.oid,e),Dn(s.db,e),Dn(s.fields,e))),s.toExtendedJSON(e)}else throw new oi("_bsontype must be a string, but was: "+typeof r)}var Bg;(function(t){function e(o,s){var a=Object.assign({},{relaxed:!0,legacy:!1},s);return typeof a.relaxed=="boolean"&&(a.strict=!a.relaxed),typeof a.strict=="boolean"&&(a.relaxed=!a.strict),JSON.parse(o,function(c,p){if(c.indexOf("\0")!==-1)throw new oi("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(c)));return Xg(p,a)})}t.parse=e;function r(o,s,a,c){a!=null&&typeof a=="object"&&(c=a,a=0),s!=null&&typeof s=="object"&&!Array.isArray(s)&&(c=s,s=void 0,a=0);var p=Object.assign({relaxed:!0,legacy:!1},c,{seenObjects:[{propertyName:"(root)",obj:null}]}),d=Dn(o,p);return JSON.stringify(d,s,a)}t.stringify=r;function n(o,s){return s=s||{},JSON.parse(r(o,s))}t.serialize=n;function i(o,s){return s=s||{},e(JSON.stringify(o),s)}t.deserialize=i})(Bg||(Bg={}));var kg,Ug=Hg();Ug.Map?kg=Ug.Map:kg=(function(){function t(e){e===void 0&&(e=[]),this._keys=[],this._values={};for(var r=0;r<e.length;r++)if(e[r]!=null){var n=e[r],i=n[0],o=n[1];this._keys.push(i),this._values[i]={v:o,i:this._keys.length-1}}}return t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(e){var r=this._values[e];return r==null?!1:(delete this._values[e],this._keys.splice(r.i,1),!0)},t.prototype.entries=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?[n,e._values[n].v]:void 0,done:n===void 0}}}},t.prototype.forEach=function(e,r){r=r||this;for(var n=0;n<this._keys.length;n++){var i=this._keys[n];e.call(r,this._values[i].v,i,r)}},t.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},t.prototype.has=function(e){return this._values[e]!=null},t.prototype.keys=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?n:void 0,done:n===void 0}}}},t.prototype.set=function(e,r){return this._values[e]?(this._values[e].v=r,this):(this._keys.push(e),this._values[e]={v:r,i:this._keys.length-1},this)},t.prototype.values=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?e._values[n].v:void 0,done:n===void 0}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),t})();var XB=ie.fromNumber(Zw),JB=ie.fromNumber(eS);var yf=new Uint8Array(8),QB=new DataView(yf.buffer,yf.byteOffset,yf.byteLength);var wS=1024*1024*17,ZB=Ce.alloc(wS);var Nn=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(e){e=e||{},this.triggerID=e.id||e.triggerID,this.nudgeID=e.nudgeID,this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.contentID=e.contentID,this.variation=e.variation,this.props=e.props,this.objective=e.objective,this.onsiteDeliveryType=e.onsiteDeliveryType,this.holdout=e.holdout}};var Ie=class{constructor(e,r={},n,i){this.name=e;this.properties=r;this.id=i?new Et(i):new Et,this.occurred=new Date,n&&(this.trigger=new Nn(n)),this.newEvent=!i}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale;setVideos(e){e&&(this.videos=[e.id])}};var Jg=0;function Qg(t,e){if(!t)return;let r=document.createElement("script");r.id=e??"",r.src=t,r.type="module",document.head.appendChild(r)}function Tf(t=document.head){return Zg(Gt.styleURL,t,"cooee-global-styles")}function SS(t=document.head){return Zg(Gt.swiperStyleURL,t,"cooee-swiper-styles")}function Zg(t,e=document.head,r){return new Promise(n=>{if(e.querySelector(`#${r}`)){n();return}let o=document.createElement("link");o.rel="stylesheet",o.href=t,o.id=r,o.onload=()=>{n()},o.onerror=()=>{console.error("Failed to load stylesheet:",t),n()},e.appendChild(o)})}function xf(t,e=document.head){if(!t)return;Jg++;let r=document.createElement("style");r.id=`cooee-app-css-${Jg}`,r.textContent=t,e.appendChild(r)}function ey(t){if(!t)return;let e=document.createElement("script");e.id="cooee-app-script",e.innerHTML=t,document.head.appendChild(e)}function Cf(t){if(t)try{(0,eval)(t)}catch(e){console.error("Failed to execute script:",e)}}async function Mc(){let t=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=t}async function Rf(t,e=!0){if(!t)return;let r=[];e&&r.push(SS(t)),r.push(Tf(t)),await Promise.all(r);let n=Xe.get().website.commonCSS;xf(n,t)}var Bc=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(e){this.onResizeCallback=e,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener("resize",this.debouncedResize),window.addEventListener("orientationchange",this.handleImmediateResize)}destroy(){window.removeEventListener("resize",this.debouncedResize),window.removeEventListener("orientationchange",this.handleImmediateResize)}handleImmediateResize=()=>{this.triggerResize()};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize()},this.debounceDelay)};triggerResize(){let e=window.innerWidth,r=window.innerHeight;(r!==this.lastHeight||e!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=e,this.lastHeight=r)}};var IS="2.0.4",Hf=500,ty="user-agent",uo="",ry="?",$c="function",Ln="undefined",po="object",Vf="string",Vt="browser",un="cpu",jr="device",wr="engine",lr="os",co="result",V="name",L="type",F="vendor",j="version",$t="architecture",ws="major",B="model",_s="console",le="mobile",Ue="tablet",at="smarttv",$r="wearable",kc="xr",bs="embedded",ms="inapp",jf="brands",ci="formFactors",Gf="fullVersionList",lo="platform",zf="platformVersion",Gc="bitness",Mn="sec-ch-ua",TS=Mn+"-full-version-list",xS=Mn+"-arch",CS=Mn+"-"+Gc,RS=Mn+"-form-factors",AS=Mn+"-"+le,DS=Mn+"-"+B,gy=Mn+"-"+lo,NS=gy+"-version",yy=[jf,Gf,le,B,lo,zf,$t,ci,Gc],Uc="Amazon",so="Apple",ny="ASUS",iy="BlackBerry",ai="Google",oy="Huawei",Af="Lenovo",sy="Honor",Fc="LG",Df="Microsoft",Nf="Motorola",Of="Nvidia",ay="OnePlus",Pf="OPPO",ds="Samsung",cy="Sharp",hs="Sony",Lf="Xiaomi",Mf="Zebra",ly="Chrome",uy="Chromium",On="Chromecast",Vc="Edge",gs="Firefox",ys="Opera",Bf="Facebook",py="Sogou",ao="Mobile ",vs=" Browser",$f="Windows",OS=typeof window!==Ln,Wt=OS&&window.navigator?window.navigator:void 0,Pn=Wt&&Wt.userAgentData?Wt.userAgentData:void 0,PS=function(t,e){var r={},n=e;if(!Wc(e)){n={};for(var i in e)for(var o in e[i])n[o]=e[i][o].concat(n[o]?n[o]:[])}for(var s in t)r[s]=n[s]&&n[s].length%2===0?n[s].concat(t[s]):t[s];return r},zc=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},Wf=function(t,e){if(typeof t===po&&t.length>0){for(var r in t)if(pn(e)==pn(t[r]))return!0;return!1}return mo(t)?pn(e)==pn(t):!1},Wc=function(t,e){for(var r in t)return/^(browser|cpu|device|engine|os)$/.test(r)||(e?Wc(t[r]):!1)},mo=function(t){return typeof t===Vf},kf=function(t){if(t){for(var e=[],r=fo(/\\?\"/g,t).split(","),n=0;n<r.length;n++)if(r[n].indexOf(";")>-1){var i=jc(r[n]).split(";v=");e[n]={brand:i[0],version:i[1]}}else e[n]=jc(r[n]);return e}},pn=function(t){return mo(t)?t.toLowerCase():t},Uf=function(t){return mo(t)?fo(/[^\d\.]/g,t).split(".")[0]:void 0},fn=function(t){for(var e in t){var r=t[e];typeof r==po&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this},fo=function(t,e){return mo(e)?e.replace(t,uo):e},Es=function(t){return fo(/\\?\"/g,t)},jc=function(t,e){if(mo(t))return t=fo(/^\s\s*/,t),typeof e===Ln?t:t.substring(0,Hf)},Ff=function(t,e){if(!(!t||!e))for(var r=0,n,i,o,s,a,c;r<e.length&&!a;){var p=e[r],d=e[r+1];for(n=i=0;n<p.length&&!a&&p[n];)if(a=p[n++].exec(t),a)for(o=0;o<d.length;o++)c=a[++i],s=d[o],typeof s===po&&s.length>0?s.length===2?typeof s[1]==$c?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===$c&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=c?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=c?s[1].call(this,c,s[2]):void 0:s.length==3?this[s[0]]=c?c.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=c?s[3].apply(this,[c.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=c||void 0;r+=2}},Wr=function(t,e){for(var r in e)if(typeof e[r]===po&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(Wf(e[r][n],t))return r===ry?void 0:r}else if(Wf(e[r],t))return r===ry?void 0:r;return e.hasOwnProperty("*")?e["*"]:t},fy={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},my={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},LS={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},dy={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[j,[V,ao+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[j,[V,Vc+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[j,[V,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[V,j],[/opios[\/ ]+([\w\.]+)/i],[j,[V,ys+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[j,[V,ys+" GX"]],[/\bopr\/([\w\.]+)/i],[j,[V,ys]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[j,[V,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[j,[V,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[V,j],[/quark(?:pc)?\/([-\w\.]+)/i],[j,[V,"Quark"]],[/\bddg\/([\w\.]+)/i],[j,[V,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[j,[V,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[j,[V,"WeChat"]],[/konqueror\/([\w\.]+)/i],[j,[V,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[j,[V,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[j,[V,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[j,[V,"Smart "+Af+vs]],[/(avast|avg)\/([\w\.]+)/i],[[V,/(.+)/,"$1 Secure"+vs],j],[/\bfocus\/([\w\.]+)/i],[j,[V,gs+" Focus"]],[/\bopt\/([\w\.]+)/i],[j,[V,ys+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[j,[V,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[j,[V,"Dolphin"]],[/coast\/([\w\.]+)/i],[j,[V,ys+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[j,[V,"MIUI"+vs]],[/fxios\/([\w\.-]+)/i],[j,[V,ao+gs]],[/\bqihoobrowser\/?([\w\.]*)/i],[j,[V,"360"]],[/\b(qq)\/([\w\.]+)/i],[[V,/(.+)/,"$1Browser"],j],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[V,/(.+)/,"$1"+vs],j],[/samsungbrowser\/([\w\.]+)/i],[j,[V,ds+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[j,[V,py+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[V,py+" Mobile"],j],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[V,j],[/(lbbrowser|rekonq)/i],[V],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[j,V],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[V,Bf],j,[L,ms]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[V,j,[L,ms]],[/\bgsa\/([\w\.]+) .*safari\//i],[j,[V,"GSA"],[L,ms]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[j,[V,"TikTok"],[L,ms]],[/\[(linkedin)app\]/i],[V,[L,ms]],[/(chromium)[\/ ]([-\w\.]+)/i],[V,j],[/headlesschrome(?:\/([\w\.]+)| )/i],[j,[V,ly+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[j,[V,Vc+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[V,ly+" WebView"],j],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[j,[V,"Android"+vs]],[/chrome\/([\w\.]+) mobile/i],[j,[V,ao+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[V,j],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[j,[V,ao+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[V,ao+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[j,V],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[V,[j,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[V,j],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[V,ao+gs],j],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[V,"Netscape"],j],[/(wolvic|librewolf)\/([\w\.]+)/i],[V,j],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[j,[V,gs+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[V,[j,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[V,[j,/[^\d\.]+./,uo]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[$t,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[$t,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[$t,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[$t,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[$t,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[$t,/ower/,uo,pn]],[/ sun4\w[;\)]/i],[[$t,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[$t,pn]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[B,[F,ds],[L,Ue]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[B,[F,ds],[L,le]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[B,[F,so],[L,le]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[B,[F,so],[L,Ue]],[/(macintosh);/i],[B,[F,so]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[B,[F,cy],[L,le]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[B,[F,sy],[L,Ue]],[/honor([-\w ]+)[;\)]/i],[B,[F,sy],[L,le]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[B,[F,oy],[L,Ue]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[B,[F,oy],[L,le]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[B,/_/g," "],[F,Lf],[L,Ue]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[B,/_/g," "],[F,Lf],[L,le]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[B,[F,ay],[L,le]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[B,[F,Pf],[L,le]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[B,[F,Wr,{OnePlus:["203","304","403","404","413","415"],"*":Pf}],[L,Ue]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[B,[F,"BLU"],[L,le]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[B,[F,"Vivo"],[L,le]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[B,[F,"Realme"],[L,le]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[B,[F,Af],[L,Ue]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[B,[F,Af],[L,le]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[B,[F,Nf],[L,le]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[B,[F,Nf],[L,Ue]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[B,[F,Fc],[L,Ue]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[B,[F,Fc],[L,le]],[/(nokia) (t[12][01])/i],[F,B,[L,Ue]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[B,/_/g," "],[L,le],[F,"Nokia"]],[/(pixel (c|tablet))\b/i],[B,[F,ai],[L,Ue]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[B,[F,ai],[L,le]],[/(google) (pixelbook( go)?)/i],[F,B],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[B,[F,hs],[L,le]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[B,"Xperia Tablet"],[F,hs],[L,Ue]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[B,[F,Uc],[L,Ue]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[B,/(.+)/g,"Fire Phone $1"],[F,Uc],[L,le]],[/(playbook);[-\w\),; ]+(rim)/i],[B,F,[L,Ue]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[B,[F,iy],[L,le]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[B,[F,ny],[L,Ue]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[B,[F,ny],[L,le]],[/(nexus 9)/i],[B,[F,"HTC"],[L,Ue]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[F,[B,/_/g," "],[L,le]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[B,[F,"TCL"],[L,Ue]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[B,[F,"TCL"],[L,le]],[/(itel) ((\w+))/i],[[F,pn],B,[L,Wr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[B,[F,"Acer"],[L,Ue]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[B,[F,"Meizu"],[L,le]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[B,[F,"Ulefone"],[L,le]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[B,[F,"Energizer"],[L,le]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[B,[F,"Cat"],[L,le]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[B,[F,"Smartfren"],[L,le]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[B,[F,"Nothing"],[L,le]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[B,[F,"Archos"],[L,Ue]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[B,[F,"Archos"],[L,le]],[/; (n159v)/i],[B,[F,"HMD"],[L,le]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[F,B,[L,Ue]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[F,B,[L,le]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[F,B,[L,Ue]],[/(surface duo)/i],[B,[F,Df],[L,Ue]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[B,[F,"Fairphone"],[L,le]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[B,[F,Of],[L,Ue]],[/(sprint) (\w+)/i],[F,B,[L,le]],[/(kin\.[onetw]{3})/i],[[B,/\./g," "],[F,Df],[L,le]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[B,[F,Mf],[L,Ue]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[B,[F,Mf],[L,le]],[/smart-tv.+(samsung)/i],[F,[L,at]],[/hbbtv.+maple;(\d+)/i],[[B,/^/,"SmartTV"],[F,ds],[L,at]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[F,B,[L,at]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[F,Fc],[L,at]],[/(apple) ?tv/i],[F,[B,so+" TV"],[L,at]],[/crkey.*devicetype\/chromecast/i],[[B,On+" Third Generation"],[F,ai],[L,at]],[/crkey.*devicetype\/([^/]*)/i],[[B,/^/,"Chromecast "],[F,ai],[L,at]],[/fuchsia.*crkey/i],[[B,On+" Nest Hub"],[F,ai],[L,at]],[/crkey/i],[[B,On],[F,ai],[L,at]],[/(portaltv)/i],[B,[F,Bf],[L,at]],[/droid.+aft(\w+)( bui|\))/i],[B,[F,Uc],[L,at]],[/(shield \w+ tv)/i],[B,[F,Of],[L,at]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[B,[F,cy],[L,at]],[/(bravia[\w ]+)( bui|\))/i],[B,[F,hs],[L,at]],[/(mi(tv|box)-?\w+) bui/i],[B,[F,Lf],[L,at]],[/Hbbtv.*(technisat) (.*);/i],[F,B,[L,at]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[F,/.+\/(\w+)/,"$1",Wr,{LG:"lge"}],[B,jc],[L,at]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[B,[L,at]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[L,at]],[/(playstation \w+)/i],[B,[F,hs],[L,_s]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[B,[F,Df],[L,_s]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[F,B,[L,_s]],[/droid.+; (shield)( bui|\))/i],[B,[F,Of],[L,_s]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[B,[F,ds],[L,$r]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[F,B,[L,$r]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[B,[F,Pf],[L,$r]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[B,[F,so],[L,$r]],[/(opwwe\d{3})/i],[B,[F,ay],[L,$r]],[/(moto 360)/i],[B,[F,Nf],[L,$r]],[/(smartwatch 3)/i],[B,[F,hs],[L,$r]],[/(g watch r)/i],[B,[F,Fc],[L,$r]],[/droid.+; (wt63?0{2,3})\)/i],[B,[F,Mf],[L,$r]],[/droid.+; (glass) \d/i],[B,[F,ai],[L,kc]],[/(pico) (4|neo3(?: link|pro)?)/i],[F,B,[L,kc]],[/(quest( \d| pro)?s?).+vr/i],[B,[F,Bf],[L,kc]],[/mobile vr; rv.+firefox/i],[[L,kc]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[F,[L,bs]],[/(aeobc)\b/i],[B,[F,Uc],[L,bs]],[/(homepod).+mac os/i],[B,[F,so],[L,bs]],[/windows iot/i],[[L,bs]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[B,[L,Wr,{mobile:"Mobile",xr:"VR","*":Ue}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[L,Ue]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[L,le]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[B,[F,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[j,[V,Vc+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[V,j],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[j,[V,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[V,j],[/ladybird\//i],[[V,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[j,V]],os:[[/(windows nt) (6\.[23]); arm/i],[[V,/N/,"R"],[j,Wr,fy]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[V,j],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[j,/(;|\))/g,"",Wr,fy],[V,$f]],[/(windows ce)\/?([\d\.]*)/i],[V,j],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[j,/_/g,"."],[V,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[V,"macOS"],[j,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[j,[V,On+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[j,[V,On+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[j,[V,On+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[j,[V,On+" Linux"]],[/crkey\/([\d\.]+)/i],[j,[V,On]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[j,V],[/(ubuntu) ([\w\.]+) like android/i],[[V,/(.+)/,"$1 Touch"],j],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[V,j],[/\(bb(10);/i],[j,[V,iy]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[j,[V,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[j,[V,gs+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[j,[V,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[j,Wr,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[V,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[j,[V,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[V,"Chrome OS"],j],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[V,j],[/(sunos) ?([\d\.]*)/i],[[V,"Solaris"],j],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[V,j]]},Hc=(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return fn.call(t.init,[[Vt,[V,j,ws,L]],[un,[$t]],[jr,[L,B,F]],[wr,[V,j]],[lr,[V,j]]]),fn.call(t.isIgnore,[[Vt,[j,ws]],[wr,[j]],[lr,[j]]]),fn.call(t.isIgnoreRgx,[[Vt,/ ?browser$/i],[lr,/ ?os$/i]]),fn.call(t.toString,[[Vt,[V,j]],[un,[$t]],[jr,[F,B]],[wr,[V,j]],[lr,[V,j]]]),t})(),MS=function(t,e){var r=Hc.init[e],n=Hc.isIgnore[e]||0,i=Hc.isIgnoreRgx[e]||0,o=Hc.toString[e]||0;function s(){fn.call(this,r)}return s.prototype.getItem=function(){return t},s.prototype.withClientHints=function(){return Pn?Pn.getHighEntropyValues(yy).then(function(a){return t.setCH(new vy(a,!1)).parseCH().get()}):t.parseCH().get()},s.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=co&&(s.prototype.is=function(a){var c=!1;for(var p in this)if(this.hasOwnProperty(p)&&!Wf(n,p)&&pn(i?fo(i,this[p]):this[p])==pn(i?fo(i,a):a)){if(c=!0,a!=Ln)break}else if(a==Ln&&c){c=!c;break}return c},s.prototype.toString=function(){var a=uo;for(var c in o)typeof this[o[c]]!==Ln&&(a+=(a?" ":uo)+this[o[c]]);return a||Ln}),Pn||(s.prototype.then=function(a){var c=this,p=function(){for(var f in c)c.hasOwnProperty(f)&&(this[f]=c[f])};p.prototype={is:s.prototype.is,toString:s.prototype.toString};var d=new p;return a(d),d}),new s};function vy(t,e){if(t=t||{},fn.call(this,yy),e)fn.call(this,[[jf,kf(t[Mn])],[Gf,kf(t[TS])],[le,/\?1/.test(t[AS])],[B,Es(t[DS])],[lo,Es(t[gy])],[zf,Es(t[NS])],[$t,Es(t[xS])],[ci,kf(t[RS])],[Gc,Es(t[CS])]]);else for(var r in t)this.hasOwnProperty(r)&&typeof t[r]!==Ln&&(this[r]=t[r])}function hy(t,e,r,n){return this.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},this.set=function(i,o){return this.data[i]=o,this},this.setCH=function(i){return this.uaCH=i,this},this.detectFeature=function(){if(Wt&&Wt.userAgent==this.ua)switch(this.itemType){case Vt:Wt.brave&&typeof Wt.brave.isBrave==$c&&this.set(V,"Brave");break;case jr:!this.get(L)&&Pn&&Pn[le]&&this.set(L,le),this.get(B)=="Macintosh"&&Wt&&typeof Wt.standalone!==Ln&&Wt.maxTouchPoints&&Wt.maxTouchPoints>2&&this.set(B,"iPad").set(L,Ue);break;case lr:!this.get(V)&&Pn&&Pn[lo]&&this.set(V,Pn[lo]);break;case co:var i=this.data,o=function(s){return i[s].getItem().detectFeature().get()};this.set(Vt,o(Vt)).set(un,o(un)).set(jr,o(jr)).set(wr,o(wr)).set(lr,o(lr))}return this},this.parseUA=function(){return this.itemType!=co&&Ff.call(this.data,this.ua,this.rgxMap),this.itemType==Vt&&this.set(ws,Uf(this.get(j))),this},this.parseCH=function(){var i=this.uaCH,o=this.rgxMap;switch(this.itemType){case Vt:case wr:var s=i[Gf]||i[jf],a;if(s)for(var c in s){var p=s[c].brand||s[c],d=s[c].version;this.itemType==Vt&&!/not.a.brand/i.test(p)&&(!a||/Chrom/.test(a)&&p!=uy||a==Vc&&/WebView2/.test(p))&&(p=Wr(p,LS),a=this.get(V),a&&!/Chrom/.test(a)&&/Chrom/.test(p)||this.set(V,p).set(j,d).set(ws,Uf(d)),a=p),this.itemType==wr&&p==uy&&this.set(j,d)}break;case un:var f=i[$t];f&&(f&&i[Gc]=="64"&&(f+="64"),Ff.call(this.data,f+";",o));break;case jr:if(i[le]&&this.set(L,le),i[B]&&(this.set(B,i[B]),!this.get(L)||!this.get(F))){var E={};Ff.call(E,"droid 9; "+i[B]+")",o),!this.get(L)&&E.type&&this.set(L,E.type),!this.get(F)&&E.vendor&&this.set(F,E.vendor)}if(i[ci]){var y;if(typeof i[ci]!="string")for(var T=0;!y&&T<i[ci].length;)y=Wr(i[ci][T++],my);else y=Wr(i[ci],my);this.set(L,y)}break;case lr:var D=i[lo];if(D){var N=i[zf];D==$f&&(N=parseInt(Uf(N),10)>=13?"11":"10"),this.set(V,D).set(j,N)}this.get(V)==$f&&i[B]=="Xbox"&&this.set(V,"Xbox").set(j,void 0);break;case co:var k=this.data,G=function(P){return k[P].getItem().setCH(i).parseCH().get()};this.set(Vt,G(Vt)).set(un,G(un)).set(jr,G(jr)).set(wr,G(wr)).set(lr,G(lr))}return this},fn.call(this,[["itemType",t],["ua",e],["uaCH",n],["rgxMap",r],["data",MS(this,t)]]),this}function Sr(t,e,r){if(typeof t===po?(Wc(t,!0)?(typeof e===po&&(r=e),e=t):(r=t,e=void 0),t=void 0):typeof t===Vf&&!Wc(e,!0)&&(r=e,e=void 0),r&&typeof r.append===$c){var n={};r.forEach(function(c,p){n[p]=c}),r=n}if(!(this instanceof Sr))return new Sr(t,e,r).getResult();var i=typeof t===Vf?t:r&&r[ty]?r[ty]:Wt&&Wt.userAgent?Wt.userAgent:uo,o=new vy(r,!0),s=e?PS(dy,e):dy,a=function(c){return c==co?function(){return new hy(c,i,s,o).set("ua",i).set(Vt,this.getBrowser()).set(un,this.getCPU()).set(jr,this.getDevice()).set(wr,this.getEngine()).set(lr,this.getOS()).get()}:function(){return new hy(c,i,s[c],o).parseUA().get()}};return fn.call(this,[["getBrowser",a(Vt)],["getCPU",a(un)],["getDevice",a(jr)],["getEngine",a(wr)],["getOS",a(lr)],["getResult",a(co)],["getUA",function(){return i}],["setUA",function(c){return mo(c)&&(i=c.length>Hf?jc(c,Hf):c),this}]]).setUA(i),this}Sr.VERSION=IS;Sr.BROWSER=zc([V,j,ws,L]);Sr.CPU=zc([$t]);Sr.DEVICE=zc([B,F,L,_s,le,at,Ue,$r,bs]);Sr.ENGINE=Sr.OS=zc([V,j]);var Ey=()=>{let t=window.ShopifyAnalytics?.meta??{},e=t.selectedVariantId;if(e)return e;if(t.product?.variants?.length>0)return t.product.variants[0].id};var me=class{static storage=new Map;static get(e){return this.storage.has(e)||this.storage.set(e,e.getInstance()),this.storage.get(e)}};var fv=xr(Si());function de(t){return typeof t=="function"}function ho(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var qc=ho(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
34
34
|
${r.map((n,i)=>`${i+1}) ${n.toString()}`).join(`
|
|
@@ -57,7 +57,7 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
`,kn=class{async addToCart(e,r){if(!e.length)return;let i={items:e.map(s=>{let{vID:a,quantity:c}=this.getVIDAndQuantity(s);return{id:a?+a:+s.mID,quantity:c,properties:r.getPrivateAttributesForLineItem()}})},o=rt.get();if(window.cooeeGetCartSections&&typeof window.cooeeGetCartSections=="function")try{i.sections_url=window.location.pathname,i.sections=window.cooeeGetCartSections()}catch(s){ae(s,"execute-cooeeGetCartSections",{engagementTrigger:r})}else o.isMiniCart()?i.sections=["mini-cart"]:o.isShopifyDefaultDrawer()&&(i.sections=o.element.getSectionsToRender?.().map((s=>s.section??s.id)));try{let s=await bo("/cart/add.js",i);return b.log(`Added ${e.length} items to Cart`),br("Product added to your cart"),s.data}catch(s){ae(s,"cart-item-add",{engagementTrigger:r});let a=["Failed to add product in cart."];if(s instanceof en&&s.is40x()&&s.responseText){let c=s.responseText;c.description&&a.push(`Reason: ${c.description}`)}a.push("Please try again later."),br(a.join(" "))}}async updateLineItem(e,r){if(!rr.hasKeys(r)){b.warn("No update fields provided");return}let n=_({id:e.key},r);try{let i=await bo("/cart/change.js",n);b.log(`Updated ${e}`),ge.getCurrent().update(i.data)}catch(i){ae(i,"cart-item-update"),br("Failed to update item in cart")}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),b.log(`Code-${e} copied`),br("Discount code copied")}catch(r){b.error("Failed to copy code",r)}}getProductURL(e){if(!e?.link)return;let r=_g(e.link);if(r)return Gi("/products/"+r)}async upgradeToSubscription(e,r){if(!e){b.warn("Trying to upgrade to subscription with no item");return}let n=await ge.getCurrent().getNormalisedCart(),i=e.selectedOrFirstVariant.value,o=n.items.findIndex(c=>c.vID===i.mID),s=i.selectedSellingPlan.value,a={line:o+1,selling_plan:s?.mID||null,properties:r.getPrivateAttributesForLineItem()};try{let c=await bo("/cart/change.js",a);return b.log(`Upgraded ${e} selling plan`),br("Line item updated"),ge.getCurrent().update(c.data),c.data}catch(c){ae(c,"cart-switch-subscription",{engagementTrigger:r}),br("Failed to update subscription")}}async createNewCart(e,r,n){if(!e?.vID){b.error("No variant ID found to perform Buy now",e);return}let i=r?[r]:[],o=[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:n.getKVFormatPrivateAttributesForLineItem()}],s=await Ya("Buy Now");return(await vl(T0,{input:{lines:o,discountCodes:i,attributes:s}},"storefront-create-cart")).data.data?.cartCreate?.cart?.checkoutUrl}async process(e){let r=e.clickAction,n=e.items,i=e.triggerData,o;if(r.at){let s=r;if(b.log(`Performing ${JSON.stringify(s)} action`),s.at===we.GO_TO_PRODUCT)o=this.getProductURL(n[0]);else if(s.at===we.ADD_TO_CART)n?.length&&await this.addToCart(n,i);else if(s.at===we.COPY_COUPON_CODE)await this.copyDiscountCode(i.discount?.code);else if(s.at===we.OPEN_CART)rt.get().open();else if(s.at===we.GO_TO_COLLECTION){let a=e.collections;if(!a?.length)return;o=Gi("/collections/"+a[0].handle)}}r.applyDiscount&&i.discount?.code?qr.navigate(i.discount.code,i.redirectBehaviour,o):o&&(location.pathname=o)}getVIDAndQuantity(e){let r,n;if(e instanceof Rt)r=e.vID,n=e.quantity??1;else{if(!e.vars?.length)return{};r=e.selectedOrFirstVariant.value.mID,n=1}return{vID:r,quantity:n}}};var _l=class{static updateIdentity(e){if(!this.isInstalled())return;let r={};e.email&&(r.email=e.email),e.mobile&&(r.phone_number=e.mobile),b.verbose("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",r])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}};var bl=class{action;triggerContext;constructor(e,r){this.action=e,this.triggerContext=r}async execute(){let e=this.containsCTA()?"CE Trigger Clicked":"CE Trigger Closed";switch(this.action.at!==we.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(e),this.action.at){case we.ACCEPT_POPUP:break;case we.GO_TO_URL:this.gotoURLAction();break;case we.SHARE:this.shareAction();break;case we.SUBMIT_FORM:await this.collectFormData();break;case void 0:case we.OPEN_CART:break;default:b.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;ki(e)||(e=`//${e}`),window.open(e,"_self")}}async closeTriggerAndSendEvent(e,r){this.triggerContext.closeInApp(e,r),await this.dispatchEvent()}shareAction(){if(!this.action.share)return;if(!navigator.share){b.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(r=>console.log(r)).catch(r=>console.error(r))}containsCTA(){return this.action.at&&this.action.at!==we.REJECT_POPUP?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:!0}async collectFormData(){let e={};for(let r of this.triggerContext.inputs){if(!r.isValid)return;let i=document.getElementById(r.id).value;r.type===51?e.email=i:r.type===52&&(e.mobile=i)}await this.closeTriggerAndSendEvent("CE Form Submitted",{form:e}),this.action.applyDiscount&&br("Coupon applied on cart"),_l.updateIdentity(e)}async dispatchEvent(){let e=this.triggerContext.triggerData,r={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new kn().process(r);let n={action:this.containsCTA()?"CLICKED":"CLOSED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}};var fr=class{renderer=Un.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,r,n){this.parentHTMLEl=e,this.inappElement=r,this.triggerContext=n,this.stylesConverter=new wo(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=Z(_(_(_(_({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});hi(this.inappHTMLEl,e)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&re(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&re(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let e={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};hi(this.inappHTMLEl,e)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let r=(e/100).toFixed(2);re(this.inappHTMLEl,"opacity",r)}}processShadow(){let e=this.inappElement.shd;e?re(this.inappHTMLEl,"box-shadow",e.getStyle(this.scalingFactor)):re(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let e=new Wn(this.inappElement.trf);e&&e.rotate&&re(this.inappHTMLEl,"transform",`rotate(${e.rotate}deg)`)}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation(),new bl(e,this.triggerContext).execute()}),re(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}};var Yr=class extends fr{constructor(e,r,n){super(e,r,n)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let e={},r=this.inappElement.typography;return r&&(e.fontSize=this.stylesConverter.getSizePx(r.fs),e.fontFamily="cooee"+r.fam?.name,e.lineHeight=`${r.lh}`,e.letterSpacing=r.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),hi(this.inappHTMLEl,e),e}processPart(e,r){let n=[];r.u&&n.push("underline"),r.st&&n.push("line-through"),n.length||n.push("normal"),re(e,"font-weight",r.b?"bold":"normal"),re(e,"font-style",r.i?"italic":"normal"),re(e,"text-decoration",n.join(" ")),re(e,"color",r.c??"inherit"),re(e,"font-family","inherit")}processAlignment(){let e=this.inappElement.typography.ta,r=e?Ti[e]?.toLowerCase():this.inappElement.typography.alignment;r||(r="start"),re(this.inappHTMLEl,"text-align",r)}};var Ps=class extends Yr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(e=>{let r=document.createElement("span");r.innerHTML=e.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(r,e),this.inappHTMLEl.appendChild(r)}),this.processCommonBlocks()}};var Ls=class extends fr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}};var yi=class extends fr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("img"),this.insertElement()}render(){this.inappHTMLEl.setAttribute("src",this.inappElement.src),re(this.inappHTMLEl,"max-width","none"),re(this.inappHTMLEl,"max-height","none"),re(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}};var Ms=class t extends fr{constructor(r,n,i){super(r,n,i);this.parent=r;this.inappHTMLEl=document.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add("cooee-wrapper"),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),re(this.inappHTMLEl,"z-index",t.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let r=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(re(this.inappHTMLEl,"width","100%"),re(this.inappHTMLEl,"height","100%")):(re(this.inappHTMLEl,"width","100vw"),re(this.inappHTMLEl,"height","100vh")),re(this.inappHTMLEl,"top","0"),re(this.inappHTMLEl,"left","0");else{let n=this.inappElement.spc,i=this.stylesConverter.getScaledSize(r.w)+n.getHorizontal(),o=this.stylesConverter.getScaledSize(r.h)+n.getVertical();re(this.inappHTMLEl,"width",i+"px"),re(this.inappHTMLEl,"height",o+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return _(_({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?re(this.inappHTMLEl,"position","absolute"):re(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}};var x0="cooee-container",wl=class extends fr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),re(this.inappHTMLEl,"position","relative"),re(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(x0),this}};var Sl=class t extends Yr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=Z(_(_(_({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e)}getBackgroundStyles(){return{}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.addStylesToTimer(e),e}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(e){this.elements.forEach(r=>hi(r,e))}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(t.DAYS)),e.hour&&this.elements.push(this.getChild(t.HOURS)),e.minute&&this.elements.push(this.getChild(t.MINUTES)),e.second&&this.elements.push(this.getChild(t.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(e){let r=document.createElement("div"),n=document.createElement("span"),i=document.createElement("span");return i.innerText=e,n.innerText="00",n.id=`lc-${e}`,re(i,"font-size","0.5em"),re(i,"text-align","center"),re(i,"font-family","inherit"),re(n,"text-align","center"),re(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(i),r.appendChild(n)):(r.appendChild(n),r.appendChild(i)),re(r,"display","flex"),re(r,"flex-direction",this.inappElement.horizontal?"":"column"),re(r,"justify-content","center"),re(r,"align-items","center"),re(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${t.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${t.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${t.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${t.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(e)}};var Il=class extends Yr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("select"),this.insertElement()}render(){re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener("click",r=>{r.stopPropagation()}),e.addEventListener("change",()=>{let r=new Ur(JSON.parse(e.value));this.updateItems(r)})}updateItems(e){let r=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[r.toEmbed(e)];let n=this.parentHTMLEl.querySelector("#coo-13");if(!n)return;let i=e.imgs[0]??r.imgs?.at(0);i?.url&&n.setAttribute("src",i.url)}addOptions(){let e=this.triggerContext.triggerData.items,r=this.inappHTMLEl;if(!e?.length){r.add(this.createOption(this.inappElement.placeholderText));return}let n=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(i=>{r.add(this.createOption(i.name??"Default",i,i.mID===n?.vID))})}createOption(e,r,n){let i=document.createElement("option");return i.text=e,i.value=JSON.stringify(r),n&&(i.selected=!0),r||(i.disabled=!0),i}};var So=class extends Yr{borderColor="";constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("input"),this.insertElement()}render(){let e=this.setInputType();this.inappHTMLEl.setAttribute("placeholder",this.inappElement.placeholderText),re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t)}};var Tl=class t extends So{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","email"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.EMAIL_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var xl=class t extends So{static MOBILE_REGEX=/^\d+$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","tel"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.MOBILE_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var Cl=class extends yi{constructor(e,r,n){super(e,r,n)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}};var Un=class t{static DOCUMENT_STANDARD_MODE="CSS1Compat";static ACTIVE_TRIGGER_DATA;static _instance;eventAPIService;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.eventAPIService=Re.getInstance(),this.resizeListener=()=>this.screenResized(),this.setParentContainer(e)}static get(){return t._instance}render(e){this.renderEngagement(new xt(e))}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(e){let r=e.max,n=e.cont.w,i=e.cont.h,o=e.spc,s=this.getWidth(),a=this.getHeight();r&&(s=s?Math.min(s,r):r,a=a?Math.min(a,r):r),a&&(s-=o.getHorizontal(),a-=o.getVertical(),s/a<n/i?this.scalingFactor=s/n:this.scalingFactor=a/i,this.scalingFactor=Math.min(this.scalingFactor,1))}setParentContainer(e){this.parent=e||document.body,this.isParentNotBody()&&re(this.parent,"position","relative")}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(e){this.triggerContext=new Rr(new Date,e),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=e.ian,(zr()||e.previewType==="mobile")&&this.ian.overrideForMobileView(),await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},e.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!rt.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:r})=>{!r&&this.startRenderingOnce()})}startRenderingOnce(){if(!this.shouldSkipCampaign()){t.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,t._instance=this;try{this.startRendering()}catch(e){ae(e,"render-popup",{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),zr()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}}shouldSkipCampaign(){let e=this.triggerContext.triggerData;if(!e.previewType&&t.ACTIVE_TRIGGER_DATA){let n={triggerShown:new Nn(t.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(e,n),!0}if(ve.get().isGoKwikPopupOpen)return this.skipTrigger(e,{reason:"GoKwik popup is open"}),!0;let r=Rm.find(n=>!!document.querySelector(n.identifier));return r?(this.skipTrigger(e,{reason:`${r.gateway} modal is open`}),!0):!1}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new Ms(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(e){throw b.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(i=>i.mID));let r=new Ie("CE Trigger Displayed",e,this.triggerContext.triggerData);this.eventAPIService.sendSilently(r);let n={action:"DISPLAYED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}sendTriggerClosed(e){let r=e.eventName;delete e.eventName;let n=new Ie(r,e,this.triggerContext.triggerData);n.name==="CE Trigger Clicked"&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(i=>i.toEmbed())),this.eventAPIService.sendSilently(n)}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500})}renderElement(e,r,n){r instanceof Ki?new Tl(e,r,n).render():r instanceof Xi?new xl(e,r,n).render():r instanceof xn?new Ps(e,r,n).render():r instanceof Ji?new Cl(e,r,n).render():r instanceof ln?new yi(e,r,n).render():r instanceof ei?new Ls(e,r,n).render():r instanceof qi?new Sl(e,r,n).render():r instanceof Yi?new Il(e,r,n).render():b.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new wl(this.rootContainer,r,e).render().getHTMLElement(),new El().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,e)}),this.addEnterAnimation(this.ian.anim))}closeInApp(e){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),t.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){let e=document.querySelector(`.${this.triggerContext.rootClassName}`);e&&e.parentElement.removeChild(e)}skipTrigger(e,r){let n=new Ie("CE Campaign Rejected",r,e);this.eventAPIService.sendSilently(n)}async preloadImages(e){let r=e.ian;if(!r)return;let n=[];r.elems.forEach(i=>{let o=i.bg?.img?.src;if(o&&n.push(this.getPromise(o)),i.t===1){let s=i.src;if(!s)return;n.push(this.getPromise(s))}}),r.bg?.img?.src&&n.push(this.getPromise(r.bg.img.src)),r.cont.bg?.img?.src&&n.push(this.getPromise(r.cont.bg.img.src)),await Promise.all(n)}getPromise(e){return new Promise(r=>{let n=new Image;n.onload=r,n.src=e,n.style.display="none"})}};var Io=class{static trackDeviceID(e){this.isInstalled()}static trackIntent(e){if(!this.isInstalled())return;let r=gi[e]?.toLowerCase();r&&(b.verbose(`Sending ${r} intent to MS Clarity`),window.clarity("set","Cooee Intent",r))}static isInstalled(){return window.clarity&&typeof window.clarity=="function"}};var Rl=class{triggerData;eventAPIService=Re.getInstance();backendAPIService=Pt.getInstance();render(e){e.contentSource===Mo.KLAVIYO&&(this.triggerData=e,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",e.klaviyoFormID]))}handleKlaviyoEvents(e){if(e.type!=="klaviyoForms")return;let r=e.detail;if(r.formId!==this.triggerData.klaviyoFormID){b.warn("Received invalid trigger callback");return}switch(r.type){case"open":this.eventAPIService.sendSilently(new Ie("CE Trigger Displayed",{form:{id:r.formId}},this.triggerData));break;case"stepSubmit":{let n=this.getFormDetails(r);this.eventAPIService.sendSilently(new Ie("CE Form Submitted",{form:n},this.triggerData)),this.backendAPIService.updateProfileSafe(n);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),this.eventAPIService.sendSilently(new Ie("CE Trigger Closed",{form:{id:r.formId}},this.triggerData));break}}getFormDetails(e){let r={id:e.formId},n=e.metaData;if(rr.hasKeys(n)){let i=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(n).forEach(a=>{i.includes(a)||(r[a]=n[a])}),r.email=n.$email??n.email,r.mobile=n.$phone_number??n.phone_number;let o=n.$first_name??n.first_name,s=n.$last_name??n.last_name;(o?.length||s?.length)&&(r.name=o+" "+s)}return r}};var Al=class{static trackIntent(e){if(!this.isInstalled()){b.verbose("Facebook pixel not installed");return}if(!Xe.get().pixelPush){b.verbose("Facebook pixel push not enabled");return}let n=gi[e.intent]?.toLowerCase(),i=e.segmentName;!n&&!i||(b.verbose(`Sending ${n} intent and ${i} segment to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:n,segment_value:e.segmentName}))}static isInstalled(){return window.fbq&&typeof window.fbq=="function"}};var um=new Map,Dl=async t=>{for(let o of t.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(o,t)}catch(s){b.error(s)}if(t.isCartEmbed()&&!t.isSubscriptionUpsell()){let s=(await ge.getCurrent().getNormalisedCart()).items.map(a=>a.mID);t.items=t.items.filter(a=>!s.includes(a.mID))}if(Xe.get().currencyCount<=1)return t.items;if(t.isShoppableVideo())return await C0(t.content.videoConfig,t),t.items;let e=t.items.length,r=t.items.map(o=>tv(o,t)),i=(await Promise.all(r)).filter(o=>o!=null);if(e&&!i.length){let o="Failed to fetch any product from Ajax API",s=new Ie("CE Campaign Failed",{reason:o,currency:t.currency},t);throw me.get(Re).sendSilently(s),new Error(o)}if(t.isCartRecovery()){let o=ge.getCurrent().items,s=[];for(let a of i)for(let c of a.vars){if(!c.isAvailable)continue;let p=o.find(E=>E.variant_id.toString()===c.mID);if(!p)continue;let d=new Dt(a);d.name=p.title;let f=new Ur(c);f.name=p.variant_title,f.price.d=p.discounted_price/100,d.variants=[f],s.push(d)}return s}return i},C0=async(t,e)=>{await Promise.all(t.videos.map(async r=>{r.items=await Promise.all(r.items.map(async n=>{let i=await tv(n,e);return i||n}))}))},tv=async(t,e)=>{if(um.has(t.mID))return um.get(t.mID);let r,n=`/products/${t.slug}.js`;try{r=(await tn(n)).data}catch(i){return i instanceof en&&i.response?.status===404||ae(i,"fetch-shopify-product",{extra:{item:t,path:n},engagementTrigger:e}),null}return r?R0(t,r):(b.error("Item not found after AJAX call for:",t),null)},R0=(t,e)=>{if(!t||!e)return t;t.name=e.title,t.tags=e.tags,t.slug=e.handle;let r=t.selectedOrFirstVariant.value;return t.vars.map(n=>{let i=e.variants.find(o=>o.id===+n.mID);i!=null&&(n.name=i.title,n.isAvailable=i.available,n.price.d=i.price?i.price/100:i.price,n.price.effective=n.price.d,n.price.cmp=i.compare_at_price?i.compare_at_price/100:i.compare_at_price,+r.mID===i.id&&(r.effectivePrice.value=n.price.d))}),um.set(t.mID,t),t};var Fn=class{runtimeData=ve.get();backendAPIService=me.get(Pt);sessionManager=me.get(_t);constructor(){}async getAllContext(){let[e,r]=await Promise.all([hl(),this.sessionManager.checkSessionAndGetContext()]);return _(_({},e),r)}};var Re=class t extends Fn{static INSTANCE;constructor(){super()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}sendSafe(e){b.verbose(`Waiting for auth to send event ${e.name}`),Gr(_t.replaySubject).then(()=>this.sendSilently(e))}sendSilently(e){this.send(e).catch(r=>ae(r,"track-event",{extra:{event:e}}))}async send(e){if(b.verbose(`Sending event: ${e.name}`,e),this.shouldReject(e)){b.warn(`Rejecting event ${e.name}`);return}ev();let r=await this.getAllContext();Object.assign(e,r),e.name!=="CE App Background"&&this.runtimeData.setActive(),this.backendAPIService.post("/v1/event/track",e).then(async n=>{b.info("\u2705 Event tracked:",this.userFriendlyName(e.name)),this.processEventResponse(e,n.data)}).catch(n=>{b.error(`Error sending event ${e.name} to server`,n)})}userFriendlyName(e){return e.replace("CE ","").replace("Trigger","Engagement").replace("Screen","Page").replace("App ","")}shouldReject(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(b.warn("Not sending event as this is a test trigger"),!0):!1}processEventResponse(e,r){this.renderWidgetIfAny(e,r).catch(n=>{ae(n,"process-popup-response",{extra:{event:e,response:r}})}),this.utiliseIntentIfCalculated(r)}async renderWidgetIfAny(e,r){if(!r.triggerData)return;let n=new xt(r.triggerData);n.occurred=e.occurred,b.log(`${n} will be shown`);let i;try{i=await Dl(n)}catch(o){b.error("Failed to refresh the products",o);return}if(n.items=i,n.contentSource===Mo.KLAVIYO){new Rl().render(n);return}new Un().renderEngagement(n).catch(o=>{ae(o,"render-popup",{extra:{event:e},engagementTrigger:n})})}utiliseIntentIfCalculated(e){e.intent&&(Io.trackIntent(e.intent),Al.trackIntent(e),b.info(`Intent is ${gi[e.intent]}`))}};var rv=new Jt,nv=new Jt;function iv(){return nv.asObservable()}function Nl(){rv.next()}var Ol=class{constructor(){rv.pipe(Tr(100)).subscribe(this.compareCartItems.bind(this))}listen(){Nl(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(n=>b.error("Unable to process cart change in XMLHttpRequest",n))}),r.apply(this,arguments)},b.verbose("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=function(n){return r.apply(window,arguments).then(i=>{let o="";try{o=typeof n=="string"||n instanceof URL?n.toString():n?.url??i?.url??""}catch{}return e.performEvent(o).catch(s=>b.error("Unable to process cart change in fetch",s)),i})},b.verbose("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&Nl()}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,r){let n=e?.items,i=r.items,o=[],s=[];if(b.verbose(`Comparing cart change with old count ${n?.length} to new count ${i.length}`),i?.forEach(a=>{let c=n?.find(p=>p.vID===a.vID);if(c){if(c.quantity!==a.quantity){let p=c.quantity<a.quantity,d=Math.abs(c.quantity-a.quantity),f=Z(_({},a),{quantity:d});p?o.push(f):s.push(f)}n&&Bh(n,c)}else o.push(a)}),n)for(let a of n)s.push(a);b.verbose(`Cart delta: added: ${o.length}, removed: ${s.length}`),o.length&&this.sendEvent("Add To Cart",{items:o}),s.length&&e.token===r.token&&this.sendEvent("Remove From Cart",{items:s}),(s.length||o.length)&&nv.next({itemsAdded:o,itemsRemoved:s,cart:r})}sendEvent(e,r){let n=new Ie(e,r);me.get(Re).sendSafe(n)}async compareCartItems(){let e=await Ye.get("cart",{}),r=await ge.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,r)}};var rt=class t{static cartDrawerToggle$=new Ss({open:!1,firstOpen:!1});static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Xe.get().website??{};currentState=!1;mutationSubscription;mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[t.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.addEventListener("click",this.clickEventListener,{capture:!0,passive:!0})}get element(){return this.cartDrawerElement}static get(){return t._instance||(t._instance=new t),t._instance}static forceUpdate(){t._instance?.destroy(),t._instance=new t}isOpen(){let e=this.inShadow?this.isPresent():cm(this.cartDrawerElement);return b.info(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(this.isOpen()){b.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent("letscooee:outbound:open-cart"));let e=document.querySelector(this.iconSelector);if(!e){b.verbose("No clickable cart icon found with selector",this.iconSelector);return}e.click()}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===t.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(e,r=!0){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(e)}catch(n){ae(n,"execute-cooeeUpdateCartDrawer")}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&e)this.element.classList.remove("is-empty"),this.element.renderContents?.(e);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let n=e.items[0].id,i=e.items[0].quantity,o=e.items[0].price;window.cartGiftUpdate(n,o,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer=="function")window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?ge.getCurrent().getNormalisedCart(!0).then(()=>{window.refreshCart(ge.getCurrent())}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,e?.items?.[0]?.id+""):(b.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent("letscooee:outbound:refresh-ui",{detail:{responseJSON:e,currentCart:ge.getCurrent()}})),r&&Nl()}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let r=e.split(":shadow");r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!ss())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await Fi(e),!this.cartDrawerElement){ov.default.warn("Max attempts exhausted to find cart drawer");return}b.verbose("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let r=(await Fi(this.shadowParentElementSelector))?.shadowRoot;r?.mode==="open"&&(this.cartDrawerShadowElement=r,this.createMutationObservers())}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle()}watchForCartToggle(){let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new Jt;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(e,{attributes:!0,subtree:!0,childList:this.inShadow}),this.mutationSubscription=r.pipe(im(800,void 0,{leading:!1,trailing:!0})).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,t.cartDrawerToggle$.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return!1;let e=this.cartDrawerShadowElement.querySelector(this.selector);return e?cm(e):!1}async updateBubble(){let e=(await ge.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=e+"")}manualCartIconClicked(e){!e.target.closest(this.iconSelector)||!e.isTrusted||window.CooeeSDK.events.push(["Open Cart"])}destroy(){document.removeEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.removeEventListener("click",this.clickEventListener,{capture:!0}),this.mutationSubscription?.unsubscribe(),this.mutationObserver?.disconnect()}};var Pl=class{static processConfiguration(){let e=Xe.get();!e.gaMeasurementID||!e.gaEnabled||this.sendClientID()}static async sendClientID(){let e=await this.getClientID();e&&Pt.getInstance().updateDevicePropsSafe({gaClientID:e})}static async getClientID(){let e=await Ye.get("gacid"),r=await this.getClientIDViaGTag();if(e!==r)return await Ye.set("gacid",r),r}static async getClientIDViaGTag(){let r=Xe.get().gaMeasurementID;if(!(!r||!window.gtag))return new Promise(n=>{window.gtag("get",r,"client_id",i=>{n(i)})})}};var Fe=class extends Br{stylesConverter=new wo(1);mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=zr()?"sm":"lg",this.clickExecutor=new dn(this.props.triggerContext)}getCompiledStyles(){return this.putStyleAccordingToDevice(),_(_(Z(_(_(_(_(_(_({},this.stylesConverter.getFlexStyles(this.mediaStyle.flex)),this.stylesConverter.getBackgroundStyles(this.mediaStyle.bg)),this.stylesConverter.getBorderStyles(this.mediaStyle.br)),this.stylesConverter.getSizeStyles(this.mediaStyle.size)),this.stylesConverter.getSpaceStyles(this.mediaStyle.spc)),this.stylesConverter.getLayoutStyles(this.mediaStyle.lout)),{boxSizing:"border-box",outline:"none"}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return!0;let{lhs:r,rhs:n}=e;switch(e.op){case"eq":return r===n;case"gt":return+r>+n;case"gte":return+r>=+n;case"lt":return+r<+n;case"lte":return+r<=+n;case"ne":return r!==n;case"null":return r==null;case"empty":return r.trim()==="";case"in":return new RegExp(`\\b${n}\\b`).test(r);case"nin":return!new RegExp(`\\b${n}\\b`).test(r);default:return b.error(`Invalid operator found for when condition - ${e.op}`),!1}}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,zr()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=_(_({},this.mediaStyle),e.style.sm))}sendTriggerClicked(e,r){this.clickExecutor.sendTriggerClicked(e,r)}async onClick(e,r){e.stopPropagation(),r.clickAction||(r.clickAction=this.props.element.clc),r.clickAction?.at&&await this.clickExecutor.execute(r)}};var A0=0,UW=Array.isArray;function K(t,e,r,n,i,o){e||(e={});var s,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?s=e[a]:c[a]=e[a];var p={type:t,props:c,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--A0,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return xe.vnode&&xe.vnode(p),p}var Qt=class extends Fe{componentDidMount(){this.setState(()=>({text:this.props.element.text})),Tt(this.onChange.bind(this))}componentWillReceiveProps(e){this.props.element=e.element,this.onChange()}render(){let e=this.getCompiledStyles(),r=this.state.text;return r||(e.display="none",r=""),K("div",{style:e,onClick:this.customOnClick.bind(this),className:"lc-text",children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:r}})})}customOnClick(){this.props.onClick&&this.props.onClick("title")}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,r={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},n=Zn(this.props.element,r,this.props.triggerContext),i=new vt(n);if(!this.matchWhenCondition(i.when)){this.setState(()=>({text:""}));return}this.setState(()=>({text:i.text}))}getTypoStyles(){let e={},r=this.mediaStyle.typo??new lt;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily=r.fam.name||"inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,e.textDecoration=r.td??"none",this.stylesConverter.getColourStyles(r.tc,"color",e),e}getComponentStyles(){return _({},this.getTypoStyles())}getSpanStyle(){return{overflow:"hidden",display:"-webkit-box",webkitBoxOrient:"vertical",webkitLineClamp:2,color:"inherit",fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit"}}};var vi=class extends Qt{render(){return K("div",{style:this.getCompiledStyles(),className:"lc-button",onClick:e=>this.onClick(e,{item:this.props.item}),children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return Z(_({},super.getComponentStyles()),{cursor:"pointer"})}};var pm=class extends Br{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos==="end"?K("div",{style:_(_({},this.getElementStyle()),this.props.styles),children:[K("span",{children:this.props.time}),K("span",{style:this.getTimeLabelStyle(),children:this.props.label})]}):K("div",{style:_(_({},this.getElementStyle()),this.props.styles),children:[K("span",{style:this.getTimeLabelStyle(),children:this.props.label}),K("span",{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return{fontSize:"0.5em",alignContent:"center"}}getElementStyle(){let e={display:"flex",flexDirection:"column",placeContent:"center center",textAlign:"center"};return this.props.element.horizontal&&(e.gridTemplateColumns="repeat(2, minmax(0, 1fr))"),e}},Bs=class extends Qt{labels={Days:"00",Hours:"00",Minutes:"00",Seconds:"00"};componentWillMount(){super.componentWillMount(),this.setState(()=>_({},this.labels)),this.processAndStartTimer()}render(){return K("div",{style:this.getLabelsParentStyle(),children:Object.keys(this.labels).map(e=>K(pm,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return{display:"grid",justifyContent:"center",gridTemplateColumns:"repeat(4, auto)",gap:this.stylesConverter.getSizePx(this.props.element.gap)}}getDisplayStyles(){return{display:"grid",placeContent:"center center"}}getComponentStyles(){return _(_({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,"0"),this.labels.Hours=String(e.hours).padStart(2,"0"),this.labels.Minutes=String(e.minutes).padStart(2,"0"),this.labels.Seconds=String(e.seconds).padStart(2,"0"),this.setState(()=>_({},this.labels))})}};function Ll(t,e){if(!t)return;let r={loop:!0,slidesPerView:e.maxInRow,spaceBetween:e.gap+"px",pagination:{type:e.pagination.type,el:t.querySelector(".swiper-pagination"),clickable:!0,renderBullet:(i,o)=>`
|
|
60
|
+
`,kn=class{async addToCart(e,r){if(!e.length)return;let i={items:e.map(s=>{let{vID:a,quantity:c}=this.getVIDAndQuantity(s);return{id:a?+a:+s.mID,quantity:c,properties:r.getPrivateAttributesForLineItem()}})},o=rt.get();if(window.cooeeGetCartSections&&typeof window.cooeeGetCartSections=="function")try{i.sections_url=window.location.pathname,i.sections=window.cooeeGetCartSections()}catch(s){ae(s,"execute-cooeeGetCartSections",{engagementTrigger:r})}else o.isMiniCart()?i.sections=["mini-cart"]:o.isShopifyDefaultDrawer()&&(i.sections=o.element.getSectionsToRender?.().map((s=>s.section??s.id)));try{let s=await bo("/cart/add.js",i);return b.log(`Added ${e.length} items to Cart`),br("Product added to your cart"),s.data}catch(s){ae(s,"cart-item-add",{engagementTrigger:r});let a=["Failed to add product in cart."];if(s instanceof en&&s.is40x()&&s.responseText){let c=s.responseText;c.description&&a.push(`Reason: ${c.description}`)}a.push("Please try again later."),br(a.join(" "))}}async updateLineItem(e,r){if(!rr.hasKeys(r)){b.warn("No update fields provided");return}let n=_({id:e.key},r);try{let i=await bo("/cart/change.js",n);b.log(`Updated ${e}`),ge.getCurrent().update(i.data)}catch(i){ae(i,"cart-item-update"),br("Failed to update item in cart")}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),b.log(`Code-${e} copied`),br("Discount code copied")}catch(r){b.error("Failed to copy code",r)}}getProductURL(e){if(!e?.link)return;let r=_g(e.link);if(r)return Gi("/products/"+r)}async upgradeToSubscription(e,r){if(!e){b.warn("Trying to upgrade to subscription with no item");return}let n=await ge.getCurrent().getNormalisedCart(),i=e.selectedOrFirstVariant.value,o=n.items.findIndex(c=>c.vID===i.mID),s=i.selectedSellingPlan.value,a={line:o+1,selling_plan:s?.mID||null,properties:r.getPrivateAttributesForLineItem()};try{let c=await bo("/cart/change.js",a);return b.log(`Upgraded ${e} selling plan`),br("Line item updated"),ge.getCurrent().update(c.data),c.data}catch(c){ae(c,"cart-switch-subscription",{engagementTrigger:r}),br("Failed to update subscription")}}async createNewCart(e,r,n){if(!e?.vID){b.error("No variant ID found to perform Buy now",e);return}let i=r?[r]:[],o=[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:n.getKVFormatPrivateAttributesForLineItem()}],s=await Ya("Buy Now");return(await vl(T0,{input:{lines:o,discountCodes:i,attributes:s}},"storefront-create-cart")).data.data?.cartCreate?.cart?.checkoutUrl}async process(e){let r=e.clickAction,n=e.items,i=e.triggerData,o;if(r.at){let s=r;if(b.log(`Performing ${JSON.stringify(s)} action`),s.at===we.GO_TO_PRODUCT)o=this.getProductURL(n[0]);else if(s.at===we.ADD_TO_CART)n?.length&&await this.addToCart(n,i);else if(s.at===we.COPY_COUPON_CODE)await this.copyDiscountCode(i.discount?.code);else if(s.at===we.OPEN_CART)rt.get().open();else if(s.at===we.GO_TO_COLLECTION){let a=e.collections;if(!a?.length)return;o=Gi("/collections/"+a[0].handle)}}r.applyDiscount&&i.discount?.code?qr.navigate(i.discount.code,i.redirectBehaviour,o):o&&(location.pathname=o)}getVIDAndQuantity(e){let r,n;if(e instanceof Rt)r=e.vID,n=e.quantity??1;else{if(!e.vars?.length)return{};r=e.selectedOrFirstVariant.value.mID,n=1}return{vID:r,quantity:n}}};var _l=class{static updateIdentity(e){if(!this.isInstalled())return;let r={};e.email&&(r.email=e.email),e.mobile&&(r.phone_number=e.mobile),b.verbose("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",r])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}};var bl=class{action;triggerContext;constructor(e,r){this.action=e,this.triggerContext=r}async execute(){let e=this.containsCTA()?"CE Trigger Clicked":"CE Trigger Closed";switch(this.action.at!==we.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(e),this.action.at){case we.ACCEPT_POPUP:break;case we.GO_TO_URL:this.gotoURLAction();break;case we.SHARE:this.shareAction();break;case we.SUBMIT_FORM:await this.collectFormData();break;case void 0:case we.OPEN_CART:break;default:b.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;ki(e)||(e=`//${e}`),window.open(e,"_self")}}async closeTriggerAndSendEvent(e,r){this.triggerContext.closeInApp(e,r),await this.dispatchEvent()}shareAction(){if(!this.action.share)return;if(!navigator.share){b.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(r=>console.log(r)).catch(r=>console.error(r))}containsCTA(){return this.action.at&&this.action.at!==we.REJECT_POPUP?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:!0}async collectFormData(){let e={};for(let r of this.triggerContext.inputs){if(!r.isValid)return;let i=document.getElementById(r.id).value;r.type===51?e.email=i:r.type===52&&(e.mobile=i)}await this.closeTriggerAndSendEvent("CE Form Submitted",{form:e}),this.action.applyDiscount&&br("Coupon applied on cart"),_l.updateIdentity(e)}async dispatchEvent(){let e=this.triggerContext.triggerData,r={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new kn().process(r);let n={action:this.containsCTA()?"CLICKED":"CLOSED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}};var fr=class{renderer=Un.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,r,n){this.parentHTMLEl=e,this.inappElement=r,this.triggerContext=n,this.stylesConverter=new wo(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=Z(_(_(_(_({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});hi(this.inappHTMLEl,e)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&re(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&re(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let e={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};hi(this.inappHTMLEl,e)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let r=(e/100).toFixed(2);re(this.inappHTMLEl,"opacity",r)}}processShadow(){let e=this.inappElement.shd;e?re(this.inappHTMLEl,"box-shadow",e.getStyle(this.scalingFactor)):re(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let e=new Wn(this.inappElement.trf);e&&e.rotate&&re(this.inappHTMLEl,"transform",`rotate(${e.rotate}deg)`)}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation(),new bl(e,this.triggerContext).execute()}),re(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}};var Yr=class extends fr{constructor(e,r,n){super(e,r,n)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let e={},r=this.inappElement.typography;return r&&(e.fontSize=this.stylesConverter.getSizePx(r.fs),e.fontFamily="cooee"+r.fam?.name,e.lineHeight=`${r.lh}`,e.letterSpacing=r.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),hi(this.inappHTMLEl,e),e}processPart(e,r){let n=[];r.u&&n.push("underline"),r.st&&n.push("line-through"),n.length||n.push("normal"),re(e,"font-weight",r.b?"bold":"normal"),re(e,"font-style",r.i?"italic":"normal"),re(e,"text-decoration",n.join(" ")),re(e,"color",r.c??"inherit"),re(e,"font-family","inherit")}processAlignment(){let e=this.inappElement.typography.ta,r=e?Ti[e]?.toLowerCase():this.inappElement.typography.alignment;r||(r="start"),re(this.inappHTMLEl,"text-align",r)}};var Ps=class extends Yr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(e=>{let r=document.createElement("span");r.innerHTML=e.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(r,e),this.inappHTMLEl.appendChild(r)}),this.processCommonBlocks()}};var Ls=class extends fr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}};var yi=class extends fr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("img"),this.insertElement()}render(){this.inappHTMLEl.setAttribute("src",this.inappElement.src),re(this.inappHTMLEl,"max-width","none"),re(this.inappHTMLEl,"max-height","none"),re(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}};var Ms=class t extends fr{constructor(r,n,i){super(r,n,i);this.parent=r;this.inappHTMLEl=document.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add("cooee-wrapper"),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),re(this.inappHTMLEl,"z-index",t.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let r=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(re(this.inappHTMLEl,"width","100%"),re(this.inappHTMLEl,"height","100%")):(re(this.inappHTMLEl,"width","100vw"),re(this.inappHTMLEl,"height","100vh")),re(this.inappHTMLEl,"top","0"),re(this.inappHTMLEl,"left","0");else{let n=this.inappElement.spc,i=this.stylesConverter.getScaledSize(r.w)+n.getHorizontal(),o=this.stylesConverter.getScaledSize(r.h)+n.getVertical();re(this.inappHTMLEl,"width",i+"px"),re(this.inappHTMLEl,"height",o+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return _(_({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?re(this.inappHTMLEl,"position","absolute"):re(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}};var x0="cooee-container",wl=class extends fr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),re(this.inappHTMLEl,"position","relative"),re(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(x0),this}};var Sl=class t extends Yr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=Z(_(_(_({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e)}getBackgroundStyles(){return{}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.addStylesToTimer(e),e}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(e){this.elements.forEach(r=>hi(r,e))}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(t.DAYS)),e.hour&&this.elements.push(this.getChild(t.HOURS)),e.minute&&this.elements.push(this.getChild(t.MINUTES)),e.second&&this.elements.push(this.getChild(t.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(e){let r=document.createElement("div"),n=document.createElement("span"),i=document.createElement("span");return i.innerText=e,n.innerText="00",n.id=`lc-${e}`,re(i,"font-size","0.5em"),re(i,"text-align","center"),re(i,"font-family","inherit"),re(n,"text-align","center"),re(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(i),r.appendChild(n)):(r.appendChild(n),r.appendChild(i)),re(r,"display","flex"),re(r,"flex-direction",this.inappElement.horizontal?"":"column"),re(r,"justify-content","center"),re(r,"align-items","center"),re(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${t.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${t.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${t.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${t.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(e)}};var Il=class extends Yr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("select"),this.insertElement()}render(){re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener("click",r=>{r.stopPropagation()}),e.addEventListener("change",()=>{let r=new Ur(JSON.parse(e.value));this.updateItems(r)})}updateItems(e){let r=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[r.toEmbed(e)];let n=this.parentHTMLEl.querySelector("#coo-13");if(!n)return;let i=e.imgs[0]??r.imgs?.at(0);i?.url&&n.setAttribute("src",i.url)}addOptions(){let e=this.triggerContext.triggerData.items,r=this.inappHTMLEl;if(!e?.length){r.add(this.createOption(this.inappElement.placeholderText));return}let n=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(i=>{r.add(this.createOption(i.name??"Default",i,i.mID===n?.vID))})}createOption(e,r,n){let i=document.createElement("option");return i.text=e,i.value=JSON.stringify(r),n&&(i.selected=!0),r||(i.disabled=!0),i}};var So=class extends Yr{borderColor="";constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("input"),this.insertElement()}render(){let e=this.setInputType();this.inappHTMLEl.setAttribute("placeholder",this.inappElement.placeholderText),re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t)}};var Tl=class t extends So{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","email"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.EMAIL_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var xl=class t extends So{static MOBILE_REGEX=/^\d+$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","tel"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.MOBILE_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var Cl=class extends yi{constructor(e,r,n){super(e,r,n)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}};var Un=class t{static DOCUMENT_STANDARD_MODE="CSS1Compat";static ACTIVE_TRIGGER_DATA;static _instance;eventAPIService;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.eventAPIService=Re.getInstance(),this.resizeListener=()=>this.screenResized(),this.setParentContainer(e)}static get(){return t._instance}render(e){this.renderEngagement(new xt(e))}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(e){let r=e.max,n=e.cont.w,i=e.cont.h,o=e.spc,s=this.getWidth(),a=this.getHeight();r&&(s=s?Math.min(s,r):r,a=a?Math.min(a,r):r),a&&(s-=o.getHorizontal(),a-=o.getVertical(),s/a<n/i?this.scalingFactor=s/n:this.scalingFactor=a/i,this.scalingFactor=Math.min(this.scalingFactor,1))}setParentContainer(e){this.parent=e||document.body,this.isParentNotBody()&&re(this.parent,"position","relative")}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(e){this.triggerContext=new Rr(new Date,e),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=e.ian,(zr()||e.previewType==="mobile")&&this.ian.overrideForMobileView(),await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},e.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!rt.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:r})=>{!r&&this.startRenderingOnce()})}startRenderingOnce(){if(!this.shouldSkipCampaign()){t.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,t._instance=this;try{this.startRendering()}catch(e){ae(e,"render-popup",{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),zr()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}}shouldSkipCampaign(){let e=this.triggerContext.triggerData;if(!e.previewType&&t.ACTIVE_TRIGGER_DATA){let n={triggerShown:new Nn(t.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(e,n),!0}if(ve.get().isGoKwikPopupOpen)return this.skipTrigger(e,{reason:"GoKwik popup is open"}),!0;let r=Rm.find(n=>!!document.querySelector(n.identifier));return r?(this.skipTrigger(e,{reason:`${r.gateway} modal is open`}),!0):!1}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new Ms(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(e){throw b.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(i=>i.mID));let r=new Ie("CE Trigger Displayed",e,this.triggerContext.triggerData);this.eventAPIService.sendSilently(r);let n={action:"DISPLAYED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}sendTriggerClosed(e){let r=e.eventName;delete e.eventName;let n=new Ie(r,e,this.triggerContext.triggerData);n.name==="CE Trigger Clicked"&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(i=>i.toEmbed())),this.eventAPIService.sendSilently(n)}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500})}renderElement(e,r,n){r instanceof Ki?new Tl(e,r,n).render():r instanceof Xi?new xl(e,r,n).render():r instanceof xn?new Ps(e,r,n).render():r instanceof Ji?new Cl(e,r,n).render():r instanceof ln?new yi(e,r,n).render():r instanceof ei?new Ls(e,r,n).render():r instanceof qi?new Sl(e,r,n).render():r instanceof Yi?new Il(e,r,n).render():b.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new wl(this.rootContainer,r,e).render().getHTMLElement(),new El().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,e)}),this.addEnterAnimation(this.ian.anim))}closeInApp(e){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),t.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){let e=document.querySelector(`.${this.triggerContext.rootClassName}`);e&&e.parentElement.removeChild(e)}skipTrigger(e,r){let n=new Ie("CE Campaign Rejected",r,e);this.eventAPIService.sendSilently(n)}async preloadImages(e){let r=e.ian;if(!r)return;let n=[];r.elems.forEach(i=>{let o=i.bg?.img?.src;if(o&&n.push(this.getPromise(o)),i.t===1){let s=i.src;if(!s)return;n.push(this.getPromise(s))}}),r.bg?.img?.src&&n.push(this.getPromise(r.bg.img.src)),r.cont.bg?.img?.src&&n.push(this.getPromise(r.cont.bg.img.src)),await Promise.all(n)}getPromise(e){return new Promise(r=>{let n=new Image;n.onload=r,n.src=e,n.style.display="none"})}};var Io=class{static trackDeviceID(e){this.isInstalled()}static trackIntent(e){if(!this.isInstalled())return;let r=gi[e]?.toLowerCase();r&&(b.verbose(`Sending ${r} intent to MS Clarity`),window.clarity("set","Cooee Intent",r))}static isInstalled(){return window.clarity&&typeof window.clarity=="function"}};var Rl=class{triggerData;eventAPIService=Re.getInstance();backendAPIService=Pt.getInstance();render(e){e.contentSource===Mo.KLAVIYO&&(this.triggerData=e,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",e.klaviyoFormID]))}handleKlaviyoEvents(e){if(e.type!=="klaviyoForms")return;let r=e.detail;if(r.formId!==this.triggerData.klaviyoFormID){b.warn("Received invalid trigger callback");return}switch(r.type){case"open":this.eventAPIService.sendSilently(new Ie("CE Trigger Displayed",{form:{id:r.formId}},this.triggerData));break;case"stepSubmit":{let n=this.getFormDetails(r);this.eventAPIService.sendSilently(new Ie("CE Form Submitted",{form:n},this.triggerData)),this.backendAPIService.updateProfileSafe(n);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),this.eventAPIService.sendSilently(new Ie("CE Trigger Closed",{form:{id:r.formId}},this.triggerData));break}}getFormDetails(e){let r={id:e.formId},n=e.metaData;if(rr.hasKeys(n)){let i=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(n).forEach(a=>{i.includes(a)||(r[a]=n[a])}),r.email=n.$email??n.email,r.mobile=n.$phone_number??n.phone_number;let o=n.$first_name??n.first_name,s=n.$last_name??n.last_name;(o?.length||s?.length)&&(r.name=o+" "+s)}return r}};var Al=class{static trackIntent(e){if(!this.isInstalled()){b.verbose("Facebook pixel not installed");return}if(!Xe.get().pixelPush){b.verbose("Facebook pixel push not enabled");return}let n=gi[e.intent]?.toLowerCase(),i=e.segmentName;!n&&!i||(b.verbose(`Sending ${n} intent and ${i} segment to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:n,segment_value:e.segmentName}))}static isInstalled(){return window.fbq&&typeof window.fbq=="function"}};var um=new Map,Dl=async t=>{for(let o of t.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(o,t)}catch(s){b.error(s)}if(t.isCartEmbed()&&!t.isSubscriptionUpsell()){let s=(await ge.getCurrent().getNormalisedCart()).items.map(a=>a.mID);t.items=t.items.filter(a=>!s.includes(a.mID))}if(Xe.get().currencyCount<=1)return t.items;if(t.isShoppableVideo())return await C0(t.content.videoConfig,t),t.items;let e=t.items.length,r=t.items.map(o=>tv(o,t)),i=(await Promise.all(r)).filter(o=>o!=null);if(e&&!i.length){let o="Failed to fetch any product from Ajax API",s=new Ie("CE Campaign Failed",{reason:o,currency:t.currency},t);throw me.get(Re).sendSilently(s),new Error(o)}if(t.isCartRecovery()){let o=ge.getCurrent().items,s=[];for(let a of i)for(let c of a.vars){if(!c.isAvailable)continue;let p=o.find(E=>E.variant_id.toString()===c.mID);if(!p)continue;let d=new Dt(a);d.name=p.title;let f=new Ur(c);f.name=p.variant_title,f.price.d=p.discounted_price/100,d.variants=[f],s.push(d)}return s}return i},C0=async(t,e)=>{await Promise.all(t.videos.map(async r=>{r.items=await Promise.all(r.items.map(async n=>{let i=await tv(n,e);return i||n}))}))},tv=async(t,e)=>{if(um.has(t.mID))return um.get(t.mID);let r,n=`/products/${t.slug}.js`;try{r=(await tn(n)).data}catch(i){return i instanceof en&&i.response?.status===404||ae(i,"fetch-shopify-product",{extra:{item:t,path:n},engagementTrigger:e}),null}return r?R0(t,r):(b.error("Item not found after AJAX call for:",t),null)},R0=(t,e)=>{if(!t||!e)return t;t.name=e.title,t.tags=e.tags,t.slug=e.handle;let r=t.selectedOrFirstVariant.value;return t.vars.map(n=>{let i=e.variants.find(o=>o.id===+n.mID);i!=null&&(n.name=i.title,n.isAvailable=i.available,n.price.d=i.price?i.price/100:i.price,n.price.effective=n.price.d,n.price.cmp=i.compare_at_price?i.compare_at_price/100:i.compare_at_price,+r.mID===i.id&&(r.effectivePrice.value=n.price.d))}),um.set(t.mID,t),t};var Fn=class{runtimeData=ve.get();backendAPIService=me.get(Pt);sessionManager=me.get(_t);constructor(){}async getAllContext(){let[e,r]=await Promise.all([hl(),this.sessionManager.checkSessionAndGetContext()]);return _(_({},e),r)}};var Re=class t extends Fn{static INSTANCE;constructor(){super()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}sendSafe(e){b.verbose(`Waiting for auth to send event ${e.name}`),Gr(_t.replaySubject).then(()=>this.sendSilently(e))}sendSilently(e){this.send(e).catch(r=>ae(r,"track-event",{extra:{event:e}}))}async send(e){if(b.verbose(`Sending event: ${e.name}`,e),this.shouldReject(e)){b.warn(`Rejecting event ${e.name}`);return}ev();let r=await this.getAllContext();Object.assign(e,r),e.name!=="CE App Background"&&this.runtimeData.setActive();let n=e.name.toLowerCase().replace(/\s+/g,"-");try{let i=await this.backendAPIService.post(`/v1/event/track/${n}`,e);b.info("\u2705 Event tracked:",this.userFriendlyName(e.name)),this.processEventResponse(e,i.data)}catch(i){throw b.error(`Error sending event ${e.name} to server`,i),i}}userFriendlyName(e){return e.replace("CE ","").replace("Trigger","Engagement").replace("Screen","Page").replace("App ","")}shouldReject(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(b.warn("Not sending event as this is a test trigger"),!0):!1}processEventResponse(e,r){this.renderWidgetIfAny(e,r).catch(n=>{ae(n,"process-popup-response",{extra:{event:e,response:r}})}),this.utiliseIntentIfCalculated(r)}async renderWidgetIfAny(e,r){if(!r.triggerData)return;let n=new xt(r.triggerData);n.occurred=e.occurred,b.log(`${n} will be shown`);let i;try{i=await Dl(n)}catch(o){b.error("Failed to refresh the products",o);return}if(n.items=i,n.contentSource===Mo.KLAVIYO){new Rl().render(n);return}new Un().renderEngagement(n).catch(o=>{ae(o,"render-popup",{extra:{event:e},engagementTrigger:n})})}utiliseIntentIfCalculated(e){e.intent&&(Io.trackIntent(e.intent),Al.trackIntent(e),b.info(`Intent is ${gi[e.intent]}`))}};var rv=new Jt,nv=new Jt;function iv(){return nv.asObservable()}function Nl(){rv.next()}var Ol=class{constructor(){rv.pipe(Tr(100)).subscribe(this.compareCartItems.bind(this))}listen(){Nl(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(n=>b.error("Unable to process cart change in XMLHttpRequest",n))}),r.apply(this,arguments)},b.verbose("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=function(n){return r.apply(window,arguments).then(i=>{let o="";try{o=typeof n=="string"||n instanceof URL?n.toString():n?.url??i?.url??""}catch{}return e.performEvent(o).catch(s=>b.error("Unable to process cart change in fetch",s)),i})},b.verbose("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&Nl()}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,r){let n=e?.items,i=r.items,o=[],s=[];if(b.verbose(`Comparing cart change with old count ${n?.length} to new count ${i.length}`),i?.forEach(a=>{let c=n?.find(p=>p.vID===a.vID);if(c){if(c.quantity!==a.quantity){let p=c.quantity<a.quantity,d=Math.abs(c.quantity-a.quantity),f=Z(_({},a),{quantity:d});p?o.push(f):s.push(f)}n&&Bh(n,c)}else o.push(a)}),n)for(let a of n)s.push(a);b.verbose(`Cart delta: added: ${o.length}, removed: ${s.length}`),o.length&&this.sendEvent("Add To Cart",{items:o}),s.length&&e.token===r.token&&this.sendEvent("Remove From Cart",{items:s}),(s.length||o.length)&&nv.next({itemsAdded:o,itemsRemoved:s,cart:r})}sendEvent(e,r){let n=new Ie(e,r);me.get(Re).sendSafe(n)}async compareCartItems(){let e=await Ye.get("cart",{}),r=await ge.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,r)}};var rt=class t{static cartDrawerToggle$=new Ss({open:!1,firstOpen:!1});static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Xe.get().website??{};currentState=!1;mutationSubscription;mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[t.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.addEventListener("click",this.clickEventListener,{capture:!0,passive:!0})}get element(){return this.cartDrawerElement}static get(){return t._instance||(t._instance=new t),t._instance}static forceUpdate(){t._instance?.destroy(),t._instance=new t}isOpen(){let e=this.inShadow?this.isPresent():cm(this.cartDrawerElement);return b.info(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(this.isOpen()){b.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent("letscooee:outbound:open-cart"));let e=document.querySelector(this.iconSelector);if(!e){b.verbose("No clickable cart icon found with selector",this.iconSelector);return}e.click()}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===t.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(e,r=!0){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(e)}catch(n){ae(n,"execute-cooeeUpdateCartDrawer")}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&e)this.element.classList.remove("is-empty"),this.element.renderContents?.(e);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let n=e.items[0].id,i=e.items[0].quantity,o=e.items[0].price;window.cartGiftUpdate(n,o,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer=="function")window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?ge.getCurrent().getNormalisedCart(!0).then(()=>{window.refreshCart(ge.getCurrent())}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,e?.items?.[0]?.id+""):(b.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent("letscooee:outbound:refresh-ui",{detail:{responseJSON:e,currentCart:ge.getCurrent()}})),r&&Nl()}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let r=e.split(":shadow");r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!ss())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await Fi(e),!this.cartDrawerElement){ov.default.warn("Max attempts exhausted to find cart drawer");return}b.verbose("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let r=(await Fi(this.shadowParentElementSelector))?.shadowRoot;r?.mode==="open"&&(this.cartDrawerShadowElement=r,this.createMutationObservers())}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle()}watchForCartToggle(){let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new Jt;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(e,{attributes:!0,subtree:!0,childList:this.inShadow}),this.mutationSubscription=r.pipe(im(800,void 0,{leading:!1,trailing:!0})).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,t.cartDrawerToggle$.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return!1;let e=this.cartDrawerShadowElement.querySelector(this.selector);return e?cm(e):!1}async updateBubble(){let e=(await ge.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=e+"")}manualCartIconClicked(e){!e.target.closest(this.iconSelector)||!e.isTrusted||window.CooeeSDK.events.push(["Open Cart"])}destroy(){document.removeEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.removeEventListener("click",this.clickEventListener,{capture:!0}),this.mutationSubscription?.unsubscribe(),this.mutationObserver?.disconnect()}};var Pl=class{static processConfiguration(){let e=Xe.get();!e.gaMeasurementID||!e.gaEnabled||this.sendClientID()}static async sendClientID(){let e=await this.getClientID();e&&Pt.getInstance().updateDevicePropsSafe({gaClientID:e})}static async getClientID(){let e=await Ye.get("gacid"),r=await this.getClientIDViaGTag();if(e!==r)return await Ye.set("gacid",r),r}static async getClientIDViaGTag(){let r=Xe.get().gaMeasurementID;if(!(!r||!window.gtag))return new Promise(n=>{window.gtag("get",r,"client_id",i=>{n(i)})})}};var Fe=class extends Br{stylesConverter=new wo(1);mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=zr()?"sm":"lg",this.clickExecutor=new dn(this.props.triggerContext)}getCompiledStyles(){return this.putStyleAccordingToDevice(),_(_(Z(_(_(_(_(_(_({},this.stylesConverter.getFlexStyles(this.mediaStyle.flex)),this.stylesConverter.getBackgroundStyles(this.mediaStyle.bg)),this.stylesConverter.getBorderStyles(this.mediaStyle.br)),this.stylesConverter.getSizeStyles(this.mediaStyle.size)),this.stylesConverter.getSpaceStyles(this.mediaStyle.spc)),this.stylesConverter.getLayoutStyles(this.mediaStyle.lout)),{boxSizing:"border-box",outline:"none"}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return!0;let{lhs:r,rhs:n}=e;switch(e.op){case"eq":return r===n;case"gt":return+r>+n;case"gte":return+r>=+n;case"lt":return+r<+n;case"lte":return+r<=+n;case"ne":return r!==n;case"null":return r==null;case"empty":return r.trim()==="";case"in":return new RegExp(`\\b${n}\\b`).test(r);case"nin":return!new RegExp(`\\b${n}\\b`).test(r);default:return b.error(`Invalid operator found for when condition - ${e.op}`),!1}}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,zr()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=_(_({},this.mediaStyle),e.style.sm))}sendTriggerClicked(e,r){this.clickExecutor.sendTriggerClicked(e,r)}async onClick(e,r){e.stopPropagation(),r.clickAction||(r.clickAction=this.props.element.clc),r.clickAction?.at&&await this.clickExecutor.execute(r)}};var A0=0,UW=Array.isArray;function K(t,e,r,n,i,o){e||(e={});var s,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?s=e[a]:c[a]=e[a];var p={type:t,props:c,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--A0,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return xe.vnode&&xe.vnode(p),p}var Qt=class extends Fe{componentDidMount(){this.setState(()=>({text:this.props.element.text})),Tt(this.onChange.bind(this))}componentWillReceiveProps(e){this.props.element=e.element,this.onChange()}render(){let e=this.getCompiledStyles(),r=this.state.text;return r||(e.display="none",r=""),K("div",{style:e,onClick:this.customOnClick.bind(this),className:"lc-text",children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:r}})})}customOnClick(){this.props.onClick&&this.props.onClick("title")}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,r={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},n=Zn(this.props.element,r,this.props.triggerContext),i=new vt(n);if(!this.matchWhenCondition(i.when)){this.setState(()=>({text:""}));return}this.setState(()=>({text:i.text}))}getTypoStyles(){let e={},r=this.mediaStyle.typo??new lt;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily=r.fam.name||"inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,e.textDecoration=r.td??"none",this.stylesConverter.getColourStyles(r.tc,"color",e),e}getComponentStyles(){return _({},this.getTypoStyles())}getSpanStyle(){return{overflow:"hidden",display:"-webkit-box",webkitBoxOrient:"vertical",webkitLineClamp:2,color:"inherit",fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit"}}};var vi=class extends Qt{render(){return K("div",{style:this.getCompiledStyles(),className:"lc-button",onClick:e=>this.onClick(e,{item:this.props.item}),children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return Z(_({},super.getComponentStyles()),{cursor:"pointer"})}};var pm=class extends Br{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos==="end"?K("div",{style:_(_({},this.getElementStyle()),this.props.styles),children:[K("span",{children:this.props.time}),K("span",{style:this.getTimeLabelStyle(),children:this.props.label})]}):K("div",{style:_(_({},this.getElementStyle()),this.props.styles),children:[K("span",{style:this.getTimeLabelStyle(),children:this.props.label}),K("span",{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return{fontSize:"0.5em",alignContent:"center"}}getElementStyle(){let e={display:"flex",flexDirection:"column",placeContent:"center center",textAlign:"center"};return this.props.element.horizontal&&(e.gridTemplateColumns="repeat(2, minmax(0, 1fr))"),e}},Bs=class extends Qt{labels={Days:"00",Hours:"00",Minutes:"00",Seconds:"00"};componentWillMount(){super.componentWillMount(),this.setState(()=>_({},this.labels)),this.processAndStartTimer()}render(){return K("div",{style:this.getLabelsParentStyle(),children:Object.keys(this.labels).map(e=>K(pm,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return{display:"grid",justifyContent:"center",gridTemplateColumns:"repeat(4, auto)",gap:this.stylesConverter.getSizePx(this.props.element.gap)}}getDisplayStyles(){return{display:"grid",placeContent:"center center"}}getComponentStyles(){return _(_({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,"0"),this.labels.Hours=String(e.hours).padStart(2,"0"),this.labels.Minutes=String(e.minutes).padStart(2,"0"),this.labels.Seconds=String(e.seconds).padStart(2,"0"),this.setState(()=>_({},this.labels))})}};function Ll(t,e){if(!t)return;let r={loop:!0,slidesPerView:e.maxInRow,spaceBetween:e.gap+"px",pagination:{type:e.pagination.type,el:t.querySelector(".swiper-pagination"),clickable:!0,renderBullet:(i,o)=>`
|
|
61
61
|
<span class="${o}"
|
|
62
62
|
style="background-color: ${e.pagination.color?.rgba};"></span>
|
|
63
63
|
`,renderProgressbar:i=>`
|