wineater-bot 4.16.1 → 4.19.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,4 @@
1
- (function(se,ie){typeof exports=="object"&&typeof module<"u"?module.exports=ie():typeof define=="function"&&define.amd?define(ie):(se=typeof globalThis<"u"?globalThis:se||self,se.WineaterChatbot=ie())})(this,function(){"use strict";var zp=Object.defineProperty;var Nl=se=>{throw TypeError(se)};var jp=(se,ie,ye)=>ie in se?zp(se,ie,{enumerable:!0,configurable:!0,writable:!0,value:ye}):se[ie]=ye;var St=(se,ie,ye)=>jp(se,typeof ie!="symbol"?ie+"":ie,ye),Pr=(se,ie,ye)=>ie.has(se)||Nl("Cannot "+ye);var w=(se,ie,ye)=>(Pr(se,ie,"read from private field"),ye?ye.call(se):ie.get(se)),G=(se,ie,ye)=>ie.has(se)?Nl("Cannot add the same private member more than once"):ie instanceof WeakSet?ie.add(se):ie.set(se,ye),j=(se,ie,ye,_s)=>(Pr(se,ie,"write to private field"),_s?_s.call(se,ye):ie.set(se,ye),ye),xe=(se,ie,ye)=>(Pr(se,ie,"access private method"),ye);var _l,Un,Hn,vn,qn,ms,Vn,Qt,mt,Gn,He,Lr,Br,Fr,Rl,tt,Ar,vt,wn,Be,wt,qe,ct,Rt,bn,Zt,Kn,Xn,Yn,Dt,li,Se,Up,Hp,qp,Wr,gi,mi,zr,kl,ut,bt,Ve,yn,vs,ws,ci,$t,At,Jn,Tl,xl;const se="5";typeof window<"u"&&((_l=window.__svelte??(window.__svelte={})).v??(_l.v=new Set)).add(se);const ie=1,ye=2,_s=16,Dl=1,Al=2,Ml=4,Ol=8,Pl=16,Ll=1,Bl=2,Ee=Symbol(),jr="http://www.w3.org/1999/xhtml",vi=!1;var wi=Array.isArray,Fl=Array.prototype.indexOf,Sn=Array.prototype.includes,ks=Array.from,Wl=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,zl=Object.getOwnPropertyDescriptors,jl=Object.prototype,Ul=Array.prototype,Ur=Object.getPrototypeOf,Hr=Object.isExtensible;const Hl=()=>{};function ql(t){for(var e=0;e<t.length;e++)t[e]()}function qr(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const Ie=2,Zn=4,Ts=8,Vr=1<<24,_t=16,nt=32,en=64,bi=128,Xe=512,Te=1024,Ce=2048,st=4096,Fe=8192,kt=16384,tn=32768,nn=65536,Gr=1<<17,Kr=1<<18,kn=1<<19,Vl=1<<20,Lt=1<<25,sn=65536,yi=1<<21,Si=1<<22,Bt=1<<23,rn=Symbol("$state"),Gl=Symbol("legacy props"),Kl=Symbol(""),on=new class extends Error{constructor(){super(...arguments);St(this,"name","StaleReactionError");St(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Xl(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Yl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Jl(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Ql(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Zl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function $l(t){throw new Error("https://svelte.dev/e/effect_orphan")}function ec(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function tc(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function nc(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function sc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ic(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function rc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function oc(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ac(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Xr(t){return t===this.v}function lc(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Yr(t){return!lc(t,this.v)}let Tn=!1,cc=!1;function uc(){Tn=!0}let ve=null;function xn(t){ve=t}function Ft(t,e=!1,n){ve={p:ve,i:!1,c:null,e:null,s:t,x:null,l:Tn&&!e?{s:null,u:null,$:[]}:null}}function Wt(t){var e=ve,n=e.e;if(n!==null){e.e=null;for(var s of n)bo(s)}return t!==void 0&&(e.x=t),e.i=!0,ve=e.p,t??{}}function $n(){return!Tn||ve!==null&&ve.l===null}let an=[];function Jr(){var t=an;an=[],ql(t)}function zt(t){if(an.length===0&&!es){var e=an;queueMicrotask(()=>{e===an&&Jr()})}an.push(t)}function hc(){for(;an.length>0;)Jr()}function Qr(t){var e=$;if(e===null)return K.f|=Bt,t;if(!(e.f&tn)&&!(e.f&Zn))throw t;jt(t,e)}function jt(t,e){for(;e!==null;){if(e.f&bi){if(!(e.f&tn))throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const dc=-7169;function fe(t,e){t.f=t.f&dc|e}function _i(t){t.f&Xe||t.deps===null?fe(t,Te):fe(t,st)}function Zr(t){if(t!==null)for(const e of t)!(e.f&Ie)||!(e.f&sn)||(e.f^=sn,Zr(e.deps))}function $r(t,e,n){t.f&Ce?e.add(t):t.f&st&&n.add(t),Zr(t.deps),fe(t,Te)}const xs=new Set;let U=null,ki=null,Ne=null,Me=[],Es=null,Ti=!1,es=!1;const Dr=class Dr{constructor(){G(this,He);St(this,"current",new Map);St(this,"previous",new Map);G(this,Un,new Set);G(this,Hn,new Set);G(this,vn,0);G(this,qn,0);G(this,ms,null);G(this,Vn,new Set);G(this,Qt,new Set);G(this,mt,new Map);St(this,"is_fork",!1);G(this,Gn,!1)}skip_effect(e){w(this,mt).has(e)||w(this,mt).set(e,{d:[],m:[]})}unskip_effect(e){var n=w(this,mt).get(e);if(n){w(this,mt).delete(e);for(var s of n.d)fe(s,Ce),rt(s);for(s of n.m)fe(s,st),rt(s)}}process(e){var i;Me=[],this.apply();var n=[],s=[];for(const r of e)xe(this,He,Br).call(this,r,n,s);if(xe(this,He,Lr).call(this)){xe(this,He,Fr).call(this,s),xe(this,He,Fr).call(this,n);for(const[r,o]of w(this,mt))io(r,o)}else{for(const r of w(this,Un))r();w(this,Un).clear(),w(this,vn)===0&&xe(this,He,Rl).call(this),ki=this,U=null,to(s),to(n),w(this,Vn).clear(),w(this,Qt).clear(),ki=null,(i=w(this,ms))==null||i.resolve()}Ne=null}capture(e,n){n!==Ee&&!this.previous.has(e)&&this.previous.set(e,n),e.f&Bt||(this.current.set(e,e.v),Ne==null||Ne.set(e,e.v))}activate(){U=this,this.apply()}deactivate(){U===this&&(U=null,Ne=null)}flush(){if(this.activate(),Me.length>0){if(eo(),U!==null&&U!==this)return}else w(this,vn)===0&&this.process([]);this.deactivate()}discard(){for(const e of w(this,Hn))e(this);w(this,Hn).clear()}increment(e){j(this,vn,w(this,vn)+1),e&&j(this,qn,w(this,qn)+1)}decrement(e){j(this,vn,w(this,vn)-1),e&&j(this,qn,w(this,qn)-1),!w(this,Gn)&&(j(this,Gn,!0),zt(()=>{j(this,Gn,!1),xe(this,He,Lr).call(this)?Me.length>0&&this.flush():this.revive()}))}revive(){for(const e of w(this,Vn))w(this,Qt).delete(e),fe(e,Ce),rt(e);for(const e of w(this,Qt))fe(e,st),rt(e);this.flush()}oncommit(e){w(this,Un).add(e)}ondiscard(e){w(this,Hn).add(e)}settled(){return(w(this,ms)??j(this,ms,qr())).promise}static ensure(){if(U===null){const e=U=new Dr;xs.add(U),es||zt(()=>{U===e&&e.flush()})}return U}apply(){}};Un=new WeakMap,Hn=new WeakMap,vn=new WeakMap,qn=new WeakMap,ms=new WeakMap,Vn=new WeakMap,Qt=new WeakMap,mt=new WeakMap,Gn=new WeakMap,He=new WeakSet,Lr=function(){return this.is_fork||w(this,qn)>0},Br=function(e,n,s){e.f^=Te;for(var i=e.first;i!==null;){var r=i.f,o=(r&(nt|en))!==0,a=o&&(r&Te)!==0,c=a||(r&Fe)!==0||w(this,mt).has(i);if(!c&&i.fn!==null){o?i.f^=Te:r&Zn?n.push(i):is(i)&&(r&_t&&w(this,Qt).add(i),Cn(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var l=i.next;if(l!==null){i=l;break}i=i.parent}}},Fr=function(e){for(var n=0;n<e.length;n+=1)$r(e[n],w(this,Vn),w(this,Qt))},Rl=function(){var i;if(xs.size>1){this.previous.clear();var e=Ne,n=!0;for(const r of xs){if(r===this){n=!1;continue}const o=[];for(const[c,u]of this.current){if(r.current.has(c))if(n&&u!==r.current.get(c))r.current.set(c,u);else continue;o.push(c)}if(o.length===0)continue;const a=[...r.current.keys()].filter(c=>!this.current.has(c));if(a.length>0){var s=Me;Me=[];const c=new Set,u=new Map;for(const l of o)no(l,a,c,u);if(Me.length>0){U=r,r.apply();for(const l of Me)xe(i=r,He,Br).call(i,l,[],[]);r.deactivate()}Me=s}}U=null,Ne=e}w(this,mt).clear(),xs.delete(this)};let Ut=Dr;function fc(t){var e=es;es=!0;try{for(var n;;){if(hc(),Me.length===0&&(U==null||U.flush(),Me.length===0))return Es=null,n;eo()}}finally{es=e}}function eo(){Ti=!0;var t=null;try{for(var e=0;Me.length>0;){var n=Ut.ensure();if(e++>1e3){var s,i;pc()}n.process(Me),Ht.clear()}}finally{Me=[],Ti=!1,Es=null}}function pc(){try{ec()}catch(t){jt(t,Es)}}let it=null;function to(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(kt|Fe))&&is(s)&&(it=new Set,Cn(s),s.deps===null&&s.first===null&&s.nodes===null&&s.teardown===null&&s.ac===null&&_o(s),(it==null?void 0:it.size)>0)){Ht.clear();for(const i of it){if(i.f&(kt|Fe))continue;const r=[i];let o=i.parent;for(;o!==null;)it.has(o)&&(it.delete(o),r.push(o)),o=o.parent;for(let a=r.length-1;a>=0;a--){const c=r[a];c.f&(kt|Fe)||Cn(c)}}it.clear()}}it=null}}function no(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&Ie?no(i,e,n,s):r&(Si|_t)&&!(r&Ce)&&so(i,e,s)&&(fe(i,Ce),rt(i))}}function so(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(Sn.call(e,i))return!0;if(i.f&Ie&&so(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function rt(t){var e=Es=t,n=e.b;if(n!=null&&n.is_pending&&t.f&(Zn|Ts|Vr)&&!(t.f&tn)){n.defer_effect(t);return}for(;e.parent!==null;){e=e.parent;var s=e.f;if(Ti&&e===$&&s&_t&&!(s&Kr)&&s&tn)return;if(s&(en|nt)){if(!(s&Te))return;e.f^=Te}}Me.push(e)}function io(t,e){if(!(t.f&nt&&t.f&Te)){t.f&Ce?e.d.push(t):t.f&st&&e.m.push(t),fe(t,Te);for(var n=t.first;n!==null;)io(n,e),n=n.next}}function gc(t){let e=0,n=ln(0),s;return()=>{Ni()&&(v(n),Di(()=>(e===0&&(s=os(()=>t(()=>ts(n)))),e+=1,()=>{zt(()=>{e-=1,e===0&&(s==null||s(),s=void 0,ts(n))})})))}}var mc=nn|kn;function vc(t,e,n,s){new wc(t,e,n,s)}class wc{constructor(e,n,s,i){G(this,Se);St(this,"parent");St(this,"is_pending",!1);St(this,"transform_error");G(this,tt);G(this,Ar,null);G(this,vt);G(this,wn);G(this,Be);G(this,wt,null);G(this,qe,null);G(this,ct,null);G(this,Rt,null);G(this,bn,0);G(this,Zt,0);G(this,Kn,!1);G(this,Xn,new Set);G(this,Yn,new Set);G(this,Dt,null);G(this,li,gc(()=>(j(this,Dt,ln(w(this,bn))),()=>{j(this,Dt,null)})));var r;j(this,tt,e),j(this,vt,n),j(this,wn,o=>{var a=$;a.b=this,a.f|=bi,s(o)}),this.parent=$.b,this.transform_error=i??((r=this.parent)==null?void 0:r.transform_error)??(o=>o),j(this,Be,Ns(()=>{xe(this,Se,Wr).call(this)},mc))}defer_effect(e){$r(e,w(this,Xn),w(this,Yn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!w(this,vt).pending}update_pending_count(e){xe(this,Se,zr).call(this,e),j(this,bn,w(this,bn)+e),!(!w(this,Dt)||w(this,Kn))&&(j(this,Kn,!0),zt(()=>{j(this,Kn,!1),w(this,Dt)&&En(w(this,Dt),w(this,bn))}))}get_effect_pending(){return w(this,li).call(this),v(w(this,Dt))}error(e){var n=w(this,vt).onerror;let s=w(this,vt).failed;if(!n&&!s)throw e;w(this,wt)&&(Oe(w(this,wt)),j(this,wt,null)),w(this,qe)&&(Oe(w(this,qe)),j(this,qe,null)),w(this,ct)&&(Oe(w(this,ct)),j(this,ct,null));var i=!1,r=!1;const o=()=>{if(i){ac();return}i=!0,r&&rc(),w(this,ct)!==null&&cn(w(this,ct),()=>{j(this,ct,null)}),xe(this,Se,mi).call(this,()=>{Ut.ensure(),xe(this,Se,Wr).call(this)})},a=c=>{try{r=!0,n==null||n(c,o),r=!1}catch(u){jt(u,w(this,Be)&&w(this,Be).parent)}s&&j(this,ct,xe(this,Se,mi).call(this,()=>{Ut.ensure();try{return Ye(()=>{var u=$;u.b=this,u.f|=bi,s(w(this,tt),()=>c,()=>o)})}catch(u){return jt(u,w(this,Be).parent),null}}))};zt(()=>{var c;try{c=this.transform_error(e)}catch(u){jt(u,w(this,Be)&&w(this,Be).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(a,u=>jt(u,w(this,Be)&&w(this,Be).parent)):a(c)})}}tt=new WeakMap,Ar=new WeakMap,vt=new WeakMap,wn=new WeakMap,Be=new WeakMap,wt=new WeakMap,qe=new WeakMap,ct=new WeakMap,Rt=new WeakMap,bn=new WeakMap,Zt=new WeakMap,Kn=new WeakMap,Xn=new WeakMap,Yn=new WeakMap,Dt=new WeakMap,li=new WeakMap,Se=new WeakSet,Up=function(){try{j(this,wt,Ye(()=>w(this,wn).call(this,w(this,tt))))}catch(e){this.error(e)}},Hp=function(e){const n=w(this,vt).failed;n&&j(this,ct,Ye(()=>{n(w(this,tt),()=>e,()=>()=>{})}))},qp=function(){const e=w(this,vt).pending;e&&(this.is_pending=!0,j(this,qe,Ye(()=>e(w(this,tt)))),zt(()=>{var n=j(this,Rt,document.createDocumentFragment()),s=Tt();n.append(s),j(this,wt,xe(this,Se,mi).call(this,()=>(Ut.ensure(),Ye(()=>w(this,wn).call(this,s))))),w(this,Zt)===0&&(w(this,tt).before(n),j(this,Rt,null),cn(w(this,qe),()=>{j(this,qe,null)}),xe(this,Se,gi).call(this))}))},Wr=function(){try{if(this.is_pending=this.has_pending_snippet(),j(this,Zt,0),j(this,bn,0),j(this,wt,Ye(()=>{w(this,wn).call(this,w(this,tt))})),w(this,Zt)>0){var e=j(this,Rt,document.createDocumentFragment());xo(w(this,wt),e);const n=w(this,vt).pending;j(this,qe,Ye(()=>n(w(this,tt))))}else xe(this,Se,gi).call(this)}catch(n){this.error(n)}},gi=function(){this.is_pending=!1;for(const e of w(this,Xn))fe(e,Ce),rt(e);for(const e of w(this,Yn))fe(e,st),rt(e);w(this,Xn).clear(),w(this,Yn).clear()},mi=function(e){var n=$,s=K,i=ve;ht(w(this,Be)),Je(w(this,Be)),xn(w(this,Be).ctx);try{return e()}catch(r){return Qr(r),null}finally{ht(n),Je(s),xn(i)}},zr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&xe(n=this.parent,Se,zr).call(n,e);return}j(this,Zt,w(this,Zt)+e),w(this,Zt)===0&&(xe(this,Se,gi).call(this),w(this,qe)&&cn(w(this,qe),()=>{j(this,qe,null)}),w(this,Rt)&&(w(this,tt).before(w(this,Rt)),j(this,Rt,null)))};function bc(t,e,n,s){const i=$n()?Is:Ei;var r=t.filter(h=>!h.settled);if(n.length===0&&r.length===0){s(e.map(i));return}var o=$,a=yc(),c=r.length===1?r[0].promise:r.length>1?Promise.all(r.map(h=>h.promise)):null;function u(h){a();try{s(h)}catch(d){o.f&kt||jt(d,o)}xi()}if(n.length===0){c.then(()=>u(e.map(i)));return}function l(){a(),Promise.all(n.map(h=>_c(h))).then(h=>u([...e.map(i),...h])).catch(h=>jt(h,o))}c?c.then(l):l()}function yc(){var t=$,e=K,n=ve,s=U;return function(r=!0){ht(t),Je(e),xn(n),r&&(s==null||s.activate())}}function xi(t=!0){ht(null),Je(null),xn(null),t&&(U==null||U.deactivate())}function Sc(){var t=$.b,e=U,n=t.is_rendered();return t.update_pending_count(1),e.increment(n),()=>{t.update_pending_count(-1),e.decrement(n)}}function Is(t){var e=Ie|Ce,n=K!==null&&K.f&Ie?K:null;return $!==null&&($.f|=kn),{ctx:ve,deps:null,effects:null,equals:Xr,f:e,fn:t,reactions:null,rv:0,v:Ee,wv:0,parent:n??$,ac:null}}function _c(t,e,n){$===null&&Yl();var i=void 0,r=ln(Ee),o=!K,a=new Map;return Lc(()=>{var d;var c=qr();i=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).finally(xi)}catch(p){c.reject(p),xi()}var u=U;if(o){var l=Sc();(d=a.get(u))==null||d.reject(on),a.delete(u),a.set(u,c)}const h=(p,f=void 0)=>{if(u.activate(),f)f!==on&&(r.f|=Bt,En(r,f));else{r.f&Bt&&(r.f^=Bt),En(r,p);for(const[m,S]of a){if(a.delete(m),m===u)break;S.reject(on)}}l&&l()};c.promise.then(h,p=>h(null,p||"unknown"))}),Ri(()=>{for(const c of a.values())c.reject(on)}),new Promise(c=>{function u(l){function h(){l===i?c(r):u(i)}l.then(h,h)}u(i)})}function oe(t){const e=Is(t);return Io(e),e}function Ei(t){const e=Is(t);return e.equals=Yr,e}function kc(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)Oe(e[n])}}function Tc(t){for(var e=t.parent;e!==null;){if(!(e.f&Ie))return e.f&kt?null:e;e=e.parent}return null}function Ii(t){var e,n=$;ht(Tc(t));try{t.f&=~sn,kc(t),e=Ao(t)}finally{ht(n)}return e}function ro(t){var e=Ii(t);if(!t.equals(e)&&(t.wv=Ro(),(!(U!=null&&U.is_fork)||t.deps===null)&&(t.v=e,t.deps===null))){fe(t,Te);return}qt||(Ne!==null?(Ni()||U!=null&&U.is_fork)&&Ne.set(t,e):_i(t))}function xc(t){var e,n;if(t.effects!==null)for(const s of t.effects)(s.teardown||s.ac)&&((e=s.teardown)==null||e.call(s),(n=s.ac)==null||n.abort(on),s.teardown=Hl,s.ac=null,rs(s,0),Ai(s))}function oo(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&Cn(e)}let Ci=new Set;const Ht=new Map;let ao=!1;function ln(t,e){var n={f:0,v:t,reactions:null,equals:Xr,rv:0,wv:0};return n}function re(t,e){const n=ln(t);return Io(n),n}function Ec(t,e=!1,n=!0){var i;const s=ln(t);return e||(s.equals=Yr),Tn&&n&&ve!==null&&ve.l!==null&&((i=ve.l).s??(i.s=[])).push(s),s}function C(t,e,n=!1){K!==null&&(!at||K.f&Gr)&&$n()&&K.f&(Ie|_t|Si|Gr)&&(Qe===null||!Sn.call(Qe,t))&&ic();let s=n?ot(e):e;return En(t,s)}function En(t,e){if(!t.equals(e)){var n=t.v;qt?Ht.set(t,e):Ht.set(t,n),t.v=e;var s=Ut.ensure();if(s.capture(t,n),t.f&Ie){const i=t;t.f&Ce&&Ii(i),_i(i)}t.wv=Ro(),co(t,Ce),$n()&&$!==null&&$.f&Te&&!($.f&(nt|en))&&(Ze===null?Wc([t]):Ze.push(t)),!s.is_fork&&Ci.size>0&&!ao&&Ic()}return e}function Ic(){ao=!1;for(const t of Ci)t.f&Te&&fe(t,st),is(t)&&Cn(t);Ci.clear()}function lo(t,e=1){var n=v(t),s=e===1?n++:n--;return C(t,n),s}function ts(t){C(t,t.v+1)}function co(t,e){var n=t.reactions;if(n!==null)for(var s=$n(),i=n.length,r=0;r<i;r++){var o=n[r],a=o.f;if(!(!s&&o===$)){var c=(a&Ce)===0;if(c&&fe(o,e),a&Ie){var u=o;Ne==null||Ne.delete(u),a&sn||(a&Xe&&(o.f|=sn),co(u,st))}else c&&(a&_t&&it!==null&&it.add(o),rt(o))}}}function ot(t){if(typeof t!="object"||t===null||rn in t)return t;const e=Ur(t);if(e!==jl&&e!==Ul)return t;var n=new Map,s=wi(t),i=re(0),r=hn,o=a=>{if(hn===r)return a();var c=K,u=hn;Je(null),No(r);var l=a();return Je(c),No(u),l};return s&&n.set("length",re(t.length)),new Proxy(t,{defineProperty(a,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&nc();var l=n.get(c);return l===void 0?o(()=>{var h=re(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(()=>re(Ee));n.set(c,l),ts(i)}}else C(u,Ee),ts(i);return!0},get(a,c,u){var p;if(c===rn)return t;var l=n.get(c),h=c in a;if(l===void 0&&(!h||(p=_n(a,c))!=null&&p.writable)&&(l=o(()=>{var f=ot(h?a[c]:Ee),m=re(f);return m}),n.set(c,l)),l!==void 0){var d=v(l);return d===Ee?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=v(l))}else if(u===void 0){var h=n.get(c),d=h==null?void 0:h.v;if(h!==void 0&&d!==Ee)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return u},has(a,c){var d;if(c===rn)return!0;var u=n.get(c),l=u!==void 0&&u.v!==Ee||Reflect.has(a,c);if(u!==void 0||$!==null&&(!l||(d=_n(a,c))!=null&&d.writable)){u===void 0&&(u=o(()=>{var p=l?ot(a[c]):Ee,f=re(p);return f}),n.set(c,u));var h=v(u);if(h===Ee)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 p=u;p<h.v;p+=1){var f=n.get(p+"");f!==void 0?C(f,Ee):p in a&&(f=o(()=>re(Ee)),n.set(p+"",f))}if(h===void 0)(!d||(I=_n(a,c))!=null&&I.writable)&&(h=o(()=>re(void 0)),C(h,ot(u)),n.set(c,h));else{d=h.v!==Ee;var m=o(()=>ot(u));C(h,m)}var S=Reflect.getOwnPropertyDescriptor(a,c);if(S!=null&&S.set&&S.set.call(l,u),!d){if(s&&typeof c=="string"){var x=n.get("length"),T=Number(c);Number.isInteger(T)&&T>=x.v&&C(x,T+1)}ts(i)}return!0},ownKeys(a){v(i);var c=Reflect.ownKeys(a).filter(h=>{var d=n.get(h);return d===void 0||d.v!==Ee});for(var[u,l]of n)l.v!==Ee&&!(u in a)&&c.push(u);return c},setPrototypeOf(){sc()}})}function uo(t){try{if(t!==null&&typeof t=="object"&&rn in t)return t[rn]}catch{}return t}function Cc(t,e){return Object.is(uo(t),uo(e))}var ho,fo,po,go;function Nc(){if(ho===void 0){ho=window,fo=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;po=_n(e,"firstChild").get,go=_n(e,"nextSibling").get,Hr(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Hr(n)&&(n.__t=void 0)}}function Tt(t=""){return document.createTextNode(t)}function In(t){return po.call(t)}function ns(t){return go.call(t)}function O(t,e){return In(t)}function xt(t,e=!1){{var n=In(t);return n instanceof Comment&&n.data===""?ns(n):n}}function W(t,e=1,n=!1){let s=t;for(;e--;)s=ns(s);return s}function Rc(t){t.textContent=""}function mo(){return!1}function vo(t,e,n){return document.createElementNS(jr,t,void 0)}let wo=!1;function Dc(){wo||(wo=!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 Cs(t){var e=K,n=$;Je(null),ht(null);try{return t()}finally{Je(e),ht(n)}}function Ac(t,e,n,s=n){t.addEventListener(e,()=>Cs(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),Dc()}function Mc(t){$===null&&(K===null&&$l(),Zl()),qt&&Ql()}function Oc(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=$;s!==null&&s.f&Fe&&(t|=Fe);var i={ctx:ve,deps:null,nodes:null,f:t|Ce|Xe,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{Cn(i)}catch(a){throw Oe(i),a}else e!==null&&rt(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&!(r.f&kn)&&(r=r.first,t&_t&&t&nn&&r!==null&&(r.f|=nn)),r!==null&&(r.parent=s,s!==null&&Oc(r,s),K!==null&&K.f&Ie&&!(t&en))){var o=K;(o.effects??(o.effects=[])).push(r)}return i}function Ni(){return K!==null&&!at}function Ri(t){const e=Et(Ts,null,!1);return fe(e,Te),e.teardown=t,e}function ss(t){Mc();var e=$.f,n=!K&&(e&nt)!==0&&(e&tn)===0;if(n){var s=ve;(s.e??(s.e=[])).push(t)}else return bo(t)}function bo(t){return Et(Zn|Vl,t,!1)}function Pc(t){Ut.ensure();const e=Et(en|kn,t,!0);return(n={})=>new Promise(s=>{n.outro?cn(e,()=>{Oe(e),s(void 0)}):(Oe(e),s(void 0))})}function yo(t){return Et(Zn,t,!1)}function Lc(t){return Et(Si|kn,t,!0)}function Di(t,e=0){return Et(Ts|e,t,!0)}function H(t,e=[],n=[],s=[]){bc(s,e,n,i=>{Et(Ts,()=>t(...i.map(v)),!0)})}function Ns(t,e=0){var n=Et(_t|e,t,!0);return n}function Ye(t){return Et(nt|kn,t,!0)}function So(t){var e=t.teardown;if(e!==null){const n=qt,s=K;Eo(!0),Je(null);try{e.call(null)}finally{Eo(n),Je(s)}}}function Ai(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&Cs(()=>{i.abort(on)});var s=n.next;n.f&en?n.parent=null:Oe(n,e),n=s}}function Bc(t){for(var e=t.first;e!==null;){var n=e.next;e.f&nt||Oe(e),e=n}}function Oe(t,e=!0){var n=!1;(e||t.f&Kr)&&t.nodes!==null&&t.nodes.end!==null&&(Fc(t.nodes.start,t.nodes.end),n=!0),Ai(t,e&&!n),rs(t,0),fe(t,kt);var s=t.nodes&&t.nodes.t;if(s!==null)for(const r of s)r.stop();So(t);var i=t.parent;i!==null&&i.first!==null&&_o(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Fc(t,e){for(;t!==null;){var n=t===e?null:ns(t);t.remove(),t=n}}function _o(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 cn(t,e,n=!0){var s=[];ko(t,s,!0);var i=()=>{n&&Oe(t),e&&e()},r=s.length;if(r>0){var o=()=>--r||i();for(var a of s)a.out(o)}else i()}function ko(t,e,n){if(!(t.f&Fe)){t.f^=Fe;var s=t.nodes&&t.nodes.t;if(s!==null)for(const a of s)(a.is_global||n)&&e.push(a);for(var i=t.first;i!==null;){var r=i.next,o=(i.f&nn)!==0||(i.f&nt)!==0&&(t.f&_t)!==0;ko(i,e,o?n:!1),i=r}}}function Mi(t){To(t,!0)}function To(t,e){if(t.f&Fe){t.f^=Fe,t.f&Te||(fe(t,Ce),rt(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&nn)!==0||(n.f&nt)!==0;To(n,i?e:!1),n=s}var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||e)&&o.in()}}function xo(t,e){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end;n!==null;){var i=n===s?null:ns(n);e.append(n),n=i}}let Rs=!1,qt=!1;function Eo(t){qt=t}let K=null,at=!1;function Je(t){K=t}let $=null;function ht(t){$=t}let Qe=null;function Io(t){K!==null&&(Qe===null?Qe=[t]:Qe.push(t))}let Pe=null,We=0,Ze=null;function Wc(t){Ze=t}let Co=1,un=0,hn=un;function No(t){hn=t}function Ro(){return++Co}function is(t){var e=t.f;if(e&Ce)return!0;if(e&Ie&&(t.f&=~sn),e&st){for(var n=t.deps,s=n.length,i=0;i<s;i++){var r=n[i];if(is(r)&&ro(r),r.wv>t.wv)return!0}e&Xe&&Ne===null&&fe(t,Te)}return!1}function Do(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Qe!==null&&Sn.call(Qe,t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&Ie?Do(r,e,!1):e===r&&(n?fe(r,Ce):r.f&Te&&fe(r,st),rt(r))}}function Ao(t){var m;var e=Pe,n=We,s=Ze,i=K,r=Qe,o=ve,a=at,c=hn,u=t.f;Pe=null,We=0,Ze=null,K=u&(nt|en)?null:t,Qe=null,xn(t.ctx),at=!1,hn=++un,t.ac!==null&&(Cs(()=>{t.ac.abort(on)}),t.ac=null);try{t.f|=yi;var l=t.fn,h=l();t.f|=tn;var d=t.deps,p=U==null?void 0:U.is_fork;if(Pe!==null){var f;if(p||rs(t,We),d!==null&&We>0)for(d.length=We+Pe.length,f=0;f<Pe.length;f++)d[We+f]=Pe[f];else t.deps=d=Pe;if(Ni()&&t.f&Xe)for(f=We;f<d.length;f++)((m=d[f]).reactions??(m.reactions=[])).push(t)}else!p&&d!==null&&We<d.length&&(rs(t,We),d.length=We);if($n()&&Ze!==null&&!at&&d!==null&&!(t.f&(Ie|st|Ce)))for(f=0;f<Ze.length;f++)Do(Ze[f],t);if(i!==null&&i!==t){if(un++,i.deps!==null)for(let S=0;S<n;S+=1)i.deps[S].rv=un;if(e!==null)for(const S of e)S.rv=un;Ze!==null&&(s===null?s=Ze:s.push(...Ze))}return t.f&Bt&&(t.f^=Bt),h}catch(S){return Qr(S)}finally{t.f^=yi,Pe=e,We=n,Ze=s,K=i,Qe=r,xn(o),at=a,hn=c}}function zc(t,e){let n=e.reactions;if(n!==null){var s=Fl.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}if(n===null&&e.f&Ie&&(Pe===null||!Sn.call(Pe,e))){var r=e;r.f&Xe&&(r.f^=Xe,r.f&=~sn),_i(r),xc(r),rs(r,0)}}function rs(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)zc(t,n[s])}function Cn(t){var e=t.f;if(!(e&kt)){fe(t,Te);var n=$,s=Rs;$=t,Rs=!0;try{e&(_t|Vr)?Bc(t):Ai(t),So(t);var i=Ao(t);t.teardown=typeof i=="function"?i:null,t.wv=Co;var r;vi&&cc&&t.f&Ce&&t.deps}finally{Rs=s,$=n}}}async function jc(){await Promise.resolve(),fc()}function v(t){var e=t.f,n=(e&Ie)!==0;if(K!==null&&!at){var s=$!==null&&($.f&kt)!==0;if(!s&&(Qe===null||!Sn.call(Qe,t))){var i=K.deps;if(K.f&yi)t.rv<un&&(t.rv=un,Pe===null&&i!==null&&i[We]===t?We++:Pe===null?Pe=[t]:Pe.push(t));else{(K.deps??(K.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[K]:Sn.call(r,K)||r.push(K)}}}if(qt&&Ht.has(t))return Ht.get(t);if(n){var o=t;if(qt){var a=o.v;return(!(o.f&Te)&&o.reactions!==null||Oo(o))&&(a=Ii(o)),Ht.set(o,a),a}var c=(o.f&Xe)===0&&!at&&K!==null&&(Rs||(K.f&Xe)!==0),u=(o.f&tn)===0;is(o)&&(c&&(o.f|=Xe),ro(o)),c&&!u&&(oo(o),Mo(o))}if(Ne!=null&&Ne.has(t))return Ne.get(t);if(t.f&Bt)throw t.v;return t.v}function Mo(t){if(t.f|=Xe,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&Ie&&!(e.f&Xe)&&(oo(e),Mo(e))}function Oo(t){if(t.v===Ee)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Ht.has(e)||e.f&Ie&&Oo(e))return!0;return!1}function os(t){var e=at;try{return at=!0,t()}finally{at=e}}const dn=Symbol("events"),Po=new Set,Oi=new Set;function Uc(t,e,n,s={}){function i(r){if(s.capture||Pi.call(e,r),!r.cancelBubble)return Cs(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?zt(()=>{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=Uc(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ri(()=>{e.removeEventListener(t,o,r)})}function fn(t,e,n){(e[dn]??(e[dn]={}))[t]=n}function Ds(t){for(var e=0;e<t.length;e++)Po.add(t[e]);for(var n of Oi)n(t)}let Lo=null;function Pi(t){var S,x;var e=this,n=e.ownerDocument,s=t.type,i=((S=t.composedPath)==null?void 0:S.call(t))||[],r=i[0]||t.target;Lo=t;var o=0,a=Lo===t&&t[dn];if(a){var c=i.indexOf(a);if(c!==-1&&(e===document||e===window)){t[dn]=e;return}var u=i.indexOf(e);if(u===-1)return;c<=u&&(o=c)}if(r=i[o]||t.target,r!==e){Wl(t,"currentTarget",{configurable:!0,get(){return r||n}});var l=K,h=$;Je(null),ht(null);try{for(var d,p=[];r!==null;){var f=r.assignedSlot||r.parentNode||r.host||null;try{var m=(x=r[dn])==null?void 0:x[s];m!=null&&(!r.disabled||t.target===r)&&m.call(r,t)}catch(T){d?p.push(T):d=T}if(t.cancelBubble||f===e||f===null)break;r=f}if(d){for(let T of p)queueMicrotask(()=>{throw T});throw d}}finally{t[dn]=e,delete t.currentTarget,Je(l),ht(h)}}}const Li=((kl=globalThis==null?void 0:globalThis.window)==null?void 0:kl.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Hc(t){return(Li==null?void 0:Li.createHTML(t))??t}function Bo(t){var e=vo("template");return e.innerHTML=Hc(t.replaceAll("<!>","<!---->")),e.content}function as(t,e){var n=$;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function q(t,e){var n=(e&Ll)!==0,s=(e&Bl)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=Bo(r?t:"<!>"+t),n||(i=In(i)));var o=s||fo?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=In(o),c=o.lastChild;as(a,c)}else as(o,o);return o}}function qc(t,e,n="svg"){var s=!t.startsWith("<!>"),i=`<${n}>${s?t:"<!>"+t}</${n}>`,r;return()=>{if(!r){var o=Bo(i),a=In(o);r=In(a)}var c=r.cloneNode(!0);return as(c,c),c}}function As(t,e){return qc(t,e,"svg")}function Nn(t=""){{var e=Tt(t+"");return as(e,e),e}}function Ms(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Tt();return t.append(e,n),as(e,n),t}function M(t,e){t!==null&&t.before(e)}const Vc=["touchstart","touchmove"];function Gc(t){return Vc.includes(t)}function Y(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 Kc(t,e){return Xc(t,e)}const Os=new Map;function Xc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:o=!0,transformError:a}){Nc();var c=void 0,u=Pc(()=>{var l=n??e.appendChild(Tt());vc(l,{pending:()=>{}},p=>{Ft({});var f=ve;r&&(f.c=r),i&&(s.$$events=i),c=t(p,s)||{},Wt()},a);var h=new Set,d=p=>{for(var f=0;f<p.length;f++){var m=p[f];if(!h.has(m)){h.add(m);var S=Gc(m);for(const I of[e,document]){var x=Os.get(I);x===void 0&&(x=new Map,Os.set(I,x));var T=x.get(m);T===void 0?(I.addEventListener(m,Pi,{passive:S}),x.set(m,1)):x.set(m,T+1)}}}};return d(ks(Po)),Oi.add(d),()=>{var S;for(var p of h)for(const x of[e,document]){var f=Os.get(x),m=f.get(p);--m==0?(x.removeEventListener(p,Pi),f.delete(p),f.size===0&&Os.delete(x)):f.set(p,m)}Oi.delete(d),l!==n&&((S=l.parentNode)==null||S.removeChild(l))}});return Yc.set(c,u),c}let Yc=new WeakMap;class Fo{constructor(e,n=!0){St(this,"anchor");G(this,ut,new Map);G(this,bt,new Map);G(this,Ve,new Map);G(this,yn,new Set);G(this,vs,!0);G(this,ws,()=>{var e=U;if(w(this,ut).has(e)){var n=w(this,ut).get(e),s=w(this,bt).get(n);if(s)Mi(s),w(this,yn).delete(n);else{var i=w(this,Ve).get(n);i&&(w(this,bt).set(n,i.effect),w(this,Ve).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,o]of w(this,ut)){if(w(this,ut).delete(r),r===e)break;const a=w(this,Ve).get(o);a&&(Oe(a.effect),w(this,Ve).delete(o))}for(const[r,o]of w(this,bt)){if(r===n||w(this,yn).has(r))continue;const a=()=>{if(Array.from(w(this,ut).values()).includes(r)){var u=document.createDocumentFragment();xo(o,u),u.append(Tt()),w(this,Ve).set(r,{effect:o,fragment:u})}else Oe(o);w(this,yn).delete(r),w(this,bt).delete(r)};w(this,vs)||!s?(w(this,yn).add(r),cn(o,a,!1)):a()}}});G(this,ci,e=>{w(this,ut).delete(e);const n=Array.from(w(this,ut).values());for(const[s,i]of w(this,Ve))n.includes(s)||(Oe(i.effect),w(this,Ve).delete(s))});this.anchor=e,j(this,vs,n)}ensure(e,n){var s=U,i=mo();if(n&&!w(this,bt).has(e)&&!w(this,Ve).has(e))if(i){var r=document.createDocumentFragment(),o=Tt();r.append(o),w(this,Ve).set(e,{effect:Ye(()=>n(o)),fragment:r})}else w(this,bt).set(e,Ye(()=>n(this.anchor)));if(w(this,ut).set(s,e),i){for(const[a,c]of w(this,bt))a===e?s.unskip_effect(c):s.skip_effect(c);for(const[a,c]of w(this,Ve))a===e?s.unskip_effect(c.effect):s.skip_effect(c.effect);s.oncommit(w(this,ws)),s.ondiscard(w(this,ci))}else w(this,ws).call(this)}}ut=new WeakMap,bt=new WeakMap,Ve=new WeakMap,yn=new WeakMap,vs=new WeakMap,ws=new WeakMap,ci=new WeakMap;function Bi(t){ve===null&&Xl(),Tn&&ve.l!==null?Jc(ve).m.push(t):ss(()=>{const e=os(t);if(typeof e=="function")return e})}function Jc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function ae(t,e,n=!1){var s=new Fo(t),i=n?nn:0;function r(o,a){s.ensure(o,a)}Ns(()=>{var o=!1;e((a,c=0)=>{o=!0,r(c,a)}),o||r(!1,null)},i)}function Rn(t,e){return e}function Qc(t,e,n){for(var s=[],i=e.length,r,o=e.length,a=0;a<i;a++){let h=e[a];cn(h,()=>{if(r){if(r.pending.delete(h),r.done.add(h),r.pending.size===0){var d=t.outrogroups;Fi(ks(r.done)),d.delete(r),d.size===0&&(t.outrogroups=null)}}else o-=1},!1)}if(o===0){var c=s.length===0&&n!==null;if(c){var u=n,l=u.parentNode;Rc(l),l.append(u),t.items.clear()}Fi(e,!c)}else r={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(r)}function Fi(t,e=!0){for(var n=0;n<t.length;n++)Oe(t[n],e)}var Wo;function Dn(t,e,n,s,i,r=null){var o=t,a=new Map;{var c=t;o=c.appendChild(Tt())}var u=null,l=Ei(()=>{var S=n();return wi(S)?S:S==null?[]:ks(S)}),h,d=!0;function p(){m.fallback=u,Zc(m,h,o,e,s),u!==null&&(h.length===0?u.f&Lt?(u.f^=Lt,cs(u,null,o)):Mi(u):cn(u,()=>{u=null}))}var f=Ns(()=>{h=v(l);for(var S=h.length,x=new Set,T=U,I=mo(),g=0;g<S;g+=1){var _=h[g],E=s(_,g),b=d?null:a.get(E);b?(b.v&&En(b.v,_),b.i&&En(b.i,g),I&&T.unskip_effect(b.e)):(b=$c(a,d?o:Wo??(Wo=Tt()),_,E,g,i,e,n),d||(b.e.f|=Lt),a.set(E,b)),x.add(E)}if(S===0&&r&&!u&&(d?u=Ye(()=>r(o)):(u=Ye(()=>r(Wo??(Wo=Tt()))),u.f|=Lt)),S>x.size&&Jl(),!d)if(I){for(const[y,k]of a)x.has(y)||T.skip_effect(k.e);T.oncommit(p),T.ondiscard(()=>{})}else p();v(l)}),m={effect:f,items:a,outrogroups:null,fallback:u};d=!1}function ls(t){for(;t!==null&&!(t.f&nt);)t=t.next;return t}function Zc(t,e,n,s,i){var y;var r=e.length,o=t.items,a=ls(t.effect.first),c,u=null,l=[],h=[],d,p,f,m;for(m=0;m<r;m+=1){if(d=e[m],p=i(d,m),f=o.get(p).e,t.outrogroups!==null)for(const k of t.outrogroups)k.pending.delete(f),k.done.delete(f);if(f.f&Lt)if(f.f^=Lt,f===a)cs(f,null,n);else{var S=u?u.next:a;f===t.effect.last&&(t.effect.last=f.prev),f.prev&&(f.prev.next=f.next),f.next&&(f.next.prev=f.prev),Vt(t,u,f),Vt(t,f,S),cs(f,S,n),u=f,l=[],h=[],a=ls(u.next);continue}if(f.f&Fe&&Mi(f),f!==a){if(c!==void 0&&c.has(f)){if(l.length<h.length){var x=h[0],T;u=x.prev;var I=l[0],g=l[l.length-1];for(T=0;T<l.length;T+=1)cs(l[T],x,n);for(T=0;T<h.length;T+=1)c.delete(h[T]);Vt(t,I.prev,g.next),Vt(t,u,I),Vt(t,g,x),a=x,u=g,m-=1,l=[],h=[]}else c.delete(f),cs(f,a,n),Vt(t,f.prev,f.next),Vt(t,f,u===null?t.effect.first:u.next),Vt(t,u,f),u=f;continue}for(l=[],h=[];a!==null&&a!==f;)(c??(c=new Set)).add(a),h.push(a),a=ls(a.next);if(a===null)continue}f.f&Lt||l.push(f),u=f,a=ls(f.next)}if(t.outrogroups!==null){for(const k of t.outrogroups)k.pending.size===0&&(Fi(ks(k.done)),(y=t.outrogroups)==null||y.delete(k));t.outrogroups.size===0&&(t.outrogroups=null)}if(a!==null||c!==void 0){var _=[];if(c!==void 0)for(f of c)f.f&Fe||_.push(f);for(;a!==null;)!(a.f&Fe)&&a!==t.fallback&&_.push(a),a=ls(a.next);var E=_.length;if(E>0){var b=r===0?n:null;Qc(t,_,b)}}}function $c(t,e,n,s,i,r,o,a){var c=o&ie?o&_s?ln(n):Ec(n,!1,!1):null,u=o&ye?ln(i):null;return{v:c,i:u,e:Ye(()=>(r(e,c??n,u??i,a),()=>{t.delete(s)}))}}function cs(t,e,n){if(t.nodes)for(var s=t.nodes.start,i=t.nodes.end,r=e&&!(e.f&Lt)?e.nodes.start:n;s!==null;){var o=ns(s);if(r.before(s),s===i)return;s=o}}function Vt(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function zo(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 jo(t,e,n){var s=new Fo(t);Ns(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},nn)}function Gt(t,e){yo(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=vo("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function Uo(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=Uo(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function eu(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Uo(t))&&(s&&(s+=" "),s+=e);return s}function An(t){return typeof t=="object"?eu(t):t??""}function tu(t,e,n){var s=t==null?"":""+t;return e&&(s=s?s+" "+e:e),s===""?null:s}function Kt(t,e,n,s,i,r){var o=t.__className;if(o!==n||o===void 0){var a=tu(n,s);a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a),t.__className=n}return r}function Ho(t,e,n=!1){if(t.multiple){if(e==null)return;if(!wi(e))return oc();for(var s of t.options)s.selected=e.includes(qo(s));return}for(s of t.options){var i=qo(s);if(Cc(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function nu(t){var e=new MutationObserver(()=>{Ho(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ri(()=>{e.disconnect()})}function qo(t){return"__value"in t?t.__value:t.value}const su=Symbol("is custom element"),iu=Symbol("is html");function ru(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Re(t,e,n,s){var i=ou(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[Kl]=n),n==null?t.removeAttribute(e):typeof n!="string"&&au(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function ou(t){return t.__attributes??(t.__attributes={[su]:t.nodeName.includes("-"),[iu]:t.namespaceURI===jr})}var Vo=new Map;function au(t){var e=t.getAttribute("is")||t.nodeName,n=Vo.get(e);if(n)return n;Vo.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=zl(i);for(var o in s)s[o].set&&n.push(o);i=Ur(i)}return n}function lu(t,e,n=e){var s=new WeakSet;Ac(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Wi(t)?zi(r):r,n(r),U!==null&&s.add(U),await jc(),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))}}}),os(e)==null&&t.value&&(n(Wi(t)?zi(t.value):t.value),U!==null&&s.add(U)),Di(()=>{var i=e();if(t===document.activeElement){var r=ki??U;if(s.has(r))return}Wi(t)&&i===zi(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Wi(t){var e=t.type;return e==="number"||e==="range"}function zi(t){return t===""?null:+t}function Go(t,e){return t===e||(t==null?void 0:t[rn])===e}function cu(t={},e,n,s){return yo(()=>{var i,r;return Di(()=>{i=r,r=[],os(()=>{t!==n(...r)&&(e(t,...r),i&&Go(n(...i),t)&&e(null,...i))})}),()=>{zt(()=>{r&&Go(n(...r),t)&&e(null,...r)})}}),t}let Ps=!1;function uu(t){var e=Ps;try{return Ps=!1,[t(),Ps]}finally{Ps=e}}function ze(t,e,n,s){var I;var i=!Tn||(n&Al)!==0,r=(n&Ol)!==0,o=(n&Pl)!==0,a=s,c=!0,u=()=>(c&&(c=!1,a=o?os(s):s),a),l;if(r){var h=rn in t||Gl in t;l=((I=_n(t,e))==null?void 0:I.set)??(h&&e in t?g=>t[e]=g:void 0)}var d,p=!1;r?[d,p]=uu(()=>t[e]):d=t[e],d===void 0&&s!==void 0&&(d=u(),l&&(i&&tc(),l(d)));var f;if(i?f=()=>{var g=t[e];return g===void 0?u():(c=!0,g)}:f=()=>{var g=t[e];return g!==void 0&&(a=void 0),g===void 0?a:g},i&&!(n&Ml))return f;if(l){var m=t.$$legacy;return function(g,_){return arguments.length>0?((!i||!_||m||p)&&l(_?f():g),g):f()}}var S=!1,x=(n&Dl?Is:Ei)(()=>(S=!1,f()));r&&v(x);var T=$;return function(g,_){if(arguments.length>0){const E=_?v(x):i&&r?ot(g):g;return C(x,E),S=!0,a!==void 0&&(a=E),g}return qt&&S||T.f&kt?x.v:v(x)}}function Ko(){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 ji(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 Ui(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 Xo(){const t="uniqueUserID";let e=Ui(t);return e||(e=Ko(),ji(t,e,365)),e}function je(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Ui("uniqueUserID");r||(r=Xo());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=Ui("sessionID");c||(c=Ko(),ji("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 Yo={},hu=function(t,e,n,s,i){var r=new Worker(Yo[e]||(Yo[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},$e=Uint8Array,Le=Uint16Array,Ls=Int32Array,Bs=new $e([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]),Fs=new $e([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]),Hi=new $e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jo=function(t,e){for(var n=new Le(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Ls(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}},Qo=Jo(Bs,2),du=Qo.b,Ws=Qo.r;du[28]=258,Ws[258]=28;for(var fu=Jo(Fs,0),qi=fu.r,zs=new Le(32768),ce=0;ce<32768;++ce){var Xt=(ce&43690)>>1|(ce&21845)<<1;Xt=(Xt&52428)>>2|(Xt&13107)<<2,Xt=(Xt&61680)>>4|(Xt&3855)<<4,zs[ce]=((Xt&65280)>>8|(Xt&255)<<8)>>1}for(var Mn=function(t,e,n){for(var s=t.length,i=0,r=new Le(e);i<s;++i)t[i]&&++r[t[i]-1];var o=new Le(e);for(i=1;i<e;++i)o[i]=o[i-1]+r[i-1]<<1;var a;if(n){a=new Le(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[zs[h]>>c]=u}else for(a=new Le(s),i=0;i<s;++i)t[i]&&(a[i]=zs[o[t[i]-1]++]>>15-t[i]);return a},Yt=new $e(288),ce=0;ce<144;++ce)Yt[ce]=8;for(var ce=144;ce<256;++ce)Yt[ce]=9;for(var ce=256;ce<280;++ce)Yt[ce]=7;for(var ce=280;ce<288;++ce)Yt[ce]=8;for(var us=new $e(32),ce=0;ce<32;++ce)us[ce]=5;var Zo=Mn(Yt,9,0),$o=Mn(us,5,0),Vi=function(t){return(t+7)/8|0},ea=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new $e(t.subarray(e,n))},pu=["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"],ta=function(t,e,n){var s=new Error(e||pu[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,ta),!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},On=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},js=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:Yi,l:0};if(i==1){var o=new $e(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(_,E){return _.f-E.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,h=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[h].f?u++:h++],c=n[u!=l&&n[u].f<n[h].f?u++:h++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};for(var d=r[0].s,s=1;s<i;++s)r[s].s>d&&(d=r[s].s);var p=new Le(d+1),f=Us(n[l-1],p,0);if(f>e){var s=0,m=0,S=f-e,x=1<<S;for(r.sort(function(E,b){return p[b.s]-p[E.s]||E.f-b.f});s<i;++s){var T=r[s].s;if(p[T]>e)m+=x-(1<<f-p[T]),p[T]=e;else break}for(m>>=S;m>0;){var I=r[s].s;p[I]<e?m-=1<<e-p[I]++-1:++s}for(;s>=0&&m;--s){var g=r[s].s;p[g]==e&&(--p[g],++m)}f=e}return{t:new $e(p),l:f}},Us=function(t,e,n){return t.s==-1?Math.max(Us(t.l,e,n+1),Us(t.r,e,n+1)):e[t.s]=n},Gi=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Le(++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}},Pn=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Ki=function(t,e,n){var s=n.length,i=Vi(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},Xi=function(t,e,n,s,i,r,o,a,c,u,l){dt(e,l++,n),++i[256];for(var h=js(i,15),d=h.t,p=h.l,f=js(r,15),m=f.t,S=f.l,x=Gi(d),T=x.c,I=x.n,g=Gi(m),_=g.c,E=g.n,b=new Le(19),y=0;y<T.length;++y)++b[T[y]&31];for(var y=0;y<_.length;++y)++b[_[y]&31];for(var k=js(b,7),P=k.t,V=k.l,F=19;F>4&&!P[Hi[F-1]];--F);var Q=u+5<<3,z=Pn(i,Yt)+Pn(r,us)+o,B=Pn(i,d)+Pn(r,m)+o+14+3*F+Pn(b,P)+2*b[16]+3*b[17]+7*b[18];if(c>=0&&Q<=z&&Q<=B)return Ki(e,l,t.subarray(c,c+u));var J,ee,D,te;if(dt(e,l,1+(B<z)),l+=2,B<z){J=Mn(d,p,0),ee=d,D=Mn(m,S,0),te=m;var Ae=Mn(P,V,0);dt(e,l,I-257),dt(e,l+5,E-1),dt(e,l+10,F-4),l+=14;for(var y=0;y<F;++y)dt(e,l+3*y,P[Hi[y]]);l+=3*F;for(var _e=[T,_],Mt=0;Mt<2;++Mt)for(var yt=_e[Mt],y=0;y<yt.length;++y){var N=yt[y]&31;dt(e,l,Ae[N]),l+=P[N],N>15&&(dt(e,l,yt[y]>>5&127),l+=yt[y]>>12)}}else J=Zo,ee=Yt,D=$o,te=us;for(var y=0;y<a;++y){var A=s[y];if(A>255){var N=A>>18&31;On(e,l,J[N+257]),l+=ee[N+257],N>7&&(dt(e,l,A>>23&31),l+=Bs[N]);var Z=A&31;On(e,l,D[Z]),l+=te[Z],Z>3&&(On(e,l,A>>5&8191),l+=Fs[Z])}else On(e,l,J[A]),l+=ee[A]}return On(e,l,J[256]),l+ee[256]},na=new Ls([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yi=new $e(0),sa=function(t,e,n,s,i,r){var o=r.z||t.length,a=new $e(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=na[e-1],d=h>>13,p=h&8191,f=(1<<n)-1,m=r.p||new Le(32768),S=r.h||new Le(f+1),x=Math.ceil(n/3),T=2*x,I=function(ne){return(t[ne]^t[ne+1]<<x^t[ne+2]<<T)&f},g=new Ls(25e3),_=new Le(288),E=new Le(32),b=0,y=0,k=r.i||0,P=0,V=r.w||0,F=0;k+2<o;++k){var Q=I(k),z=k&32767,B=S[Q];if(m[z]=B,S[Q]=z,V<=k){var J=o-k;if((b>7e3||P>24576)&&(J>423||!u)){l=Xi(t,c,0,g,_,E,y,P,F,k-F,l),P=b=y=0,F=k;for(var ee=0;ee<286;++ee)_[ee]=0;for(var ee=0;ee<30;++ee)E[ee]=0}var D=2,te=0,Ae=p,_e=z-B&32767;if(J>2&&Q==I(k-_e))for(var Mt=Math.min(d,J)-1,yt=Math.min(32767,k),N=Math.min(258,J);_e<=yt&&--Ae&&z!=B;){if(t[k+D]==t[k+D-_e]){for(var A=0;A<N&&t[k+A]==t[k+A-_e];++A);if(A>D){if(D=A,te=_e,A>Mt)break;for(var Z=Math.min(_e,A-2),le=0,ee=0;ee<Z;++ee){var ke=k-_e+ee&32767,ue=m[ke],Ge=ke-ue&32767;Ge>le&&(le=Ge,B=ke)}}}z=B,B=m[z],_e+=z-B&32767}if(te){g[P++]=268435456|Ws[D]<<18|qi[te];var De=Ws[D]&31,R=qi[te]&31;y+=Bs[De]+Fs[R],++_[257+De],++E[R],V=k+D,++b}else g[P++]=t[k],++_[t[k]]}}for(k=Math.max(k,V);k<o;++k)g[P++]=t[k],++_[t[k]];l=Xi(t,c,u,g,_,E,y,P,F,k-F,l),u||(r.r=l&7|c[l/8|0]<<3,l-=7,r.h=S,r.p=m,r.i=k,r.w=V)}else{for(var k=r.w||0;k<o+u;k+=65535){var L=k+65535;L>=o&&(c[l/8|0]=u,L=o),l=Ki(c,l+1,t.subarray(k,L))}r.i=o}return ea(a,0,s+Vi(l)+i)},ia=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}(),ra=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=ia[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},Ji=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),o=new $e(r.length+t.length);o.set(r),o.set(t,r.length),t=o,i.w=r.length}return sa(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)},gu=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},oa=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},Hs=[],mu=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},vu=function(t,e,n,s){if(!Hs[n]){for(var i="",r={},o=t.length-1,a=0;a<o;++a)i=oa(t[a],i,r);Hs[n]={c:oa(t[o],i,r),e:r}}var c=gu({},Hs[n].e);return hu(Hs[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,mu(c),s)},wu=function(){return[$e,Le,Ls,Bs,Fs,Hi,Ws,qi,Zo,Yt,$o,us,zs,na,Yi,Mn,dt,On,js,Us,Gi,Pn,Ki,Xi,Vi,ea,sa,Ji,Su,aa]},bu=function(){return[la,ca,qs,ra,ia]},aa=function(t){return postMessage(t,[t.buffer])},yu=function(t,e,n,s,i,r){var o=vu(n,s,i,function(a,c){o.terminate(),r(a,c)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},qs=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},la=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&&qs(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)}},ca=function(t){return 10+(t.filename?t.filename.length+1:0)};function Su(t,e){return Ji(t,e||{},0,0)}function _u(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ta(7),yu(t,e,[wu,bu,function(){return[ua]}],function(s){return aa(ua(s.data[0],s.data[1]))},2,n)}function ua(t,e){e||(e={});var n=ra(),s=t.length;n.p(t);var i=Ji(t,e,ca(e),8),r=i.length;return la(i,e),qs(i,r-8,n.d()),qs(i,r-4,s),i}var ku=typeof TextDecoder<"u"&&new TextDecoder,Tu=0;try{ku.decode(Yi,{stream:!0}),Tu=1}catch{}class ha{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 xu{constructor(e){this.dict=new ha,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 ha}}class Eu{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=Iu(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=Ln[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=Ln[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=Ln[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=Ln[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=Ln[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=Ln[i.operator];r&&n.some(o=>r(o,i.value))&&this.trigger(i.name)})}}const Ln={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},Iu=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 Cu{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 da={htmlmasked:"hidden",masked:"obscured"},ft=!(typeof window>"u"),Nu=ft&&navigator.userAgent.match(/firefox|fxios/i),Ru=1e5;let Qi=ft?Date.now()-performance.now():0;function Zi(){Qi=Date.now()-performance.now()}function Bn(){return Qi}const lt=ft&&performance.now?()=>Math.round(performance.now()+Qi):()=>Date.now(),$i="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function fa(t){return t.trim().replace(/\s+/g," ")}function pa(t){return t.startsWith("https://")||t.startsWith("http://")}const Vs="https://docs.openreplay.com",ga={};function Jt(t,e,n="/"){ga[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${Vs}${n} for more information.`),ga[t]=!0)}function er(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&Jt('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function pn(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(da[e]&&Jt(`"${n}" attribute`,`"${da[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function Du(t){try{return!!t.contentDocument}catch{return!1}}function ma(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 va(t){return t.toString(16).padStart(2,"0")}function Au(t){const e=new Uint8Array(t/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,va).join("")):Array.from({length:t},()=>va(Math.floor(Math.random()*16))).join("")}function wa(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function tr(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function ba(t,e){if(e)return new MutationObserver(t);{const n=tr("MutationObserver");return new window[n](t)}}function ya(t,e,n,s,i){if(!ma(t))return;let r="addEventListener";i||(r=tr("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 Sa(t,e,n,s,i){if(!ma(t))return;let r="removeEventListener";i||(r=tr("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 Ou=new Mu;function Pu(t){Ou.addTask(t)}function _a(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]=_a(r||{},i):n[s]=i}return n}function gn(t){return[0,t]}function Lu(t,e){return[5,t,e]}function Bu(t,e){return[6,t,e]}function Fu(){return[7]}function Wu(t,e,n,s,i){return[8,t,e,n,s,i]}function zu(t,e,n){return[9,t,e,n]}function ju(t,e,n){return[10,t,e,n]}function Uu(t){return[11,t]}function ka(t,e){return[13,t,e]}function Hu(t,e){return[14,t,e]}function qu(t,e,n){return[16,t,e,n]}function Vu(t,e,n){return[18,t,e,n]}function Gu(t,e){return[19,t,e]}function Ku(t,e){return[20,t,e]}function Xu(t,e){return[22,t,e]}function Yu(t,e,n,s,i,r,o,a,c){return[23,t,e,n,s,i,r,o,a,c]}function Ju(t,e,n){return[24,t,e,n]}function Qu(t,e){return[27,t,e]}function Zu(t){return[28,t]}function $u(t){return[29,t]}function Ta(t,e){return[30,t,e]}function eh(t,e,n,s){return[49,t,e,n,s]}function th(t,e){return[54,t,e]}function nh(t){return[55,t]}function xa(t,e,n,s){return[57,t,e,n,s]}function Ea(t){return[58,t]}function nr(t,e,n,s){return[60,t,e,n,s]}function sh(t,e,n){return[61,t,e,n]}function ih(t,e){return[63,t,e]}function rh(t,e){return[64,t,e]}function oh(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function sr(t,e){return[70,t,e]}function Ia(t,e,n){return[71,t,e,n]}function ir(t,e,n,s){return[73,t,e,n,s]}function Ca(t,e){return[75,t,e]}function Na(t,e){return[76,t,e]}function ah(t,e){return[77,t,e]}function rr(t,e,n,s){return[78,t,e,n,s]}function Gs(t,e,n,s,i,r,o,a,c){return[83,t,e,n,s,i,r,o,a,c]}function lh(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function ch(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function Ra(t,e,n){return[113,t,e,n]}function uh(t){return[114,t]}function Da(t){return[115,t]}function Aa(t,e,n,s,i,r,o,a,c,u){return[116,t,e,n,s,i,r,o,a,c,u]}function Ks(t){return[117,t]}function mn(t){return[118,t]}function hh(t,e){return[119,t,e]}function dh(t){return[120,t]}function fh(t,e,n,s){return[122,t,e,n,s]}const or=ft&&"performance"in window&&"memory"in performance?performance:{memory:{}},ar=ft?(navigator.deviceMemory||0)*1024:0,lr=or.memory.jsHeapSizeLimit||0;function ph(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(eh(s,i,or.memory.totalJSHeapSize||0,or.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 Ma="__or__watched_tags__";class gh{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(Ma)??"[]");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(Ma,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 mh={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"'},vh={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Xs={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"},wh={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},bh={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"},yh={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"},Oa={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},Fn={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"},Wn={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"},_h={...Wn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},Pa={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},La={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"},Ba={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},kh={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},Fa={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},Th={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"},Wa={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"},za={fontWeight:"bold"},xh={fontSize:"13px",lineHeight:"auto"},ja={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},Eh={...ja,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},Ih={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},Ch={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},Ua={Standard:{width:1280,height:720}};class Nh{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 Rh(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 Dh(){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 Ah(){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
- 0% { transform: rotate(0deg); }
3
- 100% { transform: rotate(360deg); }
4
- }`,document.head.appendChild(t)}function Oh(){Mh();const t=document.createElement("div");return t.classList.add("spinner"),Object.assign(t.style,Ch),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 Ys="or_uxt_test_start",cr="or_uxt_task_index",ur="or_uxt_session_id",Ph="or_uxt_test_id";class Lh{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,p)=>{if(!h)return console.error("User Testing: No Task ID Given");const f=this.durations.tasks.find(x=>x.taskId===h),m=this.getTimestamp(),S=f?m-f.started:0;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,taskId:h,status:d,duration:S,timestamp:m,taskAnswer:p})})},this.signalTest=h=>{const d=this.getTimestamp();if(h==="begin"&&this.testId){const m=this.getSessionId();this.setStorageKey(ur,m),this.setStorageKey(this.storageKey,this.testId.toString()),this.setStorageKey(Ys,d.toString())}else this.removeStorageKey(this.storageKey),this.removeStorageKey(cr),this.removeStorageKey(Ys);const p=this.durations.testStart||d,f=d-p;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,status:h,duration:f,timestamp:d})})};const l=this.getStorageKey(Ys);l&&(this.durations.testStart=parseInt(l,10))}}class Bh{constructor(e,n){this.app=e,this.storageKey=n,this.bg=X("div","bg",mh,void 0,"__or_ut_bg"),this.container=X("div","container",vh,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 Lh(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,Ua.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 Nh(e);const s=this.app.getSessionID(),i=this.app.localStorage.getItem(ur);s!==i&&(this.app.localStorage.removeItem(this.storageKey),this.app.localStorage.removeItem(ur),this.app.localStorage.removeItem(Ph),this.app.localStorage.removeItem(cr),this.app.localStorage.removeItem(Ys));const r=this.app.localStorage.getItem(cr);r&&(this.currentTaskIndex=parseInt(r,10))}getTestId(){return this.testId}createGreeting(e,n,s){const i=X("div","title",wh,e),r=X("div","description",bh,`Welcome, you're here to help us improve, not to be judged. Your insights matter!
5
-
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",yh,"Read guidelines to begin");this.removeGreeting=()=>((n||s)&&this.userRecorder.startRecording(30,Ua.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,Xs),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,Xs);const r=this.createDescriptionSection(e),o=this.createTasksSection(n),a=X("div","stop_bn_or",Ba,"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=Dh(),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=Ah();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?Xs:{border:"none",background:"none",padding:0}),this.taskSection&&Object.assign(this.taskSection.style,this.widgetVisible?Wn:{display:"none"}),this.descriptionSection&&Object.assign(this.descriptionSection.style,this.widgetVisible?Wn:{display:"none"}),this.endSection&&Object.assign(this.endSection.style,this.widgetVisible?Wn:{display:"none"}),this.stopButton&&Object.assign(this.stopButton.style,this.widgetVisible?Ba:{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,Rh(this.bg,n),this.collapseWidget=()=>r(!1),e}createDescriptionSection(e){const n=X("div","description_section_or",Wn),s=X("div","description_s_title_or",Oa),i=X("div","title",{fontSize:13,fontWeight:500,lineHeight:"auto"},"Introduction & Guidelines"),r=X("div","icon",Pa,"-"),o=X("div","content",Fn),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",La,"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?Fn:{display:"none"})};return s.onclick=u,this.toggleDescriptionVisibility=()=>{this.widgetGuidelinesVisible=!1,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(o.style,this.widgetGuidelinesVisible?Fn:{display:"none"}),o.removeChild(c)},c.onclick=()=>{var l,h,d;if(u(),this.test){const p=(l=this.signalManager)==null?void 0:l.getDurations(),f=p?p.tasks.findIndex(m=>this.test&&m.taskId===this.test.tasks[0].task_id):null;p&&f===-1&&(p.tasks.push({taskId:this.test.tasks[0].task_id,started:this.app.timestamp()}),(h=this.signalManager)==null||h.setDurations(p)),(d=this.signalManager)==null||d.signalTask(this.test.tasks[0].task_id,"begin")}this.showTaskSection(),o.removeChild(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,Xs);const n=X("div","task_section_or",Wn),s=X("div","description_t_title_or",Oa),i=X("div","title",{fontSize:"13px",fontWeight:"500",lineHeight:"auto"},"Tasks"),r=X("div","icon",Pa,"-"),o=X("div","content",Fn),a=X("div","pagination",kh),c=X("div","taskCard",Wa),u=X("div","taskText",za),l=X("div","taskDescription",xh),h=X("div","taskButtons",Ih),d=X("div","taskText",za);d.textContent="Your answer";const p=X("textarea","taskDescription",{resize:"vertical"}),f=X("div","inputArea",Wa);f.append(d,p);const m=X("div","closePanelButton",ja,"Collapse Panel"),S=X("div","nextButton",Eh,"Done, Next");s.append(i,r),c.append(u,l),h.append(m,S),o.append(a,c,f,h),n.append(s,o);const x=()=>{const g=e[this.currentTaskIndex];u.textContent=g.title,l.textContent=g.description,g.allow_typing?f.style.display="flex":f.style.display="none"};e.forEach((g,_)=>{const E=X("span",`or_task_${_}`,{outline:"1px solid #efefef",fontSize:"13px",height:"24px",width:"24px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em"},(_+1).toString());E.id=`or_task_${_}`,a.append(E)});const T=()=>{this.widgetTasksVisible=!this.widgetTasksVisible,r.textContent=this.widgetTasksVisible?"-":"+",Object.assign(o.style,this.widgetTasksVisible?Fn:{display:"none"})};this.hideTaskSection=()=>(r.textContent="+",Object.assign(o.style,{display:"none"}),this.widgetTasksVisible=!1,!1),this.showTaskSection=()=>(r.textContent="-",Object.assign(o.style,Fn),this.widgetTasksVisible=!0,!0);const I=()=>{const g=document.getElementById(`or_task_${this.currentTaskIndex}`);g&&Object.assign(g.style,Fa);for(let _=0;_<this.currentTaskIndex;_++){const E=document.getElementById(`or_task_${_}`);E&&Object.assign(E.style,Th)}};return s.onclick=T,m.onclick=this.collapseWidget,S.onclick=()=>{var _,E,b,y;const g=e[this.currentTaskIndex].allow_typing?p.value:void 0;if(p.value="",(_=this.signalManager)==null||_.signalTask(e[this.currentTaskIndex].task_id,"done",g),this.currentTaskIndex<e.length-1){this.currentTaskIndex++,x();const k=(E=this.signalManager)==null?void 0:E.getDurations();k&&k.tasks.findIndex(P=>P.taskId===e[this.currentTaskIndex].task_id)===-1&&(k.tasks.push({taskId:e[this.currentTaskIndex].task_id,started:this.app.timestamp()}),(b=this.signalManager)==null||b.setDurations(k)),(y=this.signalManager)==null||y.signalTask(e[this.currentTaskIndex].task_id,"begin"),I()}else this.showEndSection();this.app.localStorage.setItem("or_uxt_task_index",this.currentTaskIndex.toString())},setTimeout(()=>{const g=document.getElementById("or_task_0");g&&Object.assign(g.style,Fa),x(),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",_h),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
-
9
- We appreciate your time and valuable input.`),r=X("div","end_button_or",La,"Submitting Feedback"),o=Oh();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 Ha(t){return!!t&&t.nodeType!=null}function hr(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function Ct(t){return t.nodeType===Node.ELEMENT_NODE}function Fh(t){return t.nodeType===Node.COMMENT_NODE}function dr(t){return t.nodeType===Node.TEXT_NODE}function Js(t){return t.nodeType===Node.DOCUMENT_NODE}function Qs(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function we(t,e){return t.localName===e}class Wh{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=[],this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=s=>{const i=this.app.nodes.getID(s);if(!i||!we(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!we(s,"canvas")||this.snapshots[i])return;new IntersectionObserver(a=>{a.forEach(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=hh(i.toString(),r);this.app.send(o);const a=u=>{zh(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||!we(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&&jh(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 qa={low:.35,medium:.55,high:.8};function zh(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,qa[e])}else t.toBlob(r,o,qa[e])}function jh(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 zn={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class Uh{constructor(e=zn.Silent){this.shouldLog=n=>this.level>=n,this.info=(...n)=>{this.shouldLog(zn.Verbose)&&console.info(...n)},this.log=(...n)=>{this.shouldLog(zn.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(zn.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(zn.Errors)&&console.error(...n)},this.level=e}}const Hh=1e3;function qh(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 Vh(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 Gh={interval:Hh*30,batchSize:2500,enabled:!0};class Kh{constructor(e,n,s){this.nodes=e,this.unregisterNode=n,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{qh(this.nodes,this.options.batchSize,i=>{Vh(i)[0]||this.unregisterNode(i)})},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval)},this.options={...Gh,...s}}}class Xh{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;ya(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=>Sa(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 Kh(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 Zs(t){if(Fh(t))return!0;if(dr(t))return!1;if(!Ct(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 fr(t){return Qs(t)?!0:!Zs(t)}var pt;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(pt||(pt={}));class pr{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=ba(this.app.safe(s=>{for(const i of s){const r=i.target,o=i.type;if(!fr(r))continue;if(o==="childList"){for(let c=0;c<i.removedNodes.length;c++)fr(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=>Zs(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(Da(a))}}sendNodeAttribute(e,n,s,i){if(hr(n)){s.substring(0,6)==="xlink:"&&(s=s.substring(6)),i===null?this.app.send(ka(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(nr(e,s,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,s,i);return}if(!(s==="src"||s==="srcset"||s==="integrity"||s==="crossorigin"||s==="autocomplete"||s.substring(0,2)==="on")&&!(s==="value"&&we(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(ka(e,s));return}if(s==="style"||s==="href"&&we(n,"link")){this.app.send(nr(e,s,i,this.app.getBaseHref()));return}(s==="href"||i.length>1e5)&&(i=""),this.app.attributeSender.sendSetAttribute(e,s,i)}}sendNodeData(e,n,s){if(we(n,"style")){this.app.send(sh(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(Hu(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(!fr(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),Zs(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(Uu(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:a=>Zs(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(Da(o))}}_commitNode(e,n){if(Qs(n))return!0;const s=n.parentNode;let i;if(!we(n,"html")||!this.isTopContext){if(s===null)return this.unbindTree(n),!1;if(i=this.app.nodes.getID(s),i===void 0)return this.unbindTree(n),!1;if(!this.commitNode(i))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,i,n),this.app.sanitizer.isHidden(i))return!1}let r=n.previousSibling;for(;r!==null;){const 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(Ct(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(Wu(e,i,c,l.tagName,hr(n)))}for(let h=0;h<l.attributes.length;h++){const d=l.attributes[h];this.sendNodeAttribute(e,l,d.nodeName,d.value)}}else dr(n)&&(this.app.send(zu(e,i,c)),this.sendNodeData(e,s,n.data));return!0}o===pt.Removed&&i!==void 0&&this.app.send(ju(e,i,c));const u=this.attributesMap.get(e);if(u!==void 0){if(!Ct(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(!dr(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 Va extends pr{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(sr(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(sr(e,s))})}}class Yh extends pr{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(sr(s,i))})}}class Jh{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 gr=ft?Element.prototype.attachShadow:()=>new ShadowRoot;class Qh extends pr{constructor(e){super(e.app,!0),this.iframeOffsets=new Jh,this.contextCallbacks=[],this.contextsSet=new WeakSet,this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.docObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.app=e.app,this.options=Object.assign({captureIFrames:!0},e.options),this.app.nodes.attachNodeCallback(n=>{we(n,"iframe")&&(this.options.captureIFrames&&!pn(n,"obscured")||pn(n,"capture"))&&this.handleIframe(n)}),this.app.nodes.attachNodeCallback(n=>{Ct(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||!Du(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 Va(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 Yh(this.app);this.shadowRootObservers.set(e,n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=gr.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(Fu()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=gr.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new Va(this.app);this.iframeObservers.set(window.document,i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=gr,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}var $s;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})($s||($s={}));const Zh=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class $h{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)||Ct(s)&&(pn(s,"masked")||pn(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||Ct(s)&&(pn(s,"htmlmasked")||pn(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&Ct(s)){const i=this.options.domSanitizer(s);i===$s.Obscured&&this.obscured.add(e),i===$s.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?Zh(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g,s=>{const[i,r]=s.split("@"),[o,a]=r.split(".");return`${$i(i)}@${$i(o)}.${$i(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 ed{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=Au(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 td(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class nd{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?td(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 sd='!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',hs="canceled",Ga="or_uxt_active",mr="or_buffer_1",Nt=t=>({reason:t,success:!1}),Ka=t=>({...t,success:!0});var pe;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(pe||(pe={}));const Xa="https://api.openreplay.com/ingest";function vr(){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 id=t=>new Promise(e=>setTimeout(e,t)),ge={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"tracker inside a child iframe",iframeId:"getting node id for child iframe",iframeBatch:"batch of messages from an iframe window",parentAlive:"signal that parent is live",killIframe:"stop tracker inside frame",startIframe:"start tracker inside frame",polling:"hello-how-are-you-im-under-the-water-please-help-me"};let rd=class{constructor(e,n,s,i,r){var c,u;this.signalError=i,this.insideIframe=r,this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=pe.NotActive,this.version="14.0.14",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.features={"feature-flags":!0,"usability-test":!0},this.parentActive=!1,this.checkStatus=()=>this.parentActive,this.parentCrossDomainFrameListener=l=>{const{data:h}=l;if(!(!h||l.source===window)){if(h.line===ge.startIframe){if(this.active())return;try{this.allowAppStart(),this.start()}catch(d){console.error("children frame restart failed:",d)}}h.line===ge.parentAlive&&(this.parentActive=!0),h.line===ge.iframeId&&(this.parentActive=!0,this.rootId=h.id,this.session.setSessionToken(h.token),this.frameOderNumber=h.frameOrderNumber,this.debug.log("starting iframe tracking",h),this.allowAppStart()),h.line===ge.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.crossDomainIframeListener=l=>{var d,p;if(!this.active()||l.source===window)return;const{data:h}=l;if(h){if(h.line===ge.iframeSignal&&((d=l.source)==null||d.postMessage({ping:!0,line:ge.parentAlive},"*"),(async()=>{var S;if(l.source===null)return console.error("Couldnt connect to event.source for child iframe tracking");const m=await this.checkNodeId(l.source);if(!m){this.debug.log("Couldnt get node id for iframe",l.source);return}try{this.trackedFrames.includes(h.context)?this.debug.log("Trying to observe already added iframe; ignore if its a restart"):this.trackedFrames.push(h.context),await this.waitStarted();const x=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 I={line:ge.iframeId,id:m,token:x,frameOrderNumber:T};this.debug.log("Got child frame signal; nodeId",m,l.source,I),(S=l.source)==null||S.postMessage(I,"*")}catch(x){console.error(x)}})()),h.line===ge.iframeBatch){const m=h.messages.map(S=>{if(S[0]===20){let x=S;return this.pageFrames.forEach(T=>{if(T.contentWindow===l.source){const[I,g,_]=S,{left:E,top:b}=T.getBoundingClientRect();x=[I,g+E,_+b]}}),x}if(S[0]===68){let x=S;return this.pageFrames.forEach(T=>{if(T.contentWindow===l.source){const[I,g,_,E,b,y,k]=S,{left:P,top:V,width:F,height:Q}=T.getBoundingClientRect(),z=document.documentElement.scrollWidth,B=document.documentElement.scrollHeight,J=y/100*F+P,ee=k/100*Q+V,D=J/z,te=ee/B;x=[I,g,_,E,b,Math.round(D*1e3)/10,Math.round(te*1e3)/10]}}),x}return S});this.messages.push(...m)}if(h.line===ge.polling){if(!this.pollingQueue.order.length)return;const f=this.pollingQueue.order[0];if(f&&this.pollingQueue[f].length===0){this.pollingQueue.order=this.pollingQueue.order.filter(m=>m!==f);return}this.pollingQueue[f].includes(h.context)&&(this.pollingQueue[f]=this.pollingQueue[f].filter(m=>m!==h.context),(p=l.source)==null||p.postMessage({line:f},"*"),this.pollingQueue[f].length===0&&this.pollingQueue.order.shift())}}},this.pollingQueue={order:[]},this.addCommand=l=>{this.pollingQueue.order.push(l),this.pollingQueue[l]=[...this.trackedFrames]},this.bootChildrenFrames=async()=>{await this.waitStarted(),this.addCommand(ge.startIframe)},this.killChildrenFrames=()=>{this.addCommand(ge.killIframe)},this.signalIframeTracker=()=>{var x;const l=this.session.getTabId();window.parent.postMessage({line:ge.iframeSignal,source:l,context:this.contextId},((x=this.options.crossdomain)==null?void 0:x.parentDomain)??"*");const h=10;let d=0,p=250,f=0,m=!1;const S=()=>{var T;if(m||this.checkStatus()){m=!0;return}window.parent.postMessage({line:ge.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()){m=!0;break}f+=p,setTimeout(()=>{S()},f),p*=1.5}},this.startTimeout=null,this.coldStartCommitN=0,this.delay=0,this.attachStartCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.startCallbacks.push(l)},this.attachStopCallback=(l,h=!1)=>{h&&(l=this.safe(l)),this.stopCallbacks.push(l)},this.attachEventListener=(l,h,d,p=!0,f=!0)=>{p&&(d=this.safe(d));const m=()=>l?ya(l,h,d,f,this.options.forceNgOff):null,S=()=>l?Sa(l,h,d,f,this.options.forceNgOff):null;this.attachStartCallback(m,p),this.attachStopCallback(S,p)},this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.prevOpts={},this.restartCanvasTracking=()=>{var l;(l=this.canvasRecorder)==null||l.restartTracking()},this.flushBuffer=async l=>new Promise(h=>{let d=!1;const p=[l.shift()];for(;!d;){const f=l[0];!f||f[0]===0?d=!0:p.push(l.shift())}this.postToWorker(p),h(null)}),this.onUxtCb=[],this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,Object.keys(s).findIndex(l=>["fixedCanvasScaling","disableCanvas"].includes(l))!==-1&&(console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'),s={...s,canvas:{__save_canvas_locally:s.__save_canvas_locally,fixedCanvasScaling:s.fixedCanvasScaling,disableCanvas:s.disableCanvas}}),this.networkOptions=s.network;const o={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:Xa,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:zn.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=_a(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 $h({app:this,options:s}),this.nodes=new Xh({node_id:this.options.node_id,forceNgOff:!!s.forceNgOff,maintainer:(c=this.options.nodes)==null?void 0:c.maintainer}),this.observer=new Qh({app:this,options:s}),this.ticker=new nd(this),this.ticker.attach(()=>this.commit()),this.debug=new Uh(this.options.__debug__),this.session=new ed({app:this,options:this.options}),this.attributeSender=new xu({app:this,isDictDisabled:!!(this.options.disableStringDict||(u=this.options.crossdomain)!=null&&u.enabled)}),this.featureFlags=new Cu(this),this.tagWatcher=new gh({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:l=>this.send(dh(l))}),this.session.attachUpdateCallback(({userID:l,metadata:h})=>{l!=null&&this.send(Zu(l)),h!=null&&Object.entries(h).forEach(([d,p])=>this.send(Ta(d,p)))}),n!=null&&this.session.applySessionHash(n);const a=this.session.getTabId();this.insideIframe?(window.addEventListener("message",this.parentCrossDomainFrameListener),setInterval(()=>{var l;document.hidden||window.parent.postMessage({line:ge.polling,context:this.contextId},((l=s.crossdomain)==null?void 0:l.parentDomain)??"*")},250)):(this.initWorker(),window.addEventListener("message",this.crossDomainIframeListener)),this.bc!==null&&(this.bc.postMessage({line:ge.ask,source:a,context:this.contextId}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},250),this.bc.onmessage=l=>{if(l.data.context!==this.contextId){if(l.data.line===ge.resp){const h=l.data.token;this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===ge.reg){const h=l.data.token;this.session.regenerateTabId(),this.session.setSessionToken(h),this.allowAppStart()}if(l.data.line===ge.ask){const h=this.session.getSessionToken();h&&this.bc&&this.bc.postMessage({line:l.data.source===a?ge.reg:ge.resp,token:h,source:a,context:this.contextId})}}})}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkNodeId(e){let n;if(this.pageFrames.length>0&&(n=this.pageFrames.find(i=>i.contentWindow===e)),!n||!this.pageFrames.length){const i=Array.from(document.querySelectorAll("iframe"));this.pageFrames=i,n=i.find(r=>r.contentWindow===e)}if(!n)return null;let s=0;for(;s<100;){const i=n[this.options.node_id];if(i!==void 0)return s=100,i;s++,await id(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob([sd],{type:"text/javascript"}))),this.worker.onerror=n=>{this._debug("webworker_error",n)},this.worker.onmessage=({data:n})=>{this.handleWorkerMsg(n)};const e=()=>{this.worker&&this.worker.postMessage(null)};this.attachEventListener(window,"beforeunload",e,!1),this.attachEventListener(document.body,"mouseleave",e,!1,!1),this.attachEventListener(document,"visibilitychange",e,!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.waitStatus(pe.NotActive).then(()=>{this.allowAppStart(),this.start(this.prevOpts,!0).then(s=>{this.debug.info("Worker restarted, session was too long",s)}).catch(s=>{this.debug.error("Worker restart failed",s)})});else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const s=e.batch;s.byteLength>this.compressionThreshold?_u(e.batch,{mtime:0},(r,o)=>{var a,c;r?(this.debug.error("Openreplay compression error:",r),(a=this.worker)==null||a.postMessage({type:"uncompressed",batch:s})):(c=this.worker)==null||c.postMessage({type:"compressed",batch:o})}):(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:s})}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}send(e,n=!1){var s;this.activityState!==pe.NotActive&&(this.activityState===pe.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===pe.Active&&n&&this.commit())}_nCommit(){var e;if(this.socketMode){this.messages.unshift(mn(this.session.getTabId())),this.messages.unshift(gn(this.timestamp())),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(this.insideIframe){window.parent.postMessage({line:ge.iframeBatch,messages:this.messages},((e=this.options.crossdomain)==null?void 0:e.parentDomain)??"*"),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0;return}if(!(this.worker===void 0||!this.messages.length))try{Pu(()=>{var n;this.messages.unshift(mn(this.session.getTabId())),this.messages.unshift(gn(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(gn(this.timestamp())),this.bufferedMessages1.push(mn(this.session.getTabId())),this.bufferedMessages2.push(gn(this.timestamp())),this.bufferedMessages2.push(mn(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===pe.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(s=>s(e)),e.length=0}timestamp(){return lt()+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=lt()-i;return`${c}?jumpto=${u}`}return c}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===pe.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}checkSessionToken(e){const n=this.sessionStorage.getItem(this.options.session_reset_key)!==null,s=e||n,i=this.session.getSessionToken();return s||!i}async coldStart(e={},n){this.singleBuffer=!1;const s=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,Zi(),this.coldStartTs=lt(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(gn(this.timestamp())),this.bufferedMessages1.push(mn(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(gn(this.timestamp())),this.bufferedMessages2.push(mn(this.session.getTabId()))),this.stop(!1),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Ks(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var p,f;this.conditionsManager=new Eu(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:lt(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:ar,jsHeapSizeLimit:lr,timezone:vr(),width:window.screen.width,height:window.screen.height})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,projectID:l,features:h}=await n.json();this.features=h||this.features,this.session.assign({projectID:l}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});const d={sessionToken:s,userUUID:"",sessionID:""};this.startCallbacks.forEach(m=>m(d)),await((p=this.conditionsManager)==null?void 0:p.fetchConditions(l,s)),this.features["feature-flags"]&&(await this.featureFlags.reloadFlags(s),(f=this.conditionsManager)==null||f.processFlags(this.featureFlags.flags)),await this.tagWatcher.fetchTags(this.options.ingestPoint,s)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const s=this.checkSessionToken(e.forceNew);Zi(),this.coldStartTs=lt();const i=this.localStorage.getItem(mr);if(i){const o=JSON.parse(i);this.bufferedMessages1=Array.isArray(o)?o:this.bufferedMessages1,this.localStorage.removeItem(mr)}this.bufferedMessages1.push(gn(this.timestamp())),this.bufferedMessages1.push(mn(this.session.getTabId())),this.activityState=pe.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(o=>o(r)),s||this.send(Ks(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(mr,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var d,p;this.stop(!1);const e=lt();(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:ar,jsHeapSizeLimit:lr,timezone:vr()})}),{token:s,userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u,beaconSizeLimit:l,projectID:h}=await n.json();for((p=this.worker)==null||p.postMessage({type:"auth",token:s,beaconSizeLimit:l}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:o,userDevice:a,userOS:c,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([["q_end"]]),this.clearBuffers()}async _start(e={},n=!1,s){var c,u,l,h,d;Object.keys(e).length!==0&&(this.prevOpts=e);const i=this.activityState===pe.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const p="No worker found: perhaps, CSP is not set.";return this.signalError(p,[]),Promise.resolve(Nt(p))}if(this.activityState===pe.Active||this.activityState===pe.Starting)return Promise.resolve(Nt("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=pe.Starting,i||Zi(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=lt();(c=this.worker)==null||c.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:r,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const o=this.session.getSessionToken(),a=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",a,"session token: ",o);try{const p=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:r,doNotRecord:!1,bufferDiff:r-this.coldStartTs,userID:this.session.getInfo().userID,token:a?void 0:o,deviceMemory:ar,jsHeapSizeLimit:lr,timezone:vr(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(p.status!==200){const D=await p.text(),te=D===hs?hs:`Server error: ${p.status}. ${D}`;return Nt(te)}if(!this.worker&&!this.insideIframe){const D="no worker found after start request (this should not happen in real world)";return this.signalError(D,[]),Nt(D)}const{token:f,userUUID:m,projectID:S,beaconSizeLimit:x,compressionThreshold:T,delay:I,sessionID:g,startTimestamp:_,userBrowser:E,userCity:b,userCountry:y,userDevice:k,userOS:P,userState:V,canvasEnabled:F,canvasQuality:Q,canvasFPS:z,assistOnly:B,features:J}=await p.json();if(this.features=J||this.features,typeof f!="string"||typeof m!="string"||typeof _!="number"&&typeof _<"u"||typeof g!="string"||typeof I!="number"||typeof x!="number"&&typeof x<"u"){const D=`Incorrect server response: ${JSON.stringify(p)}`;return this.signalError(D,[]),Nt(D)}this.delay=I,this.session.setSessionToken(f),this.session.setUserInfo({userBrowser:E,userCity:b,userCountry:y,userDevice:k,userOS:P,userState:V}),this.session.assign({sessionID:g,timestamp:_||r,projectID:S}),B?(this.socketMode=!0,(u=this.worker)==null||u.postMessage("stop")):(l=this.worker)==null||l.postMessage({type:"auth",token:f,beaconSizeLimit:x}),!a&&f===o&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Ks(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([D,te])=>this.send(Ta(D,te))),this.localStorage.setItem(this.options.local_uuid_key,m),this.compressionThreshold=T;const ee={sessionToken:f,userUUID:m,sessionID:g};if(this.startCallbacks.forEach(D=>D(ee)),e.startCallback&&e.startCallback(Ka(ee)),this.features["feature-flags"]&&this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,f),this.activityState=pe.Active,(h=this.options.crossdomain)!=null&&h.enabled&&!this.insideIframe&&this.bootChildrenFrames(),F&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new Wh(this,{fps:z,quality:Q,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,Ga);let D;const te=this.localStorage.getItem(Ga);if(te&&(D=parseInt(te,10)),location!=null&&location.search){const Ae=new URLSearchParams(location.search);if(Ae.has("oruxt")){const _e=Ae.get("oruxt");D=_e?parseInt(_e,10):void 0}}D&&(this.uxtManager.isActive?this.onUxtCb.forEach(Ae=>Ae(D)):this.uxtManager.getTest(D,f,!!te).then(Ae=>{Ae&&this.onUxtCb.forEach(_e=>_e(Ae))}))}return Ka(ee)}catch(p){if(this.stop(),this.session.reset(),!p)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),Nt("Unknown error");if(p===hs)return this.signalError(hs,[]),Nt(hs);this._debug("session_start",p);const f=p instanceof Error?p.message:p.toString();return this.signalError(f,[]),Nt(f)}}addOnUxtCb(e){this.onUxtCb.push(e)}getUxtId(){var e;return(e=this.uxtManager)==null?void 0:e.getTestId()}async waitStart(){return new Promise(e=>{const n=setInterval(()=>{this.canStart&&(clearInterval(n),e(!0))},100)})}async waitStarted(){return this.waitStatus(pe.Active)}async waitStatus(e){return new Promise(n=>{const s=()=>{this.activityState===e?n(!0):setTimeout(s,25)};s()})}async start(...e){return this.activityState===pe.Active||this.activityState===pe.Starting?Promise.resolve(Nt("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(lh("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n,s;if(this.activityState!==pe.NotActive)try{!this.insideIframe&&((n=this.options.crossdomain)!=null&&n.enabled)&&this.killChildrenFrames(),this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(i=>i()),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(s=this.canvasRecorder)==null||s.clear(),this.messages.length=0,this.parentActive=!1}finally{this.activityState=pe.NotActive,this.debug.log("OpenReplay tracking stopped.")}}};function od(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(th(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const Ya=ft&&"InstallTrigger"in window?t=>t.message+`
10
- `+t.stack:t=>t.stack||t.message;function wr(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?Ya(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function ad(t){return typeof t!="number"?"NaN":t.toString()}function ld(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function Ja(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return Ya(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(wr).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+": "+wr(i))}return"{"+e.join(", ")+"}"}return t.toString()}function cd(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 Ja(s);case"s":return wr(s);case"f":return ad(s);case"d":case"i":return ld(s);default:return e}})),t.map(Ja).join(" ")}const Qa=["log","info","warn","error","debug","assert"];function ud(t,e){const n=Object.assign({consoleMethods:Qa,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const s=t.safe((c,u)=>t.send(Xu(c,cd(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,p){Reflect.apply(h,u,p),i=i+1,!(i>n.consoleThrottling)&&s(h.name,p)}};n.consoleMethods.forEach(h=>{if(Qa.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 hd=/(^|@)\S+:\d+/,Za=/^\s*at .*(\S+:\d+|\(native\))/m,dd=/^(eval@)?(\[native code\])?$/;function fd(t,e){if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return wd(t);if(t.stack&&t.stack.match(Za))return pd(t);if(t.stack)return md(t);throw new Error("Cannot parse given Error object")}function br(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 ds(t,e){return t}function pd(t,e){return gd(t.stack)}function gd(t,e){return ds(t.split(`
11
- `).filter(s=>!!s.match(Za))).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=br(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 md(t,e){return vd(t.stack)}function vd(t,e){return ds(t.split(`
12
- `).filter(s=>!s.match(dd))).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=br(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 wd(t,e){return!t.stacktrace||t.message.includes(`
13
- `)&&t.message.split(`
14
- `).length>t.stacktrace.split(`
15
- `).length?bd(t):t.stack?Sd(t):yd(t)}function bd(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 ds(i)}function yd(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 ds(i)}function Sd(t,e){return ds(t.stack.split(`
18
- `).filter(s=>!!s.match(hd)&&!s.match(/^Error created at/))).map(s=>{const i=s.split("@"),r=br(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 _d(t){return t.map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}function kd(t,e){return _d(fd(t))}function $a(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function ei(t,e,n={}){let s=e;try{s=kd(t)}catch{}return rr(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function el(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return ei(t.error,$a(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),rr(s,i,JSON.stringify($a(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return ei(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return rr("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function Td(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(o){const a=el(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 tl(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 xd(t){return Nu&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const Ed="https://static.openreplay.com/tracker/placeholder.jpeg";function Id(t){function e(a,c){t.attributeSender.sendSetAttribute(a,"src",Ed);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=>tl(h)).join(", ");t.attributeSender.sendSetAttribute(a,"srcset",l)},s=function(a,c){c.src.length>Ru&&e(a,c),t.send(nr(a,"src",c.src,t.getBaseHref()))},i=t.safe(function(a){const c=tl(a.src||"");pa(c)&&t.send(Aa(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&&!xd(a.src)?i(a):t.sanitizer.isHidden(c)||t.sanitizer.isObscured(c)?e(c,a):(s(c,a),n(c,a)))}),o=ba(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=>{we(a,"img")&&(t.nodes.attachNodeListener(a,"error",()=>i(a)),t.nodes.attachNodeListener(a,"load",()=>r(a)),r(a),o.observe(a,{attributes:!0,attributeFilter:["src","srcset"]}))})}const Cd=["text","password","email","search","number","range","date","tel","time"];function Nd(t){return we(t,"textarea")?!0:we(t,"input")?Cd.includes(t.type):!1}function Rd(t){if(!we(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const Dd=ft&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(we(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(we(e,"label"))return e;const n=t.id;if(n){const s=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(s!==null&&s.length===1)return s[0]}};function nl(t){let e=er(t);if(e===null){const n=Dd(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return fa(e).slice(0,100)}const jn={Plain:0,Obscured:1,Hidden:2};function Ad(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:jn.Obscured,obscureInputDates:!1},e);function s(l,h){let d=h.value,p=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(l)?p=jn.Hidden:(t.sanitizer.isObscured(l)||p===jn.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(d)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~d.indexOf("@"))))&&(p=jn.Obscured);let f=0;switch(p){case jn.Hidden:f=-1,d="";break;case jn.Obscured:f=d.length,d="";break}return{value:d,mask:f}}function i(l,h){const{value:d,mask:p}=s(l,h);t.send(Vu(l,d,p))}const r=new Map,o=new Map;t.attachStopCallback(()=>{r.clear(),o.clear()});function a(l,h){r.get(l)!==h.value&&(r.set(l,h.value),i(l,h))}function c(l,h){o.get(l)!==h&&(o.set(l,h),t.send(Gu(l,h)))}t.ticker.attach(()=>{r.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return r.delete(h);a(h,d)}),o.forEach((l,h)=>{const d=t.nodes.getNode(h);if(!d)return o.delete(h);c(h,d.checked)})},3);function u(l,h,d,p){const{value:f,mask:m}=s(l,h),S=nl(h);t.send(ch(l,f,m!==0,S,d,p))}t.nodes.attachNodeCallback(t.safe(l=>{const h=t.nodes.getID(l);if(h!==void 0){if(we(l,"select")&&(i(h,l),t.nodes.attachNodeListener(l,"change",()=>i(h,l))),Nd(l)){a(h,l);let d=0,p=0,f=0;const m=()=>{d=lt()},S=()=>{p===0&&d!==0&&(p=lt()-d)},x=()=>{d!==0&&(f=lt()-d),u(h,l,p,f),p=0,f=0,d=0};t.nodes.attachNodeListener(l,"focus",m),t.nodes.attachNodeListener(l,"input",S),t.nodes.attachNodeListener(l,"change",x);return}if(Rd(l)){c(h,l.checked),t.nodes.attachNodeListener(l,"change",()=>c(h,l.checked));return}}}))}let et,yr,sl;function Md(t,e){if(sl=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};et={...n,...e},yr=Od(et.root,n);let s=ti(t,"all",()=>ti(t,"two",()=>ti(t,"one",()=>ti(t,"none"))));if(s){const i=cl(ul(s,t));return i.length>0&&(s=i[0]),ni(s)}else throw new Error("Selector was not found.")}function Od(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function ti(t,e,n){let s=null,i=[],r=t,o=0;for(;r;){const a=new Date().getTime()-sl.getTime();if(et.timeoutMs!==void 0&&a>et.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let c=ii(Pd(r))||ii(...Ld(r))||ii(...Bd(r))||ii(Fd(r))||[al()];const u=Wd(r);if(e=="all")u&&(c=c.concat(c.filter(Sr).map(l=>si(l,u))));else if(e=="two")c=c.slice(0,1),u&&(c=c.concat(c.filter(Sr).map(l=>si(l,u))));else if(e=="one"){const[l]=c=c.slice(0,1);u&&Sr(l)&&(c=[si(l,u)])}else e=="none"&&(c=[al()],u&&(c=[si(c[0],u)]));for(let l of c)l.level=o;if(i.push(c),i.length>=et.seedMinLength&&(s=il(i,n),s))break;r=r.parentElement,o++}return s||(s=il(i,n)),!s&&n?n():s}function il(t,e){const n=cl(ll(t));if(n.length>et.threshold)return e?e():null;for(let s of n)if(ol(s))return s;return null}function ni(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 rl(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function ol(t){const e=ni(t);switch(yr.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 Pd(t){const e=t.getAttribute("id");return e&&et.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function Ld(t){return Array.from(t.attributes).filter(n=>et.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(et.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function Fd(t){const e=t.tagName.toLowerCase();return et.tagName(e)?{name:e,penalty:2}:null}function al(){return{name:"*",penalty:3}}function Wd(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 si(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function Sr(t){return t.name!=="html"&&!t.name.startsWith("#")}function ii(...t){const e=t.filter(zd);return e.length>0?e:null}function zd(t){return t!=null}function*ll(t,e=[]){if(t.length>0)for(let n of t[0])yield*ll(t.slice(1,t.length),e.concat(n));else yield e}function cl(t){return[...t].sort((e,n)=>rl(e)-rl(n))}function*ul(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>et.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>et.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=ni(i);if(n.visited.has(r))return;ol(i)&&jd(i,e)&&(yield i,n.visited.set(r,!0),yield*ul(i,e,n))}}function jd(t,e){return yr.querySelector(ni(t))===e}function Ud(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 _r(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 hl(t,e){return t instanceof Element?Hd(t,e):null}function Hd(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(pn(n,"masked"))return null;n=n.parentElement}if(hr(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"||_r(n)||er(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function qd(t,e){const{disableClickmaps:n=!1}=e||{};function s(g){const _=er(g);if(_!==null)return _;if(we(g,"input"))return nl(g);if(_r(g)){let E="";return g instanceof HTMLElement&&(E=t.sanitizer.getInnerTextSecure(g)),E=E||g.id||g.className,fa(E).slice(0,100)}return""}let i=-1,r=-1,o=!1,a=null,c=0,u={},l=0,h=0,d=0,p=0,f;const m=.008,S=225;function x(){const g=p/S;if(!l){l=g;return}const _=(g-l)/S;d>4&&_>m&&t.send(uh(lt())),p=0,d=0,l=g}t.attachStartCallback(()=>{f=setInterval(()=>x(),S)}),t.attachStopCallback(()=>{i=-1,r=-1,o=!1,a=null,u={},f&&clearInterval(f)});const T=()=>{o&&(t.send(Ku(i,r)),o=!1)},I=(g,_=!1)=>{function E(y,k,P){return u[y]=u[y]||Ud(k,g,P)}const b=_?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);b(g.documentElement,"mouseover",y=>{const k=hl(y.target,g);k!==a&&(a=k,c=performance.now())}),b(g,"mousemove",y=>{const[k,P]=t.observer.getDocumentOffset(g);i=y.clientX+k,r=y.clientY+P,o=!0;const V=Math.sign(y.movementX);p+=Math.abs(y.movementX)+Math.abs(y.movementY),V!==h&&(h=V,d++)},!1),b(g,"click",y=>{const k=hl(y.target,g);if(!y.clientX&&!y.clientY||k===null)return;const P=t.nodes.getID(k);if(P!==void 0){const V=y.pageX,F=y.pageY,Q=g.documentElement.scrollWidth,z=g.documentElement.scrollHeight,B=dl(V/Q),J=dl(F/z);T(),t.send(oh(P,a===k?Math.round(performance.now()-c):0,s(k),_r(k)&&!n?E(P,k,e):"",B,J),!0)}a=null})};t.nodes.attachNodeCallback(g=>{Js(g)&&I(g)}),I(document,!0),t.ticker.attach(T,(e==null?void 0:e.trackingOffset)||7)}function dl(t){return Math.round(t*1e4)}function Vd(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let o="";if(we(r,"img")&&(o=r.currentSrc||r.src),!o){const f=getComputedStyle(r).getPropertyValue("background-image");if(f){const m=s.exec(f);m!==null&&(o=m[1],(o.startsWith('"')||o.startsWith("'"))&&(o=o.substr(1,o.length-2)))}}if(!o)continue;const a=o.substr(0,10)==="data:image"?0:t[o];if(a===void 0)continue;const c=r.getBoundingClientRect(),u=Math.max(c.top,0),l=Math.max(c.left,0),h=Math.min(c.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),d=Math.min(c.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(h<=u||d<=l)continue;const p=(h-u)*(d-l);e.push({time:a,area:p})}return e}function Gd(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 Kd(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||!pa(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(Aa(u.startTime+Bn(),u.duration,u.responseStart&&u.startTime?u.responseStart-u.startTime:0,u.transferSize>u.encodedBodySize?u.transferSize-u.encodedBodySize:0,u.encodedBodySize||0,u.decodedBodySize||0,u.name,u.initiatorType,u.transferSize,u.responseStatus&&u.responseStatus===304||u.transferSize===0))}const r=new PerformanceObserver(u=>u.getEntries().forEach(i));let o;t.attachStartCallback(function({sessionID:u}){u!==o&&(performance.getEntriesByType("resource").forEach(i),o=u),r.observe({entryTypes:["resource"]})}),t.attachStopCallback(function(){r.disconnect()});let a=0,c=0;if(n.capturePageLoadTimings){let u=!1;t.ticker.attach(()=>{if(!u&&((a===0||c===0)&&performance.getEntriesByType("paint").forEach(l=>{const{name:h,startTime:d}=l;switch(h){case"first-paint":a=d;break;case"first-contentful-paint":c=d;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){u=!0;const{navigationStart:l,requestStart:h,responseStart:d,responseEnd:p,domContentLoadedEventStart:f,domContentLoadedEventEnd:m,loadEventStart:S,loadEventEnd:x}=performance.timing;t.send(Yu(h-l||0,d-l||0,p-l||0,f-l||0,m-l||0,S-l||0,x-l||0,a,c))}},30)}if(n.capturePageRenderTimings){let u=0,l=0,h=0,d=null,p=!1;t.ticker.attach(()=>{if(p)return;const f=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(m=>s[m])),f-u>1e3&&(d=Vd(s),s=null)),h!==null&&(f-h>50&&(l=f),h=f-l>5e3?null:f),d!==null&&h===null||f>3e4){p=!0,s=null;const m=d===null?0:Gd(c||a,d),{domContentLoadedEventEnd:S,navigationStart:x}=performance.timing,T=h===null?Math.max(l,c,S-x||0):0;t.send(Ju(m,c>u?c:u,T))}})}}function kr(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 Xd(t,e){let n=!1;const s=new Map;function i(a){Ha(a)&&(Ct(a)&&s.set(a,[a.scrollLeft,a.scrollTop]),Js(a)&&s.set(a,kr(a)))}const r=t.safe(()=>{e||t.send(Bu(...kr(document)))}),o=t.safe((a,c)=>{const u=t.nodes.getID(c);u!==void 0&&t.send(qu(u,a[0],a[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((a,c)=>{c&&(Ct(a)&&a.scrollLeft+a.scrollTop>0?s.set(a,[a.scrollLeft,a.scrollTop]):Js(a)&&s.set(a,kr(a))),Qs(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 Yd(t){let e,n,s,i,r=document.referrer;const o=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(fh(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(Lu(n,s)))}),c=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(nh(document.hidden)));t.attachStartCallback(()=>{e=null,i=Bn(),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 fl(t){return Qs(t)&&!!t.adoptedStyleSheets}let Jd=15;function pl(){return Jd++}const ri=new Map;function Qd(t){if(t===null||!fl(document))return;const e=new Map,n=new Map,s=o=>setTimeout(()=>{let a=t.nodes.getID(o);if(o===document&&(a=0),a===void 0)return;let c=n.get(a);c||(c=[]);const u=[],l=o.adoptedStyleSheets;if(l&&Symbol.iterator in l)for(const h of l){let d=e.get(h);const p=!d;if(d||(d=pl(),e.set(h,d)),c.includes(d)||t.send(Na(d,a)),p){const f=h.cssRules;for(let m=0;m<f.length;m++)t.send(ir(d,f[m].cssText,m,t.getBaseHref()))}u.push(d)}if(Symbol.iterator in c)for(const h of c)u.includes(h)||t.send(ah(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(Ia(h,u,t.getBaseHref())),l})},o.CSSStyleSheet.prototype.replaceSync=function(u){const l=e.get(this);return l&&t.send(Ia(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=>{fl(o)&&s(o)})}function Zd(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(ih("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,o)=>{const a=ri.get(i);a&&(typeof o=="string"?t.send(ir(a,o,r,t.getBaseHref())):t.send(Ca(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=ri.get(o);if(!a){t.debug.warn("No sheedID found for",o,ri);return}const c=r.cssText,u=o.cssRules,l=Array.from(u).indexOf(r);l>=0?(t.send(ir(a,c,l,t.getBaseHref())),t.send(Ca(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(!we(i,"style")||!i.sheet||i.textContent!==null&&i.textContent.trim().length>0)return;const r=t.nodes.getID(i);if(!r)return;const o=i.sheet,a=pl();ri.set(o,a),t.send(Na(a,r));const c=o.cssRules;for(let u=0;u<c.length;u++)e(o,u,c[u].cssText)})}function $d(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(Ea(i))}let n=!1;t.nodes.attachNodeCallback(s=>{we(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{Ha(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(Ea(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&we(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function ef(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(xa(l,...c))}super(...o)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!Js(s))return;const i=e.get(s);if(!i)return;const r=s.defaultView===window?0:t.nodes.getID(s);r!==void 0&&i.forEach(o=>{t.send(xa(r,...o))})}))}function tf(t,e,n,s,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function r(d){t.debug.log("Openreplay: capturing axios response data",d);const{headers:p,data:f,method:m,url:S,baseURL:x}=d.config,{data:T,headers:I,status:g,response:_}=d,{data:E,headers:b,status:y}=_||{},k=n.ignoreHeaders,P=Array.isArray(k)?D=>k.includes(D):()=>k;function V(D,te){P(te[0])||(D[te[0]]=te[1])}let F={},Q={};p.toJSON?F=p.toJSON():p instanceof Headers?p.forEach((D,te)=>V(F,[te,D])):Array.isArray(p)?p.forEach(D=>V(F,D)):typeof p=="object"&&Object.entries(p).forEach(D=>V(F,D));const z=b||I;z.toJSON?Q=z.toJSON():z instanceof Headers?z.forEach((D,te)=>V(Q,[te,D])):Array.isArray(z)?z.forEach(D=>V(Q,D)):typeof z=="object"&&Object.entries(z).forEach(([D,te])=>{P(D)||(Q[D]=te)});const B=s({url:S,method:m||"",status:g||y||0,request:{headers:F,body:f},response:{headers:Q,body:E||T}});if(!B){t.debug.log("Openreplay: empty request/response info, skipping");return}const J=d.config.__openreplay_timing,ee=performance.now()-J;t.debug.log("Openreplay: final req object",B),t.send(Gs("xhr",String(m),String(B.url),i(B.request),i(B.response),B.status,J+Bn(),ee,0))}function o(d){if(t.debug.log("Openreplay: capturing API request",d),d.__openreplay_timing=performance.now(),n.sessionTokenHeader){const p=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",f=t.getSessionToken();f&&d.headers.set(p,f)}return d}function a(d){return n.failuresOnly||r(d),d}function c(d){return t.debug.log("Openreplay: capturing API request error",d),nf(d)&&d.response?r(d.response):d instanceof Error&&t.send(ei(d,[])),Promise.reject(d)}function u(d){t.debug.log("Openreplay: failed API request, skipping",d)}const l=e.interceptors.request.use(o,u,{synchronous:!0}),h=e.interceptors.response.use(a,c,{synchronous:!0});t.attachStopCallback(()=>{var d,p,f,m;(p=(d=e.interceptors.request).eject)==null||p.call(d,l),(m=(f=e.interceptors.response).eject)==null||m.call(f,h)})}function nf(t){return sf(t)&&t.isAxiosError===!0}function sf(t){return t!==null&&typeof t=="object"}class Tr{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 fs=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:Er(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},xr=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(of(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":Er(t)?e=t:e=`can't parse body ${typeof t}`;return e},rf=(t,e={})=>{Er(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 Er(t){return t!==null&&typeof t=="object"}function of(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function oi(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const Ir=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href)),af=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 lf{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 Tr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const a=Ir(i);if(o.method="POST",o.url=i,o.name=(a.pathname.split("/").pop()||"")+a.search,o.requestType="beacon",o.requestHeader={"Content-Type":af(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=xr(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 cf{static create(e,n,s,i,r,o){if(e)return new Proxy(e,new lf(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 uf{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=fs(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=oi(this.item.responseSize),o.done&&(this.item.response=fs(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=fs(this.item.responseType,e),r.apply(s,o)),s}}}class hf{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 Tr(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=Ir(n),o=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=Ir(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=xr(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=oi(e.responseSize),e.response=fs(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new uf(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 df{static create(e,n,s,i,r,o){return new Proxy(fetch,new hf(e,n,s,i,r,o))}}class ff{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 Tr(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=fs(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=rf(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=xr(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=oi(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=oi(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class pf{static create(e,n,s,i,r,o){return new Proxy(XMLHttpRequest,{construct(a){const c=new a;return new Proxy(c,new ff(c,e,n,s,i,r,o))}})}}const gl=t=>{const e=`Openreplay: Can't find ${t} in global context.`;console.warn(e)};function gf(t,e,n,s,i,r,o={xhr:!0,fetch:!0,beacon:!0},a){var c;if(t&&(o.xhr&&(t.XMLHttpRequest?t.XMLHttpRequest=pf.create(e,n,s,i,r,a):gl("XMLHttpRequest")),o.fetch&&(t.fetch?t.fetch=df.create(e,n,s,i,r,a):gl("fetch")),o.beacon&&!((c=t.navigator)===null||c===void 0)&&c.sendBeacon)){const u=t.navigator.sendBeacon;t.navigator.sendBeacon=cf.create(u,e,n,s,i,r)}}function Cr(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function ml(t){return typeof t=="string"?t.toUpperCase():"GET"}function mf(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 gf(l,n.ignoreHeaders,o,a,I=>{t.send(Gs(I.requestType,I.method,I.url,I.request,I.response,I.status,I.startTime+Bn(),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(E,b){g.headers===void 0&&(g.headers={}),g.headers instanceof Headers?g.headers.append(E,b):Array.isArray(g.headers)?g.headers.push([E,b]):g.headers[E]=b});const _=performance.now();return h(I,g).then(E=>{const b=performance.now()-_;if(n.failuresOnly&&E.status<400)return E;const y=E.clone();return y.text().then(k=>{const P={},V={};if(s!==!0){const z=([B,J])=>{i(B)||(P[B]=J)};g.headers instanceof Headers?g.headers.forEach((B,J)=>z([J,B])):Array.isArray(g.headers)?g.headers.forEach(z):typeof g.headers=="object"&&Object.entries(g.headers).forEach(z),y.headers.forEach((B,J)=>{i(J)||(V[J]=B)})}const F=ml(g.method),Q=a({url:String(I),method:F,status:y.status,request:{headers:P,body:g.body||null},response:{headers:V,body:k}});Q&&t.send(Gs("fetch",F,String(Q.url),c(Q.request),c(Q.response),y.status,_+Bn(),b,0))}).catch(k=>t.debug.error("Could not process Fetch response:",k)),E})};l.fetch=d;const p=l.XMLHttpRequest.prototype.open,f=l.XMLHttpRequest.prototype.setRequestHeader,m=l.XMLHttpRequest.prototype.send;function S(I,g){const _=this;o((b,y)=>_.setRequestHeader(b,y));let E=0;return _.addEventListener("loadstart",b=>{E=b.timeStamp}),_.addEventListener("load",t.safe(b=>{const{headers:y,body:k}=Cr(_),P=E>0?b.timeStamp-E:0,F=(_.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),Q={};F.forEach(function(J){const ee=J.split(": "),D=ee.shift();i(D)||(Q[D]=ee.join(": "))});const z=ml(I),B=a({url:String(g),method:z,status:_.status,request:{headers:y,body:k||null},response:{headers:Q,body:_.response}});B&&t.send(Gs("xhr",z,String(B.url),c(B.request),c(B.response),_.status,E+Bn(),P,0))})),p.apply(this,arguments)}function x(I){const g=Cr(this);return g.body=I,m.apply(this,arguments)}function T(I,g){if(!i(I)){const _=Cr(this);_.headers[I]=g}return f.apply(this,arguments)}n.axiosInstances||(l.XMLHttpRequest.prototype.open=S,l.XMLHttpRequest.prototype.send=x,l.XMLHttpRequest.prototype.setRequestHeader=T)};u(window),n.axiosInstances&&n.axiosInstances.forEach(l=>{tf(t,l,n,a,c)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function vf(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(Ra(n,s,i))}else t.send(Ra(-1,-1,""))})}function wf(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(Ks(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const ai="/installation/javascript-sdk";function bf(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Vs}${ai}`),!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 ${Vs}${ai} for more information.`),!1;t.projectKey=t.projectID.toString(),Jt("`projectID` option","`projectKey` option",ai)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&Jt("`sessionToken` option","`sessionHash` start() option","/"),!0}const yf=()=>{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,p=this.options.ingestPoint||Xa;d.open("POST",p+"/v1/web/not-started"),d.send(JSON.stringify({trackerVersion:"14.0.14",projectKey:this.options.projectKey,doNotTrack:h,reason:l.length?`missing api: ${l.join(",")}`:u}))},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.handleError=(u,l={})=>{if(this.app!==null){if(u instanceof Error){const h=ei(u,[],l);this.app.send(h)}else if(u instanceof ErrorEvent||"PromiseRejectionEvent"in window&&u instanceof PromiseRejectionEvent){const h=el(u,void 0,l);h!=null&&this.app.send(h)}}},this.crossdomainMode=!!(wa()&&((a=e.crossdomain)!=null&&a.enabled)),!ft||!bf(e)){console.error("OpenReplay: tracker called in a non-browser environment or with invalid options");return}if(window.__OPENREPLAY__||!this.crossdomainMode&&wa()&&yf()&&((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 rd(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(Yd(r),od(r),ph(r,e),wf(r)),qd(r,e.mouse),Xd(r,this.crossdomainMode),Zd(r),Qd(r),ud(r,e),Td(r,e),Id(r),Ad(r,e),Kd(r,e),$d(r),ef(r),mf(r,e.network),vf(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 ${Vs}${ai}`),!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 Jt("'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){Jt("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send($u(e))}userAnonymousID(e){Jt("'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){Jt("'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(Qu(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(rh(e,n))}}}function _f(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 Nr(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 kf(t){return{recommendations:(t.recommendations||[]).filter(Boolean).map(Nr),hasMore:!!t.has_more}}class Tf{constructor(e,n="1"){G(this,$t,"https://api.wineater.com/");G(this,At);G(this,Jn);j(this,At,e),j(this,Jn,n)}async getInstantRecommendations(){try{const e=w(this,Jn)==="2"?"dish/recommendations/instant/v2":"dish/recommendations/instant",n=await fetch(`${w(this,$t)}${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(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(_f)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=w(this,Jn)==="2"?"dish/recommendations/search/v2":"dish/recommendations/search",s=await fetch(`${w(this,$t)}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(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(Nr)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getMoreWineRecommendations(e,n){try{const s=await fetch(`${w(this,$t)}dish/recommendations/search/v2/more`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(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 kf(i)}catch(s){throw new Error(`Error in getMoreWineRecommendations: ${s.message}`)}}async getSimilarWines(e){try{const n=await fetch(`${w(this,$t)}dish/recommendations/similar`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(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(Nr)}catch(n){throw new Error(`Error in getSimilarWines: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${w(this,$t)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w(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}}}$t=new WeakMap,At=new WeakMap,Jn=new WeakMap;const xf=((Tl=window==null?void 0:window.wineaterData)==null?void 0:Tl.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",vl=String(((xl=window==null?void 0:window.wineaterData)==null?void 0:xl.apiVersion)||"1"),ps=new Tf(xf,vl),Ue={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"},Ef={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 If(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 Cf={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:`
1
+ (function(Y,Z){typeof exports=="object"&&typeof module<"u"?module.exports=Z():typeof define=="function"&&define.amd?define(Z):(Y=typeof globalThis<"u"?globalThis:Y||self,Y.WineaterChatbot=Z())})(this,function(){"use strict";var pl=Object.defineProperty;var ho=Y=>{throw TypeError(Y)};var gl=(Y,Z,ie)=>Z in Y?pl(Y,Z,{enumerable:!0,configurable:!0,writable:!0,value:ie}):Y[Z]=ie;var ot=(Y,Z,ie)=>gl(Y,typeof Z!="symbol"?Z+"":Z,ie),qr=(Y,Z,ie)=>Z.has(Y)||ho("Cannot "+ie);var d=(Y,Z,ie)=>(qr(Y,Z,"read from private field"),ie?ie.call(Y):Z.get(Y)),F=(Y,Z,ie)=>Z.has(Y)?ho("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(Y):Z.set(Y,ie),D=(Y,Z,ie,wn)=>(qr(Y,Z,"write to private field"),wn?wn.call(Y,ie):Z.set(Y,ie),ie),te=(Y,Z,ie)=>(qr(Y,Z,"access private method"),ie);var io,fn,dn,Ft,qt,Rn,hn,vn,fe,Ur,Zt,Hr,vo,po,je,Fe,Nr,et,Ut,tt,qe,Te,nt,vt,Ct,Ht,Et,Gt,Tt,er,ve,ml,wl,Gr,ar,sr,Vr,Ze,rt,Ne,Vt,Wn,Bn,tr,Pt,pt,pn,oo,ao;const Y="5";typeof window<"u"&&((io=window.__svelte??(window.__svelte={})).v??(io.v=new Set)).add(Y);const Z=1,ie=2,wn=4,go=8,mo=16,wo=1,_o=2,bo=4,yo=8,xo=16,ko=1,So=2,ge=Symbol(),Co="http://www.w3.org/1999/xhtml",lr=!1;var ur=Array.isArray,Eo=Array.prototype.indexOf,cr=Array.from,To=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,Po=Object.getOwnPropertyDescriptors,Io=Object.prototype,Ao=Array.prototype,Kr=Object.getPrototypeOf,Yr=Object.isExtensible;function Do(e){for(var t=0;t<e.length;t++)e[t]()}function Zr(){var e,t,n=new Promise((r,i)=>{e=r,t=i});return{promise:n,resolve:e,reject:t}}const pe=2,fr=4,dr=8,at=16,st=32,Dt=64,On=128,Ge=512,me=1024,Se=2048,lt=4096,Ae=8192,ut=16384,hr=32768,Rt=65536,Qr=1<<17,Jr=1<<18,Jt=1<<19,Ro=1<<20,Wt=32768,vr=1<<21,pr=1<<22,wt=1<<23,Bt=Symbol("$state"),Wo=Symbol("legacy props"),Bo=Symbol(""),Xt=new class extends Error{constructor(){super(...arguments);ot(this,"name","StaleReactionError");ot(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function No(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Mo(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Lo(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function zo(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Oo(e){throw new Error("https://svelte.dev/e/effect_orphan")}function jo(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Fo(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function qo(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Uo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ho(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Go(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Vo(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ko(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Xr(e){return e===this.v}function Yo(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function $r(e){return!Yo(e,this.v)}let $t=!1,Zo=!1;function Qo(){$t=!0}let oe=null;function en(e){oe=e}function _t(e,t=!1,n){oe={p:oe,i:!1,c:null,e:null,s:e,x:null,l:$t&&!t?{s:null,u:null,$:[]}:null}}function bt(e){var t=oe,n=t.e;if(n!==null){t.e=null;for(var r of n)wi(r)}return e!==void 0&&(t.x=e),t.i=!0,oe=t.p,e??{}}function _n(){return!$t||oe!==null&&oe.l===null}let Nt=[];function ei(){var e=Nt;Nt=[],Do(e)}function tn(e){if(Nt.length===0&&!bn){var t=Nt;queueMicrotask(()=>{t===Nt&&ei()})}Nt.push(e)}function Jo(){for(;Nt.length>0;)ei()}function ti(e){var t=V;if(t===null)return q.f|=wt,e;if(t.f&hr)nn(e,t);else{if(!(t.f&On))throw e;t.b.error(e)}}function nn(e,t){for(;t!==null;){if(t.f&On)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e}const jn=new Set;let G=null,Fn=null,ae=null,Le=[],qn=null,gr=!1,bn=!1;const $n=class $n{constructor(){F(this,fe);ot(this,"committed",!1);ot(this,"current",new Map);ot(this,"previous",new Map);F(this,fn,new Set);F(this,dn,new Set);F(this,Ft,0);F(this,qt,0);F(this,Rn,null);F(this,hn,[]);F(this,vn,[]);ot(this,"skipped_effects",new Set);ot(this,"is_fork",!1)}is_deferred(){return this.is_fork||d(this,qt)>0}process(t){var r;Le=[],Fn=null,this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of t)te(this,fe,Ur).call(this,i,n);this.is_fork||te(this,fe,vo).call(this),this.is_deferred()?(te(this,fe,Zt).call(this,n.effects),te(this,fe,Zt).call(this,n.render_effects),te(this,fe,Zt).call(this,n.block_effects)):(Fn=this,G=null,ri(n.render_effects),ri(n.effects),Fn=null,(r=d(this,Rn))==null||r.resolve()),ae=null}capture(t,n){this.previous.has(t)||this.previous.set(t,n),t.f&wt||(this.current.set(t,t.v),ae==null||ae.set(t,t.v))}activate(){G=this,this.apply()}deactivate(){G===this&&(G=null,ae=null)}flush(){if(this.activate(),Le.length>0){if(ni(),G!==null&&G!==this)return}else d(this,Ft)===0&&this.process([]);this.deactivate()}discard(){for(const t of d(this,dn))t(this);d(this,dn).clear()}increment(t){D(this,Ft,d(this,Ft)+1),t&&D(this,qt,d(this,qt)+1)}decrement(t){D(this,Ft,d(this,Ft)-1),t&&D(this,qt,d(this,qt)-1),this.revive()}revive(){for(const t of d(this,hn))_e(t,Se),Mt(t);for(const t of d(this,vn))_e(t,lt),Mt(t);D(this,hn,[]),D(this,vn,[]),this.flush()}oncommit(t){d(this,fn).add(t)}ondiscard(t){d(this,dn).add(t)}settled(){return(d(this,Rn)??D(this,Rn,Zr())).promise}static ensure(){if(G===null){const t=G=new $n;jn.add(G),bn||$n.enqueue(()=>{G===t&&t.flush()})}return G}static enqueue(t){tn(t)}apply(){}};fn=new WeakMap,dn=new WeakMap,Ft=new WeakMap,qt=new WeakMap,Rn=new WeakMap,hn=new WeakMap,vn=new WeakMap,fe=new WeakSet,Ur=function(t,n){var v;t.f^=me;for(var r=t.first;r!==null;){var i=r.f,o=(i&(st|Dt))!==0,s=o&&(i&me)!==0,l=s||(i&Ae)!==0||this.skipped_effects.has(r);if(r.f&On&&((v=r.b)!=null&&v.is_pending())&&(n={parent:n,effect:r,effects:[],render_effects:[],block_effects:[]}),!l&&r.fn!==null){o?r.f^=me:i&fr?n.effects.push(r):Cn(r)&&(r.f&at&&n.block_effects.push(r),En(r));var a=r.first;if(a!==null){r=a;continue}}var c=r.parent;for(r=r.next;r===null&&c!==null;)c===n.effect&&(te(this,fe,Zt).call(this,n.effects),te(this,fe,Zt).call(this,n.render_effects),te(this,fe,Zt).call(this,n.block_effects),n=n.parent),r=c.next,c=c.parent}},Zt=function(t){for(const n of t)(n.f&Se?d(this,hn):d(this,vn)).push(n),te(this,fe,Hr).call(this,n.deps),_e(n,me)},Hr=function(t){if(t!==null)for(const n of t)!(n.f&pe)||!(n.f&Wt)||(n.f^=Wt,te(this,fe,Hr).call(this,n.deps))},vo=function(){if(d(this,qt)===0){for(const t of d(this,fn))t();d(this,fn).clear()}d(this,Ft)===0&&te(this,fe,po).call(this)},po=function(){var o;if(jn.size>1){this.previous.clear();var t=ae,n=!0,r={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const s of jn){if(s===this){n=!1;continue}const l=[];for(const[c,v]of this.current){if(s.current.has(c))if(n&&v!==s.current.get(c))s.current.set(c,v);else continue;l.push(c)}if(l.length===0)continue;const a=[...s.current.keys()].filter(c=>!this.current.has(c));if(a.length>0){var i=Le;Le=[];const c=new Set,v=new Map;for(const p of l)ii(p,a,c,v);if(Le.length>0){G=s,s.apply();for(const p of Le)te(o=s,fe,Ur).call(o,p,r);s.deactivate()}Le=i}}G=null,ae=t}this.committed=!0,jn.delete(this)};let ct=$n;function Xo(e){var t=bn;bn=!0;try{for(var n;;){if(Jo(),Le.length===0&&(G==null||G.flush(),Le.length===0))return qn=null,n;ni()}}finally{bn=t}}function ni(){var e=xt;gr=!0;var t=null;try{var n=0;for(Yn(!0);Le.length>0;){var r=ct.ensure();if(n++>1e3){var i,o;$o()}r.process(Le),yt.clear()}}finally{gr=!1,Yn(e),qn=null}}function $o(){try{jo()}catch(e){nn(e,qn)}}let Ve=null;function ri(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&(ut|Ae))&&Cn(r)&&(Ve=new Set,En(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?xi(r):r.fn=null),(Ve==null?void 0:Ve.size)>0)){yt.clear();for(const i of Ve){if(i.f&(ut|Ae))continue;const o=[i];let s=i.parent;for(;s!==null;)Ve.has(s)&&(Ve.delete(s),o.push(s)),s=s.parent;for(let l=o.length-1;l>=0;l--){const a=o[l];a.f&(ut|Ae)||En(a)}}Ve.clear()}}Ve=null}}function ii(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const o=i.f;o&pe?ii(i,t,n,r):o&(pr|at)&&!(o&Se)&&oi(i,t,r)&&(_e(i,Se),Mt(i))}}function oi(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(t.includes(i))return!0;if(i.f&pe&&oi(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function Mt(e){for(var t=qn=e;t.parent!==null;){t=t.parent;var n=t.f;if(gr&&t===V&&n&at&&!(n&Jr))return;if(n&(Dt|st)){if(!(n&me))return;t.f^=me}}Le.push(t)}function ea(e){let t=0,n=zt(0),r;return()=>{Vn()&&(u(n),xr(()=>(t===0&&(r=Tn(()=>e(()=>yn(n)))),t+=1,()=>{tn(()=>{t-=1,t===0&&(r==null||r(),r=void 0,yn(n))})})))}}var ta=Rt|Jt|On;function na(e,t,n){new ra(e,t,n)}class ra{constructor(t,n,r){F(this,ve);ot(this,"parent");F(this,je,!1);F(this,Fe);F(this,Nr,null);F(this,et);F(this,Ut);F(this,tt);F(this,qe,null);F(this,Te,null);F(this,nt,null);F(this,vt,null);F(this,Ct,null);F(this,Ht,0);F(this,Et,0);F(this,Gt,!1);F(this,Tt,null);F(this,er,ea(()=>(D(this,Tt,zt(d(this,Ht))),()=>{D(this,Tt,null)})));D(this,Fe,t),D(this,et,n),D(this,Ut,r),this.parent=V.b,D(this,je,!!d(this,et).pending),D(this,tt,Kn(()=>{V.b=this;{var i=te(this,ve,Gr).call(this);try{D(this,qe,ze(()=>r(i)))}catch(o){this.error(o)}d(this,Et)>0?te(this,ve,sr).call(this):D(this,je,!1)}return()=>{var o;(o=d(this,Ct))==null||o.remove()}},ta))}is_pending(){return d(this,je)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!d(this,et).pending}update_pending_count(t){te(this,ve,Vr).call(this,t),D(this,Ht,d(this,Ht)+t),d(this,Tt)&&on(d(this,Tt),d(this,Ht))}get_effect_pending(){return d(this,er).call(this),u(d(this,Tt))}error(t){var n=d(this,et).onerror;let r=d(this,et).failed;if(d(this,Gt)||!n&&!r)throw t;d(this,qe)&&(Ce(d(this,qe)),D(this,qe,null)),d(this,Te)&&(Ce(d(this,Te)),D(this,Te,null)),d(this,nt)&&(Ce(d(this,nt)),D(this,nt,null));var i=!1,o=!1;const s=()=>{if(i){Ko();return}i=!0,o&&Go(),ct.ensure(),D(this,Ht,0),d(this,nt)!==null&&sn(d(this,nt),()=>{D(this,nt,null)}),D(this,je,this.has_pending_snippet()),D(this,qe,te(this,ve,ar).call(this,()=>(D(this,Gt,!1),ze(()=>d(this,Ut).call(this,d(this,Fe)))))),d(this,Et)>0?te(this,ve,sr).call(this):D(this,je,!1)};var l=q;try{Ee(null),o=!0,n==null||n(t,s),o=!1}catch(a){nn(a,d(this,tt)&&d(this,tt).parent)}finally{Ee(l)}r&&tn(()=>{D(this,nt,te(this,ve,ar).call(this,()=>{ct.ensure(),D(this,Gt,!0);try{return ze(()=>{r(d(this,Fe),()=>t,()=>s)})}catch(a){return nn(a,d(this,tt).parent),null}finally{D(this,Gt,!1)}}))})}}je=new WeakMap,Fe=new WeakMap,Nr=new WeakMap,et=new WeakMap,Ut=new WeakMap,tt=new WeakMap,qe=new WeakMap,Te=new WeakMap,nt=new WeakMap,vt=new WeakMap,Ct=new WeakMap,Ht=new WeakMap,Et=new WeakMap,Gt=new WeakMap,Tt=new WeakMap,er=new WeakMap,ve=new WeakSet,ml=function(){try{D(this,qe,ze(()=>d(this,Ut).call(this,d(this,Fe))))}catch(t){this.error(t)}D(this,je,!1)},wl=function(){const t=d(this,et).pending;t&&(D(this,Te,ze(()=>t(d(this,Fe)))),ct.enqueue(()=>{var n=te(this,ve,Gr).call(this);D(this,qe,te(this,ve,ar).call(this,()=>(ct.ensure(),ze(()=>d(this,Ut).call(this,n))))),d(this,Et)>0?te(this,ve,sr).call(this):(sn(d(this,Te),()=>{D(this,Te,null)}),D(this,je,!1))}))},Gr=function(){var t=d(this,Fe);return d(this,je)&&(D(this,Ct,ft()),d(this,Fe).before(d(this,Ct)),t=d(this,Ct)),t},ar=function(t){var n=V,r=q,i=oe;$e(d(this,tt)),Ee(d(this,tt)),en(d(this,tt).ctx);try{return t()}catch(o){return ti(o),null}finally{$e(n),Ee(r),en(i)}},sr=function(){const t=d(this,et).pending;d(this,qe)!==null&&(D(this,vt,document.createDocumentFragment()),d(this,vt).append(d(this,Ct)),Ci(d(this,qe),d(this,vt))),d(this,Te)===null&&D(this,Te,ze(()=>t(d(this,Fe))))},Vr=function(t){var n;if(!this.has_pending_snippet()){this.parent&&te(n=this.parent,ve,Vr).call(n,t);return}D(this,Et,d(this,Et)+t),d(this,Et)===0&&(D(this,je,!1),d(this,Te)&&sn(d(this,Te),()=>{D(this,Te,null)}),d(this,vt)&&(d(this,Fe).before(d(this,vt)),D(this,vt,null)))};function rn(e,t){return t}function ia(e,t,n){for(var r=[],i=t.length,o=0;o<i;o++)kr(t[o].e,r,!0);ki(r,()=>{var s=r.length===0&&n!==null;if(s){var l=n,a=l.parentNode;pa(a),a.append(l),e.items.clear(),Je(e,t[0].prev,t[i-1].next)}for(var c=0;c<i;c++){var v=t[c];s||(e.items.delete(v.k),Je(e,v.prev,v.next)),Ce(v.e,!s)}e.first===t[0]&&(e.first=t[0].prev)})}function Lt(e,t,n,r,i,o=null){var s=e,l=new Map,a=null,c=(t&wn)!==0,v=(t&Z)!==0,p=(t&ie)!==0;if(c){var h=e;s=h.appendChild(ft())}var f=null,w=wr(()=>{var m=n();return ur(m)?m:m==null?[]:cr(m)}),y,_=!0;function b(){oa(j,y,s,t,r),f!==null&&(y.length===0?(f.fragment?(s.before(f.fragment),f.fragment=null):Sr(f.effect),I.first=f.effect):sn(f.effect,()=>{f=null}))}var I=Kn(()=>{y=u(w);for(var m=y.length,C=new Set,T=G,E=null,A=gi(),L=0;L<m;L+=1){var z=y[L],K=r(z,L),O=_?null:l.get(K);O?(v&&on(O.v,z),p?on(O.i,L):O.i=L,A&&T.skipped_effects.delete(O.e)):(O=aa(_?s:null,E,z,K,L,i,t,n),_&&(O.o=!0,E===null?a=O:E.next=O,E=O),l.set(K,O)),C.add(K)}if(m===0&&o&&!f)if(_)f={fragment:null,effect:ze(()=>o(s))};else{var de=document.createDocumentFragment(),he=ft();de.append(he),f={fragment:de,effect:ze(()=>o(he))}}if(!_)if(A){for(const[Pe,it]of l)C.has(Pe)||T.skipped_effects.add(it.e);T.oncommit(b),T.ondiscard(()=>{})}else b();u(w)}),j={effect:I,items:l,first:a};_=!1}function oa(e,t,n,r,i){var z,K,O,de;var o=(r&go)!==0,s=t.length,l=e.items,a=e.first,c,v=null,p,h=[],f=[],w,y,_,b;if(o)for(b=0;b<s;b+=1)w=t[b],y=i(w,b),_=l.get(y),(z=_.a)==null||z.measure(),(p??(p=new Set)).add(_);for(b=0;b<s;b+=1){if(w=t[b],y=i(w,b),_=l.get(y),e.first??(e.first=_),!_.o){_.o=!0;var I=v?v.next:a;Je(e,v,_),Je(e,_,I),mr(_,I,n),v=_,h=[],f=[],a=v.next;continue}if(_.e.f&Ae&&(Sr(_.e),o&&((K=_.a)==null||K.unfix(),(p??(p=new Set)).delete(_))),_!==a){if(c!==void 0&&c.has(_)){if(h.length<f.length){var j=f[0],m;v=j.prev;var C=h[0],T=h[h.length-1];for(m=0;m<h.length;m+=1)mr(h[m],j,n);for(m=0;m<f.length;m+=1)c.delete(f[m]);Je(e,C.prev,T.next),Je(e,v,C),Je(e,T,j),a=j,v=T,b-=1,h=[],f=[]}else c.delete(_),mr(_,a,n),Je(e,_.prev,_.next),Je(e,_,v===null?e.first:v.next),Je(e,v,_),v=_;continue}for(h=[],f=[];a!==null&&a.k!==y;)a.e.f&Ae||(c??(c=new Set)).add(a),f.push(a),a=a.next;if(a===null)continue;_=a}h.push(_),v=_,a=_.next}if(a!==null||c!==void 0){for(var E=c===void 0?[]:cr(c);a!==null;)a.e.f&Ae||E.push(a),a=a.next;var A=E.length;if(A>0){var L=r&wn&&s===0?n:null;if(o){for(b=0;b<A;b+=1)(O=E[b].a)==null||O.measure();for(b=0;b<A;b+=1)(de=E[b].a)==null||de.fix()}ia(e,E,L)}}o&&tn(()=>{var he;if(p!==void 0)for(_ of p)(he=_.a)==null||he.apply()})}function aa(e,t,n,r,i,o,s,l){var a=(s&Z)!==0,c=(s&mo)===0,v=a?c?fa(n,!1,!1):zt(n):n,p=s&ie?zt(i):i,h={i:p,v,k:r,a:null,e:null,o:!1,prev:t,next:null};try{if(e===null){var f=document.createDocumentFragment();f.append(e=ft())}return h.e=ze(()=>o(e,v,p,l)),t!==null&&(t.next=h),h}finally{}}function mr(e,t,n){for(var r=e.next?e.next.e.nodes_start:n,i=t?t.e.nodes_start:n,o=e.e.nodes_start;o!==null&&o!==r;){var s=xn(o);i.before(o),o=s}}function Je(e,t,n){t===null?(e.first=n,e.effect.first=n&&n.e):(t.e.next&&(t.e.next.prev=null),t.next=n,t.e.next=n&&n.e),n===null?e.effect.last=t&&t.e:(n.e.prev&&(n.e.prev.next=null),n.prev=t,n.e.prev=t&&t.e)}function sa(e,t,n,r){const i=_n()?Hn:wr;if(n.length===0&&e.length===0){r(t.map(i));return}var o=G,s=V,l=la();function a(){Promise.all(n.map(c=>ua(c))).then(c=>{l();try{r([...t.map(i),...c])}catch(v){s.f&ut||nn(v,s)}o==null||o.deactivate(),Un()}).catch(c=>{nn(c,s)})}e.length>0?Promise.all(e).then(()=>{l();try{return a()}finally{o==null||o.deactivate(),Un()}}):a()}function la(){var e=V,t=q,n=oe,r=G;return function(o=!0){$e(e),Ee(t),en(n),o&&(r==null||r.activate())}}function Un(){$e(null),Ee(null),en(null)}function Hn(e){var t=pe|Se,n=q!==null&&q.f&pe?q:null;return V!==null&&(V.f|=Jt),{ctx:oe,deps:null,effects:null,equals:Xr,f:t,fn:e,reactions:null,rv:0,v:ge,wv:0,parent:n??V,ac:null}}function ua(e,t){let n=V;n===null&&Mo();var r=n.b,i=void 0,o=zt(ge),s=!q,l=new Map;return ya(()=>{var h;var a=Zr();i=a.promise;try{Promise.resolve(e()).then(a.resolve,a.reject).then(()=>{c===G&&c.committed&&c.deactivate(),Un()})}catch(f){a.reject(f),Un()}var c=G;if(s){var v=!r.is_pending();r.update_pending_count(1),c.increment(v),(h=l.get(c))==null||h.reject(Xt),l.delete(c),l.set(c,a)}const p=(f,w=void 0)=>{if(c.activate(),w)w!==Xt&&(o.f|=wt,on(o,w));else{o.f&wt&&(o.f^=wt),on(o,f);for(const[y,_]of l){if(l.delete(y),y===c)break;_.reject(Xt)}}s&&(r.update_pending_count(-1),c.decrement(v))};a.promise.then(p,f=>p(null,f||"unknown"))}),yr(()=>{for(const a of l.values())a.reject(Xt)}),new Promise(a=>{function c(v){function p(){v===i?a(o):c(i)}v.then(p,p)}c(i)})}function ee(e){const t=Hn(e);return Ti(t),t}function wr(e){const t=Hn(e);return t.equals=$r,t}function ai(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Ce(t[n])}}function ca(e){for(var t=e.parent;t!==null;){if(!(t.f&pe))return t.f&ut?null:t;t=t.parent}return null}function _r(e){var t,n=V;$e(ca(e));try{e.f&=~Wt,ai(e),t=Ri(e)}finally{$e(n)}return t}function si(e){var t=_r(e);if(e.equals(t)||(G!=null&&G.is_fork||(e.v=t),e.wv=Ai()),!Ot)if(ae!==null)Vn()&&ae.set(e,t);else{var n=e.f&Ge?me:lt;_e(e,n)}}let br=new Set;const yt=new Map;let li=!1;function zt(e,t){var n={f:0,v:e,reactions:null,equals:Xr,rv:0,wv:0};return n}function Q(e,t){const n=zt(e);return Ti(n),n}function fa(e,t=!1,n=!0){var i;const r=zt(e);return t||(r.equals=$r),$t&&n&&oe!==null&&oe.l!==null&&((i=oe.l).s??(i.s=[])).push(r),r}function g(e,t,n=!1){q!==null&&(!Xe||q.f&Qr)&&_n()&&q.f&(pe|at|pr|Qr)&&!(be!=null&&be.includes(e))&&Ho();let r=n?Ke(t):t;return on(e,r)}function on(e,t){if(!e.equals(t)){var n=e.v;Ot?yt.set(e,t):yt.set(e,n),e.v=t;var r=ct.ensure();r.capture(e,n),e.f&pe&&(e.f&Se&&_r(e),_e(e,e.f&Ge?me:lt)),e.wv=Ai(),ci(e,Se),_n()&&V!==null&&V.f&me&&!(V.f&(st|Dt))&&(Oe===null?Sa([e]):Oe.push(e)),!r.is_fork&&br.size>0&&!li&&da()}return t}function da(){li=!1;var e=xt;Yn(!0);const t=Array.from(br);try{for(const n of t)n.f&me&&_e(n,lt),Cn(n)&&En(n)}finally{Yn(e)}br.clear()}function ui(e,t=1){var n=u(e),r=t===1?n++:n--;return g(e,n),r}function yn(e){g(e,e.v+1)}function ci(e,t){var n=e.reactions;if(n!==null)for(var r=_n(),i=n.length,o=0;o<i;o++){var s=n[o],l=s.f;if(!(!r&&s===V)){var a=(l&Se)===0;if(a&&_e(s,t),l&pe){var c=s;ae==null||ae.delete(c),l&Wt||(l&Ge&&(s.f|=Wt),ci(c,lt))}else a&&(l&at&&Ve!==null&&Ve.add(s),Mt(s))}}}function Ke(e){if(typeof e!="object"||e===null||Bt in e)return e;const t=Kr(e);if(t!==Io&&t!==Ao)return e;var n=new Map,r=ur(e),i=Q(0),o=jt,s=l=>{if(jt===o)return l();var a=q,c=jt;Ee(null),Ii(o);var v=l();return Ee(a),Ii(c),v};return r&&n.set("length",Q(e.length)),new Proxy(e,{defineProperty(l,a,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&qo();var v=n.get(a);return v===void 0?v=s(()=>{var p=Q(c.value);return n.set(a,p),p}):g(v,c.value,!0),!0},deleteProperty(l,a){var c=n.get(a);if(c===void 0){if(a in l){const v=s(()=>Q(ge));n.set(a,v),yn(i)}}else g(c,ge),yn(i);return!0},get(l,a,c){var f;if(a===Bt)return e;var v=n.get(a),p=a in l;if(v===void 0&&(!p||(f=Qt(l,a))!=null&&f.writable)&&(v=s(()=>{var w=Ke(p?l[a]:ge),y=Q(w);return y}),n.set(a,v)),v!==void 0){var h=u(v);return h===ge?void 0:h}return Reflect.get(l,a,c)},getOwnPropertyDescriptor(l,a){var c=Reflect.getOwnPropertyDescriptor(l,a);if(c&&"value"in c){var v=n.get(a);v&&(c.value=u(v))}else if(c===void 0){var p=n.get(a),h=p==null?void 0:p.v;if(p!==void 0&&h!==ge)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(l,a){var h;if(a===Bt)return!0;var c=n.get(a),v=c!==void 0&&c.v!==ge||Reflect.has(l,a);if(c!==void 0||V!==null&&(!v||(h=Qt(l,a))!=null&&h.writable)){c===void 0&&(c=s(()=>{var f=v?Ke(l[a]):ge,w=Q(f);return w}),n.set(a,c));var p=u(c);if(p===ge)return!1}return v},set(l,a,c,v){var j;var p=n.get(a),h=a in l;if(r&&a==="length")for(var f=c;f<p.v;f+=1){var w=n.get(f+"");w!==void 0?g(w,ge):f in l&&(w=s(()=>Q(ge)),n.set(f+"",w))}if(p===void 0)(!h||(j=Qt(l,a))!=null&&j.writable)&&(p=s(()=>Q(void 0)),g(p,Ke(c)),n.set(a,p));else{h=p.v!==ge;var y=s(()=>Ke(c));g(p,y)}var _=Reflect.getOwnPropertyDescriptor(l,a);if(_!=null&&_.set&&_.set.call(v,c),!h){if(r&&typeof a=="string"){var b=n.get("length"),I=Number(a);Number.isInteger(I)&&I>=b.v&&g(b,I+1)}yn(i)}return!0},ownKeys(l){u(i);var a=Reflect.ownKeys(l).filter(p=>{var h=n.get(p);return h===void 0||h.v!==ge});for(var[c,v]of n)v.v!==ge&&!(c in l)&&a.push(c);return a},setPrototypeOf(){Uo()}})}function fi(e){try{if(e!==null&&typeof e=="object"&&Bt in e)return e[Bt]}catch{}return e}function ha(e,t){return Object.is(fi(e),fi(t))}var di,hi,vi,pi;function va(){if(di===void 0){di=window,hi=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;vi=Qt(t,"firstChild").get,pi=Qt(t,"nextSibling").get,Yr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Yr(n)&&(n.__t=void 0)}}function ft(e=""){return document.createTextNode(e)}function an(e){return vi.call(e)}function xn(e){return pi.call(e)}function P(e,t){return an(e)}function we(e,t=!1){{var n=an(e);return n instanceof Comment&&n.data===""?xn(n):n}}function W(e,t=1,n=!1){let r=e;for(;t--;)r=xn(r);return r}function pa(e){e.textContent=""}function gi(){return!1}let mi=!1;function ga(){mi||(mi=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Gn(e){var t=q,n=V;Ee(null),$e(null);try{return e()}finally{Ee(t),$e(n)}}function ma(e,t,n,r=n){e.addEventListener(t,()=>Gn(n));const i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),ga()}function wa(e){V===null&&(q===null&&Oo(),zo()),Ot&&Lo()}function _a(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function dt(e,t,n){var r=V;r!==null&&r.f&Ae&&(e|=Ae);var i={ctx:oe,deps:null,nodes_start:null,nodes_end:null,f:e|Se|Ge,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{En(i),i.f|=hr}catch(l){throw Ce(i),l}else t!==null&&Mt(i);var o=i;if(n&&o.deps===null&&o.teardown===null&&o.nodes_start===null&&o.first===o.last&&!(o.f&Jt)&&(o=o.first,e&at&&e&Rt&&o!==null&&(o.f|=Rt)),o!==null&&(o.parent=r,r!==null&&_a(o,r),q!==null&&q.f&pe&&!(e&Dt))){var s=q;(s.effects??(s.effects=[])).push(o)}return i}function Vn(){return q!==null&&!Xe}function yr(e){const t=dt(dr,null,!1);return _e(t,me),t.teardown=e,t}function kn(e){wa();var t=V.f,n=!q&&(t&st)!==0&&(t&hr)===0;if(n){var r=oe;(r.e??(r.e=[])).push(e)}else return wi(e)}function wi(e){return dt(fr|Ro,e,!1)}function ba(e){ct.ensure();const t=dt(Dt|Jt,e,!0);return(n={})=>new Promise(r=>{n.outro?sn(t,()=>{Ce(t),r(void 0)}):(Ce(t),r(void 0))})}function _i(e){return dt(fr,e,!1)}function ya(e){return dt(pr|Jt,e,!0)}function xr(e,t=0){return dt(dr|t,e,!0)}function M(e,t=[],n=[],r=[]){sa(r,t,n,i=>{dt(dr,()=>e(...i.map(u)),!0)})}function Kn(e,t=0){var n=dt(at|t,e,!0);return n}function ze(e){return dt(st|Jt,e,!0)}function bi(e){var t=e.teardown;if(t!==null){const n=Ot,r=q;Ei(!0),Ee(null);try{t.call(null)}finally{Ei(n),Ee(r)}}}function yi(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&Gn(()=>{i.abort(Xt)});var r=n.next;n.f&Dt?n.parent=null:Ce(n,t),n=r}}function xa(e){for(var t=e.first;t!==null;){var n=t.next;t.f&st||Ce(t),t=n}}function Ce(e,t=!0){var n=!1;(t||e.f&Jr)&&e.nodes_start!==null&&e.nodes_end!==null&&(ka(e.nodes_start,e.nodes_end),n=!0),yi(e,t&&!n),Zn(e,0),_e(e,ut);var r=e.transitions;if(r!==null)for(const o of r)o.stop();bi(e);var i=e.parent;i!==null&&i.first!==null&&xi(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function ka(e,t){for(;e!==null;){var n=e===t?null:xn(e);e.remove(),e=n}}function xi(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function sn(e,t,n=!0){var r=[];kr(e,r,!0),ki(r,()=>{n&&Ce(e),t&&t()})}function ki(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var i of e)i.out(r)}else t()}function kr(e,t,n){if(!(e.f&Ae)){if(e.f^=Ae,e.transitions!==null)for(const s of e.transitions)(s.is_global||n)&&t.push(s);for(var r=e.first;r!==null;){var i=r.next,o=(r.f&Rt)!==0||(r.f&st)!==0&&(e.f&at)!==0;kr(r,t,o?n:!1),r=i}}}function Sr(e){Si(e,!0)}function Si(e,t){if(e.f&Ae){e.f^=Ae,e.f&me||(_e(e,Se),Mt(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&Rt)!==0||(n.f&st)!==0;Si(n,i?t:!1),n=r}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}function Ci(e,t){for(var n=e.nodes_start,r=e.nodes_end;n!==null;){var i=n===r?null:xn(n);t.append(n),n=i}}let xt=!1;function Yn(e){xt=e}let Ot=!1;function Ei(e){Ot=e}let q=null,Xe=!1;function Ee(e){q=e}let V=null;function $e(e){V=e}let be=null;function Ti(e){q!==null&&(be===null?be=[e]:be.push(e))}let ye=null,De=0,Oe=null;function Sa(e){Oe=e}let Pi=1,Sn=0,jt=Sn;function Ii(e){jt=e}function Ai(){return++Pi}function Cn(e){var t=e.f;if(t&Se)return!0;if(t&pe&&(e.f&=~Wt),t&lt){var n=e.deps;if(n!==null)for(var r=n.length,i=0;i<r;i++){var o=n[i];if(Cn(o)&&si(o),o.wv>e.wv)return!0}t&Ge&&ae===null&&_e(e,me)}return!1}function Di(e,t,n=!0){var r=e.reactions;if(r!==null&&!(be!=null&&be.includes(e)))for(var i=0;i<r.length;i++){var o=r[i];o.f&pe?Di(o,t,!1):t===o&&(n?_e(o,Se):o.f&me&&_e(o,lt),Mt(o))}}function Ri(e){var w;var t=ye,n=De,r=Oe,i=q,o=be,s=oe,l=Xe,a=jt,c=e.f;ye=null,De=0,Oe=null,q=c&(st|Dt)?null:e,be=null,en(e.ctx),Xe=!1,jt=++Sn,e.ac!==null&&(Gn(()=>{e.ac.abort(Xt)}),e.ac=null);try{e.f|=vr;var v=e.fn,p=v(),h=e.deps;if(ye!==null){var f;if(Zn(e,De),h!==null&&De>0)for(h.length=De+ye.length,f=0;f<ye.length;f++)h[De+f]=ye[f];else e.deps=h=ye;if(xt&&Vn()&&e.f&Ge)for(f=De;f<h.length;f++)((w=h[f]).reactions??(w.reactions=[])).push(e)}else h!==null&&De<h.length&&(Zn(e,De),h.length=De);if(_n()&&Oe!==null&&!Xe&&h!==null&&!(e.f&(pe|lt|Se)))for(f=0;f<Oe.length;f++)Di(Oe[f],e);return i!==null&&i!==e&&(Sn++,Oe!==null&&(r===null?r=Oe:r.push(...Oe))),e.f&wt&&(e.f^=wt),p}catch(y){return ti(y)}finally{e.f^=vr,ye=t,De=n,Oe=r,q=i,be=o,en(s),Xe=l,jt=a}}function Ca(e,t){let n=t.reactions;if(n!==null){var r=Eo.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}n===null&&t.f&pe&&(ye===null||!ye.includes(t))&&(_e(t,lt),t.f&Ge&&(t.f^=Ge,t.f&=~Wt),ai(t),Zn(t,0))}function Zn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Ca(e,n[r])}function En(e){var t=e.f;if(!(t&ut)){_e(e,me);var n=V,r=xt;V=e,xt=!0;try{t&at?xa(e):yi(e),bi(e);var i=Ri(e);e.teardown=typeof i=="function"?i:null,e.wv=Pi;var o;lr&&Zo&&e.f&Se&&e.deps}finally{xt=r,V=n}}}async function Ea(){await Promise.resolve(),Xo()}function u(e){var t=e.f,n=(t&pe)!==0;if(q!==null&&!Xe){var r=V!==null&&(V.f&ut)!==0;if(!r&&!(be!=null&&be.includes(e))){var i=q.deps;if(q.f&vr)e.rv<Sn&&(e.rv=Sn,ye===null&&i!==null&&i[De]===e?De++:ye===null?ye=[e]:ye.includes(e)||ye.push(e));else{(q.deps??(q.deps=[])).push(e);var o=e.reactions;o===null?e.reactions=[q]:o.includes(q)||o.push(q)}}}if(Ot){if(yt.has(e))return yt.get(e);if(n){var s=e,l=s.v;return(!(s.f&me)&&s.reactions!==null||Bi(s))&&(l=_r(s)),yt.set(s,l),l}}else n&&!(ae!=null&&ae.has(e))&&(s=e,Cn(s)&&si(s),xt&&Vn()&&!(s.f&Ge)&&Wi(s));if(ae!=null&&ae.has(e))return ae.get(e);if(e.f&wt)throw e.v;return e.v}function Wi(e){if(e.deps!==null){e.f^=Ge;for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),t.f&pe&&!(t.f&Ge)&&Wi(t)}}function Bi(e){if(e.v===ge)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(yt.has(t)||t.f&pe&&Bi(t))return!0;return!1}function Tn(e){var t=Xe;try{return Xe=!0,e()}finally{Xe=t}}const Ta=-7169;function _e(e,t){e.f=e.f&Ta|t}const Ni=new Set,Cr=new Set;function Pa(e,t,n,r={}){function i(o){if(r.capture||Pn.call(t,o),!o.cancelBubble)return Gn(()=>n==null?void 0:n.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?tn(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function ht(e,t,n,r,i){var o={capture:r,passive:i},s=Pa(e,t,n,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&yr(()=>{t.removeEventListener(e,s,o)})}function Qn(e){for(var t=0;t<e.length;t++)Ni.add(e[t]);for(var n of Cr)n(e)}let Mi=null;function Pn(e){var _;var t=this,n=t.ownerDocument,r=e.type,i=((_=e.composedPath)==null?void 0:_.call(e))||[],o=i[0]||e.target;Mi=e;var s=0,l=Mi===e&&e.__root;if(l){var a=i.indexOf(l);if(a!==-1&&(t===document||t===window)){e.__root=t;return}var c=i.indexOf(t);if(c===-1)return;a<=c&&(s=a)}if(o=i[s]||e.target,o!==t){To(e,"currentTarget",{configurable:!0,get(){return o||n}});var v=q,p=V;Ee(null),$e(null);try{for(var h,f=[];o!==null;){var w=o.assignedSlot||o.parentNode||o.host||null;try{var y=o["__"+r];y!=null&&(!o.disabled||e.target===o)&&y.call(o,e)}catch(b){h?f.push(b):h=b}if(e.cancelBubble||w===t||w===null)break;o=w}if(h){for(let b of f)queueMicrotask(()=>{throw b});throw h}}finally{e.__root=t,delete e.currentTarget,Ee(v),$e(p)}}}function Li(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function In(e,t){var n=V;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function B(e,t){var n=(t&ko)!==0,r=(t&So)!==0,i,o=!e.startsWith("<!>");return()=>{i===void 0&&(i=Li(o?e:"<!>"+e),n||(i=an(i)));var s=r||hi?document.importNode(i,!0):i.cloneNode(!0);if(n){var l=an(s),a=s.lastChild;In(l,a)}else In(s,s);return s}}function Ia(e,t,n="svg"){var r=!e.startsWith("<!>"),i=`<${n}>${r?e:"<!>"+e}</${n}>`,o;return()=>{if(!o){var s=Li(i),l=an(s);o=an(l)}var a=o.cloneNode(!0);return In(a,a),a}}function Jn(e,t){return Ia(e,t,"svg")}function ln(e=""){{var t=ft(e+"");return In(t,t),t}}function Ye(){var e=document.createDocumentFragment(),t=document.createComment(""),n=ft();return e.append(t,n),In(t,n),e}function S(e,t){e!==null&&e.before(t)}const Aa=["touchstart","touchmove"];function Da(e){return Aa.includes(e)}function U(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function Ra(e,t){return Wa(e,t)}const un=new Map;function Wa(e,{target:t,anchor:n,props:r={},events:i,context:o,intro:s=!0}){va();var l=new Set,a=p=>{for(var h=0;h<p.length;h++){var f=p[h];if(!l.has(f)){l.add(f);var w=Da(f);t.addEventListener(f,Pn,{passive:w});var y=un.get(f);y===void 0?(document.addEventListener(f,Pn,{passive:w}),un.set(f,1)):un.set(f,y+1)}}};a(cr(Ni)),Cr.add(a);var c=void 0,v=ba(()=>{var p=n??t.appendChild(ft());return na(p,{pending:()=>{}},h=>{if(o){_t({});var f=oe;f.c=o}i&&(r.$$events=i),c=e(h,r)||{},o&&bt()}),()=>{var w;for(var h of l){t.removeEventListener(h,Pn);var f=un.get(h);--f===0?(document.removeEventListener(h,Pn),un.delete(h)):un.set(h,f)}Cr.delete(a),p!==n&&((w=p.parentNode)==null||w.removeChild(p))}});return Ba.set(c,v),c}let Ba=new WeakMap;class zi{constructor(t,n=!0){ot(this,"anchor");F(this,Ze,new Map);F(this,rt,new Map);F(this,Ne,new Map);F(this,Vt,new Set);F(this,Wn,!0);F(this,Bn,()=>{var t=G;if(d(this,Ze).has(t)){var n=d(this,Ze).get(t),r=d(this,rt).get(n);if(r)Sr(r),d(this,Vt).delete(n);else{var i=d(this,Ne).get(n);i&&(d(this,rt).set(n,i.effect),d(this,Ne).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[o,s]of d(this,Ze)){if(d(this,Ze).delete(o),o===t)break;const l=d(this,Ne).get(s);l&&(Ce(l.effect),d(this,Ne).delete(s))}for(const[o,s]of d(this,rt)){if(o===n||d(this,Vt).has(o))continue;const l=()=>{if(Array.from(d(this,Ze).values()).includes(o)){var c=document.createDocumentFragment();Ci(s,c),c.append(ft()),d(this,Ne).set(o,{effect:s,fragment:c})}else Ce(s);d(this,Vt).delete(o),d(this,rt).delete(o)};d(this,Wn)||!r?(d(this,Vt).add(o),sn(s,l,!1)):l()}}});F(this,tr,t=>{d(this,Ze).delete(t);const n=Array.from(d(this,Ze).values());for(const[r,i]of d(this,Ne))n.includes(r)||(Ce(i.effect),d(this,Ne).delete(r))});this.anchor=t,D(this,Wn,n)}ensure(t,n){var r=G,i=gi();if(n&&!d(this,rt).has(t)&&!d(this,Ne).has(t))if(i){var o=document.createDocumentFragment(),s=ft();o.append(s),d(this,Ne).set(t,{effect:ze(()=>n(s)),fragment:o})}else d(this,rt).set(t,ze(()=>n(this.anchor)));if(d(this,Ze).set(r,t),i){for(const[l,a]of d(this,rt))l===t?r.skipped_effects.delete(a):r.skipped_effects.add(a);for(const[l,a]of d(this,Ne))l===t?r.skipped_effects.delete(a.effect):r.skipped_effects.add(a.effect);r.oncommit(d(this,Bn)),r.ondiscard(d(this,tr))}else d(this,Bn).call(this)}}Ze=new WeakMap,rt=new WeakMap,Ne=new WeakMap,Vt=new WeakMap,Wn=new WeakMap,Bn=new WeakMap,tr=new WeakMap;function Er(e){oe===null&&No(),$t&&oe.l!==null?Na(oe).m.push(e):kn(()=>{const t=Tn(e);if(typeof t=="function")return t})}function Na(e){var t=e.l;return t.u??(t.u={a:[],b:[],m:[]})}function H(e,t,n=!1){var r=new zi(e),i=n?Rt:0;function o(s,l){r.ensure(s,l)}Kn(()=>{var s=!1;t((l,a=!0)=>{s=!0,o(a,l)}),s||o(!1,null)},i)}function Oi(e,t,n,r,i){var l;var o=(l=t.$$slots)==null?void 0:l[n],s=!1;o===!0&&(o=t.children,s=!0),o===void 0||o(e,s?()=>r:r)}function ji(e,t,n){var r=new zi(e);Kn(()=>{var i=t()??null;r.ensure(i,i&&(o=>n(o,i)))},Rt)}function kt(e,t){_i(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,r.appendChild(i)}})}function Fi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ma(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fi(e))&&(r&&(r+=" "),r+=t);return r}function cn(e){return typeof e=="object"?Ma(e):e??""}function La(e,t,n){var r=e==null?"":""+e;return t&&(r=r?r+" "+t:t),r===""?null:r}function St(e,t,n,r,i,o){var s=e.__className;if(s!==n||s===void 0){var l=La(n,r);l==null?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l),e.__className=n}return o}function qi(e,t,n=!1){if(e.multiple){if(t==null)return;if(!ur(t))return Vo();for(var r of e.options)r.selected=t.includes(Ui(r));return}for(r of e.options){var i=Ui(r);if(ha(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function za(e){var t=new MutationObserver(()=>{qi(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),yr(()=>{t.disconnect()})}function Ui(e){return"__value"in e?e.__value:e.value}const Oa=Symbol("is custom element"),ja=Symbol("is html");function Fa(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ce(e,t,n,r){var i=qa(e);i[t]!==(i[t]=n)&&(t==="loading"&&(e[Bo]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Ua(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function qa(e){return e.__attributes??(e.__attributes={[Oa]:e.nodeName.includes("-"),[ja]:e.namespaceURI===Co})}var Hi=new Map;function Ua(e){var t=e.getAttribute("is")||e.nodeName,n=Hi.get(t);if(n)return n;Hi.set(t,n=[]);for(var r,i=e,o=Element.prototype;o!==i;){r=Po(i);for(var s in r)r[s].set&&n.push(s);i=Kr(i)}return n}function Ha(e,t,n=t){var r=new WeakSet;ma(e,"input",async i=>{var o=i?e.defaultValue:e.value;if(o=Tr(e)?Pr(o):o,n(o),G!==null&&r.add(G),await Ea(),o!==(o=t())){var s=e.selectionStart,l=e.selectionEnd,a=e.value.length;if(e.value=o??"",l!==null){var c=e.value.length;s===l&&l===a&&c>a?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=s,e.selectionEnd=Math.min(l,c))}}}),Tn(t)==null&&e.value&&(n(Tr(e)?Pr(e.value):e.value),G!==null&&r.add(G)),xr(()=>{var i=t();if(e===document.activeElement){var o=Fn??G;if(r.has(o))return}Tr(e)&&i===Pr(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function Tr(e){var t=e.type;return t==="number"||t==="range"}function Pr(e){return e===""?null:+e}function Gi(e,t){return e===t||(e==null?void 0:e[Bt])===t}function Ga(e={},t,n,r){return _i(()=>{var i,o;return xr(()=>{i=o,o=[],Tn(()=>{e!==n(...o)&&(t(e,...o),i&&Gi(n(...i),e)&&t(null,...i))})}),()=>{tn(()=>{o&&Gi(n(...o),e)&&t(null,...o)})}}),e}let Xn=!1;function Va(e){var t=Xn;try{return Xn=!1,[e(),Xn]}finally{Xn=t}}function Re(e,t,n,r){var j;var i=!$t||(n&_o)!==0,o=(n&yo)!==0,s=(n&xo)!==0,l=r,a=!0,c=()=>(a&&(a=!1,l=s?Tn(r):r),l),v;if(o){var p=Bt in e||Wo in e;v=((j=Qt(e,t))==null?void 0:j.set)??(p&&t in e?m=>e[t]=m:void 0)}var h,f=!1;o?[h,f]=Va(()=>e[t]):h=e[t],h===void 0&&r!==void 0&&(h=c(),v&&(i&&Fo(),v(h)));var w;if(i?w=()=>{var m=e[t];return m===void 0?c():(a=!0,m)}:w=()=>{var m=e[t];return m!==void 0&&(l=void 0),m===void 0?l:m},i&&!(n&bo))return w;if(v){var y=e.$$legacy;return function(m,C){return arguments.length>0?((!i||!C||y||f)&&v(C?w():m),m):w()}}var _=!1,b=(n&wo?Hn:wr)(()=>(_=!1,w()));o&&u(b);var I=V;return function(m,C){if(arguments.length>0){const T=C?u(b):i&&o?Ke(m):m;return g(b,T),_=!0,l!==void 0&&(l=T),m}return Ot&&_||I.f&ut?b.v:u(b)}}function Vi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Ir(e,t,n){let r="";if(n){const i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3),r="; expires="+i.toUTCString()}document.cookie=e+"="+(t||"")+r+"; path=/; secure; samesite=strict"}function Ar(e){const t=e+"=",n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null}function Ki(){const e="uniqueUserID";let t=Ar(e);return t||(t=Vi(),Ir(e,t,365)),t}function We(e,t,n={},r={}){const i="https://admin-api.wineater.com/api/widget-events";let o=Ar("uniqueUserID");o||(o=Ki());const s={user_agent:navigator.userAgent,screen_width:window.screen.width,screen_height:window.screen.height,language:navigator.language,platform:navigator.platform},l=new Date().toISOString();let a=Ar("sessionID");a||(a=Vi(),Ir("sessionID",a,1));const c={event_type:e,store_id:t,session_id:a,event_time:l,data:n,meta:{...r,user_id:o},device_info:s,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(c)}).then(v=>v.ok?v.json():v.json().then(p=>{throw new Error(p.message||"Failed to track widget event")})).catch(v=>{throw console.error("Widget event tracking error:",v),v})}function Ka(e){return{id:String(e.ID),appellation:e.Appellation||null,country:e.Country||null,grape:e.Grape,image:e.Image,price:Number(e.Price),producer:e.Producer||null,region:e.Region,score:e.Score?Number(e.Score):null,shortDescription:e["Short Description"]||null,store:e.Store,storeId:e.Store_id||null,tags:Array.isArray(e.Tags)?e.Tags.map(String):[],title:e.Title,type:e.Type,url:e.Url||null,vintage:e.Vintage?Number(e.Vintage):null,pairingRecommendation:e.pairing_recommendation||null,total:e.Total?Number(e.Total):null,itemId:e.item_id||null,isPromote:e.is_promote?!!e.is_promote:null,stock:e.stock?Number(e.stock):null,byTheGlass:!!e.by_the_glass,glassPrice:e.glass_price!=null?Number(e.glass_price):null}}function Dr(e){return{id:String(e.id),title:String(e.title),description:String(e.description),region:String(e.region),price:Number(e.price),grape:String(e.grape),appellation:e.appellation?String(e.appellation):null,url:e.url?String(e.url):null,store:String(e.store),storeId:e.storeId?String(e.storeId):null,image:String(e.image),country:e.country?String(e.country):null,vintage:e.vintage?Number(e.vintage):null,tags:Array.isArray(e.tags)?e.tags.map(String):[],score:e.score?Number(e.score):null,total:e.total?Number(e.total):null,isPromote:e.is_promote?!!e.is_promote:null,stock:e.stock?Number(e.stock):null,distance:Number(e.distance),reason:String(e.reason),type:String(e.type),byTheGlass:!!e.by_the_glass,glassPrice:e.glass_price!=null?Number(e.glass_price):null}}function Ya(e){return{recommendations:(e.recommendations||[]).filter(Boolean).map(Dr),hasMore:!!e.has_more}}class Za{constructor(t,n="1"){F(this,Pt,"https://api.wineater.com/");F(this,pt);F(this,pn);D(this,pt,t),D(this,pn,n)}async getInstantRecommendations(){try{const t=d(this,pn)==="2"?"dish/recommendations/instant/v2":"dish/recommendations/instant",n=await fetch(`${d(this,Pt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d(this,pt)}`}}),r=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${r.message||"No additional error information"}`);return r.filter(Boolean).map(Ka)}catch(t){throw new Error(`Error in getInstantRecommendations: ${t.message}`)}}async getWineRecommendationsSearch(t){try{const n=d(this,pn)==="2"?"dish/recommendations/search/v2":"dish/recommendations/search",r=await fetch(`${d(this,Pt)}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d(this,pt)}`},body:JSON.stringify({text:t})}),i=await r.json();if(!r.ok)throw new Error(`API call failed with status ${r.status}: ${i.message||"No additional error information"}`);return i.filter(Boolean).map(Dr)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getMoreWineRecommendations(t,n){try{const r=await fetch(`${d(this,Pt)}dish/recommendations/search/v2/more`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d(this,pt)}`},body:JSON.stringify({text:t,exclude_ids:n})}),i=await r.json();if(!r.ok)throw new Error(`API call failed with status ${r.status}: ${i.message||"No additional error information"}`);return Ya(i)}catch(r){throw new Error(`Error in getMoreWineRecommendations: ${r.message}`)}}async getSimilarWines(t){try{const n=await fetch(`${d(this,Pt)}dish/recommendations/similar`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d(this,pt)}`},body:JSON.stringify({id:t})}),r=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${r.message||"No additional error information"}`);return r.filter(Boolean).map(Dr)}catch(n){throw new Error(`Error in getSimilarWines: ${n.message}`)}}async getStoreConfig(){try{const t=await fetch(`${d(this,Pt)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d(this,pt)}`}});if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return await t.json()}catch(t){throw console.error("Error fetching store configuration:",t),t}}}Pt=new WeakMap,pt=new WeakMap,pn=new WeakMap;const Yi=((oo=window==null?void 0:window.wineaterData)==null?void 0:oo.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",Rr=String(((ao=window==null?void 0:window.wineaterData)==null?void 0:ao.apiVersion)||"1"),An=new Za(Yi,Rr);function Qa(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return(t>>>0).toString(36)}const Zi=`${Qa(Yi)}:${Rr}`,Qi="wineater:v1:";function Ji(e,t){try{const n=window.localStorage.getItem(Qi+e);if(!n)return null;const r=JSON.parse(n);return Date.now()-r.savedAt>t?null:r.value}catch{return null}}function Xi(e,t){try{const n={savedAt:Date.now(),value:t};window.localStorage.setItem(Qi+e,JSON.stringify(n))}catch{}}const Be={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"},Ja={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 Xa(e){return{id:String(e.id),lang:e.lang,available_languages:e.available_languages?e.available_languages:[e.lang],open_ai_key:e.open_ai_key??null,currency:e.currency,title:e.title}}const $a={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
2
  @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;600;700&display=swap');
21
3
  :root { --wineater-font-primary: 'Roboto', sans-serif; }
22
4
  #wr-Custom {
@@ -117,13 +99,13 @@ We appreciate your time and valuable input.`),r=X("div","end_button_or",La,"Subm
117
99
  background-color: #8bae98;
118
100
  }
119
101
  }
120
- `}};function Nf(t){const e={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
102
+ `}};function es(e){const t={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
121
103
  @import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
122
104
  :root { --wineater-font-primary: 'Bricolage Grotesque', serif; }
123
- `},n=Cf[t]||{};return{...e,...n}}let de=ot({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const me={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(de==null?void 0:de.currentLanguage)??"en"},getStoreLanguage(){var t;return((t=de.storeConfig)==null?void 0:t.lang)??null},getApiKey(){var t;return((t=de.storeConfig)==null?void 0:t.open_ai_key)??null},getStoreId(){var t;return((t=de.storeConfig)==null?void 0:t.id)??null},setStoreLanguage(t){if(de.storeConfig&&de.storeConfig.available_languages.includes(t)){de.currentLanguage=t;const e=new URLSearchParams(window.location.search);e.set("lang",t);const n=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",n)}else throw new Error(`Language ${t} is not available in store configuration.`)},getSupportedLanguages(){var t;return((t=de.storeConfig)==null?void 0:t.available_languages)??["en"]},getCurrency(){var t;return((t=de.storeConfig)==null?void 0:t.currency)??"USD"},async initializeStore(){try{const t=await ps.getStoreConfig();de.storeConfig=If(t),de.currentLanguage=de.storeConfig.lang;const e=this.getLanguageFromURL();e&&de.storeConfig.available_languages.includes(e)?this.setStoreLanguage(e):this.setStoreLanguage(de.storeConfig.lang),this.setUiConfig(Nf(de.storeConfig.id)),de.isConfigLoaded=!0}catch(t){console.error("Failed to initialize store:",t),de.isConfigLoaded=!1}},isInitialized(){return de.isConfigLoaded},getUiConfig(){return de.uiConfig},setUiConfig(t){de.uiConfig=t}},Rf={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 Df(t,e,n="en"){try{return new Intl.NumberFormat(Rf[n]||"en-US",{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).format(t)}catch{return t.toString()}}function be({key:t,lang:e}){const n=Ef,s=me.getUiConfig(),i=(s==null?void 0:s.translations)||{};if(i[e]&&i[e][t])return i[e][t];if(n[e]&&n[e][t])return n[e][t];throw new Error(`Translation for key "${t}" not found in language "${e}".`)}async function Af({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(([p,f])=>({key:p,text:f})),a=`
105
+ `},n=$a[e]||{};return{...t,...n}}const ts=24*60*60*1e3;let ne=Ke({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const se={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(ne==null?void 0:ne.currentLanguage)??"en"},getStoreLanguage(){var e;return((e=ne.storeConfig)==null?void 0:e.lang)??null},getApiKey(){var e;return((e=ne.storeConfig)==null?void 0:e.open_ai_key)??null},getStoreId(){var e;return((e=ne.storeConfig)==null?void 0:e.id)??null},setStoreLanguage(e){if(ne.storeConfig&&ne.storeConfig.available_languages.includes(e)){ne.currentLanguage=e;const t=new URLSearchParams(window.location.search);t.set("lang",e);const n=`${window.location.pathname}?${t.toString()}`;window.history.replaceState({},"",n)}else throw new Error(`Language ${e} is not available in store configuration.`)},getSupportedLanguages(){var e;return((e=ne.storeConfig)==null?void 0:e.available_languages)??["en"]},getCurrency(){var e;return((e=ne.storeConfig)==null?void 0:e.currency)??"USD"},applyStoreConfig(e){ne.storeConfig=Xa(e),ne.currentLanguage=ne.storeConfig.lang;const t=this.getLanguageFromURL();t&&ne.storeConfig.available_languages.includes(t)?this.setStoreLanguage(t):this.setStoreLanguage(ne.storeConfig.lang),this.setUiConfig(es(ne.storeConfig.id)),ne.isConfigLoaded=!0},async initializeStore(){const e=`${Zi}:store-config`,t=async()=>{const n=await An.getStoreConfig();return Xi(e,n),n};try{const n=Ji(e,ts);if(n)try{this.applyStoreConfig(n),t().catch(()=>{});return}catch(r){console.warn("Ignoring invalid cached store config:",r)}this.applyStoreConfig(await t())}catch(n){console.error("Failed to initialize store:",n),ne.isConfigLoaded=!1}},isInitialized(){return ne.isConfigLoaded},getUiConfig(){return ne.uiConfig},setUiConfig(e){ne.uiConfig=e}},ns={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 rs(e,t,n="en"){try{return new Intl.NumberFormat(ns[n]||"en-US",{style:"currency",currency:t,currencyDisplay:"narrowSymbol"}).format(e)}catch{return e.toString()}}function le({key:e,lang:t}){const n=Ja,r=se.getUiConfig(),i=(r==null?void 0:r.translations)||{};if(i[t]&&i[t][e])return i[t][e];if(n[t]&&n[t][e])return n[t][e];throw new Error(`Translation for key "${e}" not found in language "${t}".`)}async function is({sourceLang:e,targetLang:t,texts:n,apiKey:r}){var c,v,p,h;if(!r||!e||!t||e===t)return n;const i="https://api.openai.com/v1/chat/completions",o={"Content-Type":"application/json",Authorization:`Bearer ${r}`},s=Object.entries(n).map(([f,w])=>({key:f,text:w})),l=`
124
106
  You are a professional translator.
125
107
 
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}".
108
+ The input texts are written in language with code "${e}". Your task is to translate them strictly to the target language with code "${t}".
127
109
 
128
110
  ⚠️ DO NOT leave the original text.
129
111
  ⚠️ DO NOT skip any entry.
@@ -144,32 +126,36 @@ Output:
144
126
  ]
145
127
 
146
128
  Now translate the following input:
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 f=await(await fetch(i,{method:"POST",headers:r,body:c})).json(),m=(d=(h=(l=(u=f==null?void 0:f.choices)==null?void 0:u[0])==null?void 0:l.message)==null?void 0:h.content)==null?void 0:d.trim();if(!m)throw new Error("No response from OpenAI");const S=JSON.parse(m),x={};return S.forEach(T=>{T.key&&T.text!==void 0&&(x[T.key]=T.text)}),{...n,...x}}catch(p){return console.error("Error translating texts:",p),n}}uc();var Mf=As('<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 wl(t,e){let n=ze(e,"className",8,""),s=ze(e,"size",8,20);var i=Mf();H(()=>{Kt(i,0,An(n())),Re(i,"width",s()),Re(i,"height",s())}),M(t,i)}var Of=As('<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 bl(t,e){let n=ze(e,"className",8,""),s=ze(e,"size",8,20);var i=Of();H(()=>{Kt(i,0,An(n())),Re(i,"width",s()),Re(i,"height",s())}),M(t,i)}var Pf=As('<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 Rr(t,e){let n=ze(e,"className",8,""),s=ze(e,"size",8,20);var i=Pf();H(()=>{Kt(i,0,An(n())),Re(i,"width",s()),Re(i,"height",s())}),M(t,i)}var Lf=As('<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 yl(t,e){let n=ze(e,"className",8,""),s=ze(e,"size",8,20);var i=Lf();H(()=>{Kt(i,0,An(n())),Re(i,"width",s()),Re(i,"height",s())}),M(t,i)}var Bf=q('<span><!></span><span class="wr-Header-label svelte-oiwvqb"> </span>',1),Ff=q('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),Wf=q('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),zf=q('<h1 class="wr-Header-title svelte-oiwvqb"></h1>'),jf=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>'),Uf=q('<div class="wr-Header"><!></div>');const Hf={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;
129
+ ${JSON.stringify(s,null,2)}
130
+ `,a=JSON.stringify({model:"gpt-3.5-turbo",messages:[{role:"system",content:"You are a professional translator."},{role:"user",content:l}],temperature:.2,max_tokens:1e3});try{const w=await(await fetch(i,{method:"POST",headers:o,body:a})).json(),y=(h=(p=(v=(c=w==null?void 0:w.choices)==null?void 0:c[0])==null?void 0:v.message)==null?void 0:p.content)==null?void 0:h.trim();if(!y)throw new Error("No response from OpenAI");const _=JSON.parse(y),b={};return _.forEach(I=>{I.key&&I.text!==void 0&&(b[I.key]=I.text)}),{...n,...b}}catch(f){return console.error("Error translating texts:",f),n}}Qo();var os=Jn('<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 $i(e,t){let n=Re(t,"className",8,""),r=Re(t,"size",8,20);var i=os();M(()=>{St(i,0,cn(n())),ce(i,"width",r()),ce(i,"height",r())}),S(e,i)}var as=Jn('<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 eo(e,t){let n=Re(t,"className",8,""),r=Re(t,"size",8,20);var i=as();M(()=>{St(i,0,cn(n())),ce(i,"width",r()),ce(i,"height",r())}),S(e,i)}var ss=Jn('<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 Wr(e,t){let n=Re(t,"className",8,""),r=Re(t,"size",8,20);var i=ss();M(()=>{St(i,0,cn(n())),ce(i,"width",r()),ce(i,"height",r())}),S(e,i)}var ls=Jn('<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 to(e,t){let n=Re(t,"className",8,""),r=Re(t,"size",8,20);var i=ls();M(()=>{St(i,0,cn(n())),ce(i,"width",r()),ce(i,"height",r())}),S(e,i)}var us=B('<span><!></span><span class="wr-Header-label svelte-oiwvqb"> </span>',1),cs=B('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),fs=B('<!><span class="wr-Header-label svelte-oiwvqb"> </span>',1),ds=B('<h1 class="wr-Header-title svelte-oiwvqb"></h1>'),hs=B('<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>'),vs=B('<div class="wr-Header"><!></div>');const ps={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
131
 
150
132
  /* 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
133
 
152
134
  @media screen and (max-width: 768px) {.wr-Header-title.svelte-oiwvqb {display:none;}
153
- }`};function qf(t,e){Ft(e,!0),Gt(t,Hf);let n=oe(()=>me.getAppLanguage()),s=oe(()=>me.getUiConfig()),i=oe(()=>{var d,p;return((d=window==null?void 0:window.wineaterData)==null?void 0:d.TITLE_TEXT)||((p=v(s))==null?void 0:p.titleText)||null}),r=re(ot(Rr));function o(d){return d.split(/(meal|mood|occasion)/gi).map(p=>({keyword:/^(meal|mood|occasion)$/i.test(p)?p.toLowerCase():null,text:p}))}let a=oe(()=>v(i)?o(v(i)):null);var c=Uf(),u=O(c);{var l=d=>{var p=zf();Dn(p,21,()=>v(a),Rn,(f,m)=>{var S=Ms(),x=xt(S);{var T=E=>{var b=Bf(),y=xt(b),k=O(y);jo(k,()=>v(r),(F,Q)=>{Q(F,{className:"wr-Header-icon",size:"28"})});var P=W(y),V=O(P);H(()=>Y(V,v(m).text)),It("mouseenter",y,()=>C(r,yl,!0)),It("mouseleave",y,()=>C(r,Rr,!0)),M(E,b)},I=E=>{var b=Ff(),y=xt(b);bl(y,{className:"wr-Header-icon",size:"28"});var k=W(y),P=O(k);H(()=>Y(P,v(m).text)),M(E,b)},g=E=>{var b=Wf(),y=xt(b);wl(y,{className:"wr-Header-icon",size:"28"});var k=W(y),P=O(k);H(()=>Y(P,v(m).text)),M(E,b)},_=E=>{var b=Nn();H(()=>Y(b,v(m).text)),M(E,b)};ae(x,E=>{v(m).keyword==="meal"?E(T):v(m).keyword==="mood"?E(I,1):v(m).keyword==="occasion"?E(g,2):E(_,!1)})}M(f,S)}),M(d,p)},h=d=>{var p=jf(),f=O(p),m=W(f),S=O(m);jo(S,()=>v(r),(V,F)=>{F(V,{className:"wr-Header-icon",size:"28"})});var x=W(m,2),T=O(x),I=W(x,2);bl(I,{className:"wr-Header-icon",size:"28"});var g=W(I,2),_=O(g),E=W(g,3),b=W(E);wl(b,{className:"wr-Header-icon",size:"28"});var y=W(b,2),k=O(y),P=W(y);H((V,F,Q,z,B,J)=>{Y(f,`${V??""} `),Y(T,F),Y(_,Q),Y(E,` ${z??""} `),Y(k,B),Y(P,` ${J??""}`)},[()=>be({key:"headerLine1",lang:v(n)}),()=>be({key:"headerMeal",lang:v(n)}),()=>be({key:"headerMood",lang:v(n)}),()=>be({key:"headerOr",lang:v(n)}),()=>be({key:"headerOccasion",lang:v(n)}),()=>be({key:"headerLine2",lang:v(n)})]),It("mouseenter",m,()=>C(r,yl,!0)),It("mouseleave",m,()=>C(r,Rr,!0)),M(d,p)};ae(u,d=>{v(a)?d(l):d(h,!1)})}M(t,c),Wt()}var Vf=q('<option class="wr-Footer-lang"> </option>'),Gf=q('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),Kf=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 Xf={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;}
135
+ }`};function gs(e,t){_t(t,!0),kt(e,ps);let n=ee(()=>se.getAppLanguage()),r=ee(()=>se.getUiConfig()),i=ee(()=>{var h,f;return((h=window==null?void 0:window.wineaterData)==null?void 0:h.TITLE_TEXT)||((f=u(r))==null?void 0:f.titleText)||null}),o=Q(Ke(Wr));function s(h){return h.split(/(meal|mood|occasion)/gi).map(f=>({keyword:/^(meal|mood|occasion)$/i.test(f)?f.toLowerCase():null,text:f}))}let l=ee(()=>u(i)?s(u(i)):null);var a=vs(),c=P(a);{var v=h=>{var f=ds();Lt(f,21,()=>u(l),rn,(w,y)=>{var _=Ye(),b=we(_);{var I=m=>{var C=us(),T=we(C),E=P(T);ji(E,()=>u(o),(z,K)=>{K(z,{className:"wr-Header-icon",size:"28"})});var A=W(T),L=P(A);M(()=>U(L,u(y).text)),ht("mouseenter",T,()=>g(o,to,!0)),ht("mouseleave",T,()=>g(o,Wr,!0)),S(m,C)},j=m=>{var C=Ye(),T=we(C);{var E=L=>{var z=cs(),K=we(z);eo(K,{className:"wr-Header-icon",size:"28"});var O=W(K),de=P(O);M(()=>U(de,u(y).text)),S(L,z)},A=L=>{var z=Ye(),K=we(z);{var O=he=>{var Pe=fs(),it=we(Pe);$i(it,{className:"wr-Header-icon",size:"28"});var Kt=W(it),Nn=P(Kt);M(()=>U(Nn,u(y).text)),S(he,Pe)},de=he=>{var Pe=ln();M(()=>U(Pe,u(y).text)),S(he,Pe)};H(K,he=>{u(y).keyword==="occasion"?he(O):he(de,!1)},!0)}S(L,z)};H(T,L=>{u(y).keyword==="mood"?L(E):L(A,!1)},!0)}S(m,C)};H(b,m=>{u(y).keyword==="meal"?m(I):m(j,!1)})}S(w,_)}),S(h,f)},p=h=>{var f=hs(),w=P(f),y=W(w),_=P(y);ji(_,()=>u(o),(K,O)=>{O(K,{className:"wr-Header-icon",size:"28"})});var b=W(y,2),I=P(b),j=W(b,2);eo(j,{className:"wr-Header-icon",size:"28"});var m=W(j,2),C=P(m),T=W(m,3),E=W(T);$i(E,{className:"wr-Header-icon",size:"28"});var A=W(E,2),L=P(A),z=W(A);M((K,O,de,he,Pe,it)=>{U(w,`${K??""} `),U(I,O),U(C,de),U(T,` ${he??""} `),U(L,Pe),U(z,` ${it??""}`)},[()=>le({key:"headerLine1",lang:u(n)}),()=>le({key:"headerMeal",lang:u(n)}),()=>le({key:"headerMood",lang:u(n)}),()=>le({key:"headerOr",lang:u(n)}),()=>le({key:"headerOccasion",lang:u(n)}),()=>le({key:"headerLine2",lang:u(n)})]),ht("mouseenter",y,()=>g(o,to,!0)),ht("mouseleave",y,()=>g(o,Wr,!0)),S(h,f)};H(c,h=>{u(l)?h(v):h(p,!1)})}S(e,a),bt()}var ms=B('<option class="wr-Footer-lang"> </option>'),ws=B('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),_s=B('<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" loading="lazy" decoding="async"/> <span class="wr-Footer-text wr-Footer-text--sommelier svelte-1sr6y3t"> </span></a></div> <!></footer>');const bs={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
136
 
155
137
  @media screen and (max-width: 768px) {.wr-Footer-text--sommelier.svelte-1sr6y3t {display:none;}
156
- }`};function Yf(t,e){Ft(e,!0),Gt(t,Xf);let n=ze(e,"countryCode",3,null),s=oe(()=>me.getAppLanguage()),i=oe(()=>me.getSupportedLanguages()),r=oe(()=>me.getStoreId());function o(x){const I=x.target.value;je(Ue.LANGUAGE_CHANGED,v(r),{from_language:v(s),to_language:I}),me.setStoreLanguage(I)}var a=Kf(),c=O(a),u=O(c),l=O(u),h=O(l),d=W(l,2),p=W(d,2),f=O(p),m=W(c,2);{var S=x=>{var T=Gf();Dn(T,21,()=>v(i),Rn,(g,_)=>{var E=Vf(),b=O(E),y={};H(k=>{ru(E,v(_)===v(s)),Y(b,k),y!==(y=v(_))&&(E.value=(E.__value=v(_))??"")},[()=>v(_).toUpperCase()]),M(g,E)});var I;nu(T),H(()=>{I!==(I=v(s))&&(T.value=(T.__value=v(s))??"",Ho(T,v(s)))}),fn("change",T,o),M(x,T)};ae(m,x=>{v(i).length>1&&x(S)})}H((x,T)=>{Y(h,x),Re(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"),Y(f,T)},[()=>be({key:"poweredBy",lang:v(s)}),()=>be({key:"ai_sommelier",lang:v(s)})]),M(t,a),Wt()}Ds(["change"]);var Jf=q('<a rel="noopener noreferrer"><!></a>'),Qf=q("<button><!></button>");const Zf={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,
138
+ }`};function ys(e,t){_t(t,!0),kt(e,bs);let n=Re(t,"countryCode",3,null),r=ee(()=>se.getAppLanguage()),i=ee(()=>se.getSupportedLanguages()),o=ee(()=>se.getStoreId());function s(b){const j=b.target.value;We(Be.LANGUAGE_CHANGED,u(o),{from_language:u(r),to_language:j}),se.setStoreLanguage(j)}var l=_s(),a=P(l),c=P(a),v=P(c),p=P(v),h=W(v,2),f=W(h,2),w=P(f),y=W(a,2);{var _=b=>{var I=ws();I.__change=s,Lt(I,21,()=>u(i),rn,(m,C)=>{var T=ms(),E=P(T),A={};M(L=>{Fa(T,u(C)===u(r)),U(E,L),A!==(A=u(C))&&(T.value=(T.__value=u(C))??"")},[()=>u(C).toUpperCase()]),S(m,T)});var j;za(I),M(()=>{j!==(j=u(r))&&(I.value=(I.__value=u(r))??"",qi(I,u(r)))}),S(b,I)};H(y,b=>{u(i).length>1&&b(_)})}M((b,I)=>{U(p,b),ce(h,"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"),U(w,I)},[()=>le({key:"poweredBy",lang:u(r)}),()=>le({key:"ai_sommelier",lang:u(r)})]),S(e,l),bt()}Qn(["change"]);var xs=B('<a rel="noopener noreferrer"><!></a>'),ks=B("<button><!></button>");const Ss={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
139
  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 gs(t,e){Ft(e,!0),Gt(t,Zf);let n=ze(e,"type",3,"button"),s=ze(e,"variant",3,"primary"),i=ze(e,"target",3,"_self"),r=me.getUiConfig(),o=`wr-Action ${s()} ${e.className||""} ${r.buttonUppercase?"wr-Action--uppercase":""}`.trim();var a=Ms(),c=xt(a);{var u=h=>{var d=Jf(),p=O(d);zo(p,e,"default",{}),H(()=>{Kt(d,1,An(o),"svelte-8cxv3l"),Re(d,"href",e.href),Re(d,"id",e.id),Re(d,"target",i())}),fn("click",d,function(...f){var m;(m=e.handleClick)==null||m.apply(this,f)}),M(h,d)},l=h=>{var d=Qf(),p=O(d);zo(p,e,"default",{}),H(()=>{Kt(d,1,An(o),"svelte-8cxv3l"),Re(d,"type",n()),Re(d,"id",e.id)}),fn("click",d,function(...f){var m;(m=e.handleClick)==null||m.apply(this,f)}),M(h,d)};ae(c,h=>{e.href?h(u):h(l,!1)})}M(t,a),Wt()}Ds(["click"]);var $f=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 ep={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 tp(t,e){Ft(e,!0),Gt(t,ep);let n=ze(e,"searchQuery",15),s,i=re(!1),r=re(0),o=re(0),a=re(!0),c=re(!1),u=oe(()=>me.getAppLanguage()),l=0;function h(){return s}function d(){const g=++l,_=be({key:"placeholderSuggestions",lang:v(u)});if(!s||!_.length)return;C(c,!0);const E=()=>{if(g!==l||!s||!v(c)||v(i)||n().length)return;const b=_[v(r)];if(v(a)){if(s.placeholder=b.substring(0,lo(o)),v(o)>b.length){C(a,!1),setTimeout(E,1600);return}setTimeout(E,90)}else{if(s.placeholder=b.substring(0,lo(o,-1)),v(o)<0){C(a,!0),C(r,(v(r)+1)%_.length),setTimeout(E,450);return}setTimeout(E,45)}};E()}function p(){C(c,!1)}function f(){C(i,!0),p(),s&&(s.placeholder="")}function m(){C(i,!1),C(o,0),C(a,!0),C(c,!1)}ss(()=>{if(!s||n().length>0)return;l++,C(c,!1),C(r,0),C(o,0),C(a,!0);const g=be({key:"placeholderSuggestions",lang:v(u)});g&&g.length?s.placeholder=g[0]:s.placeholder=be({key:"searchPlaceholder",lang:v(u)})}),ss(()=>{s&&e.initialized&&!v(i)&&!n().length&&!v(c)&&d(),n().length>0&&v(c)&&(C(c,!1),l++)}),Bi(()=>{});var S={getSearchElement:h},x=$f(),T=W(O(x),2);cu(T,g=>s=g,()=>s);var I=W(T,2);return gs(I,{className:"wr-Search-button",type:"submit",variant:"primary",children:(g,_)=>{var E=Nn();H(b=>Y(E,b),[()=>be({key:"searchButton",lang:v(u)})]),M(g,E)},$$slots:{default:!0}}),It("submit",x,function(...g){var _;(_=e.onSubmit)==null||_.apply(this,g)}),It("focus",T,f),It("blur",T,m),lu(T,n),M(t,x),Wt(S)}var np=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 sp={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
- animation: svelte-li6gfl-typing 1s infinite;}
140
+ 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 Dn(e,t){_t(t,!0),kt(e,Ss);let n=Re(t,"type",3,"button"),r=Re(t,"variant",3,"primary"),i=Re(t,"target",3,"_self"),o=se.getUiConfig(),s=`wr-Action ${r()} ${t.className||""} ${o.buttonUppercase?"wr-Action--uppercase":""}`.trim();var l=Ye(),a=we(l);{var c=p=>{var h=xs();h.__click=function(...w){var y;(y=t.handleClick)==null||y.apply(this,w)};var f=P(h);Oi(f,t,"default",{}),M(()=>{St(h,1,cn(s),"svelte-8cxv3l"),ce(h,"href",t.href),ce(h,"id",t.id),ce(h,"target",i())}),S(p,h)},v=p=>{var h=ks();h.__click=function(...w){var y;(y=t.handleClick)==null||y.apply(this,w)};var f=P(h);Oi(f,t,"default",{}),M(()=>{St(h,1,cn(s),"svelte-8cxv3l"),ce(h,"type",n()),ce(h,"id",t.id)}),S(p,h)};H(a,p=>{t.href?p(c):p(v,!1)})}S(e,l),bt()}Qn(["click"]);var Cs=B('<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 Es={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("data:image/svg+xml,%3Csvg%20width=%2224%22%20height=%2225%22%20viewBox=%220%200%2024%2025%22%20fill=%22none%22%20xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath%20d=%22M11%2019.3884C15.4183%2019.3884%2019%2015.8067%2019%2011.3884C19%206.97015%2015.4183%203.38843%2011%203.38843C6.58172%203.38843%203%206.97015%203%2011.3884C3%2015.8067%206.58172%2019.3884%2011%2019.3884Z%22%20stroke=%22%238250D2%22%20stroke-width=%222%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3Cpath%20d=%22M21%2021.3884L16.7%2017.0884%22%20stroke=%22%238250D2%22%20stroke-width=%222%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3C/svg%3E");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,
141
+ 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 Ts(e,t){_t(t,!0),kt(e,Es);let n=Re(t,"searchQuery",15),r,i=Q(!1),o=Q(0),s=Q(0),l=Q(!0),a=Q(!1),c=ee(()=>se.getAppLanguage()),v=0;function p(){return r}function h(){const m=++v,C=le({key:"placeholderSuggestions",lang:u(c)});if(!r||!C.length)return;g(a,!0);const T=()=>{if(m!==v||!r||!u(a)||u(i)||n().length)return;const E=C[u(o)];if(u(l)){if(r.placeholder=E.substring(0,ui(s)),u(s)>E.length){g(l,!1),setTimeout(T,1600);return}setTimeout(T,90)}else{if(r.placeholder=E.substring(0,ui(s,-1)),u(s)<0){g(l,!0),g(o,(u(o)+1)%C.length),setTimeout(T,450);return}setTimeout(T,45)}};T()}function f(){g(a,!1)}function w(){g(i,!0),f(),r&&(r.placeholder="")}function y(){g(i,!1),g(s,0),g(l,!0),g(a,!1)}kn(()=>{if(!r||n().length>0)return;v++,g(a,!1),g(o,0),g(s,0),g(l,!0);const m=le({key:"placeholderSuggestions",lang:u(c)});m&&m.length?r.placeholder=m[0]:r.placeholder=le({key:"searchPlaceholder",lang:u(c)})}),kn(()=>{r&&t.initialized&&!u(i)&&!n().length&&!u(a)&&h(),n().length>0&&u(a)&&(g(a,!1),v++)}),Er(()=>{});var _={getSearchElement:p},b=Cs(),I=W(P(b),2);Ga(I,m=>r=m,()=>r);var j=W(I,2);return Dn(j,{className:"wr-Search-button",type:"submit",variant:"primary",children:(m,C)=>{var T=ln();M(E=>U(T,E),[()=>le({key:"searchButton",lang:u(c)})]),S(m,T)},$$slots:{default:!0}}),ht("submit",b,function(...m){var C;(C=t.onSubmit)==null||C.apply(this,m)}),ht("focus",I,w),ht("blur",I,y),Ha(I,n),S(e,b),bt(_)}var Ps=B('<div class="wr-Skeleton-tile svelte-f6xbvk"><div class="wr-Skeleton-block wr-Skeleton-image svelte-f6xbvk"></div> <div class="wr-Skeleton-block wr-Skeleton-price svelte-f6xbvk"></div> <div class="wr-Skeleton-block wr-Skeleton-title svelte-f6xbvk"></div> <div class="wr-Skeleton-block wr-Skeleton-title wr-Skeleton-title--short svelte-f6xbvk"></div> <div class="wr-Skeleton-block wr-Skeleton-button svelte-f6xbvk"></div></div>'),Is=B('<div class="wr-Skeleton svelte-f6xbvk" aria-hidden="true"></div>');const As={hash:"svelte-f6xbvk",code:`.wr-Skeleton.svelte-f6xbvk {display:grid;grid-template-columns:repeat(4, 1fr);}.wr-Skeleton-tile.svelte-f6xbvk {display:flex;flex-direction:column;align-items:center;gap:10px;padding:16px 8px;border-right:2px solid #f6f7fd;}.wr-Skeleton-tile.svelte-f6xbvk:last-child {border-right:none;}.wr-Skeleton-block.svelte-f6xbvk {border-radius:6px;background:linear-gradient(90deg, #f1f2f8 25%, #f8f9fc 50%, #f1f2f8 75%);background-size:200% 100%;
142
+ animation: svelte-f6xbvk-wr-shimmer 1.2s linear infinite;}.wr-Skeleton-image.svelte-f6xbvk {width:60%;height:200px;margin-bottom:6px;}.wr-Skeleton-price.svelte-f6xbvk {width:40px;height:16px;}.wr-Skeleton-title.svelte-f6xbvk {width:80%;height:14px;}.wr-Skeleton-title--short.svelte-f6xbvk {width:55%;}.wr-Skeleton-button.svelte-f6xbvk {width:96px;height:36px;margin-top:14px;border-radius:10px;}
161
143
 
162
- @keyframes svelte-li6gfl-typing {
163
- 0%,
164
- 100% {
165
- transform: translateY(0);
166
- opacity: 0.7;
144
+ @keyframes svelte-f6xbvk-wr-shimmer {
145
+ from {
146
+ background-position: 200% 0;
167
147
  }
168
- 50% {
169
- transform: translateY(-8px);
170
- opacity: 1;
148
+ to {
149
+ background-position: -200% 0;
171
150
  }
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 ip(t){Gt(t,sp);var e=np();M(t,e)}var rp=q('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),op=q('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),ap=q('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),lp=q('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),cp=q('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),up=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>'),hp=q('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),dp=q('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),fp=q('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),pp=q('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),gp=q('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),mp=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 vp={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 Sl(t,e){Ft(e,!0),Gt(t,vp);const n=!!e.isMobile;var s=Ms(),i=xt(s);{var r=a=>{var c=up(),u=O(c),l=W(u,2),h=O(l),d=O(h),p=O(d),f=O(p),m=W(p,2),S=W(d,2);{var x=b=>{var y=rp(),k=O(y);H(()=>Y(k,e.shortDescription)),M(b,y)};ae(S,b=>{e.shortDescription&&b(x)})}var T=W(S,2);{var I=b=>{var y=op(),k=O(y);H(()=>Y(k,e.reason)),M(b,y)},g=b=>{var y=ap(),k=O(y);H(()=>Y(k,e.pairing)),M(b,y)};ae(T,b=>{e.reason?b(I):e.pairing&&b(g,1)})}var _=W(T,2);{var E=b=>{var y=cp();Dn(y,21,()=>e.tags,Rn,(k,P)=>{var V=lp(),F=O(V);H(()=>Y(F,v(P))),M(k,V)}),M(b,y)};ae(_,b=>{e.tags&&e.tags.length&&b(E)})}H(()=>Y(f,e.title)),fn("click",u,function(...b){var y;(y=e.onClose)==null||y.apply(this,b)}),fn("click",m,function(...b){var y;(y=e.onClose)==null||y.apply(this,b)}),M(a,c)},o=a=>{var c=mp(),u=O(c),l=O(u),h=O(l),d=W(l,2),p=W(u,2);{var f=g=>{var _=hp(),E=O(_);H(()=>Y(E,e.shortDescription)),M(g,_)};ae(p,g=>{e.shortDescription&&g(f)})}var m=W(p,2);{var S=g=>{var _=dp(),E=O(_);H(()=>Y(E,e.reason)),M(g,_)},x=g=>{var _=fp(),E=O(_);H(()=>Y(E,e.pairing)),M(g,_)};ae(m,g=>{e.reason?g(S):e.pairing&&g(x,1)})}var T=W(m,2);{var I=g=>{var _=gp();Dn(_,21,()=>e.tags,Rn,(E,b)=>{var y=pp(),k=O(y);H(()=>Y(k,v(b))),M(E,y)}),M(g,_)};ae(T,g=>{e.tags&&e.tags.length&&g(I)})}H(()=>Y(h,e.title)),fn("click",d,function(...g){var _;(_=e.onClose)==null||_.apply(this,g)}),M(a,c)};ae(i,a=>{n?a(r):a(o,!1)})}M(t,s),Wt()}Ds(["click"]);var wp=q('<img class="wr-WineTile-image svelte-yk3emv"/>'),bp=q('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),yp=q('<div class="wr-WineTile-glass svelte-yk3emv"> </div>'),Sp=q('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),_p=q('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),kp=q('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),Tp=q('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),xp=q("<div><!> <!></div>"),Ep=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 Ip={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),
151
+ }
152
+
153
+ @media (prefers-reduced-motion: reduce) {.wr-Skeleton-block.svelte-f6xbvk {
154
+ animation: none;}
155
+ }
156
+
157
+ @media screen and (max-width: 768px) {.wr-Skeleton.svelte-f6xbvk {display:flex;gap:8px;overflow:hidden;padding:8px 0;}.wr-Skeleton-tile.svelte-f6xbvk {flex:0 0 240px;}
158
+ }`};function no(e){kt(e,As);var t=Is();Lt(t,4,()=>[0,1,2,3],n=>n,(n,r)=>{var i=Ps();S(n,i)}),S(e,t)}var Ds=B('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Rs=B('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Ws=B('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Bs=B('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Ns=B('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Ms=B('<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>'),Ls=B('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),zs=B('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Os=B('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),js=B('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Fs=B('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),qs=B('<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 Us={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 ro(e,t){_t(t,!0),kt(e,Us);const n=!!t.isMobile;var r=Ye(),i=we(r);{var o=l=>{var a=Ms(),c=P(a);c.__click=function(...E){var A;(A=t.onClose)==null||A.apply(this,E)};var v=W(c,2),p=P(v),h=P(p),f=P(h),w=P(f),y=W(f,2);y.__click=function(...E){var A;(A=t.onClose)==null||A.apply(this,E)};var _=W(h,2);{var b=E=>{var A=Ds(),L=P(A);M(()=>U(L,t.shortDescription)),S(E,A)};H(_,E=>{t.shortDescription&&E(b)})}var I=W(_,2);{var j=E=>{var A=Rs(),L=P(A);M(()=>U(L,t.reason)),S(E,A)},m=E=>{var A=Ye(),L=we(A);{var z=K=>{var O=Ws(),de=P(O);M(()=>U(de,t.pairing)),S(K,O)};H(L,K=>{t.pairing&&K(z)},!0)}S(E,A)};H(I,E=>{t.reason?E(j):E(m,!1)})}var C=W(I,2);{var T=E=>{var A=Ns();Lt(A,21,()=>t.tags,rn,(L,z)=>{var K=Bs(),O=P(K);M(()=>U(O,u(z))),S(L,K)}),S(E,A)};H(C,E=>{t.tags&&t.tags.length&&E(T)})}M(()=>U(w,t.title)),S(l,a)},s=l=>{var a=qs(),c=P(a),v=P(c),p=P(v),h=W(v,2);h.__click=function(...m){var C;(C=t.onClose)==null||C.apply(this,m)};var f=W(c,2);{var w=m=>{var C=Ls(),T=P(C);M(()=>U(T,t.shortDescription)),S(m,C)};H(f,m=>{t.shortDescription&&m(w)})}var y=W(f,2);{var _=m=>{var C=zs(),T=P(C);M(()=>U(T,t.reason)),S(m,C)},b=m=>{var C=Ye(),T=we(C);{var E=A=>{var L=Os(),z=P(L);M(()=>U(z,t.pairing)),S(A,L)};H(T,A=>{t.pairing&&A(E)},!0)}S(m,C)};H(y,m=>{t.reason?m(_):m(b,!1)})}var I=W(y,2);{var j=m=>{var C=Fs();Lt(C,21,()=>t.tags,rn,(T,E)=>{var A=js(),L=P(A);M(()=>U(L,u(E))),S(T,A)}),S(m,C)};H(I,m=>{t.tags&&t.tags.length&&m(j)})}M(()=>U(p,t.title)),S(l,a)};H(i,l=>{n?l(o):l(s,!1)})}S(e,r),bt()}Qn(["click"]);var Hs=B('<img class="wr-WineTile-image svelte-yk3emv" decoding="async"/>'),Gs=B('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),Vs=B('<div class="wr-WineTile-glass svelte-yk3emv"> </div>'),Ks=B('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),Ys=B('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),Zs=B('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),Qs=B('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),Js=B("<div><!> <!></div>"),Xs=B('<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 $s={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
159
  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
160
 
175
161
  /* :global обязателен — класс уезжает внутрь <Action>, а скоуп Svelte
@@ -193,16 +179,17 @@ ${JSON.stringify(o,null,2)}
193
179
  }
194
180
 
195
181
  @media screen and (max-width: 768px) {.wr-WineTile.svelte-yk3emv {flex:0 0 auto;scroll-snap-align:center;width:240px;text-align:center;}
196
- }`};function Cp(t,e){Ft(e,!0),Gt(t,Ip);let n=oe(()=>me.getAppLanguage());const s=(N,A)=>N[A]||N[A.charAt(0).toUpperCase()+A.slice(1)],i=(N,A)=>A.map(Z=>s(N,Z)).filter(Boolean).join(" • ");function r(N){var A;return Df(N,((A=me.getCurrency)==null?void 0:A.call(me))||"USD",v(n))}function o(N){return e.selectedWineId===N}function a(N){return!!(N.reason||N.shortDescription||N.tags)}function c(N,A){let Z=(N==null?void 0:N.tags)||A.tags;return Z?(Array.isArray(Z)&&(Z=Z.join(",")),typeof Z!="string"?[]:Z.split(",").map(le=>le.trim()).filter(Boolean)):[]}let u=re(!1);Bi(()=>{const N=()=>{C(u,window.innerWidth<=768)};return N(),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}});var l=Ep(),h=xt(l),d=O(h),p=O(d);{var f=N=>{var A=wp();H(()=>{Re(A,"src",e.wine.image),Re(A,"alt",e.wine.title)}),M(N,A)};ae(p,N=>{e.wine.image&&N(f)})}var m=W(p,2);{var S=N=>{var A=bp(),Z=O(A);H(le=>Y(Z,le),[()=>r(e.wine.total)]),M(N,A)};ae(m,N=>{e.wine.total&&N(S)})}var x=W(m,2);{var T=N=>{var A=yp(),Z=O(A);H((le,ke)=>Y(Z,`${le??""}${ke??""}`),[()=>be({key:"byTheGlass",lang:v(n)}),()=>e.wine.glassPrice?` — ${r(e.wine.glassPrice)}`:""]),M(N,A)};ae(x,N=>{e.wine.byTheGlass&&N(T)})}var I=W(x,2),g=O(I),_=W(d,2);{var E=N=>{var A=Sp(),Z=O(A);H(le=>Y(Z,le),[()=>i(e.wine,["type","country","region","grape"])]),M(N,A)},b=oe(()=>i(e.wine,["type","country","region","grape"]));ae(_,N=>{v(b)&&N(E)})}var y=W(_,2),k=O(y),P=O(k);{var V=N=>{gs(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,Z)=>{var le=Nn();H(ke=>Y(le,ke),[()=>be({key:"wineDetails.buy",lang:v(n)})]),M(A,le)},$$slots:{default:!0}})},F=N=>{gs(N,{handleClick:()=>e.onBuyClick(e.wine,e.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(A,Z)=>{var le=Nn();H(ke=>Y(le,ke),[()=>be({key:"moreInfo",lang:v(n)})]),M(A,le)},$$slots:{default:!0}})};ae(P,N=>{e.wine.url?N(V):N(F,!1)})}var Q=W(P,2);{var z=N=>{gs(N,{handleClick:()=>e.onSimilarClick(e.wine),variant:"text",className:"wr-WineTile-action wr-WineTile-action--similar js-WineTileAction",children:(A,Z)=>{var le=Nn();H(ke=>Y(le,ke),[()=>be({key:"similarWines",lang:v(n)})]),M(A,le)},$$slots:{default:!0}})};ae(Q,N=>{e.onSimilarClick&&N(z)})}var B=W(y,2);{var J=N=>{{let A=oe(()=>{var ue;return((ue=e.translatedPopup)==null?void 0:ue.shortDescription)||e.wine.shortDescription}),Z=oe(()=>{var ue;return((ue=e.translatedPopup)==null?void 0:ue.reason)||e.wine.reason}),le=oe(()=>{var ue;return((ue=e.translatedPopup)==null?void 0:ue.pairingRecommendation)||e.wine.pairingRecommendation}),ke=oe(()=>c(e.translatedPopup,e.wine));Sl(N,{get title(){return e.wine.title},get shortDescription(){return v(A)},get reason(){return v(Z)},get pairing(){return v(le)},get tags(){return v(ke)},get onClose(){return e.onPopupClose},isMobile:!1})}},ee=oe(()=>o(e.wine.id)&&!v(u));ae(B,N=>{v(ee)&&N(J)})}var D=W(B,2);{var te=N=>{var A=xp(),Z=O(A);{var le=Ge=>{var De=_p(),R=O(De);H(()=>{var L,ne;return Y(R,((L=e.translatedPopup)==null?void 0:L.reason)||((ne=e.translatedPopup)==null?void 0:ne.shortDescription)||e.wine.reason||e.wine.shortDescription)}),M(Ge,De)};ae(Z,Ge=>{var De,R;((De=e.translatedPopup)!=null&&De.reason||(R=e.translatedPopup)!=null&&R.shortDescription||e.wine.reason||e.wine.shortDescription)&&Ge(le)})}var ke=W(Z,2);{var ue=Ge=>{var De=Tp();Dn(De,21,()=>c(e.translatedPopup,e.wine),Rn,(R,L)=>{var ne=kp(),Ot=O(ne);H(()=>Y(Ot,v(L))),M(R,ne)}),M(Ge,De)};ae(ke,Ge=>{var De,R;((De=e.translatedPopup)!=null&&De.tags||(R=e.translatedPopup)!=null&&R.Tags||e.wine.tags)&&Ge(ue)})}H(()=>Kt(A,1,`wr-WineTilePopup ${e.hoveredWineId===e.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),M(N,A)},Ae=oe(()=>a(e.wine));ae(D,N=>{v(Ae)&&N(te)})}var _e=W(h,2);{var Mt=N=>{{let A=oe(()=>{var ue;return((ue=e.translatedPopup)==null?void 0:ue.shortDescription)||e.wine.shortDescription}),Z=oe(()=>{var ue;return((ue=e.translatedPopup)==null?void 0:ue.reason)||e.wine.reason}),le=oe(()=>{var ue;return((ue=e.translatedPopup)==null?void 0:ue.pairingRecommendation)||e.wine.pairingRecommendation}),ke=oe(()=>c(e.translatedPopup,e.wine));Sl(N,{get title(){return e.wine.title},get shortDescription(){return v(A)},get reason(){return v(Z)},get pairing(){return v(le)},get tags(){return v(ke)},get onClose(){return e.onPopupClose},isMobile:!0})}},yt=oe(()=>o(e.wine.id)&&v(u));ae(_e,N=>{v(yt)&&N(Mt)})}H(()=>{Kt(h,1,`wr-WineTile ${e.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),Y(g,e.wine.title)}),It("mouseenter",h,()=>e.onTileEnter(e.wine)),It("mouseleave",h,()=>e.onTileLeave(e.wine)),fn("click",h,N=>e.onTileClick(N,e.wine)),M(t,l),Wt()}Ds(["click"]);function Np(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 Rp=q('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),Dp=q('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),Ap=q('<div class="wr-App-showMore svelte-1n46o8q"><!></div>'),Mp=q('<div class="wr-App-placeholder svelte-1n46o8q"></div> <!>',1),Op=q('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>');const Pp={hash:"svelte-1n46o8q",code:`
182
+ }`};function el(e,t){_t(t,!0),kt(e,$s);const n=4;let r=ee(()=>se.getAppLanguage());const i=(k,N)=>k[N]||k[N.charAt(0).toUpperCase()+N.slice(1)],o=(k,N)=>N.map(X=>i(k,X)).filter(Boolean).join(" • ");function s(k){var N;return rs(k,((N=se.getCurrency)==null?void 0:N.call(se))||"USD",u(r))}function l(k){return t.selectedWineId===k}function a(k){return!!(k.reason||k.shortDescription||k.tags)}function c(k,N){let X=(k==null?void 0:k.tags)||N.tags;return X?(Array.isArray(X)&&(X=X.join(",")),typeof X!="string"?[]:X.split(",").map($=>$.trim()).filter(Boolean)):[]}let v=Q(!1);Er(()=>{const k=()=>{g(v,window.innerWidth<=768)};return k(),window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}});var p=Xs(),h=we(p);h.__click=k=>t.onTileClick(k,t.wine);var f=P(h),w=P(f);{var y=k=>{var N=Hs();M(()=>{ce(N,"src",t.wine.image),ce(N,"alt",t.wine.title),ce(N,"loading",t.index<n?"eager":"lazy"),ce(N,"fetchpriority",t.index<n?"high":"auto")}),S(k,N)};H(w,k=>{t.wine.image&&k(y)})}var _=W(w,2);{var b=k=>{var N=Gs(),X=P(N);M($=>U(X,$),[()=>s(t.wine.total)]),S(k,N)};H(_,k=>{t.wine.total&&k(b)})}var I=W(_,2);{var j=k=>{var N=Vs(),X=P(N);M(($,xe)=>U(X,`${$??""}${xe??""}`),[()=>le({key:"byTheGlass",lang:u(r)}),()=>t.wine.glassPrice?` — ${s(t.wine.glassPrice)}`:""]),S(k,N)};H(I,k=>{t.wine.byTheGlass&&k(j)})}var m=W(I,2),C=P(m),T=W(f,2);{var E=k=>{var N=Ks(),X=P(N);M($=>U(X,$),[()=>o(t.wine,["type","country","region","grape"])]),S(k,N)};H(T,k=>{o(t.wine,["type","country","region","grape"])&&k(E)})}var A=W(T,2),L=P(A),z=P(L);{var K=k=>{Dn(k,{get href(){return t.wine.url},handleClick:()=>t.onBuyLinkClick(t.wine,t.index),className:"wr-WineTile-action wr-WineTile-action--link js-WineTileAction",target:"_blank",variant:"outlined",children:(N,X)=>{var $=ln();M(xe=>U($,xe),[()=>le({key:"wineDetails.buy",lang:u(r)})]),S(N,$)},$$slots:{default:!0}})},O=k=>{Dn(k,{handleClick:()=>t.onBuyClick(t.wine,t.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(N,X)=>{var $=ln();M(xe=>U($,xe),[()=>le({key:"moreInfo",lang:u(r)})]),S(N,$)},$$slots:{default:!0}})};H(z,k=>{t.wine.url?k(K):k(O,!1)})}var de=W(z,2);{var he=k=>{Dn(k,{handleClick:()=>t.onSimilarClick(t.wine),variant:"text",className:"wr-WineTile-action wr-WineTile-action--similar js-WineTileAction",children:(N,X)=>{var $=ln();M(xe=>U($,xe),[()=>le({key:"similarWines",lang:u(r)})]),S(N,$)},$$slots:{default:!0}})};H(de,k=>{t.onSimilarClick&&k(he)})}var Pe=W(A,2);{var it=k=>{{let N=ee(()=>{var re;return((re=t.translatedPopup)==null?void 0:re.shortDescription)||t.wine.shortDescription}),X=ee(()=>{var re;return((re=t.translatedPopup)==null?void 0:re.reason)||t.wine.reason}),$=ee(()=>{var re;return((re=t.translatedPopup)==null?void 0:re.pairingRecommendation)||t.wine.pairingRecommendation}),xe=ee(()=>c(t.translatedPopup,t.wine));ro(k,{get title(){return t.wine.title},get shortDescription(){return u(N)},get reason(){return u(X)},get pairing(){return u($)},get tags(){return u(xe)},get onClose(){return t.onPopupClose},isMobile:!1})}};H(Pe,k=>{l(t.wine.id)&&!u(v)&&k(it)})}var Kt=W(Pe,2);{var Nn=k=>{var N=Js(),X=P(N);{var $=gt=>{var Ie=Ys(),Ue=P(Ie);M(()=>{var gn,Yt;return U(Ue,((gn=t.translatedPopup)==null?void 0:gn.reason)||((Yt=t.translatedPopup)==null?void 0:Yt.shortDescription)||t.wine.reason||t.wine.shortDescription)}),S(gt,Ie)};H(X,gt=>{var Ie,Ue;((Ie=t.translatedPopup)!=null&&Ie.reason||(Ue=t.translatedPopup)!=null&&Ue.shortDescription||t.wine.reason||t.wine.shortDescription)&&gt($)})}var xe=W(X,2);{var re=gt=>{var Ie=Qs();Lt(Ie,21,()=>c(t.translatedPopup,t.wine),rn,(Ue,gn)=>{var Yt=Zs(),zr=P(Yt);M(()=>U(zr,u(gn))),S(Ue,Yt)}),S(gt,Ie)};H(xe,gt=>{var Ie,Ue;((Ie=t.translatedPopup)!=null&&Ie.tags||(Ue=t.translatedPopup)!=null&&Ue.Tags||t.wine.tags)&&gt(re)})}M(()=>St(N,1,`wr-WineTilePopup ${t.hoveredWineId===t.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),S(k,N)};H(Kt,k=>{a(t.wine)&&k(Nn)})}var Mr=W(h,2);{var Lr=k=>{{let N=ee(()=>{var re;return((re=t.translatedPopup)==null?void 0:re.shortDescription)||t.wine.shortDescription}),X=ee(()=>{var re;return((re=t.translatedPopup)==null?void 0:re.reason)||t.wine.reason}),$=ee(()=>{var re;return((re=t.translatedPopup)==null?void 0:re.pairingRecommendation)||t.wine.pairingRecommendation}),xe=ee(()=>c(t.translatedPopup,t.wine));ro(k,{get title(){return t.wine.title},get shortDescription(){return u(N)},get reason(){return u(X)},get pairing(){return u($)},get tags(){return u(xe)},get onClose(){return t.onPopupClose},isMobile:!0})}};H(Mr,k=>{l(t.wine.id)&&u(v)&&k(Lr)})}M(()=>{St(h,1,`wr-WineTile ${t.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),U(C,t.wine.title)}),ht("mouseenter",h,()=>t.onTileEnter(t.wine)),ht("mouseleave",h,()=>t.onTileLeave(t.wine)),S(e,p),bt()}Qn(["click"]);const tl=/@import\s+url\(\s*['"]?([^'")]+)['"]?\s*\)\s*;?/g;function Br(e,t,n=!1){const r=document.createElement("link");r.rel=e,r.href=t,n&&(r.crossOrigin="anonymous"),document.head.appendChild(r)}function nl(){document.querySelector('link[rel="preconnect"][href="https://fonts.googleapis.com"]')||(Br("preconnect","https://fonts.googleapis.com"),Br("preconnect","https://fonts.gstatic.com",!0))}function rl(e){if(!e)return"";const t="custom-ui-config-style";if(document.getElementById(t))return;const n=e.replace(tl,(i,o)=>(Br("stylesheet",o),"")),r=document.createElement("style");return r.id=t,r.innerHTML=n,document.head.appendChild(r),t}var il=B('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),ol=B('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),al=B('<div class="wr-App-showMore svelte-1n46o8q"><!></div>'),sl=B('<div class="wr-App-placeholder svelte-1n46o8q"></div> <!>',1),ll=B('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>'),ul=B('<div class="wr-App wr-App--loading svelte-1n46o8q" aria-busy="true"><div class="wr-App-loadingTop svelte-1n46o8q"></div> <!></div>');const cl={hash:"svelte-1n46o8q",code:`
197
183
  /* ===================== 1) CSS Variables ===================== */:root {--wineater-corp-color: #0044ff;
198
184
  /* --wr-brand-color is set dynamically from uiConfig.brandColor */--wr-brand-color: #7b2beb; /* fallback value */}
199
185
 
200
186
  /* ===================== 2) Global Styles ===================== */* {box-sizing:border-box;}.hidden {display:none;}body {margin:0;padding:0;font-family:var(--wineater-font-primary, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif);}
201
187
 
202
- /* ===================== 3) Widget Container ===================== */.wr-App.svelte-1n46o8q {padding:12px 12px 0px;border-radius:16px;background-color:#fff;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);max-width:1024px;min-width:1024px;min-height:500px;margin:40px auto;position:relative;}.wr-App-picture.svelte-1n46o8q {display:flex;justify-content:center;align-items:center;margin-bottom:12px;}.wr-App-logo.svelte-1n46o8q {max-width:100%;height:auto;width:auto;max-height:60px;}.wr-App-content.svelte-1n46o8q {position:relative;min-height:300px;}.wr-App-placeholder.svelte-1n46o8q {display:grid;grid-template-columns:repeat(4, 1fr);gap:0;align-items:stretch;margin-bottom:0;}.wr-App-showMore.svelte-1n46o8q {display:flex;justify-content:center;padding:16px 0 24px;}
188
+ /* ===================== 3) Widget Container ===================== */.wr-App.svelte-1n46o8q {padding:12px 12px 0px;border-radius:16px;background-color:#fff;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);max-width:1024px;min-width:1024px;min-height:500px;margin:40px auto;position:relative;}.wr-App-loadingTop.svelte-1n46o8q {
189
+ /* roughly the height of Header + Search, so tiles do not jump once they render */height:150px;}.wr-App-picture.svelte-1n46o8q {display:flex;justify-content:center;align-items:center;margin-bottom:12px;}.wr-App-logo.svelte-1n46o8q {max-width:100%;height:auto;width:auto;max-height:60px;}.wr-App-content.svelte-1n46o8q {position:relative;min-height:300px;}.wr-App-placeholder.svelte-1n46o8q {display:grid;grid-template-columns:repeat(4, 1fr);gap:0;align-items:stretch;margin-bottom:0;}.wr-App-showMore.svelte-1n46o8q {display:flex;justify-content:center;padding:16px 0 24px;}
203
190
 
204
191
  /* ===================== 12) Error Message ===================== */.wr-App-error.svelte-1n46o8q {text-align:center;padding:24px;color:#666;}
205
192
 
206
193
  /* ===================== 13) Mobile Styles ===================== */
207
194
  @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);}
208
- }`};function Lp(t,e){var ue,Ge,De;Ft(e,!0),Gt(t,Pp);function n(){var R;ji("chatbotToken",((R=window.wineaterData)==null?void 0:R.CLIENT_TOKEN)||s,365),Xo()}const s="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";new Sf({projectKey:"PA8j9fAi49i6g2QnvpNs",__DISABLE_SECURE_MODE:!0}).start(),n();const r=((ue=window==null?void 0:window.wineaterData)==null?void 0:ue.WIDGET_TYPE)||"store",o=((Ge=window==null?void 0:window.wineaterData)==null?void 0:Ge.COUNTRY_CODE)||null;(De=window==null?void 0:window.wineaterData)!=null&&De.WIDGET_WRAPPER;let a=re(!1),c=re(!1),u=re(!1),l=re(ot([])),h=re(null),d=re(""),p=re(null),f=re(!1),m=re(null),S=re(ot([])),x=re(""),T=re(!1),I=re(ot([])),g=oe(()=>me.getAppLanguage()),_=oe(()=>me.getStoreLanguage()),E=oe(()=>me.getApiKey()),b=oe(()=>me.getStoreId()),y=oe(()=>me.isInitialized()),k=oe(()=>me.getUiConfig());function P(){C(p,be({key:"errorMessage",lang:v(g)}),!0)}const V=()=>C(p,null);async function F(R){if(v(g)===v(_)||r!=="bar")return R.map(()=>({}));const L=["shortDescription","reason","pairingRecommendation","tags"],ne=R[0];if(!ne)return R.map(()=>({}));const Ot=L.filter(Pt=>Pt in ne),bs=4,ys=[];for(let Pt=0;Pt<R.length;Pt+=bs){const ui=R.slice(Pt,Pt+bs).map(async hi=>{const di=Ot.map(he=>{const Ke=hi[he]||hi[he.toLowerCase()];return Ke?{key:he,text:Array.isArray(Ke)?Ke.join(", "):Ke}:null}).filter(Boolean);return di.length===0?{}:await Af({sourceLang:v(_),targetLang:v(g),texts:Object.fromEntries(di.map(he=>[he.key,he.text])),apiKey:v(E)})}),Mr=await Promise.all(ui);ys.push(...Mr)}return ys}async function Q(){C(c,!0);try{C(l,await ps.getInstantRecommendations(),!0)}catch(R){console.error("[wineater] instant recommendations error:",R),P()}finally{C(c,!1)}}function z(R=220){return!v(l)||v(l).length===0?Promise.resolve():(C(f,!0),new Promise(L=>{setTimeout(()=>{L()},R)}))}async function B(R){R.preventDefault();let L="";try{C(c,!0),V(),await z(220),C(l,[],!0),C(f,!1),C(T,!1),C(I,[],!0),L=v(d).trim()+";",C(x,L,!0);try{je(Ue.SEARCH_PERFORMED,v(b),{query:L})}catch(Ot){console.error("Error tracking search event:",Ot)}const ne=await ps.getWineRecommendationsSearch(L);!ne||ne.length===0?(C(l,[],!0),C(S,[],!0),C(p,be({key:"noResultsMessage",lang:v(g)}),!0),je(Ue.NO_RESULTS_FOUND,v(b),{query:L})):(C(l,ne,!0),C(T,vl==="2"&&ne.length>=4,!0),je(Ue.SEARCH_RESULTS_DISPLAYED,v(b),{results_count:ne.length,results:ne,query:L}))}catch(ne){C(l,[],!0),console.error("[wineater] search error:",ne),je(Ue.ERROR_OCCURRED,v(b),{error_message:ne==null?void 0:ne.message,query:L}),P()}finally{C(c,!1)}}async function J(){if(v(u)||!v(T))return;const R=v(l);try{C(u,!0),C(c,!0),C(I,[...new Set([...v(I),...v(l).map(Ot=>Ot.id)])],!0),await z(220),C(l,[],!0),C(f,!1);const{recommendations:L,hasMore:ne}=await ps.getMoreWineRecommendations(v(x),v(I));je(Ue.SHOW_MORE_CLICKED,v(b),{query:v(x),results_count:L.length}),C(l,L.length>0?L:R,!0),C(T,ne,!0)}catch(L){console.error("[wineater] try again error:",L),C(l,R,!0),C(T,!1)}finally{C(u,!1),C(c,!1)}}async function ee(R){try{C(c,!0),V(),je(Ue.SIMILAR_WINES_CLICKED,v(b),{wine_id:R.id,wine_title:R.title}),await z(220),C(l,[],!0),C(f,!1),C(T,!1),C(h,null);const L=await ps.getSimilarWines(R.id);C(d,R.title,!0),C(x,""),!L||L.length===0?(C(l,[],!0),C(S,[],!0),C(p,be({key:"noResultsMessage",lang:v(g)}),!0)):C(l,L,!0)}catch(L){C(l,[],!0),console.error("[wineater] similar wines error:",L),P()}finally{C(c,!1)}}ss(async()=>{if(!v(l)||v(l).length===0){C(S,[],!0);return}try{const R=await F(v(l));v(l)&&v(l).length>0&&C(S,R,!0)}catch(R){console.error("translatePopupContent failed",R)}});function D(R,L){v(h)&&v(h)!==R.id&&C(h,null),C(h,R.id,!0),je(Ue.WINE_DETAILS_VIEWED,v(b),{wine_id:R.id,wine_title:R.title,is_mobile:window.innerWidth<=768})}function te(R,L){je(Ue.BUY_BUTTON_CLICKED,v(b),{wine_id:R.id,wine_title:R.title,wine_url:R.url,is_mobile:window.innerWidth<=768})}function Ae(){const R=v(l).find(L=>L.id===v(h));je(Ue.WINE_DETAILS_CLOSED,v(b),{wine_id:v(h),wine_title:R.title}),C(h,null)}function _e(R){return!!(R.reason||R.shortDescription||R.tags)}function Mt(R){r==="store"&&_e(R)&&(C(m,R.id,!0),je(Ue.WINE_CARD_HOVER,v(b),{wine_id:R.id,wine_title:R.title}))}function yt(R){r==="store"&&v(m)===R.id&&C(m,null)}function N(R,L){R.target.closest(".js-WineTileAction")||R.target.closest(".js-WinePopupClose")||je(Ue.WINE_CARD_CLICK,v(b),{wine_id:L.id,wine_title:L.title})}function A(R){const L=R.target;L.closest(".js-WinePopup")||L.closest(".js-WineTileAction")||C(h,null)}ss(()=>{var R,L;(R=v(k))!=null&&R.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",v(k).brandColor),(L=v(k))!=null&&L.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",v(k).wineaterColor)}),Bi(async()=>{if(await me.initializeStore(),!!v(y))return C(k,me.getUiConfig()),v(k).customCss&&Np(v(k).customCss),await Q(),je(Ue.WIDGET_INITIALIZED,v(b)),C(a,!0),document.addEventListener("click",A),()=>{document.removeEventListener("click",A)}});var Z=Ms(),le=xt(Z);{var ke=R=>{var L=Op(),ne=O(L);{var Ot=he=>{var Ke=Rp(),Qn=O(Ke);H(()=>Re(Qn,"src",v(k).logoUrl)),M(he,Ke)};ae(ne,he=>{v(k).logoUrl&&he(Ot)})}var bs=W(ne,2);qf(bs,{});var ys=W(bs,2);tp(ys,{onSubmit:B,get initialized(){return v(a)},get searchQuery(){return v(d)},set searchQuery(he){C(d,he,!0)}});var Pt=W(ys,2);{var El=he=>{ip(he)};ae(Pt,he=>{v(c)&&he(El)})}var ui=W(Pt,2),Mr=O(ui);{var hi=he=>{var Ke=Dp(),Qn=O(Ke),Or=O(Qn);H(()=>Y(Or,v(p))),M(he,Ke)},di=he=>{var Ke=Mp(),Qn=xt(Ke);Dn(Qn,21,()=>v(l),Rn,(Ss,fi,pi)=>{Cp(Ss,{get wine(){return v(fi)},index:pi,get hoveredWineId(){return v(m)},get selectedWineId(){return v(h)},get isAnimating(){return v(f)},get translatedPopup(){return v(S)[pi]},onBuyClick:D,onBuyLinkClick:te,onPopupClose:Ae,onSimilarClick:ee,onTileEnter:Mt,onTileLeave:yt,onTileClick:N})});var Or=W(Qn,2);{var Bp=Ss=>{var fi=Ap(),pi=O(fi);gs(pi,{handleClick:J,variant:"outlined",children:(Fp,ng)=>{var Cl=Nn();H(Wp=>Y(Cl,Wp),[()=>be({key:"tryAgain",lang:v(g)})]),M(Fp,Cl)},$$slots:{default:!0}}),M(Ss,fi)};ae(Or,Ss=>{v(T)&&Ss(Bp)})}M(he,Ke)};ae(Mr,he=>{v(p)?he(hi):v(l)&&v(l).length>0&&he(di,1)})}var Il=W(ui,2);Yf(Il,{get countryCode(){return o}}),M(R,L)};ae(le,R=>{v(y)&&R(ke)})}M(t,Z),Wt()}return Kc(Lp,{target:document.getElementById("wineater-widget-conteiner")})});
195
+ }`};function fl(e,t){var so,lo,uo;_t(t,!0),kt(e,cl);function n(){var x;Ir("chatbotToken",((x=window.wineaterData)==null?void 0:x.CLIENT_TOKEN)||r,365),Ki()}const r="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";n(),nl();const i=6*60*60*1e3,o=`${Zi}:instant`,s=((so=window==null?void 0:window.wineaterData)==null?void 0:so.WIDGET_TYPE)||"store",l=((lo=window==null?void 0:window.wineaterData)==null?void 0:lo.COUNTRY_CODE)||null;(uo=window==null?void 0:window.wineaterData)!=null&&uo.WIDGET_WRAPPER;let a=Q(!1),c=Q(!1),v=!1,p=Q(!1),h=Q(!1),f=Q(Ke([])),w=Q(null),y=Q(""),_=Q(null),b=Q(!1),I=Q(null),j=Q(Ke([])),m=Q(""),C=Q(!1),T=Q(Ke([])),E=ee(()=>se.getAppLanguage()),A=ee(()=>se.getStoreLanguage()),L=ee(()=>se.getApiKey()),z=ee(()=>se.getStoreId()),K=ee(()=>se.isInitialized()),O=ee(()=>se.getUiConfig());function de(){g(_,le({key:"errorMessage",lang:u(E)}),!0)}const he=()=>g(_,null);async function Pe(x){if(u(E)===u(A)||s!=="bar")return x.map(()=>({}));const R=["shortDescription","reason","pairingRecommendation","tags"],J=x[0];if(!J)return x.map(()=>({}));const ue=R.filter(Qe=>Qe in J),Me=4,It=[];for(let Qe=0;Qe<x.length;Qe+=Me){const Or=x.slice(Qe,Qe+Me).map(async nr=>{const ke=ue.map(He=>{const At=nr[He]||nr[He.toLowerCase()];return At?{key:He,text:Array.isArray(At)?At.join(", "):At}:null}).filter(Boolean);return ke.length===0?{}:await is({sourceLang:u(A),targetLang:u(E),texts:Object.fromEntries(ke.map(He=>[He.key,He.text])),apiKey:u(L)})}),jr=await Promise.all(Or);It.push(...jr)}return It}async function it(x){const R=Ji(o,i),J=!!(R!=null&&R.length);J?g(f,R,!0):g(p,!0);try{const ue=await An.getInstantRecommendations();ue.length>0&&Xi(o,ue),!J&&!v&&g(f,ue,!0)}catch(ue){console.error("[wineater] instant recommendations error:",ue),!J&&!v&&(await x,de())}finally{v||g(p,!1)}}function Kt(x=220){return!u(f)||u(f).length===0?Promise.resolve():(g(b,!0),new Promise(R=>{setTimeout(()=>{R()},x)}))}async function Nn(x){x.preventDefault(),v=!0;let R="";try{g(p,!0),he(),R=u(y).trim()+";",g(m,R,!0);try{We(Be.SEARCH_PERFORMED,u(z),{query:R})}catch(Me){console.error("Error tracking search event:",Me)}const J=An.getWineRecommendationsSearch(R);J.catch(()=>{}),await Kt(220),g(f,[],!0),g(b,!1),g(C,!1),g(T,[],!0);const ue=await J;!ue||ue.length===0?(g(f,[],!0),g(j,[],!0),g(_,le({key:"noResultsMessage",lang:u(E)}),!0),We(Be.NO_RESULTS_FOUND,u(z),{query:R})):(g(f,ue,!0),g(C,Rr==="2"&&ue.length>=4,!0),We(Be.SEARCH_RESULTS_DISPLAYED,u(z),{results_count:ue.length,results:ue,query:R}))}catch(J){g(f,[],!0),console.error("[wineater] search error:",J),We(Be.ERROR_OCCURRED,u(z),{error_message:J==null?void 0:J.message,query:R}),de()}finally{g(p,!1)}}async function Mr(){if(u(h)||!u(C))return;v=!0;const x=u(f);try{g(h,!0),g(p,!0),g(T,[...new Set([...u(T),...u(f).map(Me=>Me.id)])],!0);const R=An.getMoreWineRecommendations(u(m),u(T));R.catch(()=>{}),await Kt(220),g(f,[],!0),g(b,!1);const{recommendations:J,hasMore:ue}=await R;We(Be.SHOW_MORE_CLICKED,u(z),{query:u(m),results_count:J.length}),g(f,J.length>0?J:x,!0),g(C,ue,!0)}catch(R){console.error("[wineater] try again error:",R),g(f,x,!0),g(C,!1)}finally{g(h,!1),g(p,!1)}}async function Lr(x){v=!0;try{g(p,!0),he(),We(Be.SIMILAR_WINES_CLICKED,u(z),{wine_id:x.id,wine_title:x.title});const R=An.getSimilarWines(x.id);R.catch(()=>{}),await Kt(220),g(f,[],!0),g(b,!1),g(C,!1),g(w,null);const J=await R;g(y,x.title,!0),g(m,""),!J||J.length===0?(g(f,[],!0),g(j,[],!0),g(_,le({key:"noResultsMessage",lang:u(E)}),!0)):g(f,J,!0)}catch(R){g(f,[],!0),console.error("[wineater] similar wines error:",R),de()}finally{g(p,!1)}}kn(async()=>{if(!u(f)||u(f).length===0){g(j,[],!0);return}try{const x=await Pe(u(f));u(f)&&u(f).length>0&&g(j,x,!0)}catch(x){console.error("translatePopupContent failed",x)}});function k(x,R){u(w)&&u(w)!==x.id&&g(w,null),g(w,x.id,!0),We(Be.WINE_DETAILS_VIEWED,u(z),{wine_id:x.id,wine_title:x.title,is_mobile:window.innerWidth<=768})}function N(x,R){We(Be.BUY_BUTTON_CLICKED,u(z),{wine_id:x.id,wine_title:x.title,wine_url:x.url,is_mobile:window.innerWidth<=768})}function X(){const x=u(f).find(R=>R.id===u(w));We(Be.WINE_DETAILS_CLOSED,u(z),{wine_id:u(w),wine_title:x.title}),g(w,null)}function $(x){return!!(x.reason||x.shortDescription||x.tags)}function xe(x){s==="store"&&$(x)&&(g(I,x.id,!0),We(Be.WINE_CARD_HOVER,u(z),{wine_id:x.id,wine_title:x.title}))}function re(x){s==="store"&&u(I)===x.id&&g(I,null)}function gt(x,R){x.target.closest(".js-WineTileAction")||x.target.closest(".js-WinePopupClose")||We(Be.WINE_CARD_CLICK,u(z),{wine_id:R.id,wine_title:R.title})}function Ie(x){const R=x.target;R.closest(".js-WinePopup")||R.closest(".js-WineTileAction")||g(w,null)}kn(()=>{var x,R;(x=u(O))!=null&&x.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",u(O).brandColor),(R=u(O))!=null&&R.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",u(O).wineaterColor)}),Er(()=>(document.addEventListener("click",Ie),(async()=>{const x=se.initializeStore();if(it(x),await x,!u(K)){g(c,!0);return}u(O).customCss&&rl(u(O).customCss),g(a,!0),We(Be.WIDGET_INITIALIZED,u(z))})(),()=>{document.removeEventListener("click",Ie)}));var Ue=Ye(),gn=we(Ue);{var Yt=x=>{var R=ll(),J=P(R);{var ue=ke=>{var mt=il(),He=P(mt);M(()=>ce(He,"src",u(O).logoUrl)),S(ke,mt)};H(J,ke=>{u(O).logoUrl&&ke(ue)})}var Me=W(J,2);gs(Me,{});var It=W(Me,2);Ts(It,{onSubmit:Nn,get initialized(){return u(a)},get searchQuery(){return u(y)},set searchQuery(ke){g(y,ke,!0)}});var Qe=W(It,2),co=P(Qe);{var Or=ke=>{var mt=ol(),He=P(mt),At=P(He);M(()=>U(At,u(_))),S(ke,mt)},jr=ke=>{var mt=Ye(),He=we(mt);{var At=mn=>{var Mn=sl(),rr=we(Mn);Lt(rr,21,()=>u(f),rn,(zn,ir,or)=>{el(zn,{get wine(){return u(ir)},index:or,get hoveredWineId(){return u(I)},get selectedWineId(){return u(w)},get isAnimating(){return u(b)},get translatedPopup(){return u(j)[or]},onBuyClick:k,onBuyLinkClick:N,onPopupClose:X,onSimilarClick:Lr,onTileEnter:xe,onTileLeave:re,onTileClick:gt})});var Fr=W(rr,2);{var Ln=zn=>{var ir=al(),or=P(ir);Dn(or,{handleClick:Mr,variant:"outlined",children:(hl,Al)=>{var fo=ln();M(vl=>U(fo,vl),[()=>le({key:"tryAgain",lang:u(E)})]),S(hl,fo)},$$slots:{default:!0}}),S(zn,ir)};H(Fr,zn=>{u(C)&&zn(Ln)})}S(mn,Mn)},dl=mn=>{var Mn=Ye(),rr=we(Mn);{var Fr=Ln=>{no(Ln)};H(rr,Ln=>{u(p)&&Ln(Fr)},!0)}S(mn,Mn)};H(He,mn=>{u(f)&&u(f).length>0?mn(At):mn(dl,!1)},!0)}S(ke,mt)};H(co,ke=>{u(_)?ke(Or):ke(jr,!1)})}var nr=W(Qe,2);ys(nr,{get countryCode(){return l}}),S(x,R)},zr=x=>{var R=Ye(),J=we(R);{var ue=Me=>{var It=ul(),Qe=W(P(It),2);no(Qe),S(Me,It)};H(J,Me=>{u(c)||Me(ue)},!0)}S(x,R)};H(gn,x=>{u(K)?x(Yt):x(zr,!1)})}S(e,Ue),bt()}return Ra(fl,{target:document.getElementById("wineater-widget-conteiner")})});