wineater-bot 4.11.0 → 4.12.0

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.
@@ -1,22 +1,22 @@
1
- (function(re,oe){typeof exports=="object"&&typeof module<"u"?module.exports=oe():typeof define=="function"&&define.amd?define(oe):(re=typeof globalThis<"u"?globalThis:re||self,re.WineaterChatbot=oe())})(this,function(){"use strict";var kp=Object.defineProperty;var gl=re=>{throw TypeError(re)};var Tp=(re,oe,Se)=>oe in re?kp(re,oe,{enumerable:!0,configurable:!0,writable:!0,value:Se}):re[oe]=Se;var yt=(re,oe,Se)=>Tp(re,typeof oe!="symbol"?oe+"":oe,Se),Ir=(re,oe,Se)=>oe.has(re)||gl("Cannot "+Se);var w=(re,oe,Se)=>(Ir(re,oe,"read from private field"),Se?Se.call(re):oe.get(re)),Y=(re,oe,Se)=>oe.has(re)?gl("Cannot add the same private member more than once"):oe instanceof WeakSet?oe.add(re):oe.set(re,Se),z=(re,oe,Se,gs)=>(Ir(re,oe,"write to private field"),gs?gs.call(re,Se):oe.set(re,Se),Se),fe=(re,oe,Se)=>(Ir(re,oe,"access private method"),Se);var al,Fn,Wn,cn,un,ls,zn,jn,ke,Cr,gn,Nr,ml,vl,$e,et,kr,mt,hn,vt,tt,ze,wt,Mt,Gt,dn,Kt,fn,Xt,si,Te,xp,Ep,Rr,ui,hi,Dr,rt,bt,Ge,pn,cs,us,ii,Yt,Ot,Un,ll,cl;const re="5";typeof window<"u"&&((al=window.__svelte??(window.__svelte={})).v??(al.v=new Set)).add(re);const oe=1,Se=2,gs=16,wl=1,bl=2,yl=4,_l=8,Sl=16,kl=1,Tl=2,Ie=Symbol(),xl="http://www.w3.org/1999/xhtml",di=!1;var fi=Array.isArray,El=Array.prototype.indexOf,pi=Array.from,Il=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,Cl=Object.getOwnPropertyDescriptors,Nl=Object.prototype,Rl=Array.prototype,Mr=Object.getPrototypeOf,Or=Object.isExtensible;function Dl(t){for(var e=0;e<t.length;e++)t[e]()}function Ar(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const xe=2,gi=4,mi=8,_t=16,St=32,Jt=64,ms=128,nt=512,Ce=1024,Pe=2048,kt=4096,je=8192,Tt=16384,vi=32768,Qt=65536,Pr=1<<17,Lr=1<<18,vn=1<<19,Ml=1<<20,Zt=32768,wi=1<<21,bi=1<<22,Lt=1<<23,$t=Symbol("$state"),Ol=Symbol("legacy props"),Al=Symbol(""),wn=new class extends Error{constructor(){super(...arguments);yt(this,"name","StaleReactionError");yt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Pl(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ll(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Bl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Fl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Wl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function zl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function jl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ul(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Hl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ql(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Vl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Gl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Kl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Br(t){return t===this.v}function Xl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Fr(t){return!Xl(t,this.v)}let bn=!1,Yl=!1;function Jl(){bn=!0}let we=null;function yn(t){we=t}function Bt(t,e=!1,n){we={p:we,i:!1,c:null,e:null,s:t,x:null,l:bn&&!e?{s:null,u:null,$:[]}:null}}function Ft(t){var e=we,n=e.e;if(n!==null){e.e=null;for(var s of n)so(s)}return t!==void 0&&(e.x=t),e.i=!0,we=e.p,t??{}}function Hn(){return!bn||we!==null&&we.l===null}let en=[];function Wr(){var t=en;en=[],Dl(t)}function qn(t){if(en.length===0&&!Vn){var e=en;queueMicrotask(()=>{e===en&&Wr()})}en.push(t)}function Ql(){for(;en.length>0;)Wr()}function zr(t){var e=ie;if(e===null)return J.f|=Lt,t;if(e.f&vi)_n(t,e);else{if(!(e.f&ms))throw t;e.b.error(t)}}function _n(t,e){for(;e!==null;){if(e.f&ms)try{e.b.error(t);return}catch(n){t=n}e=e.parent}throw t}const vs=new Set;let ne=null,ws=null,be=null,Xe=[],bs=null,yi=!1,Vn=!1;const ni=class ni{constructor(){Y(this,ke);yt(this,"committed",!1);yt(this,"current",new Map);yt(this,"previous",new Map);Y(this,Fn,new Set);Y(this,Wn,new Set);Y(this,cn,0);Y(this,un,0);Y(this,ls,null);Y(this,zn,[]);Y(this,jn,[]);yt(this,"skipped_effects",new Set);yt(this,"is_fork",!1)}is_deferred(){return this.is_fork||w(this,un)>0}process(e){var s;Xe=[],ws=null,this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)fe(this,ke,Cr).call(this,i,n);this.is_fork||fe(this,ke,ml).call(this),this.is_deferred()?(fe(this,ke,gn).call(this,n.effects),fe(this,ke,gn).call(this,n.render_effects),fe(this,ke,gn).call(this,n.block_effects)):(ws=this,ne=null,Ur(n.render_effects),Ur(n.effects),ws=null,(s=w(this,ls))==null||s.resolve()),be=null}capture(e,n){this.previous.has(e)||this.previous.set(e,n),e.f&Lt||(this.current.set(e,e.v),be==null||be.set(e,e.v))}activate(){ne=this,this.apply()}deactivate(){ne===this&&(ne=null,be=null)}flush(){if(this.activate(),Xe.length>0){if(jr(),ne!==null&&ne!==this)return}else w(this,cn)===0&&this.process([]);this.deactivate()}discard(){for(const e of w(this,Wn))e(this);w(this,Wn).clear()}increment(e){z(this,cn,w(this,cn)+1),e&&z(this,un,w(this,un)+1)}decrement(e){z(this,cn,w(this,cn)-1),e&&z(this,un,w(this,un)-1),this.revive()}revive(){for(const e of w(this,zn))Ne(e,Pe),tn(e);for(const e of w(this,jn))Ne(e,kt),tn(e);z(this,zn,[]),z(this,jn,[]),this.flush()}oncommit(e){w(this,Fn).add(e)}ondiscard(e){w(this,Wn).add(e)}settled(){return(w(this,ls)??z(this,ls,Ar())).promise}static ensure(){if(ne===null){const e=ne=new ni;vs.add(ne),Vn||ni.enqueue(()=>{ne===e&&e.flush()})}return ne}static enqueue(e){qn(e)}apply(){}};Fn=new WeakMap,Wn=new WeakMap,cn=new WeakMap,un=new WeakMap,ls=new WeakMap,zn=new WeakMap,jn=new WeakMap,ke=new WeakSet,Cr=function(e,n){var l;e.f^=Ce;for(var s=e.first;s!==null;){var i=s.f,r=(i&(St|Jt))!==0,o=r&&(i&Ce)!==0,a=o||(i&je)!==0||this.skipped_effects.has(s);if(s.f&ms&&((l=s.b)!=null&&l.is_pending())&&(n={parent:n,effect:s,effects:[],render_effects:[],block_effects:[]}),!a&&s.fn!==null){r?s.f^=Ce:i&gi?n.effects.push(s):Qn(s)&&(s.f&_t&&n.block_effects.push(s),Zn(s));var c=s.first;if(c!==null){s=c;continue}}var u=s.parent;for(s=s.next;s===null&&u!==null;)u===n.effect&&(fe(this,ke,gn).call(this,n.effects),fe(this,ke,gn).call(this,n.render_effects),fe(this,ke,gn).call(this,n.block_effects),n=n.parent),s=u.next,u=u.parent}},gn=function(e){for(const n of e)(n.f&Pe?w(this,zn):w(this,jn)).push(n),fe(this,ke,Nr).call(this,n.deps),Ne(n,Ce)},Nr=function(e){if(e!==null)for(const n of e)!(n.f&xe)||!(n.f&Zt)||(n.f^=Zt,fe(this,ke,Nr).call(this,n.deps))},ml=function(){if(w(this,un)===0){for(const e of w(this,Fn))e();w(this,Fn).clear()}w(this,cn)===0&&fe(this,ke,vl).call(this)},vl=function(){var r;if(vs.size>1){this.previous.clear();var e=be,n=!0,s={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const o of vs){if(o===this){n=!1;continue}const a=[];for(const[u,l]of this.current){if(o.current.has(u))if(n&&l!==o.current.get(u))o.current.set(u,l);else continue;a.push(u)}if(a.length===0)continue;const c=[...o.current.keys()].filter(u=>!this.current.has(u));if(c.length>0){var i=Xe;Xe=[];const u=new Set,l=new Map;for(const h of a)Hr(h,c,u,l);if(Xe.length>0){ne=o,o.apply();for(const h of Xe)fe(r=o,ke,Cr).call(r,h,s);o.deactivate()}Xe=i}}ne=null,be=e}this.committed=!0,vs.delete(this)};let xt=ni;function Zl(t){var e=Vn;Vn=!0;try{for(var n;;){if(Ql(),Xe.length===0&&(ne==null||ne.flush(),Xe.length===0))return bs=null,n;jr()}}finally{Vn=e}}function jr(){var t=zt;yi=!0;var e=null;try{var n=0;for(xs(!0);Xe.length>0;){var s=xt.ensure();if(n++>1e3){var i,r;$l()}s.process(Xe),Wt.clear()}}finally{yi=!1,xs(t),bs=null}}function $l(){try{zl()}catch(t){_n(t,bs)}}let st=null;function Ur(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(Tt|je))&&Qn(s)&&(st=new Set,Zn(s),s.deps===null&&s.first===null&&s.nodes_start===null&&(s.teardown===null&&s.ac===null?ao(s):s.fn=null),(st==null?void 0:st.size)>0)){Wt.clear();for(const i of st){if(i.f&(Tt|je))continue;const r=[i];let o=i.parent;for(;o!==null;)st.has(o)&&(st.delete(o),r.push(o)),o=o.parent;for(let a=r.length-1;a>=0;a--){const c=r[a];c.f&(Tt|je)||Zn(c)}}st.clear()}}st=null}}function Hr(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?Hr(i,e,n,s):r&(bi|_t)&&!(r&Pe)&&qr(i,e,s)&&(Ne(i,Pe),tn(i))}}function qr(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(e.includes(i))return!0;if(i.f&xe&&qr(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function tn(t){for(var e=bs=t;e.parent!==null;){e=e.parent;var n=e.f;if(yi&&e===ie&&n&_t&&!(n&Lr))return;if(n&(Jt|St)){if(!(n&Ce))return;e.f^=Ce}}Xe.push(e)}function ec(t){let e=0,n=nn(0),s;return()=>{ks()&&(m(n),Ei(()=>(e===0&&(s=$n(()=>t(()=>Kn(n)))),e+=1,()=>{qn(()=>{e-=1,e===0&&(s==null||s(),s=void 0,Kn(n))})})))}}var tc=Qt|vn|ms;function nc(t,e,n){new sc(t,e,n)}class sc{constructor(e,n,s){Y(this,Te);yt(this,"parent");Y(this,$e,!1);Y(this,et);Y(this,kr,null);Y(this,mt);Y(this,hn);Y(this,vt);Y(this,tt,null);Y(this,ze,null);Y(this,wt,null);Y(this,Mt,null);Y(this,Gt,null);Y(this,dn,0);Y(this,Kt,0);Y(this,fn,!1);Y(this,Xt,null);Y(this,si,ec(()=>(z(this,Xt,nn(w(this,dn))),()=>{z(this,Xt,null)})));z(this,et,e),z(this,mt,n),z(this,hn,s),this.parent=ie.b,z(this,$e,!!w(this,mt).pending),z(this,vt,Ts(()=>{ie.b=this;{var i=fe(this,Te,Rr).call(this);try{z(this,tt,Ye(()=>s(i)))}catch(r){this.error(r)}w(this,Kt)>0?fe(this,Te,hi).call(this):z(this,$e,!1)}return()=>{var r;(r=w(this,Gt))==null||r.remove()}},tc))}is_pending(){return w(this,$e)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!w(this,mt).pending}update_pending_count(e){fe(this,Te,Dr).call(this,e),z(this,dn,w(this,dn)+e),w(this,Xt)&&Gn(w(this,Xt),w(this,dn))}get_effect_pending(){return w(this,si).call(this),m(w(this,Xt))}error(e){var n=w(this,mt).onerror;let s=w(this,mt).failed;if(w(this,fn)||!n&&!s)throw e;w(this,tt)&&(Be(w(this,tt)),z(this,tt,null)),w(this,ze)&&(Be(w(this,ze)),z(this,ze,null)),w(this,wt)&&(Be(w(this,wt)),z(this,wt,null));var i=!1,r=!1;const o=()=>{if(i){Kl();return}i=!0,r&&Vl(),xt.ensure(),z(this,dn,0),w(this,wt)!==null&&xn(w(this,wt),()=>{z(this,wt,null)}),z(this,$e,this.has_pending_snippet()),z(this,tt,fe(this,Te,ui).call(this,()=>(z(this,fn,!1),Ye(()=>w(this,hn).call(this,w(this,et)))))),w(this,Kt)>0?fe(this,Te,hi).call(this):z(this,$e,!1)};var a=J;try{Fe(null),r=!0,n==null||n(e,o),r=!1}catch(c){_n(c,w(this,vt)&&w(this,vt).parent)}finally{Fe(a)}s&&qn(()=>{z(this,wt,fe(this,Te,ui).call(this,()=>{xt.ensure(),z(this,fn,!0);try{return Ye(()=>{s(w(this,et),()=>e,()=>o)})}catch(c){return _n(c,w(this,vt).parent),null}finally{z(this,fn,!1)}}))})}}$e=new WeakMap,et=new WeakMap,kr=new WeakMap,mt=new WeakMap,hn=new WeakMap,vt=new WeakMap,tt=new WeakMap,ze=new WeakMap,wt=new WeakMap,Mt=new WeakMap,Gt=new WeakMap,dn=new WeakMap,Kt=new WeakMap,fn=new WeakMap,Xt=new WeakMap,si=new WeakMap,Te=new WeakSet,xp=function(){try{z(this,tt,Ye(()=>w(this,hn).call(this,w(this,et))))}catch(e){this.error(e)}z(this,$e,!1)},Ep=function(){const e=w(this,mt).pending;e&&(z(this,ze,Ye(()=>e(w(this,et)))),xt.enqueue(()=>{var n=fe(this,Te,Rr).call(this);z(this,tt,fe(this,Te,ui).call(this,()=>(xt.ensure(),Ye(()=>w(this,hn).call(this,n))))),w(this,Kt)>0?fe(this,Te,hi).call(this):(xn(w(this,ze),()=>{z(this,ze,null)}),z(this,$e,!1))}))},Rr=function(){var e=w(this,et);return w(this,$e)&&(z(this,Gt,Et()),w(this,et).before(w(this,Gt)),e=w(this,Gt)),e},ui=function(e){var n=ie,s=J,i=we;ht(w(this,vt)),Fe(w(this,vt)),yn(w(this,vt).ctx);try{return e()}catch(r){return zr(r),null}finally{ht(n),Fe(s),yn(i)}},hi=function(){const e=w(this,mt).pending;w(this,tt)!==null&&(z(this,Mt,document.createDocumentFragment()),w(this,Mt).append(w(this,Gt)),uo(w(this,tt),w(this,Mt))),w(this,ze)===null&&z(this,ze,Ye(()=>e(w(this,et))))},Dr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&fe(n=this.parent,Te,Dr).call(n,e);return}z(this,Kt,w(this,Kt)+e),w(this,Kt)===0&&(z(this,$e,!1),w(this,ze)&&xn(w(this,ze),()=>{z(this,ze,null)}),w(this,Mt)&&(w(this,et).before(w(this,Mt)),z(this,Mt,null)))};function Sn(t,e){return e}function ic(t,e,n){for(var s=[],i=e.length,r=0;r<i;r++)Ii(e[r].e,s,!0);lo(s,()=>{var o=s.length===0&&n!==null;if(o){var a=n,c=a.parentNode;gc(c),c.append(a),t.items.clear(),lt(t,e[0].prev,e[i-1].next)}for(var u=0;u<i;u++){var l=e[u];o||(t.items.delete(l.k),lt(t,l.prev,l.next)),Be(l.e,!o)}t.first===e[0]&&(t.first=e[0].prev)})}function kn(t,e,n,s,i,r=null){var o=t,a=new Map,c=null;{var u=t;o=u.appendChild(Et())}var l=null,h=Si(()=>{var k=n();return fi(k)?k:k==null?[]:pi(k)}),d,f=!0;function p(){rc(I,d,o,e,s),l!==null&&(d.length===0?(l.fragment?(o.before(l.fragment),l.fragment=null):Ci(l.effect),v.first=l.effect):xn(l.effect,()=>{l=null}))}var v=Ts(()=>{d=m(h);for(var k=d.length,T=new Set,E=ne,g=null,S=to(),y=0;y<k;y+=1){var x=d[y],b=s(x,y),_=f?null:a.get(b);_?(Gn(_.v,x),_.i=y,S&&E.skipped_effects.delete(_.e)):(_=oc(f?o:null,g,x,b,y,i,e,n),f&&(_.o=!0,g===null?c=_:g.next=_,g=_),a.set(b,_)),T.add(b)}if(k===0&&r&&!l)if(f)l={fragment:null,effect:Ye(()=>r(o))};else{var M=document.createDocumentFragment(),L=Et();M.append(L),l={fragment:M,effect:Ye(()=>r(L))}}if(!f)if(S){for(const[B,U]of a)T.has(B)||E.skipped_effects.add(U.e);E.oncommit(p),E.ondiscard(()=>{})}else p();m(h)}),I={effect:v,items:a,first:c};f=!1}function rc(t,e,n,s,i){var r=e.length,o=t.items,a=t.first,c,u=null,l=[],h=[],d,f,p,v;for(v=0;v<r;v+=1){if(d=e[v],f=i(d,v),p=o.get(f),t.first??(t.first=p),!p.o){p.o=!0;var I=u?u.next:a;lt(t,u,p),lt(t,p,I),_i(p,I,n),u=p,l=[],h=[],a=u.next;continue}if(p.e.f&je&&Ci(p.e),p!==a){if(c!==void 0&&c.has(p)){if(l.length<h.length){var k=h[0],T;u=k.prev;var E=l[0],g=l[l.length-1];for(T=0;T<l.length;T+=1)_i(l[T],k,n);for(T=0;T<h.length;T+=1)c.delete(h[T]);lt(t,E.prev,g.next),lt(t,u,E),lt(t,g,k),a=k,u=g,v-=1,l=[],h=[]}else c.delete(p),_i(p,a,n),lt(t,p.prev,p.next),lt(t,p,u===null?t.first:u.next),lt(t,u,p),u=p;continue}for(l=[],h=[];a!==null&&a.k!==f;)a.e.f&je||(c??(c=new Set)).add(a),h.push(a),a=a.next;if(a===null)continue;p=a}l.push(p),u=p,a=p.next}if(a!==null||c!==void 0){for(var S=c===void 0?[]:pi(c);a!==null;)a.e.f&je||S.push(a),a=a.next;var y=S.length;if(y>0){var x=r===0?n:null;ic(t,S,x)}}}function oc(t,e,n,s,i,r,o,a){var c=(o&oe)!==0,u=(o&gs)===0,l=c?u?hc(n,!1,!1):nn(n):n,h=o&Se?nn(i):i,d={i:h,v:l,k:s,a:null,e:null,o:!1,prev:e,next:null};try{if(t===null){var f=document.createDocumentFragment();f.append(t=Et())}return d.e=Ye(()=>r(t,l,h,a)),e!==null&&(e.next=d),d}finally{}}function _i(t,e,n){for(var s=t.next?t.next.e.nodes_start:n,i=e?e.e.nodes_start:n,r=t.e.nodes_start;r!==null&&r!==s;){var o=Xn(r);i.before(r),r=o}}function lt(t,e,n){e===null?(t.first=n,t.effect.first=n&&n.e):(e.e.next&&(e.e.next.prev=null),e.next=n,e.e.next=n&&n.e),n===null?t.effect.last=e&&e.e:(n.e.prev&&(n.e.prev.next=null),n.prev=e,n.e.prev=e&&e.e)}function ac(t,e,n,s){const i=Hn()?_s:Si;if(n.length===0&&t.length===0){s(e.map(i));return}var r=ne,o=ie,a=lc();function c(){Promise.all(n.map(u=>cc(u))).then(u=>{a();try{s([...e.map(i),...u])}catch(l){o.f&Tt||_n(l,o)}r==null||r.deactivate(),ys()}).catch(u=>{_n(u,o)})}t.length>0?Promise.all(t).then(()=>{a();try{return c()}finally{r==null||r.deactivate(),ys()}}):c()}function lc(){var t=ie,e=J,n=we,s=ne;return function(r=!0){ht(t),Fe(e),yn(n),r&&(s==null||s.activate())}}function ys(){ht(null),Fe(null),yn(null)}function _s(t){var e=xe|Pe,n=J!==null&&J.f&xe?J:null;return ie!==null&&(ie.f|=vn),{ctx:we,deps:null,effects:null,equals:Br,f:e,fn:t,reactions:null,rv:0,v:Ie,wv:0,parent:n??ie,ac:null}}function cc(t,e){let n=ie;n===null&&Ll();var s=n.b,i=void 0,r=nn(Ie),o=!J,a=new Map;return _c(()=>{var d;var c=Ar();i=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{u===ne&&u.committed&&u.deactivate(),ys()})}catch(f){c.reject(f),ys()}var u=ne;if(o){var l=!s.is_pending();s.update_pending_count(1),u.increment(l),(d=a.get(u))==null||d.reject(wn),a.delete(u),a.set(u,c)}const h=(f,p=void 0)=>{if(u.activate(),p)p!==wn&&(r.f|=Lt,Gn(r,p));else{r.f&Lt&&(r.f^=Lt),Gn(r,f);for(const[v,I]of a){if(a.delete(v),v===u)break;I.reject(wn)}}o&&(s.update_pending_count(-1),u.decrement(l))};c.promise.then(h,f=>h(null,f||"unknown"))}),xi(()=>{for(const c of a.values())c.reject(wn)}),new Promise(c=>{function u(l){function h(){l===i?c(r):u(i)}l.then(h,h)}u(i)})}function he(t){const e=_s(t);return fo(e),e}function Si(t){const e=_s(t);return e.equals=Fr,e}function Vr(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)Be(e[n])}}function uc(t){for(var e=t.parent;e!==null;){if(!(e.f&xe))return e.f&Tt?null:e;e=e.parent}return null}function ki(t){var e,n=ie;ht(uc(t));try{t.f&=~Zt,Vr(t),e=wo(t)}finally{ht(n)}return e}function Gr(t){var e=ki(t);if(t.equals(e)||(ne!=null&&ne.is_fork||(t.v=e),t.wv=mo()),!sn)if(be!==null)ks()&&be.set(t,e);else{var n=t.f&nt?Ce:kt;Ne(t,n)}}let Ti=new Set;const Wt=new Map;let Kr=!1;function nn(t,e){var n={f:0,v:t,reactions:null,equals:Br,rv:0,wv:0};return n}function ae(t,e){const n=nn(t);return fo(n),n}function hc(t,e=!1,n=!0){var i;const s=nn(t);return e||(s.equals=Fr),bn&&n&&we!==null&&we.l!==null&&((i=we.l).s??(i.s=[])).push(s),s}function C(t,e,n=!1){J!==null&&(!ut||J.f&Pr)&&Hn()&&J.f&(xe|_t|bi|Pr)&&!(Oe!=null&&Oe.includes(t))&&ql();let s=n?ct(e):e;return Gn(t,s)}function Gn(t,e){if(!t.equals(e)){var n=t.v;sn?Wt.set(t,e):Wt.set(t,n),t.v=e;var s=xt.ensure();s.capture(t,n),t.f&xe&&(t.f&Pe&&ki(t),Ne(t,t.f&nt?Ce:kt)),t.wv=mo(),Yr(t,Pe),Hn()&&ie!==null&&ie.f&Ce&&!(ie.f&(St|Jt))&&(Je===null?Tc([t]):Je.push(t)),!s.is_fork&&Ti.size>0&&!Kr&&dc()}return e}function dc(){Kr=!1;var t=zt;xs(!0);const e=Array.from(Ti);try{for(const n of e)n.f&Ce&&Ne(n,kt),Qn(n)&&Zn(n)}finally{xs(t)}Ti.clear()}function Xr(t,e=1){var n=m(t),s=e===1?n++:n--;return C(t,n),s}function Kn(t){C(t,t.v+1)}function Yr(t,e){var n=t.reactions;if(n!==null)for(var s=Hn(),i=n.length,r=0;r<i;r++){var o=n[r],a=o.f;if(!(!s&&o===ie)){var c=(a&Pe)===0;if(c&&Ne(o,e),a&xe){var u=o;be==null||be.delete(u),a&Zt||(a&nt&&(o.f|=Zt),Yr(u,kt))}else c&&(a&_t&&st!==null&&st.add(o),tn(o))}}}function ct(t){if(typeof t!="object"||t===null||$t in t)return t;const e=Mr(t);if(e!==Nl&&e!==Rl)return t;var n=new Map,s=fi(t),i=ae(0),r=rn,o=a=>{if(rn===r)return a();var c=J,u=rn;Fe(null),go(r);var l=a();return Fe(c),go(u),l};return s&&n.set("length",ae(t.length)),new Proxy(t,{defineProperty(a,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Ul();var l=n.get(c);return l===void 0?l=o(()=>{var h=ae(u.value);return n.set(c,h),h}):C(l,u.value,!0),!0},deleteProperty(a,c){var u=n.get(c);if(u===void 0){if(c in a){const l=o(()=>ae(Ie));n.set(c,l),Kn(i)}}else C(u,Ie),Kn(i);return!0},get(a,c,u){var f;if(c===$t)return t;var l=n.get(c),h=c in a;if(l===void 0&&(!h||(f=mn(a,c))!=null&&f.writable)&&(l=o(()=>{var p=ct(h?a[c]:Ie),v=ae(p);return v}),n.set(c,l)),l!==void 0){var d=m(l);return d===Ie?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=m(l))}else if(u===void 0){var h=n.get(c),d=h==null?void 0:h.v;if(h!==void 0&&d!==Ie)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(a,c){var d;if(c===$t)return!0;var u=n.get(c),l=u!==void 0&&u.v!==Ie||Reflect.has(a,c);if(u!==void 0||ie!==null&&(!l||(d=mn(a,c))!=null&&d.writable)){u===void 0&&(u=o(()=>{var f=l?ct(a[c]):Ie,p=ae(f);return p}),n.set(c,u));var h=m(u);if(h===Ie)return!1}return l},set(a,c,u,l){var E;var h=n.get(c),d=c in a;if(s&&c==="length")for(var f=u;f<h.v;f+=1){var p=n.get(f+"");p!==void 0?C(p,Ie):f in a&&(p=o(()=>ae(Ie)),n.set(f+"",p))}if(h===void 0)(!d||(E=mn(a,c))!=null&&E.writable)&&(h=o(()=>ae(void 0)),C(h,ct(u)),n.set(c,h));else{d=h.v!==Ie;var v=o(()=>ct(u));C(h,v)}var I=Reflect.getOwnPropertyDescriptor(a,c);if(I!=null&&I.set&&I.set.call(l,u),!d){if(s&&typeof c=="string"){var k=n.get("length"),T=Number(c);Number.isInteger(T)&&T>=k.v&&C(k,T+1)}Kn(i)}return!0},ownKeys(a){m(i);var c=Reflect.ownKeys(a).filter(h=>{var d=n.get(h);return d===void 0||d.v!==Ie});for(var[u,l]of n)l.v!==Ie&&!(u in a)&&c.push(u);return c},setPrototypeOf(){Hl()}})}function Jr(t){try{if(t!==null&&typeof t=="object"&&$t in t)return t[$t]}catch{}return t}function fc(t,e){return Object.is(Jr(t),Jr(e))}var Qr,Zr,$r,eo;function pc(){if(Qr===void 0){Qr=window,Zr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;$r=mn(e,"firstChild").get,eo=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 Et(t=""){return document.createTextNode(t)}function Tn(t){return $r.call(t)}function Xn(t){return eo.call(t)}function P(t,e){return Tn(t)}function Le(t,e=!1){{var n=Tn(t);return n instanceof Comment&&n.data===""?Xn(n):n}}function j(t,e=1,n=!1){let s=t;for(;e--;)s=Xn(s);return s}function gc(t){t.textContent=""}function to(){return!1}let no=!1;function mc(){no||(no=!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 Ss(t){var e=J,n=ie;Fe(null),ht(null);try{return t()}finally{Fe(e),ht(n)}}function vc(t,e,n,s=n){t.addEventListener(e,()=>Ss(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),mc()}function wc(t){ie===null&&(J===null&&Wl(),Fl()),sn&&Bl()}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 It(t,e,n){var s=ie;s!==null&&s.f&je&&(t|=je);var i={ctx:we,deps:null,nodes_start:null,nodes_end:null,f:t|Pe|nt,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Zn(i),i.f|=vi}catch(a){throw Be(i),a}else e!==null&&tn(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes_start===null&&r.first===r.last&&!(r.f&vn)&&(r=r.first,t&_t&&t&Qt&&r!==null&&(r.f|=Qt)),r!==null&&(r.parent=s,s!==null&&bc(r,s),J!==null&&J.f&xe&&!(t&Jt))){var o=J;(o.effects??(o.effects=[])).push(r)}return i}function ks(){return J!==null&&!ut}function xi(t){const e=It(mi,null,!1);return Ne(e,Ce),e.teardown=t,e}function Yn(t){wc();var e=ie.f,n=!J&&(e&St)!==0&&(e&vi)===0;if(n){var s=we;(s.e??(s.e=[])).push(t)}else return so(t)}function so(t){return It(gi|Ml,t,!1)}function yc(t){xt.ensure();const e=It(Jt|vn,t,!0);return(n={})=>new Promise(s=>{n.outro?xn(e,()=>{Be(e),s(void 0)}):(Be(e),s(void 0))})}function io(t){return It(gi,t,!1)}function _c(t){return It(bi|vn,t,!0)}function Ei(t,e=0){return It(mi|e,t,!0)}function H(t,e=[],n=[],s=[]){ac(s,e,n,i=>{It(mi,()=>t(...i.map(m)),!0)})}function Ts(t,e=0){var n=It(_t|e,t,!0);return n}function Ye(t){return It(St|vn,t,!0)}function ro(t){var e=t.teardown;if(e!==null){const n=sn,s=J;ho(!0),Fe(null);try{e.call(null)}finally{ho(n),Fe(s)}}}function oo(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&Ss(()=>{i.abort(wn)});var s=n.next;n.f&Jt?n.parent=null:Be(n,e),n=s}}function Sc(t){for(var e=t.first;e!==null;){var n=e.next;e.f&St||Be(e),e=n}}function Be(t,e=!0){var n=!1;(e||t.f&Lr)&&t.nodes_start!==null&&t.nodes_end!==null&&(kc(t.nodes_start,t.nodes_end),n=!0),oo(t,e&&!n),Es(t,0),Ne(t,Tt);var s=t.transitions;if(s!==null)for(const r of s)r.stop();ro(t);var i=t.parent;i!==null&&i.first!==null&&ao(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function kc(t,e){for(;t!==null;){var n=t===e?null:Xn(t);t.remove(),t=n}}function ao(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 xn(t,e,n=!0){var s=[];Ii(t,s,!0),lo(s,()=>{n&&Be(t),e&&e()})}function lo(t,e){var n=t.length;if(n>0){var s=()=>--n||e();for(var i of t)i.out(s)}else e()}function Ii(t,e,n){if(!(t.f&je)){if(t.f^=je,t.transitions!==null)for(const o of t.transitions)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var i=s.next,r=(s.f&Qt)!==0||(s.f&St)!==0&&(t.f&_t)!==0;Ii(s,e,r?n:!1),s=i}}}function Ci(t){co(t,!0)}function co(t,e){if(t.f&je){t.f^=je,t.f&Ce||(Ne(t,Pe),tn(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Qt)!==0||(n.f&St)!==0;co(n,i?e:!1),n=s}if(t.transitions!==null)for(const r of t.transitions)(r.is_global||e)&&r.in()}}function uo(t,e){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 zt=!1;function xs(t){zt=t}let sn=!1;function ho(t){sn=t}let J=null,ut=!1;function Fe(t){J=t}let ie=null;function ht(t){ie=t}let Oe=null;function fo(t){J!==null&&(Oe===null?Oe=[t]:Oe.push(t))}let Ae=null,Ue=0,Je=null;function Tc(t){Je=t}let po=1,Jn=0,rn=Jn;function go(t){rn=t}function mo(){return++po}function Qn(t){var e=t.f;if(e&Pe)return!0;if(e&xe&&(t.f&=~Zt),e&kt){var n=t.deps;if(n!==null)for(var s=n.length,i=0;i<s;i++){var r=n[i];if(Qn(r)&&Gr(r),r.wv>t.wv)return!0}e&nt&&be===null&&Ne(t,Ce)}return!1}function vo(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Oe!=null&&Oe.includes(t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&xe?vo(r,e,!1):e===r&&(n?Ne(r,Pe):r.f&Ce&&Ne(r,kt),tn(r))}}function wo(t){var p;var e=Ae,n=Ue,s=Je,i=J,r=Oe,o=we,a=ut,c=rn,u=t.f;Ae=null,Ue=0,Je=null,J=u&(St|Jt)?null:t,Oe=null,yn(t.ctx),ut=!1,rn=++Jn,t.ac!==null&&(Ss(()=>{t.ac.abort(wn)}),t.ac=null);try{t.f|=wi;var l=t.fn,h=l(),d=t.deps;if(Ae!==null){var f;if(Es(t,Ue),d!==null&&Ue>0)for(d.length=Ue+Ae.length,f=0;f<Ae.length;f++)d[Ue+f]=Ae[f];else t.deps=d=Ae;if(zt&&ks()&&t.f&nt)for(f=Ue;f<d.length;f++)((p=d[f]).reactions??(p.reactions=[])).push(t)}else d!==null&&Ue<d.length&&(Es(t,Ue),d.length=Ue);if(Hn()&&Je!==null&&!ut&&d!==null&&!(t.f&(xe|kt|Pe)))for(f=0;f<Je.length;f++)vo(Je[f],t);return i!==null&&i!==t&&(Jn++,Je!==null&&(s===null?s=Je:s.push(...Je))),t.f&Lt&&(t.f^=Lt),h}catch(v){return zr(v)}finally{t.f^=wi,Ae=e,Ue=n,Je=s,J=i,Oe=r,yn(o),ut=a,rn=c}}function xc(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())}}n===null&&e.f&xe&&(Ae===null||!Ae.includes(e))&&(Ne(e,kt),e.f&nt&&(e.f^=nt,e.f&=~Zt),Vr(e),Es(e,0))}function Es(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)xc(t,n[s])}function Zn(t){var e=t.f;if(!(e&Tt)){Ne(t,Ce);var n=ie,s=zt;ie=t,zt=!0;try{e&_t?Sc(t):oo(t),ro(t);var i=wo(t);t.teardown=typeof i=="function"?i:null,t.wv=po;var r;di&&Yl&&t.f&Pe&&t.deps}finally{zt=s,ie=n}}}async function Ec(){await Promise.resolve(),Zl()}function m(t){var e=t.f,n=(e&xe)!==0;if(J!==null&&!ut){var s=ie!==null&&(ie.f&Tt)!==0;if(!s&&!(Oe!=null&&Oe.includes(t))){var i=J.deps;if(J.f&wi)t.rv<Jn&&(t.rv=Jn,Ae===null&&i!==null&&i[Ue]===t?Ue++:Ae===null?Ae=[t]:Ae.includes(t)||Ae.push(t));else{(J.deps??(J.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[J]:r.includes(J)||r.push(J)}}}if(sn){if(Wt.has(t))return Wt.get(t);if(n){var o=t,a=o.v;return(!(o.f&Ce)&&o.reactions!==null||yo(o))&&(a=ki(o)),Wt.set(o,a),a}}else n&&!(be!=null&&be.has(t))&&(o=t,Qn(o)&&Gr(o),zt&&ks()&&!(o.f&nt)&&bo(o));if(be!=null&&be.has(t))return be.get(t);if(t.f&Lt)throw t.v;return t.v}function bo(t){if(t.deps!==null){t.f^=nt;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&xe&&!(e.f&nt)&&bo(e)}}function yo(t){if(t.v===Ie)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Wt.has(e)||e.f&xe&&yo(e))return!0;return!1}function $n(t){var e=ut;try{return ut=!0,t()}finally{ut=e}}const Ic=-7169;function Ne(t,e){t.f=t.f&Ic|e}const _o=new Set,Ni=new Set;function Cc(t,e,n,s={}){function i(r){if(s.capture||es.call(e,r),!r.cancelBubble)return Ss(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?qn(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function Ct(t,e,n,s,i){var r={capture:s,passive:i},o=Cc(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&xi(()=>{e.removeEventListener(t,o,r)})}function Is(t){for(var e=0;e<t.length;e++)_o.add(t[e]);for(var n of Ni)n(t)}let So=null;function es(t){var I;var e=this,n=e.ownerDocument,s=t.type,i=((I=t.composedPath)==null?void 0:I.call(t))||[],r=i[0]||t.target;So=t;var o=0,a=So===t&&t.__root;if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;c<=u&&(o=c)}if(r=i[o]||t.target,r!==e){Il(t,"currentTarget",{configurable:!0,get(){return r||n}});var l=J,h=ie;Fe(null),ht(null);try{for(var d,f=[];r!==null;){var p=r.assignedSlot||r.parentNode||r.host||null;try{var v=r["__"+s];v!=null&&(!r.disabled||t.target===r)&&v.call(r,t)}catch(k){d?f.push(k):d=k}if(t.cancelBubble||p===e||p===null)break;r=p}if(d){for(let k of f)queueMicrotask(()=>{throw k});throw d}}finally{t.__root=e,delete t.currentTarget,Fe(l),ht(h)}}}function ko(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function ts(t,e){var n=ie;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function q(t,e){var n=(e&kl)!==0,s=(e&Tl)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=ko(r?t:"<!>"+t),n||(i=Tn(i)));var o=s||Zr?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=Tn(o),c=o.lastChild;ts(a,c)}else ts(o,o);return o}}function Nc(t,e,n="svg"){var s=!t.startsWith("<!>"),i=`<${n}>${s?t:"<!>"+t}</${n}>`,r;return()=>{if(!r){var o=ko(i),a=Tn(o);r=Tn(a)}var c=r.cloneNode(!0);return ts(c,c),c}}function Cs(t,e){return Nc(t,e,"svg")}function En(t=""){{var e=Et(t+"");return ts(e,e),e}}function Nt(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Et();return t.append(e,n),ts(e,n),t}function O(t,e){t!==null&&t.before(e)}const Rc=["touchstart","touchmove"];function Dc(t){return Rc.includes(t)}function Q(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 Mc(t,e){return Oc(t,e)}const In=new Map;function Oc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:o=!0}){pc();var a=new Set,c=h=>{for(var d=0;d<h.length;d++){var f=h[d];if(!a.has(f)){a.add(f);var p=Dc(f);e.addEventListener(f,es,{passive:p});var v=In.get(f);v===void 0?(document.addEventListener(f,es,{passive:p}),In.set(f,1)):In.set(f,v+1)}}};c(pi(_o)),Ni.add(c);var u=void 0,l=yc(()=>{var h=n??e.appendChild(Et());return nc(h,{pending:()=>{}},d=>{if(r){Bt({});var f=we;f.c=r}i&&(s.$$events=i),u=t(d,s)||{},r&&Ft()}),()=>{var p;for(var d of a){e.removeEventListener(d,es);var f=In.get(d);--f===0?(document.removeEventListener(d,es),In.delete(d)):In.set(d,f)}Ni.delete(c),h!==n&&((p=h.parentNode)==null||p.removeChild(h))}});return Ac.set(u,l),u}let Ac=new WeakMap;class To{constructor(e,n=!0){yt(this,"anchor");Y(this,rt,new Map);Y(this,bt,new Map);Y(this,Ge,new Map);Y(this,pn,new Set);Y(this,cs,!0);Y(this,us,()=>{var e=ne;if(w(this,rt).has(e)){var n=w(this,rt).get(e),s=w(this,bt).get(n);if(s)Ci(s),w(this,pn).delete(n);else{var i=w(this,Ge).get(n);i&&(w(this,bt).set(n,i.effect),w(this,Ge).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,o]of w(this,rt)){if(w(this,rt).delete(r),r===e)break;const a=w(this,Ge).get(o);a&&(Be(a.effect),w(this,Ge).delete(o))}for(const[r,o]of w(this,bt)){if(r===n||w(this,pn).has(r))continue;const a=()=>{if(Array.from(w(this,rt).values()).includes(r)){var u=document.createDocumentFragment();uo(o,u),u.append(Et()),w(this,Ge).set(r,{effect:o,fragment:u})}else Be(o);w(this,pn).delete(r),w(this,bt).delete(r)};w(this,cs)||!s?(w(this,pn).add(r),xn(o,a,!1)):a()}}});Y(this,ii,e=>{w(this,rt).delete(e);const n=Array.from(w(this,rt).values());for(const[s,i]of w(this,Ge))n.includes(s)||(Be(i.effect),w(this,Ge).delete(s))});this.anchor=e,z(this,cs,n)}ensure(e,n){var s=ne,i=to();if(n&&!w(this,bt).has(e)&&!w(this,Ge).has(e))if(i){var r=document.createDocumentFragment(),o=Et();r.append(o),w(this,Ge).set(e,{effect:Ye(()=>n(o)),fragment:r})}else w(this,bt).set(e,Ye(()=>n(this.anchor)));if(w(this,rt).set(s,e),i){for(const[a,c]of w(this,bt))a===e?s.skipped_effects.delete(c):s.skipped_effects.add(c);for(const[a,c]of w(this,Ge))a===e?s.skipped_effects.delete(c.effect):s.skipped_effects.add(c.effect);s.oncommit(w(this,us)),s.ondiscard(w(this,ii))}else w(this,us).call(this)}}rt=new WeakMap,bt=new WeakMap,Ge=new WeakMap,pn=new WeakMap,cs=new WeakMap,us=new WeakMap,ii=new WeakMap;function Ri(t){we===null&&Pl(),bn&&we.l!==null?Pc(we).m.push(t):Yn(()=>{const e=$n(t);if(typeof e=="function")return e})}function Pc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function $(t,e,n=!1){var s=new To(t),i=n?Qt:0;function r(o,a){s.ensure(o,a)}Ts(()=>{var o=!1;e((a,c=!0)=>{o=!0,r(c,a)}),o||r(!1,null)},i)}function xo(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 Eo(t,e,n){var s=new To(t);Ts(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},Qt)}function jt(t,e){io(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function Io(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=Io(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Lc(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Io(t))&&(s&&(s+=" "),s+=e);return s}function Cn(t){return typeof t=="object"?Lc(t):t??""}function Bc(t,e,n){var s=t==null?"":""+t;return e&&(s=s?s+" "+e:e),s===""?null:s}function Ut(t,e,n,s,i,r){var o=t.__className;if(o!==n||o===void 0){var a=Bc(n,s);a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a),t.__className=n}return r}function Co(t,e,n=!1){if(t.multiple){if(e==null)return;if(!fi(e))return Gl();for(var s of t.options)s.selected=e.includes(No(s));return}for(s of t.options){var i=No(s);if(fc(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Fc(t){var e=new MutationObserver(()=>{Co(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),xi(()=>{e.disconnect()})}function No(t){return"__value"in t?t.__value:t.value}const Wc=Symbol("is custom element"),zc=Symbol("is html");function jc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ee(t,e,n,s){var i=Uc(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[Al]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Hc(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Uc(t){return t.__attributes??(t.__attributes={[Wc]:t.nodeName.includes("-"),[zc]:t.namespaceURI===xl})}var Ro=new Map;function Hc(t){var e=t.getAttribute("is")||t.nodeName,n=Ro.get(e);if(n)return n;Ro.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=Mr(i)}return n}function qc(t,e,n=e){var s=new WeakSet;vc(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Di(t)?Mi(r):r,n(r),ne!==null&&s.add(ne),await Ec(),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))}}}),$n(e)==null&&t.value&&(n(Di(t)?Mi(t.value):t.value),ne!==null&&s.add(ne)),Ei(()=>{var i=e();if(t===document.activeElement){var r=ws??ne;if(s.has(r))return}Di(t)&&i===Mi(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Di(t){var e=t.type;return e==="number"||e==="range"}function Mi(t){return t===""?null:+t}function Do(t,e){return t===e||(t==null?void 0:t[$t])===e}function Vc(t={},e,n,s){return io(()=>{var i,r;return Ei(()=>{i=r,r=[],$n(()=>{t!==n(...r)&&(e(t,...r),i&&Do(n(...i),t)&&e(null,...i))})}),()=>{qn(()=>{r&&Do(n(...r),t)&&e(null,...r)})}}),t}let Ns=!1;function Gc(t){var e=Ns;try{return Ns=!1,[t(),Ns]}finally{Ns=e}}function He(t,e,n,s){var E;var i=!bn||(n&bl)!==0,r=(n&_l)!==0,o=(n&Sl)!==0,a=s,c=!0,u=()=>(c&&(c=!1,a=o?$n(s):s),a),l;if(r){var h=$t in t||Ol in t;l=((E=mn(t,e))==null?void 0:E.set)??(h&&e in t?g=>t[e]=g:void 0)}var d,f=!1;r?[d,f]=Gc(()=>t[e]):d=t[e],d===void 0&&s!==void 0&&(d=u(),l&&(i&&jl(),l(d)));var p;if(i?p=()=>{var g=t[e];return g===void 0?u():(c=!0,g)}:p=()=>{var g=t[e];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&!(n&yl))return p;if(l){var v=t.$$legacy;return function(g,S){return arguments.length>0?((!i||!S||v||f)&&l(S?p():g),g):p()}}var I=!1,k=(n&wl?_s:Si)(()=>(I=!1,p()));r&&m(k);var T=ie;return function(g,S){if(arguments.length>0){const y=S?m(k):i&&r?ct(g):g;return C(k,y),I=!0,a!==void 0&&(a=y),g}return sn&&I||T.f&Tt?k.v:m(k)}}function Mo(){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 Oi(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 Ai(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 Oo(){const t="uniqueUserID";let e=Ai(t);return e||(e=Mo(),Oi(t,e,365)),e}function qe(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Ai("uniqueUserID");r||(r=Oo());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=Ai("sessionID");c||(c=Mo(),Oi("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 Ao={},Kc=function(t,e,n,s,i){var r=new Worker(Ao[e]||(Ao[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},Qe=Uint8Array,We=Uint16Array,Rs=Int32Array,Ds=new Qe([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]),Ms=new Qe([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]),Pi=new Qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Po=function(t,e){for(var n=new We(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Rs(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}},Lo=Po(Ds,2),Xc=Lo.b,Os=Lo.r;Xc[28]=258,Os[258]=28;for(var Yc=Po(Ms,0),Li=Yc.r,As=new We(32768),ce=0;ce<32768;++ce){var Ht=(ce&43690)>>1|(ce&21845)<<1;Ht=(Ht&52428)>>2|(Ht&13107)<<2,Ht=(Ht&61680)>>4|(Ht&3855)<<4,As[ce]=((Ht&65280)>>8|(Ht&255)<<8)>>1}for(var Nn=function(t,e,n){for(var s=t.length,i=0,r=new We(e);i<s;++i)t[i]&&++r[t[i]-1];var o=new We(e);for(i=1;i<e;++i)o[i]=o[i-1]+r[i-1]<<1;var a;if(n){a=new We(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[As[h]>>c]=u}else for(a=new We(s),i=0;i<s;++i)t[i]&&(a[i]=As[o[t[i]-1]++]>>15-t[i]);return a},qt=new Qe(288),ce=0;ce<144;++ce)qt[ce]=8;for(var ce=144;ce<256;++ce)qt[ce]=9;for(var ce=256;ce<280;++ce)qt[ce]=7;for(var ce=280;ce<288;++ce)qt[ce]=8;for(var ns=new Qe(32),ce=0;ce<32;++ce)ns[ce]=5;var Bo=Nn(qt,9,0),Fo=Nn(ns,5,0),Bi=function(t){return(t+7)/8|0},Wo=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Qe(t.subarray(e,n))},Jc=["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"],zo=function(t,e,n){var s=new Error(e||Jc[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,zo),!n)throw s;return s},dt=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},Rn=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},Ps=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:ji,l:0};if(i==1){var o=new Qe(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(S,y){return S.f-y.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 f=new We(d+1),p=Ls(n[l-1],f,0);if(p>e){var s=0,v=0,I=p-e,k=1<<I;for(r.sort(function(y,x){return f[x.s]-f[y.s]||y.f-x.f});s<i;++s){var T=r[s].s;if(f[T]>e)v+=k-(1<<p-f[T]),f[T]=e;else break}for(v>>=I;v>0;){var E=r[s].s;f[E]<e?v-=1<<e-f[E]++-1:++s}for(;s>=0&&v;--s){var g=r[s].s;f[g]==e&&(--f[g],++v)}p=e}return{t:new Qe(f),l:p}},Ls=function(t,e,n){return t.s==-1?Math.max(Ls(t.l,e,n+1),Ls(t.r,e,n+1)):e[t.s]=n},Fi=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new We(++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}},Dn=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Wi=function(t,e,n){var s=n.length,i=Bi(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},zi=function(t,e,n,s,i,r,o,a,c,u,l){dt(e,l++,n),++i[256];for(var h=Ps(i,15),d=h.t,f=h.l,p=Ps(r,15),v=p.t,I=p.l,k=Fi(d),T=k.c,E=k.n,g=Fi(v),S=g.c,y=g.n,x=new We(19),b=0;b<T.length;++b)++x[T[b]&31];for(var b=0;b<S.length;++b)++x[S[b]&31];for(var _=Ps(x,7),M=_.t,L=_.l,B=19;B>4&&!M[Pi[B-1]];--B);var U=u+5<<3,W=Dn(i,qt)+Dn(r,ns)+o,F=Dn(i,d)+Dn(r,v)+o+14+3*B+Dn(x,M)+2*x[16]+3*x[17]+7*x[18];if(c>=0&&U<=W&&U<=F)return Wi(e,l,t.subarray(c,c+u));var K,Z,D,ee;if(dt(e,l,1+(F<W)),l+=2,F<W){K=Nn(d,f,0),Z=d,D=Nn(v,I,0),ee=v;var N=Nn(M,L,0);dt(e,l,E-257),dt(e,l+5,y-1),dt(e,l+10,B-4),l+=14;for(var b=0;b<B;++b)dt(e,l+3*b,M[Pi[b]]);l+=3*B;for(var A=[T,S],te=0;te<2;++te)for(var se=A[te],b=0;b<se.length;++b){var le=se[b]&31;dt(e,l,N[le]),l+=M[le],le>15&&(dt(e,l,se[b]>>5&127),l+=se[b]>>12)}}else K=Bo,Z=qt,D=Fo,ee=ns;for(var b=0;b<a;++b){var V=s[b];if(V>255){var le=V>>18&31;Rn(e,l,K[le+257]),l+=Z[le+257],le>7&&(dt(e,l,V>>23&31),l+=Ds[le]);var Re=V&31;Rn(e,l,D[Re]),l+=ee[Re],Re>3&&(Rn(e,l,V>>5&8191),l+=Ms[Re])}else Rn(e,l,K[V]),l+=Z[V]}return Rn(e,l,K[256]),l+Z[256]},jo=new Rs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ji=new Qe(0),Uo=function(t,e,n,s,i,r){var o=r.z||t.length,a=new Qe(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=jo[e-1],d=h>>13,f=h&8191,p=(1<<n)-1,v=r.p||new We(32768),I=r.h||new We(p+1),k=Math.ceil(n/3),T=2*k,E=function(at){return(t[at]^t[at+1]<<k^t[at+2]<<T)&p},g=new Rs(25e3),S=new We(288),y=new We(32),x=0,b=0,_=r.i||0,M=0,L=r.w||0,B=0;_+2<o;++_){var U=E(_),W=_&32767,F=I[U];if(v[W]=F,I[U]=W,L<=_){var K=o-_;if((x>7e3||M>24576)&&(K>423||!u)){l=zi(t,c,0,g,S,y,b,M,B,_-B,l),M=x=b=0,B=_;for(var Z=0;Z<286;++Z)S[Z]=0;for(var Z=0;Z<30;++Z)y[Z]=0}var D=2,ee=0,N=f,A=W-F&32767;if(K>2&&U==E(_-A))for(var te=Math.min(d,K)-1,se=Math.min(32767,_),le=Math.min(258,K);A<=se&&--N&&W!=F;){if(t[_+D]==t[_+D-A]){for(var V=0;V<le&&t[_+V]==t[_+V-A];++V);if(V>D){if(D=V,ee=A,V>te)break;for(var Re=Math.min(A,V-2),De=0,Z=0;Z<Re;++Z){var Me=_-A+Z&32767,At=v[Me],ot=Me-At&32767;ot>De&&(De=ot,F=Me)}}}W=F,F=v[W],A+=W-F&32767}if(ee){g[M++]=268435456|Os[D]<<18|Li[ee];var R=Os[D]&31,G=Li[ee]&31;b+=Ds[R]+Ms[G],++S[257+R],++y[G],L=_+D,++x}else g[M++]=t[_],++S[t[_]]}}for(_=Math.max(_,L);_<o;++_)g[M++]=t[_],++S[t[_]];l=zi(t,c,u,g,S,y,b,M,B,_-B,l),u||(r.r=l&7|c[l/8|0]<<3,l-=7,r.h=I,r.p=v,r.i=_,r.w=L)}else{for(var _=r.w||0;_<o+u;_+=65535){var ue=_+65535;ue>=o&&(c[l/8|0]=u,ue=o),l=Wi(c,l+1,t.subarray(_,ue))}r.i=o}return Wo(a,0,s+Bi(l)+i)},Ho=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}(),qo=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=Ho[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},Ui=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new Qe(r.length+t.length);o.set(r),o.set(t,r.length),t=o,i.w=r.length}return Uo(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)},Qc=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},Vo=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},Bs=[],Zc=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},$c=function(t,e,n,s){if(!Bs[n]){for(var i="",r={},o=t.length-1,a=0;a<o;++a)i=Vo(t[a],i,r);Bs[n]={c:Vo(t[o],i,r),e:r}}var c=Qc({},Bs[n].e);return Kc(Bs[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,Zc(c),s)},eu=function(){return[Qe,We,Rs,Ds,Ms,Pi,Os,Li,Bo,qt,Fo,ns,As,jo,ji,Nn,dt,Rn,Ps,Ls,Fi,Dn,Wi,zi,Bi,Wo,Uo,Ui,su,Go]},tu=function(){return[Ko,Xo,Fs,qo,Ho]},Go=function(t){return postMessage(t,[t.buffer])},nu=function(t,e,n,s,i,r){var o=$c(n,s,i,function(a,c){o.terminate(),r(a,c)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Fs=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Ko=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&&Fs(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)}},Xo=function(t){return 10+(t.filename?t.filename.length+1:0)};function su(t,e){return Ui(t,e||{},0,0)}function iu(t,e,n){return n||(n=e,e={}),typeof n!="function"&&zo(7),nu(t,e,[eu,tu,function(){return[Yo]}],function(s){return Go(Yo(s.data[0],s.data[1]))},2,n)}function Yo(t,e){e||(e={});var n=qo(),s=t.length;n.p(t);var i=Ui(t,e,Xo(e),8),r=i.length;return Ko(i,e),Fs(i,r-8,n.d()),Fs(i,r-4,s),i}var ru=typeof TextDecoder<"u"&&new TextDecoder,ou=0;try{ru.decode(ji,{stream:!0}),ou=1}catch{}class Jo{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 au{constructor(e){this.dict=new Jo,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 Jo}}class lu{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=cu(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=Mn[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=Mn[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=Mn[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=Mn[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=Mn[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=Mn[i.operator];r&&n.some(o=>r(o,i.value))&&this.trigger(i.name)})}}const Mn={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},cu=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 uu{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 Qo={htmlmasked:"hidden",masked:"obscured"},ft=!(typeof window>"u"),hu=ft&&navigator.userAgent.match(/firefox|fxios/i),du=1e5;let Hi=ft?Date.now()-performance.now():0;function qi(){Hi=Date.now()-performance.now()}function On(){return Hi}const it=ft&&performance.now?()=>Math.round(performance.now()+Hi):()=>Date.now(),Vi="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function Zo(t){return t.trim().replace(/\s+/g," ")}function $o(t){return t.startsWith("https://")||t.startsWith("http://")}const Ws="https://docs.openreplay.com",ea={};function Vt(t,e,n="/"){ea[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${Ws}${n} for more information.`),ea[t]=!0)}function Gi(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&Vt('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function on(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(Qo[e]&&Vt(`"${n}" attribute`,`"${Qo[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function fu(t){try{return!!t.contentDocument}catch{return!1}}function ta(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 na(t){return t.toString(16).padStart(2,"0")}function pu(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,na).join("")):Array.from({length:t},()=>na(Math.floor(Math.random()*16))).join("")}function sa(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function Ki(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function ia(t,e){if(e)return new MutationObserver(t);{const n=Ki("MutationObserver");return new window[n](t)}}function ra(t,e,n,s,i){if(!ta(t))return;let r="addEventListener";i||(r=Ki("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 oa(t,e,n,s,i){if(!ta(t))return;let r="removeEventListener";i||(r=Ki("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 gu{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 mu=new gu;function vu(t){mu.addTask(t)}function aa(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]=aa(r||{},i):n[s]=i}return n}function an(t){return[0,t]}function wu(t,e){return[5,t,e]}function bu(t,e){return[6,t,e]}function yu(){return[7]}function _u(t,e,n,s,i){return[8,t,e,n,s,i]}function Su(t,e,n){return[9,t,e,n]}function ku(t,e,n){return[10,t,e,n]}function Tu(t){return[11,t]}function la(t,e){return[13,t,e]}function xu(t,e){return[14,t,e]}function Eu(t,e,n){return[16,t,e,n]}function Iu(t,e,n){return[18,t,e,n]}function Cu(t,e){return[19,t,e]}function Nu(t,e){return[20,t,e]}function Ru(t,e){return[22,t,e]}function Du(t,e,n,s,i,r,o,a,c){return[23,t,e,n,s,i,r,o,a,c]}function Mu(t,e,n){return[24,t,e,n]}function Ou(t,e){return[27,t,e]}function Au(t){return[28,t]}function Pu(t){return[29,t]}function ca(t,e){return[30,t,e]}function Lu(t,e,n,s){return[49,t,e,n,s]}function Bu(t,e){return[54,t,e]}function Fu(t){return[55,t]}function ua(t,e,n,s){return[57,t,e,n,s]}function ha(t){return[58,t]}function Xi(t,e,n,s){return[60,t,e,n,s]}function Wu(t,e,n){return[61,t,e,n]}function zu(t,e){return[63,t,e]}function ju(t,e){return[64,t,e]}function Uu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function Yi(t,e){return[70,t,e]}function da(t,e,n){return[71,t,e,n]}function Ji(t,e,n,s){return[73,t,e,n,s]}function fa(t,e){return[75,t,e]}function pa(t,e){return[76,t,e]}function Hu(t,e){return[77,t,e]}function Qi(t,e,n,s){return[78,t,e,n,s]}function zs(t,e,n,s,i,r,o,a,c){return[83,t,e,n,s,i,r,o,a,c]}function qu(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function Vu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function ga(t,e,n){return[113,t,e,n]}function Gu(t){return[114,t]}function ma(t){return[115,t]}function va(t,e,n,s,i,r,o,a,c,u){return[116,t,e,n,s,i,r,o,a,c,u]}function js(t){return[117,t]}function ln(t){return[118,t]}function Ku(t,e){return[119,t,e]}function Xu(t){return[120,t]}function Yu(t,e,n,s){return[122,t,e,n,s]}const Zi=ft&&"performance"in window&&"memory"in performance?performance:{memory:{}},$i=ft?(navigator.deviceMemory||0)*1024:0,er=Zi.memory.jsHeapSizeLimit||0;function Ju(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(Lu(s,i,Zi.memory.totalJSHeapSize||0,Zi.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 wa="__or__watched_tags__";class Qu{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(wa)??"[]");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(wa,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 Zu={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"'},$u={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Us={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"},eh={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},th={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"},nh={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"},ba={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"},sh={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"},Pn={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"},ih={...Pn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},ya={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},_a={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"},Sa={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},rh={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},ka={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},oh={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"},Ta={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"},xa={fontWeight:"bold"},ah={fontSize:"13px",lineHeight:"auto"},Ea={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},lh={...Ea,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},ch={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},uh={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},Ia={Standard:{width:1280,height:720}};class hh{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 dh(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 fh(){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 ph(){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 gh(){const t=document.createElement("style");t.type="text/css",t.innerText=`@keyframes spin {
1
+ (function(re,oe){typeof exports=="object"&&typeof module<"u"?module.exports=oe():typeof define=="function"&&define.amd?define(oe):(re=typeof globalThis<"u"?globalThis:re||self,re.WineaterChatbot=oe())})(this,function(){"use strict";var Tp=Object.defineProperty;var ml=re=>{throw TypeError(re)};var xp=(re,oe,Se)=>oe in re?Tp(re,oe,{enumerable:!0,configurable:!0,writable:!0,value:Se}):re[oe]=Se;var wt=(re,oe,Se)=>xp(re,typeof oe!="symbol"?oe+"":oe,Se),Cr=(re,oe,Se)=>oe.has(re)||ml("Cannot "+Se);var b=(re,oe,Se)=>(Cr(re,oe,"read from private field"),Se?Se.call(re):oe.get(re)),Y=(re,oe,Se)=>oe.has(re)?ml("Cannot add the same private member more than once"):oe instanceof WeakSet?oe.add(re):oe.set(re,Se),z=(re,oe,Se,ms)=>(Cr(re,oe,"write to private field"),ms?ms.call(re,Se):oe.set(re,Se),Se),fe=(re,oe,Se)=>(Cr(re,oe,"access private method"),Se);var ll,Fn,Wn,ln,cn,ls,zn,jn,ke,Nr,gn,Rr,vl,bl,$e,et,Tr,gt,un,mt,tt,ze,vt,Dt,Vt,hn,Gt,dn,Kt,ii,Te,Ep,Ip,Dr,hi,di,Ar,ot,bt,Ge,fn,cs,us,ri,Xt,At,Un,cl,ul;const re="5";typeof window<"u"&&((ll=window.__svelte??(window.__svelte={})).v??(ll.v=new Set)).add(re);const oe=1,Se=2,ms=16,wl=1,yl=2,_l=4,Sl=8,kl=16,Tl=1,xl=2,Ce=Symbol(),El="http://www.w3.org/1999/xhtml",fi=!1;var pi=Array.isArray,Il=Array.prototype.indexOf,gi=Array.from,Cl=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,Nl=Object.getOwnPropertyDescriptors,Rl=Object.prototype,Dl=Array.prototype,Mr=Object.getPrototypeOf,Or=Object.isExtensible;function Al(t){for(var e=0;e<t.length;e++)t[e]()}function Pr(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const xe=2,mi=4,vi=8,yt=16,_t=32,Yt=64,vs=128,nt=512,Ne=1024,Pe=2048,St=4096,je=8192,kt=16384,bi=32768,Jt=65536,Lr=1<<17,Br=1<<18,vn=1<<19,Ml=1<<20,Qt=32768,wi=1<<21,yi=1<<22,Pt=1<<23,Zt=Symbol("$state"),Ol=Symbol("legacy props"),Pl=Symbol(""),bn=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 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){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Wl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function zl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function jl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ul(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Hl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ql(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Vl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Gl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Kl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Xl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Fr(t){return t===this.v}function Yl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wr(t){return!Yl(t,this.v)}let wn=!1,Jl=!1;function Ql(){wn=!0}let be=null;function yn(t){be=t}function Lt(t,e=!1,n){be={p:be,i:!1,c:null,e:null,s:t,x:null,l:wn&&!e?{s:null,u:null,$:[]}:null}}function Bt(t){var e=be,n=e.e;if(n!==null){e.e=null;for(var s of n)io(s)}return t!==void 0&&(e.x=t),e.i=!0,be=e.p,t??{}}function Hn(){return!wn||be!==null&&be.l===null}let $t=[];function zr(){var t=$t;$t=[],Al(t)}function qn(t){if($t.length===0&&!Vn){var e=$t;queueMicrotask(()=>{e===$t&&zr()})}$t.push(t)}function Zl(){for(;$t.length>0;)zr()}function jr(t){var e=ie;if(e===null)return J.f|=Pt,t;if(e.f&bi)_n(t,e);else{if(!(e.f&vs))throw t;e.b.error(t)}}function _n(t,e){for(;e!==null;){if(e.f&vs)try{e.b.error(t);return}catch(n){t=n}e=e.parent}throw t}const bs=new Set;let ne=null,ws=null,we=null,Xe=[],ys=null,_i=!1,Vn=!1;const si=class si{constructor(){Y(this,ke);wt(this,"committed",!1);wt(this,"current",new Map);wt(this,"previous",new Map);Y(this,Fn,new Set);Y(this,Wn,new Set);Y(this,ln,0);Y(this,cn,0);Y(this,ls,null);Y(this,zn,[]);Y(this,jn,[]);wt(this,"skipped_effects",new Set);wt(this,"is_fork",!1)}is_deferred(){return this.is_fork||b(this,cn)>0}process(e){var s;Xe=[],ws=null,this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)fe(this,ke,Nr).call(this,i,n);this.is_fork||fe(this,ke,vl).call(this),this.is_deferred()?(fe(this,ke,gn).call(this,n.effects),fe(this,ke,gn).call(this,n.render_effects),fe(this,ke,gn).call(this,n.block_effects)):(ws=this,ne=null,Hr(n.render_effects),Hr(n.effects),ws=null,(s=b(this,ls))==null||s.resolve()),we=null}capture(e,n){this.previous.has(e)||this.previous.set(e,n),e.f&Pt||(this.current.set(e,e.v),we==null||we.set(e,e.v))}activate(){ne=this,this.apply()}deactivate(){ne===this&&(ne=null,we=null)}flush(){if(this.activate(),Xe.length>0){if(Ur(),ne!==null&&ne!==this)return}else b(this,ln)===0&&this.process([]);this.deactivate()}discard(){for(const e of b(this,Wn))e(this);b(this,Wn).clear()}increment(e){z(this,ln,b(this,ln)+1),e&&z(this,cn,b(this,cn)+1)}decrement(e){z(this,ln,b(this,ln)-1),e&&z(this,cn,b(this,cn)-1),this.revive()}revive(){for(const e of b(this,zn))Re(e,Pe),en(e);for(const e of b(this,jn))Re(e,St),en(e);z(this,zn,[]),z(this,jn,[]),this.flush()}oncommit(e){b(this,Fn).add(e)}ondiscard(e){b(this,Wn).add(e)}settled(){return(b(this,ls)??z(this,ls,Pr())).promise}static ensure(){if(ne===null){const e=ne=new si;bs.add(ne),Vn||si.enqueue(()=>{ne===e&&e.flush()})}return ne}static enqueue(e){qn(e)}apply(){}};Fn=new WeakMap,Wn=new WeakMap,ln=new WeakMap,cn=new WeakMap,ls=new WeakMap,zn=new WeakMap,jn=new WeakMap,ke=new WeakSet,Nr=function(e,n){var l;e.f^=Ne;for(var s=e.first;s!==null;){var i=s.f,r=(i&(_t|Yt))!==0,o=r&&(i&Ne)!==0,a=o||(i&je)!==0||this.skipped_effects.has(s);if(s.f&vs&&((l=s.b)!=null&&l.is_pending())&&(n={parent:n,effect:s,effects:[],render_effects:[],block_effects:[]}),!a&&s.fn!==null){r?s.f^=Ne:i&mi?n.effects.push(s):Qn(s)&&(s.f&yt&&n.block_effects.push(s),Zn(s));var c=s.first;if(c!==null){s=c;continue}}var u=s.parent;for(s=s.next;s===null&&u!==null;)u===n.effect&&(fe(this,ke,gn).call(this,n.effects),fe(this,ke,gn).call(this,n.render_effects),fe(this,ke,gn).call(this,n.block_effects),n=n.parent),s=u.next,u=u.parent}},gn=function(e){for(const n of e)(n.f&Pe?b(this,zn):b(this,jn)).push(n),fe(this,ke,Rr).call(this,n.deps),Re(n,Ne)},Rr=function(e){if(e!==null)for(const n of e)!(n.f&xe)||!(n.f&Qt)||(n.f^=Qt,fe(this,ke,Rr).call(this,n.deps))},vl=function(){if(b(this,cn)===0){for(const e of b(this,Fn))e();b(this,Fn).clear()}b(this,ln)===0&&fe(this,ke,bl).call(this)},bl=function(){var r;if(bs.size>1){this.previous.clear();var e=we,n=!0,s={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const o of bs){if(o===this){n=!1;continue}const a=[];for(const[u,l]of this.current){if(o.current.has(u))if(n&&l!==o.current.get(u))o.current.set(u,l);else continue;a.push(u)}if(a.length===0)continue;const c=[...o.current.keys()].filter(u=>!this.current.has(u));if(c.length>0){var i=Xe;Xe=[];const u=new Set,l=new Map;for(const h of a)qr(h,c,u,l);if(Xe.length>0){ne=o,o.apply();for(const h of Xe)fe(r=o,ke,Nr).call(r,h,s);o.deactivate()}Xe=i}}ne=null,we=e}this.committed=!0,bs.delete(this)};let Tt=si;function $l(t){var e=Vn;Vn=!0;try{for(var n;;){if(Zl(),Xe.length===0&&(ne==null||ne.flush(),Xe.length===0))return ys=null,n;Ur()}}finally{Vn=e}}function Ur(){var t=Wt;_i=!0;var e=null;try{var n=0;for(Es(!0);Xe.length>0;){var s=Tt.ensure();if(n++>1e3){var i,r;ec()}s.process(Xe),Ft.clear()}}finally{_i=!1,Es(t),ys=null}}function ec(){try{jl()}catch(t){_n(t,ys)}}let st=null;function Hr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(kt|je))&&Qn(s)&&(st=new Set,Zn(s),s.deps===null&&s.first===null&&s.nodes_start===null&&(s.teardown===null&&s.ac===null?lo(s):s.fn=null),(st==null?void 0:st.size)>0)){Ft.clear();for(const i of st){if(i.f&(kt|je))continue;const r=[i];let o=i.parent;for(;o!==null;)st.has(o)&&(st.delete(o),r.push(o)),o=o.parent;for(let a=r.length-1;a>=0;a--){const c=r[a];c.f&(kt|je)||Zn(c)}}st.clear()}}st=null}}function qr(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?qr(i,e,n,s):r&(yi|yt)&&!(r&Pe)&&Vr(i,e,s)&&(Re(i,Pe),en(i))}}function Vr(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(e.includes(i))return!0;if(i.f&xe&&Vr(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function en(t){for(var e=ys=t;e.parent!==null;){e=e.parent;var n=e.f;if(_i&&e===ie&&n&yt&&!(n&Br))return;if(n&(Yt|_t)){if(!(n&Ne))return;e.f^=Ne}}Xe.push(e)}function tc(t){let e=0,n=tn(0),s;return()=>{Ts()&&(m(n),Ii(()=>(e===0&&(s=$n(()=>t(()=>Kn(n)))),e+=1,()=>{qn(()=>{e-=1,e===0&&(s==null||s(),s=void 0,Kn(n))})})))}}var nc=Jt|vn|vs;function sc(t,e,n){new ic(t,e,n)}class ic{constructor(e,n,s){Y(this,Te);wt(this,"parent");Y(this,$e,!1);Y(this,et);Y(this,Tr,null);Y(this,gt);Y(this,un);Y(this,mt);Y(this,tt,null);Y(this,ze,null);Y(this,vt,null);Y(this,Dt,null);Y(this,Vt,null);Y(this,hn,0);Y(this,Gt,0);Y(this,dn,!1);Y(this,Kt,null);Y(this,ii,tc(()=>(z(this,Kt,tn(b(this,hn))),()=>{z(this,Kt,null)})));z(this,et,e),z(this,gt,n),z(this,un,s),this.parent=ie.b,z(this,$e,!!b(this,gt).pending),z(this,mt,xs(()=>{ie.b=this;{var i=fe(this,Te,Dr).call(this);try{z(this,tt,Ye(()=>s(i)))}catch(r){this.error(r)}b(this,Gt)>0?fe(this,Te,di).call(this):z(this,$e,!1)}return()=>{var r;(r=b(this,Vt))==null||r.remove()}},nc))}is_pending(){return b(this,$e)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!b(this,gt).pending}update_pending_count(e){fe(this,Te,Ar).call(this,e),z(this,hn,b(this,hn)+e),b(this,Kt)&&Gn(b(this,Kt),b(this,hn))}get_effect_pending(){return b(this,ii).call(this),m(b(this,Kt))}error(e){var n=b(this,gt).onerror;let s=b(this,gt).failed;if(b(this,dn)||!n&&!s)throw e;b(this,tt)&&(Be(b(this,tt)),z(this,tt,null)),b(this,ze)&&(Be(b(this,ze)),z(this,ze,null)),b(this,vt)&&(Be(b(this,vt)),z(this,vt,null));var i=!1,r=!1;const o=()=>{if(i){Xl();return}i=!0,r&&Gl(),Tt.ensure(),z(this,hn,0),b(this,vt)!==null&&xn(b(this,vt),()=>{z(this,vt,null)}),z(this,$e,this.has_pending_snippet()),z(this,tt,fe(this,Te,hi).call(this,()=>(z(this,dn,!1),Ye(()=>b(this,un).call(this,b(this,et)))))),b(this,Gt)>0?fe(this,Te,di).call(this):z(this,$e,!1)};var a=J;try{Fe(null),r=!0,n==null||n(e,o),r=!1}catch(c){_n(c,b(this,mt)&&b(this,mt).parent)}finally{Fe(a)}s&&qn(()=>{z(this,vt,fe(this,Te,hi).call(this,()=>{Tt.ensure(),z(this,dn,!0);try{return Ye(()=>{s(b(this,et),()=>e,()=>o)})}catch(c){return _n(c,b(this,mt).parent),null}finally{z(this,dn,!1)}}))})}}$e=new WeakMap,et=new WeakMap,Tr=new WeakMap,gt=new WeakMap,un=new WeakMap,mt=new WeakMap,tt=new WeakMap,ze=new WeakMap,vt=new WeakMap,Dt=new WeakMap,Vt=new WeakMap,hn=new WeakMap,Gt=new WeakMap,dn=new WeakMap,Kt=new WeakMap,ii=new WeakMap,Te=new WeakSet,Ep=function(){try{z(this,tt,Ye(()=>b(this,un).call(this,b(this,et))))}catch(e){this.error(e)}z(this,$e,!1)},Ip=function(){const e=b(this,gt).pending;e&&(z(this,ze,Ye(()=>e(b(this,et)))),Tt.enqueue(()=>{var n=fe(this,Te,Dr).call(this);z(this,tt,fe(this,Te,hi).call(this,()=>(Tt.ensure(),Ye(()=>b(this,un).call(this,n))))),b(this,Gt)>0?fe(this,Te,di).call(this):(xn(b(this,ze),()=>{z(this,ze,null)}),z(this,$e,!1))}))},Dr=function(){var e=b(this,et);return b(this,$e)&&(z(this,Vt,xt()),b(this,et).before(b(this,Vt)),e=b(this,Vt)),e},hi=function(e){var n=ie,s=J,i=be;ut(b(this,mt)),Fe(b(this,mt)),yn(b(this,mt).ctx);try{return e()}catch(r){return jr(r),null}finally{ut(n),Fe(s),yn(i)}},di=function(){const e=b(this,gt).pending;b(this,tt)!==null&&(z(this,Dt,document.createDocumentFragment()),b(this,Dt).append(b(this,Vt)),ho(b(this,tt),b(this,Dt))),b(this,ze)===null&&z(this,ze,Ye(()=>e(b(this,et))))},Ar=function(e){var n;if(!this.has_pending_snippet()){this.parent&&fe(n=this.parent,Te,Ar).call(n,e);return}z(this,Gt,b(this,Gt)+e),b(this,Gt)===0&&(z(this,$e,!1),b(this,ze)&&xn(b(this,ze),()=>{z(this,ze,null)}),b(this,Dt)&&(b(this,et).before(b(this,Dt)),z(this,Dt,null)))};function Sn(t,e){return e}function rc(t,e,n){for(var s=[],i=e.length,r=0;r<i;r++)Ci(e[r].e,s,!0);co(s,()=>{var o=s.length===0&&n!==null;if(o){var a=n,c=a.parentNode;mc(c),c.append(a),t.items.clear(),lt(t,e[0].prev,e[i-1].next)}for(var u=0;u<i;u++){var l=e[u];o||(t.items.delete(l.k),lt(t,l.prev,l.next)),Be(l.e,!o)}t.first===e[0]&&(t.first=e[0].prev)})}function kn(t,e,n,s,i,r=null){var o=t,a=new Map,c=null;{var u=t;o=u.appendChild(xt())}var l=null,h=ki(()=>{var T=n();return pi(T)?T:T==null?[]:gi(T)}),d,f=!0;function p(){oc(E,d,o,e,s),l!==null&&(d.length===0?(l.fragment?(o.before(l.fragment),l.fragment=null):Ni(l.effect),v.first=l.effect):xn(l.effect,()=>{l=null}))}var v=xs(()=>{d=m(h);for(var T=d.length,x=new Set,I=ne,g=null,y=no(),k=0;k<T;k+=1){var S=d[k],_=s(S,k),w=f?null:a.get(_);w?(Gn(w.v,S),w.i=k,y&&I.skipped_effects.delete(w.e)):(w=ac(f?o:null,g,S,_,k,i,e,n),f&&(w.o=!0,g===null?c=w:g.next=w,g=w),a.set(_,w)),x.add(_)}if(T===0&&r&&!l)if(f)l={fragment:null,effect:Ye(()=>r(o))};else{var A=document.createDocumentFragment(),L=xt();A.append(L),l={fragment:A,effect:Ye(()=>r(L))}}if(!f)if(y){for(const[B,U]of a)x.has(B)||I.skipped_effects.add(U.e);I.oncommit(p),I.ondiscard(()=>{})}else p();m(h)}),E={effect:v,items:a,first:c};f=!1}function oc(t,e,n,s,i){var r=e.length,o=t.items,a=t.first,c,u=null,l=[],h=[],d,f,p,v;for(v=0;v<r;v+=1){if(d=e[v],f=i(d,v),p=o.get(f),t.first??(t.first=p),!p.o){p.o=!0;var E=u?u.next:a;lt(t,u,p),lt(t,p,E),Si(p,E,n),u=p,l=[],h=[],a=u.next;continue}if(p.e.f&je&&Ni(p.e),p!==a){if(c!==void 0&&c.has(p)){if(l.length<h.length){var T=h[0],x;u=T.prev;var I=l[0],g=l[l.length-1];for(x=0;x<l.length;x+=1)Si(l[x],T,n);for(x=0;x<h.length;x+=1)c.delete(h[x]);lt(t,I.prev,g.next),lt(t,u,I),lt(t,g,T),a=T,u=g,v-=1,l=[],h=[]}else c.delete(p),Si(p,a,n),lt(t,p.prev,p.next),lt(t,p,u===null?t.first:u.next),lt(t,u,p),u=p;continue}for(l=[],h=[];a!==null&&a.k!==f;)a.e.f&je||(c??(c=new Set)).add(a),h.push(a),a=a.next;if(a===null)continue;p=a}l.push(p),u=p,a=p.next}if(a!==null||c!==void 0){for(var y=c===void 0?[]:gi(c);a!==null;)a.e.f&je||y.push(a),a=a.next;var k=y.length;if(k>0){var S=r===0?n:null;rc(t,y,S)}}}function ac(t,e,n,s,i,r,o,a){var c=(o&oe)!==0,u=(o&ms)===0,l=c?u?dc(n,!1,!1):tn(n):n,h=o&Se?tn(i):i,d={i:h,v:l,k:s,a:null,e:null,o:!1,prev:e,next:null};try{if(t===null){var f=document.createDocumentFragment();f.append(t=xt())}return d.e=Ye(()=>r(t,l,h,a)),e!==null&&(e.next=d),d}finally{}}function Si(t,e,n){for(var s=t.next?t.next.e.nodes_start:n,i=e?e.e.nodes_start:n,r=t.e.nodes_start;r!==null&&r!==s;){var o=Xn(r);i.before(r),r=o}}function lt(t,e,n){e===null?(t.first=n,t.effect.first=n&&n.e):(e.e.next&&(e.e.next.prev=null),e.next=n,e.e.next=n&&n.e),n===null?t.effect.last=e&&e.e:(n.e.prev&&(n.e.prev.next=null),n.prev=e,n.e.prev=e&&e.e)}function lc(t,e,n,s){const i=Hn()?Ss:ki;if(n.length===0&&t.length===0){s(e.map(i));return}var r=ne,o=ie,a=cc();function c(){Promise.all(n.map(u=>uc(u))).then(u=>{a();try{s([...e.map(i),...u])}catch(l){o.f&kt||_n(l,o)}r==null||r.deactivate(),_s()}).catch(u=>{_n(u,o)})}t.length>0?Promise.all(t).then(()=>{a();try{return c()}finally{r==null||r.deactivate(),_s()}}):c()}function cc(){var t=ie,e=J,n=be,s=ne;return function(r=!0){ut(t),Fe(e),yn(n),r&&(s==null||s.activate())}}function _s(){ut(null),Fe(null),yn(null)}function Ss(t){var e=xe|Pe,n=J!==null&&J.f&xe?J:null;return ie!==null&&(ie.f|=vn),{ctx:be,deps:null,effects:null,equals:Fr,f:e,fn:t,reactions:null,rv:0,v:Ce,wv:0,parent:n??ie,ac:null}}function uc(t,e){let n=ie;n===null&&Bl();var s=n.b,i=void 0,r=tn(Ce),o=!J,a=new Map;return Sc(()=>{var d;var c=Pr();i=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{u===ne&&u.committed&&u.deactivate(),_s()})}catch(f){c.reject(f),_s()}var u=ne;if(o){var l=!s.is_pending();s.update_pending_count(1),u.increment(l),(d=a.get(u))==null||d.reject(bn),a.delete(u),a.set(u,c)}const h=(f,p=void 0)=>{if(u.activate(),p)p!==bn&&(r.f|=Pt,Gn(r,p));else{r.f&Pt&&(r.f^=Pt),Gn(r,f);for(const[v,E]of a){if(a.delete(v),v===u)break;E.reject(bn)}}o&&(s.update_pending_count(-1),u.decrement(l))};c.promise.then(h,f=>h(null,f||"unknown"))}),Ei(()=>{for(const c of a.values())c.reject(bn)}),new Promise(c=>{function u(l){function h(){l===i?c(r):u(i)}l.then(h,h)}u(i)})}function he(t){const e=Ss(t);return po(e),e}function ki(t){const e=Ss(t);return e.equals=Wr,e}function Gr(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)Be(e[n])}}function hc(t){for(var e=t.parent;e!==null;){if(!(e.f&xe))return e.f&kt?null:e;e=e.parent}return null}function Ti(t){var e,n=ie;ut(hc(t));try{t.f&=~Qt,Gr(t),e=wo(t)}finally{ut(n)}return e}function Kr(t){var e=Ti(t);if(t.equals(e)||(ne!=null&&ne.is_fork||(t.v=e),t.wv=vo()),!nn)if(we!==null)Ts()&&we.set(t,e);else{var n=t.f&nt?Ne:St;Re(t,n)}}let xi=new Set;const Ft=new Map;let Xr=!1;function tn(t,e){var n={f:0,v:t,reactions:null,equals:Fr,rv:0,wv:0};return n}function ae(t,e){const n=tn(t);return po(n),n}function dc(t,e=!1,n=!0){var i;const s=tn(t);return e||(s.equals=Wr),wn&&n&&be!==null&&be.l!==null&&((i=be.l).s??(i.s=[])).push(s),s}function C(t,e,n=!1){J!==null&&(!ct||J.f&Lr)&&Hn()&&J.f&(xe|yt|yi|Lr)&&!(Ae!=null&&Ae.includes(t))&&Vl();let s=n?it(e):e;return Gn(t,s)}function Gn(t,e){if(!t.equals(e)){var n=t.v;nn?Ft.set(t,e):Ft.set(t,n),t.v=e;var s=Tt.ensure();s.capture(t,n),t.f&xe&&(t.f&Pe&&Ti(t),Re(t,t.f&nt?Ne:St)),t.wv=vo(),Jr(t,Pe),Hn()&&ie!==null&&ie.f&Ne&&!(ie.f&(_t|Yt))&&(Je===null?xc([t]):Je.push(t)),!s.is_fork&&xi.size>0&&!Xr&&fc()}return e}function fc(){Xr=!1;var t=Wt;Es(!0);const e=Array.from(xi);try{for(const n of e)n.f&Ne&&Re(n,St),Qn(n)&&Zn(n)}finally{Es(t)}xi.clear()}function Yr(t,e=1){var n=m(t),s=e===1?n++:n--;return C(t,n),s}function Kn(t){C(t,t.v+1)}function Jr(t,e){var n=t.reactions;if(n!==null)for(var s=Hn(),i=n.length,r=0;r<i;r++){var o=n[r],a=o.f;if(!(!s&&o===ie)){var c=(a&Pe)===0;if(c&&Re(o,e),a&xe){var u=o;we==null||we.delete(u),a&Qt||(a&nt&&(o.f|=Qt),Jr(u,St))}else c&&(a&yt&&st!==null&&st.add(o),en(o))}}}function it(t){if(typeof t!="object"||t===null||Zt in t)return t;const e=Mr(t);if(e!==Rl&&e!==Dl)return t;var n=new Map,s=pi(t),i=ae(0),r=sn,o=a=>{if(sn===r)return a();var c=J,u=sn;Fe(null),mo(r);var l=a();return Fe(c),mo(u),l};return s&&n.set("length",ae(t.length)),new Proxy(t,{defineProperty(a,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Hl();var l=n.get(c);return l===void 0?l=o(()=>{var h=ae(u.value);return n.set(c,h),h}):C(l,u.value,!0),!0},deleteProperty(a,c){var u=n.get(c);if(u===void 0){if(c in a){const l=o(()=>ae(Ce));n.set(c,l),Kn(i)}}else C(u,Ce),Kn(i);return!0},get(a,c,u){var f;if(c===Zt)return t;var l=n.get(c),h=c in a;if(l===void 0&&(!h||(f=mn(a,c))!=null&&f.writable)&&(l=o(()=>{var p=it(h?a[c]:Ce),v=ae(p);return v}),n.set(c,l)),l!==void 0){var d=m(l);return d===Ce?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=m(l))}else if(u===void 0){var h=n.get(c),d=h==null?void 0:h.v;if(h!==void 0&&d!==Ce)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(a,c){var d;if(c===Zt)return!0;var u=n.get(c),l=u!==void 0&&u.v!==Ce||Reflect.has(a,c);if(u!==void 0||ie!==null&&(!l||(d=mn(a,c))!=null&&d.writable)){u===void 0&&(u=o(()=>{var f=l?it(a[c]):Ce,p=ae(f);return p}),n.set(c,u));var h=m(u);if(h===Ce)return!1}return l},set(a,c,u,l){var I;var h=n.get(c),d=c in a;if(s&&c==="length")for(var f=u;f<h.v;f+=1){var p=n.get(f+"");p!==void 0?C(p,Ce):f in a&&(p=o(()=>ae(Ce)),n.set(f+"",p))}if(h===void 0)(!d||(I=mn(a,c))!=null&&I.writable)&&(h=o(()=>ae(void 0)),C(h,it(u)),n.set(c,h));else{d=h.v!==Ce;var v=o(()=>it(u));C(h,v)}var E=Reflect.getOwnPropertyDescriptor(a,c);if(E!=null&&E.set&&E.set.call(l,u),!d){if(s&&typeof c=="string"){var T=n.get("length"),x=Number(c);Number.isInteger(x)&&x>=T.v&&C(T,x+1)}Kn(i)}return!0},ownKeys(a){m(i);var c=Reflect.ownKeys(a).filter(h=>{var d=n.get(h);return d===void 0||d.v!==Ce});for(var[u,l]of n)l.v!==Ce&&!(u in a)&&c.push(u);return c},setPrototypeOf(){ql()}})}function Qr(t){try{if(t!==null&&typeof t=="object"&&Zt in t)return t[Zt]}catch{}return t}function pc(t,e){return Object.is(Qr(t),Qr(e))}var Zr,$r,eo,to;function gc(){if(Zr===void 0){Zr=window,$r=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;eo=mn(e,"firstChild").get,to=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 xt(t=""){return document.createTextNode(t)}function Tn(t){return eo.call(t)}function Xn(t){return to.call(t)}function P(t,e){return Tn(t)}function Le(t,e=!1){{var n=Tn(t);return n instanceof Comment&&n.data===""?Xn(n):n}}function j(t,e=1,n=!1){let s=t;for(;e--;)s=Xn(s);return s}function mc(t){t.textContent=""}function no(){return!1}let so=!1;function vc(){so||(so=!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 ks(t){var e=J,n=ie;Fe(null),ut(null);try{return t()}finally{Fe(e),ut(n)}}function bc(t,e,n,s=n){t.addEventListener(e,()=>ks(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),vc()}function wc(t){ie===null&&(J===null&&zl(),Wl()),nn&&Fl()}function yc(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Et(t,e,n){var s=ie;s!==null&&s.f&je&&(t|=je);var i={ctx:be,deps:null,nodes_start:null,nodes_end:null,f:t|Pe|nt,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Zn(i),i.f|=bi}catch(a){throw Be(i),a}else e!==null&&en(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes_start===null&&r.first===r.last&&!(r.f&vn)&&(r=r.first,t&yt&&t&Jt&&r!==null&&(r.f|=Jt)),r!==null&&(r.parent=s,s!==null&&yc(r,s),J!==null&&J.f&xe&&!(t&Yt))){var o=J;(o.effects??(o.effects=[])).push(r)}return i}function Ts(){return J!==null&&!ct}function Ei(t){const e=Et(vi,null,!1);return Re(e,Ne),e.teardown=t,e}function Yn(t){wc();var e=ie.f,n=!J&&(e&_t)!==0&&(e&bi)===0;if(n){var s=be;(s.e??(s.e=[])).push(t)}else return io(t)}function io(t){return Et(mi|Ml,t,!1)}function _c(t){Tt.ensure();const e=Et(Yt|vn,t,!0);return(n={})=>new Promise(s=>{n.outro?xn(e,()=>{Be(e),s(void 0)}):(Be(e),s(void 0))})}function ro(t){return Et(mi,t,!1)}function Sc(t){return Et(yi|vn,t,!0)}function Ii(t,e=0){return Et(vi|e,t,!0)}function H(t,e=[],n=[],s=[]){lc(s,e,n,i=>{Et(vi,()=>t(...i.map(m)),!0)})}function xs(t,e=0){var n=Et(yt|e,t,!0);return n}function Ye(t){return Et(_t|vn,t,!0)}function oo(t){var e=t.teardown;if(e!==null){const n=nn,s=J;fo(!0),Fe(null);try{e.call(null)}finally{fo(n),Fe(s)}}}function ao(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&ks(()=>{i.abort(bn)});var s=n.next;n.f&Yt?n.parent=null:Be(n,e),n=s}}function kc(t){for(var e=t.first;e!==null;){var n=e.next;e.f&_t||Be(e),e=n}}function Be(t,e=!0){var n=!1;(e||t.f&Br)&&t.nodes_start!==null&&t.nodes_end!==null&&(Tc(t.nodes_start,t.nodes_end),n=!0),ao(t,e&&!n),Is(t,0),Re(t,kt);var s=t.transitions;if(s!==null)for(const r of s)r.stop();oo(t);var i=t.parent;i!==null&&i.first!==null&&lo(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function Tc(t,e){for(;t!==null;){var n=t===e?null:Xn(t);t.remove(),t=n}}function lo(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 xn(t,e,n=!0){var s=[];Ci(t,s,!0),co(s,()=>{n&&Be(t),e&&e()})}function co(t,e){var n=t.length;if(n>0){var s=()=>--n||e();for(var i of t)i.out(s)}else e()}function Ci(t,e,n){if(!(t.f&je)){if(t.f^=je,t.transitions!==null)for(const o of t.transitions)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var i=s.next,r=(s.f&Jt)!==0||(s.f&_t)!==0&&(t.f&yt)!==0;Ci(s,e,r?n:!1),s=i}}}function Ni(t){uo(t,!0)}function uo(t,e){if(t.f&je){t.f^=je,t.f&Ne||(Re(t,Pe),en(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Jt)!==0||(n.f&_t)!==0;uo(n,i?e:!1),n=s}if(t.transitions!==null)for(const r of t.transitions)(r.is_global||e)&&r.in()}}function ho(t,e){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 Wt=!1;function Es(t){Wt=t}let nn=!1;function fo(t){nn=t}let J=null,ct=!1;function Fe(t){J=t}let ie=null;function ut(t){ie=t}let Ae=null;function po(t){J!==null&&(Ae===null?Ae=[t]:Ae.push(t))}let Me=null,Ue=0,Je=null;function xc(t){Je=t}let go=1,Jn=0,sn=Jn;function mo(t){sn=t}function vo(){return++go}function Qn(t){var e=t.f;if(e&Pe)return!0;if(e&xe&&(t.f&=~Qt),e&St){var n=t.deps;if(n!==null)for(var s=n.length,i=0;i<s;i++){var r=n[i];if(Qn(r)&&Kr(r),r.wv>t.wv)return!0}e&nt&&we===null&&Re(t,Ne)}return!1}function bo(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Ae!=null&&Ae.includes(t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&xe?bo(r,e,!1):e===r&&(n?Re(r,Pe):r.f&Ne&&Re(r,St),en(r))}}function wo(t){var p;var e=Me,n=Ue,s=Je,i=J,r=Ae,o=be,a=ct,c=sn,u=t.f;Me=null,Ue=0,Je=null,J=u&(_t|Yt)?null:t,Ae=null,yn(t.ctx),ct=!1,sn=++Jn,t.ac!==null&&(ks(()=>{t.ac.abort(bn)}),t.ac=null);try{t.f|=wi;var l=t.fn,h=l(),d=t.deps;if(Me!==null){var f;if(Is(t,Ue),d!==null&&Ue>0)for(d.length=Ue+Me.length,f=0;f<Me.length;f++)d[Ue+f]=Me[f];else t.deps=d=Me;if(Wt&&Ts()&&t.f&nt)for(f=Ue;f<d.length;f++)((p=d[f]).reactions??(p.reactions=[])).push(t)}else d!==null&&Ue<d.length&&(Is(t,Ue),d.length=Ue);if(Hn()&&Je!==null&&!ct&&d!==null&&!(t.f&(xe|St|Pe)))for(f=0;f<Je.length;f++)bo(Je[f],t);return i!==null&&i!==t&&(Jn++,Je!==null&&(s===null?s=Je:s.push(...Je))),t.f&Pt&&(t.f^=Pt),h}catch(v){return jr(v)}finally{t.f^=wi,Me=e,Ue=n,Je=s,J=i,Ae=r,yn(o),ct=a,sn=c}}function Ec(t,e){let n=e.reactions;if(n!==null){var s=Il.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}n===null&&e.f&xe&&(Me===null||!Me.includes(e))&&(Re(e,St),e.f&nt&&(e.f^=nt,e.f&=~Qt),Gr(e),Is(e,0))}function Is(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)Ec(t,n[s])}function Zn(t){var e=t.f;if(!(e&kt)){Re(t,Ne);var n=ie,s=Wt;ie=t,Wt=!0;try{e&yt?kc(t):ao(t),oo(t);var i=wo(t);t.teardown=typeof i=="function"?i:null,t.wv=go;var r;fi&&Jl&&t.f&Pe&&t.deps}finally{Wt=s,ie=n}}}async function Ic(){await Promise.resolve(),$l()}function m(t){var e=t.f,n=(e&xe)!==0;if(J!==null&&!ct){var s=ie!==null&&(ie.f&kt)!==0;if(!s&&!(Ae!=null&&Ae.includes(t))){var i=J.deps;if(J.f&wi)t.rv<Jn&&(t.rv=Jn,Me===null&&i!==null&&i[Ue]===t?Ue++:Me===null?Me=[t]:Me.includes(t)||Me.push(t));else{(J.deps??(J.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[J]:r.includes(J)||r.push(J)}}}if(nn){if(Ft.has(t))return Ft.get(t);if(n){var o=t,a=o.v;return(!(o.f&Ne)&&o.reactions!==null||_o(o))&&(a=Ti(o)),Ft.set(o,a),a}}else n&&!(we!=null&&we.has(t))&&(o=t,Qn(o)&&Kr(o),Wt&&Ts()&&!(o.f&nt)&&yo(o));if(we!=null&&we.has(t))return we.get(t);if(t.f&Pt)throw t.v;return t.v}function yo(t){if(t.deps!==null){t.f^=nt;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&xe&&!(e.f&nt)&&yo(e)}}function _o(t){if(t.v===Ce)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Ft.has(e)||e.f&xe&&_o(e))return!0;return!1}function $n(t){var e=ct;try{return ct=!0,t()}finally{ct=e}}const Cc=-7169;function Re(t,e){t.f=t.f&Cc|e}const So=new Set,Ri=new Set;function Nc(t,e,n,s={}){function i(r){if(s.capture||es.call(e,r),!r.cancelBubble)return ks(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?qn(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function It(t,e,n,s,i){var r={capture:s,passive:i},o=Nc(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ei(()=>{e.removeEventListener(t,o,r)})}function Cs(t){for(var e=0;e<t.length;e++)So.add(t[e]);for(var n of Ri)n(t)}let ko=null;function es(t){var E;var e=this,n=e.ownerDocument,s=t.type,i=((E=t.composedPath)==null?void 0:E.call(t))||[],r=i[0]||t.target;ko=t;var o=0,a=ko===t&&t.__root;if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;c<=u&&(o=c)}if(r=i[o]||t.target,r!==e){Cl(t,"currentTarget",{configurable:!0,get(){return r||n}});var l=J,h=ie;Fe(null),ut(null);try{for(var d,f=[];r!==null;){var p=r.assignedSlot||r.parentNode||r.host||null;try{var v=r["__"+s];v!=null&&(!r.disabled||t.target===r)&&v.call(r,t)}catch(T){d?f.push(T):d=T}if(t.cancelBubble||p===e||p===null)break;r=p}if(d){for(let T of f)queueMicrotask(()=>{throw T});throw d}}finally{t.__root=e,delete t.currentTarget,Fe(l),ut(h)}}}function To(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function ts(t,e){var n=ie;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function q(t,e){var n=(e&Tl)!==0,s=(e&xl)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=To(r?t:"<!>"+t),n||(i=Tn(i)));var o=s||$r?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=Tn(o),c=o.lastChild;ts(a,c)}else ts(o,o);return o}}function Rc(t,e,n="svg"){var s=!t.startsWith("<!>"),i=`<${n}>${s?t:"<!>"+t}</${n}>`,r;return()=>{if(!r){var o=To(i),a=Tn(o);r=Tn(a)}var c=r.cloneNode(!0);return ts(c,c),c}}function Ns(t,e){return Rc(t,e,"svg")}function En(t=""){{var e=xt(t+"");return ts(e,e),e}}function Ct(){var t=document.createDocumentFragment(),e=document.createComment(""),n=xt();return t.append(e,n),ts(e,n),t}function M(t,e){t!==null&&t.before(e)}const Dc=["touchstart","touchmove"];function Ac(t){return Dc.includes(t)}function Q(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 Mc(t,e){return Oc(t,e)}const In=new Map;function Oc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:o=!0}){gc();var a=new Set,c=h=>{for(var d=0;d<h.length;d++){var f=h[d];if(!a.has(f)){a.add(f);var p=Ac(f);e.addEventListener(f,es,{passive:p});var v=In.get(f);v===void 0?(document.addEventListener(f,es,{passive:p}),In.set(f,1)):In.set(f,v+1)}}};c(gi(So)),Ri.add(c);var u=void 0,l=_c(()=>{var h=n??e.appendChild(xt());return sc(h,{pending:()=>{}},d=>{if(r){Lt({});var f=be;f.c=r}i&&(s.$$events=i),u=t(d,s)||{},r&&Bt()}),()=>{var p;for(var d of a){e.removeEventListener(d,es);var f=In.get(d);--f===0?(document.removeEventListener(d,es),In.delete(d)):In.set(d,f)}Ri.delete(c),h!==n&&((p=h.parentNode)==null||p.removeChild(h))}});return Pc.set(u,l),u}let Pc=new WeakMap;class xo{constructor(e,n=!0){wt(this,"anchor");Y(this,ot,new Map);Y(this,bt,new Map);Y(this,Ge,new Map);Y(this,fn,new Set);Y(this,cs,!0);Y(this,us,()=>{var e=ne;if(b(this,ot).has(e)){var n=b(this,ot).get(e),s=b(this,bt).get(n);if(s)Ni(s),b(this,fn).delete(n);else{var i=b(this,Ge).get(n);i&&(b(this,bt).set(n,i.effect),b(this,Ge).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,o]of b(this,ot)){if(b(this,ot).delete(r),r===e)break;const a=b(this,Ge).get(o);a&&(Be(a.effect),b(this,Ge).delete(o))}for(const[r,o]of b(this,bt)){if(r===n||b(this,fn).has(r))continue;const a=()=>{if(Array.from(b(this,ot).values()).includes(r)){var u=document.createDocumentFragment();ho(o,u),u.append(xt()),b(this,Ge).set(r,{effect:o,fragment:u})}else Be(o);b(this,fn).delete(r),b(this,bt).delete(r)};b(this,cs)||!s?(b(this,fn).add(r),xn(o,a,!1)):a()}}});Y(this,ri,e=>{b(this,ot).delete(e);const n=Array.from(b(this,ot).values());for(const[s,i]of b(this,Ge))n.includes(s)||(Be(i.effect),b(this,Ge).delete(s))});this.anchor=e,z(this,cs,n)}ensure(e,n){var s=ne,i=no();if(n&&!b(this,bt).has(e)&&!b(this,Ge).has(e))if(i){var r=document.createDocumentFragment(),o=xt();r.append(o),b(this,Ge).set(e,{effect:Ye(()=>n(o)),fragment:r})}else b(this,bt).set(e,Ye(()=>n(this.anchor)));if(b(this,ot).set(s,e),i){for(const[a,c]of b(this,bt))a===e?s.skipped_effects.delete(c):s.skipped_effects.add(c);for(const[a,c]of b(this,Ge))a===e?s.skipped_effects.delete(c.effect):s.skipped_effects.add(c.effect);s.oncommit(b(this,us)),s.ondiscard(b(this,ri))}else b(this,us).call(this)}}ot=new WeakMap,bt=new WeakMap,Ge=new WeakMap,fn=new WeakMap,cs=new WeakMap,us=new WeakMap,ri=new WeakMap;function Di(t){be===null&&Ll(),wn&&be.l!==null?Lc(be).m.push(t):Yn(()=>{const e=$n(t);if(typeof e=="function")return e})}function Lc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function $(t,e,n=!1){var s=new xo(t),i=n?Jt:0;function r(o,a){s.ensure(o,a)}xs(()=>{var o=!1;e((a,c=!0)=>{o=!0,r(c,a)}),o||r(!1,null)},i)}function Eo(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 Io(t,e,n){var s=new xo(t);xs(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},Jt)}function zt(t,e){ro(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function Co(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=Co(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Bc(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Co(t))&&(s&&(s+=" "),s+=e);return s}function Cn(t){return typeof t=="object"?Bc(t):t??""}function Fc(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=Fc(n,s);a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a),t.__className=n}return r}function No(t,e,n=!1){if(t.multiple){if(e==null)return;if(!pi(e))return Kl();for(var s of t.options)s.selected=e.includes(Ro(s));return}for(s of t.options){var i=Ro(s);if(pc(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Wc(t){var e=new MutationObserver(()=>{No(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ei(()=>{e.disconnect()})}function Ro(t){return"__value"in t?t.__value:t.value}const zc=Symbol("is custom element"),jc=Symbol("is html");function Uc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ee(t,e,n,s){var i=Hc(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[Pl]=n),n==null?t.removeAttribute(e):typeof n!="string"&&qc(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Hc(t){return t.__attributes??(t.__attributes={[zc]:t.nodeName.includes("-"),[jc]:t.namespaceURI===El})}var Do=new Map;function qc(t){var e=t.getAttribute("is")||t.nodeName,n=Do.get(e);if(n)return n;Do.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=Nl(i);for(var o in s)s[o].set&&n.push(o);i=Mr(i)}return n}function Vc(t,e,n=e){var s=new WeakSet;bc(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Ai(t)?Mi(r):r,n(r),ne!==null&&s.add(ne),await Ic(),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))}}}),$n(e)==null&&t.value&&(n(Ai(t)?Mi(t.value):t.value),ne!==null&&s.add(ne)),Ii(()=>{var i=e();if(t===document.activeElement){var r=ws??ne;if(s.has(r))return}Ai(t)&&i===Mi(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Ai(t){var e=t.type;return e==="number"||e==="range"}function Mi(t){return t===""?null:+t}function Ao(t,e){return t===e||(t==null?void 0:t[Zt])===e}function Gc(t={},e,n,s){return ro(()=>{var i,r;return Ii(()=>{i=r,r=[],$n(()=>{t!==n(...r)&&(e(t,...r),i&&Ao(n(...i),t)&&e(null,...i))})}),()=>{qn(()=>{r&&Ao(n(...r),t)&&e(null,...r)})}}),t}let Rs=!1;function Kc(t){var e=Rs;try{return Rs=!1,[t(),Rs]}finally{Rs=e}}function He(t,e,n,s){var I;var i=!wn||(n&yl)!==0,r=(n&Sl)!==0,o=(n&kl)!==0,a=s,c=!0,u=()=>(c&&(c=!1,a=o?$n(s):s),a),l;if(r){var h=Zt in t||Ol in t;l=((I=mn(t,e))==null?void 0:I.set)??(h&&e in t?g=>t[e]=g:void 0)}var d,f=!1;r?[d,f]=Kc(()=>t[e]):d=t[e],d===void 0&&s!==void 0&&(d=u(),l&&(i&&Ul(),l(d)));var p;if(i?p=()=>{var g=t[e];return g===void 0?u():(c=!0,g)}:p=()=>{var g=t[e];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&!(n&_l))return p;if(l){var v=t.$$legacy;return function(g,y){return arguments.length>0?((!i||!y||v||f)&&l(y?p():g),g):p()}}var E=!1,T=(n&wl?Ss:ki)(()=>(E=!1,p()));r&&m(T);var x=ie;return function(g,y){if(arguments.length>0){const k=y?m(T):i&&r?it(g):g;return C(T,k),E=!0,a!==void 0&&(a=k),g}return nn&&E||x.f&kt?T.v:m(T)}}function Mo(){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 Oi(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 Pi(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 Oo(){const t="uniqueUserID";let e=Pi(t);return e||(e=Mo(),Oi(t,e,365)),e}function qe(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Pi("uniqueUserID");r||(r=Oo());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=Pi("sessionID");c||(c=Mo(),Oi("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 Po={},Xc=function(t,e,n,s,i){var r=new Worker(Po[e]||(Po[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},Qe=Uint8Array,We=Uint16Array,Ds=Int32Array,As=new Qe([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]),Ms=new Qe([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]),Li=new Qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Lo=function(t,e){for(var n=new We(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Ds(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}},Bo=Lo(As,2),Yc=Bo.b,Os=Bo.r;Yc[28]=258,Os[258]=28;for(var Jc=Lo(Ms,0),Bi=Jc.r,Ps=new We(32768),ce=0;ce<32768;++ce){var Ut=(ce&43690)>>1|(ce&21845)<<1;Ut=(Ut&52428)>>2|(Ut&13107)<<2,Ut=(Ut&61680)>>4|(Ut&3855)<<4,Ps[ce]=((Ut&65280)>>8|(Ut&255)<<8)>>1}for(var Nn=function(t,e,n){for(var s=t.length,i=0,r=new We(e);i<s;++i)t[i]&&++r[t[i]-1];var o=new We(e);for(i=1;i<e;++i)o[i]=o[i-1]+r[i-1]<<1;var a;if(n){a=new We(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[Ps[h]>>c]=u}else for(a=new We(s),i=0;i<s;++i)t[i]&&(a[i]=Ps[o[t[i]-1]++]>>15-t[i]);return a},Ht=new Qe(288),ce=0;ce<144;++ce)Ht[ce]=8;for(var ce=144;ce<256;++ce)Ht[ce]=9;for(var ce=256;ce<280;++ce)Ht[ce]=7;for(var ce=280;ce<288;++ce)Ht[ce]=8;for(var ns=new Qe(32),ce=0;ce<32;++ce)ns[ce]=5;var Fo=Nn(Ht,9,0),Wo=Nn(ns,5,0),Fi=function(t){return(t+7)/8|0},zo=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Qe(t.subarray(e,n))},Qc=["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"],jo=function(t,e,n){var s=new Error(e||Qc[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,jo),!n)throw s;return s},ht=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},Rn=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},Ls=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:Ui,l:0};if(i==1){var o=new Qe(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(y,k){return y.f-k.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 f=new We(d+1),p=Bs(n[l-1],f,0);if(p>e){var s=0,v=0,E=p-e,T=1<<E;for(r.sort(function(k,S){return f[S.s]-f[k.s]||k.f-S.f});s<i;++s){var x=r[s].s;if(f[x]>e)v+=T-(1<<p-f[x]),f[x]=e;else break}for(v>>=E;v>0;){var I=r[s].s;f[I]<e?v-=1<<e-f[I]++-1:++s}for(;s>=0&&v;--s){var g=r[s].s;f[g]==e&&(--f[g],++v)}p=e}return{t:new Qe(f),l:p}},Bs=function(t,e,n){return t.s==-1?Math.max(Bs(t.l,e,n+1),Bs(t.r,e,n+1)):e[t.s]=n},Wi=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new We(++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}},Dn=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},zi=function(t,e,n){var s=n.length,i=Fi(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},ji=function(t,e,n,s,i,r,o,a,c,u,l){ht(e,l++,n),++i[256];for(var h=Ls(i,15),d=h.t,f=h.l,p=Ls(r,15),v=p.t,E=p.l,T=Wi(d),x=T.c,I=T.n,g=Wi(v),y=g.c,k=g.n,S=new We(19),_=0;_<x.length;++_)++S[x[_]&31];for(var _=0;_<y.length;++_)++S[y[_]&31];for(var w=Ls(S,7),A=w.t,L=w.l,B=19;B>4&&!A[Li[B-1]];--B);var U=u+5<<3,F=Dn(i,Ht)+Dn(r,ns)+o,W=Dn(i,d)+Dn(r,v)+o+14+3*B+Dn(S,A)+2*S[16]+3*S[17]+7*S[18];if(c>=0&&U<=F&&U<=W)return zi(e,l,t.subarray(c,c+u));var K,Z,D,ee;if(ht(e,l,1+(W<F)),l+=2,W<F){K=Nn(d,f,0),Z=d,D=Nn(v,E,0),ee=v;var N=Nn(A,L,0);ht(e,l,I-257),ht(e,l+5,k-1),ht(e,l+10,B-4),l+=14;for(var _=0;_<B;++_)ht(e,l+3*_,A[Li[_]]);l+=3*B;for(var O=[x,y],te=0;te<2;++te)for(var se=O[te],_=0;_<se.length;++_){var le=se[_]&31;ht(e,l,N[le]),l+=A[le],le>15&&(ht(e,l,se[_]>>5&127),l+=se[_]>>12)}}else K=Fo,Z=Ht,D=Wo,ee=ns;for(var _=0;_<a;++_){var V=s[_];if(V>255){var le=V>>18&31;Rn(e,l,K[le+257]),l+=Z[le+257],le>7&&(ht(e,l,V>>23&31),l+=As[le]);var Ie=V&31;Rn(e,l,D[Ie]),l+=ee[Ie],Ie>3&&(Rn(e,l,V>>5&8191),l+=Ms[Ie])}else Rn(e,l,K[V]),l+=Z[V]}return Rn(e,l,K[256]),l+Z[256]},Uo=new Ds([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ui=new Qe(0),Ho=function(t,e,n,s,i,r){var o=r.z||t.length,a=new Qe(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=Uo[e-1],d=h>>13,f=h&8191,p=(1<<n)-1,v=r.p||new We(32768),E=r.h||new We(p+1),T=Math.ceil(n/3),x=2*T,I=function(ue){return(t[ue]^t[ue+1]<<T^t[ue+2]<<x)&p},g=new Ds(25e3),y=new We(288),k=new We(32),S=0,_=0,w=r.i||0,A=0,L=r.w||0,B=0;w+2<o;++w){var U=I(w),F=w&32767,W=E[U];if(v[F]=W,E[U]=F,L<=w){var K=o-w;if((S>7e3||A>24576)&&(K>423||!u)){l=ji(t,c,0,g,y,k,_,A,B,w-B,l),A=S=_=0,B=w;for(var Z=0;Z<286;++Z)y[Z]=0;for(var Z=0;Z<30;++Z)k[Z]=0}var D=2,ee=0,N=f,O=F-W&32767;if(K>2&&U==I(w-O))for(var te=Math.min(d,K)-1,se=Math.min(32767,w),le=Math.min(258,K);O<=se&&--N&&F!=W;){if(t[w+D]==t[w+D-O]){for(var V=0;V<le&&t[w+V]==t[w+V-O];++V);if(V>D){if(D=V,ee=O,V>te)break;for(var Ie=Math.min(O,V-2),De=0,Z=0;Z<Ie;++Z){var Oe=w-O+Z&32767,Mt=v[Oe],at=Oe-Mt&32767;at>De&&(De=at,W=Oe)}}}F=W,W=v[F],O+=F-W&32767}if(ee){g[A++]=268435456|Os[D]<<18|Bi[ee];var pn=Os[D]&31,R=Bi[ee]&31;_+=As[pn]+Ms[R],++y[257+pn],++k[R],L=w+D,++S}else g[A++]=t[w],++y[t[w]]}}for(w=Math.max(w,L);w<o;++w)g[A++]=t[w],++y[t[w]];l=ji(t,c,u,g,y,k,_,A,B,w-B,l),u||(r.r=l&7|c[l/8|0]<<3,l-=7,r.h=E,r.p=v,r.i=w,r.w=L)}else{for(var w=r.w||0;w<o+u;w+=65535){var G=w+65535;G>=o&&(c[l/8|0]=u,G=o),l=zi(c,l+1,t.subarray(w,G))}r.i=o}return zo(a,0,s+Fi(l)+i)},qo=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}(),Vo=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=qo[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},Hi=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new Qe(r.length+t.length);o.set(r),o.set(t,r.length),t=o,i.w=r.length}return Ho(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)},Zc=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},Go=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},Fs=[],$c=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},eu=function(t,e,n,s){if(!Fs[n]){for(var i="",r={},o=t.length-1,a=0;a<o;++a)i=Go(t[a],i,r);Fs[n]={c:Go(t[o],i,r),e:r}}var c=Zc({},Fs[n].e);return Xc(Fs[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,$c(c),s)},tu=function(){return[Qe,We,Ds,As,Ms,Li,Os,Bi,Fo,Ht,Wo,ns,Ps,Uo,Ui,Nn,ht,Rn,Ls,Bs,Wi,Dn,zi,ji,Fi,zo,Ho,Hi,iu,Ko]},nu=function(){return[Xo,Yo,Ws,Vo,qo]},Ko=function(t){return postMessage(t,[t.buffer])},su=function(t,e,n,s,i,r){var o=eu(n,s,i,function(a,c){o.terminate(),r(a,c)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Ws=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Xo=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&&Ws(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)}},Yo=function(t){return 10+(t.filename?t.filename.length+1:0)};function iu(t,e){return Hi(t,e||{},0,0)}function ru(t,e,n){return n||(n=e,e={}),typeof n!="function"&&jo(7),su(t,e,[tu,nu,function(){return[Jo]}],function(s){return Ko(Jo(s.data[0],s.data[1]))},2,n)}function Jo(t,e){e||(e={});var n=Vo(),s=t.length;n.p(t);var i=Hi(t,e,Yo(e),8),r=i.length;return Xo(i,e),Ws(i,r-8,n.d()),Ws(i,r-4,s),i}var ou=typeof TextDecoder<"u"&&new TextDecoder,au=0;try{ou.decode(Ui,{stream:!0}),au=1}catch{}class Qo{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 lu{constructor(e){this.dict=new Qo,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 Qo}}class cu{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=uu(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=An[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=An[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=An[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=An[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=An[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=An[i.operator];r&&n.some(o=>r(o,i.value))&&this.trigger(i.name)})}}const An={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},uu=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 hu{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 Zo={htmlmasked:"hidden",masked:"obscured"},dt=!(typeof window>"u"),du=dt&&navigator.userAgent.match(/firefox|fxios/i),fu=1e5;let qi=dt?Date.now()-performance.now():0;function Vi(){qi=Date.now()-performance.now()}function Mn(){return qi}const rt=dt&&performance.now?()=>Math.round(performance.now()+qi):()=>Date.now(),Gi="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function $o(t){return t.trim().replace(/\s+/g," ")}function ea(t){return t.startsWith("https://")||t.startsWith("http://")}const zs="https://docs.openreplay.com",ta={};function qt(t,e,n="/"){ta[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${zs}${n} for more information.`),ta[t]=!0)}function Ki(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 rn(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(Zo[e]&&qt(`"${n}" attribute`,`"${Zo[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function pu(t){try{return!!t.contentDocument}catch{return!1}}function na(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 sa(t){return t.toString(16).padStart(2,"0")}function gu(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,sa).join("")):Array.from({length:t},()=>sa(Math.floor(Math.random()*16))).join("")}function ia(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function Xi(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function ra(t,e){if(e)return new MutationObserver(t);{const n=Xi("MutationObserver");return new window[n](t)}}function oa(t,e,n,s,i){if(!na(t))return;let r="addEventListener";i||(r=Xi("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 aa(t,e,n,s,i){if(!na(t))return;let r="removeEventListener";i||(r=Xi("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 mu{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 vu=new mu;function bu(t){vu.addTask(t)}function la(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]=la(r||{},i):n[s]=i}return n}function on(t){return[0,t]}function wu(t,e){return[5,t,e]}function yu(t,e){return[6,t,e]}function _u(){return[7]}function Su(t,e,n,s,i){return[8,t,e,n,s,i]}function ku(t,e,n){return[9,t,e,n]}function Tu(t,e,n){return[10,t,e,n]}function xu(t){return[11,t]}function ca(t,e){return[13,t,e]}function Eu(t,e){return[14,t,e]}function Iu(t,e,n){return[16,t,e,n]}function Cu(t,e,n){return[18,t,e,n]}function Nu(t,e){return[19,t,e]}function Ru(t,e){return[20,t,e]}function Du(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 Mu(t,e,n){return[24,t,e,n]}function Ou(t,e){return[27,t,e]}function Pu(t){return[28,t]}function Lu(t){return[29,t]}function ua(t,e){return[30,t,e]}function Bu(t,e,n,s){return[49,t,e,n,s]}function Fu(t,e){return[54,t,e]}function Wu(t){return[55,t]}function ha(t,e,n,s){return[57,t,e,n,s]}function da(t){return[58,t]}function Yi(t,e,n,s){return[60,t,e,n,s]}function zu(t,e,n){return[61,t,e,n]}function ju(t,e){return[63,t,e]}function Uu(t,e){return[64,t,e]}function Hu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function Ji(t,e){return[70,t,e]}function fa(t,e,n){return[71,t,e,n]}function Qi(t,e,n,s){return[73,t,e,n,s]}function pa(t,e){return[75,t,e]}function ga(t,e){return[76,t,e]}function qu(t,e){return[77,t,e]}function Zi(t,e,n,s){return[78,t,e,n,s]}function js(t,e,n,s,i,r,o,a,c){return[83,t,e,n,s,i,r,o,a,c]}function Vu(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function Gu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function ma(t,e,n){return[113,t,e,n]}function Ku(t){return[114,t]}function va(t){return[115,t]}function ba(t,e,n,s,i,r,o,a,c,u){return[116,t,e,n,s,i,r,o,a,c,u]}function Us(t){return[117,t]}function an(t){return[118,t]}function Xu(t,e){return[119,t,e]}function Yu(t){return[120,t]}function Ju(t,e,n,s){return[122,t,e,n,s]}const $i=dt&&"performance"in window&&"memory"in performance?performance:{memory:{}},er=dt?(navigator.deviceMemory||0)*1024:0,tr=$i.memory.jsHeapSizeLimit||0;function Qu(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(Bu(s,i,$i.memory.totalJSHeapSize||0,$i.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 wa="__or__watched_tags__";class Zu{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(wa)??"[]");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(wa,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 $u={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"'},eh={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Hs={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"},th={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},nh={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"},sh={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"},ya={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},On={display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.625rem",fontSize:"13px",lineHeight:"auto"},ih={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"},Pn={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"},rh={...Pn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},_a={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},Sa={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"},ka={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},oh={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},Ta={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},ah={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"},xa={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"},Ea={fontWeight:"bold"},lh={fontSize:"13px",lineHeight:"auto"},Ia={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},ch={...Ia,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},uh={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},hh={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},Ca={Standard:{width:1280,height:720}};class dh{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 fh(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 ph(){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 gh(){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 mh(){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 mh(){gh();const t=document.createElement("div");return t.classList.add("spinner"),Object.assign(t.style,uh),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 Hs="or_uxt_test_start",tr="or_uxt_task_index",nr="or_uxt_session_id",vh="or_uxt_test_id";class wh{constructor(e,n,s,i,r,o,a,c,u){this.ingestPoint=e,this.getTimestamp=n,this.token=s,this.testId=i,this.storageKey=r,this.setStorageKey=o,this.removeStorageKey=a,this.getStorageKey=c,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,f)=>{if(!h)return console.error("User Testing: No Task ID Given");const p=this.durations.tasks.find(k=>k.taskId===h),v=this.getTimestamp(),I=p?v-p.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:I,timestamp:v,taskAnswer:f})})},this.signalTest=h=>{const d=this.getTimestamp();if(h==="begin"&&this.testId){const v=this.getSessionId();this.setStorageKey(nr,v),this.setStorageKey(this.storageKey,this.testId.toString()),this.setStorageKey(Hs,d.toString())}else this.removeStorageKey(this.storageKey),this.removeStorageKey(tr),this.removeStorageKey(Hs);const f=this.durations.testStart||d,p=d-f;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:p,timestamp:d})})};const l=this.getStorageKey(Hs);l&&(this.durations.testStart=parseInt(l,10))}}class bh{constructor(e,n){this.app=e,this.storageKey=n,this.bg=X("div","bg",Zu,void 0,"__or_ut_bg"),this.container=X("div","container",$u,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,c)=>{this.testId=o;const u=this.app.options.ingestPoint;return fetch(`${u}/v1/web/uxt/test/${o}`,{headers:{Authorization:`Bearer ${a}`}}).then(l=>l.json()).then(({test:l})=>{this.isActive=!0,this.test=l,this.signalManager=new wh(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(l.title,l.reqMic,l.reqCamera),c&&((l.reqMic||l.reqCamera)&&this.userRecorder.startRecording(30,Ia.Standard,l.reqMic,l.reqCamera),this.showWidget(l.description,l.tasks,!0),this.showTaskSection())}).then(()=>o).catch(l=>{console.log("OR: Error fetching test",l)})},this.hideTaskSection=()=>!1,this.showTaskSection=()=>!0,this.collapseWidget=()=>!1,this.removeGreeting=()=>!1,this.toggleDescriptionVisibility=()=>{},this.currentTaskIndex=0,this.userRecorder=new hh(e);const s=this.app.getSessionID(),i=this.app.localStorage.getItem(nr);s!==i&&(this.app.localStorage.removeItem(this.storageKey),this.app.localStorage.removeItem(nr),this.app.localStorage.removeItem(vh),this.app.localStorage.removeItem(tr),this.app.localStorage.removeItem(Hs));const r=this.app.localStorage.getItem(tr);r&&(this.currentTaskIndex=parseInt(r,10))}getTestId(){return this.testId}createGreeting(e,n,s){const i=X("div","title",eh,e),r=X("div","description",th,`Welcome, you're here to help us improve, not to be judged. Your insights matter!
4
+ }`,document.head.appendChild(t)}function vh(){mh();const t=document.createElement("div");return t.classList.add("spinner"),Object.assign(t.style,hh),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 qs="or_uxt_test_start",nr="or_uxt_task_index",sr="or_uxt_session_id",bh="or_uxt_test_id";class wh{constructor(e,n,s,i,r,o,a,c,u){this.ingestPoint=e,this.getTimestamp=n,this.token=s,this.testId=i,this.storageKey=r,this.setStorageKey=o,this.removeStorageKey=a,this.getStorageKey=c,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,f)=>{if(!h)return console.error("User Testing: No Task ID Given");const p=this.durations.tasks.find(T=>T.taskId===h),v=this.getTimestamp(),E=p?v-p.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:E,timestamp:v,taskAnswer:f})})},this.signalTest=h=>{const d=this.getTimestamp();if(h==="begin"&&this.testId){const v=this.getSessionId();this.setStorageKey(sr,v),this.setStorageKey(this.storageKey,this.testId.toString()),this.setStorageKey(qs,d.toString())}else this.removeStorageKey(this.storageKey),this.removeStorageKey(nr),this.removeStorageKey(qs);const f=this.durations.testStart||d,p=d-f;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:p,timestamp:d})})};const l=this.getStorageKey(qs);l&&(this.durations.testStart=parseInt(l,10))}}class yh{constructor(e,n){this.app=e,this.storageKey=n,this.bg=X("div","bg",$u,void 0,"__or_ut_bg"),this.container=X("div","container",eh,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,c)=>{this.testId=o;const u=this.app.options.ingestPoint;return fetch(`${u}/v1/web/uxt/test/${o}`,{headers:{Authorization:`Bearer ${a}`}}).then(l=>l.json()).then(({test:l})=>{this.isActive=!0,this.test=l,this.signalManager=new wh(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(l.title,l.reqMic,l.reqCamera),c&&((l.reqMic||l.reqCamera)&&this.userRecorder.startRecording(30,Ca.Standard,l.reqMic,l.reqCamera),this.showWidget(l.description,l.tasks,!0),this.showTaskSection())}).then(()=>o).catch(l=>{console.log("OR: Error fetching test",l)})},this.hideTaskSection=()=>!1,this.showTaskSection=()=>!0,this.collapseWidget=()=>!1,this.removeGreeting=()=>!1,this.toggleDescriptionVisibility=()=>{},this.currentTaskIndex=0,this.userRecorder=new dh(e);const s=this.app.getSessionID(),i=this.app.localStorage.getItem(sr);s!==i&&(this.app.localStorage.removeItem(this.storageKey),this.app.localStorage.removeItem(sr),this.app.localStorage.removeItem(bh),this.app.localStorage.removeItem(nr),this.app.localStorage.removeItem(qs));const r=this.app.localStorage.getItem(nr);r&&(this.currentTaskIndex=parseInt(r,10))}getTestId(){return this.testId}createGreeting(e,n,s){const i=X("div","title",th,e),r=X("div","description",nh,`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=X("div","button",nh,"Read guidelines to begin");this.removeGreeting=()=>((n||s)&&this.userRecorder.startRecording(30,Ia.Standard,n,s),this.container.removeChild(o),this.container.removeChild(r),this.container.removeChild(i),!1),o.onclick=()=>{var c,u,l,h;this.removeGreeting();const a=(c=this.signalManager)==null?void 0:c.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,Us),this.showWidget(((l=this.test)==null?void 0:l.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,Us);const r=this.createDescriptionSection(e),o=this.createTasksSection(n),a=X("div","stop_bn_or",Sa,"Abort Session"),c=X("div","stop_ct_or",{fontSize:"13px!important"});c.style.fontSize="13px",c.append(a),this.container.append(i,r,o,c),this.taskSection=o,this.descriptionSection=r,this.stopButton=a,this.stopButtonContainer=c,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",sh),n=fh(),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=ph();e.append(n,s,i);const r=c=>(this.widgetVisible=c,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?Us:{border:"none",background:"none",padding:0}),this.taskSection&&Object.assign(this.taskSection.style,this.widgetVisible?Pn:{display:"none"}),this.descriptionSection&&Object.assign(this.descriptionSection.style,this.widgetVisible?Pn:{display:"none"}),this.endSection&&Object.assign(this.endSection.style,this.widgetVisible?Pn:{display:"none"}),this.stopButton&&Object.assign(this.stopButton.style,this.widgetVisible?Sa:{display:"none"}),c),o=()=>{Object.assign(i.style,{transform:this.widgetVisible?"rotate(0deg)":"rotate(180deg)"}),r(!this.widgetVisible)};return s.onclick=o,i.onclick=o,dh(this.bg,n),this.collapseWidget=()=>r(!1),e}createDescriptionSection(e){const n=X("div","description_section_or",Pn),s=X("div","description_s_title_or",ba),i=X("div","title",{fontSize:13,fontWeight:500,lineHeight:"auto"},"Introduction & Guidelines"),r=X("div","icon",ya,"-"),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 c=X("div","button_begin_or",_a,"Begin Test");s.append(i,r),o.append(a,c),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(c)},c.onclick=()=>{var l,h,d;if(u(),this.test){const f=(l=this.signalManager)==null?void 0:l.getDurations(),p=f?f.tasks.findIndex(v=>this.test&&v.taskId===this.test.tasks[0].task_id):null;f&&p===-1&&(f.tasks.push({taskId:this.test.tasks[0].task_id,started:this.app.timestamp()}),(h=this.signalManager)==null||h.setDurations(f)),(d=this.signalManager)==null||d.signalTask(this.test.tasks[0].task_id,"begin")}this.showTaskSection(),o.removeChild(c)},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,Us);const n=X("div","task_section_or",Pn),s=X("div","description_t_title_or",ba),i=X("div","title",{fontSize:"13px",fontWeight:"500",lineHeight:"auto"},"Tasks"),r=X("div","icon",ya,"-"),o=X("div","content",An),a=X("div","pagination",rh),c=X("div","taskCard",Ta),u=X("div","taskText",xa),l=X("div","taskDescription",ah),h=X("div","taskButtons",ch),d=X("div","taskText",xa);d.textContent="Your answer";const f=X("textarea","taskDescription",{resize:"vertical"}),p=X("div","inputArea",Ta);p.append(d,f);const v=X("div","closePanelButton",Ea,"Collapse Panel"),I=X("div","nextButton",lh,"Done, Next");s.append(i,r),c.append(u,l),h.append(v,I),o.append(a,c,p,h),n.append(s,o);const k=()=>{const g=e[this.currentTaskIndex];u.textContent=g.title,l.textContent=g.description,g.allow_typing?p.style.display="flex":p.style.display="none"};e.forEach((g,S)=>{const y=X("span",`or_task_${S}`,{outline:"1px solid #efefef",fontSize:"13px",height:"24px",width:"24px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em"},(S+1).toString());y.id=`or_task_${S}`,a.append(y)});const T=()=>{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 E=()=>{const g=document.getElementById(`or_task_${this.currentTaskIndex}`);g&&Object.assign(g.style,ka);for(let S=0;S<this.currentTaskIndex;S++){const y=document.getElementById(`or_task_${S}`);y&&Object.assign(y.style,oh)}};return s.onclick=T,v.onclick=this.collapseWidget,I.onclick=()=>{var S,y,x,b;const g=e[this.currentTaskIndex].allow_typing?f.value:void 0;if(f.value="",(S=this.signalManager)==null||S.signalTask(e[this.currentTaskIndex].task_id,"done",g),this.currentTaskIndex<e.length-1){this.currentTaskIndex++,k();const _=(y=this.signalManager)==null?void 0:y.getDurations();_&&_.tasks.findIndex(M=>M.taskId===e[this.currentTaskIndex].task_id)===-1&&(_.tasks.push({taskId:e[this.currentTaskIndex].task_id,started:this.app.timestamp()}),(x=this.signalManager)==null||x.setDurations(_)),(b=this.signalManager)==null||b.signalTask(e[this.currentTaskIndex].task_id,"begin"),E()}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,ka),k(),E()},1),n}showEndSection(){var a,c,u,l;let e=!0;(a=this.signalManager)==null||a.signalTest("done");const n=X("div","end_section_or",ih),s=X("div","end_title_or",{fontSize:"1.25rem",fontWeight:"500"},"Thank you! 👍"),i=X("div","end_description_or",{},((c=this.test)==null?void 0:c.conclusion)??`Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
7
+ 🎤 Please enable mic and camera if asked, to give us a complete picture.`),o=X("div","button",sh,"Read guidelines to begin");this.removeGreeting=()=>((n||s)&&this.userRecorder.startRecording(30,Ca.Standard,n,s),this.container.removeChild(o),this.container.removeChild(r),this.container.removeChild(i),!1),o.onclick=()=>{var c,u,l,h;this.removeGreeting();const a=(c=this.signalManager)==null?void 0:c.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,Hs),this.showWidget(((l=this.test)==null?void 0:l.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,Hs);const r=this.createDescriptionSection(e),o=this.createTasksSection(n),a=X("div","stop_bn_or",ka,"Abort Session"),c=X("div","stop_ct_or",{fontSize:"13px!important"});c.style.fontSize="13px",c.append(a),this.container.append(i,r,o,c),this.taskSection=o,this.descriptionSection=r,this.stopButton=a,this.stopButtonContainer=c,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",ih),n=ph(),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=gh();e.append(n,s,i);const r=c=>(this.widgetVisible=c,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?Hs:{border:"none",background:"none",padding:0}),this.taskSection&&Object.assign(this.taskSection.style,this.widgetVisible?Pn:{display:"none"}),this.descriptionSection&&Object.assign(this.descriptionSection.style,this.widgetVisible?Pn:{display:"none"}),this.endSection&&Object.assign(this.endSection.style,this.widgetVisible?Pn:{display:"none"}),this.stopButton&&Object.assign(this.stopButton.style,this.widgetVisible?ka:{display:"none"}),c),o=()=>{Object.assign(i.style,{transform:this.widgetVisible?"rotate(0deg)":"rotate(180deg)"}),r(!this.widgetVisible)};return s.onclick=o,i.onclick=o,fh(this.bg,n),this.collapseWidget=()=>r(!1),e}createDescriptionSection(e){const n=X("div","description_section_or",Pn),s=X("div","description_s_title_or",ya),i=X("div","title",{fontSize:13,fontWeight:500,lineHeight:"auto"},"Introduction & Guidelines"),r=X("div","icon",_a,"-"),o=X("div","content",On),a=X("div","text_description",{maxHeight:"250px",overflowY:"auto",whiteSpace:"pre-wrap",fontSize:13,color:"#454545",lineHeight:"auto"});a.innerHTML=e;const c=X("div","button_begin_or",Sa,"Begin Test");s.append(i,r),o.append(a,c),n.append(s,o);const u=()=>{this.widgetGuidelinesVisible=!this.widgetGuidelinesVisible,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?On:{display:"none"})};return s.onclick=u,this.toggleDescriptionVisibility=()=>{this.widgetGuidelinesVisible=!1,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?On:{display:"none"}),o.removeChild(c)},c.onclick=()=>{var l,h,d;if(u(),this.test){const f=(l=this.signalManager)==null?void 0:l.getDurations(),p=f?f.tasks.findIndex(v=>this.test&&v.taskId===this.test.tasks[0].task_id):null;f&&p===-1&&(f.tasks.push({taskId:this.test.tasks[0].task_id,started:this.app.timestamp()}),(h=this.signalManager)==null||h.setDurations(f)),(d=this.signalManager)==null||d.signalTask(this.test.tasks[0].task_id,"begin")}this.showTaskSection(),o.removeChild(c)},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,Hs);const n=X("div","task_section_or",Pn),s=X("div","description_t_title_or",ya),i=X("div","title",{fontSize:"13px",fontWeight:"500",lineHeight:"auto"},"Tasks"),r=X("div","icon",_a,"-"),o=X("div","content",On),a=X("div","pagination",oh),c=X("div","taskCard",xa),u=X("div","taskText",Ea),l=X("div","taskDescription",lh),h=X("div","taskButtons",uh),d=X("div","taskText",Ea);d.textContent="Your answer";const f=X("textarea","taskDescription",{resize:"vertical"}),p=X("div","inputArea",xa);p.append(d,f);const v=X("div","closePanelButton",Ia,"Collapse Panel"),E=X("div","nextButton",ch,"Done, Next");s.append(i,r),c.append(u,l),h.append(v,E),o.append(a,c,p,h),n.append(s,o);const T=()=>{const g=e[this.currentTaskIndex];u.textContent=g.title,l.textContent=g.description,g.allow_typing?p.style.display="flex":p.style.display="none"};e.forEach((g,y)=>{const k=X("span",`or_task_${y}`,{outline:"1px solid #efefef",fontSize:"13px",height:"24px",width:"24px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em"},(y+1).toString());k.id=`or_task_${y}`,a.append(k)});const x=()=>{this.widgetTasksVisible=!this.widgetTasksVisible,r.textContent=this.widgetTasksVisible?"-":"+",Object.assign(o.style,this.widgetTasksVisible?On:{display:"none"})};this.hideTaskSection=()=>(r.textContent="+",Object.assign(o.style,{display:"none"}),this.widgetTasksVisible=!1,!1),this.showTaskSection=()=>(r.textContent="-",Object.assign(o.style,On),this.widgetTasksVisible=!0,!0);const I=()=>{const g=document.getElementById(`or_task_${this.currentTaskIndex}`);g&&Object.assign(g.style,Ta);for(let y=0;y<this.currentTaskIndex;y++){const k=document.getElementById(`or_task_${y}`);k&&Object.assign(k.style,ah)}};return s.onclick=x,v.onclick=this.collapseWidget,E.onclick=()=>{var y,k,S,_;const g=e[this.currentTaskIndex].allow_typing?f.value:void 0;if(f.value="",(y=this.signalManager)==null||y.signalTask(e[this.currentTaskIndex].task_id,"done",g),this.currentTaskIndex<e.length-1){this.currentTaskIndex++,T();const w=(k=this.signalManager)==null?void 0:k.getDurations();w&&w.tasks.findIndex(A=>A.taskId===e[this.currentTaskIndex].task_id)===-1&&(w.tasks.push({taskId:e[this.currentTaskIndex].task_id,started:this.app.timestamp()}),(S=this.signalManager)==null||S.setDurations(w)),(_=this.signalManager)==null||_.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,Ta),T(),I()},1),n}showEndSection(){var a,c,u,l;let e=!0;(a=this.signalManager)==null||a.signalTest("done");const n=X("div","end_section_or",rh),s=X("div","end_title_or",{fontSize:"1.25rem",fontWeight:"500"},"Thank you! 👍"),i=X("div","end_description_or",{},((c=this.test)==null?void 0:c.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=X("div","end_button_or",_a,"Submitting Feedback"),o=mh();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 Ca(t){return!!t&&t.nodeType!=null}function sr(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function Rt(t){return t.nodeType===Node.ELEMENT_NODE}function yh(t){return t.nodeType===Node.COMMENT_NODE}function ir(t){return t.nodeType===Node.TEXT_NODE}function qs(t){return t.nodeType===Node.DOCUMENT_NODE}function Vs(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ye(t,e){return t.localName===e}class _h{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||!ye(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!ye(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=Ku(i.toString(),r);this.app.send(o);const a=u=>{Sh(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||!ye(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&&kh(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 Na={low:.35,medium:.55,high:.8};function Sh(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,Na[e])}else t.toBlob(r,o,Na[e])}function kh(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 Ln={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class Th{constructor(e=Ln.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(Ln.Verbose)&&console.info(...n)},this.log=(...n)=>{this.shouldLog(Ln.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(Ln.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(Ln.Errors)&&console.error(...n)},this.level=e}}const xh=1e3;function Eh(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 Ih(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 Ch={interval:xh*30,batchSize:2500,enabled:!0};class Nh{constructor(e,n,s){this.nodes=e,this.unregisterNode=n,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{Eh(this.nodes,this.options.batchSize,i=>{Ih(i)[0]||this.unregisterNode(i)})},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval)},this.options={...Ch,...s}}}class Rh{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;ra(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=>oa(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 Nh(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 Gs(t){if(yh(t))return!0;if(ir(t))return!1;if(!Rt(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 rr(t){return Vs(t)?!0:!Gs(t)}var pt;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(pt||(pt={}));class or{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=ia(this.app.safe(s=>{for(const i of s){const r=i.target,o=i.type;if(!rr(r))continue;if(o==="childList"){for(let c=0;c<i.removedNodes.length;c++)rr(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,pt.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=>Gs(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(ma(a))}}sendNodeAttribute(e,n,s,i){if(sr(n)){s.substring(0,6)==="xlink:"&&(s=s.substring(6)),i===null?this.app.send(la(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Xi(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"&&ye(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(la(e,s));return}if(s==="style"||s==="href"&&ye(n,"link")){this.app.send(Xi(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(ye(n,"style")){this.app.send(Wu(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(xu(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,pt.New):this.recents.get(n)!==pt.New&&this.recents.set(n,pt.Removed)}bindTree(e){if(!rr(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),Gs(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)===pt.Removed){this.app.send(Tu(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>Gs(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(ma(o))}}_commitNode(e,n){if(Vs(n))return!0;const s=n.parentNode;let i;if(!ye(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===pt.New,c=this.indexes[e];if(c===void 0)throw"commitNode: missing node index";if(a){if(Rt(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(_u(e,i,c,l.tagName,sr(n)))}for(let h=0;h<l.attributes.length;h++){const d=l.attributes[h];this.sendNodeAttribute(e,l,d.nodeName,d.value)}}else ir(n)&&(this.app.send(Su(e,i,c)),this.sendNodeData(e,s,n.data));return!0}o===pt.Removed&&i!==void 0&&this.app.send(ku(e,i,c));const u=this.attributesMap.get(e);if(u!==void 0){if(!Rt(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(!ir(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===pt.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 Ra extends or{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(Yi(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(Yi(e,s))})}}class Dh extends or{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(Yi(s,i))})}}class Mh{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 ar=ft?Element.prototype.attachShadow:()=>new ShadowRoot;class Oh extends or{constructor(e){super(e.app,!0),this.iframeOffsets=new Mh,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=>{ye(n,"iframe")&&(this.options.captureIFrames&&!on(n,"obscured")||on(n,"capture"))&&this.handleIframe(n)}),this.app.nodes.attachNodeCallback(n=>{Rt(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||!fu(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 Ra(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 Dh(this.app);this.shadowRootObservers.set(e,n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=ar.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(yu()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=ar.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new Ra(this.app);this.iframeObservers.set(window.document,i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=ar,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}var Ks;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(Ks||(Ks={}));const Ah=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class Ph{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)||Rt(s)&&(on(s,"masked")||on(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||Rt(s)&&(on(s,"htmlmasked")||on(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&Rt(s)){const i=this.options.domSanitizer(s);i===Ks.Obscured&&this.obscured.add(e),i===Ks.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?Ah(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`${Vi(i)}@${Vi(o)}.${Vi(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 Lh{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=pu(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 Bh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class Fh{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?Bh(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 Wh='!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',ss="canceled",Da="or_uxt_active",lr="or_buffer_1",Dt=t=>({reason:t,success:!1}),Ma=t=>({...t,success:!0});var ge;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(ge||(ge={}));const Oa="https://api.openreplay.com/ingest";function cr(){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 zh=t=>new Promise(e=>setTimeout(e,t)),me={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 jh=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=ge.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===me.startIframe){if(this.active())return;try{this.allowAppStart(),this.start()}catch(d){console.error("children frame restart failed:",d)}}h.line===me.parentAlive&&(this.parentActive=!0),h.line===me.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===me.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.crossDomainIframeListener=l=>{var d,f;if(!this.active()||l.source===window)return;const{data:h}=l;if(h){if(h.line===me.iframeSignal&&((d=l.source)==null||d.postMessage({ping:!0,line:me.parentAlive},"*"),(async()=>{var I;if(l.source===null)return console.error("Couldnt connect to event.source for child iframe tracking");const v=await this.checkNodeId(l.source);if(!v){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 k=this.session.getSessionToken(),T=this.trackedFrames.findIndex(g=>g===h.context)+1;T===0&&this.debug.error("Couldnt get order number for iframe",h.context,this.trackedFrames);const E={line:me.iframeId,id:v,token:k,frameOrderNumber:T};this.debug.log("Got child frame signal; nodeId",v,l.source,E),(I=l.source)==null||I.postMessage(E,"*")}catch(k){console.error(k)}})()),h.line===me.iframeBatch){const v=h.messages.map(I=>{if(I[0]===20){let k=I;return this.pageFrames.forEach(T=>{if(T.contentWindow===l.source){const[E,g,S]=I,{left:y,top:x}=T.getBoundingClientRect();k=[E,g+y,S+x]}}),k}if(I[0]===68){let k=I;return this.pageFrames.forEach(T=>{if(T.contentWindow===l.source){const[E,g,S,y,x,b,_]=I,{left:M,top:L,width:B,height:U}=T.getBoundingClientRect(),W=document.documentElement.scrollWidth,F=document.documentElement.scrollHeight,K=b/100*B+M,Z=_/100*U+L,D=K/W,ee=Z/F;k=[E,g,S,y,x,Math.round(D*1e3)/10,Math.round(ee*1e3)/10]}}),k}return I});this.messages.push(...v)}if(h.line===me.polling){if(!this.pollingQueue.order.length)return;const p=this.pollingQueue.order[0];if(p&&this.pollingQueue[p].length===0){this.pollingQueue.order=this.pollingQueue.order.filter(v=>v!==p);return}this.pollingQueue[p].includes(h.context)&&(this.pollingQueue[p]=this.pollingQueue[p].filter(v=>v!==h.context),(f=l.source)==null||f.postMessage({line:p},"*"),this.pollingQueue[p].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(me.startIframe)},this.killChildrenFrames=()=>{this.addCommand(me.killIframe)},this.signalIframeTracker=()=>{var k;const l=this.session.getTabId();window.parent.postMessage({line:me.iframeSignal,source:l,context:this.contextId},((k=this.options.crossdomain)==null?void 0:k.parentDomain)??"*");const h=10;let d=0,f=250,p=0,v=!1;const I=()=>{var T;if(v||this.checkStatus()){v=!0;return}window.parent.postMessage({line:me.iframeSignal,source:l,context:this.contextId},((T=this.options.crossdomain)==null?void 0:T.parentDomain)??"*"),this.debug.info("Trying to signal to parent, attempt:",d+1),d++};for(let T=0;T<h;T++){if(this.checkStatus()){v=!0;break}p+=f,setTimeout(()=>{I()},p),f*=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,f=!0,p=!0)=>{f&&(d=this.safe(d));const v=()=>l?ra(l,h,d,p,this.options.forceNgOff):null,I=()=>l?oa(l,h,d,p,this.options.forceNgOff):null;this.attachStartCallback(v,f),this.attachStopCallback(I,f)},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 f=[l.shift()];for(;!d;){const p=l[0];!p||p[0]===0?d=!0:f.push(l.shift())}this.postToWorker(f),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:Oa,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:Ln.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=aa(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 Ph({app:this,options:s}),this.nodes=new Rh({node_id:this.options.node_id,forceNgOff:!!s.forceNgOff,maintainer:(c=this.options.nodes)==null?void 0:c.maintainer}),this.observer=new Oh({app:this,options:s}),this.ticker=new Fh(this),this.ticker.attach(()=>this.commit()),this.debug=new Th(this.options.__debug__),this.session=new Lh({app:this,options:this.options}),this.attributeSender=new au({app:this,isDictDisabled:!!(this.options.disableStringDict||(u=this.options.crossdomain)!=null&&u.enabled)}),this.featureFlags=new uu(this),this.tagWatcher=new Qu({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:l=>this.send(Xu(l))}),this.session.attachUpdateCallback(({userID:l,metadata:h})=>{l!=null&&this.send(Au(l)),h!=null&&Object.entries(h).forEach(([d,f])=>this.send(ca(d,f)))}),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:me.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:me.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===me.resp){const h=l.data.token;this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===me.reg){const h=l.data.token;this.session.regenerateTabId(),this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===me.ask){const h=this.session.getSessionToken();h&&this.bc&&this.bc.postMessage({line:l.data.source===a?me.reg:me.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 zh(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([Wh],{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(ge.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?iu(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!==ge.NotActive&&(this.activityState===ge.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===ge.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:me.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{vu(()=>{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===ge.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===ge.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,qi(),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=ge.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(js(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var f,p;this.conditionsManager=new lu(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:$i,jsHeapSizeLimit:er,timezone:cr(),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(v=>v(d)),await((f=this.conditionsManager)==null?void 0:f.fetchConditions(l,s)),this.features["feature-flags"]&&(await this.featureFlags.reloadFlags(s),(p=this.conditionsManager)==null||p.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);qi(),this.coldStartTs=it();const i=this.localStorage.getItem(lr);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(lr)}this.bufferedMessages1.push(an(this.timestamp())),this.bufferedMessages1.push(ln(this.session.getTabId())),this.activityState=ge.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(js(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(lr,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var d,f;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:$i,jsHeapSizeLimit:er,timezone:cr()})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,beaconSizeLimit:l,projectID:h}=await n.json();for((f=this.worker)==null||f.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===ge.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const f="No worker found: perhaps, CSP is not set.";return this.signalError(f,[]),Promise.resolve(Dt(f))}if(this.activityState===ge.Active||this.activityState===ge.Starting)return Promise.resolve(Dt("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=ge.Starting,i||qi(),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 f=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:$i,jsHeapSizeLimit:er,timezone:cr(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(f.status!==200){const D=await f.text(),ee=D===ss?ss:`Server error: ${f.status}. ${D}`;return Dt(ee)}if(!this.worker&&!this.insideIframe){const D="no worker found after start request (this should not happen in real world)";return this.signalError(D,[]),Dt(D)}const{token:p,userUUID:v,projectID:I,beaconSizeLimit:k,compressionThreshold:T,delay:E,sessionID:g,startTimestamp:S,userBrowser:y,userCity:x,userCountry:b,userDevice:_,userOS:M,userState:L,canvasEnabled:B,canvasQuality:U,canvasFPS:W,assistOnly:F,features:K}=await f.json();if(this.features=K||this.features,typeof p!="string"||typeof v!="string"||typeof S!="number"&&typeof S<"u"||typeof g!="string"||typeof E!="number"||typeof k!="number"&&typeof k<"u"){const D=`Incorrect server response: ${JSON.stringify(f)}`;return this.signalError(D,[]),Dt(D)}this.delay=E,this.session.setSessionToken(p),this.session.setUserInfo({userBrowser:y,userCity:x,userCountry:b,userDevice:_,userOS:M,userState:L}),this.session.assign({sessionID:g,timestamp:S||r,projectID:I}),F?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(l=this.worker)==null||l.postMessage({type:"auth",token:p,beaconSizeLimit:k}),!a&&p===o&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(js(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([D,ee])=>this.send(ca(D,ee))),this.localStorage.setItem(this.options.local_uuid_key,v),this.compressionThreshold=T;const Z={sessionToken:p,userUUID:v,sessionID:g};if(this.startCallbacks.forEach(D=>D(Z)),e.startCallback&&e.startCallback(Ma(Z)),this.features["feature-flags"]&&this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,p),this.activityState=ge.Active,(h=this.options.crossdomain)!=null&&h.enabled&&!this.insideIframe&&this.bootChildrenFrames(),B&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new _h(this,{fps:W,quality:U,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame})),i){const D=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;D.length>0;)await this.flushBuffer(D);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 bh(this,Da);let D;const ee=this.localStorage.getItem(Da);if(ee&&(D=parseInt(ee,10)),location!=null&&location.search){const N=new URLSearchParams(location.search);if(N.has("oruxt")){const A=N.get("oruxt");D=A?parseInt(A,10):void 0}}D&&(this.uxtManager.isActive?this.onUxtCb.forEach(N=>N(D)):this.uxtManager.getTest(D,p,!!ee).then(N=>{N&&this.onUxtCb.forEach(A=>A(N))}))}return Ma(Z)}catch(f){if(this.stop(),this.session.reset(),!f)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),Dt("Unknown error");if(f===ss)return this.signalError(ss,[]),Dt(ss);this._debug("session_start",f);const p=f instanceof Error?f.message:f.toString();return this.signalError(p,[]),Dt(p)}}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(ge.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===ge.Active||this.activityState===ge.Starting?Promise.resolve(Dt("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(qu("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n,s;if(this.activityState!==ge.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=ge.NotActive,this.debug.log("OpenReplay tracking stopped.")}}};function Uh(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(Bu(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const Aa=ft&&"InstallTrigger"in window?t=>t.message+`
10
- `+t.stack:t=>t.stack||t.message;function ur(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?Aa(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function Hh(t){return typeof t!="number"?"NaN":t.toString()}function qh(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function Pa(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return Aa(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(ur).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+": "+ur(i))}return"{"+e.join(", ")+"}"}return t.toString()}function Vh(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 Pa(s);case"s":return ur(s);case"f":return Hh(s);case"d":case"i":return qh(s);default:return e}})),t.map(Pa).join(" ")}const La=["log","info","warn","error","debug","assert"];function Gh(t,e){const n=Object.assign({consoleMethods:La,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const s=t.safe((c,u)=>t.send(Ru(c,Vh(u))));let i=0;const r=()=>{i=0};t.attachStartCallback(r),t.ticker.attach(r,33,!1);const o=(c,u)=>{const l={apply:function(h,d,f){Reflect.apply(h,u,f),i=i+1,!(i>n.consoleThrottling)&&s(h.name,f)}};n.consoleMethods.forEach(h=>{if(La.indexOf(h)===-1){t.debug.error(`OpenReplay: unsupported console method "${h}"`);return}const d=u.console[h];c[h]=new Proxy(d,l)})},a=t.safe(c=>o(c.console,c));a(window),t.observer.attachContextCallback(a)}const Kh=/(^|@)\S+:\d+/,Ba=/^\s*at .*(\S+:\d+|\(native\))/m,Xh=/^(eval@)?(\[native code\])?$/;function Yh(t,e){if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return ed(t);if(t.stack&&t.stack.match(Ba))return Jh(t);if(t.stack)return Zh(t);throw new Error("Cannot parse given Error object")}function hr(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 is(t,e){return t}function Jh(t,e){return Qh(t.stack)}function Qh(t,e){return is(t.split(`
11
- `).filter(s=>!!s.match(Ba))).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=hr(r?r[1]:i),a=r&&i||void 0,c=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return{function:a,file:c,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:s}})}function Zh(t,e){return $h(t.stack)}function $h(t,e){return is(t.split(`
12
- `).filter(s=>!s.match(Xh))).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=hr(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 ed(t,e){return!t.stacktrace||t.message.includes(`
9
+ We appreciate your time and valuable input.`),r=X("div","end_button_or",Sa,"Submitting Feedback"),o=vh();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 Na(t){return!!t&&t.nodeType!=null}function ir(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function Nt(t){return t.nodeType===Node.ELEMENT_NODE}function _h(t){return t.nodeType===Node.COMMENT_NODE}function rr(t){return t.nodeType===Node.TEXT_NODE}function Vs(t){return t.nodeType===Node.DOCUMENT_NODE}function Gs(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ye(t,e){return t.localName===e}class Sh{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||!ye(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!ye(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=Xu(i.toString(),r);this.app.send(o);const a=u=>{kh(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||!ye(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&&Th(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 Ra={low:.35,medium:.55,high:.8};function kh(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,Ra[e])}else t.toBlob(r,o,Ra[e])}function Th(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 Ln={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class xh{constructor(e=Ln.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(Ln.Verbose)&&console.info(...n)},this.log=(...n)=>{this.shouldLog(Ln.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(Ln.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(Ln.Errors)&&console.error(...n)},this.level=e}}const Eh=1e3;function Ih(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 Ch(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 Nh={interval:Eh*30,batchSize:2500,enabled:!0};class Rh{constructor(e,n,s){this.nodes=e,this.unregisterNode=n,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{Ih(this.nodes,this.options.batchSize,i=>{Ch(i)[0]||this.unregisterNode(i)})},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval)},this.options={...Nh,...s}}}class Dh{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;oa(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=>aa(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 Rh(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 Ks(t){if(_h(t))return!0;if(rr(t))return!1;if(!Nt(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 or(t){return Gs(t)?!0:!Ks(t)}var ft;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(ft||(ft={}));class ar{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=ra(this.app.safe(s=>{for(const i of s){const r=i.target,o=i.type;if(!or(r))continue;if(o==="childList"){for(let c=0;c<i.removedNodes.length;c++)or(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,ft.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=>Ks(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(va(a))}}sendNodeAttribute(e,n,s,i){if(ir(n)){s.substring(0,6)==="xlink:"&&(s=s.substring(6)),i===null?this.app.send(ca(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Yi(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"&&ye(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(ca(e,s));return}if(s==="style"||s==="href"&&ye(n,"link")){this.app.send(Yi(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(ye(n,"style")){this.app.send(zu(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(Eu(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,ft.New):this.recents.get(n)!==ft.New&&this.recents.set(n,ft.Removed)}bindTree(e){if(!or(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),Ks(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)===ft.Removed){this.app.send(xu(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>Ks(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(va(o))}}_commitNode(e,n){if(Gs(n))return!0;const s=n.parentNode;let i;if(!ye(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===ft.New,c=this.indexes[e];if(c===void 0)throw"commitNode: missing node index";if(a){if(Nt(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(Su(e,i,c,l.tagName,ir(n)))}for(let h=0;h<l.attributes.length;h++){const d=l.attributes[h];this.sendNodeAttribute(e,l,d.nodeName,d.value)}}else rr(n)&&(this.app.send(ku(e,i,c)),this.sendNodeData(e,s,n.data));return!0}o===ft.Removed&&i!==void 0&&this.app.send(Tu(e,i,c));const u=this.attributesMap.get(e);if(u!==void 0){if(!Nt(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(!rr(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===ft.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 Da extends ar{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(Ji(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(Ji(e,s))})}}class Ah extends ar{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(Ji(s,i))})}}class Mh{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 lr=dt?Element.prototype.attachShadow:()=>new ShadowRoot;class Oh extends ar{constructor(e){super(e.app,!0),this.iframeOffsets=new Mh,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=>{ye(n,"iframe")&&(this.options.captureIFrames&&!rn(n,"obscured")||rn(n,"capture"))&&this.handleIframe(n)}),this.app.nodes.attachNodeCallback(n=>{Nt(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||!pu(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 Da(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=lr.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(_u()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=lr.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new Da(this.app);this.iframeObservers.set(window.document,i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=lr,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}var Xs;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(Xs||(Xs={}));const Ph=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class Lh{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)||Nt(s)&&(rn(s,"masked")||rn(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||Nt(s)&&(rn(s,"htmlmasked")||rn(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&Nt(s)){const i=this.options.domSanitizer(s);i===Xs.Obscured&&this.obscured.add(e),i===Xs.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?Ph(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`${Gi(i)}@${Gi(o)}.${Gi(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 Bh{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=gu(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 Fh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class Wh{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?Fh(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 zh='!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',ss="canceled",Aa="or_uxt_active",cr="or_buffer_1",Rt=t=>({reason:t,success:!1}),Ma=t=>({...t,success:!0});var ge;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(ge||(ge={}));const Oa="https://api.openreplay.com/ingest";function ur(){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 jh=t=>new Promise(e=>setTimeout(e,t)),me={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 Uh=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=ge.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===me.startIframe){if(this.active())return;try{this.allowAppStart(),this.start()}catch(d){console.error("children frame restart failed:",d)}}h.line===me.parentAlive&&(this.parentActive=!0),h.line===me.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===me.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.crossDomainIframeListener=l=>{var d,f;if(!this.active()||l.source===window)return;const{data:h}=l;if(h){if(h.line===me.iframeSignal&&((d=l.source)==null||d.postMessage({ping:!0,line:me.parentAlive},"*"),(async()=>{var E;if(l.source===null)return console.error("Couldnt connect to event.source for child iframe tracking");const v=await this.checkNodeId(l.source);if(!v){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 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:me.iframeId,id:v,token:T,frameOrderNumber:x};this.debug.log("Got child frame signal; nodeId",v,l.source,I),(E=l.source)==null||E.postMessage(I,"*")}catch(T){console.error(T)}})()),h.line===me.iframeBatch){const v=h.messages.map(E=>{if(E[0]===20){let T=E;return this.pageFrames.forEach(x=>{if(x.contentWindow===l.source){const[I,g,y]=E,{left:k,top:S}=x.getBoundingClientRect();T=[I,g+k,y+S]}}),T}if(E[0]===68){let T=E;return this.pageFrames.forEach(x=>{if(x.contentWindow===l.source){const[I,g,y,k,S,_,w]=E,{left:A,top:L,width:B,height:U}=x.getBoundingClientRect(),F=document.documentElement.scrollWidth,W=document.documentElement.scrollHeight,K=_/100*B+A,Z=w/100*U+L,D=K/F,ee=Z/W;T=[I,g,y,k,S,Math.round(D*1e3)/10,Math.round(ee*1e3)/10]}}),T}return E});this.messages.push(...v)}if(h.line===me.polling){if(!this.pollingQueue.order.length)return;const p=this.pollingQueue.order[0];if(p&&this.pollingQueue[p].length===0){this.pollingQueue.order=this.pollingQueue.order.filter(v=>v!==p);return}this.pollingQueue[p].includes(h.context)&&(this.pollingQueue[p]=this.pollingQueue[p].filter(v=>v!==h.context),(f=l.source)==null||f.postMessage({line:p},"*"),this.pollingQueue[p].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(me.startIframe)},this.killChildrenFrames=()=>{this.addCommand(me.killIframe)},this.signalIframeTracker=()=>{var T;const l=this.session.getTabId();window.parent.postMessage({line:me.iframeSignal,source:l,context:this.contextId},((T=this.options.crossdomain)==null?void 0:T.parentDomain)??"*");const h=10;let d=0,f=250,p=0,v=!1;const E=()=>{var x;if(v||this.checkStatus()){v=!0;return}window.parent.postMessage({line:me.iframeSignal,source:l,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()){v=!0;break}p+=f,setTimeout(()=>{E()},p),f*=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,f=!0,p=!0)=>{f&&(d=this.safe(d));const v=()=>l?oa(l,h,d,p,this.options.forceNgOff):null,E=()=>l?aa(l,h,d,p,this.options.forceNgOff):null;this.attachStartCallback(v,f),this.attachStopCallback(E,f)},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 f=[l.shift()];for(;!d;){const p=l[0];!p||p[0]===0?d=!0:f.push(l.shift())}this.postToWorker(f),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:Oa,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:Ln.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=la(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 Lh({app:this,options:s}),this.nodes=new Dh({node_id:this.options.node_id,forceNgOff:!!s.forceNgOff,maintainer:(c=this.options.nodes)==null?void 0:c.maintainer}),this.observer=new Oh({app:this,options:s}),this.ticker=new Wh(this),this.ticker.attach(()=>this.commit()),this.debug=new xh(this.options.__debug__),this.session=new Bh({app:this,options:this.options}),this.attributeSender=new lu({app:this,isDictDisabled:!!(this.options.disableStringDict||(u=this.options.crossdomain)!=null&&u.enabled)}),this.featureFlags=new hu(this),this.tagWatcher=new Zu({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:l=>this.send(Yu(l))}),this.session.attachUpdateCallback(({userID:l,metadata:h})=>{l!=null&&this.send(Pu(l)),h!=null&&Object.entries(h).forEach(([d,f])=>this.send(ua(d,f)))}),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:me.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:me.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===me.resp){const h=l.data.token;this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===me.reg){const h=l.data.token;this.session.regenerateTabId(),this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===me.ask){const h=this.session.getSessionToken();h&&this.bc&&this.bc.postMessage({line:l.data.source===a?me.reg:me.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 jh(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([zh],{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(ge.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?ru(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!==ge.NotActive&&(this.activityState===ge.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===ge.Active&&n&&this.commit())}_nCommit(){var e;if(this.socketMode){this.messages.unshift(an(this.session.getTabId())),this.messages.unshift(on(this.timestamp())),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(this.insideIframe){window.parent.postMessage({line:me.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{bu(()=>{var n;this.messages.unshift(an(this.session.getTabId())),this.messages.unshift(on(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(on(this.timestamp())),this.bufferedMessages1.push(an(this.session.getTabId())),this.bufferedMessages2.push(on(this.timestamp())),this.bufferedMessages2.push(an(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===ge.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 rt()+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=rt()-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===ge.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,Vi(),this.coldStartTs=rt(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(on(this.timestamp())),this.bufferedMessages1.push(an(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(on(this.timestamp())),this.bufferedMessages2.push(an(this.session.getTabId()))),this.stop(!1),this.activityState=ge.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(Us(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var f,p;this.conditionsManager=new cu(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:rt(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:er,jsHeapSizeLimit:tr,timezone:ur(),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(v=>v(d)),await((f=this.conditionsManager)==null?void 0:f.fetchConditions(l,s)),this.features["feature-flags"]&&(await this.featureFlags.reloadFlags(s),(p=this.conditionsManager)==null||p.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);Vi(),this.coldStartTs=rt();const i=this.localStorage.getItem(cr);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(cr)}this.bufferedMessages1.push(on(this.timestamp())),this.bufferedMessages1.push(an(this.session.getTabId())),this.activityState=ge.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(Us(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(cr,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var d,f;this.stop(!1);const e=rt();(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:er,jsHeapSizeLimit:tr,timezone:ur()})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,beaconSizeLimit:l,projectID:h}=await n.json();for((f=this.worker)==null||f.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===ge.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const f="No worker found: perhaps, CSP is not set.";return this.signalError(f,[]),Promise.resolve(Rt(f))}if(this.activityState===ge.Active||this.activityState===ge.Starting)return Promise.resolve(Rt("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=ge.Starting,i||Vi(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=rt();(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 f=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:er,jsHeapSizeLimit:tr,timezone:ur(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(f.status!==200){const D=await f.text(),ee=D===ss?ss:`Server error: ${f.status}. ${D}`;return Rt(ee)}if(!this.worker&&!this.insideIframe){const D="no worker found after start request (this should not happen in real world)";return this.signalError(D,[]),Rt(D)}const{token:p,userUUID:v,projectID:E,beaconSizeLimit:T,compressionThreshold:x,delay:I,sessionID:g,startTimestamp:y,userBrowser:k,userCity:S,userCountry:_,userDevice:w,userOS:A,userState:L,canvasEnabled:B,canvasQuality:U,canvasFPS:F,assistOnly:W,features:K}=await f.json();if(this.features=K||this.features,typeof p!="string"||typeof v!="string"||typeof y!="number"&&typeof y<"u"||typeof g!="string"||typeof I!="number"||typeof T!="number"&&typeof T<"u"){const D=`Incorrect server response: ${JSON.stringify(f)}`;return this.signalError(D,[]),Rt(D)}this.delay=I,this.session.setSessionToken(p),this.session.setUserInfo({userBrowser:k,userCity:S,userCountry:_,userDevice:w,userOS:A,userState:L}),this.session.assign({sessionID:g,timestamp:y||r,projectID:E}),W?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(l=this.worker)==null||l.postMessage({type:"auth",token:p,beaconSizeLimit:T}),!a&&p===o&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Us(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([D,ee])=>this.send(ua(D,ee))),this.localStorage.setItem(this.options.local_uuid_key,v),this.compressionThreshold=x;const Z={sessionToken:p,userUUID:v,sessionID:g};if(this.startCallbacks.forEach(D=>D(Z)),e.startCallback&&e.startCallback(Ma(Z)),this.features["feature-flags"]&&this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,p),this.activityState=ge.Active,(h=this.options.crossdomain)!=null&&h.enabled&&!this.insideIframe&&this.bootChildrenFrames(),B&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new Sh(this,{fps:F,quality:U,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame})),i){const D=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;D.length>0;)await this.flushBuffer(D);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 yh(this,Aa);let D;const ee=this.localStorage.getItem(Aa);if(ee&&(D=parseInt(ee,10)),location!=null&&location.search){const N=new URLSearchParams(location.search);if(N.has("oruxt")){const O=N.get("oruxt");D=O?parseInt(O,10):void 0}}D&&(this.uxtManager.isActive?this.onUxtCb.forEach(N=>N(D)):this.uxtManager.getTest(D,p,!!ee).then(N=>{N&&this.onUxtCb.forEach(O=>O(N))}))}return Ma(Z)}catch(f){if(this.stop(),this.session.reset(),!f)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),Rt("Unknown error");if(f===ss)return this.signalError(ss,[]),Rt(ss);this._debug("session_start",f);const p=f instanceof Error?f.message:f.toString();return this.signalError(p,[]),Rt(p)}}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(ge.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===ge.Active||this.activityState===ge.Starting?Promise.resolve(Rt("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(Vu("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n,s;if(this.activityState!==ge.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=ge.NotActive,this.debug.log("OpenReplay tracking stopped.")}}};function Hh(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(Fu(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const Pa=dt&&"InstallTrigger"in window?t=>t.message+`
10
+ `+t.stack:t=>t.stack||t.message;function hr(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?Pa(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function qh(t){return typeof t!="number"?"NaN":t.toString()}function Vh(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function La(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return Pa(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(hr).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+": "+hr(i))}return"{"+e.join(", ")+"}"}return t.toString()}function Gh(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 La(s);case"s":return hr(s);case"f":return qh(s);case"d":case"i":return Vh(s);default:return e}})),t.map(La).join(" ")}const Ba=["log","info","warn","error","debug","assert"];function Kh(t,e){const n=Object.assign({consoleMethods:Ba,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const s=t.safe((c,u)=>t.send(Du(c,Gh(u))));let i=0;const r=()=>{i=0};t.attachStartCallback(r),t.ticker.attach(r,33,!1);const o=(c,u)=>{const l={apply:function(h,d,f){Reflect.apply(h,u,f),i=i+1,!(i>n.consoleThrottling)&&s(h.name,f)}};n.consoleMethods.forEach(h=>{if(Ba.indexOf(h)===-1){t.debug.error(`OpenReplay: unsupported console method "${h}"`);return}const d=u.console[h];c[h]=new Proxy(d,l)})},a=t.safe(c=>o(c.console,c));a(window),t.observer.attachContextCallback(a)}const Xh=/(^|@)\S+:\d+/,Fa=/^\s*at .*(\S+:\d+|\(native\))/m,Yh=/^(eval@)?(\[native code\])?$/;function Jh(t,e){if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return td(t);if(t.stack&&t.stack.match(Fa))return Qh(t);if(t.stack)return $h(t);throw new Error("Cannot parse given Error object")}function dr(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 is(t,e){return t}function Qh(t,e){return Zh(t.stack)}function Zh(t,e){return is(t.split(`
11
+ `).filter(s=>!!s.match(Fa))).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=dr(r?r[1]:i),a=r&&i||void 0,c=["eval","<anonymous>"].includes(o[0])?void 0:o[0];return{function:a,file:c,line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:s}})}function $h(t,e){return ed(t.stack)}function ed(t,e){return is(t.split(`
12
+ `).filter(s=>!s.match(Yh))).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=dr(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 td(t,e){return!t.stacktrace||t.message.includes(`
13
13
  `)&&t.message.split(`
14
14
  `).length>t.stacktrace.split(`
15
- `).length?td(t):t.stack?sd(t):nd(t)}function td(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 is(i)}function nd(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 is(i)}function sd(t,e){return is(t.stack.split(`
18
- `).filter(s=>!!s.match(Kh)&&!s.match(/^Error created at/))).map(s=>{const i=s.split("@"),r=hr(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 id(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function rd(t,e){return id(Yh(t))}function Fa(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function Xs(t,e,n={}){let s=e;try{s=rd(t)}catch{}return Qi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function Wa(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return Xs(t.error,Fa(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),Qi(s,i,JSON.stringify(Fa(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return Xs(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return Qi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function od(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(o){const a=Wa(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 za(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 ad(t){return hu&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const ld="https://static.openreplay.com/tracker/placeholder.jpeg";function cd(t){function e(a,c){t.attributeSender.sendSetAttribute(a,"src",ld);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=>za(h)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",l)},s=function(a,c){c.src.length>du&&e(a,c),t.send(Xi(a,"src",c.src,t.getBaseHref()))},i=t.safe(function(a){const c=za(a.src||"");$o(c)&&t.send(va(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&&!ad(a.src)?i(a):t.sanitizer.isHidden(c)||t.sanitizer.isObscured(c)?e(c,a):(s(c,a),n(c,a)))}),o=ia(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=>{ye(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 ud=["text","password","email","search","number","range","date","tel","time"];function hd(t){return ye(t,"textarea")?!0:ye(t,"input")?ud.includes(t.type):!1}function dd(t){if(!ye(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const fd=ft&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ye(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(ye(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 ja(t){let e=Gi(t);if(e===null){const n=fd(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return Zo(e).slice(0,100)}const Bn={Plain:0,Obscured:1,Hidden:2};function pd(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:Bn.Obscured,obscureInputDates:!1},e);function s(l,h){let d=h.value,f=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(l)?f=Bn.Hidden:(t.sanitizer.isObscured(l)||f===Bn.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(d)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~d.indexOf("@"))))&&(f=Bn.Obscured);let p=0;switch(f){case Bn.Hidden:p=-1,d="";break;case Bn.Obscured:p=d.length,d="";break}return{value:d,mask:p}}function i(l,h){const{value:d,mask:f}=s(l,h);t.send(Iu(l,d,f))}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(Cu(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,f){const{value:p,mask:v}=s(l,h),I=ja(h);t.send(Vu(l,p,v!==0,I,d,f))}t.nodes.attachNodeCallback(t.safe(l=>{const h=t.nodes.getID(l);if(h!==void 0){if(ye(l,"select")&&(i(h,l),t.nodes.attachNodeListener(l,"change",()=>i(h,l))),hd(l)){a(h,l);let d=0,f=0,p=0;const v=()=>{d=it()},I=()=>{f===0&&d!==0&&(f=it()-d)},k=()=>{d!==0&&(p=it()-d),u(h,l,f,p),f=0,p=0,d=0};t.nodes.attachNodeListener(l,"focus",v),t.nodes.attachNodeListener(l,"input",I),t.nodes.attachNodeListener(l,"change",k);return}if(dd(l)){c(h,l.checked),t.nodes.attachNodeListener(l,"change",()=>c(h,l.checked));return}}}))}let Ze,dr,Ua;function gd(t,e){if(Ua=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};Ze={...n,...e},dr=md(Ze.root,n);let s=Ys(t,"all",()=>Ys(t,"two",()=>Ys(t,"one",()=>Ys(t,"none"))));if(s){const i=Xa(Ya(s,t));return i.length>0&&(s=i[0]),Js(s)}else throw new Error("Selector was not found.")}function md(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function Ys(t,e,n){let s=null,i=[],r=t,o=0;for(;r;){const a=new Date().getTime()-Ua.getTime();if(Ze.timeoutMs!==void 0&&a>Ze.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let c=Zs(vd(r))||Zs(...wd(r))||Zs(...bd(r))||Zs(yd(r))||[Ga()];const u=_d(r);if(e=="all")u&&(c=c.concat(c.filter(fr).map(l=>Qs(l,u))));else if(e=="two")c=c.slice(0,1),u&&(c=c.concat(c.filter(fr).map(l=>Qs(l,u))));else if(e=="one"){const[l]=c=c.slice(0,1);u&&fr(l)&&(c=[Qs(l,u)])}else e=="none"&&(c=[Ga()],u&&(c=[Qs(c[0],u)]));for(let l of c)l.level=o;if(i.push(c),i.length>=Ze.seedMinLength&&(s=Ha(i,n),s))break;r=r.parentElement,o++}return s||(s=Ha(i,n)),!s&&n?n():s}function Ha(t,e){const n=Xa(Ka(t));if(n.length>Ze.threshold)return e?e():null;for(let s of n)if(Va(s))return s;return null}function Js(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 qa(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Va(t){const e=Js(t);switch(dr.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 vd(t){const e=t.getAttribute("id");return e&&Ze.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function wd(t){return Array.from(t.attributes).filter(n=>Ze.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function bd(t){return Array.from(t.classList).filter(Ze.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function yd(t){const e=t.tagName.toLowerCase();return Ze.tagName(e)?{name:e,penalty:2}:null}function Ga(){return{name:"*",penalty:3}}function _d(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 Qs(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function fr(t){return t.name!=="html"&&!t.name.startsWith("#")}function Zs(...t){const e=t.filter(Sd);return e.length>0?e:null}function Sd(t){return t!=null}function*Ka(t,e=[]){if(t.length>0)for(let n of t[0])yield*Ka(t.slice(1,t.length),e.concat(n));else yield e}function Xa(t){return[...t].sort((e,n)=>qa(e)-qa(n))}function*Ya(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>Ze.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>Ze.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Js(i);if(n.visited.has(r))return;Va(i)&&kd(i,e)&&(yield i,n.visited.set(r,!0),yield*Ya(i,e,n))}}function kd(t,e){return dr.querySelector(Js(t))===e}function Td(t,e,n){return gd(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 pr(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 Ja(t,e){return t instanceof Element?xd(t,e):null}function xd(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(on(n,"masked"))return null;n=n.parentElement}if(sr(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"||pr(n)||Gi(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function Ed(t,e){const{disableClickmaps:n=!1}=e||{};function s(g){const S=Gi(g);if(S!==null)return S;if(ye(g,"input"))return ja(g);if(pr(g)){let y="";return g instanceof HTMLElement&&(y=t.sanitizer.getInnerTextSecure(g)),y=y||g.id||g.className,Zo(y).slice(0,100)}return""}let i=-1,r=-1,o=!1,a=null,c=0,u={},l=0,h=0,d=0,f=0,p;const v=.008,I=225;function k(){const g=f/I;if(!l){l=g;return}const S=(g-l)/I;d>4&&S>v&&t.send(Gu(it())),f=0,d=0,l=g}t.attachStartCallback(()=>{p=setInterval(()=>k(),I)}),t.attachStopCallback(()=>{i=-1,r=-1,o=!1,a=null,u={},p&&clearInterval(p)});const T=()=>{o&&(t.send(Nu(i,r)),o=!1)},E=(g,S=!1)=>{function y(b,_,M){return u[b]=u[b]||Td(_,g,M)}const x=S?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);x(g.documentElement,"mouseover",b=>{const _=Ja(b.target,g);_!==a&&(a=_,c=performance.now())}),x(g,"mousemove",b=>{const[_,M]=t.observer.getDocumentOffset(g);i=b.clientX+_,r=b.clientY+M,o=!0;const L=Math.sign(b.movementX);f+=Math.abs(b.movementX)+Math.abs(b.movementY),L!==h&&(h=L,d++)},!1),x(g,"click",b=>{const _=Ja(b.target,g);if(!b.clientX&&!b.clientY||_===null)return;const M=t.nodes.getID(_);if(M!==void 0){const L=b.pageX,B=b.pageY,U=g.documentElement.scrollWidth,W=g.documentElement.scrollHeight,F=Qa(L/U),K=Qa(B/W);T(),t.send(Uu(M,a===_?Math.round(performance.now()-c):0,s(_),pr(_)&&!n?y(M,_,e):"",F,K),!0)}a=null})};t.nodes.attachNodeCallback(g=>{qs(g)&&E(g)}),E(document,!0),t.ticker.attach(T,(e==null?void 0:e.trackingOffset)||7)}function Qa(t){return Math.round(t*1e4)}function Id(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let o="";if(ye(r,"img")&&(o=r.currentSrc||r.src),!o){const p=getComputedStyle(r).getPropertyValue("background-image");if(p){const v=s.exec(p);v!==null&&(o=v[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 f=(h-u)*(d-l);e.push({time:a,area:f})}return e}function Cd(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 Nd(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||!$o(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(va(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,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:f,domContentLoadedEventStart:p,domContentLoadedEventEnd:v,loadEventStart:I,loadEventEnd:k}=performance.timing;t.send(Du(h-l||0,d-l||0,f-l||0,p-l||0,v-l||0,I-l||0,k-l||0,a,c))}},30)}if(n.capturePageRenderTimings){let u=0,l=0,h=0,d=null,f=!1;t.ticker.attach(()=>{if(f)return;const p=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(v=>s[v])),p-u>1e3&&(d=Id(s),s=null)),h!==null&&(p-h>50&&(l=p),h=p-l>5e3?null:p),d!==null&&h===null||p>3e4){f=!0,s=null;const v=d===null?0:Cd(c||a,d),{domContentLoadedEventEnd:I,navigationStart:k}=performance.timing,T=h===null?Math.max(l,c,I-k||0):0;t.send(Mu(v,c>u?c:u,T))}})}}function gr(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 Rd(t,e){let n=!1;const s=new Map;function i(a){Ca(a)&&(Rt(a)&&s.set(a,[a.scrollLeft,a.scrollTop]),qs(a)&&s.set(a,gr(a)))}const r=t.safe(()=>{e||t.send(bu(...gr(document)))}),o=t.safe((a,c)=>{const u=t.nodes.getID(c);u!==void 0&&t.send(Eu(u,a[0],a[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((a,c)=>{c&&(Rt(a)&&a.scrollLeft+a.scrollTop>0?s.set(a,[a.scrollLeft,a.scrollTop]):qs(a)&&s.set(a,gr(a))),Vs(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 Dd(t){let e,n,s,i,r=document.referrer;const o=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(Yu(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(wu(n,s)))}),c=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(Fu(document.hidden)));t.attachStartCallback(()=>{e=null,i=On(),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 Za(t){return Vs(t)&&!!t.adoptedStyleSheets}let Md=15;function $a(){return Md++}const $s=new Map;function Od(t){if(t===null||!Za(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 f=!d;if(d||(d=$a(),e.set(h,d)),c.includes(d)||t.send(pa(d,a)),f){const p=h.cssRules;for(let v=0;v<p.length;v++)t.send(Ji(d,p[v].cssText,v,t.getBaseHref()))}u.push(d)}if(Symbol.iterator in c)for(const h of c)u.includes(h)||t.send(Hu(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(da(h,u,t.getBaseHref())),l})},o.CSSStyleSheet.prototype.replaceSync=function(u){const l=e.get(this);return l&&t.send(da(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=>{Za(o)&&s(o)})}function Ad(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(zu("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,o)=>{const a=$s.get(i);a&&(typeof o=="string"?t.send(Ji(a,o,r,t.getBaseHref())):t.send(fa(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=$s.get(o);if(!a){t.debug.warn("No sheedID found for",o,$s);return}const c=r.cssText,u=o.cssRules,l=Array.from(u).indexOf(r);l>=0?(t.send(Ji(a,c,l,t.getBaseHref())),t.send(fa(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(!ye(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=$a();$s.set(o,a),t.send(pa(a,r));const c=o.cssRules;for(let u=0;u<c.length;u++)e(o,u,c[u].cssText)})}function Pd(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(ha(i))}let n=!1;t.nodes.attachNodeCallback(s=>{ye(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{Ca(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(ha(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&ye(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function Ld(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(ua(l,...c))}super(...o)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!qs(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(ua(r,...o))})}))}function Bd(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:f,data:p,method:v,url:I,baseURL:k}=d.config,{data:T,headers:E,status:g,response:S}=d,{data:y,headers:x,status:b}=S||{},_=n.ignoreHeaders,M=Array.isArray(_)?D=>_.includes(D):()=>_;function L(D,ee){M(ee[0])||(D[ee[0]]=ee[1])}let B={},U={};f.toJSON?B=f.toJSON():f instanceof Headers?f.forEach((D,ee)=>L(B,[ee,D])):Array.isArray(f)?f.forEach(D=>L(B,D)):typeof f=="object"&&Object.entries(f).forEach(D=>L(B,D));const W=x||E;W.toJSON?U=W.toJSON():W instanceof Headers?W.forEach((D,ee)=>L(U,[ee,D])):Array.isArray(W)?W.forEach(D=>L(U,D)):typeof W=="object"&&Object.entries(W).forEach(([D,ee])=>{M(D)||(U[D]=ee)});const F=s({url:I,method:v||"",status:g||b||0,request:{headers:B,body:p},response:{headers:U,body:y||T}});if(!F){t.debug.log("Openreplay: empty request/response info, skipping");return}const K=d.config.__openreplay_timing,Z=performance.now()-K;t.debug.log("Openreplay: final req object",F),t.send(zs("xhr",String(v),String(F.url),i(F.request),i(F.response),F.status,K+On(),Z,0))}function o(d){if(t.debug.log("Openreplay: capturing API request",d),d.__openreplay_timing=performance.now(),n.sessionTokenHeader){const f=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",p=t.getSessionToken();p&&d.headers.set(f,p)}return d}function a(d){return n.failuresOnly||r(d),d}function c(d){return t.debug.log("Openreplay: capturing API request error",d),Fd(d)&&d.response?r(d.response):d instanceof Error&&t.send(Xs(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,f,p,v;(f=(d=e.interceptors.request).eject)==null||f.call(d,l),(v=(p=e.interceptors.response).eject)==null||v.call(p,h)})}function Fd(t){return Wd(t)&&t.isAxiosError===!0}function Wd(t){return t!==null&&typeof t=="object"}class mr{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 rs=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:wr(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},vr=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(jd(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":wr(t)?e=t:e=`can't parse body ${typeof t}`;return e},zd=(t,e={})=>{wr(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 wr(t){return t!==null&&typeof t=="object"}function jd(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function ei(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const br=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),Ud=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 Hd{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 mr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const a=br(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":Ud(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=vr(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 qd{static create(e,n,s,i,r,o){if(e)return new Proxy(e,new Hd(n,s,i,r,o))}}var gt;(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"})(gt||(gt={}));class Vd{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=rs(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===gt.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=ei(this.item.responseSize),o.done&&(this.item.response=rs(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=rs(this.item.responseType,e),r.apply(s,o)),s}}}class Gd{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 mr(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=br(n),o=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=br(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=vr(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=ei(e.responseSize),e.response=rs(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new Vd(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 Kd{static create(e,n,s,i,r,o){return new Proxy(fetch,new Gd(e,n,s,i,r,o))}}class Xd{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 mr(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=rs(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===gt.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=zd(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=vr(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 gt.UNSENT:case gt.OPENED:this.item.status=gt.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case gt.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 gt.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=ei(this.item.responseSize));break;case gt.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=ei(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Yd{static create(e,n,s,i,r,o){return new Proxy(XMLHttpRequest,{construct(a){const c=new a;return new Proxy(c,new Xd(c,e,n,s,i,r,o))}})}}const el=t=>{const e=`Openreplay: Can't find ${t} in global context.`;console.warn(e)};function Jd(t,e,n,s,i,r,o={xhr:!0,fetch:!0,beacon:!0},a){var c;if(t&&(o.xhr&&(t.XMLHttpRequest?t.XMLHttpRequest=Yd.create(e,n,s,i,r,a):el("XMLHttpRequest")),o.fetch&&(t.fetch?t.fetch=Kd.create(e,n,s,i,r,a):el("fetch")),o.beacon&&!((c=t.navigator)===null||c===void 0)&&c.sendBeacon)){const u=t.navigator.sendBeacon;t.navigator.sendBeacon=qd.create(u,e,n,s,i,r)}}function yr(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function tl(t){return typeof t=="string"?t.toUpperCase():"GET"}function Qd(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 Jd(l,n.ignoreHeaders,o,a,E=>{t.send(zs(E.requestType,E.method,E.url,E.request,E.response,E.status,E.startTime+On(),E.duration,E.responseSize))},E=>t.isServiceURL(E),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const h=l.fetch.bind(l),d=(E,g={})=>{if(!(typeof E=="string"||E instanceof URL)||t.isServiceURL(String(E)))return h(E,g);o(function(y,x){g.headers===void 0&&(g.headers={}),g.headers instanceof Headers?g.headers.append(y,x):Array.isArray(g.headers)?g.headers.push([y,x]):g.headers[y]=x});const S=performance.now();return h(E,g).then(y=>{const x=performance.now()-S;if(n.failuresOnly&&y.status<400)return y;const b=y.clone();return b.text().then(_=>{const M={},L={};if(s!==!0){const W=([F,K])=>{i(F)||(M[F]=K)};g.headers instanceof Headers?g.headers.forEach((F,K)=>W([K,F])):Array.isArray(g.headers)?g.headers.forEach(W):typeof g.headers=="object"&&Object.entries(g.headers).forEach(W),b.headers.forEach((F,K)=>{i(K)||(L[K]=F)})}const B=tl(g.method),U=a({url:String(E),method:B,status:b.status,request:{headers:M,body:g.body||null},response:{headers:L,body:_}});U&&t.send(zs("fetch",B,String(U.url),c(U.request),c(U.response),b.status,S+On(),x,0))}).catch(_=>t.debug.error("Could not process Fetch response:",_)),y})};l.fetch=d;const f=l.XMLHttpRequest.prototype.open,p=l.XMLHttpRequest.prototype.setRequestHeader,v=l.XMLHttpRequest.prototype.send;function I(E,g){const S=this;o((x,b)=>S.setRequestHeader(x,b));let y=0;return S.addEventListener("loadstart",x=>{y=x.timeStamp}),S.addEventListener("load",t.safe(x=>{const{headers:b,body:_}=yr(S),M=y>0?x.timeStamp-y:0,B=(S.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),U={};B.forEach(function(K){const Z=K.split(": "),D=Z.shift();i(D)||(U[D]=Z.join(": "))});const W=tl(E),F=a({url:String(g),method:W,status:S.status,request:{headers:b,body:_||null},response:{headers:U,body:S.response}});F&&t.send(zs("xhr",W,String(F.url),c(F.request),c(F.response),S.status,y+On(),M,0))})),f.apply(this,arguments)}function k(E){const g=yr(this);return g.body=E,v.apply(this,arguments)}function T(E,g){if(!i(E)){const S=yr(this);S.headers[E]=g}return p.apply(this,arguments)}n.axiosInstances||(l.XMLHttpRequest.prototype.open=I,l.XMLHttpRequest.prototype.send=k,l.XMLHttpRequest.prototype.setRequestHeader=T)};u(window),n.axiosInstances&&n.axiosInstances.forEach(l=>{Bd(t,l,n,a,c)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function Zd(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(ga(n,s,i))}else t.send(ga(-1,-1,""))})}function $d(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(js(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const ti="/installation/javascript-sdk";function ef(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Ws}${ti}`),!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 ${Ws}${ti} for more information.`),!1;t.projectKey=t.projectID.toString(),Vt("`projectID` option","`projectKey` option",ti)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&Vt("`sessionToken` option","`sessionHash` start() option","/"),!0}const tf=()=>{try{return!!window.top}catch{return!1}};class nf{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,f=this.options.ingestPoint||Oa;d.open("POST",f+"/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=Xs(u,[],l);this.app.send(h)}else if(u instanceof ErrorEvent||"PromiseRejectionEvent"in window&&u instanceof PromiseRejectionEvent){const h=Wa(u,void 0,l);h!=null&&this.app.send(h)}}},this.crossdomainMode=!!(sa()&&((a=e.crossdomain)!=null&&a.enabled)),!ft||!ef(e)){console.error("OpenReplay: tracker called in a non-browser environment or with invalid options");return}if(window.__OPENREPLAY__||!this.crossdomainMode&&sa()&&tf()&&((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 jh(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(Dd(r),Uh(r),Ju(r,e),$d(r)),Ed(r,e.mouse),Rd(r,this.crossdomainMode),Ad(r),Od(r),Gh(r,e),od(r,e),cd(r),pd(r,e),Nd(r,e),Pd(r),Ld(r),Qd(r,e.network),Zd(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 ft?!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 ${Ws}${ti}`),!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 Vt("'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){Vt("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(Pu(e))}userAnonymousID(e){Vt("'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){Vt("'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(Ou(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(ju(e,n))}}}function sf(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,byTheGlass:!!t.by_the_glass,glassPrice:t.glass_price!=null?Number(t.glass_price):null}}function _r(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),byTheGlass:!!t.by_the_glass,glassPrice:t.glass_price!=null?Number(t.glass_price):null}}function rf(t){return{recommendations:(t.recommendations||[]).filter(Boolean).map(_r),hasMore:!!t.has_more}}class of{constructor(e,n="1"){Y(this,Yt,"https://api.wineater.com/");Y(this,Ot);Y(this,Un);z(this,Ot,e),z(this,Un,n)}async getInstantRecommendations(){try{const e=w(this,Un)==="2"?"dish/recommendations/instant/v2":"dish/recommendations/instant",n=await fetch(`${w(this,Yt)}${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,Ot)}`}}),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(sf)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=w(this,Un)==="2"?"dish/recommendations/search/v2":"dish/recommendations/search",s=await fetch(`${w(this,Yt)}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,Ot)}`},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(_r)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getMoreWineRecommendations(e,n){try{const s=await fetch(`${w(this,Yt)}dish/recommendations/search/v2/more`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,Ot)}`},body:JSON.stringify({text:e,exclude_ids:n})}),i=await s.json();if(!s.ok)throw new Error(`API call failed with status ${s.status}: ${i.message||"No additional error information"}`);return rf(i)}catch(s){throw new Error(`Error in getMoreWineRecommendations: ${s.message}`)}}async getSimilarWines(e){try{const n=await fetch(`${w(this,Yt)}dish/recommendations/similar`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,Ot)}`},body:JSON.stringify({id:e})}),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(_r)}catch(n){throw new Error(`Error in getSimilarWines: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${w(this,Yt)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(this,Ot)}`}});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}}}Yt=new WeakMap,Ot=new WeakMap,Un=new WeakMap;const af=((ll=window==null?void 0:window.wineaterData)==null?void 0:ll.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",nl=String(((cl=window==null?void 0:window.wineaterData)==null?void 0:cl.apiVersion)||"1"),os=new of(af,nl),Ve={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",SHOW_MORE_CLICKED:"show_more_clicked",SIMILAR_WINES_CLICKED:"similar_wines_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},lf={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",showMore:"Plus de vins",similarWines:"Vins similaires",byTheGlass:"Au verre",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",showMore:"Ver más",similarWines:"Vinos similares",byTheGlass:"Por copa",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",showMore:"Show more",similarWines:"Similar wines",byTheGlass:"By the glass",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",showMore:"Prikaži još",similarWines:"Slična vina",byTheGlass:"Na čašu",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",showMore:"Mehr anzeigen",similarWines:"Ähnliche Weine",byTheGlass:"Glasweise",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:"Докладніше",showMore:"Показати ще",similarWines:"Схожі вина",byTheGlass:"На келих",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:"Подробнее",showMore:"Ещё варианты",similarWines:"Похожие вина",byTheGlass:"По бокалам",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:"Толығырақ",showMore:"Тағы көрсету",similarWines:"Ұқсас шараптар",byTheGlass:"Бокалмен",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",showMore:"Mostrar mais",similarWines:"Vinhos semelhantes",byTheGlass:"Por taça",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 cf(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 uf={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?nd(t):t.stack?id(t):sd(t)}function nd(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 is(i)}function sd(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 is(i)}function id(t,e){return is(t.stack.split(`
18
+ `).filter(s=>!!s.match(Xh)&&!s.match(/^Error created at/))).map(s=>{const i=s.split("@"),r=dr(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 rd(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function od(t,e){return rd(Jh(t))}function Wa(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function Ys(t,e,n={}){let s=e;try{s=od(t)}catch{}return Zi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function za(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return Ys(t.error,Wa(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),Zi(s,i,JSON.stringify(Wa(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return Ys(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return Zi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function ad(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(o){const a=za(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 ja(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 ld(t){return du&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const cd="https://static.openreplay.com/tracker/placeholder.jpeg";function ud(t){function e(a,c){t.attributeSender.sendSetAttribute(a,"src",cd);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=>ja(h)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",l)},s=function(a,c){c.src.length>fu&&e(a,c),t.send(Yi(a,"src",c.src,t.getBaseHref()))},i=t.safe(function(a){const c=ja(a.src||"");ea(c)&&t.send(ba(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&&!ld(a.src)?i(a):t.sanitizer.isHidden(c)||t.sanitizer.isObscured(c)?e(c,a):(s(c,a),n(c,a)))}),o=ra(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=>{ye(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 hd=["text","password","email","search","number","range","date","tel","time"];function dd(t){return ye(t,"textarea")?!0:ye(t,"input")?hd.includes(t.type):!1}function fd(t){if(!ye(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const pd=dt&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ye(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(ye(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 Ua(t){let e=Ki(t);if(e===null){const n=pd(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return $o(e).slice(0,100)}const Bn={Plain:0,Obscured:1,Hidden:2};function gd(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:Bn.Obscured,obscureInputDates:!1},e);function s(l,h){let d=h.value,f=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(l)?f=Bn.Hidden:(t.sanitizer.isObscured(l)||f===Bn.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(d)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~d.indexOf("@"))))&&(f=Bn.Obscured);let p=0;switch(f){case Bn.Hidden:p=-1,d="";break;case Bn.Obscured:p=d.length,d="";break}return{value:d,mask:p}}function i(l,h){const{value:d,mask:f}=s(l,h);t.send(Cu(l,d,f))}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(Nu(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,f){const{value:p,mask:v}=s(l,h),E=Ua(h);t.send(Gu(l,p,v!==0,E,d,f))}t.nodes.attachNodeCallback(t.safe(l=>{const h=t.nodes.getID(l);if(h!==void 0){if(ye(l,"select")&&(i(h,l),t.nodes.attachNodeListener(l,"change",()=>i(h,l))),dd(l)){a(h,l);let d=0,f=0,p=0;const v=()=>{d=rt()},E=()=>{f===0&&d!==0&&(f=rt()-d)},T=()=>{d!==0&&(p=rt()-d),u(h,l,f,p),f=0,p=0,d=0};t.nodes.attachNodeListener(l,"focus",v),t.nodes.attachNodeListener(l,"input",E),t.nodes.attachNodeListener(l,"change",T);return}if(fd(l)){c(h,l.checked),t.nodes.attachNodeListener(l,"change",()=>c(h,l.checked));return}}}))}let Ze,fr,Ha;function md(t,e){if(Ha=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};Ze={...n,...e},fr=vd(Ze.root,n);let s=Js(t,"all",()=>Js(t,"two",()=>Js(t,"one",()=>Js(t,"none"))));if(s){const i=Ya(Ja(s,t));return i.length>0&&(s=i[0]),Qs(s)}else throw new Error("Selector was not found.")}function vd(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function Js(t,e,n){let s=null,i=[],r=t,o=0;for(;r;){const a=new Date().getTime()-Ha.getTime();if(Ze.timeoutMs!==void 0&&a>Ze.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let c=$s(bd(r))||$s(...wd(r))||$s(...yd(r))||$s(_d(r))||[Ka()];const u=Sd(r);if(e=="all")u&&(c=c.concat(c.filter(pr).map(l=>Zs(l,u))));else if(e=="two")c=c.slice(0,1),u&&(c=c.concat(c.filter(pr).map(l=>Zs(l,u))));else if(e=="one"){const[l]=c=c.slice(0,1);u&&pr(l)&&(c=[Zs(l,u)])}else e=="none"&&(c=[Ka()],u&&(c=[Zs(c[0],u)]));for(let l of c)l.level=o;if(i.push(c),i.length>=Ze.seedMinLength&&(s=qa(i,n),s))break;r=r.parentElement,o++}return s||(s=qa(i,n)),!s&&n?n():s}function qa(t,e){const n=Ya(Xa(t));if(n.length>Ze.threshold)return e?e():null;for(let s of n)if(Ga(s))return s;return null}function Qs(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 Va(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Ga(t){const e=Qs(t);switch(fr.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 bd(t){const e=t.getAttribute("id");return e&&Ze.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function wd(t){return Array.from(t.attributes).filter(n=>Ze.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function yd(t){return Array.from(t.classList).filter(Ze.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function _d(t){const e=t.tagName.toLowerCase();return Ze.tagName(e)?{name:e,penalty:2}:null}function Ka(){return{name:"*",penalty:3}}function Sd(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 Zs(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function pr(t){return t.name!=="html"&&!t.name.startsWith("#")}function $s(...t){const e=t.filter(kd);return e.length>0?e:null}function kd(t){return t!=null}function*Xa(t,e=[]){if(t.length>0)for(let n of t[0])yield*Xa(t.slice(1,t.length),e.concat(n));else yield e}function Ya(t){return[...t].sort((e,n)=>Va(e)-Va(n))}function*Ja(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>Ze.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>Ze.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Qs(i);if(n.visited.has(r))return;Ga(i)&&Td(i,e)&&(yield i,n.visited.set(r,!0),yield*Ja(i,e,n))}}function Td(t,e){return fr.querySelector(Qs(t))===e}function xd(t,e,n){return md(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 gr(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 Qa(t,e){return t instanceof Element?Ed(t,e):null}function Ed(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(rn(n,"masked"))return null;n=n.parentElement}if(ir(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"||gr(n)||Ki(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function Id(t,e){const{disableClickmaps:n=!1}=e||{};function s(g){const y=Ki(g);if(y!==null)return y;if(ye(g,"input"))return Ua(g);if(gr(g)){let k="";return g instanceof HTMLElement&&(k=t.sanitizer.getInnerTextSecure(g)),k=k||g.id||g.className,$o(k).slice(0,100)}return""}let i=-1,r=-1,o=!1,a=null,c=0,u={},l=0,h=0,d=0,f=0,p;const v=.008,E=225;function T(){const g=f/E;if(!l){l=g;return}const y=(g-l)/E;d>4&&y>v&&t.send(Ku(rt())),f=0,d=0,l=g}t.attachStartCallback(()=>{p=setInterval(()=>T(),E)}),t.attachStopCallback(()=>{i=-1,r=-1,o=!1,a=null,u={},p&&clearInterval(p)});const x=()=>{o&&(t.send(Ru(i,r)),o=!1)},I=(g,y=!1)=>{function k(_,w,A){return u[_]=u[_]||xd(w,g,A)}const S=y?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);S(g.documentElement,"mouseover",_=>{const w=Qa(_.target,g);w!==a&&(a=w,c=performance.now())}),S(g,"mousemove",_=>{const[w,A]=t.observer.getDocumentOffset(g);i=_.clientX+w,r=_.clientY+A,o=!0;const L=Math.sign(_.movementX);f+=Math.abs(_.movementX)+Math.abs(_.movementY),L!==h&&(h=L,d++)},!1),S(g,"click",_=>{const w=Qa(_.target,g);if(!_.clientX&&!_.clientY||w===null)return;const A=t.nodes.getID(w);if(A!==void 0){const L=_.pageX,B=_.pageY,U=g.documentElement.scrollWidth,F=g.documentElement.scrollHeight,W=Za(L/U),K=Za(B/F);x(),t.send(Hu(A,a===w?Math.round(performance.now()-c):0,s(w),gr(w)&&!n?k(A,w,e):"",W,K),!0)}a=null})};t.nodes.attachNodeCallback(g=>{Vs(g)&&I(g)}),I(document,!0),t.ticker.attach(x,(e==null?void 0:e.trackingOffset)||7)}function Za(t){return Math.round(t*1e4)}function Cd(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let o="";if(ye(r,"img")&&(o=r.currentSrc||r.src),!o){const p=getComputedStyle(r).getPropertyValue("background-image");if(p){const v=s.exec(p);v!==null&&(o=v[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 f=(h-u)*(d-l);e.push({time:a,area:f})}return e}function Nd(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 Rd(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||!ea(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(ba(u.startTime+Mn(),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:f,domContentLoadedEventStart:p,domContentLoadedEventEnd:v,loadEventStart:E,loadEventEnd:T}=performance.timing;t.send(Au(h-l||0,d-l||0,f-l||0,p-l||0,v-l||0,E-l||0,T-l||0,a,c))}},30)}if(n.capturePageRenderTimings){let u=0,l=0,h=0,d=null,f=!1;t.ticker.attach(()=>{if(f)return;const p=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(v=>s[v])),p-u>1e3&&(d=Cd(s),s=null)),h!==null&&(p-h>50&&(l=p),h=p-l>5e3?null:p),d!==null&&h===null||p>3e4){f=!0,s=null;const v=d===null?0:Nd(c||a,d),{domContentLoadedEventEnd:E,navigationStart:T}=performance.timing,x=h===null?Math.max(l,c,E-T||0):0;t.send(Mu(v,c>u?c:u,x))}})}}function mr(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 Dd(t,e){let n=!1;const s=new Map;function i(a){Na(a)&&(Nt(a)&&s.set(a,[a.scrollLeft,a.scrollTop]),Vs(a)&&s.set(a,mr(a)))}const r=t.safe(()=>{e||t.send(yu(...mr(document)))}),o=t.safe((a,c)=>{const u=t.nodes.getID(c);u!==void 0&&t.send(Iu(u,a[0],a[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((a,c)=>{c&&(Nt(a)&&a.scrollLeft+a.scrollTop>0?s.set(a,[a.scrollLeft,a.scrollTop]):Vs(a)&&s.set(a,mr(a))),Gs(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(Ju(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(wu(n,s)))}),c=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(Wu(document.hidden)));t.attachStartCallback(()=>{e=null,i=Mn(),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 $a(t){return Gs(t)&&!!t.adoptedStyleSheets}let Md=15;function el(){return Md++}const ei=new Map;function Od(t){if(t===null||!$a(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 f=!d;if(d||(d=el(),e.set(h,d)),c.includes(d)||t.send(ga(d,a)),f){const p=h.cssRules;for(let v=0;v<p.length;v++)t.send(Qi(d,p[v].cssText,v,t.getBaseHref()))}u.push(d)}if(Symbol.iterator in c)for(const h of c)u.includes(h)||t.send(qu(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(fa(h,u,t.getBaseHref())),l})},o.CSSStyleSheet.prototype.replaceSync=function(u){const l=e.get(this);return l&&t.send(fa(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=>{$a(o)&&s(o)})}function Pd(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(ju("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,o)=>{const a=ei.get(i);a&&(typeof o=="string"?t.send(Qi(a,o,r,t.getBaseHref())):t.send(pa(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=ei.get(o);if(!a){t.debug.warn("No sheedID found for",o,ei);return}const c=r.cssText,u=o.cssRules,l=Array.from(u).indexOf(r);l>=0?(t.send(Qi(a,c,l,t.getBaseHref())),t.send(pa(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(!ye(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=el();ei.set(o,a),t.send(ga(a,r));const c=o.cssRules;for(let u=0;u<c.length;u++)e(o,u,c[u].cssText)})}function Ld(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(da(i))}let n=!1;t.nodes.attachNodeCallback(s=>{ye(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{Na(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(da(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&ye(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function Bd(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(ha(l,...c))}super(...o)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!Vs(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(ha(r,...o))})}))}function Fd(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:f,data:p,method:v,url:E,baseURL:T}=d.config,{data:x,headers:I,status:g,response:y}=d,{data:k,headers:S,status:_}=y||{},w=n.ignoreHeaders,A=Array.isArray(w)?D=>w.includes(D):()=>w;function L(D,ee){A(ee[0])||(D[ee[0]]=ee[1])}let B={},U={};f.toJSON?B=f.toJSON():f instanceof Headers?f.forEach((D,ee)=>L(B,[ee,D])):Array.isArray(f)?f.forEach(D=>L(B,D)):typeof f=="object"&&Object.entries(f).forEach(D=>L(B,D));const F=S||I;F.toJSON?U=F.toJSON():F instanceof Headers?F.forEach((D,ee)=>L(U,[ee,D])):Array.isArray(F)?F.forEach(D=>L(U,D)):typeof F=="object"&&Object.entries(F).forEach(([D,ee])=>{A(D)||(U[D]=ee)});const W=s({url:E,method:v||"",status:g||_||0,request:{headers:B,body:p},response:{headers:U,body:k||x}});if(!W){t.debug.log("Openreplay: empty request/response info, skipping");return}const K=d.config.__openreplay_timing,Z=performance.now()-K;t.debug.log("Openreplay: final req object",W),t.send(js("xhr",String(v),String(W.url),i(W.request),i(W.response),W.status,K+Mn(),Z,0))}function o(d){if(t.debug.log("Openreplay: capturing API request",d),d.__openreplay_timing=performance.now(),n.sessionTokenHeader){const f=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",p=t.getSessionToken();p&&d.headers.set(f,p)}return d}function a(d){return n.failuresOnly||r(d),d}function c(d){return t.debug.log("Openreplay: capturing API request error",d),Wd(d)&&d.response?r(d.response):d instanceof Error&&t.send(Ys(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,f,p,v;(f=(d=e.interceptors.request).eject)==null||f.call(d,l),(v=(p=e.interceptors.response).eject)==null||v.call(p,h)})}function Wd(t){return zd(t)&&t.isAxiosError===!0}function zd(t){return t!==null&&typeof t=="object"}class vr{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 rs=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:wr(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},br=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(Ud(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":wr(t)?e=t:e=`can't parse body ${typeof t}`;return e},jd=(t,e={})=>{wr(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 wr(t){return t!==null&&typeof t=="object"}function Ud(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function ti(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const yr=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),Hd=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 qd{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 vr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const a=yr(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":Hd(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=br(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 Vd{static create(e,n,s,i,r,o){if(e)return new Proxy(e,new qd(n,s,i,r,o))}}var pt;(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"})(pt||(pt={}));class Gd{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=rs(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===pt.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=ti(this.item.responseSize),o.done&&(this.item.response=rs(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=rs(this.item.responseType,e),r.apply(s,o)),s}}}class Kd{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 vr(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=yr(n),o=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=yr(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=br(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=ti(e.responseSize),e.response=rs(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new Gd(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 Xd{static create(e,n,s,i,r,o){return new Proxy(fetch,new Kd(e,n,s,i,r,o))}}class Yd{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 vr(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=rs(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===pt.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=jd(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=br(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 pt.UNSENT:case pt.OPENED:this.item.status=pt.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case pt.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 pt.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=ti(this.item.responseSize));break;case pt.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=ti(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Jd{static create(e,n,s,i,r,o){return new Proxy(XMLHttpRequest,{construct(a){const c=new a;return new Proxy(c,new Yd(c,e,n,s,i,r,o))}})}}const tl=t=>{const e=`Openreplay: Can't find ${t} in global context.`;console.warn(e)};function Qd(t,e,n,s,i,r,o={xhr:!0,fetch:!0,beacon:!0},a){var c;if(t&&(o.xhr&&(t.XMLHttpRequest?t.XMLHttpRequest=Jd.create(e,n,s,i,r,a):tl("XMLHttpRequest")),o.fetch&&(t.fetch?t.fetch=Xd.create(e,n,s,i,r,a):tl("fetch")),o.beacon&&!((c=t.navigator)===null||c===void 0)&&c.sendBeacon)){const u=t.navigator.sendBeacon;t.navigator.sendBeacon=Vd.create(u,e,n,s,i,r)}}function _r(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function nl(t){return typeof t=="string"?t.toUpperCase():"GET"}function Zd(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 Qd(l,n.ignoreHeaders,o,a,I=>{t.send(js(I.requestType,I.method,I.url,I.request,I.response,I.status,I.startTime+Mn(),I.duration,I.responseSize))},I=>t.isServiceURL(I),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const h=l.fetch.bind(l),d=(I,g={})=>{if(!(typeof I=="string"||I instanceof URL)||t.isServiceURL(String(I)))return h(I,g);o(function(k,S){g.headers===void 0&&(g.headers={}),g.headers instanceof Headers?g.headers.append(k,S):Array.isArray(g.headers)?g.headers.push([k,S]):g.headers[k]=S});const y=performance.now();return h(I,g).then(k=>{const S=performance.now()-y;if(n.failuresOnly&&k.status<400)return k;const _=k.clone();return _.text().then(w=>{const A={},L={};if(s!==!0){const F=([W,K])=>{i(W)||(A[W]=K)};g.headers instanceof Headers?g.headers.forEach((W,K)=>F([K,W])):Array.isArray(g.headers)?g.headers.forEach(F):typeof g.headers=="object"&&Object.entries(g.headers).forEach(F),_.headers.forEach((W,K)=>{i(K)||(L[K]=W)})}const B=nl(g.method),U=a({url:String(I),method:B,status:_.status,request:{headers:A,body:g.body||null},response:{headers:L,body:w}});U&&t.send(js("fetch",B,String(U.url),c(U.request),c(U.response),_.status,y+Mn(),S,0))}).catch(w=>t.debug.error("Could not process Fetch response:",w)),k})};l.fetch=d;const f=l.XMLHttpRequest.prototype.open,p=l.XMLHttpRequest.prototype.setRequestHeader,v=l.XMLHttpRequest.prototype.send;function E(I,g){const y=this;o((S,_)=>y.setRequestHeader(S,_));let k=0;return y.addEventListener("loadstart",S=>{k=S.timeStamp}),y.addEventListener("load",t.safe(S=>{const{headers:_,body:w}=_r(y),A=k>0?S.timeStamp-k:0,B=(y.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),U={};B.forEach(function(K){const Z=K.split(": "),D=Z.shift();i(D)||(U[D]=Z.join(": "))});const F=nl(I),W=a({url:String(g),method:F,status:y.status,request:{headers:_,body:w||null},response:{headers:U,body:y.response}});W&&t.send(js("xhr",F,String(W.url),c(W.request),c(W.response),y.status,k+Mn(),A,0))})),f.apply(this,arguments)}function T(I){const g=_r(this);return g.body=I,v.apply(this,arguments)}function x(I,g){if(!i(I)){const y=_r(this);y.headers[I]=g}return p.apply(this,arguments)}n.axiosInstances||(l.XMLHttpRequest.prototype.open=E,l.XMLHttpRequest.prototype.send=T,l.XMLHttpRequest.prototype.setRequestHeader=x)};u(window),n.axiosInstances&&n.axiosInstances.forEach(l=>{Fd(t,l,n,a,c)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function $d(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(ma(n,s,i))}else t.send(ma(-1,-1,""))})}function ef(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(Us(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const ni="/installation/javascript-sdk";function tf(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${zs}${ni}`),!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 ${zs}${ni} for more information.`),!1;t.projectKey=t.projectID.toString(),qt("`projectID` option","`projectKey` option",ni)}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 nf=()=>{try{return!!window.top}catch{return!1}};class sf{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,f=this.options.ingestPoint||Oa;d.open("POST",f+"/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=Ys(u,[],l);this.app.send(h)}else if(u instanceof ErrorEvent||"PromiseRejectionEvent"in window&&u instanceof PromiseRejectionEvent){const h=za(u,void 0,l);h!=null&&this.app.send(h)}}},this.crossdomainMode=!!(ia()&&((a=e.crossdomain)!=null&&a.enabled)),!dt||!tf(e)){console.error("OpenReplay: tracker called in a non-browser environment or with invalid options");return}if(window.__OPENREPLAY__||!this.crossdomainMode&&ia()&&nf()&&((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 Uh(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(Ad(r),Hh(r),Qu(r,e),ef(r)),Id(r,e.mouse),Dd(r,this.crossdomainMode),Pd(r),Od(r),Kh(r,e),ad(r,e),ud(r),gd(r,e),Rd(r,e),Ld(r),Bd(r),Zd(r,e.network),$d(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 dt?!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 ${zs}${ni}`),!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(Lu(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(Ou(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(Uu(e,n))}}}function rf(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,byTheGlass:!!t.by_the_glass,glassPrice:t.glass_price!=null?Number(t.glass_price):null}}function Sr(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),byTheGlass:!!t.by_the_glass,glassPrice:t.glass_price!=null?Number(t.glass_price):null}}function of(t){return{recommendations:(t.recommendations||[]).filter(Boolean).map(Sr),hasMore:!!t.has_more}}class af{constructor(e,n="1"){Y(this,Xt,"https://api.wineater.com/");Y(this,At);Y(this,Un);z(this,At,e),z(this,Un,n)}async getInstantRecommendations(){try{const e=b(this,Un)==="2"?"dish/recommendations/instant/v2":"dish/recommendations/instant",n=await fetch(`${b(this,Xt)}${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,At)}`}}),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(rf)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=b(this,Un)==="2"?"dish/recommendations/search/v2":"dish/recommendations/search",s=await fetch(`${b(this,Xt)}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,At)}`},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(Sr)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getMoreWineRecommendations(e,n){try{const s=await fetch(`${b(this,Xt)}dish/recommendations/search/v2/more`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,At)}`},body:JSON.stringify({text:e,exclude_ids:n})}),i=await s.json();if(!s.ok)throw new Error(`API call failed with status ${s.status}: ${i.message||"No additional error information"}`);return of(i)}catch(s){throw new Error(`Error in getMoreWineRecommendations: ${s.message}`)}}async getSimilarWines(e){try{const n=await fetch(`${b(this,Xt)}dish/recommendations/similar`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,At)}`},body:JSON.stringify({id:e})}),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(Sr)}catch(n){throw new Error(`Error in getSimilarWines: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${b(this,Xt)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,At)}`}});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}}}Xt=new WeakMap,At=new WeakMap,Un=new WeakMap;const lf=((cl=window==null?void 0:window.wineaterData)==null?void 0:cl.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",sl=String(((ul=window==null?void 0:window.wineaterData)==null?void 0:ul.apiVersion)||"1"),os=new af(lf,sl),Ve={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",SHOW_MORE_CLICKED:"show_more_clicked",SIMILAR_WINES_CLICKED:"similar_wines_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},cf={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",tryAgain:"Réessayer",similarWines:"Vins similaires",byTheGlass:"Au verre",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",tryAgain:"Probar otra vez",similarWines:"Vinos similares",byTheGlass:"Por copa",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",tryAgain:"Try again",similarWines:"Similar wines",byTheGlass:"By the glass",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",tryAgain:"Pokušaj ponovo",similarWines:"Slična vina",byTheGlass:"Na čašu",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",tryAgain:"Nochmal versuchen",similarWines:"Ähnliche Weine",byTheGlass:"Glasweise",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:"Докладніше",tryAgain:"Спробувати ще",similarWines:"Схожі вина",byTheGlass:"На келих",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:"Подробнее",tryAgain:"Попробовать ещё",similarWines:"Похожие вина",byTheGlass:"По бокалам",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:"Толығырақ",tryAgain:"Қайта көру",similarWines:"Ұқсас шараптар",byTheGlass:"Бокалмен",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",tryAgain:"Tentar de novo",similarWines:"Vinhos semelhantes",byTheGlass:"Por taça",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 uf(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 hf={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 {
@@ -117,10 +117,10 @@ We appreciate your time and valuable input.`),r=X("div","end_button_or",_a,"Subm
117
117
  background-color: #8bae98;
118
118
  }
119
119
  }
120
- `}};function hf(t){const e={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
120
+ `}};function df(t){const e={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
121
121
  @import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
122
122
  :root { --wineater-font-primary: 'Bricolage Grotesque', serif; }
123
- `},n=uf[t]||{};return{...e,...n}}let pe=ct({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const ve={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(pe==null?void 0:pe.currentLanguage)??"en"},getStoreLanguage(){var t;return((t=pe.storeConfig)==null?void 0:t.lang)??null},getApiKey(){var t;return((t=pe.storeConfig)==null?void 0:t.open_ai_key)??null},getStoreId(){var t;return((t=pe.storeConfig)==null?void 0:t.id)??null},setStoreLanguage(t){if(pe.storeConfig&&pe.storeConfig.available_languages.includes(t)){pe.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=pe.storeConfig)==null?void 0:t.available_languages)??["en"]},getCurrency(){var t;return((t=pe.storeConfig)==null?void 0:t.currency)??"USD"},async initializeStore(){try{const t=await os.getStoreConfig();pe.storeConfig=cf(t),pe.currentLanguage=pe.storeConfig.lang;const e=this.getLanguageFromURL();e&&pe.storeConfig.available_languages.includes(e)?this.setStoreLanguage(e):this.setStoreLanguage(pe.storeConfig.lang),this.setUiConfig(hf(pe.storeConfig.id)),pe.isConfigLoaded=!0}catch(t){console.error("Failed to initialize store:",t),pe.isConfigLoaded=!1}},isInitialized(){return pe.isConfigLoaded},getUiConfig(){return pe.uiConfig},setUiConfig(t){pe.uiConfig=t}},df={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 ff(t,e,n="en"){try{return new Intl.NumberFormat(df[n]||"en-US",{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).format(t)}catch{return t.toString()}}function _e({key:t,lang:e}){const n=lf,s=ve.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 pf({sourceLang:t,targetLang:e,texts:n,apiKey:s}){var u,l,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(([f,p])=>({key:f,text:p})),a=`
123
+ `},n=hf[t]||{};return{...e,...n}}let pe=it({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const ve={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(pe==null?void 0:pe.currentLanguage)??"en"},getStoreLanguage(){var t;return((t=pe.storeConfig)==null?void 0:t.lang)??null},getApiKey(){var t;return((t=pe.storeConfig)==null?void 0:t.open_ai_key)??null},getStoreId(){var t;return((t=pe.storeConfig)==null?void 0:t.id)??null},setStoreLanguage(t){if(pe.storeConfig&&pe.storeConfig.available_languages.includes(t)){pe.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=pe.storeConfig)==null?void 0:t.available_languages)??["en"]},getCurrency(){var t;return((t=pe.storeConfig)==null?void 0:t.currency)??"USD"},async initializeStore(){try{const t=await os.getStoreConfig();pe.storeConfig=uf(t),pe.currentLanguage=pe.storeConfig.lang;const e=this.getLanguageFromURL();e&&pe.storeConfig.available_languages.includes(e)?this.setStoreLanguage(e):this.setStoreLanguage(pe.storeConfig.lang),this.setUiConfig(df(pe.storeConfig.id)),pe.isConfigLoaded=!0}catch(t){console.error("Failed to initialize store:",t),pe.isConfigLoaded=!1}},isInitialized(){return pe.isConfigLoaded},getUiConfig(){return pe.uiConfig},setUiConfig(t){pe.uiConfig=t}},ff={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 pf(t,e,n="en"){try{return new Intl.NumberFormat(ff[n]||"en-US",{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).format(t)}catch{return t.toString()}}function _e({key:t,lang:e}){const n=cf,s=ve.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 gf({sourceLang:t,targetLang:e,texts:n,apiKey:s}){var u,l,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(([f,p])=>({key:f,text:p})),a=`
124
124
  You are a professional translator.
125
125
 
126
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}".
@@ -145,18 +145,18 @@ Output:
145
145
 
146
146
  Now translate the following input:
147
147
  ${JSON.stringify(o,null,2)}
148
- `,c=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 p=await(await fetch(i,{method:"POST",headers:r,body:c})).json(),v=(d=(h=(l=(u=p==null?void 0:p.choices)==null?void 0:u[0])==null?void 0:l.message)==null?void 0:h.content)==null?void 0:d.trim();if(!v)throw new Error("No response from OpenAI");const I=JSON.parse(v),k={};return I.forEach(T=>{T.key&&T.text!==void 0&&(k[T.key]=T.text)}),{...n,...k}}catch(f){return console.error("Error translating texts:",f),n}}Jl();var gf=Cs('<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 sl(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=gf();H(()=>{Ut(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),O(t,i)}var mf=Cs('<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 il(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=mf();H(()=>{Ut(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),O(t,i)}var vf=Cs('<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 Sr(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=vf();H(()=>{Ut(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),O(t,i)}var wf=Cs('<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 rl(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=wf();H(()=>{Ut(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),O(t,i)}var bf=q('<span><!></span><span class="wr-Header-label svelte-oiwvqb"> </span>',1),yf=q('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),_f=q('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),Sf=q('<h1 class="wr-Header-title svelte-oiwvqb"></h1>'),kf=q('<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>'),Tf=q('<div class="wr-Header"><!></div>');const xf={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;
148
+ `,c=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 p=await(await fetch(i,{method:"POST",headers:r,body:c})).json(),v=(d=(h=(l=(u=p==null?void 0:p.choices)==null?void 0:u[0])==null?void 0:l.message)==null?void 0:h.content)==null?void 0:d.trim();if(!v)throw new Error("No response from OpenAI");const E=JSON.parse(v),T={};return E.forEach(x=>{x.key&&x.text!==void 0&&(T[x.key]=x.text)}),{...n,...T}}catch(f){return console.error("Error translating texts:",f),n}}Ql();var mf=Ns('<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 il(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=mf();H(()=>{jt(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),M(t,i)}var vf=Ns('<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 rl(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=vf();H(()=>{jt(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),M(t,i)}var bf=Ns('<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 kr(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=bf();H(()=>{jt(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),M(t,i)}var wf=Ns('<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 ol(t,e){let n=He(e,"className",8,""),s=He(e,"size",8,20);var i=wf();H(()=>{jt(i,0,Cn(n())),Ee(i,"width",s()),Ee(i,"height",s())}),M(t,i)}var yf=q('<span><!></span><span class="wr-Header-label svelte-oiwvqb"> </span>',1),_f=q('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),Sf=q('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),kf=q('<h1 class="wr-Header-title svelte-oiwvqb"></h1>'),Tf=q('<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>'),xf=q('<div class="wr-Header"><!></div>');const Ef={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;
149
149
 
150
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;}
151
151
 
152
152
  @media screen and (max-width: 768px) {.wr-Header-title.svelte-oiwvqb {display:none;}
153
- }`};function Ef(t,e){Bt(e,!0),jt(t,xf);let n=he(()=>ve.getAppLanguage()),s=he(()=>ve.getUiConfig()),i=he(()=>{var d,f;return((d=window==null?void 0:window.wineaterData)==null?void 0:d.TITLE_TEXT)||((f=m(s))==null?void 0:f.titleText)||null}),r=ae(ct(Sr));function o(d){return d.split(/(meal|mood|occasion)/gi).map(f=>({keyword:/^(meal|mood|occasion)$/i.test(f)?f.toLowerCase():null,text:f}))}let a=he(()=>m(i)?o(m(i)):null);var c=Tf(),u=P(c);{var l=d=>{var f=Sf();kn(f,21,()=>m(a),Sn,(p,v)=>{var I=Nt(),k=Le(I);{var T=g=>{var S=bf(),y=Le(S),x=P(y);Eo(x,()=>m(r),(M,L)=>{L(M,{className:"wr-Header-icon",size:"28"})});var b=j(y),_=P(b);H(()=>Q(_,m(v).text)),Ct("mouseenter",y,()=>C(r,rl,!0)),Ct("mouseleave",y,()=>C(r,Sr,!0)),O(g,S)},E=g=>{var S=Nt(),y=Le(S);{var x=_=>{var M=yf(),L=Le(M);il(L,{className:"wr-Header-icon",size:"28"});var B=j(L),U=P(B);H(()=>Q(U,m(v).text)),O(_,M)},b=_=>{var M=Nt(),L=Le(M);{var B=W=>{var F=_f(),K=Le(F);sl(K,{className:"wr-Header-icon",size:"28"});var Z=j(K),D=P(Z);H(()=>Q(D,m(v).text)),O(W,F)},U=W=>{var F=En();H(()=>Q(F,m(v).text)),O(W,F)};$(L,W=>{m(v).keyword==="occasion"?W(B):W(U,!1)},!0)}O(_,M)};$(y,_=>{m(v).keyword==="mood"?_(x):_(b,!1)},!0)}O(g,S)};$(k,g=>{m(v).keyword==="meal"?g(T):g(E,!1)})}O(p,I)}),O(d,f)},h=d=>{var f=kf(),p=P(f),v=j(p),I=P(v);Eo(I,()=>m(r),(L,B)=>{B(L,{className:"wr-Header-icon",size:"28"})});var k=j(v,2),T=P(k),E=j(k,2);il(E,{className:"wr-Header-icon",size:"28"});var g=j(E,2),S=P(g),y=j(g,3),x=j(y);sl(x,{className:"wr-Header-icon",size:"28"});var b=j(x,2),_=P(b),M=j(b);H((L,B,U,W,F,K)=>{Q(p,`${L??""} `),Q(T,B),Q(S,U),Q(y,` ${W??""} `),Q(_,F),Q(M,` ${K??""}`)},[()=>_e({key:"headerLine1",lang:m(n)}),()=>_e({key:"headerMeal",lang:m(n)}),()=>_e({key:"headerMood",lang:m(n)}),()=>_e({key:"headerOr",lang:m(n)}),()=>_e({key:"headerOccasion",lang:m(n)}),()=>_e({key:"headerLine2",lang:m(n)})]),Ct("mouseenter",v,()=>C(r,rl,!0)),Ct("mouseleave",v,()=>C(r,Sr,!0)),O(d,f)};$(u,d=>{m(a)?d(l):d(h,!1)})}O(t,c),Ft()}var If=q('<option class="wr-Footer-lang"> </option>'),Cf=q('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),Nf=q('<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 Rf={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;}
153
+ }`};function If(t,e){Lt(e,!0),zt(t,Ef);let n=he(()=>ve.getAppLanguage()),s=he(()=>ve.getUiConfig()),i=he(()=>{var d,f;return((d=window==null?void 0:window.wineaterData)==null?void 0:d.TITLE_TEXT)||((f=m(s))==null?void 0:f.titleText)||null}),r=ae(it(kr));function o(d){return d.split(/(meal|mood|occasion)/gi).map(f=>({keyword:/^(meal|mood|occasion)$/i.test(f)?f.toLowerCase():null,text:f}))}let a=he(()=>m(i)?o(m(i)):null);var c=xf(),u=P(c);{var l=d=>{var f=kf();kn(f,21,()=>m(a),Sn,(p,v)=>{var E=Ct(),T=Le(E);{var x=g=>{var y=yf(),k=Le(y),S=P(k);Io(S,()=>m(r),(A,L)=>{L(A,{className:"wr-Header-icon",size:"28"})});var _=j(k),w=P(_);H(()=>Q(w,m(v).text)),It("mouseenter",k,()=>C(r,ol,!0)),It("mouseleave",k,()=>C(r,kr,!0)),M(g,y)},I=g=>{var y=Ct(),k=Le(y);{var S=w=>{var A=_f(),L=Le(A);rl(L,{className:"wr-Header-icon",size:"28"});var B=j(L),U=P(B);H(()=>Q(U,m(v).text)),M(w,A)},_=w=>{var A=Ct(),L=Le(A);{var B=F=>{var W=Sf(),K=Le(W);il(K,{className:"wr-Header-icon",size:"28"});var Z=j(K),D=P(Z);H(()=>Q(D,m(v).text)),M(F,W)},U=F=>{var W=En();H(()=>Q(W,m(v).text)),M(F,W)};$(L,F=>{m(v).keyword==="occasion"?F(B):F(U,!1)},!0)}M(w,A)};$(k,w=>{m(v).keyword==="mood"?w(S):w(_,!1)},!0)}M(g,y)};$(T,g=>{m(v).keyword==="meal"?g(x):g(I,!1)})}M(p,E)}),M(d,f)},h=d=>{var f=Tf(),p=P(f),v=j(p),E=P(v);Io(E,()=>m(r),(L,B)=>{B(L,{className:"wr-Header-icon",size:"28"})});var T=j(v,2),x=P(T),I=j(T,2);rl(I,{className:"wr-Header-icon",size:"28"});var g=j(I,2),y=P(g),k=j(g,3),S=j(k);il(S,{className:"wr-Header-icon",size:"28"});var _=j(S,2),w=P(_),A=j(_);H((L,B,U,F,W,K)=>{Q(p,`${L??""} `),Q(x,B),Q(y,U),Q(k,` ${F??""} `),Q(w,W),Q(A,` ${K??""}`)},[()=>_e({key:"headerLine1",lang:m(n)}),()=>_e({key:"headerMeal",lang:m(n)}),()=>_e({key:"headerMood",lang:m(n)}),()=>_e({key:"headerOr",lang:m(n)}),()=>_e({key:"headerOccasion",lang:m(n)}),()=>_e({key:"headerLine2",lang:m(n)})]),It("mouseenter",v,()=>C(r,ol,!0)),It("mouseleave",v,()=>C(r,kr,!0)),M(d,f)};$(u,d=>{m(a)?d(l):d(h,!1)})}M(t,c),Bt()}var Cf=q('<option class="wr-Footer-lang"> </option>'),Nf=q('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),Rf=q('<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 Df={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;}
154
154
 
155
155
  @media screen and (max-width: 768px) {.wr-Footer-text--sommelier.svelte-1sr6y3t {display:none;}
156
- }`};function Df(t,e){Bt(e,!0),jt(t,Rf);let n=He(e,"countryCode",3,null),s=he(()=>ve.getAppLanguage()),i=he(()=>ve.getSupportedLanguages()),r=he(()=>ve.getStoreId());function o(k){const E=k.target.value;qe(Ve.LANGUAGE_CHANGED,m(r),{from_language:m(s),to_language:E}),ve.setStoreLanguage(E)}var a=Nf(),c=P(a),u=P(c),l=P(u),h=P(l),d=j(l,2),f=j(d,2),p=P(f),v=j(c,2);{var I=k=>{var T=Cf();T.__change=o,kn(T,21,()=>m(i),Sn,(g,S)=>{var y=If(),x=P(y),b={};H(_=>{jc(y,m(S)===m(s)),Q(x,_),b!==(b=m(S))&&(y.value=(y.__value=m(S))??"")},[()=>m(S).toUpperCase()]),O(g,y)});var E;Fc(T),H(()=>{E!==(E=m(s))&&(T.value=(T.__value=m(s))??"",Co(T,m(s)))}),O(k,T)};$(v,k=>{m(i).length>1&&k(I)})}H((k,T)=>{Q(h,k),Ee(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"),Q(p,T)},[()=>_e({key:"poweredBy",lang:m(s)}),()=>_e({key:"ai_sommelier",lang:m(s)})]),O(t,a),Ft()}Is(["change"]);var Mf=q('<a rel="noopener noreferrer"><!></a>'),Of=q("<button><!></button>");const Af={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,
156
+ }`};function Af(t,e){Lt(e,!0),zt(t,Df);let n=He(e,"countryCode",3,null),s=he(()=>ve.getAppLanguage()),i=he(()=>ve.getSupportedLanguages()),r=he(()=>ve.getStoreId());function o(T){const I=T.target.value;qe(Ve.LANGUAGE_CHANGED,m(r),{from_language:m(s),to_language:I}),ve.setStoreLanguage(I)}var a=Rf(),c=P(a),u=P(c),l=P(u),h=P(l),d=j(l,2),f=j(d,2),p=P(f),v=j(c,2);{var E=T=>{var x=Nf();x.__change=o,kn(x,21,()=>m(i),Sn,(g,y)=>{var k=Cf(),S=P(k),_={};H(w=>{Uc(k,m(y)===m(s)),Q(S,w),_!==(_=m(y))&&(k.value=(k.__value=m(y))??"")},[()=>m(y).toUpperCase()]),M(g,k)});var I;Wc(x),H(()=>{I!==(I=m(s))&&(x.value=(x.__value=m(s))??"",No(x,m(s)))}),M(T,x)};$(v,T=>{m(i).length>1&&T(E)})}H((T,x)=>{Q(h,T),Ee(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"),Q(p,x)},[()=>_e({key:"poweredBy",lang:m(s)}),()=>_e({key:"ai_sommelier",lang:m(s)})]),M(t,a),Bt()}Cs(["change"]);var Mf=q('<a rel="noopener noreferrer"><!></a>'),Of=q("<button><!></button>");const Pf={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,
157
157
  color 0.2s,
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 as(t,e){Bt(e,!0),jt(t,Af);let n=He(e,"type",3,"button"),s=He(e,"variant",3,"primary"),i=He(e,"target",3,"_self"),r=ve.getUiConfig(),o=`wr-Action ${s()} ${e.className||""} ${r.buttonUppercase?"wr-Action--uppercase":""}`.trim();var a=Nt(),c=Le(a);{var u=h=>{var d=Mf();d.__click=function(...p){var v;(v=e.handleClick)==null||v.apply(this,p)};var f=P(d);xo(f,e,"default",{}),H(()=>{Ut(d,1,Cn(o),"svelte-8cxv3l"),Ee(d,"href",e.href),Ee(d,"id",e.id),Ee(d,"target",i())}),O(h,d)},l=h=>{var d=Of();d.__click=function(...p){var v;(v=e.handleClick)==null||v.apply(this,p)};var f=P(d);xo(f,e,"default",{}),H(()=>{Ut(d,1,Cn(o),"svelte-8cxv3l"),Ee(d,"type",n()),Ee(d,"id",e.id)}),O(h,d)};$(c,h=>{e.href?h(u):h(l,!1)})}O(t,a),Ft()}Is(["click"]);var Pf=q('<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 Lf={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 Bf(t,e){Bt(e,!0),jt(t,Lf);let n=He(e,"searchQuery",15),s,i=ae(!1),r=ae(0),o=ae(0),a=ae(!0),c=ae(!1),u=he(()=>ve.getAppLanguage()),l=0;function h(){return s}function d(){const g=++l,S=_e({key:"placeholderSuggestions",lang:m(u)});if(!s||!S.length)return;C(c,!0);const y=()=>{if(g!==l||!s||!m(c)||m(i)||n().length)return;const x=S[m(r)];if(m(a)){if(s.placeholder=x.substring(0,Xr(o)),m(o)>x.length){C(a,!1),setTimeout(y,1600);return}setTimeout(y,90)}else{if(s.placeholder=x.substring(0,Xr(o,-1)),m(o)<0){C(a,!0),C(r,(m(r)+1)%S.length),setTimeout(y,450);return}setTimeout(y,45)}};y()}function f(){C(c,!1)}function p(){C(i,!0),f(),s&&(s.placeholder="")}function v(){C(i,!1),C(o,0),C(a,!0),C(c,!1)}Yn(()=>{if(!s||n().length>0)return;l++,C(c,!1),C(r,0),C(o,0),C(a,!0);const g=_e({key:"placeholderSuggestions",lang:m(u)});g&&g.length?s.placeholder=g[0]:s.placeholder=_e({key:"searchPlaceholder",lang:m(u)})}),Yn(()=>{s&&e.initialized&&!m(i)&&!n().length&&!m(c)&&d(),n().length>0&&m(c)&&(C(c,!1),l++)}),Ri(()=>{});var I={getSearchElement:h},k=Pf(),T=j(P(k),2);Vc(T,g=>s=g,()=>s);var E=j(T,2);return as(E,{className:"wr-Search-button",type:"submit",variant:"primary",children:(g,S)=>{var y=En();H(x=>Q(y,x),[()=>_e({key:"searchButton",lang:m(u)})]),O(g,y)},$$slots:{default:!0}}),Ct("submit",k,function(...g){var S;(S=e.onSubmit)==null||S.apply(this,g)}),Ct("focus",T,p),Ct("blur",T,v),qc(T,n),O(t,k),Ft(I)}var Ff=q('<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 Wf={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;
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 as(t,e){Lt(e,!0),zt(t,Pf);let n=He(e,"type",3,"button"),s=He(e,"variant",3,"primary"),i=He(e,"target",3,"_self"),r=ve.getUiConfig(),o=`wr-Action ${s()} ${e.className||""} ${r.buttonUppercase?"wr-Action--uppercase":""}`.trim();var a=Ct(),c=Le(a);{var u=h=>{var d=Mf();d.__click=function(...p){var v;(v=e.handleClick)==null||v.apply(this,p)};var f=P(d);Eo(f,e,"default",{}),H(()=>{jt(d,1,Cn(o),"svelte-8cxv3l"),Ee(d,"href",e.href),Ee(d,"id",e.id),Ee(d,"target",i())}),M(h,d)},l=h=>{var d=Of();d.__click=function(...p){var v;(v=e.handleClick)==null||v.apply(this,p)};var f=P(d);Eo(f,e,"default",{}),H(()=>{jt(d,1,Cn(o),"svelte-8cxv3l"),Ee(d,"type",n()),Ee(d,"id",e.id)}),M(h,d)};$(c,h=>{e.href?h(u):h(l,!1)})}M(t,a),Bt()}Cs(["click"]);var Lf=q('<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 Bf={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 Ff(t,e){Lt(e,!0),zt(t,Bf);let n=He(e,"searchQuery",15),s,i=ae(!1),r=ae(0),o=ae(0),a=ae(!0),c=ae(!1),u=he(()=>ve.getAppLanguage()),l=0;function h(){return s}function d(){const g=++l,y=_e({key:"placeholderSuggestions",lang:m(u)});if(!s||!y.length)return;C(c,!0);const k=()=>{if(g!==l||!s||!m(c)||m(i)||n().length)return;const S=y[m(r)];if(m(a)){if(s.placeholder=S.substring(0,Yr(o)),m(o)>S.length){C(a,!1),setTimeout(k,1600);return}setTimeout(k,90)}else{if(s.placeholder=S.substring(0,Yr(o,-1)),m(o)<0){C(a,!0),C(r,(m(r)+1)%y.length),setTimeout(k,450);return}setTimeout(k,45)}};k()}function f(){C(c,!1)}function p(){C(i,!0),f(),s&&(s.placeholder="")}function v(){C(i,!1),C(o,0),C(a,!0),C(c,!1)}Yn(()=>{if(!s||n().length>0)return;l++,C(c,!1),C(r,0),C(o,0),C(a,!0);const g=_e({key:"placeholderSuggestions",lang:m(u)});g&&g.length?s.placeholder=g[0]:s.placeholder=_e({key:"searchPlaceholder",lang:m(u)})}),Yn(()=>{s&&e.initialized&&!m(i)&&!n().length&&!m(c)&&d(),n().length>0&&m(c)&&(C(c,!1),l++)}),Di(()=>{});var E={getSearchElement:h},T=Lf(),x=j(P(T),2);Gc(x,g=>s=g,()=>s);var I=j(x,2);return as(I,{className:"wr-Search-button",type:"submit",variant:"primary",children:(g,y)=>{var k=En();H(S=>Q(k,S),[()=>_e({key:"searchButton",lang:m(u)})]),M(g,k)},$$slots:{default:!0}}),It("submit",T,function(...g){var y;(y=e.onSubmit)==null||y.apply(this,g)}),It("focus",x,p),It("blur",x,v),Vc(x,n),M(t,T),Bt(E)}var Wf=q('<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 zf={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;
160
160
  animation: svelte-li6gfl-typing 1s infinite;}
161
161
 
162
162
  @keyframes svelte-li6gfl-typing {
@@ -169,9 +169,14 @@ ${JSON.stringify(o,null,2)}
169
169
  transform: translateY(-8px);
170
170
  opacity: 1;
171
171
  }
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 zf(t){jt(t,Wf);var e=Ff();O(t,e)}var jf=q('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Uf=q('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Hf=q('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),qf=q('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Vf=q('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Gf=q('<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">&times;</button></div> <!> <!> <!></div></div></div>'),Kf=q('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Xf=q('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Yf=q('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Jf=q('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Qf=q('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Zf=q('<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">&times;</button></div> <!> <!> <!></div>');const $f={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 ol(t,e){Bt(e,!0),jt(t,$f);const n=!!e.isMobile;var s=Nt(),i=Le(s);{var r=a=>{var c=Gf(),u=P(c);u.__click=function(...x){var b;(b=e.onClose)==null||b.apply(this,x)};var l=j(u,2),h=P(l),d=P(h),f=P(d),p=P(f),v=j(f,2);v.__click=function(...x){var b;(b=e.onClose)==null||b.apply(this,x)};var I=j(d,2);{var k=x=>{var b=jf(),_=P(b);H(()=>Q(_,e.shortDescription)),O(x,b)};$(I,x=>{e.shortDescription&&x(k)})}var T=j(I,2);{var E=x=>{var b=Uf(),_=P(b);H(()=>Q(_,e.reason)),O(x,b)},g=x=>{var b=Nt(),_=Le(b);{var M=L=>{var B=Hf(),U=P(B);H(()=>Q(U,e.pairing)),O(L,B)};$(_,L=>{e.pairing&&L(M)},!0)}O(x,b)};$(T,x=>{e.reason?x(E):x(g,!1)})}var S=j(T,2);{var y=x=>{var b=Vf();kn(b,21,()=>e.tags,Sn,(_,M)=>{var L=qf(),B=P(L);H(()=>Q(B,m(M))),O(_,L)}),O(x,b)};$(S,x=>{e.tags&&e.tags.length&&x(y)})}H(()=>Q(p,e.title)),O(a,c)},o=a=>{var c=Zf(),u=P(c),l=P(u),h=P(l),d=j(l,2);d.__click=function(...g){var S;(S=e.onClose)==null||S.apply(this,g)};var f=j(u,2);{var p=g=>{var S=Kf(),y=P(S);H(()=>Q(y,e.shortDescription)),O(g,S)};$(f,g=>{e.shortDescription&&g(p)})}var v=j(f,2);{var I=g=>{var S=Xf(),y=P(S);H(()=>Q(y,e.reason)),O(g,S)},k=g=>{var S=Nt(),y=Le(S);{var x=b=>{var _=Yf(),M=P(_);H(()=>Q(M,e.pairing)),O(b,_)};$(y,b=>{e.pairing&&b(x)},!0)}O(g,S)};$(v,g=>{e.reason?g(I):g(k,!1)})}var T=j(v,2);{var E=g=>{var S=Qf();kn(S,21,()=>e.tags,Sn,(y,x)=>{var b=Jf(),_=P(b);H(()=>Q(_,m(x))),O(y,b)}),O(g,S)};$(T,g=>{e.tags&&e.tags.length&&g(E)})}H(()=>Q(h,e.title)),O(a,c)};$(i,a=>{n?a(r):a(o,!1)})}O(t,s),Ft()}Is(["click"]);var ep=q('<img class="wr-WineTile-image svelte-yk3emv"/>'),tp=q('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),np=q('<div class="wr-WineTile-glass svelte-yk3emv"> </div>'),sp=q('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),ip=q('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),rp=q('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),op=q('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),ap=q("<div><!> <!></div>"),lp=q('<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 cp={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),
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 jf(t){zt(t,zf);var e=Wf();M(t,e)}var Uf=q('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Hf=q('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),qf=q('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Vf=q('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Gf=q('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Kf=q('<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">&times;</button></div> <!> <!> <!></div></div></div>'),Xf=q('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Yf=q('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Jf=q('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Qf=q('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Zf=q('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),$f=q('<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">&times;</button></div> <!> <!> <!></div>');const ep={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 al(t,e){Lt(e,!0),zt(t,ep);const n=!!e.isMobile;var s=Ct(),i=Le(s);{var r=a=>{var c=Kf(),u=P(c);u.__click=function(...S){var _;(_=e.onClose)==null||_.apply(this,S)};var l=j(u,2),h=P(l),d=P(h),f=P(d),p=P(f),v=j(f,2);v.__click=function(...S){var _;(_=e.onClose)==null||_.apply(this,S)};var E=j(d,2);{var T=S=>{var _=Uf(),w=P(_);H(()=>Q(w,e.shortDescription)),M(S,_)};$(E,S=>{e.shortDescription&&S(T)})}var x=j(E,2);{var I=S=>{var _=Hf(),w=P(_);H(()=>Q(w,e.reason)),M(S,_)},g=S=>{var _=Ct(),w=Le(_);{var A=L=>{var B=qf(),U=P(B);H(()=>Q(U,e.pairing)),M(L,B)};$(w,L=>{e.pairing&&L(A)},!0)}M(S,_)};$(x,S=>{e.reason?S(I):S(g,!1)})}var y=j(x,2);{var k=S=>{var _=Gf();kn(_,21,()=>e.tags,Sn,(w,A)=>{var L=Vf(),B=P(L);H(()=>Q(B,m(A))),M(w,L)}),M(S,_)};$(y,S=>{e.tags&&e.tags.length&&S(k)})}H(()=>Q(p,e.title)),M(a,c)},o=a=>{var c=$f(),u=P(c),l=P(u),h=P(l),d=j(l,2);d.__click=function(...g){var y;(y=e.onClose)==null||y.apply(this,g)};var f=j(u,2);{var p=g=>{var y=Xf(),k=P(y);H(()=>Q(k,e.shortDescription)),M(g,y)};$(f,g=>{e.shortDescription&&g(p)})}var v=j(f,2);{var E=g=>{var y=Yf(),k=P(y);H(()=>Q(k,e.reason)),M(g,y)},T=g=>{var y=Ct(),k=Le(y);{var S=_=>{var w=Jf(),A=P(w);H(()=>Q(A,e.pairing)),M(_,w)};$(k,_=>{e.pairing&&_(S)},!0)}M(g,y)};$(v,g=>{e.reason?g(E):g(T,!1)})}var x=j(v,2);{var I=g=>{var y=Zf();kn(y,21,()=>e.tags,Sn,(k,S)=>{var _=Qf(),w=P(_);H(()=>Q(w,m(S))),M(k,_)}),M(g,y)};$(x,g=>{e.tags&&e.tags.length&&g(I)})}H(()=>Q(h,e.title)),M(a,c)};$(i,a=>{n?a(r):a(o,!1)})}M(t,s),Bt()}Cs(["click"]);var tp=q('<img class="wr-WineTile-image svelte-yk3emv"/>'),np=q('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),sp=q('<div class="wr-WineTile-glass svelte-yk3emv"> </div>'),ip=q('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),rp=q('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),op=q('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),ap=q('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),lp=q("<div><!> <!></div>"),cp=q('<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 up={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),
173
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-glass.svelte-yk3emv {font-size:12px;font-weight:500;color:var(--wr-brand-color, #7b2beb);margin-bottom:8px;}.wr-WineTile-actions.svelte-yk3emv {margin:16px auto 0;display:flex;flex-direction:column;align-items:center;gap:8px;}
174
174
 
175
+ /* :global обязателен — класс уезжает внутрь <Action>, а скоуп Svelte
176
+ действует только на разметку этого компонента, иначе правило отбрасывается
177
+ как неиспользуемое. Цвет тот же, что у Buy; подчёркивание выезжает слева. */.wr-WineTile-action--similar {font-size:14px;font-weight:500;color:var(--wr-brand-color, #7b2beb);text-decoration:none;background:transparent;border:none;padding:0;position:relative;}.wr-WineTile-action--similar::after {content:'';position:absolute;left:0;bottom:-2px;width:100%;height:1px;background-color:currentColor;transform:scaleX(0);transform-origin:left;transition:transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1);}.wr-WineTile-action--similar:hover::after,
178
+ .wr-WineTile-action--similar:focus-visible::after {transform:scaleX(1);}
179
+
175
180
  /* 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 {
176
181
  animation: svelte-yk3emv-whPopup 0.25s ease;}.wr-WineTilePopup-reason.svelte-yk3emv {font-size:14px;font-weight:400;color:#333;margin-bottom:8px;}.wr-WineTilePopup-tags.svelte-yk3emv {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;justify-content:center;}.wr-WineTilePopup-tag.svelte-yk3emv {display:inline-block;padding:4px 8px;border-radius:12px;background-color:#f5f0ff;border:1px solid #ddd;font-size:13px;color:#333;text-transform:capitalize;}
177
182
 
@@ -187,7 +192,7 @@ ${JSON.stringify(o,null,2)}
187
192
  }
188
193
 
189
194
  @media screen and (max-width: 768px) {.wr-WineTile.svelte-yk3emv {flex:0 0 auto;scroll-snap-align:center;width:240px;text-align:center;}
190
- }`};function up(t,e){Bt(e,!0),jt(t,cp);let n=he(()=>ve.getAppLanguage());const s=(N,A)=>N[A]||N[A.charAt(0).toUpperCase()+A.slice(1)],i=(N,A)=>A.map(te=>s(N,te)).filter(Boolean).join(" • ");function r(N){var A;return ff(N,((A=ve.getCurrency)==null?void 0:A.call(ve))||"USD",m(n))}function o(N){return e.selectedWineId===N}function a(N){return!!(N.reason||N.shortDescription||N.tags)}function c(N,A){let te=(N==null?void 0:N.tags)||A.tags;return te?(Array.isArray(te)&&(te=te.join(",")),typeof te!="string"?[]:te.split(",").map(se=>se.trim()).filter(Boolean)):[]}let u=ae(!1);Ri(()=>{const N=()=>{C(u,window.innerWidth<=768)};return N(),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}});var l=lp(),h=Le(l);h.__click=N=>e.onTileClick(N,e.wine);var d=P(h),f=P(d);{var p=N=>{var A=ep();H(()=>{Ee(A,"src",e.wine.image),Ee(A,"alt",e.wine.title)}),O(N,A)};$(f,N=>{e.wine.image&&N(p)})}var v=j(f,2);{var I=N=>{var A=tp(),te=P(A);H(se=>Q(te,se),[()=>r(e.wine.total)]),O(N,A)};$(v,N=>{e.wine.total&&N(I)})}var k=j(v,2);{var T=N=>{var A=np(),te=P(A);H((se,le)=>Q(te,`${se??""}${le??""}`),[()=>_e({key:"byTheGlass",lang:m(n)}),()=>e.wine.glassPrice?` — ${r(e.wine.glassPrice)}`:""]),O(N,A)};$(k,N=>{e.wine.byTheGlass&&N(T)})}var E=j(k,2),g=P(E),S=j(d,2);{var y=N=>{var A=sp(),te=P(A);H(se=>Q(te,se),[()=>i(e.wine,["type","country","region","grape"])]),O(N,A)};$(S,N=>{i(e.wine,["type","country","region","grape"])&&N(y)})}var x=j(S,2),b=P(x),_=P(b);{var M=N=>{as(N,{get href(){return e.wine.url},handleClick:()=>e.onBuyLinkClick(e.wine,e.index),className:"wr-WineTile-action wr-WineTile-action--link js-WineTileAction",target:"_blank",variant:"outlined",children:(A,te)=>{var se=En();H(le=>Q(se,le),[()=>_e({key:"wineDetails.buy",lang:m(n)})]),O(A,se)},$$slots:{default:!0}})},L=N=>{as(N,{handleClick:()=>e.onBuyClick(e.wine,e.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(A,te)=>{var se=En();H(le=>Q(se,le),[()=>_e({key:"moreInfo",lang:m(n)})]),O(A,se)},$$slots:{default:!0}})};$(_,N=>{e.wine.url?N(M):N(L,!1)})}var B=j(_,2);{var U=N=>{as(N,{handleClick:()=>e.onSimilarClick(e.wine),variant:"text",className:"wr-WineTile-action wr-WineTile-action--similar js-WineTileAction",children:(A,te)=>{var se=En();H(le=>Q(se,le),[()=>_e({key:"similarWines",lang:m(n)})]),O(A,se)},$$slots:{default:!0}})};$(B,N=>{e.onSimilarClick&&N(U)})}var W=j(x,2);{var F=N=>{{let A=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.shortDescription)||e.wine.shortDescription}),te=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.reason)||e.wine.reason}),se=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.pairingRecommendation)||e.wine.pairingRecommendation}),le=he(()=>c(e.translatedPopup,e.wine));ol(N,{get title(){return e.wine.title},get shortDescription(){return m(A)},get reason(){return m(te)},get pairing(){return m(se)},get tags(){return m(le)},get onClose(){return e.onPopupClose},isMobile:!1})}};$(W,N=>{o(e.wine.id)&&!m(u)&&N(F)})}var K=j(W,2);{var Z=N=>{var A=ap(),te=P(A);{var se=Re=>{var De=ip(),Me=P(De);H(()=>{var At,ot;return Q(Me,((At=e.translatedPopup)==null?void 0:At.reason)||((ot=e.translatedPopup)==null?void 0:ot.shortDescription)||e.wine.reason||e.wine.shortDescription)}),O(Re,De)};$(te,Re=>{var De,Me;((De=e.translatedPopup)!=null&&De.reason||(Me=e.translatedPopup)!=null&&Me.shortDescription||e.wine.reason||e.wine.shortDescription)&&Re(se)})}var le=j(te,2);{var V=Re=>{var De=op();kn(De,21,()=>c(e.translatedPopup,e.wine),Sn,(Me,At)=>{var ot=rp(),R=P(ot);H(()=>Q(R,m(At))),O(Me,ot)}),O(Re,De)};$(le,Re=>{var De,Me;((De=e.translatedPopup)!=null&&De.tags||(Me=e.translatedPopup)!=null&&Me.Tags||e.wine.tags)&&Re(V)})}H(()=>Ut(A,1,`wr-WineTilePopup ${e.hoveredWineId===e.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),O(N,A)};$(K,N=>{a(e.wine)&&N(Z)})}var D=j(h,2);{var ee=N=>{{let A=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.shortDescription)||e.wine.shortDescription}),te=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.reason)||e.wine.reason}),se=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.pairingRecommendation)||e.wine.pairingRecommendation}),le=he(()=>c(e.translatedPopup,e.wine));ol(N,{get title(){return e.wine.title},get shortDescription(){return m(A)},get reason(){return m(te)},get pairing(){return m(se)},get tags(){return m(le)},get onClose(){return e.onPopupClose},isMobile:!0})}};$(D,N=>{o(e.wine.id)&&m(u)&&N(ee)})}H(()=>{Ut(h,1,`wr-WineTile ${e.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),Q(g,`${(e.wine.producer?e.wine.producer:"")??""} ${e.wine.title??""}`)}),Ct("mouseenter",h,()=>e.onTileEnter(e.wine)),Ct("mouseleave",h,()=>e.onTileLeave(e.wine)),O(t,l),Ft()}Is(["click"]);function hp(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 dp=q('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),fp=q('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),pp=q('<div class="wr-App-showMore svelte-1n46o8q"><!></div>'),gp=q('<div class="wr-App-placeholder svelte-1n46o8q"></div> <!>',1),mp=q('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>');const vp={hash:"svelte-1n46o8q",code:`
195
+ }`};function hp(t,e){Lt(e,!0),zt(t,up);let n=he(()=>ve.getAppLanguage());const s=(N,O)=>N[O]||N[O.charAt(0).toUpperCase()+O.slice(1)],i=(N,O)=>O.map(te=>s(N,te)).filter(Boolean).join(" • ");function r(N){var O;return pf(N,((O=ve.getCurrency)==null?void 0:O.call(ve))||"USD",m(n))}function o(N){return e.selectedWineId===N}function a(N){return!!(N.reason||N.shortDescription||N.tags)}function c(N,O){let te=(N==null?void 0:N.tags)||O.tags;return te?(Array.isArray(te)&&(te=te.join(",")),typeof te!="string"?[]:te.split(",").map(se=>se.trim()).filter(Boolean)):[]}let u=ae(!1);Di(()=>{const N=()=>{C(u,window.innerWidth<=768)};return N(),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}});var l=cp(),h=Le(l);h.__click=N=>e.onTileClick(N,e.wine);var d=P(h),f=P(d);{var p=N=>{var O=tp();H(()=>{Ee(O,"src",e.wine.image),Ee(O,"alt",e.wine.title)}),M(N,O)};$(f,N=>{e.wine.image&&N(p)})}var v=j(f,2);{var E=N=>{var O=np(),te=P(O);H(se=>Q(te,se),[()=>r(e.wine.total)]),M(N,O)};$(v,N=>{e.wine.total&&N(E)})}var T=j(v,2);{var x=N=>{var O=sp(),te=P(O);H((se,le)=>Q(te,`${se??""}${le??""}`),[()=>_e({key:"byTheGlass",lang:m(n)}),()=>e.wine.glassPrice?` — ${r(e.wine.glassPrice)}`:""]),M(N,O)};$(T,N=>{e.wine.byTheGlass&&N(x)})}var I=j(T,2),g=P(I),y=j(d,2);{var k=N=>{var O=ip(),te=P(O);H(se=>Q(te,se),[()=>i(e.wine,["type","country","region","grape"])]),M(N,O)};$(y,N=>{i(e.wine,["type","country","region","grape"])&&N(k)})}var S=j(y,2),_=P(S),w=P(_);{var A=N=>{as(N,{get href(){return e.wine.url},handleClick:()=>e.onBuyLinkClick(e.wine,e.index),className:"wr-WineTile-action wr-WineTile-action--link js-WineTileAction",target:"_blank",variant:"outlined",children:(O,te)=>{var se=En();H(le=>Q(se,le),[()=>_e({key:"wineDetails.buy",lang:m(n)})]),M(O,se)},$$slots:{default:!0}})},L=N=>{as(N,{handleClick:()=>e.onBuyClick(e.wine,e.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(O,te)=>{var se=En();H(le=>Q(se,le),[()=>_e({key:"moreInfo",lang:m(n)})]),M(O,se)},$$slots:{default:!0}})};$(w,N=>{e.wine.url?N(A):N(L,!1)})}var B=j(w,2);{var U=N=>{as(N,{handleClick:()=>e.onSimilarClick(e.wine),variant:"text",className:"wr-WineTile-action wr-WineTile-action--similar js-WineTileAction",children:(O,te)=>{var se=En();H(le=>Q(se,le),[()=>_e({key:"similarWines",lang:m(n)})]),M(O,se)},$$slots:{default:!0}})};$(B,N=>{e.onSimilarClick&&N(U)})}var F=j(S,2);{var W=N=>{{let O=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.shortDescription)||e.wine.shortDescription}),te=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.reason)||e.wine.reason}),se=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.pairingRecommendation)||e.wine.pairingRecommendation}),le=he(()=>c(e.translatedPopup,e.wine));al(N,{get title(){return e.wine.title},get shortDescription(){return m(O)},get reason(){return m(te)},get pairing(){return m(se)},get tags(){return m(le)},get onClose(){return e.onPopupClose},isMobile:!1})}};$(F,N=>{o(e.wine.id)&&!m(u)&&N(W)})}var K=j(F,2);{var Z=N=>{var O=lp(),te=P(O);{var se=Ie=>{var De=rp(),Oe=P(De);H(()=>{var Mt,at;return Q(Oe,((Mt=e.translatedPopup)==null?void 0:Mt.reason)||((at=e.translatedPopup)==null?void 0:at.shortDescription)||e.wine.reason||e.wine.shortDescription)}),M(Ie,De)};$(te,Ie=>{var De,Oe;((De=e.translatedPopup)!=null&&De.reason||(Oe=e.translatedPopup)!=null&&Oe.shortDescription||e.wine.reason||e.wine.shortDescription)&&Ie(se)})}var le=j(te,2);{var V=Ie=>{var De=ap();kn(De,21,()=>c(e.translatedPopup,e.wine),Sn,(Oe,Mt)=>{var at=op(),pn=P(at);H(()=>Q(pn,m(Mt))),M(Oe,at)}),M(Ie,De)};$(le,Ie=>{var De,Oe;((De=e.translatedPopup)!=null&&De.tags||(Oe=e.translatedPopup)!=null&&Oe.Tags||e.wine.tags)&&Ie(V)})}H(()=>jt(O,1,`wr-WineTilePopup ${e.hoveredWineId===e.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),M(N,O)};$(K,N=>{a(e.wine)&&N(Z)})}var D=j(h,2);{var ee=N=>{{let O=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.shortDescription)||e.wine.shortDescription}),te=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.reason)||e.wine.reason}),se=he(()=>{var V;return((V=e.translatedPopup)==null?void 0:V.pairingRecommendation)||e.wine.pairingRecommendation}),le=he(()=>c(e.translatedPopup,e.wine));al(N,{get title(){return e.wine.title},get shortDescription(){return m(O)},get reason(){return m(te)},get pairing(){return m(se)},get tags(){return m(le)},get onClose(){return e.onPopupClose},isMobile:!0})}};$(D,N=>{o(e.wine.id)&&m(u)&&N(ee)})}H(()=>{jt(h,1,`wr-WineTile ${e.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),Q(g,`${(e.wine.producer?e.wine.producer:"")??""} ${e.wine.title??""}`)}),It("mouseenter",h,()=>e.onTileEnter(e.wine)),It("mouseleave",h,()=>e.onTileLeave(e.wine)),M(t,l),Bt()}Cs(["click"]);function dp(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 fp=q('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),pp=q('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),gp=q('<div class="wr-App-showMore svelte-1n46o8q"><!></div>'),mp=q('<div class="wr-App-placeholder svelte-1n46o8q"></div> <!>',1),vp=q('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>');const bp={hash:"svelte-1n46o8q",code:`
191
196
  /* ===================== 1) CSS Variables ===================== */:root {--wineater-corp-color: #0044ff;
192
197
  /* --wr-brand-color is set dynamically from uiConfig.brandColor */--wr-brand-color: #7b2beb; /* fallback value */}
193
198
 
@@ -199,4 +204,4 @@ ${JSON.stringify(o,null,2)}
199
204
 
200
205
  /* ===================== 13) Mobile Styles ===================== */
201
206
  @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);}
202
- }`};function wp(t,e){var Me,At,ot;Bt(e,!0),jt(t,vp);function n(){var R;Oi("chatbotToken",((R=window.wineaterData)==null?void 0:R.CLIENT_TOKEN)||s,365),Oo()}const s="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";new nf({projectKey:"PA8j9fAi49i6g2QnvpNs",__DISABLE_SECURE_MODE:!0}).start(),n();const r=((Me=window==null?void 0:window.wineaterData)==null?void 0:Me.WIDGET_TYPE)||"store",o=((At=window==null?void 0:window.wineaterData)==null?void 0:At.COUNTRY_CODE)||null;(ot=window==null?void 0:window.wineaterData)!=null&&ot.WIDGET_WRAPPER;let a=ae(!1),c=ae(!1),u=ae(!1),l=ae(ct([])),h=ae(null),d=ae(""),f=ae(null),p=ae(!1),v=ae(null),I=ae(ct([])),k=ae(""),T=ae(!1),E=he(()=>ve.getAppLanguage()),g=he(()=>ve.getStoreLanguage()),S=he(()=>ve.getApiKey()),y=he(()=>ve.getStoreId()),x=he(()=>ve.isInitialized()),b=he(()=>ve.getUiConfig());function _(){C(f,_e({key:"errorMessage",lang:m(E)}),!0)}const M=()=>C(f,null);async function L(R){if(m(E)===m(g)||r!=="bar")return R.map(()=>({}));const G=["shortDescription","reason","pairingRecommendation","tags"],ue=R[0];if(!ue)return R.map(()=>({}));const at=G.filter(Pt=>Pt in ue),hs=4,ds=[];for(let Pt=0;Pt<R.length;Pt+=hs){const ri=R.slice(Pt,Pt+hs).map(async oi=>{const ai=at.map(de=>{const Ke=oi[de]||oi[de.toLowerCase()];return Ke?{key:de,text:Array.isArray(Ke)?Ke.join(", "):Ke}:null}).filter(Boolean);return ai.length===0?{}:await pf({sourceLang:m(g),targetLang:m(E),texts:Object.fromEntries(ai.map(de=>[de.key,de.text])),apiKey:m(S)})}),Tr=await Promise.all(ri);ds.push(...Tr)}return ds}async function B(){C(c,!0);try{C(l,await os.getInstantRecommendations(),!0)}catch(R){console.error("[wineater] instant recommendations error:",R),_()}finally{C(c,!1)}}function U(R=220){return!m(l)||m(l).length===0?Promise.resolve():(C(p,!0),new Promise(G=>{setTimeout(()=>{G()},R)}))}async function W(R){R.preventDefault();let G="";try{C(c,!0),M(),await U(220),C(l,[],!0),C(p,!1),C(T,!1),G=m(d).trim()+";",C(k,G,!0);try{qe(Ve.SEARCH_PERFORMED,m(y),{query:G})}catch(at){console.error("Error tracking search event:",at)}const ue=await os.getWineRecommendationsSearch(G);!ue||ue.length===0?(C(l,[],!0),C(I,[],!0),C(f,_e({key:"noResultsMessage",lang:m(E)}),!0),qe(Ve.NO_RESULTS_FOUND,m(y),{query:G})):(C(l,ue,!0),C(T,nl==="2"&&ue.length>=4,!0),qe(Ve.SEARCH_RESULTS_DISPLAYED,m(y),{results_count:ue.length,results:ue,query:G}))}catch(ue){C(l,[],!0),console.error("[wineater] search error:",ue),qe(Ve.ERROR_OCCURRED,m(y),{error_message:ue==null?void 0:ue.message,query:G}),_()}finally{C(c,!1)}}async function F(){if(!(m(u)||!m(T)))try{C(u,!0);const R=m(l).map(at=>at.id),{recommendations:G,hasMore:ue}=await os.getMoreWineRecommendations(m(k),R);qe(Ve.SHOW_MORE_CLICKED,m(y),{query:m(k),results_count:G.length}),C(l,[...m(l),...G],!0),C(T,ue,!0)}catch(R){console.error("[wineater] show more error:",R),C(T,!1)}finally{C(u,!1)}}async function K(R){try{C(c,!0),M(),qe(Ve.SIMILAR_WINES_CLICKED,m(y),{wine_id:R.id,wine_title:R.title}),await U(220),C(l,[],!0),C(p,!1),C(T,!1),C(h,null);const G=await os.getSimilarWines(R.id);C(d,R.title,!0),C(k,""),!G||G.length===0?(C(l,[],!0),C(I,[],!0),C(f,_e({key:"noResultsMessage",lang:m(E)}),!0)):C(l,G,!0)}catch(G){C(l,[],!0),console.error("[wineater] similar wines error:",G),_()}finally{C(c,!1)}}Yn(async()=>{if(!m(l)||m(l).length===0){C(I,[],!0);return}try{const R=await L(m(l));m(l)&&m(l).length>0&&C(I,R,!0)}catch(R){console.error("translatePopupContent failed",R)}});function Z(R,G){m(h)&&m(h)!==R.id&&C(h,null),C(h,R.id,!0),qe(Ve.WINE_DETAILS_VIEWED,m(y),{wine_id:R.id,wine_title:R.title,is_mobile:window.innerWidth<=768})}function D(R,G){qe(Ve.BUY_BUTTON_CLICKED,m(y),{wine_id:R.id,wine_title:R.title,wine_url:R.url,is_mobile:window.innerWidth<=768})}function ee(){const R=m(l).find(G=>G.id===m(h));qe(Ve.WINE_DETAILS_CLOSED,m(y),{wine_id:m(h),wine_title:R.title}),C(h,null)}function N(R){return!!(R.reason||R.shortDescription||R.tags)}function A(R){r==="store"&&N(R)&&(C(v,R.id,!0),qe(Ve.WINE_CARD_HOVER,m(y),{wine_id:R.id,wine_title:R.title}))}function te(R){r==="store"&&m(v)===R.id&&C(v,null)}function se(R,G){R.target.closest(".js-WineTileAction")||R.target.closest(".js-WinePopupClose")||qe(Ve.WINE_CARD_CLICK,m(y),{wine_id:G.id,wine_title:G.title})}function le(R){const G=R.target;G.closest(".js-WinePopup")||G.closest(".js-WineTileAction")||C(h,null)}Yn(()=>{var R,G;(R=m(b))!=null&&R.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",m(b).brandColor),(G=m(b))!=null&&G.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",m(b).wineaterColor)}),Ri(async()=>{if(await ve.initializeStore(),!!m(x))return C(b,ve.getUiConfig()),m(b).customCss&&hp(m(b).customCss),await B(),qe(Ve.WIDGET_INITIALIZED,m(y)),C(a,!0),document.addEventListener("click",le),()=>{document.removeEventListener("click",le)}});var V=Nt(),Re=Le(V);{var De=R=>{var G=mp(),ue=P(G);{var at=de=>{var Ke=dp(),fs=P(Ke);H(()=>Ee(fs,"src",m(b).logoUrl)),O(de,Ke)};$(ue,de=>{m(b).logoUrl&&de(at)})}var hs=j(ue,2);Ef(hs,{});var ds=j(hs,2);Bf(ds,{onSubmit:W,get initialized(){return m(a)},get searchQuery(){return m(d)},set searchQuery(de){C(d,de,!0)}});var Pt=j(ds,2);{var ul=de=>{zf(de)};$(Pt,de=>{m(c)&&de(ul)})}var ri=j(Pt,2),Tr=P(ri);{var oi=de=>{var Ke=fp(),fs=P(Ke),xr=P(fs);H(()=>Q(xr,m(f))),O(de,Ke)},ai=de=>{var Ke=Nt(),fs=Le(Ke);{var xr=Er=>{var dl=gp(),fl=Le(dl);kn(fl,21,()=>m(l),Sn,(ps,li,ci)=>{up(ps,{get wine(){return m(li)},index:ci,get hoveredWineId(){return m(v)},get selectedWineId(){return m(h)},get isAnimating(){return m(p)},get translatedPopup(){return m(I)[ci]},onBuyClick:Z,onBuyLinkClick:D,onPopupClose:ee,onSimilarClick:K,onTileEnter:A,onTileLeave:te,onTileClick:se})});var bp=j(fl,2);{var yp=ps=>{var li=pp(),ci=P(li);as(ci,{handleClick:F,variant:"outlined",children:(_p,Fp)=>{var pl=En();H(Sp=>Q(pl,Sp),[()=>_e({key:"showMore",lang:m(E)})]),O(_p,pl)},$$slots:{default:!0}}),O(ps,li)};$(bp,ps=>{m(T)&&ps(yp)})}O(Er,dl)};$(fs,Er=>{m(l)&&m(l).length>0&&Er(xr)},!0)}O(de,Ke)};$(Tr,de=>{m(f)?de(oi):de(ai,!1)})}var hl=j(ri,2);Df(hl,{get countryCode(){return o}}),O(R,G)};$(Re,R=>{m(x)&&R(De)})}O(t,V),Ft()}return Mc(wp,{target:document.getElementById("wineater-widget-conteiner")})});
207
+ }`};function wp(t,e){var Mt,at,pn;Lt(e,!0),zt(t,bp);function n(){var R;Oi("chatbotToken",((R=window.wineaterData)==null?void 0:R.CLIENT_TOKEN)||s,365),Oo()}const s="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";new sf({projectKey:"PA8j9fAi49i6g2QnvpNs",__DISABLE_SECURE_MODE:!0}).start(),n();const r=((Mt=window==null?void 0:window.wineaterData)==null?void 0:Mt.WIDGET_TYPE)||"store",o=((at=window==null?void 0:window.wineaterData)==null?void 0:at.COUNTRY_CODE)||null;(pn=window==null?void 0:window.wineaterData)!=null&&pn.WIDGET_WRAPPER;let a=ae(!1),c=ae(!1),u=ae(!1),l=ae(it([])),h=ae(null),d=ae(""),f=ae(null),p=ae(!1),v=ae(null),E=ae(it([])),T=ae(""),x=ae(!1),I=ae(it([])),g=he(()=>ve.getAppLanguage()),y=he(()=>ve.getStoreLanguage()),k=he(()=>ve.getApiKey()),S=he(()=>ve.getStoreId()),_=he(()=>ve.isInitialized()),w=he(()=>ve.getUiConfig());function A(){C(f,_e({key:"errorMessage",lang:m(g)}),!0)}const L=()=>C(f,null);async function B(R){if(m(g)===m(y)||r!=="bar")return R.map(()=>({}));const G=["shortDescription","reason","pairingRecommendation","tags"],ue=R[0];if(!ue)return R.map(()=>({}));const hs=G.filter(Ot=>Ot in ue),ds=4,fs=[];for(let Ot=0;Ot<R.length;Ot+=ds){const oi=R.slice(Ot,Ot+ds).map(async ai=>{const li=hs.map(de=>{const Ke=ai[de]||ai[de.toLowerCase()];return Ke?{key:de,text:Array.isArray(Ke)?Ke.join(", "):Ke}:null}).filter(Boolean);return li.length===0?{}:await gf({sourceLang:m(y),targetLang:m(g),texts:Object.fromEntries(li.map(de=>[de.key,de.text])),apiKey:m(k)})}),xr=await Promise.all(oi);fs.push(...xr)}return fs}async function U(){C(c,!0);try{C(l,await os.getInstantRecommendations(),!0)}catch(R){console.error("[wineater] instant recommendations error:",R),A()}finally{C(c,!1)}}function F(R=220){return!m(l)||m(l).length===0?Promise.resolve():(C(p,!0),new Promise(G=>{setTimeout(()=>{G()},R)}))}async function W(R){R.preventDefault();let G="";try{C(c,!0),L(),await F(220),C(l,[],!0),C(p,!1),C(x,!1),C(I,[],!0),G=m(d).trim()+";",C(T,G,!0);try{qe(Ve.SEARCH_PERFORMED,m(S),{query:G})}catch(hs){console.error("Error tracking search event:",hs)}const ue=await os.getWineRecommendationsSearch(G);!ue||ue.length===0?(C(l,[],!0),C(E,[],!0),C(f,_e({key:"noResultsMessage",lang:m(g)}),!0),qe(Ve.NO_RESULTS_FOUND,m(S),{query:G})):(C(l,ue,!0),C(x,sl==="2"&&ue.length>=4,!0),qe(Ve.SEARCH_RESULTS_DISPLAYED,m(S),{results_count:ue.length,results:ue,query:G}))}catch(ue){C(l,[],!0),console.error("[wineater] search error:",ue),qe(Ve.ERROR_OCCURRED,m(S),{error_message:ue==null?void 0:ue.message,query:G}),A()}finally{C(c,!1)}}async function K(){if(!(m(u)||!m(x)))try{C(u,!0),C(I,[...new Set([...m(I),...m(l).map(ue=>ue.id)])],!0);const{recommendations:R,hasMore:G}=await os.getMoreWineRecommendations(m(T),m(I));qe(Ve.SHOW_MORE_CLICKED,m(S),{query:m(T),results_count:R.length}),R.length>0&&C(l,R,!0),C(x,G,!0)}catch(R){console.error("[wineater] show more error:",R),C(x,!1)}finally{C(u,!1)}}async function Z(R){try{C(c,!0),L(),qe(Ve.SIMILAR_WINES_CLICKED,m(S),{wine_id:R.id,wine_title:R.title}),await F(220),C(l,[],!0),C(p,!1),C(x,!1),C(h,null);const G=await os.getSimilarWines(R.id);C(d,R.title,!0),C(T,""),!G||G.length===0?(C(l,[],!0),C(E,[],!0),C(f,_e({key:"noResultsMessage",lang:m(g)}),!0)):C(l,G,!0)}catch(G){C(l,[],!0),console.error("[wineater] similar wines error:",G),A()}finally{C(c,!1)}}Yn(async()=>{if(!m(l)||m(l).length===0){C(E,[],!0);return}try{const R=await B(m(l));m(l)&&m(l).length>0&&C(E,R,!0)}catch(R){console.error("translatePopupContent failed",R)}});function D(R,G){m(h)&&m(h)!==R.id&&C(h,null),C(h,R.id,!0),qe(Ve.WINE_DETAILS_VIEWED,m(S),{wine_id:R.id,wine_title:R.title,is_mobile:window.innerWidth<=768})}function ee(R,G){qe(Ve.BUY_BUTTON_CLICKED,m(S),{wine_id:R.id,wine_title:R.title,wine_url:R.url,is_mobile:window.innerWidth<=768})}function N(){const R=m(l).find(G=>G.id===m(h));qe(Ve.WINE_DETAILS_CLOSED,m(S),{wine_id:m(h),wine_title:R.title}),C(h,null)}function O(R){return!!(R.reason||R.shortDescription||R.tags)}function te(R){r==="store"&&O(R)&&(C(v,R.id,!0),qe(Ve.WINE_CARD_HOVER,m(S),{wine_id:R.id,wine_title:R.title}))}function se(R){r==="store"&&m(v)===R.id&&C(v,null)}function le(R,G){R.target.closest(".js-WineTileAction")||R.target.closest(".js-WinePopupClose")||qe(Ve.WINE_CARD_CLICK,m(S),{wine_id:G.id,wine_title:G.title})}function V(R){const G=R.target;G.closest(".js-WinePopup")||G.closest(".js-WineTileAction")||C(h,null)}Yn(()=>{var R,G;(R=m(w))!=null&&R.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",m(w).brandColor),(G=m(w))!=null&&G.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",m(w).wineaterColor)}),Di(async()=>{if(await ve.initializeStore(),!!m(_))return C(w,ve.getUiConfig()),m(w).customCss&&dp(m(w).customCss),await U(),qe(Ve.WIDGET_INITIALIZED,m(S)),C(a,!0),document.addEventListener("click",V),()=>{document.removeEventListener("click",V)}});var Ie=Ct(),De=Le(Ie);{var Oe=R=>{var G=vp(),ue=P(G);{var hs=de=>{var Ke=fp(),ps=P(Ke);H(()=>Ee(ps,"src",m(w).logoUrl)),M(de,Ke)};$(ue,de=>{m(w).logoUrl&&de(hs)})}var ds=j(ue,2);If(ds,{});var fs=j(ds,2);Ff(fs,{onSubmit:W,get initialized(){return m(a)},get searchQuery(){return m(d)},set searchQuery(de){C(d,de,!0)}});var Ot=j(fs,2);{var hl=de=>{jf(de)};$(Ot,de=>{m(c)&&de(hl)})}var oi=j(Ot,2),xr=P(oi);{var ai=de=>{var Ke=pp(),ps=P(Ke),Er=P(ps);H(()=>Q(Er,m(f))),M(de,Ke)},li=de=>{var Ke=Ct(),ps=Le(Ke);{var Er=Ir=>{var fl=mp(),pl=Le(fl);kn(pl,21,()=>m(l),Sn,(gs,ci,ui)=>{hp(gs,{get wine(){return m(ci)},index:ui,get hoveredWineId(){return m(v)},get selectedWineId(){return m(h)},get isAnimating(){return m(p)},get translatedPopup(){return m(E)[ui]},onBuyClick:D,onBuyLinkClick:ee,onPopupClose:N,onSimilarClick:Z,onTileEnter:te,onTileLeave:se,onTileClick:le})});var yp=j(pl,2);{var _p=gs=>{var ci=gp(),ui=P(ci);as(ui,{handleClick:K,variant:"outlined",children:(Sp,Wp)=>{var gl=En();H(kp=>Q(gl,kp),[()=>_e({key:"tryAgain",lang:m(g)})]),M(Sp,gl)},$$slots:{default:!0}}),M(gs,ci)};$(yp,gs=>{m(x)&&gs(_p)})}M(Ir,fl)};$(ps,Ir=>{m(l)&&m(l).length>0&&Ir(Er)},!0)}M(de,Ke)};$(xr,de=>{m(f)?de(ai):de(li,!1)})}var dl=j(oi,2);Af(dl,{get countryCode(){return o}}),M(R,G)};$(De,R=>{m(_)&&R(Oe)})}M(t,Ie),Bt()}return Mc(wp,{target:document.getElementById("wineater-widget-conteiner")})});