@molin.ai/shop-ai 0.7.18 → 0.7.20

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,16 +1,16 @@
1
- var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in i?Kp(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var T=(i,e,t)=>Zp(i,typeof e!="symbol"?e+"":e,t),Bs=(i,e,t)=>e.has(i)||Nl("Cannot "+t);var f=(i,e,t)=>(Bs(i,e,"read from private field"),t?t.call(i):e.get(i)),y=(i,e,t)=>e.has(i)?Nl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),E=(i,e,t,r)=>(Bs(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$=(i,e,t)=>(Bs(i,e,"access private method"),t);var Ul=(i,e,t,r)=>({set _(n){E(i,e,n,t)},get _(){return f(i,e,r)}});var an=globalThis,ln=an.ShadowRoot&&(an.ShadyCSS===void 0||an.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),jl=new WeakMap,nr=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Hs)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(ln&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=jl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&jl.set(t,e))}return e}toString(){return this.cssText}},ql=i=>new nr(typeof i=="string"?i:i+"",void 0,Hs),gt=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,s)=>r+(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)+i[s+1],i[0]);return new nr(t,i,Hs)},zs=(i,e)=>{if(ln)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=an.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},un=ln?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ql(t)})(i):i;var{is:Qp,defineProperty:eh,getOwnPropertyDescriptor:th,getOwnPropertyNames:ih,getOwnPropertySymbols:rh,getPrototypeOf:nh}=Object,cn=globalThis,Bl=cn.trustedTypes,sh=Bl?Bl.emptyScript:"",oh=cn.reactiveElementPolyfillSupport,sr=(i,e)=>i,Ws={toAttribute(i,e){switch(e){case Boolean:i=i?sh:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},zl=(i,e)=>!Qp(i,e),Hl={attribute:!0,type:String,converter:Ws,reflect:!1,hasChanged:zl};Symbol.metadata??=Symbol("metadata"),cn.litPropertyMetadata??=new WeakMap;var vt=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=Hl){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&eh(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:s}=th(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,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Hl}static _$Ei(){if(this.hasOwnProperty(sr("elementProperties")))return;let e=nh(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(sr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(sr("properties"))){let t=this.properties,r=[...ih(t),...rh(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(un(n))}else e!==void 0&&t.push(un(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r: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 r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return zs(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,r){this._$AK(e,r)}_$EC(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(r.converter?.toAttribute!==void 0?r.converter:Ws).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=r.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Ws;this._$Em=n,this[n]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??zl)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.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 r=this.constructor.elementProperties;if(r.size>0)for(let[n,s]of r)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(r=>r.hostUpdate?.()),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}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){}};vt.elementStyles=[],vt.shadowRootOptions={mode:"open"},vt[sr("elementProperties")]=new Map,vt[sr("finalized")]=new Map,oh?.({ReactiveElement:vt}),(cn.reactiveElementVersions??=[]).push("2.0.4");var Gs=globalThis,dn=Gs.trustedTypes,Wl=dn?dn.createPolicy("lit-html",{createHTML:i=>i}):void 0,Js="$lit$",mt=`lit$${Math.random().toFixed(9).slice(2)}$`,Xs="?"+mt,ah=`<${Xs}>`,Xt=document,ar=()=>Xt.createComment(""),lr=i=>i===null||typeof i!="object"&&typeof i!="function",Ys=Array.isArray,Kl=i=>Ys(i)||typeof i?.[Symbol.iterator]=="function",Vs=`[
2
- \f\r]`,or=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vl=/-->/g,Gl=/>/g,Gt=RegExp(`>|${Vs}(?:([^\\s"'>=/]+)(${Vs}*=${Vs}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Jl=/'/g,Xl=/"/g,Zl=/^(?:script|style|textarea|title)$/i,Ks=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),L=Ks(1),Dg=Ks(2),Lg=Ks(3),it=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),Yl=new WeakMap,Jt=Xt.createTreeWalker(Xt,129);function Ql(i,e){if(!Ys(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wl!==void 0?Wl.createHTML(e):e}var eu=(i,e)=>{let t=i.length-1,r=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=or;for(let l=0;l<t;l++){let a=i[l],c,d,u=-1,p=0;for(;p<a.length&&(o.lastIndex=p,d=o.exec(a),d!==null);)p=o.lastIndex,o===or?d[1]==="!--"?o=Vl:d[1]!==void 0?o=Gl:d[2]!==void 0?(Zl.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Gt):d[3]!==void 0&&(o=Gt):o===Gt?d[0]===">"?(o=n??or,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Gt:d[3]==='"'?Xl:Jl):o===Xl||o===Jl?o=Gt:o===Vl||o===Gl?o=or:(o=Gt,n=void 0);let h=o===Gt&&i[l+1].startsWith("/>")?" ":"";s+=o===or?a+ah:u>=0?(r.push(c),a.slice(0,u)+Js+a.slice(u)+mt+h):a+mt+(u===-2?l:h)}return[Ql(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ur=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0,l=e.length-1,a=this.parts,[c,d]=eu(e,t);if(this.el=i.createElement(c,r),Jt.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=Jt.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(Js)){let p=d[o++],h=n.getAttribute(u).split(mt),g=/([.?@])?(.*)/.exec(p);a.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?hn:g[1]==="?"?fn:g[1]==="@"?gn:Kt}),n.removeAttribute(u)}else u.startsWith(mt)&&(a.push({type:6,index:s}),n.removeAttribute(u));if(Zl.test(n.tagName)){let u=n.textContent.split(mt),p=u.length-1;if(p>0){n.textContent=dn?dn.emptyScript:"";for(let h=0;h<p;h++)n.append(u[h],ar()),Jt.nextNode(),a.push({type:2,index:++s});n.append(u[p],ar())}}}else if(n.nodeType===8)if(n.data===Xs)a.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(mt,u+1))!==-1;)a.push({type:7,index:s}),u+=mt.length-1}s++}}static createElement(e,t){let r=Xt.createElement("template");return r.innerHTML=e,r}};function Yt(i,e,t=i,r){if(e===it)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,s=lr(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=Yt(i,n._$AS(i,e.values),n,r)),e}var pn=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:r}=this._$AD,n=(e?.creationScope??Xt).importNode(t,!0);Jt.currentNode=n;let s=Jt.nextNode(),o=0,l=0,a=r[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new bi(s,s.nextSibling,this,e):a.type===1?c=new a.ctor(s,a.name,a.strings,this,e):a.type===6&&(c=new vn(s,this,e)),this._$AV.push(c),a=r[++l]}o!==a?.index&&(s=Jt.nextNode(),o++)}return Jt.currentNode=Xt,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},bi=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,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),lr(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==it&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Kl(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!==U&&lr(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ur.createElement(Ql(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let s=new pn(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Yl.get(e.strings);return t===void 0&&Yl.set(e.strings,t=new ur(e)),t}k(e){Ys(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let s of e)n===t.length?t.push(r=new i(this.O(ar()),this.O(ar()),this,this.options)):r=t[n],r._$AI(s),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Kt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=U}_$AI(e,t=this,r,n){let s=this.strings,o=!1;if(s===void 0)e=Yt(this,e,t,0),o=!lr(e)||e!==this._$AH&&e!==it,o&&(this._$AH=e);else{let l=e,a,c;for(e=s[0],a=0;a<s.length-1;a++)c=Yt(this,l[r+a],t,a),c===it&&(c=this._$AH[a]),o||=!lr(c)||c!==this._$AH[a],c===U?e=U:e!==U&&(e+=(c??"")+s[a+1]),this._$AH[a]=c}o&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},hn=class extends Kt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},fn=class extends Kt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},gn=class extends Kt{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=Yt(this,e,t,0)??U)===it)return;let r=this._$AH,n=e===U&&r!==U||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==U&&(r===U||n);n&&this.element.removeEventListener(this.name,this,r),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,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Yt(this,e)}},tu={M:Js,P:mt,A:Xs,C:1,L:eu,R:pn,D:Kl,V:Yt,I:bi,H:Kt,N:fn,U:gn,B:hn,F:vn},lh=Gs.litHtmlPolyfillSupport;lh?.(ur,bi),(Gs.litHtmlVersions??=[]).push("3.2.1");var iu=(i,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let s=t?.renderBefore??null;r._$litPart$=n=new bi(e.insertBefore(ar(),s),s,void 0,t??{})}return n._$AI(i),n};var H=class extends vt{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=iu(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return it}};H._$litElement$=!0,H.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:H});var uh=globalThis.litElementPolyfillSupport;uh?.({LitElement:H});(globalThis.litElementVersions??=[]).push("4.1.1");function ao(i){return[...i.v,(i.i?"!":"")+i.n].join(":")}function ch(i,e=","){return i.map(ao).join(e)}var uu=typeof CSS<"u"&&CSS.escape||(i=>i.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function mn(i){for(var e=9,t=i.length;t--;)e=Math.imul(e^i.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function bn(i,e="@media "){return e+Z(i).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(r=>`(${r}-width:${t[r]})`).join(" and "))).join(",")}function Z(i=[]){return Array.isArray(i)?i:i==null?[]:[i]}function ru(i){return i}function wn(){}var ge={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function cu(i){return i.match(/[-=:;]/g)?.length||0}function io(i){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(i)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(cu(i),15)<<18}var dh=["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 lo({n:i,i:e,v:t=[]},r,n,s){i&&(i=ao({n:i,i:e,v:t})),s=[...Z(s)];for(let l of t){let a=r.theme("screens",l);for(let c of Z(a&&bn(a)||r.v(l))){var o;s.push(c),n|=a?67108864|io(c):l=="dark"?1073741824:c[0]=="@"?io(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~dh.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:i,p:n,r:s,i:e}}var du=new Map;function ro(i){if(i.d){let e=[],t=Zs(i.r.reduce((r,n)=>n[0]=="@"?(e.push(n),r):n?Zs(r,s=>Zs(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):Qs(s,o)}return Qs(o,s)})):r,"&"),r=>Qs(r,i.n?"."+uu(i.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((r,n)=>n+"{"+r+"}",i.d)}}function Zs(i,e){return i.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,r,n)=>e(r)+n)}function Qs(i,e){return i.replace(/&/g,e)}var nu=new Intl.Collator("en",{numeric:!0});function pu(i,e){for(var t=0,r=i.length;t<r;){let n=r+t>>1;0>=hu(i[n],e)?t=n+1:r=n}return r}function hu(i,e){let t=i.p&ge.o;return t==(e.p&ge.o)&&(t==ge.b||t==ge.o)?0:i.p-e.p||i.o-e.o||nu.compare(su(i.n),su(e.n))||nu.compare(ou(i.n),ou(e.n))}function su(i){return(i||"").split(/:/).pop().split("/").pop()||"\0"}function ou(i){return(i||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function eo(i,e){return Math.round(parseInt(i,16)*e)}function Ke(i,e={}){if(typeof i=="function")return i(e);let{opacityValue:t="1",opacityVariable:r}=e,n=r?`var(${r})`:t;if(i.includes("<alpha-value>"))return i.replace("<alpha-value>",n);if(i[0]=="#"&&(i.length==4||i.length==7)){let s=(i.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[eo(i.substr(1,s),o),eo(i.substr(1+s,s),o),eo(i.substr(1+2*s,s),o),n]})`}return n=="1"?i:n=="0"?"#0000":i.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function fu(i,e,t,r,n=[]){return function s(o,{n:l,p:a,r:c=[],i:d},u){let p=[],h="",g=0,m=0;for(let _ in o||{}){var x,S;let A=o[_];if(_[0]=="@"){if(!A)continue;if(_[1]=="a"){p.push(...co(l,a,yn(""+A),u,a,c,d,!0));continue}if(_[1]=="l"){for(let R of Z(A))p.push(...s(R,{n:l,p:(x=ge[_[7]],a&~ge.o|x),r:_[7]=="d"?[]:c,i:d},u));continue}if(_[1]=="i"){p.push(...Z(A).map(R=>({p:-1,o:0,r:[],d:_+" "+R})));continue}if(_[1]=="k"){p.push({p:ge.d,o:0,r:[_],d:s(A,{p:ge.d},u).map(ro).join("")});continue}if(_[1]=="f"){p.push(...Z(A).map(R=>({p:ge.d,o:0,r:[_],d:s(R,{p:ge.d},u).map(ro).join("")})));continue}}if(typeof A!="object"||Array.isArray(A))_=="label"&&A?l=A+mn(JSON.stringify([a,d,o])):(A||A===0)&&(_=_.replace(/[A-Z]/g,R=>"-"+R.toLowerCase()),m+=1,g=Math.max(g,(S=_)[0]=="-"?0:cu(S)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(S)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+Z(A).map(R=>u.s(_,uo(""+R,u.theme)+(d?" !important":""))).join(";"));else if(_[0]=="@"||_.includes("&")){let R=a;_[0]=="@"&&(_=_.replace(/\bscreen\(([^)]+)\)/g,(q,X)=>{let z=u.theme("screens",X);return z?(R|=67108864,bn(z,"")):q}),R|=io(_)),p.push(...s(A,{n:l,p:R,r:[...c,_],i:d},u))}else p.push(...s(A,{p:a,r:[...c,_]},u))}return p.unshift({n:l,p:a,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:c,d:h}),p.sort(hu)}(i,lo(e,t,r,n),t)}function uo(i,e){return i.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,r,n,s,o="")=>{let l=e(n,o);return typeof l=="function"&&/color|fill|stroke/i.test(n)?Ke(l):""+Z(l).filter(a=>Object(a)!==a)})}function gu(i,e){let t,r=[];for(let n of i)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):r.push(t={...n,n:n.n&&e}):r.push({...n,n:n.n&&e});return r}function _n(i,e,t=ge.u,r,n){let s=[];for(let o of i)for(let l of function(a,c,d,u,p){a={...a,i:a.i||p};let h=function(g,m){let x=du.get(g.n);return x?x(g,m):m.r(g.n,g.v[0]=="dark")}(a,c);return h?typeof h=="string"?({r:u,p:d}=lo(a,c,d,u),gu(_n(yn(h),c,d,u,a.i),a.n)):Array.isArray(h)?h.map(g=>{var m,x;return{o:0,...g,r:[...Z(u),...Z(g.r)],p:(m=d,x=g.p??d,m&~ge.o|x)}}):fu(h,a,c,d,u):[{c:ao(a),p:0,o:0,r:[]}]}(o,e,t,r,n))s.splice(pu(s,l),0,l);return s}function co(i,e,t,r,n,s,o,l){return gu((l?t.flatMap(a=>_n([a],r,n,s,o)):_n(t,r,n,s,o)).map(a=>a.p&ge.o&&(a.n||e==ge.b)?{...a,p:a.p&~ge.o|e,o:0}:a),i)}function ph(i,e,t,r){var n;return n=(s,o)=>{let{n:l,p:a,r:c,i:d}=lo(s,o,e);return t&&co(l,e,t,o,a,c,d,r)},du.set(i,n),i}function to(i,e,t){if(i[i.length-1]!="("){let r=[],n=!1,s=!1,o="";for(let l of i)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),n=!n),l.endsWith(":")){r[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:r.filter(hh),i:n}))}}function hh(i,e,t){return t.indexOf(i)==e}var au=new Map;function yn(i){let e=au.get(i);if(!e){let t=[],r=[[]],n=0,s=0,o=null,l=0,a=(c,d=0)=>{n!=l&&(t.push(i.slice(n,l+d)),c&&to(t,r)),n=l+1};for(;l<i.length;l++){let c=i[l];if(s)i[l-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)i[l-1]!="\\"&&o.test(i.slice(l))&&(o=null,n=l+RegExp.lastMatch.length);else if(c=="/"&&i[l-1]!="\\"&&(i[l+1]=="*"||i[l+1]=="/"))o=i[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")a(),t.push(c);else if(c==":")i[l+1]!=":"&&a(!1,1);else if(/[\s,)]/.test(c)){a(!0);let d=t.lastIndexOf("(");if(c==")"){let u=t[d-1];if(/[~@]$/.test(u)){let p=r.shift();t.length=d,to([...t,"#"],r);let{v:h}=r[0].pop();for(let g of p)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);to([...t,ph(u.length>1?u.slice(0,-1)+mn(JSON.stringify([u,p])):u+"("+ch(p)+")",ge.a,p,/@$/.test(u))],r)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(c)&&i[l+1]=="("&&r.unshift([])}a(!0),au.set(i,e=r[0])}return e}function w(i,e,t){return[i,no(e,t)]}function no(i,e){return typeof i=="function"?i:typeof i=="string"&&/^[\w-]+$/.test(i)?(t,r)=>({[i]:e?e(t,r):so(t,1)}):t=>i||{[t[1]]:so(t,2)}}function so(i,e,t=i.slice(e).find(Boolean)||i.$$||i.input){return i.input[0]=="-"?`calc(${t} * -1)`:t}function k(i,e,t,r){return[i,po(e,t,r)]}function po(i,e,t){let r=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=vu(i||n[1]),l=s.theme(o,n.$$)??ut(n.$$,o,s);if(l!=null)return n._=so(n,0,l),r(n,s,o)}}function ve(i,e={},t){return[i,fh(e,t)]}function fh(i={},e){return(t,r)=>{let{section:n=vu(t[0]).replace("-","")+"Color"}=i,[s,o]=gh(t.$$);if(!s)return;let l=r.theme(n,s)||ut(s,n,r);if(!l||typeof l=="object")return;let{opacityVariable:a=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:u}=i,p=r.theme(c,o||"DEFAULT")||o&&ut(o,c,r),h=e||(({_:m})=>{let x=cr(d,m);return u?{[u]:x}:x});t._={value:Ke(l,{opacityVariable:a||void 0,opacityValue:p||void 0}),color:m=>Ke(l,m),opacityVariable:a||void 0,opacityValue:p||void 0};let g=h(t,r);if(!t.dark){let m=r.d(n,s,l);m&&m!==l&&(t._={value:Ke(m,{opacityVariable:a||void 0,opacityValue:p||"1"}),color:x=>Ke(m,x),opacityVariable:a||void 0,opacityValue:p||void 0},g={"&":g,[r.v("dark")]:h(t,r)})}return g}}function gh(i){return(i.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function cr(i,e){let t={};return typeof e=="string"?t[i]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[i]=e.value),t}function ut(i,e,t){if(i[0]=="["&&i.slice(-1)=="]"){if(i=wi(uo(i.slice(1,-1),t.theme)),!e)return i;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(i)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(i))||/image/i.test(e)&&!(/^image:/.test(i)||/^[a-z-]+\(/.test(i))||/weight/i.test(e)&&!(/^(number|any):/.test(i)||/^\d+$/.test(i))||/position/i.test(e)&&/^(length|size):/.test(i)))return i.replace(/^[a-z-]+:/,"")}}function vu(i){return i.replace(/-./g,e=>e[1].toUpperCase())}function wi(i){return i.includes("url(")?i.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",r,n="")=>wi(t)+r+wi(n)):i.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 ho({presets:i=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Z(e.variants),rules:Z(e.rules),ignorelist:Z(e.ignorelist),hash:void 0,stringify:(r,n)=>r+":"+n,finalize:[]};for(let r of Z([...i,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Z(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:c,ignorelist:d,hash:u=t.hash,stringify:p=t.stringify,finalize:h}=typeof r=="function"?r(t):r;t={preflight:t.preflight!==!1&&n!==!1&&[...t.preflight,...Z(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Z(a)],rules:[...t.rules,...Z(c)],ignorelist:[...t.ignorelist,...Z(d)],hash:u,stringify:p,finalize:[...t.finalize,...Z(h)]}}return t}function lu(i,e,t,r,n,s){for(let o of e){let l=t.get(o);l||t.set(o,l=r(o));let a=l(i,n,s);if(a)return a}}function vh(i){var e;return oo(i[0],typeof(e=i[1])=="function"?e:()=>e)}function mh(i){var e,t;return Array.isArray(i)?oo(i[0],no(i[1],i[2])):oo(i,no(e,t))}function oo(i,e){return mu(i,(t,r,n,s)=>{let o=r.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,n)})}function mu(i,e){let t=Z(i).map(_h);return(r,n,s)=>{for(let o of t){let l=e(r,o,n,s);if(l)return l}}}function _h(i){return typeof i=="string"?RegExp("^"+i+(i.includes("$")||i.slice(-1)=="-"?"":"$")):i}function _u(i,e){let t=ho(i),r=function({theme:a,darkMode:c,darkColor:d=wn,variants:u,rules:p,hash:h,stringify:g,ignorelist:m,finalize:x}){let S=new Map,_=new Map,A=new Map,R=new Map,q=mu(m,(P,B)=>B.test(P));u.push(["dark",Array.isArray(c)||c=="class"?`${Z(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let X=typeof h=="function"?P=>h(P,mn):h?mn:ru;X!==ru&&x.push(P=>({...P,n:P.n&&X(P.n),d:P.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(B,V)=>"--"+X(V).replace("#",""))}));let z={theme:function({extend:P={},...B}){let V={},Re={get colors(){return _e("colors")},theme:_e,negative(){return{}},breakpoints(Y){let ie={};for(let pe in Y)typeof Y[pe]=="string"&&(ie["screen-"+pe]=Y[pe]);return ie}};return _e;function _e(Y,ie,pe,Ue){if(Y){if({1:Y,2:Ue}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Y)||[,Y],/[.[]/.test(Y)){let Ie=[];Y.replace(/\[([^\]]+)\]|([^.[]+)/g,(se,ye,Oe=ye)=>Ie.push(Oe)),Y=Ie.shift(),pe=ie,ie=Ie.join("-")}let le=V[Y]||Object.assign(Object.assign(V[Y]={},Ye(B,Y)),Ye(P,Y));if(ie==null)return le;ie||(ie="DEFAULT");let $e=le[ie]??ie.split("-").reduce((Ie,se)=>Ie?.[se],le)??pe;return Ue?Ke($e,{opacityValue:uo(Ue,_e)}):$e}let We={};for(let le of[...Object.keys(B),...Object.keys(P)])We[le]=_e(le);return We}function Ye(Y,ie){let pe=Y[ie];return typeof pe=="function"&&(pe=pe(Re)),pe&&/color|fill|stroke/i.test(ie)?function Ue(We,le=[]){let $e={};for(let Ie in We){let se=We[Ie],ye=[...le,Ie];$e[ye.join("-")]=se,Ie=="DEFAULT"&&(ye=le,$e[le.join("-")]=se),typeof se=="object"&&Object.assign($e,Ue(se,ye))}return $e}(pe):pe}}(a),e:uu,h:X,s(P,B){return g(P,B,z)},d(P,B,V){return d(P,B,z,V)},v(P){return S.has(P)||S.set(P,lu(P,u,_,vh,z)||"&:"+P),S.get(P)},r(P,B){let V=JSON.stringify([P,B]);return A.has(V)||A.set(V,!q(P,z)&&lu(P,p,R,mh,z,B)),A.get(V)},f(P){return x.reduce((B,V)=>V(B,z),P)}};return z}(t),n=new Map,s=[],o=new Set;e.resume(a=>n.set(a,a),(a,c)=>{e.insert(a,s.length,c),s.push(c),o.add(a)});function l(a){let c=r.f(a),d=ro(c);if(d&&!o.has(d)){o.add(d);let u=pu(s,a);e.insert(d,u,a),s.splice(u,0,a)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let u of Z(t.preflight))typeof u=="function"&&(u=u(r)),u&&(typeof u=="string"?co("",ge.b,yn(u),r,ge.b,[],!1,!0):fu(u,{},r,ge.b)).forEach(l);c=""+c;let d=n.get(c);if(!d){let u=new Set;for(let p of _n(yn(c),r))u.add(p.c).add(l(p));d=[...u].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:r.theme,config:t,snapshot(){let a=e.snapshot(),c=new Set(o),d=new Map(n),u=[...s];return()=>{a(),o=c,n=d,s=u}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function yh(i,e){return i!=e&&""+i.split(" ").sort()!=""+e.split(" ").sort()}function yu(i){let e=new MutationObserver(t);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),r(n),t([{target:n,type:""}])},disconnect(){e.disconnect()}};function t(n){for(let{type:s,target:o}of n)if(s[0]=="a")r(o);else for(let l of o.querySelectorAll("[class]"))r(l);e.takeRecords()}function r(n){let s,o=n.getAttribute?.("class");o&&yh(o,s=i(o))&&n.setAttribute("class",s)}}function bh(i){let e=document.querySelector(i||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function xn(i){let e=i?.cssRules?i:(i&&typeof i!="string"?i:bh(i)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,r=>r.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,r){try{e.insertRule(t,r)}catch{e.insertRule(":root{}",r)}},resume:wn}}var wh=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 bu(i){return wh.get(i)}function wu(i){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(i);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function xu(i,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(i);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 xh=[["-webkit-",1],["-moz-",2],["-ms-",4]];function ku(){return({stringify:i})=>({stringify(e,t,r){let n="",s=bu(e);s&&(n+=i(s,t,r)+";");let o=wu(e),l=xu(e,t);for(let a of xh)o&a[1]&&(n+=i(a[0]+e,t,r)+";"),l&a[1]&&(n+=i(e,a[0]+t,r)+";");return n+i(e,t,r)}})}function Eu(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",po("lineClamp",({_:i})=>Su(i))],["line-clamp-(\\d+)",({1:i})=>Su(i)]]}}function Su(i){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${i}`}}var pr={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",...Ve(4,"rem",4,.5,.5),...Ve(12,"rem",4,5),14:"3.5rem",...Ve(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:{...Ve(200,"",100,0,50),...Ve(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:i})=>({DEFAULT:i("colors.gray.200","currentColor"),...i("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",...Ze(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:i})=>({auto:"auto",...i("colors")}),contrast:{...Ve(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:i})=>({...i("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:i})=>({...i("spacing"),...dr(2,6),...dr(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:i})=>({...i("spacing"),...dr(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:i})=>({...i("spacing"),...dr(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:{...Ve(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:i})=>({auto:"auto",...i("spacing")}),maxHeight:({theme:i})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...i("spacing")}),maxWidth:({theme:i,breakpoints:e})=>({...e(i("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:{...Ve(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:Ze(8,"px"),outlineWidth:Ze(8,"px"),ringColor:({theme:i})=>({...i("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:G("colors"),ringOffsetWidth:Ze(8,"px"),ringOpacity:({theme:i})=>({...i("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ze(8,"px")},rotate:{...Ze(2,"deg"),...Ze(12,"deg",3),...Ze(180,"deg",45)},saturate:Ve(200,"",100,0,50),scale:{...Ve(150,"",100,0,50),...Ve(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:G("spacing"),scrollPadding:G("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ze(2,"deg"),...Ze(12,"deg",3)},space:G("spacing"),stroke:({theme:i})=>({...i("colors"),none:"none"}),strokeWidth:Ve(2),textColor:G("colors"),textDecorationColor:G("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ze(8,"px")},textUnderlineOffset:{auto:"auto",...Ze(8,"px")},textIndent:G("spacing"),textOpacity:G("opacity"),transitionDuration:({theme:i})=>({...i("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:i})=>({...i("spacing"),...dr(2,4),full:"100%"}),width:({theme:i})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...i("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Ve(50,"",1,0,10),auto:"auto"}};function dr(i,e){let t={};do for(var r=1;r<i;r++)t[`${r}/${i}`]=Number((r/i*100).toFixed(6))+"%";while(++i<=e);return t}function Ze(i,e,t=0){let r={};for(;t<=i;t=2*t||1)r[t]=t+e;return r}function Ve(i,e="",t=1,r=0,n=1,s={}){for(;r<=i;r+=n)s[r]=r/t+e;return s}function G(i){return({theme:e})=>e(i)}var Cu={"*,::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, ${pr.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, ${pr.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 Ru=[w("\\[([-\\w]+):(.+)]",({1:i,2:e},t)=>({"@layer overrides":{"&":{[i]:ut(`[${e}]`,"",t)}}})),w("(group|peer)([~/][^-[]+)?",({input:i},{h:e})=>[{c:e(i)}]),k("aspect-","aspectRatio"),w("container",(i,{theme:e})=>{let{screens:t=e("screens"),center:r,padding:n}=e("container"),s={width:"100%",marginRight:r&&"auto",marginLeft:r&&"auto",...o("xs")};for(let l in t){let a=t[l];typeof a=="string"&&(s[bn(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}}}),k("content-","content",({_:i})=>({"--tw-content":i,content:"var(--tw-content)"})),w("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),w("box-(border|content)","boxSizing",({1:i})=>i+"-box"),w("hidden",{display:"none"}),w("table-(auto|fixed)","tableLayout"),w(["(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)",w("isolate","isolation"),w("object-(contain|cover|fill|none|scale-down)","objectFit"),k("object-","objectPosition"),w("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",kn),w("overscroll(-[xy])?-(auto|contain|none)",({1:i="",2:e})=>({["overscroll-behavior"+i]:e})),w("(static|fixed|absolute|relative|sticky)","position"),k("-?inset(-[xy])?(?:$|-)","inset",({1:i,_:e})=>({top:i!="-x"&&e,right:i!="-y"&&e,bottom:i!="-x"&&e,left:i!="-y"&&e})),k("-?(top|bottom|left|right)(?:$|-)","inset"),w("(visible|collapse)","visibility"),w("invisible",{visibility:"hidden"}),k("-?z-","zIndex"),w("flex-((row|col)(-reverse)?)","flexDirection",$u),w("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),k("(flex-(?:grow|shrink))(?:$|-)"),k("(flex)-"),k("grow(?:$|-)","flexGrow"),k("shrink(?:$|-)","flexShrink"),k("basis-","flexBasis"),k("-?(order)-"),"-?(order)-(\\d+)",k("grid-cols-","gridTemplateColumns"),w("grid-cols-(\\d+)","gridTemplateColumns",Pu),k("col-","gridColumn"),w("col-(span)-(\\d+)","gridColumn",Tu),k("col-start-","gridColumnStart"),w("col-start-(auto|\\d+)","gridColumnStart"),k("col-end-","gridColumnEnd"),w("col-end-(auto|\\d+)","gridColumnEnd"),k("grid-rows-","gridTemplateRows"),w("grid-rows-(\\d+)","gridTemplateRows",Pu),k("row-","gridRow"),w("row-(span)-(\\d+)","gridRow",Tu),k("row-start-","gridRowStart"),w("row-start-(auto|\\d+)","gridRowStart"),k("row-end-","gridRowEnd"),w("row-end-(auto|\\d+)","gridRowEnd"),w("grid-flow-((row|col)(-dense)?)","gridAutoFlow",i=>kn($u(i))),w("grid-flow-(dense)","gridAutoFlow"),k("auto-cols-","gridAutoColumns"),k("auto-rows-","gridAutoRows"),k("gap-x(?:$|-)","gap","columnGap"),k("gap-y(?:$|-)","gap","rowGap"),k("gap(?:$|-)","gap"),"(justify-(?:items|self))-",w("justify-","justifyContent",Iu),w("(content|items|self)-",i=>({["align-"+i[1]]:Iu(i)})),w("(place-(content|items|self))-",({1:i,$$:e})=>({[i]:("wun".includes(e[3])?"space-":"")+e})),k("p([xytrbl])?(?:$|-)","padding",xi("padding")),k("-?m([xytrbl])?(?:$|-)","margin",xi("margin")),k("-?space-(x|y)(?:$|-)","space",({1:i,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[i]]:`calc(${e} * calc(1 - var(--tw-space-${i}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[i]]:`calc(${e} * var(--tw-space-${i}-reverse))`}})),w("space-(x|y)-reverse",({1:i})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"1"}})),k("w-","width"),k("min-w-","minWidth"),k("max-w-","maxWidth"),k("h-","height"),k("min-h-","minHeight"),k("max-h-","maxHeight"),k("font-","fontWeight"),k("font-","fontFamily",({_:i})=>typeof(i=Z(i))[1]=="string"?{fontFamily:rt(i)}:{fontFamily:rt(i[0]),...i[1]}),w("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),w("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),w("italic","fontStyle"),w("not-italic",{fontStyle:"normal"}),w("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:i,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":i)]:i,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Tt({"--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,/*!*/ /*!*/)"})}),k("tracking-","letterSpacing"),k("leading-","lineHeight"),w("list-(inside|outside)","listStylePosition"),k("list-","listStyleType"),w("list-","listStyleType"),k("placeholder-opacity-","placeholderOpacity",({_:i})=>({"&::placeholder":{"--tw-placeholder-opacity":i}})),ve("placeholder-",{property:"color",selector:"&::placeholder"}),w("text-(left|center|right|justify|start|end)","textAlign"),w("text-(ellipsis|clip)","textOverflow"),k("text-opacity-","textOpacity","--tw-text-opacity"),ve("text-",{property:"color"}),k("text-","fontSize",({_:i})=>typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}),k("indent-","textIndent"),w("(overline|underline|line-through)","textDecorationLine"),w("no-underline",{textDecorationLine:"none"}),k("underline-offset-","textUnderlineOffset"),ve("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),k("decoration-","textDecorationThickness"),w("decoration-","textDecorationStyle"),w("(uppercase|lowercase|capitalize)","textTransform"),w("normal-case",{textTransform:"none"}),w("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),w("align-","verticalAlign"),w("whitespace-","whiteSpace"),w("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),w("break-words",{overflowWrap:"break-word"}),w("break-all",{wordBreak:"break-all"}),w("break-keep",{wordBreak:"keep-all"}),ve("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ve("accent-",{opacityVariable:!1,opacitySection:"opacity"}),w("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:i})=>`linear-gradient(to ${Zt(i," ")},var(--tw-gradient-stops))`),ve("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-from":i.value,"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),ve("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${i.value},var(--tw-gradient-to)`})),ve("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),w("bg-(fixed|local|scroll)","backgroundAttachment"),w("bg-origin-(border|padding|content)","backgroundOrigin",({1:i})=>i+"-box"),w(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),w("bg-blend-","backgroundBlendMode"),w("bg-clip-(border|padding|content|text)","backgroundClip",({1:i})=>i+(i=="text"?"":"-box")),k("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ve("bg-",{section:"backgroundColor"}),k("bg-","backgroundImage"),k("bg-","backgroundPosition"),w("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",kn),k("bg-","backgroundSize"),k("rounded(?:$|-)","borderRadius"),k("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:i,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[i]||[i,i];return{[`border-${Zt(t[0])}-radius`]:e,[`border-${Zt(t[1])}-radius`]:e}}),w("border-(collapse|separate)","borderCollapse"),k("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),w("border-(solid|dashed|dotted|double|none)","borderStyle"),k("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:i,_:e})=>({...Tt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(i||"-x")]:e,["--tw-border-spacing"+(i||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),ve("border-([xytrbl])-",{section:"borderColor"},xi("border","Color")),ve("border-"),k("border-([xytrbl])(?:$|-)","borderWidth",xi("border","Width")),k("border(?:$|-)","borderWidth"),k("divide-opacity(?:$|-)","divideOpacity",({_:i})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":i}})),w("divide-(solid|dashed|dotted|double|none)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:i}})),w("divide-([xy]-reverse)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+i]:"1"}})),k("divide-([xy])(?:$|-)","divideWidth",({1:i,_:e})=>{let t={x:"lr",y:"tb"}[i];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${i}-reverse`]:"0",[`border-${Zt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${i}-reverse)))`,[`border-${Zt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${i}-reverse))`}}}),ve("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),k("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ve("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),k("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),w("ring-inset",{"--tw-ring-inset":"inset"}),ve("ring-",{property:"--tw-ring-color"}),k("ring(?:$|-)","ringWidth",({_:i},{theme:e})=>({...Tt({"--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":Ke(e("ringOffsetColor","","#fff")),"--tw-ring-color":Ke(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(${i} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),ve("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-shadow-color":i.value,"--tw-shadow":"var(--tw-shadow-colored)"})),k("shadow(?:$|-)","boxShadow",({_:i})=>({...Tt({"--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(i),"--tw-shadow-colored":rt(i).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)"})),k("(opacity)-"),w("mix-blend-","mixBlendMode"),...Au(),...Au("backdrop-"),k("transition(?:$|-)","transitionProperty",(i,{theme:e})=>({transitionProperty:rt(i),transitionTimingFunction:i._=="none"?void 0:rt(e("transitionTimingFunction","")),transitionDuration:i._=="none"?void 0:rt(e("transitionDuration",""))})),k("duration(?:$|-)","transitionDuration","transitionDuration",rt),k("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",rt),k("delay(?:$|-)","transitionDelay","transitionDelay",rt),k("animate(?:$|-)","animation",(i,{theme:e,h:t,e:r})=>{let n=rt(i),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=r(t(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",w("transform",go),w("transform-(cpu|gpu)",({1:i})=>({"--tw-transform":Ou(i=="gpu")})),k("scale(-[xy])?-","scale",({1:i,_:e})=>({["--tw-scale"+(i||"-x")]:e,["--tw-scale"+(i||"-y")]:e,...go()})),k("-?(rotate)-","rotate",fo),k("-?(translate-[xy])-","translate",fo),k("-?(skew-[xy])-","skew",fo),w("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",kn),"(appearance)-",k("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",k("(cursor)-"),"(cursor)-",w("snap-(none)","scroll-snap-type"),w("snap-(x|y|both)",({1:i})=>({...Tt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":i+" var(--tw-scroll-snap-strictness)"})),w("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),w("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),w("snap-(normal|always)","scroll-snap-stop"),w("scroll-(auto|smooth)","scroll-behavior"),k("scroll-p([xytrbl])?(?:$|-)","padding",xi("scroll-padding")),k("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",xi("scroll-margin")),w("touch-(auto|none|manipulation)","touch-action"),w("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:i,2:e,3:t})=>({...Tt({"--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":i}`]:i,"touch-action":"var(--tw-touch-action)"})),w("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),w("outline",{outlineStyle:"solid"}),w("outline-(dashed|dotted|double)","outlineStyle"),k("-?(outline-offset)-"),ve("outline-",{opacityVariable:!1,opacitySection:"opacity"}),k("outline-","outlineWidth"),"(pointer-events)-",k("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:i})=>({x:"horizontal",y:"vertical"})[i]||i||"both"],w("select-(none|text|all|auto)","userSelect"),ve("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ve("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),k("stroke-","strokeWidth"),w("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),w("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function kn(i){return(typeof i=="string"?i:i[1]).replace(/-/g," ").trim()}function $u(i){return(typeof i=="string"?i:i[1]).replace("col","column")}function Zt(i,e="-"){let t=[];for(let r of i)t.push({t:"top",r:"right",b:"bottom",l:"left"}[r]);return t.join(e)}function rt(i){return i&&""+(i._||i)}function Iu({$$:i}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[i[3]||""]||"")+i}function xi(i,e=""){return({1:t,_:r})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...cr(i+"-"+Zt(n[0])+e,r),...cr(i+"-"+Zt(n[1])+e,r)}:cr(i+e,r)}}function Au(i=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",i&&"opacity","saturate","sepia",!i&&"drop-shadow"].filter(Boolean),t={};for(let r of e)t[`--tw-${i}${r}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...Tt(t),[`${i}filter`]:e.map(r=>`var(--tw-${i}${r})`).join(" ")},[`(${i}filter)-(none)`,w(`${i}filter`,t),...e.map(r=>k(`${r[0]=="h"?"-?":""}(${i}${r})(?:$|-)`,r,({1:n,_:s})=>({[`--tw-${n}`]:Z(s).map(o=>`${r}(${o})`).join(" "),...t})))]}function fo({1:i,_:e}){return{["--tw-"+i]:e,...go()}}function go(){return{...Tt({"--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":Ou()}),transform:"var(--tw-transform)"}}function Ou(i){return[i?"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 Tu({1:i,2:e}){return`${i} ${e} / ${i} ${e}`}function Pu({1:i}){return`repeat(${i},minmax(0,1fr))`}function Tt(i){return{"@layer defaults":{"*,::before,::after":i,"::backdrop":i}}}var Fu=[["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:i})=>`@media (orientation:${i})`],["contrast-(more|less)",({1:i})=>`@media (prefers-contrast:${i})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:i})=>`&::${i}`],["(marker|selection)",({1:i})=>`& *::${i},&::${i}`],["file","&::file-selector-button"],["(first|last|only)",({1:i})=>`&:${i}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:i,$$:e},t)=>e&&`&[${i}-${t.theme(i,e)||ut(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:i,3:e="",4:t,5:r="",6:n=e},{e:s,h:o,v:l})=>{let a=wi(r)||(t[0]=="["?t:l(t.slice(1)));return`${(a.includes("&")?a:"&"+a).replace(/&/g,`:merge(.${s(o(i+n))})`)}${i[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:i})=>`[dir="${i}"] &`],["supports-",({$$:i},e)=>{if(i&&(i=e.theme("supports",i)||ut(i,"",e)),i)return i.includes(":")||(i+=":var(--tw)"),/^\w*\s*\(/.test(i)||(i=`(${i})`),`@supports ${i.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:i},e)=>{if(i&&(i=e.theme("screens",i)||ut(i,"",e)),typeof i=="string")return`@media not all and (min-width:${i})`}],["min-",({$$:i},e)=>(i&&(i=ut(i,"",e)),i&&`@media (min-width:${i})`)],[/^\[(.+)]$/,({1:i})=>/[&@]/.test(i)&&wi(i).replace(/[}]+$/,"").split("{")]];function Mu({colors:i,disablePreflight:e}={}){return{preflight:e?void 0:Cu,theme:{...pr,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...i}},variants:Fu,rules:Ru,finalize(t){return t.n&&t.d&&t.r.some(r=>/^&::(before|after)$/.test(r))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var kh={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Sh={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Eh={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Ch={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},$h={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Ih={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Ah={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Th={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Ph={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Rh={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Oh={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Fh={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Mh={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Dh={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Lh={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Nh={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Uh={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},jh={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},qh={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Bh={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Hh={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},zh={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Du={__proto__:null,slate:kh,gray:Sh,zinc:Eh,neutral:Ch,stone:$h,red:Ih,orange:Ah,amber:Th,yellow:Ph,lime:Rh,green:Oh,emerald:Fh,teal:Mh,cyan:Dh,sky:Lh,blue:Nh,indigo:Uh,violet:jh,purple:qh,fuchsia:Bh,pink:Hh,rose:zh};function Lu({disablePreflight:i}={}){return Mu({colors:Du,disablePreflight:i})}function ju({className:i="prose",defaultColor:e="gray",extend:t={},colors:r={}}={}){return r={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",...r,dark:r.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",...r.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])=>[`${i}-${s}`,(l,a)=>qu(i,o[0]=="."?"."+a.e(a.h(o.slice(1))):o,a,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${i})`,({1:s},{h:o})=>[{c:o(s)}]],[`${i}-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)"}}],[i+"-",({$$:s},o)=>{let l=Uu(o.theme("fontSize",s));return l&&{"@layer components":l}}],[i+"-",({$$:s},o)=>n(s,o)],[i,(s,o)=>({...n(e,o),"@layer base":[Nu(i,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:M(20,16),marginBottom:M(20,16),paddingLeft:M(26,16)},li:{marginTop:M(8,16),marginBottom:M(8,16)},"ol>li,ul>li":{paddingLeft:M(6,16)},">ul>li p":{marginTop:M(12,16),marginBottom:M(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:M(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:M(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:M(12,16),marginBottom:M(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:M(48,16),marginBottom:M(48,16)},blockquote:{marginTop:M(32,20),marginBottom:M(32,20),paddingLeft:M(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:M(20,16),marginBottom:M(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:M(36,16),marginTop:"0",marginBottom:M(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:M(24,16),marginTop:M(48,24),marginBottom:M(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:M(20,16),marginTop:M(32,20),marginBottom:M(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:M(24,16),marginBottom:M(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:M(32,16),marginBottom:M(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:M(14,16),lineHeight:"1.4",marginTop:M(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:M(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:M(21,24)},"h3 code":{fontSize:M(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:M(14,16),lineHeight:"1.7",marginTop:M(24,14),marginBottom:M(24,14),borderRadius:"0.375rem",paddingTop:M(12,14),paddingRight:M(16,14),paddingBottom:M(12,14),paddingLeft:M(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:M(32,16),marginBottom:M(32,16),fontSize:M(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:M(8,14),paddingBottom:M(8,14),paddingLeft:M(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:M(8,14),paddingRight:M(8,14),paddingBottom:M(8,14),paddingLeft:M(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:M(20,16),lineHeight:"1.6",marginTop:M(24,20),marginBottom:M(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Nu(i,o,t)],"@layer components":{...Uu(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let l={},a={},c=(d,u,p)=>{let h=o.theme(`colors.${s}.${u}`,u);p["--tw-prose-"+d]=Ke(h);let g=p!=a&&o.d("colors",`${s}-${u}`,h);g&&(a["--tw-prose-"+d]=Ke(g))};for(let d in r){let u=r[d];d!="dark"&&u&&c(d,u,l)}for(let d in r.dark||{}){let u=r.dark[d];u&&(r.dark?c("invert-"+d,u,l):c(d,u,a))}return Object.keys(l).length?{"@layer defaults":{"&":l,[o.v("dark")]:a}}:void 0}}function Nu(i,e,t){let r={};for(let n in t)r[qu(i,n,e,s=>`.${e.e(e.h(i))}${s}`)]=t[n];return r}function qu(i,e,{e:t,h:r},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",l=s,a="")=>n(`${o}:where(${l}):not(:where(.${t(r("not-"+i))} *))${a}`))}function Uu(i){return i?typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}:void 0}function M(i,e){return`${(i/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var vo=ho({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:[Lu(),ku(),Eu(),ju()]});function Bu(i,e=!0){let t=function(){if(Wh)try{let a=xn(new CSSStyleSheet);return a.connect=c=>{let d=mo(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,a.target]},a.disconnect=wn,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[xn(s)],l=new WeakMap;return{get target(){return o[0].target},snapshot(){let a=o.map(c=>c.snapshot());return()=>a.forEach(c=>c())},clear(){o.forEach(a=>a.clear())},destroy(){o.forEach(a=>a.destroy())},insert(a,c,d){o[0].insert(a,c,d);let u=this.target.cssRules[c];o.forEach((p,h)=>h&&p.target.insertRule(u.cssText,c))},resume(a,c){return o[0].resume(a,c)},connect(a){let c=document.createElement("style");mo(a).appendChild(c);let d=xn(c),{cssRules:u}=this.target;for(let p=0;p<u.length;p++)d.target.insertRule(u[p].cssText,p);o.push(d),l.set(a,d)},disconnect(a){let c=o.indexOf(l.get(a));c>=0&&o.splice(c,1)}}}(),r=_u({...i,hash:i.hash??e},t),n=yu(r);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(mo(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=r}}}}var Wh=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function mo(i){return i.shadowRoot||i.attachShadow({mode:"open"})}var J=i=>Bu(vo)(i);var Sn=class extends J(H){constructor(){super();T(this,"render",()=>L`
1
+ var Vp=Object.defineProperty;var Ol=i=>{throw TypeError(i)};var Gp=(i,e,t)=>e in i?Vp(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var A=(i,e,t)=>Gp(i,typeof e!="symbol"?e+"":e,t),Ds=(i,e,t)=>e.has(i)||Ol("Cannot "+t);var f=(i,e,t)=>(Ds(i,e,"read from private field"),t?t.call(i):e.get(i)),y=(i,e,t)=>e.has(i)?Ol("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),E=(i,e,t,r)=>(Ds(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$=(i,e,t)=>(Ds(i,e,"access private method"),t);var Fl=(i,e,t,r)=>({set _(n){E(i,e,n,t)},get _(){return f(i,e,r)}});var Qr=globalThis,en=Qr.ShadowRoot&&(Qr.ShadyCSS===void 0||Qr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ls=Symbol(),Ml=new WeakMap,Ki=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Ls)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(en&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Ml.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Ml.set(t,e))}return e}toString(){return this.cssText}},Dl=i=>new Ki(typeof i=="string"?i:i+"",void 0,Ls),ct=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,s)=>r+(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)+i[s+1],i[0]);return new Ki(t,i,Ls)},Ns=(i,e)=>{if(en)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=Qr.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},tn=en?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Dl(t)})(i):i;var{is:Jp,defineProperty:Xp,getOwnPropertyDescriptor:Yp,getOwnPropertyNames:Kp,getOwnPropertySymbols:Zp,getPrototypeOf:Qp}=Object,rn=globalThis,Ll=rn.trustedTypes,eh=Ll?Ll.emptyScript:"",th=rn.reactiveElementPolyfillSupport,Zi=(i,e)=>i,Us={toAttribute(i,e){switch(e){case Boolean:i=i?eh:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Ul=(i,e)=>!Jp(i,e),Nl={attribute:!0,type:String,converter:Us,reflect:!1,hasChanged:Ul};Symbol.metadata??=Symbol("metadata"),rn.litPropertyMetadata??=new WeakMap;var dt=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=Nl){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Xp(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:s}=Yp(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,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Nl}static _$Ei(){if(this.hasOwnProperty(Zi("elementProperties")))return;let e=Qp(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Zi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Zi("properties"))){let t=this.properties,r=[...Kp(t),...Zp(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(tn(n))}else e!==void 0&&t.push(tn(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r: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 r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ns(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,r){this._$AK(e,r)}_$EC(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(r.converter?.toAttribute!==void 0?r.converter:Us).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=r.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Us;this._$Em=n,this[n]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??Ul)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.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 r=this.constructor.elementProperties;if(r.size>0)for(let[n,s]of r)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(r=>r.hostUpdate?.()),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}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){}};dt.elementStyles=[],dt.shadowRootOptions={mode:"open"},dt[Zi("elementProperties")]=new Map,dt[Zi("finalized")]=new Map,th?.({ReactiveElement:dt}),(rn.reactiveElementVersions??=[]).push("2.0.4");var js=globalThis,nn=js.trustedTypes,ql=nn?nn.createPolicy("lit-html",{createHTML:i=>i}):void 0,Bs="$lit$",pt=`lit$${Math.random().toFixed(9).slice(2)}$`,Hs="?"+pt,ih=`<${Hs}>`,zt=document,er=()=>zt.createComment(""),tr=i=>i===null||typeof i!="object"&&typeof i!="function",zs=Array.isArray,Vl=i=>zs(i)||typeof i?.[Symbol.iterator]=="function",qs=`[
2
+ \f\r]`,Qi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,jl=/-->/g,Bl=/>/g,Bt=RegExp(`>|${qs}(?:([^\\s"'>=/]+)(${qs}*=${qs}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Hl=/'/g,zl=/"/g,Gl=/^(?:script|style|textarea|title)$/i,Ws=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),D=Ws(1),Pg=Ws(2),Rg=Ws(3),Ke=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),Wl=new WeakMap,Ht=zt.createTreeWalker(zt,129);function Jl(i,e){if(!zs(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ql!==void 0?ql.createHTML(e):e}var Xl=(i,e)=>{let t=i.length-1,r=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=Qi;for(let l=0;l<t;l++){let a=i[l],c,d,u=-1,p=0;for(;p<a.length&&(o.lastIndex=p,d=o.exec(a),d!==null);)p=o.lastIndex,o===Qi?d[1]==="!--"?o=jl:d[1]!==void 0?o=Bl:d[2]!==void 0?(Gl.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Bt):d[3]!==void 0&&(o=Bt):o===Bt?d[0]===">"?(o=n??Qi,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Bt:d[3]==='"'?zl:Hl):o===zl||o===Hl?o=Bt:o===jl||o===Bl?o=Qi:(o=Bt,n=void 0);let h=o===Bt&&i[l+1].startsWith("/>")?" ":"";s+=o===Qi?a+ih:u>=0?(r.push(c),a.slice(0,u)+Bs+a.slice(u)+pt+h):a+pt+(u===-2?l:h)}return[Jl(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ir=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0,l=e.length-1,a=this.parts,[c,d]=Xl(e,t);if(this.el=i.createElement(c,r),Ht.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=Ht.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(Bs)){let p=d[o++],h=n.getAttribute(u).split(pt),g=/([.?@])?(.*)/.exec(p);a.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?on:g[1]==="?"?an:g[1]==="@"?ln:Vt}),n.removeAttribute(u)}else u.startsWith(pt)&&(a.push({type:6,index:s}),n.removeAttribute(u));if(Gl.test(n.tagName)){let u=n.textContent.split(pt),p=u.length-1;if(p>0){n.textContent=nn?nn.emptyScript:"";for(let h=0;h<p;h++)n.append(u[h],er()),Ht.nextNode(),a.push({type:2,index:++s});n.append(u[p],er())}}}else if(n.nodeType===8)if(n.data===Hs)a.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(pt,u+1))!==-1;)a.push({type:7,index:s}),u+=pt.length-1}s++}}static createElement(e,t){let r=zt.createElement("template");return r.innerHTML=e,r}};function Wt(i,e,t=i,r){if(e===Ke)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,s=tr(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=Wt(i,n._$AS(i,e.values),n,r)),e}var sn=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:r}=this._$AD,n=(e?.creationScope??zt).importNode(t,!0);Ht.currentNode=n;let s=Ht.nextNode(),o=0,l=0,a=r[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new gi(s,s.nextSibling,this,e):a.type===1?c=new a.ctor(s,a.name,a.strings,this,e):a.type===6&&(c=new un(s,this,e)),this._$AV.push(c),a=r[++l]}o!==a?.index&&(s=Ht.nextNode(),o++)}return Ht.currentNode=zt,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},gi=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,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=Wt(this,e,t),tr(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==Ke&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Vl(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!==L&&tr(this._$AH)?this._$AA.nextSibling.data=e:this.T(zt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ir.createElement(Jl(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let s=new sn(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Wl.get(e.strings);return t===void 0&&Wl.set(e.strings,t=new ir(e)),t}k(e){zs(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let s of e)n===t.length?t.push(r=new i(this.O(er()),this.O(er()),this,this.options)):r=t[n],r._$AI(s),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Vt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=L}_$AI(e,t=this,r,n){let s=this.strings,o=!1;if(s===void 0)e=Wt(this,e,t,0),o=!tr(e)||e!==this._$AH&&e!==Ke,o&&(this._$AH=e);else{let l=e,a,c;for(e=s[0],a=0;a<s.length-1;a++)c=Wt(this,l[r+a],t,a),c===Ke&&(c=this._$AH[a]),o||=!tr(c)||c!==this._$AH[a],c===L?e=L:e!==L&&(e+=(c??"")+s[a+1]),this._$AH[a]=c}o&&!n&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},on=class extends Vt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}},an=class extends Vt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}},ln=class extends Vt{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=Wt(this,e,t,0)??L)===Ke)return;let r=this._$AH,n=e===L&&r!==L||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==L&&(r===L||n);n&&this.element.removeEventListener(this.name,this,r),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)}},un=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Wt(this,e)}},Yl={M:Bs,P:pt,A:Hs,C:1,L:Xl,R:sn,D:Vl,V:Wt,I:gi,H:Vt,N:an,U:ln,B:on,F:un},rh=js.litHtmlPolyfillSupport;rh?.(ir,gi),(js.litHtmlVersions??=[]).push("3.2.1");var Kl=(i,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let s=t?.renderBefore??null;r._$litPart$=n=new gi(e.insertBefore(er(),s),s,void 0,t??{})}return n._$AI(i),n};var j=class extends dt{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=Kl(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ke}};j._$litElement$=!0,j.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:j});var nh=globalThis.litElementPolyfillSupport;nh?.({LitElement:j});(globalThis.litElementVersions??=[]).push("4.1.1");function to(i){return[...i.v,(i.i?"!":"")+i.n].join(":")}function sh(i,e=","){return i.map(to).join(e)}var nu=typeof CSS<"u"&&CSS.escape||(i=>i.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function cn(i){for(var e=9,t=i.length;t--;)e=Math.imul(e^i.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function hn(i,e="@media "){return e+Y(i).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(r=>`(${r}-width:${t[r]})`).join(" and "))).join(",")}function Y(i=[]){return Array.isArray(i)?i:i==null?[]:[i]}function Zl(i){return i}function fn(){}var pe={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function su(i){return i.match(/[-=:;]/g)?.length||0}function Ys(i){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(i)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(su(i),15)<<18}var oh=["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 io({n:i,i:e,v:t=[]},r,n,s){i&&(i=to({n:i,i:e,v:t})),s=[...Y(s)];for(let l of t){let a=r.theme("screens",l);for(let c of Y(a&&hn(a)||r.v(l))){var o;s.push(c),n|=a?67108864|Ys(c):l=="dark"?1073741824:c[0]=="@"?Ys(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~oh.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:i,p:n,r:s,i:e}}var ou=new Map;function Ks(i){if(i.d){let e=[],t=Vs(i.r.reduce((r,n)=>n[0]=="@"?(e.push(n),r):n?Vs(r,s=>Vs(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):Gs(s,o)}return Gs(o,s)})):r,"&"),r=>Gs(r,i.n?"."+nu(i.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((r,n)=>n+"{"+r+"}",i.d)}}function Vs(i,e){return i.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,r,n)=>e(r)+n)}function Gs(i,e){return i.replace(/&/g,e)}var Ql=new Intl.Collator("en",{numeric:!0});function au(i,e){for(var t=0,r=i.length;t<r;){let n=r+t>>1;0>=lu(i[n],e)?t=n+1:r=n}return r}function lu(i,e){let t=i.p&pe.o;return t==(e.p&pe.o)&&(t==pe.b||t==pe.o)?0:i.p-e.p||i.o-e.o||Ql.compare(eu(i.n),eu(e.n))||Ql.compare(tu(i.n),tu(e.n))}function eu(i){return(i||"").split(/:/).pop().split("/").pop()||"\0"}function tu(i){return(i||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Js(i,e){return Math.round(parseInt(i,16)*e)}function We(i,e={}){if(typeof i=="function")return i(e);let{opacityValue:t="1",opacityVariable:r}=e,n=r?`var(${r})`:t;if(i.includes("<alpha-value>"))return i.replace("<alpha-value>",n);if(i[0]=="#"&&(i.length==4||i.length==7)){let s=(i.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Js(i.substr(1,s),o),Js(i.substr(1+s,s),o),Js(i.substr(1+2*s,s),o),n]})`}return n=="1"?i:n=="0"?"#0000":i.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function uu(i,e,t,r,n=[]){return function s(o,{n:l,p:a,r:c=[],i:d},u){let p=[],h="",g=0,m=0;for(let _ in o||{}){var x,S;let I=o[_];if(_[0]=="@"){if(!I)continue;if(_[1]=="a"){p.push(...no(l,a,pn(""+I),u,a,c,d,!0));continue}if(_[1]=="l"){for(let P of Y(I))p.push(...s(P,{n:l,p:(x=pe[_[7]],a&~pe.o|x),r:_[7]=="d"?[]:c,i:d},u));continue}if(_[1]=="i"){p.push(...Y(I).map(P=>({p:-1,o:0,r:[],d:_+" "+P})));continue}if(_[1]=="k"){p.push({p:pe.d,o:0,r:[_],d:s(I,{p:pe.d},u).map(Ks).join("")});continue}if(_[1]=="f"){p.push(...Y(I).map(P=>({p:pe.d,o:0,r:[_],d:s(P,{p:pe.d},u).map(Ks).join("")})));continue}}if(typeof I!="object"||Array.isArray(I))_=="label"&&I?l=I+cn(JSON.stringify([a,d,o])):(I||I===0)&&(_=_.replace(/[A-Z]/g,P=>"-"+P.toLowerCase()),m+=1,g=Math.max(g,(S=_)[0]=="-"?0:su(S)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(S)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+Y(I).map(P=>u.s(_,ro(""+P,u.theme)+(d?" !important":""))).join(";"));else if(_[0]=="@"||_.includes("&")){let P=a;_[0]=="@"&&(_=_.replace(/\bscreen\(([^)]+)\)/g,(U,G)=>{let B=u.theme("screens",G);return B?(P|=67108864,hn(B,"")):U}),P|=Ys(_)),p.push(...s(I,{n:l,p:P,r:[...c,_],i:d},u))}else p.push(...s(I,{p:a,r:[...c,_]},u))}return p.unshift({n:l,p:a,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:c,d:h}),p.sort(lu)}(i,io(e,t,r,n),t)}function ro(i,e){return i.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,r,n,s,o="")=>{let l=e(n,o);return typeof l=="function"&&/color|fill|stroke/i.test(n)?We(l):""+Y(l).filter(a=>Object(a)!==a)})}function cu(i,e){let t,r=[];for(let n of i)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):r.push(t={...n,n:n.n&&e}):r.push({...n,n:n.n&&e});return r}function dn(i,e,t=pe.u,r,n){let s=[];for(let o of i)for(let l of function(a,c,d,u,p){a={...a,i:a.i||p};let h=function(g,m){let x=ou.get(g.n);return x?x(g,m):m.r(g.n,g.v[0]=="dark")}(a,c);return h?typeof h=="string"?({r:u,p:d}=io(a,c,d,u),cu(dn(pn(h),c,d,u,a.i),a.n)):Array.isArray(h)?h.map(g=>{var m,x;return{o:0,...g,r:[...Y(u),...Y(g.r)],p:(m=d,x=g.p??d,m&~pe.o|x)}}):uu(h,a,c,d,u):[{c:to(a),p:0,o:0,r:[]}]}(o,e,t,r,n))s.splice(au(s,l),0,l);return s}function no(i,e,t,r,n,s,o,l){return cu((l?t.flatMap(a=>dn([a],r,n,s,o)):dn(t,r,n,s,o)).map(a=>a.p&pe.o&&(a.n||e==pe.b)?{...a,p:a.p&~pe.o|e,o:0}:a),i)}function ah(i,e,t,r){var n;return n=(s,o)=>{let{n:l,p:a,r:c,i:d}=io(s,o,e);return t&&no(l,e,t,o,a,c,d,r)},ou.set(i,n),i}function Xs(i,e,t){if(i[i.length-1]!="("){let r=[],n=!1,s=!1,o="";for(let l of i)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),n=!n),l.endsWith(":")){r[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:r.filter(lh),i:n}))}}function lh(i,e,t){return t.indexOf(i)==e}var iu=new Map;function pn(i){let e=iu.get(i);if(!e){let t=[],r=[[]],n=0,s=0,o=null,l=0,a=(c,d=0)=>{n!=l&&(t.push(i.slice(n,l+d)),c&&Xs(t,r)),n=l+1};for(;l<i.length;l++){let c=i[l];if(s)i[l-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)i[l-1]!="\\"&&o.test(i.slice(l))&&(o=null,n=l+RegExp.lastMatch.length);else if(c=="/"&&i[l-1]!="\\"&&(i[l+1]=="*"||i[l+1]=="/"))o=i[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")a(),t.push(c);else if(c==":")i[l+1]!=":"&&a(!1,1);else if(/[\s,)]/.test(c)){a(!0);let d=t.lastIndexOf("(");if(c==")"){let u=t[d-1];if(/[~@]$/.test(u)){let p=r.shift();t.length=d,Xs([...t,"#"],r);let{v:h}=r[0].pop();for(let g of p)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);Xs([...t,ah(u.length>1?u.slice(0,-1)+cn(JSON.stringify([u,p])):u+"("+sh(p)+")",pe.a,p,/@$/.test(u))],r)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(c)&&i[l+1]=="("&&r.unshift([])}a(!0),iu.set(i,e=r[0])}return e}function w(i,e,t){return[i,Zs(e,t)]}function Zs(i,e){return typeof i=="function"?i:typeof i=="string"&&/^[\w-]+$/.test(i)?(t,r)=>({[i]:e?e(t,r):Qs(t,1)}):t=>i||{[t[1]]:Qs(t,2)}}function Qs(i,e,t=i.slice(e).find(Boolean)||i.$$||i.input){return i.input[0]=="-"?`calc(${t} * -1)`:t}function k(i,e,t,r){return[i,so(e,t,r)]}function so(i,e,t){let r=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=du(i||n[1]),l=s.theme(o,n.$$)??nt(n.$$,o,s);if(l!=null)return n._=Qs(n,0,l),r(n,s,o)}}function he(i,e={},t){return[i,uh(e,t)]}function uh(i={},e){return(t,r)=>{let{section:n=du(t[0]).replace("-","")+"Color"}=i,[s,o]=ch(t.$$);if(!s)return;let l=r.theme(n,s)||nt(s,n,r);if(!l||typeof l=="object")return;let{opacityVariable:a=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:u}=i,p=r.theme(c,o||"DEFAULT")||o&&nt(o,c,r),h=e||(({_:m})=>{let x=rr(d,m);return u?{[u]:x}:x});t._={value:We(l,{opacityVariable:a||void 0,opacityValue:p||void 0}),color:m=>We(l,m),opacityVariable:a||void 0,opacityValue:p||void 0};let g=h(t,r);if(!t.dark){let m=r.d(n,s,l);m&&m!==l&&(t._={value:We(m,{opacityVariable:a||void 0,opacityValue:p||"1"}),color:x=>We(m,x),opacityVariable:a||void 0,opacityValue:p||void 0},g={"&":g,[r.v("dark")]:h(t,r)})}return g}}function ch(i){return(i.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function rr(i,e){let t={};return typeof e=="string"?t[i]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[i]=e.value),t}function nt(i,e,t){if(i[0]=="["&&i.slice(-1)=="]"){if(i=vi(ro(i.slice(1,-1),t.theme)),!e)return i;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(i)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(i))||/image/i.test(e)&&!(/^image:/.test(i)||/^[a-z-]+\(/.test(i))||/weight/i.test(e)&&!(/^(number|any):/.test(i)||/^\d+$/.test(i))||/position/i.test(e)&&/^(length|size):/.test(i)))return i.replace(/^[a-z-]+:/,"")}}function du(i){return i.replace(/-./g,e=>e[1].toUpperCase())}function vi(i){return i.includes("url(")?i.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",r,n="")=>vi(t)+r+vi(n)):i.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 oo({presets:i=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Y(e.variants),rules:Y(e.rules),ignorelist:Y(e.ignorelist),hash:void 0,stringify:(r,n)=>r+":"+n,finalize:[]};for(let r of Y([...i,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Y(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:c,ignorelist:d,hash:u=t.hash,stringify:p=t.stringify,finalize:h}=typeof r=="function"?r(t):r;t={preflight:t.preflight!==!1&&n!==!1&&[...t.preflight,...Y(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Y(a)],rules:[...t.rules,...Y(c)],ignorelist:[...t.ignorelist,...Y(d)],hash:u,stringify:p,finalize:[...t.finalize,...Y(h)]}}return t}function ru(i,e,t,r,n,s){for(let o of e){let l=t.get(o);l||t.set(o,l=r(o));let a=l(i,n,s);if(a)return a}}function dh(i){var e;return eo(i[0],typeof(e=i[1])=="function"?e:()=>e)}function ph(i){var e,t;return Array.isArray(i)?eo(i[0],Zs(i[1],i[2])):eo(i,Zs(e,t))}function eo(i,e){return pu(i,(t,r,n,s)=>{let o=r.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,n)})}function pu(i,e){let t=Y(i).map(hh);return(r,n,s)=>{for(let o of t){let l=e(r,o,n,s);if(l)return l}}}function hh(i){return typeof i=="string"?RegExp("^"+i+(i.includes("$")||i.slice(-1)=="-"?"":"$")):i}function hu(i,e){let t=oo(i),r=function({theme:a,darkMode:c,darkColor:d=fn,variants:u,rules:p,hash:h,stringify:g,ignorelist:m,finalize:x}){let S=new Map,_=new Map,I=new Map,P=new Map,U=pu(m,(T,q)=>q.test(T));u.push(["dark",Array.isArray(c)||c=="class"?`${Y(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let G=typeof h=="function"?T=>h(T,cn):h?cn:Zl;G!==Zl&&x.push(T=>({...T,n:T.n&&G(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(q,z)=>"--"+G(z).replace("#",""))}));let B={theme:function({extend:T={},...q}){let z={},$e={get colors(){return ge("colors")},theme:ge,negative(){return{}},breakpoints(J){let ee={};for(let ue in J)typeof J[ue]=="string"&&(ee["screen-"+ue]=J[ue]);return ee}};return ge;function ge(J,ee,ue,Fe){if(J){if({1:J,2:Fe}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(J)||[,J],/[.[]/.test(J)){let Se=[];J.replace(/\[([^\]]+)\]|([^.[]+)/g,(ie,ve,Ie=ve)=>Se.push(Ie)),J=Se.shift(),ue=ee,ee=Se.join("-")}let se=z[J]||Object.assign(Object.assign(z[J]={},ze(q,J)),ze(T,J));if(ee==null)return se;ee||(ee="DEFAULT");let ke=se[ee]??ee.split("-").reduce((Se,ie)=>Se?.[ie],se)??ue;return Fe?We(ke,{opacityValue:ro(Fe,ge)}):ke}let Ue={};for(let se of[...Object.keys(q),...Object.keys(T)])Ue[se]=ge(se);return Ue}function ze(J,ee){let ue=J[ee];return typeof ue=="function"&&(ue=ue($e)),ue&&/color|fill|stroke/i.test(ee)?function Fe(Ue,se=[]){let ke={};for(let Se in Ue){let ie=Ue[Se],ve=[...se,Se];ke[ve.join("-")]=ie,Se=="DEFAULT"&&(ve=se,ke[se.join("-")]=ie),typeof ie=="object"&&Object.assign(ke,Fe(ie,ve))}return ke}(ue):ue}}(a),e:nu,h:G,s(T,q){return g(T,q,B)},d(T,q,z){return d(T,q,B,z)},v(T){return S.has(T)||S.set(T,ru(T,u,_,dh,B)||"&:"+T),S.get(T)},r(T,q){let z=JSON.stringify([T,q]);return I.has(z)||I.set(z,!U(T,B)&&ru(T,p,P,ph,B,q)),I.get(z)},f(T){return x.reduce((q,z)=>z(q,B),T)}};return B}(t),n=new Map,s=[],o=new Set;e.resume(a=>n.set(a,a),(a,c)=>{e.insert(a,s.length,c),s.push(c),o.add(a)});function l(a){let c=r.f(a),d=Ks(c);if(d&&!o.has(d)){o.add(d);let u=au(s,a);e.insert(d,u,a),s.splice(u,0,a)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let u of Y(t.preflight))typeof u=="function"&&(u=u(r)),u&&(typeof u=="string"?no("",pe.b,pn(u),r,pe.b,[],!1,!0):uu(u,{},r,pe.b)).forEach(l);c=""+c;let d=n.get(c);if(!d){let u=new Set;for(let p of dn(pn(c),r))u.add(p.c).add(l(p));d=[...u].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:r.theme,config:t,snapshot(){let a=e.snapshot(),c=new Set(o),d=new Map(n),u=[...s];return()=>{a(),o=c,n=d,s=u}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function fh(i,e){return i!=e&&""+i.split(" ").sort()!=""+e.split(" ").sort()}function fu(i){let e=new MutationObserver(t);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),r(n),t([{target:n,type:""}])},disconnect(){e.disconnect()}};function t(n){for(let{type:s,target:o}of n)if(s[0]=="a")r(o);else for(let l of o.querySelectorAll("[class]"))r(l);e.takeRecords()}function r(n){let s,o=n.getAttribute?.("class");o&&fh(o,s=i(o))&&n.setAttribute("class",s)}}function gh(i){let e=document.querySelector(i||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function gn(i){let e=i?.cssRules?i:(i&&typeof i!="string"?i:gh(i)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,r=>r.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,r){try{e.insertRule(t,r)}catch{e.insertRule(":root{}",r)}},resume:fn}}var vh=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 gu(i){return vh.get(i)}function vu(i){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(i);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function mu(i,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(i);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 mh=[["-webkit-",1],["-moz-",2],["-ms-",4]];function _u(){return({stringify:i})=>({stringify(e,t,r){let n="",s=gu(e);s&&(n+=i(s,t,r)+";");let o=vu(e),l=mu(e,t);for(let a of mh)o&a[1]&&(n+=i(a[0]+e,t,r)+";"),l&a[1]&&(n+=i(e,a[0]+t,r)+";");return n+i(e,t,r)}})}function bu(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",so("lineClamp",({_:i})=>yu(i))],["line-clamp-(\\d+)",({1:i})=>yu(i)]]}}function yu(i){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${i}`}}var sr={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",...qe(4,"rem",4,.5,.5),...qe(12,"rem",4,5),14:"3.5rem",...qe(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:W("blur"),backdropBrightness:W("brightness"),backdropContrast:W("contrast"),backdropGrayscale:W("grayscale"),backdropHueRotate:W("hueRotate"),backdropInvert:W("invert"),backdropOpacity:W("opacity"),backdropSaturate:W("saturate"),backdropSepia:W("sepia"),backgroundColor:W("colors"),backgroundImage:{none:"none"},backgroundOpacity:W("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:{...qe(200,"",100,0,50),...qe(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:i})=>({DEFAULT:i("colors.gray.200","currentColor"),...i("colors")}),borderOpacity:W("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:W("spacing"),borderWidth:{DEFAULT:"1px",...Ve(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:W("colors"),caretColor:W("colors"),accentColor:({theme:i})=>({auto:"auto",...i("colors")}),contrast:{...qe(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:W("borderColor"),divideOpacity:W("borderOpacity"),divideWidth:W("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:i})=>({...i("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:i})=>({...i("spacing"),...nr(2,6),...nr(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:W("spacing"),gradientColorStops:W("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:i})=>({...i("spacing"),...nr(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:i})=>({...i("spacing"),...nr(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:{...qe(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:i})=>({auto:"auto",...i("spacing")}),maxHeight:({theme:i})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...i("spacing")}),maxWidth:({theme:i,breakpoints:e})=>({...e(i("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:{...qe(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:W("spacing"),placeholderColor:W("colors"),placeholderOpacity:W("opacity"),outlineColor:W("colors"),outlineOffset:Ve(8,"px"),outlineWidth:Ve(8,"px"),ringColor:({theme:i})=>({...i("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:W("colors"),ringOffsetWidth:Ve(8,"px"),ringOpacity:({theme:i})=>({...i("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ve(8,"px")},rotate:{...Ve(2,"deg"),...Ve(12,"deg",3),...Ve(180,"deg",45)},saturate:qe(200,"",100,0,50),scale:{...qe(150,"",100,0,50),...qe(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:W("spacing"),scrollPadding:W("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ve(2,"deg"),...Ve(12,"deg",3)},space:W("spacing"),stroke:({theme:i})=>({...i("colors"),none:"none"}),strokeWidth:qe(2),textColor:W("colors"),textDecorationColor:W("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ve(8,"px")},textUnderlineOffset:{auto:"auto",...Ve(8,"px")},textIndent:W("spacing"),textOpacity:W("opacity"),transitionDuration:({theme:i})=>({...i("durations"),DEFAULT:"150ms"}),transitionDelay:W("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:i})=>({...i("spacing"),...nr(2,4),full:"100%"}),width:({theme:i})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...i("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...qe(50,"",1,0,10),auto:"auto"}};function nr(i,e){let t={};do for(var r=1;r<i;r++)t[`${r}/${i}`]=Number((r/i*100).toFixed(6))+"%";while(++i<=e);return t}function Ve(i,e,t=0){let r={};for(;t<=i;t=2*t||1)r[t]=t+e;return r}function qe(i,e="",t=1,r=0,n=1,s={}){for(;r<=i;r+=n)s[r]=r/t+e;return s}function W(i){return({theme:e})=>e(i)}var wu={"*,::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, ${sr.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, ${sr.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 $u=[w("\\[([-\\w]+):(.+)]",({1:i,2:e},t)=>({"@layer overrides":{"&":{[i]:nt(`[${e}]`,"",t)}}})),w("(group|peer)([~/][^-[]+)?",({input:i},{h:e})=>[{c:e(i)}]),k("aspect-","aspectRatio"),w("container",(i,{theme:e})=>{let{screens:t=e("screens"),center:r,padding:n}=e("container"),s={width:"100%",marginRight:r&&"auto",marginLeft:r&&"auto",...o("xs")};for(let l in t){let a=t[l];typeof a=="string"&&(s[hn(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}}}),k("content-","content",({_:i})=>({"--tw-content":i,content:"var(--tw-content)"})),w("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),w("box-(border|content)","boxSizing",({1:i})=>i+"-box"),w("hidden",{display:"none"}),w("table-(auto|fixed)","tableLayout"),w(["(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)",w("isolate","isolation"),w("object-(contain|cover|fill|none|scale-down)","objectFit"),k("object-","objectPosition"),w("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",vn),w("overscroll(-[xy])?-(auto|contain|none)",({1:i="",2:e})=>({["overscroll-behavior"+i]:e})),w("(static|fixed|absolute|relative|sticky)","position"),k("-?inset(-[xy])?(?:$|-)","inset",({1:i,_:e})=>({top:i!="-x"&&e,right:i!="-y"&&e,bottom:i!="-x"&&e,left:i!="-y"&&e})),k("-?(top|bottom|left|right)(?:$|-)","inset"),w("(visible|collapse)","visibility"),w("invisible",{visibility:"hidden"}),k("-?z-","zIndex"),w("flex-((row|col)(-reverse)?)","flexDirection",xu),w("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),k("(flex-(?:grow|shrink))(?:$|-)"),k("(flex)-"),k("grow(?:$|-)","flexGrow"),k("shrink(?:$|-)","flexShrink"),k("basis-","flexBasis"),k("-?(order)-"),"-?(order)-(\\d+)",k("grid-cols-","gridTemplateColumns"),w("grid-cols-(\\d+)","gridTemplateColumns",Cu),k("col-","gridColumn"),w("col-(span)-(\\d+)","gridColumn",Eu),k("col-start-","gridColumnStart"),w("col-start-(auto|\\d+)","gridColumnStart"),k("col-end-","gridColumnEnd"),w("col-end-(auto|\\d+)","gridColumnEnd"),k("grid-rows-","gridTemplateRows"),w("grid-rows-(\\d+)","gridTemplateRows",Cu),k("row-","gridRow"),w("row-(span)-(\\d+)","gridRow",Eu),k("row-start-","gridRowStart"),w("row-start-(auto|\\d+)","gridRowStart"),k("row-end-","gridRowEnd"),w("row-end-(auto|\\d+)","gridRowEnd"),w("grid-flow-((row|col)(-dense)?)","gridAutoFlow",i=>vn(xu(i))),w("grid-flow-(dense)","gridAutoFlow"),k("auto-cols-","gridAutoColumns"),k("auto-rows-","gridAutoRows"),k("gap-x(?:$|-)","gap","columnGap"),k("gap-y(?:$|-)","gap","rowGap"),k("gap(?:$|-)","gap"),"(justify-(?:items|self))-",w("justify-","justifyContent",ku),w("(content|items|self)-",i=>({["align-"+i[1]]:ku(i)})),w("(place-(content|items|self))-",({1:i,$$:e})=>({[i]:("wun".includes(e[3])?"space-":"")+e})),k("p([xytrbl])?(?:$|-)","padding",mi("padding")),k("-?m([xytrbl])?(?:$|-)","margin",mi("margin")),k("-?space-(x|y)(?:$|-)","space",({1:i,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[i]]:`calc(${e} * calc(1 - var(--tw-space-${i}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[i]]:`calc(${e} * var(--tw-space-${i}-reverse))`}})),w("space-(x|y)-reverse",({1:i})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"1"}})),k("w-","width"),k("min-w-","minWidth"),k("max-w-","maxWidth"),k("h-","height"),k("min-h-","minHeight"),k("max-h-","maxHeight"),k("font-","fontWeight"),k("font-","fontFamily",({_:i})=>typeof(i=Y(i))[1]=="string"?{fontFamily:Ze(i)}:{fontFamily:Ze(i[0]),...i[1]}),w("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),w("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),w("italic","fontStyle"),w("not-italic",{fontStyle:"normal"}),w("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:i,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":i)]:i,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Et({"--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,/*!*/ /*!*/)"})}),k("tracking-","letterSpacing"),k("leading-","lineHeight"),w("list-(inside|outside)","listStylePosition"),k("list-","listStyleType"),w("list-","listStyleType"),k("placeholder-opacity-","placeholderOpacity",({_:i})=>({"&::placeholder":{"--tw-placeholder-opacity":i}})),he("placeholder-",{property:"color",selector:"&::placeholder"}),w("text-(left|center|right|justify|start|end)","textAlign"),w("text-(ellipsis|clip)","textOverflow"),k("text-opacity-","textOpacity","--tw-text-opacity"),he("text-",{property:"color"}),k("text-","fontSize",({_:i})=>typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}),k("indent-","textIndent"),w("(overline|underline|line-through)","textDecorationLine"),w("no-underline",{textDecorationLine:"none"}),k("underline-offset-","textUnderlineOffset"),he("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),k("decoration-","textDecorationThickness"),w("decoration-","textDecorationStyle"),w("(uppercase|lowercase|capitalize)","textTransform"),w("normal-case",{textTransform:"none"}),w("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),w("align-","verticalAlign"),w("whitespace-","whiteSpace"),w("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),w("break-words",{overflowWrap:"break-word"}),w("break-all",{wordBreak:"break-all"}),w("break-keep",{wordBreak:"keep-all"}),he("caret-",{opacityVariable:!1,opacitySection:"opacity"}),he("accent-",{opacityVariable:!1,opacitySection:"opacity"}),w("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:i})=>`linear-gradient(to ${Gt(i," ")},var(--tw-gradient-stops))`),he("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-from":i.value,"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),he("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${i.value},var(--tw-gradient-to)`})),he("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),w("bg-(fixed|local|scroll)","backgroundAttachment"),w("bg-origin-(border|padding|content)","backgroundOrigin",({1:i})=>i+"-box"),w(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),w("bg-blend-","backgroundBlendMode"),w("bg-clip-(border|padding|content|text)","backgroundClip",({1:i})=>i+(i=="text"?"":"-box")),k("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),he("bg-",{section:"backgroundColor"}),k("bg-","backgroundImage"),k("bg-","backgroundPosition"),w("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",vn),k("bg-","backgroundSize"),k("rounded(?:$|-)","borderRadius"),k("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:i,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[i]||[i,i];return{[`border-${Gt(t[0])}-radius`]:e,[`border-${Gt(t[1])}-radius`]:e}}),w("border-(collapse|separate)","borderCollapse"),k("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),w("border-(solid|dashed|dotted|double|none)","borderStyle"),k("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:i,_:e})=>({...Et({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(i||"-x")]:e,["--tw-border-spacing"+(i||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),he("border-([xytrbl])-",{section:"borderColor"},mi("border","Color")),he("border-"),k("border-([xytrbl])(?:$|-)","borderWidth",mi("border","Width")),k("border(?:$|-)","borderWidth"),k("divide-opacity(?:$|-)","divideOpacity",({_:i})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":i}})),w("divide-(solid|dashed|dotted|double|none)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:i}})),w("divide-([xy]-reverse)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+i]:"1"}})),k("divide-([xy])(?:$|-)","divideWidth",({1:i,_:e})=>{let t={x:"lr",y:"tb"}[i];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${i}-reverse`]:"0",[`border-${Gt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${i}-reverse)))`,[`border-${Gt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${i}-reverse))`}}}),he("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),k("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),he("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),k("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),w("ring-inset",{"--tw-ring-inset":"inset"}),he("ring-",{property:"--tw-ring-color"}),k("ring(?:$|-)","ringWidth",({_:i},{theme:e})=>({...Et({"--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":We(e("ringOffsetColor","","#fff")),"--tw-ring-color":We(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(${i} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),he("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-shadow-color":i.value,"--tw-shadow":"var(--tw-shadow-colored)"})),k("shadow(?:$|-)","boxShadow",({_:i})=>({...Et({"--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":Ze(i),"--tw-shadow-colored":Ze(i).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)"})),k("(opacity)-"),w("mix-blend-","mixBlendMode"),...Su(),...Su("backdrop-"),k("transition(?:$|-)","transitionProperty",(i,{theme:e})=>({transitionProperty:Ze(i),transitionTimingFunction:i._=="none"?void 0:Ze(e("transitionTimingFunction","")),transitionDuration:i._=="none"?void 0:Ze(e("transitionDuration",""))})),k("duration(?:$|-)","transitionDuration","transitionDuration",Ze),k("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ze),k("delay(?:$|-)","transitionDelay","transitionDelay",Ze),k("animate(?:$|-)","animation",(i,{theme:e,h:t,e:r})=>{let n=Ze(i),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=r(t(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",w("transform",lo),w("transform-(cpu|gpu)",({1:i})=>({"--tw-transform":Iu(i=="gpu")})),k("scale(-[xy])?-","scale",({1:i,_:e})=>({["--tw-scale"+(i||"-x")]:e,["--tw-scale"+(i||"-y")]:e,...lo()})),k("-?(rotate)-","rotate",ao),k("-?(translate-[xy])-","translate",ao),k("-?(skew-[xy])-","skew",ao),w("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",vn),"(appearance)-",k("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",k("(cursor)-"),"(cursor)-",w("snap-(none)","scroll-snap-type"),w("snap-(x|y|both)",({1:i})=>({...Et({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":i+" var(--tw-scroll-snap-strictness)"})),w("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),w("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),w("snap-(normal|always)","scroll-snap-stop"),w("scroll-(auto|smooth)","scroll-behavior"),k("scroll-p([xytrbl])?(?:$|-)","padding",mi("scroll-padding")),k("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",mi("scroll-margin")),w("touch-(auto|none|manipulation)","touch-action"),w("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:i,2:e,3:t})=>({...Et({"--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":i}`]:i,"touch-action":"var(--tw-touch-action)"})),w("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),w("outline",{outlineStyle:"solid"}),w("outline-(dashed|dotted|double)","outlineStyle"),k("-?(outline-offset)-"),he("outline-",{opacityVariable:!1,opacitySection:"opacity"}),k("outline-","outlineWidth"),"(pointer-events)-",k("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:i})=>({x:"horizontal",y:"vertical"})[i]||i||"both"],w("select-(none|text|all|auto)","userSelect"),he("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),he("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),k("stroke-","strokeWidth"),w("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),w("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function vn(i){return(typeof i=="string"?i:i[1]).replace(/-/g," ").trim()}function xu(i){return(typeof i=="string"?i:i[1]).replace("col","column")}function Gt(i,e="-"){let t=[];for(let r of i)t.push({t:"top",r:"right",b:"bottom",l:"left"}[r]);return t.join(e)}function Ze(i){return i&&""+(i._||i)}function ku({$$:i}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[i[3]||""]||"")+i}function mi(i,e=""){return({1:t,_:r})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...rr(i+"-"+Gt(n[0])+e,r),...rr(i+"-"+Gt(n[1])+e,r)}:rr(i+e,r)}}function Su(i=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",i&&"opacity","saturate","sepia",!i&&"drop-shadow"].filter(Boolean),t={};for(let r of e)t[`--tw-${i}${r}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...Et(t),[`${i}filter`]:e.map(r=>`var(--tw-${i}${r})`).join(" ")},[`(${i}filter)-(none)`,w(`${i}filter`,t),...e.map(r=>k(`${r[0]=="h"?"-?":""}(${i}${r})(?:$|-)`,r,({1:n,_:s})=>({[`--tw-${n}`]:Y(s).map(o=>`${r}(${o})`).join(" "),...t})))]}function ao({1:i,_:e}){return{["--tw-"+i]:e,...lo()}}function lo(){return{...Et({"--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":Iu()}),transform:"var(--tw-transform)"}}function Iu(i){return[i?"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 Eu({1:i,2:e}){return`${i} ${e} / ${i} ${e}`}function Cu({1:i}){return`repeat(${i},minmax(0,1fr))`}function Et(i){return{"@layer defaults":{"*,::before,::after":i,"::backdrop":i}}}var Au=[["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:i})=>`@media (orientation:${i})`],["contrast-(more|less)",({1:i})=>`@media (prefers-contrast:${i})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:i})=>`&::${i}`],["(marker|selection)",({1:i})=>`& *::${i},&::${i}`],["file","&::file-selector-button"],["(first|last|only)",({1:i})=>`&:${i}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:i,$$:e},t)=>e&&`&[${i}-${t.theme(i,e)||nt(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:i,3:e="",4:t,5:r="",6:n=e},{e:s,h:o,v:l})=>{let a=vi(r)||(t[0]=="["?t:l(t.slice(1)));return`${(a.includes("&")?a:"&"+a).replace(/&/g,`:merge(.${s(o(i+n))})`)}${i[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:i})=>`[dir="${i}"] &`],["supports-",({$$:i},e)=>{if(i&&(i=e.theme("supports",i)||nt(i,"",e)),i)return i.includes(":")||(i+=":var(--tw)"),/^\w*\s*\(/.test(i)||(i=`(${i})`),`@supports ${i.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:i},e)=>{if(i&&(i=e.theme("screens",i)||nt(i,"",e)),typeof i=="string")return`@media not all and (min-width:${i})`}],["min-",({$$:i},e)=>(i&&(i=nt(i,"",e)),i&&`@media (min-width:${i})`)],[/^\[(.+)]$/,({1:i})=>/[&@]/.test(i)&&vi(i).replace(/[}]+$/,"").split("{")]];function Tu({colors:i,disablePreflight:e}={}){return{preflight:e?void 0:wu,theme:{...sr,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...i}},variants:Au,rules:$u,finalize(t){return t.n&&t.d&&t.r.some(r=>/^&::(before|after)$/.test(r))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var _h={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},yh={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},bh={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},wh={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},xh={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},kh={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Sh={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Eh={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Ch={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},$h={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Ih={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Ah={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Th={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Ph={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Rh={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Oh={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Fh={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Mh={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Dh={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Lh={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Nh={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Uh={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Pu={__proto__:null,slate:_h,gray:yh,zinc:bh,neutral:wh,stone:xh,red:kh,orange:Sh,amber:Eh,yellow:Ch,lime:$h,green:Ih,emerald:Ah,teal:Th,cyan:Ph,sky:Rh,blue:Oh,indigo:Fh,violet:Mh,purple:Dh,fuchsia:Lh,pink:Nh,rose:Uh};function Ru({disablePreflight:i}={}){return Tu({colors:Pu,disablePreflight:i})}function Mu({className:i="prose",defaultColor:e="gray",extend:t={},colors:r={}}={}){return r={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",...r,dark:r.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",...r.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])=>[`${i}-${s}`,(l,a)=>Du(i,o[0]=="."?"."+a.e(a.h(o.slice(1))):o,a,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${i})`,({1:s},{h:o})=>[{c:o(s)}]],[`${i}-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)"}}],[i+"-",({$$:s},o)=>{let l=Fu(o.theme("fontSize",s));return l&&{"@layer components":l}}],[i+"-",({$$:s},o)=>n(s,o)],[i,(s,o)=>({...n(e,o),"@layer base":[Ou(i,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:F(20,16),marginBottom:F(20,16),paddingLeft:F(26,16)},li:{marginTop:F(8,16),marginBottom:F(8,16)},"ol>li,ul>li":{paddingLeft:F(6,16)},">ul>li p":{marginTop:F(12,16),marginBottom:F(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:F(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:F(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:F(12,16),marginBottom:F(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:F(48,16),marginBottom:F(48,16)},blockquote:{marginTop:F(32,20),marginBottom:F(32,20),paddingLeft:F(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:F(20,16),marginBottom:F(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:F(36,16),marginTop:"0",marginBottom:F(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:F(24,16),marginTop:F(48,24),marginBottom:F(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:F(20,16),marginTop:F(32,20),marginBottom:F(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:F(24,16),marginBottom:F(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:F(32,16),marginBottom:F(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:F(14,16),lineHeight:"1.4",marginTop:F(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:F(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:F(21,24)},"h3 code":{fontSize:F(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:F(14,16),lineHeight:"1.7",marginTop:F(24,14),marginBottom:F(24,14),borderRadius:"0.375rem",paddingTop:F(12,14),paddingRight:F(16,14),paddingBottom:F(12,14),paddingLeft:F(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:F(32,16),marginBottom:F(32,16),fontSize:F(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:F(8,14),paddingBottom:F(8,14),paddingLeft:F(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:F(8,14),paddingRight:F(8,14),paddingBottom:F(8,14),paddingLeft:F(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:F(20,16),lineHeight:"1.6",marginTop:F(24,20),marginBottom:F(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Ou(i,o,t)],"@layer components":{...Fu(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let l={},a={},c=(d,u,p)=>{let h=o.theme(`colors.${s}.${u}`,u);p["--tw-prose-"+d]=We(h);let g=p!=a&&o.d("colors",`${s}-${u}`,h);g&&(a["--tw-prose-"+d]=We(g))};for(let d in r){let u=r[d];d!="dark"&&u&&c(d,u,l)}for(let d in r.dark||{}){let u=r.dark[d];u&&(r.dark?c("invert-"+d,u,l):c(d,u,a))}return Object.keys(l).length?{"@layer defaults":{"&":l,[o.v("dark")]:a}}:void 0}}function Ou(i,e,t){let r={};for(let n in t)r[Du(i,n,e,s=>`.${e.e(e.h(i))}${s}`)]=t[n];return r}function Du(i,e,{e:t,h:r},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",l=s,a="")=>n(`${o}:where(${l}):not(:where(.${t(r("not-"+i))} *))${a}`))}function Fu(i){return i?typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}:void 0}function F(i,e){return`${(i/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var uo=oo({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:[Ru(),_u(),bu(),Mu()]});function Lu(i,e=!0){let t=function(){if(qh)try{let a=gn(new CSSStyleSheet);return a.connect=c=>{let d=co(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,a.target]},a.disconnect=fn,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[gn(s)],l=new WeakMap;return{get target(){return o[0].target},snapshot(){let a=o.map(c=>c.snapshot());return()=>a.forEach(c=>c())},clear(){o.forEach(a=>a.clear())},destroy(){o.forEach(a=>a.destroy())},insert(a,c,d){o[0].insert(a,c,d);let u=this.target.cssRules[c];o.forEach((p,h)=>h&&p.target.insertRule(u.cssText,c))},resume(a,c){return o[0].resume(a,c)},connect(a){let c=document.createElement("style");co(a).appendChild(c);let d=gn(c),{cssRules:u}=this.target;for(let p=0;p<u.length;p++)d.target.insertRule(u[p].cssText,p);o.push(d),l.set(a,d)},disconnect(a){let c=o.indexOf(l.get(a));c>=0&&o.splice(c,1)}}}(),r=hu({...i,hash:i.hash??e},t),n=fu(r);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(co(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=r}}}}var qh=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function co(i){return i.shadowRoot||i.attachShadow({mode:"open"})}var V=i=>Lu(uo)(i);var mn=class extends V(j){constructor(){super();A(this,"render",()=>D`
4
4
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
5
5
  <!-- 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 -->
6
6
  <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">
7
7
  <!-- the 'open' state invites the user to open (e.g. the chat window) -->
8
8
  <div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute bottom-0 left-0 right-0 top-0 transition-[opacity,visibility]">
9
- ${this.src?L`
9
+ ${this.src?D`
10
10
  <!-- load given source -->
11
11
  <!-- scale-[1.01] fixes aliasing (white outline) -->
12
12
  <img class="block h-full w-full scale-[1.01] bg-white" src="${this.src}" alt="Molin AI chat" />
13
- `:L`
13
+ `:D`
14
14
  <!-- if no image URL is specified, we default to our animation -->
15
15
  <!-- scale-[1.01] fixes aliasing (white outline) -->
16
16
  <img src="https://assets.molinai.io/2024/widget-v20241209/bubble.webp" class="block h-full w-full scale-[1.01]" alt="Molin AI chat" />
@@ -26,9 +26,9 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
26
26
  </svg>
27
27
  </div>
28
28
  </button>
29
- `);this.state="open",this.src=""}};T(Sn,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",Sn);var En={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Cn=i=>(...e)=>({_$litDirective$:i,values:e}),ki=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Vh}=tu;var Hu=()=>document.createComment(""),Si=(i,e,t)=>{let r=i._$AA.parentNode,n=e===void 0?i._$AB:e._$AA;if(t===void 0){let s=r.insertBefore(Hu(),n),o=r.insertBefore(Hu(),n);t=new Vh(s,o,i,i.options)}else{let s=t._$AB.nextSibling,o=t._$AM,l=o!==i;if(l){let a;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(a=i._$AU)!==o._$AU&&t._$AP(a)}if(s!==n||l){let a=t._$AA;for(;a!==s;){let c=a.nextSibling;r.insertBefore(a,n),a=c}}}return t},Pt=(i,e,t=i)=>(i._$AI(e,t),i),Gh={},zu=(i,e=Gh)=>i._$AH=e,Wu=i=>i._$AH,$n=i=>{i._$AP?.(!1,!0);let e=i._$AA,t=i._$AB.nextSibling;for(;e!==t;){let r=e.nextSibling;e.remove(),e=r}};var Vu=(i,e,t)=>{let r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},hr=Cn(class extends ki{constructor(i){if(super(i),i.type!==En.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let n=[],s=[],o=0;for(let l of i)n[o]=r?r(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){let n=Wu(i),{values:s,keys:o}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=o,s;let l=this.ut??=[],a=[],c,d,u=0,p=n.length-1,h=0,g=s.length-1;for(;u<=p&&h<=g;)if(n[u]===null)u++;else if(n[p]===null)p--;else if(l[u]===o[h])a[h]=Pt(n[u],s[h]),u++,h++;else if(l[p]===o[g])a[g]=Pt(n[p],s[g]),p--,g--;else if(l[u]===o[g])a[g]=Pt(n[u],s[g]),Si(i,a[g+1],n[u]),u++,g--;else if(l[p]===o[h])a[h]=Pt(n[p],s[h]),Si(i,n[u],n[p]),p--,h++;else if(c===void 0&&(c=Vu(o,h,g),d=Vu(l,u,p)),c.has(l[u]))if(c.has(l[p])){let m=d.get(o[h]),x=m!==void 0?n[m]:null;if(x===null){let S=Si(i,n[u]);Pt(S,s[h]),a[h]=S}else a[h]=Pt(x,s[h]),Si(i,n[u],x),n[m]=null;h++}else $n(n[p]),p--;else $n(n[u]),u++;for(;h<=g;){let m=Si(i,a[g+1]);Pt(m,s[h]),a[h++]=m}for(;u<=p;){let m=n[u++];m!==null&&$n(m)}return this.ut=o,zu(i,a),it}});function Gu(i,e,t){return i?e(i):t?.(i)}var In,Ju,An=class An extends J(H){constructor(){super();y(this,In);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?U:L`
29
+ `);this.state="open",this.src=""}};A(mn,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",mn);var _n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},yn=i=>(...e)=>({_$litDirective$:i,values:e}),_i=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:jh}=Yl;var Nu=()=>document.createComment(""),yi=(i,e,t)=>{let r=i._$AA.parentNode,n=e===void 0?i._$AB:e._$AA;if(t===void 0){let s=r.insertBefore(Nu(),n),o=r.insertBefore(Nu(),n);t=new jh(s,o,i,i.options)}else{let s=t._$AB.nextSibling,o=t._$AM,l=o!==i;if(l){let a;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(a=i._$AU)!==o._$AU&&t._$AP(a)}if(s!==n||l){let a=t._$AA;for(;a!==s;){let c=a.nextSibling;r.insertBefore(a,n),a=c}}}return t},Ct=(i,e,t=i)=>(i._$AI(e,t),i),Bh={},Uu=(i,e=Bh)=>i._$AH=e,qu=i=>i._$AH,bn=i=>{i._$AP?.(!1,!0);let e=i._$AA,t=i._$AB.nextSibling;for(;e!==t;){let r=e.nextSibling;e.remove(),e=r}};var ju=(i,e,t)=>{let r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},or=yn(class extends _i{constructor(i){if(super(i),i.type!==_n.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let n=[],s=[],o=0;for(let l of i)n[o]=r?r(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){let n=qu(i),{values:s,keys:o}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=o,s;let l=this.ut??=[],a=[],c,d,u=0,p=n.length-1,h=0,g=s.length-1;for(;u<=p&&h<=g;)if(n[u]===null)u++;else if(n[p]===null)p--;else if(l[u]===o[h])a[h]=Ct(n[u],s[h]),u++,h++;else if(l[p]===o[g])a[g]=Ct(n[p],s[g]),p--,g--;else if(l[u]===o[g])a[g]=Ct(n[u],s[g]),yi(i,a[g+1],n[u]),u++,g--;else if(l[p]===o[h])a[h]=Ct(n[p],s[h]),yi(i,n[u],n[p]),p--,h++;else if(c===void 0&&(c=ju(o,h,g),d=ju(l,u,p)),c.has(l[u]))if(c.has(l[p])){let m=d.get(o[h]),x=m!==void 0?n[m]:null;if(x===null){let S=yi(i,n[u]);Ct(S,s[h]),a[h]=S}else a[h]=Ct(x,s[h]),yi(i,n[u],x),n[m]=null;h++}else bn(n[p]),p--;else bn(n[u]),u++;for(;h<=g;){let m=yi(i,a[g+1]);Ct(m,s[h]),a[h++]=m}for(;u<=p;){let m=n[u++];m!==null&&bn(m)}return this.ut=o,Uu(i,a),Ke}});function Bu(i,e,t){return i?e(i):t?.(i)}var wn,Hu,xn=class xn extends V(j){constructor(){super();y(this,wn);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?L:D`
30
30
  <div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pb-2 pt-6">
31
- ${Gu(this.examples.title,()=>L`
31
+ ${Bu(this.examples.title,()=>D`
32
32
  <h2 class="mt-14 px-2 pb-2 pt-9 text-left text-3xl font-bold leading-tight tracking-tight">
33
33
  <span>${this.examples.title}</span>
34
34
  <svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
@@ -38,19 +38,19 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
38
38
  </svg>
39
39
  </h2>
40
40
  `)}
41
- ${this.examples?.items?.length?L`
41
+ ${this.examples?.items?.length?D`
42
42
  <ul class="mt-auto flex select-none flex-wrap justify-end gap-2.5 text-sm/6 text-black">
43
- ${hr(this.examples.items,t=>t,t=>L`
43
+ ${or(this.examples.items,t=>t,t=>D`
44
44
  <li
45
45
  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"
46
- @click="${()=>$(this,In,Ju).call(this,t)}">
46
+ @click="${()=>$(this,wn,Hu).call(this,t)}">
47
47
  <span>${t.trim()}</span>
48
48
  </li>
49
49
  `)}
50
50
  </ul>
51
- `:U}
51
+ `:L}
52
52
  </div>
53
- `}};In=new WeakSet,Ju=function(t){this.dispatchEvent(new An.ExampleClickEvent({example:t}))},T(An,"properties",{examples:{type:Object},color:{type:String}});var fr=An,_o;fr.ExampleClickEvent=(_o=class extends CustomEvent{constructor(e,t={}){super(fr.ExampleClickEvent.type,{detail:e,...t})}},T(_o,"type","mw:example-click"),_o);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",fr);var Ci,Xu,Yu,Ei=class Ei extends J(H){constructor(){super();y(this,Ci);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return L`
53
+ `}};wn=new WeakSet,Hu=function(t){this.dispatchEvent(new xn.ExampleClickEvent({example:t}))},A(xn,"properties",{examples:{type:Object},color:{type:String}});var ar=xn,po;ar.ExampleClickEvent=(po=class extends CustomEvent{constructor(e,t={}){super(ar.ExampleClickEvent.type,{detail:e,...t})}},A(po,"type","mw:example-click"),po);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",ar);var wi,zu,Wu,bi=class bi extends V(j){constructor(){super();y(this,wi);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return D`
54
54
  <div class="relative h-12">
55
55
  <div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
56
56
 
@@ -73,7 +73,7 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
73
73
  <div class="flex-grow"></div>
74
74
 
75
75
  <!-- new chat btn -->
76
- <button @click=${$(this,Ci,Xu)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
76
+ <button @click=${$(this,wi,zu)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
77
77
  <!-- svg icon of a bubble with a plus -->
78
78
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
79
79
  <path
@@ -85,7 +85,7 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
85
85
  </button>
86
86
 
87
87
  <!-- close chat btn -->
88
- <button @click=${$(this,Ci,Yu)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
88
+ <button @click=${$(this,wi,Wu)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
89
89
  <!-- svg icon of an X -->
90
90
  <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">
91
91
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
@@ -100,7 +100,7 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
100
100
  </div>
101
101
  </div>
102
102
  </div>
103
- `}};Ci=new WeakSet,Xu=function(){this.dispatchEvent(new Ei.NewChatClickEvent)},Yu=function(){this.dispatchEvent(new Ei.CloseClickEvent)},T(Ei,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),T(Ei,"styles",gt`
103
+ `}};wi=new WeakSet,zu=function(){this.dispatchEvent(new bi.NewChatClickEvent)},Wu=function(){this.dispatchEvent(new bi.CloseClickEvent)},A(bi,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),A(bi,"styles",ct`
104
104
  /* blurred background */
105
105
 
106
106
  .gradient-blur {
@@ -112,24 +112,24 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
112
112
  /* bg-color gradient */
113
113
  background-image: linear-gradient(to bottom, white 20%, transparent);
114
114
  }
115
- `);var Qt=Ei,yo;Qt.NewChatClickEvent=(yo=class extends CustomEvent{constructor(e={}){super(Qt.NewChatClickEvent.type,{...e})}},T(yo,"type","mw:new-chat-click"),yo);var bo;Qt.CloseClickEvent=(bo=class extends CustomEvent{constructor(e={}){super(Qt.CloseClickEvent.type,{...e})}},T(bo,"type","mw:close-click"),bo);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Qt);var wo={maxHeight:120,initialHeight:32,paddingY:12},Ae,Eo,Ku,Zu,Qu,ec,Co,$i=class $i extends J(H){constructor(){super();y(this,Ae);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return L`
116
- <form @submit="${$(this,Ae,Qu)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
115
+ `);var Jt=bi,ho;Jt.NewChatClickEvent=(ho=class extends CustomEvent{constructor(e={}){super(Jt.NewChatClickEvent.type,{...e})}},A(ho,"type","mw:new-chat-click"),ho);var fo;Jt.CloseClickEvent=(fo=class extends CustomEvent{constructor(e={}){super(Jt.CloseClickEvent.type,{...e})}},A(fo,"type","mw:close-click"),fo);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Jt);var go={maxHeight:120,initialHeight:32,paddingY:12},Ee,yo,Vu,Gu,Ju,Xu,bo,xi=class xi extends V(j){constructor(){super();y(this,Ee);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return D`
116
+ <form @submit="${$(this,Ee,Ju)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
117
117
  <textarea
118
118
  name="input"
119
- @input="${$(this,Ae,ec)}"
120
- @keydown="${$(this,Ae,Zu)}"
119
+ @input="${$(this,Ee,Xu)}"
120
+ @keydown="${$(this,Ee,Gu)}"
121
121
  autofocus
122
122
  ?disabled="${this.disabled}"
123
123
  placeholder="${this.placeholder}"
124
- class="box-content h-[${wo.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${wo.paddingY}px] text-base text-gray-800 outline-none"></textarea>
124
+ class="box-content h-[${go.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${go.paddingY}px] text-base text-gray-800 outline-none"></textarea>
125
125
 
126
126
  <button type="submit" ?disabled="${this.disabled}" class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
127
- ${this.streaming?L`
127
+ ${this.streaming?D`
128
128
  <!-- x -->
129
129
  <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">
130
130
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
131
131
  </svg>
132
- `:L`
132
+ `:D`
133
133
  <!-- airplane -->
134
134
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 35 34">
135
135
  <path
@@ -145,7 +145,7 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
145
145
  <slot>
146
146
  <div class="h-5 w-full"></div>
147
147
  </slot>
148
- `}};Ae=new WeakSet,Eo=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Ku=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Zu=function(t){Jh(t)&&(t.preventDefault(),this.streaming||f(this,Ae,Ku)?.click())},Qu=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new $i.CancelEvent);return}let r=f(this,Ae,Eo);if(!r)throw new Error("Expected input element to be present");r.value&&this.dispatchEvent(new $i.SubmitEvent(r.value))&&(r.value=""),$(this,Ae,Co).call(this)},ec=function(t){this.dispatchEvent(new $i.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),$(this,Ae,Co).call(this)},Co=function(){let t=f(this,Ae,Eo);if(!t)return;let{maxHeight:r,initialHeight:n,paddingY:s}=wo;t.style.height=`${n}px`;let o=t.scrollHeight,l=s*2,a=Math.min(o-l,r);t.style.height=`${a}px`},T($i,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var _t=$i,xo;_t.ChangeEvent=(xo=class extends CustomEvent{constructor(e,t={}){super(_t.ChangeEvent.type,{detail:e,...t})}},T(xo,"type","mw:change"),xo);var ko;_t.SubmitEvent=(ko=class extends CustomEvent{constructor(e,t={}){super(_t.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},T(ko,"type","mw:submit"),ko);var So;_t.CancelEvent=(So=class extends CustomEvent{constructor(e={}){super(_t.CancelEvent.type,{...e})}},T(So,"type","mw:cancel"),So);function Jh(i){return(i.code==="Enter"||i.code==="NumpadEnter")&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",_t);var Tn=class extends J(H){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 L`
148
+ `}};Ee=new WeakSet,yo=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Vu=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Gu=function(t){Hh(t)&&(t.preventDefault(),this.streaming||f(this,Ee,Vu)?.click())},Ju=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new xi.CancelEvent);return}let r=f(this,Ee,yo);if(!r)throw new Error("Expected input element to be present");r.value&&this.dispatchEvent(new xi.SubmitEvent(r.value))&&(r.value=""),$(this,Ee,bo).call(this)},Xu=function(t){this.dispatchEvent(new xi.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),$(this,Ee,bo).call(this)},bo=function(){let t=f(this,Ee,yo);if(!t)return;let{maxHeight:r,initialHeight:n,paddingY:s}=go;t.style.height=`${n}px`;let o=t.scrollHeight,l=s*2,a=Math.min(o-l,r);t.style.height=`${a}px`},A(xi,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var ht=xi,vo;ht.ChangeEvent=(vo=class extends CustomEvent{constructor(e,t={}){super(ht.ChangeEvent.type,{detail:e,...t})}},A(vo,"type","mw:change"),vo);var mo;ht.SubmitEvent=(mo=class extends CustomEvent{constructor(e,t={}){super(ht.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},A(mo,"type","mw:submit"),mo);var _o;ht.CancelEvent=(_o=class extends CustomEvent{constructor(e={}){super(ht.CancelEvent.type,{...e})}},A(_o,"type","mw:cancel"),_o);function Hh(i){return(i.code==="Enter"||i.code==="NumpadEnter")&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",ht);var kn=class extends V(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 D`
149
149
  <div class="ml-20 flex justify-end font-sans text-base">
150
150
  <div class="max-w-full">
151
151
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -154,15 +154,15 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
154
154
  </div>
155
155
 
156
156
  <!-- render status (if any) -->
157
- ${this.status==="sent"?L`
157
+ ${this.status==="sent"?D`
158
158
  <!-- tick mark -->
159
159
  <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">
160
160
  <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
161
161
  </svg>
162
- `:U}
162
+ `:L}
163
163
  </div>
164
164
  </div>
165
- `;case"assistant":case"support":return L`
165
+ `;case"assistant":case"support":return D`
166
166
  <div class="mr-8 flex justify-start font-sans text-base">
167
167
  <div class="flex max-w-full space-x-2">
168
168
  <!--
@@ -180,17 +180,52 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
180
180
  </div>
181
181
  </div>
182
182
  </div>
183
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};T(Tn,"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",Tn);var gr,je,ct,vr,$o,Pn=class{constructor(e,t){y(this,vr);y(this,gr);y(this,je);y(this,ct);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");E(this,gr,e),f(this,gr).addController(this),E(this,je,t)}connect(e){E(this,je,e),E(this,ct,$(this,vr,$o).call(this))}hostConnected(){setTimeout(()=>{E(this,ct,$(this,vr,$o).call(this))},0)}hostDisconnected(){f(this,ct)?.close(1e3,"lit_host_disconnected"),E(this,ct,void 0)}send(e){f(this,ct)?.send(e)}close(e,t){f(this,ct)?.close(e,t)}get isConnected(){return f(this,ct)?.readyState===WebSocket.OPEN}};gr=new WeakMap,je=new WeakMap,ct=new WeakMap,vr=new WeakSet,$o=function(){let e=new WebSocket(f(this,je).url());return f(this,je).onClose&&(e.onclose=f(this,je).onClose),f(this,je).onOpen&&(e.onopen=f(this,je).onOpen),f(this,je).onError&&(e.onerror=f(this,je).onError),f(this,je).onMessage&&(e.onmessage=f(this,je).onMessage),e};var tc="664df22d-d461-42d6-801e-f70247e2cd7c",be,we,nt,Ii,Ai,Se,ei,ic,rc,nc,sc,Rn=class{constructor(e,t){y(this,Se);y(this,be);y(this,we);y(this,nt);T(this,"isStreaming",!1);T(this,"typingIndicator");T(this,"ranOutOfCredits",!1);T(this,"messages",[]);T(this,"conversationId","");y(this,Ii,0);y(this,Ai);T(this,"isLiveMode",!1);E(this,be,e),E(this,we,t),E(this,nt,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:r,role:n="user",expectStreaming:s=!1}={}){return $(this,Se,ei).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:r},{expectStreaming:s})}sendUserCancel(){return $(this,Se,ei).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return $(this,Se,ei).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return $(this,Se,ei).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){$(this,Se,ei).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,nt).close(1e3,"closed by user")}retry(){clearTimeout(f(this,Ai)),E(this,Ai,setTimeout(()=>{f(this,we).onReconnect?.(),E(this,nt,this.initWS())},1e3*f(this,Ii))),Ul(this,Ii)._++}initWS(){return new Pn(f(this,be),{url:()=>f(this,we).url(this.conversationId,{}),onOpen:e=>$(this,Se,ic).call(this,e),onMessage:e=>$(this,Se,rc).call(this,JSON.parse(e.data)),onError:e=>$(this,Se,nc).call(this,e),onClose:e=>$(this,Se,sc).call(this,e)})}hostConnected(){this.conversationId=f(this,we).restoreConversationState?.()?.conversationId||"",this.messages=f(this,we).restoreConversationState?.()?.messages||[]}reset(){$(this,Se,ei).call(this,{type:"NEW_CHAT"}),f(this,we).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,f(this,be).requestUpdate()}hostDisconnected(){clearTimeout(f(this,Ai))}reconnectSocket(){f(this,nt).close(1e3,"destroy"),E(this,nt,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};be=new WeakMap,we=new WeakMap,nt=new WeakMap,Ii=new WeakMap,Ai=new WeakMap,Se=new WeakSet,ei=function(e,{expectStreaming:t=!1}={}){return f(this,nt).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,be).requestUpdate()),f(this,nt).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},ic=function(e){E(this,Ii,0)},rc=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,r,n)=>r===n.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,f(this,be).requestUpdate(),f(this,we).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message),f(this,be).requestUpdate(),f(this,we).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,f(this,be).requestUpdate(),f(this,we).onMessageDone?.(e,t),f(this,we).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,f(this,be).requestUpdate();break}case"ERROR":{f(this,we).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,f(this,we).onConnect?.(e.conversationId),f(this,we).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,f(this,be).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,be).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,be).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===tc)||this.messages.push({id:tc,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,be).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,be).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},nc=function(e){console.error("onError",e),f(this,we).onError?.(e)},sc=function(e){f(this,be).isConnected&&!f(this,nt).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,be).requestUpdate(),f(this,we).onClose?.()};var mr,Ti,Rt,ti,Fn,oc,On=class{constructor(e,t,{timeoutMs:r=2e3}={}){y(this,Fn);y(this,mr);y(this,Ti);y(this,Rt);y(this,ti,!1);T(this,"timeoutMs");E(this,mr,e),E(this,Ti,t),this.timeoutMs=r,e.addController(this)}get isTyping(){return f(this,ti)}hostDisconnected(){clearTimeout(f(this,Rt)),E(this,Rt,void 0)}onInput(e){if(f(this,mr).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,Rt)),E(this,Rt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,ti)||$(this,Fn,oc).call(this)}}typingStopped(){clearTimeout(f(this,Rt)),E(this,ti,!1),f(this,Ti).typingStopped()}};mr=new WeakMap,Ti=new WeakMap,Rt=new WeakMap,ti=new WeakMap,Fn=new WeakSet,oc=function(){E(this,ti,!0),f(this,Ti).typingStarted()};function ac(i,e){let t=new Map;for(let r of i){let n=e(r);t.has(n)||t.set(n,[]),(t.get(n)||[]).push(r)}return t}function lc(i,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(i);return`${i.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var Io;function Ao(i){return{lang:i?.lang??Io?.lang,message:i?.message,abortEarly:i?.abortEarly??Io?.abortEarly,abortPipeEarly:i?.abortPipeEarly??Io?.abortPipeEarly}}var Xh;function Yh(i){return Xh?.get(i)}var Kh;function Zh(i){return Kh?.get(i)}var Qh;function ef(i,e){return Qh?.get(i)?.get(e)}function Pi(i){let e=typeof i;return e==="string"?`"${i}"`:e==="number"||e==="bigint"||e==="boolean"?`${i}`:e==="object"||e==="function"?(i&&Object.getPrototypeOf(i)?.constructor?.name)??"null":e}function qe(i,e,t,r,n){let s=n&&"input"in n?n.input:t.value,o=n?.expected??i.expects??null,l=n?.received??Pi(s),a={kind:i.kind,type:i.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:i.requirement,path:n?.path,issues:n?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=i.kind==="schema",d=n?.message??i.message??ef(i.reference,a.lang)??(c?Zh(a.lang):null)??r.message??Yh(a.lang);d&&(a.message=typeof d=="function"?d(a):d),c&&(t.typed=!1),t.issues?t.issues.push(a):t.issues=[a]}function st(i){return{version:1,vendor:"valibot",validate(e){return i["~run"]({value:e},Ao())}}}function tf(i,e){return Object.hasOwn(i,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function cc(i,e){let t=[...new Set(i)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var rf=class extends Error{constructor(e){super(e[0].message);T(this,"issues");this.name="ValiError",this.issues=e}};function To(i,e){return{kind:"validation",type:"max_length",reference:To,async:!1,expects:`<=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length>this.requirement&&qe(this,"length",t,r,{received:`${t.value.length}`}),t}}}function Po(i,e){return{kind:"validation",type:"max_value",reference:Po,async:!1,expects:`<=${i instanceof Date?i.toJSON():Pi(i)}`,requirement:i,message:e,"~run"(t,r){return t.typed&&!(t.value<=this.requirement)&&qe(this,"value",t,r,{received:t.value instanceof Date?t.value.toJSON():Pi(t.value)}),t}}}function Ro(i,e){return{kind:"validation",type:"min_length",reference:Ro,async:!1,expects:`>=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length<this.requirement&&qe(this,"length",t,r,{received:`${t.value.length}`}),t}}}function Oo(i,e){return{kind:"validation",type:"min_value",reference:Oo,async:!1,expects:`>=${i instanceof Date?i.toJSON():Pi(i)}`,requirement:i,message:e,"~run"(t,r){return t.typed&&!(t.value>=this.requirement)&&qe(this,"value",t,r,{received:t.value instanceof Date?t.value.toJSON():Pi(t.value)}),t}}}function nf(i,e,t){return typeof i.default=="function"?i.default(e,t):i.default}function yt(i,e){return{kind:"schema",type:"array",reference:yt,expects:"Array",async:!1,item:i,message:e,get"~standard"(){return st(this)},"~run"(t,r){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},r);if(l.issues){let a={type:"array",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else qe(this,"type",t,r);return t}}}function xe(i){return{kind:"schema",type:"boolean",reference:xe,expects:"boolean",async:!1,message:i,get"~standard"(){return st(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:qe(this,"type",e,t),e}}}function Fo(i){return{kind:"schema",type:"null",reference:Fo,expects:"null",async:!1,message:i,get"~standard"(){return st(this)},"~run"(e,t){return e.value===null?e.typed=!0:qe(this,"type",e,t),e}}}function Te(i){return{kind:"schema",type:"number",reference:Te,expects:"number",async:!1,message:i,get"~standard"(){return st(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:qe(this,"type",e,t),e}}}function re(i,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:i,message:e,get"~standard"(){return st(this)},"~run"(t,r){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},r);if(l.issues){let a={type:"object",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),(l.value!==void 0||s in n)&&(t.value[s]=l.value)}}else qe(this,"type",t,r);return t}}}function I(i,e){return{kind:"schema",type:"optional",reference:I,expects:`(${i.expects} | undefined)`,async:!1,wrapped:i,default:e,get"~standard"(){return st(this)},"~run"(t,r){return t.value===void 0&&(this.default!==void 0&&(t.value=nf(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,r)}}}function Ri(i,e){return{kind:"schema",type:"picklist",reference:Ri,expects:cc(i.map(Pi),"|"),async:!1,options:i,message:e,get"~standard"(){return st(this)},"~run"(t,r){return this.options.includes(t.value)?t.typed=!0:qe(this,"type",t,r),t}}}function Mo(i,e,t){return{kind:"schema",type:"record",reference:Mo,expects:"Object",async:!1,key:i,value:e,message:t,get"~standard"(){return st(this)},"~run"(r,n){let s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(let o in s)if(tf(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 u of a.issues)u.path=[d],r.issues?.push(u);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}let c=this.value["~run"]({value:l},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:l};for(let u of c.issues)u.path?u.path.unshift(d):u.path=[d],r.issues?.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}(!a.typed||!c.typed)&&(r.typed=!1),a.typed&&(r.value[a.value]=c.value)}}else qe(this,"type",r,n);return r}}}function N(i){return{kind:"schema",type:"string",reference:N,expects:"string",async:!1,message:i,get"~standard"(){return st(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:qe(this,"type",e,t),e}}}function uc(i){let e;if(i)for(let t of i)e?e.push(...t.issues):e=t.issues;return e}function Do(i,e){return{kind:"schema",type:"union",reference:Do,expects:cc(i.map(t=>t.expects),"|"),async:!1,options:i,message:e,get"~standard"(){return st(this)},"~run"(t,r){let n,s,o;for(let l of this.options){let a=l["~run"]({value:t.value},r);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];qe(this,"type",t,r,{issues:uc(s)}),t.typed=!0}else{if(o?.length===1)return o[0];qe(this,"type",t,r,{issues:uc(o)})}return t}}}function dc(i,e,t){let r=i["~run"]({value:e},Ao(t));if(r.issues)throw new rf(r.issues);return r.value}function Mn(...i){return{...i[0],pipe:i,get"~standard"(){return st(this)},"~run"(e,t){for(let r of i)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=r["~run"](e,t))}return e}}}function Lo(i,e,t){let r=i["~run"]({value:e},Ao(t));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var _r={SCRAPER:"scraper",UNAS:"unas",SHOPRENTER:"shoprenter",SHOPIFY:"shopify",SHOPER:"shoper"},sf=Object.freeze([_r.UNAS,_r.SHOPRENTER,_r.SHOPIFY,_r.SHOPER]),hc=Object.freeze([...sf,_r.SCRAPER]);var jm=re({wsApiUrl:N(),url:N(),logoUrl:I(N()),title:N(),status:N(),color:N(),showStillLearningBanner:I(xe()),allowedOrigins:I(yt(N())),input:re({placeholder:N()}),bubble:re({imageUrl:I(N()),position:re({bottom:I(N()),right:I(N()),left:I(N())}),mobilePosition:I(re({bottom:I(N()),right:I(N()),left:I(N())})),zIndex:I(Te())}),examples:re({title:N(),items:yt(N())}),instructions:re({items:yt(N()),limit:I(Te())}),popup:I(re({mobileEnabled:I(xe()),desktopEnabled:I(xe()),delayMs:I(Te()),text:I(N()),mobileTitleText:I(N()),mobileButtonText:I(N())})),tryItOut:I(re({mobileEnabled:I(xe()),desktopEnabled:I(xe()),text:I(N())})),contactDetails:I(re({email:I(N()),phone:I(N()),socialMedia:I(re({facebook:I(N()),instagram:I(N()),twitter:I(N())}))})),notifications:I(re({email:I(N())})),neverShowStillLearningBanner:I(xe()),hidden:I(xe()),newChatTitle:I(N()),webhookURL:I(N()),automatedResponse:I(re({enabled:I(xe()),text:I(N()),latencyThresholdMs:I(Te())})),removePoweredBy:I(xe()),claimable:I(xe()),feed:I(N()),scraper:I(Ri(["netkazan","jateknet","json-schema-org","arukereso-xml","partocean","google-rev1"])),scraperAuthorization:I(N()),platform:I(Ri(hc)),workingHours:I(re({dailyAvailability:yt(re({dayOfWeek:Mn(Te(),Oo(0),Po(6)),startTime:N(),endTime:N(),isActive:xe()})),userTimeZone:I(N())})),planOverrides:I(re({maxProducts:I(Te()),conversations:I(Te()),faqs:I(re({max:I(Te()),questionLength:I(Te()),answerLength:I(Te())}))})),omitGeneralGuidelines:I(xe()),forceStripe:I(xe()),products:I(re({blocklistUrls:I(yt(N()))})),autoRefresh:I(re({enabled:I(xe()),intervalMins:I(Te())})),lang:I(N())});var yr=class extends ki{constructor(e){if(super(e),this.it=U,e.type!==En.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===it)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:[]}}};yr.directiveName="unsafeHTML",yr.resultType=1;var fc=Cn(yr);var of=!0,No="Invariant failed";function gc(i,e){if(!i){if(of)throw new Error(No);var t=typeof e=="function"?e():e,r=t?"".concat(No,": ").concat(t):No;throw new Error(r)}}var af="\xB7 \xB7 \xB7",lf=re({conversationId:I(N()),messages:I(yt(re({id:N(),timestamp:Te(),role:Ri(["user","assistant","support"]),content:N(),content_html:I(N())})))}),uf=Mo(N(),Do([N(),Te(),xe(),Fo()])),cf=Mn(N(),Ro(1),To(1e3)),Oi,Fi,Q,jo,Dn,wr,ue,xr,vc,mc,_c,yc,bc,wc,xc,qo,Ln=class Ln extends J(H){constructor(){super();y(this,Q);y(this,Oi);y(this,Fi);y(this,wr,new On(this,{typingStarted:()=>f(this,ue).sendUserTypingStart(),typingStopped:()=>f(this,ue).sendUserTypingStop()}));y(this,ue,new Rn(this,{url:t=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&f(this,Q,qo)?.scrollTo(0,f(this,Q,qo).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,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,Q,Dn))},onConnect:t=>{},persistConversationState:(t,r)=>{localStorage.setItem(f(this,Q,Dn),JSON.stringify({conversationId:t,messages:r}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,Q,Dn))||"{}"),r=dc(lf,t);return{conversationId:r.conversationId||"",messages:r.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));y(this,xr,"single");this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get widgetId(){return this.config.widgetId}get conversationId(){return f(this,ue).conversationId}get messages(){return f(this,ue).messages}firstUpdated(){$(this,Q,jo).call(this)}updated(){$(this,Q,jo).call(this)}render(){gc(this.config,"config is required");let t=ac(this.messages,r=>{try{let n=new Date(r.timestamp),s=Math.floor(n.getUTCMinutes()/5)*5;return n.setUTCMinutes(s,0,0),n.valueOf().toString()}catch(n){console.error(n)}});return L`
183
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};A(kn,"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",kn);var wo=class extends V(j){constructor(){super(...arguments);A(this,"render",()=>D`
184
+ <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">
185
+ <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
186
+ <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
187
+ </circle>
188
+ <circle fill="currentFill" stroke="none" cx="47" cy="50" r="6">
189
+ <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2" />
190
+ </circle>
191
+ <circle fill="currentFill" stroke="none" cx="67" cy="50" r="6">
192
+ <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
193
+ </circle>
194
+ </svg>
195
+ `)}};customElements.get("mw-loading")||customElements.define("mw-loading",wo);var zh="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",xo=class extends V(j){constructor(){super(...arguments);A(this,"render",()=>D`
196
+ <p class="flex items-center justify-center whitespace-nowrap text-xs">
197
+ <span>Powered by</span>
198
+
199
+ <a href="${zh}" target="_blank" class="inline-flex items-center underline">
200
+ <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
201
+ <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
202
+ <path
203
+ fill-rule="evenodd"
204
+ clip-rule="evenodd"
205
+ d="M14.4482 15.0424C15.0767 15.2108 15.7464 15.1227 16.3099 14.7973L15.0832 12.6725L13.8564 10.5477L13.8562 10.5479L11.4869 6.44411L11.4774 6.42785L11.475 6.42371C11.1496 5.86018 10.6137 5.44898 9.98519 5.28057C9.35666 5.11215 8.68697 5.20032 8.12345 5.52567L9.35019 7.65045L10.5769 9.77523L10.577 9.77516L12.9461 13.8785L12.9593 13.9008C13.2847 14.4635 13.8202 14.8741 14.4482 15.0424ZM10.8392 15.0436C11.4677 15.212 12.1374 15.1238 12.701 14.7985L11.4742 12.6737L10.2475 10.5489L10.2474 10.549L7.87793 6.44488L7.87142 6.43373L7.86629 6.4248C7.54093 5.86127 7.00505 5.45007 6.37652 5.28166C5.90455 5.15519 5.40058 5.17178 4.94379 5.32631C4.44552 5.48229 4.08397 5.94754 4.08397 6.49724V12.5389C4.08354 12.5576 4.08333 12.5763 4.08333 12.5951C4.08333 13.2451 4.34182 13.8686 4.80194 14.3283C5.26205 14.7879 5.88611 15.0462 6.53681 15.0462V12.6098C6.53724 12.5964 6.53746 12.5831 6.53746 12.5696V9.7318C6.33805 9.40929 6.1011 8.99037 5.8593 8.52589C5.2972 7.44609 4.92176 6.52897 5.02074 6.47745C5.03257 6.47129 5.05064 6.47777 5.07425 6.4958L5.07612 6.49904C5.25259 6.63858 5.72449 7.39502 6.21645 8.34007C6.38575 8.66529 6.53812 8.97576 6.66569 9.25226L6.96825 9.77632L6.96829 9.77629L9.33716 13.8793L9.34457 13.892L9.34944 13.9004C9.67479 14.464 10.2107 14.8752 10.8392 15.0436Z"
206
+ fill="url(#paint0_linear_1_17)" />
207
+ <defs>
208
+ <linearGradient id="paint0_linear_1_17" x1="4.08333" y1="10.1653" x2="16.3099" y2="10.1653" gradientUnits="userSpaceOnUse">
209
+ <stop offset="0.197917" stop-color="#E4FF1A" />
210
+ <stop offset="0.822917" stop-color="#21F4F0" />
211
+ </linearGradient>
212
+ </defs>
213
+ </svg>
214
+
215
+ <span>Molin AI</span>
216
+ </a>
217
+ </p>
218
+ `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",xo);var lr,Me,st,ur,ko,Sn=class{constructor(e,t){y(this,ur);y(this,lr);y(this,Me);y(this,st);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");E(this,lr,e),f(this,lr).addController(this),E(this,Me,t)}connect(e){E(this,Me,e),E(this,st,$(this,ur,ko).call(this))}hostConnected(){setTimeout(()=>{E(this,st,$(this,ur,ko).call(this))},0)}hostDisconnected(){f(this,st)?.close(1e3,"lit_host_disconnected"),E(this,st,void 0)}send(e){f(this,st)?.send(e)}close(e,t){f(this,st)?.close(e,t)}get isConnected(){return f(this,st)?.readyState===WebSocket.OPEN}};lr=new WeakMap,Me=new WeakMap,st=new WeakMap,ur=new WeakSet,ko=function(){let e=new WebSocket(f(this,Me).url());return f(this,Me).onClose&&(e.onclose=f(this,Me).onClose),f(this,Me).onOpen&&(e.onopen=f(this,Me).onOpen),f(this,Me).onError&&(e.onerror=f(this,Me).onError),f(this,Me).onMessage&&(e.onmessage=f(this,Me).onMessage),e};var Yu="664df22d-d461-42d6-801e-f70247e2cd7c",me,_e,Qe,ki,Si,be,Xt,Ku,Zu,Qu,ec,En=class{constructor(e,t){y(this,be);y(this,me);y(this,_e);y(this,Qe);A(this,"isStreaming",!1);A(this,"typingIndicator");A(this,"ranOutOfCredits",!1);A(this,"messages",[]);A(this,"conversationId","");y(this,ki,0);y(this,Si);A(this,"isLiveMode",!1);E(this,me,e),E(this,_e,t),E(this,Qe,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:r,role:n="user",expectStreaming:s=!1}={}){return $(this,be,Xt).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:r},{expectStreaming:s})}sendUserCancel(){return $(this,be,Xt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return $(this,be,Xt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return $(this,be,Xt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){$(this,be,Xt).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,Qe).close(1e3,"closed by user")}retry(){clearTimeout(f(this,Si)),E(this,Si,setTimeout(()=>{f(this,_e).onReconnect?.(),E(this,Qe,this.initWS())},1e3*f(this,ki))),Fl(this,ki)._++}initWS(){return new Sn(f(this,me),{url:()=>f(this,_e).url(this.conversationId,{}),onOpen:e=>$(this,be,Ku).call(this,e),onMessage:e=>$(this,be,Zu).call(this,JSON.parse(e.data)),onError:e=>$(this,be,Qu).call(this,e),onClose:e=>$(this,be,ec).call(this,e)})}hostConnected(){this.conversationId=f(this,_e).restoreConversationState?.()?.conversationId||"",this.messages=f(this,_e).restoreConversationState?.()?.messages||[]}reset(){$(this,be,Xt).call(this,{type:"NEW_CHAT"}),f(this,_e).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,f(this,me).requestUpdate()}hostDisconnected(){clearTimeout(f(this,Si))}reconnectSocket(){f(this,Qe).close(1e3,"destroy"),E(this,Qe,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};me=new WeakMap,_e=new WeakMap,Qe=new WeakMap,ki=new WeakMap,Si=new WeakMap,be=new WeakSet,Xt=function(e,{expectStreaming:t=!1}={}){return f(this,Qe).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,me).requestUpdate()),f(this,Qe).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Ku=function(e){E(this,ki,0)},Zu=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,r,n)=>r===n.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,f(this,me).requestUpdate(),f(this,_e).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message),f(this,me).requestUpdate(),f(this,_e).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,f(this,me).requestUpdate(),f(this,_e).onMessageDone?.(e,t),f(this,_e).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,f(this,me).requestUpdate();break}case"ERROR":{f(this,_e).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,f(this,_e).onConnect?.(e.conversationId),f(this,_e).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,f(this,me).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,me).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,me).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Yu)||this.messages.push({id:Yu,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,me).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,me).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Qu=function(e){console.error("onError",e),f(this,_e).onError?.(e)},ec=function(e){f(this,me).isConnected&&!f(this,Qe).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,me).requestUpdate(),f(this,_e).onClose?.()};var cr,Ei,$t,Yt,$n,tc,Cn=class{constructor(e,t,{timeoutMs:r=2e3}={}){y(this,$n);y(this,cr);y(this,Ei);y(this,$t);y(this,Yt,!1);A(this,"timeoutMs");E(this,cr,e),E(this,Ei,t),this.timeoutMs=r,e.addController(this)}get isTyping(){return f(this,Yt)}hostDisconnected(){clearTimeout(f(this,$t)),E(this,$t,void 0)}onInput(e){if(f(this,cr).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,$t)),E(this,$t,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,Yt)||$(this,$n,tc).call(this)}}typingStopped(){clearTimeout(f(this,$t)),E(this,Yt,!1),f(this,Ei).typingStopped()}};cr=new WeakMap,Ei=new WeakMap,$t=new WeakMap,Yt=new WeakMap,$n=new WeakSet,tc=function(){E(this,Yt,!0),f(this,Ei).typingStarted()};function ic(i,e){let t=new Map;for(let r of i){let n=e(r);t.has(n)||t.set(n,[]),(t.get(n)||[]).push(r)}return t}function rc(i,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(i);return`${i.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var dr=class extends _i{constructor(e){if(super(e),this.it=L,e.type!==_n.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||e==null)return this._t=void 0,this.it=e;if(e===Ke)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:[]}}};dr.directiveName="unsafeHTML",dr.resultType=1;var nc=yn(dr);var Wh=!0,So="Invariant failed";function sc(i,e){if(!i){if(Wh)throw new Error(So);var t=typeof e=="function"?e():e,r=t?"".concat(So,": ").concat(t):So;throw new Error(r)}}var Eo;function Co(i){return{lang:i?.lang??Eo?.lang,message:i?.message,abortEarly:i?.abortEarly??Eo?.abortEarly,abortPipeEarly:i?.abortPipeEarly??Eo?.abortPipeEarly}}var Vh;function Gh(i){return Vh?.get(i)}var Jh;function Xh(i){return Jh?.get(i)}var Yh;function Kh(i,e){return Yh?.get(i)?.get(e)}function ac(i){let e=typeof i;return e==="string"?`"${i}"`:e==="number"||e==="bigint"||e==="boolean"?`${i}`:e==="object"||e==="function"?(i&&Object.getPrototypeOf(i)?.constructor?.name)??"null":e}function Ge(i,e,t,r,n){let s=n&&"input"in n?n.input:t.value,o=n?.expected??i.expects??null,l=n?.received??ac(s),a={kind:i.kind,type:i.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:i.requirement,path:n?.path,issues:n?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=i.kind==="schema",d=n?.message??i.message??Kh(i.reference,a.lang)??(c?Xh(a.lang):null)??r.message??Gh(a.lang);d&&(a.message=typeof d=="function"?d(a):d),c&&(t.typed=!1),t.issues?t.issues.push(a):t.issues=[a]}function et(i){return{version:1,vendor:"valibot",validate(e){return i["~run"]({value:e},Co())}}}function Zh(i,e){return Object.hasOwn(i,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function lc(i,e){let t=[...new Set(i)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Qh=class extends Error{constructor(e){super(e[0].message);A(this,"issues");this.name="ValiError",this.issues=e}};function $o(i,e){return{kind:"validation",type:"max_length",reference:$o,async:!1,expects:`<=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length>this.requirement&&Ge(this,"length",t,r,{received:`${t.value.length}`}),t}}}function Io(i,e){return{kind:"validation",type:"min_length",reference:Io,async:!1,expects:`>=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length<this.requirement&&Ge(this,"length",t,r,{received:`${t.value.length}`}),t}}}function ef(i,e,t){return typeof i.default=="function"?i.default(e,t):i.default}function Ao(i,e){return{kind:"schema",type:"array",reference:Ao,expects:"Array",async:!1,item:i,message:e,get"~standard"(){return et(this)},"~run"(t,r){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},r);if(l.issues){let a={type:"array",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else Ge(this,"type",t,r);return t}}}function To(i){return{kind:"schema",type:"boolean",reference:To,expects:"boolean",async:!1,message:i,get"~standard"(){return et(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:Ge(this,"type",e,t),e}}}function Po(i){return{kind:"schema",type:"null",reference:Po,expects:"null",async:!1,message:i,get"~standard"(){return et(this)},"~run"(e,t){return e.value===null?e.typed=!0:Ge(this,"type",e,t),e}}}function In(i){return{kind:"schema",type:"number",reference:In,expects:"number",async:!1,message:i,get"~standard"(){return et(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ge(this,"type",e,t),e}}}function An(i,e){return{kind:"schema",type:"object",reference:An,expects:"Object",async:!1,entries:i,message:e,get"~standard"(){return et(this)},"~run"(t,r){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},r);if(l.issues){let a={type:"object",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),(l.value!==void 0||s in n)&&(t.value[s]=l.value)}}else Ge(this,"type",t,r);return t}}}function pr(i,e){return{kind:"schema",type:"optional",reference:pr,expects:`(${i.expects} | undefined)`,async:!1,wrapped:i,default:e,get"~standard"(){return et(this)},"~run"(t,r){return t.value===void 0&&(this.default!==void 0&&(t.value=ef(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,r)}}}function Ro(i,e){return{kind:"schema",type:"picklist",reference:Ro,expects:lc(i.map(ac),"|"),async:!1,options:i,message:e,get"~standard"(){return et(this)},"~run"(t,r){return this.options.includes(t.value)?t.typed=!0:Ge(this,"type",t,r),t}}}function Oo(i,e,t){return{kind:"schema",type:"record",reference:Oo,expects:"Object",async:!1,key:i,value:e,message:t,get"~standard"(){return et(this)},"~run"(r,n){let s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(let o in s)if(Zh(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 u of a.issues)u.path=[d],r.issues?.push(u);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}let c=this.value["~run"]({value:l},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:l};for(let u of c.issues)u.path?u.path.unshift(d):u.path=[d],r.issues?.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}(!a.typed||!c.typed)&&(r.typed=!1),a.typed&&(r.value[a.value]=c.value)}}else Ge(this,"type",r,n);return r}}}function ft(i){return{kind:"schema",type:"string",reference:ft,expects:"string",async:!1,message:i,get"~standard"(){return et(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:Ge(this,"type",e,t),e}}}function oc(i){let e;if(i)for(let t of i)e?e.push(...t.issues):e=t.issues;return e}function Fo(i,e){return{kind:"schema",type:"union",reference:Fo,expects:lc(i.map(t=>t.expects),"|"),async:!1,options:i,message:e,get"~standard"(){return et(this)},"~run"(t,r){let n,s,o;for(let l of this.options){let a=l["~run"]({value:t.value},r);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];Ge(this,"type",t,r,{issues:oc(s)}),t.typed=!0}else{if(o?.length===1)return o[0];Ge(this,"type",t,r,{issues:oc(o)})}return t}}}function uc(i,e,t){let r=i["~run"]({value:e},Co(t));if(r.issues)throw new Qh(r.issues);return r.value}function cc(...i){return{...i[0],pipe:i,get"~standard"(){return et(this)},"~run"(e,t){for(let r of i)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=r["~run"](e,t))}return e}}}function Mo(i,e,t){let r=i["~run"]({value:e},Co(t));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var rf="\xB7 \xB7 \xB7",nf=An({conversationId:pr(ft()),messages:pr(Ao(An({id:ft(),timestamp:In(),role:Ro(["user","assistant","support"]),content:ft(),content_html:pr(ft())})))}),sf=Oo(ft(),Fo([ft(),In(),To(),Po()])),of=cc(ft(),Io(1),$o(1e3)),Ci,$i,K,Lo,Tn,fr,oe,gr,dc,pc,hc,fc,gc,vc,mc,No,Pn=class Pn extends V(j){constructor(){super();y(this,K);y(this,Ci);y(this,$i);y(this,fr,new Cn(this,{typingStarted:()=>f(this,oe).sendUserTypingStart(),typingStopped:()=>f(this,oe).sendUserTypingStop()}));y(this,oe,new En(this,{url:t=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&f(this,K,No)?.scrollTo(0,f(this,K,No).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,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,K,Tn))},onConnect:t=>{},persistConversationState:(t,r)=>{localStorage.setItem(f(this,K,Tn),JSON.stringify({conversationId:t,messages:r}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,K,Tn))||"{}"),r=uc(nf,t);return{conversationId:r.conversationId||"",messages:r.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));y(this,gr,"single");this.widgetId="",this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get conversationId(){return f(this,oe).conversationId}get messages(){return f(this,oe).messages}firstUpdated(){$(this,K,Lo).call(this)}updated(){$(this,K,Lo).call(this)}render(){sc(this.config,"config is required");let t=ic(this.messages,r=>{try{let n=new Date(r.timestamp),s=Math.floor(n.getUTCMinutes()/5)*5;return n.setUTCMinutes(s,0,0),n.valueOf().toString()}catch(n){console.error(n)}});return D`
184
219
  <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]">
185
220
  <div
186
221
  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]">
187
222
  <mw-chat-header
188
223
  class="absolute left-1.5 right-1.5 top-1.5"
189
224
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
190
- ?show-new-chat="${!f(this,ue).isLiveMode&&this.messages.length>0}"
225
+ ?show-new-chat="${!f(this,oe).isLiveMode&&this.messages.length>0}"
191
226
  ?show-close="${this.showClose}"
192
- @mw:new-chat-click="${$(this,Q,wc)}"
193
- @mw:close-click="${$(this,Q,xc)}">
227
+ @mw:new-chat-click="${$(this,K,vc)}"
228
+ @mw:close-click="${$(this,K,mc)}">
194
229
  </mw-chat-header>
195
230
 
196
231
  <!-- used by the dashboard to inject content -->
@@ -200,7 +235,7 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
200
235
 
201
236
  <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
202
237
  <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
203
- ${this.config?.showStillLearningBanner?L`
238
+ ${this.config?.showStillLearningBanner?D`
204
239
  <div class="flex justify-center">
205
240
  <div class="mb-2 flex max-w-[70%] select-none items-center justify-center rounded-full bg-black px-3 py-2">
206
241
  <!-- (i) symbol -->
@@ -215,7 +250,7 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
215
250
  <span class="ml-1 text-xs text-white">I'm still learning!</span>
216
251
  </div>
217
252
  </div>
218
- `:L`
253
+ `:D`
219
254
  <!-- this makes the chat stick to bottom when the banner is hidden -->
220
255
  <div class="flex p-1"></div>
221
256
  `}
@@ -223,19 +258,19 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
223
258
  <!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
224
259
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
225
260
  <div class="${this.messages.length>0?"pt-20":""}">
226
- ${hr(Array.from(t),([r])=>r,([r,n])=>L`
227
- <div class="my-2 text-center text-xs text-gray-500">${lc(new Date(Number(r)),window.navigator.language)}</div>
228
- ${hr(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;E(this,xr,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,ue).isLiveMode&&s.role==="user"&&s.id===f(this,ue).lastMsg?.id?"sent":"";return L`
261
+ ${or(Array.from(t),([r])=>r,([r,n])=>D`
262
+ <div class="my-2 text-center text-xs text-gray-500">${rc(new Date(Number(r)),window.navigator.language)}</div>
263
+ ${or(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;E(this,gr,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,oe).isLiveMode&&s.role==="user"&&s.id===f(this,oe).lastMsg?.id?"sent":"";return D`
229
264
  <div class="${a?"mb-[2px]":"mb-3"} mx-2 flex-row">
230
265
  <mw-chat-message
231
266
  color="${this.config.color}"
232
267
  status="${g}"
233
268
  logo="${s.metadata?.avatar||this.config.logoUrl}"
234
269
  side="${s.role}"
235
- position=${f(this,xr)}
236
- @click="${$(this,Q,vc)}">
270
+ position=${f(this,gr)}
271
+ @click="${$(this,K,dc)}">
237
272
  <div class="prose break-words text-inherit">
238
- ${s.content===af?L`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?fc(s.content_html):L`<p>${s.content}</p>`}
273
+ ${s.content===rf?D`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?nc(s.content_html):D`<p>${s.content}</p>`}
239
274
  </div>
240
275
  </mw-chat-message>
241
276
  </div>
@@ -243,37 +278,37 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
243
278
  `)}
244
279
 
245
280
  <!-- show typing indicator if the non-user side is typing -->
246
- ${["assistant","support"].includes(f(this,ue)?.typingIndicator?.role??"")&&f(this,ue)?.typingIndicator?.role?L`
281
+ ${["assistant","support"].includes(f(this,oe)?.typingIndicator?.role??"")&&f(this,oe)?.typingIndicator?.role?D`
247
282
  <mw-chat-message
248
283
  class="mx-2 mb-3 block"
249
284
  color="${this.config.color}"
250
- logo="${f(this,ue)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}"
251
- side="${f(this,ue).typingIndicator.role}">
285
+ logo="${f(this,oe)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}"
286
+ side="${f(this,oe).typingIndicator.role}">
252
287
  <div class="prose break-words text-inherit">
253
288
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>
254
289
  </div>
255
290
  </mw-chat-message>
256
- `:U}
291
+ `:L}
257
292
  </div>
258
293
 
259
294
  <mw-chat-background
260
295
  class="flex-grow"
261
296
  .examples="${this.messages.length>0?[]:this.config.examples}"
262
297
  color="${this.config.color}"
263
- @mw:example-click="${$(this,Q,mc)}"></mw-chat-background>
298
+ @mw:example-click="${$(this,K,pc)}"></mw-chat-background>
264
299
  </div>
265
300
 
266
301
  <div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
267
302
  <mw-chat-input
268
- @mw:change="${$(this,Q,yc)}"
269
- @mw:submit="${$(this,Q,_c)}"
270
- @mw:cancel="${$(this,Q,bc)}"
303
+ @mw:change="${$(this,K,fc)}"
304
+ @mw:submit="${$(this,K,hc)}"
305
+ @mw:cancel="${$(this,K,gc)}"
271
306
  placeholder="${this.config.input?.placeholder}"
272
- ?disabled="${f(this,ue).ranOutOfCredits}"
273
- ?streaming="${f(this,ue)?.isStreaming??!0}">
307
+ ?disabled="${f(this,oe).ranOutOfCredits}"
308
+ ?streaming="${f(this,oe)?.isStreaming??!0}">
274
309
  </mw-chat-input>
275
310
 
276
- ${this.config.removePoweredBy?U:L`
311
+ ${this.config.removePoweredBy?L:D`
277
312
  <!-- spacing between input box and powered-by or bottom -->
278
313
  <div class="h-4">
279
314
  <mw-powered-by></mw-powered-by>
@@ -282,106 +317,71 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
282
317
  </div>
283
318
  </div>
284
319
  </div>
285
- `}reloadConfig(){f(this,ue).reloadConfig(),this.requestUpdate()}};Oi=new WeakMap,Fi=new WeakMap,Q=new WeakSet,jo=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 r=Lo(uf,t);r.success?E(this,Oi,r.output):console.error("Molin: x-user-data does not pass schema validation",r.issues)}if(this.xPromptExt){let t=Lo(cf,this.xPromptExt);t.success?E(this,Fi,t.output):console.error("Molin: x-prompt-ext does not pass schema validation",t.issues)}},Dn=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},wr=new WeakMap,ue=new WeakMap,xr=new WeakMap,vc=function(t){let r=t.target;if(r instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:r.href,conversationId:this.conversationId}),window.self!==window.top){window.open(r.href,"_blank");return}window.open(r.href,r.target)}},mc=function(t){let r=t.detail.example;if(!f(this,ue)?.sendUserInput(r,{xUserData:f(this,Oi),xPromptExt:f(this,Fi)})){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!0,conversationId:this.conversationId})},_c=function(t){let r=t.detail;if(!f(this,ue)?.sendUserInput(r,{xUserData:f(this,Oi),xPromptExt:f(this,Fi)})){t.preventDefault();return}f(this,wr).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId})},yc=function(t){f(this,wr).onInput(t.detail.full)},bc=function(){f(this,ue)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},wc=function(){f(this,ue).reset()},xc=function(){this.dispatchEvent(new Ln.CloseClickEvent)},qo=function(){return this.renderRoot.querySelector("#scrollable-content")},T(Ln,"properties",{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 br=Ln,Uo;br.CloseClickEvent=(Uo=class extends CustomEvent{constructor(e={}){super(br.CloseClickEvent.type,{...e})}},T(Uo,"type","mw:close-click"),Uo);customElements.get("mw-chat")||customElements.define("mw-chat",br);var Bo=class extends J(H){constructor(){super(...arguments);T(this,"render",()=>L`
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
- <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
288
- <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
289
- </circle>
290
- <circle fill="currentFill" stroke="none" cx="47" cy="50" r="6">
291
- <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2" />
292
- </circle>
293
- <circle fill="currentFill" stroke="none" cx="67" cy="50" r="6">
294
- <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
295
- </circle>
296
- </svg>
297
- `)}};customElements.get("mw-loading")||customElements.define("mw-loading",Bo);var Mi,kc,Sc,kr=class kr extends J(H){constructor(){super();y(this,Mi);T(this,"render",()=>L`
320
+ `}reloadConfig(){f(this,oe).reloadConfig(),this.requestUpdate()}};Ci=new WeakMap,$i=new WeakMap,K=new WeakSet,Lo=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 r=Mo(sf,t);r.success?E(this,Ci,r.output):console.error("Molin: x-user-data does not pass schema validation",r.issues)}if(this.xPromptExt){let t=Mo(of,this.xPromptExt);t.success?E(this,$i,t.output):console.error("Molin: x-prompt-ext does not pass schema validation",t.issues)}},Tn=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},fr=new WeakMap,oe=new WeakMap,gr=new WeakMap,dc=function(t){let r=t.target;if(r instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:r.href,conversationId:this.conversationId}),window.self!==window.top){window.open(r.href,"_blank");return}window.open(r.href,r.target)}},pc=function(t){let r=t.detail.example;if(!f(this,oe)?.sendUserInput(r,{xUserData:f(this,Ci),xPromptExt:f(this,$i)})){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!0,conversationId:this.conversationId})},hc=function(t){let r=t.detail;if(!f(this,oe)?.sendUserInput(r,{xUserData:f(this,Ci),xPromptExt:f(this,$i)})){t.preventDefault();return}f(this,fr).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId})},fc=function(t){f(this,fr).onInput(t.detail.full)},gc=function(){f(this,oe)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},vc=function(){f(this,oe).reset()},mc=function(){this.dispatchEvent(new Pn.CloseClickEvent)},No=function(){return this.renderRoot.querySelector("#scrollable-content")},A(Pn,"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 hr=Pn,Do;hr.CloseClickEvent=(Do=class extends CustomEvent{constructor(e={}){super(hr.CloseClickEvent.type,{...e})}},A(Do,"type","mw:close-click"),Do);customElements.get("mw-chat")||customElements.define("mw-chat",hr);var Ii,_c,yc,vr=class vr extends V(j){constructor(){super();y(this,Ii);A(this,"render",()=>D`
298
321
  <!-- wrapper -->
299
322
  <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">
300
323
  <!-- close button -->
301
324
  <button
302
325
  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"
303
- @click="${$(this,Mi,kc)}"
326
+ @click="${$(this,Ii,_c)}"
304
327
  aria-label="Close">
305
328
  ×
306
329
  </button>
307
330
 
308
331
  <!-- content -->
309
- <div class="p-4 text-left text-gray-800" @click="${$(this,Mi,Sc)}">
332
+ <div class="p-4 text-left text-gray-800" @click="${$(this,Ii,yc)}">
310
333
  <p>${this.text}</p>
311
334
  </div>
312
335
  </div>
313
- `);this.text="Hello there. How can we help?"}};Mi=new WeakSet,kc=function(){this.dispatchEvent(new kr.CloseEvent)},Sc=function(){this.dispatchEvent(new kr.ClickEvent)},T(kr,"properties",{text:{type:String}});var ii=kr,Ho;ii.CloseEvent=(Ho=class extends CustomEvent{constructor(e={}){super(ii.CloseEvent.type,{...e})}},T(Ho,"type","mw:close"),Ho);var zo;ii.ClickEvent=(zo=class extends CustomEvent{constructor(e={}){super(ii.ClickEvent.type,{...e})}},T(zo,"type","mw:click"),zo);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",ii);var Di,Ec,Cc,Sr=class Sr extends J(H){constructor(){super();y(this,Di);T(this,"render",()=>L`
336
+ `);this.text="Hello there. How can we help?"}};Ii=new WeakSet,_c=function(){this.dispatchEvent(new vr.CloseEvent)},yc=function(){this.dispatchEvent(new vr.ClickEvent)},A(vr,"properties",{text:{type:String}});var Kt=vr,Uo;Kt.CloseEvent=(Uo=class extends CustomEvent{constructor(e={}){super(Kt.CloseEvent.type,{...e})}},A(Uo,"type","mw:close"),Uo);var qo;Kt.ClickEvent=(qo=class extends CustomEvent{constructor(e={}){super(Kt.ClickEvent.type,{...e})}},A(qo,"type","mw:click"),qo);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Kt);var Ai,bc,wc,mr=class mr extends V(j){constructor(){super();y(this,Ai);A(this,"render",()=>D`
314
337
  <!-- wrapper -->
315
338
  <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">
316
339
  <!-- close button -->
317
340
  <button
318
341
  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"
319
- @click="${$(this,Di,Ec)}"
342
+ @click="${$(this,Ai,bc)}"
320
343
  aria-label="Close">
321
344
  ×
322
345
  </button>
323
346
 
324
347
  <!-- content -->
325
- <div class="p-4 text-gray-800" @click="${$(this,Di,Cc)}">
348
+ <div class="p-4 text-gray-800" @click="${$(this,Ai,wc)}">
326
349
  <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
327
350
  <p class="py-2.5 text-left">${this.text}</p>
328
351
  <div class="h-4"></div>
329
- ${this.button&&this.color?L`
352
+ ${this.button&&this.color?D`
330
353
  <!-- only visible if button text and color are given -->
331
354
  <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>
332
- `:U}
355
+ `:L}
333
356
  </div>
334
357
 
335
358
  <!-- can append any other content -->
336
359
  <slot name="footer"></slot>
337
360
  </div>
338
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Di=new WeakSet,Ec=function(){this.dispatchEvent(new Sr.CloseEvent)},Cc=function(){this.dispatchEvent(new Sr.ClickEvent)},T(Sr,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var ri=Sr,Wo;ri.CloseEvent=(Wo=class extends CustomEvent{constructor(e={}){super(ri.CloseEvent.type,{...e})}},T(Wo,"type","mw:close"),Wo);var Vo;ri.ClickEvent=(Vo=class extends CustomEvent{constructor(e={}){super(ri.ClickEvent.type,{...e})}},T(Vo,"type","mw:click"),Vo);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",ri);var Li,Er,ni,Nn=class{constructor(e,t){y(this,Li);y(this,Er,!1);y(this,ni,()=>{f(this,Er)||(f(this,Li).userFirstInteracted?.(),E(this,Er,!0)),f(this,Li).userInteracted?.()});E(this,Li,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",f(this,ni)),window.addEventListener("keydown",f(this,ni))}stopListening(){window.removeEventListener("click",f(this,ni)),window.removeEventListener("keydown",f(this,ni))}};Li=new WeakMap,Er=new WeakMap,ni=new WeakMap;var df=24*60*60*1e3,Ni,Ge,si,Cr,oi,$r,jn,$c,Un=class{constructor(e,t,r=Date){y(this,jn);y(this,Ni);y(this,Ge);y(this,si);y(this,Cr);y(this,oi,!1);y(this,$r,!1);E(this,Ni,e),E(this,Ge,t),E(this,si,r),e.addController(this)}get showing(){return f(this,oi)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!f(this,oi)&&(E(this,oi,!0),f(this,Ni).requestUpdate(),e)){f(this,Ge).playPopupSound();let t=f(this,Ge).getPersistedState();f(this,Ge).setPersistedState({...t,playedSoundOnce:!0})}}hide(){E(this,$r,!0),this.abortAutoShowTimer(),E(this,oi,!1),f(this,Ni).requestUpdate()}abortAutoShowTimer(){clearTimeout(f(this,Cr))}onCloseClick(){let e=f(this,Ge).getPersistedState();f(this,Ge).setPersistedState({...e,userDismissedAt:f(this,si).now()}),this.hide()}onContentClick(){let e=f(this,Ge).getPersistedState();f(this,Ge).setPersistedState({...e,userDismissedAt:f(this,si).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),f(this,$r)||E(this,Cr,setTimeout(()=>$(this,jn,$c).call(this),f(this,Ge).getDelayMs()))}};Ni=new WeakMap,Ge=new WeakMap,si=new WeakMap,Cr=new WeakMap,oi=new WeakMap,$r=new WeakMap,jn=new WeakSet,$c=function(){let e=f(this,Ge).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&f(this,si).now()-e.userDismissedAt<df||this.show({sound:!t})};var Ot,Xo,bt,qn,Jo,Bn=class Bn extends J(H){constructor(){super();y(this,bt);y(this,Ot,new Un(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}}}));y(this,Xo,new Nn(this,f(this,Ot)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=f(this,Ot).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return L`
361
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Ai=new WeakSet,bc=function(){this.dispatchEvent(new mr.CloseEvent)},wc=function(){this.dispatchEvent(new mr.ClickEvent)},A(mr,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Zt=mr,jo;Zt.CloseEvent=(jo=class extends CustomEvent{constructor(e={}){super(Zt.CloseEvent.type,{...e})}},A(jo,"type","mw:close"),jo);var Bo;Zt.ClickEvent=(Bo=class extends CustomEvent{constructor(e={}){super(Zt.ClickEvent.type,{...e})}},A(Bo,"type","mw:click"),Bo);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Zt);var Ti,_r,Qt,Rn=class{constructor(e,t){y(this,Ti);y(this,_r,!1);y(this,Qt,()=>{f(this,_r)||(f(this,Ti).userFirstInteracted?.(),E(this,_r,!0)),f(this,Ti).userInteracted?.()});E(this,Ti,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",f(this,Qt)),window.addEventListener("keydown",f(this,Qt))}stopListening(){window.removeEventListener("click",f(this,Qt)),window.removeEventListener("keydown",f(this,Qt))}};Ti=new WeakMap,_r=new WeakMap,Qt=new WeakMap;var af=24*60*60*1e3,Pi,je,ei,yr,ti,br,Fn,xc,On=class{constructor(e,t,r=Date){y(this,Fn);y(this,Pi);y(this,je);y(this,ei);y(this,yr);y(this,ti,!1);y(this,br,!1);E(this,Pi,e),E(this,je,t),E(this,ei,r),e.addController(this)}get showing(){return f(this,ti)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!f(this,ti)&&(E(this,ti,!0),f(this,Pi).requestUpdate(),e)){f(this,je).playPopupSound();let t=f(this,je).getPersistedState();f(this,je).setPersistedState({...t,playedSoundOnce:!0})}}hide(){E(this,br,!0),this.abortAutoShowTimer(),E(this,ti,!1),f(this,Pi).requestUpdate()}abortAutoShowTimer(){clearTimeout(f(this,yr))}onCloseClick(){let e=f(this,je).getPersistedState();f(this,je).setPersistedState({...e,userDismissedAt:f(this,ei).now()}),this.hide()}onContentClick(){let e=f(this,je).getPersistedState();f(this,je).setPersistedState({...e,userDismissedAt:f(this,ei).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),f(this,br)||E(this,yr,setTimeout(()=>$(this,Fn,xc).call(this),f(this,je).getDelayMs()))}};Pi=new WeakMap,je=new WeakMap,ei=new WeakMap,yr=new WeakMap,ti=new WeakMap,br=new WeakMap,Fn=new WeakSet,xc=function(){let e=f(this,je).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&f(this,ei).now()-e.userDismissedAt<af||this.show({sound:!t})};var It,Wo,gt,Mn,zo,Dn=class Dn extends V(j){constructor(){super();y(this,gt);y(this,It,new On(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}}}));y(this,Wo,new Rn(this,f(this,It)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=f(this,It).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return D`
339
362
  <!-- mobile shadow backdrop -->
340
- <div @click="${$(this,bt,qn)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
363
+ <div @click="${$(this,gt,Mn)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
341
364
 
342
365
  <!-- mobile overlay -->
343
366
  <div class="${t} fixed bottom-0 left-0 right-0 z-[2147483647] sm:hidden">
344
- <mw-popup-mobile title="${r.mobile.title}" text="${r.mobile.text}" button="${r.mobile.button}" color="${r.mobile.color}" @mw:click="${$(this,bt,Jo)}" @mw:close="${$(this,bt,qn)}">
345
- ${r.mobile.poweredBy?L`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:U}
367
+ <mw-popup-mobile title="${r.mobile.title}" text="${r.mobile.text}" button="${r.mobile.button}" color="${r.mobile.color}" @mw:click="${$(this,gt,zo)}" @mw:close="${$(this,gt,Mn)}">
368
+ ${r.mobile.poweredBy?D`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:L}
346
369
  </mw-popup-mobile>
347
370
  </div>
348
371
 
349
372
  <!-- desktop -->
350
373
  <div class="${t} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
351
- <mw-popup-desktop text="${r.desktop.text}" @mw:click="${$(this,bt,Jo)}" @mw:close="${$(this,bt,qn)}"></mw-popup-desktop>
374
+ <mw-popup-desktop text="${r.desktop.text}" @mw:click="${$(this,gt,zo)}" @mw:close="${$(this,gt,Mn)}"></mw-popup-desktop>
352
375
  </div>
353
- `}hide(){f(this,Ot).hide()}};Ot=new WeakMap,Xo=new WeakMap,bt=new WeakSet,qn=function(){f(this,Ot).onCloseClick()},Jo=function(){this.dispatchEvent(new Bn.ClickEvent),f(this,Ot).onContentClick()},T(Bn,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Ir=Bn,Go;Ir.ClickEvent=(Go=class extends CustomEvent{constructor(e={}){super(Ir.ClickEvent.type,{...e})}},T(Go,"type","mw:click"),Go);customElements.get("mw-popup")||customElements.define("mw-popup",Ir);var pf="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Yo=class extends J(H){constructor(){super(...arguments);T(this,"render",()=>L`
354
- <p class="flex items-center justify-center whitespace-nowrap text-xs">
355
- <span>Powered by</span>
356
-
357
- <a href="${pf}" target="_blank" class="inline-flex items-center underline">
358
- <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
359
- <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
360
- <path
361
- fill-rule="evenodd"
362
- clip-rule="evenodd"
363
- d="M14.4482 15.0424C15.0767 15.2108 15.7464 15.1227 16.3099 14.7973L15.0832 12.6725L13.8564 10.5477L13.8562 10.5479L11.4869 6.44411L11.4774 6.42785L11.475 6.42371C11.1496 5.86018 10.6137 5.44898 9.98519 5.28057C9.35666 5.11215 8.68697 5.20032 8.12345 5.52567L9.35019 7.65045L10.5769 9.77523L10.577 9.77516L12.9461 13.8785L12.9593 13.9008C13.2847 14.4635 13.8202 14.8741 14.4482 15.0424ZM10.8392 15.0436C11.4677 15.212 12.1374 15.1238 12.701 14.7985L11.4742 12.6737L10.2475 10.5489L10.2474 10.549L7.87793 6.44488L7.87142 6.43373L7.86629 6.4248C7.54093 5.86127 7.00505 5.45007 6.37652 5.28166C5.90455 5.15519 5.40058 5.17178 4.94379 5.32631C4.44552 5.48229 4.08397 5.94754 4.08397 6.49724V12.5389C4.08354 12.5576 4.08333 12.5763 4.08333 12.5951C4.08333 13.2451 4.34182 13.8686 4.80194 14.3283C5.26205 14.7879 5.88611 15.0462 6.53681 15.0462V12.6098C6.53724 12.5964 6.53746 12.5831 6.53746 12.5696V9.7318C6.33805 9.40929 6.1011 8.99037 5.8593 8.52589C5.2972 7.44609 4.92176 6.52897 5.02074 6.47745C5.03257 6.47129 5.05064 6.47777 5.07425 6.4958L5.07612 6.49904C5.25259 6.63858 5.72449 7.39502 6.21645 8.34007C6.38575 8.66529 6.53812 8.97576 6.66569 9.25226L6.96825 9.77632L6.96829 9.77629L9.33716 13.8793L9.34457 13.892L9.34944 13.9004C9.67479 14.464 10.2107 14.8752 10.8392 15.0436Z"
364
- fill="url(#paint0_linear_1_17)" />
365
- <defs>
366
- <linearGradient id="paint0_linear_1_17" x1="4.08333" y1="10.1653" x2="16.3099" y2="10.1653" gradientUnits="userSpaceOnUse">
367
- <stop offset="0.197917" stop-color="#E4FF1A" />
368
- <stop offset="0.822917" stop-color="#21F4F0" />
369
- </linearGradient>
370
- </defs>
371
- </svg>
372
-
373
- <span>Molin AI</span>
374
- </a>
375
- </p>
376
- `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Yo);var zn,Ic,Hn=class extends J(H){constructor(){super();y(this,zn);T(this,"render",()=>L`
376
+ `}hide(){f(this,It).hide()}};It=new WeakMap,Wo=new WeakMap,gt=new WeakSet,Mn=function(){f(this,It).onCloseClick()},zo=function(){this.dispatchEvent(new Dn.ClickEvent),f(this,It).onContentClick()},A(Dn,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var wr=Dn,Ho;wr.ClickEvent=(Ho=class extends CustomEvent{constructor(e={}){super(wr.ClickEvent.type,{...e})}},A(Ho,"type","mw:click"),Ho);customElements.get("mw-popup")||customElements.define("mw-popup",wr);var Nn,kc,Ln=class extends V(j){constructor(){super();y(this,Nn);A(this,"render",()=>D`
377
377
  <span class="relative inline-flex">
378
378
  <slot></slot>
379
- <span class="${f(this,zn,Ic)} pointer-events-none absolute z-10 flex h-3 w-3">
379
+ <span class="${f(this,Nn,kc)} pointer-events-none absolute z-10 flex h-3 w-3">
380
380
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
381
381
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
382
382
  </span>
383
383
  </span>
384
- `);this.color="sky-500",this.position="top-right"}};zn=new WeakSet,Ic=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}`)}},T(Hn,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Hn);var Wn=class extends J(H){constructor(){super();T(this,"render",()=>L`
384
+ `);this.color="sky-500",this.position="top-right"}};Nn=new WeakSet,kc=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}`)}},A(Ln,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Ln);var Un=class extends V(j){constructor(){super();A(this,"render",()=>D`
385
385
  <div class="${this.positionClasses} fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base">
386
386
  <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
387
387
 
@@ -394,74 +394,76 @@ var Kp=Object.defineProperty;var Nl=i=>{throw TypeError(i)};var Zp=(i,e,t)=>e in
394
394
  stroke-linecap="round"></path>
395
395
  </svg>
396
396
  </div>
397
- `);this.positionClasses="",this.text="Try it out"}};T(Wn,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Wn);window.__INIT_MOLIN_SHOP_AI=function(e){if(hf(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 hf(i){window.__INIT_MOLIN_SHOP_AI_OPTIONS=i}function Ac(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Fe,wt,Gn,Ar,Ui,Ko=class{constructor(){y(this,Fe,[]);y(this,wt);y(this,Gn,10);y(this,Ar,5e3);y(this,Ui,!1)}async add(e,t){if(f(this,Fe).push({event:e,properties:Object.assign({},t,Rc()),distinct_id:Pc(t.distinct_id),timestamp:new Date().toISOString()}),f(this,Fe).length>=f(this,Gn))return this.flush();f(this,wt)||E(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Ar)))}async flush(){if(f(this,Ui)||f(this,Fe).length===0)return;let e=[...f(this,Fe)];try{E(this,Ui,!0),clearTimeout(f(this,wt)),E(this,wt,void 0),E(this,Fe,[]);let t=new AbortController,r=setTimeout(()=>t.abort(),5e3),n=new FormData;n.append("events",JSON.stringify(e));let s=await fetch(new URL("/widgets/data/collect",Zo()).href,{method:"POST",body:n,signal:t.signal});if(clearTimeout(r),!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"),E(this,Fe,[...e,...f(this,Fe)]);else{console.error("Failed to send events to backend:",t);let r=e.filter(n=>n.event.includes("error"));E(this,Fe,[...r,...f(this,Fe)])}}finally{E(this,Ui,!1),f(this,Fe).length>0&&!f(this,wt)&&E(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Ar)))}}async flushBeforeUnload(){if(f(this,Fe).length>0)try{let e=new FormData;e.append("events",JSON.stringify(f(this,Fe))),navigator.sendBeacon(new URL("/widgets/data/collect",Zo()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};Fe=new WeakMap,wt=new WeakMap,Gn=new WeakMap,Ar=new WeakMap,Ui=new WeakMap;var Tc=new Ko;window.addEventListener("unload",()=>{Tc.flushBeforeUnload().catch(console.error)});async function he(i,e){try{if(e.immediate){let t=new FormData;t.append("events",JSON.stringify([{event:i,properties:Object.assign({},e,Rc()),distinct_id:Pc(e.distinct_id),timestamp:new Date().toISOString()}]));let r=await fetch(new URL("/widgets/data/collect",Zo()).href,{method:"POST",body:t});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}return Tc.add(i,e)}catch(t){console.error("Failed to send event:",t)}}function Pc(i=crypto.randomUUID()){let e="molin_shop_assistant_distinct_id";try{let t=localStorage.getItem(e);return t||(t=i,localStorage.setItem(e,t)),t}catch(t){console.error("Failed to handle distinct ID:",t);try{localStorage.setItem(e,i)}catch(r){console.error("Failed to store new distinct ID:",r)}return i}}function Rc(){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 Vn;function Zo(){if(Vn)return Vn;let i=new URL(import.meta.url).hostname;return Vn=new Map([["localhost","http://localhost:8787"],["widget.molin.foo","https://molin.foo"],["widget.molin.ai","https://molin.ai"],["molin.foo","https://molin.foo"]]).get(i)||"https://molin.ai",Vn}var ai,Tr,Ft,li,Xn,Fc,Jn=class{constructor(e,t,r){y(this,Xn);y(this,ai);y(this,Tr);y(this,Ft);y(this,li);T(this,"isLoading",!1);T(this,"data");E(this,ai,e),E(this,Tr,t),E(this,Ft,r),e.addController(this)}fetch(){if(this.isLoading)return;f(this,li)?.abort();let e=new AbortController;E(this,li,e),this.isLoading=!0,this.data=void 0,f(this,ai).requestUpdate(),(async()=>{let t=$(this,Xn,Fc).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,Ft)?.transform=="function"?await f(this,Ft).transform(t):t,f(this,ai).requestUpdate()}).catch(t=>{f(this,Ft)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,ai).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,Ft)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,li)?.abort(),E(this,li,void 0)}};ai=new WeakMap,Tr=new WeakMap,Ft=new WeakMap,li=new WeakMap,Xn=new WeakSet,Fc=function(){let e=f(this,Tr);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var dt,Pr,ji,qi,Mt=class{constructor(e,t){y(this,dt);y(this,Pr);y(this,ji);y(this,qi);E(this,dt,e),E(this,Pr,t),e.addController(this)}get data(){return f(this,qi)||f(this,ji)?.data}hostConnected(){if(f(this,ji)||f(this,qi))return;let e=Ac();e&&e.widgetId===f(this,dt).widgetId?E(this,qi,e.config):E(this,ji,new Jn(f(this,dt),()=>{if(f(this,dt).cdn&&f(this,dt).widgetId)return`${f(this,dt).cdn}/config?w=${f(this,dt).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:f(this,Pr)?.onError}))}};dt=new WeakMap,Pr=new WeakMap,ji=new WeakMap,qi=new WeakMap;function Mc(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function b(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mc(Object(t),!0).forEach(function(r){C(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Mc(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function C(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Rd(i,e){if(i==null)return{};var t,r,n=function(o,l){if(o==null)return{};var a,c,d={},u=Object.keys(o);for(c=0;c<u.length;c++)a=u[c],l.indexOf(a)>=0||(d[a]=o[a]);return d}(i,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}var lt,Nt={DEBUG:!1,LIB_VERSION:"1.195.0"},v=typeof window<"u"?window:void 0,He=typeof globalThis<"u"?globalThis:v,Od=Array.prototype,Dc=Od.forEach,Lc=Od.indexOf,Xe=He?.navigator,O=He?.document,Be=He?.location,ca=He?.fetch,da=He!=null&&He.XMLHttpRequest&&"withCredentials"in new He.XMLHttpRequest?He.XMLHttpRequest:void 0,Nc=He?.AbortController,ke=Xe?.userAgent,j=v??{},Qo="$copy_autocapture",ff=["$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(i){i.GZipJS="gzip-js",i.Base64="base64"})(lt||(lt={}));var gf=Array.isArray,Fd=Object.prototype,Md=Fd.hasOwnProperty,As=Fd.toString,ce=gf||function(i){return As.call(i)==="[object Array]"},Qe=i=>typeof i=="function",fe=i=>i===Object(i)&&!ce(i),Hi=i=>{if(fe(i)){for(var e in i)if(Md.call(i,e))return!1;return!0}return!1},F=i=>i===void 0,Ce=i=>As.call(i)=="[object String]",Uc=i=>Ce(i)&&i.trim().length===0,zt=i=>i===null,ee=i=>F(i)||zt(i),Je=i=>As.call(i)=="[object Number]",fi=i=>As.call(i)==="[object Boolean]",vf=i=>i instanceof FormData,mf=i=>W(ff,i),Dd=i=>{var e={_log:function(t){if(v&&(Nt.DEBUG||j.POSTHOG_DEBUG)&&!F(v.console)&&v.console){for(var r=("__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];r(i,...s)}},info:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("log",...r)},warn:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("warn",...r)},error:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("error",...r)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(i,...r)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling ".concat(t))},createLogger:t=>Dd("".concat(i," ").concat(t))};return e},D=Dd("[PostHog.js]"),ze=D.createLogger,cs={},Ts=function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Vi(i,e,t){if(ce(i)){if(Dc&&i.forEach===Dc)i.forEach(e,t);else if("length"in i&&i.length===+i.length){for(var r=0,n=i.length;r<n;r++)if(r in i&&e.call(t,i[r],r)===cs)return}}}function K(i,e,t){if(!ee(i)){if(ce(i))return Vi(i,e,t);if(vf(i)){for(var r of i.entries())if(e.call(t,r[1],r[0])===cs)return}else for(var n in i)if(Md.call(i,n)&&e.call(t,i[n],n)===cs)return}}var De=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Vi(t,function(n){for(var s in n)n[s]!==void 0&&(i[s]=n[s])}),i};function W(i,e){return i.indexOf(e)!==-1}function as(i){for(var e=Object.keys(i),t=e.length,r=new Array(t);t--;)r[t]=[e[t],i[e[t]]];return r}var jc=function(i){try{return i()}catch{return}},_f=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.apply(this,t)}catch(n){D.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),D.critical(n)}}},ds=function(i){var e={};return K(i,function(t,r){Ce(t)&&t.length>0&&(e[r]=t)}),e},pa=function(i){return i.replace(/^\$/,"")};function yf(i,e){return t=i,r=s=>Ce(s)&&!zt(e)?s.slice(0,e):s,n=new Set,function s(o,l){return o!==Object(o)?r?r(o,l):o:n.has(o)?void 0:(n.add(o),ce(o)?(a=[],Vi(o,c=>{a.push(s(c))})):(a={},K(o,(c,d)=>{n.has(c)||(a[d]=s(c,d))})),a);var a}(t);var t,r,n}var bf=function(i){var e,t,r,n,s="";for(e=t=0,r=(i=(i+"").replace(/\r\n/g,`
397
+ `);this.positionClasses="",this.text="Try it out"}};A(Un,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Un);window.__INIT_MOLIN_SHOP_AI=function(e){if(lf(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 lf(i){window.__INIT_MOLIN_SHOP_AI_OPTIONS=i}function Sc(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Ae,vt,jn,xr,Ri,Vo=class{constructor(){y(this,Ae,[]);y(this,vt);y(this,jn,10);y(this,xr,5e3);y(this,Ri,!1)}async add(e,t){if(f(this,Ae).push({event:e,properties:Object.assign({},t,$c()),distinct_id:Cc(t.distinct_id),timestamp:new Date().toISOString()}),f(this,Ae).length>=f(this,jn))return this.flush();f(this,vt)||E(this,vt,setTimeout(()=>{this.flush().catch(console.error)},f(this,xr)))}async flush(){if(f(this,Ri)||f(this,Ae).length===0)return;let e=[...f(this,Ae)];try{E(this,Ri,!0),clearTimeout(f(this,vt)),E(this,vt,void 0),E(this,Ae,[]);let t=new AbortController,r=setTimeout(()=>t.abort(),5e3),n=new FormData;n.append("events",JSON.stringify(e));let s=await fetch(new URL("/widgets/data/collect",Go()).href,{method:"POST",body:n,signal:t.signal});if(clearTimeout(r),!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"),E(this,Ae,[...e,...f(this,Ae)]);else{console.error("Failed to send events to backend:",t);let r=e.filter(n=>n.event.includes("error"));E(this,Ae,[...r,...f(this,Ae)])}}finally{E(this,Ri,!1),f(this,Ae).length>0&&!f(this,vt)&&E(this,vt,setTimeout(()=>{this.flush().catch(console.error)},f(this,xr)))}}async flushBeforeUnload(){if(f(this,Ae).length>0)try{let e=new FormData;e.append("events",JSON.stringify(f(this,Ae))),navigator.sendBeacon(new URL("/widgets/data/collect",Go()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};Ae=new WeakMap,vt=new WeakMap,jn=new WeakMap,xr=new WeakMap,Ri=new WeakMap;var Ec=new Vo;window.addEventListener("beforeunload",()=>{Ec.flushBeforeUnload().catch(console.error)});async function ce(i,e){try{if(e.immediate){let t=new FormData;t.append("events",JSON.stringify([{event:i,properties:Object.assign({},e,$c()),distinct_id:Cc(e.distinct_id),timestamp:new Date().toISOString()}]));let r=await fetch(new URL("/widgets/data/collect",Go()).href,{method:"POST",body:t});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}return Ec.add(i,e)}catch(t){console.error("Failed to send event:",t)}}function Cc(i=crypto.randomUUID()){let e="molin_shop_assistant_distinct_id";try{let t=localStorage.getItem(e);return t||(t=i,localStorage.setItem(e,t)),t}catch(t){console.error("Failed to handle distinct ID:",t);try{localStorage.setItem(e,i)}catch(r){console.error("Failed to store new distinct ID:",r)}return i}}function $c(){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 qn;function Go(){if(qn)return qn;let i=new URL(import.meta.url).hostname;return qn=new Map([["localhost","http://localhost:8787"],["widget.molin.foo","https://molin.foo"],["widget.molin.ai","https://molin.ai"],["molin.foo","https://molin.foo"]]).get(i)||"https://molin.ai",qn}var ii,kr,At,ri,Hn,Ac,Bn=class{constructor(e,t,r){y(this,Hn);y(this,ii);y(this,kr);y(this,At);y(this,ri);A(this,"isLoading",!1);A(this,"data");E(this,ii,e),E(this,kr,t),E(this,At,r),e.addController(this)}fetch(){if(this.isLoading)return;f(this,ri)?.abort();let e=new AbortController;E(this,ri,e),this.isLoading=!0,this.data=void 0,f(this,ii).requestUpdate(),(async()=>{let t=$(this,Hn,Ac).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,At)?.transform=="function"?await f(this,At).transform(t):t,f(this,ii).requestUpdate()}).catch(t=>{f(this,At)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,ii).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,At)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,ri)?.abort(),E(this,ri,void 0)}};ii=new WeakMap,kr=new WeakMap,At=new WeakMap,ri=new WeakMap,Hn=new WeakSet,Ac=function(){let e=f(this,kr);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ot,Sr,Oi,Fi,Tt=class{constructor(e,t){y(this,ot);y(this,Sr);y(this,Oi);y(this,Fi);E(this,ot,e),E(this,Sr,t),e.addController(this)}get data(){return f(this,Fi)||f(this,Oi)?.data}hostConnected(){if(f(this,Oi)||f(this,Fi))return;let e=Sc();e&&e.widgetId===f(this,ot).widgetId?E(this,Fi,e.config):E(this,Oi,new Bn(f(this,ot),()=>{if(f(this,ot).cdn&&f(this,ot).widgetId)return`${f(this,ot).cdn}/config?w=${f(this,ot).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:f(this,Sr)?.onError}))}};ot=new WeakMap,Sr=new WeakMap,Oi=new WeakMap,Fi=new WeakMap;function Tc(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function b(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tc(Object(t),!0).forEach(function(r){C(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Tc(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function C(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function $d(i,e){if(i==null)return{};var t,r,n=function(o,l){if(o==null)return{};var a,c,d={},u=Object.keys(o);for(c=0;c<u.length;c++)a=u[c],l.indexOf(a)>=0||(d[a]=o[a]);return d}(i,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}var rt,Ot={DEBUG:!1,LIB_VERSION:"1.195.0"},v=typeof window<"u"?window:void 0,Le=typeof globalThis<"u"?globalThis:v,Id=Array.prototype,Pc=Id.forEach,Rc=Id.indexOf,He=Le?.navigator,R=Le?.document,De=Le?.location,sa=Le?.fetch,oa=Le!=null&&Le.XMLHttpRequest&&"withCredentials"in new Le.XMLHttpRequest?Le.XMLHttpRequest:void 0,Oc=Le?.AbortController,ye=He?.userAgent,N=v??{},Jo="$copy_autocapture",uf=["$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(i){i.GZipJS="gzip-js",i.Base64="base64"})(rt||(rt={}));var cf=Array.isArray,Ad=Object.prototype,Td=Ad.hasOwnProperty,ks=Ad.toString,ae=cf||function(i){return ks.call(i)==="[object Array]"},Je=i=>typeof i=="function",de=i=>i===Object(i)&&!ae(i),Di=i=>{if(de(i)){for(var e in i)if(Td.call(i,e))return!1;return!0}return!1},O=i=>i===void 0,xe=i=>ks.call(i)=="[object String]",Fc=i=>xe(i)&&i.trim().length===0,Ut=i=>i===null,Z=i=>O(i)||Ut(i),Be=i=>ks.call(i)=="[object Number]",ui=i=>ks.call(i)==="[object Boolean]",df=i=>i instanceof FormData,pf=i=>H(uf,i),Pd=i=>{var e={_log:function(t){if(v&&(Ot.DEBUG||N.POSTHOG_DEBUG)&&!O(v.console)&&v.console){for(var r=("__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];r(i,...s)}},info:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("log",...r)},warn:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("warn",...r)},error:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("error",...r)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(i,...r)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling ".concat(t))},createLogger:t=>Pd("".concat(i," ").concat(t))};return e},M=Pd("[PostHog.js]"),Ne=M.createLogger,ns={},Ss=function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Ui(i,e,t){if(ae(i)){if(Pc&&i.forEach===Pc)i.forEach(e,t);else if("length"in i&&i.length===+i.length){for(var r=0,n=i.length;r<n;r++)if(r in i&&e.call(t,i[r],r)===ns)return}}}function X(i,e,t){if(!Z(i)){if(ae(i))return Ui(i,e,t);if(df(i)){for(var r of i.entries())if(e.call(t,r[1],r[0])===ns)return}else for(var n in i)if(Td.call(i,n)&&e.call(t,i[n],n)===ns)return}}var Pe=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Ui(t,function(n){for(var s in n)n[s]!==void 0&&(i[s]=n[s])}),i};function H(i,e){return i.indexOf(e)!==-1}function ts(i){for(var e=Object.keys(i),t=e.length,r=new Array(t);t--;)r[t]=[e[t],i[e[t]]];return r}var Mc=function(i){try{return i()}catch{return}},hf=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.apply(this,t)}catch(n){M.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),M.critical(n)}}},ss=function(i){var e={};return X(i,function(t,r){xe(t)&&t.length>0&&(e[r]=t)}),e},aa=function(i){return i.replace(/^\$/,"")};function ff(i,e){return t=i,r=s=>xe(s)&&!Ut(e)?s.slice(0,e):s,n=new Set,function s(o,l){return o!==Object(o)?r?r(o,l):o:n.has(o)?void 0:(n.add(o),ae(o)?(a=[],Ui(o,c=>{a.push(s(c))})):(a={},X(o,(c,d)=>{n.has(c)||(a[d]=s(c,d))})),a);var a}(t);var t,r,n}var gf=function(i){var e,t,r,n,s="";for(e=t=0,r=(i=(i+"").replace(/\r\n/g,`
398
398
  `).replace(/\r/g,`
399
- `)).length,n=0;n<r;n++){var o=i.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),zt(l)||(t>e&&(s+=i.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=i.substring(e,i.length)),s},Ct=function(){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation),e}return i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},function(e,t,r,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(t,r,!!s);else{var o="on"+t,l=e[o];e[o]=function(a,c,d){return function(u){if(u=u||i(v?.event)){var p,h=!0;Qe(d)&&(p=d(u));var g=c.call(a,u);return p!==!1&&g!==!1||(h=!1),h}}}(e,r,l)}else D.error("No valid element provided to register_event")}}();function Ld(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}var Nd="$people_distinct_id",Dr="__alias",Lr="__timers",qc="$autocapture_disabled_server_side",ha="$heatmaps_enabled_server_side",Bc="$exception_capture_enabled_server_side",Hc="$web_vitals_enabled_server_side",Ud="$dead_clicks_enabled_server_side",zc="$web_vitals_allowed_metrics",fa="$session_recording_enabled_server_side",Wc="$console_log_recording_enabled_server_side",Vc="$session_recording_network_payload_capture",Gc="$session_recording_canvas_recording",Jc="$replay_sample_rate",Xc="$replay_minimum_duration",Yc="$replay_script_config",ps="$sesid",Nr="$session_is_sampled",ea="$session_recording_url_trigger_activated_session",ta="$session_recording_event_trigger_activated_session",zi="$enabled_feature_flags",ga="$early_access_features",Wi="$stored_person_properties",Ut="$stored_group_properties",va="$surveys",Yn="$surveys_activated",hs="$flag_call_reported",kt="$user_state",ma="$client_session_props",_a="$capture_rate_limit",ya="$initial_campaign_params",ba="$initial_referrer_info",wa="$initial_person_info",fs="$epp",jd="__POSTHOG_TOOLBAR__",wf=[Nd,Dr,"__cmpns",Lr,fa,ha,ps,zi,kt,ga,Ut,Wi,va,hs,ma,_a,ya,ba,fs],Kn=ze("[FeatureFlags]"),ia="$active_feature_flags",Zn="$override_feature_flags",Kc="$feature_flag_payloads",Zc=i=>{var e={};for(var[t,r]of as(i||{}))r&&(e[t]=r);return e},xa=class{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(zi),t=this.instance.get_property(Zn);if(!t)return e||{};for(var r=De({},e),n=Object.keys(t),s=0;s<n.length;s++)r[n[s]]=t[n[s]];return this._override_warning||(Kn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){return this.instance.get_property(Kc)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())},5)}_reloadFeatureFlagsRequest(){if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var e=this.instance.config.token,t=this.instance.get_property(Wi),r=this.instance.get_property(Ut),n={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:n,compression:this.instance.config.disable_compression?void 0:lt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:s=>{var o;this.setReloadingPaused(!1);var l=!0;s.statusCode===200&&(this.$anon_distinct_id=void 0,l=!1),this.receivedFeatureFlags((o=s.json)!==null&&o!==void 0?o:{},l),this._startReloadTimer()}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r,n=this.getFlagVariants()[e],s="".concat(n),o=this.instance.get_property(hs)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(ce(o[e])?o[e].push(s):o[e]=[s],(r=this.instance.persistence)===null||r===void 0||r.register({[hs]:o}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}Kn.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.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Kn.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.instance.decideEndpointWasHit=!0;var r=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]:{},c=s.featureFlags,d=s.featureFlagPayloads;if(c)if(ce(c)){var u={};if(c)for(var p=0;p<c.length;p++)u[c[p]]=!0;o&&o.register({[ia]:c,[zi]:u})}else{var h=c,g=d;s.errorsWhileComputingFlags&&(h=b(b({},l),h),g=b(b({},a),g)),o&&o.register({[ia]:Object.keys(Zc(h)),[zi]:h||{},[Kc]:g||{}})}})(e,this.instance.persistence,r,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 Kn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(Zn);else if(ce(e)){for(var r={},n=0;n<e.length;n++)r[e[n]]=!0;this.instance.persistence.register({[Zn]:r})}else this.instance.persistence.register({[Zn]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var r,n={["$feature_enrollment/".concat(e)]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:n}),this.setPersonPropertiesForFlags(n,!1);var s=b(b({},this.getFlagVariants()),{},{[e]:t});(r=this.instance.persistence)===null||r===void 0||r.register({[ia]:Object.keys(Zc(s)),[zi]:s}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(ga);if(r&&!t)return e(r);this.instance._send_request({transport:"XHR",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({[ga]:o}),e(o)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(r=>t[r]),flagVariants:Object.keys(t).filter(r=>t[r]).reduce((r,n)=>(r[n]=t[n],r),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(n=>n(t,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Wi)||{};this.instance.register({[Wi]:b(b({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Wi)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ut)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(n=>{r[n]=b(b({},r[n]),e[n]),delete e[n]}),this.instance.register({[Ut]:b(b({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(Ut)||{};this.instance.register({[Ut]:b(b({},t),{},{[e]:{}})})}else this.instance.unregister(Ut)}};Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return Je(i)&&isFinite(i)&&Math.floor(i)===i});var Qc="0123456789abcdef",ka=class i{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>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|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new i(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Qc.charAt(this.bytes[t]>>>4)+Qc.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 i(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(r!==0)return Math.sign(r)}return 0}},Sa=class{constructor(){C(this,"timestamp",0),C(this,"counter",0),C(this,"random",new Ea)}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 ka.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())}},ed,qd=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<i.length;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};v&&!F(v.crypto)&&crypto.getRandomValues&&(qd=i=>crypto.getRandomValues(i));var Ea=class{constructor(){C(this,"buffer",new Uint32Array(8)),C(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(qd(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},qt=()=>xf().toString(),xf=()=>(ed||(ed=new Sa)).generate(),kf="Thu, 01 Jan 1970 00:00:00 GMT",Rr="",Sf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ef(i,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:O;if(Rr)return Rr;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(),c=new RegExp("(^|;)\\s*"+a+"=1");!Rr&&l--;){var d=o.slice(l).join("."),u=a+"=1;domain=."+d;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+kf,Rr=d)}return Rr}(i);if(!t){var r=(n=>{var s=n.match(Sf);return s?s[0]:""})(i);r!==t&&D.info("Warning: cookie subdomain discovery mismatch",r,t),t=r}return t?"; domain=."+t:""}return""}var $t={is_supported:()=>!!O,error:function(i){D.error("cookieStore error: "+i)},get:function(i){if(O){try{for(var e=i+"=",t=O.cookie.split(";").filter(s=>s.length),r=0;r<t.length;r++){for(var n=t[r];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(i){var e;try{e=JSON.parse($t.get(i))||{}}catch{}return e},set:function(i,e,t,r,n){if(O)try{var s="",o="",l=Ef(O.location.hostname,r);if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),s="; expires="+a.toUTCString()}n&&(o="; secure");var c=i+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&D.warn("cookieStore warning: large cookie, len="+c.length),O.cookie=c,c}catch{return}},remove:function(i,e){try{$t.set(i,"",-1,e)}catch{return}}},ra=null,me={is_supported:function(){if(!zt(ra))return ra;var i=!0;if(F(v))i=!1;else try{var e="__mplssupport__";me.set(e,"xyz"),me.get(e)!=='"xyz"'&&(i=!1),me.remove(e)}catch{i=!1}return i||D.error("localStorage unsupported; falling back to cookie store"),ra=i,i},error:function(i){D.error("localStorage error: "+i)},get:function(i){try{return v?.localStorage.getItem(i)}catch(e){me.error(e)}return null},parse:function(i){try{return JSON.parse(me.get(i))||{}}catch{}return null},set:function(i,e){try{v?.localStorage.setItem(i,JSON.stringify(e))}catch(t){me.error(t)}},remove:function(i){try{v?.localStorage.removeItem(i)}catch(e){me.error(e)}}},Cf=["distinct_id",ps,Nr,fs,wa],Qn=b(b({},me),{},{parse:function(i){try{var e={};try{e=$t.parse(i)||{}}catch{}var t=De(e,JSON.parse(me.get(i)||"{}"));return me.set(i,t),t}catch{}return null},set:function(i,e,t,r,n,s){try{me.set(i,e,void 0,void 0,s);var o={};Cf.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&$t.set(i,o,t,r,n,s)}catch(l){me.error(l)}},remove:function(i,e){try{v?.localStorage.removeItem(i),$t.remove(i,e)}catch(t){me.error(t)}}}),es={},$f={is_supported:function(){return!0},error:function(i){D.error("memoryStorage error: "+i)},get:function(i){return es[i]||null},parse:function(i){return es[i]||null},set:function(i,e){es[i]=e},remove:function(i){delete es[i]}},ui=null,Ee={is_supported:function(){if(!zt(ui))return ui;if(ui=!0,F(v))ui=!1;else try{var i="__support__";Ee.set(i,"xyz"),Ee.get(i)!=='"xyz"'&&(ui=!1),Ee.remove(i)}catch{ui=!1}return ui},error:function(i){D.error("sessionStorage error: ",i)},get:function(i){try{return v?.sessionStorage.getItem(i)}catch(e){Ee.error(e)}return null},parse:function(i){try{return JSON.parse(Ee.get(i))||null}catch{}return null},set:function(i,e){try{v?.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){Ee.error(t)}},remove:function(i){try{v?.sessionStorage.removeItem(i)}catch(e){Ee.error(e)}}},If=["localhost","127.0.0.1"],Gi=i=>{var e=O?.createElement("a");return F(e)?null:(e.href=i,e)},Yi=function(i,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(i)},Af=function(i){var e,t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",n=[];return K(i,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(r)},gs=function(i,e){for(var t,r=((i.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<r.length;n++){var s=r[n].split("=");if(s[0]===e){t=s;break}}if(!ce(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{D.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},vs=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},et="Mobile",ms="iOS",pt="Android",zr="Tablet",Bd=pt+" "+zr,Hd="iPad",zd="Apple",Wd=zd+" Watch",Wr="Safari",Ki="BlackBerry",Vd="Samsung",Gd=Vd+"Browser",Jd=Vd+" Internet",vi="Chrome",Tf=vi+" OS",Xd=vi+" "+ms,gl="Internet Explorer",Yd=gl+" "+et,vl="Opera",Pf=vl+" Mini",ml="Edge",Kd="Microsoft "+ml,Ji="Firefox",Zd=Ji+" "+ms,Vr="Nintendo",Gr="PlayStation",Xi="Xbox",Qd=pt+" "+et,ep=et+" "+Wr,Ur="Windows",Ca=Ur+" Phone",td="Nokia",$a="Ouya",tp="Generic",Rf=tp+" "+et.toLowerCase(),ip=tp+" "+zr.toLowerCase(),Ia="Konqueror",Me="(\\d+(\\.\\d+)?)",na=new RegExp("Version/"+Me),Of=new RegExp(Xi,"i"),Ff=new RegExp(Gr+" \\w+","i"),Mf=new RegExp(Vr+" \\w+","i"),_l=new RegExp(Ki+"|PlayBook|BB10","i"),Df={"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"},Lf=(i,e)=>e&&W(e,zd)||function(t){return W(t,Wr)&&!W(t,vi)&&!W(t,pt)}(i),id=function(i,e){return e=e||"",W(i," OPR/")&&W(i,"Mini")?Pf:W(i," OPR/")?vl:_l.test(i)?Ki:W(i,"IE"+et)||W(i,"WPDesktop")?Yd:W(i,Gd)?Jd:W(i,ml)||W(i,"Edg/")?Kd:W(i,"FBIOS")?"Facebook "+et:W(i,"UCWEB")||W(i,"UCBrowser")?"UC Browser":W(i,"CriOS")?Xd:W(i,"CrMo")||W(i,vi)?vi:W(i,pt)&&W(i,Wr)?Qd:W(i,"FxiOS")?Zd:W(i.toLowerCase(),Ia.toLowerCase())?Ia:Lf(i,e)?W(i,et)?ep:Wr:W(i,Ji)?Ji:W(i,"MSIE")||W(i,"Trident/")?gl:W(i,"Gecko")?Ji:""},Nf={[Yd]:[new RegExp("rv:"+Me)],[Kd]:[new RegExp(ml+"?\\/"+Me)],[vi]:[new RegExp("("+vi+"|CrMo)\\/"+Me)],[Xd]:[new RegExp("CriOS\\/"+Me)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Me)],[Wr]:[na],[ep]:[na],[vl]:[new RegExp("(Opera|OPR)\\/"+Me)],[Ji]:[new RegExp(Ji+"\\/"+Me)],[Zd]:[new RegExp("FxiOS\\/"+Me)],[Ia]:[new RegExp("Konqueror[:/]?"+Me,"i")],[Ki]:[new RegExp(Ki+" "+Me),na],[Qd]:[new RegExp("android\\s"+Me,"i")],[Jd]:[new RegExp(Gd+"\\/"+Me)],[gl]:[new RegExp("(rv:|MSIE )"+Me)],Mozilla:[new RegExp("rv:"+Me)]},rd=[[new RegExp(Xi+"; "+Xi+" (.*?)[);]","i"),i=>[Xi,i&&i[1]||""]],[new RegExp(Vr,"i"),[Vr,""]],[new RegExp(Gr,"i"),[Gr,""]],[_l,[Ki,""]],[new RegExp(Ur,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ca,""];if(new RegExp(et).test(e)&&!/IEMobile\b/.test(e))return[Ur+" "+et,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=t[1],n=Df[r]||"";return/arm/i.test(e)&&(n="RT"),[Ur,n]}return[Ur,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[ms,e.join(".")]}return[ms,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=F(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+pt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+pt+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[pt,e.join(".")]}return[pt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Tf,""]],[/Linux|debian/i,["Linux",""]]],nd=function(i){return Mf.test(i)?Vr:Ff.test(i)?Gr:Of.test(i)?Xi:new RegExp($a,"i").test(i)?$a:new RegExp("("+Ca+"|WPDesktop)","i").test(i)?Ca:/iPad/.test(i)?Hd:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?Wd:_l.test(i)?Ki:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(td,"i").test(i)?td:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(et).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?pt:Bd:pt:new RegExp("(pda|"+et+")","i").test(i)?Rf:new RegExp(zr,"i").test(i)&&!new RegExp(zr+" pc","i").test(i)?ip:""},ts="https?://(.*)",Uf=["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"],oe={campaignParams:function(i){return O?this._campaignParamsFromUrl(O.URL,i):{}},_campaignParamsFromUrl:function(i,e){var t=Uf.concat(e||[]),r={};return K(t,function(n){var s=gs(i,n);r[n]=s||null}),r},_searchEngine:function(i){return i?i.search(ts+"google.([^/?]*)")===0?"google":i.search(ts+"bing.com")===0?"bing":i.search(ts+"yahoo.com")===0?"yahoo":i.search(ts+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(i){var e=oe._searchEngine(i),t=e!="yahoo"?"q":"p",r={};if(!zt(e)){r.$search_engine=e;var n=O?gs(O.referrer,t):"";n.length&&(r.ph_keyword=n)}return r},searchInfo:function(){var i=O?.referrer;return i?this._searchInfoFromReferrer(i):{}},browser:id,browserVersion:function(i,e){var t=id(i,e),r=Nf[t];if(F(r))return null;for(var n=0;n<r.length;n++){var s=r[n],o=i.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var i=this.browserLanguage();return typeof i=="string"?i.split("-")[0]:void 0},os:function(i){for(var e=0;e<rd.length;e++){var[t,r]=rd[e],n=t.exec(i),s=n&&(Qe(r)?r(n,i):r);if(s)return s}return["",""]},device:nd,deviceType:function(i){var e=nd(i);return e===Hd||e===Bd||e==="Kobo"||e==="Kindle Fire"||e===ip?zr:e===Vr||e===Xi||e===Gr||e===$a?"Console":e===Wd?"Wearable":e?et:"Desktop"},referrer:function(){return O?.referrer||"$direct"},referringDomain:function(){var i;return O!=null&&O.referrer&&((i=Gi(O.referrer))===null||i===void 0?void 0:i.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(i){var e,{r:t,u:r}=i,n={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Gi(t))===null||e===void 0?void 0:e.host};if(r){n.$initial_current_url=r;var s=Gi(r);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,K(this._campaignParamsFromUrl(r),function(o,l){n["$initial_"+pa(l)]=o})}return t&&K(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+pa(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(!ke)return{};var[i,e]=oe.os(ke);return De(ds({$os:i,$os_version:e,$browser:oe.browser(ke,navigator.vendor),$device:oe.device(ke),$device_type:oe.deviceType(ke),$timezone:oe.timezone(),$timezone_offset:oe.timezoneOffset()}),{$current_url:Be?.href,$host:Be?.host,$pathname:Be?.pathname,$raw_user_agent:ke.length>1e3?ke.substring(0,997)+"...":ke,$browser_version:oe.browserVersion(ke,navigator.vendor),$browser_language:oe.browserLanguage(),$browser_language_prefix:oe.browserLanguagePrefix(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:Nt.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(!ke)return{};var[i,e]=oe.os(ke);return De(ds({$os:i,$os_version:e,$browser:oe.browser(ke,navigator.vendor)}),{$browser_version:oe.browserVersion(ke,navigator.vendor)})}},jf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],jr=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t=>{var r="";return t.token&&(r=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+r+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&D.info("Persistence loaded",e.persistence,b({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){jf.indexOf(e.persistence.toLowerCase())===-1&&(D.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&me.is_supported()?me:t==="localstorage+cookie"&&Qn.is_supported()?Qn:t==="sessionstorage"&&Ee.is_supported()?Ee:t==="memory"?$f:t==="cookie"?$t:Qn.is_supported()?Qn:$t}properties(){var e={};return K(this.props,function(t,r){if(r===zi&&fe(t))for(var n=Object.keys(t),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=t[n[s]];else l=r,a=!1,(zt(o=wf)?a:Lc&&o.indexOf===Lc?o.indexOf(l)!=-1:(K(o,function(c){if(a||(a=c===l))return cs}),a))||(e[r]=t);var o,l,a}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=De({},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,r){if(fe(e)){F(t)&&(t="None"),this.expire_days=F(r)?this.default_expiry:r;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(fe(e)){this.expire_days=F(t)?this.default_expiry:t;var r=!1;if(K(e,(n,s)=>{e.hasOwnProperty(s)&&this.props[s]!==n&&(this.props[s]=n,r=!0)}),r)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=oe.campaignParams(this.config.custom_campaign_params);Hi(ds(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(oe.searchInfo())}update_referrer_info(){this.register_once(oe.referrerInfo(),void 0)}set_initial_person_info(){this.props[ya]||this.props[ba]||this.register_once({[wa]:oe.initialPersonInfo()},void 0)}get_referrer_info(){return ds({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};K([ba,ya],n=>{var s=this.props[n];s&&K(s,function(o,l){e["$initial_"+pa(l)]=o})});var t=this.props[wa];if(t){var r=oe.initialPersonPropsFromInfo(t);De(e,r)}return e}safe_merge(e){return K(this.props,function(t,r){r in e||(e[r]=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 r=this.buildStorage(e),n=this.props;this.clear(),this.storage=r,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 r=this.props[Lr]||{};r[e]=t,this.props[Lr]=r,this.save()}remove_event_timer(e){var t=(this.props[Lr]||{})[e];return F(t)||(delete this.props[Lr][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function _s(i){var e,t;return((e=JSON.stringify(i,(t=[],function(r,n){if(fe(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 Aa(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(i.size>=e&&i.data.length>1){var t=Math.floor(i.data.length/2),r=i.data.slice(0,t),n=i.data.slice(t);return[Aa({size:_s(r),data:r,sessionId:i.sessionId,windowId:i.windowId}),Aa({size:_s(n),data:n,sessionId:i.sessionId,windowId:i.windowId})].flatMap(s=>s)}return[i]}var St=(i=>(i[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i))(St||{}),at=(i=>(i[i.Mutation=0]="Mutation",i[i.MouseMove=1]="MouseMove",i[i.MouseInteraction=2]="MouseInteraction",i[i.Scroll=3]="Scroll",i[i.ViewportResize=4]="ViewportResize",i[i.Input=5]="Input",i[i.TouchMove=6]="TouchMove",i[i.MediaInteraction=7]="MediaInteraction",i[i.StyleSheetRule=8]="StyleSheetRule",i[i.CanvasMutation=9]="CanvasMutation",i[i.Font=10]="Font",i[i.Log=11]="Log",i[i.Drag=12]="Drag",i[i.StyleDeclaration=13]="StyleDeclaration",i[i.Selection=14]="Selection",i[i.AdoptedStyleSheet=15]="AdoptedStyleSheet",i[i.CustomElement=16]="CustomElement",i))(at||{});function sd(i){var e;return i.id===jd||!((e=i.closest)===null||e===void 0||!e.call(i,".toolbar-global-fade-container"))}function Ps(i){return!!i&&i.nodeType===1}function Ht(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function rp(i){return!!i&&i.nodeType===3}function np(i){return!!i&&i.nodeType===11}function yl(i){return i?Ts(i).split(/\s+/):[]}function od(i){var e=v?.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function ys(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return yl(e)}function sp(i){return ee(i)?null:Ts(i).split(/(\s+)/).filter(e=>Zi(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Rs(i){var e="";return Pa(i)&&!lp(i)&&i.childNodes&&i.childNodes.length&&K(i.childNodes,function(t){var r;rp(t)&&t.textContent&&(e+=(r=sp(t.textContent))!==null&&r!==void 0?r:"")}),Ts(e)}function op(i){return F(i.target)?i.srcElement||null:(e=i.target)!==null&&e!==void 0&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var Ta=["a","button","form","input","select","textarea","label"];function ap(i){var e=i.parentNode;return!(!e||!Ps(e))&&e}function qf(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!v||!i||Ht(i,"html")||!Ps(i)||t!=null&&t.url_allowlist&&!od(t.url_allowlist)||t!=null&&t.url_ignorelist&&od(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=[i],a=!0,c=i;c.parentNode&&!Ht(c,"body");)if(np(c.parentNode))l.push(c.parentNode.host),c=c.parentNode.host;else{if(!(a=ap(c)))break;if(r||Ta.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{var d=v.getComputedStyle(a);d&&d.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(a),c=a}if(!function(h,g){var m=g?.element_allowlist;if(F(m))return!0;var x=function(A){if(m.some(R=>A.tagName.toLowerCase()===R))return{v:!0}};for(var S of h){var _=x(S);if(typeof _=="object")return _.v}return!1}(l,t)||!function(h,g){var m=g?.css_selector_allowlist;if(F(m))return!0;var x=function(A){if(m.some(R=>A.matches(R)))return{v:!0}};for(var S of h){var _=x(S);if(typeof _=="object")return _.v}return!1}(l,t))return!1;var u=v.getComputedStyle(i);if(u&&u.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=i.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&&(Ta.indexOf(p)>-1||i.getAttribute("contenteditable")==="true")}}function Pa(i){for(var e=i;e.parentNode&&!Ht(e,"body");e=e.parentNode){var t=ys(e);if(W(t,"ph-sensitive")||W(t,"ph-no-capture"))return!1}if(W(ys(i),"ph-include"))return!0;var r=i.type||"";if(Ce(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=i.name||i.id||"";return!(Ce(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 lp(i){return!!(Ht(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Ht(i,"select")||Ht(i,"textarea")||i.getAttribute("contenteditable")==="true")}var up="(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})",Bf=new RegExp("^(?:".concat(up,")$")),Hf=new RegExp(up),cp="\\d{3}-?\\d{2}-?\\d{4}",zf=new RegExp("^(".concat(cp,")$")),Wf=new RegExp("(".concat(cp,")"));function Zi(i){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(ee(i)||Ce(i)&&(i=Ts(i),(e?Bf:Hf).test((i||"").replace(/[- ]/g,""))||(e?zf:Wf).test(i)))}function dp(i){var e=Rs(i);return Zi(e="".concat(e," ").concat(pp(i)).trim())?e:""}function pp(i){var e="";return i&&i.childNodes&&i.childNodes.length&&K(i.childNodes,function(t){var r;if(t&&((r=t.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var n=Rs(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(pp(t)).trim())}catch(s){D.error("[AutoCapture]",s)}}),e}function Vf(i){return function(e){var t=e.map(r=>{var n,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))o+=".".concat(l.replace(/"/g,""));var a=b(b(b(b({},r.text?{text:r.text}:{}),{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),c={};return as(a).sort((d,u)=>{var[p]=d,[h]=u;return p.localeCompare(h)}).forEach(d=>{var[u,p]=d;return c[ad(u.toString())]=ad(p.toString())}),o+=":",o+=as(a).map(d=>{var[u,p]=d;return"".concat(u,'="').concat(p,'"')}).join("")});return t.join(";")}(function(e){return e.map(t=>{var r,n,s={text:(r=t.$el_text)===null||r===void 0?void 0:r.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:Gf(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return as(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,a]=o;return s.attributes[l]=a}),s})}(i))}function ad(i){return i.replace(/"|\\"/g,'\\"')}function Gf(i){var e=i.attr__class;return e?ce(e)?e:yl(e):void 0}var Ra="[SessionRecording]",Oa="redacted",is={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:i=>i,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},Jf=["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"],Xf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Yf=["/s/","/e/","/i/"];function ld(i,e,t,r){if(ee(i))return i;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(i);return Ce(n)&&(n=parseInt(n)),n>t?Ra+" ".concat(r," body too large to record (").concat(n," bytes)"):i}function ud(i,e){if(ee(i))return i;var t=i;return Zi(t,!1)||(t=Ra+" "+e+" body "+Oa),K(Xf,r=>{var n,s;(n=t)!==null&&n!==void 0&&n.length&&((s=t)===null||s===void 0?void 0:s.indexOf(r))!==-1&&(t=Ra+" "+e+" body "+Oa+" as might contain: "+r)}),t}var Kf=(i,e)=>{var t,r,n,s={payloadSizeLimitBytes:is.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...is.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...is.payloadHostDenyList]},o=i.session_recording.recordHeaders!==!1&&e.recordHeaders,l=i.session_recording.recordBody!==!1&&e.recordBody,a=i.capture_performance!==!1&&e.recordPerformance,c=(t=s,n=Math.min(1e6,(r=t.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),p=>(p!=null&&p.requestBody&&(p.requestBody=ld(p.requestBody,p.requestHeaders,n,"Request")),p!=null&&p.responseBody&&(p.responseBody=ld(p.responseBody,p.responseHeaders,n,"Response")),p)),d=p=>{return c(((m,x)=>{var S,_=Gi(m.name),A=x.indexOf("http")===0?(S=Gi(x))===null||S===void 0?void 0:S.pathname:x;A==="/"&&(A="");var R=_?.pathname.replace(A||"","");if(!(_&&R&&Yf.some(q=>R.indexOf(q)===0)))return m})((g=(h=p).requestHeaders,ee(g)||K(Object.keys(g??{}),m=>{Jf.includes(m.toLowerCase())&&(g[m]=Oa)}),h),i.api_host));var h,g},u=Qe(i.session_recording.maskNetworkRequestFn);return u&&Qe(i.session_recording.maskCapturedNetworkRequestFn)&&D.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(i.session_recording.maskCapturedNetworkRequestFn=p=>{var h=i.session_recording.maskNetworkRequestFn({url:p.name});return b(b({},p),{},{name:h?.url})}),s.maskRequestFn=Qe(i.session_recording.maskCapturedNetworkRequestFn)?p=>{var h,g,m,x=d(p);return x&&(h=(g=(m=i.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,x))!==null&&h!==void 0?h:void 0}:p=>function(h){if(!F(h))return h.requestBody=ud(h.requestBody,"Request"),h.responseBody=ud(h.responseBody,"Response"),h}(d(p)),b(b(b({},is),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function ht(i,e,t,r,n){return e>t&&(D.warn("min cannot be greater than max."),e=t),Je(i)?i>t?(r&&D.warn(r+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(r&&D.warn(r+" cannot be less than min: "+e+". Using min value instead."),e):i:(r&&D.warn(r+" must be a number. using max or fallback. max: "+t+", fallback: "+n),ht(n||t,e,t,r))}var Fa=class{constructor(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,"bucketSize",100),C(this,"refillRate",10),C(this,"mutationBuckets",{}),C(this,"loggedTracker",{}),C(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]})}),C(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]}),C(this,"numberOfChanges",s=>{var o,l,a,c,d,u,p,h;return((o=(l=s.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((a=(c=s.attributes)===null||c===void 0?void 0:c.length)!==null&&a!==void 0?a:0)+((d=(u=s.texts)===null||u===void 0?void 0:u.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)}),C(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(c=>{var d,u,p,[h,g]=this.getNodeOrRelevantParent(c.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,(u=(p=this.options).onBlockedNode)===null||u===void 0||u.call(p,h,g))),c)}));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((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},tt=Uint8Array,Le=Uint16Array,Qi=Uint32Array,bl=new tt([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]),wl=new tt([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]),cd=new tt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hp=function(i,e){for(var t=new Le(31),r=0;r<31;++r)t[r]=e+=1<<i[r-1];var n=new Qi(t[30]);for(r=1;r<30;++r)for(var s=t[r];s<t[r+1];++s)n[s]=s-t[r]<<5|r;return[t,n]},fp=hp(bl,2),Zf=fp[0],Ma=fp[1];Zf[28]=258,Ma[258]=28;for(Da=hp(wl,0)[1],bs=new Le(32768),te=0;te<32768;++te)Dt=(43690&te)>>>1|(21845&te)<<1,Dt=(61680&(Dt=(52428&Dt)>>>2|(13107&Dt)<<2))>>>4|(3855&Dt)<<4,bs[te]=((65280&Dt)>>>8|(255&Dt)<<8)>>>1;var Dt,Da,bs,te,qr=function(i,e,t){for(var r=i.length,n=0,s=new Le(e);n<r;++n)++s[i[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<r;++n)if(i[n])for(var c=n<<4|i[n],d=e-i[n],u=l[i[n]-1]++<<d,p=u|(1<<d)-1;u<=p;++u)o[bs[u]>>>a]=c}else for(o=new Le(r),n=0;n<r;++n)o[n]=bs[l[i[n]-1]++]>>>15-i[n];return o},mi=new tt(288);for(te=0;te<144;++te)mi[te]=8;for(te=144;te<256;++te)mi[te]=9;for(te=256;te<280;++te)mi[te]=7;for(te=280;te<288;++te)mi[te]=8;var ws=new tt(32);for(te=0;te<32;++te)ws[te]=5;var Qf=qr(mi,9,0),eg=qr(ws,5,0),gp=function(i){return(i/8>>0)+(7&i&&1)},vp=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var r=new(i instanceof Le?Le:i instanceof Qi?Qi:tt)(t-e);return r.set(i.subarray(e,t)),r},xt=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8},Or=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8,i[r+2]|=t>>>16},sa=function(i,e){for(var t=[],r=0;r<i.length;++r)i[r]&&t.push({s:r,f:i[r]});var n=t.length,s=t.slice();if(!n)return[new tt(0),0];if(n==1){var o=new tt(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(q,X){return q.f-X.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],c=0,d=1,u=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};d!=n-1;)l=t[t[c].f<t[u].f?c++:u++],a=t[c!=d&&t[c].f<t[u].f?c++:u++],t[d++]={s:-1,f:l.f+a.f,l,r:a};var p=s[0].s;for(r=1;r<n;++r)s[r].s>p&&(p=s[r].s);var h=new Le(p+1),g=La(t[d-1],h,0);if(g>e){r=0;var m=0,x=g-e,S=1<<x;for(s.sort(function(q,X){return h[X.s]-h[q.s]||q.f-X.f});r<n;++r){var _=s[r].s;if(!(h[_]>e))break;m+=S-(1<<g-h[_]),h[_]=e}for(m>>>=x;m>0;){var A=s[r].s;h[A]<e?m-=1<<e-h[A]++-1:++r}for(;r>=0&&m;--r){var R=s[r].s;h[R]==e&&(--h[R],++m)}g=e}return[new tt(h),g]},La=function(i,e,t){return i.s==-1?Math.max(La(i.l,e,t+1),La(i.r,e,t+1)):e[i.s]=t},dd=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Le(++e),r=0,n=i[0],s=1,o=function(a){t[r++]=a},l=1;l<=e;++l)if(i[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=i[l]}return[t.subarray(0,r),e]},Fr=function(i,e){for(var t=0,r=0;r<e.length;++r)t+=i[r]*e[r];return t},Na=function(i,e,t){var r=t.length,n=gp(e+2);i[n]=255&r,i[n+1]=r>>>8,i[n+2]=255^i[n],i[n+3]=255^i[n+1];for(var s=0;s<r;++s)i[n+s+4]=t[s];return 8*(n+4+r)},pd=function(i,e,t,r,n,s,o,l,a,c,d){xt(e,d++,t),++n[256];for(var u=sa(n,15),p=u[0],h=u[1],g=sa(s,15),m=g[0],x=g[1],S=dd(p),_=S[0],A=S[1],R=dd(m),q=R[0],X=R[1],z=new Le(19),P=0;P<_.length;++P)z[31&_[P]]++;for(P=0;P<q.length;++P)z[31&q[P]]++;for(var B=sa(z,7),V=B[0],Re=B[1],_e=19;_e>4&&!V[cd[_e-1]];--_e);var Ye,Y,ie,pe,Ue=c+5<<3,We=Fr(n,mi)+Fr(s,ws)+o,le=Fr(n,p)+Fr(s,m)+o+14+3*_e+Fr(z,V)+(2*z[16]+3*z[17]+7*z[18]);if(Ue<=We&&Ue<=le)return Na(e,d,i.subarray(a,a+c));if(xt(e,d,1+(le<We)),d+=2,le<We){Ye=qr(p,h,0),Y=p,ie=qr(m,x,0),pe=m;var $e=qr(V,Re,0);for(xt(e,d,A-257),xt(e,d+5,X-1),xt(e,d+10,_e-4),d+=14,P=0;P<_e;++P)xt(e,d+3*P,V[cd[P]]);d+=3*_e;for(var Ie=[_,q],se=0;se<2;++se){var ye=Ie[se];for(P=0;P<ye.length;++P){var Oe=31&ye[P];xt(e,d,$e[Oe]),d+=V[Oe],Oe>15&&(xt(e,d,ye[P]>>>5&127),d+=ye[P]>>>12)}}}else Ye=Qf,Y=mi,ie=eg,pe=ws;for(P=0;P<l;++P)if(r[P]>255){Oe=r[P]>>>18&31,Or(e,d,Ye[Oe+257]),d+=Y[Oe+257],Oe>7&&(xt(e,d,r[P]>>>23&31),d+=bl[Oe]);var yi=31&r[P];Or(e,d,ie[yi]),d+=pe[yi],yi>3&&(Or(e,d,r[P]>>>5&8191),d+=wl[yi])}else Or(e,d,Ye[r[P]]),d+=Y[r[P]];return Or(e,d,Ye[256]),d+Y[256]},tg=new Qi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ig=function(){for(var i=new Qi(256),e=0;e<256;++e){for(var t=e,r=9;--r;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),rg=function(){var i=4294967295;return{p:function(e){for(var t=i,r=0;r<e.length;++r)t=ig[255&t^e[r]]^t>>>8;i=t},d:function(){return 4294967295^i}}},ng=function(i,e,t,r,n){return function(s,o,l,a,c,d){var u=s.length,p=new tt(a+u+5*(1+Math.floor(u/7e3))+c),h=p.subarray(a,p.length-c),g=0;if(!o||u<8)for(var m=0;m<=u;m+=65535){var x=m+65535;x<u?g=Na(h,g,s.subarray(m,x)):(h[m]=d,g=Na(h,g,s.subarray(m,u)))}else{for(var S=tg[o-1],_=S>>>13,A=8191&S,R=(1<<l)-1,q=new Le(32768),X=new Le(R+1),z=Math.ceil(l/3),P=2*z,B=function(qs){return(s[qs]^s[qs+1]<<z^s[qs+2]<<P)&R},V=new Qi(25e3),Re=new Le(288),_e=new Le(32),Ye=0,Y=0,ie=(m=0,0),pe=0,Ue=0;m<u;++m){var We=B(m),le=32767&m,$e=X[We];if(q[le]=$e,X[We]=le,pe<=m){var Ie=u-m;if((Ye>7e3||ie>24576)&&Ie>423){g=pd(s,h,0,V,Re,_e,Y,ie,Ue,m-Ue,g),ie=Ye=Y=0,Ue=m;for(var se=0;se<286;++se)Re[se]=0;for(se=0;se<30;++se)_e[se]=0}var ye=2,Oe=0,yi=A,It=le-$e&32767;if(Ie>2&&We==B(m-It))for(var Gp=Math.min(_,Ie)-1,Jp=Math.min(32767,m),Xp=Math.min(258,Ie);It<=Jp&&--yi&&le!=$e;){if(s[m+ye]==s[m+ye-It]){for(var At=0;At<Xp&&s[m+At]==s[m+At-It];++At);if(At>ye){if(ye=At,Oe=It,At>Gp)break;var Yp=Math.min(It,At-2),Fl=0;for(se=0;se<Yp;++se){var js=m-It+se+32768&32767,Ml=js-q[js]+32768&32767;Ml>Fl&&(Fl=Ml,$e=js)}}}It+=(le=$e)-($e=q[le])+32768&32767}if(Oe){V[ie++]=268435456|Ma[ye]<<18|Da[Oe];var Dl=31&Ma[ye],Ll=31&Da[Oe];Y+=bl[Dl]+wl[Ll],++Re[257+Dl],++_e[Ll],pe=m+ye,++Ye}else V[ie++]=s[m],++Re[s[m]]}}g=pd(s,h,d,V,Re,_e,Y,ie,Ue,m-Ue,g)}return vp(p,0,a+gp(g)+c)}(i,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+e.mem,t,r,!n)},Ua=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},sg=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&Ua(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var r=0;r<=t.length;++r)i[r+10]=t.charCodeAt(r)}},og=function(i){return 10+(i.filename&&i.filename.length+1||0)};function mp(i,e){e===void 0&&(e={});var t=rg(),r=i.length;t.p(i);var n=ng(i,e,og(e),8),s=n.length;return sg(n,e),Ua(n,s-8,t.d()),Ua(n,s-4,r),n}function _p(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var r=new tt(i.length+(i.length>>>1)),n=0,s=function(c){r[n++]=c},o=0;o<t;++o){if(n+5>r.length){var l=new tt(n+8+(t-o<<1));l.set(r),r=l}var a=i.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&i.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 vp(r,0,n)}var ls="[SessionRecording]",Pe=ze(ls),ag=3e5,lg=[at.MouseMove,at.MouseInteraction,at.Scroll,at.ViewportResize,at.Input,at.TouchMove,at.MediaInteraction,at.Drag],hd=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1});function ci(i){return function(e,t){for(var r="",n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=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,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(mp(_p(JSON.stringify(i))),!0)}function fd(i){return i.type===St.Custom&&i.data.tag==="sessionIdle"}function gd(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}var ja=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return j==null||(e=j.__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(ls+" 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:ag}get isSampled(){var e=this.instance.get_property(Nr);return fi(e)?e:null}get sessionDuration(){var e,t,r=(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 r?r.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(fa),t=!this.instance.config.disable_session_recording;return v&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(Wc),t=this.instance.config.enable_recording_console_log;return t??e}get canvasRecording(){var e,t,r,n,s,o,l=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(Gc),c=(e=(t=l?.recordCanvas)!==null&&t!==void 0?t:a?.enabled)!==null&&e!==void 0&&e,d=(r=(n=l?.canvasFps)!==null&&n!==void 0?n:a?.fps)!==null&&r!==void 0?r:0,u=(s=(o=l?.canvasQuality)!==null&&o!==void 0?o:a?.quality)!==null&&s!==void 0?s:0;return{enabled:c,fps:ht(d,0,12,"canvas recording fps"),quality:ht(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(Vc),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||r?.recordHeaders,o=n?.recordBody||r?.recordBody,l=fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(fi(l)?l:r?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(Jc);return Je(e)?e:null}get minimumDuration(){var e=this.instance.get_property(Xc);return Je(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":ee(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":fi(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(ea))===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(ta))===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(C(this,"queuedRRWebEvents",[]),C(this,"isIdle",!1),C(this,"_linkedFlagSeen",!1),C(this,"_lastActivityTimestamp",Date.now()),C(this,"_linkedFlag",null),C(this,"_removePageViewCaptureHook",void 0),C(this,"_onSessionIdListener",void 0),C(this,"_persistDecideOnSessionListener",void 0),C(this,"_samplingSessionListener",void 0),C(this,"_urlTriggers",[]),C(this,"_urlBlocklist",[]),C(this,"_urlBlocked",!1),C(this,"_eventTriggers",[]),C(this,"_removeEventTriggerCaptureHook",void 0),C(this,"_forceAllowLocalhostNetworkCapture",!1),C(this,"_onBeforeUnload",()=>{this._flushBuffer()}),C(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),C(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),C(this,"_onVisibilityChange",()=>{if(O!=null&&O.visibilityState){var n="window "+O.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Pe.error("started without valid sessionManager"),new Error(ls+" started without valid sessionManager. This is a bug.");var{sessionId:t,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Pe.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(),ee(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var r=t!=null&&t.properties.$current_url?this._maskUrl(t?.properties.$current_url):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(n){Pe.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((t,r,n)=>{var s,o,l,a;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:t,windowId:r,changeReason:n}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(ta),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(ea))}))):this.stopRecording()}stopRecording(){var e,t,r,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,(r=this._onSessionIdListener)===null||r===void 0||r.call(this),this._onSessionIdListener=void 0,(n=this._samplingSessionListener)===null||n===void 0||n.call(this),this._samplingSessionListener=void 0,Pe.info("stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if(Je(n)){var s,o=this.isSampled,l=r||!fi(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):Pe.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({[Nr]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[Nr]:null})}}onRemoteConfig(e){var t,r,n,s,o,l;if(this._persistRemoteConfig(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(r=e.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(l=e.sessionRecording)===null||l===void 0?void 0:l.endpoint),this._setupSampling(),!ee(this._linkedFlag)&&!this._linkedFlagSeen){var a=Ce(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,c=Ce(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((d,u)=>{var p=fe(u)&&a in u,h=c?u[a]===c:p;h&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:c}),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(){Je(this.sampleRate)&&ee(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistRemoteConfig(e){if(this.instance.persistence){var t,r=this.instance.persistence,n=()=>{var s,o,l,a,c,d,u,p,h=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,g=ee(h)?null:parseFloat(h),m=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;r.register({[fa]:!!e.sessionRecording,[Wc]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[Vc]:b({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[Gc]:{enabled:(c=e.sessionRecording)===null||c===void 0?void 0:c.recordCanvas,fps:(d=e.sessionRecording)===null||d===void 0?void 0:d.canvasFps,quality:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasQuality},[Jc]:g,[Xc]:F(m)?null:m,[Yc]:(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,r=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:r,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,r;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=j.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,this.scriptName,n=>{if(n)return Pe.error("could not load recorder",n);this._onScriptLoaded()}),Pe.info("starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,r;return((e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0||(r=t.get_property(Yc))===null||r===void 0?void 0:r.script)||"recorder"}isInteractiveEvent(e){var t;return e.type===3&&lg.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 r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!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")):r&&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}):Pe.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(hd(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(hd(()=>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},r=this.instance.config.session_recording;for(var[n,s]of Object.entries(r||{}))n in t&&(n==="maskInputOptions"?t.maskInputOptions=b({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 Fa(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(l,a)=>{var c="Too many mutations on node '".concat(l,"'. Rate limiting. This could be due to SVG animations or something similar");Pe.info(c,{node:a}),this.log(ls+" "+c,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(b({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 Pe.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,r,n,s=[],o=(e=j.__PosthogExtensions__)===null||e===void 0||(t=e.rrwebPlugins)===null||t===void 0?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var l=(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Qe(l)&&(!If.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(Kf(this.instance.config,this.networkPayloadCapture))):Pe.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&fe(e)){if(e.type===St.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(u){return u.type===St.Custom&&u.data.tag==="recording paused"}(e)){e.type===St.FullSnapshot&&this._scheduleFullSnapshot(),e.type===St.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var s=function(u){var p=u;if(p&&fe(p)&&p.type===6&&fe(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,u}return u}(n);if(this._updateWindowAndSessionIds(s),!this.isIdle||fd(s)){if(fd(s)){var o=s.data.payload;if(o){var l=o.lastActivityTimestamp,a=o.threshold;s.timestamp=l+a}}var c=(t=this.instance.config.session_recording.compress_events)===null||t===void 0||t?function(u){if(_s(u)<1024)return u;try{if(u.type===St.FullSnapshot)return b(b({},u),{},{data:ci(u.data),cv:"2024-10"});if(u.type===St.IncrementalSnapshot&&u.data.source===at.Mutation)return b(b({},u),{},{cv:"2024-10",data:b(b({},u.data),{},{texts:ci(u.data.texts),attributes:ci(u.data.attributes),removes:ci(u.data.removes),adds:ci(u.data.adds)})});if(u.type===St.IncrementalSnapshot&&u.data.source===at.StyleSheetRule)return b(b({},u),{},{cv:"2024-10",data:b(b({},u.data),{},{adds:ci(u.data.adds),removes:ci(u.data.removes)})})}catch(p){Pe.error("could not compress event - will use uncompressed event",p)}return u}(s):s,d={$snapshot_bytes:_s(c),$snapshot_data:c,$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 r,n={url:e};return(r=n=t.maskNetworkRequestFn(n))===null||r===void 0?void 0:r.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,r=Je(t)&&t>=0,n=Je(e)&&r&&t<e;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Aa(this.buffer).forEach(s=>{this._captureSnapshot({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+r>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",r=gd(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),gd(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,r;this.triggerStatus==="trigger_pending"&&((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[e==="url"?ea:ta]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;this.status!=="paused"&&(this._urlBlocked=!0,O==null||(e=O.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout(()=>{this._flushBuffer()},100),Pe.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;this.status==="paused"&&(this._urlBlocked=!1,O==null||(e=O.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.remove("ph-no-capture"),this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Pe.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&ee(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(t){Pe.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;(e=this.instance.persistence)===null||e===void 0||e.register({[Nr]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Pe.info(e.replace("_"," "),t),W(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},Lt=ze("[Decide]"),qa=class{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}_loadRemoteConfigJs(e){var t,r,n;(t=j.__PosthogExtensions__)!==null&&t!==void 0&&t.loadExternalDependency?(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"remote-config",()=>e(j._POSTHOG_CONFIG)):(Lt.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)}})}call(){var e=!!this.instance.config.advanced_disable_decide;if(e||this.instance.featureFlags.resetRequestQueue(),this.instance.config.__preview_remote_config)return j._POSTHOG_CONFIG?(Lt.info("Using preloaded remote config",j._POSTHOG_CONFIG),void this.onRemoteConfig(j._POSTHOG_CONFIG)):e?void Lt.warn("Remote config is disabled. Falling back to local config."):void this._loadRemoteConfigJs(r=>{if(!r)return Lt.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(n=>{this.onRemoteConfig(n)});this.onRemoteConfig(r)});if(!e){var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Wi),group_properties:this.instance.get_property(Ut),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 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:lt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:r=>this.parseDecideResponse(r.json)})}}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},t),!t)return O&&O.body?void this.instance._onRemoteConfig(e):(Lt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500));Lt.error("Failed to fetch feature flags from PostHog.")}onRemoteConfig(e){if(e){if(!O||!O.body)return Lt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.onRemoteConfig(e)},500);this.instance._onRemoteConfig(e),e.hasFeatureFlags!==!1&&(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags.reloadFeatureFlags())}else Lt.error("Failed to fetch remote config from PostHog.")}},Et,ug=v!=null&&v.location?vs(v.location.hash,"__posthog")||vs(location.hash,"state"):null,vd="_postHogToolbarParams";(function(i){i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED"})(Et||(Et={}));var Ba=class{constructor(e){this.instance=e}setToolbarState(e){j.ph_toolbar_state=e}getToolbarState(){var e;return(e=j.ph_toolbar_state)!==null&&e!==void 0?e:Et.UNINITIALIZED}maybeLoadToolbar(){var e,t,r=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||!O)return!1;r=(e=r)!==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=ug||vs(r.hash,"__posthog")||vs(r.hash,"state"),a=l?jc(()=>JSON.parse(atob(decodeURIComponent(l))))||jc(()=>JSON.parse(decodeURIComponent(l))):null;return a&&a.action==="ph_authorize"?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?r.hash=a.desiredHash:s?s.replaceState(s.state,"",r.pathname+r.search):r.hash="")):((o=JSON.parse(n.getItem(vd)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){(j.ph_load_toolbar||j.ph_load_editor)(e,this.instance)}loadToolbar(e){var t=!(O==null||!O.getElementById(jd));if(!v||t)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=b(b({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(v.localStorage.setItem(vd,JSON.stringify(b(b({},n),{},{source:void 0}))),this.getToolbarState()===Et.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===Et.UNINITIALIZED){var s,o;this.setToolbarState(Et.LOADING),(s=j.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return D.error("[Toolbar] Failed to load",l),void this.setToolbarState(Et.UNINITIALIZED);this.setToolbarState(Et.LOADED),this._callLoadToolbar(n)}),Ct(v,"turbolinks:load",()=>{this.setToolbarState(Et.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,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,r)}},Ha=class{constructor(e){C(this,"isPaused",!0),C(this,"queue",[]),C(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),r=[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)];r.map(n=>{this.sendRequest(b(b({},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(),r=function(s){var o=t[s],l=new Date().getTime();o.data&&ce(o.data)&&K(o.data,a=>{a.offset=Math.abs(a.timestamp-l),delete a.timestamp}),e.sendRequest(o)};for(var n in t)r(n)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return K(this.queue,t=>{var r,n=t,s=(n?n.batchKey:null)||n.url;F(e[s])&&(e[s]=b(b({},n),{},{data:[]})),(r=e[s].data)===null||r===void 0||r.push(n.data)}),this.queue=[],e}},cg=!!da||!!ca,md="text/plain",xs=(i,e)=>{var[t,r]=i.split("?"),n=b({},e);r?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=Af(n);return s=s?(r?r+"&":"")+s:r,"".concat(t,"?").concat(s)},rs=(i,e)=>JSON.stringify(i,(t,r)=>typeof r=="bigint"?r.toString():r,e),oa=i=>{var{data:e,compression:t}=i;if(e){if(t===lt.GZipJS){var r=mp(_p(rs(e)),{mtime:0}),n=new Blob([r],{type:md});return{contentType:md,body:n,estimatedSize:n.size}}if(t===lt.Base64){var s=function(a){var c,d,u,p,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,x=0,S="",_=[];if(!a)return a;a=bf(a);do c=(h=a.charCodeAt(m++)<<16|a.charCodeAt(m++)<<8|a.charCodeAt(m++))>>18&63,d=h>>12&63,u=h>>6&63,p=63&h,_[x++]=g.charAt(c)+g.charAt(d)+g.charAt(u)+g.charAt(p);while(m<a.length);switch(S=_.join(""),a.length%3){case 1:S=S.slice(0,-2)+"==";break;case 2:S=S.slice(0,-1)+"="}return S}(rs(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:rs(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=rs(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},Br=[];da&&Br.push({transport:"XHR",method:i=>{var e,t=new da;t.open(i.method||"GET",i.url,!0);var{contentType:r,body:n}=(e=oa(i))!==null&&e!==void 0?e:{};K(i.headers,function(s,o){t.setRequestHeader(o,s)}),r&&t.setRequestHeader("Content-Type",r),i.timeout&&(t.timeout=i.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=i.callback)===null||s===void 0||s.call(i,o)}},t.send(n)}}),ca&&Br.push({transport:"fetch",method:i=>{var e,t,{contentType:r,body:n,estimatedSize:s}=(e=oa(i))!==null&&e!==void 0?e:{},o=new Headers;K(i.headers,function(d,u){o.append(u,d)}),r&&o.append("Content-Type",r);var l=i.url,a=null;if(Nc){var c=new Nc;a={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}ca(l,{method:i?.method||"GET",headers:o,keepalive:i.method==="POST"&&(s||0)<52428.8,body:n,signal:(t=a)===null||t===void 0?void 0:t.signal}).then(d=>d.text().then(u=>{var p,h={statusCode:d.status,text:u};if(d.status===200)try{h.json=JSON.parse(u)}catch(g){D.error(g)}(p=i.callback)===null||p===void 0||p.call(i,h)})).catch(d=>{var u;D.error(d),(u=i.callback)===null||u===void 0||u.call(i,{statusCode:0,text:d})}).finally(()=>a?clearTimeout(a.timeout):null)}}),Xe!=null&&Xe.sendBeacon&&Br.push({transport:"sendBeacon",method:i=>{var e=xs(i.url,{beacon:"1"});try{var t,{contentType:r,body:n}=(t=oa(i))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:r}):n;Xe.sendBeacon(e,s)}catch{}}});var dg=["retriesPerformedSoFar"],za=class{constructor(e){C(this,"isPolling",!1),C(this,"pollIntervalMs",3e3),C(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,r=Rd(e,dg);Je(t)&&t>0&&(r.url=xs(r.url,{retry_count:t})),this.instance._send_request(b(b({},r),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(b({retriesPerformedSoFar:t},r)):(s=r.callback)===null||s===void 0||s.call(r,n)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(o){var l=3e3*Math.pow(2,o),a=l/2,c=Math.min(18e5,l),d=(Math.random()-.5)*(c-a);return Math.ceil(c+d)}(t),n=Date.now()+r;this.queue.push({retryAt:n,requestOptions:e});var s="Enqueued failed request for retry in ".concat(r);navigator.onLine||(s+=" (Browser is offline)"),D.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=[],r=this.queue.filter(s=>s.retryAt<e||(t.push(s),!1));if(this.queue=t,r.length>0)for(var{requestOptions:n}of r)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(b(b({},e),{},{transport:"sendBeacon"}))}catch(t){D.error(t)}this.queue=[]}},gi,_d=ze("[SessionId]"),Wa=class{constructor(e,t,r){var n;if(C(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");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=r||qt;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._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var l=Ee.parse(this._window_id_storage_key),a=Ee.parse(this._primary_window_exists_storage_key);l&&!a?this._windowId=l:Ee.remove(this._window_id_storage_key),Ee.set(this._primary_window_exists_storage_key,!0)}if((n=this.config.bootstrap)!==null&&n!==void 0&&n.sessionID)try{var c=(d=>{var u=d.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(d){_d.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&&Ee.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ee.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ee.parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[ps]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[ps];return ce(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){v?.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&Ee.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)||new Date().getTime(),[r,n,s]=this._getSessionId(),o=this._getWindowId(),l=Je(s)&&s>0&&Math.abs(t-s)>864e5,a=!1,c=!n,d=!e&&Math.abs(t-r)>this.sessionTimeoutMs;c||d||l?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),_d.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),s=t,a=!0):o||(o=this._windowIdGenerator(),a=!0);var u=r===0||!e||l?t:r,p=s===0?new Date().getTime():s;return this._setWindowId(o),this._setSessionId(n,u,p),a&&this._sessionIdChangedHandlers.forEach(h=>h(n,o,a?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:a?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}};(function(i){i.US="us",i.EU="eu",i.CUSTOM="custom"})(gi||(gi={}));var yd="i.posthog.com",Va=class{constructor(e){C(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(yd),".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]=gi.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=gi.EU:this._regionCache[this.apiHost]=gi.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===gi.CUSTOM)return this.apiHost+t;var r=yd+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}},yp="posthog-js";function bp(i){var{organization:e,projectId:t,prefix:r,severityAllowList:n=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=>{var o,l,a,c,d;if(!(n==="*"||n.includes(s.level))||!i.__loaded)return s;s.tags||(s.tags={});var u=i.requestRouter.endpointFor("ui","/project/".concat(i.config.token,"/person/").concat(i.get_distinct_id()));s.tags["PostHog Person URL"]=u,i.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=i.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:u,$exception_level:s.level,$exception_list:p,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((c=p[0])===null||c===void 0?void 0:c.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=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+t+"&query="+s.event_id),i.exceptions.sendExceptionEvent(h),s}}var Ga=class{constructor(e,t,r,n,s){this.name=yp,this.setupOnce=function(o){o(bp(e,{organization:t,projectId:r,prefix:n,severityAllowList:s}))}}},bd,ks,ot,aa=ze("[SegmentIntegration]");function pg(i,e){var t=i.config.segment;if(!t)return e();(function(r,n){var s=r.config.segment;if(!s)return n();var o=a=>{var c=()=>a.anonymousId()||qt();r.config.get_device_id=c,a.id()&&(r.register({distinct_id:a.id(),$device_id:c()}),r.persistence.set_property(kt,"identified")),n()},l=s.user();"then"in l&&Qe(l.then)?l.then(a=>o(a)):o(l)})(i,()=>{t.register((r=>{Promise&&Promise.resolve||aa.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===r.get_distinct_id()||(aa.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(aa.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var a=r._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")}})(i)).then(()=>{e()})})}var Ja=class{constructor(e){this._instance=e}doPageView(e){var t,r=this._previousPageViewProperties(e);return this._currentPath=(t=v?.location.pathname)!==null&&t!==void 0?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,r}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){var t=this._currentPath,r=this._prevPageviewTimestamp,n=this._instance.scrollManager.getContext();if(!r)return{};var s={};if(n){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:a,maxContentHeight:c,lastContentY:d,maxContentY:u}=n;F(o)||F(l)||F(a)||F(c)||F(d)||F(u)||(o=Math.ceil(o),l=Math.ceil(l),a=Math.ceil(a),c=Math.ceil(c),d=Math.ceil(d),u=Math.ceil(u),s={$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:o<=1?1:ht(l/o,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:o<=1?1:ht(a/o,0,1),$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:c<=1?1:ht(d/c,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:c<=1?1:ht(u/c,0,1)})}return t&&(s.$prev_pageview_pathname=t),r&&(s.$prev_pageview_duration=(e.getTime()-r.getTime())/1e3),s}};(function(i){i.Popover="popover",i.API="api",i.Widget="widget"})(bd||(bd={})),function(i){i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link"}(ks||(ks={})),function(i){i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question"}(ot||(ot={}));var Ss=class{constructor(){C(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(r=>r!==t)}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var n of this.events["*"]||[])n(e,t)}},Xa=class i{constructor(e){C(this,"_debugEventEmitter",new Ss),C(this,"checkStep",(t,r)=>this.checkStepEvent(t,r)&&this.checkStepUrl(t,r)&&this.checkStepElement(t,r)),C(this,"checkStepEvent",(t,r)=>r==null||!r.event||t?.event===r?.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((r,n)=>{this.on(r,n)})}}register(e){var t,r;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(c=>{var d;(d=this.actionEvents)===null||d===void 0||d.add(c?.event||"")})}),(r=this.instance)!==null&&r!==void 0&&r.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 r;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((r=this.actionRegistry)===null||r===void 0?void 0:r.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 r of t.steps)if(this.checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(t!=null&&t.url){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$current_url;if(!n||typeof n!="string"||!i.matchString(n,t?.url,t?.url_matching||"contains"))return!1}return!0}static matchString(e,t,r){switch(r){case"regex":return!!v&&Yi(e,t);case"exact":return t===e;case"contains":var n=i.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Yi(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&&!i.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!i.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!i.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$element_selectors;if(!n||!n.includes(t?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},Jr=class i{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(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.actions)&&((s=r.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 Xa(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(r=>{this.onAction(r)})),t.forEach(r=>{var n,s,o,l,a,c,d,u,p,h;r.conditions&&(n=r.conditions)!==null&&n!==void 0&&n.actions&&(s=r.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((l=r.conditions)===null||l===void 0||(a=l.actions)===null||a===void 0||(c=a.values)===null||c===void 0?void 0:c.length)>0&&((d=this.actionMatcher)===null||d===void 0||d.register(r.conditions.actions.values),(u=r.conditions)===null||u===void 0||(p=u.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(r.id),this.actionToSurveys.set(g.name,m||[r.id])}}))}))}setupEventBasedSurveys(e){var t;e.filter(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.events)&&((s=r.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((r,n)=>{this.onEvent(r,n)}),e.forEach(r=>{var n,s,o;(n=r.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(r.id),this.eventToSurveys.set(l.name,a||[r.id])}})}))}onEvent(e,t){var r,n,s=((r=this.instance)===null||r===void 0||(n=r.persistence)===null||n===void 0?void 0:n.props[Yn])||[];if(i.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,r,n=((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0?void 0:r.props[Yn])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,r;(t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[Yn]:[...new Set(e)]})}getSurveys(){var e,t,r=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[Yn];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};C(Jr,"SURVEY_SHOWN_EVENT_NAME","survey shown");var wp,ae,xp,hi,wd,kp,Ya,Sp,Ka={},Ep=[],hg=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xl=Array.isArray;function Bt(i,e){for(var t in e)i[t]=e[t];return i}function Cp(i){var e=i.parentNode;e&&e.removeChild(i)}function la(i,e,t,r,n){var s={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++xp,__i:-1,__u:0};return n==null&&ae.vnode!=null&&ae.vnode(s),s}function kl(i){return i.children}function us(i,e){this.props=i,this.context=e}function er(i,e){if(e==null)return i.__?er(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?er(i):null}function $p(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return $p(i)}}function Za(i){(!i.__d&&(i.__d=!0)&&hi.push(i)&&!Es.__r++||wd!==ae.debounceRendering)&&((wd=ae.debounceRendering)||kp)(Es)}function Es(){var i,e,t,r,n,s,o,l,a;for(hi.sort(Ya);i=hi.shift();)i.__d&&(e=hi.length,r=void 0,s=(n=(t=i).__v).__e,l=[],a=[],(o=t.__P)&&((r=Bt({},n)).__v=n.__v+1,ae.vnode&&ae.vnode(r),Tp(o,r,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??er(n),!!(32&n.__u),a),r.__.__k[r.__i]=r,vg(l,r,a),r.__e!=s&&$p(r)),hi.length>e&&hi.sort(Ya));Es.__r=0}function Ip(i,e,t,r,n,s,o,l,a,c,d){var u,p,h,g,m,x=r&&r.__k||Ep,S=e.length;for(t.__d=a,fg(t,e,x),a=t.__d,u=0;u<S;u++)(h=t.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(p=h.__i===-1?Ka:x[h.__i]||Ka,h.__i=u,Tp(i,h,p,n,s,o,l,a,c,d),g=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Sl(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=Ap(h,a,i):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 fg(i,e,t){var r,n,s,o,l,a=e.length,c=t.length,d=c,u=0;for(i.__k=[],r=0;r<a;r++)(n=i.__k[r]=(n=e[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?la(null,n,null,null,n):xl(n)?la(kl,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?la(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=i,n.__b=i.__b+1,l=gg(n,t,o=r+u,d),n.__i=l,s=null,l!==-1&&(d--,(s=t[l])&&(s.__u|=131072)),s==null||s.__v===null?(l==-1&&u--,typeof n.type!="function"&&(n.__u|=65536)):l!==o&&(l===o+1?u++:l>o?d>a-o?u+=l-o:u--:u=l<o&&l==o-1?l-o:0,l!==r+u&&(n.__u|=65536))):(s=t[r])&&s.key==null&&s.__e&&(s.__e==i.__d&&(i.__d=er(s)),Qa(s,s,!1),t[r]=null,d--);if(d)for(r=0;r<c;r++)(s=t[r])!=null&&!(131072&s.__u)&&(s.__e==i.__d&&(i.__d=er(s)),Qa(s,s))}function Ap(i,e,t){var r,n;if(typeof i.type=="function"){for(r=i.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=i,e=Ap(r[n],e,t));return e}return i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e),e&&e.nextSibling}function gg(i,e,t,r){var n=i.key,s=i.type,o=t-1,l=t+1,a=e[t];if(a===null||a&&n==a.key&&s===a.type)return t;if(r>(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 xd(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||hg.test(e)?t:t+"px"}function ns(i,e,t,r,n){var s;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||xd(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||xd(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in i?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+s]=t,t?r?t.u=r.u:(t.u=Date.now(),i.addEventListener(e,s?Sd:kd,s)):i.removeEventListener(e,s?Sd:kd,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 i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,t))}}function kd(i){var e=this.l[i.type+!1];if(i.t){if(i.t<=e.u)return}else i.t=Date.now();return e(ae.event?ae.event(i):i)}function Sd(i){return this.l[i.type+!0](ae.event?ae.event(i):i)}function Tp(i,e,t,r,n,s,o,l,a,c){var d,u,p,h,g,m,x,S,_,A,R,q,X,z,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=ae.__b)&&d(e);e:if(typeof B=="function")try{if(S=e.props,_=(d=B.contextType)&&r[d.__c],A=d?_?_.props.value:d.__:r,t.__c?x=(u=e.__c=t.__c).__=u.__E:("prototype"in B&&B.prototype.render?e.__c=u=new B(S,A):(e.__c=u=new us(S,A),u.constructor=B,u.render=_g),_&&_.sub(u),u.props=S,u.state||(u.state={}),u.context=A,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),B.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Bt({},u.__s)),Bt(u.__s,B.getDerivedStateFromProps(S,u.__s))),h=u.props,g=u.state,u.__v=e,p)B.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(B.getDerivedStateFromProps==null&&S!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(S,A),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(S,u.__s,A)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(u.props=S,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(V){V&&(V.__=e)}),R=0;R<u._sb.length;R++)u.__h.push(u._sb[R]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(S,u.__s,A),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,m)})}if(u.context=A,u.props=S,u.__P=i,u.__e=!1,q=ae.__r,X=0,"prototype"in B&&B.prototype.render){for(u.state=u.__s,u.__d=!1,q&&q(e),d=u.render(u.props,u.state,u.context),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[]}else do u.__d=!1,q&&q(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++X<25);u.state=u.__s,u.getChildContext!=null&&(r=Bt(Bt({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(m=u.getSnapshotBeforeUpdate(h,g)),Ip(i,xl(P=d!=null&&d.type===kl&&d.key==null?d.props.children:d)?P:[P],e,t,r,n,s,o,l,a,c),u.base=e.__e,e.__u&=-161,u.__h.length&&o.push(u),x&&(u.__E=u.__=null)}catch(V){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),ae.__e(V,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=mg(t.__e,e,t,r,n,s,o,a,c);(d=ae.diffed)&&d(e)}function vg(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)Sl(t[r],t[++r],t[++r]);ae.__c&&ae.__c(e,i),i.some(function(n){try{i=n.__h,n.__h=[],i.some(function(s){s.call(n)})}catch(s){ae.__e(s,n.__v)}})}function mg(i,e,t,r,n,s,o,l,a){var c,d,u,p,h,g,m,x=t.props,S=e.props,_=e.type;if(_==="svg"&&(n=!0),s!=null){for(c=0;c<s.length;c++)if((h=s[c])&&"setAttribute"in h==!!_&&(_?h.localName===_:h.nodeType===3)){i=h,s[c]=null;break}}if(i==null){if(_===null)return document.createTextNode(S);i=n?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,S.is&&S),s=null,l=!1}if(_===null)x===S||l&&i.data===S||(i.data=S);else{if(s=s&&wp.call(i.childNodes),x=t.props||Ka,!l&&s!=null)for(x={},c=0;c<i.attributes.length;c++)x[(h=i.attributes[c]).name]=h.value;for(c in x)h=x[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=h:c==="key"||c in S||ns(i,c,null,h,n));for(c in S)h=S[c],c=="children"?p=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?g=h:c=="checked"?m=h:c==="key"||l&&typeof h!="function"||x[c]===h||ns(i,c,h,x[c],n);if(d)l||u&&(d.__html===u.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(u&&(i.innerHTML=""),Ip(i,xl(p)?p:[p],e,t,r,n&&_!=="foreignObject",s,o,s?s[0]:t.__k&&er(t,0),l,a),s!=null)for(c=s.length;c--;)s[c]!=null&&Cp(s[c]);l||(c="value",g!==void 0&&(g!==i[c]||_==="progress"&&!g||_==="option"&&g!==x[c])&&ns(i,c,g,x[c],!1),c="checked",m!==void 0&&m!==i[c]&&ns(i,c,m,x[c],!1))}return i}function Sl(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){ae.__e(r,t)}}function Qa(i,e,t){var r,n;if(ae.unmount&&ae.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||Sl(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){ae.__e(s,e)}r.base=r.__P=null,i.__c=void 0}if(r=i.__k)for(n=0;n<r.length;n++)r[n]&&Qa(r[n],e,t||typeof i.type!="function");t||i.__e==null||Cp(i.__e),i.__=i.__e=i.__d=void 0}function _g(i,e,t){return this.constructor(i,t)}wp=Ep.slice,ae={__e:function(i,e,t,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(i)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,r||{}),o=n.__d),o)return n.__E=n}catch(l){i=l}throw i}},xp=0,us.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Bt({},this.state),typeof i=="function"&&(i=i(Bt({},t),this.props)),i&&Bt(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Za(this))},us.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Za(this))},us.prototype.render=kl,hi=[],kp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ya=function(i,e){return i.__v.__b-e.__v.__b},Es.__r=0,Sp=0;(function(i,e){var t={__c:e="__cC"+Sp++,__:i,Consumer:function(r,n){return r.children(n)},Provider:function(r){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,Za(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)}}),r.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0});var Mr=ze("[Surveys]"),yg={icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:i=>!!v&&Yi(v.location.href,i),not_regex:i=>!!v&&!Yi(v.location.href,i),exact:i=>v?.location.href===i,is_not:i=>v?.location.href!==i},el=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=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);n!=null&&n.startsWith("seenSurvey_")&&t.push(n)}return t})();e.forEach(t=>localStorage.removeItem(t))}loadIfEnabled(){var e,t,r,n=j==null||(e=j.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Jr(this.instance)),(t=j.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"surveys",s=>{var o,l;if(s)return Mr.error("Could not load surveys script",s);this._surveyManager=(o=j.__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 Jr(this.instance));var r=this.instance.get_property(va);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:n=>{var s;if(n.statusCode!==200||!n.json)return e([]);var o,l=n.json.surveys||[],a=l.filter(c=>{var d,u,p,h,g,m,x,S,_,A,R,q;return((d=c.conditions)===null||d===void 0?void 0:d.events)&&((u=c.conditions)===null||u===void 0||(p=u.events)===null||p===void 0?void 0:p.values)&&((h=c.conditions)===null||h===void 0||(g=h.events)===null||g===void 0||(m=g.values)===null||m===void 0?void 0:m.length)>0||((x=c.conditions)===null||x===void 0?void 0:x.actions)&&((S=c.conditions)===null||S===void 0||(_=S.actions)===null||_===void 0?void 0:_.values)&&((A=c.conditions)===null||A===void 0||(R=A.actions)===null||R===void 0||(q=R.values)===null||q===void 0?void 0:q.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({[va]:l}),e(l)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(r=>{var n,s=r.filter(a=>!(!a.start_date||a.end_date)).filter(a=>{var c,d,u,p;if(!a.conditions)return!0;var h=(c=a.conditions)===null||c===void 0||!c.url||yg[(d=(u=a.conditions)===null||u===void 0?void 0:u.urlMatchType)!==null&&d!==void 0?d:"icontains"](a.conditions.url),g=(p=a.conditions)===null||p===void 0||!p.selector||O?.querySelector(a.conditions.selector);return h&&g}),o=(n=this._surveyEventReceiver)===null||n===void 0?void 0:n.getSurveys(),l=s.filter(a=>{var c,d,u,p,h,g,m,x,S,_,A;if(!(a.linked_flag_key||a.targeting_flag_key||a.internal_targeting_flag_key||(c=a.feature_flag_keys)!==null&&c!==void 0&&c.length))return!0;var R=!a.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),q=!a.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key),X=((d=a.conditions)===null||d===void 0?void 0:d.events)&&((u=a.conditions)===null||u===void 0||(p=u.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,z=((m=a.conditions)===null||m===void 0?void 0:m.actions)&&((x=a.conditions)===null||x===void 0||(S=x.actions)===null||S===void 0?void 0:S.values)&&((_=a.conditions)===null||_===void 0||(A=_.actions)===null||A===void 0?void 0:A.values.length)>0,P=!X&&!z||o?.includes(a.id),B=this._canActivateRepeatedly(a),V=!(a.internal_targeting_flag_key&&!B)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key),Re=this.checkFlags(a);return R&&q&&V&&P&&Re});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(r=>{var{key:n,value:s}=r;return!n||!s||this.instance.featureFlags.isFeatureEnabled(s)})}getNextSurveyStep(e,t,r){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?ot.End:o;if(s.branching.type===ot.End)return ot.End;if(s.branching.type===ot.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===ot.ResponseBased){if(s.type===ks.SingleChoice){var l,a,c=s.choices.indexOf("".concat(r));if((l=s.branching)!==null&&l!==void 0&&(a=l.responseValues)!==null&&a!==void 0&&a.hasOwnProperty(c)){var d=s.branching.responseValues[c];return Number.isInteger(d)?d:d===ot.End?ot.End:o}}else if(s.type===ks.Rating){var u,p;if(typeof r!="number"||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(m,x){if(x===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(x===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(x===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(x===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")}(r,s.scale);if((u=s.branching)!==null&&u!==void 0&&(p=u.responseValues)!==null&&p!==void 0&&p.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===ot.End?ot.End:o}}return o}return Mr.warn("Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return ee((t=j.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(Mr.warn("init was not called"),!1):j.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){ee(this._surveyManager)?Mr.warn("init was not called"):this.getSurveys(t=>{var r=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(r)})}renderSurvey(e,t){ee(this._surveyManager)?Mr.warn("init was not called"):this.getSurveys(r=>{var n=r.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,O?.querySelector(t))})}},Ed=ze("[RateLimiter]"),tl=class{constructor(e){var t,r;C(this,"serverLimits",{}),C(this,"lastEventRateLimited",!1),C(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{Ed.info("".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void Ed.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(((r=e.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,r,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(_a))!==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,(r=this.instance.persistence)===null||r===void 0||r.set_property(_a,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},bg=()=>b({initialPathName:Be?.pathname||"",referringDomain:oe.referringDomain()},oe.campaignParams()),il=class{constructor(e,t,r){C(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[ma]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=r||bg,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[ma]}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}:{}}},wg=["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;"],Cd=function(i,e){if(!i)return!1;var t=i.toLowerCase();return wg.concat(e||[]).some(r=>{var n=r.toLowerCase();return t.indexOf(n)!==-1})},Pp=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&Cd(t,e))return!0;try{var r=i?.userAgentData;if(r!=null&&r.brands&&r.brands.some(n=>Cd(n?.brand,e)))return!0}catch{}return!!i.webdriver},Cs=class{constructor(){this.clicks=[]}isRageClick(e,t,r){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&r-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}},ss=ze("[Dead Clicks]"),xg=()=>!0,kg=i=>{var e,t=!((e=i.instance.persistence)===null||e===void 0||!e.get_property(Ud)),r=i.instance.config.capture_dead_clicks;return fi(r)?r:t},$s=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Ud]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,r,n;(t=j.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"dead-clicks-autocapture",s=>{s?ss.error("failed to load script",s):e()})}start(){var e;if(O){if(!this._lazyLoadedDeadClicksAutocapture&&(e=j.__PosthogExtensions__)!==null&&e!==void 0&&e.initDeadClicksAutocapture){var t=fe(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=j.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(O),ss.info("starting...")}}else ss.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,ss.info("stopping..."))}},Sg=ze("[Heatmaps]"),rl=class{constructor(e){var t;C(this,"rageclicks",new Cs),C(this,"_enabledServerSide",!1),C(this,"_initialized",!1),C(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[ha]),v?.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return fe(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;Sg.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({[ha]: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&&O&&(Ct(O,"click",e=>this._onClick(e||v?.event),!1,!0),Ct(O,"mousemove",e=>this._onMouseMove(e||v?.event),!1,!0),this.deadClicksCapture=new $s(this.instance,xg,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,a,c){for(var d=l;d&&Ps(d)&&!Ht(d,"body");){if(d===c)return!1;if(W(a,v?.getComputedStyle(d).position))return!0;d=ap(d)}return!1}(op(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:t}}_onClick(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!sd(e.target)){var n=this._getProperties(e,r);(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(b(b({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){sd(e.target)||(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&&!Hi(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},nl=class{constructor(e){C(this,"_updateScrollData",()=>{var t,r,n,s;this.context||(this.context={});var o=this.scrollElement(),l=this.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=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,(r=this.context.maxScrollHeight)!==null&&r!==void 0?r:0),this.context.lastContentY=c,this.context.maxContentY=Math.max(c,(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=ce(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var r=v?.document.querySelector(t);if(r)return r}}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}},$d=ze("[AutoCapture]");function ua(i,e){return e.length>i?e.slice(0,i)+"...":e}function Eg(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!Ps(e));return e}function Cg(i,e,t,r){var n=i.tagName.toLowerCase(),s={tag_name:n};Ta.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=ua(1024,dp(i)):s.$el_text=ua(1024,Rs(i)));var o=ys(i);o.length>0&&(s.classes=o.filter(function(d){return d!==""})),K(i.attributes,function(d){var u;if((!lp(i)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!e&&Zi(d.value)&&(u=d.name,!Ce(u)||u.substring(0,10)!=="_ngcontent"&&u.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=yl(p).join(" ")),s["attr__"+d.name]=ua(1024,p)}});for(var l=1,a=1,c=i;c=Eg(c);)l++,c.tagName===i.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function $g(i,e){for(var t,r,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,c=[i],d=i;d.parentNode&&!Ht(d,"body");)np(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var u,p=[],h={},g=!1,m=!1;if(K(c,R=>{var q=Pa(R);R.tagName.toLowerCase()==="a"&&(g=R.getAttribute("href"),g=q&&g&&Zi(g)&&g),W(ys(R),"ph-no-capture")&&(m=!0),p.push(Cg(R,s,o,l));var X=function(z){if(!Pa(z))return{};var P={};return K(z.attributes,function(B){if(B.name&&B.name.indexOf("data-ph-capture-attribute")===0){var V=B.name.replace("data-ph-capture-attribute-",""),Re=B.value;V&&Re&&Zi(Re)&&(P[V]=Re)}}),P}(R);De(h,X)}),m)return{props:{},explicitNoCapture:m};if(o||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?p[0].$el_text=dp(i):p[0].$el_text=Rs(i)),g){var x,S;p[0].attr__href=g;var _=(x=Gi(g))===null||x===void 0?void 0:x.host,A=v==null||(S=v.location)===null||S===void 0?void 0:S.host;_&&A&&_!==A&&(u=g)}return{props:De({$event_type:n.type,$ce_version:1},a?{}:{$elements:p},{$elements_chain:Vf(p)},(t=p[0])!==null&&t!==void 0&&t.$el_text?{$el_text:(r=p[0])===null||r===void 0?void 0:r.$el_text}:{},u&&n.type==="click"?{$external_click_url:u}:{},h)}}var sl=class{constructor(e){C(this,"_initialized",!1),C(this,"_isDisabledServerSide",null),C(this,"rageclicks",new Cs),C(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=fe(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),r.url_ignorelist=(t=r.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(v&&O){var e=r=>{r=r||v?.event;try{this._captureEvent(r)}catch(n){$d.error("Failed to capture event",n)}},t=r=>{r=r||v?.event,this._captureEvent(r,Qo)};Ct(O,"submit",e,!1,!0),Ct(O,"change",e,!1,!0),Ct(O,"click",e,!1,!0),this.config.capture_copied_text&&(Ct(O,"copy",t,!1,!0),Ct(O,"cut",t,!1,!0))}}else $d.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({[qc]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(n=>{var s=O?.querySelectorAll(n);s?.forEach(o=>{e===o&&r.push(n)})}),r}get isEnabled(){var e,t,r=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[qc],n=this._isDisabledServerSide;if(zt(n)&&!fi(r)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!r;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,n=op(e);rp(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=t===Qo;if(n&&qf(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=$g(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===Qo){var c,d=sp(v==null||(c=v.getSelection())===null||c===void 0?void 0:c.toString()),u=e.type||"clipboard";if(!d)return!1;o.$selected_content=d,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Qe(O?.querySelectorAll)}},Ig=ze("[TracingHeaders]"),ol=class{constructor(e){C(this,"_restoreXHRPatch",void 0),C(this,"_restoreFetchPatch",void 0),C(this,"_startCapturing",()=>{var t,r,n,s;F(this._restoreXHRPatch)&&((t=j.__PosthogExtensions__)===null||t===void 0||(r=t.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),F(this._restoreFetchPatch)&&((n=j.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,r,n;(t=j.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"tracing-headers",s=>{if(s)return Ig.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)}},jt;(function(i){i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED"})(jt||(jt={}));var al=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?jt.DENIED:this.storedConsent}isOptedOut(){return this.consent===jt.DENIED||this.consent===jt.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"?jt.GRANTED:e==="0"?jt.DENIED:jt.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?me:$t;var t=e==="localStorage"?$t:me;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&&!!Ld([Xe?.doNotTrack,Xe?.msDoNotTrack,j.doNotTrack],e=>W([!0,1,"1","yes"],e))}},os=ze("[ExceptionAutocapture]"),ll=class{constructor(e){var t;C(this,"originalOnUnhandledRejectionHandler",void 0),C(this,"startCapturing",()=>{var r,n,s,o;if(v&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=j.__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(c){os.error("failed to start",c),this.stopCapturing()}else os.error("failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[Bc]),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&&(os.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,r;this.hasHandlers&&e(),(t=j.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"exception-autocapture",n=>{if(n)return os.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({[Bc]: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)}},di=ze("[Web Vitals]"),Id=9e5,ul=class{constructor(e){var t;C(this,"_enabledServerSide",!1),C(this,"_initialized",!1),C(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),C(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((r,n)=>b(b({},r),{},{["$web_vitals_".concat(n.name,"_event")]:b({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),C(this,"_addToBuffer",r=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(F(s))di.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)||(ee(r?.name)||ee(r?.value)?di.error("Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?di.error("Ignoring metric with value >= "+this._maxAllowedValue,r):(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,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(b(b({},r),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),C(this,"_startCapturing",()=>{var r,n,s,o,l=j.__PosthogExtensions__;F(l)||F(l.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),r&&n&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(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):di.error("web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Hc]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=fe(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(r)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[zc])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=fe(this.instance.config.capture_performance)&&Je(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Id;return 0<e&&e<=6e4?Id:e}get isEnabled(){var e=fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return fi(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(di.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=fe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=fe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Hc]:t}),this.instance.persistence.register({[zc]:r})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,r,n;(t=j.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"web-vitals",s=>{s?di.error("failed to load script",s):e()})}_currentURL(){var e=v?v.location.href:void 0;return e||di.error("Could not determine current URL"),e}},Ag={icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!v&&Yi(e.href,i),not_regex:(i,e)=>!!v&&!Yi(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i},cl=class i{constructor(e){var t=this;C(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.getWebExperiments(n=>{i.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,n.forEach(s=>{if(s.feature_flag_key){var o;t._flagToExperiments&&(i.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);Ce(l)&&s.variants[l]&&t.applyTransforms(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var a in s.variants){var c=s.variants[a];i.matchesTestVariant(c)&&t.applyTransforms(s.name,a,c.transforms)}})},r)}),this.instance=e,this.instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(e){if(this._is_bot())i.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(ee(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();i.logInfo("applying feature flags",e),e.forEach(t=>{var r;if(this._flagToExperiments&&(r=this._flagToExperiments)!==null&&r!==void 0&&r.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=i.getWindowLocation();if(e!=null&&e.search){var t=gs(e?.search,"__experiment_id"),r=gs(e?.search,"__experiment_variant");t&&r&&(i.logInfo("previewing web experiments ".concat(t," && ").concat(r)),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(t),r,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.instance.config.disable_web_experiments&&!r)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",transport:"XHR",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var o=s.json.experiments||[];return e(o)}})}showPreviewWebExperiment(e,t,r){var n=r.filter(s=>s.id===e);n&&n.length>0&&(i.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!ee(e.conditions)&&i.matchUrlConditions(e)&&i.matchUTMConditions(e)}static matchUrlConditions(e){var t;if(ee(e.conditions)||ee((t=e.conditions)===null||t===void 0?void 0:t.url))return!0;var r,n,s,o=i.getWindowLocation();return!!o&&((r=e.conditions)===null||r===void 0||!r.url||Ag[(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(ee(e.conditions)||ee((t=e.conditions)===null||t===void 0?void 0:t.utm))return!0;var r=oe.campaignParams();if(r.utm_source){var n,s,o,l,a,c,d,u,p,h,g,m,x,S,_,A,R=(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)==r.utm_campaign,q=(a=e.conditions)===null||a===void 0||(c=a.utm)===null||c===void 0||!c.utm_source||((d=e.conditions)===null||d===void 0||(u=d.utm)===null||u===void 0?void 0:u.utm_source)==r.utm_source,X=(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)==r.utm_medium,z=(x=e.conditions)===null||x===void 0||(S=x.utm)===null||S===void 0||!S.utm_term||((_=e.conditions)===null||_===void 0||(A=_.utm)===null||A===void 0?void 0:A.utm_term)==r.utm_term;return R&&X&&z&&q}return!1}static logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];D.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r,n){var s;this._is_bot()?i.logInfo("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?r.forEach(o=>{if(o.selector){var l;i.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),o);var a,c=0,d=(l=document)===null||l===void 0?void 0:l.querySelectorAll(o.selector);d?.forEach(u=>{var p=u;c+=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=i.getWindowLocation())===null||a===void 0?void 0:a.href,$web_experiment_elements_modified:c})}}):(i.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=i.getWindowLocation())===null||s===void 0?void 0:s.href,$web_experiment_elements_modified:0}))}_is_bot(){return Xe&&this.instance?Pp(Xe,this.instance.config.custom_blocked_useragents):void 0}},dl=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},Tg=["$set_once","$set"],pi=ze("[SiteApps]"),pl=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 r=this.globalsForEvent(t);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}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,r,n,s,o,l,a;if(!e)throw new Error("Event payload is required");var c={},d=this.instance.get_property("$groups")||[],u=this.instance.get_property("$stored_group_properties")||{};for(var[p,h]of Object.entries(u))c[p]={id:d[p],type:p,properties:h};var{$set_once:g,$set:m}=e;return{event:b(b({},Rd(e,Tg)),{},{properties:b(b(b({},e.properties),m?{$set:b(b({},(t=(r=e.properties)===null||r===void 0?void 0:r.$set)!==null&&t!==void 0?t:{}),m)}:{}),g?{$set_once:b(b({},(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:c}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var r=s=>{var o;for(var l of(this.apps[e.id].errored=!s,this.apps[e.id].loaded=!0,pi.info("Site app with id ".concat(e.id," ").concat(s?"loaded":"errored")),s&&this.bufferedInvocations.length&&(pi.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach(a=>{var c;return(c=t.processEvent)===null||c===void 0?void 0:c.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=>{r(s)}});n&&(t.processEvent=n)}catch(s){pi.error("Error while initializing PostHog app with config id ".concat(e.id),s),r(!1)}}onCapturedEvent(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{var n;(n=r.processEvent)===null||n===void 0||n.call(r,t)}catch(s){pi.error("Error while processing event ".concat(e.event," for site app ").concat(r.id),s)}}}onRemoteConfig(e){var t,r,n=this;if(ce(j._POSTHOG_JS_APPS)){if(!this.isEnabled)return void pi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var s of j._POSTHOG_JS_APPS)this.setupSiteApp(s);var o;j._POSTHOG_JS_APPS.length?this.instance.on("eventCaptured",d=>this.onCapturedEvent(d)):(o=this.stopBuffering)===null||o===void 0||o.call(this)}else if((t=this.stopBuffering)===null||t===void 0||t.call(this),(r=e.siteApps)!==null&&r!==void 0&&r.length)if(this.isEnabled){var l=function(d,u){var p,h;j["__$$ph_site_app_".concat(d)]=n.instance,(p=j.__PosthogExtensions__)===null||p===void 0||(h=p.loadSiteApp)===null||h===void 0||h.call(p,n.instance,u,g=>{if(g)return pi.error("Error while initializing PostHog app with config id ".concat(d),g)})};for(var{id:a,url:c}of e.siteApps)l(a,c)}else pi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},Hr={},hl=()=>{},Bi="posthog",Rp=!cg&&ke?.indexOf("MSIE")===-1&&ke?.indexOf("Mozilla")===-1,Ad=()=>{var i,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=O?.location,t=e?.hostname,!!Ce(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:hl,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Be&&Ce(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||(i=v.location)===null||i===void 0?void 0:i.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:r=>{var n="Bad HTTP status: "+r.statusCode+" "+r.text;D.error(n)},get_device_id:r=>r,_onCapture:hl,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}},Td=i=>{var e={};F(i.process_person)||(e.person_profiles=i.process_person),F(i.xhr_headers)||(e.request_headers=i.xhr_headers),F(i.cookie_name)||(e.persistence_name=i.cookie_name),F(i.disable_cookie)||(e.disable_persistence=i.disable_cookie);var t=De({},e,i);return ce(i.property_blacklist)&&(F(i.property_denylist)?t.property_denylist=i.property_blacklist:ce(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:D.error("Invalid value for property_denylist config: "+i.property_denylist)),t},fl=class{constructor(){C(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){D.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Is=class i{constructor(){C(this,"webPerformance",new fl),C(this,"version",Nt.LIB_VERSION),C(this,"_internalEventEmitter",new Ss),this.config=Ad(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ga,this.sentryIntegration=e=>function(t,r){var n=bp(t,r);return{name:yp,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new xa(this),this.toolbar=new Ba(this),this.scrollManager=new nl(this),this.pageViewManager=new Ja(this),this.surveys=new el(this),this.experiments=new cl(this),this.exceptions=new dl(this),this.rateLimiter=new tl(this),this.requestRouter=new Va(this),this.consent=new al(this),this.people={set:(e,t,r)=>{var n=Ce(e)?{[e]:t}:e;this.setPersonProperties(n),r?.({})},set_once:(e,t,r)=>{var n=Ce(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",e=>D.info('send "'.concat(e?.event,'"'),e))}init(e,t,r){if(r&&r!==Bi){var n,s=(n=Hr[r])!==null&&n!==void 0?n:new i;return s._init(e,t,r),Hr[r]=s,Hr[Bi][r]=s,s}return this._init(e,t,r)}_init(e){var t,r,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(F(e)||Uc(e))return D.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 D.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(De({},Ad(),Td(s),{name:o,token:e})),this.config.on_xhr_error&&D.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:lt.GZipJS,this.persistence=new jr(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new jr(b(b({},this.config),{},{persistence:"sessionStorage"}));var l=b({},this.persistence.props),a=b({},this.sessionPersistence.props);if(this._requestQueue=new Ha(_=>this._send_retriable_request(_)),this._retryQueue=new za(this),this.__request_queue=[],this.sessionManager=new Wa(this),this.sessionPropsManager=new il(this.sessionManager,this.persistence),new ol(this).startIfEnabledOrStop(),this.siteApps=new pl(this),(t=this.siteApps)===null||t===void 0||t.init(),this.sessionRecording=new ja(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new sl(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new rl(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new ul(this),this.exceptionObserver=new ll(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new $s(this,kg),this.deadClicksAutocapture.startIfEnabled(),Nt.DEBUG=Nt.DEBUG||this.config.debug,Nt.DEBUG&&D.info("Starting in debug mode",{this:this,config:s,thisC:b({},this.config),p:l,s:a}),this._sync_opt_out_with_persistence(),((r=s.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var c,d,u=this.config.get_device_id(qt()),p=(c=s.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?u: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 A,R;return!((A=s.bootstrap)===null||A===void 0||(R=A.featureFlags)===null||R===void 0||!R[_])}).reduce((_,A)=>{var R,q;return _[A]=((R=s.bootstrap)===null||R===void 0||(q=R.featureFlags)===null||q===void 0?void 0:q[A])||!1,_},{}),x=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(_=>m[_]).reduce((_,A)=>{var R,q,X,z;return(R=s.bootstrap)!==null&&R!==void 0&&(q=R.featureFlagPayloads)!==null&&q!==void 0&&q[A]&&(_[A]=(X=s.bootstrap)===null||X===void 0||(z=X.featureFlagPayloads)===null||z===void 0?void 0:z[A]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:x})}if(!this.get_distinct_id()){var S=this.config.get_device_id(qt());this.register_once({distinct_id:S,$device_id:S},""),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?pg(this,()=>this._loaded()):this._loaded(),Qe(this.config._onCapture)&&this.config._onCapture!==hl&&(D.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this}_onRemoteConfig(e){var t,r,n,s,o,l,a,c,d;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=W(e.supportedCompression,lt.GZipJS)?lt.GZipJS:W(e.supportedCompression,lt.Base64)?lt.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"}),(r=this.siteApps)===null||r===void 0||r.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),(c=this.exceptionObserver)===null||c===void 0||c.onRemoteConfig(e),(d=this.deadClicksAutocapture)===null||d===void 0||d.onRemoteConfig(e)}_loaded(){this.config.advanced_disable_decide||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){D.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new qa(this).call()}_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()||Vi(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&&(Rp?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=xs(e.url,{ip:this.config.ip?1:0}),e.headers=b({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(t=>{var r,n,s,o=b({},t);o.timeout=o.timeout||6e4,o.url=xs(o.url,{_:new Date().getTime().toString(),ver:Nt.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"XHR",a=(n=(s=Ld(Br,c=>c.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:Br[0].method;if(!a)throw new Error("No available transport method");a(o)})(b(b({},e),{},{callback:t=>{var r,n,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(s=this.config).on_request_error)===null||n===void 0||n.call(s,t)),(r=e.callback)===null||r===void 0||r.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],n=[],s=[];Vi(e,l=>{l&&(t=l[0],ce(t)?s.push(l):Qe(l)?l.call(this):ce(l)&&t==="alias"?r.push(l):ce(l)&&t.indexOf("capture")!==-1&&Qe(this[t])?s.push(l):n.push(l))});var o=function(l,a){Vi(l,function(c){if(ce(c[0])){var d=a;K(c,function(u){d=d[u[0]].apply(d,u.slice(1))})}else this[c[0]].apply(this,c.slice(1))},a)};o(r,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,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!F(e)&&Ce(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=r!=null&&r.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=r?.timestamp||o,a={uuid:qt(),event:e,properties:this._calculate_event_properties(e,t||{},l)};s&&(a.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(a.$set=r?.$set);var c=this._calculate_set_once_properties(r?.$set_once);c&&(a.$set_once=c),(a=yf(a,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,F(r?.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=o);var d=b(b({},a.properties.$set),a.$set);if(Hi(d)||this.setPersonPropertiesForFlags(d),!ee(this.config.before_send)){var u=this._runBeforeSend(a);if(!u)return;a=u}this._internalEventEmitter.emit("eventCaptured",a);var p={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),a}D.critical("This capture call is ignored due to client rate limiting.")}}else D.error("No event name provided to posthog.capture")}else D.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,r){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),s=b({},t);if(s.token=this.config.token,e==="$snapshot"){var o=b(b({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ce(s.distinct_id)&&!Je(s.distinct_id)||Uc(s.distinct_id))&&D.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l=oe.properties();if(this.sessionManager){var{sessionId:a,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=a,s.$window_id=c}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===gi.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var d=this.sessionPropsManager.getSessionProps();s=De(s,d)}if(!this.config.disable_scroll_properties){var u={};e==="$pageview"?u=this.pageViewManager.doPageView(r):e==="$pageleave"&&(u=this.pageViewManager.doPageLeave(r)),s=De(s,u)}if(e==="$pageview"&&O&&(s.title=O.title),!F(n)){var p=r.getTime()-n;s.$duration=parseFloat((p/1e3).toFixed(3))}ke&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=De({},l,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),ce(this.config.property_denylist)?K(this.config.property_denylist,function(m){delete s[m]}):D.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;h&&(s=h(s,e));var g=this._hasPersonProcessing();return s.$process_person_profile=g,g&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=De({},this.persistence.get_initial_props(),e||{}),r=this.config.sanitize_properties;return r&&(t=r(t,"$set_once")),Hi(t)?void 0:t}register(e,t){var r;(r=this.persistence)===null||r===void 0||r.register(e,t)}register_once(e,t,r){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,t,r)}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,r;return(t=(r=this.sessionManager)===null||r===void 0?void 0:r.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,r){return this.surveys.getNextSurveyStep(e,t,r)}identify(e,t,r){if(!this.__loaded||!this.persistence)return D.uninitializedWarning("posthog.identify");if(Je(e)&&(e=e.toString(),D.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()))D.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(Dr)&&(this.unregister(Dr),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:r||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||r)&&this.setPersonProperties(t,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(hs))}}else D.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,r){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:b(b({},n),{},{[e]:t})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===t||r||this.reloadFeatureFlags()}}else D.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._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&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,r,n,s,o;if(D.info("reset"),!this.__loaded)return D.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(r=this.sessionPersistence)===null||r===void 0||r.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();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:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(e!=null&&e.withTimestamp&&r){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return n;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0);n+="?t=".concat(l)}return n}alias(e,t){return e===this.get_property(Nd)?(D.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(Dr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(D.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,r,n,s,o=b({},this.config);fe(e)&&(De(this.config,Td(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 jr(b(b({},this.config),{},{persistence:"sessionStorage"})),me.is_supported()&&me.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Nt.DEBUG=!0,D.info("set_config",{config:e,oldConfig:o,newConfig:b({},this.config)})),(r=this.sessionRecording)===null||r===void 0||r.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,r={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(r).some(Boolean)){var n,s,o,l,a;(n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.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 r,n=new Error("PostHog syntheticException"),s=Qe((r=j.__PosthogExtensions__)===null||r===void 0?void 0:r.parseErrorAsProperties)?j.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):b({$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:Bi;return t!==Bi&&(t=Bi+"."+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,r,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Hi(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[Dr])&&((r=this.persistence)===null||r===void 0||(n=r.props)===null||n===void 0||!n[fs]))}_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"?(D.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(fs,!0),!0)}_sync_opt_out_with_persistence(){var e,t,r,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&&((r=this.persistence)===null||r===void 0||r.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 Xe?Pp(Xe,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){O&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:O.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(ee(this.config.before_send))return e;var t=ce(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),ee(r)){var s="Event '".concat(e.event,"' was rejected in beforeSend function");return mf(e.event)?D.warn("".concat(s,". This can cause unexpected behavior.")):D.info(s),null}r.properties&&!Hi(r.properties)||D.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return r}};(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=_f(i.prototype[e[t]])})(Is,["identify"]);var Pd,Op=(Pd=Hr[Bi]=new Is,function(){function i(){i.done||(i.done=!0,Rp=!1,K(Hr,function(e){e._dom_loaded()}))}O!=null&&O.addEventListener&&(O.readyState==="complete"?i():O.addEventListener("DOMContentLoaded",i,!1)),v&&Ct(v,"load",i,!0)}(),Pd);var Fp=Op.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 Ne(i,e){if(!Fp)throw new Error("Failed to initialize PostHog");Fp.capture(i,e)}var Fs,Kr,Ms,Wt,Dp,Os,Xr=class Xr extends J(H){constructor(){super();y(this,Wt);y(this,Fs,new Mt(this,{onError:console.error}));y(this,Kr);y(this,Ms,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Ne("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Ne("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Ne("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Ne("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Ne("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Ne("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,Kr)||f(this,Fs).data}render(){return this.config?L`
399
+ `)).length,n=0;n<r;n++){var o=i.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),Ut(l)||(t>e&&(s+=i.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=i.substring(e,i.length)),s},wt=function(){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation),e}return i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},function(e,t,r,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(t,r,!!s);else{var o="on"+t,l=e[o];e[o]=function(a,c,d){return function(u){if(u=u||i(v?.event)){var p,h=!0;Je(d)&&(p=d(u));var g=c.call(a,u);return p!==!1&&g!==!1||(h=!1),h}}}(e,r,l)}else M.error("No valid element provided to register_event")}}();function Rd(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}var Od="$people_distinct_id",Ar="__alias",Tr="__timers",Dc="$autocapture_disabled_server_side",la="$heatmaps_enabled_server_side",Lc="$exception_capture_enabled_server_side",Nc="$web_vitals_enabled_server_side",Fd="$dead_clicks_enabled_server_side",Uc="$web_vitals_allowed_metrics",ua="$session_recording_enabled_server_side",qc="$console_log_recording_enabled_server_side",jc="$session_recording_network_payload_capture",Bc="$session_recording_canvas_recording",Hc="$replay_sample_rate",zc="$replay_minimum_duration",Wc="$replay_script_config",os="$sesid",Pr="$session_is_sampled",Xo="$session_recording_url_trigger_activated_session",Yo="$session_recording_event_trigger_activated_session",Li="$enabled_feature_flags",ca="$early_access_features",Ni="$stored_person_properties",Ft="$stored_group_properties",da="$surveys",zn="$surveys_activated",as="$flag_call_reported",_t="$user_state",pa="$client_session_props",ha="$capture_rate_limit",fa="$initial_campaign_params",ga="$initial_referrer_info",va="$initial_person_info",ls="$epp",Md="__POSTHOG_TOOLBAR__",vf=[Od,Ar,"__cmpns",Tr,ua,la,os,Li,_t,ca,Ft,Ni,da,as,pa,ha,fa,ga,ls],Wn=Ne("[FeatureFlags]"),Ko="$active_feature_flags",Vn="$override_feature_flags",Vc="$feature_flag_payloads",Gc=i=>{var e={};for(var[t,r]of ts(i||{}))r&&(e[t]=r);return e},ma=class{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(Li),t=this.instance.get_property(Vn);if(!t)return e||{};for(var r=Pe({},e),n=Object.keys(t),s=0;s<n.length;s++)r[n[s]]=t[n[s]];return this._override_warning||(Wn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){return this.instance.get_property(Vc)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())},5)}_reloadFeatureFlagsRequest(){if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var e=this.instance.config.token,t=this.instance.get_property(Ni),r=this.instance.get_property(Ft),n={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:n,compression:this.instance.config.disable_compression?void 0:rt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:s=>{var o;this.setReloadingPaused(!1);var l=!0;s.statusCode===200&&(this.$anon_distinct_id=void 0,l=!1),this.receivedFeatureFlags((o=s.json)!==null&&o!==void 0?o:{},l),this._startReloadTimer()}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r,n=this.getFlagVariants()[e],s="".concat(n),o=this.instance.get_property(as)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(ae(o[e])?o[e].push(s):o[e]=[s],(r=this.instance.persistence)===null||r===void 0||r.register({[as]:o}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}Wn.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.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Wn.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.instance.decideEndpointWasHit=!0;var r=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]:{},c=s.featureFlags,d=s.featureFlagPayloads;if(c)if(ae(c)){var u={};if(c)for(var p=0;p<c.length;p++)u[c[p]]=!0;o&&o.register({[Ko]:c,[Li]:u})}else{var h=c,g=d;s.errorsWhileComputingFlags&&(h=b(b({},l),h),g=b(b({},a),g)),o&&o.register({[Ko]:Object.keys(Gc(h)),[Li]:h||{},[Vc]:g||{}})}})(e,this.instance.persistence,r,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 Wn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(Vn);else if(ae(e)){for(var r={},n=0;n<e.length;n++)r[e[n]]=!0;this.instance.persistence.register({[Vn]:r})}else this.instance.persistence.register({[Vn]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var r,n={["$feature_enrollment/".concat(e)]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:n}),this.setPersonPropertiesForFlags(n,!1);var s=b(b({},this.getFlagVariants()),{},{[e]:t});(r=this.instance.persistence)===null||r===void 0||r.register({[Ko]:Object.keys(Gc(s)),[Li]:s}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(ca);if(r&&!t)return e(r);this.instance._send_request({transport:"XHR",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({[ca]:o}),e(o)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(r=>t[r]),flagVariants:Object.keys(t).filter(r=>t[r]).reduce((r,n)=>(r[n]=t[n],r),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(n=>n(t,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ni)||{};this.instance.register({[Ni]:b(b({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Ni)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ft)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(n=>{r[n]=b(b({},r[n]),e[n]),delete e[n]}),this.instance.register({[Ft]:b(b({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(Ft)||{};this.instance.register({[Ft]:b(b({},t),{},{[e]:{}})})}else this.instance.unregister(Ft)}};Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return Be(i)&&isFinite(i)&&Math.floor(i)===i});var Jc="0123456789abcdef",_a=class i{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>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|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new i(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Jc.charAt(this.bytes[t]>>>4)+Jc.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 i(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(r!==0)return Math.sign(r)}return 0}},ya=class{constructor(){C(this,"timestamp",0),C(this,"counter",0),C(this,"random",new ba)}generate(){var e=this.generateOrAbort();if(O(e)){this.timestamp=0;var t=this.generateOrAbort();if(O(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 _a.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())}},Xc,Dd=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<i.length;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};v&&!O(v.crypto)&&crypto.getRandomValues&&(Dd=i=>crypto.getRandomValues(i));var ba=class{constructor(){C(this,"buffer",new Uint32Array(8)),C(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(Dd(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},Dt=()=>mf().toString(),mf=()=>(Xc||(Xc=new ya)).generate(),_f="Thu, 01 Jan 1970 00:00:00 GMT",Er="",yf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function bf(i,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R;if(Er)return Er;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var o=n.split("."),l=Math.min(o.length,8),a="dmn_chk_"+Dt(),c=new RegExp("(^|;)\\s*"+a+"=1");!Er&&l--;){var d=o.slice(l).join("."),u=a+"=1;domain=."+d;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+_f,Er=d)}return Er}(i);if(!t){var r=(n=>{var s=n.match(yf);return s?s[0]:""})(i);r!==t&&M.info("Warning: cookie subdomain discovery mismatch",r,t),t=r}return t?"; domain=."+t:""}return""}var xt={is_supported:()=>!!R,error:function(i){M.error("cookieStore error: "+i)},get:function(i){if(R){try{for(var e=i+"=",t=R.cookie.split(";").filter(s=>s.length),r=0;r<t.length;r++){for(var n=t[r];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(i){var e;try{e=JSON.parse(xt.get(i))||{}}catch{}return e},set:function(i,e,t,r,n){if(R)try{var s="",o="",l=bf(R.location.hostname,r);if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),s="; expires="+a.toUTCString()}n&&(o="; secure");var c=i+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&M.warn("cookieStore warning: large cookie, len="+c.length),R.cookie=c,c}catch{return}},remove:function(i,e){try{xt.set(i,"",-1,e)}catch{return}}},Zo=null,fe={is_supported:function(){if(!Ut(Zo))return Zo;var i=!0;if(O(v))i=!1;else try{var e="__mplssupport__";fe.set(e,"xyz"),fe.get(e)!=='"xyz"'&&(i=!1),fe.remove(e)}catch{i=!1}return i||M.error("localStorage unsupported; falling back to cookie store"),Zo=i,i},error:function(i){M.error("localStorage error: "+i)},get:function(i){try{return v?.localStorage.getItem(i)}catch(e){fe.error(e)}return null},parse:function(i){try{return JSON.parse(fe.get(i))||{}}catch{}return null},set:function(i,e){try{v?.localStorage.setItem(i,JSON.stringify(e))}catch(t){fe.error(t)}},remove:function(i){try{v?.localStorage.removeItem(i)}catch(e){fe.error(e)}}},wf=["distinct_id",os,Pr,ls,va],Gn=b(b({},fe),{},{parse:function(i){try{var e={};try{e=xt.parse(i)||{}}catch{}var t=Pe(e,JSON.parse(fe.get(i)||"{}"));return fe.set(i,t),t}catch{}return null},set:function(i,e,t,r,n,s){try{fe.set(i,e,void 0,void 0,s);var o={};wf.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&xt.set(i,o,t,r,n,s)}catch(l){fe.error(l)}},remove:function(i,e){try{v?.localStorage.removeItem(i),xt.remove(i,e)}catch(t){fe.error(t)}}}),Jn={},xf={is_supported:function(){return!0},error:function(i){M.error("memoryStorage error: "+i)},get:function(i){return Jn[i]||null},parse:function(i){return Jn[i]||null},set:function(i,e){Jn[i]=e},remove:function(i){delete Jn[i]}},ni=null,we={is_supported:function(){if(!Ut(ni))return ni;if(ni=!0,O(v))ni=!1;else try{var i="__support__";we.set(i,"xyz"),we.get(i)!=='"xyz"'&&(ni=!1),we.remove(i)}catch{ni=!1}return ni},error:function(i){M.error("sessionStorage error: ",i)},get:function(i){try{return v?.sessionStorage.getItem(i)}catch(e){we.error(e)}return null},parse:function(i){try{return JSON.parse(we.get(i))||null}catch{}return null},set:function(i,e){try{v?.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){we.error(t)}},remove:function(i){try{v?.sessionStorage.removeItem(i)}catch(e){we.error(e)}}},kf=["localhost","127.0.0.1"],qi=i=>{var e=R?.createElement("a");return O(e)?null:(e.href=i,e)},Hi=function(i,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(i)},Sf=function(i){var e,t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",n=[];return X(i,function(s,o){O(s)||O(o)||o==="undefined"||(e=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),t=encodeURIComponent(o),n[n.length]=t+"="+e)}),n.join(r)},us=function(i,e){for(var t,r=((i.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<r.length;n++){var s=r[n].split("=");if(s[0]===e){t=s;break}}if(!ae(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{M.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},cs=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Xe="Mobile",ds="iOS",at="Android",Lr="Tablet",Ld=at+" "+Lr,Nd="iPad",Ud="Apple",qd=Ud+" Watch",Nr="Safari",zi="BlackBerry",jd="Samsung",Bd=jd+"Browser",Hd=jd+" Internet",di="Chrome",Ef=di+" OS",zd=di+" "+ds,cl="Internet Explorer",Wd=cl+" "+Xe,dl="Opera",Cf=dl+" Mini",pl="Edge",Vd="Microsoft "+pl,ji="Firefox",Gd=ji+" "+ds,Ur="Nintendo",qr="PlayStation",Bi="Xbox",Jd=at+" "+Xe,Xd=Xe+" "+Nr,Rr="Windows",wa=Rr+" Phone",Yc="Nokia",xa="Ouya",Yd="Generic",$f=Yd+" "+Xe.toLowerCase(),Kd=Yd+" "+Lr.toLowerCase(),ka="Konqueror",Te="(\\d+(\\.\\d+)?)",Qo=new RegExp("Version/"+Te),If=new RegExp(Bi,"i"),Af=new RegExp(qr+" \\w+","i"),Tf=new RegExp(Ur+" \\w+","i"),hl=new RegExp(zi+"|PlayBook|BB10","i"),Pf={"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"},Rf=(i,e)=>e&&H(e,Ud)||function(t){return H(t,Nr)&&!H(t,di)&&!H(t,at)}(i),Kc=function(i,e){return e=e||"",H(i," OPR/")&&H(i,"Mini")?Cf:H(i," OPR/")?dl:hl.test(i)?zi:H(i,"IE"+Xe)||H(i,"WPDesktop")?Wd:H(i,Bd)?Hd:H(i,pl)||H(i,"Edg/")?Vd:H(i,"FBIOS")?"Facebook "+Xe:H(i,"UCWEB")||H(i,"UCBrowser")?"UC Browser":H(i,"CriOS")?zd:H(i,"CrMo")||H(i,di)?di:H(i,at)&&H(i,Nr)?Jd:H(i,"FxiOS")?Gd:H(i.toLowerCase(),ka.toLowerCase())?ka:Rf(i,e)?H(i,Xe)?Xd:Nr:H(i,ji)?ji:H(i,"MSIE")||H(i,"Trident/")?cl:H(i,"Gecko")?ji:""},Of={[Wd]:[new RegExp("rv:"+Te)],[Vd]:[new RegExp(pl+"?\\/"+Te)],[di]:[new RegExp("("+di+"|CrMo)\\/"+Te)],[zd]:[new RegExp("CriOS\\/"+Te)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Te)],[Nr]:[Qo],[Xd]:[Qo],[dl]:[new RegExp("(Opera|OPR)\\/"+Te)],[ji]:[new RegExp(ji+"\\/"+Te)],[Gd]:[new RegExp("FxiOS\\/"+Te)],[ka]:[new RegExp("Konqueror[:/]?"+Te,"i")],[zi]:[new RegExp(zi+" "+Te),Qo],[Jd]:[new RegExp("android\\s"+Te,"i")],[Hd]:[new RegExp(Bd+"\\/"+Te)],[cl]:[new RegExp("(rv:|MSIE )"+Te)],Mozilla:[new RegExp("rv:"+Te)]},Zc=[[new RegExp(Bi+"; "+Bi+" (.*?)[);]","i"),i=>[Bi,i&&i[1]||""]],[new RegExp(Ur,"i"),[Ur,""]],[new RegExp(qr,"i"),[qr,""]],[hl,[zi,""]],[new RegExp(Rr,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[wa,""];if(new RegExp(Xe).test(e)&&!/IEMobile\b/.test(e))return[Rr+" "+Xe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=t[1],n=Pf[r]||"";return/arm/i.test(e)&&(n="RT"),[Rr,n]}return[Rr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[ds,e.join(".")]}return[ds,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=O(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+at+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+at+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[at,e.join(".")]}return[at,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ef,""]],[/Linux|debian/i,["Linux",""]]],Qc=function(i){return Tf.test(i)?Ur:Af.test(i)?qr:If.test(i)?Bi:new RegExp(xa,"i").test(i)?xa:new RegExp("("+wa+"|WPDesktop)","i").test(i)?wa:/iPad/.test(i)?Nd:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?qd:hl.test(i)?zi:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(Yc,"i").test(i)?Yc:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(Xe).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?at:Ld:at:new RegExp("(pda|"+Xe+")","i").test(i)?$f:new RegExp(Lr,"i").test(i)&&!new RegExp(Lr+" pc","i").test(i)?Kd:""},Xn="https?://(.*)",Ff=["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"],re={campaignParams:function(i){return R?this._campaignParamsFromUrl(R.URL,i):{}},_campaignParamsFromUrl:function(i,e){var t=Ff.concat(e||[]),r={};return X(t,function(n){var s=us(i,n);r[n]=s||null}),r},_searchEngine:function(i){return i?i.search(Xn+"google.([^/?]*)")===0?"google":i.search(Xn+"bing.com")===0?"bing":i.search(Xn+"yahoo.com")===0?"yahoo":i.search(Xn+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(i){var e=re._searchEngine(i),t=e!="yahoo"?"q":"p",r={};if(!Ut(e)){r.$search_engine=e;var n=R?us(R.referrer,t):"";n.length&&(r.ph_keyword=n)}return r},searchInfo:function(){var i=R?.referrer;return i?this._searchInfoFromReferrer(i):{}},browser:Kc,browserVersion:function(i,e){var t=Kc(i,e),r=Of[t];if(O(r))return null;for(var n=0;n<r.length;n++){var s=r[n],o=i.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var i=this.browserLanguage();return typeof i=="string"?i.split("-")[0]:void 0},os:function(i){for(var e=0;e<Zc.length;e++){var[t,r]=Zc[e],n=t.exec(i),s=n&&(Je(r)?r(n,i):r);if(s)return s}return["",""]},device:Qc,deviceType:function(i){var e=Qc(i);return e===Nd||e===Ld||e==="Kobo"||e==="Kindle Fire"||e===Kd?Lr:e===Ur||e===Bi||e===qr||e===xa?"Console":e===qd?"Wearable":e?Xe:"Desktop"},referrer:function(){return R?.referrer||"$direct"},referringDomain:function(){var i;return R!=null&&R.referrer&&((i=qi(R.referrer))===null||i===void 0?void 0:i.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:De?.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(i){var e,{r:t,u:r}=i,n={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=qi(t))===null||e===void 0?void 0:e.host};if(r){n.$initial_current_url=r;var s=qi(r);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,X(this._campaignParamsFromUrl(r),function(o,l){n["$initial_"+aa(l)]=o})}return t&&X(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+aa(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(!ye)return{};var[i,e]=re.os(ye);return Pe(ss({$os:i,$os_version:e,$browser:re.browser(ye,navigator.vendor),$device:re.device(ye),$device_type:re.deviceType(ye),$timezone:re.timezone(),$timezone_offset:re.timezoneOffset()}),{$current_url:De?.href,$host:De?.host,$pathname:De?.pathname,$raw_user_agent:ye.length>1e3?ye.substring(0,997)+"...":ye,$browser_version:re.browserVersion(ye,navigator.vendor),$browser_language:re.browserLanguage(),$browser_language_prefix:re.browserLanguagePrefix(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:Ot.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(!ye)return{};var[i,e]=re.os(ye);return Pe(ss({$os:i,$os_version:e,$browser:re.browser(ye,navigator.vendor)}),{$browser_version:re.browserVersion(ye,navigator.vendor)})}},Mf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Or=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t=>{var r="";return t.token&&(r=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+r+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&M.info("Persistence loaded",e.persistence,b({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){Mf.indexOf(e.persistence.toLowerCase())===-1&&(M.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&fe.is_supported()?fe:t==="localstorage+cookie"&&Gn.is_supported()?Gn:t==="sessionstorage"&&we.is_supported()?we:t==="memory"?xf:t==="cookie"?xt:Gn.is_supported()?Gn:xt}properties(){var e={};return X(this.props,function(t,r){if(r===Li&&de(t))for(var n=Object.keys(t),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=t[n[s]];else l=r,a=!1,(Ut(o=vf)?a:Rc&&o.indexOf===Rc?o.indexOf(l)!=-1:(X(o,function(c){if(a||(a=c===l))return ns}),a))||(e[r]=t);var o,l,a}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Pe({},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,r){if(de(e)){O(t)&&(t="None"),this.expire_days=O(r)?this.default_expiry:r;var n=!1;if(X(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(de(e)){this.expire_days=O(t)?this.default_expiry:t;var r=!1;if(X(e,(n,s)=>{e.hasOwnProperty(s)&&this.props[s]!==n&&(this.props[s]=n,r=!0)}),r)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=re.campaignParams(this.config.custom_campaign_params);Di(ss(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(re.searchInfo())}update_referrer_info(){this.register_once(re.referrerInfo(),void 0)}set_initial_person_info(){this.props[fa]||this.props[ga]||this.register_once({[va]:re.initialPersonInfo()},void 0)}get_referrer_info(){return ss({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};X([ga,fa],n=>{var s=this.props[n];s&&X(s,function(o,l){e["$initial_"+aa(l)]=o})});var t=this.props[va];if(t){var r=re.initialPersonPropsFromInfo(t);Pe(e,r)}return e}safe_merge(e){return X(this.props,function(t,r){r in e||(e[r]=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 r=this.buildStorage(e),n=this.props;this.clear(),this.storage=r,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 r=this.props[Tr]||{};r[e]=t,this.props[Tr]=r,this.save()}remove_event_timer(e){var t=(this.props[Tr]||{})[e];return O(t)||(delete this.props[Tr][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function ps(i){var e,t;return((e=JSON.stringify(i,(t=[],function(r,n){if(de(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 Sa(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(i.size>=e&&i.data.length>1){var t=Math.floor(i.data.length/2),r=i.data.slice(0,t),n=i.data.slice(t);return[Sa({size:ps(r),data:r,sessionId:i.sessionId,windowId:i.windowId}),Sa({size:ps(n),data:n,sessionId:i.sessionId,windowId:i.windowId})].flatMap(s=>s)}return[i]}var yt=(i=>(i[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i))(yt||{}),it=(i=>(i[i.Mutation=0]="Mutation",i[i.MouseMove=1]="MouseMove",i[i.MouseInteraction=2]="MouseInteraction",i[i.Scroll=3]="Scroll",i[i.ViewportResize=4]="ViewportResize",i[i.Input=5]="Input",i[i.TouchMove=6]="TouchMove",i[i.MediaInteraction=7]="MediaInteraction",i[i.StyleSheetRule=8]="StyleSheetRule",i[i.CanvasMutation=9]="CanvasMutation",i[i.Font=10]="Font",i[i.Log=11]="Log",i[i.Drag=12]="Drag",i[i.StyleDeclaration=13]="StyleDeclaration",i[i.Selection=14]="Selection",i[i.AdoptedStyleSheet=15]="AdoptedStyleSheet",i[i.CustomElement=16]="CustomElement",i))(it||{});function ed(i){var e;return i.id===Md||!((e=i.closest)===null||e===void 0||!e.call(i,".toolbar-global-fade-container"))}function Es(i){return!!i&&i.nodeType===1}function Nt(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function Zd(i){return!!i&&i.nodeType===3}function Qd(i){return!!i&&i.nodeType===11}function fl(i){return i?Ss(i).split(/\s+/):[]}function td(i){var e=v?.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function hs(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return fl(e)}function ep(i){return Z(i)?null:Ss(i).split(/(\s+)/).filter(e=>Wi(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Cs(i){var e="";return Ca(i)&&!rp(i)&&i.childNodes&&i.childNodes.length&&X(i.childNodes,function(t){var r;Zd(t)&&t.textContent&&(e+=(r=ep(t.textContent))!==null&&r!==void 0?r:"")}),Ss(e)}function tp(i){return O(i.target)?i.srcElement||null:(e=i.target)!==null&&e!==void 0&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var Ea=["a","button","form","input","select","textarea","label"];function ip(i){var e=i.parentNode;return!(!e||!Es(e))&&e}function Df(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!v||!i||Nt(i,"html")||!Es(i)||t!=null&&t.url_allowlist&&!td(t.url_allowlist)||t!=null&&t.url_ignorelist&&td(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=[i],a=!0,c=i;c.parentNode&&!Nt(c,"body");)if(Qd(c.parentNode))l.push(c.parentNode.host),c=c.parentNode.host;else{if(!(a=ip(c)))break;if(r||Ea.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{var d=v.getComputedStyle(a);d&&d.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(a),c=a}if(!function(h,g){var m=g?.element_allowlist;if(O(m))return!0;var x=function(I){if(m.some(P=>I.tagName.toLowerCase()===P))return{v:!0}};for(var S of h){var _=x(S);if(typeof _=="object")return _.v}return!1}(l,t)||!function(h,g){var m=g?.css_selector_allowlist;if(O(m))return!0;var x=function(I){if(m.some(P=>I.matches(P)))return{v:!0}};for(var S of h){var _=x(S);if(typeof _=="object")return _.v}return!1}(l,t))return!1;var u=v.getComputedStyle(i);if(u&&u.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=i.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&&(Ea.indexOf(p)>-1||i.getAttribute("contenteditable")==="true")}}function Ca(i){for(var e=i;e.parentNode&&!Nt(e,"body");e=e.parentNode){var t=hs(e);if(H(t,"ph-sensitive")||H(t,"ph-no-capture"))return!1}if(H(hs(i),"ph-include"))return!0;var r=i.type||"";if(xe(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=i.name||i.id||"";return!(xe(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 rp(i){return!!(Nt(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Nt(i,"select")||Nt(i,"textarea")||i.getAttribute("contenteditable")==="true")}var np="(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})",Lf=new RegExp("^(?:".concat(np,")$")),Nf=new RegExp(np),sp="\\d{3}-?\\d{2}-?\\d{4}",Uf=new RegExp("^(".concat(sp,")$")),qf=new RegExp("(".concat(sp,")"));function Wi(i){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Z(i)||xe(i)&&(i=Ss(i),(e?Lf:Nf).test((i||"").replace(/[- ]/g,""))||(e?Uf:qf).test(i)))}function op(i){var e=Cs(i);return Wi(e="".concat(e," ").concat(ap(i)).trim())?e:""}function ap(i){var e="";return i&&i.childNodes&&i.childNodes.length&&X(i.childNodes,function(t){var r;if(t&&((r=t.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var n=Cs(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(ap(t)).trim())}catch(s){M.error("[AutoCapture]",s)}}),e}function jf(i){return function(e){var t=e.map(r=>{var n,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))o+=".".concat(l.replace(/"/g,""));var a=b(b(b(b({},r.text?{text:r.text}:{}),{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),c={};return ts(a).sort((d,u)=>{var[p]=d,[h]=u;return p.localeCompare(h)}).forEach(d=>{var[u,p]=d;return c[id(u.toString())]=id(p.toString())}),o+=":",o+=ts(a).map(d=>{var[u,p]=d;return"".concat(u,'="').concat(p,'"')}).join("")});return t.join(";")}(function(e){return e.map(t=>{var r,n,s={text:(r=t.$el_text)===null||r===void 0?void 0:r.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:Bf(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ts(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,a]=o;return s.attributes[l]=a}),s})}(i))}function id(i){return i.replace(/"|\\"/g,'\\"')}function Bf(i){var e=i.attr__class;return e?ae(e)?e:fl(e):void 0}var $a="[SessionRecording]",Ia="redacted",Yn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:i=>i,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},Hf=["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"],zf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Wf=["/s/","/e/","/i/"];function rd(i,e,t,r){if(Z(i))return i;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(i);return xe(n)&&(n=parseInt(n)),n>t?$a+" ".concat(r," body too large to record (").concat(n," bytes)"):i}function nd(i,e){if(Z(i))return i;var t=i;return Wi(t,!1)||(t=$a+" "+e+" body "+Ia),X(zf,r=>{var n,s;(n=t)!==null&&n!==void 0&&n.length&&((s=t)===null||s===void 0?void 0:s.indexOf(r))!==-1&&(t=$a+" "+e+" body "+Ia+" as might contain: "+r)}),t}var Vf=(i,e)=>{var t,r,n,s={payloadSizeLimitBytes:Yn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Yn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Yn.payloadHostDenyList]},o=i.session_recording.recordHeaders!==!1&&e.recordHeaders,l=i.session_recording.recordBody!==!1&&e.recordBody,a=i.capture_performance!==!1&&e.recordPerformance,c=(t=s,n=Math.min(1e6,(r=t.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),p=>(p!=null&&p.requestBody&&(p.requestBody=rd(p.requestBody,p.requestHeaders,n,"Request")),p!=null&&p.responseBody&&(p.responseBody=rd(p.responseBody,p.responseHeaders,n,"Response")),p)),d=p=>{return c(((m,x)=>{var S,_=qi(m.name),I=x.indexOf("http")===0?(S=qi(x))===null||S===void 0?void 0:S.pathname:x;I==="/"&&(I="");var P=_?.pathname.replace(I||"","");if(!(_&&P&&Wf.some(U=>P.indexOf(U)===0)))return m})((g=(h=p).requestHeaders,Z(g)||X(Object.keys(g??{}),m=>{Hf.includes(m.toLowerCase())&&(g[m]=Ia)}),h),i.api_host));var h,g},u=Je(i.session_recording.maskNetworkRequestFn);return u&&Je(i.session_recording.maskCapturedNetworkRequestFn)&&M.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(i.session_recording.maskCapturedNetworkRequestFn=p=>{var h=i.session_recording.maskNetworkRequestFn({url:p.name});return b(b({},p),{},{name:h?.url})}),s.maskRequestFn=Je(i.session_recording.maskCapturedNetworkRequestFn)?p=>{var h,g,m,x=d(p);return x&&(h=(g=(m=i.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,x))!==null&&h!==void 0?h:void 0}:p=>function(h){if(!O(h))return h.requestBody=nd(h.requestBody,"Request"),h.responseBody=nd(h.responseBody,"Response"),h}(d(p)),b(b(b({},Yn),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function lt(i,e,t,r,n){return e>t&&(M.warn("min cannot be greater than max."),e=t),Be(i)?i>t?(r&&M.warn(r+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(r&&M.warn(r+" cannot be less than min: "+e+". Using min value instead."),e):i:(r&&M.warn(r+" must be a number. using max or fallback. max: "+t+", fallback: "+n),lt(n||t,e,t,r))}var Aa=class{constructor(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,"bucketSize",100),C(this,"refillRate",10),C(this,"mutationBuckets",{}),C(this,"loggedTracker",{}),C(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]})}),C(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]}),C(this,"numberOfChanges",s=>{var o,l,a,c,d,u,p,h;return((o=(l=s.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((a=(c=s.attributes)===null||c===void 0?void 0:c.length)!==null&&a!==void 0?a:0)+((d=(u=s.texts)===null||u===void 0?void 0:u.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)}),C(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(c=>{var d,u,p,[h,g]=this.getNodeOrRelevantParent(c.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,(u=(p=this.options).onBlockedNode)===null||u===void 0||u.call(p,h,g))),c)}));var a=this.numberOfChanges(o);return a!==0||l===a?s:void 0}),this.rrweb=e,this.options=n,this.refillRate=lt((t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=lt((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},Ye=Uint8Array,Re=Uint16Array,Vi=Uint32Array,gl=new Ye([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),vl=new Ye([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sd=new Ye([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lp=function(i,e){for(var t=new Re(31),r=0;r<31;++r)t[r]=e+=1<<i[r-1];var n=new Vi(t[30]);for(r=1;r<30;++r)for(var s=t[r];s<t[r+1];++s)n[s]=s-t[r]<<5|r;return[t,n]},up=lp(gl,2),Gf=up[0],Ta=up[1];Gf[28]=258,Ta[258]=28;for(Pa=lp(vl,0)[1],fs=new Re(32768),Q=0;Q<32768;++Q)Pt=(43690&Q)>>>1|(21845&Q)<<1,Pt=(61680&(Pt=(52428&Pt)>>>2|(13107&Pt)<<2))>>>4|(3855&Pt)<<4,fs[Q]=((65280&Pt)>>>8|(255&Pt)<<8)>>>1;var Pt,Pa,fs,Q,Fr=function(i,e,t){for(var r=i.length,n=0,s=new Re(e);n<r;++n)++s[i[n]-1];var o,l=new Re(e);for(n=0;n<e;++n)l[n]=l[n-1]+s[n-1]<<1;if(t){o=new Re(1<<e);var a=15-e;for(n=0;n<r;++n)if(i[n])for(var c=n<<4|i[n],d=e-i[n],u=l[i[n]-1]++<<d,p=u|(1<<d)-1;u<=p;++u)o[fs[u]>>>a]=c}else for(o=new Re(r),n=0;n<r;++n)o[n]=fs[l[i[n]-1]++]>>>15-i[n];return o},pi=new Ye(288);for(Q=0;Q<144;++Q)pi[Q]=8;for(Q=144;Q<256;++Q)pi[Q]=9;for(Q=256;Q<280;++Q)pi[Q]=7;for(Q=280;Q<288;++Q)pi[Q]=8;var gs=new Ye(32);for(Q=0;Q<32;++Q)gs[Q]=5;var Jf=Fr(pi,9,0),Xf=Fr(gs,5,0),cp=function(i){return(i/8>>0)+(7&i&&1)},dp=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var r=new(i instanceof Re?Re:i instanceof Vi?Vi:Ye)(t-e);return r.set(i.subarray(e,t)),r},mt=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8},Cr=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8,i[r+2]|=t>>>16},ea=function(i,e){for(var t=[],r=0;r<i.length;++r)i[r]&&t.push({s:r,f:i[r]});var n=t.length,s=t.slice();if(!n)return[new Ye(0),0];if(n==1){var o=new Ye(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(U,G){return U.f-G.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],c=0,d=1,u=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};d!=n-1;)l=t[t[c].f<t[u].f?c++:u++],a=t[c!=d&&t[c].f<t[u].f?c++:u++],t[d++]={s:-1,f:l.f+a.f,l,r:a};var p=s[0].s;for(r=1;r<n;++r)s[r].s>p&&(p=s[r].s);var h=new Re(p+1),g=Ra(t[d-1],h,0);if(g>e){r=0;var m=0,x=g-e,S=1<<x;for(s.sort(function(U,G){return h[G.s]-h[U.s]||U.f-G.f});r<n;++r){var _=s[r].s;if(!(h[_]>e))break;m+=S-(1<<g-h[_]),h[_]=e}for(m>>>=x;m>0;){var I=s[r].s;h[I]<e?m-=1<<e-h[I]++-1:++r}for(;r>=0&&m;--r){var P=s[r].s;h[P]==e&&(--h[P],++m)}g=e}return[new Ye(h),g]},Ra=function(i,e,t){return i.s==-1?Math.max(Ra(i.l,e,t+1),Ra(i.r,e,t+1)):e[i.s]=t},od=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Re(++e),r=0,n=i[0],s=1,o=function(a){t[r++]=a},l=1;l<=e;++l)if(i[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=i[l]}return[t.subarray(0,r),e]},$r=function(i,e){for(var t=0,r=0;r<e.length;++r)t+=i[r]*e[r];return t},Oa=function(i,e,t){var r=t.length,n=cp(e+2);i[n]=255&r,i[n+1]=r>>>8,i[n+2]=255^i[n],i[n+3]=255^i[n+1];for(var s=0;s<r;++s)i[n+s+4]=t[s];return 8*(n+4+r)},ad=function(i,e,t,r,n,s,o,l,a,c,d){mt(e,d++,t),++n[256];for(var u=ea(n,15),p=u[0],h=u[1],g=ea(s,15),m=g[0],x=g[1],S=od(p),_=S[0],I=S[1],P=od(m),U=P[0],G=P[1],B=new Re(19),T=0;T<_.length;++T)B[31&_[T]]++;for(T=0;T<U.length;++T)B[31&U[T]]++;for(var q=ea(B,7),z=q[0],$e=q[1],ge=19;ge>4&&!z[sd[ge-1]];--ge);var ze,J,ee,ue,Fe=c+5<<3,Ue=$r(n,pi)+$r(s,gs)+o,se=$r(n,p)+$r(s,m)+o+14+3*ge+$r(B,z)+(2*B[16]+3*B[17]+7*B[18]);if(Fe<=Ue&&Fe<=se)return Oa(e,d,i.subarray(a,a+c));if(mt(e,d,1+(se<Ue)),d+=2,se<Ue){ze=Fr(p,h,0),J=p,ee=Fr(m,x,0),ue=m;var ke=Fr(z,$e,0);for(mt(e,d,I-257),mt(e,d+5,G-1),mt(e,d+10,ge-4),d+=14,T=0;T<ge;++T)mt(e,d+3*T,z[sd[T]]);d+=3*ge;for(var Se=[_,U],ie=0;ie<2;++ie){var ve=Se[ie];for(T=0;T<ve.length;++T){var Ie=31&ve[T];mt(e,d,ke[Ie]),d+=z[Ie],Ie>15&&(mt(e,d,ve[T]>>>5&127),d+=ve[T]>>>12)}}}else ze=Jf,J=pi,ee=Xf,ue=gs;for(T=0;T<l;++T)if(r[T]>255){Ie=r[T]>>>18&31,Cr(e,d,ze[Ie+257]),d+=J[Ie+257],Ie>7&&(mt(e,d,r[T]>>>23&31),d+=gl[Ie]);var fi=31&r[T];Cr(e,d,ee[fi]),d+=ue[fi],fi>3&&(Cr(e,d,r[T]>>>5&8191),d+=vl[fi])}else Cr(e,d,ze[r[T]]),d+=J[r[T]];return Cr(e,d,ze[256]),d+J[256]},Yf=new Vi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Kf=function(){for(var i=new Vi(256),e=0;e<256;++e){for(var t=e,r=9;--r;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),Zf=function(){var i=4294967295;return{p:function(e){for(var t=i,r=0;r<e.length;++r)t=Kf[255&t^e[r]]^t>>>8;i=t},d:function(){return 4294967295^i}}},Qf=function(i,e,t,r,n){return function(s,o,l,a,c,d){var u=s.length,p=new Ye(a+u+5*(1+Math.floor(u/7e3))+c),h=p.subarray(a,p.length-c),g=0;if(!o||u<8)for(var m=0;m<=u;m+=65535){var x=m+65535;x<u?g=Oa(h,g,s.subarray(m,x)):(h[m]=d,g=Oa(h,g,s.subarray(m,u)))}else{for(var S=Yf[o-1],_=S>>>13,I=8191&S,P=(1<<l)-1,U=new Re(32768),G=new Re(P+1),B=Math.ceil(l/3),T=2*B,q=function(Ms){return(s[Ms]^s[Ms+1]<<B^s[Ms+2]<<T)&P},z=new Vi(25e3),$e=new Re(288),ge=new Re(32),ze=0,J=0,ee=(m=0,0),ue=0,Fe=0;m<u;++m){var Ue=q(m),se=32767&m,ke=G[Ue];if(U[se]=ke,G[Ue]=se,ue<=m){var Se=u-m;if((ze>7e3||ee>24576)&&Se>423){g=ad(s,h,0,z,$e,ge,J,ee,Fe,m-Fe,g),ee=ze=J=0,Fe=m;for(var ie=0;ie<286;++ie)$e[ie]=0;for(ie=0;ie<30;++ie)ge[ie]=0}var ve=2,Ie=0,fi=I,kt=se-ke&32767;if(Se>2&&Ue==q(m-kt))for(var Bp=Math.min(_,Se)-1,Hp=Math.min(32767,m),zp=Math.min(258,Se);kt<=Hp&&--fi&&se!=ke;){if(s[m+ve]==s[m+ve-kt]){for(var St=0;St<zp&&s[m+St]==s[m+St-kt];++St);if(St>ve){if(ve=St,Ie=kt,St>Bp)break;var Wp=Math.min(kt,St-2),Al=0;for(ie=0;ie<Wp;++ie){var Fs=m-kt+ie+32768&32767,Tl=Fs-U[Fs]+32768&32767;Tl>Al&&(Al=Tl,ke=Fs)}}}kt+=(se=ke)-(ke=U[se])+32768&32767}if(Ie){z[ee++]=268435456|Ta[ve]<<18|Pa[Ie];var Pl=31&Ta[ve],Rl=31&Pa[Ie];J+=gl[Pl]+vl[Rl],++$e[257+Pl],++ge[Rl],ue=m+ve,++ze}else z[ee++]=s[m],++$e[s[m]]}}g=ad(s,h,d,z,$e,ge,J,ee,Fe,m-Fe,g)}return dp(p,0,a+cp(g)+c)}(i,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+e.mem,t,r,!n)},Fa=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},eg=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&Fa(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var r=0;r<=t.length;++r)i[r+10]=t.charCodeAt(r)}},tg=function(i){return 10+(i.filename&&i.filename.length+1||0)};function pp(i,e){e===void 0&&(e={});var t=Zf(),r=i.length;t.p(i);var n=Qf(i,e,tg(e),8),s=n.length;return eg(n,e),Fa(n,s-8,t.d()),Fa(n,s-4,r),n}function hp(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var r=new Ye(i.length+(i.length>>>1)),n=0,s=function(c){r[n++]=c},o=0;o<t;++o){if(n+5>r.length){var l=new Ye(n+8+(t-o<<1));l.set(r),r=l}var a=i.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&i.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 dp(r,0,n)}var is="[SessionRecording]",Ce=Ne(is),ig=3e5,rg=[it.MouseMove,it.MouseInteraction,it.Scroll,it.ViewportResize,it.Input,it.TouchMove,it.MediaInteraction,it.Drag],ld=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1});function si(i){return function(e,t){for(var r="",n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=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,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(pp(hp(JSON.stringify(i))),!0)}function ud(i){return i.type===yt.Custom&&i.data.tag==="sessionIdle"}function cd(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}var Ma=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return N==null||(e=N.__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(is+" 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:ig}get isSampled(){var e=this.instance.get_property(Pr);return ui(e)?e:null}get sessionDuration(){var e,t,r=(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 r?r.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(ua),t=!this.instance.config.disable_session_recording;return v&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(qc),t=this.instance.config.enable_recording_console_log;return t??e}get canvasRecording(){var e,t,r,n,s,o,l=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(Bc),c=(e=(t=l?.recordCanvas)!==null&&t!==void 0?t:a?.enabled)!==null&&e!==void 0&&e,d=(r=(n=l?.canvasFps)!==null&&n!==void 0?n:a?.fps)!==null&&r!==void 0?r:0,u=(s=(o=l?.canvasQuality)!==null&&o!==void 0?o:a?.quality)!==null&&s!==void 0?s:0;return{enabled:c,fps:lt(d,0,12,"canvas recording fps"),quality:lt(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(jc),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||r?.recordHeaders,o=n?.recordBody||r?.recordBody,l=de(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(ui(l)?l:r?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(Hc);return Be(e)?e:null}get minimumDuration(){var e=this.instance.get_property(zc);return Be(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":Z(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":ui(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(Xo))===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(Yo))===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(C(this,"queuedRRWebEvents",[]),C(this,"isIdle",!1),C(this,"_linkedFlagSeen",!1),C(this,"_lastActivityTimestamp",Date.now()),C(this,"_linkedFlag",null),C(this,"_removePageViewCaptureHook",void 0),C(this,"_onSessionIdListener",void 0),C(this,"_persistDecideOnSessionListener",void 0),C(this,"_samplingSessionListener",void 0),C(this,"_urlTriggers",[]),C(this,"_urlBlocklist",[]),C(this,"_urlBlocked",!1),C(this,"_eventTriggers",[]),C(this,"_removeEventTriggerCaptureHook",void 0),C(this,"_forceAllowLocalhostNetworkCapture",!1),C(this,"_onBeforeUnload",()=>{this._flushBuffer()}),C(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),C(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),C(this,"_onVisibilityChange",()=>{if(R!=null&&R.visibilityState){var n="window "+R.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Ce.error("started without valid sessionManager"),new Error(is+" started without valid sessionManager. This is a bug.");var{sessionId:t,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Ce.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(),Z(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var r=t!=null&&t.properties.$current_url?this._maskUrl(t?.properties.$current_url):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(n){Ce.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((t,r,n)=>{var s,o,l,a;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:t,windowId:r,changeReason:n}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(Yo),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(Xo))}))):this.stopRecording()}stopRecording(){var e,t,r,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,(r=this._onSessionIdListener)===null||r===void 0||r.call(this),this._onSessionIdListener=void 0,(n=this._samplingSessionListener)===null||n===void 0||n.call(this),this._samplingSessionListener=void 0,Ce.info("stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if(Be(n)){var s,o=this.isSampled,l=r||!ui(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):Ce.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({[Pr]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[Pr]:null})}}onRemoteConfig(e){var t,r,n,s,o,l;if(this._persistRemoteConfig(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(r=e.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(l=e.sessionRecording)===null||l===void 0?void 0:l.endpoint),this._setupSampling(),!Z(this._linkedFlag)&&!this._linkedFlagSeen){var a=xe(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,c=xe(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((d,u)=>{var p=de(u)&&a in u,h=c?u[a]===c:p;h&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:c}),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(){Be(this.sampleRate)&&Z(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistRemoteConfig(e){if(this.instance.persistence){var t,r=this.instance.persistence,n=()=>{var s,o,l,a,c,d,u,p,h=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,g=Z(h)?null:parseFloat(h),m=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;r.register({[ua]:!!e.sessionRecording,[qc]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[jc]:b({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[Bc]:{enabled:(c=e.sessionRecording)===null||c===void 0?void 0:c.recordCanvas,fps:(d=e.sessionRecording)===null||d===void 0?void 0:d.canvasFps,quality:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasQuality},[Hc]:g,[zc]:O(m)?null:m,[Wc]:(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,r=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:r,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!O(Object.assign)&&!O(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,r;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=N.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,this.scriptName,n=>{if(n)return Ce.error("could not load recorder",n);this._onScriptLoaded()}),Ce.info("starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,r;return((e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0||(r=t.get_property(Wc))===null||r===void 0?void 0:r.script)||"recorder"}isInteractiveEvent(e){var t;return e.type===3&&rg.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 r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!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")):r&&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}):Ce.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(ld(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(ld(()=>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},r=this.instance.config.session_recording;for(var[n,s]of Object.entries(r||{}))n in t&&(n==="maskInputOptions"?t.maskInputOptions=b({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 Aa(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(l,a)=>{var c="Too many mutations on node '".concat(l,"'. Rate limiting. This could be due to SVG animations or something similar");Ce.info(c,{node:a}),this.log(is+" "+c,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(b({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 Ce.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,r,n,s=[],o=(e=N.__PosthogExtensions__)===null||e===void 0||(t=e.rrwebPlugins)===null||t===void 0?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var l=(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Je(l)&&(!kf.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(Vf(this.instance.config,this.networkPayloadCapture))):Ce.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&de(e)){if(e.type===yt.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(u){return u.type===yt.Custom&&u.data.tag==="recording paused"}(e)){e.type===yt.FullSnapshot&&this._scheduleFullSnapshot(),e.type===yt.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var s=function(u){var p=u;if(p&&de(p)&&p.type===6&&de(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,u}return u}(n);if(this._updateWindowAndSessionIds(s),!this.isIdle||ud(s)){if(ud(s)){var o=s.data.payload;if(o){var l=o.lastActivityTimestamp,a=o.threshold;s.timestamp=l+a}}var c=(t=this.instance.config.session_recording.compress_events)===null||t===void 0||t?function(u){if(ps(u)<1024)return u;try{if(u.type===yt.FullSnapshot)return b(b({},u),{},{data:si(u.data),cv:"2024-10"});if(u.type===yt.IncrementalSnapshot&&u.data.source===it.Mutation)return b(b({},u),{},{cv:"2024-10",data:b(b({},u.data),{},{texts:si(u.data.texts),attributes:si(u.data.attributes),removes:si(u.data.removes),adds:si(u.data.adds)})});if(u.type===yt.IncrementalSnapshot&&u.data.source===it.StyleSheetRule)return b(b({},u),{},{cv:"2024-10",data:b(b({},u.data),{},{adds:si(u.data.adds),removes:si(u.data.removes)})})}catch(p){Ce.error("could not compress event - will use uncompressed event",p)}return u}(s):s,d={$snapshot_bytes:ps(c),$snapshot_data:c,$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 r,n={url:e};return(r=n=t.maskNetworkRequestFn(n))===null||r===void 0?void 0:r.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,r=Be(t)&&t>=0,n=Be(e)&&r&&t<e;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Sa(this.buffer).forEach(s=>{this._captureSnapshot({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+r>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",r=cd(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),cd(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,r;this.triggerStatus==="trigger_pending"&&((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[e==="url"?Xo:Yo]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;this.status!=="paused"&&(this._urlBlocked=!0,R==null||(e=R.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout(()=>{this._flushBuffer()},100),Ce.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;this.status==="paused"&&(this._urlBlocked=!1,R==null||(e=R.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.remove("ph-no-capture"),this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Ce.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&Z(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(t){Ce.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;(e=this.instance.persistence)===null||e===void 0||e.register({[Pr]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Ce.info(e.replace("_"," "),t),H(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},Rt=Ne("[Decide]"),Da=class{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}_loadRemoteConfigJs(e){var t,r,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.loadExternalDependency?(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"remote-config",()=>e(N._POSTHOG_CONFIG)):(Rt.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)}})}call(){var e=!!this.instance.config.advanced_disable_decide;if(e||this.instance.featureFlags.resetRequestQueue(),this.instance.config.__preview_remote_config)return N._POSTHOG_CONFIG?(Rt.info("Using preloaded remote config",N._POSTHOG_CONFIG),void this.onRemoteConfig(N._POSTHOG_CONFIG)):e?void Rt.warn("Remote config is disabled. Falling back to local config."):void this._loadRemoteConfigJs(r=>{if(!r)return Rt.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(n=>{this.onRemoteConfig(n)});this.onRemoteConfig(r)});if(!e){var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ni),group_properties:this.instance.get_property(Ft),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 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:rt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:r=>this.parseDecideResponse(r.json)})}}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},t),!t)return R&&R.body?void this.instance._onRemoteConfig(e):(Rt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500));Rt.error("Failed to fetch feature flags from PostHog.")}onRemoteConfig(e){if(e){if(!R||!R.body)return Rt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.onRemoteConfig(e)},500);this.instance._onRemoteConfig(e),e.hasFeatureFlags!==!1&&(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags.reloadFeatureFlags())}else Rt.error("Failed to fetch remote config from PostHog.")}},bt,ng=v!=null&&v.location?cs(v.location.hash,"__posthog")||cs(location.hash,"state"):null,dd="_postHogToolbarParams";(function(i){i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED"})(bt||(bt={}));var La=class{constructor(e){this.instance=e}setToolbarState(e){N.ph_toolbar_state=e}getToolbarState(){var e;return(e=N.ph_toolbar_state)!==null&&e!==void 0?e:bt.UNINITIALIZED}maybeLoadToolbar(){var e,t,r=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||!R)return!1;r=(e=r)!==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=ng||cs(r.hash,"__posthog")||cs(r.hash,"state"),a=l?Mc(()=>JSON.parse(atob(decodeURIComponent(l))))||Mc(()=>JSON.parse(decodeURIComponent(l))):null;return a&&a.action==="ph_authorize"?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?r.hash=a.desiredHash:s?s.replaceState(s.state,"",r.pathname+r.search):r.hash="")):((o=JSON.parse(n.getItem(dd)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){(N.ph_load_toolbar||N.ph_load_editor)(e,this.instance)}loadToolbar(e){var t=!(R==null||!R.getElementById(Md));if(!v||t)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=b(b({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(v.localStorage.setItem(dd,JSON.stringify(b(b({},n),{},{source:void 0}))),this.getToolbarState()===bt.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===bt.UNINITIALIZED){var s,o;this.setToolbarState(bt.LOADING),(s=N.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return M.error("[Toolbar] Failed to load",l),void this.setToolbarState(bt.UNINITIALIZED);this.setToolbarState(bt.LOADED),this._callLoadToolbar(n)}),wt(v,"turbolinks:load",()=>{this.setToolbarState(bt.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,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,r)}},Na=class{constructor(e){C(this,"isPaused",!0),C(this,"queue",[]),C(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),r=[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)];r.map(n=>{this.sendRequest(b(b({},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(),r=function(s){var o=t[s],l=new Date().getTime();o.data&&ae(o.data)&&X(o.data,a=>{a.offset=Math.abs(a.timestamp-l),delete a.timestamp}),e.sendRequest(o)};for(var n in t)r(n)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return X(this.queue,t=>{var r,n=t,s=(n?n.batchKey:null)||n.url;O(e[s])&&(e[s]=b(b({},n),{},{data:[]})),(r=e[s].data)===null||r===void 0||r.push(n.data)}),this.queue=[],e}},sg=!!oa||!!sa,pd="text/plain",vs=(i,e)=>{var[t,r]=i.split("?"),n=b({},e);r?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=Sf(n);return s=s?(r?r+"&":"")+s:r,"".concat(t,"?").concat(s)},Kn=(i,e)=>JSON.stringify(i,(t,r)=>typeof r=="bigint"?r.toString():r,e),ta=i=>{var{data:e,compression:t}=i;if(e){if(t===rt.GZipJS){var r=pp(hp(Kn(e)),{mtime:0}),n=new Blob([r],{type:pd});return{contentType:pd,body:n,estimatedSize:n.size}}if(t===rt.Base64){var s=function(a){var c,d,u,p,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,x=0,S="",_=[];if(!a)return a;a=gf(a);do c=(h=a.charCodeAt(m++)<<16|a.charCodeAt(m++)<<8|a.charCodeAt(m++))>>18&63,d=h>>12&63,u=h>>6&63,p=63&h,_[x++]=g.charAt(c)+g.charAt(d)+g.charAt(u)+g.charAt(p);while(m<a.length);switch(S=_.join(""),a.length%3){case 1:S=S.slice(0,-2)+"==";break;case 2:S=S.slice(0,-1)+"="}return S}(Kn(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Kn(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=Kn(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},Mr=[];oa&&Mr.push({transport:"XHR",method:i=>{var e,t=new oa;t.open(i.method||"GET",i.url,!0);var{contentType:r,body:n}=(e=ta(i))!==null&&e!==void 0?e:{};X(i.headers,function(s,o){t.setRequestHeader(o,s)}),r&&t.setRequestHeader("Content-Type",r),i.timeout&&(t.timeout=i.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=i.callback)===null||s===void 0||s.call(i,o)}},t.send(n)}}),sa&&Mr.push({transport:"fetch",method:i=>{var e,t,{contentType:r,body:n,estimatedSize:s}=(e=ta(i))!==null&&e!==void 0?e:{},o=new Headers;X(i.headers,function(d,u){o.append(u,d)}),r&&o.append("Content-Type",r);var l=i.url,a=null;if(Oc){var c=new Oc;a={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}sa(l,{method:i?.method||"GET",headers:o,keepalive:i.method==="POST"&&(s||0)<52428.8,body:n,signal:(t=a)===null||t===void 0?void 0:t.signal}).then(d=>d.text().then(u=>{var p,h={statusCode:d.status,text:u};if(d.status===200)try{h.json=JSON.parse(u)}catch(g){M.error(g)}(p=i.callback)===null||p===void 0||p.call(i,h)})).catch(d=>{var u;M.error(d),(u=i.callback)===null||u===void 0||u.call(i,{statusCode:0,text:d})}).finally(()=>a?clearTimeout(a.timeout):null)}}),He!=null&&He.sendBeacon&&Mr.push({transport:"sendBeacon",method:i=>{var e=vs(i.url,{beacon:"1"});try{var t,{contentType:r,body:n}=(t=ta(i))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:r}):n;He.sendBeacon(e,s)}catch{}}});var og=["retriesPerformedSoFar"],Ua=class{constructor(e){C(this,"isPolling",!1),C(this,"pollIntervalMs",3e3),C(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!O(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,r=$d(e,og);Be(t)&&t>0&&(r.url=vs(r.url,{retry_count:t})),this.instance._send_request(b(b({},r),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(b({retriesPerformedSoFar:t},r)):(s=r.callback)===null||s===void 0||s.call(r,n)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(o){var l=3e3*Math.pow(2,o),a=l/2,c=Math.min(18e5,l),d=(Math.random()-.5)*(c-a);return Math.ceil(c+d)}(t),n=Date.now()+r;this.queue.push({retryAt:n,requestOptions:e});var s="Enqueued failed request for retry in ".concat(r);navigator.onLine||(s+=" (Browser is offline)"),M.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=[],r=this.queue.filter(s=>s.retryAt<e||(t.push(s),!1));if(this.queue=t,r.length>0)for(var{requestOptions:n}of r)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(b(b({},e),{},{transport:"sendBeacon"}))}catch(t){M.error(t)}this.queue=[]}},ci,hd=Ne("[SessionId]"),qa=class{constructor(e,t,r){var n;if(C(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");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||Dt,this._windowIdGenerator=r||Dt;var s=this.config.persistence_name||this.config.token,o=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*lt(o,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var l=we.parse(this._window_id_storage_key),a=we.parse(this._primary_window_exists_storage_key);l&&!a?this._windowId=l:we.remove(this._window_id_storage_key),we.set(this._primary_window_exists_storage_key,!0)}if((n=this.config.bootstrap)!==null&&n!==void 0&&n.sessionID)try{var c=(d=>{var u=d.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(d){hd.error("Invalid sessionID in bootstrap",d)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return O(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&&we.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&we.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?we.parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[os]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[os];return ae(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){v?.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&we.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)||new Date().getTime(),[r,n,s]=this._getSessionId(),o=this._getWindowId(),l=Be(s)&&s>0&&Math.abs(t-s)>864e5,a=!1,c=!n,d=!e&&Math.abs(t-r)>this.sessionTimeoutMs;c||d||l?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),hd.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),s=t,a=!0):o||(o=this._windowIdGenerator(),a=!0);var u=r===0||!e||l?t:r,p=s===0?new Date().getTime():s;return this._setWindowId(o),this._setSessionId(n,u,p),a&&this._sessionIdChangedHandlers.forEach(h=>h(n,o,a?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:a?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}};(function(i){i.US="us",i.EU="eu",i.CUSTOM="custom"})(ci||(ci={}));var fd="i.posthog.com",ja=class{constructor(e){C(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(fd),".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]=ci.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=ci.EU:this._regionCache[this.apiHost]=ci.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===ci.CUSTOM)return this.apiHost+t;var r=fd+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}},fp="posthog-js";function gp(i){var{organization:e,projectId:t,prefix:r,severityAllowList:n=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=>{var o,l,a,c,d;if(!(n==="*"||n.includes(s.level))||!i.__loaded)return s;s.tags||(s.tags={});var u=i.requestRouter.endpointFor("ui","/project/".concat(i.config.token,"/person/").concat(i.get_distinct_id()));s.tags["PostHog Person URL"]=u,i.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=i.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:u,$exception_level:s.level,$exception_list:p,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((c=p[0])===null||c===void 0?void 0:c.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=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+t+"&query="+s.event_id),i.exceptions.sendExceptionEvent(h),s}}var Ba=class{constructor(e,t,r,n,s){this.name=fp,this.setupOnce=function(o){o(gp(e,{organization:t,projectId:r,prefix:n,severityAllowList:s}))}}},gd,ms,tt,ia=Ne("[SegmentIntegration]");function ag(i,e){var t=i.config.segment;if(!t)return e();(function(r,n){var s=r.config.segment;if(!s)return n();var o=a=>{var c=()=>a.anonymousId()||Dt();r.config.get_device_id=c,a.id()&&(r.register({distinct_id:a.id(),$device_id:c()}),r.persistence.set_property(_t,"identified")),n()},l=s.user();"then"in l&&Je(l.then)?l.then(a=>o(a)):o(l)})(i,()=>{t.register((r=>{Promise&&Promise.resolve||ia.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===r.get_distinct_id()||(ia.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(ia.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var a=r._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")}})(i)).then(()=>{e()})})}var Ha=class{constructor(e){this._instance=e}doPageView(e){var t,r=this._previousPageViewProperties(e);return this._currentPath=(t=v?.location.pathname)!==null&&t!==void 0?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,r}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){var t=this._currentPath,r=this._prevPageviewTimestamp,n=this._instance.scrollManager.getContext();if(!r)return{};var s={};if(n){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:a,maxContentHeight:c,lastContentY:d,maxContentY:u}=n;O(o)||O(l)||O(a)||O(c)||O(d)||O(u)||(o=Math.ceil(o),l=Math.ceil(l),a=Math.ceil(a),c=Math.ceil(c),d=Math.ceil(d),u=Math.ceil(u),s={$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:o<=1?1:lt(l/o,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:o<=1?1:lt(a/o,0,1),$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:c<=1?1:lt(d/c,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:c<=1?1:lt(u/c,0,1)})}return t&&(s.$prev_pageview_pathname=t),r&&(s.$prev_pageview_duration=(e.getTime()-r.getTime())/1e3),s}};(function(i){i.Popover="popover",i.API="api",i.Widget="widget"})(gd||(gd={})),function(i){i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link"}(ms||(ms={})),function(i){i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question"}(tt||(tt={}));var _s=class{constructor(){C(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(r=>r!==t)}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var n of this.events["*"]||[])n(e,t)}},za=class i{constructor(e){C(this,"_debugEventEmitter",new _s),C(this,"checkStep",(t,r)=>this.checkStepEvent(t,r)&&this.checkStepUrl(t,r)&&this.checkStepElement(t,r)),C(this,"checkStepEvent",(t,r)=>r==null||!r.event||t?.event===r?.event),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!O((e=this.instance)===null||e===void 0?void 0:e._addCaptureHook)){var t;(t=this.instance)===null||t===void 0||t._addCaptureHook((r,n)=>{this.on(r,n)})}}register(e){var t,r;if(!O((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(c=>{var d;(d=this.actionEvents)===null||d===void 0||d.add(c?.event||"")})}),(r=this.instance)!==null&&r!==void 0&&r.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 r;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((r=this.actionRegistry)===null||r===void 0?void 0:r.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 r of t.steps)if(this.checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(t!=null&&t.url){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$current_url;if(!n||typeof n!="string"||!i.matchString(n,t?.url,t?.url_matching||"contains"))return!1}return!0}static matchString(e,t,r){switch(r){case"regex":return!!v&&Hi(e,t);case"exact":return t===e;case"contains":var n=i.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Hi(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&&!i.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!i.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!i.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$element_selectors;if(!n||!n.includes(t?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},jr=class i{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;O((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.actions)&&((s=r.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 za(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(r=>{this.onAction(r)})),t.forEach(r=>{var n,s,o,l,a,c,d,u,p,h;r.conditions&&(n=r.conditions)!==null&&n!==void 0&&n.actions&&(s=r.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((l=r.conditions)===null||l===void 0||(a=l.actions)===null||a===void 0||(c=a.values)===null||c===void 0?void 0:c.length)>0&&((d=this.actionMatcher)===null||d===void 0||d.register(r.conditions.actions.values),(u=r.conditions)===null||u===void 0||(p=u.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(r.id),this.actionToSurveys.set(g.name,m||[r.id])}}))}))}setupEventBasedSurveys(e){var t;e.filter(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.events)&&((s=r.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((r,n)=>{this.onEvent(r,n)}),e.forEach(r=>{var n,s,o;(n=r.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(r.id),this.eventToSurveys.set(l.name,a||[r.id])}})}))}onEvent(e,t){var r,n,s=((r=this.instance)===null||r===void 0||(n=r.persistence)===null||n===void 0?void 0:n.props[zn])||[];if(i.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,r,n=((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0?void 0:r.props[zn])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,r;(t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[zn]:[...new Set(e)]})}getSurveys(){var e,t,r=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[zn];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};C(jr,"SURVEY_SHOWN_EVENT_NAME","survey shown");var vp,ne,mp,li,vd,_p,Wa,yp,Va={},bp=[],lg=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ml=Array.isArray;function Lt(i,e){for(var t in e)i[t]=e[t];return i}function wp(i){var e=i.parentNode;e&&e.removeChild(i)}function ra(i,e,t,r,n){var s={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++mp,__i:-1,__u:0};return n==null&&ne.vnode!=null&&ne.vnode(s),s}function _l(i){return i.children}function rs(i,e){this.props=i,this.context=e}function Gi(i,e){if(e==null)return i.__?Gi(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Gi(i):null}function xp(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return xp(i)}}function Ga(i){(!i.__d&&(i.__d=!0)&&li.push(i)&&!ys.__r++||vd!==ne.debounceRendering)&&((vd=ne.debounceRendering)||_p)(ys)}function ys(){var i,e,t,r,n,s,o,l,a;for(li.sort(Wa);i=li.shift();)i.__d&&(e=li.length,r=void 0,s=(n=(t=i).__v).__e,l=[],a=[],(o=t.__P)&&((r=Lt({},n)).__v=n.__v+1,ne.vnode&&ne.vnode(r),Ep(o,r,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??Gi(n),!!(32&n.__u),a),r.__.__k[r.__i]=r,dg(l,r,a),r.__e!=s&&xp(r)),li.length>e&&li.sort(Wa));ys.__r=0}function kp(i,e,t,r,n,s,o,l,a,c,d){var u,p,h,g,m,x=r&&r.__k||bp,S=e.length;for(t.__d=a,ug(t,e,x),a=t.__d,u=0;u<S;u++)(h=t.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(p=h.__i===-1?Va:x[h.__i]||Va,h.__i=u,Ep(i,h,p,n,s,o,l,a,c,d),g=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&yl(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=Sp(h,a,i):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 ug(i,e,t){var r,n,s,o,l,a=e.length,c=t.length,d=c,u=0;for(i.__k=[],r=0;r<a;r++)(n=i.__k[r]=(n=e[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?ra(null,n,null,null,n):ml(n)?ra(_l,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?ra(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=i,n.__b=i.__b+1,l=cg(n,t,o=r+u,d),n.__i=l,s=null,l!==-1&&(d--,(s=t[l])&&(s.__u|=131072)),s==null||s.__v===null?(l==-1&&u--,typeof n.type!="function"&&(n.__u|=65536)):l!==o&&(l===o+1?u++:l>o?d>a-o?u+=l-o:u--:u=l<o&&l==o-1?l-o:0,l!==r+u&&(n.__u|=65536))):(s=t[r])&&s.key==null&&s.__e&&(s.__e==i.__d&&(i.__d=Gi(s)),Ja(s,s,!1),t[r]=null,d--);if(d)for(r=0;r<c;r++)(s=t[r])!=null&&!(131072&s.__u)&&(s.__e==i.__d&&(i.__d=Gi(s)),Ja(s,s))}function Sp(i,e,t){var r,n;if(typeof i.type=="function"){for(r=i.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=i,e=Sp(r[n],e,t));return e}return i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e),e&&e.nextSibling}function cg(i,e,t,r){var n=i.key,s=i.type,o=t-1,l=t+1,a=e[t];if(a===null||a&&n==a.key&&s===a.type)return t;if(r>(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 md(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||lg.test(e)?t:t+"px"}function Zn(i,e,t,r,n){var s;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||md(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||md(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in i?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+s]=t,t?r?t.u=r.u:(t.u=Date.now(),i.addEventListener(e,s?yd:_d,s)):i.removeEventListener(e,s?yd:_d,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 i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,t))}}function _d(i){var e=this.l[i.type+!1];if(i.t){if(i.t<=e.u)return}else i.t=Date.now();return e(ne.event?ne.event(i):i)}function yd(i){return this.l[i.type+!0](ne.event?ne.event(i):i)}function Ep(i,e,t,r,n,s,o,l,a,c){var d,u,p,h,g,m,x,S,_,I,P,U,G,B,T,q=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),s=[l=e.__e=t.__e]),(d=ne.__b)&&d(e);e:if(typeof q=="function")try{if(S=e.props,_=(d=q.contextType)&&r[d.__c],I=d?_?_.props.value:d.__:r,t.__c?x=(u=e.__c=t.__c).__=u.__E:("prototype"in q&&q.prototype.render?e.__c=u=new q(S,I):(e.__c=u=new rs(S,I),u.constructor=q,u.render=hg),_&&_.sub(u),u.props=S,u.state||(u.state={}),u.context=I,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),q.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Lt({},u.__s)),Lt(u.__s,q.getDerivedStateFromProps(S,u.__s))),h=u.props,g=u.state,u.__v=e,p)q.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(q.getDerivedStateFromProps==null&&S!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(S,I),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(S,u.__s,I)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(u.props=S,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(z){z&&(z.__=e)}),P=0;P<u._sb.length;P++)u.__h.push(u._sb[P]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(S,u.__s,I),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,m)})}if(u.context=I,u.props=S,u.__P=i,u.__e=!1,U=ne.__r,G=0,"prototype"in q&&q.prototype.render){for(u.state=u.__s,u.__d=!1,U&&U(e),d=u.render(u.props,u.state,u.context),B=0;B<u._sb.length;B++)u.__h.push(u._sb[B]);u._sb=[]}else do u.__d=!1,U&&U(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++G<25);u.state=u.__s,u.getChildContext!=null&&(r=Lt(Lt({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(m=u.getSnapshotBeforeUpdate(h,g)),kp(i,ml(T=d!=null&&d.type===_l&&d.key==null?d.props.children:d)?T:[T],e,t,r,n,s,o,l,a,c),u.base=e.__e,e.__u&=-161,u.__h.length&&o.push(u),x&&(u.__E=u.__=null)}catch(z){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),ne.__e(z,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=pg(t.__e,e,t,r,n,s,o,a,c);(d=ne.diffed)&&d(e)}function dg(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)yl(t[r],t[++r],t[++r]);ne.__c&&ne.__c(e,i),i.some(function(n){try{i=n.__h,n.__h=[],i.some(function(s){s.call(n)})}catch(s){ne.__e(s,n.__v)}})}function pg(i,e,t,r,n,s,o,l,a){var c,d,u,p,h,g,m,x=t.props,S=e.props,_=e.type;if(_==="svg"&&(n=!0),s!=null){for(c=0;c<s.length;c++)if((h=s[c])&&"setAttribute"in h==!!_&&(_?h.localName===_:h.nodeType===3)){i=h,s[c]=null;break}}if(i==null){if(_===null)return document.createTextNode(S);i=n?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,S.is&&S),s=null,l=!1}if(_===null)x===S||l&&i.data===S||(i.data=S);else{if(s=s&&vp.call(i.childNodes),x=t.props||Va,!l&&s!=null)for(x={},c=0;c<i.attributes.length;c++)x[(h=i.attributes[c]).name]=h.value;for(c in x)h=x[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=h:c==="key"||c in S||Zn(i,c,null,h,n));for(c in S)h=S[c],c=="children"?p=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?g=h:c=="checked"?m=h:c==="key"||l&&typeof h!="function"||x[c]===h||Zn(i,c,h,x[c],n);if(d)l||u&&(d.__html===u.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(u&&(i.innerHTML=""),kp(i,ml(p)?p:[p],e,t,r,n&&_!=="foreignObject",s,o,s?s[0]:t.__k&&Gi(t,0),l,a),s!=null)for(c=s.length;c--;)s[c]!=null&&wp(s[c]);l||(c="value",g!==void 0&&(g!==i[c]||_==="progress"&&!g||_==="option"&&g!==x[c])&&Zn(i,c,g,x[c],!1),c="checked",m!==void 0&&m!==i[c]&&Zn(i,c,m,x[c],!1))}return i}function yl(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){ne.__e(r,t)}}function Ja(i,e,t){var r,n;if(ne.unmount&&ne.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||yl(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){ne.__e(s,e)}r.base=r.__P=null,i.__c=void 0}if(r=i.__k)for(n=0;n<r.length;n++)r[n]&&Ja(r[n],e,t||typeof i.type!="function");t||i.__e==null||wp(i.__e),i.__=i.__e=i.__d=void 0}function hg(i,e,t){return this.constructor(i,t)}vp=bp.slice,ne={__e:function(i,e,t,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(i)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,r||{}),o=n.__d),o)return n.__E=n}catch(l){i=l}throw i}},mp=0,rs.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Lt({},this.state),typeof i=="function"&&(i=i(Lt({},t),this.props)),i&&Lt(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Ga(this))},rs.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Ga(this))},rs.prototype.render=_l,li=[],_p=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Wa=function(i,e){return i.__v.__b-e.__v.__b},ys.__r=0,yp=0;(function(i,e){var t={__c:e="__cC"+yp++,__:i,Consumer:function(r,n){return r.children(n)},Provider:function(r){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,Ga(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)}}),r.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0});var Ir=Ne("[Surveys]"),fg={icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:i=>!!v&&Hi(v.location.href,i),not_regex:i=>!!v&&!Hi(v.location.href,i),exact:i=>v?.location.href===i,is_not:i=>v?.location.href!==i},Xa=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=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);n!=null&&n.startsWith("seenSurvey_")&&t.push(n)}return t})();e.forEach(t=>localStorage.removeItem(t))}loadIfEnabled(){var e,t,r,n=N==null||(e=N.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new jr(this.instance)),(t=N.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"surveys",s=>{var o,l;if(s)return Ir.error("Could not load surveys script",s);this._surveyManager=(o=N.__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 jr(this.instance));var r=this.instance.get_property(da);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:n=>{var s;if(n.statusCode!==200||!n.json)return e([]);var o,l=n.json.surveys||[],a=l.filter(c=>{var d,u,p,h,g,m,x,S,_,I,P,U;return((d=c.conditions)===null||d===void 0?void 0:d.events)&&((u=c.conditions)===null||u===void 0||(p=u.events)===null||p===void 0?void 0:p.values)&&((h=c.conditions)===null||h===void 0||(g=h.events)===null||g===void 0||(m=g.values)===null||m===void 0?void 0:m.length)>0||((x=c.conditions)===null||x===void 0?void 0:x.actions)&&((S=c.conditions)===null||S===void 0||(_=S.actions)===null||_===void 0?void 0:_.values)&&((I=c.conditions)===null||I===void 0||(P=I.actions)===null||P===void 0||(U=P.values)===null||U===void 0?void 0:U.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({[da]:l}),e(l)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(r=>{var n,s=r.filter(a=>!(!a.start_date||a.end_date)).filter(a=>{var c,d,u,p;if(!a.conditions)return!0;var h=(c=a.conditions)===null||c===void 0||!c.url||fg[(d=(u=a.conditions)===null||u===void 0?void 0:u.urlMatchType)!==null&&d!==void 0?d:"icontains"](a.conditions.url),g=(p=a.conditions)===null||p===void 0||!p.selector||R?.querySelector(a.conditions.selector);return h&&g}),o=(n=this._surveyEventReceiver)===null||n===void 0?void 0:n.getSurveys(),l=s.filter(a=>{var c,d,u,p,h,g,m,x,S,_,I;if(!(a.linked_flag_key||a.targeting_flag_key||a.internal_targeting_flag_key||(c=a.feature_flag_keys)!==null&&c!==void 0&&c.length))return!0;var P=!a.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),U=!a.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key),G=((d=a.conditions)===null||d===void 0?void 0:d.events)&&((u=a.conditions)===null||u===void 0||(p=u.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,B=((m=a.conditions)===null||m===void 0?void 0:m.actions)&&((x=a.conditions)===null||x===void 0||(S=x.actions)===null||S===void 0?void 0:S.values)&&((_=a.conditions)===null||_===void 0||(I=_.actions)===null||I===void 0?void 0:I.values.length)>0,T=!G&&!B||o?.includes(a.id),q=this._canActivateRepeatedly(a),z=!(a.internal_targeting_flag_key&&!q)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key),$e=this.checkFlags(a);return P&&U&&z&&T&&$e});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(r=>{var{key:n,value:s}=r;return!n||!s||this.instance.featureFlags.isFeatureEnabled(s)})}getNextSurveyStep(e,t,r){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?tt.End:o;if(s.branching.type===tt.End)return tt.End;if(s.branching.type===tt.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===tt.ResponseBased){if(s.type===ms.SingleChoice){var l,a,c=s.choices.indexOf("".concat(r));if((l=s.branching)!==null&&l!==void 0&&(a=l.responseValues)!==null&&a!==void 0&&a.hasOwnProperty(c)){var d=s.branching.responseValues[c];return Number.isInteger(d)?d:d===tt.End?tt.End:o}}else if(s.type===ms.Rating){var u,p;if(typeof r!="number"||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(m,x){if(x===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(x===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(x===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(x===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")}(r,s.scale);if((u=s.branching)!==null&&u!==void 0&&(p=u.responseValues)!==null&&p!==void 0&&p.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===tt.End?tt.End:o}}return o}return Ir.warn("Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return Z((t=N.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(Ir.warn("init was not called"),!1):N.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Z(this._surveyManager)?Ir.warn("init was not called"):this.getSurveys(t=>{var r=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(r)})}renderSurvey(e,t){Z(this._surveyManager)?Ir.warn("init was not called"):this.getSurveys(r=>{var n=r.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,R?.querySelector(t))})}},bd=Ne("[RateLimiter]"),Ya=class{constructor(e){var t,r;C(this,"serverLimits",{}),C(this,"lastEventRateLimited",!1),C(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{bd.info("".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void bd.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(((r=e.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,r,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(ha))!==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,(r=this.instance.persistence)===null||r===void 0||r.set_property(ha,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},gg=()=>b({initialPathName:De?.pathname||"",referringDomain:re.referringDomain()},re.campaignParams()),Ka=class{constructor(e,t,r){C(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[pa]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=r||gg,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[pa]}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}:{}}},vg=["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;"],wd=function(i,e){if(!i)return!1;var t=i.toLowerCase();return vg.concat(e||[]).some(r=>{var n=r.toLowerCase();return t.indexOf(n)!==-1})},Cp=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&wd(t,e))return!0;try{var r=i?.userAgentData;if(r!=null&&r.brands&&r.brands.some(n=>wd(n?.brand,e)))return!0}catch{}return!!i.webdriver},bs=class{constructor(){this.clicks=[]}isRageClick(e,t,r){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&r-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}},Qn=Ne("[Dead Clicks]"),mg=()=>!0,_g=i=>{var e,t=!((e=i.instance.persistence)===null||e===void 0||!e.get_property(Fd)),r=i.instance.config.capture_dead_clicks;return ui(r)?r:t},ws=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Fd]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,r,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"dead-clicks-autocapture",s=>{s?Qn.error("failed to load script",s):e()})}start(){var e;if(R){if(!this._lazyLoadedDeadClicksAutocapture&&(e=N.__PosthogExtensions__)!==null&&e!==void 0&&e.initDeadClicksAutocapture){var t=de(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=N.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(R),Qn.info("starting...")}}else Qn.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Qn.info("stopping..."))}},yg=Ne("[Heatmaps]"),Za=class{constructor(e){var t;C(this,"rageclicks",new bs),C(this,"_enabledServerSide",!1),C(this,"_initialized",!1),C(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[la]),v?.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return de(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 O(this.instance.config.capture_heatmaps)?O(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;yg.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({[la]: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&&R&&(wt(R,"click",e=>this._onClick(e||v?.event),!1,!0),wt(R,"mousemove",e=>this._onMouseMove(e||v?.event),!1,!0),this.deadClicksCapture=new ws(this.instance,mg,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,a,c){for(var d=l;d&&Es(d)&&!Nt(d,"body");){if(d===c)return!1;if(H(a,v?.getComputedStyle(d).position))return!0;d=ip(d)}return!1}(tp(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:t}}_onClick(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!ed(e.target)){var n=this._getProperties(e,r);(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(b(b({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){ed(e.target)||(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&&!Di(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Qa=class{constructor(e){C(this,"_updateScrollData",()=>{var t,r,n,s;this.context||(this.context={});var o=this.scrollElement(),l=this.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=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,(r=this.context.maxScrollHeight)!==null&&r!==void 0?r:0),this.context.lastContentY=c,this.context.maxContentY=Math.max(c,(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=ae(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var r=v?.document.querySelector(t);if(r)return r}}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}},xd=Ne("[AutoCapture]");function na(i,e){return e.length>i?e.slice(0,i)+"...":e}function bg(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!Es(e));return e}function wg(i,e,t,r){var n=i.tagName.toLowerCase(),s={tag_name:n};Ea.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=na(1024,op(i)):s.$el_text=na(1024,Cs(i)));var o=hs(i);o.length>0&&(s.classes=o.filter(function(d){return d!==""})),X(i.attributes,function(d){var u;if((!rp(i)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!e&&Wi(d.value)&&(u=d.name,!xe(u)||u.substring(0,10)!=="_ngcontent"&&u.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=fl(p).join(" ")),s["attr__"+d.name]=na(1024,p)}});for(var l=1,a=1,c=i;c=bg(c);)l++,c.tagName===i.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function xg(i,e){for(var t,r,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,c=[i],d=i;d.parentNode&&!Nt(d,"body");)Qd(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var u,p=[],h={},g=!1,m=!1;if(X(c,P=>{var U=Ca(P);P.tagName.toLowerCase()==="a"&&(g=P.getAttribute("href"),g=U&&g&&Wi(g)&&g),H(hs(P),"ph-no-capture")&&(m=!0),p.push(wg(P,s,o,l));var G=function(B){if(!Ca(B))return{};var T={};return X(B.attributes,function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var z=q.name.replace("data-ph-capture-attribute-",""),$e=q.value;z&&$e&&Wi($e)&&(T[z]=$e)}}),T}(P);Pe(h,G)}),m)return{props:{},explicitNoCapture:m};if(o||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?p[0].$el_text=op(i):p[0].$el_text=Cs(i)),g){var x,S;p[0].attr__href=g;var _=(x=qi(g))===null||x===void 0?void 0:x.host,I=v==null||(S=v.location)===null||S===void 0?void 0:S.host;_&&I&&_!==I&&(u=g)}return{props:Pe({$event_type:n.type,$ce_version:1},a?{}:{$elements:p},{$elements_chain:jf(p)},(t=p[0])!==null&&t!==void 0&&t.$el_text?{$el_text:(r=p[0])===null||r===void 0?void 0:r.$el_text}:{},u&&n.type==="click"?{$external_click_url:u}:{},h)}}var el=class{constructor(e){C(this,"_initialized",!1),C(this,"_isDisabledServerSide",null),C(this,"rageclicks",new bs),C(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=de(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),r.url_ignorelist=(t=r.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(v&&R){var e=r=>{r=r||v?.event;try{this._captureEvent(r)}catch(n){xd.error("Failed to capture event",n)}},t=r=>{r=r||v?.event,this._captureEvent(r,Jo)};wt(R,"submit",e,!1,!0),wt(R,"change",e,!1,!0),wt(R,"click",e,!1,!0),this.config.capture_copied_text&&(wt(R,"copy",t,!1,!0),wt(R,"cut",t,!1,!0))}}else xd.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({[Dc]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(n=>{var s=R?.querySelectorAll(n);s?.forEach(o=>{e===o&&r.push(n)})}),r}get isEnabled(){var e,t,r=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Dc],n=this._isDisabledServerSide;if(Ut(n)&&!ui(r)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!r;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,n=tp(e);Zd(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=t===Jo;if(n&&Df(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=xg(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===Jo){var c,d=ep(v==null||(c=v.getSelection())===null||c===void 0?void 0:c.toString()),u=e.type||"clipboard";if(!d)return!1;o.$selected_content=d,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Je(R?.querySelectorAll)}},kg=Ne("[TracingHeaders]"),tl=class{constructor(e){C(this,"_restoreXHRPatch",void 0),C(this,"_restoreFetchPatch",void 0),C(this,"_startCapturing",()=>{var t,r,n,s;O(this._restoreXHRPatch)&&((t=N.__PosthogExtensions__)===null||t===void 0||(r=t.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),O(this._restoreFetchPatch)&&((n=N.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,r,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"tracing-headers",s=>{if(s)return kg.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)}},Mt;(function(i){i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED"})(Mt||(Mt={}));var il=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Mt.DENIED:this.storedConsent}isOptedOut(){return this.consent===Mt.DENIED||this.consent===Mt.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"?Mt.GRANTED:e==="0"?Mt.DENIED:Mt.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?fe:xt;var t=e==="localStorage"?xt:fe;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&&!!Rd([He?.doNotTrack,He?.msDoNotTrack,N.doNotTrack],e=>H([!0,1,"1","yes"],e))}},es=Ne("[ExceptionAutocapture]"),rl=class{constructor(e){var t;C(this,"originalOnUnhandledRejectionHandler",void 0),C(this,"startCapturing",()=>{var r,n,s,o;if(v&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=N.__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(c){es.error("failed to start",c),this.stopCapturing()}else es.error("failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[Lc]),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&&(es.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,r;this.hasHandlers&&e(),(t=N.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"exception-autocapture",n=>{if(n)return es.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({[Lc]: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)}},oi=Ne("[Web Vitals]"),kd=9e5,nl=class{constructor(e){var t;C(this,"_enabledServerSide",!1),C(this,"_initialized",!1),C(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),C(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((r,n)=>b(b({},r),{},{["$web_vitals_".concat(n.name,"_event")]:b({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),C(this,"_addToBuffer",r=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(O(s))oi.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this._currentURL();O(o)||(Z(r?.name)||Z(r?.value)?oi.error("Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?oi.error("Ignoring metric with value >= "+this._maxAllowedValue,r):(this.buffer.url!==o&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),O(this.buffer.url)&&(this.buffer.url=o),this.buffer.firstMetricTimestamp=O(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(b(b({},r),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),C(this,"_startCapturing",()=>{var r,n,s,o,l=N.__PosthogExtensions__;O(l)||O(l.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),r&&n&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(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):oi.error("web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Nc]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=de(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 O(r)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[Uc])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(de(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=de(this.instance.config.capture_performance)&&Be(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:kd;return 0<e&&e<=6e4?kd:e}get isEnabled(){var e=de(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return ui(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(oi.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=de(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=de(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Nc]:t}),this.instance.persistence.register({[Uc]:r})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,r,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"web-vitals",s=>{s?oi.error("failed to load script",s):e()})}_currentURL(){var e=v?v.location.href:void 0;return e||oi.error("Could not determine current URL"),e}},Sg={icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!v&&Hi(e.href,i),not_regex:(i,e)=>!!v&&!Hi(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i},sl=class i{constructor(e){var t=this;C(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.getWebExperiments(n=>{i.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,n.forEach(s=>{if(s.feature_flag_key){var o;t._flagToExperiments&&(i.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);xe(l)&&s.variants[l]&&t.applyTransforms(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var a in s.variants){var c=s.variants[a];i.matchesTestVariant(c)&&t.applyTransforms(s.name,a,c.transforms)}})},r)}),this.instance=e,this.instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(e){if(this._is_bot())i.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(Z(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();i.logInfo("applying feature flags",e),e.forEach(t=>{var r;if(this._flagToExperiments&&(r=this._flagToExperiments)!==null&&r!==void 0&&r.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=i.getWindowLocation();if(e!=null&&e.search){var t=us(e?.search,"__experiment_id"),r=us(e?.search,"__experiment_variant");t&&r&&(i.logInfo("previewing web experiments ".concat(t," && ").concat(r)),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(t),r,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.instance.config.disable_web_experiments&&!r)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",transport:"XHR",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var o=s.json.experiments||[];return e(o)}})}showPreviewWebExperiment(e,t,r){var n=r.filter(s=>s.id===e);n&&n.length>0&&(i.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!Z(e.conditions)&&i.matchUrlConditions(e)&&i.matchUTMConditions(e)}static matchUrlConditions(e){var t;if(Z(e.conditions)||Z((t=e.conditions)===null||t===void 0?void 0:t.url))return!0;var r,n,s,o=i.getWindowLocation();return!!o&&((r=e.conditions)===null||r===void 0||!r.url||Sg[(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(Z(e.conditions)||Z((t=e.conditions)===null||t===void 0?void 0:t.utm))return!0;var r=re.campaignParams();if(r.utm_source){var n,s,o,l,a,c,d,u,p,h,g,m,x,S,_,I,P=(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)==r.utm_campaign,U=(a=e.conditions)===null||a===void 0||(c=a.utm)===null||c===void 0||!c.utm_source||((d=e.conditions)===null||d===void 0||(u=d.utm)===null||u===void 0?void 0:u.utm_source)==r.utm_source,G=(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)==r.utm_medium,B=(x=e.conditions)===null||x===void 0||(S=x.utm)===null||S===void 0||!S.utm_term||((_=e.conditions)===null||_===void 0||(I=_.utm)===null||I===void 0?void 0:I.utm_term)==r.utm_term;return P&&G&&B&&U}return!1}static logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];M.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r,n){var s;this._is_bot()?i.logInfo("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?r.forEach(o=>{if(o.selector){var l;i.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),o);var a,c=0,d=(l=document)===null||l===void 0?void 0:l.querySelectorAll(o.selector);d?.forEach(u=>{var p=u;c+=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=i.getWindowLocation())===null||a===void 0?void 0:a.href,$web_experiment_elements_modified:c})}}):(i.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=i.getWindowLocation())===null||s===void 0?void 0:s.href,$web_experiment_elements_modified:0}))}_is_bot(){return He&&this.instance?Cp(He,this.instance.config.custom_blocked_useragents):void 0}},ol=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},Eg=["$set_once","$set"],ai=Ne("[SiteApps]"),al=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 r=this.globalsForEvent(t);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}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,r,n,s,o,l,a;if(!e)throw new Error("Event payload is required");var c={},d=this.instance.get_property("$groups")||[],u=this.instance.get_property("$stored_group_properties")||{};for(var[p,h]of Object.entries(u))c[p]={id:d[p],type:p,properties:h};var{$set_once:g,$set:m}=e;return{event:b(b({},$d(e,Eg)),{},{properties:b(b(b({},e.properties),m?{$set:b(b({},(t=(r=e.properties)===null||r===void 0?void 0:r.$set)!==null&&t!==void 0?t:{}),m)}:{}),g?{$set_once:b(b({},(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:c}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var r=s=>{var o;for(var l of(this.apps[e.id].errored=!s,this.apps[e.id].loaded=!0,ai.info("Site app with id ".concat(e.id," ").concat(s?"loaded":"errored")),s&&this.bufferedInvocations.length&&(ai.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach(a=>{var c;return(c=t.processEvent)===null||c===void 0?void 0:c.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=>{r(s)}});n&&(t.processEvent=n)}catch(s){ai.error("Error while initializing PostHog app with config id ".concat(e.id),s),r(!1)}}onCapturedEvent(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{var n;(n=r.processEvent)===null||n===void 0||n.call(r,t)}catch(s){ai.error("Error while processing event ".concat(e.event," for site app ").concat(r.id),s)}}}onRemoteConfig(e){var t,r,n=this;if(ae(N._POSTHOG_JS_APPS)){if(!this.isEnabled)return void ai.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var s of N._POSTHOG_JS_APPS)this.setupSiteApp(s);var o;N._POSTHOG_JS_APPS.length?this.instance.on("eventCaptured",d=>this.onCapturedEvent(d)):(o=this.stopBuffering)===null||o===void 0||o.call(this)}else if((t=this.stopBuffering)===null||t===void 0||t.call(this),(r=e.siteApps)!==null&&r!==void 0&&r.length)if(this.isEnabled){var l=function(d,u){var p,h;N["__$$ph_site_app_".concat(d)]=n.instance,(p=N.__PosthogExtensions__)===null||p===void 0||(h=p.loadSiteApp)===null||h===void 0||h.call(p,n.instance,u,g=>{if(g)return ai.error("Error while initializing PostHog app with config id ".concat(d),g)})};for(var{id:a,url:c}of e.siteApps)l(a,c)}else ai.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},Dr={},ll=()=>{},Mi="posthog",$p=!sg&&ye?.indexOf("MSIE")===-1&&ye?.indexOf("Mozilla")===-1,Sd=()=>{var i,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=R?.location,t=e?.hostname,!!xe(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:ll,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:De&&xe(De?.search)&&De.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||(i=v.location)===null||i===void 0?void 0:i.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:r=>{var n="Bad HTTP status: "+r.statusCode+" "+r.text;M.error(n)},get_device_id:r=>r,_onCapture:ll,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}},Ed=i=>{var e={};O(i.process_person)||(e.person_profiles=i.process_person),O(i.xhr_headers)||(e.request_headers=i.xhr_headers),O(i.cookie_name)||(e.persistence_name=i.cookie_name),O(i.disable_cookie)||(e.disable_persistence=i.disable_cookie);var t=Pe({},e,i);return ae(i.property_blacklist)&&(O(i.property_denylist)?t.property_denylist=i.property_blacklist:ae(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:M.error("Invalid value for property_denylist config: "+i.property_denylist)),t},ul=class{constructor(){C(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){M.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},xs=class i{constructor(){C(this,"webPerformance",new ul),C(this,"version",Ot.LIB_VERSION),C(this,"_internalEventEmitter",new _s),this.config=Sd(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ba,this.sentryIntegration=e=>function(t,r){var n=gp(t,r);return{name:fp,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new ma(this),this.toolbar=new La(this),this.scrollManager=new Qa(this),this.pageViewManager=new Ha(this),this.surveys=new Xa(this),this.experiments=new sl(this),this.exceptions=new ol(this),this.rateLimiter=new Ya(this),this.requestRouter=new ja(this),this.consent=new il(this),this.people={set:(e,t,r)=>{var n=xe(e)?{[e]:t}:e;this.setPersonProperties(n),r?.({})},set_once:(e,t,r)=>{var n=xe(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",e=>M.info('send "'.concat(e?.event,'"'),e))}init(e,t,r){if(r&&r!==Mi){var n,s=(n=Dr[r])!==null&&n!==void 0?n:new i;return s._init(e,t,r),Dr[r]=s,Dr[Mi][r]=s,s}return this._init(e,t,r)}_init(e){var t,r,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(O(e)||Fc(e))return M.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 M.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(Pe({},Sd(),Ed(s),{name:o,token:e})),this.config.on_xhr_error&&M.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:rt.GZipJS,this.persistence=new Or(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Or(b(b({},this.config),{},{persistence:"sessionStorage"}));var l=b({},this.persistence.props),a=b({},this.sessionPersistence.props);if(this._requestQueue=new Na(_=>this._send_retriable_request(_)),this._retryQueue=new Ua(this),this.__request_queue=[],this.sessionManager=new qa(this),this.sessionPropsManager=new Ka(this.sessionManager,this.persistence),new tl(this).startIfEnabledOrStop(),this.siteApps=new al(this),(t=this.siteApps)===null||t===void 0||t.init(),this.sessionRecording=new Ma(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new el(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Za(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new nl(this),this.exceptionObserver=new rl(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new ws(this,_g),this.deadClicksAutocapture.startIfEnabled(),Ot.DEBUG=Ot.DEBUG||this.config.debug,Ot.DEBUG&&M.info("Starting in debug mode",{this:this,config:s,thisC:b({},this.config),p:l,s:a}),this._sync_opt_out_with_persistence(),((r=s.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var c,d,u=this.config.get_device_id(Dt()),p=(c=s.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?u:s.bootstrap.distinctID;this.persistence.set_property(_t,(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 I,P;return!((I=s.bootstrap)===null||I===void 0||(P=I.featureFlags)===null||P===void 0||!P[_])}).reduce((_,I)=>{var P,U;return _[I]=((P=s.bootstrap)===null||P===void 0||(U=P.featureFlags)===null||U===void 0?void 0:U[I])||!1,_},{}),x=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(_=>m[_]).reduce((_,I)=>{var P,U,G,B;return(P=s.bootstrap)!==null&&P!==void 0&&(U=P.featureFlagPayloads)!==null&&U!==void 0&&U[I]&&(_[I]=(G=s.bootstrap)===null||G===void 0||(B=G.featureFlagPayloads)===null||B===void 0?void 0:B[I]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:x})}if(!this.get_distinct_id()){var S=this.config.get_device_id(Dt());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(_t,"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?ag(this,()=>this._loaded()):this._loaded(),Je(this.config._onCapture)&&this.config._onCapture!==ll&&(M.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this}_onRemoteConfig(e){var t,r,n,s,o,l,a,c,d;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=H(e.supportedCompression,rt.GZipJS)?rt.GZipJS:H(e.supportedCompression,rt.Base64)?rt.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"}),(r=this.siteApps)===null||r===void 0||r.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),(c=this.exceptionObserver)===null||c===void 0||c.onRemoteConfig(e),(d=this.deadClicksAutocapture)===null||d===void 0||d.onRemoteConfig(e)}_loaded(){this.config.advanced_disable_decide||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){M.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new Da(this).call()}_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()||Ui(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&&($p?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=vs(e.url,{ip:this.config.ip?1:0}),e.headers=b({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(t=>{var r,n,s,o=b({},t);o.timeout=o.timeout||6e4,o.url=vs(o.url,{_:new Date().getTime().toString(),ver:Ot.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"XHR",a=(n=(s=Rd(Mr,c=>c.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:Mr[0].method;if(!a)throw new Error("No available transport method");a(o)})(b(b({},e),{},{callback:t=>{var r,n,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(s=this.config).on_request_error)===null||n===void 0||n.call(s,t)),(r=e.callback)===null||r===void 0||r.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],n=[],s=[];Ui(e,l=>{l&&(t=l[0],ae(t)?s.push(l):Je(l)?l.call(this):ae(l)&&t==="alias"?r.push(l):ae(l)&&t.indexOf("capture")!==-1&&Je(this[t])?s.push(l):n.push(l))});var o=function(l,a){Ui(l,function(c){if(ae(c[0])){var d=a;X(c,function(u){d=d[u[0]].apply(d,u.slice(1))})}else this[c[0]].apply(this,c.slice(1))},a)};o(r,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,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!O(e)&&xe(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=r!=null&&r.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=r?.timestamp||o,a={uuid:Dt(),event:e,properties:this._calculate_event_properties(e,t||{},l)};s&&(a.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(a.$set=r?.$set);var c=this._calculate_set_once_properties(r?.$set_once);c&&(a.$set_once=c),(a=ff(a,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,O(r?.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=o);var d=b(b({},a.properties.$set),a.$set);if(Di(d)||this.setPersonPropertiesForFlags(d),!Z(this.config.before_send)){var u=this._runBeforeSend(a);if(!u)return;a=u}this._internalEventEmitter.emit("eventCaptured",a);var p={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),a}M.critical("This capture call is ignored due to client rate limiting.")}}else M.error("No event name provided to posthog.capture")}else M.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,r){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),s=b({},t);if(s.token=this.config.token,e==="$snapshot"){var o=b(b({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!xe(s.distinct_id)&&!Be(s.distinct_id)||Fc(s.distinct_id))&&M.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l=re.properties();if(this.sessionManager){var{sessionId:a,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=a,s.$window_id=c}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===ci.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var d=this.sessionPropsManager.getSessionProps();s=Pe(s,d)}if(!this.config.disable_scroll_properties){var u={};e==="$pageview"?u=this.pageViewManager.doPageView(r):e==="$pageleave"&&(u=this.pageViewManager.doPageLeave(r)),s=Pe(s,u)}if(e==="$pageview"&&R&&(s.title=R.title),!O(n)){var p=r.getTime()-n;s.$duration=parseFloat((p/1e3).toFixed(3))}ye&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Pe({},l,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),ae(this.config.property_denylist)?X(this.config.property_denylist,function(m){delete s[m]}):M.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;h&&(s=h(s,e));var g=this._hasPersonProcessing();return s.$process_person_profile=g,g&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Pe({},this.persistence.get_initial_props(),e||{}),r=this.config.sanitize_properties;return r&&(t=r(t,"$set_once")),Di(t)?void 0:t}register(e,t){var r;(r=this.persistence)===null||r===void 0||r.register(e,t)}register_once(e,t,r){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,t,r)}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,r;return(t=(r=this.sessionManager)===null||r===void 0?void 0:r.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,r){return this.surveys.getNextSurveyStep(e,t,r)}identify(e,t,r){if(!this.__loaded||!this.persistence)return M.uninitializedWarning("posthog.identify");if(Be(e)&&(e=e.toString(),M.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()))M.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(Ar)&&(this.unregister(Ar),this.register({distinct_id:e}));var o=(this.persistence.get_property(_t)||"anonymous")==="anonymous";e!==n&&o?(this.persistence.set_property(_t,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:r||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||r)&&this.setPersonProperties(t,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(as))}}else M.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,r){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:b(b({},n),{},{[e]:t})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===t||r||this.reloadFeatureFlags()}}else M.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._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&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,r,n,s,o;if(M.info("reset"),!this.__loaded)return M.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(r=this.sessionPersistence)===null||r===void 0||r.clear(),(n=this.surveys)===null||n===void 0||n.reset(),(s=this.persistence)===null||s===void 0||s.set_property(_t,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId();var a=this.config.get_device_id(Dt());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:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(e!=null&&e.withTimestamp&&r){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return n;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0);n+="?t=".concat(l)}return n}alias(e,t){return e===this.get_property(Od)?(M.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(O(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ar,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(M.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,r,n,s,o=b({},this.config);de(e)&&(Pe(this.config,Ed(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 Or(b(b({},this.config),{},{persistence:"sessionStorage"})),fe.is_supported()&&fe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Ot.DEBUG=!0,M.info("set_config",{config:e,oldConfig:o,newConfig:b({},this.config)})),(r=this.sessionRecording)===null||r===void 0||r.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,r={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(r).some(Boolean)){var n,s,o,l,a;(n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.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 r,n=new Error("PostHog syntheticException"),s=Je((r=N.__PosthogExtensions__)===null||r===void 0?void 0:r.parseErrorAsProperties)?N.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):b({$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:Mi;return t!==Mi&&(t=Mi+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(_t))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(_t))==="identified"}_hasPersonProcessing(){var e,t,r,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Di(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[Ar])&&((r=this.persistence)===null||r===void 0||(n=r.props)===null||n===void 0||!n[ls]))}_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"?(M.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(ls,!0),!0)}_sync_opt_out_with_persistence(){var e,t,r,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&&((r=this.persistence)===null||r===void 0||r.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(),(O(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 He?Cp(He,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){R&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:R.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(Z(this.config.before_send))return e;var t=ae(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),Z(r)){var s="Event '".concat(e.event,"' was rejected in beforeSend function");return pf(e.event)?M.warn("".concat(s,". This can cause unexpected behavior.")):M.info(s),null}r.properties&&!Di(r.properties)||M.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return r}};(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=hf(i.prototype[e[t]])})(xs,["identify"]);var Cd,Ip=(Cd=Dr[Mi]=new xs,function(){function i(){i.done||(i.done=!0,$p=!1,X(Dr,function(e){e._dom_loaded()}))}R!=null&&R.addEventListener&&(R.readyState==="complete"?i():R.addEventListener("DOMContentLoaded",i,!1)),v&&wt(v,"load",i,!0)}(),Cd);var Ap=Ip.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 Oe(i,e){if(!Ap)throw new Error("Failed to initialize PostHog");Ap.capture(i,e)}var Is,zr,As,qt,Pp,$s,Br=class Br extends V(j){constructor(){super();y(this,qt);y(this,Is,new Tt(this,{onError:console.error}));y(this,zr);y(this,As,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Oe("ShopAssistant: error",t),ce("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Oe("ShopAssistant: user received bot message (streaming started)",t),ce("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Oe("ShopAssistant: user received bot message (streaming ended)",t),ce("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Oe("ShopAssistant: user canceled streaming",t),ce("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Oe("ShopAssistant: user clicked link",t),ce("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Oe("ShopAssistant: user sent input",t),ce("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,zr)||f(this,Is).data}render(){return this.config?D`
400
400
  <!-- embed our chat component forwarding props -->
401
401
  <mw-chat
402
- .config="${{...this.config,widgetId:this.widgetId}}"
403
- .callbacks="${f(this,Ms)}"
402
+ widget="${this.widgetId}"
403
+ .config="${this.config}"
404
+ .callbacks="${f(this,As)}"
404
405
  x-user-data="${this.xUserData}"
405
406
  x-prompt-ext="${this.xPromptExt}"
406
407
  ?show-close="${this.showClose}"
407
- @mw:close-click="${$(this,Wt,Dp)}">
408
+ @mw:close-click="${$(this,qt,Pp)}">
408
409
  <slot name="banner" slot="banner"></slot>
409
410
  </mw-chat>
410
- `:U}injectConfig(t){E(this,Kr,t),this.requestUpdate()}reloadConfig(){f(this,Wt,Os)?.reloadConfig()}get conversationId(){return f(this,Wt,Os)?.conversationId??""}get messages(){return f(this,Wt,Os)?.messages??[]}};Fs=new WeakMap,Kr=new WeakMap,Ms=new WeakMap,Wt=new WeakSet,Dp=function(){this.dispatchEvent(new Xr.CloseClickEvent)},Os=function(){return this.renderRoot.querySelector("mw-chat")},T(Xr,"styles",gt`
411
+ `:L}injectConfig(t){E(this,zr,t),this.requestUpdate()}reloadConfig(){f(this,qt,$s)?.reloadConfig()}get conversationId(){return f(this,qt,$s)?.conversationId??""}get messages(){return f(this,qt,$s)?.messages??[]}};Is=new WeakMap,zr=new WeakMap,As=new WeakMap,qt=new WeakSet,Pp=function(){this.dispatchEvent(new Br.CloseClickEvent)},$s=function(){return this.renderRoot.querySelector("mw-chat")},A(Br,"styles",ct`
411
412
  :host {
412
413
  all: initial; /* reset all properties that can pierce the shadow DOM */
413
414
  }
414
- `),T(Xr,"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 Yr=Xr;customElements.define("molin-shop-ai-chat",Yr);var El;Yr.CloseClickEvent=(El=class extends CustomEvent{constructor(e={}){super(Yr.CloseClickEvent.type,{...e})}},T(El,"type","mw:close-click"),El);var Lp=i=>i??U;var Ds,Zr=class extends J(H){constructor(){super();y(this,Ds,new Mt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return f(this,Ds).data}render(){return this.config?L`
415
+ `),A(Br,"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 Hr=Br;customElements.define("molin-shop-ai-chat",Hr);var bl;Hr.CloseClickEvent=(bl=class extends CustomEvent{constructor(e={}){super(Hr.CloseClickEvent.type,{...e})}},A(bl,"type","mw:close-click"),bl);var Rp=i=>i??L;var Ts,Wr=class extends V(j){constructor(){super();y(this,Ts,new Tt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return f(this,Ts).data}render(){return this.config?D`
415
416
  <!-- embed our bubble component forwarding props -->
416
417
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
417
- <mw-bubble state="${this.state}" src="${Lp(this.config?.bubble?.imageUrl)}"></mw-bubble>
418
- `:U}};Ds=new WeakMap,T(Zr,"styles",gt`
418
+ <mw-bubble state="${this.state}" src="${Rp(this.config?.bubble?.imageUrl)}"></mw-bubble>
419
+ `:L}};Ts=new WeakMap,A(Wr,"styles",ct`
419
420
  :host {
420
421
  all: initial; /* reset all properties that can pierce the shadow DOM */
421
422
  }
422
- `),T(Zr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Zr);var Ls,tr,ir,_i,en,tn,Qr=class{constructor(e,t,r,n=window.history){y(this,Ls);y(this,tr);y(this,ir);y(this,_i);y(this,en,!1);y(this,tn,()=>{f(this,tr).test(window.location.pathname)&&f(this,ir).navigated()});E(this,Ls,e),E(this,tr,t),E(this,ir,r),E(this,_i,n),e.addController(this)}hostConnected(){window.addEventListener("pageshow",f(this,tn));let e=f(this,_i).pushState;f(this,_i).pushState=(...t)=>{if(e.call(f(this,_i),...t),!f(this,en))try{let r=new URL(t[2],window.location.origin);f(this,tr).test(r.pathname)&&f(this,ir).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",f(this,tn)),E(this,en,!0)}};Ls=new WeakMap,tr=new WeakMap,ir=new WeakMap,_i=new WeakMap,en=new WeakMap,tn=new WeakMap;function Np({minMs:i,maxMs:e}){return Math.random()*(e-i)+i}var Vt,ft,$l,rn,Cl=class{constructor(e=window.localStorage){y(this,ft);y(this,Vt);E(this,Vt,e)}setex(e,t,r){return f(this,Vt).setItem(e,$(this,ft,rn).call(this,{value:$(this,ft,rn).call(this,t),expiresAt:Date.now()+r*1e3})||"")}set(e,t){return f(this,Vt).setItem(e,$(this,ft,rn).call(this,{value:$(this,ft,rn).call(this,t)})||"")}get(e){let t=f(this,Vt).getItem(e);if(!t)return;let r=$(this,ft,$l).call(this,t);if(r){if(r.expiresAt&&r.expiresAt<Date.now()){f(this,Vt).removeItem(e);return}return $(this,ft,$l).call(this,r.value)}}};Vt=new WeakMap,ft=new WeakSet,$l=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},rn=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var Il=new Cl;function Al(i,e=""){return Object.entries(i).filter(([t,r])=>r).map(([t,r])=>`${e}${t}-[${r}]`).join(" ")}function Up(i,e={}){return[Al(i),Al(e,"max-sm:")].join(" ")}function jp(i){return Al(i)}function Tl(i){return Object.entries(i).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let r=`sm:${e}-[${t}]`;return e==="left"&&(r+=" sm:right-auto"),e==="right"&&(r+=" sm:left-auto"),r}).join(" ")}function qp(i){let e=Tl(i),r=`sm:bottom-[${i.bottom?`calc(${i.bottom}+72px)`:"72px"}]`;return[e,r].filter(Boolean).join(" ")}var Bp="molin-shop-ai-widget-open",Ns,on,Rl,Ol,de,Us,ne,Hp,sn,Pl,zp,Wp,Vp,rr,nn=class extends J(H){constructor(){super();y(this,ne);y(this,Ns,new Mt(this,{onError:console.error}));y(this,on);y(this,Rl,new Qr(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=f(this,ne,Pl);t&&Ne("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));y(this,Ol,new Qr(this,/.*/i,{navigated:()=>{let t=f(this,ne,Pl);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})}}));y(this,de,!1);y(this,Us,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Ne("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Ne("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Ne("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Ne("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Ne("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Ne("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,on)||f(this,Ns).data}render(){if(!this.config)return U;let t=Up(this.config.bubble.position,this.config.bubble.mobilePosition),r=jp(this.config.bubble.position),n=Tl(this.config.bubble.position),s=qp(this.config.bubble.position);return this.config.hidden?U:L`
423
+ `),A(Wr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Wr);var Ps,Ji,Xi,hi,Gr,Jr,Vr=class{constructor(e,t,r,n=window.history){y(this,Ps);y(this,Ji);y(this,Xi);y(this,hi);y(this,Gr,!1);y(this,Jr,()=>{f(this,Ji).test(window.location.pathname)&&f(this,Xi).navigated()});E(this,Ps,e),E(this,Ji,t),E(this,Xi,r),E(this,hi,n),e.addController(this)}hostConnected(){window.addEventListener("pageshow",f(this,Jr));let e=f(this,hi).pushState;f(this,hi).pushState=(...t)=>{if(e.call(f(this,hi),...t),!f(this,Gr))try{let r=new URL(t[2],window.location.origin);f(this,Ji).test(r.pathname)&&f(this,Xi).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",f(this,Jr)),E(this,Gr,!0)}};Ps=new WeakMap,Ji=new WeakMap,Xi=new WeakMap,hi=new WeakMap,Gr=new WeakMap,Jr=new WeakMap;function Op({minMs:i,maxMs:e}){return Math.random()*(e-i)+i}function wl(i,e=""){return Object.entries(i).filter(([t,r])=>r).map(([t,r])=>`${e}${t}-[${r}]`).join(" ")}function Fp(i,e={}){return[wl(i),wl(e,"max-sm:")].join(" ")}function Mp(i){return wl(i)}function xl(i){return Object.entries(i).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let r=`sm:${e}-[${t}]`;return e==="left"&&(r+=" sm:right-auto"),e==="right"&&(r+=" sm:left-auto"),r}).join(" ")}function Dp(i){let e=xl(i),r=`sm:bottom-[${i.bottom?`calc(${i.bottom}+72px)`:"72px"}]`;return[e,r].filter(Boolean).join(" ")}var jt,ut,Sl,Xr,kl=class{constructor(e=window.localStorage){y(this,ut);y(this,jt);E(this,jt,e)}setex(e,t,r){return f(this,jt).setItem(e,$(this,ut,Xr).call(this,{value:$(this,ut,Xr).call(this,t),expiresAt:Date.now()+r*1e3})||"")}set(e,t){return f(this,jt).setItem(e,$(this,ut,Xr).call(this,{value:$(this,ut,Xr).call(this,t)})||"")}get(e){let t=f(this,jt).getItem(e);if(!t)return;let r=$(this,ut,Sl).call(this,t);if(r){if(r.expiresAt&&r.expiresAt<Date.now()){f(this,jt).removeItem(e);return}return $(this,ut,Sl).call(this,r.value)}}};jt=new WeakMap,ut=new WeakSet,Sl=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Xr=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var El=new kl;var Lp="molin-shop-ai-widget-open",Rs,Zr,$l,Il,le,Os,te,Np,Kr,Cl,Up,qp,jp,Yi,Yr=class extends V(j){constructor(){super();y(this,te);y(this,Rs,new Tt(this,{onError:console.error}));y(this,Zr);y(this,$l,new Vr(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=f(this,te,Cl);t&&Oe("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));y(this,Il,new Vr(this,/.*/i,{navigated:()=>{let t=f(this,te,Cl);ce("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:t?.conversationId||"",url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0})}}));y(this,le,!1);y(this,Os,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Oe("ShopAssistant: error",t),ce("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Oe("ShopAssistant: user received bot message (streaming started)",t),ce("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Oe("ShopAssistant: user received bot message (streaming ended)",t),ce("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Oe("ShopAssistant: user canceled streaming",t),ce("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Oe("ShopAssistant: user clicked link",t),ce("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Oe("ShopAssistant: user sent input",t),ce("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,Zr)||f(this,Rs).data}render(){if(!this.config)return L;let t=Fp(this.config.bubble.position,this.config.bubble.mobilePosition),r=Mp(this.config.bubble.position),n=xl(this.config.bubble.position),s=Dp(this.config.bubble.position);return this.config.hidden?L:D`
423
424
  <mw-bubble
424
- class="${t} ${f(this,de)?"opacity-0":"opacity-100"} fixed z-[${f(this,ne,Hp)}] transition-opacity"
425
- @click="${$(this,ne,Wp)}"
426
- state="${f(this,de)?"close":"open"}"
425
+ class="${t} ${f(this,le)?"opacity-0":"opacity-100"} fixed z-[${f(this,te,Np)}] transition-opacity"
426
+ @click="${$(this,te,qp)}"
427
+ state="${f(this,le)?"close":"open"}"
427
428
  src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
428
429
 
429
430
  <!-- only load the component if enabled on any platform -->
430
- ${this.isPopupEnabled?L`
431
+ ${this.isPopupEnabled?D`
431
432
  <mw-popup
432
433
  position="${s}"
433
- delay="${this.config.popup?.delayMs||Np({minMs:2e3,maxMs:5e3})}"
434
+ delay="${this.config.popup?.delayMs||Op({minMs:2e3,maxMs:5e3})}"
434
435
  sound="https://assets.molinai.io/2024/widget-v20241209/popup.aac"
435
436
  .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}}}"
436
- @mw:click="${$(this,ne,zp)}"></mw-popup>
437
- `:U}
437
+ @mw:click="${$(this,te,Up)}"></mw-popup>
438
+ `:L}
438
439
 
439
440
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
440
- ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?L`<mw-try-it-out
441
+ ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?D`<mw-try-it-out
441
442
  class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
442
443
  position="${r}"
443
- text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:U}
444
+ text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:L}
444
445
 
445
446
  <!-- 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. -->
446
- ${this._dialogAlreadyShown?L`
447
+ ${this._dialogAlreadyShown?D`
447
448
  <div
448
- class="${f(this,de)?"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]">
449
+ class="${f(this,le)?"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]">
449
450
  <mw-chat
450
- .config="${{...this.config,widgetId:this.widgetId}}"
451
- .callbacks="${f(this,Us)}"
451
+ widget="${this.widgetId}"
452
+ .config="${this.config}"
453
+ .callbacks="${f(this,Os)}"
452
454
  ?show-close="${!0}"
453
455
  x-user-data="${this.xUserData}"
454
456
  x-prompt-ext="${this.xPromptExt}"
455
- @mw:close-click="${$(this,ne,Vp)}">
457
+ @mw:close-click="${$(this,te,jp)}">
456
458
  <slot name="banner" slot="banner"></slot>
457
459
  </mw-chat>
458
460
  </div>
459
- `:U}
460
- `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,de)&&f(this,ne,sn)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&Il.get(Bp)?.isOpen&&this.openChat()}openChat(){f(this,de)||(E(this,de,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,ne,rr).call(this,!0),f(this,ne,sn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,de)?"open":"close"}))}closeChat(){f(this,de)&&(E(this,de,!1),this.requestUpdate(),$(this,ne,rr).call(this,!1),f(this,ne,sn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,de)?"open":"close"}))}injectConfig(t){E(this,on,t),this.requestUpdate()}};Ns=new WeakMap,on=new WeakMap,Rl=new WeakMap,Ol=new WeakMap,de=new WeakMap,Us=new WeakMap,ne=new WeakSet,Hp=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},sn=function(){return this.renderRoot.querySelector("mw-popup")},Pl=function(){return this.renderRoot.querySelector("mw-chat")},zp=function(){E(this,de,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,ne,rr).call(this,!0),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:f(this,de)?"open":"close"})},Wp=function(){E(this,de,!f(this,de)),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,ne,rr).call(this,f(this,de)),f(this,ne,sn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:f(this,de)?"open":"close"})},Vp=function(){E(this,de,!1),this.requestUpdate(),$(this,ne,rr).call(this,!1),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:f(this,de)?"open":"close"})},rr=function(t){Il.set(Bp,{isOpen:t})},T(nn,"styles",gt`
461
+ `:L}
462
+ `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,le)&&f(this,te,Kr)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&El.get(Lp)?.isOpen&&this.openChat()}openChat(){f(this,le)||(E(this,le,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,te,Yi).call(this,!0),f(this,te,Kr)?.hide(),ce("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,le)?"open":"close"}))}closeChat(){f(this,le)&&(E(this,le,!1),this.requestUpdate(),$(this,te,Yi).call(this,!1),f(this,te,Kr)?.hide(),ce("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,le)?"open":"close"}))}injectConfig(t){E(this,Zr,t),this.requestUpdate()}};Rs=new WeakMap,Zr=new WeakMap,$l=new WeakMap,Il=new WeakMap,le=new WeakMap,Os=new WeakMap,te=new WeakSet,Np=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},Kr=function(){return this.renderRoot.querySelector("mw-popup")},Cl=function(){return this.renderRoot.querySelector("mw-chat")},Up=function(){E(this,le,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,te,Yi).call(this,!0),ce("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:f(this,le)?"open":"close"})},qp=function(){E(this,le,!f(this,le)),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,te,Yi).call(this,f(this,le)),f(this,te,Kr)?.hide(),ce("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:f(this,le)?"open":"close"})},jp=function(){E(this,le,!1),this.requestUpdate(),$(this,te,Yi).call(this,!1),ce("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:f(this,le)?"open":"close"})},Yi=function(t){El.set(Lp,{isOpen:t})},A(Yr,"styles",ct`
461
463
  :host {
462
464
  all: initial; /* reset all properties that can pierce the shadow DOM */
463
465
  }
464
- `),T(nn,"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",nn);
466
+ `),A(Yr,"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",Yr);
465
467
  /*! Bundled license information:
466
468
 
467
469
  @lit/reactive-element/css-tag.js: