@molin.ai/shop-ai 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in r?Zf(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var M=(r,e,t)=>Jf(r,typeof e!="symbol"?e+"":e,t),jo=(r,e,t)=>e.has(r)||zu("Cannot "+t);var f=(r,e,t)=>(jo(r,e,"read from private field"),t?t.call(r):e.get(r)),b=(r,e,t)=>e.has(r)?zu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,i)=>(jo(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),E=(r,e,t)=>(jo(r,e,"access private method"),t);var Vu=(r,e,t,i)=>({set _(n){I(r,e,n,t)},get _(){return f(r,e,i)}});var Rn=globalThis,On=Rn.ShadowRoot&&(Rn.ShadyCSS===void 0||Rn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,No=Symbol(),Wu=new WeakMap,vi=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==No)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(On&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=Wu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Wu.set(t,e))}return e}toString(){return this.cssText}},Gu=r=>new vi(typeof r=="string"?r:r+"",void 0,No),ft=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+r[s+1],r[0]);return new vi(t,r,No)},Uo=(r,e)=>{if(On)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),n=Rn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,r.appendChild(i)}},Ln=On?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return Gu(t)})(r):r;var{is:Xf,defineProperty:Kf,getOwnPropertyDescriptor:Yf,getOwnPropertyNames:Qf,getOwnPropertySymbols:e0,getPrototypeOf:t0}=Object,Fn=globalThis,Zu=Fn.trustedTypes,r0=Zu?Zu.emptyScript:"",i0=Fn.reactiveElementPolyfillSupport,_i=(r,e)=>r,Bo={toAttribute(r,e){switch(e){case Boolean:r=r?r0:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Xu=(r,e)=>!Xf(r,e),Ju={attribute:!0,type:String,converter:Bo,reflect:!1,hasChanged:Xu};Symbol.metadata??=Symbol("metadata"),Fn.litPropertyMetadata??=new WeakMap;var gt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ju){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&Kf(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){let{get:n,set:s}=Yf(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n?.call(this)},set(o){let l=n?.call(this);s.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ju}static _$Ei(){if(this.hasOwnProperty(_i("elementProperties")))return;let e=t0(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(_i("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_i("properties"))){let t=this.properties,i=[...Qf(t),...e0(t)];for(let n of i)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)t.unshift(Ln(n))}else e!==void 0&&t.push(Ln(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Uo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:Bo).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Bo;this._$Em=n,this[n]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??Xu)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};gt.elementStyles=[],gt.shadowRootOptions={mode:"open"},gt[_i("elementProperties")]=new Map,gt[_i("finalized")]=new Map,i0?.({ReactiveElement:gt}),(Fn.reactiveElementVersions??=[]).push("2.0.4");var Ho=globalThis,Dn=Ho.trustedTypes,Ku=Dn?Dn.createPolicy("lit-html",{createHTML:r=>r}):void 0,zo="$lit$",mt=`lit$${Math.random().toFixed(9).slice(2)}$`,Vo="?"+mt,n0=`<${Vo}>`,Xt=document,bi=()=>Xt.createComment(""),wi=r=>r===null||typeof r!="object"&&typeof r!="function",Wo=Array.isArray,ic=r=>Wo(r)||typeof r?.[Symbol.iterator]=="function",qo=`[
2
- \f\r]`,yi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yu=/-->/g,Qu=/>/g,Zt=RegExp(`>|${qo}(?:([^\\s"'>=/]+)(${qo}*=${qo}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ec=/'/g,tc=/"/g,nc=/^(?:script|style|textarea|title)$/i,Go=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),C=Go(1),_m=Go(2),ym=Go(3),tt=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),rc=new WeakMap,Jt=Xt.createTreeWalker(Xt,129);function sc(r,e){if(!Wo(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ku!==void 0?Ku.createHTML(e):e}var oc=(r,e)=>{let t=r.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=yi;for(let l=0;l<t;l++){let a=r[l],u,d,c=-1,p=0;for(;p<a.length&&(o.lastIndex=p,d=o.exec(a),d!==null);)p=o.lastIndex,o===yi?d[1]==="!--"?o=Yu:d[1]!==void 0?o=Qu:d[2]!==void 0?(nc.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Zt):d[3]!==void 0&&(o=Zt):o===Zt?d[0]===">"?(o=n??yi,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,u=d[1],o=d[3]===void 0?Zt:d[3]==='"'?tc:ec):o===tc||o===ec?o=Zt:o===Yu||o===Qu?o=yi:(o=Zt,n=void 0);let h=o===Zt&&r[l+1].startsWith("/>")?" ":"";s+=o===yi?a+n0:c>=0?(i.push(u),a.slice(0,c)+zo+a.slice(c)+mt+h):a+mt+(c===-2?l:h)}return[sc(r,s+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},xi=class r{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let s=0,o=0,l=e.length-1,a=this.parts,[u,d]=oc(e,t);if(this.el=r.createElement(u,i),Jt.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(n=Jt.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let c of n.getAttributeNames())if(c.endsWith(zo)){let p=d[o++],h=n.getAttribute(c).split(mt),g=/([.?@])?(.*)/.exec(p);a.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?Nn:g[1]==="?"?Un:g[1]==="@"?Bn:Yt}),n.removeAttribute(c)}else c.startsWith(mt)&&(a.push({type:6,index:s}),n.removeAttribute(c));if(nc.test(n.tagName)){let c=n.textContent.split(mt),p=c.length-1;if(p>0){n.textContent=Dn?Dn.emptyScript:"";for(let h=0;h<p;h++)n.append(c[h],bi()),Jt.nextNode(),a.push({type:2,index:++s});n.append(c[p],bi())}}}else if(n.nodeType===8)if(n.data===Vo)a.push({type:2,index:s});else{let c=-1;for(;(c=n.data.indexOf(mt,c+1))!==-1;)a.push({type:7,index:s}),c+=mt.length-1}s++}}static createElement(e,t){let i=Xt.createElement("template");return i.innerHTML=e,i}};function Kt(r,e,t=r,i){if(e===tt)return e;let n=i!==void 0?t._$Co?.[i]:t._$Cl,s=wi(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(r),n._$AT(r,t,i)),i!==void 0?(t._$Co??=[])[i]=n:t._$Cl=n),n!==void 0&&(e=Kt(r,n._$AS(r,e.values),n,i)),e}var jn=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,n=(e?.creationScope??Xt).importNode(t,!0);Jt.currentNode=n;let s=Jt.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new Sr(s,s.nextSibling,this,e):a.type===1?u=new a.ctor(s,a.name,a.strings,this,e):a.type===6&&(u=new qn(s,this,e)),this._$AV.push(u),a=i[++l]}o!==a?.index&&(s=Jt.nextNode(),o++)}return Jt.currentNode=Xt,n}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Sr=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Kt(this,e,t),wi(e)?e===j||e==null||e===""?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==tt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ic(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==j&&wi(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=xi.createElement(sc(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(t);else{let s=new jn(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=rc.get(e.strings);return t===void 0&&rc.set(e.strings,t=new xi(e)),t}k(e){Wo(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,n=0;for(let s of e)n===t.length?t.push(i=new r(this.O(bi()),this.O(bi()),this,this.options)):i=t[n],i._$AI(s),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Yt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,s){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=j}_$AI(e,t=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Kt(this,e,t,0),o=!wi(e)||e!==this._$AH&&e!==tt,o&&(this._$AH=e);else{let l=e,a,u;for(e=s[0],a=0;a<s.length-1;a++)u=Kt(this,l[i+a],t,a),u===tt&&(u=this._$AH[a]),o||=!wi(u)||u!==this._$AH[a],u===j?e=j:e!==j&&(e+=(u??"")+s[a+1]),this._$AH[a]=u}o&&!n&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Nn=class extends Yt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}},Un=class extends Yt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},Bn=class extends Yt{constructor(e,t,i,n,s){super(e,t,i,n,s),this.type=5}_$AI(e,t=this){if((e=Kt(this,e,t,0)??j)===tt)return;let i=this._$AH,n=e===j&&i!==j||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==j&&(i===j||n);n&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},qn=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Kt(this,e)}},ac={M:zo,P:mt,A:Vo,C:1,L:oc,R:jn,D:ic,V:Kt,I:Sr,H:Yt,N:Un,U:Bn,B:Nn,F:qn},s0=Ho.litHtmlPolyfillSupport;s0?.(xi,Sr),(Ho.litHtmlVersions??=[]).push("3.2.1");var lc=(r,e,t)=>{let i=t?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=t?.renderBefore??null;i._$litPart$=n=new Sr(e.insertBefore(bi(),s),s,void 0,t??{})}return n._$AI(r),n};var q=class extends gt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=lc(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return tt}};q._$litElement$=!0,q.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:q});var o0=globalThis.litElementPolyfillSupport;o0?.({LitElement:q});(globalThis.litElementVersions??=[]).push("4.1.1");var ki=class ki extends HTMLElement{constructor(){super();M(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(t,i,n){if(i!==n&&ki.observedAttributes.includes(t)){switch(t){case"name":this.name=n||"";break}this.render()}}resolveIcon(t){throw new Error("Not implemented")}render(){let t=document.createElement("style");for(t.textContent=`
1
+ var e0=Object.defineProperty;var tc=r=>{throw TypeError(r)};var t0=(r,e,t)=>e in r?e0(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var M=(r,e,t)=>t0(r,typeof e!="symbol"?e+"":e,t),Zo=(r,e,t)=>e.has(r)||tc("Cannot "+t);var f=(r,e,t)=>(Zo(r,e,"read from private field"),t?t.call(r):e.get(r)),w=(r,e,t)=>e.has(r)?tc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,i)=>(Zo(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),S=(r,e,t)=>(Zo(r,e,"access private method"),t);var rc=(r,e,t,i)=>({set _(n){I(r,e,n,t)},get _(){return f(r,e,i)}});var Fn=globalThis,Dn=Fn.ShadowRoot&&(Fn.ShadyCSS===void 0||Fn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Jo=Symbol(),ic=new WeakMap,yi=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Jo)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Dn&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=ic.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ic.set(t,e))}return e}toString(){return this.cssText}},nc=r=>new yi(typeof r=="string"?r:r+"",void 0,Jo),gt=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+r[s+1],r[0]);return new yi(t,r,Jo)},Xo=(r,e)=>{if(Dn)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),n=Fn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,r.appendChild(i)}},jn=Dn?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return nc(t)})(r):r;var{is:r0,defineProperty:i0,getOwnPropertyDescriptor:n0,getOwnPropertyNames:s0,getOwnPropertySymbols:o0,getPrototypeOf:a0}=Object,Nn=globalThis,sc=Nn.trustedTypes,l0=sc?sc.emptyScript:"",u0=Nn.reactiveElementPolyfillSupport,bi=(r,e)=>r,Ko={toAttribute(r,e){switch(e){case Boolean:r=r?l0:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},ac=(r,e)=>!r0(r,e),oc={attribute:!0,type:String,converter:Ko,reflect:!1,hasChanged:ac};Symbol.metadata??=Symbol("metadata"),Nn.litPropertyMetadata??=new WeakMap;var mt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=oc){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&i0(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){let{get:n,set:s}=n0(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n?.call(this)},set(o){let l=n?.call(this);s.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??oc}static _$Ei(){if(this.hasOwnProperty(bi("elementProperties")))return;let e=a0(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(bi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(bi("properties"))){let t=this.properties,i=[...s0(t),...o0(t)];for(let n of i)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)t.unshift(jn(n))}else e!==void 0&&t.push(jn(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Xo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:Ko).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Ko;this._$Em=n,this[n]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??ac)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};mt.elementStyles=[],mt.shadowRootOptions={mode:"open"},mt[bi("elementProperties")]=new Map,mt[bi("finalized")]=new Map,u0?.({ReactiveElement:mt}),(Nn.reactiveElementVersions??=[]).push("2.0.4");var Qo=globalThis,Un=Qo.trustedTypes,lc=Un?Un.createPolicy("lit-html",{createHTML:r=>r}):void 0,ea="$lit$",vt=`lit$${Math.random().toFixed(9).slice(2)}$`,ta="?"+vt,c0=`<${ta}>`,Kt=document,xi=()=>Kt.createComment(""),ki=r=>r===null||typeof r!="object"&&typeof r!="function",ra=Array.isArray,fc=r=>ra(r)||typeof r?.[Symbol.iterator]=="function",Yo=`[
2
+ \f\r]`,wi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,uc=/-->/g,cc=/>/g,Jt=RegExp(`>|${Yo}(?:([^\\s"'>=/]+)(${Yo}*=${Yo}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),dc=/'/g,pc=/"/g,gc=/^(?:script|style|textarea|title)$/i,ia=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),_=ia(1),Em=ia(2),Sm=ia(3),tt=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),hc=new WeakMap,Xt=Kt.createTreeWalker(Kt,129);function mc(r,e){if(!ra(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return lc!==void 0?lc.createHTML(e):e}var vc=(r,e)=>{let t=r.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=wi;for(let l=0;l<t;l++){let a=r[l],u,d,c=-1,p=0;for(;p<a.length&&(o.lastIndex=p,d=o.exec(a),d!==null);)p=o.lastIndex,o===wi?d[1]==="!--"?o=uc:d[1]!==void 0?o=cc:d[2]!==void 0?(gc.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Jt):d[3]!==void 0&&(o=Jt):o===Jt?d[0]===">"?(o=n??wi,c=-1):d[1]===void 0?c=-2:(c=o.lastIndex-d[2].length,u=d[1],o=d[3]===void 0?Jt:d[3]==='"'?pc:dc):o===pc||o===dc?o=Jt:o===uc||o===cc?o=wi:(o=Jt,n=void 0);let h=o===Jt&&r[l+1].startsWith("/>")?" ":"";s+=o===wi?a+c0:c>=0?(i.push(u),a.slice(0,c)+ea+a.slice(c)+vt+h):a+vt+(c===-2?l:h)}return[mc(r,s+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Ci=class r{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let s=0,o=0,l=e.length-1,a=this.parts,[u,d]=vc(e,t);if(this.el=r.createElement(u,i),Xt.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(n=Xt.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let c of n.getAttributeNames())if(c.endsWith(ea)){let p=d[o++],h=n.getAttribute(c).split(vt),g=/([.?@])?(.*)/.exec(p);a.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?qn:g[1]==="?"?Hn:g[1]==="@"?zn:Qt}),n.removeAttribute(c)}else c.startsWith(vt)&&(a.push({type:6,index:s}),n.removeAttribute(c));if(gc.test(n.tagName)){let c=n.textContent.split(vt),p=c.length-1;if(p>0){n.textContent=Un?Un.emptyScript:"";for(let h=0;h<p;h++)n.append(c[h],xi()),Xt.nextNode(),a.push({type:2,index:++s});n.append(c[p],xi())}}}else if(n.nodeType===8)if(n.data===ta)a.push({type:2,index:s});else{let c=-1;for(;(c=n.data.indexOf(vt,c+1))!==-1;)a.push({type:7,index:s}),c+=vt.length-1}s++}}static createElement(e,t){let i=Kt.createElement("template");return i.innerHTML=e,i}};function Yt(r,e,t=r,i){if(e===tt)return e;let n=i!==void 0?t._$Co?.[i]:t._$Cl,s=ki(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(r),n._$AT(r,t,i)),i!==void 0?(t._$Co??=[])[i]=n:t._$Cl=n),n!==void 0&&(e=Yt(r,n._$AS(r,e.values),n,i)),e}var Bn=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,n=(e?.creationScope??Kt).importNode(t,!0);Xt.currentNode=n;let s=Xt.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new Sr(s,s.nextSibling,this,e):a.type===1?u=new a.ctor(s,a.name,a.strings,this,e):a.type===6&&(u=new Vn(s,this,e)),this._$AV.push(u),a=i[++l]}o!==a?.index&&(s=Xt.nextNode(),o++)}return Xt.currentNode=Kt,n}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Sr=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Yt(this,e,t),ki(e)?e===N||e==null||e===""?(this._$AH!==N&&this._$AR(),this._$AH=N):e!==this._$AH&&e!==tt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):fc(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==N&&ki(this._$AH)?this._$AA.nextSibling.data=e:this.T(Kt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ci.createElement(mc(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(t);else{let s=new Bn(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=hc.get(e.strings);return t===void 0&&hc.set(e.strings,t=new Ci(e)),t}k(e){ra(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,n=0;for(let s of e)n===t.length?t.push(i=new r(this.O(xi()),this.O(xi()),this,this.options)):i=t[n],i._$AI(s),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Qt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,s){this.type=1,this._$AH=N,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=N}_$AI(e,t=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Yt(this,e,t,0),o=!ki(e)||e!==this._$AH&&e!==tt,o&&(this._$AH=e);else{let l=e,a,u;for(e=s[0],a=0;a<s.length-1;a++)u=Yt(this,l[i+a],t,a),u===tt&&(u=this._$AH[a]),o||=!ki(u)||u!==this._$AH[a],u===N?e=N:e!==N&&(e+=(u??"")+s[a+1]),this._$AH[a]=u}o&&!n&&this.j(e)}j(e){e===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},qn=class extends Qt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===N?void 0:e}},Hn=class extends Qt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==N)}},zn=class extends Qt{constructor(e,t,i,n,s){super(e,t,i,n,s),this.type=5}_$AI(e,t=this){if((e=Yt(this,e,t,0)??N)===tt)return;let i=this._$AH,n=e===N&&i!==N||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==N&&(i===N||n);n&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Vn=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Yt(this,e)}},_c={M:ea,P:vt,A:ta,C:1,L:vc,R:Bn,D:fc,V:Yt,I:Sr,H:Qt,N:Hn,U:zn,B:qn,F:Vn},d0=Qo.litHtmlPolyfillSupport;d0?.(Ci,Sr),(Qo.litHtmlVersions??=[]).push("3.2.1");var yc=(r,e,t)=>{let i=t?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=t?.renderBefore??null;i._$litPart$=n=new Sr(e.insertBefore(xi(),s),s,void 0,t??{})}return n._$AI(r),n};var j=class extends mt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=yc(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return tt}};j._$litElement$=!0,j.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:j});var p0=globalThis.litElementPolyfillSupport;p0?.({LitElement:j});(globalThis.litElementVersions??=[]).push("4.1.1");var Ei=class Ei extends HTMLElement{constructor(){super();M(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(t,i,n){if(i!==n&&Ei.observedAttributes.includes(t)){switch(t){case"name":this.name=n||"";break}this.render()}}resolveIcon(t){throw new Error("Not implemented")}render(){let t=document.createElement("style");for(t.textContent=`
4
4
  :host {
5
5
  display: inline-block;
6
6
  line-height: 0;
7
7
  }
8
- `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(t);if(!this.name)return;let i=this.resolveIcon(this.name);if(!i){console.warn(`'${this.name}' not found, please add it to ${ki.name}`);return}let o=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;o.setAttribute("fill","currentColor"),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};M(ki,"observedAttributes",["name"]);var Hn=ki;var uc={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
8
+ `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(t);if(!this.name)return;let i=this.resolveIcon(this.name);if(!i){console.warn(`'${this.name}' not found, please add it to ${Ei.name}`);return}let o=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;o.setAttribute("fill","currentColor"),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};M(Ei,"observedAttributes",["name"]);var Wn=Ei;var bc={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
9
9
  <path d="M12 6V12H16.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
10
  </svg>`,"arrow-path":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <path d="M16.0228 9.34841H21.0154V9.34663M2.98413 19.6444V14.6517M2.98413 14.6517L7.97677 14.6517M2.98413 14.6517L6.16502 17.8347C7.15555 18.8271 8.41261 19.58 9.86436 19.969C14.2654 21.1483 18.7892 18.5364 19.9685 14.1353M4.03073 9.86484C5.21 5.46374 9.73377 2.85194 14.1349 4.03121C15.5866 4.4202 16.8437 5.17312 17.8342 6.1655L21.0154 9.34663M21.0154 4.3558V9.34663" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -101,17 +101,17 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
101
101
  <path d="M12 6.04168C10.4077 4.61656 8.30506 3.75 6 3.75C4.94809 3.75 3.93834 3.93046 3 4.26212V18.5121C3.93834 18.1805 4.94809 18 6 18C8.30506 18 10.4077 18.8666 12 20.2917M12 6.04168C13.5923 4.61656 15.6949 3.75 18 3.75C19.0519 3.75 20.0617 3.93046 21 4.26212V18.5121C20.0617 18.1805 19.0519 18 18 18C15.6949 18 13.5923 18.8666 12 20.2917M12 6.04168V20.2917" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
102
102
  </svg>`,share:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
103
103
  <path d="M7.21721 10.9071C6.83295 10.2169 6.096 9.75 5.25 9.75C4.00736 9.75 3 10.7574 3 12C3 13.2426 4.00736 14.25 5.25 14.25C6.096 14.25 6.83295 13.7831 7.21721 13.0929M7.21721 10.9071C7.39737 11.2307 7.5 11.6034 7.5 12C7.5 12.3966 7.39737 12.7693 7.21721 13.0929M7.21721 10.9071L16.7828 5.5929M7.21721 13.0929L16.7828 18.4071M16.7828 18.4071C16.6026 18.7307 16.5 19.1034 16.5 19.5C16.5 20.7426 17.5074 21.75 18.75 21.75C19.9926 21.75 21 20.7426 21 19.5C21 18.2574 19.9926 17.25 18.75 17.25C17.904 17.25 17.1671 17.7169 16.7828 18.4071ZM16.7828 5.5929C17.1671 6.28309 17.904 6.75 18.75 6.75C19.9926 6.75 21 5.74264 21 4.5C21 3.25736 19.9926 2.25 18.75 2.25C17.5074 2.25 16.5 3.25736 16.5 4.5C16.5 4.89664 16.6026 5.26931 16.7828 5.5929Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
104
- </svg>`};var a0=uc,Zo=class extends Hn{resolveIcon(e){return a0[e]}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found");e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(t=>{t.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",Zo);function na(r){return[...r.v,(r.i?"!":"")+r.n].join(":")}function l0(r,e=","){return r.map(na).join(e)}var mc=typeof CSS<"u"&&CSS.escape||(r=>r.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function zn(r){for(var e=9,t=r.length;t--;)e=Math.imul(e^r.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Gn(r,e="@media "){return e+Q(r).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function Q(r=[]){return Array.isArray(r)?r:r==null?[]:[r]}function cc(r){return r}function Zn(){}var ge={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function vc(r){return r.match(/[-=:;]/g)?.length||0}function Qo(r){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(r)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(vc(r),15)<<18}var u0=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function sa({n:r,i:e,v:t=[]},i,n,s){r&&(r=na({n:r,i:e,v:t})),s=[...Q(s)];for(let l of t){let a=i.theme("screens",l);for(let u of Q(a&&Gn(a)||i.v(l))){var o;s.push(u),n|=a?67108864|Qo(u):l=="dark"?1073741824:u[0]=="@"?Qo(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~u0.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:r,p:n,r:s,i:e}}var _c=new Map;function ea(r){if(r.d){let e=[],t=Jo(r.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?Jo(i,s=>Jo(n,o=>{let l=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(l){let a=s.indexOf(l[1]);return~a?s.slice(0,a)+l[0]+s.slice(a+l[1].length):Xo(s,o)}return Xo(o,s)})):i,"&"),i=>Xo(i,r.n?"."+mc(r.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",r.d)}}function Jo(r,e){return r.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,n)=>e(i)+n)}function Xo(r,e){return r.replace(/&/g,e)}var dc=new Intl.Collator("en",{numeric:!0});function yc(r,e){for(var t=0,i=r.length;t<i;){let n=i+t>>1;0>=bc(r[n],e)?t=n+1:i=n}return i}function bc(r,e){let t=r.p&ge.o;return t==(e.p&ge.o)&&(t==ge.b||t==ge.o)?0:r.p-e.p||r.o-e.o||dc.compare(pc(r.n),pc(e.n))||dc.compare(hc(r.n),hc(e.n))}function pc(r){return(r||"").split(/:/).pop().split("/").pop()||"\0"}function hc(r){return(r||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ko(r,e){return Math.round(parseInt(r,16)*e)}function Je(r,e={}){if(typeof r=="function")return r(e);let{opacityValue:t="1",opacityVariable:i}=e,n=i?`var(${i})`:t;if(r.includes("<alpha-value>"))return r.replace("<alpha-value>",n);if(r[0]=="#"&&(r.length==4||r.length==7)){let s=(r.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Ko(r.substr(1,s),o),Ko(r.substr(1+s,s),o),Ko(r.substr(1+2*s,s),o),n]})`}return n=="1"?r:n=="0"?"#0000":r.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function wc(r,e,t,i,n=[]){return function s(o,{n:l,p:a,r:u=[],i:d},c){let p=[],h="",g=0,m=0;for(let _ in o||{}){var y,w;let x=o[_];if(_[0]=="@"){if(!x)continue;if(_[1]=="a"){p.push(...aa(l,a,Wn(""+x),c,a,u,d,!0));continue}if(_[1]=="l"){for(let S of Q(x))p.push(...s(S,{n:l,p:(y=ge[_[7]],a&~ge.o|y),r:_[7]=="d"?[]:u,i:d},c));continue}if(_[1]=="i"){p.push(...Q(x).map(S=>({p:-1,o:0,r:[],d:_+" "+S})));continue}if(_[1]=="k"){p.push({p:ge.d,o:0,r:[_],d:s(x,{p:ge.d},c).map(ea).join("")});continue}if(_[1]=="f"){p.push(...Q(x).map(S=>({p:ge.d,o:0,r:[_],d:s(S,{p:ge.d},c).map(ea).join("")})));continue}}if(typeof x!="object"||Array.isArray(x))_=="label"&&x?l=x+zn(JSON.stringify([a,d,o])):(x||x===0)&&(_=_.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),m+=1,g=Math.max(g,(w=_)[0]=="-"?0:vc(w)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(w)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+Q(x).map(S=>c.s(_,oa(""+S,c.theme)+(d?" !important":""))).join(";"));else if(_[0]=="@"||_.includes("&")){let S=a;_[0]=="@"&&(_=_.replace(/\bscreen\(([^)]+)\)/g,(R,B)=>{let N=c.theme("screens",B);return N?(S|=67108864,Gn(N,"")):R}),S|=Qo(_)),p.push(...s(x,{n:l,p:S,r:[...u,_],i:d},c))}else p.push(...s(x,{p:a,r:[...u,_]},c))}return p.unshift({n:l,p:a,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:u,d:h}),p.sort(bc)}(r,sa(e,t,i,n),t)}function oa(r,e){return r.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,n,s,o="")=>{let l=e(n,o);return typeof l=="function"&&/color|fill|stroke/i.test(n)?Je(l):""+Q(l).filter(a=>Object(a)!==a)})}function xc(r,e){let t,i=[];for(let n of r)n.d&&n.n?t?.p==n.p&&""+t.r==""+n.r?(t.c=[t.c,n.c].filter(Boolean).join(" "),t.d=t.d+";"+n.d):i.push(t={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function Vn(r,e,t=ge.u,i,n){let s=[];for(let o of r)for(let l of function(a,u,d,c,p){a={...a,i:a.i||p};let h=function(g,m){let y=_c.get(g.n);return y?y(g,m):m.r(g.n,g.v[0]=="dark")}(a,u);return h?typeof h=="string"?({r:c,p:d}=sa(a,u,d,c),xc(Vn(Wn(h),u,d,c,a.i),a.n)):Array.isArray(h)?h.map(g=>{var m,y;return{o:0,...g,r:[...Q(c),...Q(g.r)],p:(m=d,y=g.p??d,m&~ge.o|y)}}):wc(h,a,u,d,c):[{c:na(a),p:0,o:0,r:[]}]}(o,e,t,i,n))s.splice(yc(s,l),0,l);return s}function aa(r,e,t,i,n,s,o,l){return xc((l?t.flatMap(a=>Vn([a],i,n,s,o)):Vn(t,i,n,s,o)).map(a=>a.p&ge.o&&(a.n||e==ge.b)?{...a,p:a.p&~ge.o|e,o:0}:a),r)}function c0(r,e,t,i){var n;return n=(s,o)=>{let{n:l,p:a,r:u,i:d}=sa(s,o,e);return t&&aa(l,e,t,o,a,u,d,i)},_c.set(r,n),r}function Yo(r,e,t){if(r[r.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let l of r)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),n=!n),l.endsWith(":")){i[l=="dark:"?"unshift":"push"](l.slice(0,-1));continue}l[0]=="-"&&(l=l.slice(1),s=!s),l.endsWith("-")&&(l=l.slice(0,-1)),l&&l!="&"&&(o+=(o&&"-")+l)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(d0),i:n}))}}function d0(r,e,t){return t.indexOf(r)==e}var fc=new Map;function Wn(r){let e=fc.get(r);if(!e){let t=[],i=[[]],n=0,s=0,o=null,l=0,a=(u,d=0)=>{n!=l&&(t.push(r.slice(n,l+d)),u&&Yo(t,i)),n=l+1};for(;l<r.length;l++){let u=r[l];if(s)r[l-1]!="\\"&&(s+=+(u=="[")||-(u=="]"));else if(u=="[")s+=1;else if(o)r[l-1]!="\\"&&o.test(r.slice(l))&&(o=null,n=l+RegExp.lastMatch.length);else if(u=="/"&&r[l-1]!="\\"&&(r[l+1]=="*"||r[l+1]=="/"))o=r[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(u=="(")a(),t.push(u);else if(u==":")r[l+1]!=":"&&a(!1,1);else if(/[\s,)]/.test(u)){a(!0);let d=t.lastIndexOf("(");if(u==")"){let c=t[d-1];if(/[~@]$/.test(c)){let p=i.shift();t.length=d,Yo([...t,"#"],i);let{v:h}=i[0].pop();for(let g of p)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);Yo([...t,c0(c.length>1?c.slice(0,-1)+zn(JSON.stringify([c,p])):c+"("+l0(p)+")",ge.a,p,/@$/.test(c))],i)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(u)&&r[l+1]=="("&&i.unshift([])}a(!0),fc.set(r,e=i[0])}return e}function $(r,e,t){return[r,ta(e,t)]}function ta(r,e){return typeof r=="function"?r:typeof r=="string"&&/^[\w-]+$/.test(r)?(t,i)=>({[r]:e?e(t,i):ra(t,1)}):t=>r||{[t[1]]:ra(t,2)}}function ra(r,e,t=r.slice(e).find(Boolean)||r.$$||r.input){return r.input[0]=="-"?`calc(${t} * -1)`:t}function T(r,e,t,i){return[r,la(e,t,i)]}function la(r,e,t){let i=typeof e=="string"?(n,s)=>({[e]:t?t(n,s):n._}):e||(({1:n,_:s},o,l)=>({[n||l]:s}));return(n,s)=>{let o=kc(r||n[1]),l=s.theme(o,n.$$)??ot(n.$$,o,s);if(l!=null)return n._=ra(n,0,l),i(n,s,o)}}function me(r,e={},t){return[r,p0(e,t)]}function p0(r={},e){return(t,i)=>{let{section:n=kc(t[0]).replace("-","")+"Color"}=r,[s,o]=h0(t.$$);if(!s)return;let l=i.theme(n,s)||ot(s,n,i);if(!l||typeof l=="object")return;let{opacityVariable:a=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:u=n.replace("Color","Opacity"),property:d=n,selector:c}=r,p=i.theme(u,o||"DEFAULT")||o&&ot(o,u,i),h=e||(({_:m})=>{let y=Ci(d,m);return c?{[c]:y}:y});t._={value:Je(l,{opacityVariable:a||void 0,opacityValue:p||void 0}),color:m=>Je(l,m),opacityVariable:a||void 0,opacityValue:p||void 0};let g=h(t,i);if(!t.dark){let m=i.d(n,s,l);m&&m!==l&&(t._={value:Je(m,{opacityVariable:a||void 0,opacityValue:p||"1"}),color:y=>Je(m,y),opacityVariable:a||void 0,opacityValue:p||void 0},g={"&":g,[i.v("dark")]:h(t,i)})}return g}}function h0(r){return(r.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Ci(r,e){let t={};return typeof e=="string"?t[r]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[r]=e.value),t}function ot(r,e,t){if(r[0]=="["&&r.slice(-1)=="]"){if(r=Er(oa(r.slice(1,-1),t.theme)),!e)return r;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(r)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(r))||/image/i.test(e)&&!(/^image:/.test(r)||/^[a-z-]+\(/.test(r))||/weight/i.test(e)&&!(/^(number|any):/.test(r)||/^\d+$/.test(r))||/position/i.test(e)&&/^(length|size):/.test(r)))return r.replace(/^[a-z-]+:/,"")}}function kc(r){return r.replace(/-./g,e=>e[1].toUpperCase())}function Er(r){return r.includes("url(")?r.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,n="")=>Er(t)+i+Er(n)):r.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function ua({presets:r=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Q(e.variants),rules:Q(e.rules),ignorelist:Q(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of Q([...r,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Q(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:l,variants:a,rules:u,ignorelist:d,hash:c=t.hash,stringify:p=t.stringify,finalize:h}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&n!==!1&&[...t.preflight,...Q(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Q(a)],rules:[...t.rules,...Q(u)],ignorelist:[...t.ignorelist,...Q(d)],hash:c,stringify:p,finalize:[...t.finalize,...Q(h)]}}return t}function gc(r,e,t,i,n,s){for(let o of e){let l=t.get(o);l||t.set(o,l=i(o));let a=l(r,n,s);if(a)return a}}function f0(r){var e;return ia(r[0],typeof(e=r[1])=="function"?e:()=>e)}function g0(r){var e,t;return Array.isArray(r)?ia(r[0],ta(r[1],r[2])):ia(r,ta(e,t))}function ia(r,e){return Cc(r,(t,i,n,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,n)})}function Cc(r,e){let t=Q(r).map(m0);return(i,n,s)=>{for(let o of t){let l=e(i,o,n,s);if(l)return l}}}function m0(r){return typeof r=="string"?RegExp("^"+r+(r.includes("$")||r.slice(-1)=="-"?"":"$")):r}function Sc(r,e){let t=ua(r),i=function({theme:a,darkMode:u,darkColor:d=Zn,variants:c,rules:p,hash:h,stringify:g,ignorelist:m,finalize:y}){let w=new Map,_=new Map,x=new Map,S=new Map,R=Cc(m,(P,U)=>U.test(P));c.push(["dark",Array.isArray(u)||u=="class"?`${Q(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let B=typeof h=="function"?P=>h(P,zn):h?zn:cc;B!==cc&&y.push(P=>({...P,n:P.n&&B(P.n),d:P.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(U,W)=>"--"+B(W).replace("#",""))}));let N={theme:function({extend:P={},...U}){let W={},xe={get colors(){return ce("colors")},theme:ce,negative(){return{}},breakpoints(Z){let X={};for(let de in Z)typeof Z[de]=="string"&&(X["screen-"+de]=Z[de]);return X}};return ce;function ce(Z,X,de,Ne){if(Z){if({1:Z,2:Ne}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Z)||[,Z],/[.[]/.test(Z)){let $e=[];Z.replace(/\[([^\]]+)\]|([^.[]+)/g,(ie,_e,Me=_e)=>$e.push(Me)),Z=$e.shift(),de=X,X=$e.join("-")}let ae=W[Z]||Object.assign(Object.assign(W[Z]={},je(U,Z)),je(P,Z));if(X==null)return ae;X||(X="DEFAULT");let Ee=ae[X]??X.split("-").reduce(($e,ie)=>$e?.[ie],ae)??de;return Ne?Je(Ee,{opacityValue:oa(Ne,ce)}):Ee}let He={};for(let ae of[...Object.keys(U),...Object.keys(P)])He[ae]=ce(ae);return He}function je(Z,X){let de=Z[X];return typeof de=="function"&&(de=de(xe)),de&&/color|fill|stroke/i.test(X)?function Ne(He,ae=[]){let Ee={};for(let $e in He){let ie=He[$e],_e=[...ae,$e];Ee[_e.join("-")]=ie,$e=="DEFAULT"&&(_e=ae,Ee[ae.join("-")]=ie),typeof ie=="object"&&Object.assign(Ee,Ne(ie,_e))}return Ee}(de):de}}(a),e:mc,h:B,s(P,U){return g(P,U,N)},d(P,U,W){return d(P,U,N,W)},v(P){return w.has(P)||w.set(P,gc(P,c,_,f0,N)||"&:"+P),w.get(P)},r(P,U){let W=JSON.stringify([P,U]);return x.has(W)||x.set(W,!R(P,N)&&gc(P,p,S,g0,N,U)),x.get(W)},f(P){return y.reduce((U,W)=>W(U,N),P)}};return N}(t),n=new Map,s=[],o=new Set;e.resume(a=>n.set(a,a),(a,u)=>{e.insert(a,s.length,u),s.push(u),o.add(a)});function l(a){let u=i.f(a),d=ea(u);if(d&&!o.has(d)){o.add(d);let c=yc(s,a);e.insert(d,c,a),s.splice(c,0,a)}return u.n}return Object.defineProperties(function(u){if(!n.size)for(let c of Q(t.preflight))typeof c=="function"&&(c=c(i)),c&&(typeof c=="string"?aa("",ge.b,Wn(c),i,ge.b,[],!1,!0):wc(c,{},i,ge.b)).forEach(l);u=""+u;let d=n.get(u);if(!d){let c=new Set;for(let p of Vn(Wn(u),i))c.add(p.c).add(l(p));d=[...c].filter(Boolean).join(" "),n.set(u,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let a=e.snapshot(),u=new Set(o),d=new Map(n),c=[...s];return()=>{a(),o=u,n=d,s=c}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function v0(r,e){return r!=e&&""+r.split(" ").sort()!=""+e.split(" ").sort()}function Ec(r){let e=new MutationObserver(t);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),t([{target:n,type:""}])},disconnect(){e.disconnect()}};function t(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let l of o.querySelectorAll("[class]"))i(l);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&v0(o,s=r(o))&&n.setAttribute("class",s)}}function _0(r){let e=document.querySelector(r||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Jn(r){let e=r?.cssRules?r:(r&&typeof r!="string"?r:_0(r)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,i){try{e.insertRule(t,i)}catch{e.insertRule(":root{}",i)}},resume:Zn}}var y0=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function $c(r){return y0.get(r)}function Ic(r){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(r);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Ac(r,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(r);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var b0=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Tc(){return({stringify:r})=>({stringify(e,t,i){let n="",s=$c(e);s&&(n+=r(s,t,i)+";");let o=Ic(e),l=Ac(e,t);for(let a of b0)o&a[1]&&(n+=r(a[0]+e,t,i)+";"),l&a[1]&&(n+=r(e,a[0]+t,i)+";");return n+r(e,t,i)}})}function Pc(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",la("lineClamp",({_:r})=>Mc(r))],["line-clamp-(\\d+)",({1:r})=>Mc(r)]]}}function Mc(r){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${r}`}}var Ei={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...ze(4,"rem",4,.5,.5),...ze(12,"rem",4,5),14:"3.5rem",...ze(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:G("blur"),backdropBrightness:G("brightness"),backdropContrast:G("contrast"),backdropGrayscale:G("grayscale"),backdropHueRotate:G("hueRotate"),backdropInvert:G("invert"),backdropOpacity:G("opacity"),backdropSaturate:G("saturate"),backdropSepia:G("sepia"),backgroundColor:G("colors"),backgroundImage:{none:"none"},backgroundOpacity:G("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...ze(200,"",100,0,50),...ze(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:r})=>({DEFAULT:r("colors.gray.200","currentColor"),...r("colors")}),borderOpacity:G("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:G("spacing"),borderWidth:{DEFAULT:"1px",...Xe(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:G("colors"),caretColor:G("colors"),accentColor:({theme:r})=>({auto:"auto",...r("colors")}),contrast:{...ze(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:G("borderColor"),divideOpacity:G("borderOpacity"),divideWidth:G("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:r})=>({...r("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:r})=>({...r("spacing"),...Si(2,6),...Si(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:G("spacing"),gradientColorStops:G("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:r})=>({...r("spacing"),...Si(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:r})=>({...r("spacing"),...Si(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...ze(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:r})=>({auto:"auto",...r("spacing")}),maxHeight:({theme:r})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...r("spacing")}),maxWidth:({theme:r,breakpoints:e})=>({...e(r("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...ze(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:G("spacing"),placeholderColor:G("colors"),placeholderOpacity:G("opacity"),outlineColor:G("colors"),outlineOffset:Xe(8,"px"),outlineWidth:Xe(8,"px"),ringColor:({theme:r})=>({...r("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:G("colors"),ringOffsetWidth:Xe(8,"px"),ringOpacity:({theme:r})=>({...r("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Xe(8,"px")},rotate:{...Xe(2,"deg"),...Xe(12,"deg",3),...Xe(180,"deg",45)},saturate:ze(200,"",100,0,50),scale:{...ze(150,"",100,0,50),...ze(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:G("spacing"),scrollPadding:G("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Xe(2,"deg"),...Xe(12,"deg",3)},space:G("spacing"),stroke:({theme:r})=>({...r("colors"),none:"none"}),strokeWidth:ze(2),textColor:G("colors"),textDecorationColor:G("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Xe(8,"px")},textUnderlineOffset:{auto:"auto",...Xe(8,"px")},textIndent:G("spacing"),textOpacity:G("opacity"),transitionDuration:({theme:r})=>({...r("durations"),DEFAULT:"150ms"}),transitionDelay:G("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:r})=>({...r("spacing"),...Si(2,4),full:"100%"}),width:({theme:r})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...r("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...ze(50,"",1,0,10),auto:"auto"}};function Si(r,e){let t={};do for(var i=1;i<r;i++)t[`${i}/${r}`]=Number((i/r*100).toFixed(6))+"%";while(++r<=e);return t}function Xe(r,e,t=0){let i={};for(;t<=r;t=2*t||1)i[t]=t+e;return i}function ze(r,e="",t=1,i=0,n=1,s={}){for(;i<=r;i+=n)s[i]=i/t+e;return s}function G(r){return({theme:e})=>e(r)}var Rc={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Ei.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Ei.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Nc=[$("\\[([-\\w]+):(.+)]",({1:r,2:e},t)=>({"@layer overrides":{"&":{[r]:ot(`[${e}]`,"",t)}}})),$("(group|peer)([~/][^-[]+)?",({input:r},{h:e})=>[{c:e(r)}]),T("aspect-","aspectRatio"),$("container",(r,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let l in t){let a=t[l];typeof a=="string"&&(s[Gn(a)]={"&":{maxWidth:a,...o(l)}})}return s;function o(l){let a=n&&(typeof n=="string"?n:n[l]||n.DEFAULT);if(a)return{paddingRight:a,paddingLeft:a}}}),T("content-","content",({_:r})=>({"--tw-content":r,content:"var(--tw-content)"})),$("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),$("box-(border|content)","boxSizing",({1:r})=>r+"-box"),$("hidden",{display:"none"}),$("table-(auto|fixed)","tableLayout"),$(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",$("isolate","isolation"),$("object-(contain|cover|fill|none|scale-down)","objectFit"),T("object-","objectPosition"),$("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Xn),$("overscroll(-[xy])?-(auto|contain|none)",({1:r="",2:e})=>({["overscroll-behavior"+r]:e})),$("(static|fixed|absolute|relative|sticky)","position"),T("-?inset(-[xy])?(?:$|-)","inset",({1:r,_:e})=>({top:r!="-x"&&e,right:r!="-y"&&e,bottom:r!="-x"&&e,left:r!="-y"&&e})),T("-?(top|bottom|left|right)(?:$|-)","inset"),$("(visible|collapse)","visibility"),$("invisible",{visibility:"hidden"}),T("-?z-","zIndex"),$("flex-((row|col)(-reverse)?)","flexDirection",Oc),$("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),T("(flex-(?:grow|shrink))(?:$|-)"),T("(flex)-"),T("grow(?:$|-)","flexGrow"),T("shrink(?:$|-)","flexShrink"),T("basis-","flexBasis"),T("-?(order)-"),"-?(order)-(\\d+)",T("grid-cols-","gridTemplateColumns"),$("grid-cols-(\\d+)","gridTemplateColumns",jc),T("col-","gridColumn"),$("col-(span)-(\\d+)","gridColumn",Dc),T("col-start-","gridColumnStart"),$("col-start-(auto|\\d+)","gridColumnStart"),T("col-end-","gridColumnEnd"),$("col-end-(auto|\\d+)","gridColumnEnd"),T("grid-rows-","gridTemplateRows"),$("grid-rows-(\\d+)","gridTemplateRows",jc),T("row-","gridRow"),$("row-(span)-(\\d+)","gridRow",Dc),T("row-start-","gridRowStart"),$("row-start-(auto|\\d+)","gridRowStart"),T("row-end-","gridRowEnd"),$("row-end-(auto|\\d+)","gridRowEnd"),$("grid-flow-((row|col)(-dense)?)","gridAutoFlow",r=>Xn(Oc(r))),$("grid-flow-(dense)","gridAutoFlow"),T("auto-cols-","gridAutoColumns"),T("auto-rows-","gridAutoRows"),T("gap-x(?:$|-)","gap","columnGap"),T("gap-y(?:$|-)","gap","rowGap"),T("gap(?:$|-)","gap"),"(justify-(?:items|self))-",$("justify-","justifyContent",Lc),$("(content|items|self)-",r=>({["align-"+r[1]]:Lc(r)})),$("(place-(content|items|self))-",({1:r,$$:e})=>({[r]:("wun".includes(e[3])?"space-":"")+e})),T("p([xytrbl])?(?:$|-)","padding",$r("padding")),T("-?m([xytrbl])?(?:$|-)","margin",$r("margin")),T("-?space-(x|y)(?:$|-)","space",({1:r,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[r]]:`calc(${e} * calc(1 - var(--tw-space-${r}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[r]]:`calc(${e} * var(--tw-space-${r}-reverse))`}})),$("space-(x|y)-reverse",({1:r})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"1"}})),T("w-","width"),T("min-w-","minWidth"),T("max-w-","maxWidth"),T("h-","height"),T("min-h-","minHeight"),T("max-h-","maxHeight"),T("font-","fontWeight"),T("font-","fontFamily",({_:r})=>typeof(r=Q(r))[1]=="string"?{fontFamily:rt(r)}:{fontFamily:rt(r[0]),...r[1]}),$("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),$("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),$("italic","fontStyle"),$("not-italic",{fontStyle:"normal"}),$("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:r,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":r)]:r,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Mt({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),T("tracking-","letterSpacing"),T("leading-","lineHeight"),$("list-(inside|outside)","listStylePosition"),T("list-","listStyleType"),$("list-","listStyleType"),T("placeholder-opacity-","placeholderOpacity",({_:r})=>({"&::placeholder":{"--tw-placeholder-opacity":r}})),me("placeholder-",{property:"color",selector:"&::placeholder"}),$("text-(left|center|right|justify|start|end)","textAlign"),$("text-(ellipsis|clip)","textOverflow"),T("text-opacity-","textOpacity","--tw-text-opacity"),me("text-",{property:"color"}),T("text-","fontSize",({_:r})=>typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}),T("indent-","textIndent"),$("(overline|underline|line-through)","textDecorationLine"),$("no-underline",{textDecorationLine:"none"}),T("underline-offset-","textUnderlineOffset"),me("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),T("decoration-","textDecorationThickness"),$("decoration-","textDecorationStyle"),$("(uppercase|lowercase|capitalize)","textTransform"),$("normal-case",{textTransform:"none"}),$("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),$("align-","verticalAlign"),$("whitespace-","whiteSpace"),$("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),$("break-words",{overflowWrap:"break-word"}),$("break-all",{wordBreak:"break-all"}),$("break-keep",{wordBreak:"keep-all"}),me("caret-",{opacityVariable:!1,opacitySection:"opacity"}),me("accent-",{opacityVariable:!1,opacitySection:"opacity"}),$("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:r})=>`linear-gradient(to ${Qt(r," ")},var(--tw-gradient-stops))`),me("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-from":r.value,"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),me("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${r.value},var(--tw-gradient-to)`})),me("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),$("bg-(fixed|local|scroll)","backgroundAttachment"),$("bg-origin-(border|padding|content)","backgroundOrigin",({1:r})=>r+"-box"),$(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),$("bg-blend-","backgroundBlendMode"),$("bg-clip-(border|padding|content|text)","backgroundClip",({1:r})=>r+(r=="text"?"":"-box")),T("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),me("bg-",{section:"backgroundColor"}),T("bg-","backgroundImage"),T("bg-","backgroundPosition"),$("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Xn),T("bg-","backgroundSize"),T("rounded(?:$|-)","borderRadius"),T("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:r,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[r]||[r,r];return{[`border-${Qt(t[0])}-radius`]:e,[`border-${Qt(t[1])}-radius`]:e}}),$("border-(collapse|separate)","borderCollapse"),T("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),$("border-(solid|dashed|dotted|double|none)","borderStyle"),T("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:r,_:e})=>({...Mt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(r||"-x")]:e,["--tw-border-spacing"+(r||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),me("border-([xytrbl])-",{section:"borderColor"},$r("border","Color")),me("border-"),T("border-([xytrbl])(?:$|-)","borderWidth",$r("border","Width")),T("border(?:$|-)","borderWidth"),T("divide-opacity(?:$|-)","divideOpacity",({_:r})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":r}})),$("divide-(solid|dashed|dotted|double|none)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:r}})),$("divide-([xy]-reverse)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+r]:"1"}})),T("divide-([xy])(?:$|-)","divideWidth",({1:r,_:e})=>{let t={x:"lr",y:"tb"}[r];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${r}-reverse`]:"0",[`border-${Qt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${r}-reverse)))`,[`border-${Qt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${r}-reverse))`}}}),me("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),T("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),me("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),T("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),$("ring-inset",{"--tw-ring-inset":"inset"}),me("ring-",{property:"--tw-ring-color"}),T("ring(?:$|-)","ringWidth",({_:r},{theme:e})=>({...Mt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Je(e("ringOffsetColor","","#fff")),"--tw-ring-color":Je(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${r} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),me("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-shadow-color":r.value,"--tw-shadow":"var(--tw-shadow-colored)"})),T("shadow(?:$|-)","boxShadow",({_:r})=>({...Mt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":rt(r),"--tw-shadow-colored":rt(r).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),T("(opacity)-"),$("mix-blend-","mixBlendMode"),...Fc(),...Fc("backdrop-"),T("transition(?:$|-)","transitionProperty",(r,{theme:e})=>({transitionProperty:rt(r),transitionTimingFunction:r._=="none"?void 0:rt(e("transitionTimingFunction","")),transitionDuration:r._=="none"?void 0:rt(e("transitionDuration",""))})),T("duration(?:$|-)","transitionDuration","transitionDuration",rt),T("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",rt),T("delay(?:$|-)","transitionDelay","transitionDelay",rt),T("animate(?:$|-)","animation",(r,{theme:e,h:t,e:i})=>{let n=rt(r),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",$("transform",da),$("transform-(cpu|gpu)",({1:r})=>({"--tw-transform":Uc(r=="gpu")})),T("scale(-[xy])?-","scale",({1:r,_:e})=>({["--tw-scale"+(r||"-x")]:e,["--tw-scale"+(r||"-y")]:e,...da()})),T("-?(rotate)-","rotate",ca),T("-?(translate-[xy])-","translate",ca),T("-?(skew-[xy])-","skew",ca),$("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Xn),"(appearance)-",T("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",T("(cursor)-"),"(cursor)-",$("snap-(none)","scroll-snap-type"),$("snap-(x|y|both)",({1:r})=>({...Mt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":r+" var(--tw-scroll-snap-strictness)"})),$("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),$("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),$("snap-(normal|always)","scroll-snap-stop"),$("scroll-(auto|smooth)","scroll-behavior"),T("scroll-p([xytrbl])?(?:$|-)","padding",$r("scroll-padding")),T("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",$r("scroll-margin")),$("touch-(auto|none|manipulation)","touch-action"),$("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:r,2:e,3:t})=>({...Mt({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":r}`]:r,"touch-action":"var(--tw-touch-action)"})),$("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),$("outline",{outlineStyle:"solid"}),$("outline-(dashed|dotted|double)","outlineStyle"),T("-?(outline-offset)-"),me("outline-",{opacityVariable:!1,opacitySection:"opacity"}),T("outline-","outlineWidth"),"(pointer-events)-",T("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:r})=>({x:"horizontal",y:"vertical"})[r]||r||"both"],$("select-(none|text|all|auto)","userSelect"),me("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),me("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),T("stroke-","strokeWidth"),$("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),$("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Xn(r){return(typeof r=="string"?r:r[1]).replace(/-/g," ").trim()}function Oc(r){return(typeof r=="string"?r:r[1]).replace("col","column")}function Qt(r,e="-"){let t=[];for(let i of r)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function rt(r){return r&&""+(r._||r)}function Lc({$$:r}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[r[3]||""]||"")+r}function $r(r,e=""){return({1:t,_:i})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...Ci(r+"-"+Qt(n[0])+e,i),...Ci(r+"-"+Qt(n[1])+e,i)}:Ci(r+e,i)}}function Fc(r=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",r&&"opacity","saturate","sepia",!r&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${r}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...Mt(t),[`${r}filter`]:e.map(i=>`var(--tw-${r}${i})`).join(" ")},[`(${r}filter)-(none)`,$(`${r}filter`,t),...e.map(i=>T(`${i[0]=="h"?"-?":""}(${r}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:Q(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function ca({1:r,_:e}){return{["--tw-"+r]:e,...da()}}function da(){return{...Mt({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Uc()}),transform:"var(--tw-transform)"}}function Uc(r){return[r?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Dc({1:r,2:e}){return`${r} ${e} / ${r} ${e}`}function jc({1:r}){return`repeat(${r},minmax(0,1fr))`}function Mt(r){return{"@layer defaults":{"*,::before,::after":r,"::backdrop":r}}}var Bc=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:r})=>`@media (orientation:${r})`],["contrast-(more|less)",({1:r})=>`@media (prefers-contrast:${r})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:r})=>`&::${r}`],["(marker|selection)",({1:r})=>`& *::${r},&::${r}`],["file","&::file-selector-button"],["(first|last|only)",({1:r})=>`&:${r}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:r,$$:e},t)=>e&&`&[${r}-${t.theme(r,e)||ot(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:r,3:e="",4:t,5:i="",6:n=e},{e:s,h:o,v:l})=>{let a=Er(i)||(t[0]=="["?t:l(t.slice(1)));return`${(a.includes("&")?a:"&"+a).replace(/&/g,`:merge(.${s(o(r+n))})`)}${r[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:r})=>`[dir="${r}"] &`],["supports-",({$$:r},e)=>{if(r&&(r=e.theme("supports",r)||ot(r,"",e)),r)return r.includes(":")||(r+=":var(--tw)"),/^\w*\s*\(/.test(r)||(r=`(${r})`),`@supports ${r.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:r},e)=>{if(r&&(r=e.theme("screens",r)||ot(r,"",e)),typeof r=="string")return`@media not all and (min-width:${r})`}],["min-",({$$:r},e)=>(r&&(r=ot(r,"",e)),r&&`@media (min-width:${r})`)],[/^\[(.+)]$/,({1:r})=>/[&@]/.test(r)&&Er(r).replace(/[}]+$/,"").split("{")]];function qc({colors:r,disablePreflight:e}={}){return{preflight:e?void 0:Rc,theme:{...Ei,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...r}},variants:Bc,rules:Nc,finalize(t){return t.n&&t.d&&t.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var w0={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},x0={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},k0={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},C0={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},S0={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},E0={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},$0={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},I0={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},A0={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},T0={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},M0={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},P0={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},R0={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},O0={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},L0={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},F0={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},D0={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},j0={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},N0={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},U0={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},B0={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},q0={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Hc={__proto__:null,slate:w0,gray:x0,zinc:k0,neutral:C0,stone:S0,red:E0,orange:$0,amber:I0,yellow:A0,lime:T0,green:M0,emerald:P0,teal:R0,cyan:O0,sky:L0,blue:F0,indigo:D0,violet:j0,purple:N0,fuchsia:U0,pink:B0,rose:q0};function zc({disablePreflight:r}={}){return qc({colors:Hc,disablePreflight:r})}function Gc({className:r="prose",defaultColor:e="gray",extend:t={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${r}-${s}`,(l,a)=>Zc(r,o[0]=="."?"."+a.e(a.h(o.slice(1))):o,a,u=>`& :is(${u.trim()})`)]),rules:[[`(lead|not-${r})`,({1:s},{h:o})=>[{c:o(s)}]],[`${r}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[r+"-",({$$:s},o)=>{let l=Wc(o.theme("fontSize",s));return l&&{"@layer components":l}}],[r+"-",({$$:s},o)=>n(s,o)],[r,(s,o)=>({...n(e,o),"@layer base":[Vc(r,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:D(20,16),marginBottom:D(20,16),paddingLeft:D(26,16)},li:{marginTop:D(8,16),marginBottom:D(8,16)},"ol>li,ul>li":{paddingLeft:D(6,16)},">ul>li p":{marginTop:D(12,16),marginBottom:D(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:D(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:D(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:D(12,16),marginBottom:D(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:D(48,16),marginBottom:D(48,16)},blockquote:{marginTop:D(32,20),marginBottom:D(32,20),paddingLeft:D(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:D(20,16),marginBottom:D(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:D(36,16),marginTop:"0",marginBottom:D(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:D(24,16),marginTop:D(48,24),marginBottom:D(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:D(20,16),marginTop:D(32,20),marginBottom:D(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:D(24,16),marginBottom:D(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:D(32,16),marginBottom:D(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:D(14,16),lineHeight:"1.4",marginTop:D(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:D(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:D(21,24)},"h3 code":{fontSize:D(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:D(14,16),lineHeight:"1.7",marginTop:D(24,14),marginBottom:D(24,14),borderRadius:"0.375rem",paddingTop:D(12,14),paddingRight:D(16,14),paddingBottom:D(12,14),paddingLeft:D(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:D(32,16),marginBottom:D(32,16),fontSize:D(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:D(8,14),paddingBottom:D(8,14),paddingLeft:D(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:D(8,14),paddingRight:D(8,14),paddingBottom:D(8,14),paddingLeft:D(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:D(20,16),lineHeight:"1.6",marginTop:D(24,20),marginBottom:D(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Vc(r,o,t)],"@layer components":{...Wc(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let l={},a={},u=(d,c,p)=>{let h=o.theme(`colors.${s}.${c}`,c);p["--tw-prose-"+d]=Je(h);let g=p!=a&&o.d("colors",`${s}-${c}`,h);g&&(a["--tw-prose-"+d]=Je(g))};for(let d in i){let c=i[d];d!="dark"&&c&&u(d,c,l)}for(let d in i.dark||{}){let c=i.dark[d];c&&(i.dark?u("invert-"+d,c,l):u(d,c,a))}return Object.keys(l).length?{"@layer defaults":{"&":l,[o.v("dark")]:a}}:void 0}}function Vc(r,e,t){let i={};for(let n in t)i[Zc(r,n,e,s=>`.${e.e(e.h(r))}${s}`)]=t[n];return i}function Zc(r,e,{e:t,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",l=s,a="")=>n(`${o}:where(${l}):not(:where(.${t(i("not-"+r))} *))${a}`))}function Wc(r){return r?typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}:void 0}function D(r,e){return`${(r/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var pa=ua({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[zc(),Tc(),Pc(),Gc()]});function Jc(r,e=!0){let t=function(){if(H0)try{let a=Jn(new CSSStyleSheet);return a.connect=u=>{let d=ha(u);d.adoptedStyleSheets=[...d.adoptedStyleSheets,a.target]},a.disconnect=Zn,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Jn(s)],l=new WeakMap;return{get target(){return o[0].target},snapshot(){let a=o.map(u=>u.snapshot());return()=>a.forEach(u=>u())},clear(){o.forEach(a=>a.clear())},destroy(){o.forEach(a=>a.destroy())},insert(a,u,d){o[0].insert(a,u,d);let c=this.target.cssRules[u];o.forEach((p,h)=>h&&p.target.insertRule(c.cssText,u))},resume(a,u){return o[0].resume(a,u)},connect(a){let u=document.createElement("style");ha(a).appendChild(u);let d=Jn(u),{cssRules:c}=this.target;for(let p=0;p<c.length;p++)d.target.insertRule(c[p].cssText,p);o.push(d),l.set(a,d)},disconnect(a){let u=o.indexOf(l.get(a));u>=0&&o.splice(u,1)}}}(),i=Sc({...r,hash:r.hash??e},t),n=Ec(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(ha(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=i}}}}var H0=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function ha(r){return r.shadowRoot||r.attachShadow({mode:"open"})}var z=r=>Jc(pa)(r);var Kn=class extends z(q){constructor(){super();M(this,"render",()=>C`
104
+ </svg>`};var h0=bc,na=class extends Wn{resolveIcon(e){return h0[e]}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found");e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(t=>{t.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",na);function fa(r){return[...r.v,(r.i?"!":"")+r.n].join(":")}function f0(r,e=","){return r.map(fa).join(e)}var $c=typeof CSS<"u"&&CSS.escape||(r=>r.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Gn(r){for(var e=9,t=r.length;t--;)e=Math.imul(e^r.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Xn(r,e="@media "){return e+Q(r).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function Q(r=[]){return Array.isArray(r)?r:r==null?[]:[r]}function wc(r){return r}function Kn(){}var ge={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Ic(r){return r.match(/[-=:;]/g)?.length||0}function ua(r){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(r)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(Ic(r),15)<<18}var g0=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function ga({n:r,i:e,v:t=[]},i,n,s){r&&(r=fa({n:r,i:e,v:t})),s=[...Q(s)];for(let l of t){let a=i.theme("screens",l);for(let u of Q(a&&Xn(a)||i.v(l))){var o;s.push(u),n|=a?67108864|ua(u):l=="dark"?1073741824:u[0]=="@"?ua(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~g0.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:r,p:n,r:s,i:e}}var Ac=new Map;function ca(r){if(r.d){let e=[],t=sa(r.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?sa(i,s=>sa(n,o=>{let l=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(l){let a=s.indexOf(l[1]);return~a?s.slice(0,a)+l[0]+s.slice(a+l[1].length):oa(s,o)}return oa(o,s)})):i,"&"),i=>oa(i,r.n?"."+$c(r.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",r.d)}}function sa(r,e){return r.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,n)=>e(i)+n)}function oa(r,e){return r.replace(/&/g,e)}var xc=new Intl.Collator("en",{numeric:!0});function Tc(r,e){for(var t=0,i=r.length;t<i;){let n=i+t>>1;0>=Mc(r[n],e)?t=n+1:i=n}return i}function Mc(r,e){let t=r.p&ge.o;return t==(e.p&ge.o)&&(t==ge.b||t==ge.o)?0:r.p-e.p||r.o-e.o||xc.compare(kc(r.n),kc(e.n))||xc.compare(Cc(r.n),Cc(e.n))}function kc(r){return(r||"").split(/:/).pop().split("/").pop()||"\0"}function Cc(r){return(r||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function aa(r,e){return Math.round(parseInt(r,16)*e)}function Je(r,e={}){if(typeof r=="function")return r(e);let{opacityValue:t="1",opacityVariable:i}=e,n=i?`var(${i})`:t;if(r.includes("<alpha-value>"))return r.replace("<alpha-value>",n);if(r[0]=="#"&&(r.length==4||r.length==7)){let s=(r.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[aa(r.substr(1,s),o),aa(r.substr(1+s,s),o),aa(r.substr(1+2*s,s),o),n]})`}return n=="1"?r:n=="0"?"#0000":r.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function Pc(r,e,t,i,n=[]){return function s(o,{n:l,p:a,r:u=[],i:d},c){let p=[],h="",g=0,m=0;for(let y in o||{}){var b,x;let k=o[y];if(y[0]=="@"){if(!k)continue;if(y[1]=="a"){p.push(...va(l,a,Jn(""+k),c,a,u,d,!0));continue}if(y[1]=="l"){for(let E of Q(k))p.push(...s(E,{n:l,p:(b=ge[y[7]],a&~ge.o|b),r:y[7]=="d"?[]:u,i:d},c));continue}if(y[1]=="i"){p.push(...Q(k).map(E=>({p:-1,o:0,r:[],d:y+" "+E})));continue}if(y[1]=="k"){p.push({p:ge.d,o:0,r:[y],d:s(k,{p:ge.d},c).map(ca).join("")});continue}if(y[1]=="f"){p.push(...Q(k).map(E=>({p:ge.d,o:0,r:[y],d:s(E,{p:ge.d},c).map(ca).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))y=="label"&&k?l=k+Gn(JSON.stringify([a,d,o])):(k||k===0)&&(y=y.replace(/[A-Z]/g,E=>"-"+E.toLowerCase()),m+=1,g=Math.max(g,(x=y)[0]=="-"?0:Ic(x)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(x)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+Q(k).map(E=>c.s(y,ma(""+E,c.theme)+(d?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let E=a;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(R,q)=>{let U=c.theme("screens",q);return U?(E|=67108864,Xn(U,"")):R}),E|=ua(y)),p.push(...s(k,{n:l,p:E,r:[...u,y],i:d},c))}else p.push(...s(k,{p:a,r:[...u,y]},c))}return p.unshift({n:l,p:a,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:u,d:h}),p.sort(Mc)}(r,ga(e,t,i,n),t)}function ma(r,e){return r.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,n,s,o="")=>{let l=e(n,o);return typeof l=="function"&&/color|fill|stroke/i.test(n)?Je(l):""+Q(l).filter(a=>Object(a)!==a)})}function Rc(r,e){let t,i=[];for(let n of r)n.d&&n.n?t?.p==n.p&&""+t.r==""+n.r?(t.c=[t.c,n.c].filter(Boolean).join(" "),t.d=t.d+";"+n.d):i.push(t={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function Zn(r,e,t=ge.u,i,n){let s=[];for(let o of r)for(let l of function(a,u,d,c,p){a={...a,i:a.i||p};let h=function(g,m){let b=Ac.get(g.n);return b?b(g,m):m.r(g.n,g.v[0]=="dark")}(a,u);return h?typeof h=="string"?({r:c,p:d}=ga(a,u,d,c),Rc(Zn(Jn(h),u,d,c,a.i),a.n)):Array.isArray(h)?h.map(g=>{var m,b;return{o:0,...g,r:[...Q(c),...Q(g.r)],p:(m=d,b=g.p??d,m&~ge.o|b)}}):Pc(h,a,u,d,c):[{c:fa(a),p:0,o:0,r:[]}]}(o,e,t,i,n))s.splice(Tc(s,l),0,l);return s}function va(r,e,t,i,n,s,o,l){return Rc((l?t.flatMap(a=>Zn([a],i,n,s,o)):Zn(t,i,n,s,o)).map(a=>a.p&ge.o&&(a.n||e==ge.b)?{...a,p:a.p&~ge.o|e,o:0}:a),r)}function m0(r,e,t,i){var n;return n=(s,o)=>{let{n:l,p:a,r:u,i:d}=ga(s,o,e);return t&&va(l,e,t,o,a,u,d,i)},Ac.set(r,n),r}function la(r,e,t){if(r[r.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let l of r)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),n=!n),l.endsWith(":")){i[l=="dark:"?"unshift":"push"](l.slice(0,-1));continue}l[0]=="-"&&(l=l.slice(1),s=!s),l.endsWith("-")&&(l=l.slice(0,-1)),l&&l!="&"&&(o+=(o&&"-")+l)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(v0),i:n}))}}function v0(r,e,t){return t.indexOf(r)==e}var Ec=new Map;function Jn(r){let e=Ec.get(r);if(!e){let t=[],i=[[]],n=0,s=0,o=null,l=0,a=(u,d=0)=>{n!=l&&(t.push(r.slice(n,l+d)),u&&la(t,i)),n=l+1};for(;l<r.length;l++){let u=r[l];if(s)r[l-1]!="\\"&&(s+=+(u=="[")||-(u=="]"));else if(u=="[")s+=1;else if(o)r[l-1]!="\\"&&o.test(r.slice(l))&&(o=null,n=l+RegExp.lastMatch.length);else if(u=="/"&&r[l-1]!="\\"&&(r[l+1]=="*"||r[l+1]=="/"))o=r[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(u=="(")a(),t.push(u);else if(u==":")r[l+1]!=":"&&a(!1,1);else if(/[\s,)]/.test(u)){a(!0);let d=t.lastIndexOf("(");if(u==")"){let c=t[d-1];if(/[~@]$/.test(c)){let p=i.shift();t.length=d,la([...t,"#"],i);let{v:h}=i[0].pop();for(let g of p)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);la([...t,m0(c.length>1?c.slice(0,-1)+Gn(JSON.stringify([c,p])):c+"("+f0(p)+")",ge.a,p,/@$/.test(c))],i)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(u)&&r[l+1]=="("&&i.unshift([])}a(!0),Ec.set(r,e=i[0])}return e}function $(r,e,t){return[r,da(e,t)]}function da(r,e){return typeof r=="function"?r:typeof r=="string"&&/^[\w-]+$/.test(r)?(t,i)=>({[r]:e?e(t,i):pa(t,1)}):t=>r||{[t[1]]:pa(t,2)}}function pa(r,e,t=r.slice(e).find(Boolean)||r.$$||r.input){return r.input[0]=="-"?`calc(${t} * -1)`:t}function T(r,e,t,i){return[r,_a(e,t,i)]}function _a(r,e,t){let i=typeof e=="string"?(n,s)=>({[e]:t?t(n,s):n._}):e||(({1:n,_:s},o,l)=>({[n||l]:s}));return(n,s)=>{let o=Oc(r||n[1]),l=s.theme(o,n.$$)??at(n.$$,o,s);if(l!=null)return n._=pa(n,0,l),i(n,s,o)}}function me(r,e={},t){return[r,_0(e,t)]}function _0(r={},e){return(t,i)=>{let{section:n=Oc(t[0]).replace("-","")+"Color"}=r,[s,o]=y0(t.$$);if(!s)return;let l=i.theme(n,s)||at(s,n,i);if(!l||typeof l=="object")return;let{opacityVariable:a=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:u=n.replace("Color","Opacity"),property:d=n,selector:c}=r,p=i.theme(u,o||"DEFAULT")||o&&at(o,u,i),h=e||(({_:m})=>{let b=Si(d,m);return c?{[c]:b}:b});t._={value:Je(l,{opacityVariable:a||void 0,opacityValue:p||void 0}),color:m=>Je(l,m),opacityVariable:a||void 0,opacityValue:p||void 0};let g=h(t,i);if(!t.dark){let m=i.d(n,s,l);m&&m!==l&&(t._={value:Je(m,{opacityVariable:a||void 0,opacityValue:p||"1"}),color:b=>Je(m,b),opacityVariable:a||void 0,opacityValue:p||void 0},g={"&":g,[i.v("dark")]:h(t,i)})}return g}}function y0(r){return(r.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Si(r,e){let t={};return typeof e=="string"?t[r]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[r]=e.value),t}function at(r,e,t){if(r[0]=="["&&r.slice(-1)=="]"){if(r=$r(ma(r.slice(1,-1),t.theme)),!e)return r;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(r)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(r))||/image/i.test(e)&&!(/^image:/.test(r)||/^[a-z-]+\(/.test(r))||/weight/i.test(e)&&!(/^(number|any):/.test(r)||/^\d+$/.test(r))||/position/i.test(e)&&/^(length|size):/.test(r)))return r.replace(/^[a-z-]+:/,"")}}function Oc(r){return r.replace(/-./g,e=>e[1].toUpperCase())}function $r(r){return r.includes("url(")?r.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,n="")=>$r(t)+i+$r(n)):r.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function $i({presets:r=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Q(e.variants),rules:Q(e.rules),ignorelist:Q(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of Q([...r,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Q(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:l,variants:a,rules:u,ignorelist:d,hash:c=t.hash,stringify:p=t.stringify,finalize:h}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&n!==!1&&[...t.preflight,...Q(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Q(a)],rules:[...t.rules,...Q(u)],ignorelist:[...t.ignorelist,...Q(d)],hash:c,stringify:p,finalize:[...t.finalize,...Q(h)]}}return t}function Sc(r,e,t,i,n,s){for(let o of e){let l=t.get(o);l||t.set(o,l=i(o));let a=l(r,n,s);if(a)return a}}function b0(r){var e;return ha(r[0],typeof(e=r[1])=="function"?e:()=>e)}function w0(r){var e,t;return Array.isArray(r)?ha(r[0],da(r[1],r[2])):ha(r,da(e,t))}function ha(r,e){return Lc(r,(t,i,n,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,n)})}function Lc(r,e){let t=Q(r).map(x0);return(i,n,s)=>{for(let o of t){let l=e(i,o,n,s);if(l)return l}}}function x0(r){return typeof r=="string"?RegExp("^"+r+(r.includes("$")||r.slice(-1)=="-"?"":"$")):r}function Fc(r,e){let t=$i(r),i=function({theme:a,darkMode:u,darkColor:d=Kn,variants:c,rules:p,hash:h,stringify:g,ignorelist:m,finalize:b}){let x=new Map,y=new Map,k=new Map,E=new Map,R=Lc(m,(P,B)=>B.test(P));c.push(["dark",Array.isArray(u)||u=="class"?`${Q(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let q=typeof h=="function"?P=>h(P,Gn):h?Gn:wc;q!==wc&&b.push(P=>({...P,n:P.n&&q(P.n),d:P.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(B,W)=>"--"+q(W).replace("#",""))}));let U={theme:function({extend:P={},...B}){let W={},xe={get colors(){return ce("colors")},theme:ce,negative(){return{}},breakpoints(Z){let X={};for(let de in Z)typeof Z[de]=="string"&&(X["screen-"+de]=Z[de]);return X}};return ce;function ce(Z,X,de,Ne){if(Z){if({1:Z,2:Ne}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Z)||[,Z],/[.[]/.test(Z)){let $e=[];Z.replace(/\[([^\]]+)\]|([^.[]+)/g,(ie,_e,Me=_e)=>$e.push(Me)),Z=$e.shift(),de=X,X=$e.join("-")}let ae=W[Z]||Object.assign(Object.assign(W[Z]={},je(B,Z)),je(P,Z));if(X==null)return ae;X||(X="DEFAULT");let Se=ae[X]??X.split("-").reduce(($e,ie)=>$e?.[ie],ae)??de;return Ne?Je(Se,{opacityValue:ma(Ne,ce)}):Se}let He={};for(let ae of[...Object.keys(B),...Object.keys(P)])He[ae]=ce(ae);return He}function je(Z,X){let de=Z[X];return typeof de=="function"&&(de=de(xe)),de&&/color|fill|stroke/i.test(X)?function Ne(He,ae=[]){let Se={};for(let $e in He){let ie=He[$e],_e=[...ae,$e];Se[_e.join("-")]=ie,$e=="DEFAULT"&&(_e=ae,Se[ae.join("-")]=ie),typeof ie=="object"&&Object.assign(Se,Ne(ie,_e))}return Se}(de):de}}(a),e:$c,h:q,s(P,B){return g(P,B,U)},d(P,B,W){return d(P,B,U,W)},v(P){return x.has(P)||x.set(P,Sc(P,c,y,b0,U)||"&:"+P),x.get(P)},r(P,B){let W=JSON.stringify([P,B]);return k.has(W)||k.set(W,!R(P,U)&&Sc(P,p,E,w0,U,B)),k.get(W)},f(P){return b.reduce((B,W)=>W(B,U),P)}};return U}(t),n=new Map,s=[],o=new Set;e.resume(a=>n.set(a,a),(a,u)=>{e.insert(a,s.length,u),s.push(u),o.add(a)});function l(a){let u=i.f(a),d=ca(u);if(d&&!o.has(d)){o.add(d);let c=Tc(s,a);e.insert(d,c,a),s.splice(c,0,a)}return u.n}return Object.defineProperties(function(u){if(!n.size)for(let c of Q(t.preflight))typeof c=="function"&&(c=c(i)),c&&(typeof c=="string"?va("",ge.b,Jn(c),i,ge.b,[],!1,!0):Pc(c,{},i,ge.b)).forEach(l);u=""+u;let d=n.get(u);if(!d){let c=new Set;for(let p of Zn(Jn(u),i))c.add(p.c).add(l(p));d=[...c].filter(Boolean).join(" "),n.set(u,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let a=e.snapshot(),u=new Set(o),d=new Map(n),c=[...s];return()=>{a(),o=u,n=d,s=c}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function k0(r,e){return r!=e&&""+r.split(" ").sort()!=""+e.split(" ").sort()}function Dc(r){let e=new MutationObserver(t);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),t([{target:n,type:""}])},disconnect(){e.disconnect()}};function t(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let l of o.querySelectorAll("[class]"))i(l);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&k0(o,s=r(o))&&n.setAttribute("class",s)}}function C0(r){let e=document.querySelector(r||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Yn(r){let e=r?.cssRules?r:(r&&typeof r!="string"?r:C0(r)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,i){try{e.insertRule(t,i)}catch{e.insertRule(":root{}",i)}},resume:Kn}}var E0=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function jc(r){return E0.get(r)}function Nc(r){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(r);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Uc(r,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(r);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var S0=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Qn(){return({stringify:r})=>({stringify(e,t,i){let n="",s=jc(e);s&&(n+=r(s,t,i)+";");let o=Nc(e),l=Uc(e,t);for(let a of S0)o&a[1]&&(n+=r(a[0]+e,t,i)+";"),l&a[1]&&(n+=r(e,a[0]+t,i)+";");return n+r(e,t,i)}})}function es(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",_a("lineClamp",({_:r})=>Bc(r))],["line-clamp-(\\d+)",({1:r})=>Bc(r)]]}}function Bc(r){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${r}`}}var Ai={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...ze(4,"rem",4,.5,.5),...ze(12,"rem",4,5),14:"3.5rem",...ze(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:G("blur"),backdropBrightness:G("brightness"),backdropContrast:G("contrast"),backdropGrayscale:G("grayscale"),backdropHueRotate:G("hueRotate"),backdropInvert:G("invert"),backdropOpacity:G("opacity"),backdropSaturate:G("saturate"),backdropSepia:G("sepia"),backgroundColor:G("colors"),backgroundImage:{none:"none"},backgroundOpacity:G("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...ze(200,"",100,0,50),...ze(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:r})=>({DEFAULT:r("colors.gray.200","currentColor"),...r("colors")}),borderOpacity:G("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:G("spacing"),borderWidth:{DEFAULT:"1px",...Xe(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:G("colors"),caretColor:G("colors"),accentColor:({theme:r})=>({auto:"auto",...r("colors")}),contrast:{...ze(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:G("borderColor"),divideOpacity:G("borderOpacity"),divideWidth:G("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:r})=>({...r("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:r})=>({...r("spacing"),...Ii(2,6),...Ii(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:G("spacing"),gradientColorStops:G("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:r})=>({...r("spacing"),...Ii(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:r})=>({...r("spacing"),...Ii(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...ze(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:r})=>({auto:"auto",...r("spacing")}),maxHeight:({theme:r})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...r("spacing")}),maxWidth:({theme:r,breakpoints:e})=>({...e(r("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...ze(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:G("spacing"),placeholderColor:G("colors"),placeholderOpacity:G("opacity"),outlineColor:G("colors"),outlineOffset:Xe(8,"px"),outlineWidth:Xe(8,"px"),ringColor:({theme:r})=>({...r("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:G("colors"),ringOffsetWidth:Xe(8,"px"),ringOpacity:({theme:r})=>({...r("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Xe(8,"px")},rotate:{...Xe(2,"deg"),...Xe(12,"deg",3),...Xe(180,"deg",45)},saturate:ze(200,"",100,0,50),scale:{...ze(150,"",100,0,50),...ze(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:G("spacing"),scrollPadding:G("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Xe(2,"deg"),...Xe(12,"deg",3)},space:G("spacing"),stroke:({theme:r})=>({...r("colors"),none:"none"}),strokeWidth:ze(2),textColor:G("colors"),textDecorationColor:G("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Xe(8,"px")},textUnderlineOffset:{auto:"auto",...Xe(8,"px")},textIndent:G("spacing"),textOpacity:G("opacity"),transitionDuration:({theme:r})=>({...r("durations"),DEFAULT:"150ms"}),transitionDelay:G("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:r})=>({...r("spacing"),...Ii(2,4),full:"100%"}),width:({theme:r})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...r("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...ze(50,"",1,0,10),auto:"auto"}};function Ii(r,e){let t={};do for(var i=1;i<r;i++)t[`${i}/${r}`]=Number((i/r*100).toFixed(6))+"%";while(++r<=e);return t}function Xe(r,e,t=0){let i={};for(;t<=r;t=2*t||1)i[t]=t+e;return i}function ze(r,e="",t=1,i=0,n=1,s={}){for(;i<=r;i+=n)s[i]=i/t+e;return s}function G(r){return({theme:e})=>e(r)}var qc={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Ai.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Ai.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Zc=[$("\\[([-\\w]+):(.+)]",({1:r,2:e},t)=>({"@layer overrides":{"&":{[r]:at(`[${e}]`,"",t)}}})),$("(group|peer)([~/][^-[]+)?",({input:r},{h:e})=>[{c:e(r)}]),T("aspect-","aspectRatio"),$("container",(r,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let l in t){let a=t[l];typeof a=="string"&&(s[Xn(a)]={"&":{maxWidth:a,...o(l)}})}return s;function o(l){let a=n&&(typeof n=="string"?n:n[l]||n.DEFAULT);if(a)return{paddingRight:a,paddingLeft:a}}}),T("content-","content",({_:r})=>({"--tw-content":r,content:"var(--tw-content)"})),$("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),$("box-(border|content)","boxSizing",({1:r})=>r+"-box"),$("hidden",{display:"none"}),$("table-(auto|fixed)","tableLayout"),$(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",$("isolate","isolation"),$("object-(contain|cover|fill|none|scale-down)","objectFit"),T("object-","objectPosition"),$("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",ts),$("overscroll(-[xy])?-(auto|contain|none)",({1:r="",2:e})=>({["overscroll-behavior"+r]:e})),$("(static|fixed|absolute|relative|sticky)","position"),T("-?inset(-[xy])?(?:$|-)","inset",({1:r,_:e})=>({top:r!="-x"&&e,right:r!="-y"&&e,bottom:r!="-x"&&e,left:r!="-y"&&e})),T("-?(top|bottom|left|right)(?:$|-)","inset"),$("(visible|collapse)","visibility"),$("invisible",{visibility:"hidden"}),T("-?z-","zIndex"),$("flex-((row|col)(-reverse)?)","flexDirection",Hc),$("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),T("(flex-(?:grow|shrink))(?:$|-)"),T("(flex)-"),T("grow(?:$|-)","flexGrow"),T("shrink(?:$|-)","flexShrink"),T("basis-","flexBasis"),T("-?(order)-"),"-?(order)-(\\d+)",T("grid-cols-","gridTemplateColumns"),$("grid-cols-(\\d+)","gridTemplateColumns",Gc),T("col-","gridColumn"),$("col-(span)-(\\d+)","gridColumn",Wc),T("col-start-","gridColumnStart"),$("col-start-(auto|\\d+)","gridColumnStart"),T("col-end-","gridColumnEnd"),$("col-end-(auto|\\d+)","gridColumnEnd"),T("grid-rows-","gridTemplateRows"),$("grid-rows-(\\d+)","gridTemplateRows",Gc),T("row-","gridRow"),$("row-(span)-(\\d+)","gridRow",Wc),T("row-start-","gridRowStart"),$("row-start-(auto|\\d+)","gridRowStart"),T("row-end-","gridRowEnd"),$("row-end-(auto|\\d+)","gridRowEnd"),$("grid-flow-((row|col)(-dense)?)","gridAutoFlow",r=>ts(Hc(r))),$("grid-flow-(dense)","gridAutoFlow"),T("auto-cols-","gridAutoColumns"),T("auto-rows-","gridAutoRows"),T("gap-x(?:$|-)","gap","columnGap"),T("gap-y(?:$|-)","gap","rowGap"),T("gap(?:$|-)","gap"),"(justify-(?:items|self))-",$("justify-","justifyContent",zc),$("(content|items|self)-",r=>({["align-"+r[1]]:zc(r)})),$("(place-(content|items|self))-",({1:r,$$:e})=>({[r]:("wun".includes(e[3])?"space-":"")+e})),T("p([xytrbl])?(?:$|-)","padding",Ir("padding")),T("-?m([xytrbl])?(?:$|-)","margin",Ir("margin")),T("-?space-(x|y)(?:$|-)","space",({1:r,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[r]]:`calc(${e} * calc(1 - var(--tw-space-${r}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[r]]:`calc(${e} * var(--tw-space-${r}-reverse))`}})),$("space-(x|y)-reverse",({1:r})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"1"}})),T("w-","width"),T("min-w-","minWidth"),T("max-w-","maxWidth"),T("h-","height"),T("min-h-","minHeight"),T("max-h-","maxHeight"),T("font-","fontWeight"),T("font-","fontFamily",({_:r})=>typeof(r=Q(r))[1]=="string"?{fontFamily:rt(r)}:{fontFamily:rt(r[0]),...r[1]}),$("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),$("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),$("italic","fontStyle"),$("not-italic",{fontStyle:"normal"}),$("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:r,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":r)]:r,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Pt({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),T("tracking-","letterSpacing"),T("leading-","lineHeight"),$("list-(inside|outside)","listStylePosition"),T("list-","listStyleType"),$("list-","listStyleType"),T("placeholder-opacity-","placeholderOpacity",({_:r})=>({"&::placeholder":{"--tw-placeholder-opacity":r}})),me("placeholder-",{property:"color",selector:"&::placeholder"}),$("text-(left|center|right|justify|start|end)","textAlign"),$("text-(ellipsis|clip)","textOverflow"),T("text-opacity-","textOpacity","--tw-text-opacity"),me("text-",{property:"color"}),T("text-","fontSize",({_:r})=>typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}),T("indent-","textIndent"),$("(overline|underline|line-through)","textDecorationLine"),$("no-underline",{textDecorationLine:"none"}),T("underline-offset-","textUnderlineOffset"),me("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),T("decoration-","textDecorationThickness"),$("decoration-","textDecorationStyle"),$("(uppercase|lowercase|capitalize)","textTransform"),$("normal-case",{textTransform:"none"}),$("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),$("align-","verticalAlign"),$("whitespace-","whiteSpace"),$("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),$("break-words",{overflowWrap:"break-word"}),$("break-all",{wordBreak:"break-all"}),$("break-keep",{wordBreak:"keep-all"}),me("caret-",{opacityVariable:!1,opacitySection:"opacity"}),me("accent-",{opacityVariable:!1,opacitySection:"opacity"}),$("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:r})=>`linear-gradient(to ${er(r," ")},var(--tw-gradient-stops))`),me("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-from":r.value,"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),me("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${r.value},var(--tw-gradient-to)`})),me("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),$("bg-(fixed|local|scroll)","backgroundAttachment"),$("bg-origin-(border|padding|content)","backgroundOrigin",({1:r})=>r+"-box"),$(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),$("bg-blend-","backgroundBlendMode"),$("bg-clip-(border|padding|content|text)","backgroundClip",({1:r})=>r+(r=="text"?"":"-box")),T("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),me("bg-",{section:"backgroundColor"}),T("bg-","backgroundImage"),T("bg-","backgroundPosition"),$("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",ts),T("bg-","backgroundSize"),T("rounded(?:$|-)","borderRadius"),T("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:r,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[r]||[r,r];return{[`border-${er(t[0])}-radius`]:e,[`border-${er(t[1])}-radius`]:e}}),$("border-(collapse|separate)","borderCollapse"),T("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),$("border-(solid|dashed|dotted|double|none)","borderStyle"),T("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:r,_:e})=>({...Pt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(r||"-x")]:e,["--tw-border-spacing"+(r||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),me("border-([xytrbl])-",{section:"borderColor"},Ir("border","Color")),me("border-"),T("border-([xytrbl])(?:$|-)","borderWidth",Ir("border","Width")),T("border(?:$|-)","borderWidth"),T("divide-opacity(?:$|-)","divideOpacity",({_:r})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":r}})),$("divide-(solid|dashed|dotted|double|none)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:r}})),$("divide-([xy]-reverse)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+r]:"1"}})),T("divide-([xy])(?:$|-)","divideWidth",({1:r,_:e})=>{let t={x:"lr",y:"tb"}[r];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${r}-reverse`]:"0",[`border-${er(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${r}-reverse)))`,[`border-${er(t[1])}Width`]:`calc(${e} * var(--tw-divide-${r}-reverse))`}}}),me("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),T("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),me("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),T("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),$("ring-inset",{"--tw-ring-inset":"inset"}),me("ring-",{property:"--tw-ring-color"}),T("ring(?:$|-)","ringWidth",({_:r},{theme:e})=>({...Pt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Je(e("ringOffsetColor","","#fff")),"--tw-ring-color":Je(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${r} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),me("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-shadow-color":r.value,"--tw-shadow":"var(--tw-shadow-colored)"})),T("shadow(?:$|-)","boxShadow",({_:r})=>({...Pt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":rt(r),"--tw-shadow-colored":rt(r).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),T("(opacity)-"),$("mix-blend-","mixBlendMode"),...Vc(),...Vc("backdrop-"),T("transition(?:$|-)","transitionProperty",(r,{theme:e})=>({transitionProperty:rt(r),transitionTimingFunction:r._=="none"?void 0:rt(e("transitionTimingFunction","")),transitionDuration:r._=="none"?void 0:rt(e("transitionDuration",""))})),T("duration(?:$|-)","transitionDuration","transitionDuration",rt),T("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",rt),T("delay(?:$|-)","transitionDelay","transitionDelay",rt),T("animate(?:$|-)","animation",(r,{theme:e,h:t,e:i})=>{let n=rt(r),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",$("transform",ba),$("transform-(cpu|gpu)",({1:r})=>({"--tw-transform":Jc(r=="gpu")})),T("scale(-[xy])?-","scale",({1:r,_:e})=>({["--tw-scale"+(r||"-x")]:e,["--tw-scale"+(r||"-y")]:e,...ba()})),T("-?(rotate)-","rotate",ya),T("-?(translate-[xy])-","translate",ya),T("-?(skew-[xy])-","skew",ya),$("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",ts),"(appearance)-",T("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",T("(cursor)-"),"(cursor)-",$("snap-(none)","scroll-snap-type"),$("snap-(x|y|both)",({1:r})=>({...Pt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":r+" var(--tw-scroll-snap-strictness)"})),$("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),$("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),$("snap-(normal|always)","scroll-snap-stop"),$("scroll-(auto|smooth)","scroll-behavior"),T("scroll-p([xytrbl])?(?:$|-)","padding",Ir("scroll-padding")),T("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",Ir("scroll-margin")),$("touch-(auto|none|manipulation)","touch-action"),$("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:r,2:e,3:t})=>({...Pt({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":r}`]:r,"touch-action":"var(--tw-touch-action)"})),$("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),$("outline",{outlineStyle:"solid"}),$("outline-(dashed|dotted|double)","outlineStyle"),T("-?(outline-offset)-"),me("outline-",{opacityVariable:!1,opacitySection:"opacity"}),T("outline-","outlineWidth"),"(pointer-events)-",T("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:r})=>({x:"horizontal",y:"vertical"})[r]||r||"both"],$("select-(none|text|all|auto)","userSelect"),me("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),me("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),T("stroke-","strokeWidth"),$("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),$("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function ts(r){return(typeof r=="string"?r:r[1]).replace(/-/g," ").trim()}function Hc(r){return(typeof r=="string"?r:r[1]).replace("col","column")}function er(r,e="-"){let t=[];for(let i of r)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function rt(r){return r&&""+(r._||r)}function zc({$$:r}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[r[3]||""]||"")+r}function Ir(r,e=""){return({1:t,_:i})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...Si(r+"-"+er(n[0])+e,i),...Si(r+"-"+er(n[1])+e,i)}:Si(r+e,i)}}function Vc(r=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",r&&"opacity","saturate","sepia",!r&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${r}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...Pt(t),[`${r}filter`]:e.map(i=>`var(--tw-${r}${i})`).join(" ")},[`(${r}filter)-(none)`,$(`${r}filter`,t),...e.map(i=>T(`${i[0]=="h"?"-?":""}(${r}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:Q(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function ya({1:r,_:e}){return{["--tw-"+r]:e,...ba()}}function ba(){return{...Pt({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Jc()}),transform:"var(--tw-transform)"}}function Jc(r){return[r?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Wc({1:r,2:e}){return`${r} ${e} / ${r} ${e}`}function Gc({1:r}){return`repeat(${r},minmax(0,1fr))`}function Pt(r){return{"@layer defaults":{"*,::before,::after":r,"::backdrop":r}}}var Xc=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:r})=>`@media (orientation:${r})`],["contrast-(more|less)",({1:r})=>`@media (prefers-contrast:${r})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:r})=>`&::${r}`],["(marker|selection)",({1:r})=>`& *::${r},&::${r}`],["file","&::file-selector-button"],["(first|last|only)",({1:r})=>`&:${r}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:r,$$:e},t)=>e&&`&[${r}-${t.theme(r,e)||at(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:r,3:e="",4:t,5:i="",6:n=e},{e:s,h:o,v:l})=>{let a=$r(i)||(t[0]=="["?t:l(t.slice(1)));return`${(a.includes("&")?a:"&"+a).replace(/&/g,`:merge(.${s(o(r+n))})`)}${r[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:r})=>`[dir="${r}"] &`],["supports-",({$$:r},e)=>{if(r&&(r=e.theme("supports",r)||at(r,"",e)),r)return r.includes(":")||(r+=":var(--tw)"),/^\w*\s*\(/.test(r)||(r=`(${r})`),`@supports ${r.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:r},e)=>{if(r&&(r=e.theme("screens",r)||at(r,"",e)),typeof r=="string")return`@media not all and (min-width:${r})`}],["min-",({$$:r},e)=>(r&&(r=at(r,"",e)),r&&`@media (min-width:${r})`)],[/^\[(.+)]$/,({1:r})=>/[&@]/.test(r)&&$r(r).replace(/[}]+$/,"").split("{")]];function Kc({colors:r,disablePreflight:e}={}){return{preflight:e?void 0:qc,theme:{...Ai,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...r}},variants:Xc,rules:Zc,finalize(t){return t.n&&t.d&&t.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var $0={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},I0={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},A0={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},T0={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},M0={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},P0={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},R0={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},O0={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},L0={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},F0={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},D0={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},j0={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},N0={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},U0={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},B0={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},q0={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},H0={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},z0={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},V0={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},W0={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},G0={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Z0={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Yc={__proto__:null,slate:$0,gray:I0,zinc:A0,neutral:T0,stone:M0,red:P0,orange:R0,amber:O0,yellow:L0,lime:F0,green:D0,emerald:j0,teal:N0,cyan:U0,sky:B0,blue:q0,indigo:H0,violet:z0,purple:V0,fuchsia:W0,pink:G0,rose:Z0};function rs({disablePreflight:r}={}){return Kc({colors:Yc,disablePreflight:r})}function is({className:r="prose",defaultColor:e="gray",extend:t={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${r}-${s}`,(l,a)=>td(r,o[0]=="."?"."+a.e(a.h(o.slice(1))):o,a,u=>`& :is(${u.trim()})`)]),rules:[[`(lead|not-${r})`,({1:s},{h:o})=>[{c:o(s)}]],[`${r}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[r+"-",({$$:s},o)=>{let l=ed(o.theme("fontSize",s));return l&&{"@layer components":l}}],[r+"-",({$$:s},o)=>n(s,o)],[r,(s,o)=>({...n(e,o),"@layer base":[Qc(r,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:D(20,16),marginBottom:D(20,16),paddingLeft:D(26,16)},li:{marginTop:D(8,16),marginBottom:D(8,16)},"ol>li,ul>li":{paddingLeft:D(6,16)},">ul>li p":{marginTop:D(12,16),marginBottom:D(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:D(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:D(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:D(12,16),marginBottom:D(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:D(48,16),marginBottom:D(48,16)},blockquote:{marginTop:D(32,20),marginBottom:D(32,20),paddingLeft:D(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:D(20,16),marginBottom:D(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:D(36,16),marginTop:"0",marginBottom:D(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:D(24,16),marginTop:D(48,24),marginBottom:D(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:D(20,16),marginTop:D(32,20),marginBottom:D(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:D(24,16),marginBottom:D(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:D(32,16),marginBottom:D(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:D(14,16),lineHeight:"1.4",marginTop:D(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:D(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:D(21,24)},"h3 code":{fontSize:D(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:D(14,16),lineHeight:"1.7",marginTop:D(24,14),marginBottom:D(24,14),borderRadius:"0.375rem",paddingTop:D(12,14),paddingRight:D(16,14),paddingBottom:D(12,14),paddingLeft:D(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:D(32,16),marginBottom:D(32,16),fontSize:D(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:D(8,14),paddingBottom:D(8,14),paddingLeft:D(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:D(8,14),paddingRight:D(8,14),paddingBottom:D(8,14),paddingLeft:D(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:D(20,16),lineHeight:"1.6",marginTop:D(24,20),marginBottom:D(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Qc(r,o,t)],"@layer components":{...ed(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let l={},a={},u=(d,c,p)=>{let h=o.theme(`colors.${s}.${c}`,c);p["--tw-prose-"+d]=Je(h);let g=p!=a&&o.d("colors",`${s}-${c}`,h);g&&(a["--tw-prose-"+d]=Je(g))};for(let d in i){let c=i[d];d!="dark"&&c&&u(d,c,l)}for(let d in i.dark||{}){let c=i.dark[d];c&&(i.dark?u("invert-"+d,c,l):u(d,c,a))}return Object.keys(l).length?{"@layer defaults":{"&":l,[o.v("dark")]:a}}:void 0}}function Qc(r,e,t){let i={};for(let n in t)i[td(r,n,e,s=>`.${e.e(e.h(r))}${s}`)]=t[n];return i}function td(r,e,{e:t,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",l=s,a="")=>n(`${o}:where(${l}):not(:where(.${t(i("not-"+r))} *))${a}`))}function ed(r){return r?typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}:void 0}function D(r,e){return`${(r/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var wa=$i({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[rs(),Qn(),es(),is()]});function ns(r,e=!0){let t=function(){if(J0)try{let a=Yn(new CSSStyleSheet);return a.connect=u=>{let d=xa(u);d.adoptedStyleSheets=[...d.adoptedStyleSheets,a.target]},a.disconnect=Kn,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Yn(s)],l=new WeakMap;return{get target(){return o[0].target},snapshot(){let a=o.map(u=>u.snapshot());return()=>a.forEach(u=>u())},clear(){o.forEach(a=>a.clear())},destroy(){o.forEach(a=>a.destroy())},insert(a,u,d){o[0].insert(a,u,d);let c=this.target.cssRules[u];o.forEach((p,h)=>h&&p.target.insertRule(c.cssText,u))},resume(a,u){return o[0].resume(a,u)},connect(a){let u=document.createElement("style");xa(a).appendChild(u);let d=Yn(u),{cssRules:c}=this.target;for(let p=0;p<c.length;p++)d.target.insertRule(c[p].cssText,p);o.push(d),l.set(a,d)},disconnect(a){let u=o.indexOf(l.get(a));u>=0&&o.splice(u,1)}}}(),i=Fc({...r,hash:r.hash??e},t),n=Dc(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(xa(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=i}}}}var J0=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function xa(r){return r.shadowRoot||r.attachShadow({mode:"open"})}var z=r=>ns(wa)(r);var ss=class extends z(j){constructor(){super();M(this,"render",()=>_`
105
105
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
106
106
  <!-- the background color is set on the root button so that when we cross fade between the open/close states there's no white flicker -->
107
107
  <button class="leading-0 relative inline-block h-14 w-14 overflow-hidden rounded-full bg-slate-800 text-sm text-white shadow-xl transition-transform hover:scale-105 active:scale-90">
108
108
  <!-- the 'open' state invites the user to open (e.g. the chat window) -->
109
109
  <div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute bottom-0 left-0 right-0 top-0 transition-[opacity,visibility]">
110
- ${this.src?C`
110
+ ${this.src?_`
111
111
  <!-- load given source -->
112
112
  <!-- scale-[1.01] fixes aliasing (white outline) -->
113
113
  <img class="block h-full w-full scale-[1.01] bg-white" src="${this.src}" alt="Molin AI chat" />
114
- `:C`
114
+ `:_`
115
115
  <!-- if no image URL is specified, we default to our animation -->
116
116
  <!-- scale-[1.01] fixes aliasing (white outline) -->
117
117
  <img src="https://assets.molinai.io/2024/widget-v20241209/bubble.webp" class="block h-full w-full scale-[1.01]" alt="Molin AI chat" />
@@ -127,9 +127,9 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
127
127
  </svg>
128
128
  </div>
129
129
  </button>
130
- `);this.state="open",this.src=""}};M(Kn,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",Kn);var Yn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Qn=r=>(...e)=>({_$litDirective$:r,values:e}),Ir=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:z0}=ac;var Xc=()=>document.createComment(""),Ar=(r,e,t)=>{let i=r._$AA.parentNode,n=e===void 0?r._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(Xc(),n),o=i.insertBefore(Xc(),n);t=new z0(s,o,r,r.options)}else{let s=t._$AB.nextSibling,o=t._$AM,l=o!==r;if(l){let a;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(a=r._$AU)!==o._$AU&&t._$AP(a)}if(s!==n||l){let a=t._$AA;for(;a!==s;){let u=a.nextSibling;i.insertBefore(a,n),a=u}}}return t},Pt=(r,e,t=r)=>(r._$AI(e,t),r),V0={},Kc=(r,e=V0)=>r._$AH=e,Yc=r=>r._$AH,es=r=>{r._$AP?.(!1,!0);let e=r._$AA,t=r._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var Qc=(r,e,t)=>{let i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},Rt=Qn(class extends Ir{constructor(r){if(super(r),r.type!==Yn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let l of r)n[o]=i?i(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:n}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){let n=Yc(r),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=o,s;let l=this.ut??=[],a=[],u,d,c=0,p=n.length-1,h=0,g=s.length-1;for(;c<=p&&h<=g;)if(n[c]===null)c++;else if(n[p]===null)p--;else if(l[c]===o[h])a[h]=Pt(n[c],s[h]),c++,h++;else if(l[p]===o[g])a[g]=Pt(n[p],s[g]),p--,g--;else if(l[c]===o[g])a[g]=Pt(n[c],s[g]),Ar(r,a[g+1],n[c]),c++,g--;else if(l[p]===o[h])a[h]=Pt(n[p],s[h]),Ar(r,n[c],n[p]),p--,h++;else if(u===void 0&&(u=Qc(o,h,g),d=Qc(l,c,p)),u.has(l[c]))if(u.has(l[p])){let m=d.get(o[h]),y=m!==void 0?n[m]:null;if(y===null){let w=Ar(r,n[c]);Pt(w,s[h]),a[h]=w}else a[h]=Pt(y,s[h]),Ar(r,n[c],y),n[m]=null;h++}else es(n[p]),p--;else es(n[c]),c++;for(;h<=g;){let m=Ar(r,a[g+1]);Pt(m,s[h]),a[h++]=m}for(;c<=p;){let m=n[c++];m!==null&&es(m)}return this.ut=o,Kc(r,a),tt}});function $i(r,e,t){return r?e(r):t?.(r)}var ts,ed,rs=class rs extends z(q){constructor(){super();b(this,ts);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?j:C`
130
+ `);this.state="open",this.src=""}};M(ss,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",ss);var os={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},as=r=>(...e)=>({_$litDirective$:r,values:e}),Ar=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:X0}=_c;var rd=()=>document.createComment(""),Tr=(r,e,t)=>{let i=r._$AA.parentNode,n=e===void 0?r._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(rd(),n),o=i.insertBefore(rd(),n);t=new X0(s,o,r,r.options)}else{let s=t._$AB.nextSibling,o=t._$AM,l=o!==r;if(l){let a;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(a=r._$AU)!==o._$AU&&t._$AP(a)}if(s!==n||l){let a=t._$AA;for(;a!==s;){let u=a.nextSibling;i.insertBefore(a,n),a=u}}}return t},Rt=(r,e,t=r)=>(r._$AI(e,t),r),K0={},id=(r,e=K0)=>r._$AH=e,nd=r=>r._$AH,ls=r=>{r._$AP?.(!1,!0);let e=r._$AA,t=r._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var sd=(r,e,t)=>{let i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},it=as(class extends Ar{constructor(r){if(super(r),r.type!==os.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let l of r)n[o]=i?i(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:n}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){let n=nd(r),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=o,s;let l=this.ut??=[],a=[],u,d,c=0,p=n.length-1,h=0,g=s.length-1;for(;c<=p&&h<=g;)if(n[c]===null)c++;else if(n[p]===null)p--;else if(l[c]===o[h])a[h]=Rt(n[c],s[h]),c++,h++;else if(l[p]===o[g])a[g]=Rt(n[p],s[g]),p--,g--;else if(l[c]===o[g])a[g]=Rt(n[c],s[g]),Tr(r,a[g+1],n[c]),c++,g--;else if(l[p]===o[h])a[h]=Rt(n[p],s[h]),Tr(r,n[c],n[p]),p--,h++;else if(u===void 0&&(u=sd(o,h,g),d=sd(l,c,p)),u.has(l[c]))if(u.has(l[p])){let m=d.get(o[h]),b=m!==void 0?n[m]:null;if(b===null){let x=Tr(r,n[c]);Rt(x,s[h]),a[h]=x}else a[h]=Rt(b,s[h]),Tr(r,n[c],b),n[m]=null;h++}else ls(n[p]),p--;else ls(n[c]),c++;for(;h<=g;){let m=Tr(r,a[g+1]);Rt(m,s[h]),a[h++]=m}for(;c<=p;){let m=n[c++];m!==null&&ls(m)}return this.ut=o,id(r,a),tt}});function Ti(r,e,t){return r?e(r):t?.(r)}var us,od,cs=class cs extends z(j){constructor(){super();w(this,us);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?N:_`
131
131
  <div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pb-2 pt-6">
132
- ${$i(this.examples.title,()=>C`
132
+ ${Ti(this.examples.title,()=>_`
133
133
  <h2 class="mt-14 px-2 pb-2 pt-9 text-left text-3xl font-bold leading-tight tracking-tight">
134
134
  <span>${this.examples.title}</span>
135
135
  <svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
@@ -139,19 +139,19 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
139
139
  </svg>
140
140
  </h2>
141
141
  `)}
142
- ${this.examples?.items?.length?C`
142
+ ${this.examples?.items?.length?_`
143
143
  <ul class="mt-auto flex select-none flex-wrap justify-end gap-2.5 text-sm/6 text-black">
144
- ${Rt(this.examples.items,t=>t,t=>C`
144
+ ${it(this.examples.items,t=>t,t=>_`
145
145
  <li
146
146
  class="border-1 hover:bg-[${this.color}]/[0.08] border-gray my-auto inline-block cursor-pointer rounded-2xl px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:opacity-80 hover:shadow"
147
- @click="${()=>E(this,ts,ed).call(this,t)}">
147
+ @click="${()=>S(this,us,od).call(this,t)}">
148
148
  <span>${t.trim()}</span>
149
149
  </li>
150
150
  `)}
151
151
  </ul>
152
- `:j}
152
+ `:N}
153
153
  </div>
154
- `}};ts=new WeakSet,ed=function(t){this.dispatchEvent(new rs.ExampleClickEvent({example:t}))},M(rs,"properties",{examples:{type:Object},color:{type:String}});var Ii=rs,fa;Ii.ExampleClickEvent=(fa=class extends CustomEvent{constructor(e,t={}){super(Ii.ExampleClickEvent.type,{detail:e,...t})}},M(fa,"type","mw:example-click"),fa);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Ii);var Mr,td,rd,Tr=class Tr extends z(q){constructor(){super();b(this,Mr);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return C`
154
+ `}};us=new WeakSet,od=function(t){this.dispatchEvent(new cs.ExampleClickEvent({example:t}))},M(cs,"properties",{examples:{type:Object},color:{type:String}});var Mi=cs,ka;Mi.ExampleClickEvent=(ka=class extends CustomEvent{constructor(e,t={}){super(Mi.ExampleClickEvent.type,{detail:e,...t})}},M(ka,"type","mw:example-click"),ka);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Mi);var Pr,ad,ld,Mr=class Mr extends z(j){constructor(){super();w(this,Pr);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return _`
155
155
  <div class="relative z-10 h-12">
156
156
  <div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
157
157
 
@@ -174,7 +174,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
174
174
  <div class="flex-grow"></div>
175
175
 
176
176
  <!-- new chat btn -->
177
- <button @click=${E(this,Mr,td)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
177
+ <button @click=${S(this,Pr,ad)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
178
178
  <!-- svg icon of a bubble with a plus -->
179
179
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
180
180
  <path
@@ -186,7 +186,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
186
186
  </button>
187
187
 
188
188
  <!-- close chat btn -->
189
- <button @click=${E(this,Mr,rd)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
189
+ <button @click=${S(this,Pr,ld)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
190
190
  <!-- svg icon of an X -->
191
191
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="white">
192
192
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
@@ -201,7 +201,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
201
201
  </div>
202
202
  </div>
203
203
  </div>
204
- `}};Mr=new WeakSet,td=function(){this.dispatchEvent(new Tr.NewChatClickEvent)},rd=function(){this.dispatchEvent(new Tr.CloseClickEvent)},M(Tr,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),M(Tr,"styles",ft`
204
+ `}};Pr=new WeakSet,ad=function(){this.dispatchEvent(new Mr.NewChatClickEvent)},ld=function(){this.dispatchEvent(new Mr.CloseClickEvent)},M(Mr,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),M(Mr,"styles",gt`
205
205
  /* blurred background */
206
206
 
207
207
  .gradient-blur {
@@ -213,24 +213,24 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
213
213
  /* bg-color gradient */
214
214
  background-image: linear-gradient(to bottom, white 20%, transparent);
215
215
  }
216
- `);var er=Tr,ga;er.NewChatClickEvent=(ga=class extends CustomEvent{constructor(e={}){super(er.NewChatClickEvent.type,{...e})}},M(ga,"type","mw:new-chat-click"),ga);var ma;er.CloseClickEvent=(ma=class extends CustomEvent{constructor(e={}){super(er.CloseClickEvent.type,{...e})}},M(ma,"type","mw:close-click"),ma);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",er);var va={maxHeight:120,initialHeight:32,paddingY:12},Ie,wa,id,nd,sd,od,xa,Pr=class Pr extends z(q){constructor(){super();b(this,Ie);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return C`
217
- <form @submit="${E(this,Ie,sd)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
216
+ `);var tr=Mr,Ca;tr.NewChatClickEvent=(Ca=class extends CustomEvent{constructor(e={}){super(tr.NewChatClickEvent.type,{...e})}},M(Ca,"type","mw:new-chat-click"),Ca);var Ea;tr.CloseClickEvent=(Ea=class extends CustomEvent{constructor(e={}){super(tr.CloseClickEvent.type,{...e})}},M(Ea,"type","mw:close-click"),Ea);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",tr);var Sa={maxHeight:120,initialHeight:32,paddingY:12},Ie,Ta,ud,cd,dd,pd,Ma,Rr=class Rr extends z(j){constructor(){super();w(this,Ie);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return _`
217
+ <form @submit="${S(this,Ie,dd)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
218
218
  <textarea
219
219
  name="input"
220
- @input="${E(this,Ie,od)}"
221
- @keydown="${E(this,Ie,nd)}"
220
+ @input="${S(this,Ie,pd)}"
221
+ @keydown="${S(this,Ie,cd)}"
222
222
  autofocus
223
223
  ?disabled="${this.disabled}"
224
224
  placeholder="${this.placeholder}"
225
- class="box-content h-[${va.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${va.paddingY}px] text-base text-gray-800 outline-none"></textarea>
225
+ class="box-content h-[${Sa.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${Sa.paddingY}px] text-base text-gray-800 outline-none"></textarea>
226
226
 
227
227
  <button type="submit" ?disabled="${this.disabled}" class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
228
- ${this.streaming?C`
228
+ ${this.streaming?_`
229
229
  <!-- x -->
230
230
  <svg class="h-6 w-6 fill-current" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="#312E30">
231
231
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
232
232
  </svg>
233
- `:C`
233
+ `:_`
234
234
  <!-- airplane -->
235
235
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 35 34">
236
236
  <path
@@ -246,7 +246,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
246
246
  <slot>
247
247
  <div class="h-5 w-full"></div>
248
248
  </slot>
249
- `}};Ie=new WeakSet,wa=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},id=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},nd=function(t){W0(t)&&(t.preventDefault(),this.streaming||f(this,Ie,id)?.click())},sd=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new Pr.CancelEvent);return}let i=f(this,Ie,wa);if(!i)throw new Error("Expected input element to be present");let n=i.value.trim();n&&this.dispatchEvent(new Pr.SubmitEvent(n))&&(i.value=""),E(this,Ie,xa).call(this)},od=function(t){this.dispatchEvent(new Pr.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),E(this,Ie,xa).call(this)},xa=function(){let t=f(this,Ie,wa);if(!t)return;let{maxHeight:i,initialHeight:n,paddingY:s}=va;t.style.height=`${n}px`;let o=t.scrollHeight,l=s*2,a=Math.min(o-l,i);t.style.height=`${a}px`},M(Pr,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var vt=Pr,_a;vt.ChangeEvent=(_a=class extends CustomEvent{constructor(e,t={}){super(vt.ChangeEvent.type,{detail:e,...t})}},M(_a,"type","mw:change"),_a);var ya;vt.SubmitEvent=(ya=class extends CustomEvent{constructor(e,t={}){super(vt.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},M(ya,"type","mw:submit"),ya);var ba;vt.CancelEvent=(ba=class extends CustomEvent{constructor(e={}){super(vt.CancelEvent.type,{...e})}},M(ba,"type","mw:cancel"),ba);function W0(r){return(r.code==="Enter"||r.code==="NumpadEnter")&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",vt);var is=class extends z(q){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let t=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return C`
249
+ `}};Ie=new WeakSet,Ta=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},ud=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},cd=function(t){Y0(t)&&(t.preventDefault(),this.streaming||f(this,Ie,ud)?.click())},dd=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new Rr.CancelEvent);return}let i=f(this,Ie,Ta);if(!i)throw new Error("Expected input element to be present");let n=i.value.trim();n&&this.dispatchEvent(new Rr.SubmitEvent(n))&&(i.value=""),S(this,Ie,Ma).call(this)},pd=function(t){this.dispatchEvent(new Rr.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),S(this,Ie,Ma).call(this)},Ma=function(){let t=f(this,Ie,Ta);if(!t)return;let{maxHeight:i,initialHeight:n,paddingY:s}=Sa;t.style.height=`${n}px`;let o=t.scrollHeight,l=s*2,a=Math.min(o-l,i);t.style.height=`${a}px`},M(Rr,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var _t=Rr,$a;_t.ChangeEvent=($a=class extends CustomEvent{constructor(e,t={}){super(_t.ChangeEvent.type,{detail:e,...t})}},M($a,"type","mw:change"),$a);var Ia;_t.SubmitEvent=(Ia=class extends CustomEvent{constructor(e,t={}){super(_t.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},M(Ia,"type","mw:submit"),Ia);var Aa;_t.CancelEvent=(Aa=class extends CustomEvent{constructor(e={}){super(_t.CancelEvent.type,{...e})}},M(Aa,"type","mw:cancel"),Aa);function Y0(r){return(r.code==="Enter"||r.code==="NumpadEnter")&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",_t);var ds=class extends z(j){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let t=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return _`
250
250
  <div class="ml-20 flex justify-end font-sans text-base">
251
251
  <div class="max-w-full">
252
252
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -255,15 +255,15 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
255
255
  </div>
256
256
 
257
257
  <!-- render status (if any) -->
258
- ${this.status==="sent"?C`
258
+ ${this.status==="sent"?_`
259
259
  <!-- tick mark -->
260
260
  <svg class="ml-auto h-3 w-3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
261
261
  <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
262
262
  </svg>
263
- `:j}
263
+ `:N}
264
264
  </div>
265
265
  </div>
266
- `;case"assistant":case"support":return C`
266
+ `;case"assistant":case"support":return _`
267
267
  <div class="mr-8 flex justify-start font-sans text-base">
268
268
  <div class="flex max-w-full space-x-2">
269
269
  <!--
@@ -282,7 +282,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
282
282
  </div>
283
283
  </div>
284
284
  </div>
285
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};M(is,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",is);var ka=class extends z(q){constructor(){super(...arguments);M(this,"render",()=>C`
285
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};M(ds,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",ds);var Pa=class extends z(j){constructor(){super(...arguments);M(this,"render",()=>_`
286
286
  <svg class="leading-0 inline-block h-full w-full" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
287
287
  <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
288
288
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -294,11 +294,11 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
294
294
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
295
295
  </circle>
296
296
  </svg>
297
- `)}};customElements.get("mw-loading")||customElements.define("mw-loading",ka);var G0="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Ca=class extends z(q){constructor(){super(...arguments);M(this,"render",()=>C`
297
+ `)}};customElements.get("mw-loading")||customElements.define("mw-loading",Pa);var Q0="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Ra=class extends z(j){constructor(){super(...arguments);M(this,"render",()=>_`
298
298
  <p class="flex items-center justify-center whitespace-nowrap text-xs">
299
299
  <span>Powered by</span>
300
300
 
301
- <a href="${G0}" target="_blank" class="inline-flex items-center underline">
301
+ <a href="${Q0}" target="_blank" class="inline-flex items-center underline">
302
302
  <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
303
303
  <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
304
304
  <path
@@ -317,95 +317,95 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
317
317
  <span>Molin AI</span>
318
318
  </a>
319
319
  </p>
320
- `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Ca);function ad(r,e){let t=r instanceof URL?r:new URL(r);if(e)for(let[i,n]of e)t.searchParams.set(i,n);return t}var Ai=r=>r??j;var Rr,Ti,tr,ns=class extends z(q){constructor(){super();b(this,Rr,!1);b(this,Ti,!1);b(this,tr,!1);this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let t=this.product?.url,i=this.searchParams;try{if(t&&i)return ad(t,i).href}catch{}return t}render(){let{name:t,description:i,price:n,url:s}=this.product||{},o=s?this.imagesByProductUrl?.[s]:void 0;return C`
320
+ `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Ra);function Oa(r){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(r)}function hd(r,e){let t=r instanceof URL?r:new URL(r);if(e)for(let[i,n]of e)t.searchParams.set(i,n);return t}var Ot=r=>r??N;var eg={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},La=$i({preflight:{...eg},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}}}},presets:[rs(),Qn(),es(),is()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Pi=r=>ns(La)(r);var Or,Ri,rr,ps=class extends Pi(j){constructor(){super();w(this,Or,!1);w(this,Ri,!1);w(this,rr,!1);this.src=""}render(){return this.src?_`
321
+ <div class="relative h-full w-full overflow-hidden rounded-lg">
322
+ <!-- use the same icon as for missing image url as the background behind the image so there is no flicker while it's loading -->
323
+ <div class="absolute inset-0 flex items-center justify-center bg-gray-100">
324
+ <!-- shopping bag icon -->
325
+ <svg class="h-1/3 w-1/3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
326
+ <path
327
+ stroke-linecap="round"
328
+ stroke-linejoin="round"
329
+ d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
330
+ </svg>
331
+ </div>
332
+
333
+ <!-- absolute position to take the height of the parent and to appear on top of the shopping bag background -->
334
+ <div class="absolute inset-0 flex h-full w-full bg-gray-100">
335
+ ${f(this,Or)&&f(this,Ri)?_`
336
+ <!-- missing image url -->
337
+ <div class="flex h-full w-full items-center justify-center">
338
+ <!-- shopping bag icon -->
339
+ <svg class="h-1/3 w-1/3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
340
+ <path
341
+ stroke-linecap="round"
342
+ stroke-linejoin="round"
343
+ d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
344
+ </svg>
345
+ </div>
346
+ `:f(this,Or)?_`
347
+ <img
348
+ @error="${()=>{I(this,Ri,!0),this.requestUpdate()}}"
349
+ @load="${()=>{I(this,rr,!0),this.requestUpdate()}}"
350
+ src="${this.src}"
351
+ alt="preview image"
352
+ class="${f(this,rr)?"bg-white":""} h-full w-full object-cover"
353
+ loading="lazy" />
354
+ `:_`
355
+ <!-- Cloudflare Images: resize the source image -->
356
+ <img
357
+ @error="${()=>{I(this,Or,!0),this.requestUpdate()}}"
358
+ @load="${()=>{I(this,rr,!0),this.requestUpdate()}}"
359
+ srcset="
360
+ https://molin.foo/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=1/${this.src} 1x,
361
+ https://molin.foo/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=2/${this.src} 2x
362
+ "
363
+ alt="preview image"
364
+ class="${f(this,rr)?"bg-white":""} h-full w-full object-cover"
365
+ loading="lazy" />
366
+ `}
367
+ </div>
368
+ </div>
369
+ `:_`
370
+ <!-- missing image url -->
371
+ <div class="flex h-full w-full overflow-hidden rounded-lg bg-gray-100">
372
+ <div class="flex h-full w-full items-center justify-center">
373
+ <!-- shopping bag icon -->
374
+ <svg class="h-1/3 w-1/3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
375
+ <path
376
+ stroke-linecap="round"
377
+ stroke-linejoin="round"
378
+ d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
379
+ </svg>
380
+ </div>
381
+ </div>
382
+ `}};Or=new WeakMap,Ri=new WeakMap,rr=new WeakMap,M(ps,"properties",{src:{type:String}});customElements.define("mw-product-thumbnail",ps);var hs=class extends z(j){constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let e=this.product?.url,t=this.searchParams;try{if(e&&t)return hd(e,t).href}catch{}return e}render(){let{name:e,description:t,price:i,url:n}=this.product||{},s=n?this.imagesByProductUrl?.[n]:void 0;return _`
321
383
  <a
322
- href="${Ai(this.trackedProductUrl)}"
323
- title="${Ai(t)}"
384
+ href="${Ot(this.trackedProductUrl)}"
385
+ title="${Ot(e)}"
324
386
  class="group flex w-full max-w-md cursor-pointer gap-[10px] overflow-hidden rounded-lg"
325
387
  target="${this.linksNewTab?"_blank":"_self"}"
326
388
  ?disabled="${this.streaming}">
327
- ${this.streaming?C`
389
+ ${this.streaming?_`
328
390
  <!-- shimmer -->
329
391
  <div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200"></div>
330
- `:o?C`
331
- <div class="relative h-[70px] w-[70px] overflow-hidden rounded-lg bg-gray-100">
332
- <!-- use the same icon as for missing image url as the background behind the image so there is no flicker while it's loading -->
333
- <div class="absolute inset-0 flex items-center justify-center">
334
- <!-- shopping bag icon -->
335
- <svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
336
- <path
337
- stroke-linecap="round"
338
- stroke-linejoin="round"
339
- d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
340
- </svg>
341
- </div>
342
-
343
- <!-- absolute position to take the height of the parent and to appear on top of the shopping bag background -->
344
- <div class="absolute inset-0 flex h-full w-full">
345
- ${f(this,Rr)&&f(this,Ti)?C`
346
- <!-- missing image url -->
347
- <div class="flex h-full w-full items-center justify-center">
348
- <!-- shopping bag icon -->
349
- <svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
350
- <path
351
- stroke-linecap="round"
352
- stroke-linejoin="round"
353
- d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
354
- </svg>
355
- </div>
356
- `:f(this,Rr)?C`
357
- <img
358
- @error="${()=>{I(this,Ti,!0),this.requestUpdate()}}"
359
- @load="${()=>{I(this,tr,!0),this.requestUpdate()}}"
360
- src="${o}"
361
- alt="preview image"
362
- class="${f(this,tr)?"bg-white":""} h-full w-full object-cover"
363
- loading="lazy" />
364
- `:C`
365
- <!-- Cloudflare Images: resize the source image -->
366
- <img
367
- @error="${()=>{I(this,Rr,!0),this.requestUpdate()}}"
368
- @load="${()=>{I(this,tr,!0),this.requestUpdate()}}"
369
- srcset="
370
- https://molin.foo/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=1/${o} 1x,
371
- https://molin.foo/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=2/${o} 2x
372
- "
373
- alt="preview image"
374
- class="${f(this,tr)?"bg-white":""} h-full w-full object-cover"
375
- loading="lazy" />
376
- `}
377
- </div>
378
- </div>
379
- `:C`
380
- <!-- missing image url -->
381
- <div class="flex h-[70px] w-[70px] overflow-hidden rounded-lg bg-gray-100">
382
- <div class="flex h-full w-full items-center justify-center">
383
- <!-- shopping bag icon -->
384
- <svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
385
- <path
386
- stroke-linecap="round"
387
- stroke-linejoin="round"
388
- d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
389
- </svg>
390
- </div>
391
- </div>
392
- `}
392
+ `:_`<mw-product-thumbnail class="block h-[70px] w-[70px]" src="${Ot(s)}"></mw-product-thumbnail>`}
393
393
 
394
394
  <div class="flex flex-1 flex-col justify-between">
395
395
  <div>
396
- ${t||!this.streaming?C`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${t}</h3>`:C`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
396
+ ${e||!this.streaming?_`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${e}</h3>`:_`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
397
397
 
398
398
  <!-- no margin here -->
399
399
 
400
- ${i||!this.streaming?C`<p class="line-clamp-2 text-xs text-gray-500">${i}</p>`:C`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
400
+ ${t||!this.streaming?_`<p class="line-clamp-2 text-xs text-gray-500">${t}</p>`:_`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
401
401
  </div>
402
402
 
403
403
  <!-- flexbox filled space -->
404
404
 
405
- ${n||!this.streaming?C`<span class="text-xs text-gray-900">${n}</span>`:C`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
405
+ ${i||!this.streaming?_`<span class="text-xs text-gray-900">${i}</span>`:_`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
406
406
  </div>
407
407
  </a>
408
- `}};Rr=new WeakMap,Ti=new WeakMap,tr=new WeakMap,M(ns,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",ns);function ss(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}var os=function(){},Or=function(){};var Mi=(r,e,t)=>Math.min(Math.max(t,r),e);var Sa=.001,Z0=.01,ld=10,J0=.05,X0=1;function ud({duration:r=800,bounce:e=.25,velocity:t=0,mass:i=1}){let n,s;os(r<=ld*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Mi(J0,X0,o),r=Mi(Z0,ld,r/1e3),o<1?(n=u=>{let d=u*o,c=d*r,p=d-t,h=as(u,o),g=Math.exp(-c);return Sa-p/h*g},s=u=>{let c=u*o*r,p=c*t+t,h=Math.pow(o,2)*Math.pow(u,2)*r,g=Math.exp(-c),m=as(Math.pow(u,2),o);return(-n(u)+Sa>0?-1:1)*((p-h)*g)/m}):(n=u=>{let d=Math.exp(-u*r),c=(u-t)*r+1;return-Sa+d*c},s=u=>{let d=Math.exp(-u*r),c=(t-u)*(r*r);return d*c});let l=5/r,a=Y0(n,s,l);if(r=r*1e3,isNaN(a))return{stiffness:100,damping:10,duration:r};{let u=Math.pow(a,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:r}}}var K0=12;function Y0(r,e,t){let i=t;for(let n=1;n<K0;n++)i=i-r(i)/e(i);return i}function as(r,e){return r*Math.sqrt(1-e*e)}var Q0=["duration","bounce"],eg=["stiffness","damping","mass"];function cd(r,e){return e.some(t=>r[t]!==void 0)}function tg(r){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},r);if(!cd(r,eg)&&cd(r,Q0)){let t=ud(r);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function ls(r){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:n}=r,s=ss(r,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:l,damping:a,mass:u,velocity:d,duration:c,isResolvedFromDuration:p}=tg(s),h=dd,g=dd;function m(){let y=d?-(d/1e3):0,w=t-e,_=a/(2*Math.sqrt(l*u)),x=Math.sqrt(l/u)/1e3;if(n===void 0&&(n=Math.min(Math.abs(t-e)/100,.4)),_<1){let S=as(x,_);h=R=>{let B=Math.exp(-_*x*R);return t-B*((y+_*x*w)/S*Math.sin(S*R)+w*Math.cos(S*R))},g=R=>{let B=Math.exp(-_*x*R);return _*x*B*(Math.sin(S*R)*(y+_*x*w)/S+w*Math.cos(S*R))-B*(Math.cos(S*R)*(y+_*x*w)-S*w*Math.sin(S*R))}}else if(_===1)h=S=>t-Math.exp(-x*S)*(w+(y+x*w)*S);else{let S=x*Math.sqrt(_*_-1);h=R=>{let B=Math.exp(-_*x*R),N=Math.min(S*R,300);return t-B*((y+_*x*w)*Math.sinh(N)+S*w*Math.cosh(N))/S}}}return m(),{next:y=>{let w=h(y);if(p)o.done=y>=c;else{let _=g(y)*1e3,x=Math.abs(_)<=i,S=Math.abs(t-w)<=n;o.done=x&&S}return o.value=o.done?t:w,o},flipTarget:()=>{d=-d,[e,t]=[t,e],m()}}}ls.needsInterpolation=(r,e)=>typeof r=="string"||typeof e=="string";var dd=r=>0;var Ea=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var Lr=(r,e,t)=>-t*r+t*e+r;var us=(r,e)=>t=>Math.max(Math.min(t,e),r),Ot=r=>r%1?Number(r.toFixed(5)):r,Fr=/(-)?([\d]*\.?[\d])+/g,cs=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,pd=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function _t(r){return typeof r=="string"}var Dr={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},ds=Object.assign(Object.assign({},Dr),{transform:us(0,1)}),G2=Object.assign(Object.assign({},Dr),{default:1});var Pi=r=>({test:e=>_t(e)&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),X2=Pi("deg"),jr=Pi("%"),K2=Pi("px"),Y2=Pi("vh"),Q2=Pi("vw"),e_=Object.assign(Object.assign({},jr),{parse:r=>jr.parse(r)/100,transform:r=>jr.transform(r*100)});var Nr=(r,e)=>t=>!!(_t(t)&&pd.test(t)&&t.startsWith(r)||e&&Object.prototype.hasOwnProperty.call(t,e)),ps=(r,e,t)=>i=>{if(!_t(i))return i;let[n,s,o,l]=i.match(Fr);return{[r]:parseFloat(n),[e]:parseFloat(s),[t]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}};var at={test:Nr("hsl","hue"),parse:ps("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+jr.transform(Ot(e))+", "+jr.transform(Ot(t))+", "+Ot(ds.transform(i))+")"};var rg=us(0,255),hs=Object.assign(Object.assign({},Dr),{transform:r=>Math.round(rg(r))}),Ke={test:Nr("rgb","red"),parse:ps("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+hs.transform(r)+", "+hs.transform(e)+", "+hs.transform(t)+", "+Ot(ds.transform(i))+")"};function ig(r){let e="",t="",i="",n="";return r.length>5?(e=r.substr(1,2),t=r.substr(3,2),i=r.substr(5,2),n=r.substr(7,2)):(e=r.substr(1,1),t=r.substr(2,1),i=r.substr(3,1),n=r.substr(4,1),e+=e,t+=t,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var Ur={test:Nr("#"),parse:ig,transform:Ke.transform};var Lt={test:r=>Ke.test(r)||Ur.test(r)||at.test(r),parse:r=>Ke.test(r)?Ke.parse(r):at.test(r)?at.parse(r):Ur.parse(r),transform:r=>_t(r)?r:r.hasOwnProperty("red")?Ke.transform(r):at.transform(r)};var hd="${c}",fd="${n}";function ng(r){var e,t,i,n;return isNaN(r)&&_t(r)&&((t=(e=r.match(Fr))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((n=(i=r.match(cs))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function gd(r){typeof r=="number"&&(r=`${r}`);let e=[],t=0,i=r.match(cs);i&&(t=i.length,r=r.replace(cs,hd),e.push(...i.map(Lt.parse)));let n=r.match(Fr);return n&&(r=r.replace(Fr,fd),e.push(...n.map(Dr.parse))),{values:e,numColors:t,tokenised:r}}function md(r){return gd(r).values}function vd(r){let{values:e,numColors:t,tokenised:i}=gd(r),n=e.length;return s=>{let o=i;for(let l=0;l<n;l++)o=o.replace(l<t?hd:fd,l<t?Lt.transform(s[l]):Ot(s[l]));return o}}var sg=r=>typeof r=="number"?0:r;function og(r){let e=md(r);return vd(r)(e.map(sg))}var fs={test:ng,parse:md,createTransformer:vd,getAnimatableNone:og};function $a(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function Ia({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let n=0,s=0,o=0;if(!e)n=s=o=t;else{let l=t<.5?t*(1+e):t+e-t*e,a=2*t-l;n=$a(a,l,r+1/3),s=$a(a,l,r),o=$a(a,l,r-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var ag=(r,e,t)=>{let i=r*r,n=e*e;return Math.sqrt(Math.max(0,t*(n-i)+i))},lg=[Ur,Ke,at],_d=r=>lg.find(e=>e.test(r)),yd=r=>`'${r}' is not an animatable color. Use the equivalent color code instead.`,gs=(r,e)=>{let t=_d(r),i=_d(e);Or(!!t,yd(r)),Or(!!i,yd(e));let n=t.parse(r),s=i.parse(e);t===at&&(n=Ia(n),t=Ke),i===at&&(s=Ia(s),i=Ke);let o=Object.assign({},n);return l=>{for(let a in o)a!=="alpha"&&(o[a]=ag(n[a],s[a],l));return o.alpha=Lr(n.alpha,s.alpha,l),t.transform(o)}};var bd=r=>typeof r=="number";var ug=(r,e)=>t=>e(r(t)),ms=(...r)=>r.reduce(ug);function xd(r,e){return bd(r)?t=>Lr(r,e,t):Lt.test(r)?gs(r,e):Ta(r,e)}var Aa=(r,e)=>{let t=[...r],i=t.length,n=r.map((s,o)=>xd(s,e[o]));return s=>{for(let o=0;o<i;o++)t[o]=n[o](s);return t}},kd=(r,e)=>{let t=Object.assign(Object.assign({},r),e),i={};for(let n in t)r[n]!==void 0&&e[n]!==void 0&&(i[n]=xd(r[n],e[n]));return n=>{for(let s in i)t[s]=i[s](n);return t}};function wd(r){let e=fs.parse(r),t=e.length,i=0,n=0,s=0;for(let o=0;o<t;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Ta=(r,e)=>{let t=fs.createTransformer(e),i=wd(r),n=wd(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?ms(Aa(i.parsed,n.parsed),t):(os(!0,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:r}`)};var cg=(r,e)=>t=>Lr(r,e,t);function dg(r){if(typeof r=="number")return cg;if(typeof r=="string")return Lt.test(r)?gs:Ta;if(Array.isArray(r))return Aa;if(typeof r=="object")return kd}function pg(r,e,t){let i=[],n=t||dg(r[0]),s=r.length-1;for(let o=0;o<s;o++){let l=n(r[o],r[o+1]);if(e){let a=Array.isArray(e)?e[o]:e;l=ms(a,l)}i.push(l)}return i}function hg([r,e],[t]){return i=>t(Ea(r,e,i))}function fg(r,e){let t=r.length,i=t-1;return n=>{let s=0,o=!1;if(n<=r[0]?o=!0:n>=r[i]&&(s=i-1,o=!0),!o){let a=1;for(;a<t&&!(r[a]>n||a===i);a++);s=a-1}let l=Ea(r[s],r[s+1],n);return e[s](l)}}function vs(r,e,{clamp:t=!0,ease:i,mixer:n}={}){let s=r.length;Or(s===e.length,"Both input and output ranges must be the same length"),Or(!i||!Array.isArray(i)||i.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),r[0]>r[s-1]&&(r=[].concat(r),e=[].concat(e),r.reverse(),e.reverse());let o=pg(e,i,n),l=s===2?hg(r,o):fg(r,o);return t?a=>l(Mi(r[0],r[s-1],a)):l}var Ri=r=>e=>1-r(1-e),_s=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2,Cd=r=>e=>Math.pow(e,r),Ma=r=>e=>e*e*((r+1)*e-r),Sd=r=>{let e=Ma(r);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))};var Ed=1.525,gg=4/11,mg=8/11,vg=9/10;var $d=Cd(2),iy=Ri($d),Id=_s($d),_g=r=>1-Math.sin(Math.acos(r)),yg=Ri(_g),ny=_s(yg),Ad=Ma(Ed),sy=Ri(Ad),oy=_s(Ad),ay=Sd(Ed),bg=4356/361,wg=35442/1805,xg=16061/1805,kg=r=>{if(r===1||r===0)return r;let e=r*r;return r<gg?7.5625*e:r<mg?9.075*e-9.9*r+3.4:r<vg?bg*e-wg*r+xg:10.8*r*r-20.52*r+10.72},ly=Ri(kg);function Cg(r,e){return r.map(()=>e||Id).splice(0,r.length-1)}function Sg(r){let e=r.length;return r.map((t,i)=>i!==0?i/(e-1):0)}function Eg(r,e){return r.map(t=>t*e)}function Oi({from:r=0,to:e=1,ease:t,offset:i,duration:n=300}){let s={done:!1,value:r},o=Array.isArray(e)?e:[r,e],l=Eg(i&&i.length===o.length?i:Sg(o),n);function a(){return vs(l,o,{ease:Array.isArray(t)?t:Cg(o,t)})}let u=a();return{next:d=>(s.value=u(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),u=a()}}}function Td({velocity:r=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},l=t*r,a=e+l,u=s===void 0?a:s(a);return u!==a&&(l=u-e),{next:d=>{let c=-l*Math.exp(-d/i);return o.done=!(c>n||c<-n),o.value=o.done?u:u+c,o},flipTarget:()=>{}}}var Md={keyframes:Oi,spring:ls,decay:Td};function Pd(r){if(Array.isArray(r.to))return Oi;if(Md[r.type])return Md[r.type];let e=new Set(Object.keys(r));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Oi:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ls:Oi}var Pa=16.666666666666668,$g=typeof performance<"u"?()=>performance.now():()=>Date.now(),Ra=typeof window<"u"?r=>window.requestAnimationFrame(r):r=>setTimeout(()=>r($g()),Pa);function Rd(r){let e=[],t=[],i=0,n=!1,s=!1,o=new WeakSet,l={schedule:(a,u=!1,d=!1)=>{let c=d&&n,p=c?e:t;return u&&o.add(a),p.indexOf(a)===-1&&(p.push(a),c&&n&&(i=e.length)),a},cancel:a=>{let u=t.indexOf(a);u!==-1&&t.splice(u,1),o.delete(a)},process:a=>{if(n){s=!0;return}if(n=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let u=0;u<i;u++){let d=e[u];d(a),o.has(d)&&(l.schedule(d),r())}n=!1,s&&(s=!1,l.process(a))}};return l}var Ig=40,Oa=!0,Fi=!1,La=!1,Li={delta:0,timestamp:0},Di=["read","update","preRender","render","postRender"],ys=Di.reduce((r,e)=>(r[e]=Rd(()=>Fi=!0),r),{}),Ag=Di.reduce((r,e)=>{let t=ys[e];return r[e]=(i,n=!1,s=!1)=>(Fi||Mg(),t.schedule(i,n,s)),r},{}),Od=Di.reduce((r,e)=>(r[e]=ys[e].cancel,r),{}),xy=Di.reduce((r,e)=>(r[e]=()=>ys[e].process(Li),r),{}),Tg=r=>ys[r].process(Li),Ld=r=>{Fi=!1,Li.delta=Oa?Pa:Math.max(Math.min(r-Li.timestamp,Ig),1),Li.timestamp=r,La=!0,Di.forEach(Tg),La=!1,Fi&&(Oa=!1,Ra(Ld))},Mg=()=>{Fi=!0,Oa=!0,La||Ra(Ld)};var Fd=Ag;function Fa(r,e,t=0){return r-e-t}function Dd(r,e,t=0,i=!0){return i?Fa(e+-r,e,t):e-(r-e)+t}function jd(r,e,t,i){return i?r>=e+t:r<=-t}var Pg=r=>{let e=({delta:t})=>r(t);return{start:()=>Fd.update(e,!0),stop:()=>Od.update(e)}};function Da(r){var e,t,{from:i,autoplay:n=!0,driver:s=Pg,elapsed:o=0,repeat:l=0,repeatType:a="loop",repeatDelay:u=0,onPlay:d,onStop:c,onComplete:p,onRepeat:h,onUpdate:g}=r,m=ss(r,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:y}=m,w,_=0,x=m.duration,S,R=!1,B=!0,N,P=Pd(m);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,y)&&(N=vs([0,100],[i,y],{clamp:!1}),i=0,y=100);let U=P(Object.assign(Object.assign({},m),{from:i,to:y}));function W(){_++,a==="reverse"?(B=_%2===0,o=Dd(o,x,u,B)):(o=Fa(o,x,u),a==="mirror"&&U.flipTarget()),R=!1,h&&h()}function xe(){w.stop(),p&&p()}function ce(Z){if(B||(Z=-Z),o+=Z,!R){let X=U.next(Math.max(0,o));S=X.value,N&&(S=N(S)),R=B?X.done:o<=0}g?.(S),R&&(_===0&&(x??(x=o)),_<l?jd(o,x,u,B)&&W():xe())}function je(){d?.(),w=s(ce),w.start()}return n&&je(),{stop:()=>{c?.(),w.stop()}}}var te,Nd,bs,Ud,ws,Bd,qd,Hd,xs,ks=class ks extends z(q){constructor(){super();b(this,te);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(t){t.has("product")&&E(this,te,Nd).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return C`
408
+ `}};M(hs,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",hs);function fs(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}var gs=function(){},Lr=function(){};var Oi=(r,e,t)=>Math.min(Math.max(t,r),e);var Fa=.001,tg=.01,fd=10,rg=.05,ig=1;function gd({duration:r=800,bounce:e=.25,velocity:t=0,mass:i=1}){let n,s;gs(r<=fd*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Oi(rg,ig,o),r=Oi(tg,fd,r/1e3),o<1?(n=u=>{let d=u*o,c=d*r,p=d-t,h=ms(u,o),g=Math.exp(-c);return Fa-p/h*g},s=u=>{let c=u*o*r,p=c*t+t,h=Math.pow(o,2)*Math.pow(u,2)*r,g=Math.exp(-c),m=ms(Math.pow(u,2),o);return(-n(u)+Fa>0?-1:1)*((p-h)*g)/m}):(n=u=>{let d=Math.exp(-u*r),c=(u-t)*r+1;return-Fa+d*c},s=u=>{let d=Math.exp(-u*r),c=(t-u)*(r*r);return d*c});let l=5/r,a=sg(n,s,l);if(r=r*1e3,isNaN(a))return{stiffness:100,damping:10,duration:r};{let u=Math.pow(a,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:r}}}var ng=12;function sg(r,e,t){let i=t;for(let n=1;n<ng;n++)i=i-r(i)/e(i);return i}function ms(r,e){return r*Math.sqrt(1-e*e)}var og=["duration","bounce"],ag=["stiffness","damping","mass"];function md(r,e){return e.some(t=>r[t]!==void 0)}function lg(r){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},r);if(!md(r,ag)&&md(r,og)){let t=gd(r);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function vs(r){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:n}=r,s=fs(r,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:l,damping:a,mass:u,velocity:d,duration:c,isResolvedFromDuration:p}=lg(s),h=vd,g=vd;function m(){let b=d?-(d/1e3):0,x=t-e,y=a/(2*Math.sqrt(l*u)),k=Math.sqrt(l/u)/1e3;if(n===void 0&&(n=Math.min(Math.abs(t-e)/100,.4)),y<1){let E=ms(k,y);h=R=>{let q=Math.exp(-y*k*R);return t-q*((b+y*k*x)/E*Math.sin(E*R)+x*Math.cos(E*R))},g=R=>{let q=Math.exp(-y*k*R);return y*k*q*(Math.sin(E*R)*(b+y*k*x)/E+x*Math.cos(E*R))-q*(Math.cos(E*R)*(b+y*k*x)-E*x*Math.sin(E*R))}}else if(y===1)h=E=>t-Math.exp(-k*E)*(x+(b+k*x)*E);else{let E=k*Math.sqrt(y*y-1);h=R=>{let q=Math.exp(-y*k*R),U=Math.min(E*R,300);return t-q*((b+y*k*x)*Math.sinh(U)+E*x*Math.cosh(U))/E}}}return m(),{next:b=>{let x=h(b);if(p)o.done=b>=c;else{let y=g(b)*1e3,k=Math.abs(y)<=i,E=Math.abs(t-x)<=n;o.done=k&&E}return o.value=o.done?t:x,o},flipTarget:()=>{d=-d,[e,t]=[t,e],m()}}}vs.needsInterpolation=(r,e)=>typeof r=="string"||typeof e=="string";var vd=r=>0;var Da=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var Fr=(r,e,t)=>-t*r+t*e+r;var _s=(r,e)=>t=>Math.max(Math.min(t,e),r),Lt=r=>r%1?Number(r.toFixed(5)):r,Dr=/(-)?([\d]*\.?[\d])+/g,ys=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,_d=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function yt(r){return typeof r=="string"}var jr={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},bs=Object.assign(Object.assign({},jr),{transform:_s(0,1)}),m_=Object.assign(Object.assign({},jr),{default:1});var Li=r=>({test:e=>yt(e)&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),y_=Li("deg"),Nr=Li("%"),b_=Li("px"),w_=Li("vh"),x_=Li("vw"),k_=Object.assign(Object.assign({},Nr),{parse:r=>Nr.parse(r)/100,transform:r=>Nr.transform(r*100)});var Ur=(r,e)=>t=>!!(yt(t)&&_d.test(t)&&t.startsWith(r)||e&&Object.prototype.hasOwnProperty.call(t,e)),ws=(r,e,t)=>i=>{if(!yt(i))return i;let[n,s,o,l]=i.match(Dr);return{[r]:parseFloat(n),[e]:parseFloat(s),[t]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}};var lt={test:Ur("hsl","hue"),parse:ws("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Nr.transform(Lt(e))+", "+Nr.transform(Lt(t))+", "+Lt(bs.transform(i))+")"};var ug=_s(0,255),xs=Object.assign(Object.assign({},jr),{transform:r=>Math.round(ug(r))}),Ke={test:Ur("rgb","red"),parse:ws("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+xs.transform(r)+", "+xs.transform(e)+", "+xs.transform(t)+", "+Lt(bs.transform(i))+")"};function cg(r){let e="",t="",i="",n="";return r.length>5?(e=r.substr(1,2),t=r.substr(3,2),i=r.substr(5,2),n=r.substr(7,2)):(e=r.substr(1,1),t=r.substr(2,1),i=r.substr(3,1),n=r.substr(4,1),e+=e,t+=t,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var Br={test:Ur("#"),parse:cg,transform:Ke.transform};var Ft={test:r=>Ke.test(r)||Br.test(r)||lt.test(r),parse:r=>Ke.test(r)?Ke.parse(r):lt.test(r)?lt.parse(r):Br.parse(r),transform:r=>yt(r)?r:r.hasOwnProperty("red")?Ke.transform(r):lt.transform(r)};var yd="${c}",bd="${n}";function dg(r){var e,t,i,n;return isNaN(r)&&yt(r)&&((t=(e=r.match(Dr))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((n=(i=r.match(ys))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function wd(r){typeof r=="number"&&(r=`${r}`);let e=[],t=0,i=r.match(ys);i&&(t=i.length,r=r.replace(ys,yd),e.push(...i.map(Ft.parse)));let n=r.match(Dr);return n&&(r=r.replace(Dr,bd),e.push(...n.map(jr.parse))),{values:e,numColors:t,tokenised:r}}function xd(r){return wd(r).values}function kd(r){let{values:e,numColors:t,tokenised:i}=wd(r),n=e.length;return s=>{let o=i;for(let l=0;l<n;l++)o=o.replace(l<t?yd:bd,l<t?Ft.transform(s[l]):Lt(s[l]));return o}}var pg=r=>typeof r=="number"?0:r;function hg(r){let e=xd(r);return kd(r)(e.map(pg))}var ks={test:dg,parse:xd,createTransformer:kd,getAnimatableNone:hg};function ja(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function Na({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let n=0,s=0,o=0;if(!e)n=s=o=t;else{let l=t<.5?t*(1+e):t+e-t*e,a=2*t-l;n=ja(a,l,r+1/3),s=ja(a,l,r),o=ja(a,l,r-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var fg=(r,e,t)=>{let i=r*r,n=e*e;return Math.sqrt(Math.max(0,t*(n-i)+i))},gg=[Br,Ke,lt],Cd=r=>gg.find(e=>e.test(r)),Ed=r=>`'${r}' is not an animatable color. Use the equivalent color code instead.`,Cs=(r,e)=>{let t=Cd(r),i=Cd(e);Lr(!!t,Ed(r)),Lr(!!i,Ed(e));let n=t.parse(r),s=i.parse(e);t===lt&&(n=Na(n),t=Ke),i===lt&&(s=Na(s),i=Ke);let o=Object.assign({},n);return l=>{for(let a in o)a!=="alpha"&&(o[a]=fg(n[a],s[a],l));return o.alpha=Fr(n.alpha,s.alpha,l),t.transform(o)}};var Sd=r=>typeof r=="number";var mg=(r,e)=>t=>e(r(t)),Es=(...r)=>r.reduce(mg);function Id(r,e){return Sd(r)?t=>Fr(r,e,t):Ft.test(r)?Cs(r,e):Ba(r,e)}var Ua=(r,e)=>{let t=[...r],i=t.length,n=r.map((s,o)=>Id(s,e[o]));return s=>{for(let o=0;o<i;o++)t[o]=n[o](s);return t}},Ad=(r,e)=>{let t=Object.assign(Object.assign({},r),e),i={};for(let n in t)r[n]!==void 0&&e[n]!==void 0&&(i[n]=Id(r[n],e[n]));return n=>{for(let s in i)t[s]=i[s](n);return t}};function $d(r){let e=ks.parse(r),t=e.length,i=0,n=0,s=0;for(let o=0;o<t;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Ba=(r,e)=>{let t=ks.createTransformer(e),i=$d(r),n=$d(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Es(Ua(i.parsed,n.parsed),t):(gs(!0,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:r}`)};var vg=(r,e)=>t=>Fr(r,e,t);function _g(r){if(typeof r=="number")return vg;if(typeof r=="string")return Ft.test(r)?Cs:Ba;if(Array.isArray(r))return Ua;if(typeof r=="object")return Ad}function yg(r,e,t){let i=[],n=t||_g(r[0]),s=r.length-1;for(let o=0;o<s;o++){let l=n(r[o],r[o+1]);if(e){let a=Array.isArray(e)?e[o]:e;l=Es(a,l)}i.push(l)}return i}function bg([r,e],[t]){return i=>t(Da(r,e,i))}function wg(r,e){let t=r.length,i=t-1;return n=>{let s=0,o=!1;if(n<=r[0]?o=!0:n>=r[i]&&(s=i-1,o=!0),!o){let a=1;for(;a<t&&!(r[a]>n||a===i);a++);s=a-1}let l=Da(r[s],r[s+1],n);return e[s](l)}}function Ss(r,e,{clamp:t=!0,ease:i,mixer:n}={}){let s=r.length;Lr(s===e.length,"Both input and output ranges must be the same length"),Lr(!i||!Array.isArray(i)||i.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),r[0]>r[s-1]&&(r=[].concat(r),e=[].concat(e),r.reverse(),e.reverse());let o=yg(e,i,n),l=s===2?bg(r,o):wg(r,o);return t?a=>l(Oi(r[0],r[s-1],a)):l}var Fi=r=>e=>1-r(1-e),$s=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2,Td=r=>e=>Math.pow(e,r),qa=r=>e=>e*e*((r+1)*e-r),Md=r=>{let e=qa(r);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))};var Pd=1.525,xg=4/11,kg=8/11,Cg=9/10;var Rd=Td(2),Sy=Fi(Rd),Od=$s(Rd),Eg=r=>1-Math.sin(Math.acos(r)),Sg=Fi(Eg),$y=$s(Sg),Ld=qa(Pd),Iy=Fi(Ld),Ay=$s(Ld),Ty=Md(Pd),$g=4356/361,Ig=35442/1805,Ag=16061/1805,Tg=r=>{if(r===1||r===0)return r;let e=r*r;return r<xg?7.5625*e:r<kg?9.075*e-9.9*r+3.4:r<Cg?$g*e-Ig*r+Ag:10.8*r*r-20.52*r+10.72},My=Fi(Tg);function Mg(r,e){return r.map(()=>e||Od).splice(0,r.length-1)}function Pg(r){let e=r.length;return r.map((t,i)=>i!==0?i/(e-1):0)}function Rg(r,e){return r.map(t=>t*e)}function Di({from:r=0,to:e=1,ease:t,offset:i,duration:n=300}){let s={done:!1,value:r},o=Array.isArray(e)?e:[r,e],l=Rg(i&&i.length===o.length?i:Pg(o),n);function a(){return Ss(l,o,{ease:Array.isArray(t)?t:Mg(o,t)})}let u=a();return{next:d=>(s.value=u(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),u=a()}}}function Fd({velocity:r=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},l=t*r,a=e+l,u=s===void 0?a:s(a);return u!==a&&(l=u-e),{next:d=>{let c=-l*Math.exp(-d/i);return o.done=!(c>n||c<-n),o.value=o.done?u:u+c,o},flipTarget:()=>{}}}var Dd={keyframes:Di,spring:vs,decay:Fd};function jd(r){if(Array.isArray(r.to))return Di;if(Dd[r.type])return Dd[r.type];let e=new Set(Object.keys(r));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Di:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?vs:Di}var Ha=16.666666666666668,Og=typeof performance<"u"?()=>performance.now():()=>Date.now(),za=typeof window<"u"?r=>window.requestAnimationFrame(r):r=>setTimeout(()=>r(Og()),Ha);function Nd(r){let e=[],t=[],i=0,n=!1,s=!1,o=new WeakSet,l={schedule:(a,u=!1,d=!1)=>{let c=d&&n,p=c?e:t;return u&&o.add(a),p.indexOf(a)===-1&&(p.push(a),c&&n&&(i=e.length)),a},cancel:a=>{let u=t.indexOf(a);u!==-1&&t.splice(u,1),o.delete(a)},process:a=>{if(n){s=!0;return}if(n=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let u=0;u<i;u++){let d=e[u];d(a),o.has(d)&&(l.schedule(d),r())}n=!1,s&&(s=!1,l.process(a))}};return l}var Lg=40,Va=!0,Ni=!1,Wa=!1,ji={delta:0,timestamp:0},Ui=["read","update","preRender","render","postRender"],Is=Ui.reduce((r,e)=>(r[e]=Nd(()=>Ni=!0),r),{}),Fg=Ui.reduce((r,e)=>{let t=Is[e];return r[e]=(i,n=!1,s=!1)=>(Ni||jg(),t.schedule(i,n,s)),r},{}),Ud=Ui.reduce((r,e)=>(r[e]=Is[e].cancel,r),{}),Vy=Ui.reduce((r,e)=>(r[e]=()=>Is[e].process(ji),r),{}),Dg=r=>Is[r].process(ji),Bd=r=>{Ni=!1,ji.delta=Va?Ha:Math.max(Math.min(r-ji.timestamp,Lg),1),ji.timestamp=r,Wa=!0,Ui.forEach(Dg),Wa=!1,Ni&&(Va=!1,za(Bd))},jg=()=>{Ni=!0,Va=!0,Wa||za(Bd)};var qd=Fg;function Ga(r,e,t=0){return r-e-t}function Hd(r,e,t=0,i=!0){return i?Ga(e+-r,e,t):e-(r-e)+t}function zd(r,e,t,i){return i?r>=e+t:r<=-t}var Ng=r=>{let e=({delta:t})=>r(t);return{start:()=>qd.update(e,!0),stop:()=>Ud.update(e)}};function Za(r){var e,t,{from:i,autoplay:n=!0,driver:s=Ng,elapsed:o=0,repeat:l=0,repeatType:a="loop",repeatDelay:u=0,onPlay:d,onStop:c,onComplete:p,onRepeat:h,onUpdate:g}=r,m=fs(r,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=m,x,y=0,k=m.duration,E,R=!1,q=!0,U,P=jd(m);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,b)&&(U=Ss([0,100],[i,b],{clamp:!1}),i=0,b=100);let B=P(Object.assign(Object.assign({},m),{from:i,to:b}));function W(){y++,a==="reverse"?(q=y%2===0,o=Hd(o,k,u,q)):(o=Ga(o,k,u),a==="mirror"&&B.flipTarget()),R=!1,h&&h()}function xe(){x.stop(),p&&p()}function ce(Z){if(q||(Z=-Z),o+=Z,!R){let X=B.next(Math.max(0,o));E=X.value,U&&(E=U(E)),R=q?X.done:o<=0}g?.(E),R&&(y===0&&(k??(k=o)),y<l?zd(o,k,u,q)&&W():xe())}function je(){d?.(),x=s(ce),x.start()}return n&&je(),{stop:()=>{c?.(),x.stop()}}}var te,Vd,As,Wd,Ts,Gd,Zd,Jd,Ms,Ps=class Ps extends z(j){constructor(){super();w(this,te);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(t){t.has("product")&&S(this,te,Vd).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return _`
409
409
  <div class="my-2 w-full rounded-3xl border bg-white p-4">
410
410
  <div class="relative mx-auto mb-4 max-w-[240px]">
411
411
  <div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
@@ -424,12 +424,12 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
424
424
  <div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
425
425
  </div>
426
426
  </div>
427
- `;if(this.product.layout==="horizontal")return C` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:t,description:i,price:n,category:s}=this.product;return C`
427
+ `;if(this.product.layout==="horizontal")return _` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:t,description:i,price:n,category:s}=this.product;return _`
428
428
  <div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
429
429
  <div class="pointer-events-auto mx-auto mb-4">
430
430
  <div class="group relative overflow-hidden rounded-2xl">
431
431
  <div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
432
- ${this.images.length>0?Rt(this.images,o=>o,(o,l)=>C`
432
+ ${this.images.length>0?it(this.images,o=>o,(o,l)=>_`
433
433
  <!-- Cloudflare Images: resize the source image -->
434
434
  <img
435
435
  src="https://molin.foo/cdn-cgi/image/w=100,fit=scale-down,format=auto,quality=75,dpr=1/${o}"
@@ -440,7 +440,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
440
440
  alt="image ${l+1}: ${t}"
441
441
  class="h-auto w-full flex-shrink-0 object-scale-down"
442
442
  loading="lazy" />
443
- `):C`
443
+ `):_`
444
444
  <div class="h-full w-full flex-shrink-0 object-scale-down"></div>
445
445
  <svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
446
446
  <rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
@@ -452,61 +452,61 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
452
452
  </svg>
453
453
  `}
454
454
  </div>
455
- ${$i(this.images.length>1,()=>C`
455
+ ${Ti(this.images.length>1,()=>_`
456
456
  <div class="absolute inset-0 flex items-center justify-between px-4">
457
457
  <button
458
- @click="${E(this,te,qd)}"
458
+ @click="${S(this,te,Zd)}"
459
459
  class="absolute left-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
460
460
  <hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
461
461
  </button>
462
462
  <button
463
- @click="${E(this,te,Bd)}"
463
+ @click="${S(this,te,Gd)}"
464
464
  class="absolute right-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
465
465
  <hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
466
466
  </button>
467
467
  </div>
468
468
  `)}
469
- ${$i(this.images?.length>1,()=>C`
469
+ ${Ti(this.images?.length>1,()=>_`
470
470
  <div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
471
- ${this.images.map((o,l)=>C`
471
+ ${this.images.map((o,l)=>_`
472
472
  <button
473
- @click="${()=>E(this,te,Hd).call(this,l)}"
473
+ @click="${()=>S(this,te,Jd).call(this,l)}"
474
474
  class="${l===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} h-1.5 w-1.5 rounded-full bg-white transition-all hover:bg-opacity-80"></button>
475
475
  `)}
476
476
  </div>
477
477
  `)}
478
478
  </div>
479
479
  </div>
480
- <div @click="${E(this,te,bs)}" class="cursor-pointer">
481
- ${s?C`<a @click="${E(this,te,bs)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
480
+ <div @click="${S(this,te,As)}" class="cursor-pointer">
481
+ ${s?_`<a @click="${S(this,te,As)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
482
482
 
483
483
  <h3
484
- @click="${E(this,te,bs)}"
484
+ @click="${S(this,te,As)}"
485
485
  class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
486
- ${t||C`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
486
+ ${t||_`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
487
487
  </h3>
488
- ${i?C`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${i}</p>`:C`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
489
- <span class="text-lg font-bold"> ${n||C`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
488
+ ${i?_`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${i}</p>`:_`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
489
+ <span class="text-lg font-bold"> ${n||_`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
490
490
 
491
491
  <!-- <div class="my-4 border-t border-gray-200"></div> -->
492
492
 
493
493
  <!-- <button
494
- @click="${E(this,te,Ud)}"
494
+ @click="${S(this,te,Wd)}"
495
495
  ?disabled="${!this._isValidUrl}"
496
496
  class="${this._isValidUrl?"bg-gray-900 hover:bg-gray-800":"bg-gray-900/80 cursor-default"} w-full rounded-xl px-4 py-1.5 text-sm text-white">
497
497
  ${this.labels.addToCart}
498
498
  </button> -->
499
499
  </div>
500
500
  </div>
501
- `}};te=new WeakSet,Nd=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let t=new URL(this.product.url);this._isValidUrl=t.protocol==="http:"||t.protocol==="https:"}catch{this._isValidUrl=!1}},bs=function(t){t.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Ud=function(t){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new ks.AddToCartEvent(this.product)))},ws=function(t,i){f(this,te,xs)&&Da({from:t,to:i,duration:300,onUpdate:n=>{f(this,te,xs)&&(f(this,te,xs).style.transform=`translateX(${n}%)`)}})},Bd=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,i=(t+1)%this.product.images.length,n=-(t*100),s=-(i*100);E(this,te,ws).call(this,n,s),this._currentImageIndex=i},qd=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,i=(t-1+this.product.images.length)%this.product.images.length,n=-(t*100),s=-(i*100);E(this,te,ws).call(this,n,s),this._currentImageIndex=i},Hd=function(t){if(!this.product?.images?.length)return;let i=this._currentImageIndex,n=Math.max(0,Math.min(t,this.product.images.length-1)),s=-(i*100),o=-(n*100);E(this,te,ws).call(this,s,o),this._currentImageIndex=n},xs=function(){return this.renderRoot.querySelector(".image-slider")},M(ks,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var ji=ks,ja;ji.AddToCartEvent=(ja=class extends CustomEvent{constructor(e,t={}){super(ji.AddToCartEvent.type,{detail:{product:e},...t})}},M(ja,"type","mw-product-card:add-to-cart"),ja);customElements.get("mw-product-card")||customElements.define("mw-product-card",ji);var Ni,Ue,lt,Ui,Na,Cs=class{constructor(e,t){b(this,Ui);b(this,Ni);b(this,Ue);b(this,lt);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");I(this,Ni,e),f(this,Ni).addController(this),I(this,Ue,t)}connect(e){I(this,Ue,e),I(this,lt,E(this,Ui,Na).call(this))}hostConnected(){setTimeout(()=>{I(this,lt,E(this,Ui,Na).call(this))},0)}hostDisconnected(){f(this,lt)?.close(1e3,"lit_host_disconnected"),I(this,lt,void 0)}send(e){f(this,lt)?.send(e)}close(e,t){f(this,lt)?.close(e,t)}get isConnected(){return f(this,lt)?.readyState===WebSocket.OPEN}};Ni=new WeakMap,Ue=new WeakMap,lt=new WeakMap,Ui=new WeakSet,Na=function(){let e=new WebSocket(f(this,Ue).url());return f(this,Ue).onClose&&(e.onclose=f(this,Ue).onClose),f(this,Ue).onOpen&&(e.onopen=f(this,Ue).onOpen),f(this,Ue).onError&&(e.onerror=f(this,Ue).onError),f(this,Ue).onMessage&&(e.onmessage=f(this,Ue).onMessage),e};var zd="664df22d-d461-42d6-801e-f70247e2cd7c",ye,be,it,Br,qr,ke,rr,Vd,Wd,Gd,Zd,Ss=class{constructor(e,t){b(this,ke);b(this,ye);b(this,be);b(this,it);M(this,"isStreaming",!1);M(this,"typingIndicator");M(this,"ranOutOfCredits",!1);M(this,"messages",[]);M(this,"conversationId","");b(this,Br,0);b(this,qr);M(this,"isLiveMode",!1);I(this,ye,e),I(this,be,t),I(this,it,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:i,role:n="user",expectStreaming:s=!1}={}){return E(this,ke,rr).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:i},{expectStreaming:s})}sendUserCancel(){return E(this,ke,rr).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return E(this,ke,rr).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return E(this,ke,rr).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){E(this,ke,rr).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,it).close(1e3,"closed by user")}retry(){clearTimeout(f(this,qr)),I(this,qr,setTimeout(()=>{f(this,be).onReconnect?.(),I(this,it,this.initWS())},1e3*f(this,Br))),Vu(this,Br)._++}initWS(){return new Cs(f(this,ye),{url:()=>f(this,be).url(this.conversationId,{}),onOpen:e=>E(this,ke,Vd).call(this,e),onMessage:e=>E(this,ke,Wd).call(this,JSON.parse(e.data)),onError:e=>E(this,ke,Gd).call(this,e),onClose:e=>E(this,ke,Zd).call(this,e)})}hostConnected(){this.conversationId=f(this,be).restoreConversationState?.()?.conversationId||"",this.messages=f(this,be).restoreConversationState?.()?.messages||[]}reset(){E(this,ke,rr).call(this,{type:"NEW_CHAT"}),f(this,be).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,f(this,ye).requestUpdate()}hostDisconnected(){clearTimeout(f(this,qr))}reconnectSocket(){f(this,it).close(1e3,"destroy"),I(this,it,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};ye=new WeakMap,be=new WeakMap,it=new WeakMap,Br=new WeakMap,qr=new WeakMap,ke=new WeakSet,rr=function(e,{expectStreaming:t=!1}={}){return f(this,it).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,ye).requestUpdate()),f(this,it).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Vd=function(e){I(this,Br,0)},Wd=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((t,i,n)=>i===n.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,f(this,ye).requestUpdate(),f(this,be).onNewMessage?.(e.message);break}case"APPEND_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t){switch(e.message.content_type){case"text":{let{part:i,delta:n,position:s}=e.message;t.content=t.content.slice(0,s)+n,t.parts||=[],t.parts[i]={text:t.parts[i]&&"text"in t.parts[i]?(t.parts[i].text||"").slice(0,s)+n:n};break}case"html":{let{part:i,delta:n,position:s}=e.message;t.parts||=[],t.parts[i]={html:t.parts[i]&&"html"in t.parts[i]?(t.parts[i].html||"").slice(0,s)+n:n};break}case"data":{let{part:i}=e.message;t.parts||=[],t.parts[i]={tag:e.message.tag,data:t.parts[i]&&"data"in t.parts[i]?Object.assign(t.parts[i].data||{},e.message.data):e.message.data};break}}e.metadata&&(t.metadata=e.metadata),f(this,be).onMessageAppend?.(e),f(this,ye).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),t.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,f(this,ye).requestUpdate(),f(this,be).onMessageDone?.(e,t),f(this,be).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,f(this,ye).requestUpdate();break}case"ERROR":{f(this,be).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,f(this,be).onConnect?.(e.conversationId),f(this,be).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,f(this,ye).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,ye).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,ye).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===zd)||this.messages.push({id:zd,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,ye).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,ye).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Gd=function(e){console.error("onError",e),f(this,be).onError?.(e)},Zd=function(e){f(this,ye).isConnected&&!f(this,it).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,ye).requestUpdate(),f(this,be).onClose?.()};function Jd(r){return Array.isArray(r)?r:r?[r]:[]}function Xd(r,e){let t=new Map;for(let i of r){let n=e(i);t.has(n)||t.set(n,[]),(t.get(n)||[]).push(i)}return t}var Bi=class extends Ir{constructor(e){if(super(e),this.it=j,e.type!==Yn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===j||e==null)return this._t=void 0,this.it=e;if(e===tt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Bi.directiveName="unsafeHTML",Bi.resultType=1;var Kd=Qn(Bi);var Ua;function Ba(r){return{lang:r?.lang??Ua?.lang,message:r?.message,abortEarly:r?.abortEarly??Ua?.abortEarly,abortPipeEarly:r?.abortPipeEarly??Ua?.abortPipeEarly}}var Rg;function Og(r){return Rg?.get(r)}var Lg;function Fg(r){return Lg?.get(r)}var Dg;function jg(r,e){return Dg?.get(r)?.get(e)}function Qd(r){let e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}function Ye(r,e,t,i,n){let s=n&&"input"in n?n.input:t.value,o=n?.expected??r.expects??null,l=n?.received??Qd(s),a={kind:r.kind,type:r.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:r.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=r.kind==="schema",d=n?.message??r.message??jg(r.reference,a.lang)??(u?Fg(a.lang):null)??i.message??Og(a.lang);d&&(a.message=typeof d=="function"?d(a):d),u&&(t.typed=!1),t.issues?t.issues.push(a):t.issues=[a]}function Ve(r){return{version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},Ba())}}}function Ng(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function ep(r,e){let t=[...new Set(r)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Ug=class extends Error{constructor(r){super(r[0].message),this.name="ValiError",this.issues=r}};function qa(r,e){return{kind:"validation",type:"max_length",reference:qa,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(t,i){return t.typed&&t.value.length>this.requirement&&Ye(this,"length",t,i,{received:`${t.value.length}`}),t}}}function Ha(r,e){return{kind:"validation",type:"min_length",reference:Ha,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(t,i){return t.typed&&t.value.length<this.requirement&&Ye(this,"length",t,i,{received:`${t.value.length}`}),t}}}function Bg(r,e,t){return typeof r.default=="function"?r.default(e,t):r.default}function za(){return{kind:"schema",type:"any",reference:za,expects:"any",async:!1,get"~standard"(){return Ve(this)},"~run"(r){return r.typed=!0,r}}}function Hr(r,e){return{kind:"schema",type:"array",reference:Hr,expects:"Array",async:!1,item:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){let n=t.value;if(Array.isArray(n)){t.typed=!0,t.value=[];for(let s=0;s<n.length;s++){let o=n[s],l=this.item["~run"]({value:o},i);if(l.issues){let a={type:"array",origin:"value",input:n,key:s,value:o};for(let u of l.issues)u.path?u.path.unshift(a):u.path=[a],t.issues?.push(u);if(t.issues||(t.issues=l.issues),i.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else Ye(this,"type",t,i);return t}}}function Va(r){return{kind:"schema",type:"boolean",reference:Va,expects:"boolean",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:Ye(this,"type",e,t),e}}}function Wa(r){return{kind:"schema",type:"null",reference:Wa,expects:"null",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return e.value===null?e.typed=!0:Ye(this,"type",e,t),e}}}function Es(r){return{kind:"schema",type:"number",reference:Es,expects:"number",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ye(this,"type",e,t),e}}}function yt(r,e){return{kind:"schema",type:"object",reference:yt,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){let n=t.value;if(n&&typeof n=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=n[s],l=this.entries[s]["~run"]({value:o},i);if(l.issues){let a={type:"object",origin:"value",input:n,key:s,value:o};for(let u of l.issues)u.path?u.path.unshift(a):u.path=[a],t.issues?.push(u);if(t.issues||(t.issues=l.issues),i.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),(l.value!==void 0||s in n)&&(t.value[s]=l.value)}}else Ye(this,"type",t,i);return t}}}function zr(r,e){return{kind:"schema",type:"optional",reference:zr,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return Ve(this)},"~run"(t,i){return t.value===void 0&&(this.default!==void 0&&(t.value=Bg(this,t,i)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,i)}}}function Ga(r,e){return{kind:"schema",type:"picklist",reference:Ga,expects:ep(r.map(Qd),"|"),async:!1,options:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){return this.options.includes(t.value)?t.typed=!0:Ye(this,"type",t,i),t}}}function $s(r,e,t){return{kind:"schema",type:"record",reference:$s,expects:"Object",async:!1,key:r,value:e,message:t,get"~standard"(){return Ve(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(Ng(s,o)){let l=s[o],a=this.key["~run"]({value:o},n);if(a.issues){let d={type:"object",origin:"key",input:s,key:o,value:l};for(let c of a.issues)c.path=[d],i.issues?.push(c);if(i.issues||(i.issues=a.issues),n.abortEarly){i.typed=!1;break}}let u=this.value["~run"]({value:l},n);if(u.issues){let d={type:"object",origin:"value",input:s,key:o,value:l};for(let c of u.issues)c.path?c.path.unshift(d):c.path=[d],i.issues?.push(c);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!a.typed||!u.typed)&&(i.typed=!1),a.typed&&(i.value[a.value]=u.value)}}else Ye(this,"type",i,n);return i}}}function pe(r){return{kind:"schema",type:"string",reference:pe,expects:"string",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:Ye(this,"type",e,t),e}}}function Yd(r){let e;if(r)for(let t of r)e?e.push(...t.issues):e=t.issues;return e}function Vr(r,e){return{kind:"schema",type:"union",reference:Vr,expects:ep(r.map(t=>t.expects),"|"),async:!1,options:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){let n,s,o;for(let l of this.options){let a=l["~run"]({value:t.value},i);if(a.typed)if(a.issues)s?s.push(a):s=[a];else{n=a;break}else o?o.push(a):o=[a]}if(n)return n;if(s){if(s.length===1)return s[0];Ye(this,"type",t,i,{issues:Yd(s)}),t.typed=!0}else{if(o?.length===1)return o[0];Ye(this,"type",t,i,{issues:Yd(o)})}return t}}}function tp(r,e,t){let i=r["~run"]({value:e},Ba(t));if(i.issues)throw new Ug(i.issues);return i.value}function rp(r,e){let t={};for(let i in r.entries)t[i]=!e||e.includes(i)?zr(r.entries[i]):r.entries[i];return{...r,entries:t,get"~standard"(){return Ve(this)}}}function ip(...r){return{...r[0],pipe:r,get"~standard"(){return Ve(this)},"~run"(e,t){for(let i of r)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=i["~run"](e,t))}return e}}}function qi(r,e,t){let i=r["~run"]({value:e},Ba(t));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var qg=rp(yt({name:pe(),description:pe(),price:pe(),image_url:Vr([pe(),Hr(pe())]),category:pe(),url:pe()}));function sp(r,e,t,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1}){if(!r)return C``;let l=e>0&&t[e-1]&&"data"in t[e-1],a=e<t.length-1||!o;if("text"in r)return C`<p>${r.text}</p>`;if("html"in r)return C`${Kd(r.html)}`;if("data"in r)switch(r.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let u=qi(qg,r.data);if(u.success){let d={...u.output,images:[]};return d.images=Jd(d.image_url),C`
502
- ${l?C`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
501
+ `}};te=new WeakSet,Vd=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let t=new URL(this.product.url);this._isValidUrl=t.protocol==="http:"||t.protocol==="https:"}catch{this._isValidUrl=!1}},As=function(t){t.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Wd=function(t){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new Ps.AddToCartEvent(this.product)))},Ts=function(t,i){f(this,te,Ms)&&Za({from:t,to:i,duration:300,onUpdate:n=>{f(this,te,Ms)&&(f(this,te,Ms).style.transform=`translateX(${n}%)`)}})},Gd=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,i=(t+1)%this.product.images.length,n=-(t*100),s=-(i*100);S(this,te,Ts).call(this,n,s),this._currentImageIndex=i},Zd=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,i=(t-1+this.product.images.length)%this.product.images.length,n=-(t*100),s=-(i*100);S(this,te,Ts).call(this,n,s),this._currentImageIndex=i},Jd=function(t){if(!this.product?.images?.length)return;let i=this._currentImageIndex,n=Math.max(0,Math.min(t,this.product.images.length-1)),s=-(i*100),o=-(n*100);S(this,te,Ts).call(this,s,o),this._currentImageIndex=n},Ms=function(){return this.renderRoot.querySelector(".image-slider")},M(Ps,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Bi=Ps,Ja;Bi.AddToCartEvent=(Ja=class extends CustomEvent{constructor(e,t={}){super(Bi.AddToCartEvent.type,{detail:{product:e},...t})}},M(Ja,"type","mw-product-card:add-to-cart"),Ja);customElements.get("mw-product-card")||customElements.define("mw-product-card",Bi);var qi,Ue,ut,Hi,Xa,Rs=class{constructor(e,t){w(this,Hi);w(this,qi);w(this,Ue);w(this,ut);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");I(this,qi,e),f(this,qi).addController(this),I(this,Ue,t)}connect(e){I(this,Ue,e),I(this,ut,S(this,Hi,Xa).call(this))}hostConnected(){setTimeout(()=>{I(this,ut,S(this,Hi,Xa).call(this))},0)}hostDisconnected(){f(this,ut)?.close(1e3,"lit_host_disconnected"),I(this,ut,void 0)}send(e){f(this,ut)?.send(e)}close(e,t){f(this,ut)?.close(e,t)}get isConnected(){return f(this,ut)?.readyState===WebSocket.OPEN}};qi=new WeakMap,Ue=new WeakMap,ut=new WeakMap,Hi=new WeakSet,Xa=function(){let e=new WebSocket(f(this,Ue).url());return f(this,Ue).onClose&&(e.onclose=f(this,Ue).onClose),f(this,Ue).onOpen&&(e.onopen=f(this,Ue).onOpen),f(this,Ue).onError&&(e.onerror=f(this,Ue).onError),f(this,Ue).onMessage&&(e.onmessage=f(this,Ue).onMessage),e};var Xd="664df22d-d461-42d6-801e-f70247e2cd7c",ye,be,nt,qr,Hr,ke,ir,Kd,Yd,Qd,ep,Os=class{constructor(e,t){w(this,ke);w(this,ye);w(this,be);w(this,nt);M(this,"isStreaming",!1);M(this,"typingIndicator");M(this,"ranOutOfCredits",!1);M(this,"messages",[]);M(this,"conversationId","");w(this,qr,0);w(this,Hr);M(this,"isLiveMode",!1);I(this,ye,e),I(this,be,t),I(this,nt,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:i,role:n="user",expectStreaming:s=!1}={}){return S(this,ke,ir).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:i},{expectStreaming:s})}sendUserCancel(){return S(this,ke,ir).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return S(this,ke,ir).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return S(this,ke,ir).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){S(this,ke,ir).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,nt).close(1e3,"closed by user")}retry(){clearTimeout(f(this,Hr)),I(this,Hr,setTimeout(()=>{f(this,be).onReconnect?.(),I(this,nt,this.initWS())},1e3*f(this,qr))),rc(this,qr)._++}initWS(){return new Rs(f(this,ye),{url:()=>f(this,be).url(this.conversationId,{}),onOpen:e=>S(this,ke,Kd).call(this,e),onMessage:e=>S(this,ke,Yd).call(this,JSON.parse(e.data)),onError:e=>S(this,ke,Qd).call(this,e),onClose:e=>S(this,ke,ep).call(this,e)})}hostConnected(){this.conversationId=f(this,be).restoreConversationState?.()?.conversationId||"",this.messages=f(this,be).restoreConversationState?.()?.messages||[]}reset(){S(this,ke,ir).call(this,{type:"NEW_CHAT"}),f(this,be).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,f(this,ye).requestUpdate()}hostDisconnected(){clearTimeout(f(this,Hr))}reconnectSocket(){f(this,nt).close(1e3,"destroy"),I(this,nt,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};ye=new WeakMap,be=new WeakMap,nt=new WeakMap,qr=new WeakMap,Hr=new WeakMap,ke=new WeakSet,ir=function(e,{expectStreaming:t=!1}={}){return f(this,nt).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,ye).requestUpdate()),f(this,nt).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Kd=function(e){I(this,qr,0)},Yd=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((t,i,n)=>i===n.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,f(this,ye).requestUpdate(),f(this,be).onNewMessage?.(e.message);break}case"APPEND_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t){switch(e.message.content_type){case"text":{let{part:i,delta:n,position:s}=e.message;t.content=t.content.slice(0,s)+n,t.parts||=[],t.parts[i]={text:t.parts[i]&&"text"in t.parts[i]?(t.parts[i].text||"").slice(0,s)+n:n};break}case"html":{let{part:i,delta:n,position:s}=e.message;t.parts||=[],t.parts[i]={html:t.parts[i]&&"html"in t.parts[i]?(t.parts[i].html||"").slice(0,s)+n:n};break}case"data":{let{part:i}=e.message;t.parts||=[],t.parts[i]={tag:e.message.tag,data:t.parts[i]&&"data"in t.parts[i]?Object.assign(t.parts[i].data||{},e.message.data):e.message.data};break}}e.metadata&&(t.metadata=e.metadata),f(this,be).onMessageAppend?.(e),f(this,ye).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),t.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,f(this,ye).requestUpdate(),f(this,be).onMessageDone?.(e,t),f(this,be).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,f(this,ye).requestUpdate();break}case"ERROR":{f(this,be).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,f(this,be).onConnect?.(e.conversationId),f(this,be).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,f(this,ye).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,ye).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,ye).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Xd)||this.messages.push({id:Xd,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,ye).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,ye).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Qd=function(e){console.error("onError",e),f(this,be).onError?.(e)},ep=function(e){f(this,ye).isConnected&&!f(this,nt).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,ye).requestUpdate(),f(this,be).onClose?.()};function zr(r){return Array.isArray(r)?r:r?[r]:[]}function tp(r,e){let t=new Map;for(let i of r){let n=e(i);t.has(n)||t.set(n,[]),(t.get(n)||[]).push(i)}return t}var zi=class extends Ar{constructor(e){if(super(e),this.it=N,e.type!==os.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===N||e==null)return this._t=void 0,this.it=e;if(e===tt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};zi.directiveName="unsafeHTML",zi.resultType=1;var rp=as(zi);var Ka;function Ya(r){return{lang:r?.lang??Ka?.lang,message:r?.message,abortEarly:r?.abortEarly??Ka?.abortEarly,abortPipeEarly:r?.abortPipeEarly??Ka?.abortPipeEarly}}var Ug;function Bg(r){return Ug?.get(r)}var qg;function Hg(r){return qg?.get(r)}var zg;function Vg(r,e){return zg?.get(r)?.get(e)}function np(r){let e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}function Ye(r,e,t,i,n){let s=n&&"input"in n?n.input:t.value,o=n?.expected??r.expects??null,l=n?.received??np(s),a={kind:r.kind,type:r.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:r.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=r.kind==="schema",d=n?.message??r.message??Vg(r.reference,a.lang)??(u?Hg(a.lang):null)??i.message??Bg(a.lang);d&&(a.message=typeof d=="function"?d(a):d),u&&(t.typed=!1),t.issues?t.issues.push(a):t.issues=[a]}function Ve(r){return{version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},Ya())}}}function Wg(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function sp(r,e){let t=[...new Set(r)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Gg=class extends Error{constructor(r){super(r[0].message),this.name="ValiError",this.issues=r}};function Qa(r,e){return{kind:"validation",type:"max_length",reference:Qa,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(t,i){return t.typed&&t.value.length>this.requirement&&Ye(this,"length",t,i,{received:`${t.value.length}`}),t}}}function el(r,e){return{kind:"validation",type:"min_length",reference:el,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(t,i){return t.typed&&t.value.length<this.requirement&&Ye(this,"length",t,i,{received:`${t.value.length}`}),t}}}function Zg(r,e,t){return typeof r.default=="function"?r.default(e,t):r.default}function tl(){return{kind:"schema",type:"any",reference:tl,expects:"any",async:!1,get"~standard"(){return Ve(this)},"~run"(r){return r.typed=!0,r}}}function Vr(r,e){return{kind:"schema",type:"array",reference:Vr,expects:"Array",async:!1,item:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){let n=t.value;if(Array.isArray(n)){t.typed=!0,t.value=[];for(let s=0;s<n.length;s++){let o=n[s],l=this.item["~run"]({value:o},i);if(l.issues){let a={type:"array",origin:"value",input:n,key:s,value:o};for(let u of l.issues)u.path?u.path.unshift(a):u.path=[a],t.issues?.push(u);if(t.issues||(t.issues=l.issues),i.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else Ye(this,"type",t,i);return t}}}function rl(r){return{kind:"schema",type:"boolean",reference:rl,expects:"boolean",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:Ye(this,"type",e,t),e}}}function il(r){return{kind:"schema",type:"null",reference:il,expects:"null",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return e.value===null?e.typed=!0:Ye(this,"type",e,t),e}}}function Ls(r){return{kind:"schema",type:"number",reference:Ls,expects:"number",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ye(this,"type",e,t),e}}}function bt(r,e){return{kind:"schema",type:"object",reference:bt,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){let n=t.value;if(n&&typeof n=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=n[s],l=this.entries[s]["~run"]({value:o},i);if(l.issues){let a={type:"object",origin:"value",input:n,key:s,value:o};for(let u of l.issues)u.path?u.path.unshift(a):u.path=[a],t.issues?.push(u);if(t.issues||(t.issues=l.issues),i.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),(l.value!==void 0||s in n)&&(t.value[s]=l.value)}}else Ye(this,"type",t,i);return t}}}function Wr(r,e){return{kind:"schema",type:"optional",reference:Wr,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return Ve(this)},"~run"(t,i){return t.value===void 0&&(this.default!==void 0&&(t.value=Zg(this,t,i)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,i)}}}function nl(r,e){return{kind:"schema",type:"picklist",reference:nl,expects:sp(r.map(np),"|"),async:!1,options:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){return this.options.includes(t.value)?t.typed=!0:Ye(this,"type",t,i),t}}}function Fs(r,e,t){return{kind:"schema",type:"record",reference:Fs,expects:"Object",async:!1,key:r,value:e,message:t,get"~standard"(){return Ve(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(Wg(s,o)){let l=s[o],a=this.key["~run"]({value:o},n);if(a.issues){let d={type:"object",origin:"key",input:s,key:o,value:l};for(let c of a.issues)c.path=[d],i.issues?.push(c);if(i.issues||(i.issues=a.issues),n.abortEarly){i.typed=!1;break}}let u=this.value["~run"]({value:l},n);if(u.issues){let d={type:"object",origin:"value",input:s,key:o,value:l};for(let c of u.issues)c.path?c.path.unshift(d):c.path=[d],i.issues?.push(c);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!a.typed||!u.typed)&&(i.typed=!1),a.typed&&(i.value[a.value]=u.value)}}else Ye(this,"type",i,n);return i}}}function pe(r){return{kind:"schema",type:"string",reference:pe,expects:"string",async:!1,message:r,get"~standard"(){return Ve(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:Ye(this,"type",e,t),e}}}function ip(r){let e;if(r)for(let t of r)e?e.push(...t.issues):e=t.issues;return e}function Gr(r,e){return{kind:"schema",type:"union",reference:Gr,expects:sp(r.map(t=>t.expects),"|"),async:!1,options:r,message:e,get"~standard"(){return Ve(this)},"~run"(t,i){let n,s,o;for(let l of this.options){let a=l["~run"]({value:t.value},i);if(a.typed)if(a.issues)s?s.push(a):s=[a];else{n=a;break}else o?o.push(a):o=[a]}if(n)return n;if(s){if(s.length===1)return s[0];Ye(this,"type",t,i,{issues:ip(s)}),t.typed=!0}else{if(o?.length===1)return o[0];Ye(this,"type",t,i,{issues:ip(o)})}return t}}}function op(r,e,t){let i=r["~run"]({value:e},Ya(t));if(i.issues)throw new Gg(i.issues);return i.value}function ap(r,e){let t={};for(let i in r.entries)t[i]=!e||e.includes(i)?Wr(r.entries[i]):r.entries[i];return{...r,entries:t,get"~standard"(){return Ve(this)}}}function lp(...r){return{...r[0],pipe:r,get"~standard"(){return Ve(this)},"~run"(e,t){for(let i of r)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=i["~run"](e,t))}return e}}}function Vi(r,e,t){let i=r["~run"]({value:e},Ya(t));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var Jg=ap(bt({name:pe(),description:pe(),price:pe(),image_url:Gr([pe(),Vr(pe())]),category:pe(),url:pe()}));function cp(r,e,t,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1}){if(!r)return _``;let l=e>0&&t[e-1]&&"data"in t[e-1],a=e<t.length-1||!o;if("text"in r)return _`<p>${r.text}</p>`;if("html"in r)return _`${rp(r.html)}`;if("data"in r)switch(r.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let u=Vi(Jg,r.data);if(u.success){let d={...u.output,images:[]};return d.images=zr(d.image_url),_`
502
+ ${l?_`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
503
503
  <mw-product-card-horizontal
504
504
  product="${JSON.stringify(d)}"
505
505
  ?streaming="${!a}"
506
506
  ?links-new-tab="${n}"
507
507
  .searchParams="${s}"
508
508
  .imagesByProductUrl="${i}"></mw-product-card-horizontal>
509
- `}console.warn(u.issues);break}}return console.warn("could not render part:",r),C`<p><i>data type not supported</i></p>`}var Hi,Wr,Ft,ir,As,op,Is=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,As);b(this,Hi);b(this,Wr);b(this,Ft);b(this,ir,!1);M(this,"timeoutMs");I(this,Hi,e),I(this,Wr,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return f(this,ir)}hostDisconnected(){clearTimeout(f(this,Ft)),I(this,Ft,void 0)}onInput(e){if(f(this,Hi).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,Ft)),I(this,Ft,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,ir)||E(this,As,op).call(this)}}typingStopped(){clearTimeout(f(this,Ft)),I(this,ir,!1),f(this,Wr).typingStopped()}};Hi=new WeakMap,Wr=new WeakMap,Ft=new WeakMap,ir=new WeakMap,As=new WeakSet,op=function(){I(this,ir,!0),f(this,Wr).typingStarted()};function ap(r,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(r);return`${r.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var Hg=!0,Za="Invariant failed";function lp(r,e){if(!r){if(Hg)throw new Error(Za);var t=typeof e=="function"?e():e,i=t?"".concat(Za,": ").concat(t):Za;throw new Error(i)}}var zg="\xB7 \xB7 \xB7",Vg=yt({conversationId:zr(pe()),messages:zr(Hr(yt({id:pe(),timestamp:Es(),role:Ga(["user","assistant","support"]),content:pe(),parts:zr(Hr(Vr([yt({text:pe()}),yt({html:pe()}),yt({tag:pe(),data:$s(pe(),za())})])))})))}),Wg=$s(pe(),Vr([pe(),Es(),Va(),Wa()])),Gg=ip(pe(),Ha(1),qa(1e3)),Gr,Zr,J,Xa,Ts,Vi,nr,ne,Wi,up,cp,dp,pp,hp,fp,gp,mp,Ms,Ps=class Ps extends z(q){constructor(){super();b(this,J);b(this,Gr);b(this,Zr);b(this,Vi,new Is(this,{typingStarted:()=>f(this,ne).sendUserTypingStart(),typingStopped:()=>f(this,ne).sendUserTypingStop()}));b(this,nr,!1);b(this,ne,new Ss(this,{url:t=>{let i=new URL(this.config.wsApiUrl);return i.searchParams.set("widgetId",this.widgetId),i.searchParams.set("conversationId",t),i.searchParams.set("pageUrl",window.location.href),i},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{I(this,nr,!1),t.role==="user"&&f(this,J,Ms)?.scrollTo(0,f(this,J,Ms).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageAppend:t=>{let i=f(this,J,Ms);if(!i)return;let n=f(this,ne).lastMsg;!n||n.role!=="assistant"||requestAnimationFrame(()=>{let s=i.querySelector(`[data-id="${n.id}"]`);if(!s)return;let o=s.offsetHeight,l=i.getClientRects()[0].height-70;o>l&&!f(this,nr)&&(i.scrollTop=s.offsetTop-80)})},onMessageDone:(t,i)=>{I(this,nr,!1),i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(f(this,J,Ts))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(f(this,J,Ts),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,J,Ts))||"{}"),i=tp(Vg,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));b(this,Wi,"single");this.widgetId="",this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get conversationId(){return f(this,ne).conversationId}get messages(){return f(this,ne).messages}firstUpdated(){E(this,J,Xa).call(this)}updated(){E(this,J,Xa).call(this)}render(){lp(this.config,"config is required");let t=Xd(this.messages,i=>{try{let n=new Date(i.timestamp),s=Math.floor(n.getUTCMinutes()/5)*5;return n.setUTCMinutes(s,0,0),n.valueOf().toString()}catch(n){console.error(n)}});return C`
509
+ `}console.warn(u.issues);break}case"order-status-card-v1":return _`<mw-product-order-status-card order-details="${JSON.stringify(r.data)}" ?streaming="${!a}" ?links-new-tab="${n}"></mw-product-order-status-card> `}return console.warn("could not render part:",r),_`<p><i>data type not supported</i></p>`}var Wi,Zr,Dt,nr,js,dp,Ds=class{constructor(e,t,{timeoutMs:i=2e3}={}){w(this,js);w(this,Wi);w(this,Zr);w(this,Dt);w(this,nr,!1);M(this,"timeoutMs");I(this,Wi,e),I(this,Zr,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return f(this,nr)}hostDisconnected(){clearTimeout(f(this,Dt)),I(this,Dt,void 0)}onInput(e){if(f(this,Wi).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,Dt)),I(this,Dt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,nr)||S(this,js,dp).call(this)}}typingStopped(){clearTimeout(f(this,Dt)),I(this,nr,!1),f(this,Zr).typingStopped()}};Wi=new WeakMap,Zr=new WeakMap,Dt=new WeakMap,nr=new WeakMap,js=new WeakSet,dp=function(){I(this,nr,!0),f(this,Zr).typingStarted()};function pp(r,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(r);return`${r.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var Xg=!0,sl="Invariant failed";function hp(r,e){if(!r){if(Xg)throw new Error(sl);var t=typeof e=="function"?e():e,i=t?"".concat(sl,": ").concat(t):sl;throw new Error(i)}}var Kg="\xB7 \xB7 \xB7",Yg=bt({conversationId:Wr(pe()),messages:Wr(Vr(bt({id:pe(),timestamp:Ls(),role:nl(["user","assistant","support"]),content:pe(),parts:Wr(Vr(Gr([bt({text:pe()}),bt({html:pe()}),bt({tag:pe(),data:Fs(pe(),tl())})])))})))}),Qg=Fs(pe(),Gr([pe(),Ls(),rl(),il()])),e1=lp(pe(),el(1),Qa(1e3)),Jr,Xr,J,al,Ns,Zi,sr,ne,Ji,fp,gp,mp,vp,_p,yp,bp,wp,Us,Bs=class Bs extends z(j){constructor(){super();w(this,J);w(this,Jr);w(this,Xr);w(this,Zi,new Ds(this,{typingStarted:()=>f(this,ne).sendUserTypingStart(),typingStopped:()=>f(this,ne).sendUserTypingStop()}));w(this,sr,!1);w(this,ne,new Os(this,{url:t=>{let i=new URL(this.config.wsApiUrl);return i.searchParams.set("widgetId",this.widgetId),i.searchParams.set("conversationId",t),i.searchParams.set("pageUrl",window.location.href),i},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{I(this,sr,!1),t.role==="user"&&f(this,J,Us)?.scrollTo(0,f(this,J,Us).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageAppend:t=>{let i=f(this,J,Us);if(!i)return;let n=f(this,ne).lastMsg;!n||n.role!=="assistant"||requestAnimationFrame(()=>{let s=i.querySelector(`[data-id="${n.id}"]`);if(!s)return;let o=s.offsetHeight,l=i.getClientRects()[0].height-70;o>l&&!f(this,sr)&&(i.scrollTop=s.offsetTop-80)})},onMessageDone:(t,i)=>{I(this,sr,!1),i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(f(this,J,Ns))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(f(this,J,Ns),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,J,Ns))||"{}"),i=op(Yg,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));w(this,Ji,"single");this.widgetId="",this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get conversationId(){return f(this,ne).conversationId}get messages(){return f(this,ne).messages}firstUpdated(){S(this,J,al).call(this)}updated(){S(this,J,al).call(this)}render(){hp(this.config,"config is required");let t=tp(this.messages,i=>{try{let n=new Date(i.timestamp),s=Math.floor(n.getUTCMinutes()/5)*5;return n.setUTCMinutes(s,0,0),n.valueOf().toString()}catch(n){console.error(n)}});return _`
510
510
  <div class="relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px]">
511
511
  <div
512
512
  class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px]">
@@ -515,8 +515,8 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
515
515
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
516
516
  ?show-new-chat="${!f(this,ne).isLiveMode&&this.messages.length>0}"
517
517
  ?show-close="${this.showClose}"
518
- @mw:new-chat-click="${E(this,J,gp)}"
519
- @mw:close-click="${E(this,J,mp)}">
518
+ @mw:new-chat-click="${S(this,J,bp)}"
519
+ @mw:close-click="${S(this,J,wp)}">
520
520
  </mw-chat-header>
521
521
 
522
522
  <!-- used by the dashboard to inject content -->
@@ -525,8 +525,8 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
525
525
  </div>
526
526
 
527
527
  <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
528
- <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto" @scroll="${E(this,J,up)}">
529
- ${this.config?.showStillLearningBanner?C`
528
+ <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto" @scroll="${S(this,J,fp)}">
529
+ ${this.config?.showStillLearningBanner?_`
530
530
  <div class="flex justify-center">
531
531
  <div class="mb-2 flex max-w-[70%] select-none items-center justify-center rounded-full bg-black px-3 py-2">
532
532
  <!-- (i) symbol -->
@@ -541,7 +541,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
541
541
  <span class="ml-1 text-xs text-white">I'm still learning!</span>
542
542
  </div>
543
543
  </div>
544
- `:C`
544
+ `:_`
545
545
  <!-- this makes the chat stick to bottom when the banner is hidden -->
546
546
  <div class="flex p-1"></div>
547
547
  `}
@@ -549,19 +549,19 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
549
549
  <!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
550
550
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
551
551
  <div class="${this.messages.length>0?"pt-20":""}">
552
- ${Rt(Array.from(t),([i])=>i,([i,n])=>C`
553
- <div class="my-2 text-center text-xs text-gray-500">${ap(new Date(Number(i)),window.navigator.language)}</div>
554
- ${Rt(n??[],s=>s.id,(s,o)=>{let a=n[o+1]?.role===s.role,d=(o>0?n[o-1]:void 0)?.role===s.role,p=(n.length>0?n[n.length-1]:void 0)?.id===s.id;I(this,Wi,p&&!d&&!a?"single-current":!d&&!a?"single":!d&&a?"first":p&&d&&!a?"last-current":d&&!a?"last":d&&a?"middle":"single");let g=f(this,ne).isLiveMode&&s.role==="user"&&s.id===f(this,ne).lastMsg?.id?"sent":"";return C`
552
+ ${it(Array.from(t),([i])=>i,([i,n])=>_`
553
+ <div class="my-2 text-center text-xs text-gray-500">${pp(new Date(Number(i)),window.navigator.language)}</div>
554
+ ${it(n??[],s=>s.id,(s,o)=>{let a=n[o+1]?.role===s.role,d=(o>0?n[o-1]:void 0)?.role===s.role,p=(n.length>0?n[n.length-1]:void 0)?.id===s.id;I(this,Ji,p&&!d&&!a?"single-current":!d&&!a?"single":!d&&a?"first":p&&d&&!a?"last-current":d&&!a?"last":d&&a?"middle":"single");let g=f(this,ne).isLiveMode&&s.role==="user"&&s.id===f(this,ne).lastMsg?.id?"sent":"";return _`
555
555
  <div data-id="${s.id}" class="${a?"mb-[2px]":"mb-3"} mx-2 flex-row">
556
556
  <mw-chat-message
557
557
  color="${this.config.color}"
558
558
  status="${g}"
559
559
  logo="${s.metadata?.avatar||this.config.logoUrl}"
560
560
  side="${s.role}"
561
- position=${f(this,Wi)}
562
- @click="${E(this,J,cp)}">
561
+ position=${f(this,Ji)}
562
+ @click="${S(this,J,gp)}">
563
563
  <div class="prose break-words text-inherit">
564
- ${s.content===zg?C`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.parts?Rt(s.parts,(m,y)=>y,(m,y)=>sp(m,y,s.parts??[],{imagesByProductUrl:s.metadata?.imagesByProductUrl,linksNewTab:this.config.linksNewTab??!0,searchParams:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:s.streaming})):C`<p>${s.content}</p>`}
564
+ ${s.content===Kg?_`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.parts?it(s.parts,(m,b)=>b,(m,b)=>cp(m,b,s.parts??[],{imagesByProductUrl:s.metadata?.imagesByProductUrl,linksNewTab:this.config.linksNewTab??!0,searchParams:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:s.streaming})):_`<p>${s.content}</p>`}
565
565
  </div>
566
566
  </mw-chat-message>
567
567
  </div>
@@ -569,7 +569,7 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
569
569
  `)}
570
570
 
571
571
  <!-- show typing indicator if the non-user side is typing -->
572
- ${["assistant","support"].includes(f(this,ne)?.typingIndicator?.role??"")&&f(this,ne)?.typingIndicator?.role?C`
572
+ ${["assistant","support"].includes(f(this,ne)?.typingIndicator?.role??"")&&f(this,ne)?.typingIndicator?.role?_`
573
573
  <mw-chat-message
574
574
  class="mx-2 mb-3 block"
575
575
  color="${this.config.color}"
@@ -579,27 +579,27 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
579
579
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>
580
580
  </div>
581
581
  </mw-chat-message>
582
- `:j}
582
+ `:N}
583
583
  </div>
584
584
 
585
585
  <mw-chat-background
586
586
  class="flex-grow"
587
587
  .examples="${this.messages.length>0?[]:this.config.examples}"
588
588
  color="${this.config.color}"
589
- @mw:example-click="${E(this,J,dp)}"></mw-chat-background>
589
+ @mw:example-click="${S(this,J,mp)}"></mw-chat-background>
590
590
  </div>
591
591
 
592
592
  <div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
593
593
  <mw-chat-input
594
- @mw:change="${E(this,J,hp)}"
595
- @mw:submit="${E(this,J,pp)}"
596
- @mw:cancel="${E(this,J,fp)}"
594
+ @mw:change="${S(this,J,_p)}"
595
+ @mw:submit="${S(this,J,vp)}"
596
+ @mw:cancel="${S(this,J,yp)}"
597
597
  placeholder="${this.config.input?.placeholder}"
598
598
  ?disabled="${f(this,ne).ranOutOfCredits}"
599
599
  ?streaming="${f(this,ne)?.isStreaming??!0}">
600
600
  </mw-chat-input>
601
601
 
602
- ${this.config.removePoweredBy?j:C`
602
+ ${this.config.removePoweredBy?N:_`
603
603
  <!-- spacing between input box and powered-by or bottom -->
604
604
  <div class="h-4">
605
605
  <mw-powered-by></mw-powered-by>
@@ -608,71 +608,71 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
608
608
  </div>
609
609
  </div>
610
610
  </div>
611
- `}reloadConfig(){f(this,ne).reloadConfig(),this.requestUpdate()}};Gr=new WeakMap,Zr=new WeakMap,J=new WeakSet,Xa=function(){if(this.xUserData){let t;try{t=JSON.parse(this.xUserData)}catch(n){console.error("Molin: x-user-data is not valid JSON",n)}let i=qi(Wg,t);i.success?I(this,Gr,i.output):console.error("Molin: x-user-data does not pass schema validation",i.issues)}if(this.xPromptExt){let t=qi(Gg,this.xPromptExt);t.success?I(this,Zr,t.output):console.error("Molin: x-prompt-ext does not pass schema validation",t.issues)}},Ts=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},Vi=new WeakMap,nr=new WeakMap,ne=new WeakMap,Wi=new WeakMap,up=function(){I(this,nr,!0)},cp=function(t){let i=t.target;if(i instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let s=this.config.linksNewTab?"_blank":"_self";window.open(i.href,i.target||s)}},dp=function(t){let i=t.detail.example;if(!f(this,ne)?.sendUserInput(i,{xUserData:f(this,Gr),xPromptExt:f(this,Zr)})){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},pp=function(t){let i=t.detail;if(!f(this,ne)?.sendUserInput(i,{xUserData:f(this,Gr),xPromptExt:f(this,Zr)})){t.preventDefault();return}f(this,Vi).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},hp=function(t){f(this,Vi).onInput(t.detail.full)},fp=function(){f(this,ne)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},gp=function(){f(this,ne).reset()},mp=function(){this.dispatchEvent(new Ps.CloseClickEvent)},Ms=function(){return this.renderRoot.querySelector("#scrollable-content")},M(Ps,"properties",{widgetId:{type:String,attribute:"widget"},config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var zi=Ps,Ja;zi.CloseClickEvent=(Ja=class extends CustomEvent{constructor(e={}){super(zi.CloseClickEvent.type,{...e})}},M(Ja,"type","mw:close-click"),Ja);customElements.get("mw-chat")||customElements.define("mw-chat",zi);var Jr,vp,_p,Gi=class Gi extends z(q){constructor(){super();b(this,Jr);M(this,"render",()=>C`
611
+ `}reloadConfig(){f(this,ne).reloadConfig(),this.requestUpdate()}};Jr=new WeakMap,Xr=new WeakMap,J=new WeakSet,al=function(){if(this.xUserData){let t;try{t=JSON.parse(this.xUserData)}catch(n){console.error("Molin: x-user-data is not valid JSON",n)}let i=Vi(Qg,t);i.success?I(this,Jr,i.output):console.error("Molin: x-user-data does not pass schema validation",i.issues)}if(this.xPromptExt){let t=Vi(e1,this.xPromptExt);t.success?I(this,Xr,t.output):console.error("Molin: x-prompt-ext does not pass schema validation",t.issues)}},Ns=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},Zi=new WeakMap,sr=new WeakMap,ne=new WeakMap,Ji=new WeakMap,fp=function(){I(this,sr,!0)},gp=function(t){let i=t.target;if(i instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let s=this.config.linksNewTab?"_blank":"_self";window.open(i.href,i.target||s)}},mp=function(t){let i=t.detail.example;if(!f(this,ne)?.sendUserInput(i,{xUserData:f(this,Jr),xPromptExt:f(this,Xr)})){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},vp=function(t){let i=t.detail;if(!f(this,ne)?.sendUserInput(i,{xUserData:f(this,Jr),xPromptExt:f(this,Xr)})){t.preventDefault();return}f(this,Zi).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},_p=function(t){f(this,Zi).onInput(t.detail.full)},yp=function(){f(this,ne)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},bp=function(){f(this,ne).reset()},wp=function(){this.dispatchEvent(new Bs.CloseClickEvent)},Us=function(){return this.renderRoot.querySelector("#scrollable-content")},M(Bs,"properties",{widgetId:{type:String,attribute:"widget"},config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var Gi=Bs,ol;Gi.CloseClickEvent=(ol=class extends CustomEvent{constructor(e={}){super(Gi.CloseClickEvent.type,{...e})}},M(ol,"type","mw:close-click"),ol);customElements.get("mw-chat")||customElements.define("mw-chat",Gi);var Kr,xp,kp,Xi=class Xi extends z(j){constructor(){super();w(this,Kr);M(this,"render",()=>_`
612
612
  <!-- wrapper -->
613
613
  <div class="group relative z-[2147483647] w-[300px] cursor-pointer select-none rounded-2xl rounded-t-2xl bg-white font-sans text-base leading-normal shadow-2xl">
614
614
  <!-- close button -->
615
615
  <button
616
616
  class="absolute -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 pb-[2px] text-center text-gray-700 opacity-0 shadow transition-opacity duration-300 ease-in-out group-hover:opacity-100"
617
- @click="${E(this,Jr,vp)}"
617
+ @click="${S(this,Kr,xp)}"
618
618
  aria-label="Close">
619
619
  ×
620
620
  </button>
621
621
 
622
622
  <!-- content -->
623
- <div class="p-4 text-left text-gray-800" @click="${E(this,Jr,_p)}">
623
+ <div class="p-4 text-left text-gray-800" @click="${S(this,Kr,kp)}">
624
624
  <p>${this.text}</p>
625
625
  </div>
626
626
  </div>
627
- `);this.text="Hello there. How can we help?"}};Jr=new WeakSet,vp=function(){this.dispatchEvent(new Gi.CloseEvent)},_p=function(){this.dispatchEvent(new Gi.ClickEvent)},M(Gi,"properties",{text:{type:String}});var sr=Gi,Ka;sr.CloseEvent=(Ka=class extends CustomEvent{constructor(e={}){super(sr.CloseEvent.type,{...e})}},M(Ka,"type","mw:close"),Ka);var Ya;sr.ClickEvent=(Ya=class extends CustomEvent{constructor(e={}){super(sr.ClickEvent.type,{...e})}},M(Ya,"type","mw:click"),Ya);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",sr);var Xr,yp,bp,Zi=class Zi extends z(q){constructor(){super();b(this,Xr);M(this,"render",()=>C`
627
+ `);this.text="Hello there. How can we help?"}};Kr=new WeakSet,xp=function(){this.dispatchEvent(new Xi.CloseEvent)},kp=function(){this.dispatchEvent(new Xi.ClickEvent)},M(Xi,"properties",{text:{type:String}});var or=Xi,ll;or.CloseEvent=(ll=class extends CustomEvent{constructor(e={}){super(or.CloseEvent.type,{...e})}},M(ll,"type","mw:close"),ll);var ul;or.ClickEvent=(ul=class extends CustomEvent{constructor(e={}){super(or.ClickEvent.type,{...e})}},M(ul,"type","mw:click"),ul);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",or);var Yr,Cp,Ep,Ki=class Ki extends z(j){constructor(){super();w(this,Yr);M(this,"render",()=>_`
628
628
  <!-- wrapper -->
629
629
  <div class="group relative z-[2147483647] select-none rounded-t-2xl bg-white text-left font-sans text-[16px] text-base leading-normal text-gray-800 shadow-2xl transition-all">
630
630
  <!-- close button -->
631
631
  <button
632
632
  class="absolute right-4 top-[28px] inline-flex h-7 w-7 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 pb-[2px] text-center text-xl shadow-none duration-300 ease-in-out focus:outline-none"
633
- @click="${E(this,Xr,yp)}"
633
+ @click="${S(this,Yr,Cp)}"
634
634
  aria-label="Close">
635
635
  ×
636
636
  </button>
637
637
 
638
638
  <!-- content -->
639
- <div class="p-4 text-gray-800" @click="${E(this,Xr,bp)}">
639
+ <div class="p-4 text-gray-800" @click="${S(this,Yr,Ep)}">
640
640
  <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
641
641
  <p class="py-2.5 text-left">${this.text}</p>
642
642
  <div class="h-4"></div>
643
- ${this.button&&this.color?C`
643
+ ${this.button&&this.color?_`
644
644
  <!-- only visible if button text and color are given -->
645
645
  <button class="w-full rounded-full bg-[${this.color}] px-5 py-2.5 text-center text-sm font-medium text-white" type="button">${this.button}</button>
646
- `:j}
646
+ `:N}
647
647
  </div>
648
648
 
649
649
  <!-- can append any other content -->
650
650
  <slot name="footer"></slot>
651
651
  </div>
652
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Xr=new WeakSet,yp=function(){this.dispatchEvent(new Zi.CloseEvent)},bp=function(){this.dispatchEvent(new Zi.ClickEvent)},M(Zi,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var or=Zi,Qa;or.CloseEvent=(Qa=class extends CustomEvent{constructor(e={}){super(or.CloseEvent.type,{...e})}},M(Qa,"type","mw:close"),Qa);var el;or.ClickEvent=(el=class extends CustomEvent{constructor(e={}){super(or.ClickEvent.type,{...e})}},M(el,"type","mw:click"),el);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",or);var Kr,Ji,ar,Rs=class{constructor(e,t){b(this,Kr);b(this,Ji,!1);b(this,ar,()=>{f(this,Ji)||(f(this,Kr).userFirstInteracted?.(),I(this,Ji,!0)),f(this,Kr).userInteracted?.()});I(this,Kr,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",f(this,ar)),window.addEventListener("keydown",f(this,ar))}stopListening(){window.removeEventListener("click",f(this,ar)),window.removeEventListener("keydown",f(this,ar))}};Kr=new WeakMap,Ji=new WeakMap,ar=new WeakMap;var Zg=24*60*60*1e3,Yr,We,lr,Xi,ur,Ki,Ls,wp,Os=class{constructor(e,t,i=Date){b(this,Ls);b(this,Yr);b(this,We);b(this,lr);b(this,Xi);b(this,ur,!1);b(this,Ki,!1);I(this,Yr,e),I(this,We,t),I(this,lr,i),e.addController(this)}get showing(){return f(this,ur)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!f(this,ur)&&(I(this,ur,!0),f(this,Yr).requestUpdate(),e)){f(this,We).playPopupSound();let t=f(this,We).getPersistedState();f(this,We).setPersistedState({...t,playedSoundOnce:!0})}}hide(){I(this,Ki,!0),this.abortAutoShowTimer(),I(this,ur,!1),f(this,Yr).requestUpdate()}abortAutoShowTimer(){clearTimeout(f(this,Xi))}onCloseClick(){let e=f(this,We).getPersistedState();f(this,We).setPersistedState({...e,userDismissedAt:f(this,lr).now()}),this.hide()}onContentClick(){let e=f(this,We).getPersistedState();f(this,We).setPersistedState({...e,userDismissedAt:f(this,lr).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),f(this,Ki)||I(this,Xi,setTimeout(()=>E(this,Ls,wp).call(this),f(this,We).getDelayMs()))}};Yr=new WeakMap,We=new WeakMap,lr=new WeakMap,Xi=new WeakMap,ur=new WeakMap,Ki=new WeakMap,Ls=new WeakSet,wp=function(){let e=f(this,We).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&f(this,lr).now()-e.userDismissedAt<Zg||this.show({sound:!t})};var Dt,il,bt,Fs,rl,Ds=class Ds extends z(q){constructor(){super();b(this,bt);b(this,Dt,new Os(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));b(this,il,new Rs(this,f(this,Dt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=f(this,Dt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return C`
652
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Yr=new WeakSet,Cp=function(){this.dispatchEvent(new Ki.CloseEvent)},Ep=function(){this.dispatchEvent(new Ki.ClickEvent)},M(Ki,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var ar=Ki,cl;ar.CloseEvent=(cl=class extends CustomEvent{constructor(e={}){super(ar.CloseEvent.type,{...e})}},M(cl,"type","mw:close"),cl);var dl;ar.ClickEvent=(dl=class extends CustomEvent{constructor(e={}){super(ar.ClickEvent.type,{...e})}},M(dl,"type","mw:click"),dl);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",ar);var Qr,Yi,lr,qs=class{constructor(e,t){w(this,Qr);w(this,Yi,!1);w(this,lr,()=>{f(this,Yi)||(f(this,Qr).userFirstInteracted?.(),I(this,Yi,!0)),f(this,Qr).userInteracted?.()});I(this,Qr,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",f(this,lr)),window.addEventListener("keydown",f(this,lr))}stopListening(){window.removeEventListener("click",f(this,lr)),window.removeEventListener("keydown",f(this,lr))}};Qr=new WeakMap,Yi=new WeakMap,lr=new WeakMap;var t1=24*60*60*1e3,ei,We,ur,Qi,cr,en,zs,Sp,Hs=class{constructor(e,t,i=Date){w(this,zs);w(this,ei);w(this,We);w(this,ur);w(this,Qi);w(this,cr,!1);w(this,en,!1);I(this,ei,e),I(this,We,t),I(this,ur,i),e.addController(this)}get showing(){return f(this,cr)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!f(this,cr)&&(I(this,cr,!0),f(this,ei).requestUpdate(),e)){f(this,We).playPopupSound();let t=f(this,We).getPersistedState();f(this,We).setPersistedState({...t,playedSoundOnce:!0})}}hide(){I(this,en,!0),this.abortAutoShowTimer(),I(this,cr,!1),f(this,ei).requestUpdate()}abortAutoShowTimer(){clearTimeout(f(this,Qi))}onCloseClick(){let e=f(this,We).getPersistedState();f(this,We).setPersistedState({...e,userDismissedAt:f(this,ur).now()}),this.hide()}onContentClick(){let e=f(this,We).getPersistedState();f(this,We).setPersistedState({...e,userDismissedAt:f(this,ur).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),f(this,en)||I(this,Qi,setTimeout(()=>S(this,zs,Sp).call(this),f(this,We).getDelayMs()))}};ei=new WeakMap,We=new WeakMap,ur=new WeakMap,Qi=new WeakMap,cr=new WeakMap,en=new WeakMap,zs=new WeakSet,Sp=function(){let e=f(this,We).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&f(this,ur).now()-e.userDismissedAt<t1||this.show({sound:!t})};var jt,fl,wt,Vs,hl,Ws=class Ws extends z(j){constructor(){super();w(this,wt);w(this,jt,new Hs(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));w(this,fl,new qs(this,f(this,jt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=f(this,jt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return _`
653
653
  <!-- mobile shadow backdrop -->
654
- <div @click="${E(this,bt,Fs)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
654
+ <div @click="${S(this,wt,Vs)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
655
655
 
656
656
  <!-- mobile overlay -->
657
657
  <div class="${t} fixed bottom-0 left-0 right-0 z-[2147483647] sm:hidden">
658
- <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${E(this,bt,rl)}" @mw:close="${E(this,bt,Fs)}">
659
- ${i.mobile.poweredBy?C`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:j}
658
+ <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${S(this,wt,hl)}" @mw:close="${S(this,wt,Vs)}">
659
+ ${i.mobile.poweredBy?_`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:N}
660
660
  </mw-popup-mobile>
661
661
  </div>
662
662
 
663
663
  <!-- desktop -->
664
664
  <div class="${t} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
665
- <mw-popup-desktop text="${i.desktop.text}" @mw:click="${E(this,bt,rl)}" @mw:close="${E(this,bt,Fs)}"></mw-popup-desktop>
665
+ <mw-popup-desktop text="${i.desktop.text}" @mw:click="${S(this,wt,hl)}" @mw:close="${S(this,wt,Vs)}"></mw-popup-desktop>
666
666
  </div>
667
- `}hide(){f(this,Dt).hide()}};Dt=new WeakMap,il=new WeakMap,bt=new WeakSet,Fs=function(){f(this,Dt).onCloseClick()},rl=function(){this.dispatchEvent(new Ds.ClickEvent),f(this,Dt).onContentClick()},M(Ds,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Yi=Ds,tl;Yi.ClickEvent=(tl=class extends CustomEvent{constructor(e={}){super(Yi.ClickEvent.type,{...e})}},M(tl,"type","mw:click"),tl);customElements.get("mw-popup")||customElements.define("mw-popup",Yi);var Ns,xp,js=class extends z(q){constructor(){super();b(this,Ns);M(this,"render",()=>C`
667
+ `}hide(){f(this,jt).hide()}};jt=new WeakMap,fl=new WeakMap,wt=new WeakSet,Vs=function(){f(this,jt).onCloseClick()},hl=function(){this.dispatchEvent(new Ws.ClickEvent),f(this,jt).onContentClick()},M(Ws,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var tn=Ws,pl;tn.ClickEvent=(pl=class extends CustomEvent{constructor(e={}){super(tn.ClickEvent.type,{...e})}},M(pl,"type","mw:click"),pl);customElements.get("mw-popup")||customElements.define("mw-popup",tn);var Zs,$p,Gs=class extends z(j){constructor(){super();w(this,Zs);M(this,"render",()=>_`
668
668
  <span class="relative inline-flex">
669
669
  <slot></slot>
670
- <span class="${f(this,Ns,xp)} pointer-events-none absolute z-10 flex h-3 w-3">
670
+ <span class="${f(this,Zs,$p)} pointer-events-none absolute z-10 flex h-3 w-3">
671
671
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
672
672
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
673
673
  </span>
674
674
  </span>
675
- `);this.color="sky-500",this.position="top-right"}};Ns=new WeakSet,xp=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},M(js,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",js);var Us=class extends z(q){constructor(){super();M(this,"render",()=>C`
675
+ `);this.color="sky-500",this.position="top-right"}};Zs=new WeakSet,$p=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},M(Gs,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Gs);var Js=class extends z(j){constructor(){super();M(this,"render",()=>_`
676
676
  <div class="${this.positionClasses} fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base">
677
677
  <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
678
678
 
@@ -685,76 +685,261 @@ var Zf=Object.defineProperty;var zu=r=>{throw TypeError(r)};var Jf=(r,e,t)=>e in
685
685
  stroke-linecap="round"></path>
686
686
  </svg>
687
687
  </div>
688
- `);this.positionClasses="",this.text="Try it out"}};M(Us,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Us);window.__INIT_MOLIN_SHOP_AI=function(e){if(Jg(e),e.auto){let t=document.createElement("molin-shop-ai");t.setAttribute("cdn",e.cdn),t.setAttribute("widget",e.widgetId),document.body.appendChild(t)}};function Jg(r){window.__INIT_MOLIN_SHOP_AI_OPTIONS=r}function kp(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Pe,wt,qs,Qi,Qr,nl=class{constructor(){b(this,Pe,[]);b(this,wt);b(this,qs,10);b(this,Qi,5e3);b(this,Qr,!1)}async add(e,t){if(f(this,Pe).push({event:e,properties:Object.assign({},t,Ep()),distinct_id:Sp(t.distinct_id),timestamp:new Date().toISOString()}),f(this,Pe).length>=f(this,qs))return this.flush();f(this,wt)||I(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Qi)))}async flush(){if(f(this,Qr)||f(this,Pe).length===0)return;let e=[...f(this,Pe)];try{I(this,Qr,!0),clearTimeout(f(this,wt)),I(this,wt,void 0),I(this,Pe,[]);let t=new AbortController,i=setTimeout(()=>t.abort(),5e3),n=new FormData;n.append("events",JSON.stringify(e));let s=await fetch(new URL("/widgets/data/collect",sl()).href,{method:"POST",body:n,signal:t.signal});if(clearTimeout(i),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s}catch(t){if(t.name==="AbortError")console.error("Request timed out, retrying events"),I(this,Pe,[...e,...f(this,Pe)]);else{console.error("Failed to send events to backend:",t);let i=e.filter(n=>n.event.includes("error"));I(this,Pe,[...i,...f(this,Pe)])}}finally{I(this,Qr,!1),f(this,Pe).length>0&&!f(this,wt)&&I(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Qi)))}}async flushBeforeUnload(){if(f(this,Pe).length>0)try{let e=new FormData;e.append("events",JSON.stringify(f(this,Pe))),navigator.sendBeacon(new URL("/widgets/data/collect",sl()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};Pe=new WeakMap,wt=new WeakMap,qs=new WeakMap,Qi=new WeakMap,Qr=new WeakMap;var Cp=new nl;window.addEventListener("beforeunload",()=>{Cp.flushBeforeUnload().catch(console.error)});async function he(r,e){try{if(e.immediate){let t=new FormData;t.append("events",JSON.stringify([{event:r,properties:Object.assign({},e,Ep()),distinct_id:Sp(e.distinct_id),timestamp:new Date().toISOString()}]));let i=await fetch(new URL("/widgets/data/collect",sl()).href,{method:"POST",body:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return await i.json()}return Cp.add(r,e)}catch(t){console.error("Failed to send event:",t)}}function Sp(r=crypto.randomUUID()){let e="molin_shop_assistant_distinct_id";try{let t=localStorage.getItem(e);return t||(t=r,localStorage.setItem(e,t)),t}catch(t){console.error("Failed to handle distinct ID:",t);try{localStorage.setItem(e,r)}catch(i){console.error("Failed to store new distinct ID:",i)}return r}}function Ep(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack}}var Bs;function sl(){if(Bs)return Bs;let r=new URL(import.meta.url).hostname;return Bs=new Map([["localhost","http://localhost:8787"],["widget.molin.foo","https://molin.foo"],["widget.molin.ai","https://molin.ai"],["molin.foo","https://molin.foo"]]).get(r)||"https://molin.ai",Bs}var cr,en,jt,dr,zs,Ip,Hs=class{constructor(e,t,i){b(this,zs);b(this,cr);b(this,en);b(this,jt);b(this,dr);M(this,"isLoading",!1);M(this,"data");I(this,cr,e),I(this,en,t),I(this,jt,i),e.addController(this)}fetch(){if(this.isLoading)return;f(this,dr)?.abort();let e=new AbortController;I(this,dr,e),this.isLoading=!0,this.data=void 0,f(this,cr).requestUpdate(),(async()=>{let t=E(this,zs,Ip).call(this);return t.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(t,{signal:e.signal})})().then(async t=>{if(!t.ok)throw new Error(`${t.statusText}: ${await t.text()}`);this.isLoading=!1,this.data=typeof f(this,jt)?.transform=="function"?await f(this,jt).transform(t):t,f(this,cr).requestUpdate()}).catch(t=>{f(this,jt)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,cr).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,jt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,dr)?.abort(),I(this,dr,void 0)}};cr=new WeakMap,en=new WeakMap,jt=new WeakMap,dr=new WeakMap,zs=new WeakSet,Ip=function(){let e=f(this,en);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ut,tn,ei,ti,Nt=class{constructor(e,t){b(this,ut);b(this,tn);b(this,ei);b(this,ti);I(this,ut,e),I(this,tn,t),e.addController(this)}get data(){return f(this,ti)||f(this,ei)?.data}hostConnected(){if(f(this,ei)||f(this,ti))return;let e=kp();e&&e.widgetId===f(this,ut).widgetId?I(this,ti,e.config):I(this,ei,new Hs(f(this,ut),()=>{if(f(this,ut).cdn&&f(this,ut).widgetId)return`${f(this,ut).cdn}/config?w=${f(this,ut).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:f(this,tn)?.onError}))}};ut=new WeakMap,tn=new WeakMap,ei=new WeakMap,ti=new WeakMap;function Ap(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function k(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ap(Object(t),!0).forEach(function(i){A(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ap(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function A(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ah(r,e){if(r==null)return{};var t,i,n=function(o,l){if(o==null)return{};var a,u,d={},c=Object.keys(o);for(u=0;u<c.length;u++)a=c[u],l.indexOf(a)>=0||(d[a]=o[a]);return d}(r,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}var ct,Et={DEBUG:!1,LIB_VERSION:"1.205.0"},v=typeof window<"u"?window:void 0,qe=typeof globalThis<"u"?globalThis:v,Th=Array.prototype,Tp=Th.forEach,Mp=Th.indexOf,Ge=qe?.navigator,L=qe?.document,Be=qe?.location,vl=qe?.fetch,_l=qe!=null&&qe.XMLHttpRequest&&"withCredentials"in new qe.XMLHttpRequest?qe.XMLHttpRequest:void 0,Pp=qe?.AbortController,we=Ge?.userAgent,H=v??{},ol="$copy_autocapture",Xg=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(r){r.GZipJS="gzip-js",r.Base64="base64"})(ct||(ct={}));function V(r,e){return r.indexOf(e)!==-1}var So=function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},yl=function(r){return r.replace(/^\$/,"")},Kg=Array.isArray,Mh=Object.prototype,Ph=Mh.hasOwnProperty,Eo=Mh.toString,fe=Kg||function(r){return Eo.call(r)==="[object Array]"},Ze=r=>typeof r=="function",le=r=>r===Object(r)&&!fe(r),ii=r=>{if(le(r)){for(var e in r)if(Ph.call(r,e))return!1;return!0}return!1},F=r=>r===void 0,Se=r=>Eo.call(r)=="[object String]",Rp=r=>Se(r)&&r.trim().length===0,Vt=r=>r===null,Y=r=>F(r)||Vt(r),Oe=r=>Eo.call(r)=="[object Number]",yr=r=>Eo.call(r)==="[object Boolean]",Yg=r=>r instanceof FormData,Qg=r=>V(Xg,r),Rh=r=>{var e={_log:function(t){if(v&&(Et.DEBUG||H.POSTHOG_DEBUG)&&!F(v.console)&&v.console){for(var i=("__rrweb_original__"in v.console[t])?v.console[t].__rrweb_original__:v.console[t],n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(r,...s)}},info:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];console.error(r,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling ".concat(t))},createLogger:t=>Rh("".concat(r," ").concat(t))};return e},O=Rh("[PostHog.js]"),Fe=O.createLogger,so={};function si(r,e,t){if(fe(r)){if(Tp&&r.forEach===Tp)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,n=r.length;i<n;i++)if(i in r&&e.call(t,r[i],i)===so)return}}}function K(r,e,t){if(!Y(r)){if(fe(r))return si(r,e,t);if(Yg(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===so)return}else for(var n in r)if(Ph.call(r,n)&&e.call(t,r[n],n)===so)return}}var Te=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return si(t,function(n){for(var s in n)n[s]!==void 0&&(r[s]=n[s])}),r};function ro(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var Op=function(r){try{return r()}catch{return}},e1=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(n){O.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),O.critical(n)}}},oo=function(r){var e={};return K(r,function(t,i){Se(t)&&t.length>0&&(e[i]=t)}),e};function t1(r,e){return t=r,i=s=>Se(s)&&!Vt(e)?s.slice(0,e):s,n=new Set,function s(o,l){return o!==Object(o)?i?i(o,l):o:n.has(o)?void 0:(n.add(o),fe(o)?(a=[],si(o,u=>{a.push(s(u))})):(a={},K(o,(u,d)=>{n.has(u)||(a[d]=s(u,d))})),a);var a}(t);var t,i,n}var $t=function(){function r(e){return e&&(e.preventDefault=r.preventDefault,e.stopPropagation=r.stopPropagation),e}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(t,i,!!s);else{var o="on"+t,l=e[o];e[o]=function(a,u,d){return function(c){if(c=c||r(v?.event)){var p,h=!0;Ze(d)&&(p=d(c));var g=u.call(a,c);return p!==!1&&g!==!1||(h=!1),h}}}(e,i,l)}else O.error("No valid element provided to register_event")}}();function Oh(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}var Lh="$people_distinct_id",an="__alias",ln="__timers",Lp="$autocapture_disabled_server_side",bl="$heatmaps_enabled_server_side",Fp="$exception_capture_enabled_server_side",Dp="$web_vitals_enabled_server_side",Fh="$dead_clicks_enabled_server_side",jp="$web_vitals_allowed_metrics",wl="$session_recording_enabled_server_side",Np="$console_log_recording_enabled_server_side",Up="$session_recording_network_payload_capture",Bp="$session_recording_canvas_recording",qp="$replay_sample_rate",Hp="$replay_minimum_duration",zp="$replay_script_config",ao="$sesid",un="$session_is_sampled",al="$session_recording_url_trigger_activated_session",ll="$session_recording_event_trigger_activated_session",ni="$enabled_feature_flags",io="$early_access_features",cn="$stored_person_properties",vr="$stored_group_properties",xl="$surveys",Vs="$surveys_activated",lo="$flag_call_reported",kt="$user_state",kl="$client_session_props",Cl="$capture_rate_limit",Sl="$initial_campaign_params",El="$initial_referrer_info",$l="$initial_person_info",uo="$epp",Dh="__POSTHOG_TOOLBAR__",Vp="$posthog_cklsh",r1=[Lh,an,"__cmpns",ln,wl,bl,ao,ni,kt,io,vr,cn,xl,lo,kl,Cl,Sl,El,uo],Ws=Fe("[FeatureFlags]"),ul="$active_feature_flags",Gs="$override_feature_flags",Wp="$feature_flag_payloads",Gp=r=>{var e={};for(var[t,i]of ro(r||{}))i&&(e[t]=i);return e},Il=class{constructor(e){A(this,"_override_warning",!1),A(this,"_hasLoadedFlags",!1),A(this,"_requestInFlight",!1),A(this,"_reloadingDisabled",!1),A(this,"_additionalReloadRequested",!1),A(this,"_decideCalled",!1),A(this,"_flagsLoadedFromRemote",!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(ni),t=this.instance.get_property(Gs);if(!t)return e||{};for(var i=Te({},e),n=Object.keys(t),s=0;s<n.length;s++)i[n[s]]=t[n[s]];return this._override_warning||(Ws.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}getFlagPayloads(){return this.instance.get_property(Wp)||{}}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout(()=>{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(cn),group_properties:this.instance.get_property(vr)};(e!=null&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:ct.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:i=>{var n,s,o=!0;i.statusCode===200&&(this.$anon_distinct_id=void 0,o=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((s=i.json)!==null&&s!==void 0?s:{})),t.disable_flags||(this._flagsLoadedFromRemote=!o,this.receivedFeatureFlags((n=i.json)!==null&&n!==void 0?n:{},o),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var i,n,s,o,l,a=this.getFlagVariants()[e],u="".concat(a),d=this.instance.get_property(lo)||{};return(t.send_event||!("send_event"in t))&&(!(e in d)||!d[e].includes(u))&&(fe(d[e])?d[e].push(u):d[e]=[u],(i=this.instance.persistence)===null||i===void 0||i.register({[lo]:d}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:((n=this.instance.config.bootstrap)===null||n===void 0||(s=n.featureFlags)===null||s===void 0?void 0:s[e])||null,$feature_flag_bootstrapped_payload:((o=this.instance.config.bootstrap)===null||o===void 0||(l=o.featureFlagPayloads)===null||l===void 0?void 0:l[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote})),a}Ws.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Ws.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this.instance.persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads();(function(s,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.featureFlags,d=s.featureFlagPayloads;if(u)if(fe(u)){var c={};if(u)for(var p=0;p<u.length;p++)c[u[p]]=!0;o&&o.register({[ul]:u,[ni]:c})}else{var h=u,g=d;s.errorsWhileComputingFlags&&(h=k(k({},l),h),g=k(k({},a),g)),o&&o.register({[ul]:Object.keys(Gp(h)),[ni]:h||{},[Wp]:g||{}})}})(e,this.instance.persistence,i,n),this._fireFeatureFlagsCallbacks(t)}}override(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return Ws.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(Gs);else if(fe(e)){for(var i={},n=0;n<e.length;n++)i[e[n]]=!0;this.instance.persistence.register({[Gs]:i})}else this.instance.persistence.register({[Gs]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,n=(this.instance.get_property(io)||[]).find(a=>a.flagKey===e),s={["$feature_enrollment/".concat(e)]:t},o={$feature_flag:e,$feature_enrollment:t,$set:s};n&&(o.$early_access_feature_name=n.name),this.instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var l=k(k({},this.getFlagVariants()),{},{[e]:t});(i=this.instance.persistence)===null||i===void 0||i.register({[ul]:Object.keys(Gp(l)),[ni]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(io);if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:n=>{var s;if(n.json){var o=n.json.earlyAccessFeatures;return(s=this.instance.persistence)===null||s===void 0||s.register({[io]:o}),e(o)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,n)=>(i[n]=t[n],i),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(n=>n(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(cn)||{};this.instance.register({[cn]:k(k({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(cn)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(vr)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(n=>{i[n]=k(k({},i[n]),e[n]),delete e[n]}),this.instance.register({[vr]:k(k({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(vr)||{};this.instance.register({[vr]:k(k({},t),{},{[e]:{}})})}else this.instance.unregister(vr)}};Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return Oe(r)&&isFinite(r)&&Math.floor(r)===r});var Zp="0123456789abcdef",Al=class r{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(n)||e<0||t<0||i<0||n<0||e>0xffffffffffff||t>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new r(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Zp.charAt(this.bytes[t]>>>4)+Zp.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new r(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}},Tl=class{constructor(){A(this,"timestamp",0),A(this,"counter",0),A(this,"random",new Ml)}generate(){var e=this.generateOrAbort();if(F(e)){this.timestamp=0;var t=this.generateOrAbort();if(F(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Al.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}},Jp,jh=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};v&&!F(v.crypto)&&crypto.getRandomValues&&(jh=r=>crypto.getRandomValues(r));var Ml=class{constructor(){A(this,"buffer",new Uint32Array(8)),A(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(jh(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},qt=()=>i1().toString(),i1=()=>(Jp||(Jp=new Tl)).generate(),n1="Thu, 01 Jan 1970 00:00:00 GMT",rn="",s1=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function o1(r,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L;if(rn)return rn;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var o=n.split("."),l=Math.min(o.length,8),a="dmn_chk_"+qt(),u=new RegExp("(^|;)\\s*"+a+"=1");!rn&&l--;){var d=o.slice(l).join("."),c=a+"=1;domain=."+d;s.cookie=c,u.test(s.cookie)&&(s.cookie=c+";expires="+n1,rn=d)}return rn}(r);if(!t){var i=(n=>{var s=n.match(s1);return s?s[0]:""})(r);i!==t&&O.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var It={is_supported:()=>!!L,error:function(r){O.error("cookieStore error: "+r)},get:function(r){if(L){try{for(var e=r+"=",t=L.cookie.split(";").filter(s=>s.length),i=0;i<t.length;i++){for(var n=t[i];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},parse:function(r){var e;try{e=JSON.parse(It.get(r))||{}}catch{}return e},set:function(r,e,t,i,n){if(L)try{var s="",o="",l=o1(L.location.hostname,i);if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),s="; expires="+a.toUTCString()}n&&(o="; secure");var u=r+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&O.warn("cookieStore warning: large cookie, len="+u.length),L.cookie=u,u}catch{return}},remove:function(r,e){try{It.set(r,"",-1,e)}catch{return}}},cl=null,ve={is_supported:function(){if(!Vt(cl))return cl;var r=!0;if(F(v))r=!1;else try{var e="__mplssupport__";ve.set(e,"xyz"),ve.get(e)!=='"xyz"'&&(r=!1),ve.remove(e)}catch{r=!1}return r||O.error("localStorage unsupported; falling back to cookie store"),cl=r,r},error:function(r){O.error("localStorage error: "+r)},get:function(r){try{return v?.localStorage.getItem(r)}catch(e){ve.error(e)}return null},parse:function(r){try{return JSON.parse(ve.get(r))||{}}catch{}return null},set:function(r,e){try{v?.localStorage.setItem(r,JSON.stringify(e))}catch(t){ve.error(t)}},remove:function(r){try{v?.localStorage.removeItem(r)}catch(e){ve.error(e)}}},a1=["distinct_id",ao,un,uo,$l],Zs=k(k({},ve),{},{parse:function(r){try{var e={};try{e=It.parse(r)||{}}catch{}var t=Te(e,JSON.parse(ve.get(r)||"{}"));return ve.set(r,t),t}catch{}return null},set:function(r,e,t,i,n,s){try{ve.set(r,e,void 0,void 0,s);var o={};a1.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&It.set(r,o,t,i,n,s)}catch(l){ve.error(l)}},remove:function(r,e){try{v?.localStorage.removeItem(r),It.remove(r,e)}catch(t){ve.error(t)}}}),Js={},l1={is_supported:function(){return!0},error:function(r){O.error("memoryStorage error: "+r)},get:function(r){return Js[r]||null},parse:function(r){return Js[r]||null},set:function(r,e){Js[r]=e},remove:function(r){delete Js[r]}},pr=null,Ce={is_supported:function(){if(!Vt(pr))return pr;if(pr=!0,F(v))pr=!1;else try{var r="__support__";Ce.set(r,"xyz"),Ce.get(r)!=='"xyz"'&&(pr=!1),Ce.remove(r)}catch{pr=!1}return pr},error:function(r){O.error("sessionStorage error: ",r)},get:function(r){try{return v?.sessionStorage.getItem(r)}catch(e){Ce.error(e)}return null},parse:function(r){try{return JSON.parse(Ce.get(r))||null}catch{}return null},set:function(r,e){try{v?.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){Ce.error(t)}},remove:function(r){try{v?.sessionStorage.removeItem(r)}catch(e){Ce.error(e)}}},u1=["localhost","127.0.0.1"],oi=r=>{var e=L?.createElement("a");return F(e)?null:(e.href=r,e)},ui=function(r,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(r)},c1=function(r){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",n=[];return K(r,function(s,o){F(s)||F(o)||o==="undefined"||(e=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),t=encodeURIComponent(o),n[n.length]=t+"="+e)}),n.join(i)},co=function(r,e){for(var t,i=((r.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){t=s;break}}if(!fe(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{O.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},po=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Qe="Mobile",ho="iOS",dt="Android",vn="Tablet",Nh=dt+" "+vn,Uh="iPad",Bh="Apple",qh=Bh+" Watch",_n="Safari",ci="BlackBerry",Hh="Samsung",zh=Hh+"Browser",Vh=Hh+" Internet",wr="Chrome",d1=wr+" OS",Wh=wr+" "+ho,wu="Internet Explorer",Gh=wu+" "+Qe,xu="Opera",p1=xu+" Mini",ku="Edge",Zh="Microsoft "+ku,ai="Firefox",Jh=ai+" "+ho,yn="Nintendo",bn="PlayStation",li="Xbox",Xh=dt+" "+Qe,Kh=Qe+" "+_n,dn="Windows",Pl=dn+" Phone",Xp="Nokia",Rl="Ouya",Yh="Generic",h1=Yh+" "+Qe.toLowerCase(),Qh=Yh+" "+vn.toLowerCase(),Ol="Konqueror",Re="(\\d+(\\.\\d+)?)",dl=new RegExp("Version/"+Re),f1=new RegExp(li,"i"),g1=new RegExp(bn+" \\w+","i"),m1=new RegExp(yn+" \\w+","i"),Cu=new RegExp(ci+"|PlayBook|BB10","i"),v1={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},_1=(r,e)=>e&&V(e,Bh)||function(t){return V(t,_n)&&!V(t,wr)&&!V(t,dt)}(r),Kp=function(r,e){return e=e||"",V(r," OPR/")&&V(r,"Mini")?p1:V(r," OPR/")?xu:Cu.test(r)?ci:V(r,"IE"+Qe)||V(r,"WPDesktop")?Gh:V(r,zh)?Vh:V(r,ku)||V(r,"Edg/")?Zh:V(r,"FBIOS")?"Facebook "+Qe:V(r,"UCWEB")||V(r,"UCBrowser")?"UC Browser":V(r,"CriOS")?Wh:V(r,"CrMo")||V(r,wr)?wr:V(r,dt)&&V(r,_n)?Xh:V(r,"FxiOS")?Jh:V(r.toLowerCase(),Ol.toLowerCase())?Ol:_1(r,e)?V(r,Qe)?Kh:_n:V(r,ai)?ai:V(r,"MSIE")||V(r,"Trident/")?wu:V(r,"Gecko")?ai:""},y1={[Gh]:[new RegExp("rv:"+Re)],[Zh]:[new RegExp(ku+"?\\/"+Re)],[wr]:[new RegExp("("+wr+"|CrMo)\\/"+Re)],[Wh]:[new RegExp("CriOS\\/"+Re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Re)],[_n]:[dl],[Kh]:[dl],[xu]:[new RegExp("(Opera|OPR)\\/"+Re)],[ai]:[new RegExp(ai+"\\/"+Re)],[Jh]:[new RegExp("FxiOS\\/"+Re)],[Ol]:[new RegExp("Konqueror[:/]?"+Re,"i")],[ci]:[new RegExp(ci+" "+Re),dl],[Xh]:[new RegExp("android\\s"+Re,"i")],[Vh]:[new RegExp(zh+"\\/"+Re)],[wu]:[new RegExp("(rv:|MSIE )"+Re)],Mozilla:[new RegExp("rv:"+Re)]},Yp=[[new RegExp(li+"; "+li+" (.*?)[);]","i"),r=>[li,r&&r[1]||""]],[new RegExp(yn,"i"),[yn,""]],[new RegExp(bn,"i"),[bn,""]],[Cu,[ci,""]],[new RegExp(dn,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Pl,""];if(new RegExp(Qe).test(e)&&!/IEMobile\b/.test(e))return[dn+" "+Qe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],n=v1[i]||"";return/arm/i.test(e)&&(n="RT"),[dn,n]}return[dn,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[ho,e.join(".")]}return[ho,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=F(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+dt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+dt+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[dt,e.join(".")]}return[dt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[d1,""]],[/Linux|debian/i,["Linux",""]]],Qp=function(r){return m1.test(r)?yn:g1.test(r)?bn:f1.test(r)?li:new RegExp(Rl,"i").test(r)?Rl:new RegExp("("+Pl+"|WPDesktop)","i").test(r)?Pl:/iPad/.test(r)?Uh:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?qh:Cu.test(r)?ci:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(Xp,"i").test(r)?Xp:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(Qe).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?dt:Nh:dt:new RegExp("(pda|"+Qe+")","i").test(r)?h1:new RegExp(vn,"i").test(r)&&!new RegExp(vn+" pc","i").test(r)?Qh:""},Xs="https?://(.*)",b1=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],se={campaignParams:function(r){return L?this._campaignParamsFromUrl(L.URL,r):{}},_campaignParamsFromUrl:function(r,e){var t=b1.concat(e||[]),i={};return K(t,function(n){var s=co(r,n);i[n]=s||null}),i},_searchEngine:function(r){return r?r.search(Xs+"google.([^/?]*)")===0?"google":r.search(Xs+"bing.com")===0?"bing":r.search(Xs+"yahoo.com")===0?"yahoo":r.search(Xs+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(r){var e=se._searchEngine(r),t=e!="yahoo"?"q":"p",i={};if(!Vt(e)){i.$search_engine=e;var n=L?co(L.referrer,t):"";n.length&&(i.ph_keyword=n)}return i},searchInfo:function(){var r=L?.referrer;return r?this._searchInfoFromReferrer(r):{}},browser:Kp,browserVersion:function(r,e){var t=Kp(r,e),i=y1[t];if(F(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=r.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var r=this.browserLanguage();return typeof r=="string"?r.split("-")[0]:void 0},os:function(r){for(var e=0;e<Yp.length;e++){var[t,i]=Yp[e],n=t.exec(r),s=n&&(Ze(i)?i(n,r):i);if(s)return s}return["",""]},device:Qp,deviceType:function(r){var e=Qp(r);return e===Uh||e===Nh||e==="Kobo"||e==="Kindle Fire"||e===Qh?vn:e===yn||e===li||e===bn||e===Rl?"Console":e===qh?"Wearable":e?Qe:"Desktop"},referrer:function(){return L?.referrer||"$direct"},referringDomain:function(){var r;return L!=null&&L.referrer&&((r=oi(L.referrer))===null||r===void 0?void 0:r.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:Be?.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(r){var e,{r:t,u:i}=r,n={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=oi(t))===null||e===void 0?void 0:e.host};if(i){n.$initial_current_url=i;var s=oi(i);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,K(this._campaignParamsFromUrl(i),function(o,l){n["$initial_"+yl(l)]=o})}return t&&K(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+yl(l)]=o}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){if(!we)return{};var[r,e]=se.os(we);return Te(oo({$os:r,$os_version:e,$browser:se.browser(we,navigator.vendor),$device:se.device(we),$device_type:se.deviceType(we),$timezone:se.timezone(),$timezone_offset:se.timezoneOffset()}),{$current_url:Be?.href,$host:Be?.host,$pathname:Be?.pathname,$raw_user_agent:we.length>1e3?we.substring(0,997)+"...":we,$browser_version:se.browserVersion(we,navigator.vendor),$browser_language:se.browserLanguage(),$browser_language_prefix:se.browserLanguagePrefix(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:Et.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!we)return{};var[r,e]=se.os(we);return Te(oo({$os:r,$os_version:e,$browser:se.browser(we,navigator.vendor)}),{$browser_version:se.browserVersion(we,navigator.vendor)})}},w1=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],hn=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t=>{var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&O.info("Persistence loaded",e.persistence,k({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){w1.indexOf(e.persistence.toLowerCase())===-1&&(O.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&ve.is_supported()?ve:t==="localstorage+cookie"&&Zs.is_supported()?Zs:t==="sessionstorage"&&Ce.is_supported()?Ce:t==="memory"?l1:t==="cookie"?It:Zs.is_supported()?Zs:It}properties(){var e={};return K(this.props,function(t,i){if(i===ni&&le(t))for(var n=Object.keys(t),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=t[n[s]];else l=i,a=!1,(Vt(o=r1)?a:Mp&&o.indexOf===Mp?o.indexOf(l)!=-1:(K(o,function(u){if(a||(a=u===l))return so}),a))||(e[i]=t);var o,l,a}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Te({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(le(e)){F(t)&&(t="None"),this.expire_days=F(i)?this.default_expiry:i;var n=!1;if(K(e,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==t||(this.props[o]=s,n=!0)}),n)return this.save(),!0}return!1}register(e,t){if(le(e)){this.expire_days=F(t)?this.default_expiry:t;var i=!1;if(K(e,(n,s)=>{e.hasOwnProperty(s)&&this.props[s]!==n&&(this.props[s]=n,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=se.campaignParams(this.config.custom_campaign_params);ii(oo(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(se.searchInfo())}update_referrer_info(){this.register_once(se.referrerInfo(),void 0)}set_initial_person_info(){this.props[Sl]||this.props[El]||this.register_once({[$l]:se.initialPersonInfo()},void 0)}get_referrer_info(){return oo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};K([El,Sl],n=>{var s=this.props[n];s&&K(s,function(o,l){e["$initial_"+yl(l)]=o})});var t=this.props[$l];if(t){var i=se.initialPersonPropsFromInfo(t);Te(e,i)}return e}safe_merge(e){return K(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.buildStorage(e),n=this.props;this.clear(),this.storage=i,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[ln]||{};i[e]=t,this.props[ln]=i,this.save()}remove_event_timer(e){var t=(this.props[ln]||{})[e];return F(t)||(delete this.props[ln][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function fo(r){var e,t;return((e=JSON.stringify(r,(t=[],function(i,n){if(le(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n})))===null||e===void 0?void 0:e.length)||0}function Ll(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(r.size>=e&&r.data.length>1){var t=Math.floor(r.data.length/2),i=r.data.slice(0,t),n=r.data.slice(t);return[Ll({size:fo(i),data:i,sessionId:r.sessionId,windowId:r.windowId}),Ll({size:fo(n),data:n,sessionId:r.sessionId,windowId:r.windowId})].flatMap(s=>s)}return[r]}var Ct=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(Ct||{}),st=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(st||{});function eh(r){var e;return r instanceof Element&&(r.id===Dh||!((e=r.closest)===null||e===void 0||!e.call(r,".toolbar-global-fade-container")))}function $o(r){return!!r&&r.nodeType===1}function zt(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function ef(r){return!!r&&r.nodeType===3}function tf(r){return!!r&&r.nodeType===11}function Su(r){return r?So(r).split(/\s+/):[]}function th(r){var e=v?.location.href;return!!(e&&r&&r.some(t=>e.match(t)))}function go(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return Su(e)}function rf(r){return Y(r)?null:So(r).split(/(\s+)/).filter(e=>di(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Io(r){var e="";return Dl(r)&&!of(r)&&r.childNodes&&r.childNodes.length&&K(r.childNodes,function(t){var i;ef(t)&&t.textContent&&(e+=(i=rf(t.textContent))!==null&&i!==void 0?i:"")}),So(e)}function nf(r){return F(r.target)?r.srcElement||null:(e=r.target)!==null&&e!==void 0&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var Fl=["a","button","form","input","select","textarea","label"];function sf(r){var e=r.parentNode;return!(!e||!$o(e))&&e}function x1(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!v||!r||zt(r,"html")||!$o(r)||t!=null&&t.url_allowlist&&!th(t.url_allowlist)||t!=null&&t.url_ignorelist&&th(t.url_ignorelist))return!1;if(t!=null&&t.dom_event_allowlist){var s=t.dom_event_allowlist;if(s&&!s.some(h=>e.type===h))return!1}for(var o=!1,l=[r],a=!0,u=r;u.parentNode&&!zt(u,"body");)if(tf(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!(a=sf(u)))break;if(i||Fl.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{var d=v.getComputedStyle(a);d&&d.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(a),u=a}if(!function(h,g){var m=g?.element_allowlist;if(F(m))return!0;var y=function(x){if(m.some(S=>x.tagName.toLowerCase()===S))return{v:!0}};for(var w of h){var _=y(w);if(typeof _=="object")return _.v}return!1}(l,t)||!function(h,g){var m=g?.css_selector_allowlist;if(F(m))return!0;var y=function(x){if(m.some(S=>x.matches(S)))return{v:!0}};for(var w of h){var _=y(w);if(typeof _=="object")return _.v}return!1}(l,t))return!1;var c=v.getComputedStyle(r);if(c&&c.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=r.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return o?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Fl.indexOf(p)>-1||r.getAttribute("contenteditable")==="true")}}function Dl(r){for(var e=r;e.parentNode&&!zt(e,"body");e=e.parentNode){var t=go(e);if(V(t,"ph-sensitive")||V(t,"ph-no-capture"))return!1}if(V(go(r),"ph-include"))return!0;var i=r.type||"";if(Se(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=r.name||r.id||"";return!(Se(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function of(r){return!!(zt(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||zt(r,"select")||zt(r,"textarea")||r.getAttribute("contenteditable")==="true")}var af="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",k1=new RegExp("^(?:".concat(af,")$")),C1=new RegExp(af),lf="\\d{3}-?\\d{2}-?\\d{4}",S1=new RegExp("^(".concat(lf,")$")),E1=new RegExp("(".concat(lf,")"));function di(r){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Y(r)||Se(r)&&(r=So(r),(e?k1:C1).test((r||"").replace(/[- ]/g,""))||(e?S1:E1).test(r)))}function uf(r){var e=Io(r);return di(e="".concat(e," ").concat(cf(r)).trim())?e:""}function cf(r){var e="";return r&&r.childNodes&&r.childNodes.length&&K(r.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var n=Io(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(cf(t)).trim())}catch(s){O.error("[AutoCapture]",s)}}),e}function $1(r){return function(e){var t=e.map(i=>{var n,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class)for(var l of(i.attr_class.sort(),i.attr_class))o+=".".concat(l.replace(/"/g,""));var a=k(k(k(k({},i.text?{text:i.text}:{}),{},{"nth-child":(n=i.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),u={};return ro(a).sort((d,c)=>{var[p]=d,[h]=c;return p.localeCompare(h)}).forEach(d=>{var[c,p]=d;return u[rh(c.toString())]=rh(p.toString())}),o+=":",o+=ro(a).map(d=>{var[c,p]=d;return"".concat(c,'="').concat(p,'"')}).join("")});return t.join(";")}(function(e){return e.map(t=>{var i,n,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(n=t.attr__href)===null||n===void 0?void 0:n.slice(0,2048),attr_class:I1(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ro(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,a]=o;return s.attributes[l]=a}),s})}(r))}function rh(r){return r.replace(/"|\\"/g,'\\"')}function I1(r){var e=r.attr__class;return e?fe(e)?e:Su(e):void 0}var jl="[SessionRecording]",Nl="redacted",Ks={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:r=>r,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},A1=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],T1=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],M1=["/s/","/e/","/i/"];function ih(r,e,t,i){if(Y(r))return r;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(r);return Se(n)&&(n=parseInt(n)),n>t?jl+" ".concat(i," body too large to record (").concat(n," bytes)"):r}function nh(r,e){if(Y(r))return r;var t=r;return di(t,!1)||(t=jl+" "+e+" body "+Nl),K(T1,i=>{var n,s;(n=t)!==null&&n!==void 0&&n.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=jl+" "+e+" body "+Nl+" as might contain: "+i)}),t}var P1=(r,e)=>{var t,i,n,s={payloadSizeLimitBytes:Ks.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ks.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ks.payloadHostDenyList]},o=r.session_recording.recordHeaders!==!1&&e.recordHeaders,l=r.session_recording.recordBody!==!1&&e.recordBody,a=r.capture_performance!==!1&&e.recordPerformance,u=(t=s,n=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),p=>(p!=null&&p.requestBody&&(p.requestBody=ih(p.requestBody,p.requestHeaders,n,"Request")),p!=null&&p.responseBody&&(p.responseBody=ih(p.responseBody,p.responseHeaders,n,"Response")),p)),d=p=>{return u(((m,y)=>{var w,_=oi(m.name),x=y.indexOf("http")===0?(w=oi(y))===null||w===void 0?void 0:w.pathname:y;x==="/"&&(x="");var S=_?.pathname.replace(x||"","");if(!(_&&S&&M1.some(R=>S.indexOf(R)===0)))return m})((g=(h=p).requestHeaders,Y(g)||K(Object.keys(g??{}),m=>{A1.includes(m.toLowerCase())&&(g[m]=Nl)}),h),r.api_host));var h,g},c=Ze(r.session_recording.maskNetworkRequestFn);return c&&Ze(r.session_recording.maskCapturedNetworkRequestFn)&&O.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(r.session_recording.maskCapturedNetworkRequestFn=p=>{var h=r.session_recording.maskNetworkRequestFn({url:p.name});return k(k({},p),{},{name:h?.url})}),s.maskRequestFn=Ze(r.session_recording.maskCapturedNetworkRequestFn)?p=>{var h,g,m,y=d(p);return y&&(h=(g=(m=r.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,y))!==null&&h!==void 0?h:void 0}:p=>function(h){if(!F(h))return h.requestBody=nh(h.requestBody,"Request"),h.responseBody=nh(h.responseBody,"Response"),h}(d(p)),k(k(k({},Ks),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function pt(r,e,t,i,n){return e>t&&(O.warn("min cannot be greater than max."),e=t),Oe(r)?r>t?(i&&O.warn(i+" cannot be greater than max: "+t+". Using max value instead."),t):r<e?(i&&O.warn(i+" cannot be less than min: "+e+". Using min value instead."),e):r:(i&&O.warn(i+" must be a number. using max or fallback. max: "+t+", fallback: "+n),pt(n||t,e,t,i))}var Ul=class{constructor(e){var t,i,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(this,"bucketSize",100),A(this,"refillRate",10),A(this,"mutationBuckets",{}),A(this,"loggedTracker",{}),A(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(s=>{this.mutationBuckets[s]=this.mutationBuckets[s]+this.refillRate,this.mutationBuckets[s]>=this.bucketSize&&delete this.mutationBuckets[s]})}),A(this,"getNodeOrRelevantParent",s=>{var o=this.rrweb.mirror.getNode(s);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[this.rrweb.mirror.getId(l),l]}return[s,o]}),A(this,"numberOfChanges",s=>{var o,l,a,u,d,c,p,h;return((o=(l=s.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((a=(u=s.attributes)===null||u===void 0?void 0:u.length)!==null&&a!==void 0?a:0)+((d=(c=s.texts)===null||c===void 0?void 0:c.length)!==null&&d!==void 0?d:0)+((p=(h=s.adds)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)}),A(this,"throttleMutations",s=>{if(s.type!==3||s.data.source!==0)return s;var o=s.data,l=this.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(u=>{var d,c,p,[h,g]=this.getNodeOrRelevantParent(u.id);return this.mutationBuckets[h]===0?!1:(this.mutationBuckets[h]=(d=this.mutationBuckets[h])!==null&&d!==void 0?d:this.bucketSize,this.mutationBuckets[h]=Math.max(this.mutationBuckets[h]-1,0),this.mutationBuckets[h]===0&&(this.loggedTracker[h]||(this.loggedTracker[h]=!0,(c=(p=this.options).onBlockedNode)===null||c===void 0||c.call(p,h,g))),u)}));var a=this.numberOfChanges(o);return a!==0||l===a?s:void 0}),this.rrweb=e,this.options=n,this.refillRate=pt((t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=pt((i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},et=Uint8Array,Le=Uint16Array,pi=Uint32Array,Eu=new et([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]),$u=new et([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]),sh=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),df=function(r,e){for(var t=new Le(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var n=new pi(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)n[s]=s-t[i]<<5|i;return[t,n]},pf=df(Eu,2),R1=pf[0],Bl=pf[1];R1[28]=258,Bl[258]=28;for(ql=df($u,0)[1],mo=new Le(32768),ee=0;ee<32768;++ee)Ut=(43690&ee)>>>1|(21845&ee)<<1,Ut=(61680&(Ut=(52428&Ut)>>>2|(13107&Ut)<<2))>>>4|(3855&Ut)<<4,mo[ee]=((65280&Ut)>>>8|(255&Ut)<<8)>>>1;var Ut,ql,mo,ee,fn=function(r,e,t){for(var i=r.length,n=0,s=new Le(e);n<i;++n)++s[r[n]-1];var o,l=new Le(e);for(n=0;n<e;++n)l[n]=l[n-1]+s[n-1]<<1;if(t){o=new Le(1<<e);var a=15-e;for(n=0;n<i;++n)if(r[n])for(var u=n<<4|r[n],d=e-r[n],c=l[r[n]-1]++<<d,p=c|(1<<d)-1;c<=p;++c)o[mo[c]>>>a]=u}else for(o=new Le(i),n=0;n<i;++n)o[n]=mo[l[r[n]-1]++]>>>15-r[n];return o},xr=new et(288);for(ee=0;ee<144;++ee)xr[ee]=8;for(ee=144;ee<256;++ee)xr[ee]=9;for(ee=256;ee<280;++ee)xr[ee]=7;for(ee=280;ee<288;++ee)xr[ee]=8;var vo=new et(32);for(ee=0;ee<32;++ee)vo[ee]=5;var O1=fn(xr,9,0),L1=fn(vo,5,0),hf=function(r){return(r/8>>0)+(7&r&&1)},ff=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof Le?Le:r instanceof pi?pi:et)(t-e);return i.set(r.subarray(e,t)),i},xt=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},nn=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},pl=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});var n=t.length,s=t.slice();if(!n)return[new et(0),0];if(n==1){var o=new et(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(R,B){return R.f-B.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],u=0,d=1,c=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};d!=n-1;)l=t[t[u].f<t[c].f?u++:c++],a=t[u!=d&&t[u].f<t[c].f?u++:c++],t[d++]={s:-1,f:l.f+a.f,l,r:a};var p=s[0].s;for(i=1;i<n;++i)s[i].s>p&&(p=s[i].s);var h=new Le(p+1),g=Hl(t[d-1],h,0);if(g>e){i=0;var m=0,y=g-e,w=1<<y;for(s.sort(function(R,B){return h[B.s]-h[R.s]||R.f-B.f});i<n;++i){var _=s[i].s;if(!(h[_]>e))break;m+=w-(1<<g-h[_]),h[_]=e}for(m>>>=y;m>0;){var x=s[i].s;h[x]<e?m-=1<<e-h[x]++-1:++i}for(;i>=0&&m;--i){var S=s[i].s;h[S]==e&&(--h[S],++m)}g=e}return[new et(h),g]},Hl=function(r,e,t){return r.s==-1?Math.max(Hl(r.l,e,t+1),Hl(r.r,e,t+1)):e[r.s]=t},oh=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Le(++e),i=0,n=r[0],s=1,o=function(a){t[i++]=a},l=1;l<=e;++l)if(r[l]==n&&l!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=r[l]}return[t.subarray(0,i),e]},sn=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},zl=function(r,e,t){var i=t.length,n=hf(e+2);r[n]=255&i,r[n+1]=i>>>8,r[n+2]=255^r[n],r[n+3]=255^r[n+1];for(var s=0;s<i;++s)r[n+s+4]=t[s];return 8*(n+4+i)},ah=function(r,e,t,i,n,s,o,l,a,u,d){xt(e,d++,t),++n[256];for(var c=pl(n,15),p=c[0],h=c[1],g=pl(s,15),m=g[0],y=g[1],w=oh(p),_=w[0],x=w[1],S=oh(m),R=S[0],B=S[1],N=new Le(19),P=0;P<_.length;++P)N[31&_[P]]++;for(P=0;P<R.length;++P)N[31&R[P]]++;for(var U=pl(N,7),W=U[0],xe=U[1],ce=19;ce>4&&!W[sh[ce-1]];--ce);var je,Z,X,de,Ne=u+5<<3,He=sn(n,xr)+sn(s,vo)+o,ae=sn(n,p)+sn(s,m)+o+14+3*ce+sn(N,W)+(2*N[16]+3*N[17]+7*N[18]);if(Ne<=He&&Ne<=ae)return zl(e,d,r.subarray(a,a+u));if(xt(e,d,1+(ae<He)),d+=2,ae<He){je=fn(p,h,0),Z=p,X=fn(m,y,0),de=m;var Ee=fn(W,xe,0);for(xt(e,d,x-257),xt(e,d+5,B-1),xt(e,d+10,ce-4),d+=14,P=0;P<ce;++P)xt(e,d+3*P,W[sh[P]]);d+=3*ce;for(var $e=[_,R],ie=0;ie<2;++ie){var _e=$e[ie];for(P=0;P<_e.length;++P){var Me=31&_e[P];xt(e,d,Ee[Me]),d+=W[Me],Me>15&&(xt(e,d,_e[P]>>>5&127),d+=_e[P]>>>12)}}}else je=O1,Z=xr,X=L1,de=vo;for(P=0;P<l;++P)if(i[P]>255){Me=i[P]>>>18&31,nn(e,d,je[Me+257]),d+=Z[Me+257],Me>7&&(xt(e,d,i[P]>>>23&31),d+=Eu[Me]);var Cr=31&i[P];nn(e,d,X[Cr]),d+=de[Cr],Cr>3&&(nn(e,d,i[P]>>>5&8191),d+=$u[Cr])}else nn(e,d,je[i[P]]),d+=Z[i[P]];return nn(e,d,je[256]),d+Z[256]},F1=new pi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),D1=function(){for(var r=new pi(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r}(),j1=function(){var r=4294967295;return{p:function(e){for(var t=r,i=0;i<e.length;++i)t=D1[255&t^e[i]]^t>>>8;r=t},d:function(){return 4294967295^r}}},N1=function(r,e,t,i,n){return function(s,o,l,a,u,d){var c=s.length,p=new et(a+c+5*(1+Math.floor(c/7e3))+u),h=p.subarray(a,p.length-u),g=0;if(!o||c<8)for(var m=0;m<=c;m+=65535){var y=m+65535;y<c?g=zl(h,g,s.subarray(m,y)):(h[m]=d,g=zl(h,g,s.subarray(m,c)))}else{for(var w=F1[o-1],_=w>>>13,x=8191&w,S=(1<<l)-1,R=new Le(32768),B=new Le(S+1),N=Math.ceil(l/3),P=2*N,U=function(Do){return(s[Do]^s[Do+1]<<N^s[Do+2]<<P)&S},W=new pi(25e3),xe=new Le(288),ce=new Le(32),je=0,Z=0,X=(m=0,0),de=0,Ne=0;m<c;++m){var He=U(m),ae=32767&m,Ee=B[He];if(R[ae]=Ee,B[He]=ae,de<=m){var $e=c-m;if((je>7e3||X>24576)&&$e>423){g=ah(s,h,0,W,xe,ce,Z,X,Ne,m-Ne,g),X=je=Z=0,Ne=m;for(var ie=0;ie<286;++ie)xe[ie]=0;for(ie=0;ie<30;++ie)ce[ie]=0}var _e=2,Me=0,Cr=x,At=ae-Ee&32767;if($e>2&&He==U(m-At))for(var zf=Math.min(_,$e)-1,Vf=Math.min(32767,m),Wf=Math.min(258,$e);At<=Vf&&--Cr&&ae!=Ee;){if(s[m+_e]==s[m+_e-At]){for(var Tt=0;Tt<Wf&&s[m+Tt]==s[m+Tt-At];++Tt);if(Tt>_e){if(_e=Tt,Me=At,Tt>zf)break;var Gf=Math.min(At,Tt-2),Uu=0;for(ie=0;ie<Gf;++ie){var Fo=m-At+ie+32768&32767,Bu=Fo-R[Fo]+32768&32767;Bu>Uu&&(Uu=Bu,Ee=Fo)}}}At+=(ae=Ee)-(Ee=R[ae])+32768&32767}if(Me){W[X++]=268435456|Bl[_e]<<18|ql[Me];var qu=31&Bl[_e],Hu=31&ql[Me];Z+=Eu[qu]+$u[Hu],++xe[257+qu],++ce[Hu],de=m+_e,++je}else W[X++]=s[m],++xe[s[m]]}}g=ah(s,h,d,W,xe,ce,Z,X,Ne,m-Ne,g)}return ff(p,0,a+hf(g)+u)}(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!n)},Vl=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},U1=function(r,e){var t=e.filename;if(r[0]=31,r[1]=139,r[2]=8,r[8]=e.level<2?4:e.level==9?2:0,r[9]=3,e.mtime!=0&&Vl(r,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){r[3]=8;for(var i=0;i<=t.length;++i)r[i+10]=t.charCodeAt(i)}},B1=function(r){return 10+(r.filename&&r.filename.length+1||0)};function gf(r,e){e===void 0&&(e={});var t=j1(),i=r.length;t.p(r);var n=N1(r,e,B1(e),8),s=n.length;return U1(n,e),Vl(n,s-8,t.d()),Vl(n,s-4,i),n}function mf(r,e){var t=r.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var i=new et(r.length+(r.length>>>1)),n=0,s=function(u){i[n++]=u},o=0;o<t;++o){if(n+5>i.length){var l=new et(n+8+(t-o<<1));l.set(i),i=l}var a=r.charCodeAt(o);a<128||e?s(a):a<2048?(s(192|a>>>6),s(128|63&a)):a>55295&&a<57344?(s(240|(a=65536+(1047552&a)|1023&r.charCodeAt(++o))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return ff(i,0,n)}var pn="[SessionRecording]",Ae=Fe(pn),q1=3e5,H1=[st.MouseMove,st.MouseInteraction,st.Scroll,st.ViewportResize,st.Input,st.TouchMove,st.MediaInteraction,st.Drag],lh=r=>({rrwebMethod:r,enqueuedAt:Date.now(),attempt:1});function hr(r){return function(e,t){for(var i="",n=0;n<e.length;){var s=e[n++];s<128||t?i+=String.fromCharCode(s):s<224?i+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?i+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,i+=String.fromCharCode(55296|s>>10,56320|1023&s))}return i}(gf(mf(JSON.stringify(r))),!0)}function uh(r){return r.type===Ct.Custom&&r.data.tag==="sessionIdle"}function ch(r,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(r))}var Wl=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return H==null||(e=H.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(pn+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return this.triggerStatus==="trigger_pending"?6e4:(e=(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:q1}get isSampled(){var e=this.instance.get_property(un);return yr(e)?e:null}get sessionDuration(){var e,t,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((t=this.buffer)===null||t===void 0?void 0:t.data.length)-1],{sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(wl),t=!this.instance.config.disable_session_recording;return v&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(Np),t=this.instance.config.enable_recording_console_log;return t??e}get canvasRecording(){var e,t,i,n,s,o,l=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(Bp),u=(e=(t=l?.recordCanvas)!==null&&t!==void 0?t:a?.enabled)!==null&&e!==void 0&&e,d=(i=(n=l?.canvasFps)!==null&&n!==void 0?n:a?.fps)!==null&&i!==void 0?i:0,c=(s=(o=l?.canvasQuality)!==null&&o!==void 0?o:a?.quality)!==null&&s!==void 0?s:0;return{enabled:u,fps:pt(d,0,12,"canvas recording fps"),quality:pt(c,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,i=this.instance.get_property(Up),n={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordBody},s=n?.recordHeaders||i?.recordHeaders,o=n?.recordBody||i?.recordBody,l=le(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(yr(l)?l:i?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(qp);return Oe(e)?e:null}get minimumDuration(){var e=this.instance.get_property(Hp);return Oe(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":Y(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":yr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return this._urlTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(al))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return this._eventTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(ll))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",t=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(A(this,"queuedRRWebEvents",[]),A(this,"isIdle",!1),A(this,"_linkedFlagSeen",!1),A(this,"_lastActivityTimestamp",Date.now()),A(this,"_linkedFlag",null),A(this,"_removePageViewCaptureHook",void 0),A(this,"_onSessionIdListener",void 0),A(this,"_persistDecideOnSessionListener",void 0),A(this,"_samplingSessionListener",void 0),A(this,"_urlTriggers",[]),A(this,"_urlBlocklist",[]),A(this,"_urlBlocked",!1),A(this,"_eventTriggers",[]),A(this,"_removeEventTriggerCaptureHook",void 0),A(this,"_forceAllowLocalhostNetworkCapture",!1),A(this,"_onBeforeUnload",()=>{this._flushBuffer()}),A(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),A(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),A(this,"_onVisibilityChange",()=>{if(L!=null&&L.visibilityState){var n="window "+L.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Ae.error("started without valid sessionManager"),new Error(pn+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(pn+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:t,windowId:i}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=i,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Ae.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),v?.addEventListener("beforeunload",this._onBeforeUnload),v?.addEventListener("offline",this._onOffline),v?.addEventListener("online",this._onOnline),v?.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Y(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var i=t!=null&&t.properties.$current_url?this._maskUrl(t?.properties.$current_url):"";if(!i)return;this._tryAddCustomEvent("$pageview",{href:i})}}catch(n){Ae.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((t,i,n)=>{var s,o,l,a;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:t,windowId:i,changeReason:n}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(ll),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(al))}))):this.stopRecording()}stopRecording(){var e,t,i,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,v?.removeEventListener("beforeunload",this._onBeforeUnload),v?.removeEventListener("offline",this._onOffline),v?.removeEventListener("online",this._onOnline),v?.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(e=this._removePageViewCaptureHook)===null||e===void 0||e.call(this),this._removePageViewCaptureHook=void 0,(t=this._removeEventTriggerCaptureHook)===null||t===void 0||t.call(this),this._removeEventTriggerCaptureHook=void 0,(i=this._onSessionIdListener)===null||i===void 0||i.call(this),this._onSessionIdListener=void 0,(n=this._samplingSessionListener)===null||n===void 0||n.call(this),this._samplingSessionListener=void 0,Ae.info("stopped"))}makeSamplingDecision(e){var t,i=this.sessionId!==e,n=this.sampleRate;if(Oe(n)){var s,o=this.isSampled,l=i||!yr(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):Ae.warn("Sample rate (".concat(n,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:n,isSampled:s})),(t=this.instance.persistence)===null||t===void 0||t.register({[un]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[un]:null})}}onRemoteConfig(e){var t,i,n,s,o,l;if(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(l=e.sessionRecording)===null||l===void 0?void 0:l.endpoint),this._setupSampling(),!Y(this._linkedFlag)&&!this._linkedFlagSeen){var a=Se(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,u=Se(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((d,c)=>{var p=le(c)&&a in c,h=u?c[a]===u:p;h&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:u}),this._linkedFlagSeen=h})}(n=e.sessionRecording)!==null&&n!==void 0&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),(s=e.sessionRecording)!==null&&s!==void 0&&s.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),(o=e.sessionRecording)!==null&&o!==void 0&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Oe(this.sampleRate)&&Y(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistRemoteConfig(e){if(this.instance.persistence){var t,i=this.instance.persistence,n=()=>{var s,o,l,a,u,d,c,p,h=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,g=Y(h)?null:parseFloat(h),m=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;i.register({[wl]:!!e.sessionRecording,[Np]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[Up]:k({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[Bp]:{enabled:(u=e.sessionRecording)===null||u===void 0?void 0:u.recordCanvas,fps:(d=e.sessionRecording)===null||d===void 0?void 0:d.canvasFps,quality:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasQuality},[qp]:g,[Hp]:F(m)?null:m,[zp]:(p=e.sessionRecording)===null||p===void 0?void 0:p.scriptConfig})};n(),(t=this._persistDecideOnSessionListener)===null||t===void 0||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(n)}}log(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!F(Object.assign)&&!F(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,i;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=H.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,this.scriptName,n=>{if(n)return Ae.error("could not load recorder",n);this._onScriptLoaded()}),Ae.info("starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,i;return((e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0||(i=t.get_property(zp))===null||i===void 0?void 0:i.script)||"recorder"}isInteractiveEvent(e){var t;return e.type===3&&H1.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var{windowId:n,sessionId:s}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==s,l=this.windowId!==n;this.windowId=n,this.sessionId=s,o||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Ae.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(lh(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(lh(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var e,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this.instance.config.session_recording;for(var[n,s]of Object.entries(i||{}))n in t&&(n==="maskInputOptions"?t.maskInputOptions=k({password:!0},s):t[n]=s);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new Ul(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(l,a)=>{var u="Too many mutations on node '".concat(l,"'. Rate limiting. This could be due to SVG animations or something similar");Ae.info(u,{node:a}),this.log(pn+" "+u,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(k({emit:l=>{this.onRRwebEmit(l)},plugins:o},t)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:o.map(l=>l?.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Ae.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}}_gatherRRWebPlugins(){var e,t,i,n,s=[],o=(e=H.__PosthogExtensions__)===null||e===void 0||(t=e.rrwebPlugins)===null||t===void 0?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var l=(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ze(l)&&(!u1.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(P1(this.instance.config,this.networkPayloadCapture))):Ae.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&le(e)){if(e.type===Ct.Meta){var i=this._maskUrl(e.data.href);if(this._lastHref=i,!i)return;e.data.href=i}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(c){return c.type===Ct.Custom&&c.data.tag==="recording paused"}(e)){e.type===Ct.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Ct.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var s=function(c){var p=c;if(p&&le(p)&&p.type===6&&le(p.data)&&p.data.plugin==="rrweb/console@1"){p.data.payload.payload.length>10&&(p.data.payload.payload=p.data.payload.payload.slice(0,10),p.data.payload.payload.push("...[truncated]"));for(var h=[],g=0;g<p.data.payload.payload.length;g++)p.data.payload.payload[g]&&p.data.payload.payload[g].length>2e3?h.push(p.data.payload.payload[g].slice(0,2e3)+"...[truncated]"):h.push(p.data.payload.payload[g]);return p.data.payload.payload=h,c}return c}(n);if(this._updateWindowAndSessionIds(s),!this.isIdle||uh(s)){if(uh(s)){var o=s.data.payload;if(o){var l=o.lastActivityTimestamp,a=o.threshold;s.timestamp=l+a}}var u=(t=this.instance.config.session_recording.compress_events)===null||t===void 0||t?function(c){if(fo(c)<1024)return c;try{if(c.type===Ct.FullSnapshot)return k(k({},c),{},{data:hr(c.data),cv:"2024-10"});if(c.type===Ct.IncrementalSnapshot&&c.data.source===st.Mutation)return k(k({},c),{},{cv:"2024-10",data:k(k({},c.data),{},{texts:hr(c.data.texts),attributes:hr(c.data.attributes),removes:hr(c.data.removes),adds:hr(c.data.adds)})});if(c.type===Ct.IncrementalSnapshot&&c.data.source===st.StyleSheetRule)return k(k({},c),{},{cv:"2024-10",data:k(k({},c.data),{},{adds:hr(c.data.adds),removes:hr(c.data.removes)})})}catch(p){Ae.error("could not compress event - will use uncompressed event",p)}return c}(s):s,d={$snapshot_bytes:fo(u),$snapshot_data:u,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(d):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&v){var e=this._maskUrl(v.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this._tryRRWebMethod(t)})}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,n={url:e};return(i=n=t.maskNetworkRequestFn(n))===null||i===void 0?void 0:i.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,i=Oe(t)&&t>=0,n=Oe(e)&&i&&t<e;return this.status==="buffering"||this.status==="paused"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Ll(this.buffer).forEach(s=>{this._captureSnapshot({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId,$lib:"web",$lib_version:Et.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t,i=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(v!==void 0&&v.location.href){var e=v.location.href,t=this.status==="paused",i=ch(e,this._urlBlocklist);i&&!t?this._pauseRecording():!i&&t&&this._resumeRecording(),ch(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,i;this.triggerStatus==="trigger_pending"&&((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register({[e==="url"?al:ll]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){this.status!=="paused"&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Ae.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this.status==="paused"&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Ae.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&Y(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(t){Ae.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;(e=this.instance.persistence)===null||e===void 0||e.register({[un]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Ae.info(e.replace("_"," "),t),V(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},fr=Fe("[RemoteConfig]"),Gl=class{constructor(e){this.instance=e}get remoteConfig(){var e,t;return(e=H._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(t=e[this.instance.config.token])===null||t===void 0?void 0:t.config}_loadRemoteConfigJs(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.loadExternalDependency?(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"remote-config",()=>e(this.remoteConfig)):(fr.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return fr.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void fr.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(e=>{if(!e)return fr.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(t=>{this.onRemoteConfig(t)});this.onRemoteConfig(e)})}catch(e){fr.error("Error loading remote config",e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),e.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):fr.info("__preview_remote_config is disabled. Logging config instead",e):fr.error("Failed to fetch remote config from PostHog.")}},St,z1=v!=null&&v.location?po(v.location.hash,"__posthog")||po(location.hash,"state"):null,dh="_postHogToolbarParams",ph=Fe("[Toolbar]");(function(r){r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED"})(St||(St={}));var Zl=class{constructor(e){this.instance=e}setToolbarState(e){H.ph_toolbar_state=e}getToolbarState(){var e;return(e=H.ph_toolbar_state)!==null&&e!==void 0?e:St.UNINITIALIZED}maybeLoadToolbar(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!v||!L)return!1;i=(e=i)!==null&&e!==void 0?e:v.location,s=(t=s)!==null&&t!==void 0?t:v.history;try{if(!n){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}n=v?.localStorage}var o,l=z1||po(i.hash,"__posthog")||po(i.hash,"state"),a=l?Op(()=>JSON.parse(atob(decodeURIComponent(l))))||Op(()=>JSON.parse(decodeURIComponent(l))):null;return a&&a.action==="ph_authorize"?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?i.hash=a.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(n.getItem(dh)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){var t=H.ph_load_toolbar||H.ph_load_editor;!Y(t)&&Ze(t)?t(e,this.instance):ph.warn("No toolbar load function found")}loadToolbar(e){var t=!(L==null||!L.getElementById(Dh));if(!v||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=k(k({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(v.localStorage.setItem(dh,JSON.stringify(k(k({},n),{},{source:void 0}))),this.getToolbarState()===St.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===St.UNINITIALIZED){var s,o;this.setToolbarState(St.LOADING),(s=H.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return ph.error("[Toolbar] Failed to load",l),void this.setToolbarState(St.UNINITIALIZED);this.setToolbarState(St.LOADED),this._callLoadToolbar(n)}),$t(v,"turbolinks:load",()=>{this.setToolbarState(St.UNINITIALIZED),this.loadToolbar(n)})}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}},Jl=class{constructor(e){A(this,"isPaused",!0),A(this,"queue",[]),A(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},t=Object.values(e),i=[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)];i.map(n=>{this.sendRequest(k(k({},n),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),i=function(s){var o=t[s],l=new Date().getTime();o.data&&fe(o.data)&&K(o.data,a=>{a.offset=Math.abs(a.timestamp-l),delete a.timestamp}),e.sendRequest(o)};for(var n in t)i(n)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return K(this.queue,t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;F(e[s])&&(e[s]=k(k({},n),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(n.data)}),this.queue=[],e}},V1=function(r){var e,t,i,n,s="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,`
688
+ `);this.positionClasses="",this.text="Try it out"}};M(Js,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Js);var Ip=(r,e,t)=>{for(let i of e)if(i[0]===r)return(0,i[1])();return t?.()};var Xs=class extends Pi(j){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1}render(){let e=zr(this.orderDetails?.order_status?.step||[]),t=zr(this.orderDetails?.items?.item||[]),i=zr(this.orderDetails?.actions||[]);return _`
689
+ <div class="flex w-full max-w-md flex-col rounded-3xl border bg-white p-4">
690
+ <!-- Header with order ID -->
691
+ <div class="mb-2">
692
+ ${this.orderDetails?.order_id?.label||!this.streaming?_`<h2 class="text-lg font-semibold">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:_`<div class="h-7 w-full animate-pulse rounded bg-gray-200"></div>`}
693
+ </div>
694
+
695
+ <!-- Progress Timeline -->
696
+ <div>
697
+ <ol role="list" class="w-full overflow-hidden">
698
+ ${this.streaming&&!this.orderDetails?_`
699
+ <!-- Loading for status timeline -->
700
+ ${[1,2,3].map((n,s)=>_`
701
+ <li class="w-full pb-8">
702
+ ${s<2?_`<div class="absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 animate-pulse bg-gray-200" aria-hidden="true"></div>`:""}
703
+ <div class="group relative flex items-start">
704
+ <span class="flex h-6 items-center">
705
+ <span class="h-4 w-4 animate-pulse rounded-full bg-gray-200"></span>
706
+ </span>
707
+ <span class="ml-3 flex min-w-0 flex-col">
708
+ <span class="h-5 w-24 animate-pulse rounded bg-gray-200"></span>
709
+ </span>
710
+ </div>
711
+ </li>
712
+ `)}
713
+ `:it(e,n=>n.label,(n,s)=>{let o=n.status==="completed",l=n.status==="in_progress",a=s===e.length-1;return _`<li class="relative pb-4">
714
+ ${a?"":_`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?"bg-[#601feb]":"bg-gray-300"}`}" aria-hidden="true"></div>`}
715
+
716
+ <div class="group relative flex items-start">
717
+ ${Ip(n.status,[["pending",()=>_` <span class="flex h-6 items-center">
718
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white">
719
+ <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
720
+ </span>
721
+ </span>`],["in_progress",()=>_`<span class="flex h-6 items-center">
722
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
723
+ <span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
724
+ </span>
725
+ </span>`],["completed",()=>_`
726
+ <span class="flex h-6 items-center">
727
+ <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[#601feb]">
728
+ <hi-outline class="mb-3 block h-3 w-3 text-white" name="check"></hi-outline>
729
+ </span>
730
+ </span>
731
+ `]],()=>_`<span class="flex h-6 items-center">
732
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
733
+ <span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
734
+ </span>
735
+ </span>`)}
736
+
737
+ <span class="ml-3 flex min-w-0 flex-col">
738
+ <span class="${`text-sm font-medium ${l?"text-[#601feb]":o?"text-gray-900":"text-gray-500"}`}"> ${n.label} </span>
739
+ </span>
740
+ </div>
741
+ </li>`})}
742
+ </ol>
743
+ </div>
744
+
745
+ <!-- Products list with order items -->
746
+ <div class="mb-2 w-full">
747
+ ${t.length===0&&!this.orderDetails?.total?.amount&&this.streaming?_`
748
+ <!-- Loading shimmer for products -->
749
+ <div class="w-full space-y-4">
750
+ <div class="flex items-center gap-2">
751
+ <div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
752
+ <div class="flex-1 space-y-2">
753
+ <div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>
754
+ <div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
755
+ </div>
756
+ </div>
757
+ <div class="flex items-center justify-between">
758
+ <div class="h-4 w-12 animate-pulse rounded bg-gray-200"></div>
759
+ <div class="h-4 w-10 animate-pulse rounded bg-gray-200"></div>
760
+ </div>
761
+ </div>
762
+ `:_`
763
+ <div class="divide-y divide-gray-100">
764
+ ${this.streaming&&!t.length?_`
765
+ <!-- Loading shimmer for individual products -->
766
+ ${[1,2].map(()=>_`
767
+ <div class="flex items-center gap-2 py-1.5">
768
+ <div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
769
+ <div class="min-w-0 flex-1">
770
+ <div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>
771
+ </div>
772
+ <div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
773
+ </div>
774
+ `)}
775
+ `:t?.map(n=>{let s=n?.image_url;return _`
776
+ <div class="flex items-center gap-2 py-1.5">
777
+ <mw-product-thumbnail class="block h-12 w-12" src="${Ot(s)}"></mw-product-thumbnail>
778
+
779
+ <div class="min-w-0 flex-1">
780
+ ${!n?.name&&this.streaming?_`<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>`:_`<h3 class="truncate text-sm font-medium">${n?.name}</h3>`}
781
+ </div>
782
+ ${!n?.price&&this.streaming?_`<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>`:_`<span class="text-sm text-gray-500">${n?.quantity&&Number(n.quantity)>1?"x":""} ${n?.price}</span>`}
783
+ </div>
784
+ `})}
785
+ </div>
786
+ <!-- Order total -->
787
+ <div class="mt-1 border-t border-gray-200 pt-1">
788
+ <div class="flex justify-between font-medium">
789
+ <span>${this.orderDetails?.total?.label}</span>
790
+ <span>${this.orderDetails?.total?.amount}</span>
791
+ </div>
792
+ </div>
793
+ `}
794
+ </div>
795
+
796
+ <!-- Shipping and payment information -->
797
+ <div class="mb-2 flex w-full flex-col gap-2 overflow-hidden">
798
+ ${this.streaming&&!this.orderDetails?_`
799
+ <!-- Loading shimmer template -->
800
+ ${[1,2].map(()=>_`
801
+ <div>
802
+ <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
803
+ <div class="space-y-2 overflow-hidden">
804
+ <div class="h-4 w-40 animate-pulse rounded bg-gray-200"></div>
805
+ <div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
806
+ </div>
807
+ </div>
808
+ `)}
809
+ `:_`
810
+ <!-- Shipping Section -->
811
+ <div>
812
+ ${this.streaming&&!this.orderDetails?.shipping?_`
813
+ <div>
814
+ <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
815
+ <div class="space-y-2 overflow-hidden">
816
+ <div class="h-4 w-40 animate-pulse rounded bg-gray-200"></div>
817
+ <div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
818
+ </div>
819
+ </div>
820
+ `:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?_`
821
+ <h3 class="mb-1 text-sm font-medium">${this.orderDetails?.shipping?.label}</h3>
822
+ <div class="space-y-1">
823
+ ${this.orderDetails.customer?.name?_`<p class="text-xs text-gray-600">${this.orderDetails.customer.name}</p>`:""}
824
+ ${this.orderDetails.shipping?.method?_`<p class="text-xs text-gray-600">${this.orderDetails.shipping.method}</p>`:""}
825
+ </div>
826
+ `:""}
827
+ </div>
828
+
829
+ <!-- Payment Section -->
830
+ <div>
831
+ ${this.streaming&&!this.orderDetails?.payment?_`
832
+ <div>
833
+ <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
834
+ <div class="space-y-2 overflow-hidden">
835
+ <div class="h-4 w-40 animate-pulse rounded bg-gray-200"></div>
836
+ <div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
837
+ </div>
838
+ </div>
839
+ `:this.orderDetails?.payment?_`
840
+ <h3 class="mb-1 text-sm font-medium">${this.orderDetails.payment.label}</h3>
841
+ ${this.orderDetails.payment?.method?.value?_`
842
+ <p class="text-xs text-gray-600">
843
+ <span class="font-medium">${this.orderDetails.payment.method.label}:</span>
844
+ ${this.orderDetails.payment.method.value}
845
+ </p>
846
+ `:""}
847
+ ${this.orderDetails.payment.status?.value?_`
848
+ <p class="text-xs text-gray-600">
849
+ <span class="font-medium">${this.orderDetails.payment.status.label}:</span>
850
+ <span>${this.orderDetails.payment.status.value}</span>
851
+ </p>
852
+ `:""}
853
+ `:""}
854
+ </div>
855
+ `}
856
+ </div>
857
+
858
+ <!-- Action buttons section -->
859
+ <div class="flex w-full flex-col gap-2 overflow-hidden">
860
+ ${this.streaming&&!i[0]?.track_order?.label&&!Oa(i[0]?.track_order?.tracking_url||"")?_`
861
+ <!-- Loading shimmer for buttons -->
862
+ <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200"></div>
863
+ `:it(i,(n,s)=>`action-${s}`,n=>{if(n?.track_order?.label)return _`
864
+ ${Oa(n.track_order?.tracking_url||"")?_` <a
865
+ target="${this.linksNewTab?"_blank":"_self"}"
866
+ href="${n.track_order?.tracking_url}"
867
+ class="mt-1 w-full rounded-xl bg-[#601feb] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90"
868
+ >${n.track_order.label}</a
869
+ >`:null}
870
+ `})}
871
+ </div>
872
+ </div>
873
+ `}};M(Xs,"properties",{orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"}});customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Xs);window.__INIT_MOLIN_SHOP_AI=function(e){if(r1(e),e.auto){let t=document.createElement("molin-shop-ai");t.setAttribute("cdn",e.cdn),t.setAttribute("widget",e.widgetId),document.body.appendChild(t)}};function r1(r){window.__INIT_MOLIN_SHOP_AI_OPTIONS=r}function Ap(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Pe,xt,Ys,rn,ti,gl=class{constructor(){w(this,Pe,[]);w(this,xt);w(this,Ys,10);w(this,rn,5e3);w(this,ti,!1)}async add(e,t){if(f(this,Pe).push({event:e,properties:Object.assign({},t,Pp()),distinct_id:Mp(t.distinct_id),timestamp:new Date().toISOString()}),f(this,Pe).length>=f(this,Ys))return this.flush();f(this,xt)||I(this,xt,setTimeout(()=>{this.flush().catch(console.error)},f(this,rn)))}async flush(){if(f(this,ti)||f(this,Pe).length===0)return;let e=[...f(this,Pe)];try{I(this,ti,!0),clearTimeout(f(this,xt)),I(this,xt,void 0),I(this,Pe,[]);let t=new AbortController,i=setTimeout(()=>t.abort(),5e3),n=new FormData;n.append("events",JSON.stringify(e));let s=await fetch(new URL("/widgets/data/collect",ml()).href,{method:"POST",body:n,signal:t.signal});if(clearTimeout(i),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s}catch(t){if(t.name==="AbortError")console.error("Request timed out, retrying events"),I(this,Pe,[...e,...f(this,Pe)]);else{console.error("Failed to send events to backend:",t);let i=e.filter(n=>n.event.includes("error"));I(this,Pe,[...i,...f(this,Pe)])}}finally{I(this,ti,!1),f(this,Pe).length>0&&!f(this,xt)&&I(this,xt,setTimeout(()=>{this.flush().catch(console.error)},f(this,rn)))}}async flushBeforeUnload(){if(f(this,Pe).length>0)try{let e=new FormData;e.append("events",JSON.stringify(f(this,Pe))),navigator.sendBeacon(new URL("/widgets/data/collect",ml()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};Pe=new WeakMap,xt=new WeakMap,Ys=new WeakMap,rn=new WeakMap,ti=new WeakMap;var Tp=new gl;window.addEventListener("beforeunload",()=>{Tp.flushBeforeUnload().catch(console.error)});async function he(r,e){try{if(e.immediate){let t=new FormData;t.append("events",JSON.stringify([{event:r,properties:Object.assign({},e,Pp()),distinct_id:Mp(e.distinct_id),timestamp:new Date().toISOString()}]));let i=await fetch(new URL("/widgets/data/collect",ml()).href,{method:"POST",body:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return await i.json()}return Tp.add(r,e)}catch(t){console.error("Failed to send event:",t)}}function Mp(r=crypto.randomUUID()){let e="molin_shop_assistant_distinct_id";try{let t=localStorage.getItem(e);return t||(t=r,localStorage.setItem(e,t)),t}catch(t){console.error("Failed to handle distinct ID:",t);try{localStorage.setItem(e,r)}catch(i){console.error("Failed to store new distinct ID:",i)}return r}}function Pp(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack}}var Ks;function ml(){if(Ks)return Ks;let r=new URL(import.meta.url).hostname;return Ks=new Map([["localhost","http://localhost:8787"],["widget.molin.foo","https://molin.foo"],["widget.molin.ai","https://molin.ai"],["molin.foo","https://molin.foo"]]).get(r)||"https://molin.ai",Ks}var dr,nn,Nt,pr,eo,Op,Qs=class{constructor(e,t,i){w(this,eo);w(this,dr);w(this,nn);w(this,Nt);w(this,pr);M(this,"isLoading",!1);M(this,"data");I(this,dr,e),I(this,nn,t),I(this,Nt,i),e.addController(this)}fetch(){if(this.isLoading)return;f(this,pr)?.abort();let e=new AbortController;I(this,pr,e),this.isLoading=!0,this.data=void 0,f(this,dr).requestUpdate(),(async()=>{let t=S(this,eo,Op).call(this);return t.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(t,{signal:e.signal})})().then(async t=>{if(!t.ok)throw new Error(`${t.statusText}: ${await t.text()}`);this.isLoading=!1,this.data=typeof f(this,Nt)?.transform=="function"?await f(this,Nt).transform(t):t,f(this,dr).requestUpdate()}).catch(t=>{f(this,Nt)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,dr).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,Nt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,pr)?.abort(),I(this,pr,void 0)}};dr=new WeakMap,nn=new WeakMap,Nt=new WeakMap,pr=new WeakMap,eo=new WeakSet,Op=function(){let e=f(this,nn);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ct,sn,ri,ii,Ut=class{constructor(e,t){w(this,ct);w(this,sn);w(this,ri);w(this,ii);I(this,ct,e),I(this,sn,t),e.addController(this)}get data(){return f(this,ii)||f(this,ri)?.data}hostConnected(){if(f(this,ri)||f(this,ii))return;let e=Ap();e&&e.widgetId===f(this,ct).widgetId?I(this,ii,e.config):I(this,ri,new Qs(f(this,ct),()=>{if(f(this,ct).cdn&&f(this,ct).widgetId)return`${f(this,ct).cdn}/config?w=${f(this,ct).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:f(this,sn)?.onError}))}};ct=new WeakMap,sn=new WeakMap,ri=new WeakMap,ii=new WeakMap;function Lp(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function C(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lp(Object(t),!0).forEach(function(i){A(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lp(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function A(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lh(r,e){if(r==null)return{};var t,i,n=function(o,l){if(o==null)return{};var a,u,d={},c=Object.keys(o);for(u=0;u<c.length;u++)a=c[u],l.indexOf(a)>=0||(d[a]=o[a]);return d}(r,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}var dt,$t={DEBUG:!1,LIB_VERSION:"1.205.0"},v=typeof window<"u"?window:void 0,qe=typeof globalThis<"u"?globalThis:v,Fh=Array.prototype,Fp=Fh.forEach,Dp=Fh.indexOf,Ge=qe?.navigator,L=qe?.document,Be=qe?.location,Il=qe?.fetch,Al=qe!=null&&qe.XMLHttpRequest&&"withCredentials"in new qe.XMLHttpRequest?qe.XMLHttpRequest:void 0,jp=qe?.AbortController,we=Ge?.userAgent,H=v??{},vl="$copy_autocapture",i1=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(r){r.GZipJS="gzip-js",r.Base64="base64"})(dt||(dt={}));function V(r,e){return r.indexOf(e)!==-1}var Lo=function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},Tl=function(r){return r.replace(/^\$/,"")},n1=Array.isArray,Dh=Object.prototype,jh=Dh.hasOwnProperty,Fo=Dh.toString,fe=n1||function(r){return Fo.call(r)==="[object Array]"},Ze=r=>typeof r=="function",le=r=>r===Object(r)&&!fe(r),si=r=>{if(le(r)){for(var e in r)if(jh.call(r,e))return!1;return!0}return!1},F=r=>r===void 0,Ee=r=>Fo.call(r)=="[object String]",Np=r=>Ee(r)&&r.trim().length===0,Wt=r=>r===null,Y=r=>F(r)||Wt(r),Oe=r=>Fo.call(r)=="[object Number]",br=r=>Fo.call(r)==="[object Boolean]",s1=r=>r instanceof FormData,o1=r=>V(i1,r),Nh=r=>{var e={_log:function(t){if(v&&($t.DEBUG||H.POSTHOG_DEBUG)&&!F(v.console)&&v.console){for(var i=("__rrweb_original__"in v.console[t])?v.console[t].__rrweb_original__:v.console[t],n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(r,...s)}},info:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];console.error(r,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling ".concat(t))},createLogger:t=>Nh("".concat(r," ").concat(t))};return e},O=Nh("[PostHog.js]"),Fe=O.createLogger,mo={};function ai(r,e,t){if(fe(r)){if(Fp&&r.forEach===Fp)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,n=r.length;i<n;i++)if(i in r&&e.call(t,r[i],i)===mo)return}}}function K(r,e,t){if(!Y(r)){if(fe(r))return ai(r,e,t);if(s1(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===mo)return}else for(var n in r)if(jh.call(r,n)&&e.call(t,r[n],n)===mo)return}}var Te=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ai(t,function(n){for(var s in n)n[s]!==void 0&&(r[s]=n[s])}),r};function ho(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var Up=function(r){try{return r()}catch{return}},a1=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(n){O.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),O.critical(n)}}},vo=function(r){var e={};return K(r,function(t,i){Ee(t)&&t.length>0&&(e[i]=t)}),e};function l1(r,e){return t=r,i=s=>Ee(s)&&!Wt(e)?s.slice(0,e):s,n=new Set,function s(o,l){return o!==Object(o)?i?i(o,l):o:n.has(o)?void 0:(n.add(o),fe(o)?(a=[],ai(o,u=>{a.push(s(u))})):(a={},K(o,(u,d)=>{n.has(u)||(a[d]=s(u,d))})),a);var a}(t);var t,i,n}var It=function(){function r(e){return e&&(e.preventDefault=r.preventDefault,e.stopPropagation=r.stopPropagation),e}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(t,i,!!s);else{var o="on"+t,l=e[o];e[o]=function(a,u,d){return function(c){if(c=c||r(v?.event)){var p,h=!0;Ze(d)&&(p=d(c));var g=u.call(a,c);return p!==!1&&g!==!1||(h=!1),h}}}(e,i,l)}else O.error("No valid element provided to register_event")}}();function Uh(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}var Bh="$people_distinct_id",cn="__alias",dn="__timers",Bp="$autocapture_disabled_server_side",Ml="$heatmaps_enabled_server_side",qp="$exception_capture_enabled_server_side",Hp="$web_vitals_enabled_server_side",qh="$dead_clicks_enabled_server_side",zp="$web_vitals_allowed_metrics",Pl="$session_recording_enabled_server_side",Vp="$console_log_recording_enabled_server_side",Wp="$session_recording_network_payload_capture",Gp="$session_recording_canvas_recording",Zp="$replay_sample_rate",Jp="$replay_minimum_duration",Xp="$replay_script_config",_o="$sesid",pn="$session_is_sampled",_l="$session_recording_url_trigger_activated_session",yl="$session_recording_event_trigger_activated_session",oi="$enabled_feature_flags",fo="$early_access_features",hn="$stored_person_properties",_r="$stored_group_properties",Rl="$surveys",to="$surveys_activated",yo="$flag_call_reported",Ct="$user_state",Ol="$client_session_props",Ll="$capture_rate_limit",Fl="$initial_campaign_params",Dl="$initial_referrer_info",jl="$initial_person_info",bo="$epp",Hh="__POSTHOG_TOOLBAR__",Kp="$posthog_cklsh",u1=[Bh,cn,"__cmpns",dn,Pl,Ml,_o,oi,Ct,fo,_r,hn,Rl,yo,Ol,Ll,Fl,Dl,bo],ro=Fe("[FeatureFlags]"),bl="$active_feature_flags",io="$override_feature_flags",Yp="$feature_flag_payloads",Qp=r=>{var e={};for(var[t,i]of ho(r||{}))i&&(e[t]=i);return e},Nl=class{constructor(e){A(this,"_override_warning",!1),A(this,"_hasLoadedFlags",!1),A(this,"_requestInFlight",!1),A(this,"_reloadingDisabled",!1),A(this,"_additionalReloadRequested",!1),A(this,"_decideCalled",!1),A(this,"_flagsLoadedFromRemote",!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(oi),t=this.instance.get_property(io);if(!t)return e||{};for(var i=Te({},e),n=Object.keys(t),s=0;s<n.length;s++)i[n[s]]=t[n[s]];return this._override_warning||(ro.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}getFlagPayloads(){return this.instance.get_property(Yp)||{}}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout(()=>{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(hn),group_properties:this.instance.get_property(_r)};(e!=null&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:dt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:i=>{var n,s,o=!0;i.statusCode===200&&(this.$anon_distinct_id=void 0,o=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((s=i.json)!==null&&s!==void 0?s:{})),t.disable_flags||(this._flagsLoadedFromRemote=!o,this.receivedFeatureFlags((n=i.json)!==null&&n!==void 0?n:{},o),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var i,n,s,o,l,a=this.getFlagVariants()[e],u="".concat(a),d=this.instance.get_property(yo)||{};return(t.send_event||!("send_event"in t))&&(!(e in d)||!d[e].includes(u))&&(fe(d[e])?d[e].push(u):d[e]=[u],(i=this.instance.persistence)===null||i===void 0||i.register({[yo]:d}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:((n=this.instance.config.bootstrap)===null||n===void 0||(s=n.featureFlags)===null||s===void 0?void 0:s[e])||null,$feature_flag_bootstrapped_payload:((o=this.instance.config.bootstrap)===null||o===void 0||(l=o.featureFlagPayloads)===null||l===void 0?void 0:l[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote})),a}ro.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);ro.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this.instance.persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads();(function(s,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.featureFlags,d=s.featureFlagPayloads;if(u)if(fe(u)){var c={};if(u)for(var p=0;p<u.length;p++)c[u[p]]=!0;o&&o.register({[bl]:u,[oi]:c})}else{var h=u,g=d;s.errorsWhileComputingFlags&&(h=C(C({},l),h),g=C(C({},a),g)),o&&o.register({[bl]:Object.keys(Qp(h)),[oi]:h||{},[Yp]:g||{}})}})(e,this.instance.persistence,i,n),this._fireFeatureFlagsCallbacks(t)}}override(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return ro.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(io);else if(fe(e)){for(var i={},n=0;n<e.length;n++)i[e[n]]=!0;this.instance.persistence.register({[io]:i})}else this.instance.persistence.register({[io]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,n=(this.instance.get_property(fo)||[]).find(a=>a.flagKey===e),s={["$feature_enrollment/".concat(e)]:t},o={$feature_flag:e,$feature_enrollment:t,$set:s};n&&(o.$early_access_feature_name=n.name),this.instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var l=C(C({},this.getFlagVariants()),{},{[e]:t});(i=this.instance.persistence)===null||i===void 0||i.register({[bl]:Object.keys(Qp(l)),[oi]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(fo);if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:n=>{var s;if(n.json){var o=n.json.earlyAccessFeatures;return(s=this.instance.persistence)===null||s===void 0||s.register({[fo]:o}),e(o)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,n)=>(i[n]=t[n],i),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(n=>n(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(hn)||{};this.instance.register({[hn]:C(C({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(hn)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(_r)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(n=>{i[n]=C(C({},i[n]),e[n]),delete e[n]}),this.instance.register({[_r]:C(C({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(_r)||{};this.instance.register({[_r]:C(C({},t),{},{[e]:{}})})}else this.instance.unregister(_r)}};Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return Oe(r)&&isFinite(r)&&Math.floor(r)===r});var eh="0123456789abcdef",Ul=class r{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(n)||e<0||t<0||i<0||n<0||e>0xffffffffffff||t>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new r(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+eh.charAt(this.bytes[t]>>>4)+eh.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new r(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}},Bl=class{constructor(){A(this,"timestamp",0),A(this,"counter",0),A(this,"random",new ql)}generate(){var e=this.generateOrAbort();if(F(e)){this.timestamp=0;var t=this.generateOrAbort();if(F(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Ul.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}},th,zh=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};v&&!F(v.crypto)&&crypto.getRandomValues&&(zh=r=>crypto.getRandomValues(r));var ql=class{constructor(){A(this,"buffer",new Uint32Array(8)),A(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(zh(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},Ht=()=>c1().toString(),c1=()=>(th||(th=new Bl)).generate(),d1="Thu, 01 Jan 1970 00:00:00 GMT",on="",p1=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function h1(r,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L;if(on)return on;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var o=n.split("."),l=Math.min(o.length,8),a="dmn_chk_"+Ht(),u=new RegExp("(^|;)\\s*"+a+"=1");!on&&l--;){var d=o.slice(l).join("."),c=a+"=1;domain=."+d;s.cookie=c,u.test(s.cookie)&&(s.cookie=c+";expires="+d1,on=d)}return on}(r);if(!t){var i=(n=>{var s=n.match(p1);return s?s[0]:""})(r);i!==t&&O.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var At={is_supported:()=>!!L,error:function(r){O.error("cookieStore error: "+r)},get:function(r){if(L){try{for(var e=r+"=",t=L.cookie.split(";").filter(s=>s.length),i=0;i<t.length;i++){for(var n=t[i];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},parse:function(r){var e;try{e=JSON.parse(At.get(r))||{}}catch{}return e},set:function(r,e,t,i,n){if(L)try{var s="",o="",l=h1(L.location.hostname,i);if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),s="; expires="+a.toUTCString()}n&&(o="; secure");var u=r+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&O.warn("cookieStore warning: large cookie, len="+u.length),L.cookie=u,u}catch{return}},remove:function(r,e){try{At.set(r,"",-1,e)}catch{return}}},wl=null,ve={is_supported:function(){if(!Wt(wl))return wl;var r=!0;if(F(v))r=!1;else try{var e="__mplssupport__";ve.set(e,"xyz"),ve.get(e)!=='"xyz"'&&(r=!1),ve.remove(e)}catch{r=!1}return r||O.error("localStorage unsupported; falling back to cookie store"),wl=r,r},error:function(r){O.error("localStorage error: "+r)},get:function(r){try{return v?.localStorage.getItem(r)}catch(e){ve.error(e)}return null},parse:function(r){try{return JSON.parse(ve.get(r))||{}}catch{}return null},set:function(r,e){try{v?.localStorage.setItem(r,JSON.stringify(e))}catch(t){ve.error(t)}},remove:function(r){try{v?.localStorage.removeItem(r)}catch(e){ve.error(e)}}},f1=["distinct_id",_o,pn,bo,jl],no=C(C({},ve),{},{parse:function(r){try{var e={};try{e=At.parse(r)||{}}catch{}var t=Te(e,JSON.parse(ve.get(r)||"{}"));return ve.set(r,t),t}catch{}return null},set:function(r,e,t,i,n,s){try{ve.set(r,e,void 0,void 0,s);var o={};f1.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&At.set(r,o,t,i,n,s)}catch(l){ve.error(l)}},remove:function(r,e){try{v?.localStorage.removeItem(r),At.remove(r,e)}catch(t){ve.error(t)}}}),so={},g1={is_supported:function(){return!0},error:function(r){O.error("memoryStorage error: "+r)},get:function(r){return so[r]||null},parse:function(r){return so[r]||null},set:function(r,e){so[r]=e},remove:function(r){delete so[r]}},hr=null,Ce={is_supported:function(){if(!Wt(hr))return hr;if(hr=!0,F(v))hr=!1;else try{var r="__support__";Ce.set(r,"xyz"),Ce.get(r)!=='"xyz"'&&(hr=!1),Ce.remove(r)}catch{hr=!1}return hr},error:function(r){O.error("sessionStorage error: ",r)},get:function(r){try{return v?.sessionStorage.getItem(r)}catch(e){Ce.error(e)}return null},parse:function(r){try{return JSON.parse(Ce.get(r))||null}catch{}return null},set:function(r,e){try{v?.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){Ce.error(t)}},remove:function(r){try{v?.sessionStorage.removeItem(r)}catch(e){Ce.error(e)}}},m1=["localhost","127.0.0.1"],li=r=>{var e=L?.createElement("a");return F(e)?null:(e.href=r,e)},di=function(r,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(r)},v1=function(r){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",n=[];return K(r,function(s,o){F(s)||F(o)||o==="undefined"||(e=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),t=encodeURIComponent(o),n[n.length]=t+"="+e)}),n.join(i)},wo=function(r,e){for(var t,i=((r.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){t=s;break}}if(!fe(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{O.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},xo=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Qe="Mobile",ko="iOS",pt="Android",bn="Tablet",Vh=pt+" "+bn,Wh="iPad",Gh="Apple",Zh=Gh+" Watch",wn="Safari",pi="BlackBerry",Jh="Samsung",Xh=Jh+"Browser",Kh=Jh+" Internet",xr="Chrome",_1=xr+" OS",Yh=xr+" "+ko,Pu="Internet Explorer",Qh=Pu+" "+Qe,Ru="Opera",y1=Ru+" Mini",Ou="Edge",ef="Microsoft "+Ou,ui="Firefox",tf=ui+" "+ko,xn="Nintendo",kn="PlayStation",ci="Xbox",rf=pt+" "+Qe,nf=Qe+" "+wn,fn="Windows",Hl=fn+" Phone",rh="Nokia",zl="Ouya",sf="Generic",b1=sf+" "+Qe.toLowerCase(),of=sf+" "+bn.toLowerCase(),Vl="Konqueror",Re="(\\d+(\\.\\d+)?)",xl=new RegExp("Version/"+Re),w1=new RegExp(ci,"i"),x1=new RegExp(kn+" \\w+","i"),k1=new RegExp(xn+" \\w+","i"),Lu=new RegExp(pi+"|PlayBook|BB10","i"),C1={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},E1=(r,e)=>e&&V(e,Gh)||function(t){return V(t,wn)&&!V(t,xr)&&!V(t,pt)}(r),ih=function(r,e){return e=e||"",V(r," OPR/")&&V(r,"Mini")?y1:V(r," OPR/")?Ru:Lu.test(r)?pi:V(r,"IE"+Qe)||V(r,"WPDesktop")?Qh:V(r,Xh)?Kh:V(r,Ou)||V(r,"Edg/")?ef:V(r,"FBIOS")?"Facebook "+Qe:V(r,"UCWEB")||V(r,"UCBrowser")?"UC Browser":V(r,"CriOS")?Yh:V(r,"CrMo")||V(r,xr)?xr:V(r,pt)&&V(r,wn)?rf:V(r,"FxiOS")?tf:V(r.toLowerCase(),Vl.toLowerCase())?Vl:E1(r,e)?V(r,Qe)?nf:wn:V(r,ui)?ui:V(r,"MSIE")||V(r,"Trident/")?Pu:V(r,"Gecko")?ui:""},S1={[Qh]:[new RegExp("rv:"+Re)],[ef]:[new RegExp(Ou+"?\\/"+Re)],[xr]:[new RegExp("("+xr+"|CrMo)\\/"+Re)],[Yh]:[new RegExp("CriOS\\/"+Re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Re)],[wn]:[xl],[nf]:[xl],[Ru]:[new RegExp("(Opera|OPR)\\/"+Re)],[ui]:[new RegExp(ui+"\\/"+Re)],[tf]:[new RegExp("FxiOS\\/"+Re)],[Vl]:[new RegExp("Konqueror[:/]?"+Re,"i")],[pi]:[new RegExp(pi+" "+Re),xl],[rf]:[new RegExp("android\\s"+Re,"i")],[Kh]:[new RegExp(Xh+"\\/"+Re)],[Pu]:[new RegExp("(rv:|MSIE )"+Re)],Mozilla:[new RegExp("rv:"+Re)]},nh=[[new RegExp(ci+"; "+ci+" (.*?)[);]","i"),r=>[ci,r&&r[1]||""]],[new RegExp(xn,"i"),[xn,""]],[new RegExp(kn,"i"),[kn,""]],[Lu,[pi,""]],[new RegExp(fn,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Hl,""];if(new RegExp(Qe).test(e)&&!/IEMobile\b/.test(e))return[fn+" "+Qe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],n=C1[i]||"";return/arm/i.test(e)&&(n="RT"),[fn,n]}return[fn,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[ko,e.join(".")]}return[ko,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=F(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+pt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+pt+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[pt,e.join(".")]}return[pt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[_1,""]],[/Linux|debian/i,["Linux",""]]],sh=function(r){return k1.test(r)?xn:x1.test(r)?kn:w1.test(r)?ci:new RegExp(zl,"i").test(r)?zl:new RegExp("("+Hl+"|WPDesktop)","i").test(r)?Hl:/iPad/.test(r)?Wh:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?Zh:Lu.test(r)?pi:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(rh,"i").test(r)?rh:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(Qe).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?pt:Vh:pt:new RegExp("(pda|"+Qe+")","i").test(r)?b1:new RegExp(bn,"i").test(r)&&!new RegExp(bn+" pc","i").test(r)?of:""},oo="https?://(.*)",$1=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],se={campaignParams:function(r){return L?this._campaignParamsFromUrl(L.URL,r):{}},_campaignParamsFromUrl:function(r,e){var t=$1.concat(e||[]),i={};return K(t,function(n){var s=wo(r,n);i[n]=s||null}),i},_searchEngine:function(r){return r?r.search(oo+"google.([^/?]*)")===0?"google":r.search(oo+"bing.com")===0?"bing":r.search(oo+"yahoo.com")===0?"yahoo":r.search(oo+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(r){var e=se._searchEngine(r),t=e!="yahoo"?"q":"p",i={};if(!Wt(e)){i.$search_engine=e;var n=L?wo(L.referrer,t):"";n.length&&(i.ph_keyword=n)}return i},searchInfo:function(){var r=L?.referrer;return r?this._searchInfoFromReferrer(r):{}},browser:ih,browserVersion:function(r,e){var t=ih(r,e),i=S1[t];if(F(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=r.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var r=this.browserLanguage();return typeof r=="string"?r.split("-")[0]:void 0},os:function(r){for(var e=0;e<nh.length;e++){var[t,i]=nh[e],n=t.exec(r),s=n&&(Ze(i)?i(n,r):i);if(s)return s}return["",""]},device:sh,deviceType:function(r){var e=sh(r);return e===Wh||e===Vh||e==="Kobo"||e==="Kindle Fire"||e===of?bn:e===xn||e===ci||e===kn||e===zl?"Console":e===Zh?"Wearable":e?Qe:"Desktop"},referrer:function(){return L?.referrer||"$direct"},referringDomain:function(){var r;return L!=null&&L.referrer&&((r=li(L.referrer))===null||r===void 0?void 0:r.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:Be?.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(r){var e,{r:t,u:i}=r,n={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=li(t))===null||e===void 0?void 0:e.host};if(i){n.$initial_current_url=i;var s=li(i);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,K(this._campaignParamsFromUrl(i),function(o,l){n["$initial_"+Tl(l)]=o})}return t&&K(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+Tl(l)]=o}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){if(!we)return{};var[r,e]=se.os(we);return Te(vo({$os:r,$os_version:e,$browser:se.browser(we,navigator.vendor),$device:se.device(we),$device_type:se.deviceType(we),$timezone:se.timezone(),$timezone_offset:se.timezoneOffset()}),{$current_url:Be?.href,$host:Be?.host,$pathname:Be?.pathname,$raw_user_agent:we.length>1e3?we.substring(0,997)+"...":we,$browser_version:se.browserVersion(we,navigator.vendor),$browser_language:se.browserLanguage(),$browser_language_prefix:se.browserLanguagePrefix(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:$t.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!we)return{};var[r,e]=se.os(we);return Te(vo({$os:r,$os_version:e,$browser:se.browser(we,navigator.vendor)}),{$browser_version:se.browserVersion(we,navigator.vendor)})}},I1=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],mn=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t=>{var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&O.info("Persistence loaded",e.persistence,C({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){I1.indexOf(e.persistence.toLowerCase())===-1&&(O.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&ve.is_supported()?ve:t==="localstorage+cookie"&&no.is_supported()?no:t==="sessionstorage"&&Ce.is_supported()?Ce:t==="memory"?g1:t==="cookie"?At:no.is_supported()?no:At}properties(){var e={};return K(this.props,function(t,i){if(i===oi&&le(t))for(var n=Object.keys(t),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=t[n[s]];else l=i,a=!1,(Wt(o=u1)?a:Dp&&o.indexOf===Dp?o.indexOf(l)!=-1:(K(o,function(u){if(a||(a=u===l))return mo}),a))||(e[i]=t);var o,l,a}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Te({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(le(e)){F(t)&&(t="None"),this.expire_days=F(i)?this.default_expiry:i;var n=!1;if(K(e,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==t||(this.props[o]=s,n=!0)}),n)return this.save(),!0}return!1}register(e,t){if(le(e)){this.expire_days=F(t)?this.default_expiry:t;var i=!1;if(K(e,(n,s)=>{e.hasOwnProperty(s)&&this.props[s]!==n&&(this.props[s]=n,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=se.campaignParams(this.config.custom_campaign_params);si(vo(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(se.searchInfo())}update_referrer_info(){this.register_once(se.referrerInfo(),void 0)}set_initial_person_info(){this.props[Fl]||this.props[Dl]||this.register_once({[jl]:se.initialPersonInfo()},void 0)}get_referrer_info(){return vo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};K([Dl,Fl],n=>{var s=this.props[n];s&&K(s,function(o,l){e["$initial_"+Tl(l)]=o})});var t=this.props[jl];if(t){var i=se.initialPersonPropsFromInfo(t);Te(e,i)}return e}safe_merge(e){return K(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.buildStorage(e),n=this.props;this.clear(),this.storage=i,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[dn]||{};i[e]=t,this.props[dn]=i,this.save()}remove_event_timer(e){var t=(this.props[dn]||{})[e];return F(t)||(delete this.props[dn][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function Co(r){var e,t;return((e=JSON.stringify(r,(t=[],function(i,n){if(le(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n})))===null||e===void 0?void 0:e.length)||0}function Wl(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(r.size>=e&&r.data.length>1){var t=Math.floor(r.data.length/2),i=r.data.slice(0,t),n=r.data.slice(t);return[Wl({size:Co(i),data:i,sessionId:r.sessionId,windowId:r.windowId}),Wl({size:Co(n),data:n,sessionId:r.sessionId,windowId:r.windowId})].flatMap(s=>s)}return[r]}var Et=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(Et||{}),ot=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(ot||{});function oh(r){var e;return r instanceof Element&&(r.id===Hh||!((e=r.closest)===null||e===void 0||!e.call(r,".toolbar-global-fade-container")))}function Do(r){return!!r&&r.nodeType===1}function Vt(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function af(r){return!!r&&r.nodeType===3}function lf(r){return!!r&&r.nodeType===11}function Fu(r){return r?Lo(r).split(/\s+/):[]}function ah(r){var e=v?.location.href;return!!(e&&r&&r.some(t=>e.match(t)))}function Eo(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return Fu(e)}function uf(r){return Y(r)?null:Lo(r).split(/(\s+)/).filter(e=>hi(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function jo(r){var e="";return Zl(r)&&!pf(r)&&r.childNodes&&r.childNodes.length&&K(r.childNodes,function(t){var i;af(t)&&t.textContent&&(e+=(i=uf(t.textContent))!==null&&i!==void 0?i:"")}),Lo(e)}function cf(r){return F(r.target)?r.srcElement||null:(e=r.target)!==null&&e!==void 0&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var Gl=["a","button","form","input","select","textarea","label"];function df(r){var e=r.parentNode;return!(!e||!Do(e))&&e}function A1(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!v||!r||Vt(r,"html")||!Do(r)||t!=null&&t.url_allowlist&&!ah(t.url_allowlist)||t!=null&&t.url_ignorelist&&ah(t.url_ignorelist))return!1;if(t!=null&&t.dom_event_allowlist){var s=t.dom_event_allowlist;if(s&&!s.some(h=>e.type===h))return!1}for(var o=!1,l=[r],a=!0,u=r;u.parentNode&&!Vt(u,"body");)if(lf(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!(a=df(u)))break;if(i||Gl.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{var d=v.getComputedStyle(a);d&&d.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(a),u=a}if(!function(h,g){var m=g?.element_allowlist;if(F(m))return!0;var b=function(k){if(m.some(E=>k.tagName.toLowerCase()===E))return{v:!0}};for(var x of h){var y=b(x);if(typeof y=="object")return y.v}return!1}(l,t)||!function(h,g){var m=g?.css_selector_allowlist;if(F(m))return!0;var b=function(k){if(m.some(E=>k.matches(E)))return{v:!0}};for(var x of h){var y=b(x);if(typeof y=="object")return y.v}return!1}(l,t))return!1;var c=v.getComputedStyle(r);if(c&&c.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=r.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return o?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Gl.indexOf(p)>-1||r.getAttribute("contenteditable")==="true")}}function Zl(r){for(var e=r;e.parentNode&&!Vt(e,"body");e=e.parentNode){var t=Eo(e);if(V(t,"ph-sensitive")||V(t,"ph-no-capture"))return!1}if(V(Eo(r),"ph-include"))return!0;var i=r.type||"";if(Ee(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=r.name||r.id||"";return!(Ee(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function pf(r){return!!(Vt(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||Vt(r,"select")||Vt(r,"textarea")||r.getAttribute("contenteditable")==="true")}var hf="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",T1=new RegExp("^(?:".concat(hf,")$")),M1=new RegExp(hf),ff="\\d{3}-?\\d{2}-?\\d{4}",P1=new RegExp("^(".concat(ff,")$")),R1=new RegExp("(".concat(ff,")"));function hi(r){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Y(r)||Ee(r)&&(r=Lo(r),(e?T1:M1).test((r||"").replace(/[- ]/g,""))||(e?P1:R1).test(r)))}function gf(r){var e=jo(r);return hi(e="".concat(e," ").concat(mf(r)).trim())?e:""}function mf(r){var e="";return r&&r.childNodes&&r.childNodes.length&&K(r.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var n=jo(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(mf(t)).trim())}catch(s){O.error("[AutoCapture]",s)}}),e}function O1(r){return function(e){var t=e.map(i=>{var n,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class)for(var l of(i.attr_class.sort(),i.attr_class))o+=".".concat(l.replace(/"/g,""));var a=C(C(C(C({},i.text?{text:i.text}:{}),{},{"nth-child":(n=i.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),u={};return ho(a).sort((d,c)=>{var[p]=d,[h]=c;return p.localeCompare(h)}).forEach(d=>{var[c,p]=d;return u[lh(c.toString())]=lh(p.toString())}),o+=":",o+=ho(a).map(d=>{var[c,p]=d;return"".concat(c,'="').concat(p,'"')}).join("")});return t.join(";")}(function(e){return e.map(t=>{var i,n,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(n=t.attr__href)===null||n===void 0?void 0:n.slice(0,2048),attr_class:L1(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ho(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,a]=o;return s.attributes[l]=a}),s})}(r))}function lh(r){return r.replace(/"|\\"/g,'\\"')}function L1(r){var e=r.attr__class;return e?fe(e)?e:Fu(e):void 0}var Jl="[SessionRecording]",Xl="redacted",ao={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:r=>r,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},F1=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],D1=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],j1=["/s/","/e/","/i/"];function uh(r,e,t,i){if(Y(r))return r;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(r);return Ee(n)&&(n=parseInt(n)),n>t?Jl+" ".concat(i," body too large to record (").concat(n," bytes)"):r}function ch(r,e){if(Y(r))return r;var t=r;return hi(t,!1)||(t=Jl+" "+e+" body "+Xl),K(D1,i=>{var n,s;(n=t)!==null&&n!==void 0&&n.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=Jl+" "+e+" body "+Xl+" as might contain: "+i)}),t}var N1=(r,e)=>{var t,i,n,s={payloadSizeLimitBytes:ao.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...ao.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...ao.payloadHostDenyList]},o=r.session_recording.recordHeaders!==!1&&e.recordHeaders,l=r.session_recording.recordBody!==!1&&e.recordBody,a=r.capture_performance!==!1&&e.recordPerformance,u=(t=s,n=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),p=>(p!=null&&p.requestBody&&(p.requestBody=uh(p.requestBody,p.requestHeaders,n,"Request")),p!=null&&p.responseBody&&(p.responseBody=uh(p.responseBody,p.responseHeaders,n,"Response")),p)),d=p=>{return u(((m,b)=>{var x,y=li(m.name),k=b.indexOf("http")===0?(x=li(b))===null||x===void 0?void 0:x.pathname:b;k==="/"&&(k="");var E=y?.pathname.replace(k||"","");if(!(y&&E&&j1.some(R=>E.indexOf(R)===0)))return m})((g=(h=p).requestHeaders,Y(g)||K(Object.keys(g??{}),m=>{F1.includes(m.toLowerCase())&&(g[m]=Xl)}),h),r.api_host));var h,g},c=Ze(r.session_recording.maskNetworkRequestFn);return c&&Ze(r.session_recording.maskCapturedNetworkRequestFn)&&O.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(r.session_recording.maskCapturedNetworkRequestFn=p=>{var h=r.session_recording.maskNetworkRequestFn({url:p.name});return C(C({},p),{},{name:h?.url})}),s.maskRequestFn=Ze(r.session_recording.maskCapturedNetworkRequestFn)?p=>{var h,g,m,b=d(p);return b&&(h=(g=(m=r.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,b))!==null&&h!==void 0?h:void 0}:p=>function(h){if(!F(h))return h.requestBody=ch(h.requestBody,"Request"),h.responseBody=ch(h.responseBody,"Response"),h}(d(p)),C(C(C({},ao),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function ht(r,e,t,i,n){return e>t&&(O.warn("min cannot be greater than max."),e=t),Oe(r)?r>t?(i&&O.warn(i+" cannot be greater than max: "+t+". Using max value instead."),t):r<e?(i&&O.warn(i+" cannot be less than min: "+e+". Using min value instead."),e):r:(i&&O.warn(i+" must be a number. using max or fallback. max: "+t+", fallback: "+n),ht(n||t,e,t,i))}var Kl=class{constructor(e){var t,i,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(this,"bucketSize",100),A(this,"refillRate",10),A(this,"mutationBuckets",{}),A(this,"loggedTracker",{}),A(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(s=>{this.mutationBuckets[s]=this.mutationBuckets[s]+this.refillRate,this.mutationBuckets[s]>=this.bucketSize&&delete this.mutationBuckets[s]})}),A(this,"getNodeOrRelevantParent",s=>{var o=this.rrweb.mirror.getNode(s);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[this.rrweb.mirror.getId(l),l]}return[s,o]}),A(this,"numberOfChanges",s=>{var o,l,a,u,d,c,p,h;return((o=(l=s.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((a=(u=s.attributes)===null||u===void 0?void 0:u.length)!==null&&a!==void 0?a:0)+((d=(c=s.texts)===null||c===void 0?void 0:c.length)!==null&&d!==void 0?d:0)+((p=(h=s.adds)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)}),A(this,"throttleMutations",s=>{if(s.type!==3||s.data.source!==0)return s;var o=s.data,l=this.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(u=>{var d,c,p,[h,g]=this.getNodeOrRelevantParent(u.id);return this.mutationBuckets[h]===0?!1:(this.mutationBuckets[h]=(d=this.mutationBuckets[h])!==null&&d!==void 0?d:this.bucketSize,this.mutationBuckets[h]=Math.max(this.mutationBuckets[h]-1,0),this.mutationBuckets[h]===0&&(this.loggedTracker[h]||(this.loggedTracker[h]=!0,(c=(p=this.options).onBlockedNode)===null||c===void 0||c.call(p,h,g))),u)}));var a=this.numberOfChanges(o);return a!==0||l===a?s:void 0}),this.rrweb=e,this.options=n,this.refillRate=ht((t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=ht((i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},et=Uint8Array,Le=Uint16Array,fi=Uint32Array,Du=new et([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]),ju=new et([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]),dh=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vf=function(r,e){for(var t=new Le(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var n=new fi(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)n[s]=s-t[i]<<5|i;return[t,n]},_f=vf(Du,2),U1=_f[0],Yl=_f[1];U1[28]=258,Yl[258]=28;for(Ql=vf(ju,0)[1],So=new Le(32768),ee=0;ee<32768;++ee)Bt=(43690&ee)>>>1|(21845&ee)<<1,Bt=(61680&(Bt=(52428&Bt)>>>2|(13107&Bt)<<2))>>>4|(3855&Bt)<<4,So[ee]=((65280&Bt)>>>8|(255&Bt)<<8)>>>1;var Bt,Ql,So,ee,vn=function(r,e,t){for(var i=r.length,n=0,s=new Le(e);n<i;++n)++s[r[n]-1];var o,l=new Le(e);for(n=0;n<e;++n)l[n]=l[n-1]+s[n-1]<<1;if(t){o=new Le(1<<e);var a=15-e;for(n=0;n<i;++n)if(r[n])for(var u=n<<4|r[n],d=e-r[n],c=l[r[n]-1]++<<d,p=c|(1<<d)-1;c<=p;++c)o[So[c]>>>a]=u}else for(o=new Le(i),n=0;n<i;++n)o[n]=So[l[r[n]-1]++]>>>15-r[n];return o},kr=new et(288);for(ee=0;ee<144;++ee)kr[ee]=8;for(ee=144;ee<256;++ee)kr[ee]=9;for(ee=256;ee<280;++ee)kr[ee]=7;for(ee=280;ee<288;++ee)kr[ee]=8;var $o=new et(32);for(ee=0;ee<32;++ee)$o[ee]=5;var B1=vn(kr,9,0),q1=vn($o,5,0),yf=function(r){return(r/8>>0)+(7&r&&1)},bf=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof Le?Le:r instanceof fi?fi:et)(t-e);return i.set(r.subarray(e,t)),i},kt=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},an=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},kl=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});var n=t.length,s=t.slice();if(!n)return[new et(0),0];if(n==1){var o=new et(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(R,q){return R.f-q.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],u=0,d=1,c=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};d!=n-1;)l=t[t[u].f<t[c].f?u++:c++],a=t[u!=d&&t[u].f<t[c].f?u++:c++],t[d++]={s:-1,f:l.f+a.f,l,r:a};var p=s[0].s;for(i=1;i<n;++i)s[i].s>p&&(p=s[i].s);var h=new Le(p+1),g=eu(t[d-1],h,0);if(g>e){i=0;var m=0,b=g-e,x=1<<b;for(s.sort(function(R,q){return h[q.s]-h[R.s]||R.f-q.f});i<n;++i){var y=s[i].s;if(!(h[y]>e))break;m+=x-(1<<g-h[y]),h[y]=e}for(m>>>=b;m>0;){var k=s[i].s;h[k]<e?m-=1<<e-h[k]++-1:++i}for(;i>=0&&m;--i){var E=s[i].s;h[E]==e&&(--h[E],++m)}g=e}return[new et(h),g]},eu=function(r,e,t){return r.s==-1?Math.max(eu(r.l,e,t+1),eu(r.r,e,t+1)):e[r.s]=t},ph=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Le(++e),i=0,n=r[0],s=1,o=function(a){t[i++]=a},l=1;l<=e;++l)if(r[l]==n&&l!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=r[l]}return[t.subarray(0,i),e]},ln=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},tu=function(r,e,t){var i=t.length,n=yf(e+2);r[n]=255&i,r[n+1]=i>>>8,r[n+2]=255^r[n],r[n+3]=255^r[n+1];for(var s=0;s<i;++s)r[n+s+4]=t[s];return 8*(n+4+i)},hh=function(r,e,t,i,n,s,o,l,a,u,d){kt(e,d++,t),++n[256];for(var c=kl(n,15),p=c[0],h=c[1],g=kl(s,15),m=g[0],b=g[1],x=ph(p),y=x[0],k=x[1],E=ph(m),R=E[0],q=E[1],U=new Le(19),P=0;P<y.length;++P)U[31&y[P]]++;for(P=0;P<R.length;++P)U[31&R[P]]++;for(var B=kl(U,7),W=B[0],xe=B[1],ce=19;ce>4&&!W[dh[ce-1]];--ce);var je,Z,X,de,Ne=u+5<<3,He=ln(n,kr)+ln(s,$o)+o,ae=ln(n,p)+ln(s,m)+o+14+3*ce+ln(U,W)+(2*U[16]+3*U[17]+7*U[18]);if(Ne<=He&&Ne<=ae)return tu(e,d,r.subarray(a,a+u));if(kt(e,d,1+(ae<He)),d+=2,ae<He){je=vn(p,h,0),Z=p,X=vn(m,b,0),de=m;var Se=vn(W,xe,0);for(kt(e,d,k-257),kt(e,d+5,q-1),kt(e,d+10,ce-4),d+=14,P=0;P<ce;++P)kt(e,d+3*P,W[dh[P]]);d+=3*ce;for(var $e=[y,R],ie=0;ie<2;++ie){var _e=$e[ie];for(P=0;P<_e.length;++P){var Me=31&_e[P];kt(e,d,Se[Me]),d+=W[Me],Me>15&&(kt(e,d,_e[P]>>>5&127),d+=_e[P]>>>12)}}}else je=B1,Z=kr,X=q1,de=$o;for(P=0;P<l;++P)if(i[P]>255){Me=i[P]>>>18&31,an(e,d,je[Me+257]),d+=Z[Me+257],Me>7&&(kt(e,d,i[P]>>>23&31),d+=Du[Me]);var Er=31&i[P];an(e,d,X[Er]),d+=de[Er],Er>3&&(an(e,d,i[P]>>>5&8191),d+=ju[Er])}else an(e,d,je[i[P]]),d+=Z[i[P]];return an(e,d,je[256]),d+Z[256]},H1=new fi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),z1=function(){for(var r=new fi(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r}(),V1=function(){var r=4294967295;return{p:function(e){for(var t=r,i=0;i<e.length;++i)t=z1[255&t^e[i]]^t>>>8;r=t},d:function(){return 4294967295^r}}},W1=function(r,e,t,i,n){return function(s,o,l,a,u,d){var c=s.length,p=new et(a+c+5*(1+Math.floor(c/7e3))+u),h=p.subarray(a,p.length-u),g=0;if(!o||c<8)for(var m=0;m<=c;m+=65535){var b=m+65535;b<c?g=tu(h,g,s.subarray(m,b)):(h[m]=d,g=tu(h,g,s.subarray(m,c)))}else{for(var x=H1[o-1],y=x>>>13,k=8191&x,E=(1<<l)-1,R=new Le(32768),q=new Le(E+1),U=Math.ceil(l/3),P=2*U,B=function(Go){return(s[Go]^s[Go+1]<<U^s[Go+2]<<P)&E},W=new fi(25e3),xe=new Le(288),ce=new Le(32),je=0,Z=0,X=(m=0,0),de=0,Ne=0;m<c;++m){var He=B(m),ae=32767&m,Se=q[He];if(R[ae]=Se,q[He]=ae,de<=m){var $e=c-m;if((je>7e3||X>24576)&&$e>423){g=hh(s,h,0,W,xe,ce,Z,X,Ne,m-Ne,g),X=je=Z=0,Ne=m;for(var ie=0;ie<286;++ie)xe[ie]=0;for(ie=0;ie<30;++ie)ce[ie]=0}var _e=2,Me=0,Er=k,Tt=ae-Se&32767;if($e>2&&He==B(m-Tt))for(var Xf=Math.min(y,$e)-1,Kf=Math.min(32767,m),Yf=Math.min(258,$e);Tt<=Kf&&--Er&&ae!=Se;){if(s[m+_e]==s[m+_e-Tt]){for(var Mt=0;Mt<Yf&&s[m+Mt]==s[m+Mt-Tt];++Mt);if(Mt>_e){if(_e=Mt,Me=Tt,Mt>Xf)break;var Qf=Math.min(Tt,Mt-2),Ku=0;for(ie=0;ie<Qf;++ie){var Wo=m-Tt+ie+32768&32767,Yu=Wo-R[Wo]+32768&32767;Yu>Ku&&(Ku=Yu,Se=Wo)}}}Tt+=(ae=Se)-(Se=R[ae])+32768&32767}if(Me){W[X++]=268435456|Yl[_e]<<18|Ql[Me];var Qu=31&Yl[_e],ec=31&Ql[Me];Z+=Du[Qu]+ju[ec],++xe[257+Qu],++ce[ec],de=m+_e,++je}else W[X++]=s[m],++xe[s[m]]}}g=hh(s,h,d,W,xe,ce,Z,X,Ne,m-Ne,g)}return bf(p,0,a+yf(g)+u)}(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!n)},ru=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},G1=function(r,e){var t=e.filename;if(r[0]=31,r[1]=139,r[2]=8,r[8]=e.level<2?4:e.level==9?2:0,r[9]=3,e.mtime!=0&&ru(r,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){r[3]=8;for(var i=0;i<=t.length;++i)r[i+10]=t.charCodeAt(i)}},Z1=function(r){return 10+(r.filename&&r.filename.length+1||0)};function wf(r,e){e===void 0&&(e={});var t=V1(),i=r.length;t.p(r);var n=W1(r,e,Z1(e),8),s=n.length;return G1(n,e),ru(n,s-8,t.d()),ru(n,s-4,i),n}function xf(r,e){var t=r.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var i=new et(r.length+(r.length>>>1)),n=0,s=function(u){i[n++]=u},o=0;o<t;++o){if(n+5>i.length){var l=new et(n+8+(t-o<<1));l.set(i),i=l}var a=r.charCodeAt(o);a<128||e?s(a):a<2048?(s(192|a>>>6),s(128|63&a)):a>55295&&a<57344?(s(240|(a=65536+(1047552&a)|1023&r.charCodeAt(++o))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return bf(i,0,n)}var gn="[SessionRecording]",Ae=Fe(gn),J1=3e5,X1=[ot.MouseMove,ot.MouseInteraction,ot.Scroll,ot.ViewportResize,ot.Input,ot.TouchMove,ot.MediaInteraction,ot.Drag],fh=r=>({rrwebMethod:r,enqueuedAt:Date.now(),attempt:1});function fr(r){return function(e,t){for(var i="",n=0;n<e.length;){var s=e[n++];s<128||t?i+=String.fromCharCode(s):s<224?i+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?i+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,i+=String.fromCharCode(55296|s>>10,56320|1023&s))}return i}(wf(xf(JSON.stringify(r))),!0)}function gh(r){return r.type===Et.Custom&&r.data.tag==="sessionIdle"}function mh(r,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(r))}var iu=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return H==null||(e=H.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(gn+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return this.triggerStatus==="trigger_pending"?6e4:(e=(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:J1}get isSampled(){var e=this.instance.get_property(pn);return br(e)?e:null}get sessionDuration(){var e,t,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((t=this.buffer)===null||t===void 0?void 0:t.data.length)-1],{sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(Pl),t=!this.instance.config.disable_session_recording;return v&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(Vp),t=this.instance.config.enable_recording_console_log;return t??e}get canvasRecording(){var e,t,i,n,s,o,l=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(Gp),u=(e=(t=l?.recordCanvas)!==null&&t!==void 0?t:a?.enabled)!==null&&e!==void 0&&e,d=(i=(n=l?.canvasFps)!==null&&n!==void 0?n:a?.fps)!==null&&i!==void 0?i:0,c=(s=(o=l?.canvasQuality)!==null&&o!==void 0?o:a?.quality)!==null&&s!==void 0?s:0;return{enabled:u,fps:ht(d,0,12,"canvas recording fps"),quality:ht(c,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,i=this.instance.get_property(Wp),n={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordBody},s=n?.recordHeaders||i?.recordHeaders,o=n?.recordBody||i?.recordBody,l=le(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(br(l)?l:i?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(Zp);return Oe(e)?e:null}get minimumDuration(){var e=this.instance.get_property(Jp);return Oe(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":Y(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":br(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return this._urlTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(_l))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return this._eventTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(yl))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",t=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(A(this,"queuedRRWebEvents",[]),A(this,"isIdle",!1),A(this,"_linkedFlagSeen",!1),A(this,"_lastActivityTimestamp",Date.now()),A(this,"_linkedFlag",null),A(this,"_removePageViewCaptureHook",void 0),A(this,"_onSessionIdListener",void 0),A(this,"_persistDecideOnSessionListener",void 0),A(this,"_samplingSessionListener",void 0),A(this,"_urlTriggers",[]),A(this,"_urlBlocklist",[]),A(this,"_urlBlocked",!1),A(this,"_eventTriggers",[]),A(this,"_removeEventTriggerCaptureHook",void 0),A(this,"_forceAllowLocalhostNetworkCapture",!1),A(this,"_onBeforeUnload",()=>{this._flushBuffer()}),A(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),A(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),A(this,"_onVisibilityChange",()=>{if(L!=null&&L.visibilityState){var n="window "+L.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Ae.error("started without valid sessionManager"),new Error(gn+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(gn+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:t,windowId:i}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=i,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Ae.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),v?.addEventListener("beforeunload",this._onBeforeUnload),v?.addEventListener("offline",this._onOffline),v?.addEventListener("online",this._onOnline),v?.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Y(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var i=t!=null&&t.properties.$current_url?this._maskUrl(t?.properties.$current_url):"";if(!i)return;this._tryAddCustomEvent("$pageview",{href:i})}}catch(n){Ae.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((t,i,n)=>{var s,o,l,a;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:t,windowId:i,changeReason:n}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(yl),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(_l))}))):this.stopRecording()}stopRecording(){var e,t,i,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,v?.removeEventListener("beforeunload",this._onBeforeUnload),v?.removeEventListener("offline",this._onOffline),v?.removeEventListener("online",this._onOnline),v?.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(e=this._removePageViewCaptureHook)===null||e===void 0||e.call(this),this._removePageViewCaptureHook=void 0,(t=this._removeEventTriggerCaptureHook)===null||t===void 0||t.call(this),this._removeEventTriggerCaptureHook=void 0,(i=this._onSessionIdListener)===null||i===void 0||i.call(this),this._onSessionIdListener=void 0,(n=this._samplingSessionListener)===null||n===void 0||n.call(this),this._samplingSessionListener=void 0,Ae.info("stopped"))}makeSamplingDecision(e){var t,i=this.sessionId!==e,n=this.sampleRate;if(Oe(n)){var s,o=this.isSampled,l=i||!br(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):Ae.warn("Sample rate (".concat(n,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:n,isSampled:s})),(t=this.instance.persistence)===null||t===void 0||t.register({[pn]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[pn]:null})}}onRemoteConfig(e){var t,i,n,s,o,l;if(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(l=e.sessionRecording)===null||l===void 0?void 0:l.endpoint),this._setupSampling(),!Y(this._linkedFlag)&&!this._linkedFlagSeen){var a=Ee(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,u=Ee(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((d,c)=>{var p=le(c)&&a in c,h=u?c[a]===u:p;h&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:u}),this._linkedFlagSeen=h})}(n=e.sessionRecording)!==null&&n!==void 0&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),(s=e.sessionRecording)!==null&&s!==void 0&&s.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),(o=e.sessionRecording)!==null&&o!==void 0&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Oe(this.sampleRate)&&Y(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistRemoteConfig(e){if(this.instance.persistence){var t,i=this.instance.persistence,n=()=>{var s,o,l,a,u,d,c,p,h=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,g=Y(h)?null:parseFloat(h),m=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;i.register({[Pl]:!!e.sessionRecording,[Vp]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[Wp]:C({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[Gp]:{enabled:(u=e.sessionRecording)===null||u===void 0?void 0:u.recordCanvas,fps:(d=e.sessionRecording)===null||d===void 0?void 0:d.canvasFps,quality:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasQuality},[Zp]:g,[Jp]:F(m)?null:m,[Xp]:(p=e.sessionRecording)===null||p===void 0?void 0:p.scriptConfig})};n(),(t=this._persistDecideOnSessionListener)===null||t===void 0||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(n)}}log(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!F(Object.assign)&&!F(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,i;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=H.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,this.scriptName,n=>{if(n)return Ae.error("could not load recorder",n);this._onScriptLoaded()}),Ae.info("starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,i;return((e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0||(i=t.get_property(Xp))===null||i===void 0?void 0:i.script)||"recorder"}isInteractiveEvent(e){var t;return e.type===3&&X1.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var{windowId:n,sessionId:s}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==s,l=this.windowId!==n;this.windowId=n,this.sessionId=s,o||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Ae.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(fh(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(fh(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var e,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this.instance.config.session_recording;for(var[n,s]of Object.entries(i||{}))n in t&&(n==="maskInputOptions"?t.maskInputOptions=C({password:!0},s):t[n]=s);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new Kl(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(l,a)=>{var u="Too many mutations on node '".concat(l,"'. Rate limiting. This could be due to SVG animations or something similar");Ae.info(u,{node:a}),this.log(gn+" "+u,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(C({emit:l=>{this.onRRwebEmit(l)},plugins:o},t)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:o.map(l=>l?.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Ae.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}}_gatherRRWebPlugins(){var e,t,i,n,s=[],o=(e=H.__PosthogExtensions__)===null||e===void 0||(t=e.rrwebPlugins)===null||t===void 0?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var l=(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ze(l)&&(!m1.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(N1(this.instance.config,this.networkPayloadCapture))):Ae.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&le(e)){if(e.type===Et.Meta){var i=this._maskUrl(e.data.href);if(this._lastHref=i,!i)return;e.data.href=i}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(c){return c.type===Et.Custom&&c.data.tag==="recording paused"}(e)){e.type===Et.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Et.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var s=function(c){var p=c;if(p&&le(p)&&p.type===6&&le(p.data)&&p.data.plugin==="rrweb/console@1"){p.data.payload.payload.length>10&&(p.data.payload.payload=p.data.payload.payload.slice(0,10),p.data.payload.payload.push("...[truncated]"));for(var h=[],g=0;g<p.data.payload.payload.length;g++)p.data.payload.payload[g]&&p.data.payload.payload[g].length>2e3?h.push(p.data.payload.payload[g].slice(0,2e3)+"...[truncated]"):h.push(p.data.payload.payload[g]);return p.data.payload.payload=h,c}return c}(n);if(this._updateWindowAndSessionIds(s),!this.isIdle||gh(s)){if(gh(s)){var o=s.data.payload;if(o){var l=o.lastActivityTimestamp,a=o.threshold;s.timestamp=l+a}}var u=(t=this.instance.config.session_recording.compress_events)===null||t===void 0||t?function(c){if(Co(c)<1024)return c;try{if(c.type===Et.FullSnapshot)return C(C({},c),{},{data:fr(c.data),cv:"2024-10"});if(c.type===Et.IncrementalSnapshot&&c.data.source===ot.Mutation)return C(C({},c),{},{cv:"2024-10",data:C(C({},c.data),{},{texts:fr(c.data.texts),attributes:fr(c.data.attributes),removes:fr(c.data.removes),adds:fr(c.data.adds)})});if(c.type===Et.IncrementalSnapshot&&c.data.source===ot.StyleSheetRule)return C(C({},c),{},{cv:"2024-10",data:C(C({},c.data),{},{adds:fr(c.data.adds),removes:fr(c.data.removes)})})}catch(p){Ae.error("could not compress event - will use uncompressed event",p)}return c}(s):s,d={$snapshot_bytes:Co(u),$snapshot_data:u,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(d):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&v){var e=this._maskUrl(v.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this._tryRRWebMethod(t)})}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,n={url:e};return(i=n=t.maskNetworkRequestFn(n))===null||i===void 0?void 0:i.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,i=Oe(t)&&t>=0,n=Oe(e)&&i&&t<e;return this.status==="buffering"||this.status==="paused"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Wl(this.buffer).forEach(s=>{this._captureSnapshot({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId,$lib:"web",$lib_version:$t.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t,i=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(v!==void 0&&v.location.href){var e=v.location.href,t=this.status==="paused",i=mh(e,this._urlBlocklist);i&&!t?this._pauseRecording():!i&&t&&this._resumeRecording(),mh(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,i;this.triggerStatus==="trigger_pending"&&((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register({[e==="url"?_l:yl]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){this.status!=="paused"&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Ae.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this.status==="paused"&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Ae.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&Y(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(t){Ae.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;(e=this.instance.persistence)===null||e===void 0||e.register({[pn]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Ae.info(e.replace("_"," "),t),V(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},gr=Fe("[RemoteConfig]"),nu=class{constructor(e){this.instance=e}get remoteConfig(){var e,t;return(e=H._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(t=e[this.instance.config.token])===null||t===void 0?void 0:t.config}_loadRemoteConfigJs(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.loadExternalDependency?(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"remote-config",()=>e(this.remoteConfig)):(gr.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return gr.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void gr.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(e=>{if(!e)return gr.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(t=>{this.onRemoteConfig(t)});this.onRemoteConfig(e)})}catch(e){gr.error("Error loading remote config",e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),e.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):gr.info("__preview_remote_config is disabled. Logging config instead",e):gr.error("Failed to fetch remote config from PostHog.")}},St,K1=v!=null&&v.location?xo(v.location.hash,"__posthog")||xo(location.hash,"state"):null,vh="_postHogToolbarParams",_h=Fe("[Toolbar]");(function(r){r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED"})(St||(St={}));var su=class{constructor(e){this.instance=e}setToolbarState(e){H.ph_toolbar_state=e}getToolbarState(){var e;return(e=H.ph_toolbar_state)!==null&&e!==void 0?e:St.UNINITIALIZED}maybeLoadToolbar(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!v||!L)return!1;i=(e=i)!==null&&e!==void 0?e:v.location,s=(t=s)!==null&&t!==void 0?t:v.history;try{if(!n){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}n=v?.localStorage}var o,l=K1||xo(i.hash,"__posthog")||xo(i.hash,"state"),a=l?Up(()=>JSON.parse(atob(decodeURIComponent(l))))||Up(()=>JSON.parse(decodeURIComponent(l))):null;return a&&a.action==="ph_authorize"?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?i.hash=a.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(n.getItem(vh)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){var t=H.ph_load_toolbar||H.ph_load_editor;!Y(t)&&Ze(t)?t(e,this.instance):_h.warn("No toolbar load function found")}loadToolbar(e){var t=!(L==null||!L.getElementById(Hh));if(!v||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=C(C({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(v.localStorage.setItem(vh,JSON.stringify(C(C({},n),{},{source:void 0}))),this.getToolbarState()===St.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===St.UNINITIALIZED){var s,o;this.setToolbarState(St.LOADING),(s=H.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return _h.error("[Toolbar] Failed to load",l),void this.setToolbarState(St.UNINITIALIZED);this.setToolbarState(St.LOADED),this._callLoadToolbar(n)}),It(v,"turbolinks:load",()=>{this.setToolbarState(St.UNINITIALIZED),this.loadToolbar(n)})}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}},ou=class{constructor(e){A(this,"isPaused",!0),A(this,"queue",[]),A(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},t=Object.values(e),i=[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)];i.map(n=>{this.sendRequest(C(C({},n),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),i=function(s){var o=t[s],l=new Date().getTime();o.data&&fe(o.data)&&K(o.data,a=>{a.offset=Math.abs(a.timestamp-l),delete a.timestamp}),e.sendRequest(o)};for(var n in t)i(n)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return K(this.queue,t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;F(e[s])&&(e[s]=C(C({},n),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(n.data)}),this.queue=[],e}},Y1=function(r){var e,t,i,n,s="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,`
689
874
  `).replace(/\r/g,`
690
- `)).length,n=0;n<i;n++){var o=r.charCodeAt(n),l=null;o<128?t++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Vt(l)||(t>e&&(s+=r.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=r.substring(e,r.length)),s},W1=!!_l||!!vl,hh="text/plain",_o=(r,e)=>{var[t,i]=r.split("?"),n=k({},e);i?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=c1(n);return s=s?(i?i+"&":"")+s:i,"".concat(t,"?").concat(s)},Ys=(r,e)=>JSON.stringify(r,(t,i)=>typeof i=="bigint"?i.toString():i,e),hl=r=>{var{data:e,compression:t}=r;if(e){if(t===ct.GZipJS){var i=gf(mf(Ys(e)),{mtime:0}),n=new Blob([i],{type:hh});return{contentType:hh,body:n,estimatedSize:n.size}}if(t===ct.Base64){var s=function(a){var u,d,c,p,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,y=0,w="",_=[];if(!a)return a;a=V1(a);do u=(h=a.charCodeAt(m++)<<16|a.charCodeAt(m++)<<8|a.charCodeAt(m++))>>18&63,d=h>>12&63,c=h>>6&63,p=63&h,_[y++]=g.charAt(u)+g.charAt(d)+g.charAt(c)+g.charAt(p);while(m<a.length);switch(w=_.join(""),a.length%3){case 1:w=w.slice(0,-2)+"==";break;case 2:w=w.slice(0,-1)+"="}return w}(Ys(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Ys(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=Ys(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},gn=[];vl&&gn.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:n,estimatedSize:s}=(e=hl(r))!==null&&e!==void 0?e:{},o=new Headers;K(r.headers,function(d,c){o.append(c,d)}),i&&o.append("Content-Type",i);var l=r.url,a=null;if(Pp){var u=new Pp;a={signal:u.signal,timeout:setTimeout(()=>u.abort(),r.timeout)}}vl(l,k({method:r?.method||"GET",headers:o,keepalive:r.method==="POST"&&(s||0)<52428.8,body:n,signal:(t=a)===null||t===void 0?void 0:t.signal},r.fetchOptions)).then(d=>d.text().then(c=>{var p,h={statusCode:d.status,text:c};if(d.status===200)try{h.json=JSON.parse(c)}catch(g){O.error(g)}(p=r.callback)===null||p===void 0||p.call(r,h)})).catch(d=>{var c;O.error(d),(c=r.callback)===null||c===void 0||c.call(r,{statusCode:0,text:d})}).finally(()=>a?clearTimeout(a.timeout):null)}}),_l&&gn.push({transport:"XHR",method:r=>{var e,t=new _l;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:n}=(e=hl(r))!==null&&e!==void 0?e:{};K(r.headers,function(s,o){t.setRequestHeader(o,s)}),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var s,o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}(s=r.callback)===null||s===void 0||s.call(r,o)}},t.send(n)}}),Ge!=null&&Ge.sendBeacon&&gn.push({transport:"sendBeacon",method:r=>{var e=_o(r.url,{beacon:"1"});try{var t,{contentType:i,body:n}=(t=hl(r))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:i}):n;Ge.sendBeacon(e,s)}catch{}}});var G1=["retriesPerformedSoFar"],Xl=class{constructor(e){A(this,"isPolling",!1),A(this,"pollIntervalMs",3e3),A(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!F(v)&&"onLine"in v.navigator&&(this.areWeOnline=v.navigator.onLine,v.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),v.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=Ah(e,G1);Oe(t)&&t>0&&(i.url=_o(i.url,{retry_count:t})),this.instance._send_request(k(k({},i),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(k({retriesPerformedSoFar:t},i)):(s=i.callback)===null||s===void 0||s.call(i,n)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var l=3e3*Math.pow(2,o),a=l/2,u=Math.min(18e5,l),d=(Math.random()-.5)*(u-a);return Math.ceil(u+d)}(t),n=Date.now()+i;this.queue.push({retryAt:n,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),O.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var e=Date.now(),t=[],i=this.queue.filter(s=>s.retryAt<e||(t.push(s),!1));if(this.queue=t,i.length>0)for(var{requestOptions:n}of i)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(k(k({},e),{},{transport:"sendBeacon"}))}catch(t){O.error(t)}this.queue=[]}},br,fh=Fe("[SessionId]"),Kl=class{constructor(e,t,i){var n;if(A(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||qt,this._windowIdGenerator=i||qt;var s=this.config.persistence_name||this.config.token,o=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pt(o,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var l=Ce.parse(this._window_id_storage_key),a=Ce.parse(this._primary_window_exists_storage_key);l&&!a?this._windowId=l:Ce.remove(this._window_id_storage_key),Ce.set(this._primary_window_exists_storage_key,!0)}if((n=this.config.bootstrap)!==null&&n!==void 0&&n.sessionID)try{var u=(d=>{var c=d.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),u)}catch(d){fh.error("Invalid sessionID in bootstrap",d)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ce.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ce.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ce.parse(this._window_id_storage_key):null}_setSessionId(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[ao]:[t,e,i]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[ao];return fe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){v?.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&Ce.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var i=t||new Date().getTime(),[n,s,o]=this._getSessionId(),l=this._getWindowId(),a=Oe(o)&&o>0&&Math.abs(i-o)>864e5,u=!1,d=!s,c=!e&&Math.abs(i-n)>this.sessionTimeoutMs;d||c||a?(s=this._sessionIdGenerator(),l=this._windowIdGenerator(),fh.info("new session ID generated",{sessionId:s,windowId:l,changeReason:{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:a}}),o=i,u=!0):l||(l=this._windowIdGenerator(),u=!0);var p=n===0||!e||a?i:n,h=o===0?new Date().getTime():o;return this._setWindowId(l),this._setSessionId(s,p,h),e||this.resetIdleTimer(),u&&this._sessionIdChangedHandlers.forEach(g=>g(s,l,u?{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:a}:void 0)),{sessionId:s,windowId:l,sessionStartTimestamp:h,changeReason:u?{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:n}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}};(function(r){r.US="us",r.EU="eu",r.CUSTOM="custom"})(br||(br={}));var gh="i.posthog.com",Yl=class{constructor(e){A(this,"_regionCache",{}),this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(gh),".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=br.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=br.EU:this._regionCache[this.apiHost]=br.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t&&(t=t[0]==="/"?t:"/".concat(t)),e==="ui")return this.uiHost+t;if(this.region===br.CUSTOM)return this.apiHost+t;var i=gh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},vf="posthog-js";function _f(r){var{organization:e,projectId:t,prefix:i,severityAllowList:n=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=>{var o,l,a,u,d;if(!(n==="*"||n.includes(s.level))||!r.__loaded)return s;s.tags||(s.tags={});var c=r.requestRouter.endpointFor("ui","/project/".concat(r.config.token,"/person/").concat(r.get_distinct_id()));s.tags["PostHog Person URL"]=c,r.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var p=((o=s.exception)===null||o===void 0?void 0:o.values)||[];p.map(g=>{g.stacktrace&&(g.stacktrace.type="raw")});var h={$exception_message:((l=p[0])===null||l===void 0?void 0:l.value)||s.message,$exception_type:(a=p[0])===null||a===void 0?void 0:a.type,$exception_personURL:c,$exception_level:s.level,$exception_list:p,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((u=p[0])===null||u===void 0?void 0:u.value)||s.message,$sentry_exception_type:(d=p[0])===null||d===void 0?void 0:d.type,$sentry_tags:s.tags};return e&&t&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+e+"/issues/?project="+t+"&query="+s.event_id),r.exceptions.sendExceptionEvent(h),s}}var Ql=class{constructor(e,t,i,n,s){this.name=vf,this.setupOnce=function(o){o(_f(e,{organization:t,projectId:i,prefix:n,severityAllowList:s}))}}},mh,yo,nt,fl=Fe("[SegmentIntegration]");function Z1(r,e){var t=r.config.segment;if(!t)return e();(function(i,n){var s=i.config.segment;if(!s)return n();var o=a=>{var u=()=>a.anonymousId()||qt();i.config.get_device_id=u,a.id()&&(i.register({distinct_id:a.id(),$device_id:u()}),i.persistence.set_property(kt,"identified")),n()},l=s.user();"then"in l&&Ze(l.then)?l.then(a=>o(a)):o(l)})(r,()=>{t.register((i=>{Promise&&Promise.resolve||fl.warn("This browser does not have Promise support, and can not use the segment integration");var n=(s,o)=>{var l;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||(fl.info("No userId set, resetting PostHog"),i.reset()),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(fl.info("UserId set, identifying with PostHog"),i.identify(s.event.userId));var a=i._calculate_event_properties(o,(l=s.event.properties)!==null&&l!==void 0?l:{},new Date);return s.event.properties=Object.assign({},a,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>n(s,s.event.event),page:s=>n(s,"$pageview"),identify:s=>n(s,"$identify"),screen:s=>n(s,"$screen")}})(r)).then(()=>{e()})})}var eu=class{constructor(e){this._instance=e}doPageView(e,t){var i,n=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:(i=v?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this._previousPageViewProperties(e,(t=this._currentPageview)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this._currentPageview)===null||e===void 0?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var i=this._currentPageview;if(!i)return{$pageview_id:t};var n={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:a,maxContentHeight:u,lastContentY:d,maxContentY:c}=s;if(!(F(o)||F(l)||F(a)||F(u)||F(d)||F(c))){o=Math.ceil(o),l=Math.ceil(l),a=Math.ceil(a),u=Math.ceil(u),d=Math.ceil(d),c=Math.ceil(c);var p=o<=1?1:pt(l/o,0,1),h=o<=1?1:pt(a/o,0,1),g=u<=1?1:pt(d/u,0,1),m=u<=1?1:pt(c/u,0,1);n=Te(n,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:m})}}return i.pathname&&(n.$prev_pageview_pathname=i.pathname),i.timestamp&&(n.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),n}};(function(r){r.Popover="popover",r.API="api",r.Widget="widget"})(mh||(mh={})),function(r){r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link"}(yo||(yo={})),function(r){r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question"}(nt||(nt={}));var bo=class{constructor(){A(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(i=>i!==t)}}emit(e,t){for(var i of this.events[e]||[])i(t);for(var n of this.events["*"]||[])n(e,t)}},tu=class r{constructor(e){A(this,"_debugEventEmitter",new bo),A(this,"checkStep",(t,i)=>this.checkStepEvent(t,i)&&this.checkStepUrl(t,i)&&this.checkStepElement(t,i)),A(this,"checkStepEvent",(t,i)=>i==null||!i.event||t?.event===i?.event),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!F((e=this.instance)===null||e===void 0?void 0:e._addCaptureHook)){var t;(t=this.instance)===null||t===void 0||t._addCaptureHook((i,n)=>{this.on(i,n)})}}register(e){var t,i;if(!F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(o=>{var l,a;(l=this.actionRegistry)===null||l===void 0||l.add(o),(a=o.steps)===null||a===void 0||a.forEach(u=>{var d;(d=this.actionEvents)===null||d===void 0||d.add(u?.event||"")})}),(i=this.instance)!==null&&i!==void 0&&i.autocapture)){var n,s=new Set;e.forEach(o=>{var l;(l=o.steps)===null||l===void 0||l.forEach(a=>{a!=null&&a.selector&&s.add(a?.selector)})}),(n=this.instance)===null||n===void 0||n.autocapture.setElementSelectors(s)}}on(e,t){var i;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((i=this.actionRegistry)===null||i===void 0?void 0:i.size)>0&&this.actionRegistry.forEach(n=>{this.checkAction(t,n)&&this._debugEventEmitter.emit("actionCaptured",n.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}checkAction(e,t){if(t?.steps==null)return!1;for(var i of t.steps)if(this.checkStep(e,i))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(t!=null&&t.url){var i,n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!n||typeof n!="string"||!r.matchString(n,t?.url,t?.url_matching||"contains"))return!1}return!0}static matchString(e,t,i){switch(i){case"regex":return!!v&&ui(e,t);case"exact":return t===e;case"contains":var n=r.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return ui(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.getElementsList(e).some(s=>!(t!=null&&t.href&&!r.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!r.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!r.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var i,n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(!n||!n.includes(t?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},wn=class r{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter(i=>{var n,s,o,l;return((n=i.conditions)===null||n===void 0?void 0:n.actions)&&((s=i.conditions)===null||s===void 0||(o=s.actions)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0});t.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new tu(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(i=>{this.onAction(i)})),t.forEach(i=>{var n,s,o,l,a,u,d,c,p,h;i.conditions&&(n=i.conditions)!==null&&n!==void 0&&n.actions&&(s=i.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((l=i.conditions)===null||l===void 0||(a=l.actions)===null||a===void 0||(u=a.values)===null||u===void 0?void 0:u.length)>0&&((d=this.actionMatcher)===null||d===void 0||d.register(i.conditions.actions.values),(c=i.conditions)===null||c===void 0||(p=c.actions)===null||p===void 0||(h=p.values)===null||h===void 0||h.forEach(g=>{if(g&&g.name){var m=this.actionToSurveys.get(g.name);m&&m.push(i.id),this.actionToSurveys.set(g.name,m||[i.id])}}))}))}setupEventBasedSurveys(e){var t;e.filter(i=>{var n,s,o,l;return((n=i.conditions)===null||n===void 0?void 0:n.events)&&((s=i.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0}).length!==0&&((t=this.instance)===null||t===void 0||t._addCaptureHook((i,n)=>{this.onEvent(i,n)}),e.forEach(i=>{var n,s,o;(n=i.conditions)===null||n===void 0||(s=n.events)===null||s===void 0||(o=s.values)===null||o===void 0||o.forEach(l=>{if(l&&l.name){var a=this.eventToSurveys.get(l.name);a&&a.push(i.id),this.eventToSurveys.set(l.name,a||[i.id])}})}))}onEvent(e,t){var i,n,s=((i=this.instance)===null||i===void 0||(n=i.persistence)===null||n===void 0?void 0:n.props[Vs])||[];if(r.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,l=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(l){var a=s.indexOf(l);a>=0&&(s.splice(a,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,i,n=((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0?void 0:i.props[Vs])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,i;(t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register({[Vs]:[...new Set(e)]})}getSurveys(){var e,t,i=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[Vs];return i||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};A(wn,"SURVEY_SHOWN_EVENT_NAME","survey shown");var yf,oe,bf,_r,vh,wf,ru,xf,iu={},kf=[],J1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Iu=Array.isArray;function Ht(r,e){for(var t in e)r[t]=e[t];return r}function Cf(r){var e=r.parentNode;e&&e.removeChild(r)}function gl(r,e,t,i,n){var s={type:r,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++bf,__i:-1,__u:0};return n==null&&oe.vnode!=null&&oe.vnode(s),s}function Au(r){return r.children}function no(r,e){this.props=r,this.context=e}function hi(r,e){if(e==null)return r.__?hi(r.__,r.__i+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?hi(r):null}function Sf(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return Sf(r)}}function nu(r){(!r.__d&&(r.__d=!0)&&_r.push(r)&&!wo.__r++||vh!==oe.debounceRendering)&&((vh=oe.debounceRendering)||wf)(wo)}function wo(){var r,e,t,i,n,s,o,l,a;for(_r.sort(ru);r=_r.shift();)r.__d&&(e=_r.length,i=void 0,s=(n=(t=r).__v).__e,l=[],a=[],(o=t.__P)&&((i=Ht({},n)).__v=n.__v+1,oe.vnode&&oe.vnode(i),If(o,i,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??hi(n),!!(32&n.__u),a),i.__.__k[i.__i]=i,Y1(l,i,a),i.__e!=s&&Sf(i)),_r.length>e&&_r.sort(ru));wo.__r=0}function Ef(r,e,t,i,n,s,o,l,a,u,d){var c,p,h,g,m,y=i&&i.__k||kf,w=e.length;for(t.__d=a,X1(t,e,y),a=t.__d,c=0;c<w;c++)(h=t.__k[c])!=null&&typeof h!="boolean"&&typeof h!="function"&&(p=h.__i===-1?iu:y[h.__i]||iu,h.__i=c,If(r,h,p,n,s,o,l,a,u,d),g=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Tu(p.ref,null,h),d.push(h.ref,h.__c||g,h)),m==null&&g!=null&&(m=g),65536&h.__u||p.__k===h.__k?a=$f(h,a,r):typeof h.type=="function"&&h.__d!==void 0?a=h.__d:g&&(a=g.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=a,t.__e=m}function X1(r,e,t){var i,n,s,o,l,a=e.length,u=t.length,d=u,c=0;for(r.__k=[],i=0;i<a;i++)(n=r.__k[i]=(n=e[i])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?gl(null,n,null,null,n):Iu(n)?gl(Au,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?gl(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=r,n.__b=r.__b+1,l=K1(n,t,o=i+c,d),n.__i=l,s=null,l!==-1&&(d--,(s=t[l])&&(s.__u|=131072)),s==null||s.__v===null?(l==-1&&c--,typeof n.type!="function"&&(n.__u|=65536)):l!==o&&(l===o+1?c++:l>o?d>a-o?c+=l-o:c--:c=l<o&&l==o-1?l-o:0,l!==i+c&&(n.__u|=65536))):(s=t[i])&&s.key==null&&s.__e&&(s.__e==r.__d&&(r.__d=hi(s)),su(s,s,!1),t[i]=null,d--);if(d)for(i=0;i<u;i++)(s=t[i])!=null&&!(131072&s.__u)&&(s.__e==r.__d&&(r.__d=hi(s)),su(s,s))}function $f(r,e,t){var i,n;if(typeof r.type=="function"){for(i=r.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=r,e=$f(i[n],e,t));return e}return r.__e!=e&&(t.insertBefore(r.__e,e||null),e=r.__e),e&&e.nextSibling}function K1(r,e,t,i){var n=r.key,s=r.type,o=t-1,l=t+1,a=e[t];if(a===null||a&&n==a.key&&s===a.type)return t;if(i>(a!=null&&!(131072&a.__u)?1:0))for(;o>=0||l<e.length;){if(o>=0){if((a=e[o])&&!(131072&a.__u)&&n==a.key&&s===a.type)return o;o--}if(l<e.length){if((a=e[l])&&!(131072&a.__u)&&n==a.key&&s===a.type)return l;l++}}return-1}function _h(r,e,t){e[0]==="-"?r.setProperty(e,t??""):r[e]=t==null?"":typeof t!="number"||J1.test(e)?t:t+"px"}function Qs(r,e,t,i,n){var s;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof i=="string"&&(r.style.cssText=i=""),i)for(e in i)t&&e in t||_h(r.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||_h(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+s]=t,t?i?t.u=i.u:(t.u=Date.now(),r.addEventListener(e,s?bh:yh,s)):r.removeEventListener(e,s?bh:yh,s);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in r)try{r[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?r.removeAttribute(e):r.setAttribute(e,t))}}function yh(r){var e=this.l[r.type+!1];if(r.t){if(r.t<=e.u)return}else r.t=Date.now();return e(oe.event?oe.event(r):r)}function bh(r){return this.l[r.type+!0](oe.event?oe.event(r):r)}function If(r,e,t,i,n,s,o,l,a,u){var d,c,p,h,g,m,y,w,_,x,S,R,B,N,P,U=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),s=[l=e.__e=t.__e]),(d=oe.__b)&&d(e);e:if(typeof U=="function")try{if(w=e.props,_=(d=U.contextType)&&i[d.__c],x=d?_?_.props.value:d.__:i,t.__c?y=(c=e.__c=t.__c).__=c.__E:("prototype"in U&&U.prototype.render?e.__c=c=new U(w,x):(e.__c=c=new no(w,x),c.constructor=U,c.render=em),_&&_.sub(c),c.props=w,c.state||(c.state={}),c.context=x,c.__n=i,p=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),U.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=Ht({},c.__s)),Ht(c.__s,U.getDerivedStateFromProps(w,c.__s))),h=c.props,g=c.state,c.__v=e,p)U.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(U.getDerivedStateFromProps==null&&w!==h&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(w,x),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(w,c.__s,x)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(c.props=w,c.state=c.__s,c.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(W){W&&(W.__=e)}),S=0;S<c._sb.length;S++)c.__h.push(c._sb[S]);c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(w,c.__s,x),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(h,g,m)})}if(c.context=x,c.props=w,c.__P=r,c.__e=!1,R=oe.__r,B=0,"prototype"in U&&U.prototype.render){for(c.state=c.__s,c.__d=!1,R&&R(e),d=c.render(c.props,c.state,c.context),N=0;N<c._sb.length;N++)c.__h.push(c._sb[N]);c._sb=[]}else do c.__d=!1,R&&R(e),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++B<25);c.state=c.__s,c.getChildContext!=null&&(i=Ht(Ht({},i),c.getChildContext())),p||c.getSnapshotBeforeUpdate==null||(m=c.getSnapshotBeforeUpdate(h,g)),Ef(r,Iu(P=d!=null&&d.type===Au&&d.key==null?d.props.children:d)?P:[P],e,t,i,n,s,o,l,a,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),y&&(c.__E=c.__=null)}catch(W){e.__v=null,a||s!=null?(e.__e=l,e.__u|=a?160:32,s[s.indexOf(l)]=null):(e.__e=t.__e,e.__k=t.__k),oe.__e(W,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Q1(t.__e,e,t,i,n,s,o,a,u);(d=oe.diffed)&&d(e)}function Y1(r,e,t){e.__d=void 0;for(var i=0;i<t.length;i++)Tu(t[i],t[++i],t[++i]);oe.__c&&oe.__c(e,r),r.some(function(n){try{r=n.__h,n.__h=[],r.some(function(s){s.call(n)})}catch(s){oe.__e(s,n.__v)}})}function Q1(r,e,t,i,n,s,o,l,a){var u,d,c,p,h,g,m,y=t.props,w=e.props,_=e.type;if(_==="svg"&&(n=!0),s!=null){for(u=0;u<s.length;u++)if((h=s[u])&&"setAttribute"in h==!!_&&(_?h.localName===_:h.nodeType===3)){r=h,s[u]=null;break}}if(r==null){if(_===null)return document.createTextNode(w);r=n?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,w.is&&w),s=null,l=!1}if(_===null)y===w||l&&r.data===w||(r.data=w);else{if(s=s&&yf.call(r.childNodes),y=t.props||iu,!l&&s!=null)for(y={},u=0;u<r.attributes.length;u++)y[(h=r.attributes[u]).name]=h.value;for(u in y)h=y[u],u=="children"||(u=="dangerouslySetInnerHTML"?c=h:u==="key"||u in w||Qs(r,u,null,h,n));for(u in w)h=w[u],u=="children"?p=h:u=="dangerouslySetInnerHTML"?d=h:u=="value"?g=h:u=="checked"?m=h:u==="key"||l&&typeof h!="function"||y[u]===h||Qs(r,u,h,y[u],n);if(d)l||c&&(d.__html===c.__html||d.__html===r.innerHTML)||(r.innerHTML=d.__html),e.__k=[];else if(c&&(r.innerHTML=""),Ef(r,Iu(p)?p:[p],e,t,i,n&&_!=="foreignObject",s,o,s?s[0]:t.__k&&hi(t,0),l,a),s!=null)for(u=s.length;u--;)s[u]!=null&&Cf(s[u]);l||(u="value",g!==void 0&&(g!==r[u]||_==="progress"&&!g||_==="option"&&g!==y[u])&&Qs(r,u,g,y[u],!1),u="checked",m!==void 0&&m!==r[u]&&Qs(r,u,m,y[u],!1))}return r}function Tu(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(i){oe.__e(i,t)}}function su(r,e,t){var i,n;if(oe.unmount&&oe.unmount(r),(i=r.ref)&&(i.current&&i.current!==r.__e||Tu(i,null,e)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){oe.__e(s,e)}i.base=i.__P=null,r.__c=void 0}if(i=r.__k)for(n=0;n<i.length;n++)i[n]&&su(i[n],e,t||typeof r.type!="function");t||r.__e==null||Cf(r.__e),r.__=r.__e=r.__d=void 0}function em(r,e,t){return this.constructor(r,t)}yf=kf.slice,oe={__e:function(r,e,t,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(r)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(r,i||{}),o=n.__d),o)return n.__E=n}catch(l){r=l}throw r}},bf=0,no.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ht({},this.state),typeof r=="function"&&(r=r(Ht({},t),this.props)),r&&Ht(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),nu(this))},no.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),nu(this))},no.prototype.render=Au,_r=[],wf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ru=function(r,e){return r.__v.__b-e.__v.__b},wo.__r=0,xf=0;(function(r,e){var t={__c:e="__cC"+xf++,__:r,Consumer:function(i,n){return i.children(n)},Provider:function(i){var n,s;return this.getChildContext||(n=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&n.some(function(l){l.__e=!0,nu(l)})},this.sub=function(o){n.push(o);var l=o.componentWillUnmount;o.componentWillUnmount=function(){n.splice(n.indexOf(o),1),l&&l.call(o)}}),i.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}});var on=Fe("[Surveys]"),tm={icontains:r=>!!v&&v.location.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:r=>!!v&&v.location.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:r=>!!v&&ui(v.location.href,r),not_regex:r=>!!v&&!ui(v.location.href,r),exact:r=>v?.location.href===r,is_not:r=>v?.location.href!==r},ou=class{constructor(e){this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var t=[],i=0;i<localStorage.length;i++){var n=localStorage.key(i);n!=null&&n.startsWith("seenSurvey_")&&t.push(n)}return t})();e.forEach(t=>localStorage.removeItem(t))}loadIfEnabled(){var e,t,i,n=H==null||(e=H.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new wn(this.instance)),(t=H.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,"surveys",s=>{var o,l;if(s)return on.error("Could not load surveys script",s);this._surveyManager=(o=H.__PosthogExtensions__)===null||o===void 0||(l=o.generateSurveys)===null||l===void 0?void 0:l.call(o,this.instance)}))}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new wn(this.instance));var i=this.instance.get_property(xl);if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:n=>{var s;if(n.statusCode!==200||!n.json)return e([]);var o,l=n.json.surveys||[],a=l.filter(u=>{var d,c,p,h,g,m,y,w,_,x,S,R;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((c=u.conditions)===null||c===void 0||(p=c.events)===null||p===void 0?void 0:p.values)&&((h=u.conditions)===null||h===void 0||(g=h.events)===null||g===void 0||(m=g.values)===null||m===void 0?void 0:m.length)>0||((y=u.conditions)===null||y===void 0?void 0:y.actions)&&((w=u.conditions)===null||w===void 0||(_=w.actions)===null||_===void 0?void 0:_.values)&&((x=u.conditions)===null||x===void 0||(S=x.actions)===null||S===void 0||(R=S.values)===null||R===void 0?void 0:R.length)>0});return a.length>0&&((o=this._surveyEventReceiver)===null||o===void 0||o.register(a)),(s=this.instance.persistence)===null||s===void 0||s.register({[xl]:l}),e(l)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(i=>{var n,s=i.filter(a=>!(!a.start_date||a.end_date)).filter(a=>{var u,d,c,p;if(!a.conditions)return!0;var h=(u=a.conditions)===null||u===void 0||!u.url||tm[(d=(c=a.conditions)===null||c===void 0?void 0:c.urlMatchType)!==null&&d!==void 0?d:"icontains"](a.conditions.url),g=(p=a.conditions)===null||p===void 0||!p.selector||L?.querySelector(a.conditions.selector);return h&&g}),o=(n=this._surveyEventReceiver)===null||n===void 0?void 0:n.getSurveys(),l=s.filter(a=>{var u,d,c,p,h,g,m,y,w,_,x;if(!(a.linked_flag_key||a.targeting_flag_key||a.internal_targeting_flag_key||(u=a.feature_flag_keys)!==null&&u!==void 0&&u.length))return!0;var S=!a.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),R=!a.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key),B=((d=a.conditions)===null||d===void 0?void 0:d.events)&&((c=a.conditions)===null||c===void 0||(p=c.events)===null||p===void 0?void 0:p.values)&&((h=a.conditions)===null||h===void 0||(g=h.events)===null||g===void 0?void 0:g.values.length)>0,N=((m=a.conditions)===null||m===void 0?void 0:m.actions)&&((y=a.conditions)===null||y===void 0||(w=y.actions)===null||w===void 0?void 0:w.values)&&((_=a.conditions)===null||_===void 0||(x=_.actions)===null||x===void 0?void 0:x.values.length)>0,P=!B&&!N||o?.includes(a.id),U=this._canActivateRepeatedly(a),W=!(a.internal_targeting_flag_key&&!U)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key),xe=this.checkFlags(a);return S&&R&&W&&P&&xe});return e(l)},t)}checkFlags(e){var t;return(t=e.feature_flag_keys)===null||t===void 0||!t.length||e.feature_flag_keys.every(i=>{var{key:n,value:s}=i;return!n||!s||this.instance.featureFlags.isFeatureEnabled(s)})}getNextSurveyStep(e,t,i){var n,s=e.questions[t],o=t+1;if((n=s.branching)===null||n===void 0||!n.type)return t===e.questions.length-1?nt.End:o;if(s.branching.type===nt.End)return nt.End;if(s.branching.type===nt.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===nt.ResponseBased){if(s.type===yo.SingleChoice){var l,a,u=s.choices.indexOf("".concat(i));if((l=s.branching)!==null&&l!==void 0&&(a=l.responseValues)!==null&&a!==void 0&&a.hasOwnProperty(u)){var d=s.branching.responseValues[u];return Number.isInteger(d)?d:d===nt.End?nt.End:o}}else if(s.type===yo.Rating){var c,p;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(m,y){if(y===3){if(m<1||m>3)throw new Error("The response must be in range 1-3");return m===1?"negative":m===2?"neutral":"positive"}if(y===5){if(m<1||m>5)throw new Error("The response must be in range 1-5");return m<=2?"negative":m===3?"neutral":"positive"}if(y===7){if(m<1||m>7)throw new Error("The response must be in range 1-7");return m<=3?"negative":m===4?"neutral":"positive"}if(y===10){if(m<0||m>10)throw new Error("The response must be in range 0-10");return m<=6?"detractors":m<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(i,s.scale);if((c=s.branching)!==null&&c!==void 0&&(p=c.responseValues)!==null&&p!==void 0&&p.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===nt.End?nt.End:o}}return o}return on.warn("Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return Y((t=H.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(on.warn("init was not called"),!1):H.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Y(this._surveyManager)?on.warn("init was not called"):this.getSurveys(t=>{var i=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(i)})}renderSurvey(e,t){Y(this._surveyManager)?on.warn("init was not called"):this.getSurveys(i=>{var n=i.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,L?.querySelector(t))})}},wh=Fe("[RateLimiter]"),au=class{constructor(e){var t,i;A(this,"serverLimits",{}),A(this,"lastEventRateLimited",!1),A(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{wh.info("".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void wh.warn('could not rate limit - continuing. Error: "'.concat(o?.message,'"'),{text:s})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,i,n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(Cl))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var l=o.tokens<1;return l||n||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||n||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(i=this.instance.persistence)===null||i===void 0||i.set_property(Cl,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},rm=()=>k({initialPathName:Be?.pathname||"",referringDomain:se.referringDomain()},se.campaignParams()),lu=class{constructor(e,t,i){A(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[kl]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||rm,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[kl]}getSessionProps(){var e,t=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}},im=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],xh=function(r,e){if(!r)return!1;var t=r.toLowerCase();return im.concat(e||[]).some(i=>{var n=i.toLowerCase();return t.indexOf(n)!==-1})},Af=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&xh(t,e))return!0;try{var i=r?.userAgentData;if(i!=null&&i.brands&&i.brands.some(n=>xh(n?.brand,e)))return!0}catch{}return!!r.webdriver},xo=class{constructor(){this.clicks=[]}isRageClick(e,t,i){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},eo=Fe("[Dead Clicks]"),nm=()=>!0,sm=r=>{var e,t=!((e=r.instance.persistence)===null||e===void 0||!e.get_property(Fh)),i=r.instance.config.capture_dead_clicks;return yr(i)?i:t},ko=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Fh]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"dead-clicks-autocapture",s=>{s?eo.error("failed to load script",s):e()})}start(){var e;if(L){if(!this._lazyLoadedDeadClicksAutocapture&&(e=H.__PosthogExtensions__)!==null&&e!==void 0&&e.initDeadClicksAutocapture){var t=le(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=H.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(L),eo.info("starting...")}}else eo.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,eo.info("stopping..."))}},om=Fe("[Heatmaps]");function kh(r){return le(r)&&"clientX"in r&&"clientY"in r&&Oe(r.clientX)&&Oe(r.clientY)}var uu=class{constructor(e){var t;A(this,"rageclicks",new xo),A(this,"_enabledServerSide",!1),A(this,"_initialized",!1),A(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[bl]),v?.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return le(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return F(this.instance.config.capture_heatmaps)?F(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;om.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this._flushInterval)!==null&&e!==void 0?e:void 0),(t=this.deadClicksCapture)===null||t===void 0||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[bl]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){v&&L&&($t(L,"click",e=>this._onClick(e||v?.event),!1,!0),$t(L,"mousemove",e=>this._onMouseMove(e||v?.event),!1,!0),this.deadClicksCapture=new ko(this.instance,nm,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var i=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,a,u){for(var d=l;d&&$o(d)&&!zt(d,"body");){if(d===u)return!1;if(V(a,v?.getComputedStyle(d).position))return!0;d=sf(d)}return!1}(nf(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:i),target_fixed:o,type:t}}_onClick(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!eh(e.target)&&kh(e)){var n=this._getProperties(e,i);(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(k(k({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){!eh(e.target)&&kh(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(v){var t=v.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!ii(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},cu=class{constructor(e){A(this,"_updateScrollData",()=>{var t,i,n,s;this.context||(this.context={});var o=this.scrollElement(),l=this.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=l+(o?.clientHeight||0),d=o?.scrollHeight||0;this.context.lastScrollY=Math.ceil(l),this.context.maxScrollY=Math.max(l,(t=this.context.maxScrollY)!==null&&t!==void 0?t:0),this.context.maxScrollHeight=Math.max(a,(i=this.context.maxScrollHeight)!==null&&i!==void 0?i:0),this.context.lastContentY=u,this.context.maxContentY=Math.max(u,(n=this.context.maxContentY)!==null&&n!==void 0?n:0),this.context.maxContentHeight=Math.max(d,(s=this.context.maxContentHeight)!==null&&s!==void 0?s:0)}),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){v?.addEventListener("scroll",this._updateScrollData,!0),v?.addEventListener("scrollend",this._updateScrollData,!0),v?.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return v?.document.documentElement;var e=fe(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var i=v?.document.querySelector(t);if(i)return i}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return v&&(v.scrollY||v.pageYOffset||v.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return v&&(v.scrollX||v.pageXOffset||v.document.documentElement.scrollLeft)||0}},Ch=Fe("[AutoCapture]");function ml(r,e){return e.length>r?e.slice(0,r)+"...":e}function am(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!$o(e));return e}function lm(r,e,t,i){var n=r.tagName.toLowerCase(),s={tag_name:n};Fl.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=ml(1024,uf(r)):s.$el_text=ml(1024,Io(r)));var o=go(r);o.length>0&&(s.classes=o.filter(function(d){return d!==""})),K(r.attributes,function(d){var c;if((!of(r)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(i==null||!i.includes(d.name))&&!e&&di(d.value)&&(c=d.name,!Se(c)||c.substring(0,10)!=="_ngcontent"&&c.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=Su(p).join(" ")),s["attr__"+d.name]=ml(1024,p)}});for(var l=1,a=1,u=r;u=am(u);)l++,u.tagName===r.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function um(r,e){for(var t,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,u=[r],d=r;d.parentNode&&!zt(d,"body");)tf(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var c,p=[],h={},g=!1,m=!1;if(K(u,S=>{var R=Dl(S);S.tagName.toLowerCase()==="a"&&(g=S.getAttribute("href"),g=R&&g&&di(g)&&g),V(go(S),"ph-no-capture")&&(m=!0),p.push(lm(S,s,o,l));var B=function(N){if(!Dl(N))return{};var P={};return K(N.attributes,function(U){if(U.name&&U.name.indexOf("data-ph-capture-attribute")===0){var W=U.name.replace("data-ph-capture-attribute-",""),xe=U.value;W&&xe&&di(xe)&&(P[W]=xe)}}),P}(S);Te(h,B)}),m)return{props:{},explicitNoCapture:m};if(o||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?p[0].$el_text=uf(r):p[0].$el_text=Io(r)),g){var y,w;p[0].attr__href=g;var _=(y=oi(g))===null||y===void 0?void 0:y.host,x=v==null||(w=v.location)===null||w===void 0?void 0:w.host;_&&x&&_!==x&&(c=g)}return{props:Te({$event_type:n.type,$ce_version:1},a?{}:{$elements:p},{$elements_chain:$1(p)},(t=p[0])!==null&&t!==void 0&&t.$el_text?{$el_text:(i=p[0])===null||i===void 0?void 0:i.$el_text}:{},c&&n.type==="click"?{$external_click_url:c}:{},h)}}var du=class{constructor(e){A(this,"_initialized",!1),A(this,"_isDisabledServerSide",null),A(this,"rageclicks",new xo),A(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,i=le(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),i.url_ignorelist=(t=i.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),i}_addDomEventHandlers(){if(this.isBrowserSupported()){if(v&&L){var e=i=>{i=i||v?.event;try{this._captureEvent(i)}catch(n){Ch.error("Failed to capture event",n)}},t=i=>{i=i||v?.event,this._captureEvent(i,ol)};$t(L,"submit",e,!1,!0),$t(L,"change",e,!1,!0),$t(L,"click",e,!1,!0),this.config.capture_copied_text&&($t(L,"copy",t,!1,!0),$t(L,"cut",t,!1,!0))}}else Ch.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Lp]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,i=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(n=>{var s=L?.querySelectorAll(n);s?.forEach(o=>{e===o&&i.push(n)})}),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Lp],n=this._isDisabledServerSide;if(Vt(n)&&!yr(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var i,n=nf(e);ef(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!==null&&i!==void 0&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=t===ol;if(n&&x1(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=um(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(l)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(o.$element_selectors=a),t===ol){var u,d=rf(v==null||(u=v.getSelection())===null||u===void 0?void 0:u.toString()),c=e.type||"clipboard";if(!d)return!1;o.$selected_content=d,o.$copy_type=c}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Ze(L?.querySelectorAll)}},cm=Fe("[TracingHeaders]"),pu=class{constructor(e){A(this,"_restoreXHRPatch",void 0),A(this,"_restoreFetchPatch",void 0),A(this,"_startCapturing",()=>{var t,i,n,s;F(this._restoreXHRPatch)&&((t=H.__PosthogExtensions__)===null||t===void 0||(i=t.tracingHeadersPatchFns)===null||i===void 0||i._patchXHR(this.instance.sessionManager)),F(this._restoreFetchPatch)&&((n=H.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"tracing-headers",s=>{if(s)return cm.error("failed to load script",s);e()})}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)===null||e===void 0||e.call(this),(t=this._restoreFetchPatch)===null||t===void 0||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}},Bt;(function(r){r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED"})(Bt||(Bt={}));var hu=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Bt.DENIED:this.storedConsent}isOptedOut(){return this.consent===Bt.DENIED||this.consent===Bt.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return e==="1"?Bt.GRANTED:e==="0"?Bt.DENIED:Bt.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?ve:It;var t=e==="localStorage"?It:ve;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)==="1"),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!Oh([Ge?.doNotTrack,Ge?.msDoNotTrack,H.doNotTrack],e=>V([!0,1,"1","yes"],e))}},to=Fe("[ExceptionAutocapture]"),fu=class{constructor(e){var t;A(this,"originalOnUnhandledRejectionHandler",void 0),A(this,"startCapturing",()=>{var i,n,s,o;if(v&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=H.__PosthogExtensions__)===null||s===void 0||(o=s.errorWrappingFunctions)===null||o===void 0?void 0:o.wrapUnhandledRejection;if(l&&a)try{this.unwrapOnError=l(this.captureException.bind(this)),this.unwrapUnhandledRejection=a(this.captureException.bind(this))}catch(u){to.error("failed to start",u),this.stopCapturing()}else to.error("failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[Fp]),this.startIfEnabled()}get isEnabled(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}get isCapturing(){var e;return!(v==null||(e=v.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(to.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,i;this.hasHandlers&&e(),(t=H.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,"exception-autocapture",n=>{if(n)return to.error("failed to load script",n);e()})}stopCapturing(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[Fp]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}},gr=Fe("[Web Vitals]"),Sh=9e5,gu=class{constructor(e){var t;A(this,"_enabledServerSide",!1),A(this,"_initialized",!1),A(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),A(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((i,n)=>k(k({},i),{},{["$web_vitals_".concat(n.name,"_event")]:k({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),A(this,"_addToBuffer",i=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(F(s))gr.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this._currentURL();F(o)||(Y(i?.name)||Y(i?.value)?gr.error("Invalid metric received",i):this._maxAllowedValue&&i.value>=this._maxAllowedValue?gr.error("Ignoring metric with value >= "+this._maxAllowedValue,i):(this.buffer.url!==o&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),F(this.buffer.url)&&(this.buffer.url=o),this.buffer.firstMetricTimestamp=F(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(k(k({},i),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),A(this,"_startCapturing",()=>{var i,n,s,o,l=H.__PosthogExtensions__;F(l)||F(l.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:n,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),i&&n&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this._addToBuffer.bind(this)),this._initialized=!0):gr.error("web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Dp]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=le(this.instance.config.capture_performance)?(e=this.instance.config.capture_performance)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return F(i)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[jp])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(le(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=le(this.instance.config.capture_performance)&&Oe(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Sh;return 0<e&&e<=6e4?Sh:e}get isEnabled(){var e=le(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return yr(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(gr.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=le(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=le(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Dp]:t}),this.instance.persistence.register({[jp]:i})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"web-vitals",s=>{s?gr.error("failed to load script",s):e()})}_currentURL(){var e=v?v.location.href:void 0;return e||gr.error("Could not determine current URL"),e}},dm={icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!v&&ui(e.href,r),not_regex:(r,e)=>!!v&&!ui(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r},mu=class r{constructor(e){var t=this;A(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var i=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.getWebExperiments(n=>{r.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,n.forEach(s=>{if(s.feature_flag_key){var o;t._flagToExperiments&&(r.logInfo("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=t._flagToExperiments)===null||o===void 0||o.set(s.feature_flag_key,s));var l=t.instance.getFeatureFlag(s.feature_flag_key);Se(l)&&s.variants[l]&&t.applyTransforms(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var a in s.variants){var u=s.variants[a];r.matchesTestVariant(u)&&t.applyTransforms(s.name,a,u.transforms)}})},i)}),this.instance=e,this.instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}onFeatureFlags(e){if(this._is_bot())r.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(Y(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();r.logInfo("applying feature flags",e),e.forEach(t=>{var i;if(this._flagToExperiments&&(i=this._flagToExperiments)!==null&&i!==void 0&&i.has(t)){var n,s=this.instance.getFeatureFlag(t),o=(n=this._flagToExperiments)===null||n===void 0?void 0:n.get(t);s&&o!=null&&o.variants[s]&&this.applyTransforms(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var e=r.getWindowLocation();if(e!=null&&e.search){var t=co(e?.search,"__experiment_id"),i=co(e?.search,"__experiment_variant");t&&i&&(r.logInfo("previewing web experiments ".concat(t," && ").concat(i)),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(t),i,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.instance.config.disable_web_experiments&&!i)return e([]);var n=this.instance.get_property("$web_experiments");if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var o=s.json.experiments||[];return e(o)}})}showPreviewWebExperiment(e,t,i){var n=i.filter(s=>s.id===e);n&&n.length>0&&(r.logInfo("Previewing web experiment [".concat(n[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(n[0].name,t,n[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!Y(e.conditions)&&r.matchUrlConditions(e)&&r.matchUTMConditions(e)}static matchUrlConditions(e){var t;if(Y(e.conditions)||Y((t=e.conditions)===null||t===void 0?void 0:t.url))return!0;var i,n,s,o=r.getWindowLocation();return!!o&&((i=e.conditions)===null||i===void 0||!i.url||dm[(n=(s=e.conditions)===null||s===void 0?void 0:s.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,o))}static getWindowLocation(){return v?.location}static matchUTMConditions(e){var t;if(Y(e.conditions)||Y((t=e.conditions)===null||t===void 0?void 0:t.utm))return!0;var i=se.campaignParams();if(i.utm_source){var n,s,o,l,a,u,d,c,p,h,g,m,y,w,_,x,S=(n=e.conditions)===null||n===void 0||(s=n.utm)===null||s===void 0||!s.utm_campaign||((o=e.conditions)===null||o===void 0||(l=o.utm)===null||l===void 0?void 0:l.utm_campaign)==i.utm_campaign,R=(a=e.conditions)===null||a===void 0||(u=a.utm)===null||u===void 0||!u.utm_source||((d=e.conditions)===null||d===void 0||(c=d.utm)===null||c===void 0?void 0:c.utm_source)==i.utm_source,B=(p=e.conditions)===null||p===void 0||(h=p.utm)===null||h===void 0||!h.utm_medium||((g=e.conditions)===null||g===void 0||(m=g.utm)===null||m===void 0?void 0:m.utm_medium)==i.utm_medium,N=(y=e.conditions)===null||y===void 0||(w=y.utm)===null||w===void 0||!w.utm_term||((_=e.conditions)===null||_===void 0||(x=_.utm)===null||x===void 0?void 0:x.utm_term)==i.utm_term;return S&&B&&N&&R}return!1}static logInfo(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];O.info("[WebExperiments] ".concat(e),i)}applyTransforms(e,t,i,n){var s;this._is_bot()?r.logInfo("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach(o=>{if(o.selector){var l;r.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),o);var a,u=0,d=(l=document)===null||l===void 0?void 0:l.querySelectorAll(o.selector);d?.forEach(c=>{var p=c;u+=1,o.attributes&&o.attributes.forEach(h=>{switch(h.name){case"text":p.innerText=h.value;break;case"html":p.innerHTML=h.value;break;case"cssClass":p.className=h.value;break;default:p.setAttribute(h.name,h.value)}}),o.text&&(p.innerText=o.text),o.html&&(p.parentElement?p.parentElement.innerHTML=o.html:p.innerHTML=o.html),o.css&&p.setAttribute("style",o.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:n,$web_experiment_document_url:(a=r.getWindowLocation())===null||a===void 0?void 0:a.href,$web_experiment_elements_modified:u})}}):(r.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:n,$web_experiment_variant:t,$web_experiment_document_url:(s=r.getWindowLocation())===null||s===void 0?void 0:s.href,$web_experiment_elements_modified:0}))}_is_bot(){return Ge&&this.instance?Af(Ge,this.instance.config.custom_blocked_useragents):void 0}},vu=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},pm=["$set_once","$set"],mr=Fe("[SiteApps]"),_u=class{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var i=this.globalsForEvent(t);this.bufferedInvocations.push(i),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return(e=H._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(t=e[this.instance.config.token])===null||t===void 0?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var t,i,n,s,o,l,a;if(!e)throw new Error("Event payload is required");var u={},d=this.instance.get_property("$groups")||[],c=this.instance.get_property("$stored_group_properties")||{};for(var[p,h]of Object.entries(c))u[p]={id:d[p],type:p,properties:h};var{$set_once:g,$set:m}=e;return{event:k(k({},Ah(e,pm)),{},{properties:k(k(k({},e.properties),m?{$set:k(k({},(t=(i=e.properties)===null||i===void 0?void 0:i.$set)!==null&&t!==void 0?t:{}),m)}:{}),g?{$set_once:k(k({},(n=(s=e.properties)===null||s===void 0?void 0:s.$set_once)!==null&&n!==void 0?n:{}),g)}:{}),elements_chain:(o=(l=e.properties)===null||l===void 0?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var i=s=>{var o;for(var l of(this.apps[e.id].errored=!s,this.apps[e.id].loaded=!0,mr.info("Site app with id ".concat(e.id," ").concat(s?"loaded":"errored")),s&&this.bufferedInvocations.length&&(mr.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach(a=>{var u;return(u=t.processEvent)===null||u===void 0?void 0:u.call(t,a)})),Object.values(this.apps)))if(!l.loaded)return;(o=this.stopBuffering)===null||o===void 0||o.call(this)};try{var{processEvent:n}=e.init({posthog:this.instance,callback:s=>{i(s)}});n&&(t.processEvent=n)}catch(s){mr.error("Error while initializing PostHog app with config id ".concat(e.id),s),i(!1)}}onCapturedEvent(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{var n;(n=i.processEvent)===null||n===void 0||n.call(i,t)}catch(s){mr.error("Error while processing event ".concat(e.event," for site app ").concat(i.id),s)}}}onRemoteConfig(e){var t,i,n,s=this;if((t=this.siteAppLoaders)!==null&&t!==void 0&&t.length){if(!this.isEnabled)return void mr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var o of this.siteAppLoaders)this.setupSiteApp(o);this.instance.on("eventCaptured",d=>this.onCapturedEvent(d))}else if((i=this.stopBuffering)===null||i===void 0||i.call(this),(n=e.siteApps)!==null&&n!==void 0&&n.length)if(this.isEnabled){var l=function(d,c){var p,h;H["__$$ph_site_app_".concat(d)]=s.instance,(p=H.__PosthogExtensions__)===null||p===void 0||(h=p.loadSiteApp)===null||h===void 0||h.call(p,s.instance,c,g=>{if(g)return mr.error("Error while initializing PostHog app with config id ".concat(d),g)})};for(var{id:a,url:u}of e.siteApps)l(a,u)}else mr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},mn={},yu=()=>{},ri="posthog",Tf=!W1&&we?.indexOf("MSIE")===-1&&we?.indexOf("Mozilla")===-1,Eh=()=>{var r,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=L?.location,t=e?.hostname,!!Se(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:yu,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Be&&Se(Be?.search)&&Be.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(r=v.location)===null||r===void 0?void 0:r.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:i=>{var n="Bad HTTP status: "+i.statusCode+" "+i.text;O.error(n)},get_device_id:i=>i,_onCapture:yu,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},$h=r=>{var e={};F(r.process_person)||(e.person_profiles=r.process_person),F(r.xhr_headers)||(e.request_headers=r.xhr_headers),F(r.cookie_name)||(e.persistence_name=r.cookie_name),F(r.disable_cookie)||(e.disable_persistence=r.disable_cookie);var t=Te({},e,r);return fe(r.property_blacklist)&&(F(r.property_denylist)?t.property_denylist=r.property_blacklist:fe(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:O.error("Invalid value for property_denylist config: "+r.property_denylist)),t},bu=class{constructor(){A(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){O.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Co=class r{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)===null||t===void 0?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){A(this,"webPerformance",new bu),A(this,"version",Et.LIB_VERSION),A(this,"_internalEventEmitter",new bo),this.config=Eh(),this.SentryIntegration=Ql,this.sentryIntegration=e=>function(t,i){var n=_f(t,i);return{name:vf,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new Il(this),this.toolbar=new Zl(this),this.scrollManager=new cu(this),this.pageViewManager=new eu(this),this.surveys=new ou(this),this.experiments=new mu(this),this.exceptions=new vu(this),this.rateLimiter=new au(this),this.requestRouter=new Yl(this),this.consent=new hu(this),this.people={set:(e,t,i)=>{var n=Se(e)?{[e]:t}:e;this.setPersonProperties(n),i?.({})},set_once:(e,t,i)=>{var n=Se(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),i?.({})}},this.on("eventCaptured",e=>O.info('send "'.concat(e?.event,'"'),e))}init(e,t,i){if(i&&i!==ri){var n,s=(n=mn[i])!==null&&n!==void 0?n:new r;return s._init(e,t,i),mn[i]=s,mn[ri][i]=s,s}return this._init(e,t,i)}_init(e){var t,i,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(F(e)||Rp(e))return O.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return O.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],s.person_profiles&&(this._initialPersonProfilesConfig=s.person_profiles),this.set_config(Te({},Eh(),$h(s),{name:o,token:e})),this.config.on_xhr_error&&O.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:ct.GZipJS,this.persistence=new hn(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new hn(k(k({},this.config),{},{persistence:"sessionStorage"}));var l=k({},this.persistence.props),a=k({},this.sessionPersistence.props);if(this._requestQueue=new Jl(_=>this._send_retriable_request(_)),this._retryQueue=new Xl(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Kl(this),this.sessionPropsManager=new lu(this.sessionManager,this.persistence)),new pu(this).startIfEnabledOrStop(),this.siteApps=new _u(this),(t=this.siteApps)===null||t===void 0||t.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Wl(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new du(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new uu(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new gu(this),this.exceptionObserver=new fu(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new ko(this,sm),this.deadClicksAutocapture.startIfEnabled(),Et.DEBUG=Et.DEBUG||this.config.debug,Et.DEBUG&&O.info("Starting in debug mode",{this:this,config:s,thisC:k({},this.config),p:l,s:a}),this._sync_opt_out_with_persistence(),((i=s.bootstrap)===null||i===void 0?void 0:i.distinctID)!==void 0){var u,d,c=this.config.get_device_id(qt()),p=(u=s.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?c:s.bootstrap.distinctID;this.persistence.set_property(kt,(d=s.bootstrap)!==null&&d!==void 0&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var h,g,m=Object.keys(((h=s.bootstrap)===null||h===void 0?void 0:h.featureFlags)||{}).filter(_=>{var x,S;return!((x=s.bootstrap)===null||x===void 0||(S=x.featureFlags)===null||S===void 0||!S[_])}).reduce((_,x)=>{var S,R;return _[x]=((S=s.bootstrap)===null||S===void 0||(R=S.featureFlags)===null||R===void 0?void 0:R[x])||!1,_},{}),y=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(_=>m[_]).reduce((_,x)=>{var S,R,B,N;return(S=s.bootstrap)!==null&&S!==void 0&&(R=S.featureFlagPayloads)!==null&&R!==void 0&&R[x]&&(_[x]=(B=s.bootstrap)===null||B===void 0||(N=B.featureFlagPayloads)===null||N===void 0?void 0:N[x]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:y})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Vp,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(qt());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(kt,"anonymous")}return v==null||(n=v.addEventListener)===null||n===void 0||n.call(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?Z1(this,()=>this._loaded()):this._loaded(),Ze(this.config._onCapture)&&this.config._onCapture!==yu&&(O.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this}_onRemoteConfig(e){var t,i,n,s,o,l,a,u,d;if(!L||!L.body)return O.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=V(e.supportedCompression,ct.GZipJS)?ct.GZipJS:V(e.supportedCompression,ct.Base64)?ct.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),(i=this.siteApps)===null||i===void 0||i.onRemoteConfig(e),(n=this.sessionRecording)===null||n===void 0||n.onRemoteConfig(e),(s=this.autocapture)===null||s===void 0||s.onRemoteConfig(e),(o=this.heatmaps)===null||o===void 0||o.onRemoteConfig(e),(l=this.surveys)===null||l===void 0||l.onRemoteConfig(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.onRemoteConfig(e),(u=this.exceptionObserver)===null||u===void 0||u.onRemoteConfig(e),(d=this.deadClicksAutocapture)===null||d===void 0||d.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){O.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new Gl(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||si(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(t=this._retryQueue)===null||t===void 0||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Tf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=_o(e.url,{ip:this.config.ip?1:0}),e.headers=k({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var i,n,s,o=k({},t);o.timeout=o.timeout||6e4,o.url=_o(o.url,{_:new Date().getTime().toString(),ver:Et.LIB_VERSION,compression:o.compression});var l=(i=o.transport)!==null&&i!==void 0?i:"fetch",a=(n=(s=Oh(gn,u=>u.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:gn[0].method;if(!a)throw new Error("No available transport method");a(o)})(k(k({},e),{},{callback:t=>{var i,n,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(s=this.config).on_request_error)===null||n===void 0||n.call(s,t)),(i=e.callback)===null||i===void 0||i.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,i=[],n=[],s=[];si(e,l=>{l&&(t=l[0],fe(t)?s.push(l):Ze(l)?l.call(this):fe(l)&&t==="alias"?i.push(l):fe(l)&&t.indexOf("capture")!==-1&&Ze(this[t])?s.push(l):n.push(l))});var o=function(l,a){si(l,function(u){if(fe(u[0])){var d=a;K(u,function(c){d=d[c[0]].apply(d,c.slice(1))})}else this[u[0]].apply(this,u.slice(1))},a)};o(i,this),o(n,this),o(s,this)}_hasBootstrappedFeatureFlags(){var e,t;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!F(e)&&Se(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=i?.timestamp||o,a=qt(),u={uuid:a,event:e,properties:this._calculate_event_properties(e,t||{},l,a)};s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(u.$set=i?.$set);var d=this._calculate_set_once_properties(i?.$set_once);d&&(u.$set_once=d),(u=t1(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,F(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var c=k(k({},u.properties.$set),u.$set);if(ii(c)||this.setPersonPropertiesForFlags(c),!Y(this.config.before_send)){var p=this._runBeforeSend(u);if(!p)return;u=p}this._internalEventEmitter.emit("eventCaptured",u);var h={method:"POST",url:(n=i?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(h):this._requestQueue.enqueue(h),u}O.critical("This capture call is ignored due to client rate limiting.")}}else O.error("No event name provided to posthog.capture")}else O.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,i,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var s=this.persistence.remove_event_timer(e),o=k({},t);if(o.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(o.$cklsh_mode=!0),e==="$snapshot"){var l=k(k({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Se(o.distinct_id)&&!Oe(o.distinct_id)||Rp(o.distinct_id))&&O.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var a,u=se.properties();if(this.sessionManager){var{sessionId:d,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();o.$session_id=d,o.$window_id=c}if(this.sessionRecording&&(o.$recording_status=this.sessionRecording.status),this.requestRouter.region===br.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var p=this.sessionPropsManager.getSessionProps();o=Te(o,p)}if(a=e==="$pageview"?this.pageViewManager.doPageView(i,n):e==="$pageleave"?this.pageViewManager.doPageLeave(i):this.pageViewManager.doEvent(),o=Te(o,a),e==="$pageview"&&L&&(o.title=L.title),!F(s)){var h=i.getTime()-s;o.$duration=parseFloat((h/1e3).toFixed(3))}we&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Te({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),fe(this.config.property_denylist)?K(this.config.property_denylist,function(y){delete o[y]}):O.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(O.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,e));var m=this._hasPersonProcessing();return o.$process_person_profile=m,m&&this._requirePersonProcessing("_calculate_event_properties"),o}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Te({},this.persistence.get_initial_props(),e||{}),i=this.config.sanitize_properties;return i&&(O.error("sanitize_properties is deprecated. Use before_send instead"),t=i(t,"$set_once")),ii(t)?void 0:t}register(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}register_once(e,t,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}unregister(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}identify(e,t,i){if(!this.__loaded||!this.persistence)return O.uninitializedWarning("posthog.identify");if(Oe(e)&&(e=e.toString(),O.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))O.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(an)&&(this.unregister(an),this.register({distinct_id:e}));var o=(this.persistence.get_property(kt)||"anonymous")==="anonymous";e!==n&&o?(this.persistence.set_property(kt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(lo))}}else O.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:k(k({},n),{},{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}}else O.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,n,s,o;if(O.info("reset"),!this.__loaded)return O.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(n=this.surveys)===null||n===void 0||n.reset(),(s=this.persistence)===null||s===void 0||s.set_property(kt,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId(),this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Vp,$device_id:null},"");else{var a=this.config.get_device_id(qt());this.register_once({distinct_id:a,$device_id:e?a:l},"")}}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(e!=null&&e.withTimestamp&&i){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!i)return n;var l=Math.max(Math.floor((new Date().getTime()-i)/1e3)-o,0);n+="?t=".concat(l)}return n}alias(e,t){return e===this.get_property(Lh)?(O.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(an,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(O.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,n,s,o=k({},this.config);le(e)&&(Te(this.config,$h(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new hn(k(k({},this.config),{},{persistence:"sessionStorage"})),ve.is_supported()&&ve.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Et.DEBUG=!0,O.info("set_config",{config:e,oldConfig:o,newConfig:k({},this.config)})),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(n=this.autocapture)===null||n===void 0||n.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var n,s,o,l,a;(n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),i.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),i.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),i.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),i.event_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}captureException(e,t){var i,n=new Error("PostHog syntheticException"),s=Ze((i=H.__PosthogExtensions__)===null||i===void 0?void 0:i.parseErrorAsProperties)?H.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):k({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},t);this.exceptions.sendExceptionEvent(s)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:ri;return t!==ri&&(t=ri+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(kt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(kt))==="identified"}_hasPersonProcessing(){var e,t,i,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ii(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[an])&&((i=this.persistence)===null||i===void 0||(n=i.props)===null||n===void 0||!n[uo]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return this.config.person_profiles==="never"?(O.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(uo,!0),!0)}_sync_opt_out_with_persistence(){var e,t,i,n,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,l=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==l&&((i=this.persistence)===null||i===void 0||i.set_disabled(l)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==l&&((n=this.sessionPersistence)===null||n===void 0||n.set_disabled(l))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Ge?Af(Ge,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){L&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:L.title},{send_instantly:!0}))}debug(e){e===!1?(v?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(v?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(e){if(Y(this.config.before_send))return e;var t=fe(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var n of t){if(i=n(i),Y(i)){var s="Event '".concat(e.event,"' was rejected in beforeSend function");return Qg(e.event)?O.warn("".concat(s,". This can cause unexpected behavior.")):O.info(s),null}i.properties&&!ii(i.properties)||O.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return i}getPageViewId(){var e;return(e=this.pageViewManager._currentPageview)===null||e===void 0?void 0:e.pageViewId}};(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=e1(r.prototype[e[t]])})(Co,["identify"]);var Ih,Mf=(Ih=mn[ri]=new Co,function(){function r(){r.done||(r.done=!0,Tf=!1,K(mn,function(e){e._dom_loaded()}))}L!=null&&L.addEventListener&&(L.readyState==="complete"?r():L.addEventListener("DOMContentLoaded",r,!1)),v&&$t(v,"load",r,!0)}(),Ih);var Pf=Mf.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,advanced_disable_decide:!0},"MolinShopAI");function De(r,e){if(!Pf)throw new Error("Failed to initialize PostHog");Pf.capture(r,e)}var To,Cn,Mo,Wt,Of,Ao,xn=class xn extends z(q){constructor(){super();b(this,Wt);b(this,To,new Nt(this,{onError:console.error}));b(this,Cn);b(this,Mo,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),De("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{De("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{De("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{De("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{De("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{De("ShopAssistant: user sent input",t),he("ShopAssistant: user sent input",t)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData="",this.xPromptExt=""}get config(){return f(this,Cn)||f(this,To).data}render(){return this.config?C`
875
+ `)).length,n=0;n<i;n++){var o=r.charCodeAt(n),l=null;o<128?t++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Wt(l)||(t>e&&(s+=r.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=r.substring(e,r.length)),s},Q1=!!Al||!!Il,yh="text/plain",Io=(r,e)=>{var[t,i]=r.split("?"),n=C({},e);i?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=v1(n);return s=s?(i?i+"&":"")+s:i,"".concat(t,"?").concat(s)},lo=(r,e)=>JSON.stringify(r,(t,i)=>typeof i=="bigint"?i.toString():i,e),Cl=r=>{var{data:e,compression:t}=r;if(e){if(t===dt.GZipJS){var i=wf(xf(lo(e)),{mtime:0}),n=new Blob([i],{type:yh});return{contentType:yh,body:n,estimatedSize:n.size}}if(t===dt.Base64){var s=function(a){var u,d,c,p,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,b=0,x="",y=[];if(!a)return a;a=Y1(a);do u=(h=a.charCodeAt(m++)<<16|a.charCodeAt(m++)<<8|a.charCodeAt(m++))>>18&63,d=h>>12&63,c=h>>6&63,p=63&h,y[b++]=g.charAt(u)+g.charAt(d)+g.charAt(c)+g.charAt(p);while(m<a.length);switch(x=y.join(""),a.length%3){case 1:x=x.slice(0,-2)+"==";break;case 2:x=x.slice(0,-1)+"="}return x}(lo(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:lo(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=lo(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},_n=[];Il&&_n.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:n,estimatedSize:s}=(e=Cl(r))!==null&&e!==void 0?e:{},o=new Headers;K(r.headers,function(d,c){o.append(c,d)}),i&&o.append("Content-Type",i);var l=r.url,a=null;if(jp){var u=new jp;a={signal:u.signal,timeout:setTimeout(()=>u.abort(),r.timeout)}}Il(l,C({method:r?.method||"GET",headers:o,keepalive:r.method==="POST"&&(s||0)<52428.8,body:n,signal:(t=a)===null||t===void 0?void 0:t.signal},r.fetchOptions)).then(d=>d.text().then(c=>{var p,h={statusCode:d.status,text:c};if(d.status===200)try{h.json=JSON.parse(c)}catch(g){O.error(g)}(p=r.callback)===null||p===void 0||p.call(r,h)})).catch(d=>{var c;O.error(d),(c=r.callback)===null||c===void 0||c.call(r,{statusCode:0,text:d})}).finally(()=>a?clearTimeout(a.timeout):null)}}),Al&&_n.push({transport:"XHR",method:r=>{var e,t=new Al;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:n}=(e=Cl(r))!==null&&e!==void 0?e:{};K(r.headers,function(s,o){t.setRequestHeader(o,s)}),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var s,o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}(s=r.callback)===null||s===void 0||s.call(r,o)}},t.send(n)}}),Ge!=null&&Ge.sendBeacon&&_n.push({transport:"sendBeacon",method:r=>{var e=Io(r.url,{beacon:"1"});try{var t,{contentType:i,body:n}=(t=Cl(r))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:i}):n;Ge.sendBeacon(e,s)}catch{}}});var em=["retriesPerformedSoFar"],au=class{constructor(e){A(this,"isPolling",!1),A(this,"pollIntervalMs",3e3),A(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!F(v)&&"onLine"in v.navigator&&(this.areWeOnline=v.navigator.onLine,v.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),v.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=Lh(e,em);Oe(t)&&t>0&&(i.url=Io(i.url,{retry_count:t})),this.instance._send_request(C(C({},i),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(C({retriesPerformedSoFar:t},i)):(s=i.callback)===null||s===void 0||s.call(i,n)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var l=3e3*Math.pow(2,o),a=l/2,u=Math.min(18e5,l),d=(Math.random()-.5)*(u-a);return Math.ceil(u+d)}(t),n=Date.now()+i;this.queue.push({retryAt:n,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),O.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var e=Date.now(),t=[],i=this.queue.filter(s=>s.retryAt<e||(t.push(s),!1));if(this.queue=t,i.length>0)for(var{requestOptions:n}of i)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(C(C({},e),{},{transport:"sendBeacon"}))}catch(t){O.error(t)}this.queue=[]}},wr,bh=Fe("[SessionId]"),lu=class{constructor(e,t,i){var n;if(A(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Ht,this._windowIdGenerator=i||Ht;var s=this.config.persistence_name||this.config.token,o=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ht(o,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var l=Ce.parse(this._window_id_storage_key),a=Ce.parse(this._primary_window_exists_storage_key);l&&!a?this._windowId=l:Ce.remove(this._window_id_storage_key),Ce.set(this._primary_window_exists_storage_key,!0)}if((n=this.config.bootstrap)!==null&&n!==void 0&&n.sessionID)try{var u=(d=>{var c=d.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),u)}catch(d){bh.error("Invalid sessionID in bootstrap",d)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ce.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ce.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ce.parse(this._window_id_storage_key):null}_setSessionId(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[_o]:[t,e,i]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[_o];return fe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){v?.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&Ce.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var i=t||new Date().getTime(),[n,s,o]=this._getSessionId(),l=this._getWindowId(),a=Oe(o)&&o>0&&Math.abs(i-o)>864e5,u=!1,d=!s,c=!e&&Math.abs(i-n)>this.sessionTimeoutMs;d||c||a?(s=this._sessionIdGenerator(),l=this._windowIdGenerator(),bh.info("new session ID generated",{sessionId:s,windowId:l,changeReason:{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:a}}),o=i,u=!0):l||(l=this._windowIdGenerator(),u=!0);var p=n===0||!e||a?i:n,h=o===0?new Date().getTime():o;return this._setWindowId(l),this._setSessionId(s,p,h),e||this.resetIdleTimer(),u&&this._sessionIdChangedHandlers.forEach(g=>g(s,l,u?{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:a}:void 0)),{sessionId:s,windowId:l,sessionStartTimestamp:h,changeReason:u?{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:n}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}};(function(r){r.US="us",r.EU="eu",r.CUSTOM="custom"})(wr||(wr={}));var wh="i.posthog.com",uu=class{constructor(e){A(this,"_regionCache",{}),this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(wh),".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=wr.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=wr.EU:this._regionCache[this.apiHost]=wr.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t&&(t=t[0]==="/"?t:"/".concat(t)),e==="ui")return this.uiHost+t;if(this.region===wr.CUSTOM)return this.apiHost+t;var i=wh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},kf="posthog-js";function Cf(r){var{organization:e,projectId:t,prefix:i,severityAllowList:n=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=>{var o,l,a,u,d;if(!(n==="*"||n.includes(s.level))||!r.__loaded)return s;s.tags||(s.tags={});var c=r.requestRouter.endpointFor("ui","/project/".concat(r.config.token,"/person/").concat(r.get_distinct_id()));s.tags["PostHog Person URL"]=c,r.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var p=((o=s.exception)===null||o===void 0?void 0:o.values)||[];p.map(g=>{g.stacktrace&&(g.stacktrace.type="raw")});var h={$exception_message:((l=p[0])===null||l===void 0?void 0:l.value)||s.message,$exception_type:(a=p[0])===null||a===void 0?void 0:a.type,$exception_personURL:c,$exception_level:s.level,$exception_list:p,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((u=p[0])===null||u===void 0?void 0:u.value)||s.message,$sentry_exception_type:(d=p[0])===null||d===void 0?void 0:d.type,$sentry_tags:s.tags};return e&&t&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+e+"/issues/?project="+t+"&query="+s.event_id),r.exceptions.sendExceptionEvent(h),s}}var cu=class{constructor(e,t,i,n,s){this.name=kf,this.setupOnce=function(o){o(Cf(e,{organization:t,projectId:i,prefix:n,severityAllowList:s}))}}},xh,Ao,st,El=Fe("[SegmentIntegration]");function tm(r,e){var t=r.config.segment;if(!t)return e();(function(i,n){var s=i.config.segment;if(!s)return n();var o=a=>{var u=()=>a.anonymousId()||Ht();i.config.get_device_id=u,a.id()&&(i.register({distinct_id:a.id(),$device_id:u()}),i.persistence.set_property(Ct,"identified")),n()},l=s.user();"then"in l&&Ze(l.then)?l.then(a=>o(a)):o(l)})(r,()=>{t.register((i=>{Promise&&Promise.resolve||El.warn("This browser does not have Promise support, and can not use the segment integration");var n=(s,o)=>{var l;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||(El.info("No userId set, resetting PostHog"),i.reset()),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(El.info("UserId set, identifying with PostHog"),i.identify(s.event.userId));var a=i._calculate_event_properties(o,(l=s.event.properties)!==null&&l!==void 0?l:{},new Date);return s.event.properties=Object.assign({},a,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>n(s,s.event.event),page:s=>n(s,"$pageview"),identify:s=>n(s,"$identify"),screen:s=>n(s,"$screen")}})(r)).then(()=>{e()})})}var du=class{constructor(e){this._instance=e}doPageView(e,t){var i,n=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:(i=v?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this._previousPageViewProperties(e,(t=this._currentPageview)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this._currentPageview)===null||e===void 0?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var i=this._currentPageview;if(!i)return{$pageview_id:t};var n={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:a,maxContentHeight:u,lastContentY:d,maxContentY:c}=s;if(!(F(o)||F(l)||F(a)||F(u)||F(d)||F(c))){o=Math.ceil(o),l=Math.ceil(l),a=Math.ceil(a),u=Math.ceil(u),d=Math.ceil(d),c=Math.ceil(c);var p=o<=1?1:ht(l/o,0,1),h=o<=1?1:ht(a/o,0,1),g=u<=1?1:ht(d/u,0,1),m=u<=1?1:ht(c/u,0,1);n=Te(n,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:m})}}return i.pathname&&(n.$prev_pageview_pathname=i.pathname),i.timestamp&&(n.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),n}};(function(r){r.Popover="popover",r.API="api",r.Widget="widget"})(xh||(xh={})),function(r){r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link"}(Ao||(Ao={})),function(r){r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question"}(st||(st={}));var To=class{constructor(){A(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(i=>i!==t)}}emit(e,t){for(var i of this.events[e]||[])i(t);for(var n of this.events["*"]||[])n(e,t)}},pu=class r{constructor(e){A(this,"_debugEventEmitter",new To),A(this,"checkStep",(t,i)=>this.checkStepEvent(t,i)&&this.checkStepUrl(t,i)&&this.checkStepElement(t,i)),A(this,"checkStepEvent",(t,i)=>i==null||!i.event||t?.event===i?.event),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!F((e=this.instance)===null||e===void 0?void 0:e._addCaptureHook)){var t;(t=this.instance)===null||t===void 0||t._addCaptureHook((i,n)=>{this.on(i,n)})}}register(e){var t,i;if(!F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(o=>{var l,a;(l=this.actionRegistry)===null||l===void 0||l.add(o),(a=o.steps)===null||a===void 0||a.forEach(u=>{var d;(d=this.actionEvents)===null||d===void 0||d.add(u?.event||"")})}),(i=this.instance)!==null&&i!==void 0&&i.autocapture)){var n,s=new Set;e.forEach(o=>{var l;(l=o.steps)===null||l===void 0||l.forEach(a=>{a!=null&&a.selector&&s.add(a?.selector)})}),(n=this.instance)===null||n===void 0||n.autocapture.setElementSelectors(s)}}on(e,t){var i;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((i=this.actionRegistry)===null||i===void 0?void 0:i.size)>0&&this.actionRegistry.forEach(n=>{this.checkAction(t,n)&&this._debugEventEmitter.emit("actionCaptured",n.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}checkAction(e,t){if(t?.steps==null)return!1;for(var i of t.steps)if(this.checkStep(e,i))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(t!=null&&t.url){var i,n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!n||typeof n!="string"||!r.matchString(n,t?.url,t?.url_matching||"contains"))return!1}return!0}static matchString(e,t,i){switch(i){case"regex":return!!v&&di(e,t);case"exact":return t===e;case"contains":var n=r.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return di(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.getElementsList(e).some(s=>!(t!=null&&t.href&&!r.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!r.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!r.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var i,n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(!n||!n.includes(t?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},Cn=class r{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter(i=>{var n,s,o,l;return((n=i.conditions)===null||n===void 0?void 0:n.actions)&&((s=i.conditions)===null||s===void 0||(o=s.actions)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0});t.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new pu(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(i=>{this.onAction(i)})),t.forEach(i=>{var n,s,o,l,a,u,d,c,p,h;i.conditions&&(n=i.conditions)!==null&&n!==void 0&&n.actions&&(s=i.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((l=i.conditions)===null||l===void 0||(a=l.actions)===null||a===void 0||(u=a.values)===null||u===void 0?void 0:u.length)>0&&((d=this.actionMatcher)===null||d===void 0||d.register(i.conditions.actions.values),(c=i.conditions)===null||c===void 0||(p=c.actions)===null||p===void 0||(h=p.values)===null||h===void 0||h.forEach(g=>{if(g&&g.name){var m=this.actionToSurveys.get(g.name);m&&m.push(i.id),this.actionToSurveys.set(g.name,m||[i.id])}}))}))}setupEventBasedSurveys(e){var t;e.filter(i=>{var n,s,o,l;return((n=i.conditions)===null||n===void 0?void 0:n.events)&&((s=i.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0}).length!==0&&((t=this.instance)===null||t===void 0||t._addCaptureHook((i,n)=>{this.onEvent(i,n)}),e.forEach(i=>{var n,s,o;(n=i.conditions)===null||n===void 0||(s=n.events)===null||s===void 0||(o=s.values)===null||o===void 0||o.forEach(l=>{if(l&&l.name){var a=this.eventToSurveys.get(l.name);a&&a.push(i.id),this.eventToSurveys.set(l.name,a||[i.id])}})}))}onEvent(e,t){var i,n,s=((i=this.instance)===null||i===void 0||(n=i.persistence)===null||n===void 0?void 0:n.props[to])||[];if(r.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,l=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(l){var a=s.indexOf(l);a>=0&&(s.splice(a,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,i,n=((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0?void 0:i.props[to])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,i;(t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register({[to]:[...new Set(e)]})}getSurveys(){var e,t,i=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[to];return i||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};A(Cn,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Ef,oe,Sf,yr,kh,$f,hu,If,fu={},Af=[],rm=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nu=Array.isArray;function zt(r,e){for(var t in e)r[t]=e[t];return r}function Tf(r){var e=r.parentNode;e&&e.removeChild(r)}function Sl(r,e,t,i,n){var s={type:r,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++Sf,__i:-1,__u:0};return n==null&&oe.vnode!=null&&oe.vnode(s),s}function Uu(r){return r.children}function go(r,e){this.props=r,this.context=e}function gi(r,e){if(e==null)return r.__?gi(r.__,r.__i+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?gi(r):null}function Mf(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return Mf(r)}}function gu(r){(!r.__d&&(r.__d=!0)&&yr.push(r)&&!Mo.__r++||kh!==oe.debounceRendering)&&((kh=oe.debounceRendering)||$f)(Mo)}function Mo(){var r,e,t,i,n,s,o,l,a;for(yr.sort(hu);r=yr.shift();)r.__d&&(e=yr.length,i=void 0,s=(n=(t=r).__v).__e,l=[],a=[],(o=t.__P)&&((i=zt({},n)).__v=n.__v+1,oe.vnode&&oe.vnode(i),Of(o,i,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??gi(n),!!(32&n.__u),a),i.__.__k[i.__i]=i,sm(l,i,a),i.__e!=s&&Mf(i)),yr.length>e&&yr.sort(hu));Mo.__r=0}function Pf(r,e,t,i,n,s,o,l,a,u,d){var c,p,h,g,m,b=i&&i.__k||Af,x=e.length;for(t.__d=a,im(t,e,b),a=t.__d,c=0;c<x;c++)(h=t.__k[c])!=null&&typeof h!="boolean"&&typeof h!="function"&&(p=h.__i===-1?fu:b[h.__i]||fu,h.__i=c,Of(r,h,p,n,s,o,l,a,u,d),g=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Bu(p.ref,null,h),d.push(h.ref,h.__c||g,h)),m==null&&g!=null&&(m=g),65536&h.__u||p.__k===h.__k?a=Rf(h,a,r):typeof h.type=="function"&&h.__d!==void 0?a=h.__d:g&&(a=g.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=a,t.__e=m}function im(r,e,t){var i,n,s,o,l,a=e.length,u=t.length,d=u,c=0;for(r.__k=[],i=0;i<a;i++)(n=r.__k[i]=(n=e[i])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?Sl(null,n,null,null,n):Nu(n)?Sl(Uu,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?Sl(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=r,n.__b=r.__b+1,l=nm(n,t,o=i+c,d),n.__i=l,s=null,l!==-1&&(d--,(s=t[l])&&(s.__u|=131072)),s==null||s.__v===null?(l==-1&&c--,typeof n.type!="function"&&(n.__u|=65536)):l!==o&&(l===o+1?c++:l>o?d>a-o?c+=l-o:c--:c=l<o&&l==o-1?l-o:0,l!==i+c&&(n.__u|=65536))):(s=t[i])&&s.key==null&&s.__e&&(s.__e==r.__d&&(r.__d=gi(s)),mu(s,s,!1),t[i]=null,d--);if(d)for(i=0;i<u;i++)(s=t[i])!=null&&!(131072&s.__u)&&(s.__e==r.__d&&(r.__d=gi(s)),mu(s,s))}function Rf(r,e,t){var i,n;if(typeof r.type=="function"){for(i=r.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=r,e=Rf(i[n],e,t));return e}return r.__e!=e&&(t.insertBefore(r.__e,e||null),e=r.__e),e&&e.nextSibling}function nm(r,e,t,i){var n=r.key,s=r.type,o=t-1,l=t+1,a=e[t];if(a===null||a&&n==a.key&&s===a.type)return t;if(i>(a!=null&&!(131072&a.__u)?1:0))for(;o>=0||l<e.length;){if(o>=0){if((a=e[o])&&!(131072&a.__u)&&n==a.key&&s===a.type)return o;o--}if(l<e.length){if((a=e[l])&&!(131072&a.__u)&&n==a.key&&s===a.type)return l;l++}}return-1}function Ch(r,e,t){e[0]==="-"?r.setProperty(e,t??""):r[e]=t==null?"":typeof t!="number"||rm.test(e)?t:t+"px"}function uo(r,e,t,i,n){var s;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof i=="string"&&(r.style.cssText=i=""),i)for(e in i)t&&e in t||Ch(r.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||Ch(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+s]=t,t?i?t.u=i.u:(t.u=Date.now(),r.addEventListener(e,s?Sh:Eh,s)):r.removeEventListener(e,s?Sh:Eh,s);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in r)try{r[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?r.removeAttribute(e):r.setAttribute(e,t))}}function Eh(r){var e=this.l[r.type+!1];if(r.t){if(r.t<=e.u)return}else r.t=Date.now();return e(oe.event?oe.event(r):r)}function Sh(r){return this.l[r.type+!0](oe.event?oe.event(r):r)}function Of(r,e,t,i,n,s,o,l,a,u){var d,c,p,h,g,m,b,x,y,k,E,R,q,U,P,B=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),s=[l=e.__e=t.__e]),(d=oe.__b)&&d(e);e:if(typeof B=="function")try{if(x=e.props,y=(d=B.contextType)&&i[d.__c],k=d?y?y.props.value:d.__:i,t.__c?b=(c=e.__c=t.__c).__=c.__E:("prototype"in B&&B.prototype.render?e.__c=c=new B(x,k):(e.__c=c=new go(x,k),c.constructor=B,c.render=am),y&&y.sub(c),c.props=x,c.state||(c.state={}),c.context=k,c.__n=i,p=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),B.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=zt({},c.__s)),zt(c.__s,B.getDerivedStateFromProps(x,c.__s))),h=c.props,g=c.state,c.__v=e,p)B.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(B.getDerivedStateFromProps==null&&x!==h&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(x,k),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(x,c.__s,k)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(c.props=x,c.state=c.__s,c.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(W){W&&(W.__=e)}),E=0;E<c._sb.length;E++)c.__h.push(c._sb[E]);c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(x,c.__s,k),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(h,g,m)})}if(c.context=k,c.props=x,c.__P=r,c.__e=!1,R=oe.__r,q=0,"prototype"in B&&B.prototype.render){for(c.state=c.__s,c.__d=!1,R&&R(e),d=c.render(c.props,c.state,c.context),U=0;U<c._sb.length;U++)c.__h.push(c._sb[U]);c._sb=[]}else do c.__d=!1,R&&R(e),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++q<25);c.state=c.__s,c.getChildContext!=null&&(i=zt(zt({},i),c.getChildContext())),p||c.getSnapshotBeforeUpdate==null||(m=c.getSnapshotBeforeUpdate(h,g)),Pf(r,Nu(P=d!=null&&d.type===Uu&&d.key==null?d.props.children:d)?P:[P],e,t,i,n,s,o,l,a,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),b&&(c.__E=c.__=null)}catch(W){e.__v=null,a||s!=null?(e.__e=l,e.__u|=a?160:32,s[s.indexOf(l)]=null):(e.__e=t.__e,e.__k=t.__k),oe.__e(W,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=om(t.__e,e,t,i,n,s,o,a,u);(d=oe.diffed)&&d(e)}function sm(r,e,t){e.__d=void 0;for(var i=0;i<t.length;i++)Bu(t[i],t[++i],t[++i]);oe.__c&&oe.__c(e,r),r.some(function(n){try{r=n.__h,n.__h=[],r.some(function(s){s.call(n)})}catch(s){oe.__e(s,n.__v)}})}function om(r,e,t,i,n,s,o,l,a){var u,d,c,p,h,g,m,b=t.props,x=e.props,y=e.type;if(y==="svg"&&(n=!0),s!=null){for(u=0;u<s.length;u++)if((h=s[u])&&"setAttribute"in h==!!y&&(y?h.localName===y:h.nodeType===3)){r=h,s[u]=null;break}}if(r==null){if(y===null)return document.createTextNode(x);r=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,x.is&&x),s=null,l=!1}if(y===null)b===x||l&&r.data===x||(r.data=x);else{if(s=s&&Ef.call(r.childNodes),b=t.props||fu,!l&&s!=null)for(b={},u=0;u<r.attributes.length;u++)b[(h=r.attributes[u]).name]=h.value;for(u in b)h=b[u],u=="children"||(u=="dangerouslySetInnerHTML"?c=h:u==="key"||u in x||uo(r,u,null,h,n));for(u in x)h=x[u],u=="children"?p=h:u=="dangerouslySetInnerHTML"?d=h:u=="value"?g=h:u=="checked"?m=h:u==="key"||l&&typeof h!="function"||b[u]===h||uo(r,u,h,b[u],n);if(d)l||c&&(d.__html===c.__html||d.__html===r.innerHTML)||(r.innerHTML=d.__html),e.__k=[];else if(c&&(r.innerHTML=""),Pf(r,Nu(p)?p:[p],e,t,i,n&&y!=="foreignObject",s,o,s?s[0]:t.__k&&gi(t,0),l,a),s!=null)for(u=s.length;u--;)s[u]!=null&&Tf(s[u]);l||(u="value",g!==void 0&&(g!==r[u]||y==="progress"&&!g||y==="option"&&g!==b[u])&&uo(r,u,g,b[u],!1),u="checked",m!==void 0&&m!==r[u]&&uo(r,u,m,b[u],!1))}return r}function Bu(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(i){oe.__e(i,t)}}function mu(r,e,t){var i,n;if(oe.unmount&&oe.unmount(r),(i=r.ref)&&(i.current&&i.current!==r.__e||Bu(i,null,e)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){oe.__e(s,e)}i.base=i.__P=null,r.__c=void 0}if(i=r.__k)for(n=0;n<i.length;n++)i[n]&&mu(i[n],e,t||typeof r.type!="function");t||r.__e==null||Tf(r.__e),r.__=r.__e=r.__d=void 0}function am(r,e,t){return this.constructor(r,t)}Ef=Af.slice,oe={__e:function(r,e,t,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(r)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(r,i||{}),o=n.__d),o)return n.__E=n}catch(l){r=l}throw r}},Sf=0,go.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=zt({},this.state),typeof r=="function"&&(r=r(zt({},t),this.props)),r&&zt(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),gu(this))},go.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),gu(this))},go.prototype.render=Uu,yr=[],$f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,hu=function(r,e){return r.__v.__b-e.__v.__b},Mo.__r=0,If=0;(function(r,e){var t={__c:e="__cC"+If++,__:r,Consumer:function(i,n){return i.children(n)},Provider:function(i){var n,s;return this.getChildContext||(n=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&n.some(function(l){l.__e=!0,gu(l)})},this.sub=function(o){n.push(o);var l=o.componentWillUnmount;o.componentWillUnmount=function(){n.splice(n.indexOf(o),1),l&&l.call(o)}}),i.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}});var un=Fe("[Surveys]"),lm={icontains:r=>!!v&&v.location.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:r=>!!v&&v.location.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:r=>!!v&&di(v.location.href,r),not_regex:r=>!!v&&!di(v.location.href,r),exact:r=>v?.location.href===r,is_not:r=>v?.location.href!==r},vu=class{constructor(e){this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var t=[],i=0;i<localStorage.length;i++){var n=localStorage.key(i);n!=null&&n.startsWith("seenSurvey_")&&t.push(n)}return t})();e.forEach(t=>localStorage.removeItem(t))}loadIfEnabled(){var e,t,i,n=H==null||(e=H.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Cn(this.instance)),(t=H.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,"surveys",s=>{var o,l;if(s)return un.error("Could not load surveys script",s);this._surveyManager=(o=H.__PosthogExtensions__)===null||o===void 0||(l=o.generateSurveys)===null||l===void 0?void 0:l.call(o,this.instance)}))}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Cn(this.instance));var i=this.instance.get_property(Rl);if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:n=>{var s;if(n.statusCode!==200||!n.json)return e([]);var o,l=n.json.surveys||[],a=l.filter(u=>{var d,c,p,h,g,m,b,x,y,k,E,R;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((c=u.conditions)===null||c===void 0||(p=c.events)===null||p===void 0?void 0:p.values)&&((h=u.conditions)===null||h===void 0||(g=h.events)===null||g===void 0||(m=g.values)===null||m===void 0?void 0:m.length)>0||((b=u.conditions)===null||b===void 0?void 0:b.actions)&&((x=u.conditions)===null||x===void 0||(y=x.actions)===null||y===void 0?void 0:y.values)&&((k=u.conditions)===null||k===void 0||(E=k.actions)===null||E===void 0||(R=E.values)===null||R===void 0?void 0:R.length)>0});return a.length>0&&((o=this._surveyEventReceiver)===null||o===void 0||o.register(a)),(s=this.instance.persistence)===null||s===void 0||s.register({[Rl]:l}),e(l)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(i=>{var n,s=i.filter(a=>!(!a.start_date||a.end_date)).filter(a=>{var u,d,c,p;if(!a.conditions)return!0;var h=(u=a.conditions)===null||u===void 0||!u.url||lm[(d=(c=a.conditions)===null||c===void 0?void 0:c.urlMatchType)!==null&&d!==void 0?d:"icontains"](a.conditions.url),g=(p=a.conditions)===null||p===void 0||!p.selector||L?.querySelector(a.conditions.selector);return h&&g}),o=(n=this._surveyEventReceiver)===null||n===void 0?void 0:n.getSurveys(),l=s.filter(a=>{var u,d,c,p,h,g,m,b,x,y,k;if(!(a.linked_flag_key||a.targeting_flag_key||a.internal_targeting_flag_key||(u=a.feature_flag_keys)!==null&&u!==void 0&&u.length))return!0;var E=!a.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),R=!a.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key),q=((d=a.conditions)===null||d===void 0?void 0:d.events)&&((c=a.conditions)===null||c===void 0||(p=c.events)===null||p===void 0?void 0:p.values)&&((h=a.conditions)===null||h===void 0||(g=h.events)===null||g===void 0?void 0:g.values.length)>0,U=((m=a.conditions)===null||m===void 0?void 0:m.actions)&&((b=a.conditions)===null||b===void 0||(x=b.actions)===null||x===void 0?void 0:x.values)&&((y=a.conditions)===null||y===void 0||(k=y.actions)===null||k===void 0?void 0:k.values.length)>0,P=!q&&!U||o?.includes(a.id),B=this._canActivateRepeatedly(a),W=!(a.internal_targeting_flag_key&&!B)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key),xe=this.checkFlags(a);return E&&R&&W&&P&&xe});return e(l)},t)}checkFlags(e){var t;return(t=e.feature_flag_keys)===null||t===void 0||!t.length||e.feature_flag_keys.every(i=>{var{key:n,value:s}=i;return!n||!s||this.instance.featureFlags.isFeatureEnabled(s)})}getNextSurveyStep(e,t,i){var n,s=e.questions[t],o=t+1;if((n=s.branching)===null||n===void 0||!n.type)return t===e.questions.length-1?st.End:o;if(s.branching.type===st.End)return st.End;if(s.branching.type===st.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===st.ResponseBased){if(s.type===Ao.SingleChoice){var l,a,u=s.choices.indexOf("".concat(i));if((l=s.branching)!==null&&l!==void 0&&(a=l.responseValues)!==null&&a!==void 0&&a.hasOwnProperty(u)){var d=s.branching.responseValues[u];return Number.isInteger(d)?d:d===st.End?st.End:o}}else if(s.type===Ao.Rating){var c,p;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(m,b){if(b===3){if(m<1||m>3)throw new Error("The response must be in range 1-3");return m===1?"negative":m===2?"neutral":"positive"}if(b===5){if(m<1||m>5)throw new Error("The response must be in range 1-5");return m<=2?"negative":m===3?"neutral":"positive"}if(b===7){if(m<1||m>7)throw new Error("The response must be in range 1-7");return m<=3?"negative":m===4?"neutral":"positive"}if(b===10){if(m<0||m>10)throw new Error("The response must be in range 0-10");return m<=6?"detractors":m<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(i,s.scale);if((c=s.branching)!==null&&c!==void 0&&(p=c.responseValues)!==null&&p!==void 0&&p.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===st.End?st.End:o}}return o}return un.warn("Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return Y((t=H.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(un.warn("init was not called"),!1):H.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Y(this._surveyManager)?un.warn("init was not called"):this.getSurveys(t=>{var i=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(i)})}renderSurvey(e,t){Y(this._surveyManager)?un.warn("init was not called"):this.getSurveys(i=>{var n=i.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,L?.querySelector(t))})}},$h=Fe("[RateLimiter]"),_u=class{constructor(e){var t,i;A(this,"serverLimits",{}),A(this,"lastEventRateLimited",!1),A(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{$h.info("".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void $h.warn('could not rate limit - continuing. Error: "'.concat(o?.message,'"'),{text:s})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,i,n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(Ll))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var l=o.tokens<1;return l||n||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||n||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(i=this.instance.persistence)===null||i===void 0||i.set_property(Ll,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},um=()=>C({initialPathName:Be?.pathname||"",referringDomain:se.referringDomain()},se.campaignParams()),yu=class{constructor(e,t,i){A(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[Ol]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||um,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[Ol]}getSessionProps(){var e,t=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}},cm=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Ih=function(r,e){if(!r)return!1;var t=r.toLowerCase();return cm.concat(e||[]).some(i=>{var n=i.toLowerCase();return t.indexOf(n)!==-1})},Lf=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&Ih(t,e))return!0;try{var i=r?.userAgentData;if(i!=null&&i.brands&&i.brands.some(n=>Ih(n?.brand,e)))return!0}catch{}return!!r.webdriver},Po=class{constructor(){this.clicks=[]}isRageClick(e,t,i){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},co=Fe("[Dead Clicks]"),dm=()=>!0,pm=r=>{var e,t=!((e=r.instance.persistence)===null||e===void 0||!e.get_property(qh)),i=r.instance.config.capture_dead_clicks;return br(i)?i:t},Ro=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[qh]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"dead-clicks-autocapture",s=>{s?co.error("failed to load script",s):e()})}start(){var e;if(L){if(!this._lazyLoadedDeadClicksAutocapture&&(e=H.__PosthogExtensions__)!==null&&e!==void 0&&e.initDeadClicksAutocapture){var t=le(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=H.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(L),co.info("starting...")}}else co.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,co.info("stopping..."))}},hm=Fe("[Heatmaps]");function Ah(r){return le(r)&&"clientX"in r&&"clientY"in r&&Oe(r.clientX)&&Oe(r.clientY)}var bu=class{constructor(e){var t;A(this,"rageclicks",new Po),A(this,"_enabledServerSide",!1),A(this,"_initialized",!1),A(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Ml]),v?.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return le(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return F(this.instance.config.capture_heatmaps)?F(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;hm.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this._flushInterval)!==null&&e!==void 0?e:void 0),(t=this.deadClicksCapture)===null||t===void 0||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ml]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){v&&L&&(It(L,"click",e=>this._onClick(e||v?.event),!1,!0),It(L,"mousemove",e=>this._onMouseMove(e||v?.event),!1,!0),this.deadClicksCapture=new Ro(this.instance,dm,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var i=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,a,u){for(var d=l;d&&Do(d)&&!Vt(d,"body");){if(d===u)return!1;if(V(a,v?.getComputedStyle(d).position))return!0;d=df(d)}return!1}(cf(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:i),target_fixed:o,type:t}}_onClick(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!oh(e.target)&&Ah(e)){var n=this._getProperties(e,i);(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(C(C({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){!oh(e.target)&&Ah(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(v){var t=v.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!si(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},wu=class{constructor(e){A(this,"_updateScrollData",()=>{var t,i,n,s;this.context||(this.context={});var o=this.scrollElement(),l=this.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=l+(o?.clientHeight||0),d=o?.scrollHeight||0;this.context.lastScrollY=Math.ceil(l),this.context.maxScrollY=Math.max(l,(t=this.context.maxScrollY)!==null&&t!==void 0?t:0),this.context.maxScrollHeight=Math.max(a,(i=this.context.maxScrollHeight)!==null&&i!==void 0?i:0),this.context.lastContentY=u,this.context.maxContentY=Math.max(u,(n=this.context.maxContentY)!==null&&n!==void 0?n:0),this.context.maxContentHeight=Math.max(d,(s=this.context.maxContentHeight)!==null&&s!==void 0?s:0)}),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){v?.addEventListener("scroll",this._updateScrollData,!0),v?.addEventListener("scrollend",this._updateScrollData,!0),v?.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return v?.document.documentElement;var e=fe(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var i=v?.document.querySelector(t);if(i)return i}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return v&&(v.scrollY||v.pageYOffset||v.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return v&&(v.scrollX||v.pageXOffset||v.document.documentElement.scrollLeft)||0}},Th=Fe("[AutoCapture]");function $l(r,e){return e.length>r?e.slice(0,r)+"...":e}function fm(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!Do(e));return e}function gm(r,e,t,i){var n=r.tagName.toLowerCase(),s={tag_name:n};Gl.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=$l(1024,gf(r)):s.$el_text=$l(1024,jo(r)));var o=Eo(r);o.length>0&&(s.classes=o.filter(function(d){return d!==""})),K(r.attributes,function(d){var c;if((!pf(r)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(i==null||!i.includes(d.name))&&!e&&hi(d.value)&&(c=d.name,!Ee(c)||c.substring(0,10)!=="_ngcontent"&&c.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=Fu(p).join(" ")),s["attr__"+d.name]=$l(1024,p)}});for(var l=1,a=1,u=r;u=fm(u);)l++,u.tagName===r.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function mm(r,e){for(var t,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,u=[r],d=r;d.parentNode&&!Vt(d,"body");)lf(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var c,p=[],h={},g=!1,m=!1;if(K(u,E=>{var R=Zl(E);E.tagName.toLowerCase()==="a"&&(g=E.getAttribute("href"),g=R&&g&&hi(g)&&g),V(Eo(E),"ph-no-capture")&&(m=!0),p.push(gm(E,s,o,l));var q=function(U){if(!Zl(U))return{};var P={};return K(U.attributes,function(B){if(B.name&&B.name.indexOf("data-ph-capture-attribute")===0){var W=B.name.replace("data-ph-capture-attribute-",""),xe=B.value;W&&xe&&hi(xe)&&(P[W]=xe)}}),P}(E);Te(h,q)}),m)return{props:{},explicitNoCapture:m};if(o||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?p[0].$el_text=gf(r):p[0].$el_text=jo(r)),g){var b,x;p[0].attr__href=g;var y=(b=li(g))===null||b===void 0?void 0:b.host,k=v==null||(x=v.location)===null||x===void 0?void 0:x.host;y&&k&&y!==k&&(c=g)}return{props:Te({$event_type:n.type,$ce_version:1},a?{}:{$elements:p},{$elements_chain:O1(p)},(t=p[0])!==null&&t!==void 0&&t.$el_text?{$el_text:(i=p[0])===null||i===void 0?void 0:i.$el_text}:{},c&&n.type==="click"?{$external_click_url:c}:{},h)}}var xu=class{constructor(e){A(this,"_initialized",!1),A(this,"_isDisabledServerSide",null),A(this,"rageclicks",new Po),A(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,i=le(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),i.url_ignorelist=(t=i.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),i}_addDomEventHandlers(){if(this.isBrowserSupported()){if(v&&L){var e=i=>{i=i||v?.event;try{this._captureEvent(i)}catch(n){Th.error("Failed to capture event",n)}},t=i=>{i=i||v?.event,this._captureEvent(i,vl)};It(L,"submit",e,!1,!0),It(L,"change",e,!1,!0),It(L,"click",e,!1,!0),this.config.capture_copied_text&&(It(L,"copy",t,!1,!0),It(L,"cut",t,!1,!0))}}else Th.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Bp]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,i=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(n=>{var s=L?.querySelectorAll(n);s?.forEach(o=>{e===o&&i.push(n)})}),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Bp],n=this._isDisabledServerSide;if(Wt(n)&&!br(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var i,n=cf(e);af(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!==null&&i!==void 0&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=t===vl;if(n&&A1(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=mm(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(l)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(o.$element_selectors=a),t===vl){var u,d=uf(v==null||(u=v.getSelection())===null||u===void 0?void 0:u.toString()),c=e.type||"clipboard";if(!d)return!1;o.$selected_content=d,o.$copy_type=c}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Ze(L?.querySelectorAll)}},vm=Fe("[TracingHeaders]"),ku=class{constructor(e){A(this,"_restoreXHRPatch",void 0),A(this,"_restoreFetchPatch",void 0),A(this,"_startCapturing",()=>{var t,i,n,s;F(this._restoreXHRPatch)&&((t=H.__PosthogExtensions__)===null||t===void 0||(i=t.tracingHeadersPatchFns)===null||i===void 0||i._patchXHR(this.instance.sessionManager)),F(this._restoreFetchPatch)&&((n=H.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"tracing-headers",s=>{if(s)return vm.error("failed to load script",s);e()})}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)===null||e===void 0||e.call(this),(t=this._restoreFetchPatch)===null||t===void 0||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}},qt;(function(r){r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED"})(qt||(qt={}));var Cu=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?qt.DENIED:this.storedConsent}isOptedOut(){return this.consent===qt.DENIED||this.consent===qt.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return e==="1"?qt.GRANTED:e==="0"?qt.DENIED:qt.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?ve:At;var t=e==="localStorage"?At:ve;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)==="1"),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!Uh([Ge?.doNotTrack,Ge?.msDoNotTrack,H.doNotTrack],e=>V([!0,1,"1","yes"],e))}},po=Fe("[ExceptionAutocapture]"),Eu=class{constructor(e){var t;A(this,"originalOnUnhandledRejectionHandler",void 0),A(this,"startCapturing",()=>{var i,n,s,o;if(v&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=H.__PosthogExtensions__)===null||s===void 0||(o=s.errorWrappingFunctions)===null||o===void 0?void 0:o.wrapUnhandledRejection;if(l&&a)try{this.unwrapOnError=l(this.captureException.bind(this)),this.unwrapUnhandledRejection=a(this.captureException.bind(this))}catch(u){po.error("failed to start",u),this.stopCapturing()}else po.error("failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[qp]),this.startIfEnabled()}get isEnabled(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}get isCapturing(){var e;return!(v==null||(e=v.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(po.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,i;this.hasHandlers&&e(),(t=H.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,"exception-autocapture",n=>{if(n)return po.error("failed to load script",n);e()})}stopCapturing(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[qp]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}},mr=Fe("[Web Vitals]"),Mh=9e5,Su=class{constructor(e){var t;A(this,"_enabledServerSide",!1),A(this,"_initialized",!1),A(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),A(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((i,n)=>C(C({},i),{},{["$web_vitals_".concat(n.name,"_event")]:C({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),A(this,"_addToBuffer",i=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(F(s))mr.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this._currentURL();F(o)||(Y(i?.name)||Y(i?.value)?mr.error("Invalid metric received",i):this._maxAllowedValue&&i.value>=this._maxAllowedValue?mr.error("Ignoring metric with value >= "+this._maxAllowedValue,i):(this.buffer.url!==o&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),F(this.buffer.url)&&(this.buffer.url=o),this.buffer.firstMetricTimestamp=F(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(C(C({},i),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),A(this,"_startCapturing",()=>{var i,n,s,o,l=H.__PosthogExtensions__;F(l)||F(l.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:n,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),i&&n&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this._addToBuffer.bind(this)),this._initialized=!0):mr.error("web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Hp]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=le(this.instance.config.capture_performance)?(e=this.instance.config.capture_performance)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return F(i)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[zp])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(le(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=le(this.instance.config.capture_performance)&&Oe(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Mh;return 0<e&&e<=6e4?Mh:e}get isEnabled(){var e=le(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return br(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(mr.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=le(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=le(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Hp]:t}),this.instance.persistence.register({[zp]:i})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,i,n;(t=H.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(i=H.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"web-vitals",s=>{s?mr.error("failed to load script",s):e()})}_currentURL(){var e=v?v.location.href:void 0;return e||mr.error("Could not determine current URL"),e}},_m={icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!v&&di(e.href,r),not_regex:(r,e)=>!!v&&!di(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r},$u=class r{constructor(e){var t=this;A(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var i=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.getWebExperiments(n=>{r.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,n.forEach(s=>{if(s.feature_flag_key){var o;t._flagToExperiments&&(r.logInfo("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=t._flagToExperiments)===null||o===void 0||o.set(s.feature_flag_key,s));var l=t.instance.getFeatureFlag(s.feature_flag_key);Ee(l)&&s.variants[l]&&t.applyTransforms(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var a in s.variants){var u=s.variants[a];r.matchesTestVariant(u)&&t.applyTransforms(s.name,a,u.transforms)}})},i)}),this.instance=e,this.instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}onFeatureFlags(e){if(this._is_bot())r.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(Y(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();r.logInfo("applying feature flags",e),e.forEach(t=>{var i;if(this._flagToExperiments&&(i=this._flagToExperiments)!==null&&i!==void 0&&i.has(t)){var n,s=this.instance.getFeatureFlag(t),o=(n=this._flagToExperiments)===null||n===void 0?void 0:n.get(t);s&&o!=null&&o.variants[s]&&this.applyTransforms(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var e=r.getWindowLocation();if(e!=null&&e.search){var t=wo(e?.search,"__experiment_id"),i=wo(e?.search,"__experiment_variant");t&&i&&(r.logInfo("previewing web experiments ".concat(t," && ").concat(i)),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(t),i,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.instance.config.disable_web_experiments&&!i)return e([]);var n=this.instance.get_property("$web_experiments");if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var o=s.json.experiments||[];return e(o)}})}showPreviewWebExperiment(e,t,i){var n=i.filter(s=>s.id===e);n&&n.length>0&&(r.logInfo("Previewing web experiment [".concat(n[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(n[0].name,t,n[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!Y(e.conditions)&&r.matchUrlConditions(e)&&r.matchUTMConditions(e)}static matchUrlConditions(e){var t;if(Y(e.conditions)||Y((t=e.conditions)===null||t===void 0?void 0:t.url))return!0;var i,n,s,o=r.getWindowLocation();return!!o&&((i=e.conditions)===null||i===void 0||!i.url||_m[(n=(s=e.conditions)===null||s===void 0?void 0:s.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,o))}static getWindowLocation(){return v?.location}static matchUTMConditions(e){var t;if(Y(e.conditions)||Y((t=e.conditions)===null||t===void 0?void 0:t.utm))return!0;var i=se.campaignParams();if(i.utm_source){var n,s,o,l,a,u,d,c,p,h,g,m,b,x,y,k,E=(n=e.conditions)===null||n===void 0||(s=n.utm)===null||s===void 0||!s.utm_campaign||((o=e.conditions)===null||o===void 0||(l=o.utm)===null||l===void 0?void 0:l.utm_campaign)==i.utm_campaign,R=(a=e.conditions)===null||a===void 0||(u=a.utm)===null||u===void 0||!u.utm_source||((d=e.conditions)===null||d===void 0||(c=d.utm)===null||c===void 0?void 0:c.utm_source)==i.utm_source,q=(p=e.conditions)===null||p===void 0||(h=p.utm)===null||h===void 0||!h.utm_medium||((g=e.conditions)===null||g===void 0||(m=g.utm)===null||m===void 0?void 0:m.utm_medium)==i.utm_medium,U=(b=e.conditions)===null||b===void 0||(x=b.utm)===null||x===void 0||!x.utm_term||((y=e.conditions)===null||y===void 0||(k=y.utm)===null||k===void 0?void 0:k.utm_term)==i.utm_term;return E&&q&&U&&R}return!1}static logInfo(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];O.info("[WebExperiments] ".concat(e),i)}applyTransforms(e,t,i,n){var s;this._is_bot()?r.logInfo("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach(o=>{if(o.selector){var l;r.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),o);var a,u=0,d=(l=document)===null||l===void 0?void 0:l.querySelectorAll(o.selector);d?.forEach(c=>{var p=c;u+=1,o.attributes&&o.attributes.forEach(h=>{switch(h.name){case"text":p.innerText=h.value;break;case"html":p.innerHTML=h.value;break;case"cssClass":p.className=h.value;break;default:p.setAttribute(h.name,h.value)}}),o.text&&(p.innerText=o.text),o.html&&(p.parentElement?p.parentElement.innerHTML=o.html:p.innerHTML=o.html),o.css&&p.setAttribute("style",o.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:n,$web_experiment_document_url:(a=r.getWindowLocation())===null||a===void 0?void 0:a.href,$web_experiment_elements_modified:u})}}):(r.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:n,$web_experiment_variant:t,$web_experiment_document_url:(s=r.getWindowLocation())===null||s===void 0?void 0:s.href,$web_experiment_elements_modified:0}))}_is_bot(){return Ge&&this.instance?Lf(Ge,this.instance.config.custom_blocked_useragents):void 0}},Iu=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},ym=["$set_once","$set"],vr=Fe("[SiteApps]"),Au=class{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var i=this.globalsForEvent(t);this.bufferedInvocations.push(i),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return(e=H._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(t=e[this.instance.config.token])===null||t===void 0?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var t,i,n,s,o,l,a;if(!e)throw new Error("Event payload is required");var u={},d=this.instance.get_property("$groups")||[],c=this.instance.get_property("$stored_group_properties")||{};for(var[p,h]of Object.entries(c))u[p]={id:d[p],type:p,properties:h};var{$set_once:g,$set:m}=e;return{event:C(C({},Lh(e,ym)),{},{properties:C(C(C({},e.properties),m?{$set:C(C({},(t=(i=e.properties)===null||i===void 0?void 0:i.$set)!==null&&t!==void 0?t:{}),m)}:{}),g?{$set_once:C(C({},(n=(s=e.properties)===null||s===void 0?void 0:s.$set_once)!==null&&n!==void 0?n:{}),g)}:{}),elements_chain:(o=(l=e.properties)===null||l===void 0?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var i=s=>{var o;for(var l of(this.apps[e.id].errored=!s,this.apps[e.id].loaded=!0,vr.info("Site app with id ".concat(e.id," ").concat(s?"loaded":"errored")),s&&this.bufferedInvocations.length&&(vr.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach(a=>{var u;return(u=t.processEvent)===null||u===void 0?void 0:u.call(t,a)})),Object.values(this.apps)))if(!l.loaded)return;(o=this.stopBuffering)===null||o===void 0||o.call(this)};try{var{processEvent:n}=e.init({posthog:this.instance,callback:s=>{i(s)}});n&&(t.processEvent=n)}catch(s){vr.error("Error while initializing PostHog app with config id ".concat(e.id),s),i(!1)}}onCapturedEvent(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{var n;(n=i.processEvent)===null||n===void 0||n.call(i,t)}catch(s){vr.error("Error while processing event ".concat(e.event," for site app ").concat(i.id),s)}}}onRemoteConfig(e){var t,i,n,s=this;if((t=this.siteAppLoaders)!==null&&t!==void 0&&t.length){if(!this.isEnabled)return void vr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var o of this.siteAppLoaders)this.setupSiteApp(o);this.instance.on("eventCaptured",d=>this.onCapturedEvent(d))}else if((i=this.stopBuffering)===null||i===void 0||i.call(this),(n=e.siteApps)!==null&&n!==void 0&&n.length)if(this.isEnabled){var l=function(d,c){var p,h;H["__$$ph_site_app_".concat(d)]=s.instance,(p=H.__PosthogExtensions__)===null||p===void 0||(h=p.loadSiteApp)===null||h===void 0||h.call(p,s.instance,c,g=>{if(g)return vr.error("Error while initializing PostHog app with config id ".concat(d),g)})};for(var{id:a,url:u}of e.siteApps)l(a,u)}else vr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},yn={},Tu=()=>{},ni="posthog",Ff=!Q1&&we?.indexOf("MSIE")===-1&&we?.indexOf("Mozilla")===-1,Ph=()=>{var r,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=L?.location,t=e?.hostname,!!Ee(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Tu,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Be&&Ee(Be?.search)&&Be.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(r=v.location)===null||r===void 0?void 0:r.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:i=>{var n="Bad HTTP status: "+i.statusCode+" "+i.text;O.error(n)},get_device_id:i=>i,_onCapture:Tu,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},Rh=r=>{var e={};F(r.process_person)||(e.person_profiles=r.process_person),F(r.xhr_headers)||(e.request_headers=r.xhr_headers),F(r.cookie_name)||(e.persistence_name=r.cookie_name),F(r.disable_cookie)||(e.disable_persistence=r.disable_cookie);var t=Te({},e,r);return fe(r.property_blacklist)&&(F(r.property_denylist)?t.property_denylist=r.property_blacklist:fe(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:O.error("Invalid value for property_denylist config: "+r.property_denylist)),t},Mu=class{constructor(){A(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){O.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Oo=class r{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)===null||t===void 0?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){A(this,"webPerformance",new Mu),A(this,"version",$t.LIB_VERSION),A(this,"_internalEventEmitter",new To),this.config=Ph(),this.SentryIntegration=cu,this.sentryIntegration=e=>function(t,i){var n=Cf(t,i);return{name:kf,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new Nl(this),this.toolbar=new su(this),this.scrollManager=new wu(this),this.pageViewManager=new du(this),this.surveys=new vu(this),this.experiments=new $u(this),this.exceptions=new Iu(this),this.rateLimiter=new _u(this),this.requestRouter=new uu(this),this.consent=new Cu(this),this.people={set:(e,t,i)=>{var n=Ee(e)?{[e]:t}:e;this.setPersonProperties(n),i?.({})},set_once:(e,t,i)=>{var n=Ee(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),i?.({})}},this.on("eventCaptured",e=>O.info('send "'.concat(e?.event,'"'),e))}init(e,t,i){if(i&&i!==ni){var n,s=(n=yn[i])!==null&&n!==void 0?n:new r;return s._init(e,t,i),yn[i]=s,yn[ni][i]=s,s}return this._init(e,t,i)}_init(e){var t,i,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(F(e)||Np(e))return O.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return O.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],s.person_profiles&&(this._initialPersonProfilesConfig=s.person_profiles),this.set_config(Te({},Ph(),Rh(s),{name:o,token:e})),this.config.on_xhr_error&&O.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:dt.GZipJS,this.persistence=new mn(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new mn(C(C({},this.config),{},{persistence:"sessionStorage"}));var l=C({},this.persistence.props),a=C({},this.sessionPersistence.props);if(this._requestQueue=new ou(y=>this._send_retriable_request(y)),this._retryQueue=new au(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new lu(this),this.sessionPropsManager=new yu(this.sessionManager,this.persistence)),new ku(this).startIfEnabledOrStop(),this.siteApps=new Au(this),(t=this.siteApps)===null||t===void 0||t.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new iu(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new xu(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new bu(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Su(this),this.exceptionObserver=new Eu(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Ro(this,pm),this.deadClicksAutocapture.startIfEnabled(),$t.DEBUG=$t.DEBUG||this.config.debug,$t.DEBUG&&O.info("Starting in debug mode",{this:this,config:s,thisC:C({},this.config),p:l,s:a}),this._sync_opt_out_with_persistence(),((i=s.bootstrap)===null||i===void 0?void 0:i.distinctID)!==void 0){var u,d,c=this.config.get_device_id(Ht()),p=(u=s.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?c:s.bootstrap.distinctID;this.persistence.set_property(Ct,(d=s.bootstrap)!==null&&d!==void 0&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var h,g,m=Object.keys(((h=s.bootstrap)===null||h===void 0?void 0:h.featureFlags)||{}).filter(y=>{var k,E;return!((k=s.bootstrap)===null||k===void 0||(E=k.featureFlags)===null||E===void 0||!E[y])}).reduce((y,k)=>{var E,R;return y[k]=((E=s.bootstrap)===null||E===void 0||(R=E.featureFlags)===null||R===void 0?void 0:R[k])||!1,y},{}),b=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(y=>m[y]).reduce((y,k)=>{var E,R,q,U;return(E=s.bootstrap)!==null&&E!==void 0&&(R=E.featureFlagPayloads)!==null&&R!==void 0&&R[k]&&(y[k]=(q=s.bootstrap)===null||q===void 0||(U=q.featureFlagPayloads)===null||U===void 0?void 0:U[k]),y},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:b})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Kp,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(Ht());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(Ct,"anonymous")}return v==null||(n=v.addEventListener)===null||n===void 0||n.call(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?tm(this,()=>this._loaded()):this._loaded(),Ze(this.config._onCapture)&&this.config._onCapture!==Tu&&(O.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",y=>this.config._onCapture(y.event,y))),this}_onRemoteConfig(e){var t,i,n,s,o,l,a,u,d;if(!L||!L.body)return O.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=V(e.supportedCompression,dt.GZipJS)?dt.GZipJS:V(e.supportedCompression,dt.Base64)?dt.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),(i=this.siteApps)===null||i===void 0||i.onRemoteConfig(e),(n=this.sessionRecording)===null||n===void 0||n.onRemoteConfig(e),(s=this.autocapture)===null||s===void 0||s.onRemoteConfig(e),(o=this.heatmaps)===null||o===void 0||o.onRemoteConfig(e),(l=this.surveys)===null||l===void 0||l.onRemoteConfig(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.onRemoteConfig(e),(u=this.exceptionObserver)===null||u===void 0||u.onRemoteConfig(e),(d=this.deadClicksAutocapture)===null||d===void 0||d.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){O.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new nu(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||ai(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(t=this._retryQueue)===null||t===void 0||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Ff?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Io(e.url,{ip:this.config.ip?1:0}),e.headers=C({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var i,n,s,o=C({},t);o.timeout=o.timeout||6e4,o.url=Io(o.url,{_:new Date().getTime().toString(),ver:$t.LIB_VERSION,compression:o.compression});var l=(i=o.transport)!==null&&i!==void 0?i:"fetch",a=(n=(s=Uh(_n,u=>u.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:_n[0].method;if(!a)throw new Error("No available transport method");a(o)})(C(C({},e),{},{callback:t=>{var i,n,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(s=this.config).on_request_error)===null||n===void 0||n.call(s,t)),(i=e.callback)===null||i===void 0||i.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,i=[],n=[],s=[];ai(e,l=>{l&&(t=l[0],fe(t)?s.push(l):Ze(l)?l.call(this):fe(l)&&t==="alias"?i.push(l):fe(l)&&t.indexOf("capture")!==-1&&Ze(this[t])?s.push(l):n.push(l))});var o=function(l,a){ai(l,function(u){if(fe(u[0])){var d=a;K(u,function(c){d=d[c[0]].apply(d,c.slice(1))})}else this[u[0]].apply(this,u.slice(1))},a)};o(i,this),o(n,this),o(s,this)}_hasBootstrappedFeatureFlags(){var e,t;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!F(e)&&Ee(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=i?.timestamp||o,a=Ht(),u={uuid:a,event:e,properties:this._calculate_event_properties(e,t||{},l,a)};s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(u.$set=i?.$set);var d=this._calculate_set_once_properties(i?.$set_once);d&&(u.$set_once=d),(u=l1(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,F(i?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var c=C(C({},u.properties.$set),u.$set);if(si(c)||this.setPersonPropertiesForFlags(c),!Y(this.config.before_send)){var p=this._runBeforeSend(u);if(!p)return;u=p}this._internalEventEmitter.emit("eventCaptured",u);var h={method:"POST",url:(n=i?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(h):this._requestQueue.enqueue(h),u}O.critical("This capture call is ignored due to client rate limiting.")}}else O.error("No event name provided to posthog.capture")}else O.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,i,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var s=this.persistence.remove_event_timer(e),o=C({},t);if(o.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(o.$cklsh_mode=!0),e==="$snapshot"){var l=C(C({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Ee(o.distinct_id)&&!Oe(o.distinct_id)||Np(o.distinct_id))&&O.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var a,u=se.properties();if(this.sessionManager){var{sessionId:d,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();o.$session_id=d,o.$window_id=c}if(this.sessionRecording&&(o.$recording_status=this.sessionRecording.status),this.requestRouter.region===wr.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var p=this.sessionPropsManager.getSessionProps();o=Te(o,p)}if(a=e==="$pageview"?this.pageViewManager.doPageView(i,n):e==="$pageleave"?this.pageViewManager.doPageLeave(i):this.pageViewManager.doEvent(),o=Te(o,a),e==="$pageview"&&L&&(o.title=L.title),!F(s)){var h=i.getTime()-s;o.$duration=parseFloat((h/1e3).toFixed(3))}we&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Te({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),fe(this.config.property_denylist)?K(this.config.property_denylist,function(b){delete o[b]}):O.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(O.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,e));var m=this._hasPersonProcessing();return o.$process_person_profile=m,m&&this._requirePersonProcessing("_calculate_event_properties"),o}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Te({},this.persistence.get_initial_props(),e||{}),i=this.config.sanitize_properties;return i&&(O.error("sanitize_properties is deprecated. Use before_send instead"),t=i(t,"$set_once")),si(t)?void 0:t}register(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}register_once(e,t,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}unregister(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}identify(e,t,i){if(!this.__loaded||!this.persistence)return O.uninitializedWarning("posthog.identify");if(Oe(e)&&(e=e.toString(),O.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))O.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(cn)&&(this.unregister(cn),this.register({distinct_id:e}));var o=(this.persistence.get_property(Ct)||"anonymous")==="anonymous";e!==n&&o?(this.persistence.set_property(Ct,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(yo))}}else O.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:C(C({},n),{},{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}}else O.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,n,s,o;if(O.info("reset"),!this.__loaded)return O.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(n=this.surveys)===null||n===void 0||n.reset(),(s=this.persistence)===null||s===void 0||s.set_property(Ct,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId(),this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Kp,$device_id:null},"");else{var a=this.config.get_device_id(Ht());this.register_once({distinct_id:a,$device_id:e?a:l},"")}}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(e!=null&&e.withTimestamp&&i){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!i)return n;var l=Math.max(Math.floor((new Date().getTime()-i)/1e3)-o,0);n+="?t=".concat(l)}return n}alias(e,t){return e===this.get_property(Bh)?(O.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(cn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(O.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,n,s,o=C({},this.config);le(e)&&(Te(this.config,Rh(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new mn(C(C({},this.config),{},{persistence:"sessionStorage"})),ve.is_supported()&&ve.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&($t.DEBUG=!0,O.info("set_config",{config:e,oldConfig:o,newConfig:C({},this.config)})),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(n=this.autocapture)===null||n===void 0||n.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var n,s,o,l,a;(n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),i.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),i.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),i.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),i.event_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}captureException(e,t){var i,n=new Error("PostHog syntheticException"),s=Ze((i=H.__PosthogExtensions__)===null||i===void 0?void 0:i.parseErrorAsProperties)?H.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):C({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},t);this.exceptions.sendExceptionEvent(s)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:ni;return t!==ni&&(t=ni+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(Ct))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(Ct))==="identified"}_hasPersonProcessing(){var e,t,i,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&si(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[cn])&&((i=this.persistence)===null||i===void 0||(n=i.props)===null||n===void 0||!n[bo]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return this.config.person_profiles==="never"?(O.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(bo,!0),!0)}_sync_opt_out_with_persistence(){var e,t,i,n,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,l=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==l&&((i=this.persistence)===null||i===void 0||i.set_disabled(l)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==l&&((n=this.sessionPersistence)===null||n===void 0||n.set_disabled(l))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Ge?Lf(Ge,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){L&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:L.title},{send_instantly:!0}))}debug(e){e===!1?(v?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(v?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(e){if(Y(this.config.before_send))return e;var t=fe(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var n of t){if(i=n(i),Y(i)){var s="Event '".concat(e.event,"' was rejected in beforeSend function");return o1(e.event)?O.warn("".concat(s,". This can cause unexpected behavior.")):O.info(s),null}i.properties&&!si(i.properties)||O.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return i}getPageViewId(){var e;return(e=this.pageViewManager._currentPageview)===null||e===void 0?void 0:e.pageViewId}};(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=a1(r.prototype[e[t]])})(Oo,["identify"]);var Oh,Df=(Oh=yn[ni]=new Oo,function(){function r(){r.done||(r.done=!0,Ff=!1,K(yn,function(e){e._dom_loaded()}))}L!=null&&L.addEventListener&&(L.readyState==="complete"?r():L.addEventListener("DOMContentLoaded",r,!1)),v&&It(v,"load",r,!0)}(),Oh);var jf=Df.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,advanced_disable_decide:!0},"MolinShopAI");function De(r,e){if(!jf)throw new Error("Failed to initialize PostHog");jf.capture(r,e)}var Uo,$n,Bo,Gt,Uf,No,En=class En extends z(j){constructor(){super();w(this,Gt);w(this,Uo,new Ut(this,{onError:console.error}));w(this,$n);w(this,Bo,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),De("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{De("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{De("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{De("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{De("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{De("ShopAssistant: user sent input",t),he("ShopAssistant: user sent input",t)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData="",this.xPromptExt=""}get config(){return f(this,$n)||f(this,Uo).data}render(){return this.config?_`
691
876
  <!-- embed our chat component forwarding props -->
692
877
  <mw-chat
693
878
  widget="${this.widgetId}"
694
879
  .config="${this.config}"
695
- .callbacks="${f(this,Mo)}"
880
+ .callbacks="${f(this,Bo)}"
696
881
  x-user-data="${this.xUserData}"
697
882
  x-prompt-ext="${this.xPromptExt}"
698
883
  ?show-close="${this.showClose}"
699
- @mw:close-click="${E(this,Wt,Of)}">
884
+ @mw:close-click="${S(this,Gt,Uf)}">
700
885
  <slot name="banner" slot="banner"></slot>
701
886
  </mw-chat>
702
- `:j}injectConfig(t){I(this,Cn,t),this.requestUpdate()}reloadConfig(){f(this,Wt,Ao)?.reloadConfig()}get conversationId(){return f(this,Wt,Ao)?.conversationId??""}get messages(){return f(this,Wt,Ao)?.messages??[]}};To=new WeakMap,Cn=new WeakMap,Mo=new WeakMap,Wt=new WeakSet,Of=function(){this.dispatchEvent(new xn.CloseClickEvent)},Ao=function(){return this.renderRoot.querySelector("mw-chat")},M(xn,"styles",ft`
887
+ `:N}injectConfig(t){I(this,$n,t),this.requestUpdate()}reloadConfig(){f(this,Gt,No)?.reloadConfig()}get conversationId(){return f(this,Gt,No)?.conversationId??""}get messages(){return f(this,Gt,No)?.messages??[]}};Uo=new WeakMap,$n=new WeakMap,Bo=new WeakMap,Gt=new WeakSet,Uf=function(){this.dispatchEvent(new En.CloseClickEvent)},No=function(){return this.renderRoot.querySelector("mw-chat")},M(En,"styles",gt`
703
888
  :host {
704
889
  all: initial; /* reset all properties that can pierce the shadow DOM */
705
890
  }
706
- `),M(xn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var kn=xn;customElements.define("molin-shop-ai-chat",kn);var Mu;kn.CloseClickEvent=(Mu=class extends CustomEvent{constructor(e={}){super(kn.CloseClickEvent.type,{...e})}},M(Mu,"type","mw:close-click"),Mu);var Po,Sn=class extends z(q){constructor(){super();b(this,Po,new Nt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return f(this,Po).data}render(){return this.config?C`
891
+ `),M(En,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var Sn=En;customElements.define("molin-shop-ai-chat",Sn);var qu;Sn.CloseClickEvent=(qu=class extends CustomEvent{constructor(e={}){super(Sn.CloseClickEvent.type,{...e})}},M(qu,"type","mw:close-click"),qu);var qo,In=class extends z(j){constructor(){super();w(this,qo,new Ut(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return f(this,qo).data}render(){return this.config?_`
707
892
  <!-- embed our bubble component forwarding props -->
708
893
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
709
- <mw-bubble state="${this.state}" src="${Ai(this.config?.bubble?.imageUrl)}"></mw-bubble>
710
- `:j}};Po=new WeakMap,M(Sn,"styles",ft`
894
+ <mw-bubble state="${this.state}" src="${Ot(this.config?.bubble?.imageUrl)}"></mw-bubble>
895
+ `:N}};qo=new WeakMap,M(In,"styles",gt`
711
896
  :host {
712
897
  all: initial; /* reset all properties that can pierce the shadow DOM */
713
898
  }
714
- `),M(Sn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Sn);var Ro,fi,gi,kr,$n,In,En=class{constructor(e,t,i,n=window.history){b(this,Ro);b(this,fi);b(this,gi);b(this,kr);b(this,$n,!1);b(this,In,()=>{f(this,fi).test(window.location.pathname)&&f(this,gi).navigated()});I(this,Ro,e),I(this,fi,t),I(this,gi,i),I(this,kr,n),e.addController(this)}hostConnected(){window.addEventListener("pageshow",f(this,In));let e=f(this,kr).pushState;f(this,kr).pushState=(...t)=>{if(e.call(f(this,kr),...t),!f(this,$n))try{let i=new URL(t[2],window.location.origin);f(this,fi).test(i.pathname)&&f(this,gi).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",f(this,In)),I(this,$n,!0)}};Ro=new WeakMap,fi=new WeakMap,gi=new WeakMap,kr=new WeakMap,$n=new WeakMap,In=new WeakMap;function Lf({minMs:r,maxMs:e}){return Math.random()*(e-r)+r}function Pu(r,e=""){return Object.entries(r).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}function Ff(r,e={}){return[Pu(r),Pu(e,"max-sm:")].join(" ")}function Df(r){return Pu(r)}function Ru(r){return Object.entries(r).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let i=`sm:${e}-[${t}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function jf(r){let e=Ru(r),i=`sm:bottom-[${r.bottom?`calc(${r.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var Gt,ht,Lu,An,Ou=class{constructor(e=window.localStorage){b(this,ht);b(this,Gt);I(this,Gt,e)}setex(e,t,i){return f(this,Gt).setItem(e,E(this,ht,An).call(this,{value:E(this,ht,An).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return f(this,Gt).setItem(e,E(this,ht,An).call(this,{value:E(this,ht,An).call(this,t)})||"")}get(e){let t=f(this,Gt).getItem(e);if(!t)return;let i=E(this,ht,Lu).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){f(this,Gt).removeItem(e);return}return E(this,ht,Lu).call(this,i.value)}}};Gt=new WeakMap,ht=new WeakSet,Lu=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},An=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var Fu=new Ou;var Nf="molin-shop-ai-widget-open",Oo,Pn,ju,Nu,ue,Lo,re,Uf,Mn,Du,Bf,qf,Hf,mi,Tn=class extends z(q){constructor(){super();b(this,re);b(this,Oo,new Nt(this,{onError:console.error}));b(this,Pn);b(this,ju,new En(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=f(this,re,Du);t&&De("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,Nu,new En(this,/.*/i,{navigated:()=>{let t=f(this,re,Du);he("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:t?.conversationId||"",url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0})}}));b(this,ue,!1);b(this,Lo,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),De("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{De("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{De("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{De("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{De("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{De("ShopAssistant: user sent input",t),he("ShopAssistant: user sent input",t)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData="",this.xPromptExt="",this._dialogAlreadyShown=!1}get config(){return f(this,Pn)||f(this,Oo).data}render(){if(!this.config)return j;let t=Ff(this.config.bubble.position,this.config.bubble.mobilePosition),i=Df(this.config.bubble.position),n=Ru(this.config.bubble.position),s=jf(this.config.bubble.position);return this.config.hidden?j:C`
899
+ `),M(In,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",In);var Ho,mi,vi,Cr,Tn,Mn,An=class{constructor(e,t,i,n=window.history){w(this,Ho);w(this,mi);w(this,vi);w(this,Cr);w(this,Tn,!1);w(this,Mn,()=>{f(this,mi).test(window.location.pathname)&&f(this,vi).navigated()});I(this,Ho,e),I(this,mi,t),I(this,vi,i),I(this,Cr,n),e.addController(this)}hostConnected(){window.addEventListener("pageshow",f(this,Mn));let e=f(this,Cr).pushState;f(this,Cr).pushState=(...t)=>{if(e.call(f(this,Cr),...t),!f(this,Tn))try{let i=new URL(t[2],window.location.origin);f(this,mi).test(i.pathname)&&f(this,vi).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",f(this,Mn)),I(this,Tn,!0)}};Ho=new WeakMap,mi=new WeakMap,vi=new WeakMap,Cr=new WeakMap,Tn=new WeakMap,Mn=new WeakMap;function Bf({minMs:r,maxMs:e}){return Math.random()*(e-r)+r}function Hu(r,e=""){return Object.entries(r).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}function qf(r,e={}){return[Hu(r),Hu(e,"max-sm:")].join(" ")}function Hf(r){return Hu(r)}function zu(r){return Object.entries(r).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let i=`sm:${e}-[${t}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function zf(r){let e=zu(r),i=`sm:bottom-[${r.bottom?`calc(${r.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var Zt,ft,Wu,Pn,Vu=class{constructor(e=window.localStorage){w(this,ft);w(this,Zt);I(this,Zt,e)}setex(e,t,i){return f(this,Zt).setItem(e,S(this,ft,Pn).call(this,{value:S(this,ft,Pn).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return f(this,Zt).setItem(e,S(this,ft,Pn).call(this,{value:S(this,ft,Pn).call(this,t)})||"")}get(e){let t=f(this,Zt).getItem(e);if(!t)return;let i=S(this,ft,Wu).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){f(this,Zt).removeItem(e);return}return S(this,ft,Wu).call(this,i.value)}}};Zt=new WeakMap,ft=new WeakSet,Wu=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Pn=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var Gu=new Vu;var Vf="molin-shop-ai-widget-open",zo,Ln,Ju,Xu,ue,Vo,re,Wf,On,Zu,Gf,Zf,Jf,_i,Rn=class extends z(j){constructor(){super();w(this,re);w(this,zo,new Ut(this,{onError:console.error}));w(this,Ln);w(this,Ju,new An(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=f(this,re,Zu);t&&De("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));w(this,Xu,new An(this,/.*/i,{navigated:()=>{let t=f(this,re,Zu);he("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:t?.conversationId||"",url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0})}}));w(this,ue,!1);w(this,Vo,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),De("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{De("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{De("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{De("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{De("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{De("ShopAssistant: user sent input",t),he("ShopAssistant: user sent input",t)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData="",this.xPromptExt="",this._dialogAlreadyShown=!1}get config(){return f(this,Ln)||f(this,zo).data}render(){if(!this.config)return N;let t=qf(this.config.bubble.position,this.config.bubble.mobilePosition),i=Hf(this.config.bubble.position),n=zu(this.config.bubble.position),s=zf(this.config.bubble.position);return this.config.hidden?N:_`
715
900
  <mw-bubble
716
- class="${t} ${f(this,ue)?"opacity-0":"opacity-100"} fixed z-[${f(this,re,Uf)}] transition-opacity"
717
- @click="${E(this,re,qf)}"
901
+ class="${t} ${f(this,ue)?"opacity-0":"opacity-100"} fixed z-[${f(this,re,Wf)}] transition-opacity"
902
+ @click="${S(this,re,Zf)}"
718
903
  state="${f(this,ue)?"close":"open"}"
719
904
  src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
720
905
 
721
906
  <!-- only load the component if enabled on any platform -->
722
- ${this.isPopupEnabled?C`
907
+ ${this.isPopupEnabled?_`
723
908
  <mw-popup
724
909
  position="${s}"
725
- delay="${this.config.popup?.delayMs||Lf({minMs:2e3,maxMs:5e3})}"
910
+ delay="${this.config.popup?.delayMs||Bf({minMs:2e3,maxMs:5e3})}"
726
911
  sound="https://assets.molinai.io/2024/widget-v20241209/popup.aac"
727
912
  .content="${{desktop:{text:this.config.popup?.text||"Hello there. How can we help?"},mobile:{title:this.config.popup?.mobileTitleText||`Chat with ${this.config.title}`,text:this.config.popup?.text||"Hello there. How can we help?",button:this.config.popup?.mobileButtonText||`Chat with ${this.config.title}`,color:this.config.color,poweredBy:!this.config.removePoweredBy}}}"
728
- @mw:click="${E(this,re,Bf)}"></mw-popup>
729
- `:j}
913
+ @mw:click="${S(this,re,Gf)}"></mw-popup>
914
+ `:N}
730
915
 
731
916
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
732
- ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?C`<mw-try-it-out
917
+ ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?_`<mw-try-it-out
733
918
  class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
734
919
  position="${i}"
735
- text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:j}
920
+ text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:N}
736
921
 
737
922
  <!-- On first render, do not render the dialog, so it does not connect to backend. Once it's rendered once, it's never removed from the DOM. -->
738
- ${this._dialogAlreadyShown?C`
923
+ ${this._dialogAlreadyShown?_`
739
924
  <div
740
925
  class="${f(this,ue)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${n} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:bottom-[1.5rem] sm:top-auto sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-[36px] 2xl:max-w-[420px]">
741
926
  <mw-chat
742
927
  widget="${this.widgetId}"
743
928
  .config="${this.config}"
744
- .callbacks="${f(this,Lo)}"
929
+ .callbacks="${f(this,Vo)}"
745
930
  ?show-close="${!0}"
746
931
  x-user-data="${this.xUserData}"
747
932
  x-prompt-ext="${this.xPromptExt}"
748
- @mw:close-click="${E(this,re,Hf)}">
933
+ @mw:close-click="${S(this,re,Jf)}">
749
934
  <slot name="banner" slot="banner"></slot>
750
935
  </mw-chat>
751
936
  </div>
752
- `:j}
753
- `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,ue)&&f(this,re,Mn)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&Fu.get(Nf)?.isOpen&&this.openChat()}openChat(){f(this,ue)||(I(this,ue,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),E(this,re,mi).call(this,!0),f(this,re,Mn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ue)?"open":"close"}))}closeChat(){f(this,ue)&&(I(this,ue,!1),this.requestUpdate(),E(this,re,mi).call(this,!1),f(this,re,Mn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ue)?"open":"close"}))}injectConfig(t){I(this,Pn,t),this.requestUpdate()}};Oo=new WeakMap,Pn=new WeakMap,ju=new WeakMap,Nu=new WeakMap,ue=new WeakMap,Lo=new WeakMap,re=new WeakSet,Uf=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},Mn=function(){return this.renderRoot.querySelector("mw-popup")},Du=function(){return this.renderRoot.querySelector("mw-chat")},Bf=function(){I(this,ue,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),E(this,re,mi).call(this,!0),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:f(this,ue)?"open":"close"})},qf=function(){I(this,ue,!f(this,ue)),this._dialogAlreadyShown=!0,this.requestUpdate(),E(this,re,mi).call(this,f(this,ue)),f(this,re,Mn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:f(this,ue)?"open":"close"})},Hf=function(){I(this,ue,!1),this.requestUpdate(),E(this,re,mi).call(this,!1),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:f(this,ue)?"open":"close"})},mi=function(t){Fu.set(Nf,{isOpen:t})},M(Tn,"styles",ft`
937
+ `:N}
938
+ `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,ue)&&f(this,re,On)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&Gu.get(Vf)?.isOpen&&this.openChat()}openChat(){f(this,ue)||(I(this,ue,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),S(this,re,_i).call(this,!0),f(this,re,On)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ue)?"open":"close"}))}closeChat(){f(this,ue)&&(I(this,ue,!1),this.requestUpdate(),S(this,re,_i).call(this,!1),f(this,re,On)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ue)?"open":"close"}))}injectConfig(t){I(this,Ln,t),this.requestUpdate()}};zo=new WeakMap,Ln=new WeakMap,Ju=new WeakMap,Xu=new WeakMap,ue=new WeakMap,Vo=new WeakMap,re=new WeakSet,Wf=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},On=function(){return this.renderRoot.querySelector("mw-popup")},Zu=function(){return this.renderRoot.querySelector("mw-chat")},Gf=function(){I(this,ue,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),S(this,re,_i).call(this,!0),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:f(this,ue)?"open":"close"})},Zf=function(){I(this,ue,!f(this,ue)),this._dialogAlreadyShown=!0,this.requestUpdate(),S(this,re,_i).call(this,f(this,ue)),f(this,re,On)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:f(this,ue)?"open":"close"})},Jf=function(){I(this,ue,!1),this.requestUpdate(),S(this,re,_i).call(this,!1),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:f(this,ue)?"open":"close"})},_i=function(t){Gu.set(Vf,{isOpen:t})},M(Rn,"styles",gt`
754
939
  :host {
755
940
  all: initial; /* reset all properties that can pierce the shadow DOM */
756
941
  }
757
- `),M(Tn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",Tn);
942
+ `),M(Rn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",Rn);
758
943
  /*! Bundled license information:
759
944
 
760
945
  @lit/reactive-element/css-tag.js:
@@ -833,4 +1018,11 @@ lit-html/directives/unsafe-html.js:
833
1018
  * Copyright 2017 Google LLC
834
1019
  * SPDX-License-Identifier: BSD-3-Clause
835
1020
  *)
1021
+
1022
+ lit-html/directives/choose.js:
1023
+ (**
1024
+ * @license
1025
+ * Copyright 2021 Google LLC
1026
+ * SPDX-License-Identifier: BSD-3-Clause
1027
+ *)
836
1028
  */