wineater-bot 4.9.5 → 4.9.7
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/wineater-chatbot.mjs +2779 -2729
- package/dist/wineater-chatbot.umd.js +37 -24
- package/package.json +1 -1
- package/src/components/Header.svelte +32 -3
- package/src/services/ui-config/projects-config 2.ts +72 -0
- package/src/services/ui-config/projects-config.ts +16 -2
- package/src/services/ui-config/types.ts +1 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(function(ne,ie){typeof exports=="object"&&typeof module<"u"?module.exports=ie():typeof define=="function"&&define.amd?define(ie):(ne=typeof globalThis<"u"?globalThis:ne||self,ne.WineaterChatbot=ie())})(this,function(){"use strict";var Sp=Object.defineProperty;var fl=ne=>{throw TypeError(ne)};var _p=(ne,ie,we)=>ie in ne?Sp(ne,ie,{enumerable:!0,configurable:!0,writable:!0,value:we}):ne[ie]=we;var wt=(ne,ie,we)=>_p(ne,typeof ie!="symbol"?ie+"":ie,we),Tr=(ne,ie,we)=>ie.has(ne)||fl("Cannot "+we);var v=(ne,ie,we)=>(Tr(ne,ie,"read from private field"),we?we.call(ne):ie.get(ne)),U=(ne,ie,we)=>ie.has(ne)?fl("Cannot add the same private member more than once"):ie instanceof WeakSet?ie.add(ne):ie.set(ne,we),F=(ne,ie,we,fs)=>(Tr(ne,ie,"write to private field"),fs?fs.call(ne,we):ie.set(ne,we),we),ke=(ne,ie,we)=>(Tr(ne,ie,"access private method"),we);var al,An,Pn,cn,Ln,ls,Bn,Ht,gt,Fn,ze,xr,Er,Ir,pl,Qe,_r,mt,un,Ae,vt,je,rt,Et,hn,qt,Wn,zn,jn,It,$s,ye,kp,Tp,xp,Cr,si,ii,Nr,ll,ot,bt,Ue,dn,cs,us,ei,Un,fn,Hn,cl,ul;const ne="5";typeof window<"u"&&((al=window.__svelte??(window.__svelte={})).v??(al.v=new Set)).add(ne);const ie=1,we=2,fs=16,gl=1,ml=2,vl=4,bl=8,wl=16,yl=1,Sl=2,Te=Symbol(),Rr="http://www.w3.org/1999/xhtml",ri=!1;var oi=Array.isArray,_l=Array.prototype.indexOf,gn=Array.prototype.includes,ps=Array.from,kl=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,Tl=Object.getOwnPropertyDescriptors,xl=Object.prototype,El=Array.prototype,Dr=Object.getPrototypeOf,Or=Object.isExtensible;const Il=()=>{};function Cl(t){for(var e=0;e<t.length;e++)t[e]()}function Mr(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const xe=2,qn=4,gs=8,Ar=1<<24,yt=16,$e=32,Gt=64,ai=128,qe=512,_e=1024,Ee=2048,et=4096,Be=8192,St=16384,Kt=32768,Xt=65536,Pr=1<<17,Lr=1<<18,vn=1<<19,Nl=1<<20,Ct=1<<25,Yt=65536,li=1<<21,ci=1<<22,Nt=1<<23,Jt=Symbol("$state"),Rl=Symbol("legacy props"),Dl=Symbol(""),Qt=new class extends Error{constructor(){super(...arguments);wt(this,"name","StaleReactionError");wt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Ol(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ml(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Al(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Pl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ll(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Bl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Fl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Wl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function zl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function jl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ul(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Hl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function ql(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Vl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Br(t){return t===this.v}function Gl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Fr(t){return!Gl(t,this.v)}let bn=!1,Kl=!1;function Xl(){bn=!0}let me=null;function wn(t){me=t}function Rt(t,e=!1,n){me={p:me,i:!1,c:null,e:null,s:t,x:null,l:bn&&!e?{s:null,u:null,$:[]}:null}}function Dt(t){var e=me,n=e.e;if(n!==null){e.e=null;for(var s of n)ao(s)}return t!==void 0&&(e.x=t),e.i=!0,me=e.p,t??{}}function Vn(){return!bn||me!==null&&me.l===null}let Zt=[];function Wr(){var t=Zt;Zt=[],Cl(t)}function Ot(t){if(Zt.length===0&&!Gn){var e=Zt;queueMicrotask(()=>{e===Zt&&Wr()})}Zt.push(t)}function Yl(){for(;Zt.length>0;)Wr()}function zr(t){var e=Q;if(e===null)return H.f|=Nt,t;if(!(e.f&Kt)&&!(e.f&qn))throw t;Mt(t,e)}function Mt(t,e){for(;e!==null;){if(e.f&ai){if(!(e.f&Kt))throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Jl=-7169;function fe(t,e){t.f=t.f&Jl|e}function ui(t){t.f&qe||t.deps===null?fe(t,_e):fe(t,et)}function jr(t){if(t!==null)for(const e of t)!(e.f&xe)||!(e.f&Yt)||(e.f^=Yt,jr(e.deps))}function Ur(t,e,n){t.f&Ee?e.add(t):t.f&et&&n.add(t),jr(t.deps),fe(t,_e)}const ms=new Set;let W=null,hi=null,Ie=null,Re=[],vs=null,di=!1,Gn=!1;const Sr=class Sr{constructor(){U(this,ze);wt(this,"current",new Map);wt(this,"previous",new Map);U(this,An,new Set);U(this,Pn,new Set);U(this,cn,0);U(this,Ln,0);U(this,ls,null);U(this,Bn,new Set);U(this,Ht,new Set);U(this,gt,new Map);wt(this,"is_fork",!1);U(this,Fn,!1)}skip_effect(e){v(this,gt).has(e)||v(this,gt).set(e,{d:[],m:[]})}unskip_effect(e){var n=v(this,gt).get(e);if(n){v(this,gt).delete(e);for(var s of n.d)fe(s,Ee),nt(s);for(s of n.m)fe(s,et),nt(s)}}process(e){var i;Re=[],this.apply();var n=[],s=[];for(const r of e)ke(this,ze,Er).call(this,r,n,s);if(ke(this,ze,xr).call(this)){ke(this,ze,Ir).call(this,s),ke(this,ze,Ir).call(this,n);for(const[r,o]of v(this,gt))Kr(r,o)}else{for(const r of v(this,An))r();v(this,An).clear(),v(this,cn)===0&&ke(this,ze,pl).call(this),hi=this,W=null,qr(s),qr(n),v(this,Bn).clear(),v(this,Ht).clear(),hi=null,(i=v(this,ls))==null||i.resolve()}Ie=null}capture(e,n){n!==Te&&!this.previous.has(e)&&this.previous.set(e,n),e.f&Nt||(this.current.set(e,e.v),Ie==null||Ie.set(e,e.v))}activate(){W=this,this.apply()}deactivate(){W===this&&(W=null,Ie=null)}flush(){if(this.activate(),Re.length>0){if(Hr(),W!==null&&W!==this)return}else v(this,cn)===0&&this.process([]);this.deactivate()}discard(){for(const e of v(this,Pn))e(this);v(this,Pn).clear()}increment(e){F(this,cn,v(this,cn)+1),e&&F(this,Ln,v(this,Ln)+1)}decrement(e){F(this,cn,v(this,cn)-1),e&&F(this,Ln,v(this,Ln)-1),!v(this,Fn)&&(F(this,Fn,!0),Ot(()=>{F(this,Fn,!1),ke(this,ze,xr).call(this)?Re.length>0&&this.flush():this.revive()}))}revive(){for(const e of v(this,Bn))v(this,Ht).delete(e),fe(e,Ee),nt(e);for(const e of v(this,Ht))fe(e,et),nt(e);this.flush()}oncommit(e){v(this,An).add(e)}ondiscard(e){v(this,Pn).add(e)}settled(){return(v(this,ls)??F(this,ls,Mr())).promise}static ensure(){if(W===null){const e=W=new Sr;ms.add(W),Gn||Ot(()=>{W===e&&e.flush()})}return W}apply(){}};An=new WeakMap,Pn=new WeakMap,cn=new WeakMap,Ln=new WeakMap,ls=new WeakMap,Bn=new WeakMap,Ht=new WeakMap,gt=new WeakMap,Fn=new WeakMap,ze=new WeakSet,xr=function(){return this.is_fork||v(this,Ln)>0},Er=function(e,n,s){e.f^=_e;for(var i=e.first;i!==null;){var r=i.f,o=(r&($e|Gt))!==0,a=o&&(r&_e)!==0,c=a||(r&Be)!==0||v(this,gt).has(i);if(!c&&i.fn!==null){o?i.f^=_e:r&qn?n.push(i):Jn(i)&&(r&yt&&v(this,Ht).add(i),_n(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var l=i.next;if(l!==null){i=l;break}i=i.parent}}},Ir=function(e){for(var n=0;n<e.length;n+=1)Ur(e[n],v(this,Bn),v(this,Ht))},pl=function(){var i;if(ms.size>1){this.previous.clear();var e=Ie,n=!0;for(const r of ms){if(r===this){n=!1;continue}const o=[];for(const[c,u]of this.current){if(r.current.has(c))if(n&&u!==r.current.get(c))r.current.set(c,u);else continue;o.push(c)}if(o.length===0)continue;const a=[...r.current.keys()].filter(c=>!this.current.has(c));if(a.length>0){var s=Re;Re=[];const c=new Set,u=new Map;for(const l of o)Vr(l,a,c,u);if(Re.length>0){W=r,r.apply();for(const l of Re)ke(i=r,ze,Er).call(i,l,[],[]);r.deactivate()}Re=s}}W=null,Ie=e}v(this,gt).clear(),ms.delete(this)};let At=Sr;function Ql(t){var e=Gn;Gn=!0;try{for(var n;;){if(Yl(),Re.length===0&&(W==null||W.flush(),Re.length===0))return vs=null,n;Hr()}}finally{Gn=e}}function Hr(){di=!0;var t=null;try{for(var e=0;Re.length>0;){var n=At.ensure();if(e++>1e3){var s,i;Zl()}n.process(Re),Pt.clear()}}finally{Re=[],di=!1,vs=null}}function Zl(){try{Fl()}catch(t){Mt(t,vs)}}let tt=null;function qr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(St|Be))&&Jn(s)&&(tt=new Set,_n(s),s.deps===null&&s.first===null&&s.nodes===null&&s.teardown===null&&s.ac===null&&uo(s),(tt==null?void 0:tt.size)>0)){Pt.clear();for(const i of tt){if(i.f&(St|Be))continue;const r=[i];let o=i.parent;for(;o!==null;)tt.has(o)&&(tt.delete(o),r.push(o)),o=o.parent;for(let a=r.length-1;a>=0;a--){const c=r[a];c.f&(St|Be)||_n(c)}}tt.clear()}}tt=null}}function Vr(t,e,n,s){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const i of t.reactions){const r=i.f;r&xe?Vr(i,e,n,s):r&(ci|yt)&&!(r&Ee)&&Gr(i,e,s)&&(fe(i,Ee),nt(i))}}function Gr(t,e,n){const s=n.get(t);if(s!==void 0)return s;if(t.deps!==null)for(const i of t.deps){if(gn.call(e,i))return!0;if(i.f&xe&&Gr(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function nt(t){var e=vs=t,n=e.b;if(n!=null&&n.is_pending&&t.f&(qn|gs|Ar)&&!(t.f&Kt)){n.defer_effect(t);return}for(;e.parent!==null;){e=e.parent;var s=e.f;if(di&&e===Q&&s&yt&&!(s&Lr)&&s&Kt)return;if(s&(Gt|$e)){if(!(s&_e))return;e.f^=_e}}Re.push(e)}function Kr(t,e){if(!(t.f&$e&&t.f&_e)){t.f&Ee?e.d.push(t):t.f&et&&e.m.push(t),fe(t,_e);for(var n=t.first;n!==null;)Kr(n,e),n=n.next}}function $l(t){let e=0,n=$t(0),s;return()=>{vi()&&(b(n),wi(()=>(e===0&&(s=Zn(()=>t(()=>Kn(n)))),e+=1,()=>{Ot(()=>{e-=1,e===0&&(s==null||s(),s=void 0,Kn(n))})})))}}var ec=Xt|vn;function tc(t,e,n,s){new nc(t,e,n,s)}class nc{constructor(e,n,s,i){U(this,ye);wt(this,"parent");wt(this,"is_pending",!1);wt(this,"transform_error");U(this,Qe);U(this,_r,null);U(this,mt);U(this,un);U(this,Ae);U(this,vt,null);U(this,je,null);U(this,rt,null);U(this,Et,null);U(this,hn,0);U(this,qt,0);U(this,Wn,!1);U(this,zn,new Set);U(this,jn,new Set);U(this,It,null);U(this,$s,$l(()=>(F(this,It,$t(v(this,hn))),()=>{F(this,It,null)})));var r;F(this,Qe,e),F(this,mt,n),F(this,un,o=>{var a=Q;a.b=this,a.f|=ai,s(o)}),this.parent=Q.b,this.transform_error=i??((r=this.parent)==null?void 0:r.transform_error)??(o=>o),F(this,Ae,Ss(()=>{ke(this,ye,Cr).call(this)},ec))}defer_effect(e){Ur(e,v(this,zn),v(this,jn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!v(this,mt).pending}update_pending_count(e){ke(this,ye,Nr).call(this,e),F(this,hn,v(this,hn)+e),!(!v(this,It)||v(this,Wn))&&(F(this,Wn,!0),Ot(()=>{F(this,Wn,!1),v(this,It)&&yn(v(this,It),v(this,hn))}))}get_effect_pending(){return v(this,$s).call(this),b(v(this,It))}error(e){var n=v(this,mt).onerror;let s=v(this,mt).failed;if(!n&&!s)throw e;v(this,vt)&&(De(v(this,vt)),F(this,vt,null)),v(this,je)&&(De(v(this,je)),F(this,je,null)),v(this,rt)&&(De(v(this,rt)),F(this,rt,null));var i=!1,r=!1;const o=()=>{if(i){Vl();return}i=!0,r&&Hl(),v(this,rt)!==null&&en(v(this,rt),()=>{F(this,rt,null)}),ke(this,ye,ii).call(this,()=>{At.ensure(),ke(this,ye,Cr).call(this)})},a=c=>{try{r=!0,n==null||n(c,o),r=!1}catch(u){Mt(u,v(this,Ae)&&v(this,Ae).parent)}s&&F(this,rt,ke(this,ye,ii).call(this,()=>{At.ensure();try{return Ve(()=>{var u=Q;u.b=this,u.f|=ai,s(v(this,Qe),()=>c,()=>o)})}catch(u){return Mt(u,v(this,Ae).parent),null}}))};Ot(()=>{var c;try{c=this.transform_error(e)}catch(u){Mt(u,v(this,Ae)&&v(this,Ae).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(a,u=>Mt(u,v(this,Ae)&&v(this,Ae).parent)):a(c)})}}Qe=new WeakMap,_r=new WeakMap,mt=new WeakMap,un=new WeakMap,Ae=new WeakMap,vt=new WeakMap,je=new WeakMap,rt=new WeakMap,Et=new WeakMap,hn=new WeakMap,qt=new WeakMap,Wn=new WeakMap,zn=new WeakMap,jn=new WeakMap,It=new WeakMap,$s=new WeakMap,ye=new WeakSet,kp=function(){try{F(this,vt,Ve(()=>v(this,un).call(this,v(this,Qe))))}catch(e){this.error(e)}},Tp=function(e){const n=v(this,mt).failed;n&&F(this,rt,Ve(()=>{n(v(this,Qe),()=>e,()=>()=>{})}))},xp=function(){const e=v(this,mt).pending;e&&(this.is_pending=!0,F(this,je,Ve(()=>e(v(this,Qe)))),Ot(()=>{var n=F(this,Et,document.createDocumentFragment()),s=_t();n.append(s),F(this,vt,ke(this,ye,ii).call(this,()=>(At.ensure(),Ve(()=>v(this,un).call(this,s))))),v(this,qt)===0&&(v(this,Qe).before(n),F(this,Et,null),en(v(this,je),()=>{F(this,je,null)}),ke(this,ye,si).call(this))}))},Cr=function(){try{if(this.is_pending=this.has_pending_snippet(),F(this,qt,0),F(this,hn,0),F(this,vt,Ve(()=>{v(this,un).call(this,v(this,Qe))})),v(this,qt)>0){var e=F(this,Et,document.createDocumentFragment());po(v(this,vt),e);const n=v(this,mt).pending;F(this,je,Ve(()=>n(v(this,Qe))))}else ke(this,ye,si).call(this)}catch(n){this.error(n)}},si=function(){this.is_pending=!1;for(const e of v(this,zn))fe(e,Ee),nt(e);for(const e of v(this,jn))fe(e,et),nt(e);v(this,zn).clear(),v(this,jn).clear()},ii=function(e){var n=Q,s=H,i=me;lt(v(this,Ae)),Ge(v(this,Ae)),wn(v(this,Ae).ctx);try{return e()}catch(r){return zr(r),null}finally{lt(n),Ge(s),wn(i)}},Nr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&ke(n=this.parent,ye,Nr).call(n,e);return}F(this,qt,v(this,qt)+e),v(this,qt)===0&&(ke(this,ye,si).call(this),v(this,je)&&en(v(this,je),()=>{F(this,je,null)}),v(this,Et)&&(v(this,Qe).before(v(this,Et)),F(this,Et,null)))};function sc(t,e,n,s){const i=Vn()?bs:pi;var r=t.filter(h=>!h.settled);if(n.length===0&&r.length===0){s(e.map(i));return}var o=Q,a=ic(),c=r.length===1?r[0].promise:r.length>1?Promise.all(r.map(h=>h.promise)):null;function u(h){a();try{s(h)}catch(d){o.f&St||Mt(d,o)}fi()}if(n.length===0){c.then(()=>u(e.map(i)));return}function l(){a(),Promise.all(n.map(h=>oc(h))).then(h=>u([...e.map(i),...h])).catch(h=>Mt(h,o))}c?c.then(l):l()}function ic(){var t=Q,e=H,n=me,s=W;return function(r=!0){lt(t),Ge(e),wn(n),r&&(s==null||s.activate())}}function fi(t=!0){lt(null),Ge(null),wn(null),t&&(W==null||W.deactivate())}function rc(){var t=Q.b,e=W,n=t.is_rendered();return t.update_pending_count(1),e.increment(n),()=>{t.update_pending_count(-1),e.decrement(n)}}function bs(t){var e=xe|Ee,n=H!==null&&H.f&xe?H:null;return Q!==null&&(Q.f|=vn),{ctx:me,deps:null,effects:null,equals:Br,f:e,fn:t,reactions:null,rv:0,v:Te,wv:0,parent:n??Q,ac:null}}function oc(t,e,n){Q===null&&Ml();var i=void 0,r=$t(Te),o=!H,a=new Map;return yc(()=>{var d;var c=Mr();i=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).finally(fi)}catch(p){c.reject(p),fi()}var u=W;if(o){var l=rc();(d=a.get(u))==null||d.reject(Qt),a.delete(u),a.set(u,c)}const h=(p,f=void 0)=>{if(u.activate(),f)f!==Qt&&(r.f|=Nt,yn(r,f));else{r.f&Nt&&(r.f^=Nt),yn(r,p);for(const[m,y]of a){if(a.delete(m),m===u)break;y.reject(Qt)}}l&&l()};c.promise.then(h,p=>h(null,p||"unknown"))}),bi(()=>{for(const c of a.values())c.reject(Qt)}),new Promise(c=>{function u(l){function h(){l===i?c(r):u(i)}l.then(h,h)}u(i)})}function ae(t){const e=bs(t);return mo(e),e}function pi(t){const e=bs(t);return e.equals=Fr,e}function ac(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)De(e[n])}}function lc(t){for(var e=t.parent;e!==null;){if(!(e.f&xe))return e.f&St?null:e;e=e.parent}return null}function gi(t){var e,n=Q;lt(lc(t));try{t.f&=~Yt,ac(t),e=So(t)}finally{lt(n)}return e}function Xr(t){var e=gi(t);if(!t.equals(e)&&(t.wv=wo(),(!(W!=null&&W.is_fork)||t.deps===null)&&(t.v=e,t.deps===null))){fe(t,_e);return}Lt||(Ie!==null?(vi()||W!=null&&W.is_fork)&&Ie.set(t,e):ui(t))}function cc(t){var e,n;if(t.effects!==null)for(const s of t.effects)(s.teardown||s.ac)&&((e=s.teardown)==null||e.call(s),(n=s.ac)==null||n.abort(Qt),s.teardown=Il,s.ac=null,Qn(s,0),yi(s))}function Yr(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&_n(e)}let mi=new Set;const Pt=new Map;let Jr=!1;function $t(t,e){var n={f:0,v:t,reactions:null,equals:Br,rv:0,wv:0};return n}function le(t,e){const n=$t(t);return mo(n),n}function uc(t,e=!1,n=!0){var i;const s=$t(t);return e||(s.equals=Fr),bn&&n&&me!==null&&me.l!==null&&((i=me.l).s??(i.s=[])).push(s),s}function D(t,e,n=!1){H!==null&&(!st||H.f&Pr)&&Vn()&&H.f&(xe|yt|ci|Pr)&&(Ke===null||!gn.call(Ke,t))&&Ul();let s=n?at(e):e;return yn(t,s)}function yn(t,e){if(!t.equals(e)){var n=t.v;Lt?Pt.set(t,e):Pt.set(t,n),t.v=e;var s=At.ensure();if(s.capture(t,n),t.f&xe){const i=t;t.f&Ee&&gi(i),ui(i)}t.wv=wo(),Zr(t,Ee),Vn()&&Q!==null&&Q.f&_e&&!(Q.f&($e|Gt))&&(Xe===null?kc([t]):Xe.push(t)),!s.is_fork&&mi.size>0&&!Jr&&hc()}return e}function hc(){Jr=!1;for(const t of mi)t.f&_e&&fe(t,et),Jn(t)&&_n(t);mi.clear()}function Qr(t,e=1){var n=b(t),s=e===1?n++:n--;return D(t,n),s}function Kn(t){D(t,t.v+1)}function Zr(t,e){var n=t.reactions;if(n!==null)for(var s=Vn(),i=n.length,r=0;r<i;r++){var o=n[r],a=o.f;if(!(!s&&o===Q)){var c=(a&Ee)===0;if(c&&fe(o,e),a&xe){var u=o;Ie==null||Ie.delete(u),a&Yt||(a&qe&&(o.f|=Yt),Zr(u,et))}else c&&(a&yt&&tt!==null&&tt.add(o),nt(o))}}}function at(t){if(typeof t!="object"||t===null||Jt in t)return t;const e=Dr(t);if(e!==xl&&e!==El)return t;var n=new Map,s=oi(t),i=le(0),r=nn,o=a=>{if(nn===r)return a();var c=H,u=nn;Ge(null),bo(r);var l=a();return Ge(c),bo(u),l};return s&&n.set("length",le(t.length)),new Proxy(t,{defineProperty(a,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&zl();var l=n.get(c);return l===void 0?o(()=>{var h=le(u.value);return n.set(c,h),h}):D(l,u.value,!0),!0},deleteProperty(a,c){var u=n.get(c);if(u===void 0){if(c in a){const l=o(()=>le(Te));n.set(c,l),Kn(i)}}else D(u,Te),Kn(i);return!0},get(a,c,u){var p;if(c===Jt)return t;var l=n.get(c),h=c in a;if(l===void 0&&(!h||(p=mn(a,c))!=null&&p.writable)&&(l=o(()=>{var f=at(h?a[c]:Te),m=le(f);return m}),n.set(c,l)),l!==void 0){var d=b(l);return d===Te?void 0:d}return Reflect.get(a,c,u)},getOwnPropertyDescriptor(a,c){var u=Reflect.getOwnPropertyDescriptor(a,c);if(u&&"value"in u){var l=n.get(c);l&&(u.value=b(l))}else if(u===void 0){var h=n.get(c),d=h==null?void 0:h.v;if(h!==void 0&&d!==Te)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(a,c){var d;if(c===Jt)return!0;var u=n.get(c),l=u!==void 0&&u.v!==Te||Reflect.has(a,c);if(u!==void 0||Q!==null&&(!l||(d=mn(a,c))!=null&&d.writable)){u===void 0&&(u=o(()=>{var p=l?at(a[c]):Te,f=le(p);return f}),n.set(c,u));var h=b(u);if(h===Te)return!1}return l},set(a,c,u,l){var x;var h=n.get(c),d=c in a;if(s&&c==="length")for(var p=u;p<h.v;p+=1){var f=n.get(p+"");f!==void 0?D(f,Te):p in a&&(f=o(()=>le(Te)),n.set(p+"",f))}if(h===void 0)(!d||(x=mn(a,c))!=null&&x.writable)&&(h=o(()=>le(void 0)),D(h,at(u)),n.set(c,h));else{d=h.v!==Te;var m=o(()=>at(u));D(h,m)}var y=Reflect.getOwnPropertyDescriptor(a,c);if(y!=null&&y.set&&y.set.call(l,u),!d){if(s&&typeof c=="string"){var S=n.get("length"),_=Number(c);Number.isInteger(_)&&_>=S.v&&D(S,_+1)}Kn(i)}return!0},ownKeys(a){b(i);var c=Reflect.ownKeys(a).filter(h=>{var d=n.get(h);return d===void 0||d.v!==Te});for(var[u,l]of n)l.v!==Te&&!(u in a)&&c.push(u);return c},setPrototypeOf(){jl()}})}function $r(t){try{if(t!==null&&typeof t=="object"&&Jt in t)return t[Jt]}catch{}return t}function dc(t,e){return Object.is($r(t),$r(e))}var eo,to,no,so;function fc(){if(eo===void 0){eo=window,to=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;no=mn(e,"firstChild").get,so=mn(e,"nextSibling").get,Or(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Or(n)&&(n.__t=void 0)}}function _t(t=""){return document.createTextNode(t)}function Sn(t){return no.call(t)}function Xn(t){return so.call(t)}function M(t,e){return Sn(t)}function ws(t,e=!1){{var n=Sn(t);return n instanceof Comment&&n.data===""?Xn(n):n}}function V(t,e=1,n=!1){let s=t;for(;e--;)s=Xn(s);return s}function pc(t){t.textContent=""}function io(){return!1}function ro(t,e,n){return document.createElementNS(Rr,t,void 0)}let oo=!1;function gc(){oo||(oo=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function ys(t){var e=H,n=Q;Ge(null),lt(null);try{return t()}finally{Ge(e),lt(n)}}function mc(t,e,n,s=n){t.addEventListener(e,()=>ys(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),gc()}function vc(t){Q===null&&(H===null&&Bl(),Ll()),Lt&&Pl()}function bc(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function kt(t,e,n){var s=Q;s!==null&&s.f&Be&&(t|=Be);var i={ctx:me,deps:null,nodes:null,f:t|Ee|qe,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{_n(i)}catch(a){throw De(i),a}else e!==null&&nt(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&!(r.f&vn)&&(r=r.first,t&yt&&t&Xt&&r!==null&&(r.f|=Xt)),r!==null&&(r.parent=s,s!==null&&bc(r,s),H!==null&&H.f&xe&&!(t&Gt))){var o=H;(o.effects??(o.effects=[])).push(r)}return i}function vi(){return H!==null&&!st}function bi(t){const e=kt(gs,null,!1);return fe(e,_e),e.teardown=t,e}function Yn(t){vc();var e=Q.f,n=!H&&(e&$e)!==0&&(e&Kt)===0;if(n){var s=me;(s.e??(s.e=[])).push(t)}else return ao(t)}function ao(t){return kt(qn|Nl,t,!1)}function wc(t){At.ensure();const e=kt(Gt|vn,t,!0);return(n={})=>new Promise(s=>{n.outro?en(e,()=>{De(e),s(void 0)}):(De(e),s(void 0))})}function lo(t){return kt(qn,t,!1)}function yc(t){return kt(ci|vn,t,!0)}function wi(t,e=0){return kt(gs|e,t,!0)}function X(t,e=[],n=[],s=[]){sc(s,e,n,i=>{kt(gs,()=>t(...i.map(b)),!0)})}function Ss(t,e=0){var n=kt(yt|e,t,!0);return n}function Ve(t){return kt($e|vn,t,!0)}function co(t){var e=t.teardown;if(e!==null){const n=Lt,s=H;go(!0),Ge(null);try{e.call(null)}finally{go(n),Ge(s)}}}function yi(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&ys(()=>{i.abort(Qt)});var s=n.next;n.f&Gt?n.parent=null:De(n,e),n=s}}function Sc(t){for(var e=t.first;e!==null;){var n=e.next;e.f&$e||De(e),e=n}}function De(t,e=!0){var n=!1;(e||t.f&Lr)&&t.nodes!==null&&t.nodes.end!==null&&(_c(t.nodes.start,t.nodes.end),n=!0),yi(t,e&&!n),Qn(t,0),fe(t,St);var s=t.nodes&&t.nodes.t;if(s!==null)for(const r of s)r.stop();co(t);var i=t.parent;i!==null&&i.first!==null&&uo(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function _c(t,e){for(;t!==null;){var n=t===e?null:Xn(t);t.remove(),t=n}}function uo(t){var e=t.parent,n=t.prev,s=t.next;n!==null&&(n.next=s),s!==null&&(s.prev=n),e!==null&&(e.first===t&&(e.first=s),e.last===t&&(e.last=n))}function en(t,e,n=!0){var s=[];ho(t,s,!0);var i=()=>{n&&De(t),e&&e()},r=s.length;if(r>0){var o=()=>--r||i();for(var a of s)a.out(o)}else i()}function ho(t,e,n){if(!(t.f&Be)){t.f^=Be;var s=t.nodes&&t.nodes.t;if(s!==null)for(const a of s)(a.is_global||n)&&e.push(a);for(var i=t.first;i!==null;){var r=i.next,o=(i.f&Xt)!==0||(i.f&$e)!==0&&(t.f&yt)!==0;ho(i,e,o?n:!1),i=r}}}function Si(t){fo(t,!0)}function fo(t,e){if(t.f&Be){t.f^=Be,t.f&_e||(fe(t,Ee),nt(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Xt)!==0||(n.f&$e)!==0;fo(n,i?e:!1),n=s}var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||e)&&o.in()}}function po(t,e){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end;n!==null;){var i=n===s?null:Xn(n);e.append(n),n=i}}let _s=!1,Lt=!1;function go(t){Lt=t}let H=null,st=!1;function Ge(t){H=t}let Q=null;function lt(t){Q=t}let Ke=null;function mo(t){H!==null&&(Ke===null?Ke=[t]:Ke.push(t))}let Oe=null,Fe=0,Xe=null;function kc(t){Xe=t}let vo=1,tn=0,nn=tn;function bo(t){nn=t}function wo(){return++vo}function Jn(t){var e=t.f;if(e&Ee)return!0;if(e&xe&&(t.f&=~Yt),e&et){for(var n=t.deps,s=n.length,i=0;i<s;i++){var r=n[i];if(Jn(r)&&Xr(r),r.wv>t.wv)return!0}e&qe&&Ie===null&&fe(t,_e)}return!1}function yo(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Ke!==null&&gn.call(Ke,t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&xe?yo(r,e,!1):e===r&&(n?fe(r,Ee):r.f&_e&&fe(r,et),nt(r))}}function So(t){var m;var e=Oe,n=Fe,s=Xe,i=H,r=Ke,o=me,a=st,c=nn,u=t.f;Oe=null,Fe=0,Xe=null,H=u&($e|Gt)?null:t,Ke=null,wn(t.ctx),st=!1,nn=++tn,t.ac!==null&&(ys(()=>{t.ac.abort(Qt)}),t.ac=null);try{t.f|=li;var l=t.fn,h=l();t.f|=Kt;var d=t.deps,p=W==null?void 0:W.is_fork;if(Oe!==null){var f;if(p||Qn(t,Fe),d!==null&&Fe>0)for(d.length=Fe+Oe.length,f=0;f<Oe.length;f++)d[Fe+f]=Oe[f];else t.deps=d=Oe;if(vi()&&t.f&qe)for(f=Fe;f<d.length;f++)((m=d[f]).reactions??(m.reactions=[])).push(t)}else!p&&d!==null&&Fe<d.length&&(Qn(t,Fe),d.length=Fe);if(Vn()&&Xe!==null&&!st&&d!==null&&!(t.f&(xe|et|Ee)))for(f=0;f<Xe.length;f++)yo(Xe[f],t);if(i!==null&&i!==t){if(tn++,i.deps!==null)for(let y=0;y<n;y+=1)i.deps[y].rv=tn;if(e!==null)for(const y of e)y.rv=tn;Xe!==null&&(s===null?s=Xe:s.push(...Xe))}return t.f&Nt&&(t.f^=Nt),h}catch(y){return zr(y)}finally{t.f^=li,Oe=e,Fe=n,Xe=s,H=i,Ke=r,wn(o),st=a,nn=c}}function Tc(t,e){let n=e.reactions;if(n!==null){var s=_l.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}if(n===null&&e.f&xe&&(Oe===null||!gn.call(Oe,e))){var r=e;r.f&qe&&(r.f^=qe,r.f&=~Yt),ui(r),cc(r),Qn(r,0)}}function Qn(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)Tc(t,n[s])}function _n(t){var e=t.f;if(!(e&St)){fe(t,_e);var n=Q,s=_s;Q=t,_s=!0;try{e&(yt|Ar)?Sc(t):yi(t),co(t);var i=So(t);t.teardown=typeof i=="function"?i:null,t.wv=vo;var r;ri&&Kl&&t.f&Ee&&t.deps}finally{_s=s,Q=n}}}async function xc(){await Promise.resolve(),Ql()}function b(t){var e=t.f,n=(e&xe)!==0;if(H!==null&&!st){var s=Q!==null&&(Q.f&St)!==0;if(!s&&(Ke===null||!gn.call(Ke,t))){var i=H.deps;if(H.f&li)t.rv<tn&&(t.rv=tn,Oe===null&&i!==null&&i[Fe]===t?Fe++:Oe===null?Oe=[t]:Oe.push(t));else{(H.deps??(H.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[H]:gn.call(r,H)||r.push(H)}}}if(Lt&&Pt.has(t))return Pt.get(t);if(n){var o=t;if(Lt){var a=o.v;return(!(o.f&_e)&&o.reactions!==null||ko(o))&&(a=gi(o)),Pt.set(o,a),a}var c=(o.f&qe)===0&&!st&&H!==null&&(_s||(H.f&qe)!==0),u=(o.f&Kt)===0;Jn(o)&&(c&&(o.f|=qe),Xr(o)),c&&!u&&(Yr(o),_o(o))}if(Ie!=null&&Ie.has(t))return Ie.get(t);if(t.f&Nt)throw t.v;return t.v}function _o(t){if(t.f|=qe,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&xe&&!(e.f&qe)&&(Yr(e),_o(e))}function ko(t){if(t.v===Te)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Pt.has(e)||e.f&xe&&ko(e))return!0;return!1}function Zn(t){var e=st;try{return st=!0,t()}finally{st=e}}const sn=Symbol("events"),To=new Set,_i=new Set;function Ec(t,e,n,s={}){function i(r){if(s.capture||ki.call(e,r),!r.cancelBubble)return ys(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Ot(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function rn(t,e,n,s,i){var r={capture:s,passive:i},o=Ec(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&bi(()=>{e.removeEventListener(t,o,r)})}function kn(t,e,n){(e[sn]??(e[sn]={}))[t]=n}function ks(t){for(var e=0;e<t.length;e++)To.add(t[e]);for(var n of _i)n(t)}let xo=null;function ki(t){var y,S;var e=this,n=e.ownerDocument,s=t.type,i=((y=t.composedPath)==null?void 0:y.call(t))||[],r=i[0]||t.target;xo=t;var o=0,a=xo===t&&t[sn];if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t[sn]=e;return}var u=i.indexOf(e);if(u===-1)return;c<=u&&(o=c)}if(r=i[o]||t.target,r!==e){kl(t,"currentTarget",{configurable:!0,get(){return r||n}});var l=H,h=Q;Ge(null),lt(null);try{for(var d,p=[];r!==null;){var f=r.assignedSlot||r.parentNode||r.host||null;try{var m=(S=r[sn])==null?void 0:S[s];m!=null&&(!r.disabled||t.target===r)&&m.call(r,t)}catch(_){d?p.push(_):d=_}if(t.cancelBubble||f===e||f===null)break;r=f}if(d){for(let _ of p)queueMicrotask(()=>{throw _});throw d}}finally{t[sn]=e,delete t.currentTarget,Ge(l),lt(h)}}}const Ti=((ll=globalThis==null?void 0:globalThis.window)==null?void 0:ll.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Ic(t){return(Ti==null?void 0:Ti.createHTML(t))??t}function Eo(t){var e=ro("template");return e.innerHTML=Ic(t.replaceAll("<!>","<!---->")),e.content}function $n(t,e){var n=Q;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function K(t,e){var n=(e&yl)!==0,s=(e&Sl)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=Eo(r?t:"<!>"+t),n||(i=Sn(i)));var o=s||to?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=Sn(o),c=o.lastChild;$n(a,c)}else $n(o,o);return o}}function Cc(t,e,n="svg"){var s=!t.startsWith("<!>"),i=`<${n}>${s?t:"<!>"+t}</${n}>`,r;return()=>{if(!r){var o=Eo(i),a=Sn(o);r=Sn(a)}var c=r.cloneNode(!0);return $n(c,c),c}}function Ts(t,e){return Cc(t,e,"svg")}function xi(t=""){{var e=_t(t+"");return $n(e,e),e}}function Ei(){var t=document.createDocumentFragment(),e=document.createComment(""),n=_t();return t.append(e,n),$n(e,n),t}function P(t,e){t!==null&&t.before(e)}const Nc=["touchstart","touchmove"];function Rc(t){return Nc.includes(t)}function se(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=`${n}`)}function Dc(t,e){return Oc(t,e)}const xs=new Map;function Oc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:o=!0,transformError:a}){fc();var c=void 0,u=wc(()=>{var l=n??e.appendChild(_t());tc(l,{pending:()=>{}},p=>{Rt({});var f=me;r&&(f.c=r),i&&(s.$$events=i),c=t(p,s)||{},Dt()},a);var h=new Set,d=p=>{for(var f=0;f<p.length;f++){var m=p[f];if(!h.has(m)){h.add(m);var y=Rc(m);for(const x of[e,document]){var S=xs.get(x);S===void 0&&(S=new Map,xs.set(x,S));var _=S.get(m);_===void 0?(x.addEventListener(m,ki,{passive:y}),S.set(m,1)):S.set(m,_+1)}}}};return d(ps(To)),_i.add(d),()=>{var y;for(var p of h)for(const S of[e,document]){var f=xs.get(S),m=f.get(p);--m==0?(S.removeEventListener(p,ki),f.delete(p),f.size===0&&xs.delete(S)):f.set(p,m)}_i.delete(d),l!==n&&((y=l.parentNode)==null||y.removeChild(l))}});return Mc.set(c,u),c}let Mc=new WeakMap;class Io{constructor(e,n=!0){wt(this,"anchor");U(this,ot,new Map);U(this,bt,new Map);U(this,Ue,new Map);U(this,dn,new Set);U(this,cs,!0);U(this,us,()=>{var e=W;if(v(this,ot).has(e)){var n=v(this,ot).get(e),s=v(this,bt).get(n);if(s)Si(s),v(this,dn).delete(n);else{var i=v(this,Ue).get(n);i&&(v(this,bt).set(n,i.effect),v(this,Ue).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,o]of v(this,ot)){if(v(this,ot).delete(r),r===e)break;const a=v(this,Ue).get(o);a&&(De(a.effect),v(this,Ue).delete(o))}for(const[r,o]of v(this,bt)){if(r===n||v(this,dn).has(r))continue;const a=()=>{if(Array.from(v(this,ot).values()).includes(r)){var u=document.createDocumentFragment();po(o,u),u.append(_t()),v(this,Ue).set(r,{effect:o,fragment:u})}else De(o);v(this,dn).delete(r),v(this,bt).delete(r)};v(this,cs)||!s?(v(this,dn).add(r),en(o,a,!1)):a()}}});U(this,ei,e=>{v(this,ot).delete(e);const n=Array.from(v(this,ot).values());for(const[s,i]of v(this,Ue))n.includes(s)||(De(i.effect),v(this,Ue).delete(s))});this.anchor=e,F(this,cs,n)}ensure(e,n){var s=W,i=io();if(n&&!v(this,bt).has(e)&&!v(this,Ue).has(e))if(i){var r=document.createDocumentFragment(),o=_t();r.append(o),v(this,Ue).set(e,{effect:Ve(()=>n(o)),fragment:r})}else v(this,bt).set(e,Ve(()=>n(this.anchor)));if(v(this,ot).set(s,e),i){for(const[a,c]of v(this,bt))a===e?s.unskip_effect(c):s.skip_effect(c);for(const[a,c]of v(this,Ue))a===e?s.unskip_effect(c.effect):s.skip_effect(c.effect);s.oncommit(v(this,us)),s.ondiscard(v(this,ei))}else v(this,us).call(this)}}ot=new WeakMap,bt=new WeakMap,Ue=new WeakMap,dn=new WeakMap,cs=new WeakMap,us=new WeakMap,ei=new WeakMap;function Ii(t){me===null&&Ol(),bn&&me.l!==null?Ac(me).m.push(t):Yn(()=>{const e=Zn(t);if(typeof e=="function")return e})}function Ac(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function ce(t,e,n=!1){var s=new Io(t),i=n?Xt:0;function r(o,a){s.ensure(o,a)}Ss(()=>{var o=!1;e((a,c=0)=>{o=!0,r(c,a)}),o||r(!1,null)},i)}function es(t,e){return e}function Pc(t,e,n){for(var s=[],i=e.length,r,o=e.length,a=0;a<i;a++){let h=e[a];en(h,()=>{if(r){if(r.pending.delete(h),r.done.add(h),r.pending.size===0){var d=t.outrogroups;Ci(ps(r.done)),d.delete(r),d.size===0&&(t.outrogroups=null)}}else o-=1},!1)}if(o===0){var c=s.length===0&&n!==null;if(c){var u=n,l=u.parentNode;pc(l),l.append(u),t.items.clear()}Ci(e,!c)}else r={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(r)}function Ci(t,e=!0){for(var n=0;n<t.length;n++)De(t[n],e)}var Co;function ts(t,e,n,s,i,r=null){var o=t,a=new Map;{var c=t;o=c.appendChild(_t())}var u=null,l=pi(()=>{var y=n();return oi(y)?y:y==null?[]:ps(y)}),h,d=!0;function p(){m.fallback=u,Lc(m,h,o,e,s),u!==null&&(h.length===0?u.f&Ct?(u.f^=Ct,ss(u,null,o)):Si(u):en(u,()=>{u=null}))}var f=Ss(()=>{h=b(l);for(var y=h.length,S=new Set,_=W,x=io(),g=0;g<y;g+=1){var w=h[g],E=s(w,g),I=d?null:a.get(E);I?(I.v&&yn(I.v,w),I.i&&yn(I.i,g),x&&_.unskip_effect(I.e)):(I=Bc(a,d?o:Co??(Co=_t()),w,E,g,i,e,n),d||(I.e.f|=Ct),a.set(E,I)),S.add(E)}if(y===0&&r&&!u&&(d?u=Ve(()=>r(o)):(u=Ve(()=>r(Co??(Co=_t()))),u.f|=Ct)),y>S.size&&Al(),!d)if(x){for(const[k,T]of a)S.has(k)||_.skip_effect(T.e);_.oncommit(p),_.ondiscard(()=>{})}else p();b(l)}),m={effect:f,items:a,outrogroups:null,fallback:u};d=!1}function ns(t){for(;t!==null&&!(t.f&$e);)t=t.next;return t}function Lc(t,e,n,s,i){var k;var r=e.length,o=t.items,a=ns(t.effect.first),c,u=null,l=[],h=[],d,p,f,m;for(m=0;m<r;m+=1){if(d=e[m],p=i(d,m),f=o.get(p).e,t.outrogroups!==null)for(const T of t.outrogroups)T.pending.delete(f),T.done.delete(f);if(f.f&Ct)if(f.f^=Ct,f===a)ss(f,null,n);else{var y=u?u.next:a;f===t.effect.last&&(t.effect.last=f.prev),f.prev&&(f.prev.next=f.next),f.next&&(f.next.prev=f.prev),Bt(t,u,f),Bt(t,f,y),ss(f,y,n),u=f,l=[],h=[],a=ns(u.next);continue}if(f.f&Be&&Si(f),f!==a){if(c!==void 0&&c.has(f)){if(l.length<h.length){var S=h[0],_;u=S.prev;var x=l[0],g=l[l.length-1];for(_=0;_<l.length;_+=1)ss(l[_],S,n);for(_=0;_<h.length;_+=1)c.delete(h[_]);Bt(t,x.prev,g.next),Bt(t,u,x),Bt(t,g,S),a=S,u=g,m-=1,l=[],h=[]}else c.delete(f),ss(f,a,n),Bt(t,f.prev,f.next),Bt(t,f,u===null?t.effect.first:u.next),Bt(t,u,f),u=f;continue}for(l=[],h=[];a!==null&&a!==f;)(c??(c=new Set)).add(a),h.push(a),a=ns(a.next);if(a===null)continue}f.f&Ct||l.push(f),u=f,a=ns(f.next)}if(t.outrogroups!==null){for(const T of t.outrogroups)T.pending.size===0&&(Ci(ps(T.done)),(k=t.outrogroups)==null||k.delete(T));t.outrogroups.size===0&&(t.outrogroups=null)}if(a!==null||c!==void 0){var w=[];if(c!==void 0)for(f of c)f.f&Be||w.push(f);for(;a!==null;)!(a.f&Be)&&a!==t.fallback&&w.push(a),a=ns(a.next);var E=w.length;if(E>0){var I=r===0?n:null;Pc(t,w,I)}}}function Bc(t,e,n,s,i,r,o,a){var c=o&ie?o&fs?$t(n):uc(n,!1,!1):null,u=o&we?$t(i):null;return{v:c,i:u,e:Ve(()=>(r(e,c??n,u??i,a),()=>{t.delete(s)}))}}function ss(t,e,n){if(t.nodes)for(var s=t.nodes.start,i=t.nodes.end,r=e&&!(e.f&Ct)?e.nodes.start:n;s!==null;){var o=Xn(s);if(r.before(s),s===i)return;s=o}}function Bt(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function No(t,e,n,s,i){var a;var r=(a=e.$$slots)==null?void 0:a[n],o=!1;r===!0&&(r=e.children,o=!0),r===void 0||r(t,o?()=>s:s)}function Fc(t,e,n){var s=new Io(t);Ss(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},Xt)}function Ft(t,e){lo(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=ro("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function Ro(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Ro(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Wc(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Ro(t))&&(s&&(s+=" "),s+=e);return s}function Tn(t){return typeof t=="object"?Wc(t):t??""}function zc(t,e,n){var s=t==null?"":""+t;return e&&(s=s?s+" "+e:e),s===""?null:s}function Wt(t,e,n,s,i,r){var o=t.__className;if(o!==n||o===void 0){var a=zc(n,s);a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a),t.__className=n}return r}function Do(t,e,n=!1){if(t.multiple){if(e==null)return;if(!oi(e))return ql();for(var s of t.options)s.selected=e.includes(Oo(s));return}for(s of t.options){var i=Oo(s);if(dc(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function jc(t){var e=new MutationObserver(()=>{Do(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),bi(()=>{e.disconnect()})}function Oo(t){return"__value"in t?t.__value:t.value}const Uc=Symbol("is custom element"),Hc=Symbol("is html");function qc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ce(t,e,n,s){var i=Vc(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[Dl]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Gc(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Vc(t){return t.__attributes??(t.__attributes={[Uc]:t.nodeName.includes("-"),[Hc]:t.namespaceURI===Rr})}var Mo=new Map;function Gc(t){var e=t.getAttribute("is")||t.nodeName,n=Mo.get(e);if(n)return n;Mo.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=Tl(i);for(var o in s)s[o].set&&n.push(o);i=Dr(i)}return n}function Kc(t,e,n=e){var s=new WeakSet;mc(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Ni(t)?Ri(r):r,n(r),W!==null&&s.add(W),await xc(),r!==(r=e())){var o=t.selectionStart,a=t.selectionEnd,c=t.value.length;if(t.value=r??"",a!==null){var u=t.value.length;o===a&&a===c&&u>c?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=o,t.selectionEnd=Math.min(a,u))}}}),Zn(e)==null&&t.value&&(n(Ni(t)?Ri(t.value):t.value),W!==null&&s.add(W)),wi(()=>{var i=e();if(t===document.activeElement){var r=hi??W;if(s.has(r))return}Ni(t)&&i===Ri(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Ni(t){var e=t.type;return e==="number"||e==="range"}function Ri(t){return t===""?null:+t}function Ao(t,e){return t===e||(t==null?void 0:t[Jt])===e}function Xc(t={},e,n,s){return lo(()=>{var i,r;return wi(()=>{i=r,r=[],Zn(()=>{t!==n(...r)&&(e(t,...r),i&&Ao(n(...i),t)&&e(null,...i))})}),()=>{Ot(()=>{r&&Ao(n(...r),t)&&e(null,...r)})}}),t}let Es=!1;function Yc(t){var e=Es;try{return Es=!1,[t(),Es]}finally{Es=e}}function We(t,e,n,s){var x;var i=!bn||(n&ml)!==0,r=(n&bl)!==0,o=(n&wl)!==0,a=s,c=!0,u=()=>(c&&(c=!1,a=o?Zn(s):s),a),l;if(r){var h=Jt in t||Rl in t;l=((x=mn(t,e))==null?void 0:x.set)??(h&&e in t?g=>t[e]=g:void 0)}var d,p=!1;r?[d,p]=Yc(()=>t[e]):d=t[e],d===void 0&&s!==void 0&&(d=u(),l&&(i&&Wl(),l(d)));var f;if(i?f=()=>{var g=t[e];return g===void 0?u():(c=!0,g)}:f=()=>{var g=t[e];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&!(n&vl))return f;if(l){var m=t.$$legacy;return function(g,w){return arguments.length>0?((!i||!w||m||p)&&l(w?f():g),g):f()}}var y=!1,S=(n&gl?bs:pi)(()=>(y=!1,f()));r&&b(S);var _=Q;return function(g,w){if(arguments.length>0){const E=w?b(S):i&&r?at(g):g;return D(S,E),y=!0,a!==void 0&&(a=E),g}return Lt&&y||_.f&St?S.v:b(S)}}function Po(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Di(t,e,n){let s="";if(n){const i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3),s="; expires="+i.toUTCString()}document.cookie=t+"="+(e||"")+s+"; path=/; secure; samesite=strict"}function Oi(t){const e=t+"=",n=document.cookie.split(";");for(let s=0;s<n.length;s++){let i=n[s];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null}function Lo(){const t="uniqueUserID";let e=Oi(t);return e||(e=Po(),Di(t,e,365)),e}function ct(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Oi("uniqueUserID");r||(r=Lo());const o={user_agent:navigator.userAgent,screen_width:window.screen.width,screen_height:window.screen.height,language:navigator.language,platform:navigator.platform},a=new Date().toISOString();let c=Oi("sessionID");c||(c=Po(),Di("sessionID",c,1));const u={event_type:t,store_id:e,session_id:c,event_time:a,data:n,meta:{...s,user_id:r},device_info:o,region:navigator.language.split("-")[1]||null,language:navigator.language.split("-")[0]||"en"};return fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(l=>l.ok?l.json():l.json().then(h=>{throw new Error(h.message||"Failed to track widget event")})).catch(l=>{throw console.error("Widget event tracking error:",l),l})}var Bo={},Jc=function(t,e,n,s,i){var r=new Worker(Bo[e]||(Bo[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return r.onmessage=function(o){var a=o.data,c=a.$e$;if(c){var u=new Error(c[0]);u.code=c[1],u.stack=c[2],i(u,null)}else i(null,a)},r.postMessage(n,s),r},Ye=Uint8Array,Me=Uint16Array,Is=Int32Array,Cs=new Ye([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ns=new Ye([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Mi=new Ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fo=function(t,e){for(var n=new Me(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Is(n[30]),s=1;s<30;++s)for(var r=n[s];r<n[s+1];++r)i[r]=r-n[s]<<5|s;return{b:n,r:i}},Wo=Fo(Cs,2),Qc=Wo.b,Rs=Wo.r;Qc[28]=258,Rs[258]=28;for(var Zc=Fo(Ns,0),Ai=Zc.r,Ds=new Me(32768),oe=0;oe<32768;++oe){var zt=(oe&43690)>>1|(oe&21845)<<1;zt=(zt&52428)>>2|(zt&13107)<<2,zt=(zt&61680)>>4|(zt&3855)<<4,Ds[oe]=((zt&65280)>>8|(zt&255)<<8)>>1}for(var xn=function(t,e,n){for(var s=t.length,i=0,r=new Me(e);i<s;++i)t[i]&&++r[t[i]-1];var o=new Me(e);for(i=1;i<e;++i)o[i]=o[i-1]+r[i-1]<<1;var a;if(n){a=new Me(1<<e);var c=15-e;for(i=0;i<s;++i)if(t[i])for(var u=i<<4|t[i],l=e-t[i],h=o[t[i]-1]++<<l,d=h|(1<<l)-1;h<=d;++h)a[Ds[h]>>c]=u}else for(a=new Me(s),i=0;i<s;++i)t[i]&&(a[i]=Ds[o[t[i]-1]++]>>15-t[i]);return a},jt=new Ye(288),oe=0;oe<144;++oe)jt[oe]=8;for(var oe=144;oe<256;++oe)jt[oe]=9;for(var oe=256;oe<280;++oe)jt[oe]=7;for(var oe=280;oe<288;++oe)jt[oe]=8;for(var is=new Ye(32),oe=0;oe<32;++oe)is[oe]=5;var zo=xn(jt,9,0),jo=xn(is,5,0),Pi=function(t){return(t+7)/8|0},Uo=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Ye(t.subarray(e,n))},$c=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ho=function(t,e,n){var s=new Error(e||$c[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,Ho),!n)throw s;return s},ut=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},En=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8,t[s+2]|=n>>16},Os=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s,f:t[s]});var i=n.length,r=n.slice();if(!i)return{t:Wi,l:0};if(i==1){var o=new Ye(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(w,E){return w.f-E.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,h=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[h].f?u++:h++],c=n[u!=l&&n[u].f<n[h].f?u++:h++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=r[0].s,s=1;s<i;++s)r[s].s>d&&(d=r[s].s);var p=new Me(d+1),f=Ms(n[l-1],p,0);if(f>e){var s=0,m=0,y=f-e,S=1<<y;for(r.sort(function(E,I){return p[I.s]-p[E.s]||E.f-I.f});s<i;++s){var _=r[s].s;if(p[_]>e)m+=S-(1<<f-p[_]),p[_]=e;else break}for(m>>=y;m>0;){var x=r[s].s;p[x]<e?m-=1<<e-p[x]++-1:++s}for(;s>=0&&m;--s){var g=r[s].s;p[g]==e&&(--p[g],++m)}f=e}return{t:new Ye(p),l:f}},Ms=function(t,e,n){return t.s==-1?Math.max(Ms(t.l,e,n+1),Ms(t.r,e,n+1)):e[t.s]=n},Li=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Me(++e),s=0,i=t[0],r=1,o=function(c){n[s++]=c},a=1;a<=e;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(i),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(i);r=1,i=t[a]}return{c:n.subarray(0,s),n:e}},In=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Bi=function(t,e,n){var s=n.length,i=Pi(e+2);t[i]=s&255,t[i+1]=s>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<s;++r)t[i+r+4]=n[r];return(i+4+s)*8},Fi=function(t,e,n,s,i,r,o,a,c,u,l){ut(e,l++,n),++i[256];for(var h=Os(i,15),d=h.t,p=h.l,f=Os(r,15),m=f.t,y=f.l,S=Li(d),_=S.c,x=S.n,g=Li(m),w=g.c,E=g.n,I=new Me(19),k=0;k<_.length;++k)++I[_[k]&31];for(var k=0;k<w.length;++k)++I[w[k]&31];for(var T=Os(I,7),A=T.t,G=T.l,j=19;j>4&&!A[Mi[j-1]];--j);var Z=u+5<<3,z=In(i,jt)+In(r,is)+o,L=In(i,d)+In(r,m)+o+14+3*j+In(I,A)+2*I[16]+3*I[17]+7*I[18];if(c>=0&&Z<=z&&Z<=L)return Bi(e,l,t.subarray(c,c+u));var Y,$,R,J;if(ut(e,l,1+(L<z)),l+=2,L<z){Y=xn(d,p,0),$=d,R=xn(m,y,0),J=m;var N=xn(A,G,0);ut(e,l,x-257),ut(e,l+5,E-1),ut(e,l+10,j-4),l+=14;for(var k=0;k<j;++k)ut(e,l+3*k,A[Mi[k]]);l+=3*j;for(var O=[_,w],te=0;te<2;++te)for(var re=O[te],k=0;k<re.length;++k){var ue=re[k]&31;ut(e,l,N[ue]),l+=A[ue],ue>15&&(ut(e,l,re[k]>>5&127),l+=re[k]>>12)}}else Y=zo,$=jt,R=jo,J=is;for(var k=0;k<a;++k){var C=s[k];if(C>255){var ue=C>>18&31;En(e,l,Y[ue+257]),l+=$[ue+257],ue>7&&(ut(e,l,C>>23&31),l+=Cs[ue]);var B=C&31;En(e,l,R[B]),l+=J[B],B>3&&(En(e,l,C>>5&8191),l+=Ns[B])}else En(e,l,Y[C]),l+=$[C]}return En(e,l,Y[256]),l+$[256]},qo=new Is([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Wi=new Ye(0),Vo=function(t,e,n,s,i,r){var o=r.z||t.length,a=new Ye(s+o+5*(1+Math.ceil(o/7e3))+i),c=a.subarray(s,a.length-i),u=r.l,l=(r.r||0)&7;if(e){l&&(c[0]=r.r>>3);for(var h=qo[e-1],d=h>>13,p=h&8191,f=(1<<n)-1,m=r.p||new Me(32768),y=r.h||new Me(f+1),S=Math.ceil(n/3),_=2*S,x=function(pn){return(t[pn]^t[pn+1]<<S^t[pn+2]<<_)&f},g=new Is(25e3),w=new Me(288),E=new Me(32),I=0,k=0,T=r.i||0,A=0,G=r.w||0,j=0;T+2<o;++T){var Z=x(T),z=T&32767,L=y[Z];if(m[z]=L,y[Z]=z,G<=T){var Y=o-T;if((I>7e3||A>24576)&&(Y>423||!u)){l=Fi(t,c,0,g,w,E,k,A,j,T-j,l),A=I=k=0,j=T;for(var $=0;$<286;++$)w[$]=0;for(var $=0;$<30;++$)E[$]=0}var R=2,J=0,N=p,O=z-L&32767;if(Y>2&&Z==x(T-O))for(var te=Math.min(d,Y)-1,re=Math.min(32767,T),ue=Math.min(258,Y);O<=re&&--N&&z!=L;){if(t[T+R]==t[T+R-O]){for(var C=0;C<ue&&t[T+C]==t[T+C-O];++C);if(C>R){if(R=C,J=O,C>te)break;for(var B=Math.min(O,C-2),ee=0,$=0;$<B;++$){var Se=T-O+$&32767,Ze=m[Se],Pe=Se-Ze&32767;Pe>ee&&(ee=Pe,L=Se)}}}z=L,L=m[z],O+=z-L&32767}if(J){g[A++]=268435456|Rs[R]<<18|Ai[J];var Le=Rs[R]&31,hs=Ai[J]&31;k+=Cs[Le]+Ns[hs],++w[257+Le],++E[hs],G=T+R,++I}else g[A++]=t[T],++w[t[T]]}}for(T=Math.max(T,G);T<o;++T)g[A++]=t[T],++w[t[T]];l=Fi(t,c,u,g,w,E,k,A,j,T-j,l),u||(r.r=l&7|c[l/8|0]<<3,l-=7,r.h=y,r.p=m,r.i=T,r.w=G)}else{for(var T=r.w||0;T<o+u;T+=65535){var Vt=T+65535;Vt>=o&&(c[l/8|0]=u,Vt=o),l=Bi(c,l+1,t.subarray(T,Vt))}r.i=o}return Uo(a,0,s+Pi(l)+i)},Go=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,s=9;--s;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Ko=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=Go[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},zi=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new Ye(r.length+t.length);o.set(r),o.set(t,r.length),t=o,i.w=r.length}return Vo(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,s,i)},eu=function(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n},Xo=function(t,e,n){for(var s=t(),i=t.toString(),r=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<s.length;++o){var a=s[o],c=r[o];if(typeof a=="function"){e+=";"+c+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var l=u.indexOf(" ",8)+1;e+=u.slice(l,u.indexOf("(",l))}else{e+=u;for(var h in a.prototype)e+=";"+c+".prototype."+h+"="+a.prototype[h].toString()}else e+=u}else n[c]=a}return e},As=[],tu=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},nu=function(t,e,n,s){if(!As[n]){for(var i="",r={},o=t.length-1,a=0;a<o;++a)i=Xo(t[a],i,r);As[n]={c:Xo(t[o],i,r),e:r}}var c=eu({},As[n].e);return Jc(As[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,tu(c),s)},su=function(){return[Ye,Me,Is,Cs,Ns,Mi,Rs,Ai,zo,jt,jo,is,Ds,qo,Wi,xn,ut,En,Os,Ms,Li,In,Bi,Fi,Pi,Uo,Vo,zi,ou,Yo]},iu=function(){return[Jo,Qo,Ps,Ko,Go]},Yo=function(t){return postMessage(t,[t.buffer])},ru=function(t,e,n,s,i,r){var o=nu(n,s,i,function(a,c){o.terminate(),r(a,c)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Ps=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Jo=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Ps(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var s=0;s<=n.length;++s)t[s+10]=n.charCodeAt(s)}},Qo=function(t){return 10+(t.filename?t.filename.length+1:0)};function ou(t,e){return zi(t,e||{},0,0)}function au(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Ho(7),ru(t,e,[su,iu,function(){return[Zo]}],function(s){return Yo(Zo(s.data[0],s.data[1]))},2,n)}function Zo(t,e){e||(e={});var n=Ko(),s=t.length;n.p(t);var i=zi(t,e,Qo(e),8),r=i.length;return Jo(i,e),Ps(i,r-8,n.d()),Ps(i,r-4,s),i}var lu=typeof TextDecoder<"u"&&new TextDecoder,cu=0;try{lu.decode(Wi,{stream:!0}),cu=1}catch{}class $o{constructor(){this.idx=1,this.backDict={}}getKey(e){let n=!1;return this.backDict[e]||(n=!0,this.backDict[e]=this.idx++),[this.backDict[e],n]}}class uu{constructor(e){this.dict=new $o,this.app=e.app,this.isDictDisabled=e.isDictDisabled}sendSetAttribute(e,n,s){if(this.isDictDisabled){const i=[12,e,n,s];return this.app.send(i)}else{const i=[51,e,this.applyDict(n),this.applyDict(s)];return this.app.send(i)}}applyDict(e){const[n,s]=this.dict.getKey(e);return s&&this.app.send([50,n,e]),n}clear(){this.dict=new $o}}class hu{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=du(s);if(i.type)return i}},this.durationInt=null}setConditions(e){this.conditions=e}async fetchConditions(e,n){try{const s=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}),{conditions:i}=await s.json(),r=[];i.forEach(o=>{o.filters.forEach(c=>{let u;c.type==="fetch"?(u={type:"network_request",subConditions:[],name:o.name},c.filters.forEach(l=>{const h=this.createConditionFromFilter(l);h&&u.subConditions.push(h)})):u=this.createConditionFromFilter(c),u&&(u.type==="session_duration"&&this.processDuration(u.value[0],o.name),r.push({...u,name:o.name}))})}),this.conditions=r}catch{this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(n){this.app.debug.error(n)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e);break}}processFlags(e){const n=this.conditions.filter(s=>s.type==="feature_flag");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&e.find(r=>i(r.key,s.value))&&this.trigger(s.name)})}processDuration(e,n){this.durationInt=setInterval(()=>{performance.now()>e&&this.trigger(n)},1e3),this.app.attachStopCallback(()=>{this.durationInt&&clearInterval(this.durationInt)})}networkRequest(e){const n=this.conditions.filter(s=>s.type==="network_request");n.length&&n.forEach(s=>{const i=s.subConditions.filter(r=>r.operator!=="isAny");i.length?i.every(o=>{let a;switch(o.key){case"url":a=e[3];break;case"status":a=e[6];break;case"method":a=e[2];break;case"duration":a=e[8];break}const c=Cn[o.operator];if(c&&c(a,o.value))return!0})&&this.trigger(s.name):i.length===0&&s.subConditions.length&&this.trigger(s.name)})}customEvent(e){const n=this.conditions.filter(s=>s.type==="custom_event");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&(i(e[1],s.value)||i(e[2],s.value))&&this.trigger(s.name)})}clickEvent(e){const n=this.conditions.filter(s=>s.type==="click");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&(i(e[3],s.value)||i(e[4],s.value))&&this.trigger(s.name)})}pageLocationEvent(e){const n=this.conditions.filter(s=>s.type==="visited_url");n&&n.forEach(s=>{const i=Cn[s.operator];i&&i(e[1],s.value)&&this.trigger(s.name)})}jsExceptionEvent(e){const n=[e[1],e[2],e[3]],s=this.conditions.filter(i=>i.type==="exception");s&&s.forEach(i=>{const r=Cn[i.operator];r&&n.some(o=>r(o,i.value))&&this.trigger(i.name)})}}const Cn={is:(t,e)=>e.some(n=>t.includes(n)),isAny:()=>!0,isNot:(t,e)=>!e.some(n=>t.includes(n)),contains:(t,e)=>e.some(n=>t.includes(n)),notContains:(t,e)=>!e.some(n=>t.includes(n)),startsWith:(t,e)=>e.some(n=>t.startsWith(n)),endsWith:(t,e)=>e.some(n=>t.endsWith(n)),greaterThan:(t,e)=>t>e,greaterOrEqual:(t,e)=>t>=e,lessOrEqual:(t,e)=>t<=e,lessThan:(t,e)=>t<e},du=t=>{const e={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=i=>{if(Object.keys(e).includes(i))return e[i]};let s={type:"",operator:"",value:t.value,key:""};switch(t.type){case"click":s={type:"click",operator:n(t.operator),value:t.value,key:""};break;case"location":s={type:"visited_url",operator:t.operator,value:t.value,key:""};break;case"custom":s={type:"custom_event",operator:t.operator,value:t.value,key:""};break;case"metadata":s={type:t.source==="featureFlag"?"feature_flag":t.type,operator:t.operator,value:t.value,key:""};break;case"error":s={type:"exception",operator:t.operator,value:t.value,key:""};break;case"duration":s={type:"session_duration",value:t.value[0],key:""};break;case"fetchUrl":s={type:"network_request",key:"url",operator:t.operator,value:t.value};break;case"fetchStatusCode":s={type:"network_request",key:"status",operator:n(t.operator),value:t.value};break;case"fetchMethod":s={type:"network_request",key:"method",operator:n(t.operator),value:t.value};break;case"fetchDuration":s={type:"network_request",key:"duration",operator:n(t.operator),value:t.value};break}return s};class fu{constructor(e){this.app=e,this.flags=[],this.storageKey="__openreplay_flags";const n=this.app.sessionStorage.getItem(this.storageKey);if(n){const s=n.split(";").filter(Boolean);this.flags=s.map(i=>JSON.parse(i))}}getFeatureFlag(e){return this.flags.find(n=>n.key===e)}isFlagEnabled(e){return this.flags.findIndex(n=>n.key===e)!==-1}onFlagsLoad(e){this.onFlagsCb=e}async reloadFlags(e){const n=this.app.sessionStorage.getItem(this.storageKey),s={};n&&n.split(";").filter(Boolean).forEach(l=>{const h=JSON.parse(l);s[h.key]={key:h.key,value:h.value}});const i=this.app.session.getInfo(),r=this.app.session.userInfo,o={projectID:i.projectID,userID:i.userID,metadata:i.metadata,referrer:document.referrer,os:r.userOS,device:r.userDevice,country:r.userCountry,state:r.userState,city:r.userCity,browser:r.userBrowser,persistFlags:s},a=e??this.app.session.getSessionToken(),c=await fetch(this.app.options.ingestPoint+"/v1/web/feature-flags",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(o)});if(c.status===200){const u=await c.json();return this.handleFlags(u.flags)}}handleFlags(e){var r;const n=[];e.forEach(o=>{o.is_persist&&n.push(o)});let s="";return this.diffPersist(n).forEach(o=>{s+=`${JSON.stringify(o)};`}),this.app.sessionStorage.setItem(this.storageKey,s),this.flags=e,(r=this.onFlagsCb)==null?void 0:r.call(this,e)}clearPersistFlags(){this.app.sessionStorage.removeItem(this.storageKey)}diffPersist(e){const n=this.app.sessionStorage.getItem(this.storageKey);if(!n)return e;const i=n.split(";").filter(Boolean).map(r=>JSON.parse(r));return e.filter(r=>i.findIndex(o=>o.key===r.key)===-1)}}const ea={htmlmasked:"hidden",masked:"obscured"},ht=!(typeof window>"u"),pu=ht&&navigator.userAgent.match(/firefox|fxios/i),gu=1e5;let ji=ht?Date.now()-performance.now():0;function Ui(){ji=Date.now()-performance.now()}function Nn(){return ji}const it=ht&&performance.now?()=>Math.round(performance.now()+ji):()=>Date.now(),Hi="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function ta(t){return t.trim().replace(/\s+/g," ")}function na(t){return t.startsWith("https://")||t.startsWith("http://")}const Ls="https://docs.openreplay.com",sa={};function Ut(t,e,n="/"){sa[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${Ls}${n} for more information.`),sa[t]=!0)}function qi(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&Ut('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function on(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(ea[e]&&Ut(`"${n}" attribute`,`"${ea[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function mu(t){try{return!!t.contentDocument}catch{return!1}}function ia(t){try{return t instanceof HTMLIFrameElement?t.contentDocument:t instanceof Window?t.document:t instanceof Document?t.defaultView:"nodeType"in t?t.nodeType:"addEventListener"in t&&t.addEventListener,!0}catch(e){if(e instanceof DOMException&&e.name==="SecurityError")return!1}return!0}function ra(t){return t.toString(16).padStart(2,"0")}function vu(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,ra).join("")):Array.from({length:t},()=>ra(Math.floor(Math.random()*16))).join("")}function oa(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function Vi(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function aa(t,e){if(e)return new MutationObserver(t);{const n=Vi("MutationObserver");return new window[n](t)}}function la(t,e,n,s,i){if(!ia(t))return;let r="addEventListener";i||(r=Vi("addEventListener"));try{t[r]?t[r](e,n,s):t.addEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}function ca(t,e,n,s,i){if(!ia(t))return;let r="removeEventListener";i||(r=Vi("removeEventListener"));try{t[r]?t[r](e,n,s):t.removeEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}class bu{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||this.taskQueue.length===0)return;this.isRunning=!0;const e=()=>{if(this.taskQueue.length===0){this.isRunning=!1;return}const n=this.taskQueue.shift();Promise.resolve(n()).then(()=>{requestAnimationFrame(()=>e())})};e()}}const wu=new bu;function yu(t){wu.addTask(t)}function ua(t,e){const n={...t};for(const s in e)if(e.hasOwnProperty(s)){const i=e[s],r=t[s];typeof i=="object"&&!Array.isArray(i)&&i!==null?n[s]=ua(r||{},i):n[s]=i}return n}function an(t){return[0,t]}function Su(t,e){return[5,t,e]}function _u(t,e){return[6,t,e]}function ku(){return[7]}function Tu(t,e,n,s,i){return[8,t,e,n,s,i]}function xu(t,e,n){return[9,t,e,n]}function Eu(t,e,n){return[10,t,e,n]}function Iu(t){return[11,t]}function ha(t,e){return[13,t,e]}function Cu(t,e){return[14,t,e]}function Nu(t,e,n){return[16,t,e,n]}function Ru(t,e,n){return[18,t,e,n]}function Du(t,e){return[19,t,e]}function Ou(t,e){return[20,t,e]}function Mu(t,e){return[22,t,e]}function Au(t,e,n,s,i,r,o,a,c){return[23,t,e,n,s,i,r,o,a,c]}function Pu(t,e,n){return[24,t,e,n]}function Lu(t,e){return[27,t,e]}function Bu(t){return[28,t]}function Fu(t){return[29,t]}function da(t,e){return[30,t,e]}function Wu(t,e,n,s){return[49,t,e,n,s]}function zu(t,e){return[54,t,e]}function ju(t){return[55,t]}function fa(t,e,n,s){return[57,t,e,n,s]}function pa(t){return[58,t]}function Gi(t,e,n,s){return[60,t,e,n,s]}function Uu(t,e,n){return[61,t,e,n]}function Hu(t,e){return[63,t,e]}function qu(t,e){return[64,t,e]}function Vu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function Ki(t,e){return[70,t,e]}function ga(t,e,n){return[71,t,e,n]}function Xi(t,e,n,s){return[73,t,e,n,s]}function ma(t,e){return[75,t,e]}function va(t,e){return[76,t,e]}function Gu(t,e){return[77,t,e]}function Yi(t,e,n,s){return[78,t,e,n,s]}function Bs(t,e,n,s,i,r,o,a,c){return[83,t,e,n,s,i,r,o,a,c]}function Ku(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function Xu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function ba(t,e,n){return[113,t,e,n]}function Yu(t){return[114,t]}function wa(t){return[115,t]}function ya(t,e,n,s,i,r,o,a,c,u){return[116,t,e,n,s,i,r,o,a,c,u]}function Fs(t){return[117,t]}function ln(t){return[118,t]}function Ju(t,e){return[119,t,e]}function Qu(t){return[120,t]}function Zu(t,e,n,s){return[122,t,e,n,s]}const Ji=ht&&"performance"in window&&"memory"in performance?performance:{memory:{}},Qi=ht?(navigator.deviceMemory||0)*1024:0,Zi=Ji.memory.jsHeapSizeLimit||0;function $u(t,e){if(!Object.assign({capturePerformance:!0},e).capturePerformance)return;let s,i;const r=()=>{s===void 0||s===-1||(s++,requestAnimationFrame(r))};t.ticker.attach(()=>{i===void 0||i===-1||i++},0,!1);const o=()=>{s===void 0||i===void 0||(t.send(Wu(s,i,Ji.memory.totalJSHeapSize||0,Ji.memory.usedJSHeapSize||0)),i=s=document.hidden?-1:0)};t.attachStartCallback(()=>{i=s=-1,o(),r()}),t.attachStopCallback(()=>{i=s=void 0}),t.ticker.attach(o,40,!1),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",o,!1,!1)}const Sa="__or__watched_tags__";class eh{constructor(e){this.intervals={},this.tags=[],this.sessionStorage=e.sessionStorage,this.errLog=e.errLog,this.onTag=e.onTag;const n=JSON.parse(e.sessionStorage.getItem(Sa)??"[]");this.setTags(n),this.observer=new IntersectionObserver(s=>{s.forEach(i=>{if(i.isIntersecting&&i.target){const r=i.target.__or_watcher_tagname;r&&this.onTagRendered(r),this.observer.unobserve(i.target)}})})}async fetchTags(e,n){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(s=>s.json()).then(({tags:s})=>{if(s&&s.length){this.setTags(s);const i=JSON.stringify(s);this.sessionStorage.setItem(Sa,i||"")}}).catch(s=>this.errLog(s))}setTags(e){this.tags=e,this.intervals={},e.forEach(n=>{this.intervals[n.id]=setInterval(()=>{const s=document.querySelectorAll(n.selector);if(s.length>0){const i=s[0];i.__or_watcher_tagname=n.id,this.observer.observe(i)}},500)})}onTagRendered(e){this.intervals[e]&&clearInterval(this.intervals[e]),this.onTag(e)}clear(){this.tags.forEach(e=>{clearInterval(this.intervals[e.id])}),this.tags=[],this.intervals={},this.observer.disconnect()}}const th={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.40)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},nh={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Ws={display:"flex","flex-direction":"column",gap:"unset","align-items":"center",padding:"unset",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',"border-radius":"2px",border:"1px solid #D9D9D9",background:"rgba(255, 255, 255, 0.75)",width:"22rem"},sh={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},ih={borderTop:"1px solid rgba(0, 0, 0, 0.06)",borderBottom:"1px solid rgba(0, 0, 0, 0.06)",padding:"1.25rem 0rem",color:"rgba(0, 0, 0, 0.85)",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"400",lineHeight:"auto",whiteSpace:"pre-wrap"},rh={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",cursor:"pointer"},_a={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},Rn={display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.625rem",fontSize:"13px",lineHeight:"auto"},oh={padding:"0.5rem",gap:"0.5rem",fontFamily:"Verdana, sans-serif",fontSize:"16px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto",color:"white",display:"flex",alignItems:"center",width:"100%",borderRadius:"2px",background:"rgba(0, 0, 0, 0.75)",boxSizing:"border-box"},Dn={boxSizing:"border-box",display:"block",width:"100%",borderBottom:"1px solid #D9D9D9",background:"#FFF",padding:"0.65rem",alignSelf:"stretch",color:"#000",fontFamily:"Verdana, sans-serif",fontStyle:"normal",fontWeight:"400"},ah={...Dn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},ka={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},Ta={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",width:"100%",boxSizing:"border-box",cursor:"pointer"},xa={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},lh={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},Ea={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},ch={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #D2DFFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",background:"#D2DFFF",fontSize:"13px",height:"24px",width:"24px"},Ia={borderRadius:"0.375rem",border:"1px solid rgba(0, 0, 0, 0.06)",background:"#F5F7FF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",padding:"0.625rem 0.9375rem",gap:"0.5rem",alignSelf:"stretch"},Ca={fontWeight:"bold"},uh={fontSize:"13px",lineHeight:"auto"},Na={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},hh={...Na,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},dh={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},fh={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},Ra={Standard:{width:1280,height:720}};class ph{constructor(e){this.app=e,this.mediaRecorder=null,this.recordedChunks=[],this.stream=null,this.recStartTs=null}async startRecording(e,n,s,i){this.recStartTs=this.app.timestamp();const r=n;try{this.stream=await navigator.mediaDevices.getUserMedia({video:i?{...r,frameRate:{ideal:e}}:!1,audio:s}),this.mediaRecorder=new MediaRecorder(this.stream,{mimeType:"video/webm;codecs=vp9"}),this.recordedChunks=[],this.mediaRecorder.ondataavailable=o=>{o.data.size>0&&this.recordedChunks.push(o.data)},this.mediaRecorder.start()}catch(o){console.error(o)}}async stopRecording(){return new Promise(e=>{this.mediaRecorder&&(this.mediaRecorder.onstop=()=>{const n=new Blob(this.recordedChunks,{type:"video/webm"});e(n)},this.mediaRecorder.stop())})}async sendToAPI(){const e=await this.stopRecording();return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`,{headers:{Authorization:`Bearer ${this.app.session.getSessionToken()}`}}).then(n=>{if(n.ok)return n.json();throw new Error("Failed to get upload url")}).then(({url:n})=>fetch(n,{method:"PUT",headers:{"Content-Type":"video/webm"},body:e})).catch(console.error).finally(()=>{this.discard()})}async saveToFile(e="recorded-video.webm"){const n=await this.stopRecording(),s=URL.createObjectURL(n),i=document.createElement("a");i.style.display="none",i.href=s,i.download=e,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(s),document.body.removeChild(i)}discard(){var e,n;(e=this.mediaRecorder)==null||e.stop(),(n=this.stream)==null||n.getTracks().forEach(s=>s.stop())}}function gh(t,e){e.onmousedown=function(n){const s=t.getBoundingClientRect(),i=n.clientX-s.left,r=n.clientY-s.top;t.style.position="fixed",t.style.zIndex=99999999999999,o(n.pageX,n.pageY);function o(u,l){let h=u-i,d=l-r;h<=5&&(h=5),d<=5&&(d=5),h>=window.innerWidth-s.width&&(h=window.innerWidth-s.width),d>=window.innerHeight-s.height&&(d=window.innerHeight-s.height),t.style.left=`${h}px`,t.style.top=`${d}px`}function a(u){o(u.pageX,u.pageY)}document.addEventListener("mousemove",a);const c=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c)};document.addEventListener("mouseup",c)},e.ondragstart=function(){return!1}}function mh(){const t=document.createElement("div");t.className="grid";for(let e=0;e<16;e++){const n=document.createElement("div");Object.assign(n.style,{width:"2px",height:"2px",borderRadius:"10px",background:"white"}),n.className="cell",t.appendChild(n)}return Object.assign(t.style,{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridTemplateRows:"repeat(4, 1fr)",gap:"2px",cursor:"grab"}),t}function vh(){const t=document.createElement("div");Object.assign(t.style,{width:"0",height:"0",borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:"7px solid white"});const e=document.createElement("div");return e.appendChild(t),Object.assign(e.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",cursor:"pointer",marginLeft:"auto",transform:"rotate(180deg)"}),e}function bh(){const t=document.createElement("style");t.type="text/css",t.innerText=`@keyframes spin {
|
|
1
|
+
(function(se,ie){typeof exports=="object"&&typeof module<"u"?module.exports=ie():typeof define=="function"&&define.amd?define(ie):(se=typeof globalThis<"u"?globalThis:se||self,se.WineaterChatbot=ie())})(this,function(){"use strict";var Tp=Object.defineProperty;var vl=se=>{throw TypeError(se)};var xp=(se,ie,be)=>ie in se?Tp(se,ie,{enumerable:!0,configurable:!0,writable:!0,value:be}):se[ie]=be;var bt=(se,ie,be)=>xp(se,typeof ie!="symbol"?ie+"":ie,be),xr=(se,ie,be)=>ie.has(se)||vl("Cannot "+be);var w=(se,ie,be)=>(xr(se,ie,"read from private field"),be?be.call(se):ie.get(se)),q=(se,ie,be)=>ie.has(se)?vl("Cannot add the same private member more than once"):ie instanceof WeakSet?ie.add(se):ie.set(se,be),W=(se,ie,be,ps)=>(xr(se,ie,"write to private field"),ps?ps.call(se,be):ie.set(se,be),be),ke=(se,ie,be)=>(xr(se,ie,"access private method"),be);var hl,Bn,Fn,un,Wn,cs,zn,Vt,gt,jn,ze,Er,Ir,Cr,wl,Qe,kr,mt,hn,Me,vt,je,rt,It,dn,Gt,Un,Hn,qn,Ct,ti,ye,Ep,Ip,Cp,Nr,ri,oi,Rr,dl,ot,wt,Ue,fn,us,hs,ni,Vn,pn,Gn,fl,pl;const se="5";typeof window<"u"&&((hl=window.__svelte??(window.__svelte={})).v??(hl.v=new Set)).add(se);const ie=1,be=2,ps=16,bl=1,yl=2,Sl=4,_l=8,kl=16,Tl=1,xl=2,Te=Symbol(),Dr="http://www.w3.org/1999/xhtml",ai=!1;var li=Array.isArray,El=Array.prototype.indexOf,mn=Array.prototype.includes,gs=Array.from,Il=Object.defineProperty,vn=Object.getOwnPropertyDescriptor,Cl=Object.getOwnPropertyDescriptors,Nl=Object.prototype,Rl=Array.prototype,Or=Object.getPrototypeOf,Ar=Object.isExtensible;const Dl=()=>{};function Ol(t){for(var e=0;e<t.length;e++)t[e]()}function Mr(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const xe=2,Kn=4,ms=8,Pr=1<<24,yt=16,$e=32,Xt=64,ci=128,qe=512,_e=1024,Ee=2048,et=4096,Be=8192,St=16384,Yt=32768,Jt=65536,Lr=1<<17,Br=1<<18,wn=1<<19,Al=1<<20,Nt=1<<25,Qt=65536,ui=1<<21,hi=1<<22,Rt=1<<23,Zt=Symbol("$state"),Ml=Symbol("legacy props"),Pl=Symbol(""),$t=new class extends Error{constructor(){super(...arguments);bt(this,"name","StaleReactionError");bt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Ll(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Bl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Fl(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Wl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function zl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function jl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Ul(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Hl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ql(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Vl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Gl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Kl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Xl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Yl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Fr(t){return t===this.v}function Jl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wr(t){return!Jl(t,this.v)}let bn=!1,Ql=!1;function Zl(){bn=!0}let ve=null;function yn(t){ve=t}function Dt(t,e=!1,n){ve={p:ve,i:!1,c:null,e:null,s:t,x:null,l:bn&&!e?{s:null,u:null,$:[]}:null}}function Ot(t){var e=ve,n=e.e;if(n!==null){e.e=null;for(var s of n)lo(s)}return t!==void 0&&(e.x=t),e.i=!0,ve=e.p,t??{}}function Xn(){return!bn||ve!==null&&ve.l===null}let en=[];function zr(){var t=en;en=[],Ol(t)}function At(t){if(en.length===0&&!Yn){var e=en;queueMicrotask(()=>{e===en&&zr()})}en.push(t)}function $l(){for(;en.length>0;)zr()}function jr(t){var e=Z;if(e===null)return K.f|=Rt,t;if(!(e.f&Yt)&&!(e.f&Kn))throw t;Mt(t,e)}function Mt(t,e){for(;e!==null;){if(e.f&ci){if(!(e.f&Yt))throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const ec=-7169;function fe(t,e){t.f=t.f&ec|e}function di(t){t.f&qe||t.deps===null?fe(t,_e):fe(t,et)}function Ur(t){if(t!==null)for(const e of t)!(e.f&xe)||!(e.f&Qt)||(e.f^=Qt,Ur(e.deps))}function Hr(t,e,n){t.f&Ee?e.add(t):t.f&et&&n.add(t),Ur(t.deps),fe(t,_e)}const vs=new Set;let z=null,fi=null,Ie=null,Re=[],ws=null,pi=!1,Yn=!1;const _r=class _r{constructor(){q(this,ze);bt(this,"current",new Map);bt(this,"previous",new Map);q(this,Bn,new Set);q(this,Fn,new Set);q(this,un,0);q(this,Wn,0);q(this,cs,null);q(this,zn,new Set);q(this,Vt,new Set);q(this,gt,new Map);bt(this,"is_fork",!1);q(this,jn,!1)}skip_effect(e){w(this,gt).has(e)||w(this,gt).set(e,{d:[],m:[]})}unskip_effect(e){var n=w(this,gt).get(e);if(n){w(this,gt).delete(e);for(var s of n.d)fe(s,Ee),nt(s);for(s of n.m)fe(s,et),nt(s)}}process(e){var i;Re=[],this.apply();var n=[],s=[];for(const r of e)ke(this,ze,Ir).call(this,r,n,s);if(ke(this,ze,Er).call(this)){ke(this,ze,Cr).call(this,s),ke(this,ze,Cr).call(this,n);for(const[r,o]of w(this,gt))Xr(r,o)}else{for(const r of w(this,Bn))r();w(this,Bn).clear(),w(this,un)===0&&ke(this,ze,wl).call(this),fi=this,z=null,Vr(s),Vr(n),w(this,zn).clear(),w(this,Vt).clear(),fi=null,(i=w(this,cs))==null||i.resolve()}Ie=null}capture(e,n){n!==Te&&!this.previous.has(e)&&this.previous.set(e,n),e.f&Rt||(this.current.set(e,e.v),Ie==null||Ie.set(e,e.v))}activate(){z=this,this.apply()}deactivate(){z===this&&(z=null,Ie=null)}flush(){if(this.activate(),Re.length>0){if(qr(),z!==null&&z!==this)return}else w(this,un)===0&&this.process([]);this.deactivate()}discard(){for(const e of w(this,Fn))e(this);w(this,Fn).clear()}increment(e){W(this,un,w(this,un)+1),e&&W(this,Wn,w(this,Wn)+1)}decrement(e){W(this,un,w(this,un)-1),e&&W(this,Wn,w(this,Wn)-1),!w(this,jn)&&(W(this,jn,!0),At(()=>{W(this,jn,!1),ke(this,ze,Er).call(this)?Re.length>0&&this.flush():this.revive()}))}revive(){for(const e of w(this,zn))w(this,Vt).delete(e),fe(e,Ee),nt(e);for(const e of w(this,Vt))fe(e,et),nt(e);this.flush()}oncommit(e){w(this,Bn).add(e)}ondiscard(e){w(this,Fn).add(e)}settled(){return(w(this,cs)??W(this,cs,Mr())).promise}static ensure(){if(z===null){const e=z=new _r;vs.add(z),Yn||At(()=>{z===e&&e.flush()})}return z}apply(){}};Bn=new WeakMap,Fn=new WeakMap,un=new WeakMap,Wn=new WeakMap,cs=new WeakMap,zn=new WeakMap,Vt=new WeakMap,gt=new WeakMap,jn=new WeakMap,ze=new WeakSet,Er=function(){return this.is_fork||w(this,Wn)>0},Ir=function(e,n,s){e.f^=_e;for(var i=e.first;i!==null;){var r=i.f,o=(r&($e|Xt))!==0,a=o&&(r&_e)!==0,l=a||(r&Be)!==0||w(this,gt).has(i);if(!l&&i.fn!==null){o?i.f^=_e:r&Kn?n.push(i):$n(i)&&(r&yt&&w(this,Vt).add(i),kn(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var c=i.next;if(c!==null){i=c;break}i=i.parent}}},Cr=function(e){for(var n=0;n<e.length;n+=1)Hr(e[n],w(this,zn),w(this,Vt))},wl=function(){var i;if(vs.size>1){this.previous.clear();var e=Ie,n=!0;for(const r of vs){if(r===this){n=!1;continue}const o=[];for(const[l,u]of this.current){if(r.current.has(l))if(n&&u!==r.current.get(l))r.current.set(l,u);else continue;o.push(l)}if(o.length===0)continue;const a=[...r.current.keys()].filter(l=>!this.current.has(l));if(a.length>0){var s=Re;Re=[];const l=new Set,u=new Map;for(const c of o)Gr(c,a,l,u);if(Re.length>0){z=r,r.apply();for(const c of Re)ke(i=r,ze,Ir).call(i,c,[],[]);r.deactivate()}Re=s}}z=null,Ie=e}w(this,gt).clear(),vs.delete(this)};let Pt=_r;function tc(t){var e=Yn;Yn=!0;try{for(var n;;){if($l(),Re.length===0&&(z==null||z.flush(),Re.length===0))return ws=null,n;qr()}}finally{Yn=e}}function qr(){pi=!0;var t=null;try{for(var e=0;Re.length>0;){var n=Pt.ensure();if(e++>1e3){var s,i;nc()}n.process(Re),Lt.clear()}}finally{Re=[],pi=!1,ws=null}}function nc(){try{Ul()}catch(t){Mt(t,ws)}}let tt=null;function Vr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(St|Be))&&$n(s)&&(tt=new Set,kn(s),s.deps===null&&s.first===null&&s.nodes===null&&s.teardown===null&&s.ac===null&&ho(s),(tt==null?void 0:tt.size)>0)){Lt.clear();for(const i of tt){if(i.f&(St|Be))continue;const r=[i];let o=i.parent;for(;o!==null;)tt.has(o)&&(tt.delete(o),r.push(o)),o=o.parent;for(let a=r.length-1;a>=0;a--){const l=r[a];l.f&(St|Be)||kn(l)}}tt.clear()}}tt=null}}function Gr(t,e,n,s){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const i of t.reactions){const r=i.f;r&xe?Gr(i,e,n,s):r&(hi|yt)&&!(r&Ee)&&Kr(i,e,s)&&(fe(i,Ee),nt(i))}}function Kr(t,e,n){const s=n.get(t);if(s!==void 0)return s;if(t.deps!==null)for(const i of t.deps){if(mn.call(e,i))return!0;if(i.f&xe&&Kr(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function nt(t){var e=ws=t,n=e.b;if(n!=null&&n.is_pending&&t.f&(Kn|ms|Pr)&&!(t.f&Yt)){n.defer_effect(t);return}for(;e.parent!==null;){e=e.parent;var s=e.f;if(pi&&e===Z&&s&yt&&!(s&Br)&&s&Yt)return;if(s&(Xt|$e)){if(!(s&_e))return;e.f^=_e}}Re.push(e)}function Xr(t,e){if(!(t.f&$e&&t.f&_e)){t.f&Ee?e.d.push(t):t.f&et&&e.m.push(t),fe(t,_e);for(var n=t.first;n!==null;)Xr(n,e),n=n.next}}function sc(t){let e=0,n=tn(0),s;return()=>{bi()&&(v(n),Si(()=>(e===0&&(s=ts(()=>t(()=>Jn(n)))),e+=1,()=>{At(()=>{e-=1,e===0&&(s==null||s(),s=void 0,Jn(n))})})))}}var ic=Jt|wn;function rc(t,e,n,s){new oc(t,e,n,s)}class oc{constructor(e,n,s,i){q(this,ye);bt(this,"parent");bt(this,"is_pending",!1);bt(this,"transform_error");q(this,Qe);q(this,kr,null);q(this,mt);q(this,hn);q(this,Me);q(this,vt,null);q(this,je,null);q(this,rt,null);q(this,It,null);q(this,dn,0);q(this,Gt,0);q(this,Un,!1);q(this,Hn,new Set);q(this,qn,new Set);q(this,Ct,null);q(this,ti,sc(()=>(W(this,Ct,tn(w(this,dn))),()=>{W(this,Ct,null)})));var r;W(this,Qe,e),W(this,mt,n),W(this,hn,o=>{var a=Z;a.b=this,a.f|=ci,s(o)}),this.parent=Z.b,this.transform_error=i??((r=this.parent)==null?void 0:r.transform_error)??(o=>o),W(this,Me,Ss(()=>{ke(this,ye,Nr).call(this)},ic))}defer_effect(e){Hr(e,w(this,Hn),w(this,qn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!w(this,mt).pending}update_pending_count(e){ke(this,ye,Rr).call(this,e),W(this,dn,w(this,dn)+e),!(!w(this,Ct)||w(this,Un))&&(W(this,Un,!0),At(()=>{W(this,Un,!1),w(this,Ct)&&Sn(w(this,Ct),w(this,dn))}))}get_effect_pending(){return w(this,ti).call(this),v(w(this,Ct))}error(e){var n=w(this,mt).onerror;let s=w(this,mt).failed;if(!n&&!s)throw e;w(this,vt)&&(De(w(this,vt)),W(this,vt,null)),w(this,je)&&(De(w(this,je)),W(this,je,null)),w(this,rt)&&(De(w(this,rt)),W(this,rt,null));var i=!1,r=!1;const o=()=>{if(i){Yl();return}i=!0,r&&Kl(),w(this,rt)!==null&&nn(w(this,rt),()=>{W(this,rt,null)}),ke(this,ye,oi).call(this,()=>{Pt.ensure(),ke(this,ye,Nr).call(this)})},a=l=>{try{r=!0,n==null||n(l,o),r=!1}catch(u){Mt(u,w(this,Me)&&w(this,Me).parent)}s&&W(this,rt,ke(this,ye,oi).call(this,()=>{Pt.ensure();try{return Ve(()=>{var u=Z;u.b=this,u.f|=ci,s(w(this,Qe),()=>l,()=>o)})}catch(u){return Mt(u,w(this,Me).parent),null}}))};At(()=>{var l;try{l=this.transform_error(e)}catch(u){Mt(u,w(this,Me)&&w(this,Me).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,u=>Mt(u,w(this,Me)&&w(this,Me).parent)):a(l)})}}Qe=new WeakMap,kr=new WeakMap,mt=new WeakMap,hn=new WeakMap,Me=new WeakMap,vt=new WeakMap,je=new WeakMap,rt=new WeakMap,It=new WeakMap,dn=new WeakMap,Gt=new WeakMap,Un=new WeakMap,Hn=new WeakMap,qn=new WeakMap,Ct=new WeakMap,ti=new WeakMap,ye=new WeakSet,Ep=function(){try{W(this,vt,Ve(()=>w(this,hn).call(this,w(this,Qe))))}catch(e){this.error(e)}},Ip=function(e){const n=w(this,mt).failed;n&&W(this,rt,Ve(()=>{n(w(this,Qe),()=>e,()=>()=>{})}))},Cp=function(){const e=w(this,mt).pending;e&&(this.is_pending=!0,W(this,je,Ve(()=>e(w(this,Qe)))),At(()=>{var n=W(this,It,document.createDocumentFragment()),s=_t();n.append(s),W(this,vt,ke(this,ye,oi).call(this,()=>(Pt.ensure(),Ve(()=>w(this,hn).call(this,s))))),w(this,Gt)===0&&(w(this,Qe).before(n),W(this,It,null),nn(w(this,je),()=>{W(this,je,null)}),ke(this,ye,ri).call(this))}))},Nr=function(){try{if(this.is_pending=this.has_pending_snippet(),W(this,Gt,0),W(this,dn,0),W(this,vt,Ve(()=>{w(this,hn).call(this,w(this,Qe))})),w(this,Gt)>0){var e=W(this,It,document.createDocumentFragment());go(w(this,vt),e);const n=w(this,mt).pending;W(this,je,Ve(()=>n(w(this,Qe))))}else ke(this,ye,ri).call(this)}catch(n){this.error(n)}},ri=function(){this.is_pending=!1;for(const e of w(this,Hn))fe(e,Ee),nt(e);for(const e of w(this,qn))fe(e,et),nt(e);w(this,Hn).clear(),w(this,qn).clear()},oi=function(e){var n=Z,s=K,i=ve;lt(w(this,Me)),Ge(w(this,Me)),yn(w(this,Me).ctx);try{return e()}catch(r){return jr(r),null}finally{lt(n),Ge(s),yn(i)}},Rr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&ke(n=this.parent,ye,Rr).call(n,e);return}W(this,Gt,w(this,Gt)+e),w(this,Gt)===0&&(ke(this,ye,ri).call(this),w(this,je)&&nn(w(this,je),()=>{W(this,je,null)}),w(this,It)&&(w(this,Qe).before(w(this,It)),W(this,It,null)))};function ac(t,e,n,s){const i=Xn()?bs:mi;var r=t.filter(h=>!h.settled);if(n.length===0&&r.length===0){s(e.map(i));return}var o=Z,a=lc(),l=r.length===1?r[0].promise:r.length>1?Promise.all(r.map(h=>h.promise)):null;function u(h){a();try{s(h)}catch(d){o.f&St||Mt(d,o)}gi()}if(n.length===0){l.then(()=>u(e.map(i)));return}function c(){a(),Promise.all(n.map(h=>uc(h))).then(h=>u([...e.map(i),...h])).catch(h=>Mt(h,o))}l?l.then(c):c()}function lc(){var t=Z,e=K,n=ve,s=z;return function(r=!0){lt(t),Ge(e),yn(n),r&&(s==null||s.activate())}}function gi(t=!0){lt(null),Ge(null),yn(null),t&&(z==null||z.deactivate())}function cc(){var t=Z.b,e=z,n=t.is_rendered();return t.update_pending_count(1),e.increment(n),()=>{t.update_pending_count(-1),e.decrement(n)}}function bs(t){var e=xe|Ee,n=K!==null&&K.f&xe?K:null;return Z!==null&&(Z.f|=wn),{ctx:ve,deps:null,effects:null,equals:Fr,f:e,fn:t,reactions:null,rv:0,v:Te,wv:0,parent:n??Z,ac:null}}function uc(t,e,n){Z===null&&Bl();var i=void 0,r=tn(Te),o=!K,a=new Map;return Tc(()=>{var d;var l=Mr();i=l.promise;try{Promise.resolve(t()).then(l.resolve,l.reject).finally(gi)}catch(p){l.reject(p),gi()}var u=z;if(o){var c=cc();(d=a.get(u))==null||d.reject($t),a.delete(u),a.set(u,l)}const h=(p,f=void 0)=>{if(u.activate(),f)f!==$t&&(r.f|=Rt,Sn(r,f));else{r.f&Rt&&(r.f^=Rt),Sn(r,p);for(const[m,S]of a){if(a.delete(m),m===u)break;S.reject($t)}}c&&c()};l.promise.then(h,p=>h(null,p||"unknown"))}),yi(()=>{for(const l of a.values())l.reject($t)}),new Promise(l=>{function u(c){function h(){c===i?l(r):u(i)}c.then(h,h)}u(i)})}function re(t){const e=bs(t);return vo(e),e}function mi(t){const e=bs(t);return e.equals=Wr,e}function hc(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)De(e[n])}}function dc(t){for(var e=t.parent;e!==null;){if(!(e.f&xe))return e.f&St?null:e;e=e.parent}return null}function vi(t){var e,n=Z;lt(dc(t));try{t.f&=~Qt,hc(t),e=_o(t)}finally{lt(n)}return e}function Yr(t){var e=vi(t);if(!t.equals(e)&&(t.wv=yo(),(!(z!=null&&z.is_fork)||t.deps===null)&&(t.v=e,t.deps===null))){fe(t,_e);return}Ft||(Ie!==null?(bi()||z!=null&&z.is_fork)&&Ie.set(t,e):di(t))}function fc(t){var e,n;if(t.effects!==null)for(const s of t.effects)(s.teardown||s.ac)&&((e=s.teardown)==null||e.call(s),(n=s.ac)==null||n.abort($t),s.teardown=Dl,s.ac=null,es(s,0),_i(s))}function Jr(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&kn(e)}let wi=new Set;const Lt=new Map;let Qr=!1;function tn(t,e){var n={f:0,v:t,reactions:null,equals:Fr,rv:0,wv:0};return n}function le(t,e){const n=tn(t);return vo(n),n}function pc(t,e=!1,n=!0){var i;const s=tn(t);return e||(s.equals=Wr),bn&&n&&ve!==null&&ve.l!==null&&((i=ve.l).s??(i.s=[])).push(s),s}function D(t,e,n=!1){K!==null&&(!st||K.f&Lr)&&Xn()&&K.f&(xe|yt|hi|Lr)&&(Ke===null||!mn.call(Ke,t))&&Gl();let s=n?at(e):e;return Sn(t,s)}function Sn(t,e){if(!t.equals(e)){var n=t.v;Ft?Lt.set(t,e):Lt.set(t,n),t.v=e;var s=Pt.ensure();if(s.capture(t,n),t.f&xe){const i=t;t.f&Ee&&vi(i),di(i)}t.wv=yo(),$r(t,Ee),Xn()&&Z!==null&&Z.f&_e&&!(Z.f&($e|Xt))&&(Xe===null?Ic([t]):Xe.push(t)),!s.is_fork&&wi.size>0&&!Qr&&gc()}return e}function gc(){Qr=!1;for(const t of wi)t.f&_e&&fe(t,et),$n(t)&&kn(t);wi.clear()}function Zr(t,e=1){var n=v(t),s=e===1?n++:n--;return D(t,n),s}function Jn(t){D(t,t.v+1)}function $r(t,e){var n=t.reactions;if(n!==null)for(var s=Xn(),i=n.length,r=0;r<i;r++){var o=n[r],a=o.f;if(!(!s&&o===Z)){var l=(a&Ee)===0;if(l&&fe(o,e),a&xe){var u=o;Ie==null||Ie.delete(u),a&Qt||(a&qe&&(o.f|=Qt),$r(u,et))}else l&&(a&yt&&tt!==null&&tt.add(o),nt(o))}}}function at(t){if(typeof t!="object"||t===null||Zt in t)return t;const e=Or(t);if(e!==Nl&&e!==Rl)return t;var n=new Map,s=li(t),i=le(0),r=rn,o=a=>{if(rn===r)return a();var l=K,u=rn;Ge(null),bo(r);var c=a();return Ge(l),bo(u),c};return s&&n.set("length",le(t.length)),new Proxy(t,{defineProperty(a,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&ql();var c=n.get(l);return c===void 0?o(()=>{var h=le(u.value);return n.set(l,h),h}):D(c,u.value,!0),!0},deleteProperty(a,l){var u=n.get(l);if(u===void 0){if(l in a){const c=o(()=>le(Te));n.set(l,c),Jn(i)}}else D(u,Te),Jn(i);return!0},get(a,l,u){var p;if(l===Zt)return t;var c=n.get(l),h=l in a;if(c===void 0&&(!h||(p=vn(a,l))!=null&&p.writable)&&(c=o(()=>{var f=at(h?a[l]:Te),m=le(f);return m}),n.set(l,c)),c!==void 0){var d=v(c);return d===Te?void 0:d}return Reflect.get(a,l,u)},getOwnPropertyDescriptor(a,l){var u=Reflect.getOwnPropertyDescriptor(a,l);if(u&&"value"in u){var c=n.get(l);c&&(u.value=v(c))}else if(u===void 0){var h=n.get(l),d=h==null?void 0:h.v;if(h!==void 0&&d!==Te)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(a,l){var d;if(l===Zt)return!0;var u=n.get(l),c=u!==void 0&&u.v!==Te||Reflect.has(a,l);if(u!==void 0||Z!==null&&(!c||(d=vn(a,l))!=null&&d.writable)){u===void 0&&(u=o(()=>{var p=c?at(a[l]):Te,f=le(p);return f}),n.set(l,u));var h=v(u);if(h===Te)return!1}return c},set(a,l,u,c){var I;var h=n.get(l),d=l in a;if(s&&l==="length")for(var p=u;p<h.v;p+=1){var f=n.get(p+"");f!==void 0?D(f,Te):p in a&&(f=o(()=>le(Te)),n.set(p+"",f))}if(h===void 0)(!d||(I=vn(a,l))!=null&&I.writable)&&(h=o(()=>le(void 0)),D(h,at(u)),n.set(l,h));else{d=h.v!==Te;var m=o(()=>at(u));D(h,m)}var S=Reflect.getOwnPropertyDescriptor(a,l);if(S!=null&&S.set&&S.set.call(c,u),!d){if(s&&typeof l=="string"){var T=n.get("length"),x=Number(l);Number.isInteger(x)&&x>=T.v&&D(T,x+1)}Jn(i)}return!0},ownKeys(a){v(i);var l=Reflect.ownKeys(a).filter(h=>{var d=n.get(h);return d===void 0||d.v!==Te});for(var[u,c]of n)c.v!==Te&&!(u in a)&&l.push(u);return l},setPrototypeOf(){Vl()}})}function eo(t){try{if(t!==null&&typeof t=="object"&&Zt in t)return t[Zt]}catch{}return t}function mc(t,e){return Object.is(eo(t),eo(e))}var to,no,so,io;function vc(){if(to===void 0){to=window,no=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;so=vn(e,"firstChild").get,io=vn(e,"nextSibling").get,Ar(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Ar(n)&&(n.__t=void 0)}}function _t(t=""){return document.createTextNode(t)}function _n(t){return so.call(t)}function Qn(t){return io.call(t)}function O(t,e){return _n(t)}function Bt(t,e=!1){{var n=_n(t);return n instanceof Comment&&n.data===""?Qn(n):n}}function H(t,e=1,n=!1){let s=t;for(;e--;)s=Qn(s);return s}function wc(t){t.textContent=""}function ro(){return!1}function oo(t,e,n){return document.createElementNS(Dr,t,void 0)}let ao=!1;function bc(){ao||(ao=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function ys(t){var e=K,n=Z;Ge(null),lt(null);try{return t()}finally{Ge(e),lt(n)}}function yc(t,e,n,s=n){t.addEventListener(e,()=>ys(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),bc()}function Sc(t){Z===null&&(K===null&&jl(),zl()),Ft&&Wl()}function _c(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function kt(t,e,n){var s=Z;s!==null&&s.f&Be&&(t|=Be);var i={ctx:ve,deps:null,nodes:null,f:t|Ee|qe,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{kn(i)}catch(a){throw De(i),a}else e!==null&&nt(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&!(r.f&wn)&&(r=r.first,t&yt&&t&Jt&&r!==null&&(r.f|=Jt)),r!==null&&(r.parent=s,s!==null&&_c(r,s),K!==null&&K.f&xe&&!(t&Xt))){var o=K;(o.effects??(o.effects=[])).push(r)}return i}function bi(){return K!==null&&!st}function yi(t){const e=kt(ms,null,!1);return fe(e,_e),e.teardown=t,e}function Zn(t){Sc();var e=Z.f,n=!K&&(e&$e)!==0&&(e&Yt)===0;if(n){var s=ve;(s.e??(s.e=[])).push(t)}else return lo(t)}function lo(t){return kt(Kn|Al,t,!1)}function kc(t){Pt.ensure();const e=kt(Xt|wn,t,!0);return(n={})=>new Promise(s=>{n.outro?nn(e,()=>{De(e),s(void 0)}):(De(e),s(void 0))})}function co(t){return kt(Kn,t,!1)}function Tc(t){return kt(hi|wn,t,!0)}function Si(t,e=0){return kt(ms|e,t,!0)}function G(t,e=[],n=[],s=[]){ac(s,e,n,i=>{kt(ms,()=>t(...i.map(v)),!0)})}function Ss(t,e=0){var n=kt(yt|e,t,!0);return n}function Ve(t){return kt($e|wn,t,!0)}function uo(t){var e=t.teardown;if(e!==null){const n=Ft,s=K;mo(!0),Ge(null);try{e.call(null)}finally{mo(n),Ge(s)}}}function _i(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&ys(()=>{i.abort($t)});var s=n.next;n.f&Xt?n.parent=null:De(n,e),n=s}}function xc(t){for(var e=t.first;e!==null;){var n=e.next;e.f&$e||De(e),e=n}}function De(t,e=!0){var n=!1;(e||t.f&Br)&&t.nodes!==null&&t.nodes.end!==null&&(Ec(t.nodes.start,t.nodes.end),n=!0),_i(t,e&&!n),es(t,0),fe(t,St);var s=t.nodes&&t.nodes.t;if(s!==null)for(const r of s)r.stop();uo(t);var i=t.parent;i!==null&&i.first!==null&&ho(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Ec(t,e){for(;t!==null;){var n=t===e?null:Qn(t);t.remove(),t=n}}function ho(t){var e=t.parent,n=t.prev,s=t.next;n!==null&&(n.next=s),s!==null&&(s.prev=n),e!==null&&(e.first===t&&(e.first=s),e.last===t&&(e.last=n))}function nn(t,e,n=!0){var s=[];fo(t,s,!0);var i=()=>{n&&De(t),e&&e()},r=s.length;if(r>0){var o=()=>--r||i();for(var a of s)a.out(o)}else i()}function fo(t,e,n){if(!(t.f&Be)){t.f^=Be;var s=t.nodes&&t.nodes.t;if(s!==null)for(const a of s)(a.is_global||n)&&e.push(a);for(var i=t.first;i!==null;){var r=i.next,o=(i.f&Jt)!==0||(i.f&$e)!==0&&(t.f&yt)!==0;fo(i,e,o?n:!1),i=r}}}function ki(t){po(t,!0)}function po(t,e){if(t.f&Be){t.f^=Be,t.f&_e||(fe(t,Ee),nt(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Jt)!==0||(n.f&$e)!==0;po(n,i?e:!1),n=s}var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||e)&&o.in()}}function go(t,e){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end;n!==null;){var i=n===s?null:Qn(n);e.append(n),n=i}}let _s=!1,Ft=!1;function mo(t){Ft=t}let K=null,st=!1;function Ge(t){K=t}let Z=null;function lt(t){Z=t}let Ke=null;function vo(t){K!==null&&(Ke===null?Ke=[t]:Ke.push(t))}let Oe=null,Fe=0,Xe=null;function Ic(t){Xe=t}let wo=1,sn=0,rn=sn;function bo(t){rn=t}function yo(){return++wo}function $n(t){var e=t.f;if(e&Ee)return!0;if(e&xe&&(t.f&=~Qt),e&et){for(var n=t.deps,s=n.length,i=0;i<s;i++){var r=n[i];if($n(r)&&Yr(r),r.wv>t.wv)return!0}e&qe&&Ie===null&&fe(t,_e)}return!1}function So(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Ke!==null&&mn.call(Ke,t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&xe?So(r,e,!1):e===r&&(n?fe(r,Ee):r.f&_e&&fe(r,et),nt(r))}}function _o(t){var m;var e=Oe,n=Fe,s=Xe,i=K,r=Ke,o=ve,a=st,l=rn,u=t.f;Oe=null,Fe=0,Xe=null,K=u&($e|Xt)?null:t,Ke=null,yn(t.ctx),st=!1,rn=++sn,t.ac!==null&&(ys(()=>{t.ac.abort($t)}),t.ac=null);try{t.f|=ui;var c=t.fn,h=c();t.f|=Yt;var d=t.deps,p=z==null?void 0:z.is_fork;if(Oe!==null){var f;if(p||es(t,Fe),d!==null&&Fe>0)for(d.length=Fe+Oe.length,f=0;f<Oe.length;f++)d[Fe+f]=Oe[f];else t.deps=d=Oe;if(bi()&&t.f&qe)for(f=Fe;f<d.length;f++)((m=d[f]).reactions??(m.reactions=[])).push(t)}else!p&&d!==null&&Fe<d.length&&(es(t,Fe),d.length=Fe);if(Xn()&&Xe!==null&&!st&&d!==null&&!(t.f&(xe|et|Ee)))for(f=0;f<Xe.length;f++)So(Xe[f],t);if(i!==null&&i!==t){if(sn++,i.deps!==null)for(let S=0;S<n;S+=1)i.deps[S].rv=sn;if(e!==null)for(const S of e)S.rv=sn;Xe!==null&&(s===null?s=Xe:s.push(...Xe))}return t.f&Rt&&(t.f^=Rt),h}catch(S){return jr(S)}finally{t.f^=ui,Oe=e,Fe=n,Xe=s,K=i,Ke=r,yn(o),st=a,rn=l}}function Cc(t,e){let n=e.reactions;if(n!==null){var s=El.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}if(n===null&&e.f&xe&&(Oe===null||!mn.call(Oe,e))){var r=e;r.f&qe&&(r.f^=qe,r.f&=~Qt),di(r),fc(r),es(r,0)}}function es(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)Cc(t,n[s])}function kn(t){var e=t.f;if(!(e&St)){fe(t,_e);var n=Z,s=_s;Z=t,_s=!0;try{e&(yt|Pr)?xc(t):_i(t),uo(t);var i=_o(t);t.teardown=typeof i=="function"?i:null,t.wv=wo;var r;ai&&Ql&&t.f&Ee&&t.deps}finally{_s=s,Z=n}}}async function Nc(){await Promise.resolve(),tc()}function v(t){var e=t.f,n=(e&xe)!==0;if(K!==null&&!st){var s=Z!==null&&(Z.f&St)!==0;if(!s&&(Ke===null||!mn.call(Ke,t))){var i=K.deps;if(K.f&ui)t.rv<sn&&(t.rv=sn,Oe===null&&i!==null&&i[Fe]===t?Fe++:Oe===null?Oe=[t]:Oe.push(t));else{(K.deps??(K.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[K]:mn.call(r,K)||r.push(K)}}}if(Ft&&Lt.has(t))return Lt.get(t);if(n){var o=t;if(Ft){var a=o.v;return(!(o.f&_e)&&o.reactions!==null||To(o))&&(a=vi(o)),Lt.set(o,a),a}var l=(o.f&qe)===0&&!st&&K!==null&&(_s||(K.f&qe)!==0),u=(o.f&Yt)===0;$n(o)&&(l&&(o.f|=qe),Yr(o)),l&&!u&&(Jr(o),ko(o))}if(Ie!=null&&Ie.has(t))return Ie.get(t);if(t.f&Rt)throw t.v;return t.v}function ko(t){if(t.f|=qe,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&xe&&!(e.f&qe)&&(Jr(e),ko(e))}function To(t){if(t.v===Te)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Lt.has(e)||e.f&xe&&To(e))return!0;return!1}function ts(t){var e=st;try{return st=!0,t()}finally{st=e}}const on=Symbol("events"),xo=new Set,Ti=new Set;function Rc(t,e,n,s={}){function i(r){if(s.capture||xi.call(e,r),!r.cancelBubble)return ys(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?At(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function Tt(t,e,n,s,i){var r={capture:s,passive:i},o=Rc(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&yi(()=>{e.removeEventListener(t,o,r)})}function Tn(t,e,n){(e[on]??(e[on]={}))[t]=n}function ks(t){for(var e=0;e<t.length;e++)xo.add(t[e]);for(var n of Ti)n(t)}let Eo=null;function xi(t){var S,T;var e=this,n=e.ownerDocument,s=t.type,i=((S=t.composedPath)==null?void 0:S.call(t))||[],r=i[0]||t.target;Eo=t;var o=0,a=Eo===t&&t[on];if(a){var l=i.indexOf(a);if(l!==-1&&(e===document||e===window)){t[on]=e;return}var u=i.indexOf(e);if(u===-1)return;l<=u&&(o=l)}if(r=i[o]||t.target,r!==e){Il(t,"currentTarget",{configurable:!0,get(){return r||n}});var c=K,h=Z;Ge(null),lt(null);try{for(var d,p=[];r!==null;){var f=r.assignedSlot||r.parentNode||r.host||null;try{var m=(T=r[on])==null?void 0:T[s];m!=null&&(!r.disabled||t.target===r)&&m.call(r,t)}catch(x){d?p.push(x):d=x}if(t.cancelBubble||f===e||f===null)break;r=f}if(d){for(let x of p)queueMicrotask(()=>{throw x});throw d}}finally{t[on]=e,delete t.currentTarget,Ge(c),lt(h)}}}const Ei=((dl=globalThis==null?void 0:globalThis.window)==null?void 0:dl.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Dc(t){return(Ei==null?void 0:Ei.createHTML(t))??t}function Io(t){var e=oo("template");return e.innerHTML=Dc(t.replaceAll("<!>","<!---->")),e.content}function ns(t,e){var n=Z;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function V(t,e){var n=(e&Tl)!==0,s=(e&xl)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=Io(r?t:"<!>"+t),n||(i=_n(i)));var o=s||no?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=_n(o),l=o.lastChild;ns(a,l)}else ns(o,o);return o}}function Oc(t,e,n="svg"){var s=!t.startsWith("<!>"),i=`<${n}>${s?t:"<!>"+t}</${n}>`,r;return()=>{if(!r){var o=Io(i),a=_n(o);r=_n(a)}var l=r.cloneNode(!0);return ns(l,l),l}}function Ts(t,e){return Oc(t,e,"svg")}function xs(t=""){{var e=_t(t+"");return ns(e,e),e}}function Es(){var t=document.createDocumentFragment(),e=document.createComment(""),n=_t();return t.append(e,n),ns(e,n),t}function M(t,e){t!==null&&t.before(e)}const Ac=["touchstart","touchmove"];function Mc(t){return Ac.includes(t)}function $(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=`${n}`)}function Pc(t,e){return Lc(t,e)}const Is=new Map;function Lc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:o=!0,transformError:a}){vc();var l=void 0,u=kc(()=>{var c=n??e.appendChild(_t());rc(c,{pending:()=>{}},p=>{Dt({});var f=ve;r&&(f.c=r),i&&(s.$$events=i),l=t(p,s)||{},Ot()},a);var h=new Set,d=p=>{for(var f=0;f<p.length;f++){var m=p[f];if(!h.has(m)){h.add(m);var S=Mc(m);for(const I of[e,document]){var T=Is.get(I);T===void 0&&(T=new Map,Is.set(I,T));var x=T.get(m);x===void 0?(I.addEventListener(m,xi,{passive:S}),T.set(m,1)):T.set(m,x+1)}}}};return d(gs(xo)),Ti.add(d),()=>{var S;for(var p of h)for(const T of[e,document]){var f=Is.get(T),m=f.get(p);--m==0?(T.removeEventListener(p,xi),f.delete(p),f.size===0&&Is.delete(T)):f.set(p,m)}Ti.delete(d),c!==n&&((S=c.parentNode)==null||S.removeChild(c))}});return Bc.set(l,u),l}let Bc=new WeakMap;class Co{constructor(e,n=!0){bt(this,"anchor");q(this,ot,new Map);q(this,wt,new Map);q(this,Ue,new Map);q(this,fn,new Set);q(this,us,!0);q(this,hs,()=>{var e=z;if(w(this,ot).has(e)){var n=w(this,ot).get(e),s=w(this,wt).get(n);if(s)ki(s),w(this,fn).delete(n);else{var i=w(this,Ue).get(n);i&&(w(this,wt).set(n,i.effect),w(this,Ue).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,o]of w(this,ot)){if(w(this,ot).delete(r),r===e)break;const a=w(this,Ue).get(o);a&&(De(a.effect),w(this,Ue).delete(o))}for(const[r,o]of w(this,wt)){if(r===n||w(this,fn).has(r))continue;const a=()=>{if(Array.from(w(this,ot).values()).includes(r)){var u=document.createDocumentFragment();go(o,u),u.append(_t()),w(this,Ue).set(r,{effect:o,fragment:u})}else De(o);w(this,fn).delete(r),w(this,wt).delete(r)};w(this,us)||!s?(w(this,fn).add(r),nn(o,a,!1)):a()}}});q(this,ni,e=>{w(this,ot).delete(e);const n=Array.from(w(this,ot).values());for(const[s,i]of w(this,Ue))n.includes(s)||(De(i.effect),w(this,Ue).delete(s))});this.anchor=e,W(this,us,n)}ensure(e,n){var s=z,i=ro();if(n&&!w(this,wt).has(e)&&!w(this,Ue).has(e))if(i){var r=document.createDocumentFragment(),o=_t();r.append(o),w(this,Ue).set(e,{effect:Ve(()=>n(o)),fragment:r})}else w(this,wt).set(e,Ve(()=>n(this.anchor)));if(w(this,ot).set(s,e),i){for(const[a,l]of w(this,wt))a===e?s.unskip_effect(l):s.skip_effect(l);for(const[a,l]of w(this,Ue))a===e?s.unskip_effect(l.effect):s.skip_effect(l.effect);s.oncommit(w(this,hs)),s.ondiscard(w(this,ni))}else w(this,hs).call(this)}}ot=new WeakMap,wt=new WeakMap,Ue=new WeakMap,fn=new WeakMap,us=new WeakMap,hs=new WeakMap,ni=new WeakMap;function Ii(t){ve===null&&Ll(),bn&&ve.l!==null?Fc(ve).m.push(t):Zn(()=>{const e=ts(t);if(typeof e=="function")return e})}function Fc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function ce(t,e,n=!1){var s=new Co(t),i=n?Jt:0;function r(o,a){s.ensure(o,a)}Ss(()=>{var o=!1;e((a,l=0)=>{o=!0,r(l,a)}),o||r(!1,null)},i)}function xn(t,e){return e}function Wc(t,e,n){for(var s=[],i=e.length,r,o=e.length,a=0;a<i;a++){let h=e[a];nn(h,()=>{if(r){if(r.pending.delete(h),r.done.add(h),r.pending.size===0){var d=t.outrogroups;Ci(gs(r.done)),d.delete(r),d.size===0&&(t.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=s.length===0&&n!==null;if(l){var u=n,c=u.parentNode;wc(c),c.append(u),t.items.clear()}Ci(e,!l)}else r={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(r)}function Ci(t,e=!0){for(var n=0;n<t.length;n++)De(t[n],e)}var No;function En(t,e,n,s,i,r=null){var o=t,a=new Map;{var l=t;o=l.appendChild(_t())}var u=null,c=mi(()=>{var S=n();return li(S)?S:S==null?[]:gs(S)}),h,d=!0;function p(){m.fallback=u,zc(m,h,o,e,s),u!==null&&(h.length===0?u.f&Nt?(u.f^=Nt,is(u,null,o)):ki(u):nn(u,()=>{u=null}))}var f=Ss(()=>{h=v(c);for(var S=h.length,T=new Set,x=z,I=ro(),g=0;g<S;g+=1){var b=h[g],_=s(b,g),k=d?null:a.get(_);k?(k.v&&Sn(k.v,b),k.i&&Sn(k.i,g),I&&x.unskip_effect(k.e)):(k=jc(a,d?o:No??(No=_t()),b,_,g,i,e,n),d||(k.e.f|=Nt),a.set(_,k)),T.add(_)}if(S===0&&r&&!u&&(d?u=Ve(()=>r(o)):(u=Ve(()=>r(No??(No=_t()))),u.f|=Nt)),S>T.size&&Fl(),!d)if(I){for(const[y,E]of a)T.has(y)||x.skip_effect(E.e);x.oncommit(p),x.ondiscard(()=>{})}else p();v(c)}),m={effect:f,items:a,outrogroups:null,fallback:u};d=!1}function ss(t){for(;t!==null&&!(t.f&$e);)t=t.next;return t}function zc(t,e,n,s,i){var y;var r=e.length,o=t.items,a=ss(t.effect.first),l,u=null,c=[],h=[],d,p,f,m;for(m=0;m<r;m+=1){if(d=e[m],p=i(d,m),f=o.get(p).e,t.outrogroups!==null)for(const E of t.outrogroups)E.pending.delete(f),E.done.delete(f);if(f.f&Nt)if(f.f^=Nt,f===a)is(f,null,n);else{var S=u?u.next:a;f===t.effect.last&&(t.effect.last=f.prev),f.prev&&(f.prev.next=f.next),f.next&&(f.next.prev=f.prev),Wt(t,u,f),Wt(t,f,S),is(f,S,n),u=f,c=[],h=[],a=ss(u.next);continue}if(f.f&Be&&ki(f),f!==a){if(l!==void 0&&l.has(f)){if(c.length<h.length){var T=h[0],x;u=T.prev;var I=c[0],g=c[c.length-1];for(x=0;x<c.length;x+=1)is(c[x],T,n);for(x=0;x<h.length;x+=1)l.delete(h[x]);Wt(t,I.prev,g.next),Wt(t,u,I),Wt(t,g,T),a=T,u=g,m-=1,c=[],h=[]}else l.delete(f),is(f,a,n),Wt(t,f.prev,f.next),Wt(t,f,u===null?t.effect.first:u.next),Wt(t,u,f),u=f;continue}for(c=[],h=[];a!==null&&a!==f;)(l??(l=new Set)).add(a),h.push(a),a=ss(a.next);if(a===null)continue}f.f&Nt||c.push(f),u=f,a=ss(f.next)}if(t.outrogroups!==null){for(const E of t.outrogroups)E.pending.size===0&&(Ci(gs(E.done)),(y=t.outrogroups)==null||y.delete(E));t.outrogroups.size===0&&(t.outrogroups=null)}if(a!==null||l!==void 0){var b=[];if(l!==void 0)for(f of l)f.f&Be||b.push(f);for(;a!==null;)!(a.f&Be)&&a!==t.fallback&&b.push(a),a=ss(a.next);var _=b.length;if(_>0){var k=r===0?n:null;Wc(t,b,k)}}}function jc(t,e,n,s,i,r,o,a){var l=o&ie?o&ps?tn(n):pc(n,!1,!1):null,u=o&be?tn(i):null;return{v:l,i:u,e:Ve(()=>(r(e,l??n,u??i,a),()=>{t.delete(s)}))}}function is(t,e,n){if(t.nodes)for(var s=t.nodes.start,i=t.nodes.end,r=e&&!(e.f&Nt)?e.nodes.start:n;s!==null;){var o=Qn(s);if(r.before(s),s===i)return;s=o}}function Wt(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function Ro(t,e,n,s,i){var a;var r=(a=e.$$slots)==null?void 0:a[n],o=!1;r===!0&&(r=e.children,o=!0),r===void 0||r(t,o?()=>s:s)}function Do(t,e,n){var s=new Co(t);Ss(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},Jt)}function zt(t,e){co(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=oo("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function Oo(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Oo(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Uc(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Oo(t))&&(s&&(s+=" "),s+=e);return s}function In(t){return typeof t=="object"?Uc(t):t??""}function Hc(t,e,n){var s=t==null?"":""+t;return e&&(s=s?s+" "+e:e),s===""?null:s}function jt(t,e,n,s,i,r){var o=t.__className;if(o!==n||o===void 0){var a=Hc(n,s);a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a),t.__className=n}return r}function Ao(t,e,n=!1){if(t.multiple){if(e==null)return;if(!li(e))return Xl();for(var s of t.options)s.selected=e.includes(Mo(s));return}for(s of t.options){var i=Mo(s);if(mc(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function qc(t){var e=new MutationObserver(()=>{Ao(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),yi(()=>{e.disconnect()})}function Mo(t){return"__value"in t?t.__value:t.value}const Vc=Symbol("is custom element"),Gc=Symbol("is html");function Kc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ce(t,e,n,s){var i=Xc(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[Pl]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Yc(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Xc(t){return t.__attributes??(t.__attributes={[Vc]:t.nodeName.includes("-"),[Gc]:t.namespaceURI===Dr})}var Po=new Map;function Yc(t){var e=t.getAttribute("is")||t.nodeName,n=Po.get(e);if(n)return n;Po.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=Cl(i);for(var o in s)s[o].set&&n.push(o);i=Or(i)}return n}function Jc(t,e,n=e){var s=new WeakSet;yc(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Ni(t)?Ri(r):r,n(r),z!==null&&s.add(z),await Nc(),r!==(r=e())){var o=t.selectionStart,a=t.selectionEnd,l=t.value.length;if(t.value=r??"",a!==null){var u=t.value.length;o===a&&a===l&&u>l?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=o,t.selectionEnd=Math.min(a,u))}}}),ts(e)==null&&t.value&&(n(Ni(t)?Ri(t.value):t.value),z!==null&&s.add(z)),Si(()=>{var i=e();if(t===document.activeElement){var r=fi??z;if(s.has(r))return}Ni(t)&&i===Ri(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Ni(t){var e=t.type;return e==="number"||e==="range"}function Ri(t){return t===""?null:+t}function Lo(t,e){return t===e||(t==null?void 0:t[Zt])===e}function Qc(t={},e,n,s){return co(()=>{var i,r;return Si(()=>{i=r,r=[],ts(()=>{t!==n(...r)&&(e(t,...r),i&&Lo(n(...i),t)&&e(null,...i))})}),()=>{At(()=>{r&&Lo(n(...r),t)&&e(null,...r)})}}),t}let Cs=!1;function Zc(t){var e=Cs;try{return Cs=!1,[t(),Cs]}finally{Cs=e}}function We(t,e,n,s){var I;var i=!bn||(n&yl)!==0,r=(n&_l)!==0,o=(n&kl)!==0,a=s,l=!0,u=()=>(l&&(l=!1,a=o?ts(s):s),a),c;if(r){var h=Zt in t||Ml in t;c=((I=vn(t,e))==null?void 0:I.set)??(h&&e in t?g=>t[e]=g:void 0)}var d,p=!1;r?[d,p]=Zc(()=>t[e]):d=t[e],d===void 0&&s!==void 0&&(d=u(),c&&(i&&Hl(),c(d)));var f;if(i?f=()=>{var g=t[e];return g===void 0?u():(l=!0,g)}:f=()=>{var g=t[e];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&!(n&Sl))return f;if(c){var m=t.$$legacy;return function(g,b){return arguments.length>0?((!i||!b||m||p)&&c(b?f():g),g):f()}}var S=!1,T=(n&bl?bs:mi)(()=>(S=!1,f()));r&&v(T);var x=Z;return function(g,b){if(arguments.length>0){const _=b?v(T):i&&r?at(g):g;return D(T,_),S=!0,a!==void 0&&(a=_),g}return Ft&&S||x.f&St?T.v:v(T)}}function Bo(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Di(t,e,n){let s="";if(n){const i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3),s="; expires="+i.toUTCString()}document.cookie=t+"="+(e||"")+s+"; path=/; secure; samesite=strict"}function Oi(t){const e=t+"=",n=document.cookie.split(";");for(let s=0;s<n.length;s++){let i=n[s];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null}function Fo(){const t="uniqueUserID";let e=Oi(t);return e||(e=Bo(),Di(t,e,365)),e}function ct(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Oi("uniqueUserID");r||(r=Fo());const o={user_agent:navigator.userAgent,screen_width:window.screen.width,screen_height:window.screen.height,language:navigator.language,platform:navigator.platform},a=new Date().toISOString();let l=Oi("sessionID");l||(l=Bo(),Di("sessionID",l,1));const u={event_type:t,store_id:e,session_id:l,event_time:a,data:n,meta:{...s,user_id:r},device_info:o,region:navigator.language.split("-")[1]||null,language:navigator.language.split("-")[0]||"en"};return fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(c=>c.ok?c.json():c.json().then(h=>{throw new Error(h.message||"Failed to track widget event")})).catch(c=>{throw console.error("Widget event tracking error:",c),c})}var Wo={},$c=function(t,e,n,s,i){var r=new Worker(Wo[e]||(Wo[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return r.onmessage=function(o){var a=o.data,l=a.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],i(u,null)}else i(null,a)},r.postMessage(n,s),r},Ye=Uint8Array,Ae=Uint16Array,Ns=Int32Array,Rs=new Ye([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ds=new Ye([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ai=new Ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zo=function(t,e){for(var n=new Ae(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Ns(n[30]),s=1;s<30;++s)for(var r=n[s];r<n[s+1];++r)i[r]=r-n[s]<<5|s;return{b:n,r:i}},jo=zo(Rs,2),eu=jo.b,Os=jo.r;eu[28]=258,Os[258]=28;for(var tu=zo(Ds,0),Mi=tu.r,As=new Ae(32768),ae=0;ae<32768;++ae){var Ut=(ae&43690)>>1|(ae&21845)<<1;Ut=(Ut&52428)>>2|(Ut&13107)<<2,Ut=(Ut&61680)>>4|(Ut&3855)<<4,As[ae]=((Ut&65280)>>8|(Ut&255)<<8)>>1}for(var Cn=function(t,e,n){for(var s=t.length,i=0,r=new Ae(e);i<s;++i)t[i]&&++r[t[i]-1];var o=new Ae(e);for(i=1;i<e;++i)o[i]=o[i-1]+r[i-1]<<1;var a;if(n){a=new Ae(1<<e);var l=15-e;for(i=0;i<s;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],h=o[t[i]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)a[As[h]>>l]=u}else for(a=new Ae(s),i=0;i<s;++i)t[i]&&(a[i]=As[o[t[i]-1]++]>>15-t[i]);return a},Ht=new Ye(288),ae=0;ae<144;++ae)Ht[ae]=8;for(var ae=144;ae<256;++ae)Ht[ae]=9;for(var ae=256;ae<280;++ae)Ht[ae]=7;for(var ae=280;ae<288;++ae)Ht[ae]=8;for(var rs=new Ye(32),ae=0;ae<32;++ae)rs[ae]=5;var Uo=Cn(Ht,9,0),Ho=Cn(rs,5,0),Pi=function(t){return(t+7)/8|0},qo=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Ye(t.subarray(e,n))},nu=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Vo=function(t,e,n){var s=new Error(e||nu[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,Vo),!n)throw s;return s},ut=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},Nn=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8,t[s+2]|=n>>16},Ms=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s,f:t[s]});var i=n.length,r=n.slice();if(!i)return{t:Wi,l:0};if(i==1){var o=new Ye(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(b,_){return b.f-_.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[h].f?u++:h++],l=n[u!=c&&n[u].f<n[h].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=r[0].s,s=1;s<i;++s)r[s].s>d&&(d=r[s].s);var p=new Ae(d+1),f=Ps(n[c-1],p,0);if(f>e){var s=0,m=0,S=f-e,T=1<<S;for(r.sort(function(_,k){return p[k.s]-p[_.s]||_.f-k.f});s<i;++s){var x=r[s].s;if(p[x]>e)m+=T-(1<<f-p[x]),p[x]=e;else break}for(m>>=S;m>0;){var I=r[s].s;p[I]<e?m-=1<<e-p[I]++-1:++s}for(;s>=0&&m;--s){var g=r[s].s;p[g]==e&&(--p[g],++m)}f=e}return{t:new Ye(p),l:f}},Ps=function(t,e,n){return t.s==-1?Math.max(Ps(t.l,e,n+1),Ps(t.r,e,n+1)):e[t.s]=n},Li=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ae(++e),s=0,i=t[0],r=1,o=function(l){n[s++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(i),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(i);r=1,i=t[a]}return{c:n.subarray(0,s),n:e}},Rn=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Bi=function(t,e,n){var s=n.length,i=Pi(e+2);t[i]=s&255,t[i+1]=s>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<s;++r)t[i+r+4]=n[r];return(i+4+s)*8},Fi=function(t,e,n,s,i,r,o,a,l,u,c){ut(e,c++,n),++i[256];for(var h=Ms(i,15),d=h.t,p=h.l,f=Ms(r,15),m=f.t,S=f.l,T=Li(d),x=T.c,I=T.n,g=Li(m),b=g.c,_=g.n,k=new Ae(19),y=0;y<x.length;++y)++k[x[y]&31];for(var y=0;y<b.length;++y)++k[b[y]&31];for(var E=Ms(k,7),P=E.t,j=E.l,L=19;L>4&&!P[Ai[L-1]];--L);var J=u+5<<3,U=Rn(i,Ht)+Rn(r,rs)+o,B=Rn(i,d)+Rn(r,m)+o+14+3*L+Rn(k,P)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&J<=U&&J<=B)return Bi(e,c,t.subarray(l,l+u));var Y,ee,R,Q;if(ut(e,c,1+(B<U)),c+=2,B<U){Y=Cn(d,p,0),ee=d,R=Cn(m,S,0),Q=m;var N=Cn(P,j,0);ut(e,c,I-257),ut(e,c+5,_-1),ut(e,c+10,L-4),c+=14;for(var y=0;y<L;++y)ut(e,c+3*y,P[Ai[y]]);c+=3*L;for(var A=[x,b],ne=0;ne<2;++ne)for(var oe=A[ne],y=0;y<oe.length;++y){var ue=oe[y]&31;ut(e,c,N[ue]),c+=P[ue],ue>15&&(ut(e,c,oe[y]>>5&127),c+=oe[y]>>12)}}else Y=Uo,ee=Ht,R=Ho,Q=rs;for(var y=0;y<a;++y){var C=s[y];if(C>255){var ue=C>>18&31;Nn(e,c,Y[ue+257]),c+=ee[ue+257],ue>7&&(ut(e,c,C>>23&31),c+=Rs[ue]);var F=C&31;Nn(e,c,R[F]),c+=Q[F],F>3&&(Nn(e,c,C>>5&8191),c+=Ds[F])}else Nn(e,c,Y[C]),c+=ee[C]}return Nn(e,c,Y[256]),c+ee[256]},Go=new Ns([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Wi=new Ye(0),Ko=function(t,e,n,s,i,r){var o=r.z||t.length,a=new Ye(s+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(s,a.length-i),u=r.l,c=(r.r||0)&7;if(e){c&&(l[0]=r.r>>3);for(var h=Go[e-1],d=h>>13,p=h&8191,f=(1<<n)-1,m=r.p||new Ae(32768),S=r.h||new Ae(f+1),T=Math.ceil(n/3),x=2*T,I=function(gn){return(t[gn]^t[gn+1]<<T^t[gn+2]<<x)&f},g=new Ns(25e3),b=new Ae(288),_=new Ae(32),k=0,y=0,E=r.i||0,P=0,j=r.w||0,L=0;E+2<o;++E){var J=I(E),U=E&32767,B=S[J];if(m[U]=B,S[J]=U,j<=E){var Y=o-E;if((k>7e3||P>24576)&&(Y>423||!u)){c=Fi(t,l,0,g,b,_,y,P,L,E-L,c),P=k=y=0,L=E;for(var ee=0;ee<286;++ee)b[ee]=0;for(var ee=0;ee<30;++ee)_[ee]=0}var R=2,Q=0,N=p,A=U-B&32767;if(Y>2&&J==I(E-A))for(var ne=Math.min(d,Y)-1,oe=Math.min(32767,E),ue=Math.min(258,Y);A<=oe&&--N&&U!=B;){if(t[E+R]==t[E+R-A]){for(var C=0;C<ue&&t[E+C]==t[E+C-A];++C);if(C>R){if(R=C,Q=A,C>ne)break;for(var F=Math.min(A,C-2),te=0,ee=0;ee<F;++ee){var Se=E-A+ee&32767,Ze=m[Se],Pe=Se-Ze&32767;Pe>te&&(te=Pe,B=Se)}}}U=B,B=m[U],A+=U-B&32767}if(Q){g[P++]=268435456|Os[R]<<18|Mi[Q];var Le=Os[R]&31,ds=Mi[Q]&31;y+=Rs[Le]+Ds[ds],++b[257+Le],++_[ds],j=E+R,++k}else g[P++]=t[E],++b[t[E]]}}for(E=Math.max(E,j);E<o;++E)g[P++]=t[E],++b[t[E]];c=Fi(t,l,u,g,b,_,y,P,L,E-L,c),u||(r.r=c&7|l[c/8|0]<<3,c-=7,r.h=S,r.p=m,r.i=E,r.w=j)}else{for(var E=r.w||0;E<o+u;E+=65535){var Kt=E+65535;Kt>=o&&(l[c/8|0]=u,Kt=o),c=Bi(l,c+1,t.subarray(E,Kt))}r.i=o}return qo(a,0,s+Pi(c)+i)},Xo=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,s=9;--s;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Yo=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=Xo[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},zi=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new Ye(r.length+t.length);o.set(r),o.set(t,r.length),t=o,i.w=r.length}return Ko(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,s,i)},su=function(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n},Jo=function(t,e,n){for(var s=t(),i=t.toString(),r=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<s.length;++o){var a=s[o],l=r[o];if(typeof a=="function"){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else{e+=u;for(var h in a.prototype)e+=";"+l+".prototype."+h+"="+a.prototype[h].toString()}else e+=u}else n[l]=a}return e},Ls=[],iu=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},ru=function(t,e,n,s){if(!Ls[n]){for(var i="",r={},o=t.length-1,a=0;a<o;++a)i=Jo(t[a],i,r);Ls[n]={c:Jo(t[o],i,r),e:r}}var l=su({},Ls[n].e);return $c(Ls[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,l,iu(l),s)},ou=function(){return[Ye,Ae,Ns,Rs,Ds,Ai,Os,Mi,Uo,Ht,Ho,rs,As,Go,Wi,Cn,ut,Nn,Ms,Ps,Li,Rn,Bi,Fi,Pi,qo,Ko,zi,cu,Qo]},au=function(){return[Zo,$o,Bs,Yo,Xo]},Qo=function(t){return postMessage(t,[t.buffer])},lu=function(t,e,n,s,i,r){var o=ru(n,s,i,function(a,l){o.terminate(),r(a,l)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Bs=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Zo=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Bs(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var s=0;s<=n.length;++s)t[s+10]=n.charCodeAt(s)}},$o=function(t){return 10+(t.filename?t.filename.length+1:0)};function cu(t,e){return zi(t,e||{},0,0)}function uu(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Vo(7),lu(t,e,[ou,au,function(){return[ea]}],function(s){return Qo(ea(s.data[0],s.data[1]))},2,n)}function ea(t,e){e||(e={});var n=Yo(),s=t.length;n.p(t);var i=zi(t,e,$o(e),8),r=i.length;return Zo(i,e),Bs(i,r-8,n.d()),Bs(i,r-4,s),i}var hu=typeof TextDecoder<"u"&&new TextDecoder,du=0;try{hu.decode(Wi,{stream:!0}),du=1}catch{}class ta{constructor(){this.idx=1,this.backDict={}}getKey(e){let n=!1;return this.backDict[e]||(n=!0,this.backDict[e]=this.idx++),[this.backDict[e],n]}}class fu{constructor(e){this.dict=new ta,this.app=e.app,this.isDictDisabled=e.isDictDisabled}sendSetAttribute(e,n,s){if(this.isDictDisabled){const i=[12,e,n,s];return this.app.send(i)}else{const i=[51,e,this.applyDict(n),this.applyDict(s)];return this.app.send(i)}}applyDict(e){const[n,s]=this.dict.getKey(e);return s&&this.app.send([50,n,e]),n}clear(){this.dict=new ta}}class pu{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=gu(s);if(i.type)return i}},this.durationInt=null}setConditions(e){this.conditions=e}async fetchConditions(e,n){try{const s=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}),{conditions:i}=await s.json(),r=[];i.forEach(o=>{o.filters.forEach(l=>{let u;l.type==="fetch"?(u={type:"network_request",subConditions:[],name:o.name},l.filters.forEach(c=>{const h=this.createConditionFromFilter(c);h&&u.subConditions.push(h)})):u=this.createConditionFromFilter(l),u&&(u.type==="session_duration"&&this.processDuration(u.value[0],o.name),r.push({...u,name:o.name}))})}),this.conditions=r}catch{this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(n){this.app.debug.error(n)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e);break}}processFlags(e){const n=this.conditions.filter(s=>s.type==="feature_flag");n.length&&n.forEach(s=>{const i=Dn[s.operator];i&&e.find(r=>i(r.key,s.value))&&this.trigger(s.name)})}processDuration(e,n){this.durationInt=setInterval(()=>{performance.now()>e&&this.trigger(n)},1e3),this.app.attachStopCallback(()=>{this.durationInt&&clearInterval(this.durationInt)})}networkRequest(e){const n=this.conditions.filter(s=>s.type==="network_request");n.length&&n.forEach(s=>{const i=s.subConditions.filter(r=>r.operator!=="isAny");i.length?i.every(o=>{let a;switch(o.key){case"url":a=e[3];break;case"status":a=e[6];break;case"method":a=e[2];break;case"duration":a=e[8];break}const l=Dn[o.operator];if(l&&l(a,o.value))return!0})&&this.trigger(s.name):i.length===0&&s.subConditions.length&&this.trigger(s.name)})}customEvent(e){const n=this.conditions.filter(s=>s.type==="custom_event");n.length&&n.forEach(s=>{const i=Dn[s.operator];i&&(i(e[1],s.value)||i(e[2],s.value))&&this.trigger(s.name)})}clickEvent(e){const n=this.conditions.filter(s=>s.type==="click");n.length&&n.forEach(s=>{const i=Dn[s.operator];i&&(i(e[3],s.value)||i(e[4],s.value))&&this.trigger(s.name)})}pageLocationEvent(e){const n=this.conditions.filter(s=>s.type==="visited_url");n&&n.forEach(s=>{const i=Dn[s.operator];i&&i(e[1],s.value)&&this.trigger(s.name)})}jsExceptionEvent(e){const n=[e[1],e[2],e[3]],s=this.conditions.filter(i=>i.type==="exception");s&&s.forEach(i=>{const r=Dn[i.operator];r&&n.some(o=>r(o,i.value))&&this.trigger(i.name)})}}const Dn={is:(t,e)=>e.some(n=>t.includes(n)),isAny:()=>!0,isNot:(t,e)=>!e.some(n=>t.includes(n)),contains:(t,e)=>e.some(n=>t.includes(n)),notContains:(t,e)=>!e.some(n=>t.includes(n)),startsWith:(t,e)=>e.some(n=>t.startsWith(n)),endsWith:(t,e)=>e.some(n=>t.endsWith(n)),greaterThan:(t,e)=>t>e,greaterOrEqual:(t,e)=>t>=e,lessOrEqual:(t,e)=>t<=e,lessThan:(t,e)=>t<e},gu=t=>{const e={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=i=>{if(Object.keys(e).includes(i))return e[i]};let s={type:"",operator:"",value:t.value,key:""};switch(t.type){case"click":s={type:"click",operator:n(t.operator),value:t.value,key:""};break;case"location":s={type:"visited_url",operator:t.operator,value:t.value,key:""};break;case"custom":s={type:"custom_event",operator:t.operator,value:t.value,key:""};break;case"metadata":s={type:t.source==="featureFlag"?"feature_flag":t.type,operator:t.operator,value:t.value,key:""};break;case"error":s={type:"exception",operator:t.operator,value:t.value,key:""};break;case"duration":s={type:"session_duration",value:t.value[0],key:""};break;case"fetchUrl":s={type:"network_request",key:"url",operator:t.operator,value:t.value};break;case"fetchStatusCode":s={type:"network_request",key:"status",operator:n(t.operator),value:t.value};break;case"fetchMethod":s={type:"network_request",key:"method",operator:n(t.operator),value:t.value};break;case"fetchDuration":s={type:"network_request",key:"duration",operator:n(t.operator),value:t.value};break}return s};class mu{constructor(e){this.app=e,this.flags=[],this.storageKey="__openreplay_flags";const n=this.app.sessionStorage.getItem(this.storageKey);if(n){const s=n.split(";").filter(Boolean);this.flags=s.map(i=>JSON.parse(i))}}getFeatureFlag(e){return this.flags.find(n=>n.key===e)}isFlagEnabled(e){return this.flags.findIndex(n=>n.key===e)!==-1}onFlagsLoad(e){this.onFlagsCb=e}async reloadFlags(e){const n=this.app.sessionStorage.getItem(this.storageKey),s={};n&&n.split(";").filter(Boolean).forEach(c=>{const h=JSON.parse(c);s[h.key]={key:h.key,value:h.value}});const i=this.app.session.getInfo(),r=this.app.session.userInfo,o={projectID:i.projectID,userID:i.userID,metadata:i.metadata,referrer:document.referrer,os:r.userOS,device:r.userDevice,country:r.userCountry,state:r.userState,city:r.userCity,browser:r.userBrowser,persistFlags:s},a=e??this.app.session.getSessionToken(),l=await fetch(this.app.options.ingestPoint+"/v1/web/feature-flags",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(o)});if(l.status===200){const u=await l.json();return this.handleFlags(u.flags)}}handleFlags(e){var r;const n=[];e.forEach(o=>{o.is_persist&&n.push(o)});let s="";return this.diffPersist(n).forEach(o=>{s+=`${JSON.stringify(o)};`}),this.app.sessionStorage.setItem(this.storageKey,s),this.flags=e,(r=this.onFlagsCb)==null?void 0:r.call(this,e)}clearPersistFlags(){this.app.sessionStorage.removeItem(this.storageKey)}diffPersist(e){const n=this.app.sessionStorage.getItem(this.storageKey);if(!n)return e;const i=n.split(";").filter(Boolean).map(r=>JSON.parse(r));return e.filter(r=>i.findIndex(o=>o.key===r.key)===-1)}}const na={htmlmasked:"hidden",masked:"obscured"},ht=!(typeof window>"u"),vu=ht&&navigator.userAgent.match(/firefox|fxios/i),wu=1e5;let ji=ht?Date.now()-performance.now():0;function Ui(){ji=Date.now()-performance.now()}function On(){return ji}const it=ht&&performance.now?()=>Math.round(performance.now()+ji):()=>Date.now(),Hi="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function sa(t){return t.trim().replace(/\s+/g," ")}function ia(t){return t.startsWith("https://")||t.startsWith("http://")}const Fs="https://docs.openreplay.com",ra={};function qt(t,e,n="/"){ra[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${Fs}${n} for more information.`),ra[t]=!0)}function qi(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&qt('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function an(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(na[e]&&qt(`"${n}" attribute`,`"${na[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function bu(t){try{return!!t.contentDocument}catch{return!1}}function oa(t){try{return t instanceof HTMLIFrameElement?t.contentDocument:t instanceof Window?t.document:t instanceof Document?t.defaultView:"nodeType"in t?t.nodeType:"addEventListener"in t&&t.addEventListener,!0}catch(e){if(e instanceof DOMException&&e.name==="SecurityError")return!1}return!0}function aa(t){return t.toString(16).padStart(2,"0")}function yu(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,aa).join("")):Array.from({length:t},()=>aa(Math.floor(Math.random()*16))).join("")}function la(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function Vi(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function ca(t,e){if(e)return new MutationObserver(t);{const n=Vi("MutationObserver");return new window[n](t)}}function ua(t,e,n,s,i){if(!oa(t))return;let r="addEventListener";i||(r=Vi("addEventListener"));try{t[r]?t[r](e,n,s):t.addEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}function ha(t,e,n,s,i){if(!oa(t))return;let r="removeEventListener";i||(r=Vi("removeEventListener"));try{t[r]?t[r](e,n,s):t.removeEventListener(e,n,s)}catch(o){const a=o.message;console.error(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`,e,t)}}class Su{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||this.taskQueue.length===0)return;this.isRunning=!0;const e=()=>{if(this.taskQueue.length===0){this.isRunning=!1;return}const n=this.taskQueue.shift();Promise.resolve(n()).then(()=>{requestAnimationFrame(()=>e())})};e()}}const _u=new Su;function ku(t){_u.addTask(t)}function da(t,e){const n={...t};for(const s in e)if(e.hasOwnProperty(s)){const i=e[s],r=t[s];typeof i=="object"&&!Array.isArray(i)&&i!==null?n[s]=da(r||{},i):n[s]=i}return n}function ln(t){return[0,t]}function Tu(t,e){return[5,t,e]}function xu(t,e){return[6,t,e]}function Eu(){return[7]}function Iu(t,e,n,s,i){return[8,t,e,n,s,i]}function Cu(t,e,n){return[9,t,e,n]}function Nu(t,e,n){return[10,t,e,n]}function Ru(t){return[11,t]}function fa(t,e){return[13,t,e]}function Du(t,e){return[14,t,e]}function Ou(t,e,n){return[16,t,e,n]}function Au(t,e,n){return[18,t,e,n]}function Mu(t,e){return[19,t,e]}function Pu(t,e){return[20,t,e]}function Lu(t,e){return[22,t,e]}function Bu(t,e,n,s,i,r,o,a,l){return[23,t,e,n,s,i,r,o,a,l]}function Fu(t,e,n){return[24,t,e,n]}function Wu(t,e){return[27,t,e]}function zu(t){return[28,t]}function ju(t){return[29,t]}function pa(t,e){return[30,t,e]}function Uu(t,e,n,s){return[49,t,e,n,s]}function Hu(t,e){return[54,t,e]}function qu(t){return[55,t]}function ga(t,e,n,s){return[57,t,e,n,s]}function ma(t){return[58,t]}function Gi(t,e,n,s){return[60,t,e,n,s]}function Vu(t,e,n){return[61,t,e,n]}function Gu(t,e){return[63,t,e]}function Ku(t,e){return[64,t,e]}function Xu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function Ki(t,e){return[70,t,e]}function va(t,e,n){return[71,t,e,n]}function Xi(t,e,n,s){return[73,t,e,n,s]}function wa(t,e){return[75,t,e]}function ba(t,e){return[76,t,e]}function Yu(t,e){return[77,t,e]}function Yi(t,e,n,s){return[78,t,e,n,s]}function Ws(t,e,n,s,i,r,o,a,l){return[83,t,e,n,s,i,r,o,a,l]}function Ju(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function Qu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function ya(t,e,n){return[113,t,e,n]}function Zu(t){return[114,t]}function Sa(t){return[115,t]}function _a(t,e,n,s,i,r,o,a,l,u){return[116,t,e,n,s,i,r,o,a,l,u]}function zs(t){return[117,t]}function cn(t){return[118,t]}function $u(t,e){return[119,t,e]}function eh(t){return[120,t]}function th(t,e,n,s){return[122,t,e,n,s]}const Ji=ht&&"performance"in window&&"memory"in performance?performance:{memory:{}},Qi=ht?(navigator.deviceMemory||0)*1024:0,Zi=Ji.memory.jsHeapSizeLimit||0;function nh(t,e){if(!Object.assign({capturePerformance:!0},e).capturePerformance)return;let s,i;const r=()=>{s===void 0||s===-1||(s++,requestAnimationFrame(r))};t.ticker.attach(()=>{i===void 0||i===-1||i++},0,!1);const o=()=>{s===void 0||i===void 0||(t.send(Uu(s,i,Ji.memory.totalJSHeapSize||0,Ji.memory.usedJSHeapSize||0)),i=s=document.hidden?-1:0)};t.attachStartCallback(()=>{i=s=-1,o(),r()}),t.attachStopCallback(()=>{i=s=void 0}),t.ticker.attach(o,40,!1),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",o,!1,!1)}const ka="__or__watched_tags__";class sh{constructor(e){this.intervals={},this.tags=[],this.sessionStorage=e.sessionStorage,this.errLog=e.errLog,this.onTag=e.onTag;const n=JSON.parse(e.sessionStorage.getItem(ka)??"[]");this.setTags(n),this.observer=new IntersectionObserver(s=>{s.forEach(i=>{if(i.isIntersecting&&i.target){const r=i.target.__or_watcher_tagname;r&&this.onTagRendered(r),this.observer.unobserve(i.target)}})})}async fetchTags(e,n){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(s=>s.json()).then(({tags:s})=>{if(s&&s.length){this.setTags(s);const i=JSON.stringify(s);this.sessionStorage.setItem(ka,i||"")}}).catch(s=>this.errLog(s))}setTags(e){this.tags=e,this.intervals={},e.forEach(n=>{this.intervals[n.id]=setInterval(()=>{const s=document.querySelectorAll(n.selector);if(s.length>0){const i=s[0];i.__or_watcher_tagname=n.id,this.observer.observe(i)}},500)})}onTagRendered(e){this.intervals[e]&&clearInterval(this.intervals[e]),this.onTag(e)}clear(){this.tags.forEach(e=>{clearInterval(this.intervals[e.id])}),this.tags=[],this.intervals={},this.observer.disconnect()}}const ih={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.40)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},rh={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},js={display:"flex","flex-direction":"column",gap:"unset","align-items":"center",padding:"unset",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',"border-radius":"2px",border:"1px solid #D9D9D9",background:"rgba(255, 255, 255, 0.75)",width:"22rem"},oh={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},ah={borderTop:"1px solid rgba(0, 0, 0, 0.06)",borderBottom:"1px solid rgba(0, 0, 0, 0.06)",padding:"1.25rem 0rem",color:"rgba(0, 0, 0, 0.85)",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"400",lineHeight:"auto",whiteSpace:"pre-wrap"},lh={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",cursor:"pointer"},Ta={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},An={display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.625rem",fontSize:"13px",lineHeight:"auto"},ch={padding:"0.5rem",gap:"0.5rem",fontFamily:"Verdana, sans-serif",fontSize:"16px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto",color:"white",display:"flex",alignItems:"center",width:"100%",borderRadius:"2px",background:"rgba(0, 0, 0, 0.75)",boxSizing:"border-box"},Mn={boxSizing:"border-box",display:"block",width:"100%",borderBottom:"1px solid #D9D9D9",background:"#FFF",padding:"0.65rem",alignSelf:"stretch",color:"#000",fontFamily:"Verdana, sans-serif",fontStyle:"normal",fontWeight:"400"},uh={...Mn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},xa={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},Ea={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",width:"100%",boxSizing:"border-box",cursor:"pointer"},Ia={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},hh={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},Ca={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},dh={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #D2DFFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",background:"#D2DFFF",fontSize:"13px",height:"24px",width:"24px"},Na={borderRadius:"0.375rem",border:"1px solid rgba(0, 0, 0, 0.06)",background:"#F5F7FF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",padding:"0.625rem 0.9375rem",gap:"0.5rem",alignSelf:"stretch"},Ra={fontWeight:"bold"},fh={fontSize:"13px",lineHeight:"auto"},Da={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},ph={...Da,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},gh={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},mh={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},Oa={Standard:{width:1280,height:720}};class vh{constructor(e){this.app=e,this.mediaRecorder=null,this.recordedChunks=[],this.stream=null,this.recStartTs=null}async startRecording(e,n,s,i){this.recStartTs=this.app.timestamp();const r=n;try{this.stream=await navigator.mediaDevices.getUserMedia({video:i?{...r,frameRate:{ideal:e}}:!1,audio:s}),this.mediaRecorder=new MediaRecorder(this.stream,{mimeType:"video/webm;codecs=vp9"}),this.recordedChunks=[],this.mediaRecorder.ondataavailable=o=>{o.data.size>0&&this.recordedChunks.push(o.data)},this.mediaRecorder.start()}catch(o){console.error(o)}}async stopRecording(){return new Promise(e=>{this.mediaRecorder&&(this.mediaRecorder.onstop=()=>{const n=new Blob(this.recordedChunks,{type:"video/webm"});e(n)},this.mediaRecorder.stop())})}async sendToAPI(){const e=await this.stopRecording();return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`,{headers:{Authorization:`Bearer ${this.app.session.getSessionToken()}`}}).then(n=>{if(n.ok)return n.json();throw new Error("Failed to get upload url")}).then(({url:n})=>fetch(n,{method:"PUT",headers:{"Content-Type":"video/webm"},body:e})).catch(console.error).finally(()=>{this.discard()})}async saveToFile(e="recorded-video.webm"){const n=await this.stopRecording(),s=URL.createObjectURL(n),i=document.createElement("a");i.style.display="none",i.href=s,i.download=e,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(s),document.body.removeChild(i)}discard(){var e,n;(e=this.mediaRecorder)==null||e.stop(),(n=this.stream)==null||n.getTracks().forEach(s=>s.stop())}}function wh(t,e){e.onmousedown=function(n){const s=t.getBoundingClientRect(),i=n.clientX-s.left,r=n.clientY-s.top;t.style.position="fixed",t.style.zIndex=99999999999999,o(n.pageX,n.pageY);function o(u,c){let h=u-i,d=c-r;h<=5&&(h=5),d<=5&&(d=5),h>=window.innerWidth-s.width&&(h=window.innerWidth-s.width),d>=window.innerHeight-s.height&&(d=window.innerHeight-s.height),t.style.left=`${h}px`,t.style.top=`${d}px`}function a(u){o(u.pageX,u.pageY)}document.addEventListener("mousemove",a);const l=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mouseup",l)},e.ondragstart=function(){return!1}}function bh(){const t=document.createElement("div");t.className="grid";for(let e=0;e<16;e++){const n=document.createElement("div");Object.assign(n.style,{width:"2px",height:"2px",borderRadius:"10px",background:"white"}),n.className="cell",t.appendChild(n)}return Object.assign(t.style,{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridTemplateRows:"repeat(4, 1fr)",gap:"2px",cursor:"grab"}),t}function yh(){const t=document.createElement("div");Object.assign(t.style,{width:"0",height:"0",borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:"7px solid white"});const e=document.createElement("div");return e.appendChild(t),Object.assign(e.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",cursor:"pointer",marginLeft:"auto",transform:"rotate(180deg)"}),e}function Sh(){const t=document.createElement("style");t.type="text/css",t.innerText=`@keyframes spin {
|
|
2
2
|
0% { transform: rotate(0deg); }
|
|
3
3
|
100% { transform: rotate(360deg); }
|
|
4
|
-
}`,document.head.appendChild(t)}function
|
|
4
|
+
}`,document.head.appendChild(t)}function _h(){Sh();const t=document.createElement("div");return t.classList.add("spinner"),Object.assign(t.style,mh),t}function X(t,e,n,s,i){const r=document.createElement(t);return r.className=e,Object.assign(r.style,n),s&&(r.textContent=s),i&&(r.id=i),r}const Us="or_uxt_test_start",$i="or_uxt_task_index",er="or_uxt_session_id",kh="or_uxt_test_id";class Th{constructor(e,n,s,i,r,o,a,l,u){this.ingestPoint=e,this.getTimestamp=n,this.token=s,this.testId=i,this.storageKey=r,this.setStorageKey=o,this.removeStorageKey=a,this.getStorageKey=l,this.getSessionId=u,this.durations={testStart:0,tasks:[]},this.getDurations=()=>this.durations,this.setDurations=h=>{this.durations.testStart=h.testStart,this.durations.tasks=h.tasks},this.signalTask=(h,d,p)=>{if(!h)return console.error("User Testing: No Task ID Given");const f=this.durations.tasks.find(T=>T.taskId===h),m=this.getTimestamp(),S=f?m-f.started:0;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,taskId:h,status:d,duration:S,timestamp:m,taskAnswer:p})})},this.signalTest=h=>{const d=this.getTimestamp();if(h==="begin"&&this.testId){const m=this.getSessionId();this.setStorageKey(er,m),this.setStorageKey(this.storageKey,this.testId.toString()),this.setStorageKey(Us,d.toString())}else this.removeStorageKey(this.storageKey),this.removeStorageKey($i),this.removeStorageKey(Us);const p=this.durations.testStart||d,f=d-p;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,status:h,duration:f,timestamp:d})})};const c=this.getStorageKey(Us);c&&(this.durations.testStart=parseInt(c,10))}}class xh{constructor(e,n){this.app=e,this.storageKey=n,this.bg=X("div","bg",ih,void 0,"__or_ut_bg"),this.container=X("div","container",rh,void 0,"__or_ut_ct"),this.widgetGuidelinesVisible=!0,this.widgetTasksVisible=!1,this.widgetVisible=!0,this.isActive=!1,this.descriptionSection=null,this.taskSection=null,this.endSection=null,this.stopButton=null,this.stopButtonContainer=null,this.test=null,this.testId=null,this.signalManager=null,this.getTest=(o,a,l)=>{this.testId=o;const u=this.app.options.ingestPoint;return fetch(`${u}/v1/web/uxt/test/${o}`,{headers:{Authorization:`Bearer ${a}`}}).then(c=>c.json()).then(({test:c})=>{this.isActive=!0,this.test=c,this.signalManager=new Th(this.app.options.ingestPoint,()=>this.app.timestamp(),a,o,this.storageKey,(h,d)=>this.app.localStorage.setItem(h,d),h=>this.app.localStorage.removeItem(h),h=>this.app.localStorage.getItem(h),()=>this.app.getSessionID()),this.createGreeting(c.title,c.reqMic,c.reqCamera),l&&((c.reqMic||c.reqCamera)&&this.userRecorder.startRecording(30,Oa.Standard,c.reqMic,c.reqCamera),this.showWidget(c.description,c.tasks,!0),this.showTaskSection())}).then(()=>o).catch(c=>{console.log("OR: Error fetching test",c)})},this.hideTaskSection=()=>!1,this.showTaskSection=()=>!0,this.collapseWidget=()=>!1,this.removeGreeting=()=>!1,this.toggleDescriptionVisibility=()=>{},this.currentTaskIndex=0,this.userRecorder=new vh(e);const s=this.app.getSessionID(),i=this.app.localStorage.getItem(er);s!==i&&(this.app.localStorage.removeItem(this.storageKey),this.app.localStorage.removeItem(er),this.app.localStorage.removeItem(kh),this.app.localStorage.removeItem($i),this.app.localStorage.removeItem(Us));const r=this.app.localStorage.getItem($i);r&&(this.currentTaskIndex=parseInt(r,10))}getTestId(){return this.testId}createGreeting(e,n,s){const i=X("div","title",oh,e),r=X("div","description",ah,`Welcome, you're here to help us improve, not to be judged. Your insights matter!
|
|
5
5
|
|
|
6
6
|
📹 We're recording this browser tab to learn from your experience.
|
|
7
|
-
🎤 Please enable mic and camera if asked, to give us a complete picture.`),o=
|
|
7
|
+
🎤 Please enable mic and camera if asked, to give us a complete picture.`),o=X("div","button",lh,"Read guidelines to begin");this.removeGreeting=()=>((n||s)&&this.userRecorder.startRecording(30,Oa.Standard,n,s),this.container.removeChild(o),this.container.removeChild(r),this.container.removeChild(i),!1),o.onclick=()=>{var l,u,c,h;this.removeGreeting();const a=(l=this.signalManager)==null?void 0:l.getDurations();a&&this.signalManager&&(a.testStart=this.app.timestamp(),this.signalManager.setDurations(a)),(u=this.signalManager)==null||u.signalTest("begin"),this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,js),this.showWidget(((c=this.test)==null?void 0:c.guidelines)||"",((h=this.test)==null?void 0:h.tasks)||[])},this.container.append(i,r,o),this.bg.appendChild(this.container),document.body.appendChild(this.bg)}showWidget(e,n,s){this.container.innerHTML="",Object.assign(this.bg.style,{position:"fixed",zIndex:99999999999999,right:"8px",left:"unset",width:"fit-content",top:"8px",height:"fit-content",background:"unset",display:"unset",alignItems:"unset",justifyContent:"unset"});const i=this.createTitleSection();this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,js);const r=this.createDescriptionSection(e),o=this.createTasksSection(n),a=X("div","stop_bn_or",Ia,"Abort Session"),l=X("div","stop_ct_or",{fontSize:"13px!important"});l.style.fontSize="13px",l.append(a),this.container.append(i,r,o,l),this.taskSection=o,this.descriptionSection=r,this.stopButton=a,this.stopButtonContainer=l,a.onclick=()=>{var u;this.userRecorder.discard(),(u=this.signalManager)==null||u.signalTest("skipped"),document.body.removeChild(this.bg),window.close()},s?this.toggleDescriptionVisibility():this.hideTaskSection()}createTitleSection(){var a;const e=X("div","title",ch),n=bh(),s=X("div","title_text",{maxWidth:"19rem",overflow:"hidden",textOverflow:"ellipsis",width:"100%",fontSize:16,lineHeight:"auto",cursor:"pointer"},(a=this.test)==null?void 0:a.title),i=yh();e.append(n,s,i);const r=l=>(this.widgetVisible=l,this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,this.widgetVisible?js:{border:"none",background:"none",padding:0}),this.taskSection&&Object.assign(this.taskSection.style,this.widgetVisible?Mn:{display:"none"}),this.descriptionSection&&Object.assign(this.descriptionSection.style,this.widgetVisible?Mn:{display:"none"}),this.endSection&&Object.assign(this.endSection.style,this.widgetVisible?Mn:{display:"none"}),this.stopButton&&Object.assign(this.stopButton.style,this.widgetVisible?Ia:{display:"none"}),l),o=()=>{Object.assign(i.style,{transform:this.widgetVisible?"rotate(0deg)":"rotate(180deg)"}),r(!this.widgetVisible)};return s.onclick=o,i.onclick=o,wh(this.bg,n),this.collapseWidget=()=>r(!1),e}createDescriptionSection(e){const n=X("div","description_section_or",Mn),s=X("div","description_s_title_or",Ta),i=X("div","title",{fontSize:13,fontWeight:500,lineHeight:"auto"},"Introduction & Guidelines"),r=X("div","icon",xa,"-"),o=X("div","content",An),a=X("div","text_description",{maxHeight:"250px",overflowY:"auto",whiteSpace:"pre-wrap",fontSize:13,color:"#454545",lineHeight:"auto"});a.innerHTML=e;const l=X("div","button_begin_or",Ea,"Begin Test");s.append(i,r),o.append(a,l),n.append(s,o);const u=()=>{this.widgetGuidelinesVisible=!this.widgetGuidelinesVisible,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?An:{display:"none"})};return s.onclick=u,this.toggleDescriptionVisibility=()=>{this.widgetGuidelinesVisible=!1,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?An:{display:"none"}),o.removeChild(l)},l.onclick=()=>{var c,h,d;if(u(),this.test){const p=(c=this.signalManager)==null?void 0:c.getDurations(),f=p?p.tasks.findIndex(m=>this.test&&m.taskId===this.test.tasks[0].task_id):null;p&&f===-1&&(p.tasks.push({taskId:this.test.tasks[0].task_id,started:this.app.timestamp()}),(h=this.signalManager)==null||h.setDurations(p)),(d=this.signalManager)==null||d.signalTask(this.test.tasks[0].task_id,"begin")}this.showTaskSection(),o.removeChild(l)},n}createTasksSection(e){this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,js);const n=X("div","task_section_or",Mn),s=X("div","description_t_title_or",Ta),i=X("div","title",{fontSize:"13px",fontWeight:"500",lineHeight:"auto"},"Tasks"),r=X("div","icon",xa,"-"),o=X("div","content",An),a=X("div","pagination",hh),l=X("div","taskCard",Na),u=X("div","taskText",Ra),c=X("div","taskDescription",fh),h=X("div","taskButtons",gh),d=X("div","taskText",Ra);d.textContent="Your answer";const p=X("textarea","taskDescription",{resize:"vertical"}),f=X("div","inputArea",Na);f.append(d,p);const m=X("div","closePanelButton",Da,"Collapse Panel"),S=X("div","nextButton",ph,"Done, Next");s.append(i,r),l.append(u,c),h.append(m,S),o.append(a,l,f,h),n.append(s,o);const T=()=>{const g=e[this.currentTaskIndex];u.textContent=g.title,c.textContent=g.description,g.allow_typing?f.style.display="flex":f.style.display="none"};e.forEach((g,b)=>{const _=X("span",`or_task_${b}`,{outline:"1px solid #efefef",fontSize:"13px",height:"24px",width:"24px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em"},(b+1).toString());_.id=`or_task_${b}`,a.append(_)});const x=()=>{this.widgetTasksVisible=!this.widgetTasksVisible,r.textContent=this.widgetTasksVisible?"-":"+",Object.assign(o.style,this.widgetTasksVisible?An:{display:"none"})};this.hideTaskSection=()=>(r.textContent="+",Object.assign(o.style,{display:"none"}),this.widgetTasksVisible=!1,!1),this.showTaskSection=()=>(r.textContent="-",Object.assign(o.style,An),this.widgetTasksVisible=!0,!0);const I=()=>{const g=document.getElementById(`or_task_${this.currentTaskIndex}`);g&&Object.assign(g.style,Ca);for(let b=0;b<this.currentTaskIndex;b++){const _=document.getElementById(`or_task_${b}`);_&&Object.assign(_.style,dh)}};return s.onclick=x,m.onclick=this.collapseWidget,S.onclick=()=>{var b,_,k,y;const g=e[this.currentTaskIndex].allow_typing?p.value:void 0;if(p.value="",(b=this.signalManager)==null||b.signalTask(e[this.currentTaskIndex].task_id,"done",g),this.currentTaskIndex<e.length-1){this.currentTaskIndex++,T();const E=(_=this.signalManager)==null?void 0:_.getDurations();E&&E.tasks.findIndex(P=>P.taskId===e[this.currentTaskIndex].task_id)===-1&&(E.tasks.push({taskId:e[this.currentTaskIndex].task_id,started:this.app.timestamp()}),(k=this.signalManager)==null||k.setDurations(E)),(y=this.signalManager)==null||y.signalTask(e[this.currentTaskIndex].task_id,"begin"),I()}else this.showEndSection();this.app.localStorage.setItem("or_uxt_task_index",this.currentTaskIndex.toString())},setTimeout(()=>{const g=document.getElementById("or_task_0");g&&Object.assign(g.style,Ca),T(),I()},1),n}showEndSection(){var a,l,u,c;let e=!0;(a=this.signalManager)==null||a.signalTest("done");const n=X("div","end_section_or",uh),s=X("div","end_title_or",{fontSize:"1.25rem",fontWeight:"500"},"Thank you! 👍"),i=X("div","end_description_or",{},((l=this.test)==null?void 0:l.conclusion)??`Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
|
|
8
8
|
|
|
9
|
-
We appreciate your time and valuable input.`),r=q("div","end_button_or",Ta,"Submitting Feedback"),o=wh();r.appendChild(o),(u=this.test)!=null&&u.reqMic||(l=this.test)!=null&&l.reqCamera?this.userRecorder.sendToAPI().then(()=>{r.removeChild(o),r.textContent="End Session",e=!1}).catch(h=>{console.error(h),r.removeChild(o),r.textContent="End Session",e=!1}):(r.removeChild(o),r.textContent="End Session",e=!1),this.taskSection&&this.container.removeChild(this.taskSection),this.descriptionSection&&this.container.removeChild(this.descriptionSection),this.stopButton&&this.stopButtonContainer&&this.container.removeChild(this.stopButtonContainer),r.onclick=()=>{e||(window.close(),document.body.removeChild(this.bg))},n.append(s,i,r),this.endSection=n,this.container.append(n)}}function Da(t){return!!t&&t.nodeType!=null}function tr(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function Tt(t){return t.nodeType===Node.ELEMENT_NODE}function kh(t){return t.nodeType===Node.COMMENT_NODE}function nr(t){return t.nodeType===Node.TEXT_NODE}function js(t){return t.nodeType===Node.DOCUMENT_NODE}function Us(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ve(t,e){return t.localName===e}class Th{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=[],this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=s=>{const i=this.app.nodes.getID(s);if(!i||!ve(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!ve(s,"canvas")||this.snapshots[i])return;new IntersectionObserver(a=>{a.forEach(c=>{c.isIntersecting&&(c.target?this.snapshots[i]&&this.snapshots[i].createdAt?this.snapshots[i].paused=!1:this.recordCanvas(c.target,i):this.snapshots[i]&&(this.snapshots[i].paused=!0))})}).observe(s)},this.recordCanvas=(s,i)=>{const r=this.app.timestamp();this.snapshots[i]={images:[],createdAt:r,paused:!1,dummy:document.createElement("canvas")};const o=Ju(i.toString(),r);this.app.send(o);const a=u=>{xh(u,this.options.quality,this.snapshots[i].dummy,this.options.fixedScaling,this.fileExt,l=>{if(l){if(!this.snapshots[i])return this.app.debug.warn("Canvas not present in snapshots after capture:",this.snapshots,i);this.snapshots[i].images.push({id:this.app.timestamp(),data:l}),this.snapshots[i].images.length>9&&(this.sendSnaps(this.snapshots[i].images,i,this.snapshots[i].createdAt),this.snapshots[i].images=[])}})},c=setInterval(()=>{const u=this.app.nodes.getID(s),l=u?this.app.nodes.getNode(u):void 0;if(!this.snapshots[i]){this.app.debug.log("Canvas is not present in {snapshots}"),clearInterval(c);return}if(!l||!ve(l,"canvas")||l!==s){this.app.debug.log("Canvas element not in sync",l,s),clearInterval(c);return}else this.snapshots[i].paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{a(l)}):a(l))},this.interval);this.intervals.push(c)},this.fileExt=n.fileExt??"webp",this.interval=1e3/n.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(this.captureCanvas)},250)}sendSnaps(e,n,s){if(Object.keys(this.snapshots).length===0)return;const i=new FormData;e.forEach(o=>{const a=o.data;a&&(i.append("snapshot",a,`${s}_${n}_${o.id}.${this.fileExt}`),this.options.isDebug&&Eh(a,`${s}_${n}_${o.id}.${this.fileExt}`))});const r=()=>{this.app.debug.log("Restarting tracker; token expired"),this.app.stop(!1),setTimeout(()=>{this.app.start({},!0)},250)};fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:i}).then(o=>o.status===401?r():!0).catch(o=>{this.app.debug.error("error saving canvas",o)})}clear(){this.intervals.forEach(e=>clearInterval(e)),this.snapshots={}}}const Oa={low:.35,medium:.55,high:.8};function xh(t,e="medium",n,s=!1,i,r){const o=`image/${i}`;if(s){const a=window.devicePixelRatio||1;n.width=t.width/a,n.height=t.height/a;const c=n.getContext("2d");if(!c)return"";c.clearRect(0,0,n.width,n.height),c.drawImage(t,0,0,n.width,n.height),n.toBlob(r,o,Oa[e])}else t.toBlob(r,o,Oa[e])}function Eh(t,e){const n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}const On={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class Ih{constructor(e=On.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(On.Verbose)&&console.info(...n)},this.log=(...n)=>{this.shouldLog(On.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(On.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(On.Errors)&&console.error(...n)},this.level=e}}const Ch=1e3;function Nh(t,e,n){const s=t.entries();function i(){const r=[];let o=s.next();for(;!o.done&&r.length<e;)r.push(o.value),o=s.next();r.length>0&&(r.forEach(([a,c])=>{c&&n(c)}),setTimeout(i,50))}i()}function Rh(t){var e;try{if(!t.isConnected)return[!1,"not connected"];const n=t.nodeType===Node.DOCUMENT_NODE,s=n?t.defaultView:(e=t.ownerDocument)==null?void 0:e.defaultView,i=n?t:t.ownerDocument;return s?s.closed?[!1,"window closed"]:i!=null&&i.documentElement.isConnected?[!0,"ok"]:[!1,"documentElement not connected"]:[!1,"no window"]}catch(n){return[!1,n]}}const Dh={interval:Ch*30,batchSize:2500,enabled:!0};class Oh{constructor(e,n,s){this.nodes=e,this.unregisterNode=n,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{Nh(this.nodes,this.options.batchSize,i=>{Rh(i)[0]||this.unregisterNode(i)})},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval)},this.options={...Dh,...s}}}class Mh{constructor(e){this.nodes=new Map,this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.scanTree=n=>{this.nodes.forEach(s=>s?n(s):void 0)},this.attachNodeListener=(n,s,i,r=!0)=>{const o=this.getID(n);if(o===void 0)return;la(n,s,i,r,this.forceNgOff);let a=this.elementListeners.get(o);a===void 0&&(a=[],this.elementListeners.set(o,a)),a.push([s,i,r])},this.unregisterNode=n=>{const s=n[this.node_id];if(s!==void 0){n[this.node_id]=void 0,delete n[this.node_id],this.nodes.delete(s);const i=this.elementListeners.get(s);i!==void 0&&(this.elementListeners.delete(s),i.forEach(r=>ca(n,r[0],r[1],r[2],this.forceNgOff))),this.totalNodeAmount--}return s},this.node_id=e.node_id,this.forceNgOff=e.forceNgOff,this.maintainer=new Oh(this.nodes,this.unregisterNode,e.maintainer),this.maintainer.start()}syntheticMode(e){const n=Number.MAX_SAFE_INTEGER,i=99999999*e;if(i>n)throw new Error("Placeholder id overflow");this.nextNodeId=i}attachNodeCallback(e){return this.nodeCallbacks.push(e)}registerNode(e){let n=e[this.node_id];const s=n===void 0;return s&&(n=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes.set(n,e),e[this.node_id]=n),[n,s]}cleanTree(){for(const[e,n]of this.nodes)n&&!document.contains(n)&&this.unregisterNode(n)}callNodeCallbacks(e,n){this.nodeCallbacks.forEach(s=>s(e,n))}getID(e){if(e)return e[this.node_id]}getNode(e){return this.nodes.get(e)}getNodeCount(){return this.totalNodeAmount}clear(){for(const[e,n]of this.nodes)n&&this.unregisterNode(n);this.nextNodeId=0,this.nodes.clear()}}function Hs(t){if(kh(t))return!0;if(nr(t))return!1;if(!Tt(t))return!0;const e=t.tagName.toUpperCase();if(e==="LINK"){const n=t.getAttribute("rel"),s=t.getAttribute("as");return!(n!=null&&n.includes("stylesheet")||s==="style"||s==="font")}return e==="SCRIPT"||e==="NOSCRIPT"||e==="META"||e==="TITLE"||e==="BASE"}function sr(t){return Us(t)?!0:!Hs(t)}var dt;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(dt||(dt={}));class ir{constructor(e,n=!1){this.app=e,this.isTopContext=n,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.observer=aa(this.app.safe(s=>{for(const i of s){const r=i.target,o=i.type;if(!sr(r))continue;if(o==="childList"){for(let c=0;c<i.removedNodes.length;c++)sr(i.removedNodes[c])&&this.bindNode(i.removedNodes[c]);for(let c=0;c<i.addedNodes.length;c++)this.bindTree(i.addedNodes[c]);continue}const a=this.app.nodes.getID(r);if(a!==void 0){if(this.recents.has(a)||this.recents.set(a,dt.Changed),o==="attributes"){const c=i.attributeName;if(c===null)continue;let u=this.attributesMap.get(a);u===void 0&&this.attributesMap.set(a,u=new Set),u.add(c);continue}o==="characterData"&&this.textSet.add(a)}}this.commitNodes()}),this.app.options.forceNgOff)}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}handleIframeSrcChange(e){const n=e.contentDocument;if(n&&this.app.nodes.getID(n)!==void 0){const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:c=>Hs(c)||this.app.nodes.getID(c)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let r=0;const o=this.app.nodes.getNodeCount();for(;i.nextNode();)e.contentDocument.contains(i.currentNode)||(r+=1,this.app.nodes.unregisterNode(i.currentNode));const a=Math.floor(r/o*100);a>30&&this.app.send(wa(a))}}sendNodeAttribute(e,n,s,i){if(tr(n)){s.substring(0,6)==="xlink:"&&(s=s.substring(6)),i===null?this.app.send(ha(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Gi(e,s,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,s,i);return}if(!(s==="src"||s==="srcset"||s==="integrity"||s==="crossorigin"||s==="autocomplete"||s.substring(0,2)==="on")&&!(s==="value"&&ve(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(ha(e,s));return}if(s==="style"||s==="href"&&ve(n,"link")){this.app.send(Gi(e,s,i,this.app.getBaseHref()));return}(s==="href"||i.length>1e5)&&(i=""),this.app.attributeSender.sendSetAttribute(e,s,i)}}sendNodeData(e,n,s){if(ve(n,"style")){this.app.send(Uu(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(Cu(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,dt.New):this.recents.get(n)!==dt.New&&this.recents.set(n,dt.Removed)}bindTree(e){if(!sr(e))return;this.bindNode(e);const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:s=>(this.app.nodes.getID(s)!==void 0&&this.app.debug.error("! Node is already bound",s),Hs(s)||this.app.nodes.getID(s)!==void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)},!1);for(;n.nextNode();)this.bindNode(n.currentNode)}unbindTree(e){const n=this.app.nodes.unregisterNode(e);if(n!==void 0&&this.recents.get(n)===dt.Removed){this.app.send(Iu(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>Hs(a)||this.app.nodes.getID(a)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let i=0;const r=this.app.nodes.getNodeCount();for(;s.nextNode();)i+=1,this.app.nodes.unregisterNode(s.currentNode);const o=Math.floor(i/r*100);o>30&&this.app.send(wa(o))}}_commitNode(e,n){if(Us(n))return!0;const s=n.parentNode;let i;if(!ve(n,"html")||!this.isTopContext){if(s===null)return this.unbindTree(n),!1;if(i=this.app.nodes.getID(s),i===void 0)return this.unbindTree(n),!1;if(!this.commitNode(i))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,i,n),this.app.sanitizer.isHidden(i))return!1}let r=n.previousSibling;for(;r!==null;){const l=this.app.nodes.getID(r);if(l!==void 0){this.commitNode(l),this.indexes[e]=this.indexes[l]+1;break}r=r.previousSibling}r===null&&(this.indexes[e]=0);const o=this.recents.get(e),a=o===dt.New,c=this.indexes[e];if(c===void 0)throw"commitNode: missing node index";if(a){if(Tt(n)){let l=n;if(i!==void 0){if(this.app.sanitizer.isHidden(e)){const h=l.clientWidth,d=l.clientHeight;l=n.cloneNode(),l.style.width=`${h}px`,l.style.height=`${d}px`}this.app.send(Tu(e,i,c,l.tagName,tr(n)))}for(let h=0;h<l.attributes.length;h++){const d=l.attributes[h];this.sendNodeAttribute(e,l,d.nodeName,d.value)}}else nr(n)&&(this.app.send(xu(e,i,c)),this.sendNodeData(e,s,n.data));return!0}o===dt.Removed&&i!==void 0&&this.app.send(Eu(e,i,c));const u=this.attributesMap.get(e);if(u!==void 0){if(!Tt(n))throw"commitNode: node is not an element";for(const l of u)this.sendNodeAttribute(e,n,l,n.getAttribute(l))}if(this.textSet.has(e)){if(!nr(n))throw"commitNode: node is not a text";this.sendNodeData(e,s,n.data)}return!0}commitNode(e){const n=this.app.nodes.getNode(e);if(n===void 0)return!1;const s=this.commited[e];return s!==void 0?s:this.commited[e]=this._commitNode(e,n)}commitNodes(e=!1){let n;this.recents.forEach((s,i)=>{this.commitNode(i),s===dt.New&&(n=this.app.nodes.getNode(i))&&this.app.nodes.callNodeCallbacks(n,e)}),this.clear()}observeRoot(e,n,s=e){this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(s),n(this.app.nodes.getID(e)),this.commitNodes(!0)}disconnect(){this.observer.disconnect(),this.clear()}}class Ma extends ir{observe(e){const n=e.contentDocument,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.docId=i,this.app.send(Ki(s,i))})}syntheticObserve(e,n){this.observeRoot(n,s=>{if(s===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(Ki(e,s))})}}class Ah extends ir{observe(e){const n=e.shadowRoot,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.error("OpenReplay: Shadow Root was not bound");return}this.app.send(Ki(s,i))})}}class Ph{constructor(){this.states=new WeakMap}calcOffset(e){let n=0,s=0;if(e.parent&&([n,s]=this.calcOffset(e.parent)),!e.offset){const{left:o,top:a}=e.iFrame.getBoundingClientRect();e.offset=[o,a]}const[i,r]=e.offset;return[n+i,s+r]}getDocumentOffset(e){const n=this.states.get(e);return n?this.calcOffset(n):[0,0]}observe(e){var a;const n=e.contentDocument;if(!n)return;const s=e.ownerDocument,i=this.states.get(s),r={offset:null,iFrame:e,parent:i||null,clear:()=>{var c;s.removeEventListener("scroll",o),(c=s.defaultView)==null||c.removeEventListener("resize",o)}},o=()=>{r.offset=null};s.addEventListener("scroll",o),(a=s.defaultView)==null||a.addEventListener("resize",o),this.states.set(n,r)}clear(){this.states=new WeakMap}}const rr=ht?Element.prototype.attachShadow:()=>new ShadowRoot;class Lh extends ir{constructor(e){super(e.app,!0),this.iframeOffsets=new Ph,this.contextCallbacks=[],this.contextsSet=new WeakSet,this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.docObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.app=e.app,this.options=Object.assign({captureIFrames:!0},e.options),this.app.nodes.attachNodeCallback(n=>{ve(n,"iframe")&&(this.options.captureIFrames&&!on(n,"obscured")||on(n,"capture"))&&this.handleIframe(n)}),this.app.nodes.attachNodeCallback(n=>{Tt(n)&&n.shadowRoot!==null&&this.handleShadowRoot(n.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){const n=this.app.safe(()=>setTimeout(()=>{const s=this.app.nodes.getID(e);if(s===void 0||!mu(e))return;const i=e.contentWindow,r=e.contentDocument;if(!r){this.app.debug.warn("no doc for iframe found",e);return}if(r&&this.docObservers.has(r)){this.app.debug.info("doc already observed for",s);return}const o=new Ma(this.app);this.iframeObservers.set(e,o),this.docObservers.set(r,o),this.iframeObserversArr.push(o),o.observe(e),this.iframeOffsets.observe(e),i&&i===i.window&&!this.contextsSet.has(i)&&(this.contextsSet.add(i),this.contextCallbacks.forEach(a=>a(i)))},250));e.addEventListener("load",n),n()}handleShadowRoot(e){const n=new Ah(this.app);this.shadowRootObservers.set(e,n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=rr.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(ku()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=rr.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new Ma(this.app);this.iframeObservers.set(window.document,i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=rr,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}var qs;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(qs||(qs={}));const Bh=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class Fh{constructor(e){this.obscured=new Set,this.hidden=new Set,this.app=e.app,this.options=Object.assign({obscureTextEmails:!0,obscureTextNumbers:!1},e.options)}handleNode(e,n,s){if((this.obscured.has(n)||Tt(s)&&(on(s,"masked")||on(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||Tt(s)&&(on(s,"htmlmasked")||on(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&Tt(s)){const i=this.options.domSanitizer(s);i===qs.Obscured&&this.obscured.add(e),i===qs.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?Bh(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g,s=>{const[i,r]=s.split("@"),[o,a]=r.split(".");return`${Hi(i)}@${Hi(o)}.${Hi(a)}`})),n)}isObscured(e){return this.obscured.has(e)}isHidden(e){return this.hidden.has(e)}getInnerTextSecure(e){const n=this.app.nodes.getID(e);return n?this.sanitize(n,e.innerText):""}clear(){this.obscured.clear(),this.hidden.clear()}}class Wh{constructor(e){this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.app=e.app,this.options=e.options,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){e.userID==null&&delete e.userID,e.sessionID==null&&delete e.sessionID,this.callbacks.forEach(n=>n(e))}assign(e){e.userID!==void 0&&(this.userID=e.userID),e.metadata!==void 0&&Object.entries(e.metadata).forEach(([n,s])=>this.metadata[n]=s),e.sessionID!==void 0&&(this.sessionID=e.sessionID),e.timestamp!==void 0&&(this.timestamp=e.timestamp),e.projectID!==void 0&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,n){this.metadata[e]=n,this.handleUpdate({metadata:{[e]:n}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}getPageNumber(){const e=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(e!=null)return parseInt(e)}incPageNo(){let e=this.getPageNumber();return e===void 0?e=0:e++,this.app.sessionStorage.setItem(this.options.session_pageno_key,e.toString()),e}getSessionToken(){return this.token||this.app.sessionStorage.getItem(this.options.session_token_key)||void 0}setSessionToken(e){this.token=e,this.app.sessionStorage.setItem(this.options.session_token_key,e)}applySessionHash(e){const n=decodeURI(e).split("&");let s=e,i="100500";n.length==2&&([i,s]=n),!(!i||!s)&&(this.app.sessionStorage.setItem(this.options.session_token_key,s),this.app.sessionStorage.setItem(this.options.session_pageno_key,i))}getSessionHash(){const e=this.getPageNumber(),n=this.getSessionToken();if(!(e===void 0||n===void 0))return encodeURI(String(e)+"&"+n)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=vu(12);this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}function zh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class jh{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e,n=0,s=!0,i){i&&(e=e.bind(i)),s&&(e=this.app.safe(e)),this.callbacks.unshift(n?zh(e,n):e)-1}start(){this.timer===null&&(this.timer=setInterval(()=>this.callbacks.forEach(e=>{e&&e()}),30))}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}}const Uh='!function(){"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t){if(this.busy||!this.token)this.queue.push(t);else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}else this.busy=!1}retry(t,s,i){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout((()=>this.sendBatch(t,s,i)),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t,s,i){var e;const n=null==i?void 0:i.toString().replace(/^([^_]+)_([^_]+).*/,"$1_$2_$3");this.busy=!0;const h={Authorization:`Bearer ${this.token}`};s&&(h["Content-Encoding"]="gzip"),null!==this.token?fetch(`${this.ingestURL}?batch=${null!==(e=this.pageNo)&&void 0!==e?e:"noPageNum"}_${null!=n?n:"noBatchNum"}`,{body:t,method:"POST",headers:h,keepalive:t.length<65536}).then((e=>{if(401===e.status)return this.busy=!1,void this.onUnauthorised();e.status>=400?this.retry(t,s,`${null!=i?i:"noBatchNum"}_network:${e.status}`):(this.attemptsCount=0,this.sendNext())})).catch((e=>{console.warn("OpenReplay:",e),this.retry(t,s,`${null!=i?i:"noBatchNum"}_reject:${e.message}`)})):setTimeout((()=>{this.sendBatch(t,s,`${null!=i?i:"noBatchNum"}_newToken`)}),500)}sendCompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!0,s)}sendUncompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class i{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const i=s.encode(t),e=i.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(i,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class e extends i{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 38:case 70:case 75:case 76:case 77:case 82:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 63:case 64:case 79:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 67:case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class n{constructor(t,s,i,n,h,r){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=n,this.tabId=h,this.onOfflineEnd=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new e(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url],s=[118,this.tabId];this.writeType(t),this.writeFields(t),this.writeWithSize(s),this.isEmpty=!0}writeWithSize(t){const s=this.encoder;if(!this.writeType(t)||!s.skip(3))return!1;const i=s.getCurrentOffset(),e=this.writeFields(t);if(e){const e=s.getCurrentOffset()-i;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,i-3),s.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if("q_end"===t[0])return this.finaliseBatch(),this.onOfflineEnd();0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new e(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)?this.finaliseBatch():console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder=new e(this.beaconSize),this.prepare()))}finaliseBatch(){if(this.isEmpty)return;const t=this.encoder.flush();this.onBatch(t),this.prepare()}clean(){this.encoder.reset()}}var h;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(h||(h={}));let r=null,u=null,a=h.NotActive;function o(){u&&u.finaliseBatch()}function c(){return new Promise((t=>{a=h.Stopping,null!==p&&(clearInterval(p),p=null),u&&(u.clean(),u=null),r&&(r.clean(),setTimeout((()=>{r=null}),20)),setTimeout((()=>{a=h.NotActive,t(null)}),100)}))}function g(){[h.Stopped,h.Stopping].includes(a)||(postMessage("a_stop"),c().then((()=>{postMessage("a_start")})))}let l,p=null;self.onmessage=({data:s})=>{if(null!=s){if("stop"===s)return o(),void c().then((()=>{a=h.Stopped}));if("forceFlushBatch"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&r.sendCompressed(s.batch)}if("uncompressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&r.sendUncompressed(s.batch)}return"start"===s.type?(a=h.Starting,r=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),c()}(t)}),s.connAttemptCount,s.connAttemptGap,(t=>{postMessage({type:"compress",batch:t},[t.buffer])}),s.pageNo),u=new n(s.pageNo,s.timestamp,s.url,(t=>{r&&r.push(t)}),s.tabId,(()=>postMessage({type:"queue_empty"}))),null===p&&(p=setInterval(o,1e4)),a=h.Active):"auth"===s.type?r?u?(r.authorise(s.token),void(s.beaconSizeLimit&&u.setBeaconSizeLimit(s.beaconSizeLimit))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(u){const t=u;s.forEach((s=>{55===s[0]&&(s[1]?l=setTimeout((()=>g()),18e5):clearTimeout(l)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else o()}else o()}}();\n',rs="canceled",Aa="or_uxt_active",or="or_buffer_1",xt=t=>({reason:t,success:!1}),Pa=t=>({...t,success:!0});var pe;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(pe||(pe={}));const La="https://api.openreplay.com/ingest";function ar(){const t=new Date().getTimezoneOffset()*-1,e=t>=0?"+":"-",n=Math.floor(Math.abs(t)/60),s=Math.abs(t)%60;return`UTC${e}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}const Hh=t=>new Promise(e=>setTimeout(e,t)),ge={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"tracker inside a child iframe",iframeId:"getting node id for child iframe",iframeBatch:"batch of messages from an iframe window",parentAlive:"signal that parent is live",killIframe:"stop tracker inside frame",startIframe:"start tracker inside frame",polling:"hello-how-are-you-im-under-the-water-please-help-me"};let qh=class{constructor(e,n,s,i,r){var c,u;this.signalError=i,this.insideIframe=r,this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=pe.NotActive,this.version="14.0.14",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.features={"feature-flags":!0,"usability-test":!0},this.parentActive=!1,this.checkStatus=()=>this.parentActive,this.parentCrossDomainFrameListener=l=>{const{data:h}=l;if(!(!h||l.source===window)){if(h.line===ge.startIframe){if(this.active())return;try{this.allowAppStart(),this.start()}catch(d){console.error("children frame restart failed:",d)}}h.line===ge.parentAlive&&(this.parentActive=!0),h.line===ge.iframeId&&(this.parentActive=!0,this.rootId=h.id,this.session.setSessionToken(h.token),this.frameOderNumber=h.frameOrderNumber,this.debug.log("starting iframe tracking",h),this.allowAppStart()),h.line===ge.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.crossDomainIframeListener=l=>{var d,p;if(!this.active()||l.source===window)return;const{data:h}=l;if(h){if(h.line===ge.iframeSignal&&((d=l.source)==null||d.postMessage({ping:!0,line:ge.parentAlive},"*"),(async()=>{var y;if(l.source===null)return console.error("Couldnt connect to event.source for child iframe tracking");const m=await this.checkNodeId(l.source);if(!m){this.debug.log("Couldnt get node id for iframe",l.source);return}try{this.trackedFrames.includes(h.context)?this.debug.log("Trying to observe already added iframe; ignore if its a restart"):this.trackedFrames.push(h.context),await this.waitStarted();const S=this.session.getSessionToken(),_=this.trackedFrames.findIndex(g=>g===h.context)+1;_===0&&this.debug.error("Couldnt get order number for iframe",h.context,this.trackedFrames);const x={line:ge.iframeId,id:m,token:S,frameOrderNumber:_};this.debug.log("Got child frame signal; nodeId",m,l.source,x),(y=l.source)==null||y.postMessage(x,"*")}catch(S){console.error(S)}})()),h.line===ge.iframeBatch){const m=h.messages.map(y=>{if(y[0]===20){let S=y;return this.pageFrames.forEach(_=>{if(_.contentWindow===l.source){const[x,g,w]=y,{left:E,top:I}=_.getBoundingClientRect();S=[x,g+E,w+I]}}),S}if(y[0]===68){let S=y;return this.pageFrames.forEach(_=>{if(_.contentWindow===l.source){const[x,g,w,E,I,k,T]=y,{left:A,top:G,width:j,height:Z}=_.getBoundingClientRect(),z=document.documentElement.scrollWidth,L=document.documentElement.scrollHeight,Y=k/100*j+A,$=T/100*Z+G,R=Y/z,J=$/L;S=[x,g,w,E,I,Math.round(R*1e3)/10,Math.round(J*1e3)/10]}}),S}return y});this.messages.push(...m)}if(h.line===ge.polling){if(!this.pollingQueue.order.length)return;const f=this.pollingQueue.order[0];if(f&&this.pollingQueue[f].length===0){this.pollingQueue.order=this.pollingQueue.order.filter(m=>m!==f);return}this.pollingQueue[f].includes(h.context)&&(this.pollingQueue[f]=this.pollingQueue[f].filter(m=>m!==h.context),(p=l.source)==null||p.postMessage({line:f},"*"),this.pollingQueue[f].length===0&&this.pollingQueue.order.shift())}}},this.pollingQueue={order:[]},this.addCommand=l=>{this.pollingQueue.order.push(l),this.pollingQueue[l]=[...this.trackedFrames]},this.bootChildrenFrames=async()=>{await this.waitStarted(),this.addCommand(ge.startIframe)},this.killChildrenFrames=()=>{this.addCommand(ge.killIframe)},this.signalIframeTracker=()=>{var S;const l=this.session.getTabId();window.parent.postMessage({line:ge.iframeSignal,source:l,context:this.contextId},((S=this.options.crossdomain)==null?void 0:S.parentDomain)??"*");const h=10;let d=0,p=250,f=0,m=!1;const y=()=>{var _;if(m||this.checkStatus()){m=!0;return}window.parent.postMessage({line:ge.iframeSignal,source:l,context:this.contextId},((_=this.options.crossdomain)==null?void 0:_.parentDomain)??"*"),this.debug.info("Trying to signal to parent, attempt:",d+1),d++};for(let _=0;_<h;_++){if(this.checkStatus()){m=!0;break}f+=p,setTimeout(()=>{y()},f),p*=1.5}},this.startTimeout=null,this.coldStartCommitN=0,this.delay=0,this.attachStartCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.startCallbacks.push(l)},this.attachStopCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.stopCallbacks.push(l)},this.attachEventListener=(l,h,d,p=!0,f=!0)=>{p&&(d=this.safe(d));const m=()=>l?la(l,h,d,f,this.options.forceNgOff):null,y=()=>l?ca(l,h,d,f,this.options.forceNgOff):null;this.attachStartCallback(m,p),this.attachStopCallback(y,p)},this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.prevOpts={},this.restartCanvasTracking=()=>{var l;(l=this.canvasRecorder)==null||l.restartTracking()},this.flushBuffer=async l=>new Promise(h=>{let d=!1;const p=[l.shift()];for(;!d;){const f=l[0];!f||f[0]===0?d=!0:p.push(l.shift())}this.postToWorker(p),h(null)}),this.onUxtCb=[],this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,Object.keys(s).findIndex(l=>["fixedCanvasScaling","disableCanvas"].includes(l))!==-1&&(console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'),s={...s,canvas:{__save_canvas_locally:s.__save_canvas_locally,fixedCanvasScaling:s.fixedCanvasScaling,disableCanvas:s.disableCanvas}}),this.networkOptions=s.network;const o={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:La,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:On.Silent,__save_canvas_locally:!1,localStorage:null,sessionStorage:null,disableStringDict:!1,forceSingleTab:!1,assistSocketHost:"",fixedCanvasScaling:!1,disableCanvas:!1,captureIFrames:!0,obscureTextEmails:!0,obscureTextNumbers:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1},forceNgOff:!1};if(this.options=ua(o,s),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const l=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${l}`)}this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new Fh({app:this,options:s}),this.nodes=new Mh({node_id:this.options.node_id,forceNgOff:!!s.forceNgOff,maintainer:(c=this.options.nodes)==null?void 0:c.maintainer}),this.observer=new Lh({app:this,options:s}),this.ticker=new jh(this),this.ticker.attach(()=>this.commit()),this.debug=new Ih(this.options.__debug__),this.session=new Wh({app:this,options:this.options}),this.attributeSender=new uu({app:this,isDictDisabled:!!(this.options.disableStringDict||(u=this.options.crossdomain)!=null&&u.enabled)}),this.featureFlags=new fu(this),this.tagWatcher=new eh({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:l=>this.send(Qu(l))}),this.session.attachUpdateCallback(({userID:l,metadata:h})=>{l!=null&&this.send(Bu(l)),h!=null&&Object.entries(h).forEach(([d,p])=>this.send(da(d,p)))}),n!=null&&this.session.applySessionHash(n);const a=this.session.getTabId();this.insideIframe?(window.addEventListener("message",this.parentCrossDomainFrameListener),setInterval(()=>{var l;document.hidden||window.parent.postMessage({line:ge.polling,context:this.contextId},((l=s.crossdomain)==null?void 0:l.parentDomain)??"*")},250)):(this.initWorker(),window.addEventListener("message",this.crossDomainIframeListener)),this.bc!==null&&(this.bc.postMessage({line:ge.ask,source:a,context:this.contextId}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},250),this.bc.onmessage=l=>{if(l.data.context!==this.contextId){if(l.data.line===ge.resp){const h=l.data.token;this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===ge.reg){const h=l.data.token;this.session.regenerateTabId(),this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===ge.ask){const h=this.session.getSessionToken();h&&this.bc&&this.bc.postMessage({line:l.data.source===a?ge.reg:ge.resp,token:h,source:a,context:this.contextId})}}})}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkNodeId(e){let n;if(this.pageFrames.length>0&&(n=this.pageFrames.find(i=>i.contentWindow===e)),!n||!this.pageFrames.length){const i=Array.from(document.querySelectorAll("iframe"));this.pageFrames=i,n=i.find(r=>r.contentWindow===e)}if(!n)return null;let s=0;for(;s<100;){const i=n[this.options.node_id];if(i!==void 0)return s=100,i;s++,await Hh(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([Uh],{type:"text/javascript"}))),this.worker.onerror=n=>{this._debug("webworker_error",n)},this.worker.onmessage=({data:n})=>{this.handleWorkerMsg(n)};const e=()=>{this.worker&&this.worker.postMessage(null)};this.attachEventListener(window,"beforeunload",e,!1),this.attachEventListener(document.body,"mouseleave",e,!1,!1),this.attachEventListener(document,"visibilitychange",e,!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.waitStatus(pe.NotActive).then(()=>{this.allowAppStart(),this.start(this.prevOpts,!0).then(s=>{this.debug.info("Worker restarted, session was too long",s)}).catch(s=>{this.debug.error("Worker restart failed",s)})});else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const s=e.batch;s.byteLength>this.compressionThreshold?au(e.batch,{mtime:0},(r,o)=>{var a,c;r?(this.debug.error("Openreplay compression error:",r),(a=this.worker)==null||a.postMessage({type:"uncompressed",batch:s})):(c=this.worker)==null||c.postMessage({type:"compressed",batch:o})}):(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:s})}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}send(e,n=!1){var s;this.activityState!==pe.NotActive&&(this.activityState===pe.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===pe.Active&&n&&this.commit())}_nCommit(){var e;if(this.socketMode){this.messages.unshift(ln(this.session.getTabId())),this.messages.unshift(an(this.timestamp())),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(this.insideIframe){window.parent.postMessage({line:ge.iframeBatch,messages:this.messages},((e=this.options.crossdomain)==null?void 0:e.parentDomain)??"*"),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(!(this.worker===void 0||!this.messages.length))try{yu(()=>{var n;this.messages.unshift(ln(this.session.getTabId())),this.messages.unshift(an(this.timestamp())),(n=this.worker)==null||n.postMessage(this.messages),this.commitCallbacks.forEach(s=>s(this.messages)),this.messages.length=0})}catch(n){this._debug("worker_commit",n),this.stop(!0),setTimeout(()=>{this.start()},500)}}_cStartCommit(){this.coldStartCommitN+=1,this.coldStartCommitN===2&&(this.bufferedMessages1.push(an(this.timestamp())),this.bufferedMessages1.push(ln(this.session.getTabId())),this.bufferedMessages2.push(an(this.timestamp())),this.bufferedMessages2.push(ln(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===pe.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(s=>s(e)),e.length=0}timestamp(){return it()+this.delay}safe(e){const n=this;return function(...s){try{e.apply(this,s)}catch(i){n._debug("safe_fn_call",i)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}checkRequiredVersion(e){const n=e.split(/[.-]/),s=this.version.split(/[.-]/);for(let i=0;i<3;i++){if(isNaN(Number(s[i]))||isNaN(Number(n[i])))return!1;if(Number(s[i])>Number(n[i]))return!0;if(Number(s[i])<Number(n[i]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken()}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:n,sessionID:s,timestamp:i}=this.session.getInfo();if(!n||!s){this.debug.error("OpenReplay error: Unable to build session URL");return}const r=this.options.ingestPoint,c=(/api\.openreplay\.com/.test(r)?"https://app.openreplay.com/ingest":r).replace(/ingest$/,`${n}/session/${s}`);if(e!=null&&e.withCurrentTime){const u=it()-i;return`${c}?jumpto=${u}`}return c}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===pe.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}checkSessionToken(e){const n=this.sessionStorage.getItem(this.options.session_reset_key)!==null,s=e||n,i=this.session.getSessionToken();return s||!i}async coldStart(e={},n){this.singleBuffer=!1;const s=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,Ui(),this.coldStartTs=it(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(an(this.timestamp())),this.bufferedMessages1.push(ln(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(an(this.timestamp())),this.bufferedMessages2.push(ln(this.session.getTabId()))),this.stop(!1),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Fs(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var p,f;this.conditionsManager=new hu(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:it(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Qi,jsHeapSizeLimit:Zi,timezone:ar(),width:window.screen.width,height:window.screen.height})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,projectID:l,features:h}=await n.json();this.features=h||this.features,this.session.assign({projectID:l}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});const d={sessionToken:s,userUUID:"",sessionID:""};this.startCallbacks.forEach(m=>m(d)),await((p=this.conditionsManager)==null?void 0:p.fetchConditions(l,s)),this.features["feature-flags"]&&(await this.featureFlags.reloadFlags(s),(f=this.conditionsManager)==null||f.processFlags(this.featureFlags.flags)),await this.tagWatcher.fetchTags(this.options.ingestPoint,s)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const s=this.checkSessionToken(e.forceNew);Ui(),this.coldStartTs=it();const i=this.localStorage.getItem(or);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(or)}this.bufferedMessages1.push(an(this.timestamp())),this.bufferedMessages1.push(ln(this.session.getTabId())),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(o=>o(r)),s||this.send(Fs(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(or,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var d,p;this.stop(!1);const e=it();(d=this.worker)==null||d.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:e,doNotRecord:!1,bufferDiff:e-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Qi,jsHeapSizeLimit:Zi,timezone:ar()})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,beaconSizeLimit:l,projectID:h}=await n.json();for((p=this.worker)==null||p.postMessage({type:"auth",token:s,beaconSizeLimit:l}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([["q_end"]]),this.clearBuffers()}async _start(e={},n=!1,s){var c,u,l,h,d;Object.keys(e).length!==0&&(this.prevOpts=e);const i=this.activityState===pe.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const p="No worker found: perhaps, CSP is not set.";return this.signalError(p,[]),Promise.resolve(xt(p))}if(this.activityState===pe.Active||this.activityState===pe.Starting)return Promise.resolve(xt("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=pe.Starting,i||Ui(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=it();(c=this.worker)==null||c.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:r,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const o=this.session.getSessionToken(),a=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",a,"session token: ",o);try{const p=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:r,doNotRecord:!1,bufferDiff:r-this.coldStartTs,userID:this.session.getInfo().userID,token:a?void 0:o,deviceMemory:Qi,jsHeapSizeLimit:Zi,timezone:ar(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(p.status!==200){const R=await p.text(),J=R===rs?rs:`Server error: ${p.status}. ${R}`;return xt(J)}if(!this.worker&&!this.insideIframe){const R="no worker found after start request (this should not happen in real world)";return this.signalError(R,[]),xt(R)}const{token:f,userUUID:m,projectID:y,beaconSizeLimit:S,compressionThreshold:_,delay:x,sessionID:g,startTimestamp:w,userBrowser:E,userCity:I,userCountry:k,userDevice:T,userOS:A,userState:G,canvasEnabled:j,canvasQuality:Z,canvasFPS:z,assistOnly:L,features:Y}=await p.json();if(this.features=Y||this.features,typeof f!="string"||typeof m!="string"||typeof w!="number"&&typeof w<"u"||typeof g!="string"||typeof x!="number"||typeof S!="number"&&typeof S<"u"){const R=`Incorrect server response: ${JSON.stringify(p)}`;return this.signalError(R,[]),xt(R)}this.delay=x,this.session.setSessionToken(f),this.session.setUserInfo({userBrowser:E,userCity:I,userCountry:k,userDevice:T,userOS:A,userState:G}),this.session.assign({sessionID:g,timestamp:w||r,projectID:y}),L?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(l=this.worker)==null||l.postMessage({type:"auth",token:f,beaconSizeLimit:S}),!a&&f===o&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Fs(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([R,J])=>this.send(da(R,J))),this.localStorage.setItem(this.options.local_uuid_key,m),this.compressionThreshold=_;const $={sessionToken:f,userUUID:m,sessionID:g};if(this.startCallbacks.forEach(R=>R($)),e.startCallback&&e.startCallback(Pa($)),this.features["feature-flags"]&&this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,f),this.activityState=pe.Active,(h=this.options.crossdomain)!=null&&h.enabled&&!this.insideIframe&&this.bootChildrenFrames(),j&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new Th(this,{fps:z,quality:Z,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame})),i){const R=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;R.length>0;)await this.flushBuffer(R);this.clearBuffers(),this.commit()}else this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber):this.observer.observe(),this.ticker.start();if((d=this.canvasRecorder)==null||d.startTracking(),this.features["usability-test"]&&!this.insideIframe){this.uxtManager=this.uxtManager?this.uxtManager:new _h(this,Aa);let R;const J=this.localStorage.getItem(Aa);if(J&&(R=parseInt(J,10)),location!=null&&location.search){const N=new URLSearchParams(location.search);if(N.has("oruxt")){const O=N.get("oruxt");R=O?parseInt(O,10):void 0}}R&&(this.uxtManager.isActive?this.onUxtCb.forEach(N=>N(R)):this.uxtManager.getTest(R,f,!!J).then(N=>{N&&this.onUxtCb.forEach(O=>O(N))}))}return Pa($)}catch(p){if(this.stop(),this.session.reset(),!p)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),xt("Unknown error");if(p===rs)return this.signalError(rs,[]),xt(rs);this._debug("session_start",p);const f=p instanceof Error?p.message:p.toString();return this.signalError(f,[]),xt(f)}}addOnUxtCb(e){this.onUxtCb.push(e)}getUxtId(){var e;return(e=this.uxtManager)==null?void 0:e.getTestId()}async waitStart(){return new Promise(e=>{const n=setInterval(()=>{this.canStart&&(clearInterval(n),e(!0))},100)})}async waitStarted(){return this.waitStatus(pe.Active)}async waitStatus(e){return new Promise(n=>{const s=()=>{this.activityState===e?n(!0):setTimeout(s,25)};s()})}async start(...e){return this.activityState===pe.Active||this.activityState===pe.Starting?Promise.resolve(xt("OpenReplay: trying to call `start()` on the instance that has been started already.")):(this.insideIframe&&this.signalIframeTracker(),document.hidden?new Promise(n=>{const s=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",s),n(this._start(...e)))};document.addEventListener("visibilitychange",s)}):(await this.waitStart(),this._start(...e)))}forceFlushBatch(){var e;(e=this.worker)==null||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){const n=e;return(s,i,r="down")=>{typeof s!="string"||typeof i!="string"||i.length>5*1024*1024||s.length>255||this.send(Ku("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n,s;if(this.activityState!==pe.NotActive)try{!this.insideIframe&&((n=this.options.crossdomain)!=null&&n.enabled)&&this.killChildrenFrames(),this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(i=>i()),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(s=this.canvasRecorder)==null||s.clear(),this.messages.length=0,this.parentActive=!1}finally{this.activityState=pe.NotActive,this.debug.log("OpenReplay tracking stopped.")}}};function Vh(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(zu(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const Ba=ht&&"InstallTrigger"in window?t=>t.message+`
|
|
10
|
-
`+t.stack:t=>t.stack||t.message;function lr(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?
|
|
11
|
-
`).filter(s=>!!s.match(
|
|
12
|
-
`).filter(s=>!s.match(
|
|
9
|
+
We appreciate your time and valuable input.`),r=X("div","end_button_or",Ea,"Submitting Feedback"),o=_h();r.appendChild(o),(u=this.test)!=null&&u.reqMic||(c=this.test)!=null&&c.reqCamera?this.userRecorder.sendToAPI().then(()=>{r.removeChild(o),r.textContent="End Session",e=!1}).catch(h=>{console.error(h),r.removeChild(o),r.textContent="End Session",e=!1}):(r.removeChild(o),r.textContent="End Session",e=!1),this.taskSection&&this.container.removeChild(this.taskSection),this.descriptionSection&&this.container.removeChild(this.descriptionSection),this.stopButton&&this.stopButtonContainer&&this.container.removeChild(this.stopButtonContainer),r.onclick=()=>{e||(window.close(),document.body.removeChild(this.bg))},n.append(s,i,r),this.endSection=n,this.container.append(n)}}function Aa(t){return!!t&&t.nodeType!=null}function tr(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function xt(t){return t.nodeType===Node.ELEMENT_NODE}function Eh(t){return t.nodeType===Node.COMMENT_NODE}function nr(t){return t.nodeType===Node.TEXT_NODE}function Hs(t){return t.nodeType===Node.DOCUMENT_NODE}function qs(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function we(t,e){return t.localName===e}class Ih{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=[],this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=s=>{const i=this.app.nodes.getID(s);if(!i||!we(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!we(s,"canvas")||this.snapshots[i])return;new IntersectionObserver(a=>{a.forEach(l=>{l.isIntersecting&&(l.target?this.snapshots[i]&&this.snapshots[i].createdAt?this.snapshots[i].paused=!1:this.recordCanvas(l.target,i):this.snapshots[i]&&(this.snapshots[i].paused=!0))})}).observe(s)},this.recordCanvas=(s,i)=>{const r=this.app.timestamp();this.snapshots[i]={images:[],createdAt:r,paused:!1,dummy:document.createElement("canvas")};const o=$u(i.toString(),r);this.app.send(o);const a=u=>{Ch(u,this.options.quality,this.snapshots[i].dummy,this.options.fixedScaling,this.fileExt,c=>{if(c){if(!this.snapshots[i])return this.app.debug.warn("Canvas not present in snapshots after capture:",this.snapshots,i);this.snapshots[i].images.push({id:this.app.timestamp(),data:c}),this.snapshots[i].images.length>9&&(this.sendSnaps(this.snapshots[i].images,i,this.snapshots[i].createdAt),this.snapshots[i].images=[])}})},l=setInterval(()=>{const u=this.app.nodes.getID(s),c=u?this.app.nodes.getNode(u):void 0;if(!this.snapshots[i]){this.app.debug.log("Canvas is not present in {snapshots}"),clearInterval(l);return}if(!c||!we(c,"canvas")||c!==s){this.app.debug.log("Canvas element not in sync",c,s),clearInterval(l);return}else this.snapshots[i].paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{a(c)}):a(c))},this.interval);this.intervals.push(l)},this.fileExt=n.fileExt??"webp",this.interval=1e3/n.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(this.captureCanvas)},250)}sendSnaps(e,n,s){if(Object.keys(this.snapshots).length===0)return;const i=new FormData;e.forEach(o=>{const a=o.data;a&&(i.append("snapshot",a,`${s}_${n}_${o.id}.${this.fileExt}`),this.options.isDebug&&Nh(a,`${s}_${n}_${o.id}.${this.fileExt}`))});const r=()=>{this.app.debug.log("Restarting tracker; token expired"),this.app.stop(!1),setTimeout(()=>{this.app.start({},!0)},250)};fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:i}).then(o=>o.status===401?r():!0).catch(o=>{this.app.debug.error("error saving canvas",o)})}clear(){this.intervals.forEach(e=>clearInterval(e)),this.snapshots={}}}const Ma={low:.35,medium:.55,high:.8};function Ch(t,e="medium",n,s=!1,i,r){const o=`image/${i}`;if(s){const a=window.devicePixelRatio||1;n.width=t.width/a,n.height=t.height/a;const l=n.getContext("2d");if(!l)return"";l.clearRect(0,0,n.width,n.height),l.drawImage(t,0,0,n.width,n.height),n.toBlob(r,o,Ma[e])}else t.toBlob(r,o,Ma[e])}function Nh(t,e){const n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}const Pn={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class Rh{constructor(e=Pn.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(Pn.Verbose)&&console.info(...n)},this.log=(...n)=>{this.shouldLog(Pn.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(Pn.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(Pn.Errors)&&console.error(...n)},this.level=e}}const Dh=1e3;function Oh(t,e,n){const s=t.entries();function i(){const r=[];let o=s.next();for(;!o.done&&r.length<e;)r.push(o.value),o=s.next();r.length>0&&(r.forEach(([a,l])=>{l&&n(l)}),setTimeout(i,50))}i()}function Ah(t){var e;try{if(!t.isConnected)return[!1,"not connected"];const n=t.nodeType===Node.DOCUMENT_NODE,s=n?t.defaultView:(e=t.ownerDocument)==null?void 0:e.defaultView,i=n?t:t.ownerDocument;return s?s.closed?[!1,"window closed"]:i!=null&&i.documentElement.isConnected?[!0,"ok"]:[!1,"documentElement not connected"]:[!1,"no window"]}catch(n){return[!1,n]}}const Mh={interval:Dh*30,batchSize:2500,enabled:!0};class Ph{constructor(e,n,s){this.nodes=e,this.unregisterNode=n,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{Oh(this.nodes,this.options.batchSize,i=>{Ah(i)[0]||this.unregisterNode(i)})},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval)},this.options={...Mh,...s}}}class Lh{constructor(e){this.nodes=new Map,this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.scanTree=n=>{this.nodes.forEach(s=>s?n(s):void 0)},this.attachNodeListener=(n,s,i,r=!0)=>{const o=this.getID(n);if(o===void 0)return;ua(n,s,i,r,this.forceNgOff);let a=this.elementListeners.get(o);a===void 0&&(a=[],this.elementListeners.set(o,a)),a.push([s,i,r])},this.unregisterNode=n=>{const s=n[this.node_id];if(s!==void 0){n[this.node_id]=void 0,delete n[this.node_id],this.nodes.delete(s);const i=this.elementListeners.get(s);i!==void 0&&(this.elementListeners.delete(s),i.forEach(r=>ha(n,r[0],r[1],r[2],this.forceNgOff))),this.totalNodeAmount--}return s},this.node_id=e.node_id,this.forceNgOff=e.forceNgOff,this.maintainer=new Ph(this.nodes,this.unregisterNode,e.maintainer),this.maintainer.start()}syntheticMode(e){const n=Number.MAX_SAFE_INTEGER,i=99999999*e;if(i>n)throw new Error("Placeholder id overflow");this.nextNodeId=i}attachNodeCallback(e){return this.nodeCallbacks.push(e)}registerNode(e){let n=e[this.node_id];const s=n===void 0;return s&&(n=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes.set(n,e),e[this.node_id]=n),[n,s]}cleanTree(){for(const[e,n]of this.nodes)n&&!document.contains(n)&&this.unregisterNode(n)}callNodeCallbacks(e,n){this.nodeCallbacks.forEach(s=>s(e,n))}getID(e){if(e)return e[this.node_id]}getNode(e){return this.nodes.get(e)}getNodeCount(){return this.totalNodeAmount}clear(){for(const[e,n]of this.nodes)n&&this.unregisterNode(n);this.nextNodeId=0,this.nodes.clear()}}function Vs(t){if(Eh(t))return!0;if(nr(t))return!1;if(!xt(t))return!0;const e=t.tagName.toUpperCase();if(e==="LINK"){const n=t.getAttribute("rel"),s=t.getAttribute("as");return!(n!=null&&n.includes("stylesheet")||s==="style"||s==="font")}return e==="SCRIPT"||e==="NOSCRIPT"||e==="META"||e==="TITLE"||e==="BASE"}function sr(t){return qs(t)?!0:!Vs(t)}var dt;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(dt||(dt={}));class ir{constructor(e,n=!1){this.app=e,this.isTopContext=n,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.observer=ca(this.app.safe(s=>{for(const i of s){const r=i.target,o=i.type;if(!sr(r))continue;if(o==="childList"){for(let l=0;l<i.removedNodes.length;l++)sr(i.removedNodes[l])&&this.bindNode(i.removedNodes[l]);for(let l=0;l<i.addedNodes.length;l++)this.bindTree(i.addedNodes[l]);continue}const a=this.app.nodes.getID(r);if(a!==void 0){if(this.recents.has(a)||this.recents.set(a,dt.Changed),o==="attributes"){const l=i.attributeName;if(l===null)continue;let u=this.attributesMap.get(a);u===void 0&&this.attributesMap.set(a,u=new Set),u.add(l);continue}o==="characterData"&&this.textSet.add(a)}}this.commitNodes()}),this.app.options.forceNgOff)}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}handleIframeSrcChange(e){const n=e.contentDocument;if(n&&this.app.nodes.getID(n)!==void 0){const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:l=>Vs(l)||this.app.nodes.getID(l)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let r=0;const o=this.app.nodes.getNodeCount();for(;i.nextNode();)e.contentDocument.contains(i.currentNode)||(r+=1,this.app.nodes.unregisterNode(i.currentNode));const a=Math.floor(r/o*100);a>30&&this.app.send(Sa(a))}}sendNodeAttribute(e,n,s,i){if(tr(n)){s.substring(0,6)==="xlink:"&&(s=s.substring(6)),i===null?this.app.send(fa(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Gi(e,s,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,s,i);return}if(!(s==="src"||s==="srcset"||s==="integrity"||s==="crossorigin"||s==="autocomplete"||s.substring(0,2)==="on")&&!(s==="value"&&we(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(fa(e,s));return}if(s==="style"||s==="href"&&we(n,"link")){this.app.send(Gi(e,s,i,this.app.getBaseHref()));return}(s==="href"||i.length>1e5)&&(i=""),this.app.attributeSender.sendSetAttribute(e,s,i)}}sendNodeData(e,n,s){if(we(n,"style")){this.app.send(Vu(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(Du(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,dt.New):this.recents.get(n)!==dt.New&&this.recents.set(n,dt.Removed)}bindTree(e){if(!sr(e))return;this.bindNode(e);const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:s=>(this.app.nodes.getID(s)!==void 0&&this.app.debug.error("! Node is already bound",s),Vs(s)||this.app.nodes.getID(s)!==void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)},!1);for(;n.nextNode();)this.bindNode(n.currentNode)}unbindTree(e){const n=this.app.nodes.unregisterNode(e);if(n!==void 0&&this.recents.get(n)===dt.Removed){this.app.send(Ru(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>Vs(a)||this.app.nodes.getID(a)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let i=0;const r=this.app.nodes.getNodeCount();for(;s.nextNode();)i+=1,this.app.nodes.unregisterNode(s.currentNode);const o=Math.floor(i/r*100);o>30&&this.app.send(Sa(o))}}_commitNode(e,n){if(qs(n))return!0;const s=n.parentNode;let i;if(!we(n,"html")||!this.isTopContext){if(s===null)return this.unbindTree(n),!1;if(i=this.app.nodes.getID(s),i===void 0)return this.unbindTree(n),!1;if(!this.commitNode(i))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,i,n),this.app.sanitizer.isHidden(i))return!1}let r=n.previousSibling;for(;r!==null;){const c=this.app.nodes.getID(r);if(c!==void 0){this.commitNode(c),this.indexes[e]=this.indexes[c]+1;break}r=r.previousSibling}r===null&&(this.indexes[e]=0);const o=this.recents.get(e),a=o===dt.New,l=this.indexes[e];if(l===void 0)throw"commitNode: missing node index";if(a){if(xt(n)){let c=n;if(i!==void 0){if(this.app.sanitizer.isHidden(e)){const h=c.clientWidth,d=c.clientHeight;c=n.cloneNode(),c.style.width=`${h}px`,c.style.height=`${d}px`}this.app.send(Iu(e,i,l,c.tagName,tr(n)))}for(let h=0;h<c.attributes.length;h++){const d=c.attributes[h];this.sendNodeAttribute(e,c,d.nodeName,d.value)}}else nr(n)&&(this.app.send(Cu(e,i,l)),this.sendNodeData(e,s,n.data));return!0}o===dt.Removed&&i!==void 0&&this.app.send(Nu(e,i,l));const u=this.attributesMap.get(e);if(u!==void 0){if(!xt(n))throw"commitNode: node is not an element";for(const c of u)this.sendNodeAttribute(e,n,c,n.getAttribute(c))}if(this.textSet.has(e)){if(!nr(n))throw"commitNode: node is not a text";this.sendNodeData(e,s,n.data)}return!0}commitNode(e){const n=this.app.nodes.getNode(e);if(n===void 0)return!1;const s=this.commited[e];return s!==void 0?s:this.commited[e]=this._commitNode(e,n)}commitNodes(e=!1){let n;this.recents.forEach((s,i)=>{this.commitNode(i),s===dt.New&&(n=this.app.nodes.getNode(i))&&this.app.nodes.callNodeCallbacks(n,e)}),this.clear()}observeRoot(e,n,s=e){this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(s),n(this.app.nodes.getID(e)),this.commitNodes(!0)}disconnect(){this.observer.disconnect(),this.clear()}}class Pa extends ir{observe(e){const n=e.contentDocument,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.docId=i,this.app.send(Ki(s,i))})}syntheticObserve(e,n){this.observeRoot(n,s=>{if(s===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(Ki(e,s))})}}class Bh extends ir{observe(e){const n=e.shadowRoot,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.error("OpenReplay: Shadow Root was not bound");return}this.app.send(Ki(s,i))})}}class Fh{constructor(){this.states=new WeakMap}calcOffset(e){let n=0,s=0;if(e.parent&&([n,s]=this.calcOffset(e.parent)),!e.offset){const{left:o,top:a}=e.iFrame.getBoundingClientRect();e.offset=[o,a]}const[i,r]=e.offset;return[n+i,s+r]}getDocumentOffset(e){const n=this.states.get(e);return n?this.calcOffset(n):[0,0]}observe(e){var a;const n=e.contentDocument;if(!n)return;const s=e.ownerDocument,i=this.states.get(s),r={offset:null,iFrame:e,parent:i||null,clear:()=>{var l;s.removeEventListener("scroll",o),(l=s.defaultView)==null||l.removeEventListener("resize",o)}},o=()=>{r.offset=null};s.addEventListener("scroll",o),(a=s.defaultView)==null||a.addEventListener("resize",o),this.states.set(n,r)}clear(){this.states=new WeakMap}}const rr=ht?Element.prototype.attachShadow:()=>new ShadowRoot;class Wh extends ir{constructor(e){super(e.app,!0),this.iframeOffsets=new Fh,this.contextCallbacks=[],this.contextsSet=new WeakSet,this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.docObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.app=e.app,this.options=Object.assign({captureIFrames:!0},e.options),this.app.nodes.attachNodeCallback(n=>{we(n,"iframe")&&(this.options.captureIFrames&&!an(n,"obscured")||an(n,"capture"))&&this.handleIframe(n)}),this.app.nodes.attachNodeCallback(n=>{xt(n)&&n.shadowRoot!==null&&this.handleShadowRoot(n.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){const n=this.app.safe(()=>setTimeout(()=>{const s=this.app.nodes.getID(e);if(s===void 0||!bu(e))return;const i=e.contentWindow,r=e.contentDocument;if(!r){this.app.debug.warn("no doc for iframe found",e);return}if(r&&this.docObservers.has(r)){this.app.debug.info("doc already observed for",s);return}const o=new Pa(this.app);this.iframeObservers.set(e,o),this.docObservers.set(r,o),this.iframeObserversArr.push(o),o.observe(e),this.iframeOffsets.observe(e),i&&i===i.window&&!this.contextsSet.has(i)&&(this.contextsSet.add(i),this.contextCallbacks.forEach(a=>a(i)))},250));e.addEventListener("load",n),n()}handleShadowRoot(e){const n=new Bh(this.app);this.shadowRootObservers.set(e,n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=rr.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(Eu()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=rr.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new Pa(this.app);this.iframeObservers.set(window.document,i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=rr,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}var Gs;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(Gs||(Gs={}));const zh=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class jh{constructor(e){this.obscured=new Set,this.hidden=new Set,this.app=e.app,this.options=Object.assign({obscureTextEmails:!0,obscureTextNumbers:!1},e.options)}handleNode(e,n,s){if((this.obscured.has(n)||xt(s)&&(an(s,"masked")||an(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||xt(s)&&(an(s,"htmlmasked")||an(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&xt(s)){const i=this.options.domSanitizer(s);i===Gs.Obscured&&this.obscured.add(e),i===Gs.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?zh(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g,s=>{const[i,r]=s.split("@"),[o,a]=r.split(".");return`${Hi(i)}@${Hi(o)}.${Hi(a)}`})),n)}isObscured(e){return this.obscured.has(e)}isHidden(e){return this.hidden.has(e)}getInnerTextSecure(e){const n=this.app.nodes.getID(e);return n?this.sanitize(n,e.innerText):""}clear(){this.obscured.clear(),this.hidden.clear()}}class Uh{constructor(e){this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.app=e.app,this.options=e.options,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){e.userID==null&&delete e.userID,e.sessionID==null&&delete e.sessionID,this.callbacks.forEach(n=>n(e))}assign(e){e.userID!==void 0&&(this.userID=e.userID),e.metadata!==void 0&&Object.entries(e.metadata).forEach(([n,s])=>this.metadata[n]=s),e.sessionID!==void 0&&(this.sessionID=e.sessionID),e.timestamp!==void 0&&(this.timestamp=e.timestamp),e.projectID!==void 0&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,n){this.metadata[e]=n,this.handleUpdate({metadata:{[e]:n}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}getPageNumber(){const e=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(e!=null)return parseInt(e)}incPageNo(){let e=this.getPageNumber();return e===void 0?e=0:e++,this.app.sessionStorage.setItem(this.options.session_pageno_key,e.toString()),e}getSessionToken(){return this.token||this.app.sessionStorage.getItem(this.options.session_token_key)||void 0}setSessionToken(e){this.token=e,this.app.sessionStorage.setItem(this.options.session_token_key,e)}applySessionHash(e){const n=decodeURI(e).split("&");let s=e,i="100500";n.length==2&&([i,s]=n),!(!i||!s)&&(this.app.sessionStorage.setItem(this.options.session_token_key,s),this.app.sessionStorage.setItem(this.options.session_pageno_key,i))}getSessionHash(){const e=this.getPageNumber(),n=this.getSessionToken();if(!(e===void 0||n===void 0))return encodeURI(String(e)+"&"+n)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=yu(12);this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}function Hh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class qh{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e,n=0,s=!0,i){i&&(e=e.bind(i)),s&&(e=this.app.safe(e)),this.callbacks.unshift(n?Hh(e,n):e)-1}start(){this.timer===null&&(this.timer=setInterval(()=>this.callbacks.forEach(e=>{e&&e()}),30))}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}}const Vh='!function(){"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t){if(this.busy||!this.token)this.queue.push(t);else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}else this.busy=!1}retry(t,s,i){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout((()=>this.sendBatch(t,s,i)),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t,s,i){var e;const n=null==i?void 0:i.toString().replace(/^([^_]+)_([^_]+).*/,"$1_$2_$3");this.busy=!0;const h={Authorization:`Bearer ${this.token}`};s&&(h["Content-Encoding"]="gzip"),null!==this.token?fetch(`${this.ingestURL}?batch=${null!==(e=this.pageNo)&&void 0!==e?e:"noPageNum"}_${null!=n?n:"noBatchNum"}`,{body:t,method:"POST",headers:h,keepalive:t.length<65536}).then((e=>{if(401===e.status)return this.busy=!1,void this.onUnauthorised();e.status>=400?this.retry(t,s,`${null!=i?i:"noBatchNum"}_network:${e.status}`):(this.attemptsCount=0,this.sendNext())})).catch((e=>{console.warn("OpenReplay:",e),this.retry(t,s,`${null!=i?i:"noBatchNum"}_reject:${e.message}`)})):setTimeout((()=>{this.sendBatch(t,s,`${null!=i?i:"noBatchNum"}_newToken`)}),500)}sendCompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!0,s)}sendUncompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class i{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const i=s.encode(t),e=i.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(i,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class e extends i{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 38:case 70:case 75:case 76:case 77:case 82:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 63:case 64:case 79:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 67:case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class n{constructor(t,s,i,n,h,r){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=n,this.tabId=h,this.onOfflineEnd=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new e(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url],s=[118,this.tabId];this.writeType(t),this.writeFields(t),this.writeWithSize(s),this.isEmpty=!0}writeWithSize(t){const s=this.encoder;if(!this.writeType(t)||!s.skip(3))return!1;const i=s.getCurrentOffset(),e=this.writeFields(t);if(e){const e=s.getCurrentOffset()-i;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,i-3),s.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if("q_end"===t[0])return this.finaliseBatch(),this.onOfflineEnd();0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new e(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)?this.finaliseBatch():console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder=new e(this.beaconSize),this.prepare()))}finaliseBatch(){if(this.isEmpty)return;const t=this.encoder.flush();this.onBatch(t),this.prepare()}clean(){this.encoder.reset()}}var h;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(h||(h={}));let r=null,u=null,a=h.NotActive;function o(){u&&u.finaliseBatch()}function c(){return new Promise((t=>{a=h.Stopping,null!==p&&(clearInterval(p),p=null),u&&(u.clean(),u=null),r&&(r.clean(),setTimeout((()=>{r=null}),20)),setTimeout((()=>{a=h.NotActive,t(null)}),100)}))}function g(){[h.Stopped,h.Stopping].includes(a)||(postMessage("a_stop"),c().then((()=>{postMessage("a_start")})))}let l,p=null;self.onmessage=({data:s})=>{if(null!=s){if("stop"===s)return o(),void c().then((()=>{a=h.Stopped}));if("forceFlushBatch"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&r.sendCompressed(s.batch)}if("uncompressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&r.sendUncompressed(s.batch)}return"start"===s.type?(a=h.Starting,r=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),c()}(t)}),s.connAttemptCount,s.connAttemptGap,(t=>{postMessage({type:"compress",batch:t},[t.buffer])}),s.pageNo),u=new n(s.pageNo,s.timestamp,s.url,(t=>{r&&r.push(t)}),s.tabId,(()=>postMessage({type:"queue_empty"}))),null===p&&(p=setInterval(o,1e4)),a=h.Active):"auth"===s.type?r?u?(r.authorise(s.token),void(s.beaconSizeLimit&&u.setBeaconSizeLimit(s.beaconSizeLimit))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(u){const t=u;s.forEach((s=>{55===s[0]&&(s[1]?l=setTimeout((()=>g()),18e5):clearTimeout(l)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else o()}else o()}}();\n',os="canceled",La="or_uxt_active",or="or_buffer_1",Et=t=>({reason:t,success:!1}),Ba=t=>({...t,success:!0});var pe;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(pe||(pe={}));const Fa="https://api.openreplay.com/ingest";function ar(){const t=new Date().getTimezoneOffset()*-1,e=t>=0?"+":"-",n=Math.floor(Math.abs(t)/60),s=Math.abs(t)%60;return`UTC${e}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}const Gh=t=>new Promise(e=>setTimeout(e,t)),ge={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"tracker inside a child iframe",iframeId:"getting node id for child iframe",iframeBatch:"batch of messages from an iframe window",parentAlive:"signal that parent is live",killIframe:"stop tracker inside frame",startIframe:"start tracker inside frame",polling:"hello-how-are-you-im-under-the-water-please-help-me"};let Kh=class{constructor(e,n,s,i,r){var l,u;this.signalError=i,this.insideIframe=r,this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=pe.NotActive,this.version="14.0.14",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.features={"feature-flags":!0,"usability-test":!0},this.parentActive=!1,this.checkStatus=()=>this.parentActive,this.parentCrossDomainFrameListener=c=>{const{data:h}=c;if(!(!h||c.source===window)){if(h.line===ge.startIframe){if(this.active())return;try{this.allowAppStart(),this.start()}catch(d){console.error("children frame restart failed:",d)}}h.line===ge.parentAlive&&(this.parentActive=!0),h.line===ge.iframeId&&(this.parentActive=!0,this.rootId=h.id,this.session.setSessionToken(h.token),this.frameOderNumber=h.frameOrderNumber,this.debug.log("starting iframe tracking",h),this.allowAppStart()),h.line===ge.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.crossDomainIframeListener=c=>{var d,p;if(!this.active()||c.source===window)return;const{data:h}=c;if(h){if(h.line===ge.iframeSignal&&((d=c.source)==null||d.postMessage({ping:!0,line:ge.parentAlive},"*"),(async()=>{var S;if(c.source===null)return console.error("Couldnt connect to event.source for child iframe tracking");const m=await this.checkNodeId(c.source);if(!m){this.debug.log("Couldnt get node id for iframe",c.source);return}try{this.trackedFrames.includes(h.context)?this.debug.log("Trying to observe already added iframe; ignore if its a restart"):this.trackedFrames.push(h.context),await this.waitStarted();const T=this.session.getSessionToken(),x=this.trackedFrames.findIndex(g=>g===h.context)+1;x===0&&this.debug.error("Couldnt get order number for iframe",h.context,this.trackedFrames);const I={line:ge.iframeId,id:m,token:T,frameOrderNumber:x};this.debug.log("Got child frame signal; nodeId",m,c.source,I),(S=c.source)==null||S.postMessage(I,"*")}catch(T){console.error(T)}})()),h.line===ge.iframeBatch){const m=h.messages.map(S=>{if(S[0]===20){let T=S;return this.pageFrames.forEach(x=>{if(x.contentWindow===c.source){const[I,g,b]=S,{left:_,top:k}=x.getBoundingClientRect();T=[I,g+_,b+k]}}),T}if(S[0]===68){let T=S;return this.pageFrames.forEach(x=>{if(x.contentWindow===c.source){const[I,g,b,_,k,y,E]=S,{left:P,top:j,width:L,height:J}=x.getBoundingClientRect(),U=document.documentElement.scrollWidth,B=document.documentElement.scrollHeight,Y=y/100*L+P,ee=E/100*J+j,R=Y/U,Q=ee/B;T=[I,g,b,_,k,Math.round(R*1e3)/10,Math.round(Q*1e3)/10]}}),T}return S});this.messages.push(...m)}if(h.line===ge.polling){if(!this.pollingQueue.order.length)return;const f=this.pollingQueue.order[0];if(f&&this.pollingQueue[f].length===0){this.pollingQueue.order=this.pollingQueue.order.filter(m=>m!==f);return}this.pollingQueue[f].includes(h.context)&&(this.pollingQueue[f]=this.pollingQueue[f].filter(m=>m!==h.context),(p=c.source)==null||p.postMessage({line:f},"*"),this.pollingQueue[f].length===0&&this.pollingQueue.order.shift())}}},this.pollingQueue={order:[]},this.addCommand=c=>{this.pollingQueue.order.push(c),this.pollingQueue[c]=[...this.trackedFrames]},this.bootChildrenFrames=async()=>{await this.waitStarted(),this.addCommand(ge.startIframe)},this.killChildrenFrames=()=>{this.addCommand(ge.killIframe)},this.signalIframeTracker=()=>{var T;const c=this.session.getTabId();window.parent.postMessage({line:ge.iframeSignal,source:c,context:this.contextId},((T=this.options.crossdomain)==null?void 0:T.parentDomain)??"*");const h=10;let d=0,p=250,f=0,m=!1;const S=()=>{var x;if(m||this.checkStatus()){m=!0;return}window.parent.postMessage({line:ge.iframeSignal,source:c,context:this.contextId},((x=this.options.crossdomain)==null?void 0:x.parentDomain)??"*"),this.debug.info("Trying to signal to parent, attempt:",d+1),d++};for(let x=0;x<h;x++){if(this.checkStatus()){m=!0;break}f+=p,setTimeout(()=>{S()},f),p*=1.5}},this.startTimeout=null,this.coldStartCommitN=0,this.delay=0,this.attachStartCallback=(c,h=!1)=>{h&&(c=this.safe(c)),this.startCallbacks.push(c)},this.attachStopCallback=(c,h=!1)=>{h&&(c=this.safe(c)),this.stopCallbacks.push(c)},this.attachEventListener=(c,h,d,p=!0,f=!0)=>{p&&(d=this.safe(d));const m=()=>c?ua(c,h,d,f,this.options.forceNgOff):null,S=()=>c?ha(c,h,d,f,this.options.forceNgOff):null;this.attachStartCallback(m,p),this.attachStopCallback(S,p)},this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.prevOpts={},this.restartCanvasTracking=()=>{var c;(c=this.canvasRecorder)==null||c.restartTracking()},this.flushBuffer=async c=>new Promise(h=>{let d=!1;const p=[c.shift()];for(;!d;){const f=c[0];!f||f[0]===0?d=!0:p.push(c.shift())}this.postToWorker(p),h(null)}),this.onUxtCb=[],this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,Object.keys(s).findIndex(c=>["fixedCanvasScaling","disableCanvas"].includes(c))!==-1&&(console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'),s={...s,canvas:{__save_canvas_locally:s.__save_canvas_locally,fixedCanvasScaling:s.fixedCanvasScaling,disableCanvas:s.disableCanvas}}),this.networkOptions=s.network;const o={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:Fa,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:Pn.Silent,__save_canvas_locally:!1,localStorage:null,sessionStorage:null,disableStringDict:!1,forceSingleTab:!1,assistSocketHost:"",fixedCanvasScaling:!1,disableCanvas:!1,captureIFrames:!0,obscureTextEmails:!0,obscureTextNumbers:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1},forceNgOff:!1};if(this.options=da(o,s),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const c=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${c}`)}this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new jh({app:this,options:s}),this.nodes=new Lh({node_id:this.options.node_id,forceNgOff:!!s.forceNgOff,maintainer:(l=this.options.nodes)==null?void 0:l.maintainer}),this.observer=new Wh({app:this,options:s}),this.ticker=new qh(this),this.ticker.attach(()=>this.commit()),this.debug=new Rh(this.options.__debug__),this.session=new Uh({app:this,options:this.options}),this.attributeSender=new fu({app:this,isDictDisabled:!!(this.options.disableStringDict||(u=this.options.crossdomain)!=null&&u.enabled)}),this.featureFlags=new mu(this),this.tagWatcher=new sh({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:c=>this.send(eh(c))}),this.session.attachUpdateCallback(({userID:c,metadata:h})=>{c!=null&&this.send(zu(c)),h!=null&&Object.entries(h).forEach(([d,p])=>this.send(pa(d,p)))}),n!=null&&this.session.applySessionHash(n);const a=this.session.getTabId();this.insideIframe?(window.addEventListener("message",this.parentCrossDomainFrameListener),setInterval(()=>{var c;document.hidden||window.parent.postMessage({line:ge.polling,context:this.contextId},((c=s.crossdomain)==null?void 0:c.parentDomain)??"*")},250)):(this.initWorker(),window.addEventListener("message",this.crossDomainIframeListener)),this.bc!==null&&(this.bc.postMessage({line:ge.ask,source:a,context:this.contextId}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},250),this.bc.onmessage=c=>{if(c.data.context!==this.contextId){if(c.data.line===ge.resp){const h=c.data.token;this.session.setSessionToken(h),this.allowAppStart()}if(c.data.line===ge.reg){const h=c.data.token;this.session.regenerateTabId(),this.session.setSessionToken(h),this.allowAppStart()}if(c.data.line===ge.ask){const h=this.session.getSessionToken();h&&this.bc&&this.bc.postMessage({line:c.data.source===a?ge.reg:ge.resp,token:h,source:a,context:this.contextId})}}})}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkNodeId(e){let n;if(this.pageFrames.length>0&&(n=this.pageFrames.find(i=>i.contentWindow===e)),!n||!this.pageFrames.length){const i=Array.from(document.querySelectorAll("iframe"));this.pageFrames=i,n=i.find(r=>r.contentWindow===e)}if(!n)return null;let s=0;for(;s<100;){const i=n[this.options.node_id];if(i!==void 0)return s=100,i;s++,await Gh(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([Vh],{type:"text/javascript"}))),this.worker.onerror=n=>{this._debug("webworker_error",n)},this.worker.onmessage=({data:n})=>{this.handleWorkerMsg(n)};const e=()=>{this.worker&&this.worker.postMessage(null)};this.attachEventListener(window,"beforeunload",e,!1),this.attachEventListener(document.body,"mouseleave",e,!1,!1),this.attachEventListener(document,"visibilitychange",e,!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.waitStatus(pe.NotActive).then(()=>{this.allowAppStart(),this.start(this.prevOpts,!0).then(s=>{this.debug.info("Worker restarted, session was too long",s)}).catch(s=>{this.debug.error("Worker restart failed",s)})});else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const s=e.batch;s.byteLength>this.compressionThreshold?uu(e.batch,{mtime:0},(r,o)=>{var a,l;r?(this.debug.error("Openreplay compression error:",r),(a=this.worker)==null||a.postMessage({type:"uncompressed",batch:s})):(l=this.worker)==null||l.postMessage({type:"compressed",batch:o})}):(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:s})}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}send(e,n=!1){var s;this.activityState!==pe.NotActive&&(this.activityState===pe.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===pe.Active&&n&&this.commit())}_nCommit(){var e;if(this.socketMode){this.messages.unshift(cn(this.session.getTabId())),this.messages.unshift(ln(this.timestamp())),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(this.insideIframe){window.parent.postMessage({line:ge.iframeBatch,messages:this.messages},((e=this.options.crossdomain)==null?void 0:e.parentDomain)??"*"),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(!(this.worker===void 0||!this.messages.length))try{ku(()=>{var n;this.messages.unshift(cn(this.session.getTabId())),this.messages.unshift(ln(this.timestamp())),(n=this.worker)==null||n.postMessage(this.messages),this.commitCallbacks.forEach(s=>s(this.messages)),this.messages.length=0})}catch(n){this._debug("worker_commit",n),this.stop(!0),setTimeout(()=>{this.start()},500)}}_cStartCommit(){this.coldStartCommitN+=1,this.coldStartCommitN===2&&(this.bufferedMessages1.push(ln(this.timestamp())),this.bufferedMessages1.push(cn(this.session.getTabId())),this.bufferedMessages2.push(ln(this.timestamp())),this.bufferedMessages2.push(cn(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===pe.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(s=>s(e)),e.length=0}timestamp(){return it()+this.delay}safe(e){const n=this;return function(...s){try{e.apply(this,s)}catch(i){n._debug("safe_fn_call",i)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}checkRequiredVersion(e){const n=e.split(/[.-]/),s=this.version.split(/[.-]/);for(let i=0;i<3;i++){if(isNaN(Number(s[i]))||isNaN(Number(n[i])))return!1;if(Number(s[i])>Number(n[i]))return!0;if(Number(s[i])<Number(n[i]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken()}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:n,sessionID:s,timestamp:i}=this.session.getInfo();if(!n||!s){this.debug.error("OpenReplay error: Unable to build session URL");return}const r=this.options.ingestPoint,l=(/api\.openreplay\.com/.test(r)?"https://app.openreplay.com/ingest":r).replace(/ingest$/,`${n}/session/${s}`);if(e!=null&&e.withCurrentTime){const u=it()-i;return`${l}?jumpto=${u}`}return l}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===pe.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}checkSessionToken(e){const n=this.sessionStorage.getItem(this.options.session_reset_key)!==null,s=e||n,i=this.session.getSessionToken();return s||!i}async coldStart(e={},n){this.singleBuffer=!1;const s=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,Ui(),this.coldStartTs=it(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(ln(this.timestamp())),this.bufferedMessages1.push(cn(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(ln(this.timestamp())),this.bufferedMessages2.push(cn(this.session.getTabId()))),this.stop(!1),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(zs(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var p,f;this.conditionsManager=new pu(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:it(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Qi,jsHeapSizeLimit:Zi,timezone:ar(),width:window.screen.width,height:window.screen.height})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:l,userState:u,projectID:c,features:h}=await n.json();this.features=h||this.features,this.session.assign({projectID:c}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:l,userState:u});const d={sessionToken:s,userUUID:"",sessionID:""};this.startCallbacks.forEach(m=>m(d)),await((p=this.conditionsManager)==null?void 0:p.fetchConditions(c,s)),this.features["feature-flags"]&&(await this.featureFlags.reloadFlags(s),(f=this.conditionsManager)==null||f.processFlags(this.featureFlags.flags)),await this.tagWatcher.fetchTags(this.options.ingestPoint,s)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const s=this.checkSessionToken(e.forceNew);Ui(),this.coldStartTs=it();const i=this.localStorage.getItem(or);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(or)}this.bufferedMessages1.push(ln(this.timestamp())),this.bufferedMessages1.push(cn(this.session.getTabId())),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(o=>o(r)),s||this.send(zs(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(or,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var d,p;this.stop(!1);const e=it();(d=this.worker)==null||d.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:e,doNotRecord:!1,bufferDiff:e-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Qi,jsHeapSizeLimit:Zi,timezone:ar()})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:l,userState:u,beaconSizeLimit:c,projectID:h}=await n.json();for((p=this.worker)==null||p.postMessage({type:"auth",token:s,beaconSizeLimit:c}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:l,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([["q_end"]]),this.clearBuffers()}async _start(e={},n=!1,s){var l,u,c,h,d;Object.keys(e).length!==0&&(this.prevOpts=e);const i=this.activityState===pe.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const p="No worker found: perhaps, CSP is not set.";return this.signalError(p,[]),Promise.resolve(Et(p))}if(this.activityState===pe.Active||this.activityState===pe.Starting)return Promise.resolve(Et("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=pe.Starting,i||Ui(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=it();(l=this.worker)==null||l.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:r,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const o=this.session.getSessionToken(),a=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",a,"session token: ",o);try{const p=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:r,doNotRecord:!1,bufferDiff:r-this.coldStartTs,userID:this.session.getInfo().userID,token:a?void 0:o,deviceMemory:Qi,jsHeapSizeLimit:Zi,timezone:ar(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(p.status!==200){const R=await p.text(),Q=R===os?os:`Server error: ${p.status}. ${R}`;return Et(Q)}if(!this.worker&&!this.insideIframe){const R="no worker found after start request (this should not happen in real world)";return this.signalError(R,[]),Et(R)}const{token:f,userUUID:m,projectID:S,beaconSizeLimit:T,compressionThreshold:x,delay:I,sessionID:g,startTimestamp:b,userBrowser:_,userCity:k,userCountry:y,userDevice:E,userOS:P,userState:j,canvasEnabled:L,canvasQuality:J,canvasFPS:U,assistOnly:B,features:Y}=await p.json();if(this.features=Y||this.features,typeof f!="string"||typeof m!="string"||typeof b!="number"&&typeof b<"u"||typeof g!="string"||typeof I!="number"||typeof T!="number"&&typeof T<"u"){const R=`Incorrect server response: ${JSON.stringify(p)}`;return this.signalError(R,[]),Et(R)}this.delay=I,this.session.setSessionToken(f),this.session.setUserInfo({userBrowser:_,userCity:k,userCountry:y,userDevice:E,userOS:P,userState:j}),this.session.assign({sessionID:g,timestamp:b||r,projectID:S}),B?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(c=this.worker)==null||c.postMessage({type:"auth",token:f,beaconSizeLimit:T}),!a&&f===o&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(zs(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([R,Q])=>this.send(pa(R,Q))),this.localStorage.setItem(this.options.local_uuid_key,m),this.compressionThreshold=x;const ee={sessionToken:f,userUUID:m,sessionID:g};if(this.startCallbacks.forEach(R=>R(ee)),e.startCallback&&e.startCallback(Ba(ee)),this.features["feature-flags"]&&this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,f),this.activityState=pe.Active,(h=this.options.crossdomain)!=null&&h.enabled&&!this.insideIframe&&this.bootChildrenFrames(),L&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new Ih(this,{fps:U,quality:J,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame})),i){const R=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;R.length>0;)await this.flushBuffer(R);this.clearBuffers(),this.commit()}else this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber):this.observer.observe(),this.ticker.start();if((d=this.canvasRecorder)==null||d.startTracking(),this.features["usability-test"]&&!this.insideIframe){this.uxtManager=this.uxtManager?this.uxtManager:new xh(this,La);let R;const Q=this.localStorage.getItem(La);if(Q&&(R=parseInt(Q,10)),location!=null&&location.search){const N=new URLSearchParams(location.search);if(N.has("oruxt")){const A=N.get("oruxt");R=A?parseInt(A,10):void 0}}R&&(this.uxtManager.isActive?this.onUxtCb.forEach(N=>N(R)):this.uxtManager.getTest(R,f,!!Q).then(N=>{N&&this.onUxtCb.forEach(A=>A(N))}))}return Ba(ee)}catch(p){if(this.stop(),this.session.reset(),!p)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),Et("Unknown error");if(p===os)return this.signalError(os,[]),Et(os);this._debug("session_start",p);const f=p instanceof Error?p.message:p.toString();return this.signalError(f,[]),Et(f)}}addOnUxtCb(e){this.onUxtCb.push(e)}getUxtId(){var e;return(e=this.uxtManager)==null?void 0:e.getTestId()}async waitStart(){return new Promise(e=>{const n=setInterval(()=>{this.canStart&&(clearInterval(n),e(!0))},100)})}async waitStarted(){return this.waitStatus(pe.Active)}async waitStatus(e){return new Promise(n=>{const s=()=>{this.activityState===e?n(!0):setTimeout(s,25)};s()})}async start(...e){return this.activityState===pe.Active||this.activityState===pe.Starting?Promise.resolve(Et("OpenReplay: trying to call `start()` on the instance that has been started already.")):(this.insideIframe&&this.signalIframeTracker(),document.hidden?new Promise(n=>{const s=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",s),n(this._start(...e)))};document.addEventListener("visibilitychange",s)}):(await this.waitStart(),this._start(...e)))}forceFlushBatch(){var e;(e=this.worker)==null||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){const n=e;return(s,i,r="down")=>{typeof s!="string"||typeof i!="string"||i.length>5*1024*1024||s.length>255||this.send(Ju("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n,s;if(this.activityState!==pe.NotActive)try{!this.insideIframe&&((n=this.options.crossdomain)!=null&&n.enabled)&&this.killChildrenFrames(),this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(i=>i()),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(s=this.canvasRecorder)==null||s.clear(),this.messages.length=0,this.parentActive=!1}finally{this.activityState=pe.NotActive,this.debug.log("OpenReplay tracking stopped.")}}};function Xh(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(Hu(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const Wa=ht&&"InstallTrigger"in window?t=>t.message+`
|
|
10
|
+
`+t.stack:t=>t.stack||t.message;function lr(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?Wa(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function Yh(t){return typeof t!="number"?"NaN":t.toString()}function Jh(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function za(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return Wa(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(lr).join(", ");return`Array(${e})[${n}]`}if(typeof t=="object"){const e=[];let n=0;for(const s in t){if(++n===10)break;const i=t[s];e.push(s+": "+lr(i))}return"{"+e.join(", ")+"}"}return t.toString()}function Qh(t){return typeof t[0]=="string"&&t.unshift(t.shift().replace(/%(o|s|f|d|i)/g,(e,n)=>{const s=t.shift();if(s===void 0)return e;switch(n){case"o":return za(s);case"s":return lr(s);case"f":return Yh(s);case"d":case"i":return Jh(s);default:return e}})),t.map(za).join(" ")}const ja=["log","info","warn","error","debug","assert"];function Zh(t,e){const n=Object.assign({consoleMethods:ja,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const s=t.safe((l,u)=>t.send(Lu(l,Qh(u))));let i=0;const r=()=>{i=0};t.attachStartCallback(r),t.ticker.attach(r,33,!1);const o=(l,u)=>{const c={apply:function(h,d,p){Reflect.apply(h,u,p),i=i+1,!(i>n.consoleThrottling)&&s(h.name,p)}};n.consoleMethods.forEach(h=>{if(ja.indexOf(h)===-1){t.debug.error(`OpenReplay: unsupported console method "${h}"`);return}const d=u.console[h];l[h]=new Proxy(d,c)})},a=t.safe(l=>o(l.console,l));a(window),t.observer.attachContextCallback(a)}const $h=/(^|@)\S+:\d+/,Ua=/^\s*at .*(\S+:\d+|\(native\))/m,ed=/^(eval@)?(\[native code\])?$/;function td(t,e){if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return od(t);if(t.stack&&t.stack.match(Ua))return nd(t);if(t.stack)return id(t);throw new Error("Cannot parse given Error object")}function cr(t){if(!t.includes(":"))return[t,void 0,void 0];const n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[n[1],n[2]||void 0,n[3]||void 0]}function as(t,e){return t}function nd(t,e){return sd(t.stack)}function sd(t,e){return as(t.split(`
|
|
11
|
+
`).filter(s=>!!s.match(Ua))).map(s=>{s.includes("(eval ")&&(s=s.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=s.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const r=i.match(/ (\(.+\)$)/);i=r?i.replace(r[0],""):i;const o=cr(r?r[1]:i),a=r&&i||void 0,l=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return{function:a,file:l,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:s}})}function id(t,e){return rd(t.stack)}function rd(t,e){return as(t.split(`
|
|
12
|
+
`).filter(s=>!s.match(ed))).map(s=>{if(s.includes(" > eval")&&(s=s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!s.includes("@")&&!s.includes(":"))return{function:s};{const i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=s.match(i),o=r&&r[1]?r[1]:void 0,a=cr(s.replace(i,""));return{function:o,file:a[0],line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:s}}})}function od(t,e){return!t.stacktrace||t.message.includes(`
|
|
13
13
|
`)&&t.message.split(`
|
|
14
14
|
`).length>t.stacktrace.split(`
|
|
15
|
-
`).length?
|
|
16
|
-
`),i=[];for(let r=2,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({file:a[2],line:+a[1],raw:s[r]})}return
|
|
17
|
-
`),i=[];for(let r=0,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({function:a[3]||void 0,file:a[2],line:a[1]?+a[1]:void 0,raw:s[r]})}return
|
|
18
|
-
`).filter(s=>!!s.match(Jh)&&!s.match(/^Error created at/))).map(s=>{const i=s.split("@"),r=cr(i.pop()),o=i.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;let c;o.match(/\(([^)]*)\)/)&&(c=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));const u=c===void 0||c==="[arguments not available]"?void 0:c.split(",");return{function:a,args:u,file:r[0],line:r[1]?+r[1]:void 0,col:r[2]?+r[2]:void 0,raw:s}})}function ad(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function ld(t,e){return ad(Zh(t))}function ja(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function Vs(t,e,n={}){let s=e;try{s=ld(t)}catch{}return Yi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function Ua(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return Vs(t.error,ja(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),Yi(s,i,JSON.stringify(ja(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return Vs(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return Yi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function cd(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(o){const a=Ua(o,i);a!=null&&t.send(a)}try{t.attachEventListener(i,"unhandledrejection",r),t.attachEventListener(i,"error",r)}catch(o){console.error("Error while attaching to error proto contexts",o)}}n.captureExceptions&&(t.observer.attachContextCallback(s),s(window))}function Ha(t,e=document.location){return t=t.trim(),t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:t.startsWith("/")?e.origin+t:e.origin+e.pathname+t}function ud(t){return pu&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const hd="https://static.openreplay.com/tracker/placeholder.jpeg";function dd(t){function e(a,c){t.attributeSender.sendSetAttribute(a,"src",hd);const{width:u,height:l}=c.getBoundingClientRect();c.hasAttribute("width")||t.attributeSender.sendSetAttribute(a,"width",String(u)),c.hasAttribute("height")||t.attributeSender.sendSetAttribute(a,"height",String(l))}const n=function(a,c){const{srcset:u}=c;if(!u)return;const l=u.split(u.match(/,\s+/)?/,\s+/:",").map(h=>Ha(h)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",l)},s=function(a,c){c.src.length>gu&&e(a,c),t.send(Gi(a,"src",c.src,t.getBaseHref()))},i=t.safe(function(a){const c=Ha(a.src||"");na(c)&&t.send(ya(t.timestamp(),0,0,0,0,0,c,"img",0,!1))}),r=t.safe(function(a){const c=t.nodes.getID(a);c!==void 0&&a.complete&&(a.naturalHeight===0&&a.naturalWidth===0&&!ud(a.src)?i(a):t.sanitizer.isHidden(c)||t.sanitizer.isObscured(c)?e(c,a):(s(c,a),n(c,a)))}),o=aa(t.safe(a=>{for(const c of a)if(c.type==="attributes"){const u=c.target,l=t.nodes.getID(u);if(l===void 0)return;c.attributeName==="src"&&s(l,u),c.attributeName==="srcset"&&n(l,u)}}),t.options.forceNgOff);t.attachStopCallback(()=>{o.disconnect()}),t.nodes.attachNodeCallback(a=>{ve(a,"img")&&(t.nodes.attachNodeListener(a,"error",()=>i(a)),t.nodes.attachNodeListener(a,"load",()=>r(a)),r(a),o.observe(a,{attributes:!0,attributeFilter:["src","srcset"]}))})}const fd=["text","password","email","search","number","range","date","tel","time"];function pd(t){return ve(t,"textarea")?!0:ve(t,"input")?fd.includes(t.type):!1}function gd(t){if(!ve(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const md=ht&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ve(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ve(e,"label"))return e;const n=t.id;if(n){const s=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(s!==null&&s.length===1)return s[0]}};function qa(t){let e=qi(t);if(e===null){const n=md(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return ta(e).slice(0,100)}const Mn={Plain:0,Obscured:1,Hidden:2};function vd(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:Mn.Obscured,obscureInputDates:!1},e);function s(l,h){let d=h.value,p=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(l)?p=Mn.Hidden:(t.sanitizer.isObscured(l)||p===Mn.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(d)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~d.indexOf("@"))))&&(p=Mn.Obscured);let f=0;switch(p){case Mn.Hidden:f=-1,d="";break;case Mn.Obscured:f=d.length,d="";break}return{value:d,mask:f}}function i(l,h){const{value:d,mask:p}=s(l,h);t.send(Ru(l,d,p))}const r=new Map,o=new Map;t.attachStopCallback(()=>{r.clear(),o.clear()});function a(l,h){r.get(l)!==h.value&&(r.set(l,h.value),i(l,h))}function c(l,h){o.get(l)!==h&&(o.set(l,h),t.send(Du(l,h)))}t.ticker.attach(()=>{r.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return r.delete(h);a(h,d)}),o.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return o.delete(h);c(h,d.checked)})},3);function u(l,h,d,p){const{value:f,mask:m}=s(l,h),y=qa(h);t.send(Xu(l,f,m!==0,y,d,p))}t.nodes.attachNodeCallback(t.safe(l=>{const h=t.nodes.getID(l);if(h!==void 0){if(ve(l,"select")&&(i(h,l),t.nodes.attachNodeListener(l,"change",()=>i(h,l))),pd(l)){a(h,l);let d=0,p=0,f=0;const m=()=>{d=it()},y=()=>{p===0&&d!==0&&(p=it()-d)},S=()=>{d!==0&&(f=it()-d),u(h,l,p,f),p=0,f=0,d=0};t.nodes.attachNodeListener(l,"focus",m),t.nodes.attachNodeListener(l,"input",y),t.nodes.attachNodeListener(l,"change",S);return}if(gd(l)){c(h,l.checked),t.nodes.attachNodeListener(l,"change",()=>c(h,l.checked));return}}}))}let Je,ur,Va;function bd(t,e){if(Va=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Je={...n,...e},ur=wd(Je.root,n);let s=Gs(t,"all",()=>Gs(t,"two",()=>Gs(t,"one",()=>Gs(t,"none"))));if(s){const i=Qa(Za(s,t));return i.length>0&&(s=i[0]),Ks(s)}else throw new Error("Selector was not found.")}function wd(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function Gs(t,e,n){let s=null,i=[],r=t,o=0;for(;r;){const a=new Date().getTime()-Va.getTime();if(Je.timeoutMs!==void 0&&a>Je.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let c=Ys(yd(r))||Ys(...Sd(r))||Ys(..._d(r))||Ys(kd(r))||[Ya()];const u=Td(r);if(e=="all")u&&(c=c.concat(c.filter(hr).map(l=>Xs(l,u))));else if(e=="two")c=c.slice(0,1),u&&(c=c.concat(c.filter(hr).map(l=>Xs(l,u))));else if(e=="one"){const[l]=c=c.slice(0,1);u&&hr(l)&&(c=[Xs(l,u)])}else e=="none"&&(c=[Ya()],u&&(c=[Xs(c[0],u)]));for(let l of c)l.level=o;if(i.push(c),i.length>=Je.seedMinLength&&(s=Ga(i,n),s))break;r=r.parentElement,o++}return s||(s=Ga(i,n)),!s&&n?n():s}function Ga(t,e){const n=Qa(Ja(t));if(n.length>Je.threshold)return e?e():null;for(let s of n)if(Xa(s))return s;return null}function Ks(t){let e=t[0],n=e.name;for(let s=1;s<t.length;s++){const i=t[s].level||0;e.level===i-1?n=`${t[s].name} > ${n}`:n=`${t[s].name} ${n}`,e=t[s]}return n}function Ka(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Xa(t){const e=Ks(t);switch(ur.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function yd(t){const e=t.getAttribute("id");return e&&Je.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function Sd(t){return Array.from(t.attributes).filter(n=>Je.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function _d(t){return Array.from(t.classList).filter(Je.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function kd(t){const e=t.tagName.toLowerCase();return Je.tagName(e)?{name:e,penalty:2}:null}function Ya(){return{name:"*",penalty:3}}function Td(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let s=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&s++,n!==t);)n=n.nextSibling;return s}function Xs(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function hr(t){return t.name!=="html"&&!t.name.startsWith("#")}function Ys(...t){const e=t.filter(xd);return e.length>0?e:null}function xd(t){return t!=null}function*Ja(t,e=[]){if(t.length>0)for(let n of t[0])yield*Ja(t.slice(1,t.length),e.concat(n));else yield e}function Qa(t){return[...t].sort((e,n)=>Ka(e)-Ka(n))}function*Za(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>Je.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>Je.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Ks(i);if(n.visited.has(r))return;Xa(i)&&Ed(i,e)&&(yield i,n.visited.set(r,!0),yield*Za(i,e,n))}}function Ed(t,e){return ur.querySelector(Ks(t))===e}function Id(t,e,n){return bd(t,{root:e.body,seedMinLength:3,optimizedMinLength:(n==null?void 0:n.minSelectorDepth)||2,threshold:(n==null?void 0:n.nthThreshold)||1e3,maxNumberOfTries:(n==null?void 0:n.maxOptimiseTries)||1e4})}function dr(t){const e=t.tagName.toUpperCase();return e==="BUTTON"||e==="A"||e==="LI"||e==="SELECT"||e==="TR"||e==="TH"||t.onclick!=null||t.getAttribute("role")==="button"}function $a(t,e){return t instanceof Element?Cd(t,e):null}function Cd(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(on(n,"masked"))return null;n=n.parentElement}if(tr(t)){let s=t.ownerSVGElement;for(;s!==null;)t=s,s=s.ownerSVGElement}for(n=t;n!==null&&n!==e.documentElement;){const s=n.tagName.toUpperCase();if(s==="LABEL")return null;if(s==="INPUT"||dr(n)||qi(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function Nd(t,e){const{disableClickmaps:n=!1}=e||{};function s(g){const w=qi(g);if(w!==null)return w;if(ve(g,"input"))return qa(g);if(dr(g)){let E="";return g instanceof HTMLElement&&(E=t.sanitizer.getInnerTextSecure(g)),E=E||g.id||g.className,ta(E).slice(0,100)}return""}let i=-1,r=-1,o=!1,a=null,c=0,u={},l=0,h=0,d=0,p=0,f;const m=.008,y=225;function S(){const g=p/y;if(!l){l=g;return}const w=(g-l)/y;d>4&&w>m&&t.send(Yu(it())),p=0,d=0,l=g}t.attachStartCallback(()=>{f=setInterval(()=>S(),y)}),t.attachStopCallback(()=>{i=-1,r=-1,o=!1,a=null,u={},f&&clearInterval(f)});const _=()=>{o&&(t.send(Ou(i,r)),o=!1)},x=(g,w=!1)=>{function E(k,T,A){return u[k]=u[k]||Id(T,g,A)}const I=w?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);I(g.documentElement,"mouseover",k=>{const T=$a(k.target,g);T!==a&&(a=T,c=performance.now())}),I(g,"mousemove",k=>{const[T,A]=t.observer.getDocumentOffset(g);i=k.clientX+T,r=k.clientY+A,o=!0;const G=Math.sign(k.movementX);p+=Math.abs(k.movementX)+Math.abs(k.movementY),G!==h&&(h=G,d++)},!1),I(g,"click",k=>{const T=$a(k.target,g);if(!k.clientX&&!k.clientY||T===null)return;const A=t.nodes.getID(T);if(A!==void 0){const G=k.pageX,j=k.pageY,Z=g.documentElement.scrollWidth,z=g.documentElement.scrollHeight,L=el(G/Z),Y=el(j/z);_(),t.send(Vu(A,a===T?Math.round(performance.now()-c):0,s(T),dr(T)&&!n?E(A,T,e):"",L,Y),!0)}a=null})};t.nodes.attachNodeCallback(g=>{js(g)&&x(g)}),x(document,!0),t.ticker.attach(_,(e==null?void 0:e.trackingOffset)||7)}function el(t){return Math.round(t*1e4)}function Rd(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let o="";if(ve(r,"img")&&(o=r.currentSrc||r.src),!o){const f=getComputedStyle(r).getPropertyValue("background-image");if(f){const m=s.exec(f);m!==null&&(o=m[1],(o.startsWith('"')||o.startsWith("'"))&&(o=o.substr(1,o.length-2)))}}if(!o)continue;const a=o.substr(0,10)==="data:image"?0:t[o];if(a===void 0)continue;const c=r.getBoundingClientRect(),u=Math.max(c.top,0),l=Math.max(c.left,0),h=Math.min(c.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),d=Math.min(c.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(h<=u||d<=l)continue;const p=(h-u)*(d-l);e.push({time:a,area:p})}return e}function Dd(t,e){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,s=n*t;for(let i=0;i<e.length;i++){const{time:r,area:o}=e[i];n+=o,s+=o*(r>t?r:t)}return n===0?0:s/n}function Od(t,e){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},e);if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let s={};function i(u){var h;if(u.duration<0||!na(u.name)||t.isServiceURL(u.name))return;s!==null&&(s[u.name]=u.startTime+u.duration);let l=!1;(h=n.excludedResourceUrls)==null||h.forEach(d=>{if(u.name.startsWith(d)){l=!0;return}}),!l&&t.send(ya(u.startTime+Nn(),u.duration,u.responseStart&&u.startTime?u.responseStart-u.startTime:0,u.transferSize>u.encodedBodySize?u.transferSize-u.encodedBodySize:0,u.encodedBodySize||0,u.decodedBodySize||0,u.name,u.initiatorType,u.transferSize,u.responseStatus&&u.responseStatus===304||u.transferSize===0))}const r=new PerformanceObserver(u=>u.getEntries().forEach(i));let o;t.attachStartCallback(function({sessionID:u}){u!==o&&(performance.getEntriesByType("resource").forEach(i),o=u),r.observe({entryTypes:["resource"]})}),t.attachStopCallback(function(){r.disconnect()});let a=0,c=0;if(n.capturePageLoadTimings){let u=!1;t.ticker.attach(()=>{if(!u&&((a===0||c===0)&&performance.getEntriesByType("paint").forEach(l=>{const{name:h,startTime:d}=l;switch(h){case"first-paint":a=d;break;case"first-contentful-paint":c=d;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){u=!0;const{navigationStart:l,requestStart:h,responseStart:d,responseEnd:p,domContentLoadedEventStart:f,domContentLoadedEventEnd:m,loadEventStart:y,loadEventEnd:S}=performance.timing;t.send(Au(h-l||0,d-l||0,p-l||0,f-l||0,m-l||0,y-l||0,S-l||0,a,c))}},30)}if(n.capturePageRenderTimings){let u=0,l=0,h=0,d=null,p=!1;t.ticker.attach(()=>{if(p)return;const f=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(m=>s[m])),f-u>1e3&&(d=Rd(s),s=null)),h!==null&&(f-h>50&&(l=f),h=f-l>5e3?null:f),d!==null&&h===null||f>3e4){p=!0,s=null;const m=d===null?0:Dd(c||a,d),{domContentLoadedEventEnd:y,navigationStart:S}=performance.timing,_=h===null?Math.max(l,c,y-S||0):0;t.send(Pu(m,c>u?c:u,_))}})}}function fr(t){const e=t.defaultView;return[e&&e.scrollX||t.documentElement&&t.documentElement.scrollLeft||t.body&&t.body.scrollLeft||0,e&&e.scrollY||t.documentElement&&t.documentElement.scrollTop||t.body&&t.body.scrollTop||0]}function Md(t,e){let n=!1;const s=new Map;function i(a){Da(a)&&(Tt(a)&&s.set(a,[a.scrollLeft,a.scrollTop]),js(a)&&s.set(a,fr(a)))}const r=t.safe(()=>{e||t.send(_u(...fr(document)))}),o=t.safe((a,c)=>{const u=t.nodes.getID(c);u!==void 0&&t.send(Nu(u,a[0],a[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((a,c)=>{c&&(Tt(a)&&a.scrollLeft+a.scrollTop>0?s.set(a,[a.scrollLeft,a.scrollTop]):js(a)&&s.set(a,fr(a))),Us(a)&&t.nodes.attachNodeListener(a,"scroll",u=>{i(u.target)})}),t.attachEventListener(document,"scroll",a=>{const c=a.target;if(c===document){n=!0;return}i(c)}),t.ticker.attach(()=>{n&&(r(),n=!1),s.forEach(o),s.clear()},5,!1)}function Ad(t){let e,n,s,i,r=document.referrer;const o=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(Zu(e,r,i,document.title)),i=0,r=e)}),a=t.safe(()=>{const{innerWidth:u,innerHeight:l}=window;(u!==n||l!==s)&&(n=u,s=l,t.send(Su(n,s)))}),c=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(ju(document.hidden)));t.attachStartCallback(()=>{e=null,i=Nn(),n=s=-1,o(),a(),c()}),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",c,!1,!1),t.ticker.attach(o,1,!1),t.ticker.attach(a,5,!1)}function tl(t){return Us(t)&&!!t.adoptedStyleSheets}let Pd=15;function nl(){return Pd++}const Js=new Map;function Ld(t){if(t===null||!tl(document))return;const e=new Map,n=new Map,s=o=>setTimeout(()=>{let a=t.nodes.getID(o);if(o===document&&(a=0),a===void 0)return;let c=n.get(a);c||(c=[]);const u=[],l=o.adoptedStyleSheets;if(l&&Symbol.iterator in l)for(const h of l){let d=e.get(h);const p=!d;if(d||(d=nl(),e.set(h,d)),c.includes(d)||t.send(va(d,a)),p){const f=h.cssRules;for(let m=0;m<f.length;m++)t.send(Xi(d,f[m].cssText,m,t.getBaseHref()))}u.push(d)}if(Symbol.iterator in c)for(const h of c)u.includes(h)||t.send(Gu(h,a));n.set(a,u)},20);function i(o){const a=Object.getOwnPropertyDescriptor(o,"adoptedStyleSheets");a&&Object.defineProperty(o,"adoptedStyleSheets",{...a,set:function(c){const u=a.set.call(this,c);return s(this),u}})}const r=o=>{if(o.__openreplay_adpss_patched__)return;o.__openreplay_adpss_patched__=!0,i(o.Document.prototype),i(o.ShadowRoot.prototype);const{replace:a,replaceSync:c}=o.CSSStyleSheet.prototype;o.CSSStyleSheet.prototype.replace=function(u){return a.call(this,u).then(l=>{const h=e.get(this);return h&&t.send(ga(h,u,t.getBaseHref())),l})},o.CSSStyleSheet.prototype.replaceSync=function(u){const l=e.get(this);return l&&t.send(ga(l,u,t.getBaseHref())),c.call(this,u)}};r(window),t.observer.attachContextCallback(t.safe(r)),t.attachStopCallback(()=>{e.clear(),n.clear()}),t.attachStartCallback(()=>{s(document)}),t.nodes.attachNodeCallback(o=>{tl(o)&&s(o)})}function Bd(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(Hu("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,o)=>{const a=Js.get(i);a&&(typeof o=="string"?t.send(Xi(a,o,r,t.getBaseHref())):t.send(ma(a,r)))}),n=t.safe(i=>{let r=i;for(;r.parentRule;)r=r.parentRule;const o=r.parentStyleSheet;if(!o){t.debug.warn("No parent StyleSheet found for",r,i);return}const a=Js.get(o);if(!a){t.debug.warn("No sheedID found for",o,Js);return}const c=r.cssText,u=o.cssRules,l=Array.from(u).indexOf(r);l>=0?(t.send(Xi(a,c,l,t.getBaseHref())),t.send(ma(a,l+1))):t.debug.warn("Rule index not found in",o,r)}),s=t.safe(i=>{const{insertRule:r,deleteRule:o}=i.CSSStyleSheet.prototype,{insertRule:a,deleteRule:c}=i.CSSGroupingRule.prototype;i.CSSStyleSheet.prototype.insertRule=function(u,l=0){return e(this,l,u),r.call(this,u,l)},i.CSSStyleSheet.prototype.deleteRule=function(u){return e(this,u),o.call(this,u)},i.CSSGroupingRule.prototype.insertRule=function(u,l=0){const h=a.call(this,u,l);return n(this),h},i.CSSGroupingRule.prototype.deleteRule=function(u=0){const l=c.call(this,u);return n(this),l}});s(window),t.observer.attachContextCallback(s),t.nodes.attachNodeCallback(i=>{if(!ve(i,"style")||!i.sheet||i.textContent!==null&&i.textContent.trim().length>0)return;const r=t.nodes.getID(i);if(!r)return;const o=i.sheet,a=nl();Js.set(o,a),t.send(va(a,r));const c=o.cssRules;for(let u=0;u<c.length;u++)e(o,u,c[u].cssText)})}function Fd(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(pa(i))}let n=!1;t.nodes.attachNodeCallback(s=>{ve(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{Da(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(pa(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&ve(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function Wd(t){if(!window.FontFace)return;const e=new Map,n=s=>{class i extends s.FontFace{constructor(...o){if(typeof o[1]=="string"){let a="";o[2]&&t.safe(()=>{a=JSON.stringify(o[2])});const c=[o[0],o[1],a],u=e.get(s.document)||[];u.push(c),e.set(s.document,u);const l=s===window?0:t.nodes.getID(s.document);if(l===void 0)return;t.active()&&t.send(fa(l,...c))}super(...o)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!js(s))return;const i=e.get(s);if(!i)return;const r=s.defaultView===window?0:t.nodes.getID(s);r!==void 0&&i.forEach(o=>{t.send(fa(r,...o))})}))}function zd(t,e,n,s,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function r(d){t.debug.log("Openreplay: capturing axios response data",d);const{headers:p,data:f,method:m,url:y,baseURL:S}=d.config,{data:_,headers:x,status:g,response:w}=d,{data:E,headers:I,status:k}=w||{},T=n.ignoreHeaders,A=Array.isArray(T)?R=>T.includes(R):()=>T;function G(R,J){A(J[0])||(R[J[0]]=J[1])}let j={},Z={};p.toJSON?j=p.toJSON():p instanceof Headers?p.forEach((R,J)=>G(j,[J,R])):Array.isArray(p)?p.forEach(R=>G(j,R)):typeof p=="object"&&Object.entries(p).forEach(R=>G(j,R));const z=I||x;z.toJSON?Z=z.toJSON():z instanceof Headers?z.forEach((R,J)=>G(Z,[J,R])):Array.isArray(z)?z.forEach(R=>G(Z,R)):typeof z=="object"&&Object.entries(z).forEach(([R,J])=>{A(R)||(Z[R]=J)});const L=s({url:y,method:m||"",status:g||k||0,request:{headers:j,body:f},response:{headers:Z,body:E||_}});if(!L){t.debug.log("Openreplay: empty request/response info, skipping");return}const Y=d.config.__openreplay_timing,$=performance.now()-Y;t.debug.log("Openreplay: final req object",L),t.send(Bs("xhr",String(m),String(L.url),i(L.request),i(L.response),L.status,Y+Nn(),$,0))}function o(d){if(t.debug.log("Openreplay: capturing API request",d),d.__openreplay_timing=performance.now(),n.sessionTokenHeader){const p=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",f=t.getSessionToken();f&&d.headers.set(p,f)}return d}function a(d){return n.failuresOnly||r(d),d}function c(d){return t.debug.log("Openreplay: capturing API request error",d),jd(d)&&d.response?r(d.response):d instanceof Error&&t.send(Vs(d,[])),Promise.reject(d)}function u(d){t.debug.log("Openreplay: failed API request, skipping",d)}const l=e.interceptors.request.use(o,u,{synchronous:!0}),h=e.interceptors.response.use(a,c,{synchronous:!0});t.attachStopCallback(()=>{var d,p,f,m;(p=(d=e.interceptors.request).eject)==null||p.call(d,l),(m=(f=e.interceptors.response).eject)==null||m.call(f,h)})}function jd(t){return Ud(t)&&t.isAxiosError===!0}function Ud(t){return t!==null&&typeof t=="object"}class pr{constructor(e=[],n,s){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestType="xhr",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:n}=this.writeHeaders(),s={headers:e,body:this.method==="GET"?JSON.stringify(this.getData):this.requestData},i={headers:n,body:this.response},r=this.sanitize({url:this.url,method:this.method,status:this.status,request:s,response:i});if(!r)return null;if(r.url.includes("/graphql")&&r.response.body&&typeof r.response.body=="string"){const a=r.response.body.includes("errors");r.status=a?400:200,this.requestType="graphql"}return{requestType:this.requestType,method:r.method,url:r.url,request:JSON.stringify(r.request),response:JSON.stringify(r.response),status:r.status,startTime:this.startTime,duration:this.duration,responseSize:this.responseSize}}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(([s,i])=>{this.isHeaderIgnored(s)||(e[s]=i)}),this.setSessionTokenHeader((s,i)=>{e[s]=i});const n={};return Object.entries(this.header).forEach(([s,i])=>{this.isHeaderIgnored(s)||(n[s]=i)}),{reqHs:e,resHs:n}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(n=>n.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const as=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:mr(e)||Array.isArray(e)?n=JSON.stringify(e):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},gr=t=>{if(!t)return null;let e;if(typeof t=="string"){(t[0]==="{"||t[0]==="[")&&(e=t);const n=t.split("&");n.length===1?e=t:e=n.join(",")}else if(qd(t)){const n=[];for(const[s,i]of t)n.push(`${s}=${typeof i=="string"?i:"[object Object]"}`);e=n.join(",")}else t instanceof Blob||t instanceof ReadableStream||t instanceof ArrayBuffer?e="byte data":mr(t)?e=t:e=`can't parse body ${typeof t}`;return e},Hd=(t,e={})=>{mr(e)||(e={});let n=t?t.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const s of n){const i=s.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e};function mr(t){return t!==null&&typeof t=="object"}function qd(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function Qs(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const vr=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),Vd=t=>t instanceof Blob?t.type:t instanceof FormData?"multipart/form-data":t instanceof URLSearchParams?"application/x-www-form-urlencoded;charset=UTF-8":"text/plain;charset=UTF-8";class Gd{constructor(e,n,s,i,r){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r}apply(e,n,s){const i=s[0],r=s[1],o=new pr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const a=vr(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":Vd(r)},o.status=0,o.statusText="Pending",a.search&&a.searchParams){o.getData={};for(const[l,h]of a.searchParams)o.getData[l]=h}o.requestData=gr(r),o.startTime||(o.startTime=performance.now());const c=e.apply(n,s);c?(o.endTime=performance.now(),o.duration=o.endTime-(o.startTime||o.endTime),o.status=0,o.statusText="Sent",o.readyState=4):(o.status=500,o.statusText="Unknown");const u=o.getMessage();return u&&this.sendMessage(u),c}}class Kd{static create(e,n,s,i,r,o){if(e)return new Proxy(e,new Gd(n,s,i,r,o))}}var ft;(function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"})(ft||(ft={}));class Xd{constructor(e,n){this.resp=e,this.item=n,this.mockReader()}set(e,n,s){return Reflect.set(e,n,s)}get(e,n){const s=Reflect.get(e,n);switch(n){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),s.apply(e).then(i=>(this.item.response=as(this.item.responseType,i),i)))}return typeof s=="function"?s.bind(e):s}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const n=this.resp.body.getReader;this.resp.body.getReader=()=>{const s=n.apply(this.resp.body);if(this.item.readyState===ft.DONE)return s;const i=s.read,r=s.cancel;return this.item.responseType="arraybuffer",s.read=()=>i.apply(s).then(o=>{if(!e)e=new Uint8Array(o.value);else{const a=new Uint8Array(e.length+o.value.length);a.set(e),a.set(o.value,e.length),e=a}return this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=o.done?4:3,this.item.statusText=o.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=Qs(this.item.responseSize),o.done&&(this.item.response=as(this.item.responseType,e)),o}),s.cancel=(...o)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=as(this.item.responseType,e),r.apply(s,o)),s}}}class Yd{constructor(e,n,s,i,r,o){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r,this.tokenUrlMatcher=o}apply(e,n,s){const i=s[0],r=s[1];if(!i||typeof i!="string"&&!(i!=null&&i.url)||(i instanceof URL||typeof i=="string"?this.isServiceUrl(String(i)):this.isServiceUrl(String(i.url))))return e.apply(window,s);const a=new pr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);return this.beforeFetch(a,i,r),this.setSessionTokenHeader((c,u)=>{if(!(this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(a.url))){if(s[1]===void 0&&s[0]instanceof Request)return s[0].headers.append(c,u);s[1]||(s[1]={}),s[1].headers===void 0&&(s[1]=Object.assign(Object.assign({},s[1]),{headers:{}})),s[1].headers instanceof Headers?s[1].headers.append(c,u):Array.isArray(s[1].headers)?s[1].headers.push([c,u]):s[1].headers[c]=u}}),e.apply(window,s).then(this.afterFetch(a)).catch(c=>{throw a.endTime=performance.now(),a.duration=a.endTime-(a.startTime||a.endTime),c})}beforeFetch(e,n,s){let i,r="GET",o={};if(typeof n=="string"?(r=(s==null?void 0:s.method)||"GET",i=vr(n),o=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=vr(n.url),o=n.headers),e.method=r,e.requestType="fetch",e.requestHeader=o,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),Object.prototype.toString.call(o)==="[object Headers]"){e.requestHeader={};for(const[a,c]of o)e.requestHeader[a]=c}else e.requestHeader=o;if(i.search&&i.searchParams){e.getData={};for(const[a,c]of i.searchParams)e.getData[a]=c}s!=null&&s.body&&(e.requestData=gr(s.body))}afterFetch(e){return n=>{e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let s=!1;e.header={};for(const[i,r]of n.headers)e.header[i]=r,s=r.toLowerCase().indexOf("chunked")>-1?!0:s;return s?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=Qs(e.responseSize),e.response=as(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new Xd(n,e))}}handleResponseBody(e,n){const s=e.headers.get("content-type");return s&&s.includes("application/json")?(n.responseType="json",e.text()):s&&(s.includes("text/html")||s.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class Jd{static create(e,n,s,i,r,o){return new Proxy(fetch,new Yd(e,n,s,i,r,o))}}class Qd{constructor(e,n,s,i,r,o,a){this.ignoredHeaders=n,this.setSessionTokenHeader=s,this.sanitize=i,this.sendMessage=r,this.isServiceUrl=o,this.tokenUrlMatcher=a,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new pr(n,s,i),this.item.requestType="xhr"}get(e,n){switch(n){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((i,r)=>{this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(this.item.url)||e.setRequestHeader(i,r)}),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const s=Reflect.get(e,n);return typeof s=="function"?s.bind(e):s}}set(e,n,s){switch(n){case"onreadystatechange":return this.setOnReadyStateChange(e,n,s);case"onabort":return this.setOnAbort(e,n,s);case"ontimeout":return this.setOnTimeout(e,n,s)}return Reflect.set(e,n,s)}onReadyStateChange(){if(!(this.item.url&&this.isServiceUrl(this.item.url))&&(this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),setTimeout(()=>{this.item.response=as(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===ft.DONE)){const e=this.item.getMessage();e&&this.sendMessage(e)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){const n=Reflect.get(e,"open");return(...s)=>{var i,r,o;const a=s[0],c=s[1];return this.item.method=a?a.toUpperCase():"GET",this.item.url=((i=c.toString)===null||i===void 0?void 0:i.call(c))||"",this.item.name=(o=(r=this.item.url)===null||r===void 0?void 0:r.replace(new RegExp("/*$"),"").split("/").pop())!==null&&o!==void 0?o:"",this.item.getData=Hd(this.item.url,{}),n.apply(e,s)}}getSend(e){const n=Reflect.get(e,"send");return(...s)=>{const i=s[0];return this.item.requestData=gr(i),n.apply(e,s)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...s)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[s[0]]=s[1],n.apply(e,s))}setOnReadyStateChange(e,n,s){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),s==null||s.apply(e,i)})}setOnAbort(e,n,s){return Reflect.set(e,n,(...i)=>{this.onAbort(),s.apply(e,i)})}setOnTimeout(e,n,s){return Reflect.set(e,n,(...i)=>{this.onTimeout(),s.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case ft.UNSENT:case ft.OPENED:this.item.status=ft.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case ft.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
|
|
19
|
-
`);for(let s=0;s<n.length;s++){const i=n[s];if(!i)continue;const r=i.split(": "),o=r[0];this.item.header[o]=r.slice(1).join(": ")}break;case ft.LOADING:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Qs(this.item.responseSize));break;case ft.DONE:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=this.XMLReq.response,this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Qs(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Zd{static create(e,n,s,i,r,o){return new Proxy(XMLHttpRequest,{construct(a){const c=new a;return new Proxy(c,new Qd(c,e,n,s,i,r,o))}})}}const sl=t=>{const e=`Openreplay: Can't find ${t} in global context.`;console.warn(e)};function $d(t,e,n,s,i,r,o={xhr:!0,fetch:!0,beacon:!0},a){var c;if(t&&(o.xhr&&(t.XMLHttpRequest?t.XMLHttpRequest=Zd.create(e,n,s,i,r,a):sl("XMLHttpRequest")),o.fetch&&(t.fetch?t.fetch=Jd.create(e,n,s,i,r,a):sl("fetch")),o.beacon&&!((c=t.navigator)===null||c===void 0)&&c.sendBeacon)){const u=t.navigator.sendBeacon;t.navigator.sendBeacon=Kd.create(u,e,n,s,i,r)}}function br(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function il(t){return typeof t=="string"?t.toUpperCase():"GET"}function ef(t,e={}){const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0},e);n.useProxy===!1&&t.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const s=n.ignoreHeaders,i=Array.isArray(s)?l=>s.includes(l):()=>s,r=n.sessionTokenHeader===!0?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function o(l){if(r){const h=t.getSessionToken();h&&t.safe(l)(r,h)}}function a(l){if(n.capturePayload||(delete l.request.body,delete l.response.body),n.sanitizer){const h=l.response.body;if(typeof h=="string")try{l.response.body=JSON.parse(h)}catch{}return n.sanitizer(l)}return l}function c(l){if(l&&typeof l.body!="string")try{l.body=JSON.stringify(l.body)}catch{l.body="<unable to stringify>",t.notify.warn("Openreplay fetch couldn't stringify body:",l.body)}return JSON.stringify(l)}const u=l=>{if(n.useProxy)return $d(l,n.ignoreHeaders,o,a,x=>{t.send(Bs(x.requestType,x.method,x.url,x.request,x.response,x.status,x.startTime+Nn(),x.duration,x.responseSize))},x=>t.isServiceURL(x),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const h=l.fetch.bind(l),d=(x,g={})=>{if(!(typeof x=="string"||x instanceof URL)||t.isServiceURL(String(x)))return h(x,g);o(function(E,I){g.headers===void 0&&(g.headers={}),g.headers instanceof Headers?g.headers.append(E,I):Array.isArray(g.headers)?g.headers.push([E,I]):g.headers[E]=I});const w=performance.now();return h(x,g).then(E=>{const I=performance.now()-w;if(n.failuresOnly&&E.status<400)return E;const k=E.clone();return k.text().then(T=>{const A={},G={};if(s!==!0){const z=([L,Y])=>{i(L)||(A[L]=Y)};g.headers instanceof Headers?g.headers.forEach((L,Y)=>z([Y,L])):Array.isArray(g.headers)?g.headers.forEach(z):typeof g.headers=="object"&&Object.entries(g.headers).forEach(z),k.headers.forEach((L,Y)=>{i(Y)||(G[Y]=L)})}const j=il(g.method),Z=a({url:String(x),method:j,status:k.status,request:{headers:A,body:g.body||null},response:{headers:G,body:T}});Z&&t.send(Bs("fetch",j,String(Z.url),c(Z.request),c(Z.response),k.status,w+Nn(),I,0))}).catch(T=>t.debug.error("Could not process Fetch response:",T)),E})};l.fetch=d;const p=l.XMLHttpRequest.prototype.open,f=l.XMLHttpRequest.prototype.setRequestHeader,m=l.XMLHttpRequest.prototype.send;function y(x,g){const w=this;o((I,k)=>w.setRequestHeader(I,k));let E=0;return w.addEventListener("loadstart",I=>{E=I.timeStamp}),w.addEventListener("load",t.safe(I=>{const{headers:k,body:T}=br(w),A=E>0?I.timeStamp-E:0,j=(w.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),Z={};j.forEach(function(Y){const $=Y.split(": "),R=$.shift();i(R)||(Z[R]=$.join(": "))});const z=il(x),L=a({url:String(g),method:z,status:w.status,request:{headers:k,body:T||null},response:{headers:Z,body:w.response}});L&&t.send(Bs("xhr",z,String(L.url),c(L.request),c(L.response),w.status,E+Nn(),A,0))})),p.apply(this,arguments)}function S(x){const g=br(this);return g.body=x,m.apply(this,arguments)}function _(x,g){if(!i(x)){const w=br(this);w.headers[x]=g}return f.apply(this,arguments)}n.axiosInstances||(l.XMLHttpRequest.prototype.open=y,l.XMLHttpRequest.prototype.send=S,l.XMLHttpRequest.prototype.setRequestHeader=_)};u(window),n.axiosInstances&&n.axiosInstances.forEach(l=>{zd(t,l,n,a,c)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function tf(t){t.attachEventListener(document,"selectionchange",()=>{const e=document.getSelection();if(e!==null&&!e.isCollapsed){const n=t.nodes.getID(e.anchorNode),s=t.nodes.getID(e.focusNode),i=e.toString().replace(/\s+/g," ");n&&s&&t.send(ba(n,s,i))}else t.send(ba(-1,-1,""))})}function nf(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(Fs(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const Zs="/installation/javascript-sdk";function sf(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Ls}${Zs}`),!1;if(typeof t.projectKey!="string")if(typeof t.projectKey!="number"){if(typeof t.projectID!="number")return console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check ${Ls}${Zs} for more information.`),!1;t.projectKey=t.projectID.toString(),Ut("`projectID` option","`projectKey` option",Zs)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&Ut("`sessionToken` option","`sessionHash` start() option","/"),!0}const rf=()=>{try{return!!window.top}catch{return!1}};class of{constructor(e){var a,c;if(this.options=e,this.app=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&(navigator.doNotTrack=="1"||window.doNotTrack=="1"),this.signalStartIssue=(u,l)=>{const h=this.checkDoNotTrack(),d=new XMLHttpRequest,p=this.options.ingestPoint||La;d.open("POST",p+"/v1/web/not-started"),d.send(JSON.stringify({trackerVersion:"14.0.14",projectKey:this.options.projectKey,doNotTrack:h,reason:l.length?`missing api: ${l.join(",")}`:u}))},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.handleError=(u,l={})=>{if(this.app!==null){if(u instanceof Error){const h=Vs(u,[],l);this.app.send(h)}else if(u instanceof ErrorEvent||"PromiseRejectionEvent"in window&&u instanceof PromiseRejectionEvent){const h=Ua(u,void 0,l);h!=null&&this.app.send(h)}}},this.crossdomainMode=!!(oa()&&((a=e.crossdomain)!=null&&a.enabled)),!ht||!sf(e)){console.error("OpenReplay: tracker called in a non-browser environment or with invalid options");return}if(window.__OPENREPLAY__||!this.crossdomainMode&&oa()&&rf()&&((c=window.top)!=null&&c.__OPENREPLAY__)){console.error("OpenReplay: one tracker instance has been initialised already");return}if(!e.__DISABLE_SECURE_MODE&&location.protocol!=="https:"){console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.");return}const n=this.checkDoNotTrack(),s=[],i=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(n)s.push("doNotTrack");else for(const u of i)if(u==="timing"){if("performance"in window&&!(u in performance)){s.push(u);break}}else if(u==="startsWith"){if(!(u in String.prototype)){s.push(u);break}}else if(!(u in window)){s.push(u);break}if(s.length>0){const u=s.join(",");console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${u}`),this.signalStartIssue("missing_api",s);return}const r=new qh(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(Ad(r),Vh(r),$u(r,e),nf(r)),Nd(r,e.mouse),Md(r,this.crossdomainMode),Bd(r),Ld(r),Yh(r,e),cd(r,e),dd(r),vd(r,e),Od(r,e),Fd(r),Wd(r),ef(r,e.network),tf(r),window.__OPENREPLAY__=this,e.flags&&e.flags.onFlagsLoad&&this.onFlagsLoad(e.flags.onFlagsLoad);const o=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(r.attachStartCallback(()=>{const u=r.getTabId(),l=r.sessionStorage??window.sessionStorage;window.open=function(...h){return e.autoResetOnWindowOpen&&r.resetNextPageSession(!0),e.resetTabOnWindowOpen&&l.removeItem(e.session_tabid_key||"__openreplay_tabid"),r.resetNextPageSession(!1),l.setItem(e.session_tabid_key||"__openreplay_tabid",u),o.call(window,...h)}}),r.attachStopCallback(()=>{window.open=o}))}isFlagEnabled(e){return this.featureFlags.isFlagEnabled(e)}onFlagsLoad(e){var n;(n=this.app)==null||n.featureFlags.onFlagsLoad(e)}clearPersistFlags(){var e;(e=this.app)==null||e.featureFlags.clearPersistFlags()}reloadFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.reloadFlags()}getFeatureFlag(e){var n;return(n=this.app)==null?void 0:n.featureFlags.getFeatureFlag(e)}getAllFeatureFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.flags}use(e){return e(this.app,this.options)}isActive(){return this.app===null?!1:this.app.active()}trackWs(e){if(this.app!==null)return this.app.trackWs(e)}start(e){return this.browserEnvCheck()?this.app===null?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):this.app.start(e):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return ht?!0:(console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${Ls}${Zs}`),!1)}coldStart(e,n){if(this.browserEnvCheck()){if(this.app===null)return Promise.reject("Tracker not initialized");this.app.coldStart(e,n)}else return Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,n){return this.browserEnvCheck()?this.app===null?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,n):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(this.app!==null)return this.app.uploadOfflineRecording()}stop(){if(this.app!==null)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){this.app!==null&&this.app.forceFlushBatch()}getSessionToken(){return this.app===null?null:this.app.getSessionToken()}getSessionInfo(){return this.app===null?null:this.app.session.getInfo()}getSessionID(){return this.app===null?null:this.app.getSessionID()}getTabId(){return this.app===null?null:this.app.getTabId()}getUxId(){return this.app===null?null:this.app.getUxtId()}sessionID(){return Ut("'sessionID' method","'getSessionID' method","/"),this.getSessionID()}getSessionURL(e){if(this.app!==null)return this.app.getSessionURL(e)}setUserID(e){typeof e=="string"&&this.app!==null&&this.app.session.setUserID(e)}userID(e){Ut("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(Fu(e))}userAnonymousID(e){Ut("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,n){typeof e=="string"&&typeof n=="string"&&this.app!==null&&this.app.session.setMetadata(e,n)}metadata(e,n){Ut("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,n)}event(e,n=null,s=!1){if(typeof e=="string"&&this.app!==null){if(s)return this.issue(e,n);try{n=JSON.stringify(n)}catch{return}this.app.send(Lu(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(qu(e,n))}}}function af(t){return{id:String(t.ID),appellation:t.Appellation||null,country:t.Country||null,grape:t.Grape,image:t.Image,price:Number(t.Price),producer:t.Producer||null,region:t.Region,score:t.Score?Number(t.Score):null,shortDescription:t["Short Description"]||null,store:t.Store,storeId:t.Store_id||null,tags:Array.isArray(t.Tags)?t.Tags.map(String):[],title:t.Title,type:t.Type,url:t.Url||null,vintage:t.Vintage?Number(t.Vintage):null,pairingRecommendation:t.pairing_recommendation||null,total:t.Total?Number(t.Total):null,itemId:t.item_id||null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null}}function lf(t){return{id:String(t.id),title:String(t.title),description:String(t.description),region:String(t.region),price:Number(t.price),grape:String(t.grape),appellation:t.appellation?String(t.appellation):null,url:t.url?String(t.url):null,store:String(t.store),storeId:t.storeId?String(t.storeId):null,image:String(t.image),country:t.country?String(t.country):null,vintage:t.vintage?Number(t.vintage):null,tags:Array.isArray(t.tags)?t.tags.map(String):[],score:t.score?Number(t.score):null,total:t.total?Number(t.total):null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null,distance:Number(t.distance),reason:String(t.reason),type:String(t.type)}}class cf{constructor(e,n="1"){U(this,Un,"https://api.wineater.com/");U(this,fn);U(this,Hn);F(this,fn,e),F(this,Hn,n)}async getInstantRecommendations(){try{const e=v(this,Hn)==="2"?"dish/recommendations/instant/v2":"dish/recommendations/instant",n=await fetch(`${v(this,Un)}${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,fn)}`}}),s=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${s.message||"No additional error information"}`);return s.filter(Boolean).map(af)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=v(this,Hn)==="2"?"dish/recommendations/search/v2":"dish/recommendations/search",s=await fetch(`${v(this,Un)}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,fn)}`},body:JSON.stringify({text:e})}),i=await s.json();if(!s.ok)throw new Error(`API call failed with status ${s.status}: ${i.message||"No additional error information"}`);return i.filter(Boolean).map(lf)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${v(this,Un)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v(this,fn)}`}});if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return await e.json()}catch(e){throw console.error("Error fetching store configuration:",e),e}}}Un=new WeakMap,fn=new WeakMap,Hn=new WeakMap;const uf=((cl=window==null?void 0:window.wineaterData)==null?void 0:cl.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",hf=String(((ul=window==null?void 0:window.wineaterData)==null?void 0:ul.apiVersion)||"1"),wr=new cf(uf,hf),pt={WIDGET_INITIALIZED:"widget_initialized",WIDGET_LOADED:"widget_loaded",SEARCH_PERFORMED:"search_performed",SEARCH_RESULTS_DISPLAYED:"search_results_displayed",NO_RESULTS_FOUND:"no_results_found",WINE_CARD_HOVER:"wine_card_hover",WINE_CARD_CLICK:"wine_card_click",WINE_DETAILS_VIEWED:"wine_details_viewed",WINE_DETAILS_CLOSED:"wine_details_closed",BUY_BUTTON_CLICKED:"buy_button_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},df={fr:{lang:"fr",welcomeMessage:"Quel plat allez-vous déguster ? Décrivez-le-moi et je vous proposerai le vin qui l'accompagnera parfaitement.",noResultsFound:"Aucun résultat trouvé.",somethingWentWrong:"Désolé, quelque chose a mal tourné.",chatButton1:"Trouvez l'accord parfait",chatButton2:"Associez le vin",chatButton3:"Obtenez des conseils",chatTitle:"Accord Mets & Vins 🍷",chatSubtitle:"Décrivez votre plat et obtenez une recommandation en 30 secondes",inputPlaceholder:"ex., Salade de thon",sendButton:"Accorder",poweredBy:"Propulsé par",price:"Prix",region:"Région",type:"Type",reason:"Suggestion",moreInfo:"Plus d'infos",winePairingIntro:"Pour ce vin, voici quelques suggestions de plats :",askForDinner:"Que voulez-vous manger ce soir?",clearChatButton:"Effacer le chat",widgetTitle:"TROUVEZ VOTRE VIN PARFAIT",widgetSubtitle:"Partagez tout ce que vous avez en tête—votre repas, humeur, budget ou occasion—et notre sommelier IA vous recommandera le vin parfait en quelques secondes",searchPlaceholder:"Entrez un mot-clé ou une description","wineDetails.reason":"Raison","wineDetails.price":"Prix","wineDetails.region":"Région","wineDetails.type":"Type","wineDetails.moreInfo":"Plus d'infos","wineDetails.code":"Code","wineDetails.buy":"Acheter",searchButton:"Rechercher",priceRange:"Gamme de prix",wineColor:"Couleur du vin",intensity:"Intensité",red:"Rouge",white:"Blanc",rose:"Rosé",light:"Léger",medium:"Moyen",full:"Puissant",barTitle:"Sélection du bar",barSubtitle:"Choisissez vos plats ci-dessous et cliquez sur «Envoyer»",barSendButton:"Envoyer",barResetButton:"Réinitialiser",barName:"Nom du bar",barNotesPlaceholder:"Entrez vos souhaits ici...",placeholderSuggestions:["Vin pour les pâtes","Parfait avec du poisson","Recommandé pour une soirée"],headerLine1:"Partagez tout ce qui vous passe par la tête —",headerLine2:"— et obtenez des recommandations de vin parfait en quelques secondes",headerMeal:"repas",headerMood:"humeur",headerBudget:"budget",headerOccasion:"occasion",headerOr:"ou",errorMessage:"Une erreur est survenue. Veuillez réessayer plus tard.",noResultsMessage:"Aucun résultat trouvé pour votre recherche. Veuillez essayer une autre requête.",ai_sommelier:"AI sommelier"},es:{lang:"es",welcomeMessage:"¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",noResultsFound:"No se encontraron resultados.",somethingWentWrong:"Lo sentimos, algo salió mal.",chatButton1:"Encuentra tu maridaje",chatButton2:"Combina vino ya",chatButton3:"Recibe asesoría ahora",chatTitle:"Maridaje de Vinos 🍷",chatSubtitle:"Describe tu comida y obtén una recomendación en 30 segundos",inputPlaceholder:"ej., Ensalada de atún",sendButton:"Combinar",poweredBy:"Desarrollado por",price:"Precio",region:"Región",type:"Tipo",reason:"Sugerencia",moreInfo:"Más info",winePairingIntro:"Para este vino, aquí tienes algunas sugerencias de platos:",askForDinner:"¿Qué te gustaría cenar?",clearChatButton:"Limpiar el chat",widgetTitle:"ENCUENTRA TU VINO PERFECTO",widgetSubtitle:"Comparte cualquier cosa que tengas en mente—tu comida, estado de ánimo, presupuesto o evento—y nuestro sommelier de IA te recomendará el vino perfecto en segundos",searchPlaceholder:"Escribe una palabra clave o descripción","wineDetails.reason":"Razón","wineDetails.price":"Precio","wineDetails.region":"Región","wineDetails.type":"Tipo","wineDetails.code":"Código","wineDetails.moreInfo":"Más información","wineDetails.buy":"Comprar",searchButton:"Buscar",priceRange:"Rango de precios",wineColor:"Color del vino",intensity:"Intensidad",red:"Tinto",white:"Blanco",rose:"Rosado",light:"Ligero",medium:"Medio",full:"Intenso",barTitle:"Platos de Bar",barSubtitle:"Selecciona de la lista y presiona «Enviar»",barSendButton:"Enviar",barResetButton:"Reiniciar",barName:"Nombre del bar",barNotesPlaceholder:"Agrega tus comentarios aquí...",placeholderSuggestions:["Vino para pasta","Perfecto con pescado","Recomendado para una fiesta"],headerLine1:"Comparte cualquier cosa que tengas en mente —",headerLine2:"— y obtén recomendaciones del vino perfecto en cuestión de segundos",headerMeal:"comida",headerMood:"estado de ánimo",headerBudget:"presupuesto",headerOccasion:"ocasión",headerOr:"o",errorMessage:"Algo salió mal. Por favor, inténtalo de nuevo más tarde.",noResultsMessage:"No se encontraron resultados para tu búsqueda. Por favor, intenta con otra consulta.",ai_sommelier:"AI sommelier"},en:{lang:"en",welcomeMessage:"What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",noResultsFound:"No results found.",somethingWentWrong:"Sorry, something went wrong.",chatButton1:"Find Your Pairing",chatButton2:"Pair Wine Now",chatButton3:"Get Wine Advice",chatTitle:"Wine Pairing Assistant 🍷",chatSubtitle:"Describe your meal and get a recommendation in 30 seconds",inputPlaceholder:"e.g., Tuna salad",sendButton:"Match",poweredBy:"Powered by",price:"Price",region:"Region",type:"Type",reason:"Suggestion",moreInfo:"More info",winePairingIntro:"For this wine, here are some suggested dishes:",askForDinner:"What would you like to have for dinner?",clearChatButton:"Clear Chat",widgetTitle:"FIND YOUR PERFECT WINE",widgetSubtitle:"Share anything on your mind—your meal, mood, budget, or occasion—and our AI sommelier will recommend the perfect wine in seconds",searchPlaceholder:"Enter a keyword or description","wineDetails.price":"Price","wineDetails.region":"Region","wineDetails.type":"Type","wineDetails.moreInfo":"More info","wineDetails.reason":"Reason","wineDetails.code":"Code","wineDetails.buy":"Buy",searchButton:"Search",priceRange:"Price Range",wineColor:"Wine Color",intensity:"Intensity",red:"Red",white:"White",rose:"Rosé",light:"Light",medium:"Medium",full:"Full",barTitle:"Bar Dishes",barSubtitle:"Select dishes below and click 'Send'",barSendButton:"Send",barResetButton:"Reset",barName:"Bar Name",barNotesPlaceholder:"Add your wishes here...",placeholderSuggestions:["Wine for pasta","Perfect with fish","Recommended for a party"],headerLine1:"Share anything on your mind —",headerLine2:"— and get recommendations of the perfect wine in seconds",headerMeal:"meal",headerMood:"mood",headerBudget:"budget",headerOccasion:"occasion",headerOr:"or",errorMessage:"Something went wrong. Please try again later.",noResultsMessage:"No results found for your search. Please try a different query.",ai_sommelier:"AI sommelier"},sr:{lang:"sr",welcomeMessage:"Šta planirate da jedete? Podelite svoje jelo i preporučiću vam savršeno vino uz obrok.",noResultsFound:"Nema rezultata.",somethingWentWrong:"Izvinite, nešto je pošlo po zlu.",chatButton1:"Pronađi vino",chatButton2:"Upari vino sada",chatButton3:"Zatraži preporuku",chatTitle:"Asistent za uparivanje vina 🍷",chatSubtitle:"Opišite svoj obrok i dobijte preporuku za 30 sekundi",inputPlaceholder:"npr. Tuna salata",sendButton:"Upari",poweredBy:"Pokreće",price:"Cena",region:"Regija",type:"Tip",reason:"Preporuka",moreInfo:"Više informacija",winePairingIntro:"Za ovo vino, preporučuju se sledeća jela:",askForDinner:"Šta biste želeli za večeru?",clearChatButton:"Obriši razgovor",widgetTitle:"PRONAĐITE SAVRŠENO VINO",widgetSubtitle:"Podelite bilo šta — obrok, raspoloženje, budžet ili priliku — i naš AI somelijer će vam za par sekundi preporučiti vino",searchPlaceholder:"Unesite ključnu reč ili opis","wineDetails.price":"Cena","wineDetails.region":"Regija","wineDetails.type":"Tip","wineDetails.moreInfo":"Više informacija","wineDetails.reason":"Razlog","wineDetails.code":"Šifra","wineDetails.buy":"Kupi",searchButton:"Pretraga",priceRange:"Cenovni raspon",wineColor:"Boja vina",intensity:"Intenzitet",red:"Crveno",white:"Belo",rose:"Roze",light:"Lako",medium:"Srednje",full:"Puno",barTitle:"Jela iz bara",barSubtitle:"Izaberite jela ispod i kliknite 'Pošalji'",barSendButton:"Pošalji",barResetButton:"Resetuj",barName:"Naziv bara",barNotesPlaceholder:"Dodajte svoje želje ovde...",placeholderSuggestions:["Vino uz pastu","Savršeno uz ribu","Preporuka za žurku"],headerLine1:"Podelite bilo šta što vam je na umu —",headerLine2:"— i dobijte preporuke za savršeno vino za par sekundi",headerMeal:"obrok",headerMood:"raspoloženje",headerBudget:"budžet",headerOccasion:"prilika",headerOr:"ili",errorMessage:"Nešto je pošlo po zlu. Molimo pokušajte ponovo kasnije.",noResultsMessage:"Nema rezultata za vašu pretragu. Molimo pokušajte sa drugačijim upitom.",ai_sommelier:"AI sommelier"},de:{lang:"de",welcomeMessage:"Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",noResultsFound:"Keine Ergebnisse gefunden.",somethingWentWrong:"Entschuldigung, etwas ist schief gelaufen.",chatButton1:"Finde Dein Pairing",chatButton2:"Wein jetzt wählen",chatButton3:"Erhalte Weinberatung",chatTitle:"Wein & Speisen 🍷",chatSubtitle:"Beschreiben Sie Ihr Gericht und erhalten Sie in 30 Sekunden eine Empfehlung",inputPlaceholder:"z.B., Thunfischsalat",sendButton:"Kombinieren",poweredBy:"Unterstützt von",price:"Preis",region:"Region",type:"Typ",reason:"Anregung",moreInfo:"Mehr Info",winePairingIntro:"Für diesen Wein gibt es folgende Essensvorschläge:",askForDinner:"Was möchten Sie zum Abendessen essen?",clearChatButton:"Chat löschen",widgetTitle:"FINDEN SIE IHREN PERFEKTEN WEIN",widgetSubtitle:"Teilen Sie alles, was Ihnen in den Sinn kommt—Ihre Mahlzeit, Stimmung, Ihr Budget oder Anlass—und unser KI-Sommelier empfiehlt Ihnen in Sekunden den perfekten Wein",placeholderSuggestions:["Wein für Pasta","Perfekt zu Fisch","Empfohlen für eine Party"],searchPlaceholder:"Geben Sie ein Stichwort oder eine Beschreibung ein","wineDetails.price":"Preis","wineDetails.region":"Region","wineDetails.type":"Typ","wineDetails.moreInfo":"Mehr Info","wineDetails.reason":"Grund","wineDetails.code":"Code","wineDetails.buy":"Kaufen",searchButton:"Suche",priceRange:"Preisspanne",wineColor:"Weinfarbe",intensity:"Intensität",red:"Rot",white:"Weiß",rose:"Rosé",light:"Leicht",medium:"Mittel",full:"Voll",barTitle:"Bar-Auswahl",barSubtitle:"Wählen Sie Ihre Gerichte und klicken Sie auf 'Senden'",barSendButton:"Senden",barResetButton:"Zurücksetzen",barName:"Name der Bar",headerLine1:"Teilen Sie alles, was Ihnen durch den Kopf geht —",headerLine2:"— und erhalten Sie in Sekundenschnelle Empfehlungen für den perfekten Wein",headerMeal:"Mahlzeit",headerMood:"Stimmung",headerBudget:"Budget",headerOccasion:"Anlass",headerOr:"oder",errorMessage:"Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut.",noResultsMessage:"Keine Ergebnisse für Ihre Suche gefunden. Bitte versuchen Sie es mit einer anderen Anfrage.",ai_sommelier:"AI sommelier"},ukr:{lang:"ukr",welcomeMessage:"Що ви збираєтесь їсти? Опишіть свою страву, і я порекомендую вам ідеальне вино.",noResultsFound:"Результатів не знайдено.",somethingWentWrong:"Вибачте, щось пішло не так.",chatButton1:"Знайти ідеальне поєднання",chatButton2:"Підібрати вино",chatButton3:"Отримати пораду",chatTitle:"Сомельє-помічник 🍷",chatSubtitle:"Опишіть свою страву і отримайте рекомендацію за 30 секунд",inputPlaceholder:"наприклад, Тунець із салатом",sendButton:"Підібрати",poweredBy:"Розроблено на основі",price:"Ціна",region:"Регіон",type:"Тип",reason:"Рекомендація",moreInfo:"Докладніше",winePairingIntro:"До цього вина підходять такі страви:",askForDinner:"Що ви хочете на вечерю?",clearChatButton:"Очистити чат",widgetTitle:"ЗНАЙДІТЬ ІДЕАЛЬНЕ ВИНО",widgetSubtitle:"Поділіться тим, що у вас на думці—їжа, настрій, бюджет чи подія—і наш AI-сомельє порекомендує вам ідеальне вино за секунди",searchPlaceholder:"Введіть ключове слово або опис","wineDetails.reason":"Причина","wineDetails.price":"Ціна","wineDetails.region":"Регіон","wineDetails.type":"Тип","wineDetails.moreInfo":"Докладніше","wineDetails.code":"Код","wineDetails.buy":"Купити",searchButton:"Пошук",priceRange:"Діапазон цін",wineColor:"Колір вина",intensity:"Інтенсивність",red:"Червоне",white:"Біле",rose:"Рожеве",light:"Легке",medium:"Середнє",full:"Повне",barTitle:"Закуски до вина",barSubtitle:"Виберіть страви нижче та натисніть «Надіслати»",barSendButton:"Надіслати",barResetButton:"Скинути",barName:"Назва бару",barNotesPlaceholder:"Додайте ваші побажання тут...",placeholderSuggestions:["Вино до пасти","Ідеально до риби","Рекомендуємо для вечірки"],headerLine1:"Поділіться будь-якими вашими думками —",headerLine2:"— і отримайте рекомендації щодо ідеального вина за секунди",headerMeal:"страва",headerMood:"настрій",headerBudget:"бюджет",headerOccasion:"подія",headerOr:"або",errorMessage:"Щось пішло не так. Будь ласка, спробуйте пізніше.",noResultsMessage:"За вашим запитом не знайдено результатів. Спробуйте інший запит.",ai_sommelier:"AI sommelier"},ru:{lang:"ru",welcomeMessage:"Что вы планируете поесть? Напишите ваше блюдо, и я подберу идеальное вино к нему.",noResultsFound:"Результаты не найдены.",somethingWentWrong:"Извините, что-то пошло не так.",chatButton1:"Найти сочетание",chatButton2:"Подобрать вино",chatButton3:"Получить совет",chatTitle:"Ассистент по подбору вина 🍷",chatSubtitle:"Опишите ваше блюдо и получите рекомендацию за 30 секунд",inputPlaceholder:"например, Тунец с салатом",sendButton:"Подобрать",poweredBy:"Powered by",price:"Цена",region:"Регион",type:"Тип",reason:"Рекомендация",moreInfo:"Подробнее",winePairingIntro:"К этому вину подходят следующие блюда:",askForDinner:"Что бы вы хотели на ужин?",clearChatButton:"Очистить чат",widgetTitle:"НАЙДИТЬ ИДЕАЛЬНОЕ ВИНО",widgetSubtitle:"Поделитесь вашими предпочтениями — блюдом, настроением, бюджетом или случаем — и наш AI-сомелье подберёт идеальное вино за секунды",searchPlaceholder:"Введите ключевое слово или описание","wineDetails.price":"Цена","wineDetails.region":"Регион","wineDetails.type":"Тип","wineDetails.moreInfo":"Подробнее","wineDetails.reason":"Причина","wineDetails.code":"Код","wineDetails.buy":"Купить",searchButton:"Поиск",priceRange:"Диапазон цен",wineColor:"Цвет вина",intensity:"Интенсивность",red:"Красное",white:"Белое",rose:"Розовое",light:"Лёгкое",medium:"Среднее",full:"Полное",barTitle:"Закуски к вину",barSubtitle:"Выберите блюда ниже и нажмите 'Отправить'",barSendButton:"Отправить",barResetButton:"Сбросить",barName:"Название бара",barNotesPlaceholder:"Добавьте ваши пожелания здесь...",placeholderSuggestions:["Вино для пасты","Идеально к рыбе","Рекомендуем для вечеринки"],headerLine1:"Поделитесь любыми вашими мыслями —",headerLine2:"— и получите рекомендации по идеальному вину за считанные секунды",headerMeal:"блюдо",headerMood:"настроение",headerBudget:"бюджет",headerOccasion:"случай",headerOr:"или",errorMessage:"Что-то пошло не так. Пожалуйста, попробуйте позже.",noResultsMessage:"По вашему запросу не найдено результатов. Попробуйте другой запрос.",ai_sommelier:"AI sommelier"},kk:{lang:"kk",welcomeMessage:"Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",noResultsFound:"Нәтижелер табылмады.",somethingWentWrong:"Кешіріңіз, бірдеңе дұрыс болмады.",chatButton1:"Сәйкестік табу",chatButton2:"Шарап таңдау",chatButton3:"Кеңес алу",chatTitle:"Шарап таңдаушы көмекші 🍷",chatSubtitle:"Тағамыңызды сипаттаңыз — 30 секундта ұсыныс алыңыз",inputPlaceholder:"мысалы, тунец салатымен",sendButton:"Таңдау",poweredBy:"Powered by",price:"Бағасы",region:"Өңір",type:"Түрі",reason:"Ұсыныс",moreInfo:"Толығырақ",winePairingIntro:"Бұл шарапқа келесі тағамдар сәйкес келеді:",askForDinner:"Кешкі асқа не қалайсыз?",clearChatButton:"Чатты тазалау",widgetTitle:"КЕРЕМЕТ ШАРАПТЫ ТАБЫҢЫЗ",widgetSubtitle:"Таңдауларыңызды бөлісіңіз — тағам, көңіл-күй, бюджет немесе жағдай — және біздің AI-сомелье сізге бірнеше секундта шарап ұсынады",searchPlaceholder:"Кілт сөзді немесе сипаттаманы енгізіңіз","wineDetails.price":"Бағасы","wineDetails.region":"Өңір","wineDetails.type":"Түрі","wineDetails.moreInfo":"Толығырақ","wineDetails.reason":"Себебі","wineDetails.code":"Код","wineDetails.buy":"Сатып алу",searchButton:"Іздеу",priceRange:"Баға диапазоны",wineColor:"Шарап түсі",intensity:"Қанықтылық",red:"Қызыл",white:"Ақ",rose:"Розалық",light:"Жеңіл",medium:"Орташа",full:"Толық",barTitle:"Шарапқа арналған тіскебасарлар",barSubtitle:"Төмендегі тағамдарды таңдаңыз және 'Жіберу' батырмасын басыңыз",barSendButton:"Жіберу",barResetButton:"Қалпына келтіру",barName:"Бар атауы",barNotesPlaceholder:"Мұнда өз тілектеріңізді жазыңыз...",placeholderSuggestions:["Пастаға арналған шарап","Балыққа тамаша үйлеседі","Кешке ұсынуға болады"],headerLine1:"Ойларыңызбен бөлісіңіз —",headerLine2:"— және бірнеше секундта мінсіз шарап ұсынысын алыңыз",headerMeal:"тағам",headerMood:"көңіл-күй",headerBudget:"бюджет",headerOccasion:"жағдай",headerOr:"немесе",errorMessage:"Бірдеңе дұрыс болмады. Кейінірек қайта көріңіз.",noResultsMessage:"Іздеуіңізге сәйкес нәтиже табылмады. Басқа сұрау қолданып көріңіз.",ai_sommelier:"AI sommelier"},pt:{lang:"pt",welcomeMessage:"O que você planeja comer? Descreva seu prato e eu recomendarei a harmonização perfeita.",noResultsFound:"Nenhum resultado encontrado.",somethingWentWrong:"Desculpe, algo deu errado.",chatButton1:"Encontre sua harmonização",chatButton2:"Harmonizar vinho agora",chatButton3:"Receber conselho de vinho",chatTitle:"Assistente de Harmonização de Vinhos 🍷",chatSubtitle:"Descreva sua refeição e receba uma recomendação em 30 segundos",inputPlaceholder:"ex., Salada de atum",sendButton:"Harmonizar",poweredBy:"Desenvolvido por",price:"Preço",region:"Região",type:"Tipo",reason:"Sugestão",moreInfo:"Mais informações",winePairingIntro:"Para este vinho, aqui estão algumas sugestões de pratos:",askForDinner:"O que você gostaria de jantar?",clearChatButton:"Limpar chat",widgetTitle:"ENCONTRE SEU VINHO PERFEITO",widgetSubtitle:"Compartilhe o que tiver em mente — sua refeição, humor, orçamento ou ocasião — e nosso sommelier de IA recomendará o vinho perfeito em segundos",searchPlaceholder:"Digite uma palavra-chave ou descrição","wineDetails.reason":"Motivo","wineDetails.price":"Preço","wineDetails.region":"Região","wineDetails.type":"Tipo","wineDetails.moreInfo":"Mais informações","wineDetails.code":"Código","wineDetails.buy":"Comprar",searchButton:"Pesquisar",priceRange:"Faixa de preço",wineColor:"Cor do vinho",intensity:"Intensidade",red:"Tinto",white:"Branco",rose:"Rosé",light:"Leve",medium:"Médio",full:"Encorpado",barTitle:"Pratos do bar",barSubtitle:"Selecione os pratos abaixo e clique em 'Enviar'",barSendButton:"Enviar",barResetButton:"Resetar",barName:"Nome do bar",barNotesPlaceholder:"Adicione seus desejos aqui...",placeholderSuggestions:["Vinho para massa","Perfeito com peixe","Recomendado para uma festa"],headerLine1:"Compartilhe o que tiver em mente —",headerLine2:"— e receba recomendações do vinho perfeito em segundos",headerMeal:"refeição",headerMood:"humor",headerBudget:"orçamento",headerOccasion:"ocasião",headerOr:"ou",errorMessage:"Algo deu errado. Por favor, tente novamente mais tarde.",noResultsMessage:"Nenhum resultado encontrado para sua pesquisa. Por favor, tente uma consulta diferente.",ai_sommelier:"AI sommelier"}};function ff(t){return{id:String(t.id),lang:t.lang,available_languages:t.available_languages?t.available_languages:[t.lang],open_ai_key:t.open_ai_key??null,currency:t.currency,title:t.title}}const pf={0:{logoUrl:null,brandColor:"#7B2BEB"},29:{logoUrl:"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/plou_logo.jpg",brandColor:"#e6c6bb"},25:{logoUrl:null,brandColor:"#000000",wineaterColor:"#000000",buttonUppercase:!0,customCss:`
|
|
15
|
+
`).length?ad(t):t.stack?cd(t):ld(t)}function ad(t,e){const n=/Line (\d+).*script (?:in )?(\S+)/i,s=t.message.split(`
|
|
16
|
+
`),i=[];for(let r=2,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({file:a[2],line:+a[1],raw:s[r]})}return as(i)}function ld(t,e){const n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,s=t.stacktrace.split(`
|
|
17
|
+
`),i=[];for(let r=0,o=s.length;r<o;r+=2){const a=n.exec(s[r]);a&&i.push({function:a[3]||void 0,file:a[2],line:a[1]?+a[1]:void 0,raw:s[r]})}return as(i)}function cd(t,e){return as(t.stack.split(`
|
|
18
|
+
`).filter(s=>!!s.match($h)&&!s.match(/^Error created at/))).map(s=>{const i=s.split("@"),r=cr(i.pop()),o=i.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;let l;o.match(/\(([^)]*)\)/)&&(l=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));const u=l===void 0||l==="[arguments not available]"?void 0:l.split(",");return{function:a,args:u,file:r[0],line:r[1]?+r[1]:void 0,col:r[2]?+r[2]:void 0,raw:s}})}function ud(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function hd(t,e){return ud(td(t))}function Ha(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function Ks(t,e,n={}){let s=e;try{s=hd(t)}catch{}return Yi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function qa(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return Ks(t.error,Ha(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),Yi(s,i,JSON.stringify(Ha(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return Ks(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return Yi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function dd(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(o){const a=qa(o,i);a!=null&&t.send(a)}try{t.attachEventListener(i,"unhandledrejection",r),t.attachEventListener(i,"error",r)}catch(o){console.error("Error while attaching to error proto contexts",o)}}n.captureExceptions&&(t.observer.attachContextCallback(s),s(window))}function Va(t,e=document.location){return t=t.trim(),t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:t.startsWith("/")?e.origin+t:e.origin+e.pathname+t}function fd(t){return vu&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const pd="https://static.openreplay.com/tracker/placeholder.jpeg";function gd(t){function e(a,l){t.attributeSender.sendSetAttribute(a,"src",pd);const{width:u,height:c}=l.getBoundingClientRect();l.hasAttribute("width")||t.attributeSender.sendSetAttribute(a,"width",String(u)),l.hasAttribute("height")||t.attributeSender.sendSetAttribute(a,"height",String(c))}const n=function(a,l){const{srcset:u}=l;if(!u)return;const c=u.split(u.match(/,\s+/)?/,\s+/:",").map(h=>Va(h)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",c)},s=function(a,l){l.src.length>wu&&e(a,l),t.send(Gi(a,"src",l.src,t.getBaseHref()))},i=t.safe(function(a){const l=Va(a.src||"");ia(l)&&t.send(_a(t.timestamp(),0,0,0,0,0,l,"img",0,!1))}),r=t.safe(function(a){const l=t.nodes.getID(a);l!==void 0&&a.complete&&(a.naturalHeight===0&&a.naturalWidth===0&&!fd(a.src)?i(a):t.sanitizer.isHidden(l)||t.sanitizer.isObscured(l)?e(l,a):(s(l,a),n(l,a)))}),o=ca(t.safe(a=>{for(const l of a)if(l.type==="attributes"){const u=l.target,c=t.nodes.getID(u);if(c===void 0)return;l.attributeName==="src"&&s(c,u),l.attributeName==="srcset"&&n(c,u)}}),t.options.forceNgOff);t.attachStopCallback(()=>{o.disconnect()}),t.nodes.attachNodeCallback(a=>{we(a,"img")&&(t.nodes.attachNodeListener(a,"error",()=>i(a)),t.nodes.attachNodeListener(a,"load",()=>r(a)),r(a),o.observe(a,{attributes:!0,attributeFilter:["src","srcset"]}))})}const md=["text","password","email","search","number","range","date","tel","time"];function vd(t){return we(t,"textarea")?!0:we(t,"input")?md.includes(t.type):!1}function wd(t){if(!we(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const bd=ht&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(we(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(we(e,"label"))return e;const n=t.id;if(n){const s=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(s!==null&&s.length===1)return s[0]}};function Ga(t){let e=qi(t);if(e===null){const n=bd(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return sa(e).slice(0,100)}const Ln={Plain:0,Obscured:1,Hidden:2};function yd(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:Ln.Obscured,obscureInputDates:!1},e);function s(c,h){let d=h.value,p=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(c)?p=Ln.Hidden:(t.sanitizer.isObscured(c)||p===Ln.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(d)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~d.indexOf("@"))))&&(p=Ln.Obscured);let f=0;switch(p){case Ln.Hidden:f=-1,d="";break;case Ln.Obscured:f=d.length,d="";break}return{value:d,mask:f}}function i(c,h){const{value:d,mask:p}=s(c,h);t.send(Au(c,d,p))}const r=new Map,o=new Map;t.attachStopCallback(()=>{r.clear(),o.clear()});function a(c,h){r.get(c)!==h.value&&(r.set(c,h.value),i(c,h))}function l(c,h){o.get(c)!==h&&(o.set(c,h),t.send(Mu(c,h)))}t.ticker.attach(()=>{r.forEach((c,h)=>{const d=t.nodes.getNode(h);if(!d)return r.delete(h);a(h,d)}),o.forEach((c,h)=>{const d=t.nodes.getNode(h);if(!d)return o.delete(h);l(h,d.checked)})},3);function u(c,h,d,p){const{value:f,mask:m}=s(c,h),S=Ga(h);t.send(Qu(c,f,m!==0,S,d,p))}t.nodes.attachNodeCallback(t.safe(c=>{const h=t.nodes.getID(c);if(h!==void 0){if(we(c,"select")&&(i(h,c),t.nodes.attachNodeListener(c,"change",()=>i(h,c))),vd(c)){a(h,c);let d=0,p=0,f=0;const m=()=>{d=it()},S=()=>{p===0&&d!==0&&(p=it()-d)},T=()=>{d!==0&&(f=it()-d),u(h,c,p,f),p=0,f=0,d=0};t.nodes.attachNodeListener(c,"focus",m),t.nodes.attachNodeListener(c,"input",S),t.nodes.attachNodeListener(c,"change",T);return}if(wd(c)){l(h,c.checked),t.nodes.attachNodeListener(c,"change",()=>l(h,c.checked));return}}}))}let Je,ur,Ka;function Sd(t,e){if(Ka=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Je={...n,...e},ur=_d(Je.root,n);let s=Xs(t,"all",()=>Xs(t,"two",()=>Xs(t,"one",()=>Xs(t,"none"))));if(s){const i=$a(el(s,t));return i.length>0&&(s=i[0]),Ys(s)}else throw new Error("Selector was not found.")}function _d(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function Xs(t,e,n){let s=null,i=[],r=t,o=0;for(;r;){const a=new Date().getTime()-Ka.getTime();if(Je.timeoutMs!==void 0&&a>Je.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let l=Qs(kd(r))||Qs(...Td(r))||Qs(...xd(r))||Qs(Ed(r))||[Qa()];const u=Id(r);if(e=="all")u&&(l=l.concat(l.filter(hr).map(c=>Js(c,u))));else if(e=="two")l=l.slice(0,1),u&&(l=l.concat(l.filter(hr).map(c=>Js(c,u))));else if(e=="one"){const[c]=l=l.slice(0,1);u&&hr(c)&&(l=[Js(c,u)])}else e=="none"&&(l=[Qa()],u&&(l=[Js(l[0],u)]));for(let c of l)c.level=o;if(i.push(l),i.length>=Je.seedMinLength&&(s=Xa(i,n),s))break;r=r.parentElement,o++}return s||(s=Xa(i,n)),!s&&n?n():s}function Xa(t,e){const n=$a(Za(t));if(n.length>Je.threshold)return e?e():null;for(let s of n)if(Ja(s))return s;return null}function Ys(t){let e=t[0],n=e.name;for(let s=1;s<t.length;s++){const i=t[s].level||0;e.level===i-1?n=`${t[s].name} > ${n}`:n=`${t[s].name} ${n}`,e=t[s]}return n}function Ya(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Ja(t){const e=Ys(t);switch(ur.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function kd(t){const e=t.getAttribute("id");return e&&Je.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function Td(t){return Array.from(t.attributes).filter(n=>Je.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function xd(t){return Array.from(t.classList).filter(Je.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function Ed(t){const e=t.tagName.toLowerCase();return Je.tagName(e)?{name:e,penalty:2}:null}function Qa(){return{name:"*",penalty:3}}function Id(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let s=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&s++,n!==t);)n=n.nextSibling;return s}function Js(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function hr(t){return t.name!=="html"&&!t.name.startsWith("#")}function Qs(...t){const e=t.filter(Cd);return e.length>0?e:null}function Cd(t){return t!=null}function*Za(t,e=[]){if(t.length>0)for(let n of t[0])yield*Za(t.slice(1,t.length),e.concat(n));else yield e}function $a(t){return[...t].sort((e,n)=>Ya(e)-Ya(n))}function*el(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>Je.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>Je.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Ys(i);if(n.visited.has(r))return;Ja(i)&&Nd(i,e)&&(yield i,n.visited.set(r,!0),yield*el(i,e,n))}}function Nd(t,e){return ur.querySelector(Ys(t))===e}function Rd(t,e,n){return Sd(t,{root:e.body,seedMinLength:3,optimizedMinLength:(n==null?void 0:n.minSelectorDepth)||2,threshold:(n==null?void 0:n.nthThreshold)||1e3,maxNumberOfTries:(n==null?void 0:n.maxOptimiseTries)||1e4})}function dr(t){const e=t.tagName.toUpperCase();return e==="BUTTON"||e==="A"||e==="LI"||e==="SELECT"||e==="TR"||e==="TH"||t.onclick!=null||t.getAttribute("role")==="button"}function tl(t,e){return t instanceof Element?Dd(t,e):null}function Dd(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(an(n,"masked"))return null;n=n.parentElement}if(tr(t)){let s=t.ownerSVGElement;for(;s!==null;)t=s,s=s.ownerSVGElement}for(n=t;n!==null&&n!==e.documentElement;){const s=n.tagName.toUpperCase();if(s==="LABEL")return null;if(s==="INPUT"||dr(n)||qi(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function Od(t,e){const{disableClickmaps:n=!1}=e||{};function s(g){const b=qi(g);if(b!==null)return b;if(we(g,"input"))return Ga(g);if(dr(g)){let _="";return g instanceof HTMLElement&&(_=t.sanitizer.getInnerTextSecure(g)),_=_||g.id||g.className,sa(_).slice(0,100)}return""}let i=-1,r=-1,o=!1,a=null,l=0,u={},c=0,h=0,d=0,p=0,f;const m=.008,S=225;function T(){const g=p/S;if(!c){c=g;return}const b=(g-c)/S;d>4&&b>m&&t.send(Zu(it())),p=0,d=0,c=g}t.attachStartCallback(()=>{f=setInterval(()=>T(),S)}),t.attachStopCallback(()=>{i=-1,r=-1,o=!1,a=null,u={},f&&clearInterval(f)});const x=()=>{o&&(t.send(Pu(i,r)),o=!1)},I=(g,b=!1)=>{function _(y,E,P){return u[y]=u[y]||Rd(E,g,P)}const k=b?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);k(g.documentElement,"mouseover",y=>{const E=tl(y.target,g);E!==a&&(a=E,l=performance.now())}),k(g,"mousemove",y=>{const[E,P]=t.observer.getDocumentOffset(g);i=y.clientX+E,r=y.clientY+P,o=!0;const j=Math.sign(y.movementX);p+=Math.abs(y.movementX)+Math.abs(y.movementY),j!==h&&(h=j,d++)},!1),k(g,"click",y=>{const E=tl(y.target,g);if(!y.clientX&&!y.clientY||E===null)return;const P=t.nodes.getID(E);if(P!==void 0){const j=y.pageX,L=y.pageY,J=g.documentElement.scrollWidth,U=g.documentElement.scrollHeight,B=nl(j/J),Y=nl(L/U);x(),t.send(Xu(P,a===E?Math.round(performance.now()-l):0,s(E),dr(E)&&!n?_(P,E,e):"",B,Y),!0)}a=null})};t.nodes.attachNodeCallback(g=>{Hs(g)&&I(g)}),I(document,!0),t.ticker.attach(x,(e==null?void 0:e.trackingOffset)||7)}function nl(t){return Math.round(t*1e4)}function Ad(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let o="";if(we(r,"img")&&(o=r.currentSrc||r.src),!o){const f=getComputedStyle(r).getPropertyValue("background-image");if(f){const m=s.exec(f);m!==null&&(o=m[1],(o.startsWith('"')||o.startsWith("'"))&&(o=o.substr(1,o.length-2)))}}if(!o)continue;const a=o.substr(0,10)==="data:image"?0:t[o];if(a===void 0)continue;const l=r.getBoundingClientRect(),u=Math.max(l.top,0),c=Math.max(l.left,0),h=Math.min(l.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),d=Math.min(l.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(h<=u||d<=c)continue;const p=(h-u)*(d-c);e.push({time:a,area:p})}return e}function Md(t,e){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,s=n*t;for(let i=0;i<e.length;i++){const{time:r,area:o}=e[i];n+=o,s+=o*(r>t?r:t)}return n===0?0:s/n}function Pd(t,e){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},e);if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let s={};function i(u){var h;if(u.duration<0||!ia(u.name)||t.isServiceURL(u.name))return;s!==null&&(s[u.name]=u.startTime+u.duration);let c=!1;(h=n.excludedResourceUrls)==null||h.forEach(d=>{if(u.name.startsWith(d)){c=!0;return}}),!c&&t.send(_a(u.startTime+On(),u.duration,u.responseStart&&u.startTime?u.responseStart-u.startTime:0,u.transferSize>u.encodedBodySize?u.transferSize-u.encodedBodySize:0,u.encodedBodySize||0,u.decodedBodySize||0,u.name,u.initiatorType,u.transferSize,u.responseStatus&&u.responseStatus===304||u.transferSize===0))}const r=new PerformanceObserver(u=>u.getEntries().forEach(i));let o;t.attachStartCallback(function({sessionID:u}){u!==o&&(performance.getEntriesByType("resource").forEach(i),o=u),r.observe({entryTypes:["resource"]})}),t.attachStopCallback(function(){r.disconnect()});let a=0,l=0;if(n.capturePageLoadTimings){let u=!1;t.ticker.attach(()=>{if(!u&&((a===0||l===0)&&performance.getEntriesByType("paint").forEach(c=>{const{name:h,startTime:d}=c;switch(h){case"first-paint":a=d;break;case"first-contentful-paint":l=d;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){u=!0;const{navigationStart:c,requestStart:h,responseStart:d,responseEnd:p,domContentLoadedEventStart:f,domContentLoadedEventEnd:m,loadEventStart:S,loadEventEnd:T}=performance.timing;t.send(Bu(h-c||0,d-c||0,p-c||0,f-c||0,m-c||0,S-c||0,T-c||0,a,l))}},30)}if(n.capturePageRenderTimings){let u=0,c=0,h=0,d=null,p=!1;t.ticker.attach(()=>{if(p)return;const f=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(m=>s[m])),f-u>1e3&&(d=Ad(s),s=null)),h!==null&&(f-h>50&&(c=f),h=f-c>5e3?null:f),d!==null&&h===null||f>3e4){p=!0,s=null;const m=d===null?0:Md(l||a,d),{domContentLoadedEventEnd:S,navigationStart:T}=performance.timing,x=h===null?Math.max(c,l,S-T||0):0;t.send(Fu(m,l>u?l:u,x))}})}}function fr(t){const e=t.defaultView;return[e&&e.scrollX||t.documentElement&&t.documentElement.scrollLeft||t.body&&t.body.scrollLeft||0,e&&e.scrollY||t.documentElement&&t.documentElement.scrollTop||t.body&&t.body.scrollTop||0]}function Ld(t,e){let n=!1;const s=new Map;function i(a){Aa(a)&&(xt(a)&&s.set(a,[a.scrollLeft,a.scrollTop]),Hs(a)&&s.set(a,fr(a)))}const r=t.safe(()=>{e||t.send(xu(...fr(document)))}),o=t.safe((a,l)=>{const u=t.nodes.getID(l);u!==void 0&&t.send(Ou(u,a[0],a[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((a,l)=>{l&&(xt(a)&&a.scrollLeft+a.scrollTop>0?s.set(a,[a.scrollLeft,a.scrollTop]):Hs(a)&&s.set(a,fr(a))),qs(a)&&t.nodes.attachNodeListener(a,"scroll",u=>{i(u.target)})}),t.attachEventListener(document,"scroll",a=>{const l=a.target;if(l===document){n=!0;return}i(l)}),t.ticker.attach(()=>{n&&(r(),n=!1),s.forEach(o),s.clear()},5,!1)}function Bd(t){let e,n,s,i,r=document.referrer;const o=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(th(e,r,i,document.title)),i=0,r=e)}),a=t.safe(()=>{const{innerWidth:u,innerHeight:c}=window;(u!==n||c!==s)&&(n=u,s=c,t.send(Tu(n,s)))}),l=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(qu(document.hidden)));t.attachStartCallback(()=>{e=null,i=On(),n=s=-1,o(),a(),l()}),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",l,!1,!1),t.ticker.attach(o,1,!1),t.ticker.attach(a,5,!1)}function sl(t){return qs(t)&&!!t.adoptedStyleSheets}let Fd=15;function il(){return Fd++}const Zs=new Map;function Wd(t){if(t===null||!sl(document))return;const e=new Map,n=new Map,s=o=>setTimeout(()=>{let a=t.nodes.getID(o);if(o===document&&(a=0),a===void 0)return;let l=n.get(a);l||(l=[]);const u=[],c=o.adoptedStyleSheets;if(c&&Symbol.iterator in c)for(const h of c){let d=e.get(h);const p=!d;if(d||(d=il(),e.set(h,d)),l.includes(d)||t.send(ba(d,a)),p){const f=h.cssRules;for(let m=0;m<f.length;m++)t.send(Xi(d,f[m].cssText,m,t.getBaseHref()))}u.push(d)}if(Symbol.iterator in l)for(const h of l)u.includes(h)||t.send(Yu(h,a));n.set(a,u)},20);function i(o){const a=Object.getOwnPropertyDescriptor(o,"adoptedStyleSheets");a&&Object.defineProperty(o,"adoptedStyleSheets",{...a,set:function(l){const u=a.set.call(this,l);return s(this),u}})}const r=o=>{if(o.__openreplay_adpss_patched__)return;o.__openreplay_adpss_patched__=!0,i(o.Document.prototype),i(o.ShadowRoot.prototype);const{replace:a,replaceSync:l}=o.CSSStyleSheet.prototype;o.CSSStyleSheet.prototype.replace=function(u){return a.call(this,u).then(c=>{const h=e.get(this);return h&&t.send(va(h,u,t.getBaseHref())),c})},o.CSSStyleSheet.prototype.replaceSync=function(u){const c=e.get(this);return c&&t.send(va(c,u,t.getBaseHref())),l.call(this,u)}};r(window),t.observer.attachContextCallback(t.safe(r)),t.attachStopCallback(()=>{e.clear(),n.clear()}),t.attachStartCallback(()=>{s(document)}),t.nodes.attachNodeCallback(o=>{sl(o)&&s(o)})}function zd(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(Gu("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,o)=>{const a=Zs.get(i);a&&(typeof o=="string"?t.send(Xi(a,o,r,t.getBaseHref())):t.send(wa(a,r)))}),n=t.safe(i=>{let r=i;for(;r.parentRule;)r=r.parentRule;const o=r.parentStyleSheet;if(!o){t.debug.warn("No parent StyleSheet found for",r,i);return}const a=Zs.get(o);if(!a){t.debug.warn("No sheedID found for",o,Zs);return}const l=r.cssText,u=o.cssRules,c=Array.from(u).indexOf(r);c>=0?(t.send(Xi(a,l,c,t.getBaseHref())),t.send(wa(a,c+1))):t.debug.warn("Rule index not found in",o,r)}),s=t.safe(i=>{const{insertRule:r,deleteRule:o}=i.CSSStyleSheet.prototype,{insertRule:a,deleteRule:l}=i.CSSGroupingRule.prototype;i.CSSStyleSheet.prototype.insertRule=function(u,c=0){return e(this,c,u),r.call(this,u,c)},i.CSSStyleSheet.prototype.deleteRule=function(u){return e(this,u),o.call(this,u)},i.CSSGroupingRule.prototype.insertRule=function(u,c=0){const h=a.call(this,u,c);return n(this),h},i.CSSGroupingRule.prototype.deleteRule=function(u=0){const c=l.call(this,u);return n(this),c}});s(window),t.observer.attachContextCallback(s),t.nodes.attachNodeCallback(i=>{if(!we(i,"style")||!i.sheet||i.textContent!==null&&i.textContent.trim().length>0)return;const r=t.nodes.getID(i);if(!r)return;const o=i.sheet,a=il();Zs.set(o,a),t.send(ba(a,r));const l=o.cssRules;for(let u=0;u<l.length;u++)e(o,u,l[u].cssText)})}function jd(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(ma(i))}let n=!1;t.nodes.attachNodeCallback(s=>{we(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{Aa(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(ma(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&we(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function Ud(t){if(!window.FontFace)return;const e=new Map,n=s=>{class i extends s.FontFace{constructor(...o){if(typeof o[1]=="string"){let a="";o[2]&&t.safe(()=>{a=JSON.stringify(o[2])});const l=[o[0],o[1],a],u=e.get(s.document)||[];u.push(l),e.set(s.document,u);const c=s===window?0:t.nodes.getID(s.document);if(c===void 0)return;t.active()&&t.send(ga(c,...l))}super(...o)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!Hs(s))return;const i=e.get(s);if(!i)return;const r=s.defaultView===window?0:t.nodes.getID(s);r!==void 0&&i.forEach(o=>{t.send(ga(r,...o))})}))}function Hd(t,e,n,s,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function r(d){t.debug.log("Openreplay: capturing axios response data",d);const{headers:p,data:f,method:m,url:S,baseURL:T}=d.config,{data:x,headers:I,status:g,response:b}=d,{data:_,headers:k,status:y}=b||{},E=n.ignoreHeaders,P=Array.isArray(E)?R=>E.includes(R):()=>E;function j(R,Q){P(Q[0])||(R[Q[0]]=Q[1])}let L={},J={};p.toJSON?L=p.toJSON():p instanceof Headers?p.forEach((R,Q)=>j(L,[Q,R])):Array.isArray(p)?p.forEach(R=>j(L,R)):typeof p=="object"&&Object.entries(p).forEach(R=>j(L,R));const U=k||I;U.toJSON?J=U.toJSON():U instanceof Headers?U.forEach((R,Q)=>j(J,[Q,R])):Array.isArray(U)?U.forEach(R=>j(J,R)):typeof U=="object"&&Object.entries(U).forEach(([R,Q])=>{P(R)||(J[R]=Q)});const B=s({url:S,method:m||"",status:g||y||0,request:{headers:L,body:f},response:{headers:J,body:_||x}});if(!B){t.debug.log("Openreplay: empty request/response info, skipping");return}const Y=d.config.__openreplay_timing,ee=performance.now()-Y;t.debug.log("Openreplay: final req object",B),t.send(Ws("xhr",String(m),String(B.url),i(B.request),i(B.response),B.status,Y+On(),ee,0))}function o(d){if(t.debug.log("Openreplay: capturing API request",d),d.__openreplay_timing=performance.now(),n.sessionTokenHeader){const p=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",f=t.getSessionToken();f&&d.headers.set(p,f)}return d}function a(d){return n.failuresOnly||r(d),d}function l(d){return t.debug.log("Openreplay: capturing API request error",d),qd(d)&&d.response?r(d.response):d instanceof Error&&t.send(Ks(d,[])),Promise.reject(d)}function u(d){t.debug.log("Openreplay: failed API request, skipping",d)}const c=e.interceptors.request.use(o,u,{synchronous:!0}),h=e.interceptors.response.use(a,l,{synchronous:!0});t.attachStopCallback(()=>{var d,p,f,m;(p=(d=e.interceptors.request).eject)==null||p.call(d,c),(m=(f=e.interceptors.response).eject)==null||m.call(f,h)})}function qd(t){return Vd(t)&&t.isAxiosError===!0}function Vd(t){return t!==null&&typeof t=="object"}class pr{constructor(e=[],n,s){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestType="xhr",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:n}=this.writeHeaders(),s={headers:e,body:this.method==="GET"?JSON.stringify(this.getData):this.requestData},i={headers:n,body:this.response},r=this.sanitize({url:this.url,method:this.method,status:this.status,request:s,response:i});if(!r)return null;if(r.url.includes("/graphql")&&r.response.body&&typeof r.response.body=="string"){const a=r.response.body.includes("errors");r.status=a?400:200,this.requestType="graphql"}return{requestType:this.requestType,method:r.method,url:r.url,request:JSON.stringify(r.request),response:JSON.stringify(r.response),status:r.status,startTime:this.startTime,duration:this.duration,responseSize:this.responseSize}}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(([s,i])=>{this.isHeaderIgnored(s)||(e[s]=i)}),this.setSessionTokenHeader((s,i)=>{e[s]=i});const n={};return Object.entries(this.header).forEach(([s,i])=>{this.isHeaderIgnored(s)||(n[s]=i)}),{reqHs:e,resHs:n}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(n=>n.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const ls=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:mr(e)||Array.isArray(e)?n=JSON.stringify(e):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},gr=t=>{if(!t)return null;let e;if(typeof t=="string"){(t[0]==="{"||t[0]==="[")&&(e=t);const n=t.split("&");n.length===1?e=t:e=n.join(",")}else if(Kd(t)){const n=[];for(const[s,i]of t)n.push(`${s}=${typeof i=="string"?i:"[object Object]"}`);e=n.join(",")}else t instanceof Blob||t instanceof ReadableStream||t instanceof ArrayBuffer?e="byte data":mr(t)?e=t:e=`can't parse body ${typeof t}`;return e},Gd=(t,e={})=>{mr(e)||(e={});let n=t?t.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const s of n){const i=s.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e};function mr(t){return t!==null&&typeof t=="object"}function Kd(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function $s(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const vr=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),Xd=t=>t instanceof Blob?t.type:t instanceof FormData?"multipart/form-data":t instanceof URLSearchParams?"application/x-www-form-urlencoded;charset=UTF-8":"text/plain;charset=UTF-8";class Yd{constructor(e,n,s,i,r){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r}apply(e,n,s){const i=s[0],r=s[1],o=new pr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const a=vr(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":Xd(r)},o.status=0,o.statusText="Pending",a.search&&a.searchParams){o.getData={};for(const[c,h]of a.searchParams)o.getData[c]=h}o.requestData=gr(r),o.startTime||(o.startTime=performance.now());const l=e.apply(n,s);l?(o.endTime=performance.now(),o.duration=o.endTime-(o.startTime||o.endTime),o.status=0,o.statusText="Sent",o.readyState=4):(o.status=500,o.statusText="Unknown");const u=o.getMessage();return u&&this.sendMessage(u),l}}class Jd{static create(e,n,s,i,r,o){if(e)return new Proxy(e,new Yd(n,s,i,r,o))}}var ft;(function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"})(ft||(ft={}));class Qd{constructor(e,n){this.resp=e,this.item=n,this.mockReader()}set(e,n,s){return Reflect.set(e,n,s)}get(e,n){const s=Reflect.get(e,n);switch(n){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),s.apply(e).then(i=>(this.item.response=ls(this.item.responseType,i),i)))}return typeof s=="function"?s.bind(e):s}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const n=this.resp.body.getReader;this.resp.body.getReader=()=>{const s=n.apply(this.resp.body);if(this.item.readyState===ft.DONE)return s;const i=s.read,r=s.cancel;return this.item.responseType="arraybuffer",s.read=()=>i.apply(s).then(o=>{if(!e)e=new Uint8Array(o.value);else{const a=new Uint8Array(e.length+o.value.length);a.set(e),a.set(o.value,e.length),e=a}return this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=o.done?4:3,this.item.statusText=o.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=$s(this.item.responseSize),o.done&&(this.item.response=ls(this.item.responseType,e)),o}),s.cancel=(...o)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=ls(this.item.responseType,e),r.apply(s,o)),s}}}class Zd{constructor(e,n,s,i,r,o){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r,this.tokenUrlMatcher=o}apply(e,n,s){const i=s[0],r=s[1];if(!i||typeof i!="string"&&!(i!=null&&i.url)||(i instanceof URL||typeof i=="string"?this.isServiceUrl(String(i)):this.isServiceUrl(String(i.url))))return e.apply(window,s);const a=new pr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);return this.beforeFetch(a,i,r),this.setSessionTokenHeader((l,u)=>{if(!(this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(a.url))){if(s[1]===void 0&&s[0]instanceof Request)return s[0].headers.append(l,u);s[1]||(s[1]={}),s[1].headers===void 0&&(s[1]=Object.assign(Object.assign({},s[1]),{headers:{}})),s[1].headers instanceof Headers?s[1].headers.append(l,u):Array.isArray(s[1].headers)?s[1].headers.push([l,u]):s[1].headers[l]=u}}),e.apply(window,s).then(this.afterFetch(a)).catch(l=>{throw a.endTime=performance.now(),a.duration=a.endTime-(a.startTime||a.endTime),l})}beforeFetch(e,n,s){let i,r="GET",o={};if(typeof n=="string"?(r=(s==null?void 0:s.method)||"GET",i=vr(n),o=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=vr(n.url),o=n.headers),e.method=r,e.requestType="fetch",e.requestHeader=o,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),Object.prototype.toString.call(o)==="[object Headers]"){e.requestHeader={};for(const[a,l]of o)e.requestHeader[a]=l}else e.requestHeader=o;if(i.search&&i.searchParams){e.getData={};for(const[a,l]of i.searchParams)e.getData[a]=l}s!=null&&s.body&&(e.requestData=gr(s.body))}afterFetch(e){return n=>{e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let s=!1;e.header={};for(const[i,r]of n.headers)e.header[i]=r,s=r.toLowerCase().indexOf("chunked")>-1?!0:s;return s?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=$s(e.responseSize),e.response=ls(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new Qd(n,e))}}handleResponseBody(e,n){const s=e.headers.get("content-type");return s&&s.includes("application/json")?(n.responseType="json",e.text()):s&&(s.includes("text/html")||s.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class $d{static create(e,n,s,i,r,o){return new Proxy(fetch,new Zd(e,n,s,i,r,o))}}class ef{constructor(e,n,s,i,r,o,a){this.ignoredHeaders=n,this.setSessionTokenHeader=s,this.sanitize=i,this.sendMessage=r,this.isServiceUrl=o,this.tokenUrlMatcher=a,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new pr(n,s,i),this.item.requestType="xhr"}get(e,n){switch(n){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((i,r)=>{this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(this.item.url)||e.setRequestHeader(i,r)}),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const s=Reflect.get(e,n);return typeof s=="function"?s.bind(e):s}}set(e,n,s){switch(n){case"onreadystatechange":return this.setOnReadyStateChange(e,n,s);case"onabort":return this.setOnAbort(e,n,s);case"ontimeout":return this.setOnTimeout(e,n,s)}return Reflect.set(e,n,s)}onReadyStateChange(){if(!(this.item.url&&this.isServiceUrl(this.item.url))&&(this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),setTimeout(()=>{this.item.response=ls(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===ft.DONE)){const e=this.item.getMessage();e&&this.sendMessage(e)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){const n=Reflect.get(e,"open");return(...s)=>{var i,r,o;const a=s[0],l=s[1];return this.item.method=a?a.toUpperCase():"GET",this.item.url=((i=l.toString)===null||i===void 0?void 0:i.call(l))||"",this.item.name=(o=(r=this.item.url)===null||r===void 0?void 0:r.replace(new RegExp("/*$"),"").split("/").pop())!==null&&o!==void 0?o:"",this.item.getData=Gd(this.item.url,{}),n.apply(e,s)}}getSend(e){const n=Reflect.get(e,"send");return(...s)=>{const i=s[0];return this.item.requestData=gr(i),n.apply(e,s)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...s)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[s[0]]=s[1],n.apply(e,s))}setOnReadyStateChange(e,n,s){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),s==null||s.apply(e,i)})}setOnAbort(e,n,s){return Reflect.set(e,n,(...i)=>{this.onAbort(),s.apply(e,i)})}setOnTimeout(e,n,s){return Reflect.set(e,n,(...i)=>{this.onTimeout(),s.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case ft.UNSENT:case ft.OPENED:this.item.status=ft.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case ft.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
|
|
19
|
+
`);for(let s=0;s<n.length;s++){const i=n[s];if(!i)continue;const r=i.split(": "),o=r[0];this.item.header[o]=r.slice(1).join(": ")}break;case ft.LOADING:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=$s(this.item.responseSize));break;case ft.DONE:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=this.XMLReq.response,this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=$s(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class tf{static create(e,n,s,i,r,o){return new Proxy(XMLHttpRequest,{construct(a){const l=new a;return new Proxy(l,new ef(l,e,n,s,i,r,o))}})}}const rl=t=>{const e=`Openreplay: Can't find ${t} in global context.`;console.warn(e)};function nf(t,e,n,s,i,r,o={xhr:!0,fetch:!0,beacon:!0},a){var l;if(t&&(o.xhr&&(t.XMLHttpRequest?t.XMLHttpRequest=tf.create(e,n,s,i,r,a):rl("XMLHttpRequest")),o.fetch&&(t.fetch?t.fetch=$d.create(e,n,s,i,r,a):rl("fetch")),o.beacon&&!((l=t.navigator)===null||l===void 0)&&l.sendBeacon)){const u=t.navigator.sendBeacon;t.navigator.sendBeacon=Jd.create(u,e,n,s,i,r)}}function wr(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function ol(t){return typeof t=="string"?t.toUpperCase():"GET"}function sf(t,e={}){const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0},e);n.useProxy===!1&&t.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const s=n.ignoreHeaders,i=Array.isArray(s)?c=>s.includes(c):()=>s,r=n.sessionTokenHeader===!0?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function o(c){if(r){const h=t.getSessionToken();h&&t.safe(c)(r,h)}}function a(c){if(n.capturePayload||(delete c.request.body,delete c.response.body),n.sanitizer){const h=c.response.body;if(typeof h=="string")try{c.response.body=JSON.parse(h)}catch{}return n.sanitizer(c)}return c}function l(c){if(c&&typeof c.body!="string")try{c.body=JSON.stringify(c.body)}catch{c.body="<unable to stringify>",t.notify.warn("Openreplay fetch couldn't stringify body:",c.body)}return JSON.stringify(c)}const u=c=>{if(n.useProxy)return nf(c,n.ignoreHeaders,o,a,I=>{t.send(Ws(I.requestType,I.method,I.url,I.request,I.response,I.status,I.startTime+On(),I.duration,I.responseSize))},I=>t.isServiceURL(I),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const h=c.fetch.bind(c),d=(I,g={})=>{if(!(typeof I=="string"||I instanceof URL)||t.isServiceURL(String(I)))return h(I,g);o(function(_,k){g.headers===void 0&&(g.headers={}),g.headers instanceof Headers?g.headers.append(_,k):Array.isArray(g.headers)?g.headers.push([_,k]):g.headers[_]=k});const b=performance.now();return h(I,g).then(_=>{const k=performance.now()-b;if(n.failuresOnly&&_.status<400)return _;const y=_.clone();return y.text().then(E=>{const P={},j={};if(s!==!0){const U=([B,Y])=>{i(B)||(P[B]=Y)};g.headers instanceof Headers?g.headers.forEach((B,Y)=>U([Y,B])):Array.isArray(g.headers)?g.headers.forEach(U):typeof g.headers=="object"&&Object.entries(g.headers).forEach(U),y.headers.forEach((B,Y)=>{i(Y)||(j[Y]=B)})}const L=ol(g.method),J=a({url:String(I),method:L,status:y.status,request:{headers:P,body:g.body||null},response:{headers:j,body:E}});J&&t.send(Ws("fetch",L,String(J.url),l(J.request),l(J.response),y.status,b+On(),k,0))}).catch(E=>t.debug.error("Could not process Fetch response:",E)),_})};c.fetch=d;const p=c.XMLHttpRequest.prototype.open,f=c.XMLHttpRequest.prototype.setRequestHeader,m=c.XMLHttpRequest.prototype.send;function S(I,g){const b=this;o((k,y)=>b.setRequestHeader(k,y));let _=0;return b.addEventListener("loadstart",k=>{_=k.timeStamp}),b.addEventListener("load",t.safe(k=>{const{headers:y,body:E}=wr(b),P=_>0?k.timeStamp-_:0,L=(b.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),J={};L.forEach(function(Y){const ee=Y.split(": "),R=ee.shift();i(R)||(J[R]=ee.join(": "))});const U=ol(I),B=a({url:String(g),method:U,status:b.status,request:{headers:y,body:E||null},response:{headers:J,body:b.response}});B&&t.send(Ws("xhr",U,String(B.url),l(B.request),l(B.response),b.status,_+On(),P,0))})),p.apply(this,arguments)}function T(I){const g=wr(this);return g.body=I,m.apply(this,arguments)}function x(I,g){if(!i(I)){const b=wr(this);b.headers[I]=g}return f.apply(this,arguments)}n.axiosInstances||(c.XMLHttpRequest.prototype.open=S,c.XMLHttpRequest.prototype.send=T,c.XMLHttpRequest.prototype.setRequestHeader=x)};u(window),n.axiosInstances&&n.axiosInstances.forEach(c=>{Hd(t,c,n,a,l)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function rf(t){t.attachEventListener(document,"selectionchange",()=>{const e=document.getSelection();if(e!==null&&!e.isCollapsed){const n=t.nodes.getID(e.anchorNode),s=t.nodes.getID(e.focusNode),i=e.toString().replace(/\s+/g," ");n&&s&&t.send(ya(n,s,i))}else t.send(ya(-1,-1,""))})}function of(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(zs(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const ei="/installation/javascript-sdk";function af(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Fs}${ei}`),!1;if(typeof t.projectKey!="string")if(typeof t.projectKey!="number"){if(typeof t.projectID!="number")return console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check ${Fs}${ei} for more information.`),!1;t.projectKey=t.projectID.toString(),qt("`projectID` option","`projectKey` option",ei)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&qt("`sessionToken` option","`sessionHash` start() option","/"),!0}const lf=()=>{try{return!!window.top}catch{return!1}};class cf{constructor(e){var a,l;if(this.options=e,this.app=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&(navigator.doNotTrack=="1"||window.doNotTrack=="1"),this.signalStartIssue=(u,c)=>{const h=this.checkDoNotTrack(),d=new XMLHttpRequest,p=this.options.ingestPoint||Fa;d.open("POST",p+"/v1/web/not-started"),d.send(JSON.stringify({trackerVersion:"14.0.14",projectKey:this.options.projectKey,doNotTrack:h,reason:c.length?`missing api: ${c.join(",")}`:u}))},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.handleError=(u,c={})=>{if(this.app!==null){if(u instanceof Error){const h=Ks(u,[],c);this.app.send(h)}else if(u instanceof ErrorEvent||"PromiseRejectionEvent"in window&&u instanceof PromiseRejectionEvent){const h=qa(u,void 0,c);h!=null&&this.app.send(h)}}},this.crossdomainMode=!!(la()&&((a=e.crossdomain)!=null&&a.enabled)),!ht||!af(e)){console.error("OpenReplay: tracker called in a non-browser environment or with invalid options");return}if(window.__OPENREPLAY__||!this.crossdomainMode&&la()&&lf()&&((l=window.top)!=null&&l.__OPENREPLAY__)){console.error("OpenReplay: one tracker instance has been initialised already");return}if(!e.__DISABLE_SECURE_MODE&&location.protocol!=="https:"){console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.");return}const n=this.checkDoNotTrack(),s=[],i=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(n)s.push("doNotTrack");else for(const u of i)if(u==="timing"){if("performance"in window&&!(u in performance)){s.push(u);break}}else if(u==="startsWith"){if(!(u in String.prototype)){s.push(u);break}}else if(!(u in window)){s.push(u);break}if(s.length>0){const u=s.join(",");console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${u}`),this.signalStartIssue("missing_api",s);return}const r=new Kh(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(Bd(r),Xh(r),nh(r,e),of(r)),Od(r,e.mouse),Ld(r,this.crossdomainMode),zd(r),Wd(r),Zh(r,e),dd(r,e),gd(r),yd(r,e),Pd(r,e),jd(r),Ud(r),sf(r,e.network),rf(r),window.__OPENREPLAY__=this,e.flags&&e.flags.onFlagsLoad&&this.onFlagsLoad(e.flags.onFlagsLoad);const o=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(r.attachStartCallback(()=>{const u=r.getTabId(),c=r.sessionStorage??window.sessionStorage;window.open=function(...h){return e.autoResetOnWindowOpen&&r.resetNextPageSession(!0),e.resetTabOnWindowOpen&&c.removeItem(e.session_tabid_key||"__openreplay_tabid"),r.resetNextPageSession(!1),c.setItem(e.session_tabid_key||"__openreplay_tabid",u),o.call(window,...h)}}),r.attachStopCallback(()=>{window.open=o}))}isFlagEnabled(e){return this.featureFlags.isFlagEnabled(e)}onFlagsLoad(e){var n;(n=this.app)==null||n.featureFlags.onFlagsLoad(e)}clearPersistFlags(){var e;(e=this.app)==null||e.featureFlags.clearPersistFlags()}reloadFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.reloadFlags()}getFeatureFlag(e){var n;return(n=this.app)==null?void 0:n.featureFlags.getFeatureFlag(e)}getAllFeatureFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.flags}use(e){return e(this.app,this.options)}isActive(){return this.app===null?!1:this.app.active()}trackWs(e){if(this.app!==null)return this.app.trackWs(e)}start(e){return this.browserEnvCheck()?this.app===null?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):this.app.start(e):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return ht?!0:(console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${Fs}${ei}`),!1)}coldStart(e,n){if(this.browserEnvCheck()){if(this.app===null)return Promise.reject("Tracker not initialized");this.app.coldStart(e,n)}else return Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,n){return this.browserEnvCheck()?this.app===null?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,n):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(this.app!==null)return this.app.uploadOfflineRecording()}stop(){if(this.app!==null)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){this.app!==null&&this.app.forceFlushBatch()}getSessionToken(){return this.app===null?null:this.app.getSessionToken()}getSessionInfo(){return this.app===null?null:this.app.session.getInfo()}getSessionID(){return this.app===null?null:this.app.getSessionID()}getTabId(){return this.app===null?null:this.app.getTabId()}getUxId(){return this.app===null?null:this.app.getUxtId()}sessionID(){return qt("'sessionID' method","'getSessionID' method","/"),this.getSessionID()}getSessionURL(e){if(this.app!==null)return this.app.getSessionURL(e)}setUserID(e){typeof e=="string"&&this.app!==null&&this.app.session.setUserID(e)}userID(e){qt("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(ju(e))}userAnonymousID(e){qt("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,n){typeof e=="string"&&typeof n=="string"&&this.app!==null&&this.app.session.setMetadata(e,n)}metadata(e,n){qt("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,n)}event(e,n=null,s=!1){if(typeof e=="string"&&this.app!==null){if(s)return this.issue(e,n);try{n=JSON.stringify(n)}catch{return}this.app.send(Wu(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(Ku(e,n))}}}function uf(t){return{id:String(t.ID),appellation:t.Appellation||null,country:t.Country||null,grape:t.Grape,image:t.Image,price:Number(t.Price),producer:t.Producer||null,region:t.Region,score:t.Score?Number(t.Score):null,shortDescription:t["Short Description"]||null,store:t.Store,storeId:t.Store_id||null,tags:Array.isArray(t.Tags)?t.Tags.map(String):[],title:t.Title,type:t.Type,url:t.Url||null,vintage:t.Vintage?Number(t.Vintage):null,pairingRecommendation:t.pairing_recommendation||null,total:t.Total?Number(t.Total):null,itemId:t.item_id||null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null}}function hf(t){return{id:String(t.id),title:String(t.title),description:String(t.description),region:String(t.region),price:Number(t.price),grape:String(t.grape),appellation:t.appellation?String(t.appellation):null,url:t.url?String(t.url):null,store:String(t.store),storeId:t.storeId?String(t.storeId):null,image:String(t.image),country:t.country?String(t.country):null,vintage:t.vintage?Number(t.vintage):null,tags:Array.isArray(t.tags)?t.tags.map(String):[],score:t.score?Number(t.score):null,total:t.total?Number(t.total):null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null,distance:Number(t.distance),reason:String(t.reason),type:String(t.type)}}class df{constructor(e,n="1"){q(this,Vn,"https://api.wineater.com/");q(this,pn);q(this,Gn);W(this,pn,e),W(this,Gn,n)}async getInstantRecommendations(){try{const e=w(this,Gn)==="2"?"dish/recommendations/instant/v2":"dish/recommendations/instant",n=await fetch(`${w(this,Vn)}${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,pn)}`}}),s=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${s.message||"No additional error information"}`);return s.filter(Boolean).map(uf)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=w(this,Gn)==="2"?"dish/recommendations/search/v2":"dish/recommendations/search",s=await fetch(`${w(this,Vn)}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,pn)}`},body:JSON.stringify({text:e})}),i=await s.json();if(!s.ok)throw new Error(`API call failed with status ${s.status}: ${i.message||"No additional error information"}`);return i.filter(Boolean).map(hf)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${w(this,Vn)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,pn)}`}});if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return await e.json()}catch(e){throw console.error("Error fetching store configuration:",e),e}}}Vn=new WeakMap,pn=new WeakMap,Gn=new WeakMap;const ff=((fl=window==null?void 0:window.wineaterData)==null?void 0:fl.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",pf=String(((pl=window==null?void 0:window.wineaterData)==null?void 0:pl.apiVersion)||"1"),br=new df(ff,pf),pt={WIDGET_INITIALIZED:"widget_initialized",WIDGET_LOADED:"widget_loaded",SEARCH_PERFORMED:"search_performed",SEARCH_RESULTS_DISPLAYED:"search_results_displayed",NO_RESULTS_FOUND:"no_results_found",WINE_CARD_HOVER:"wine_card_hover",WINE_CARD_CLICK:"wine_card_click",WINE_DETAILS_VIEWED:"wine_details_viewed",WINE_DETAILS_CLOSED:"wine_details_closed",BUY_BUTTON_CLICKED:"buy_button_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},gf={fr:{lang:"fr",welcomeMessage:"Quel plat allez-vous déguster ? Décrivez-le-moi et je vous proposerai le vin qui l'accompagnera parfaitement.",noResultsFound:"Aucun résultat trouvé.",somethingWentWrong:"Désolé, quelque chose a mal tourné.",chatButton1:"Trouvez l'accord parfait",chatButton2:"Associez le vin",chatButton3:"Obtenez des conseils",chatTitle:"Accord Mets & Vins 🍷",chatSubtitle:"Décrivez votre plat et obtenez une recommandation en 30 secondes",inputPlaceholder:"ex., Salade de thon",sendButton:"Accorder",poweredBy:"Propulsé par",price:"Prix",region:"Région",type:"Type",reason:"Suggestion",moreInfo:"Plus d'infos",winePairingIntro:"Pour ce vin, voici quelques suggestions de plats :",askForDinner:"Que voulez-vous manger ce soir?",clearChatButton:"Effacer le chat",widgetTitle:"TROUVEZ VOTRE VIN PARFAIT",widgetSubtitle:"Partagez tout ce que vous avez en tête—votre repas, humeur, budget ou occasion—et notre sommelier IA vous recommandera le vin parfait en quelques secondes",searchPlaceholder:"Entrez un mot-clé ou une description","wineDetails.reason":"Raison","wineDetails.price":"Prix","wineDetails.region":"Région","wineDetails.type":"Type","wineDetails.moreInfo":"Plus d'infos","wineDetails.code":"Code","wineDetails.buy":"Acheter",searchButton:"Rechercher",priceRange:"Gamme de prix",wineColor:"Couleur du vin",intensity:"Intensité",red:"Rouge",white:"Blanc",rose:"Rosé",light:"Léger",medium:"Moyen",full:"Puissant",barTitle:"Sélection du bar",barSubtitle:"Choisissez vos plats ci-dessous et cliquez sur «Envoyer»",barSendButton:"Envoyer",barResetButton:"Réinitialiser",barName:"Nom du bar",barNotesPlaceholder:"Entrez vos souhaits ici...",placeholderSuggestions:["Vin pour les pâtes","Parfait avec du poisson","Recommandé pour une soirée"],headerLine1:"Partagez tout ce qui vous passe par la tête —",headerLine2:"— et obtenez des recommandations de vin parfait en quelques secondes",headerMeal:"repas",headerMood:"humeur",headerBudget:"budget",headerOccasion:"occasion",headerOr:"ou",errorMessage:"Une erreur est survenue. Veuillez réessayer plus tard.",noResultsMessage:"Aucun résultat trouvé pour votre recherche. Veuillez essayer une autre requête.",ai_sommelier:"AI sommelier"},es:{lang:"es",welcomeMessage:"¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",noResultsFound:"No se encontraron resultados.",somethingWentWrong:"Lo sentimos, algo salió mal.",chatButton1:"Encuentra tu maridaje",chatButton2:"Combina vino ya",chatButton3:"Recibe asesoría ahora",chatTitle:"Maridaje de Vinos 🍷",chatSubtitle:"Describe tu comida y obtén una recomendación en 30 segundos",inputPlaceholder:"ej., Ensalada de atún",sendButton:"Combinar",poweredBy:"Desarrollado por",price:"Precio",region:"Región",type:"Tipo",reason:"Sugerencia",moreInfo:"Más info",winePairingIntro:"Para este vino, aquí tienes algunas sugerencias de platos:",askForDinner:"¿Qué te gustaría cenar?",clearChatButton:"Limpiar el chat",widgetTitle:"ENCUENTRA TU VINO PERFECTO",widgetSubtitle:"Comparte cualquier cosa que tengas en mente—tu comida, estado de ánimo, presupuesto o evento—y nuestro sommelier de IA te recomendará el vino perfecto en segundos",searchPlaceholder:"Escribe una palabra clave o descripción","wineDetails.reason":"Razón","wineDetails.price":"Precio","wineDetails.region":"Región","wineDetails.type":"Tipo","wineDetails.code":"Código","wineDetails.moreInfo":"Más información","wineDetails.buy":"Comprar",searchButton:"Buscar",priceRange:"Rango de precios",wineColor:"Color del vino",intensity:"Intensidad",red:"Tinto",white:"Blanco",rose:"Rosado",light:"Ligero",medium:"Medio",full:"Intenso",barTitle:"Platos de Bar",barSubtitle:"Selecciona de la lista y presiona «Enviar»",barSendButton:"Enviar",barResetButton:"Reiniciar",barName:"Nombre del bar",barNotesPlaceholder:"Agrega tus comentarios aquí...",placeholderSuggestions:["Vino para pasta","Perfecto con pescado","Recomendado para una fiesta"],headerLine1:"Comparte cualquier cosa que tengas en mente —",headerLine2:"— y obtén recomendaciones del vino perfecto en cuestión de segundos",headerMeal:"comida",headerMood:"estado de ánimo",headerBudget:"presupuesto",headerOccasion:"ocasión",headerOr:"o",errorMessage:"Algo salió mal. Por favor, inténtalo de nuevo más tarde.",noResultsMessage:"No se encontraron resultados para tu búsqueda. Por favor, intenta con otra consulta.",ai_sommelier:"AI sommelier"},en:{lang:"en",welcomeMessage:"What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",noResultsFound:"No results found.",somethingWentWrong:"Sorry, something went wrong.",chatButton1:"Find Your Pairing",chatButton2:"Pair Wine Now",chatButton3:"Get Wine Advice",chatTitle:"Wine Pairing Assistant 🍷",chatSubtitle:"Describe your meal and get a recommendation in 30 seconds",inputPlaceholder:"e.g., Tuna salad",sendButton:"Match",poweredBy:"Powered by",price:"Price",region:"Region",type:"Type",reason:"Suggestion",moreInfo:"More info",winePairingIntro:"For this wine, here are some suggested dishes:",askForDinner:"What would you like to have for dinner?",clearChatButton:"Clear Chat",widgetTitle:"FIND YOUR PERFECT WINE",widgetSubtitle:"Share anything on your mind—your meal, mood, budget, or occasion—and our AI sommelier will recommend the perfect wine in seconds",searchPlaceholder:"Enter a keyword or description","wineDetails.price":"Price","wineDetails.region":"Region","wineDetails.type":"Type","wineDetails.moreInfo":"More info","wineDetails.reason":"Reason","wineDetails.code":"Code","wineDetails.buy":"Buy",searchButton:"Search",priceRange:"Price Range",wineColor:"Wine Color",intensity:"Intensity",red:"Red",white:"White",rose:"Rosé",light:"Light",medium:"Medium",full:"Full",barTitle:"Bar Dishes",barSubtitle:"Select dishes below and click 'Send'",barSendButton:"Send",barResetButton:"Reset",barName:"Bar Name",barNotesPlaceholder:"Add your wishes here...",placeholderSuggestions:["Wine for pasta","Perfect with fish","Recommended for a party"],headerLine1:"Share anything on your mind —",headerLine2:"— and get recommendations of the perfect wine in seconds",headerMeal:"meal",headerMood:"mood",headerBudget:"budget",headerOccasion:"occasion",headerOr:"or",errorMessage:"Something went wrong. Please try again later.",noResultsMessage:"No results found for your search. Please try a different query.",ai_sommelier:"AI sommelier"},sr:{lang:"sr",welcomeMessage:"Šta planirate da jedete? Podelite svoje jelo i preporučiću vam savršeno vino uz obrok.",noResultsFound:"Nema rezultata.",somethingWentWrong:"Izvinite, nešto je pošlo po zlu.",chatButton1:"Pronađi vino",chatButton2:"Upari vino sada",chatButton3:"Zatraži preporuku",chatTitle:"Asistent za uparivanje vina 🍷",chatSubtitle:"Opišite svoj obrok i dobijte preporuku za 30 sekundi",inputPlaceholder:"npr. Tuna salata",sendButton:"Upari",poweredBy:"Pokreće",price:"Cena",region:"Regija",type:"Tip",reason:"Preporuka",moreInfo:"Više informacija",winePairingIntro:"Za ovo vino, preporučuju se sledeća jela:",askForDinner:"Šta biste želeli za večeru?",clearChatButton:"Obriši razgovor",widgetTitle:"PRONAĐITE SAVRŠENO VINO",widgetSubtitle:"Podelite bilo šta — obrok, raspoloženje, budžet ili priliku — i naš AI somelijer će vam za par sekundi preporučiti vino",searchPlaceholder:"Unesite ključnu reč ili opis","wineDetails.price":"Cena","wineDetails.region":"Regija","wineDetails.type":"Tip","wineDetails.moreInfo":"Više informacija","wineDetails.reason":"Razlog","wineDetails.code":"Šifra","wineDetails.buy":"Kupi",searchButton:"Pretraga",priceRange:"Cenovni raspon",wineColor:"Boja vina",intensity:"Intenzitet",red:"Crveno",white:"Belo",rose:"Roze",light:"Lako",medium:"Srednje",full:"Puno",barTitle:"Jela iz bara",barSubtitle:"Izaberite jela ispod i kliknite 'Pošalji'",barSendButton:"Pošalji",barResetButton:"Resetuj",barName:"Naziv bara",barNotesPlaceholder:"Dodajte svoje želje ovde...",placeholderSuggestions:["Vino uz pastu","Savršeno uz ribu","Preporuka za žurku"],headerLine1:"Podelite bilo šta što vam je na umu —",headerLine2:"— i dobijte preporuke za savršeno vino za par sekundi",headerMeal:"obrok",headerMood:"raspoloženje",headerBudget:"budžet",headerOccasion:"prilika",headerOr:"ili",errorMessage:"Nešto je pošlo po zlu. Molimo pokušajte ponovo kasnije.",noResultsMessage:"Nema rezultata za vašu pretragu. Molimo pokušajte sa drugačijim upitom.",ai_sommelier:"AI sommelier"},de:{lang:"de",welcomeMessage:"Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",noResultsFound:"Keine Ergebnisse gefunden.",somethingWentWrong:"Entschuldigung, etwas ist schief gelaufen.",chatButton1:"Finde Dein Pairing",chatButton2:"Wein jetzt wählen",chatButton3:"Erhalte Weinberatung",chatTitle:"Wein & Speisen 🍷",chatSubtitle:"Beschreiben Sie Ihr Gericht und erhalten Sie in 30 Sekunden eine Empfehlung",inputPlaceholder:"z.B., Thunfischsalat",sendButton:"Kombinieren",poweredBy:"Unterstützt von",price:"Preis",region:"Region",type:"Typ",reason:"Anregung",moreInfo:"Mehr Info",winePairingIntro:"Für diesen Wein gibt es folgende Essensvorschläge:",askForDinner:"Was möchten Sie zum Abendessen essen?",clearChatButton:"Chat löschen",widgetTitle:"FINDEN SIE IHREN PERFEKTEN WEIN",widgetSubtitle:"Teilen Sie alles, was Ihnen in den Sinn kommt—Ihre Mahlzeit, Stimmung, Ihr Budget oder Anlass—und unser KI-Sommelier empfiehlt Ihnen in Sekunden den perfekten Wein",placeholderSuggestions:["Wein für Pasta","Perfekt zu Fisch","Empfohlen für eine Party"],searchPlaceholder:"Geben Sie ein Stichwort oder eine Beschreibung ein","wineDetails.price":"Preis","wineDetails.region":"Region","wineDetails.type":"Typ","wineDetails.moreInfo":"Mehr Info","wineDetails.reason":"Grund","wineDetails.code":"Code","wineDetails.buy":"Kaufen",searchButton:"Suche",priceRange:"Preisspanne",wineColor:"Weinfarbe",intensity:"Intensität",red:"Rot",white:"Weiß",rose:"Rosé",light:"Leicht",medium:"Mittel",full:"Voll",barTitle:"Bar-Auswahl",barSubtitle:"Wählen Sie Ihre Gerichte und klicken Sie auf 'Senden'",barSendButton:"Senden",barResetButton:"Zurücksetzen",barName:"Name der Bar",headerLine1:"Teilen Sie alles, was Ihnen durch den Kopf geht —",headerLine2:"— und erhalten Sie in Sekundenschnelle Empfehlungen für den perfekten Wein",headerMeal:"Mahlzeit",headerMood:"Stimmung",headerBudget:"Budget",headerOccasion:"Anlass",headerOr:"oder",errorMessage:"Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut.",noResultsMessage:"Keine Ergebnisse für Ihre Suche gefunden. Bitte versuchen Sie es mit einer anderen Anfrage.",ai_sommelier:"AI sommelier"},ukr:{lang:"ukr",welcomeMessage:"Що ви збираєтесь їсти? Опишіть свою страву, і я порекомендую вам ідеальне вино.",noResultsFound:"Результатів не знайдено.",somethingWentWrong:"Вибачте, щось пішло не так.",chatButton1:"Знайти ідеальне поєднання",chatButton2:"Підібрати вино",chatButton3:"Отримати пораду",chatTitle:"Сомельє-помічник 🍷",chatSubtitle:"Опишіть свою страву і отримайте рекомендацію за 30 секунд",inputPlaceholder:"наприклад, Тунець із салатом",sendButton:"Підібрати",poweredBy:"Розроблено на основі",price:"Ціна",region:"Регіон",type:"Тип",reason:"Рекомендація",moreInfo:"Докладніше",winePairingIntro:"До цього вина підходять такі страви:",askForDinner:"Що ви хочете на вечерю?",clearChatButton:"Очистити чат",widgetTitle:"ЗНАЙДІТЬ ІДЕАЛЬНЕ ВИНО",widgetSubtitle:"Поділіться тим, що у вас на думці—їжа, настрій, бюджет чи подія—і наш AI-сомельє порекомендує вам ідеальне вино за секунди",searchPlaceholder:"Введіть ключове слово або опис","wineDetails.reason":"Причина","wineDetails.price":"Ціна","wineDetails.region":"Регіон","wineDetails.type":"Тип","wineDetails.moreInfo":"Докладніше","wineDetails.code":"Код","wineDetails.buy":"Купити",searchButton:"Пошук",priceRange:"Діапазон цін",wineColor:"Колір вина",intensity:"Інтенсивність",red:"Червоне",white:"Біле",rose:"Рожеве",light:"Легке",medium:"Середнє",full:"Повне",barTitle:"Закуски до вина",barSubtitle:"Виберіть страви нижче та натисніть «Надіслати»",barSendButton:"Надіслати",barResetButton:"Скинути",barName:"Назва бару",barNotesPlaceholder:"Додайте ваші побажання тут...",placeholderSuggestions:["Вино до пасти","Ідеально до риби","Рекомендуємо для вечірки"],headerLine1:"Поділіться будь-якими вашими думками —",headerLine2:"— і отримайте рекомендації щодо ідеального вина за секунди",headerMeal:"страва",headerMood:"настрій",headerBudget:"бюджет",headerOccasion:"подія",headerOr:"або",errorMessage:"Щось пішло не так. Будь ласка, спробуйте пізніше.",noResultsMessage:"За вашим запитом не знайдено результатів. Спробуйте інший запит.",ai_sommelier:"AI sommelier"},ru:{lang:"ru",welcomeMessage:"Что вы планируете поесть? Напишите ваше блюдо, и я подберу идеальное вино к нему.",noResultsFound:"Результаты не найдены.",somethingWentWrong:"Извините, что-то пошло не так.",chatButton1:"Найти сочетание",chatButton2:"Подобрать вино",chatButton3:"Получить совет",chatTitle:"Ассистент по подбору вина 🍷",chatSubtitle:"Опишите ваше блюдо и получите рекомендацию за 30 секунд",inputPlaceholder:"например, Тунец с салатом",sendButton:"Подобрать",poweredBy:"Powered by",price:"Цена",region:"Регион",type:"Тип",reason:"Рекомендация",moreInfo:"Подробнее",winePairingIntro:"К этому вину подходят следующие блюда:",askForDinner:"Что бы вы хотели на ужин?",clearChatButton:"Очистить чат",widgetTitle:"НАЙДИТЬ ИДЕАЛЬНОЕ ВИНО",widgetSubtitle:"Поделитесь вашими предпочтениями — блюдом, настроением, бюджетом или случаем — и наш AI-сомелье подберёт идеальное вино за секунды",searchPlaceholder:"Введите ключевое слово или описание","wineDetails.price":"Цена","wineDetails.region":"Регион","wineDetails.type":"Тип","wineDetails.moreInfo":"Подробнее","wineDetails.reason":"Причина","wineDetails.code":"Код","wineDetails.buy":"Купить",searchButton:"Поиск",priceRange:"Диапазон цен",wineColor:"Цвет вина",intensity:"Интенсивность",red:"Красное",white:"Белое",rose:"Розовое",light:"Лёгкое",medium:"Среднее",full:"Полное",barTitle:"Закуски к вину",barSubtitle:"Выберите блюда ниже и нажмите 'Отправить'",barSendButton:"Отправить",barResetButton:"Сбросить",barName:"Название бара",barNotesPlaceholder:"Добавьте ваши пожелания здесь...",placeholderSuggestions:["Вино для пасты","Идеально к рыбе","Рекомендуем для вечеринки"],headerLine1:"Поделитесь любыми вашими мыслями —",headerLine2:"— и получите рекомендации по идеальному вину за считанные секунды",headerMeal:"блюдо",headerMood:"настроение",headerBudget:"бюджет",headerOccasion:"случай",headerOr:"или",errorMessage:"Что-то пошло не так. Пожалуйста, попробуйте позже.",noResultsMessage:"По вашему запросу не найдено результатов. Попробуйте другой запрос.",ai_sommelier:"AI sommelier"},kk:{lang:"kk",welcomeMessage:"Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",noResultsFound:"Нәтижелер табылмады.",somethingWentWrong:"Кешіріңіз, бірдеңе дұрыс болмады.",chatButton1:"Сәйкестік табу",chatButton2:"Шарап таңдау",chatButton3:"Кеңес алу",chatTitle:"Шарап таңдаушы көмекші 🍷",chatSubtitle:"Тағамыңызды сипаттаңыз — 30 секундта ұсыныс алыңыз",inputPlaceholder:"мысалы, тунец салатымен",sendButton:"Таңдау",poweredBy:"Powered by",price:"Бағасы",region:"Өңір",type:"Түрі",reason:"Ұсыныс",moreInfo:"Толығырақ",winePairingIntro:"Бұл шарапқа келесі тағамдар сәйкес келеді:",askForDinner:"Кешкі асқа не қалайсыз?",clearChatButton:"Чатты тазалау",widgetTitle:"КЕРЕМЕТ ШАРАПТЫ ТАБЫҢЫЗ",widgetSubtitle:"Таңдауларыңызды бөлісіңіз — тағам, көңіл-күй, бюджет немесе жағдай — және біздің AI-сомелье сізге бірнеше секундта шарап ұсынады",searchPlaceholder:"Кілт сөзді немесе сипаттаманы енгізіңіз","wineDetails.price":"Бағасы","wineDetails.region":"Өңір","wineDetails.type":"Түрі","wineDetails.moreInfo":"Толығырақ","wineDetails.reason":"Себебі","wineDetails.code":"Код","wineDetails.buy":"Сатып алу",searchButton:"Іздеу",priceRange:"Баға диапазоны",wineColor:"Шарап түсі",intensity:"Қанықтылық",red:"Қызыл",white:"Ақ",rose:"Розалық",light:"Жеңіл",medium:"Орташа",full:"Толық",barTitle:"Шарапқа арналған тіскебасарлар",barSubtitle:"Төмендегі тағамдарды таңдаңыз және 'Жіберу' батырмасын басыңыз",barSendButton:"Жіберу",barResetButton:"Қалпына келтіру",barName:"Бар атауы",barNotesPlaceholder:"Мұнда өз тілектеріңізді жазыңыз...",placeholderSuggestions:["Пастаға арналған шарап","Балыққа тамаша үйлеседі","Кешке ұсынуға болады"],headerLine1:"Ойларыңызбен бөлісіңіз —",headerLine2:"— және бірнеше секундта мінсіз шарап ұсынысын алыңыз",headerMeal:"тағам",headerMood:"көңіл-күй",headerBudget:"бюджет",headerOccasion:"жағдай",headerOr:"немесе",errorMessage:"Бірдеңе дұрыс болмады. Кейінірек қайта көріңіз.",noResultsMessage:"Іздеуіңізге сәйкес нәтиже табылмады. Басқа сұрау қолданып көріңіз.",ai_sommelier:"AI sommelier"},pt:{lang:"pt",welcomeMessage:"O que você planeja comer? Descreva seu prato e eu recomendarei a harmonização perfeita.",noResultsFound:"Nenhum resultado encontrado.",somethingWentWrong:"Desculpe, algo deu errado.",chatButton1:"Encontre sua harmonização",chatButton2:"Harmonizar vinho agora",chatButton3:"Receber conselho de vinho",chatTitle:"Assistente de Harmonização de Vinhos 🍷",chatSubtitle:"Descreva sua refeição e receba uma recomendação em 30 segundos",inputPlaceholder:"ex., Salada de atum",sendButton:"Harmonizar",poweredBy:"Desenvolvido por",price:"Preço",region:"Região",type:"Tipo",reason:"Sugestão",moreInfo:"Mais informações",winePairingIntro:"Para este vinho, aqui estão algumas sugestões de pratos:",askForDinner:"O que você gostaria de jantar?",clearChatButton:"Limpar chat",widgetTitle:"ENCONTRE SEU VINHO PERFEITO",widgetSubtitle:"Compartilhe o que tiver em mente — sua refeição, humor, orçamento ou ocasião — e nosso sommelier de IA recomendará o vinho perfeito em segundos",searchPlaceholder:"Digite uma palavra-chave ou descrição","wineDetails.reason":"Motivo","wineDetails.price":"Preço","wineDetails.region":"Região","wineDetails.type":"Tipo","wineDetails.moreInfo":"Mais informações","wineDetails.code":"Código","wineDetails.buy":"Comprar",searchButton:"Pesquisar",priceRange:"Faixa de preço",wineColor:"Cor do vinho",intensity:"Intensidade",red:"Tinto",white:"Branco",rose:"Rosé",light:"Leve",medium:"Médio",full:"Encorpado",barTitle:"Pratos do bar",barSubtitle:"Selecione os pratos abaixo e clique em 'Enviar'",barSendButton:"Enviar",barResetButton:"Resetar",barName:"Nome do bar",barNotesPlaceholder:"Adicione seus desejos aqui...",placeholderSuggestions:["Vinho para massa","Perfeito com peixe","Recomendado para uma festa"],headerLine1:"Compartilhe o que tiver em mente —",headerLine2:"— e receba recomendações do vinho perfeito em segundos",headerMeal:"refeição",headerMood:"humor",headerBudget:"orçamento",headerOccasion:"ocasião",headerOr:"ou",errorMessage:"Algo deu errado. Por favor, tente novamente mais tarde.",noResultsMessage:"Nenhum resultado encontrado para sua pesquisa. Por favor, tente uma consulta diferente.",ai_sommelier:"AI sommelier"}};function mf(t){return{id:String(t.id),lang:t.lang,available_languages:t.available_languages?t.available_languages:[t.lang],open_ai_key:t.open_ai_key??null,currency:t.currency,title:t.title}}const vf={0:{logoUrl:null,brandColor:"#7B2BEB"},29:{logoUrl:"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/plou_logo.jpg",brandColor:"#e6c6bb"},25:{logoUrl:null,brandColor:"#000000",wineaterColor:"#000000",buttonUppercase:!0,customCss:`
|
|
20
20
|
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;600;700&display=swap');
|
|
21
21
|
:root { --wineater-font-primary: 'Roboto', sans-serif; }
|
|
22
22
|
#wr-Custom {
|
|
@@ -65,7 +65,20 @@ We appreciate your time and valuable input.`),r=q("div","end_button_or",Ta,"Subm
|
|
|
65
65
|
box-shadow: none;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
`,translations:{fr:{"wineDetails.buy":"voir plus"}}},21:{logoUrl:"https://www.intermarche.com/images/logoIntermarche.svg",brandColor:"#B81242",wineaterColor:"#
|
|
68
|
+
`,translations:{fr:{"wineDetails.buy":"voir plus"}}},21:{logoUrl:"https://www.intermarche.com/images/logoIntermarche.svg",brandColor:"#B81242",wineaterColor:"#B81242",buttonUppercase:!0,customCss:`
|
|
69
|
+
#wr-Custom {
|
|
70
|
+
.wr-Search-icon {
|
|
71
|
+
background-image: none;
|
|
72
|
+
-webkit-mask-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/search.svg?x=1');
|
|
73
|
+
mask-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/search.svg?x=1');
|
|
74
|
+
-webkit-mask-repeat: no-repeat;
|
|
75
|
+
mask-repeat: no-repeat;
|
|
76
|
+
-webkit-mask-size: contain;
|
|
77
|
+
mask-size: contain;
|
|
78
|
+
background-color: #B81242;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`,translations:{}},26:{logoUrl:"https://paladarlondon.com/wp-content/uploads/2021/05/cropped-cropped-Paladar-Logo-1473x464-min-768x219.png",brandColor:"#B81242",wineaterColor:"#7B2BEB",buttonUppercase:!0,customCss:"",translations:{}},28:{logoUrl:"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/ryba_moya.png",brandColor:"#de4e2a",wineaterColor:"#de4e2a",buttonUppercase:!0,customCss:`
|
|
69
82
|
#wr-Custom {
|
|
70
83
|
.wr-Search-icon {
|
|
71
84
|
background-image: none;
|
|
@@ -78,7 +91,7 @@ We appreciate your time and valuable input.`),r=q("div","end_button_or",Ta,"Subm
|
|
|
78
91
|
background-color: #de4e2a;
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
|
-
`,translations:{}},30:{logoUrl:null,brandColor:"#8bae98",wineaterColor:"#8bae98",customCss:`
|
|
94
|
+
`,translations:{}},30:{logoUrl:null,brandColor:"#8bae98",wineaterColor:"#8bae98",titleText:"Looking for the perfect bottle? Ask our AI Sommelier for personalised recommendations, whatever the meal, mood or occasion.",customCss:`
|
|
82
95
|
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap');
|
|
83
96
|
:root { --wineater-font-primary: 'Montserrat', Verdana, Helvetica, Arial, sans-serif; }
|
|
84
97
|
#wr-Custom {
|
|
@@ -104,10 +117,10 @@ We appreciate your time and valuable input.`),r=q("div","end_button_or",Ta,"Subm
|
|
|
104
117
|
background-color: #8bae98;
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
|
-
`}};function
|
|
120
|
+
`}};function wf(t){const e={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
|
|
108
121
|
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
|
|
109
122
|
:root { --wineater-font-primary: 'Bricolage Grotesque', serif; }
|
|
110
|
-
`},n=
|
|
123
|
+
`},n=vf[t]||{};return{...e,...n}}let de=at({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const me={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(de==null?void 0:de.currentLanguage)??"en"},getStoreLanguage(){var t;return((t=de.storeConfig)==null?void 0:t.lang)??null},getApiKey(){var t;return((t=de.storeConfig)==null?void 0:t.open_ai_key)??null},getStoreId(){var t;return((t=de.storeConfig)==null?void 0:t.id)??null},setStoreLanguage(t){if(de.storeConfig&&de.storeConfig.available_languages.includes(t)){de.currentLanguage=t;const e=new URLSearchParams(window.location.search);e.set("lang",t);const n=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",n)}else throw new Error(`Language ${t} is not available in store configuration.`)},getSupportedLanguages(){var t;return((t=de.storeConfig)==null?void 0:t.available_languages)??["en"]},getCurrency(){var t;return((t=de.storeConfig)==null?void 0:t.currency)??"USD"},async initializeStore(){try{const t=await br.getStoreConfig();de.storeConfig=mf(t),de.currentLanguage=de.storeConfig.lang;const e=this.getLanguageFromURL();e&&de.storeConfig.available_languages.includes(e)?this.setStoreLanguage(e):this.setStoreLanguage(de.storeConfig.lang),this.setUiConfig(wf(de.storeConfig.id)),de.isConfigLoaded=!0}catch(t){console.error("Failed to initialize store:",t),de.isConfigLoaded=!1}},isInitialized(){return de.isConfigLoaded},getUiConfig(){return de.uiConfig},setUiConfig(t){de.uiConfig=t}},bf={en:"en-US",de:"de-DE",fr:"fr-FR",es:"es-ES",it:"it-IT",ja:"ja-JP",zh:"zh-CN",ru:"ru-RU",kk:"kk-KZ",pt:"pt-PT"};function yf(t,e,n="en"){try{return new Intl.NumberFormat(bf[n]||"en-US",{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).format(t)}catch{return t.toString()}}function Ne({key:t,lang:e}){const n=gf,s=me.getUiConfig(),i=(s==null?void 0:s.translations)||{};if(i[e]&&i[e][t])return i[e][t];if(n[e]&&n[e][t])return n[e][t];throw new Error(`Translation for key "${t}" not found in language "${e}".`)}async function Sf({sourceLang:t,targetLang:e,texts:n,apiKey:s}){var u,c,h,d;if(!s||!t||!e||t===e)return n;const i="https://api.openai.com/v1/chat/completions",r={"Content-Type":"application/json",Authorization:`Bearer ${s}`},o=Object.entries(n).map(([p,f])=>({key:p,text:f})),a=`
|
|
111
124
|
You are a professional translator.
|
|
112
125
|
|
|
113
126
|
The input texts are written in language with code "${t}". Your task is to translate them strictly to the target language with code "${e}".
|
|
@@ -132,18 +145,18 @@ Output:
|
|
|
132
145
|
|
|
133
146
|
Now translate the following input:
|
|
134
147
|
${JSON.stringify(o,null,2)}
|
|
135
|
-
`,
|
|
148
|
+
`,l=JSON.stringify({model:"gpt-3.5-turbo",messages:[{role:"system",content:"You are a professional translator."},{role:"user",content:a}],temperature:.2,max_tokens:1e3});try{const f=await(await fetch(i,{method:"POST",headers:r,body:l})).json(),m=(d=(h=(c=(u=f==null?void 0:f.choices)==null?void 0:u[0])==null?void 0:c.message)==null?void 0:h.content)==null?void 0:d.trim();if(!m)throw new Error("No response from OpenAI");const S=JSON.parse(m),T={};return S.forEach(x=>{x.key&&x.text!==void 0&&(T[x.key]=x.text)}),{...n,...T}}catch(p){return console.error("Error translating texts:",p),n}}Zl();var _f=Ts('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M10.036 4.96326H28.2826L34.3648 14.0865L19.1593 33.8537L3.95381 14.0865L10.036 4.96326Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.6388 4.96326L13.0771 14.0865L19.1593 33.8537L25.2415 14.0865L20.6799 4.96326" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.95381 14.0867H34.3648" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function al(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=_f();G(()=>{jt(i,0,In(n())),Ce(i,"width",s()),Ce(i,"height",s())}),M(t,i)}var kf=Ts('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M29.533 21.4034C31.7986 19.1834 34.0946 16.5224 34.0946 13.0404C34.0946 10.8224 33.2135 8.69521 31.6451 7.12684C30.0768 5.55847 27.9496 4.67737 25.7316 4.67737C23.0554 4.67737 21.1699 5.43764 18.8891 7.71847C16.6083 5.43764 14.7228 4.67737 12.0467 4.67737C9.82865 4.67737 7.70148 5.55847 6.13311 7.12684C4.56474 8.69521 3.68364 10.8224 3.68364 13.0404C3.68364 16.5376 5.96446 19.1986 8.24528 21.4034L18.8891 32.0472L29.533 21.4034Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M18.8891 19.8829L17.3686 18.3623L20.4097 15.3212L15.848 10.7596L18.8891 7.71851" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function ll(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=kf();G(()=>{jt(i,0,In(n())),Ce(i,"width",s()),Ce(i,"height",s())}),M(t,i)}var Tf=Ts('<svg viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 17.655a3.801 3.801 0 1 0 0-7.602 3.801 3.801 0 0 0 0 7.602Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 3.97a9.884 9.884 0 0 0-9.458 6.995c-1.673 4.76-1.186 5.93-4.835 9.245a4.562 4.562 0 0 0 2.889 8.09c6.082 0 12.772-2.738 17.334-6.54a9.885 9.885 0 0 0-5.93-17.79Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="m28.693 10.053 3.33 6.842c.316.983.475 2.009.471 3.041a9.867 9.867 0 0 1-3.953 7.907c-4.562 3.801-11.252 6.538-17.334 6.538a4.562 4.562 0 0 1-4.075-2.524l-2.92-5.839"></path></svg>');function yr(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=Tf();G(()=>{jt(i,0,In(n())),Ce(i,"width",s()),Ce(i,"height",s())}),M(t,i)}var xf=Ts('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34" fill="none"><path d="M9.03846 17.0001C10.3456 12.1888 15.9077 8.65686 20.858 8.65686C25.8083 8.65686 29.2846 12.1888 30.5917 17.0001C29.2846 21.8252 25.8083 25.3432 20.858 25.3432C15.9077 25.3432 10.3456 21.8252 9.03846 17.0001Z" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M25.0296 17V17.6953" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2485 25.2457C20.4397 22.8774 19.4599 19.98 19.4599 16.9999C19.4599 14.0198 20.4397 11.1224 22.2485 8.75403" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.73372 15.1506C9.73372 11.4379 7.75916 8.6151 3.79615 7.96155C2.40562 10.0473 2.40562 14.9142 4.11597 17C2.39171 19.0858 2.39171 23.9527 3.79615 26.0385C7.75916 25.3849 9.73372 22.5621 9.73372 18.8494" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.545 10.4089C14.1834 8.48998 12.7512 6.20951 11.1243 4.48525H19.1893C19.8491 4.4828 20.4883 4.71502 20.9927 5.14042C21.497 5.56582 21.8337 6.15668 21.9426 6.80744L22.2624 8.75418" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2624 25.2459L21.9426 27.1926C21.8337 27.8434 21.497 28.4342 20.9927 28.8596C20.4883 29.285 19.8491 29.5172 19.1893 29.5148H13.2101C14.5573 27.9873 15.2948 26.0172 15.2819 23.9805" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function cl(t,e){let n=We(e,"className",8,""),s=We(e,"size",8,20);var i=xf();G(()=>{jt(i,0,In(n())),Ce(i,"width",s()),Ce(i,"height",s())}),M(t,i)}var Ef=V('<span><!></span><span class="wr-Header-label svelte-oiwvqb"> </span>',1),If=V('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),Cf=V('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),Nf=V('<h1 class="wr-Header-title svelte-oiwvqb"></h1>'),Rf=V('<h1 class="wr-Header-title svelte-oiwvqb"> <span><!></span> <span class="wr-Header-label svelte-oiwvqb"> </span>, <!> <span class="wr-Header-label svelte-oiwvqb"> </span> <br/> <!> <span class="wr-Header-label svelte-oiwvqb"> </span> </h1>'),Df=V('<div class="wr-Header"><!></div>');const Of={hash:"svelte-oiwvqb",code:`.wr-Header-title.svelte-oiwvqb {font-weight:600;font-size:24px;margin:0 auto;line-height:1.3;color:#333;text-align:center;
|
|
136
149
|
|
|
137
150
|
/* TODO: add wineater-color to svg */}.wr-Header-icon {display:inline-block;vertical-align:middle;color:var(--wr-wineater-color);}.wr-Header-label.svelte-oiwvqb {color:var(--wr-wineater-color);font-weight:500;}
|
|
138
151
|
|
|
139
152
|
@media screen and (max-width: 768px) {.wr-Header-title.svelte-oiwvqb {display:none;}
|
|
140
|
-
}`};function
|
|
153
|
+
}`};function Af(t,e){Dt(e,!0),zt(t,Of);let n=re(()=>me.getAppLanguage()),s=re(()=>me.getUiConfig()),i=re(()=>{var d,p;return((d=window==null?void 0:window.wineaterData)==null?void 0:d.TITLE_TEXT)||((p=v(s))==null?void 0:p.titleText)||null}),r=le(at(yr));function o(d){return d.split(/(meal|mood|occasion)/gi).map(p=>({keyword:/^(meal|mood|occasion)$/i.test(p)?p.toLowerCase():null,text:p}))}let a=re(()=>v(i)?o(v(i)):null);var l=Df(),u=O(l);{var c=d=>{var p=Nf();En(p,21,()=>v(a),xn,(f,m)=>{var S=Es(),T=Bt(S);{var x=_=>{var k=Ef(),y=Bt(k),E=O(y);Do(E,()=>v(r),(L,J)=>{J(L,{className:"wr-Header-icon",size:"28"})});var P=H(y),j=O(P);G(()=>$(j,v(m).text)),Tt("mouseenter",y,()=>D(r,cl,!0)),Tt("mouseleave",y,()=>D(r,yr,!0)),M(_,k)},I=_=>{var k=If(),y=Bt(k);ll(y,{className:"wr-Header-icon",size:"28"});var E=H(y),P=O(E);G(()=>$(P,v(m).text)),M(_,k)},g=_=>{var k=Cf(),y=Bt(k);al(y,{className:"wr-Header-icon",size:"28"});var E=H(y),P=O(E);G(()=>$(P,v(m).text)),M(_,k)},b=_=>{var k=xs();G(()=>$(k,v(m).text)),M(_,k)};ce(T,_=>{v(m).keyword==="meal"?_(x):v(m).keyword==="mood"?_(I,1):v(m).keyword==="occasion"?_(g,2):_(b,!1)})}M(f,S)}),M(d,p)},h=d=>{var p=Rf(),f=O(p),m=H(f),S=O(m);Do(S,()=>v(r),(j,L)=>{L(j,{className:"wr-Header-icon",size:"28"})});var T=H(m,2),x=O(T),I=H(T,2);ll(I,{className:"wr-Header-icon",size:"28"});var g=H(I,2),b=O(g),_=H(g,3),k=H(_);al(k,{className:"wr-Header-icon",size:"28"});var y=H(k,2),E=O(y),P=H(y);G((j,L,J,U,B,Y)=>{$(f,`${j??""} `),$(x,L),$(b,J),$(_,` ${U??""} `),$(E,B),$(P,` ${Y??""}`)},[()=>Ne({key:"headerLine1",lang:v(n)}),()=>Ne({key:"headerMeal",lang:v(n)}),()=>Ne({key:"headerMood",lang:v(n)}),()=>Ne({key:"headerOr",lang:v(n)}),()=>Ne({key:"headerOccasion",lang:v(n)}),()=>Ne({key:"headerLine2",lang:v(n)})]),Tt("mouseenter",m,()=>D(r,cl,!0)),Tt("mouseleave",m,()=>D(r,yr,!0)),M(d,p)};ce(u,d=>{v(a)?d(c):d(h,!1)})}M(t,l),Ot()}var Mf=V('<option class="wr-Footer-lang"> </option>'),Pf=V('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),Lf=V('<footer class="wr-Footer svelte-1sr6y3t"><div class="wr-Footer-center svelte-1sr6y3t"><a href="https://wineater.com" class="wr-Footer-link svelte-1sr6y3t" target="_blank"><span class="wr-Footer-text"> </span> <img class="wr-Footer-logo svelte-1sr6y3t" alt="Wineater Logo"/> <span class="wr-Footer-text wr-Footer-text--sommelier svelte-1sr6y3t"> </span></a></div> <!></footer>');const Bf={hash:"svelte-1sr6y3t",code:`.wr-Footer.svelte-1sr6y3t {position:relative;border-top:2px solid #f6f7fd;font-weight:200;padding:12px 24px;min-height:40px;}.wr-Footer-center.svelte-1sr6y3t {position:absolute;left:50%;transform:translateX(-50%);text-align:center;}.wr-Footer-dropdown.svelte-1sr6y3t {position:absolute;right:0px;top:50%;transform:translateY(-50%);padding:4px;border-radius:6px;border:2px solid var(--wr-brand-color);background-color:white;color:var(--wr-brand-color);font-weight:500;font-size:12px;cursor:pointer;transition:all 0.2s ease;}.wr-Footer-dropdown.svelte-1sr6y3t:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.2);}.wr-Footer-link.svelte-1sr6y3t {text-decoration:none;display:flex;align-items:center;white-space:nowrap;gap:8px;color:#a8a8a8;font-size:12px;line-height:16px;transition:opacity 0.2s ease;}.wr-Footer-link.svelte-1sr6y3t:hover {opacity:0.8;}.wr-Footer-logo.svelte-1sr6y3t {height:16px;width:auto;color:#a8a8a8;}
|
|
141
154
|
|
|
142
155
|
@media screen and (max-width: 768px) {.wr-Footer-text--sommelier.svelte-1sr6y3t {display:none;}
|
|
143
|
-
}`};function
|
|
156
|
+
}`};function Ff(t,e){Dt(e,!0),zt(t,Bf);let n=We(e,"countryCode",3,null),s=re(()=>me.getAppLanguage()),i=re(()=>me.getSupportedLanguages()),r=re(()=>me.getStoreId());function o(T){const I=T.target.value;ct(pt.LANGUAGE_CHANGED,v(r),{from_language:v(s),to_language:I}),me.setStoreLanguage(I)}var a=Lf(),l=O(a),u=O(l),c=O(u),h=O(c),d=H(c,2),p=H(d,2),f=O(p),m=H(l,2);{var S=T=>{var x=Pf();En(x,21,()=>v(i),xn,(g,b)=>{var _=Mf(),k=O(_),y={};G(E=>{Kc(_,v(b)===v(s)),$(k,E),y!==(y=v(b))&&(_.value=(_.__value=v(b))??"")},[()=>v(b).toUpperCase()]),M(g,_)});var I;qc(x),G(()=>{I!==(I=v(s))&&(x.value=(x.__value=v(s))??"",Ao(x,v(s)))}),Tn("change",x,o),M(T,x)};ce(m,T=>{v(i).length>1&&T(S)})}G((T,x)=>{$(h,T),Ce(d,"src",n()==="ru"?"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/divino_logo.svg?x=5":"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo_medium_gray.svg"),$(f,x)},[()=>Ne({key:"poweredBy",lang:v(s)}),()=>Ne({key:"ai_sommelier",lang:v(s)})]),M(t,a),Ot()}ks(["change"]);var Wf=V('<a rel="noopener noreferrer"><!></a>'),zf=V("<button><!></button>");const jf={hash:"svelte-8cxv3l",code:`.wr-Action.svelte-8cxv3l {background:transparent;border:none;font-family:inherit;cursor:pointer;display:block;text-decoration:none;transition:background 0.2s,
|
|
144
157
|
color 0.2s,
|
|
145
|
-
box-shadow 0.2s;}.wr-Action.primary.svelte-8cxv3l {background:var(--wr-brand-color);color:#fff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {opacity:0.8;}}.wr-Action.outlined.svelte-8cxv3l {background:transparent;color:var(--wr-brand-color);border:2px solid var(--wr-brand-color);border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.25);background-color:var(--wr-brand-color);color:#fff;}}.wr-Action--uppercase.svelte-8cxv3l {text-transform:uppercase;}`};function
|
|
146
|
-
opacity 0.3s ease-in-out;}.wr-Search-input.svelte-1wah7ro:focus {border-color:var(--wr-brand-color);}.wr-Search-input.svelte-1wah7ro:focus::placeholder {opacity:0.5;}`};function
|
|
158
|
+
box-shadow 0.2s;}.wr-Action.primary.svelte-8cxv3l {background:var(--wr-brand-color);color:#fff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {opacity:0.8;}}.wr-Action.outlined.svelte-8cxv3l {background:transparent;color:var(--wr-brand-color);border:2px solid var(--wr-brand-color);border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.25);background-color:var(--wr-brand-color);color:#fff;}}.wr-Action--uppercase.svelte-8cxv3l {text-transform:uppercase;}`};function Sr(t,e){Dt(e,!0),zt(t,jf);let n=We(e,"type",3,"button"),s=We(e,"variant",3,"primary"),i=We(e,"target",3,"_self"),r=me.getUiConfig(),o=`wr-Action ${s()} ${e.className||""} ${r.buttonUppercase?"wr-Action--uppercase":""}`.trim();var a=Es(),l=Bt(a);{var u=h=>{var d=Wf(),p=O(d);Ro(p,e,"default",{}),G(()=>{jt(d,1,In(o),"svelte-8cxv3l"),Ce(d,"href",e.href),Ce(d,"id",e.id),Ce(d,"target",i())}),M(h,d)},c=h=>{var d=zf(),p=O(d);Ro(p,e,"default",{}),G(()=>{jt(d,1,In(o),"svelte-8cxv3l"),Ce(d,"type",n()),Ce(d,"id",e.id)}),Tn("click",d,function(...f){var m;(m=e.handleClick)==null||m.apply(this,f)}),M(h,d)};ce(l,h=>{e.href?h(u):h(c,!1)})}M(t,a),Ot()}ks(["click"]);var Uf=V('<form class="wr-Search svelte-1wah7ro"><span class="wr-Search-icon svelte-1wah7ro"></span> <input class="wr-Search-input svelte-1wah7ro" type="text"/> <!></form>');const Hf={hash:"svelte-1wah7ro",code:`.wr-Search.svelte-1wah7ro {position:relative;margin:12px auto;padding:0 6px;display:flex;align-items:center;border:2px solid #d5d9ee;border-radius:10px;}.wr-Search-icon.svelte-1wah7ro {left:12px;width:24px;height:24px;flex:0 0 auto;background-image:url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//search.svg?x=1');background-repeat:no-repeat;background-size:contain;z-index:2;}.wr-Search-input.svelte-1wah7ro {flex:1 1 0%;min-width:0;padding:12px;font-size:16px;border:none;border-radius:10px;outline:none;transition:border 0.2s ease;}.wr-Search-input.svelte-1wah7ro::placeholder {color:var(--wr-wineater-color);opacity:1;transition:color 0.3s ease,
|
|
159
|
+
opacity 0.3s ease-in-out;}.wr-Search-input.svelte-1wah7ro:focus {border-color:var(--wr-brand-color);}.wr-Search-input.svelte-1wah7ro:focus::placeholder {opacity:0.5;}`};function qf(t,e){Dt(e,!0),zt(t,Hf);let n=We(e,"searchQuery",15),s,i=le(!1),r=le(0),o=le(0),a=le(!0),l=le(!1),u=re(()=>me.getAppLanguage()),c=0;function h(){return s}function d(){const g=++c,b=Ne({key:"placeholderSuggestions",lang:v(u)});if(!s||!b.length)return;D(l,!0);const _=()=>{if(g!==c||!s||!v(l)||v(i)||n().length)return;const k=b[v(r)];if(v(a)){if(s.placeholder=k.substring(0,Zr(o)),v(o)>k.length){D(a,!1),setTimeout(_,1600);return}setTimeout(_,90)}else{if(s.placeholder=k.substring(0,Zr(o,-1)),v(o)<0){D(a,!0),D(r,(v(r)+1)%b.length),setTimeout(_,450);return}setTimeout(_,45)}};_()}function p(){D(l,!1)}function f(){D(i,!0),p(),s&&(s.placeholder="")}function m(){D(i,!1),D(o,0),D(a,!0),D(l,!1)}Zn(()=>{if(!s||n().length>0)return;c++,D(l,!1),D(r,0),D(o,0),D(a,!0);const g=Ne({key:"placeholderSuggestions",lang:v(u)});g&&g.length?s.placeholder=g[0]:s.placeholder=Ne({key:"searchPlaceholder",lang:v(u)})}),Zn(()=>{s&&e.initialized&&!v(i)&&!n().length&&!v(l)&&d(),n().length>0&&v(l)&&(D(l,!1),c++)}),Ii(()=>{});var S={getSearchElement:h},T=Uf(),x=H(O(T),2);Qc(x,g=>s=g,()=>s);var I=H(x,2);return Sr(I,{className:"wr-Search-button",type:"submit",variant:"primary",children:(g,b)=>{var _=xs();G(k=>$(_,k),[()=>Ne({key:"searchButton",lang:v(u)})]),M(g,_)},$$slots:{default:!0}}),Tt("submit",T,function(...g){var b;(b=e.onSubmit)==null||b.apply(this,g)}),Tt("focus",x,f),Tt("blur",x,m),Jc(x,n),M(t,T),Ot(S)}var Vf=V('<div class="wr-Loader svelte-li6gfl"><div class="wr-Loader-indicator svelte-li6gfl"><span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span></div></div>');const Gf={hash:"svelte-li6gfl",code:`.wr-Loader.svelte-li6gfl {position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:10000;text-align:center;}.wr-Loader-indicator.svelte-li6gfl {display:flex;justify-content:center;align-items:center;height:40px;visibility:visible;background-color:white;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl) {display:block;width:8px;height:8px;margin:0 3px;border-radius:50%;background:linear-gradient(90deg, var(--wr-brand-color), var(--wineater-corp-color));opacity:0.7;
|
|
147
160
|
animation: svelte-li6gfl-typing 1s infinite;}
|
|
148
161
|
|
|
149
162
|
@keyframes svelte-li6gfl-typing {
|
|
@@ -156,7 +169,7 @@ ${JSON.stringify(o,null,2)}
|
|
|
156
169
|
transform: translateY(-8px);
|
|
157
170
|
opacity: 1;
|
|
158
171
|
}
|
|
159
|
-
}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(1) {animation-delay:0s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(2) {animation-delay:0.15s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(3) {animation-delay:0.3s;}`};function
|
|
172
|
+
}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(1) {animation-delay:0s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(2) {animation-delay:0.15s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(3) {animation-delay:0.3s;}`};function Kf(t){zt(t,Gf);var e=Vf();M(t,e)}var Xf=V('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Yf=V('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Jf=V('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Qf=V('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Zf=V('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),$f=V('<div class="wr-WinePopupMobile svelte-17gehox"><div class="wr-WinePopupMobile-overlay svelte-17gehox"></div> <div class="wr-WinePopupMobile-wrapper svelte-17gehox"><div class="wr-WinePopup js-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close js-WinePopupClose svelte-17gehox">×</button></div> <!> <!> <!></div></div></div>'),ep=V('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),tp=V('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),np=V('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),sp=V('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),ip=V('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),rp=V('<div class="wr-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close svelte-17gehox">×</button></div> <!> <!> <!></div>');const op={hash:"svelte-17gehox",code:".wr-WinePopup.svelte-17gehox {position:absolute;width:100%;background-color:white;padding:16px;border-radius:16px;box-shadow:0 6px 30px rgba(0, 0, 0, 0.2);text-align:left;font-size:14px;box-sizing:border-box;display:flex;flex-direction:column;}.wr-WinePopup-text.svelte-17gehox {margin:5px 0;}.wr-WinePopup-header.svelte-17gehox {display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}.wr-WinePopup-title.svelte-17gehox {font-size:16px;font-weight:600;margin:0;flex:1;line-height:1.3;}.wr-WinePopup-close.svelte-17gehox {font-size:20px;font-weight:bold;cursor:pointer;color:#999;border:none;background:transparent;line-height:1;}.wr-WinePopup-close.svelte-17gehox:hover {color:#000;}.wr-WinePopup-desc.svelte-17gehox {margin-top:8px;}.wr-WinePopup-reason.svelte-17gehox {font-size:14px;font-weight:400;color:#333;margin-top:8px;}.wr-WinePopup-pairing.svelte-17gehox {margin-top:8px;}.wr-WinePopup-tags.svelte-17gehox {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;justify-content:center;}.wr-WinePopup-tag.svelte-17gehox {display:inline-block;padding:4px 8px;border-radius:12px;background-color:#f5f0ff;border:1px solid #ddd;font-size:13px;color:#333;text-transform:capitalize;}.wr-WinePopupMobile.svelte-17gehox {position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;}.wr-WinePopupMobile-overlay.svelte-17gehox {position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);}.wr-WinePopupMobile-wrapper.svelte-17gehox {position:absolute;width:100%;height:100%;top:50%;left:50%;transform:translate(-50%, -50%);max-width:90%;max-height:80%;overflow-y:auto;background:transparent;}"};function ul(t,e){Dt(e,!0),zt(t,op);const n=!!e.isMobile;var s=Es(),i=Bt(s);{var r=a=>{var l=$f(),u=O(l),c=H(u,2),h=O(c),d=O(h),p=O(d),f=O(p),m=H(p,2),S=H(d,2);{var T=k=>{var y=Xf(),E=O(y);G(()=>$(E,e.shortDescription)),M(k,y)};ce(S,k=>{e.shortDescription&&k(T)})}var x=H(S,2);{var I=k=>{var y=Yf(),E=O(y);G(()=>$(E,e.reason)),M(k,y)},g=k=>{var y=Jf(),E=O(y);G(()=>$(E,e.pairing)),M(k,y)};ce(x,k=>{e.reason?k(I):e.pairing&&k(g,1)})}var b=H(x,2);{var _=k=>{var y=Zf();En(y,21,()=>e.tags,xn,(E,P)=>{var j=Qf(),L=O(j);G(()=>$(L,v(P))),M(E,j)}),M(k,y)};ce(b,k=>{e.tags&&e.tags.length&&k(_)})}G(()=>$(f,e.title)),Tn("click",u,function(...k){var y;(y=e.onClose)==null||y.apply(this,k)}),Tn("click",m,function(...k){var y;(y=e.onClose)==null||y.apply(this,k)}),M(a,l)},o=a=>{var l=rp(),u=O(l),c=O(u),h=O(c),d=H(c,2),p=H(u,2);{var f=g=>{var b=ep(),_=O(b);G(()=>$(_,e.shortDescription)),M(g,b)};ce(p,g=>{e.shortDescription&&g(f)})}var m=H(p,2);{var S=g=>{var b=tp(),_=O(b);G(()=>$(_,e.reason)),M(g,b)},T=g=>{var b=np(),_=O(b);G(()=>$(_,e.pairing)),M(g,b)};ce(m,g=>{e.reason?g(S):e.pairing&&g(T,1)})}var x=H(m,2);{var I=g=>{var b=ip();En(b,21,()=>e.tags,xn,(_,k)=>{var y=sp(),E=O(y);G(()=>$(E,v(k))),M(_,y)}),M(g,b)};ce(x,g=>{e.tags&&e.tags.length&&g(I)})}G(()=>$(h,e.title)),Tn("click",d,function(...g){var b;(b=e.onClose)==null||b.apply(this,g)}),M(a,l)};ce(i,a=>{n?a(r):a(o,!1)})}M(t,s),Ot()}ks(["click"]);var ap=V('<img class="wr-WineTile-image svelte-yk3emv"/>'),lp=V('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),cp=V('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),up=V('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),hp=V('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),dp=V('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),fp=V("<div><!> <!></div>"),pp=V('<article><header class="wr-WineTile-header svelte-yk3emv"><!> <!> <h3 class="wr-WineTile-title svelte-yk3emv"> </h3></header> <!> <footer class="wr-WineTile-footer svelte-yk3emv"><div class="wr-WineTile-actions svelte-yk3emv"><!></div></footer> <!> <!></article> <!>',1);const gp={hash:"svelte-yk3emv",code:`.wr-WineTile.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;text-align:center;box-sizing:border-box;padding:16px 8px;border-right:2px solid #f6f7fd;position:relative;transform:translateY(0);opacity:1;transition:transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
|
|
160
173
|
opacity 180ms cubic-bezier(0.22, 0.61, 0.36, 1);will-change:transform, opacity;}.wr-WineTile.svelte-yk3emv:last-child {border-right:none;}.wr-WineTile.ww-slide-up.svelte-yk3emv {transform:translateY(-28px);opacity:0;}.wr-WineTile-header.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;justify-content:flex-start;}.wr-WineTile-image.svelte-yk3emv {height:200px;width:100%;max-width:100%;object-fit:contain;margin:0 auto 16px;display:block;}.wr-WineTile-title.svelte-yk3emv {font-size:15px;font-weight:500;margin:0 0 8px;min-height:3rem;line-height:1.2;text-align:center;color:#000;}.wr-WineTile-params.svelte-yk3emv {font-size:14px;color:#666;white-space:normal;text-align:center;}.wr-WineTile-footer.svelte-yk3emv {margin-top:auto;display:flex;align-items:center;gap:12px;justify-content:center;}.wr-WineTile-price.svelte-yk3emv {font-size:16px;font-weight:400;margin-bottom:8px;color:#333;}.wr-WineTile-actions.svelte-yk3emv {margin:16px auto 0;}
|
|
161
174
|
|
|
162
175
|
/* Hover popup inside tile */.wr-WineTilePopup.svelte-yk3emv {display:none;position:absolute;top:0;left:0;width:100%;padding:12px;background-color:#fff;border:1px solid #ddd;border-radius:8px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);transition:transform 0.3s ease;z-index:999;}.wr-WineTilePopup.visible.svelte-yk3emv {display:block;}.wr-WineTilePopup.slide-in.svelte-yk3emv {
|
|
@@ -174,7 +187,7 @@ ${JSON.stringify(o,null,2)}
|
|
|
174
187
|
}
|
|
175
188
|
|
|
176
189
|
@media screen and (max-width: 768px) {.wr-WineTile.svelte-yk3emv {flex:0 0 auto;scroll-snap-align:center;width:240px;text-align:center;}
|
|
177
|
-
}`};function
|
|
190
|
+
}`};function mp(t,e){Dt(e,!0),zt(t,gp);let n=re(()=>me.getAppLanguage());const s=(N,A)=>N[A]||N[A.charAt(0).toUpperCase()+A.slice(1)],i=(N,A)=>A.map(ne=>s(N,ne)).filter(Boolean).join(" • ");function r(N){var A;return yf(N,((A=me.getCurrency)==null?void 0:A.call(me))||"USD",v(n))}function o(N){return e.selectedWineId===N}function a(N){return!!(N.reason||N.shortDescription||N.tags)}function l(N,A){let ne=(N==null?void 0:N.tags)||A.tags;return ne?(Array.isArray(ne)&&(ne=ne.join(",")),typeof ne!="string"?[]:ne.split(",").map(oe=>oe.trim()).filter(Boolean)):[]}let u=le(!1);Ii(()=>{const N=()=>{D(u,window.innerWidth<=768)};return N(),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}});var c=pp(),h=Bt(c),d=O(h),p=O(d);{var f=N=>{var A=ap();G(()=>{Ce(A,"src",e.wine.image),Ce(A,"alt",e.wine.title)}),M(N,A)};ce(p,N=>{e.wine.image&&N(f)})}var m=H(p,2);{var S=N=>{var A=lp(),ne=O(A);G(oe=>$(ne,oe),[()=>r(e.wine.total)]),M(N,A)};ce(m,N=>{e.wine.total&&N(S)})}var T=H(m,2),x=O(T),I=H(d,2);{var g=N=>{var A=cp(),ne=O(A);G(oe=>$(ne,oe),[()=>i(e.wine,["type","country","region","grape"])]),M(N,A)},b=re(()=>i(e.wine,["type","country","region","grape"]));ce(I,N=>{v(b)&&N(g)})}var _=H(I,2),k=O(_),y=O(k);{var E=N=>{Sr(N,{get href(){return e.wine.url},className:"wr-WineTile-action wr-WineTile-action--link js-WineTileAction",target:"_blank",variant:"outlined",children:(A,ne)=>{var oe=xs();G(ue=>$(oe,ue),[()=>Ne({key:"wineDetails.buy",lang:v(n)})]),M(A,oe)},$$slots:{default:!0}})},P=N=>{Sr(N,{handleClick:()=>e.onBuyClick(e.wine,e.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(A,ne)=>{var oe=xs();G(ue=>$(oe,ue),[()=>Ne({key:"moreInfo",lang:v(n)})]),M(A,oe)},$$slots:{default:!0}})};ce(y,N=>{e.wine.url?N(E):N(P,!1)})}var j=H(_,2);{var L=N=>{{let A=re(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.shortDescription)||e.wine.shortDescription}),ne=re(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.reason)||e.wine.reason}),oe=re(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.pairingRecommendation)||e.wine.pairingRecommendation}),ue=re(()=>l(e.translatedPopup,e.wine));ul(N,{get title(){return e.wine.title},get shortDescription(){return v(A)},get reason(){return v(ne)},get pairing(){return v(oe)},get tags(){return v(ue)},get onClose(){return e.onPopupClose},isMobile:!1})}},J=re(()=>o(e.wine.id)&&!v(u));ce(j,N=>{v(J)&&N(L)})}var U=H(j,2);{var B=N=>{var A=fp(),ne=O(A);{var oe=F=>{var te=up(),Se=O(te);G(()=>{var Ze,Pe;return $(Se,((Ze=e.translatedPopup)==null?void 0:Ze.reason)||((Pe=e.translatedPopup)==null?void 0:Pe.shortDescription)||e.wine.reason||e.wine.shortDescription)}),M(F,te)};ce(ne,F=>{var te,Se;((te=e.translatedPopup)!=null&&te.reason||(Se=e.translatedPopup)!=null&&Se.shortDescription||e.wine.reason||e.wine.shortDescription)&&F(oe)})}var ue=H(ne,2);{var C=F=>{var te=dp();En(te,21,()=>l(e.translatedPopup,e.wine),xn,(Se,Ze)=>{var Pe=hp(),Le=O(Pe);G(()=>$(Le,v(Ze))),M(Se,Pe)}),M(F,te)};ce(ue,F=>{var te,Se;((te=e.translatedPopup)!=null&&te.tags||(Se=e.translatedPopup)!=null&&Se.Tags||e.wine.tags)&&F(C)})}G(()=>jt(A,1,`wr-WineTilePopup ${e.hoveredWineId===e.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),M(N,A)},Y=re(()=>a(e.wine));ce(U,N=>{v(Y)&&N(B)})}var ee=H(h,2);{var R=N=>{{let A=re(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.shortDescription)||e.wine.shortDescription}),ne=re(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.reason)||e.wine.reason}),oe=re(()=>{var C;return((C=e.translatedPopup)==null?void 0:C.pairingRecommendation)||e.wine.pairingRecommendation}),ue=re(()=>l(e.translatedPopup,e.wine));ul(N,{get title(){return e.wine.title},get shortDescription(){return v(A)},get reason(){return v(ne)},get pairing(){return v(oe)},get tags(){return v(ue)},get onClose(){return e.onPopupClose},isMobile:!0})}},Q=re(()=>o(e.wine.id)&&v(u));ce(ee,N=>{v(Q)&&N(R)})}G(()=>{jt(h,1,`wr-WineTile ${e.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),$(x,`${(e.wine.producer?e.wine.producer:"")??""} ${e.wine.title??""}`)}),Tt("mouseenter",h,()=>e.onTileEnter(e.wine)),Tt("mouseleave",h,()=>e.onTileLeave(e.wine)),Tn("click",h,N=>e.onTileClick(N,e.wine)),M(t,c),Ot()}ks(["click"]);function vp(t){if(!t)return"";const e="custom-ui-config-style";if(document.getElementById(e))return;const n=document.createElement("style");return n.id=e,n.innerHTML=t,document.head.appendChild(n),e}var wp=V('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),bp=V('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),yp=V('<div class="wr-App-placeholder svelte-1n46o8q"></div>'),Sp=V('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>');const _p={hash:"svelte-1n46o8q",code:`
|
|
178
191
|
/* ===================== 1) CSS Variables ===================== */:root {--wineater-corp-color: #0044ff;
|
|
179
192
|
/* --wr-brand-color is set dynamically from uiConfig.brandColor */--wr-brand-color: #7b2beb; /* fallback value */}
|
|
180
193
|
|
|
@@ -186,4 +199,4 @@ ${JSON.stringify(o,null,2)}
|
|
|
186
199
|
|
|
187
200
|
/* ===================== 13) Mobile Styles ===================== */
|
|
188
201
|
@media screen and (max-width: 768px) {.wr-App.svelte-1n46o8q {flex-direction:column;padding:0px 16px;min-width:100vw;}.wr-App-placeholder.svelte-1n46o8q {display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;padding:8px 0;width:calc(100vw - 32px);min-width:calc(100vw - 32px);}
|
|
189
|
-
}`};function
|
|
202
|
+
}`};function kp(t,e){var ne,oe,ue;Dt(e,!0),zt(t,_p);function n(){var C;Di("chatbotToken",((C=window.wineaterData)==null?void 0:C.CLIENT_TOKEN)||s,365),Fo()}const s="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";new cf({projectKey:"PA8j9fAi49i6g2QnvpNs",__DISABLE_SECURE_MODE:!0}).start(),n();const r=((ne=window==null?void 0:window.wineaterData)==null?void 0:ne.WIDGET_TYPE)||"store",o=((oe=window==null?void 0:window.wineaterData)==null?void 0:oe.COUNTRY_CODE)||null;(ue=window==null?void 0:window.wineaterData)!=null&&ue.WIDGET_WRAPPER;let a=le(!1),l=le(!1),u=le(at([])),c=le(null),h=le(""),d=le(null),p=le(!1),f=le(null),m=le(at([])),S=re(()=>me.getAppLanguage()),T=re(()=>me.getStoreLanguage()),x=re(()=>me.getApiKey()),I=re(()=>me.getStoreId()),g=re(()=>me.isInitialized()),b=re(()=>me.getUiConfig());function _(){D(d,Ne({key:"errorMessage",lang:v(S)}),!0)}const k=()=>D(d,null);async function y(C){if(v(S)===v(T)||r!=="bar")return C.map(()=>({}));const F=["shortDescription","reason","pairingRecommendation","tags"],te=C[0];if(!te)return C.map(()=>({}));const Se=F.filter(Le=>Le in te),Ze=4,Pe=[];for(let Le=0;Le<C.length;Le+=Ze){const Kt=C.slice(Le,Le+Ze).map(async si=>{const ii=Se.map(he=>{const He=si[he]||si[he.toLowerCase()];return He?{key:he,text:Array.isArray(He)?He.join(", "):He}:null}).filter(Boolean);return ii.length===0?{}:await Sf({sourceLang:v(T),targetLang:v(S),texts:Object.fromEntries(ii.map(he=>[he.key,he.text])),apiKey:v(x)})}),gn=await Promise.all(Kt);Pe.push(...gn)}return Pe}async function E(){D(l,!0);try{D(u,await br.getInstantRecommendations(),!0)}catch(C){console.error("[wineater] instant recommendations error:",C),_()}finally{D(l,!1)}}function P(C=220){return!v(u)||v(u).length===0?Promise.resolve():(D(p,!0),new Promise(F=>{setTimeout(()=>{F()},C)}))}async function j(C){C.preventDefault();let F="";try{D(l,!0),k(),await P(220),D(u,[],!0),D(p,!1),F=v(h).trim()+";";try{ct(pt.SEARCH_PERFORMED,v(I),{query:F})}catch(Se){console.error("Error tracking search event:",Se)}const te=await br.getWineRecommendationsSearch(F);!te||te.length===0?(D(u,[],!0),D(m,[],!0),D(d,Ne({key:"noResultsMessage",lang:v(S)}),!0),ct(pt.NO_RESULTS_FOUND,v(I),{query:F})):(D(u,te,!0),ct(pt.SEARCH_RESULTS_DISPLAYED,v(I),{results_count:te.length,results:te,query:F}))}catch(te){D(u,[],!0),console.error("[wineater] search error:",te),ct(pt.ERROR_OCCURRED,v(I),{error_message:te==null?void 0:te.message,query:F}),_()}finally{D(l,!1)}}Zn(async()=>{if(!v(u)||v(u).length===0){D(m,[],!0);return}try{const C=await y(v(u));v(u)&&v(u).length>0&&D(m,C,!0)}catch(C){console.error("translatePopupContent failed",C)}});function L(C,F){v(c)&&v(c)!==C.id&&D(c,null),D(c,C.id,!0),ct(pt.WINE_DETAILS_VIEWED,v(I),{wine_id:C.id,wine_title:C.title,is_mobile:window.innerWidth<=768})}function J(){const C=v(u).find(F=>F.id===v(c));ct(pt.WINE_DETAILS_CLOSED,v(I),{wine_id:v(c),wine_title:C.title}),D(c,null)}function U(C){return!!(C.reason||C.shortDescription||C.tags)}function B(C){r==="store"&&U(C)&&(D(f,C.id,!0),ct(pt.WINE_CARD_HOVER,v(I),{wine_id:C.id,wine_title:C.title}))}function Y(C){r==="store"&&v(f)===C.id&&D(f,null)}function ee(C,F){C.target.closest(".js-WineTileAction")||C.target.closest(".js-WinePopupClose")||ct(pt.WINE_CARD_CLICK,v(I),{wine_id:F.id,wine_title:F.title})}function R(C){const F=C.target;F.closest(".js-WinePopup")||F.closest(".js-WineTileAction")||D(c,null)}Zn(()=>{var C,F;(C=v(b))!=null&&C.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",v(b).brandColor),(F=v(b))!=null&&F.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",v(b).wineaterColor)}),Ii(async()=>{if(await me.initializeStore(),!!v(g))return D(b,me.getUiConfig()),v(b).customCss&&vp(v(b).customCss),await E(),ct(pt.WIDGET_INITIALIZED,v(I)),D(a,!0),document.addEventListener("click",R),()=>{document.removeEventListener("click",R)}});var Q=Es(),N=Bt(Q);{var A=C=>{var F=Sp(),te=O(F);{var Se=he=>{var He=wp(),fs=O(He);G(()=>Ce(fs,"src",v(b).logoUrl)),M(he,He)};ce(te,he=>{v(b).logoUrl&&he(Se)})}var Ze=H(te,2);Af(Ze,{});var Pe=H(Ze,2);qf(Pe,{onSubmit:j,get initialized(){return v(a)},get searchQuery(){return v(h)},set searchQuery(he){D(h,he,!0)}});var Le=H(Pe,2);{var ds=he=>{Kf(he)};ce(Le,he=>{v(l)&&he(ds)})}var Kt=H(Le,2),gn=O(Kt);{var si=he=>{var He=bp(),fs=O(He),Tr=O(fs);G(()=>$(Tr,v(d))),M(he,He)},ii=he=>{var He=yp();En(He,21,()=>v(u),xn,(fs,Tr,ml)=>{mp(fs,{get wine(){return v(Tr)},index:ml,get hoveredWineId(){return v(f)},get selectedWineId(){return v(c)},get isAnimating(){return v(p)},get translatedPopup(){return v(m)[ml]},onBuyClick:L,onPopupClose:J,onTileEnter:B,onTileLeave:Y,onTileClick:ee})}),M(he,He)};ce(gn,he=>{v(d)?he(si):v(u)&&v(u).length>0&&he(ii,1)})}var gl=H(Kt,2);Ff(gl,{get countryCode(){return o}}),M(C,F)};ce(N,C=>{v(g)&&C(A)})}M(t,Q),Ot()}return Pc(kp,{target:document.getElementById("wineater-widget-conteiner")})});
|