@molin.ai/shop-ai 0.6.37 → 0.6.39

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,26 +1,16 @@
1
- var np=Object.defineProperty;var _a=n=>{throw TypeError(n)};var ip=(n,e,t)=>e in n?np(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var k=(n,e,t)=>ip(n,typeof e!="symbol"?e+"":e,t),Ss=(n,e,t)=>e.has(n)||_a("Cannot "+t);var h=(n,e,t)=>(Ss(n,e,"read from private field"),t?t.call(n):e.get(n)),b=(n,e,t)=>e.has(n)?_a("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),R=(n,e,t,i)=>(Ss(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),$=(n,e,t)=>(Ss(n,e,"access private method"),t);var ba=(n,e,t,i)=>({set _(r){R(n,e,r,t)},get _(){return h(n,e,i)}});var Yi=globalThis,Ki=Yi.ShadowRoot&&(Yi.ShadyCSS===void 0||Yi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Es=Symbol(),wa=new WeakMap,Gn=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Es)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(Ki&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=wa.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&wa.set(t,e))}return e}toString(){return this.cssText}},xa=n=>new Gn(typeof n=="string"?n:n+"",void 0,Es),ht=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((i,r,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1],n[0]);return new Gn(t,n,Es)},$s=(n,e)=>{if(Ki)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=Yi.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},Qi=Ki?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return xa(t)})(n):n;var{is:rp,defineProperty:sp,getOwnPropertyDescriptor:op,getOwnPropertyNames:ap,getOwnPropertySymbols:lp,getPrototypeOf:up}=Object,Zi=globalThis,ka=Zi.trustedTypes,cp=ka?ka.emptyScript:"",pp=Zi.reactiveElementPolyfillSupport,Xn=(n,e)=>n,Cs={toAttribute(n,e){switch(e){case Boolean:n=n?cp:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Ea=(n,e)=>!rp(n,e),Sa={attribute:!0,type:String,converter:Cs,reflect:!1,hasChanged:Ea};Symbol.metadata??=Symbol("metadata"),Zi.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=Sa){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&sp(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=op(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r?.call(this)},set(o){let a=r?.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Sa}static _$Ei(){if(this.hasOwnProperty(Xn("elementProperties")))return;let e=up(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Xn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Xn("properties"))){let t=this.properties,i=[...ap(t),...lp(t)];for(let r of i)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let r of i)t.unshift(Qi(r))}else e!==void 0&&t.push(Qi(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:Cs).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let s=i.getPropertyOptions(r),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Cs;this._$Em=r,this[r]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??Ea)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,s]of i)s.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};vt.elementStyles=[],vt.shadowRootOptions={mode:"open"},vt[Xn("elementProperties")]=new Map,vt[Xn("finalized")]=new Map,pp?.({ReactiveElement:vt}),(Zi.reactiveElementVersions??=[]).push("2.0.4");var As=globalThis,er=As.trustedTypes,$a=er?er.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ts="$lit$",gt=`lit$${Math.random().toFixed(9).slice(2)}$`,Rs="?"+gt,fp=`<${Rs}>`,Jt=document,Yn=()=>Jt.createComment(""),Kn=n=>n===null||typeof n!="object"&&typeof n!="function",Ps=Array.isArray,Pa=n=>Ps(n)||typeof n?.[Symbol.iterator]=="function",Is=`[
2
- \f\r]`,Jn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ca=/-->/g,Ia=/>/g,Gt=RegExp(`>|${Is}(?:([^\\s"'>=/]+)(${Is}*=${Is}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Aa=/'/g,Ta=/"/g,Fa=/^(?:script|style|textarea|title)$/i,Fs=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),P=Fs(1),Zd=Fs(2),eh=Fs(3),nt=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),Ra=new WeakMap,Xt=Jt.createTreeWalker(Jt,129);function Oa(n,e){if(!Ps(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return $a!==void 0?$a.createHTML(e):e}var Da=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":e===3?"<math>":"",o=Jn;for(let a=0;a<t;a++){let l=n[a],u,c,p=-1,f=0;for(;f<l.length&&(o.lastIndex=f,c=o.exec(l),c!==null);)f=o.lastIndex,o===Jn?c[1]==="!--"?o=Ca:c[1]!==void 0?o=Ia:c[2]!==void 0?(Fa.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Gt):c[3]!==void 0&&(o=Gt):o===Gt?c[0]===">"?(o=r??Jn,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Gt:c[3]==='"'?Ta:Aa):o===Ta||o===Aa?o=Gt:o===Ca||o===Ia?o=Jn:(o=Gt,r=void 0);let d=o===Gt&&n[a+1].startsWith("/>")?" ":"";s+=o===Jn?l+fp:p>=0?(i.push(u),l.slice(0,p)+Ts+l.slice(p)+gt+d):l+gt+(p===-2?a:d)}return[Oa(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Qn=class n{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[u,c]=Da(e,t);if(this.el=n.createElement(u,i),Xt.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Xt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(Ts)){let f=c[o++],d=r.getAttribute(p).split(gt),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:g[2],strings:d,ctor:g[1]==="."?nr:g[1]==="?"?ir:g[1]==="@"?rr:Kt}),r.removeAttribute(p)}else p.startsWith(gt)&&(l.push({type:6,index:s}),r.removeAttribute(p));if(Fa.test(r.tagName)){let p=r.textContent.split(gt),f=p.length-1;if(f>0){r.textContent=er?er.emptyScript:"";for(let d=0;d<f;d++)r.append(p[d],Yn()),Xt.nextNode(),l.push({type:2,index:++s});r.append(p[f],Yn())}}}else if(r.nodeType===8)if(r.data===Rs)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(gt,p+1))!==-1;)l.push({type:7,index:s}),p+=gt.length-1}s++}}static createElement(e,t){let i=Jt.createElement("template");return i.innerHTML=e,i}};function Yt(n,e,t=n,i){if(e===nt)return e;let r=i!==void 0?t.o?.[i]:t.l,s=Kn(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t.o??=[])[i]=r:t.l=r),r!==void 0&&(e=Yt(n,r._$AS(n,e.values),r,i)),e}var tr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,r=(e?.creationScope??Jt).importNode(t,!0);Xt.currentNode=r;let s=Xt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new hn(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new sr(s,this,e)),this._$AV.push(u),l=i[++a]}o!==l?.index&&(s=Xt.nextNode(),o++)}return Xt.currentNode=Jt,r}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},hn=class n{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,t,i,r){this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this.v=r?.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),Kn(e)?e===N||e==null||e===""?(this._$AH!==N&&this._$AR(),this._$AH=N):e!==this._$AH&&e!==nt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Pa(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==N&&Kn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Jt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Qn.createElement(Oa(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new tr(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Ra.get(e.strings);return t===void 0&&Ra.set(e.strings,t=new Qn(e)),t}k(e){Ps(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,r=0;for(let s of e)r===t.length?t.push(i=new n(this.O(Yn()),this.O(Yn()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this.v=e,this._$AP?.(e))}},Kt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=N,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=N}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Yt(this,e,t,0),o=!Kn(e)||e!==this._$AH&&e!==nt,o&&(this._$AH=e);else{let a=e,l,u;for(e=s[0],l=0;l<s.length-1;l++)u=Yt(this,a[i+l],t,l),u===nt&&(u=this._$AH[l]),o||=!Kn(u)||u!==this._$AH[l],u===N?e=N:e!==N&&(e+=(u??"")+s[l+1]),this._$AH[l]=u}o&&!r&&this.j(e)}j(e){e===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},nr=class extends Kt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===N?void 0:e}},ir=class extends Kt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==N)}},rr=class extends Kt{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Yt(this,e,t,0)??N)===nt)return;let i=this._$AH,r=e===N&&i!==N||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==N&&(i===N||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},sr=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Yt(this,e)}},Ma={M:Ts,P:gt,A:Rs,C:1,L:Da,R:tr,D:Pa,V:Yt,I:hn,H:Kt,N:ir,U:rr,B:nr,F:sr},dp=As.litHtmlPolyfillSupport;dp?.(Qn,hn),(As.litHtmlVersions??=[]).push("3.2.0");var La=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new hn(e.insertBefore(Yn(),s),s,void 0,t??{})}return r._$AI(n),r};var q=class extends vt{constructor(){super(...arguments),this.renderOptions={host:this},this.o=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.o=La(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return nt}};q._$litElement$=!0,q.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:q});var hp=globalThis.litElementPolyfillSupport;hp?.({LitElement:q});(globalThis.litElementVersions??=[]).push("4.1.0");function Hs(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function vp(n,e=","){return n.map(Hs).join(e)}var za=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function or(n){for(var e=9,t=n.length;t--;)e=Math.imul(e^n.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function ur(n,e="@media "){return e+Z(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function Z(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function Na(n){return n}function cr(){}var ce={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Wa(n){return n.match(/[-=:;]/g)?.length||0}function Ns(n){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(n)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(Wa(n),15)<<18}var gp=["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 zs({n,i:e,v:t=[]},i,r,s){n&&(n=Hs({n,i:e,v:t})),s=[...Z(s)];for(let a of t){let l=i.theme("screens",a);for(let u of Z(l&&ur(l)||i.v(a))){var o;s.push(u),r|=l?67108864|Ns(u):a=="dark"?1073741824:u[0]=="@"?Ns(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~gp.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var Va=new Map;function js(n){if(n.d){let e=[],t=Os(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?Os(i,s=>Os(r,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):Ds(s,o)}return Ds(o,s)})):i,"&"),i=>Ds(i,n.n?"."+za(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function Os(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function Ds(n,e){return n.replace(/&/g,e)}var ja=new Intl.Collator("en",{numeric:!0});function Ga(n,e){for(var t=0,i=n.length;t<i;){let r=i+t>>1;0>=Xa(n[r],e)?t=r+1:i=r}return i}function Xa(n,e){let t=n.p&ce.o;return t==(e.p&ce.o)&&(t==ce.b||t==ce.o)?0:n.p-e.p||n.o-e.o||ja.compare(qa(n.n),qa(e.n))||ja.compare(Ua(n.n),Ua(e.n))}function qa(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function Ua(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ms(n,e){return Math.round(parseInt(n,16)*e)}function Ve(n,e={}){if(typeof n=="function")return n(e);let{opacityValue:t="1",opacityVariable:i}=e,r=i?`var(${i})`:t;if(n.includes("<alpha-value>"))return n.replace("<alpha-value>",r);if(n[0]=="#"&&(n.length==4||n.length==7)){let s=(n.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Ms(n.substr(1,s),o),Ms(n.substr(1+s,s),o),Ms(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function Ja(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:u=[],i:c},p){let f=[],d="",g=0,m=0;for(let C in o||{}){var E,L;let M=o[C];if(C[0]=="@"){if(!M)continue;if(C[1]=="a"){f.push(...Vs(a,l,lr(""+M),p,l,u,c,!0));continue}if(C[1]=="l"){for(let D of Z(M))f.push(...s(D,{n:a,p:(E=ce[C[7]],l&~ce.o|E),r:C[7]=="d"?[]:u,i:c},p));continue}if(C[1]=="i"){f.push(...Z(M).map(D=>({p:-1,o:0,r:[],d:C+" "+D})));continue}if(C[1]=="k"){f.push({p:ce.d,o:0,r:[C],d:s(M,{p:ce.d},p).map(js).join("")});continue}if(C[1]=="f"){f.push(...Z(M).map(D=>({p:ce.d,o:0,r:[C],d:s(D,{p:ce.d},p).map(js).join("")})));continue}}if(typeof M!="object"||Array.isArray(M))C=="label"&&M?a=M+or(JSON.stringify([l,c,o])):(M||M===0)&&(C=C.replace(/[A-Z]/g,D=>"-"+D.toLowerCase()),m+=1,g=Math.max(g,(L=C)[0]=="-"?0:Wa(L)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(L)?+!!RegExp.$1||-!!RegExp.$2:0)+1),d+=(d?";":"")+Z(M).map(D=>p.s(C,Ws(""+D,p.theme)+(c?" !important":""))).join(";"));else if(C[0]=="@"||C.includes("&")){let D=l;C[0]=="@"&&(C=C.replace(/\bscreen\(([^)]+)\)/g,(U,G)=>{let X=p.theme("screens",G);return X?(D|=67108864,ur(X,"")):U}),D|=Ns(C)),f.push(...s(M,{n:a,p:D,r:[...u,C],i:c},p))}else f.push(...s(M,{p:l,r:[...u,C]},p))}return f.unshift({n:a,p:l,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:u,d}),f.sort(Xa)}(n,zs(e,t,i,r),t)}function Ws(n,e){return n.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,r,s,o="")=>{let a=e(r,o);return typeof a=="function"&&/color|fill|stroke/i.test(r)?Ve(a):""+Z(a).filter(l=>Object(l)!==l)})}function Ya(n,e){let t,i=[];for(let r of n)r.d&&r.n?t?.p==r.p&&""+t.r==""+r.r?(t.c=[t.c,r.c].filter(Boolean).join(" "),t.d=t.d+";"+r.d):i.push(t={...r,n:r.n&&e}):i.push({...r,n:r.n&&e});return i}function ar(n,e,t=ce.u,i,r){let s=[];for(let o of n)for(let a of function(l,u,c,p,f){l={...l,i:l.i||f};let d=function(g,m){let E=Va.get(g.n);return E?E(g,m):m.r(g.n,g.v[0]=="dark")}(l,u);return d?typeof d=="string"?({r:p,p:c}=zs(l,u,c,p),Ya(ar(lr(d),u,c,p,l.i),l.n)):Array.isArray(d)?d.map(g=>{var m,E;return{o:0,...g,r:[...Z(p),...Z(g.r)],p:(m=c,E=g.p??c,m&~ce.o|E)}}):Ja(d,l,u,c,p):[{c:Hs(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(Ga(s,a),0,a);return s}function Vs(n,e,t,i,r,s,o,a){return Ya((a?t.flatMap(l=>ar([l],i,r,s,o)):ar(t,i,r,s,o)).map(l=>l.p&ce.o&&(l.n||e==ce.b)?{...l,p:l.p&~ce.o|e,o:0}:l),n)}function mp(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:u,i:c}=zs(s,o,e);return t&&Vs(a,e,t,o,l,u,c,i)},Va.set(n,r),n}function Ls(n,e,t){if(n[n.length-1]!="("){let i=[],r=!1,s=!1,o="";for(let a of n)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),r=!r),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(yp),i:r}))}}function yp(n,e,t){return t.indexOf(n)==e}var Ba=new Map;function lr(n){let e=Ba.get(n);if(!e){let t=[],i=[[]],r=0,s=0,o=null,a=0,l=(u,c=0)=>{r!=a&&(t.push(n.slice(r,a+c)),u&&Ls(t,i)),r=a+1};for(;a<n.length;a++){let u=n[a];if(s)n[a-1]!="\\"&&(s+=+(u=="[")||-(u=="]"));else if(u=="[")s+=1;else if(o)n[a-1]!="\\"&&o.test(n.slice(a))&&(o=null,r=a+RegExp.lastMatch.length);else if(u=="/"&&n[a-1]!="\\"&&(n[a+1]=="*"||n[a+1]=="/"))o=n[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(u=="(")l(),t.push(u);else if(u==":")n[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(u)){l(!0);let c=t.lastIndexOf("(");if(u==")"){let p=t[c-1];if(/[~@]$/.test(p)){let f=i.shift();t.length=c,Ls([...t,"#"],i);let{v:d}=i[0].pop();for(let g of f)g.v.splice(+(g.v[0]=="dark")-+(d[0]=="dark"),d.length);Ls([...t,mp(p.length>1?p.slice(0,-1)+or(JSON.stringify([p,f])):p+"("+vp(f)+")",ce.a,f,/@$/.test(p))],i)}c=t.lastIndexOf("(",c-1)}t.length=c+1}else/[~@]/.test(u)&&n[a+1]=="("&&i.unshift([])}l(!0),Ba.set(n,e=i[0])}return e}function w(n,e,t){return[n,qs(e,t)]}function qs(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):Us(t,1)}):t=>n||{[t[1]]:Us(t,2)}}function Us(n,e,t=n.slice(e).find(Boolean)||n.$$||n.input){return n.input[0]=="-"?`calc(${t} * -1)`:t}function x(n,e,t,i){return[n,Gs(e,t,i)]}function Gs(n,e,t){let i=typeof e=="string"?(r,s)=>({[e]:t?t(r,s):r._}):e||(({1:r,_:s},o,a)=>({[r||a]:s}));return(r,s)=>{let o=Ka(n||r[1]),a=s.theme(o,r.$$)??ut(r.$$,o,s);if(a!=null)return r._=Us(r,0,a),i(r,s,o)}}function pe(n,e={},t){return[n,_p(e,t)]}function _p(n={},e){return(t,i)=>{let{section:r=Ka(t[0]).replace("-","")+"Color"}=n,[s,o]=bp(t.$$);if(!s)return;let a=i.theme(r,s)||ut(s,r,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:u=r.replace("Color","Opacity"),property:c=r,selector:p}=n,f=i.theme(u,o||"DEFAULT")||o&&ut(o,u,i),d=e||(({_:m})=>{let E=Zn(c,m);return p?{[p]:E}:E});t._={value:Ve(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:m=>Ve(a,m),opacityVariable:l||void 0,opacityValue:f||void 0};let g=d(t,i);if(!t.dark){let m=i.d(r,s,a);m&&m!==a&&(t._={value:Ve(m,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:E=>Ve(m,E),opacityVariable:l||void 0,opacityValue:f||void 0},g={"&":g,[i.v("dark")]:d(t,i)})}return g}}function bp(n){return(n.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Zn(n,e){let t={};return typeof e=="string"?t[n]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[n]=e.value),t}function ut(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=vn(Ws(n.slice(1,-1),t.theme)),!e)return n;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(n)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(n))||/image/i.test(e)&&!(/^image:/.test(n)||/^[a-z-]+\(/.test(n))||/weight/i.test(e)&&!(/^(number|any):/.test(n)||/^\d+$/.test(n))||/position/i.test(e)&&/^(length|size):/.test(n)))return n.replace(/^[a-z-]+:/,"")}}function Ka(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function vn(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>vn(t)+i+vn(r)):n.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 ei({presets:n=[],...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:(i,r)=>i+":"+r,finalize:[]};for(let i of Z([...n,{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:r,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:a,variants:l,rules:u,ignorelist:c,hash:p=t.hash,stringify:f=t.stringify,finalize:d}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&r!==!1&&[...t.preflight,...Z(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...Z(l)],rules:[...t.rules,...Z(u)],ignorelist:[...t.ignorelist,...Z(c)],hash:p,stringify:f,finalize:[...t.finalize,...Z(d)]}}return t}function Ha(n,e,t,i,r,s){for(let o of e){let a=t.get(o);a||t.set(o,a=i(o));let l=a(n,r,s);if(l)return l}}function wp(n){var e;return Bs(n[0],typeof(e=n[1])=="function"?e:()=>e)}function xp(n){var e,t;return Array.isArray(n)?Bs(n[0],qs(n[1],n[2])):Bs(n,qs(e,t))}function Bs(n,e){return Qa(n,(t,i,r,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,r)})}function Qa(n,e){let t=Z(n).map(kp);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function kp(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function Za(n,e){let t=ei(n),i=function({theme:l,darkMode:u,darkColor:c=cr,variants:p,rules:f,hash:d,stringify:g,ignorelist:m,finalize:E}){let L=new Map,C=new Map,M=new Map,D=new Map,U=Qa(m,(T,J)=>J.test(T));p.push(["dark",Array.isArray(u)||u=="class"?`${Z(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let G=typeof d=="function"?T=>d(T,or):d?or:Na;G!==Na&&E.push(T=>({...T,n:T.n&&G(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(J,K)=>"--"+G(K).replace("#",""))}));let X={theme:function({extend:T={},...J}){let K={},tt={get colors(){return ve("colors")},theme:ve,negative(){return{}},breakpoints(Y){let ne={};for(let ue in Y)typeof Y[ue]=="string"&&(ne["screen-"+ue]=Y[ue]);return ne}};return ve;function ve(Y,ne,ue,Me){if(Y){if({1:Y,2:Me}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Y)||[,Y],/[.[]/.test(Y)){let Ee=[];Y.replace(/\[([^\]]+)\]|([^.[]+)/g,(ie,ge,Ie=ge)=>Ee.push(Ie)),Y=Ee.shift(),ue=ne,ne=Ee.join("-")}let oe=K[Y]||Object.assign(Object.assign(K[Y]={},We(J,Y)),We(T,Y));if(ne==null)return oe;ne||(ne="DEFAULT");let Se=oe[ne]??ne.split("-").reduce((Ee,ie)=>Ee?.[ie],oe)??ue;return Me?Ve(Se,{opacityValue:Ws(Me,ve)}):Se}let qe={};for(let oe of[...Object.keys(J),...Object.keys(T)])qe[oe]=ve(oe);return qe}function We(Y,ne){let ue=Y[ne];return typeof ue=="function"&&(ue=ue(tt)),ue&&/color|fill|stroke/i.test(ne)?function Me(qe,oe=[]){let Se={};for(let Ee in qe){let ie=qe[Ee],ge=[...oe,Ee];Se[ge.join("-")]=ie,Ee=="DEFAULT"&&(ge=oe,Se[oe.join("-")]=ie),typeof ie=="object"&&Object.assign(Se,Me(ie,ge))}return Se}(ue):ue}}(l),e:za,h:G,s(T,J){return g(T,J,X)},d(T,J,K){return c(T,J,X,K)},v(T){return L.has(T)||L.set(T,Ha(T,p,C,wp,X)||"&:"+T),L.get(T)},r(T,J){let K=JSON.stringify([T,J]);return M.has(K)||M.set(K,!U(T,X)&&Ha(T,f,D,xp,X,J)),M.get(K)},f(T){return E.reduce((J,K)=>K(J,X),T)}};return X}(t),r=new Map,s=[],o=new Set;e.resume(l=>r.set(l,l),(l,u)=>{e.insert(l,s.length,u),s.push(u),o.add(l)});function a(l){let u=i.f(l),c=js(u);if(c&&!o.has(c)){o.add(c);let p=Ga(s,l);e.insert(c,p,l),s.splice(p,0,l)}return u.n}return Object.defineProperties(function(u){if(!r.size)for(let p of Z(t.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?Vs("",ce.b,lr(p),i,ce.b,[],!1,!0):Ja(p,{},i,ce.b)).forEach(a);u=""+u;let c=r.get(u);if(!c){let p=new Set;for(let f of ar(lr(u),i))p.add(f.c).add(a(f));c=[...p].filter(Boolean).join(" "),r.set(u,c).set(c,c)}return c},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let l=e.snapshot(),u=new Set(o),c=new Map(r),p=[...s];return()=>{l(),o=u,r=c,s=p}},clear(){e.clear(),o=new Set,r=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Sp(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function el(n){let e=new MutationObserver(t);return{observe(r){e.observe(r,{attributeFilter:["class"],subtree:!0,childList:!0}),i(r),t([{target:r,type:""}])},disconnect(){e.disconnect()}};function t(r){for(let{type:s,target:o}of r)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(r){let s,o=r.getAttribute?.("class");o&&Sp(o,s=n(o))&&r.setAttribute("class",s)}}function Ep(n){let e=document.querySelector(n||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function pr(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:Ep(n)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,i){try{e.insertRule(t,i)}catch{e.insertRule(":root{}",i)}},resume:cr}}var $p=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 tl(n){return $p.get(n)}function nl(n){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(n);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function il(n,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(n);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 Cp=[["-webkit-",1],["-moz-",2],["-ms-",4]];function fr(){return({stringify:n})=>({stringify(e,t,i){let r="",s=tl(e);s&&(r+=n(s,t,i)+";");let o=nl(e),a=il(e,t);for(let l of Cp)o&l[1]&&(r+=n(l[0]+e,t,i)+";"),a&l[1]&&(r+=n(e,l[0]+t,i)+";");return r+n(e,t,i)}})}function dr(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Gs("lineClamp",({_:n})=>rl(n))],["line-clamp-(\\d+)",({1:n})=>rl(n)]]}}function rl(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var ni={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",...Ue(4,"rem",4,.5,.5),...Ue(12,"rem",4,5),14:"3.5rem",...Ue(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:H("blur"),backdropBrightness:H("brightness"),backdropContrast:H("contrast"),backdropGrayscale:H("grayscale"),backdropHueRotate:H("hueRotate"),backdropInvert:H("invert"),backdropOpacity:H("opacity"),backdropSaturate:H("saturate"),backdropSepia:H("sepia"),backgroundColor:H("colors"),backgroundImage:{none:"none"},backgroundOpacity:H("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:{...Ue(200,"",100,0,50),...Ue(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:H("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:H("spacing"),borderWidth:{DEFAULT:"1px",...Ge(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:H("colors"),caretColor:H("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...Ue(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:H("borderColor"),divideOpacity:H("borderOpacity"),divideWidth:H("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:n})=>({...n("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:n})=>({...n("spacing"),...ti(2,6),...ti(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:H("spacing"),gradientColorStops:H("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:n})=>({...n("spacing"),...ti(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:n})=>({...n("spacing"),...ti(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:{...Ue(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:n})=>({auto:"auto",...n("spacing")}),maxHeight:({theme:n})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...n("spacing")}),maxWidth:({theme:n,breakpoints:e})=>({...e(n("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:{...Ue(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:H("spacing"),placeholderColor:H("colors"),placeholderOpacity:H("opacity"),outlineColor:H("colors"),outlineOffset:Ge(8,"px"),outlineWidth:Ge(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:H("colors"),ringOffsetWidth:Ge(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ge(8,"px")},rotate:{...Ge(2,"deg"),...Ge(12,"deg",3),...Ge(180,"deg",45)},saturate:Ue(200,"",100,0,50),scale:{...Ue(150,"",100,0,50),...Ue(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:H("spacing"),scrollPadding:H("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ge(2,"deg"),...Ge(12,"deg",3)},space:H("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:Ue(2),textColor:H("colors"),textDecorationColor:H("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ge(8,"px")},textUnderlineOffset:{auto:"auto",...Ge(8,"px")},textIndent:H("spacing"),textOpacity:H("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:H("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:n})=>({...n("spacing"),...ti(2,4),full:"100%"}),width:({theme:n})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...n("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Ue(50,"",1,0,10),auto:"auto"}};function ti(n,e){let t={};do for(var i=1;i<n;i++)t[`${i}/${n}`]=Number((i/n*100).toFixed(6))+"%";while(++n<=e);return t}function Ge(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function Ue(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function H(n){return({theme:e})=>e(n)}var sl={"*,::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, ${ni.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, ${ni.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 pl=[w("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:ut(`[${e}]`,"",t)}}})),w("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),x("aspect-","aspectRatio"),w("container",(n,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:r}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in t){let l=t[a];typeof l=="string"&&(s[ur(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=r&&(typeof r=="string"?r:r[a]||r.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),x("content-","content",({_:n})=>({"--tw-content":n,content:"var(--tw-content)"})),w("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),w("box-(border|content)","boxSizing",({1:n})=>n+"-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"),x("object-","objectPosition"),w("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",hr),w("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),w("(static|fixed|absolute|relative|sticky)","position"),x("-?inset(-[xy])?(?:$|-)","inset",({1:n,_:e})=>({top:n!="-x"&&e,right:n!="-y"&&e,bottom:n!="-x"&&e,left:n!="-y"&&e})),x("-?(top|bottom|left|right)(?:$|-)","inset"),w("(visible|collapse)","visibility"),w("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),w("flex-((row|col)(-reverse)?)","flexDirection",ol),w("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),x("(flex-(?:grow|shrink))(?:$|-)"),x("(flex)-"),x("grow(?:$|-)","flexGrow"),x("shrink(?:$|-)","flexShrink"),x("basis-","flexBasis"),x("-?(order)-"),"-?(order)-(\\d+)",x("grid-cols-","gridTemplateColumns"),w("grid-cols-(\\d+)","gridTemplateColumns",cl),x("col-","gridColumn"),w("col-(span)-(\\d+)","gridColumn",ul),x("col-start-","gridColumnStart"),w("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),w("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),w("grid-rows-(\\d+)","gridTemplateRows",cl),x("row-","gridRow"),w("row-(span)-(\\d+)","gridRow",ul),x("row-start-","gridRowStart"),w("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),w("row-end-(auto|\\d+)","gridRowEnd"),w("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>hr(ol(n))),w("grid-flow-(dense)","gridAutoFlow"),x("auto-cols-","gridAutoColumns"),x("auto-rows-","gridAutoRows"),x("gap-x(?:$|-)","gap","columnGap"),x("gap-y(?:$|-)","gap","rowGap"),x("gap(?:$|-)","gap"),"(justify-(?:items|self))-",w("justify-","justifyContent",al),w("(content|items|self)-",n=>({["align-"+n[1]]:al(n)})),w("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),x("p([xytrbl])?(?:$|-)","padding",gn("padding")),x("-?m([xytrbl])?(?:$|-)","margin",gn("margin")),x("-?space-(x|y)(?:$|-)","space",({1:n,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[n]]:`calc(${e} * calc(1 - var(--tw-space-${n}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[n]]:`calc(${e} * var(--tw-space-${n}-reverse))`}})),w("space-(x|y)-reverse",({1:n})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"1"}})),x("w-","width"),x("min-w-","minWidth"),x("max-w-","maxWidth"),x("h-","height"),x("min-h-","minHeight"),x("max-h-","maxHeight"),x("font-","fontWeight"),x("font-","fontFamily",({_:n})=>typeof(n=Z(n))[1]=="string"?{fontFamily:it(n)}:{fontFamily:it(n[0]),...n[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:n,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":n)]:n,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...At({"--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,/*!*/ /*!*/)"})}),x("tracking-","letterSpacing"),x("leading-","lineHeight"),w("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),w("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),pe("placeholder-",{property:"color",selector:"&::placeholder"}),w("text-(left|center|right|justify|start|end)","textAlign"),w("text-(ellipsis|clip)","textOverflow"),x("text-opacity-","textOpacity","--tw-text-opacity"),pe("text-",{property:"color"}),x("text-","fontSize",({_:n})=>typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}),x("indent-","textIndent"),w("(overline|underline|line-through)","textDecorationLine"),w("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),pe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("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"}),pe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),pe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),w("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${Qt(n," ")},var(--tw-gradient-stops))`),pe("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-from":n.value,"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),pe("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${n.value},var(--tw-gradient-to)`})),pe("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:n})=>n+"-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:n})=>n+(n=="text"?"":"-box")),x("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),pe("bg-",{section:"backgroundColor"}),x("bg-","backgroundImage"),x("bg-","backgroundPosition"),w("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",hr),x("bg-","backgroundSize"),x("rounded(?:$|-)","borderRadius"),x("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:n,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[n]||[n,n];return{[`border-${Qt(t[0])}-radius`]:e,[`border-${Qt(t[1])}-radius`]:e}}),w("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),w("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...At({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(n||"-x")]:e,["--tw-border-spacing"+(n||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),pe("border-([xytrbl])-",{section:"borderColor"},gn("border","Color")),pe("border-"),x("border-([xytrbl])(?:$|-)","borderWidth",gn("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),w("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),w("divide-([xy]-reverse)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+n]:"1"}})),x("divide-([xy])(?:$|-)","divideWidth",({1:n,_:e})=>{let t={x:"lr",y:"tb"}[n];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${n}-reverse`]:"0",[`border-${Qt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${Qt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${n}-reverse))`}}}),pe("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),x("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),pe("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),x("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),w("ring-inset",{"--tw-ring-inset":"inset"}),pe("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:n},{theme:e})=>({...At({"--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":Ve(e("ringOffsetColor","","#fff")),"--tw-ring-color":Ve(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(${n} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),pe("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-shadow-color":n.value,"--tw-shadow":"var(--tw-shadow-colored)"})),x("shadow(?:$|-)","boxShadow",({_:n})=>({...At({"--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":it(n),"--tw-shadow-colored":it(n).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)"})),x("(opacity)-"),w("mix-blend-","mixBlendMode"),...ll(),...ll("backdrop-"),x("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:it(n),transitionTimingFunction:n._=="none"?void 0:it(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:it(e("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",it),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",it),x("delay(?:$|-)","transitionDelay","transitionDelay",it),x("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=it(n),s=r.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:r}}),"(transform)-(none)",w("transform",Js),w("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":fl(n=="gpu")})),x("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...Js()})),x("-?(rotate)-","rotate",Xs),x("-?(translate-[xy])-","translate",Xs),x("-?(skew-[xy])-","skew",Xs),w("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",hr),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",w("snap-(none)","scroll-snap-type"),w("snap-(x|y|both)",({1:n})=>({...At({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" 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"),x("scroll-p([xytrbl])?(?:$|-)","padding",gn("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",gn("scroll-margin")),w("touch-(auto|none|manipulation)","touch-action"),w("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,2:e,3:t})=>({...At({"--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":n}`]:n,"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"),x("-?(outline-offset)-"),pe("outline-",{opacityVariable:!1,opacitySection:"opacity"}),x("outline-","outlineWidth"),"(pointer-events)-",x("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:n})=>({x:"horizontal",y:"vertical"})[n]||n||"both"],w("select-(none|text|all|auto)","userSelect"),pe("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),pe("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),x("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 hr(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function ol(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function Qt(n,e="-"){let t=[];for(let i of n)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function it(n){return n&&""+(n._||n)}function al({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function gn(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...Zn(n+"-"+Qt(r[0])+e,i),...Zn(n+"-"+Qt(r[1])+e,i)}:Zn(n+e,i)}}function ll(n=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",n&&"opacity","saturate","sepia",!n&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${n}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...At(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,w(`${n}filter`,t),...e.map(i=>x(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:Z(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function Xs({1:n,_:e}){return{["--tw-"+n]:e,...Js()}}function Js(){return{...At({"--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":fl()}),transform:"var(--tw-transform)"}}function fl(n){return[n?"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 ul({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function cl({1:n}){return`repeat(${n},minmax(0,1fr))`}function At(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var dl=[["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:n})=>`@media (orientation:${n})`],["contrast-(more|less)",({1:n})=>`@media (prefers-contrast:${n})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:n})=>`&::${n}`],["(marker|selection)",({1:n})=>`& *::${n},&::${n}`],["file","&::file-selector-button"],["(first|last|only)",({1:n})=>`&:${n}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:n,$$:e},t)=>e&&`&[${n}-${t.theme(n,e)||ut(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:n,3:e="",4:t,5:i="",6:r=e},{e:s,h:o,v:a})=>{let l=vn(i)||(t[0]=="["?t:a(t.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(n+r))})`)}${n[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:n})=>`[dir="${n}"] &`],["supports-",({$$:n},e)=>{if(n&&(n=e.theme("supports",n)||ut(n,"",e)),n)return n.includes(":")||(n+=":var(--tw)"),/^\w*\s*\(/.test(n)||(n=`(${n})`),`@supports ${n.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:n},e)=>{if(n&&(n=e.theme("screens",n)||ut(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=ut(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&vn(n).replace(/[}]+$/,"").split("{")]];function hl({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:sl,theme:{...ni,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:dl,rules:pl,finalize(t){return t.n&&t.d&&t.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var Ip={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Ap={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Tp={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Rp={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Pp={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Fp={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Op={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Dp={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Mp={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Lp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Np={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},jp={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},qp={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Up={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Bp={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Hp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},zp={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Wp={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Vp={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Gp={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Xp={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Jp={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},vl={__proto__:null,slate:Ip,gray:Ap,zinc:Tp,neutral:Rp,stone:Pp,red:Fp,orange:Op,amber:Dp,yellow:Mp,lime:Lp,green:Np,emerald:jp,teal:qp,cyan:Up,sky:Bp,blue:Hp,indigo:zp,violet:Wp,purple:Vp,fuchsia:Gp,pink:Xp,rose:Jp};function vr({disablePreflight:n}={}){return hl({colors:vl,disablePreflight:n})}function gr({className:n="prose",defaultColor:e="gray",extend:t={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${n}-${s}`,(a,l)=>yl(n,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,u=>`& :is(${u.trim()})`)]),rules:[[`(lead|not-${n})`,({1:s},{h:o})=>[{c:o(s)}]],[`${n}-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)"}}],[n+"-",({$$:s},o)=>{let a=ml(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[gl(n,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"}}),gl(n,o,t)],"@layer components":{...ml(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function r(s,o){let a={},l={},u=(c,p,f)=>{let d=o.theme(`colors.${s}.${p}`,p);f["--tw-prose-"+c]=Ve(d);let g=f!=l&&o.d("colors",`${s}-${p}`,d);g&&(l["--tw-prose-"+c]=Ve(g))};for(let c in i){let p=i[c];c!="dark"&&p&&u(c,p,a)}for(let c in i.dark||{}){let p=i.dark[c];p&&(i.dark?u("invert-"+c,p,a):u(c,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function gl(n,e,t){let i={};for(let r in t)i[yl(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function yl(n,e,{e:t,h:i},r){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>r(`${o}:where(${a}):not(:where(.${t(i("not-"+n))} *))${l}`))}function ml(n){return n?typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}:void 0}function F(n,e){return`${(n/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Ys=ei({hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}}}},presets:[vr(),fr(),dr(),gr()]});function mr(n,e=!0){let t=function(){if(Yp)try{let l=pr(new CSSStyleSheet);return l.connect=u=>{let c=Ks(u);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=cr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[pr(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(u=>u.snapshot());return()=>l.forEach(u=>u())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,u,c){o[0].insert(l,u,c);let p=this.target.cssRules[u];o.forEach((f,d)=>d&&f.target.insertRule(p.cssText,u))},resume(l,u){return o[0].resume(l,u)},connect(l){let u=document.createElement("style");Ks(l).appendChild(u);let c=pr(u),{cssRules:p}=this.target;for(let f=0;f<p.length;f++)c.target.insertRule(p[f].cssText,f);o.push(c),a.set(l,c)},disconnect(l){let u=o.indexOf(a.get(l));u>=0&&o.splice(u,1)}}}(),i=Za({...n,hash:n.hash??e},t),r=el(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(Ks(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var Yp=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Ks(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var Qs=n=>mr(Ys)(n);var Kp="Free",yr,_l,ii=class extends Qs(q){constructor(){super();b(this,yr);this.planConfigs}render(){return P`
4
- <a href="/pricing-plans" target="_blank" class="text-sm text-white">
5
- <div class="m-3 flex flex-row items-start rounded-xl bg-violet-500 px-3 py-2">
6
- <p class="flex-grow">Upgrade your <span class="font-bold text-lime">${this.planConfigs?.title}</span> plan to add more than <span class="font-bold text-lime">${this.planConfigs?.maxProducts?.toLocaleString()}</span> products.</p>
7
- <span class="h-full flex-none rounded-full border border-white px-5 py-2 text-sm font-medium text-white transition-colors duration-200 hover:bg-white/10">${this.planConfigs.title!==Kp?"Upgrade":"Try Free"}</span>
8
- <button type="button" @click="${$(this,yr,_l)}" class="ml-1 h-6 rounded-full bg-violet-500 transition-colors hover:bg-violet-700" aria-label="Close">
9
- <span class="inline-block h-6 w-6 leading-6">✕</span>
10
- </button>
11
- </div>
12
- </a>
13
- `}firstUpdated(){this.planConfigs.slug==="scale"&&(this.style.display="none")}};yr=new WeakSet,_l=function(t){t.preventDefault(),this.style.display="none"},k(ii,"properties",{planConfigs:{type:Object,attribute:"plan-configs"}});var Zs=ei({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:[vr(),fr(),dr(),gr()]});var z=n=>mr(Zs)(n);var ri=class extends z(q){constructor(){super();k(this,"render",()=>P`
1
+ var ep=Object.defineProperty;var ha=n=>{throw TypeError(n)};var tp=(n,e,t)=>e in n?ep(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>tp(n,typeof e!="symbol"?e+"":e,t),vs=(n,e,t)=>e.has(n)||ha("Cannot "+t);var h=(n,e,t)=>(vs(n,e,"read from private field"),t?t.call(n):e.get(n)),b=(n,e,t)=>e.has(n)?ha("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),S=(n,e,t,i)=>(vs(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),$=(n,e,t)=>(vs(n,e,"access private method"),t);var va=(n,e,t,i)=>({set _(r){S(n,e,r,t)},get _(){return h(n,e,i)}});var zi=globalThis,Wi=zi.ShadowRoot&&(zi.ShadyCSS===void 0||zi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gs=Symbol(),ga=new WeakMap,Vn=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==gs)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(Wi&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=ga.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ga.set(t,e))}return e}toString(){return this.cssText}},ma=n=>new Vn(typeof n=="string"?n:n+"",void 0,gs),ht=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((i,r,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1],n[0]);return new Vn(t,n,gs)},ms=(n,e)=>{if(Wi)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=zi.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},Vi=Wi?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return ma(t)})(n):n;var{is:np,defineProperty:ip,getOwnPropertyDescriptor:rp,getOwnPropertyNames:sp,getOwnPropertySymbols:op,getPrototypeOf:ap}=Object,Gi=globalThis,ya=Gi.trustedTypes,lp=ya?ya.emptyScript:"",up=Gi.reactiveElementPolyfillSupport,Gn=(n,e)=>n,ys={toAttribute(n,e){switch(e){case Boolean:n=n?lp:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},ba=(n,e)=>!np(n,e),_a={attribute:!0,type:String,converter:ys,reflect:!1,hasChanged:ba};Symbol.metadata??=Symbol("metadata"),Gi.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=_a){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&ip(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=rp(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r?.call(this)},set(o){let a=r?.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_a}static _$Ei(){if(this.hasOwnProperty(Gn("elementProperties")))return;let e=ap(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Gn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Gn("properties"))){let t=this.properties,i=[...sp(t),...op(t)];for(let r of i)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let r of i)t.unshift(Vi(r))}else e!==void 0&&t.push(Vi(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ms(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:ys).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let s=i.getPropertyOptions(r),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:ys;this._$Em=r,this[r]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??ba)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,s]of i)s.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};vt.elementStyles=[],vt.shadowRootOptions={mode:"open"},vt[Gn("elementProperties")]=new Map,vt[Gn("finalized")]=new Map,up?.({ReactiveElement:vt}),(Gi.reactiveElementVersions??=[]).push("2.0.4");var bs=globalThis,Xi=bs.trustedTypes,wa=Xi?Xi.createPolicy("lit-html",{createHTML:n=>n}):void 0,ws="$lit$",gt=`lit$${Math.random().toFixed(9).slice(2)}$`,xs="?"+gt,cp=`<${xs}>`,Gt=document,Jn=()=>Gt.createComment(""),Yn=n=>n===null||typeof n!="object"&&typeof n!="function",ks=Array.isArray,Ca=n=>ks(n)||typeof n?.[Symbol.iterator]=="function",_s=`[
2
+ \f\r]`,Xn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xa=/-->/g,ka=/>/g,Wt=RegExp(`>|${_s}(?:([^\\s"'>=/]+)(${_s}*=${_s}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Sa=/'/g,Ea=/"/g,Ia=/^(?:script|style|textarea|title)$/i,Ss=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),D=Ss(1),Yd=Ss(2),Kd=Ss(3),nt=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),$a=new WeakMap,Vt=Gt.createTreeWalker(Gt,129);function Aa(n,e){if(!ks(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return wa!==void 0?wa.createHTML(e):e}var Ta=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":e===3?"<math>":"",o=Xn;for(let a=0;a<t;a++){let l=n[a],u,c,p=-1,f=0;for(;f<l.length&&(o.lastIndex=f,c=o.exec(l),c!==null);)f=o.lastIndex,o===Xn?c[1]==="!--"?o=xa:c[1]!==void 0?o=ka:c[2]!==void 0?(Ia.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Wt):c[3]!==void 0&&(o=Wt):o===Wt?c[0]===">"?(o=r??Xn,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Wt:c[3]==='"'?Ea:Sa):o===Ea||o===Sa?o=Wt:o===xa||o===ka?o=Xn:(o=Wt,r=void 0);let d=o===Wt&&n[a+1].startsWith("/>")?" ":"";s+=o===Xn?l+cp:p>=0?(i.push(u),l.slice(0,p)+ws+l.slice(p)+gt+d):l+gt+(p===-2?a:d)}return[Aa(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},Kn=class n{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[u,c]=Ta(e,t);if(this.el=n.createElement(u,i),Vt.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Vt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(ws)){let f=c[o++],d=r.getAttribute(p).split(gt),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:g[2],strings:d,ctor:g[1]==="."?Yi:g[1]==="?"?Ki:g[1]==="@"?Qi:Jt}),r.removeAttribute(p)}else p.startsWith(gt)&&(l.push({type:6,index:s}),r.removeAttribute(p));if(Ia.test(r.tagName)){let p=r.textContent.split(gt),f=p.length-1;if(f>0){r.textContent=Xi?Xi.emptyScript:"";for(let d=0;d<f;d++)r.append(p[d],Jn()),Vt.nextNode(),l.push({type:2,index:++s});r.append(p[f],Jn())}}}else if(r.nodeType===8)if(r.data===xs)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(gt,p+1))!==-1;)l.push({type:7,index:s}),p+=gt.length-1}s++}}static createElement(e,t){let i=Gt.createElement("template");return i.innerHTML=e,i}};function Xt(n,e,t=n,i){if(e===nt)return e;let r=i!==void 0?t.o?.[i]:t.l,s=Yn(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t.o??=[])[i]=r:t.l=r),r!==void 0&&(e=Xt(n,r._$AS(n,e.values),r,i)),e}var Ji=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,r=(e?.creationScope??Gt).importNode(t,!0);Vt.currentNode=r;let s=Vt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new vn(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new Zi(s,this,e)),this._$AV.push(u),l=i[++a]}o!==l?.index&&(s=Vt.nextNode(),o++)}return Vt.currentNode=Gt,r}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},vn=class n{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,t,i,r){this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this.v=r?.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=Xt(this,e,t),Yn(e)?e===N||e==null||e===""?(this._$AH!==N&&this._$AR(),this._$AH=N):e!==this._$AH&&e!==nt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ca(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==N&&Yn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Gt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Kn.createElement(Aa(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new Ji(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=$a.get(e.strings);return t===void 0&&$a.set(e.strings,t=new Kn(e)),t}k(e){ks(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,r=0;for(let s of e)r===t.length?t.push(i=new n(this.O(Jn()),this.O(Jn()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this.v=e,this._$AP?.(e))}},Jt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=N,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=N}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Xt(this,e,t,0),o=!Yn(e)||e!==this._$AH&&e!==nt,o&&(this._$AH=e);else{let a=e,l,u;for(e=s[0],l=0;l<s.length-1;l++)u=Xt(this,a[i+l],t,l),u===nt&&(u=this._$AH[l]),o||=!Yn(u)||u!==this._$AH[l],u===N?e=N:e!==N&&(e+=(u??"")+s[l+1]),this._$AH[l]=u}o&&!r&&this.j(e)}j(e){e===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Yi=class extends Jt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===N?void 0:e}},Ki=class extends Jt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==N)}},Qi=class extends Jt{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Xt(this,e,t,0)??N)===nt)return;let i=this._$AH,r=e===N&&i!==N||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==N&&(i===N||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Zi=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Xt(this,e)}},Ra={M:ws,P:gt,A:xs,C:1,L:Ta,R:Ji,D:Ca,V:Xt,I:vn,H:Jt,N:Ki,U:Qi,B:Yi,F:Zi},pp=bs.litHtmlPolyfillSupport;pp?.(Kn,vn),(bs.litHtmlVersions??=[]).push("3.2.0");var Pa=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new vn(e.insertBefore(Jn(),s),s,void 0,t??{})}return r._$AI(n),r};var U=class extends vt{constructor(){super(...arguments),this.renderOptions={host:this},this.o=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.o=Pa(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return nt}};U._$litElement$=!0,U.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:U});var fp=globalThis.litElementPolyfillSupport;fp?.({LitElement:U});(globalThis.litElementVersions??=[]).push("4.1.0");function Fs(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function dp(n,e=","){return n.map(Fs).join(e)}var ja=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function er(n){for(var e=9,t=n.length;t--;)e=Math.imul(e^n.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function ir(n,e="@media "){return e+Z(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function Z(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function Oa(n){return n}function rr(){}var ce={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function qa(n){return n.match(/[-=:;]/g)?.length||0}function As(n){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(n)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(qa(n),15)<<18}var hp=["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 Ms({n,i:e,v:t=[]},i,r,s){n&&(n=Fs({n,i:e,v:t})),s=[...Z(s)];for(let a of t){let l=i.theme("screens",a);for(let u of Z(l&&ir(l)||i.v(a))){var o;s.push(u),r|=l?67108864|As(u):a=="dark"?1073741824:u[0]=="@"?As(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~hp.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var Ua=new Map;function Ts(n){if(n.d){let e=[],t=Es(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?Es(i,s=>Es(r,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):$s(s,o)}return $s(o,s)})):i,"&"),i=>$s(i,n.n?"."+ja(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function Es(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function $s(n,e){return n.replace(/&/g,e)}var Fa=new Intl.Collator("en",{numeric:!0});function Ba(n,e){for(var t=0,i=n.length;t<i;){let r=i+t>>1;0>=Ha(n[r],e)?t=r+1:i=r}return i}function Ha(n,e){let t=n.p&ce.o;return t==(e.p&ce.o)&&(t==ce.b||t==ce.o)?0:n.p-e.p||n.o-e.o||Fa.compare(Ma(n.n),Ma(e.n))||Fa.compare(Da(n.n),Da(e.n))}function Ma(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function Da(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Cs(n,e){return Math.round(parseInt(n,16)*e)}function Ge(n,e={}){if(typeof n=="function")return n(e);let{opacityValue:t="1",opacityVariable:i}=e,r=i?`var(${i})`:t;if(n.includes("<alpha-value>"))return n.replace("<alpha-value>",r);if(n[0]=="#"&&(n.length==4||n.length==7)){let s=(n.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Cs(n.substr(1,s),o),Cs(n.substr(1+s,s),o),Cs(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function za(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:u=[],i:c},p){let f=[],d="",g=0,m=0;for(let I in o||{}){var E,L;let M=o[I];if(I[0]=="@"){if(!M)continue;if(I[1]=="a"){f.push(...Ls(a,l,nr(""+M),p,l,u,c,!0));continue}if(I[1]=="l"){for(let F of Z(M))f.push(...s(F,{n:a,p:(E=ce[I[7]],l&~ce.o|E),r:I[7]=="d"?[]:u,i:c},p));continue}if(I[1]=="i"){f.push(...Z(M).map(F=>({p:-1,o:0,r:[],d:I+" "+F})));continue}if(I[1]=="k"){f.push({p:ce.d,o:0,r:[I],d:s(M,{p:ce.d},p).map(Ts).join("")});continue}if(I[1]=="f"){f.push(...Z(M).map(F=>({p:ce.d,o:0,r:[I],d:s(F,{p:ce.d},p).map(Ts).join("")})));continue}}if(typeof M!="object"||Array.isArray(M))I=="label"&&M?a=M+er(JSON.stringify([l,c,o])):(M||M===0)&&(I=I.replace(/[A-Z]/g,F=>"-"+F.toLowerCase()),m+=1,g=Math.max(g,(L=I)[0]=="-"?0:qa(L)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(L)?+!!RegExp.$1||-!!RegExp.$2:0)+1),d+=(d?";":"")+Z(M).map(F=>p.s(I,Ds(""+F,p.theme)+(c?" !important":""))).join(";"));else if(I[0]=="@"||I.includes("&")){let F=l;I[0]=="@"&&(I=I.replace(/\bscreen\(([^)]+)\)/g,(q,G)=>{let X=p.theme("screens",G);return X?(F|=67108864,ir(X,"")):q}),F|=As(I)),f.push(...s(M,{n:a,p:F,r:[...u,I],i:c},p))}else f.push(...s(M,{p:l,r:[...u,I]},p))}return f.unshift({n:a,p:l,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:u,d}),f.sort(Ha)}(n,Ms(e,t,i,r),t)}function Ds(n,e){return n.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,r,s,o="")=>{let a=e(r,o);return typeof a=="function"&&/color|fill|stroke/i.test(r)?Ge(a):""+Z(a).filter(l=>Object(l)!==l)})}function Wa(n,e){let t,i=[];for(let r of n)r.d&&r.n?t?.p==r.p&&""+t.r==""+r.r?(t.c=[t.c,r.c].filter(Boolean).join(" "),t.d=t.d+";"+r.d):i.push(t={...r,n:r.n&&e}):i.push({...r,n:r.n&&e});return i}function tr(n,e,t=ce.u,i,r){let s=[];for(let o of n)for(let a of function(l,u,c,p,f){l={...l,i:l.i||f};let d=function(g,m){let E=Ua.get(g.n);return E?E(g,m):m.r(g.n,g.v[0]=="dark")}(l,u);return d?typeof d=="string"?({r:p,p:c}=Ms(l,u,c,p),Wa(tr(nr(d),u,c,p,l.i),l.n)):Array.isArray(d)?d.map(g=>{var m,E;return{o:0,...g,r:[...Z(p),...Z(g.r)],p:(m=c,E=g.p??c,m&~ce.o|E)}}):za(d,l,u,c,p):[{c:Fs(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(Ba(s,a),0,a);return s}function Ls(n,e,t,i,r,s,o,a){return Wa((a?t.flatMap(l=>tr([l],i,r,s,o)):tr(t,i,r,s,o)).map(l=>l.p&ce.o&&(l.n||e==ce.b)?{...l,p:l.p&~ce.o|e,o:0}:l),n)}function vp(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:u,i:c}=Ms(s,o,e);return t&&Ls(a,e,t,o,l,u,c,i)},Ua.set(n,r),n}function Is(n,e,t){if(n[n.length-1]!="("){let i=[],r=!1,s=!1,o="";for(let a of n)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),r=!r),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(gp),i:r}))}}function gp(n,e,t){return t.indexOf(n)==e}var La=new Map;function nr(n){let e=La.get(n);if(!e){let t=[],i=[[]],r=0,s=0,o=null,a=0,l=(u,c=0)=>{r!=a&&(t.push(n.slice(r,a+c)),u&&Is(t,i)),r=a+1};for(;a<n.length;a++){let u=n[a];if(s)n[a-1]!="\\"&&(s+=+(u=="[")||-(u=="]"));else if(u=="[")s+=1;else if(o)n[a-1]!="\\"&&o.test(n.slice(a))&&(o=null,r=a+RegExp.lastMatch.length);else if(u=="/"&&n[a-1]!="\\"&&(n[a+1]=="*"||n[a+1]=="/"))o=n[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(u=="(")l(),t.push(u);else if(u==":")n[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(u)){l(!0);let c=t.lastIndexOf("(");if(u==")"){let p=t[c-1];if(/[~@]$/.test(p)){let f=i.shift();t.length=c,Is([...t,"#"],i);let{v:d}=i[0].pop();for(let g of f)g.v.splice(+(g.v[0]=="dark")-+(d[0]=="dark"),d.length);Is([...t,vp(p.length>1?p.slice(0,-1)+er(JSON.stringify([p,f])):p+"("+dp(f)+")",ce.a,f,/@$/.test(p))],i)}c=t.lastIndexOf("(",c-1)}t.length=c+1}else/[~@]/.test(u)&&n[a+1]=="("&&i.unshift([])}l(!0),La.set(n,e=i[0])}return e}function w(n,e,t){return[n,Rs(e,t)]}function Rs(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):Ps(t,1)}):t=>n||{[t[1]]:Ps(t,2)}}function Ps(n,e,t=n.slice(e).find(Boolean)||n.$$||n.input){return n.input[0]=="-"?`calc(${t} * -1)`:t}function x(n,e,t,i){return[n,Ns(e,t,i)]}function Ns(n,e,t){let i=typeof e=="string"?(r,s)=>({[e]:t?t(r,s):r._}):e||(({1:r,_:s},o,a)=>({[r||a]:s}));return(r,s)=>{let o=Va(n||r[1]),a=s.theme(o,r.$$)??ct(r.$$,o,s);if(a!=null)return r._=Ps(r,0,a),i(r,s,o)}}function pe(n,e={},t){return[n,mp(e,t)]}function mp(n={},e){return(t,i)=>{let{section:r=Va(t[0]).replace("-","")+"Color"}=n,[s,o]=yp(t.$$);if(!s)return;let a=i.theme(r,s)||ct(s,r,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:u=r.replace("Color","Opacity"),property:c=r,selector:p}=n,f=i.theme(u,o||"DEFAULT")||o&&ct(o,u,i),d=e||(({_:m})=>{let E=Qn(c,m);return p?{[p]:E}:E});t._={value:Ge(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:m=>Ge(a,m),opacityVariable:l||void 0,opacityValue:f||void 0};let g=d(t,i);if(!t.dark){let m=i.d(r,s,a);m&&m!==a&&(t._={value:Ge(m,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:E=>Ge(m,E),opacityVariable:l||void 0,opacityValue:f||void 0},g={"&":g,[i.v("dark")]:d(t,i)})}return g}}function yp(n){return(n.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Qn(n,e){let t={};return typeof e=="string"?t[n]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[n]=e.value),t}function ct(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=gn(Ds(n.slice(1,-1),t.theme)),!e)return n;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(n)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(n))||/image/i.test(e)&&!(/^image:/.test(n)||/^[a-z-]+\(/.test(n))||/weight/i.test(e)&&!(/^(number|any):/.test(n)||/^\d+$/.test(n))||/position/i.test(e)&&/^(length|size):/.test(n)))return n.replace(/^[a-z-]+:/,"")}}function Va(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function gn(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>gn(t)+i+gn(r)):n.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 js({presets:n=[],...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:(i,r)=>i+":"+r,finalize:[]};for(let i of Z([...n,{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:r,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:a,variants:l,rules:u,ignorelist:c,hash:p=t.hash,stringify:f=t.stringify,finalize:d}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&r!==!1&&[...t.preflight,...Z(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...Z(l)],rules:[...t.rules,...Z(u)],ignorelist:[...t.ignorelist,...Z(c)],hash:p,stringify:f,finalize:[...t.finalize,...Z(d)]}}return t}function Na(n,e,t,i,r,s){for(let o of e){let a=t.get(o);a||t.set(o,a=i(o));let l=a(n,r,s);if(l)return l}}function _p(n){var e;return Os(n[0],typeof(e=n[1])=="function"?e:()=>e)}function bp(n){var e,t;return Array.isArray(n)?Os(n[0],Rs(n[1],n[2])):Os(n,Rs(e,t))}function Os(n,e){return Ga(n,(t,i,r,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,r)})}function Ga(n,e){let t=Z(n).map(wp);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function wp(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function Xa(n,e){let t=js(n),i=function({theme:l,darkMode:u,darkColor:c=rr,variants:p,rules:f,hash:d,stringify:g,ignorelist:m,finalize:E}){let L=new Map,I=new Map,M=new Map,F=new Map,q=Ga(m,(R,J)=>J.test(R));p.push(["dark",Array.isArray(u)||u=="class"?`${Z(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let G=typeof d=="function"?R=>d(R,er):d?er:Oa;G!==Oa&&E.push(R=>({...R,n:R.n&&G(R.n),d:R.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(J,K)=>"--"+G(K).replace("#",""))}));let X={theme:function({extend:R={},...J}){let K={},tt={get colors(){return ve("colors")},theme:ve,negative(){return{}},breakpoints(Y){let ne={};for(let ue in Y)typeof Y[ue]=="string"&&(ne["screen-"+ue]=Y[ue]);return ne}};return ve;function ve(Y,ne,ue,Le){if(Y){if({1:Y,2:Le}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Y)||[,Y],/[.[]/.test(Y)){let Ee=[];Y.replace(/\[([^\]]+)\]|([^.[]+)/g,(ie,ge,Ae=ge)=>Ee.push(Ae)),Y=Ee.shift(),ue=ne,ne=Ee.join("-")}let oe=K[Y]||Object.assign(Object.assign(K[Y]={},Ve(J,Y)),Ve(R,Y));if(ne==null)return oe;ne||(ne="DEFAULT");let Se=oe[ne]??ne.split("-").reduce((Ee,ie)=>Ee?.[ie],oe)??ue;return Le?Ge(Se,{opacityValue:Ds(Le,ve)}):Se}let Ue={};for(let oe of[...Object.keys(J),...Object.keys(R)])Ue[oe]=ve(oe);return Ue}function Ve(Y,ne){let ue=Y[ne];return typeof ue=="function"&&(ue=ue(tt)),ue&&/color|fill|stroke/i.test(ne)?function Le(Ue,oe=[]){let Se={};for(let Ee in Ue){let ie=Ue[Ee],ge=[...oe,Ee];Se[ge.join("-")]=ie,Ee=="DEFAULT"&&(ge=oe,Se[oe.join("-")]=ie),typeof ie=="object"&&Object.assign(Se,Le(ie,ge))}return Se}(ue):ue}}(l),e:ja,h:G,s(R,J){return g(R,J,X)},d(R,J,K){return c(R,J,X,K)},v(R){return L.has(R)||L.set(R,Na(R,p,I,_p,X)||"&:"+R),L.get(R)},r(R,J){let K=JSON.stringify([R,J]);return M.has(K)||M.set(K,!q(R,X)&&Na(R,f,F,bp,X,J)),M.get(K)},f(R){return E.reduce((J,K)=>K(J,X),R)}};return X}(t),r=new Map,s=[],o=new Set;e.resume(l=>r.set(l,l),(l,u)=>{e.insert(l,s.length,u),s.push(u),o.add(l)});function a(l){let u=i.f(l),c=Ts(u);if(c&&!o.has(c)){o.add(c);let p=Ba(s,l);e.insert(c,p,l),s.splice(p,0,l)}return u.n}return Object.defineProperties(function(u){if(!r.size)for(let p of Z(t.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?Ls("",ce.b,nr(p),i,ce.b,[],!1,!0):za(p,{},i,ce.b)).forEach(a);u=""+u;let c=r.get(u);if(!c){let p=new Set;for(let f of tr(nr(u),i))p.add(f.c).add(a(f));c=[...p].filter(Boolean).join(" "),r.set(u,c).set(c,c)}return c},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let l=e.snapshot(),u=new Set(o),c=new Map(r),p=[...s];return()=>{l(),o=u,r=c,s=p}},clear(){e.clear(),o=new Set,r=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function xp(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function Ja(n){let e=new MutationObserver(t);return{observe(r){e.observe(r,{attributeFilter:["class"],subtree:!0,childList:!0}),i(r),t([{target:r,type:""}])},disconnect(){e.disconnect()}};function t(r){for(let{type:s,target:o}of r)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(r){let s,o=r.getAttribute?.("class");o&&xp(o,s=n(o))&&r.setAttribute("class",s)}}function kp(n){let e=document.querySelector(n||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function sr(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:kp(n)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,i){try{e.insertRule(t,i)}catch{e.insertRule(":root{}",i)}},resume:rr}}var Sp=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 Ya(n){return Sp.get(n)}function Ka(n){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(n);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Qa(n,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(n);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 Ep=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Za(){return({stringify:n})=>({stringify(e,t,i){let r="",s=Ya(e);s&&(r+=n(s,t,i)+";");let o=Ka(e),a=Qa(e,t);for(let l of Ep)o&l[1]&&(r+=n(l[0]+e,t,i)+";"),a&l[1]&&(r+=n(e,l[0]+t,i)+";");return r+n(e,t,i)}})}function tl(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Ns("lineClamp",({_:n})=>el(n))],["line-clamp-(\\d+)",({1:n})=>el(n)]]}}function el(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var ei={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...Be(4,"rem",4,.5,.5),...Be(12,"rem",4,5),14:"3.5rem",...Be(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:H("blur"),backdropBrightness:H("brightness"),backdropContrast:H("contrast"),backdropGrayscale:H("grayscale"),backdropHueRotate:H("hueRotate"),backdropInvert:H("invert"),backdropOpacity:H("opacity"),backdropSaturate:H("saturate"),backdropSepia:H("sepia"),backgroundColor:H("colors"),backgroundImage:{none:"none"},backgroundOpacity:H("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:{...Be(200,"",100,0,50),...Be(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:H("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:H("spacing"),borderWidth:{DEFAULT:"1px",...Xe(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:H("colors"),caretColor:H("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...Be(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:H("borderColor"),divideOpacity:H("borderOpacity"),divideWidth:H("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:n})=>({...n("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:n})=>({...n("spacing"),...Zn(2,6),...Zn(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:H("spacing"),gradientColorStops:H("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:n})=>({...n("spacing"),...Zn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:n})=>({...n("spacing"),...Zn(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:{...Be(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:n})=>({auto:"auto",...n("spacing")}),maxHeight:({theme:n})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...n("spacing")}),maxWidth:({theme:n,breakpoints:e})=>({...e(n("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:{...Be(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:H("spacing"),placeholderColor:H("colors"),placeholderOpacity:H("opacity"),outlineColor:H("colors"),outlineOffset:Xe(8,"px"),outlineWidth:Xe(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:H("colors"),ringOffsetWidth:Xe(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Xe(8,"px")},rotate:{...Xe(2,"deg"),...Xe(12,"deg",3),...Xe(180,"deg",45)},saturate:Be(200,"",100,0,50),scale:{...Be(150,"",100,0,50),...Be(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:H("spacing"),scrollPadding:H("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Xe(2,"deg"),...Xe(12,"deg",3)},space:H("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:Be(2),textColor:H("colors"),textDecorationColor:H("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Xe(8,"px")},textUnderlineOffset:{auto:"auto",...Xe(8,"px")},textIndent:H("spacing"),textOpacity:H("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:H("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:n})=>({...n("spacing"),...Zn(2,4),full:"100%"}),width:({theme:n})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...n("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Be(50,"",1,0,10),auto:"auto"}};function Zn(n,e){let t={};do for(var i=1;i<n;i++)t[`${i}/${n}`]=Number((i/n*100).toFixed(6))+"%";while(++n<=e);return t}function Xe(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function Be(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function H(n){return({theme:e})=>e(n)}var nl={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${ei.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${ei.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var ll=[w("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:ct(`[${e}]`,"",t)}}})),w("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),x("aspect-","aspectRatio"),w("container",(n,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:r}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in t){let l=t[a];typeof l=="string"&&(s[ir(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=r&&(typeof r=="string"?r:r[a]||r.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),x("content-","content",({_:n})=>({"--tw-content":n,content:"var(--tw-content)"})),w("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),w("box-(border|content)","boxSizing",({1:n})=>n+"-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"),x("object-","objectPosition"),w("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",or),w("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),w("(static|fixed|absolute|relative|sticky)","position"),x("-?inset(-[xy])?(?:$|-)","inset",({1:n,_:e})=>({top:n!="-x"&&e,right:n!="-y"&&e,bottom:n!="-x"&&e,left:n!="-y"&&e})),x("-?(top|bottom|left|right)(?:$|-)","inset"),w("(visible|collapse)","visibility"),w("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),w("flex-((row|col)(-reverse)?)","flexDirection",il),w("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),x("(flex-(?:grow|shrink))(?:$|-)"),x("(flex)-"),x("grow(?:$|-)","flexGrow"),x("shrink(?:$|-)","flexShrink"),x("basis-","flexBasis"),x("-?(order)-"),"-?(order)-(\\d+)",x("grid-cols-","gridTemplateColumns"),w("grid-cols-(\\d+)","gridTemplateColumns",al),x("col-","gridColumn"),w("col-(span)-(\\d+)","gridColumn",ol),x("col-start-","gridColumnStart"),w("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),w("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),w("grid-rows-(\\d+)","gridTemplateRows",al),x("row-","gridRow"),w("row-(span)-(\\d+)","gridRow",ol),x("row-start-","gridRowStart"),w("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),w("row-end-(auto|\\d+)","gridRowEnd"),w("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>or(il(n))),w("grid-flow-(dense)","gridAutoFlow"),x("auto-cols-","gridAutoColumns"),x("auto-rows-","gridAutoRows"),x("gap-x(?:$|-)","gap","columnGap"),x("gap-y(?:$|-)","gap","rowGap"),x("gap(?:$|-)","gap"),"(justify-(?:items|self))-",w("justify-","justifyContent",rl),w("(content|items|self)-",n=>({["align-"+n[1]]:rl(n)})),w("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),x("p([xytrbl])?(?:$|-)","padding",mn("padding")),x("-?m([xytrbl])?(?:$|-)","margin",mn("margin")),x("-?space-(x|y)(?:$|-)","space",({1:n,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[n]]:`calc(${e} * calc(1 - var(--tw-space-${n}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[n]]:`calc(${e} * var(--tw-space-${n}-reverse))`}})),w("space-(x|y)-reverse",({1:n})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"1"}})),x("w-","width"),x("min-w-","minWidth"),x("max-w-","maxWidth"),x("h-","height"),x("min-h-","minHeight"),x("max-h-","maxHeight"),x("font-","fontWeight"),x("font-","fontFamily",({_:n})=>typeof(n=Z(n))[1]=="string"?{fontFamily:it(n)}:{fontFamily:it(n[0]),...n[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:n,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":n)]:n,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,/*!*/ /*!*/)"})}),x("tracking-","letterSpacing"),x("leading-","lineHeight"),w("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),w("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),pe("placeholder-",{property:"color",selector:"&::placeholder"}),w("text-(left|center|right|justify|start|end)","textAlign"),w("text-(ellipsis|clip)","textOverflow"),x("text-opacity-","textOpacity","--tw-text-opacity"),pe("text-",{property:"color"}),x("text-","fontSize",({_:n})=>typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}),x("indent-","textIndent"),w("(overline|underline|line-through)","textDecorationLine"),w("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),pe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("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"}),pe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),pe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),w("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${Yt(n," ")},var(--tw-gradient-stops))`),pe("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-from":n.value,"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),pe("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${n.value},var(--tw-gradient-to)`})),pe("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:n})=>n+"-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:n})=>n+(n=="text"?"":"-box")),x("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),pe("bg-",{section:"backgroundColor"}),x("bg-","backgroundImage"),x("bg-","backgroundPosition"),w("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",or),x("bg-","backgroundSize"),x("rounded(?:$|-)","borderRadius"),x("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:n,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[n]||[n,n];return{[`border-${Yt(t[0])}-radius`]:e,[`border-${Yt(t[1])}-radius`]:e}}),w("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),w("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...Tt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(n||"-x")]:e,["--tw-border-spacing"+(n||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),pe("border-([xytrbl])-",{section:"borderColor"},mn("border","Color")),pe("border-"),x("border-([xytrbl])(?:$|-)","borderWidth",mn("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),w("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),w("divide-([xy]-reverse)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+n]:"1"}})),x("divide-([xy])(?:$|-)","divideWidth",({1:n,_:e})=>{let t={x:"lr",y:"tb"}[n];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${n}-reverse`]:"0",[`border-${Yt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${Yt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${n}-reverse))`}}}),pe("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),x("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),pe("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),x("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),w("ring-inset",{"--tw-ring-inset":"inset"}),pe("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:n},{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":Ge(e("ringOffsetColor","","#fff")),"--tw-ring-color":Ge(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(${n} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),pe("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-shadow-color":n.value,"--tw-shadow":"var(--tw-shadow-colored)"})),x("shadow(?:$|-)","boxShadow",({_:n})=>({...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":it(n),"--tw-shadow-colored":it(n).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)"})),x("(opacity)-"),w("mix-blend-","mixBlendMode"),...sl(),...sl("backdrop-"),x("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:it(n),transitionTimingFunction:n._=="none"?void 0:it(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:it(e("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",it),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",it),x("delay(?:$|-)","transitionDelay","transitionDelay",it),x("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=it(n),s=r.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:r}}),"(transform)-(none)",w("transform",Us),w("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":ul(n=="gpu")})),x("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...Us()})),x("-?(rotate)-","rotate",qs),x("-?(translate-[xy])-","translate",qs),x("-?(skew-[xy])-","skew",qs),w("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",or),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",w("snap-(none)","scroll-snap-type"),w("snap-(x|y|both)",({1:n})=>({...Tt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" 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"),x("scroll-p([xytrbl])?(?:$|-)","padding",mn("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",mn("scroll-margin")),w("touch-(auto|none|manipulation)","touch-action"),w("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,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":n}`]:n,"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"),x("-?(outline-offset)-"),pe("outline-",{opacityVariable:!1,opacitySection:"opacity"}),x("outline-","outlineWidth"),"(pointer-events)-",x("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:n})=>({x:"horizontal",y:"vertical"})[n]||n||"both"],w("select-(none|text|all|auto)","userSelect"),pe("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),pe("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),x("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 or(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function il(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function Yt(n,e="-"){let t=[];for(let i of n)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function it(n){return n&&""+(n._||n)}function rl({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function mn(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...Qn(n+"-"+Yt(r[0])+e,i),...Qn(n+"-"+Yt(r[1])+e,i)}:Qn(n+e,i)}}function sl(n=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",n&&"opacity","saturate","sepia",!n&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${n}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...Tt(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,w(`${n}filter`,t),...e.map(i=>x(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:Z(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function qs({1:n,_:e}){return{["--tw-"+n]:e,...Us()}}function Us(){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":ul()}),transform:"var(--tw-transform)"}}function ul(n){return[n?"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 ol({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function al({1:n}){return`repeat(${n},minmax(0,1fr))`}function Tt(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var cl=[["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:n})=>`@media (orientation:${n})`],["contrast-(more|less)",({1:n})=>`@media (prefers-contrast:${n})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:n})=>`&::${n}`],["(marker|selection)",({1:n})=>`& *::${n},&::${n}`],["file","&::file-selector-button"],["(first|last|only)",({1:n})=>`&:${n}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:n,$$:e},t)=>e&&`&[${n}-${t.theme(n,e)||ct(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:n,3:e="",4:t,5:i="",6:r=e},{e:s,h:o,v:a})=>{let l=gn(i)||(t[0]=="["?t:a(t.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(n+r))})`)}${n[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:n})=>`[dir="${n}"] &`],["supports-",({$$:n},e)=>{if(n&&(n=e.theme("supports",n)||ct(n,"",e)),n)return n.includes(":")||(n+=":var(--tw)"),/^\w*\s*\(/.test(n)||(n=`(${n})`),`@supports ${n.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:n},e)=>{if(n&&(n=e.theme("screens",n)||ct(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=ct(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&gn(n).replace(/[}]+$/,"").split("{")]];function pl({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:nl,theme:{...ei,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:cl,rules:ll,finalize(t){return t.n&&t.d&&t.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var $p={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Cp={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Ip={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Ap={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Tp={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Rp={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Pp={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Op={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Fp={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Mp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Dp={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Lp={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Np={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},jp={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},qp={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Up={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Bp={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Hp={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},zp={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Wp={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Vp={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Gp={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},fl={__proto__:null,slate:$p,gray:Cp,zinc:Ip,neutral:Ap,stone:Tp,red:Rp,orange:Pp,amber:Op,yellow:Fp,lime:Mp,green:Dp,emerald:Lp,teal:Np,cyan:jp,sky:qp,blue:Up,indigo:Bp,violet:Hp,purple:zp,fuchsia:Wp,pink:Vp,rose:Gp};function dl({disablePreflight:n}={}){return pl({colors:fl,disablePreflight:n})}function gl({className:n="prose",defaultColor:e="gray",extend:t={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${n}-${s}`,(a,l)=>ml(n,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,u=>`& :is(${u.trim()})`)]),rules:[[`(lead|not-${n})`,({1:s},{h:o})=>[{c:o(s)}]],[`${n}-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)"}}],[n+"-",({$$:s},o)=>{let a=vl(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[hl(n,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:P(20,16),marginBottom:P(20,16),paddingLeft:P(26,16)},li:{marginTop:P(8,16),marginBottom:P(8,16)},"ol>li,ul>li":{paddingLeft:P(6,16)},">ul>li p":{marginTop:P(12,16),marginBottom:P(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:P(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:P(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:P(12,16),marginBottom:P(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:P(48,16),marginBottom:P(48,16)},blockquote:{marginTop:P(32,20),marginBottom:P(32,20),paddingLeft:P(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:P(20,16),marginBottom:P(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:P(36,16),marginTop:"0",marginBottom:P(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:P(24,16),marginTop:P(48,24),marginBottom:P(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:P(20,16),marginTop:P(32,20),marginBottom:P(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:P(24,16),marginBottom:P(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:P(32,16),marginBottom:P(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:P(14,16),lineHeight:"1.4",marginTop:P(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:P(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:P(21,24)},"h3 code":{fontSize:P(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:P(14,16),lineHeight:"1.7",marginTop:P(24,14),marginBottom:P(24,14),borderRadius:"0.375rem",paddingTop:P(12,14),paddingRight:P(16,14),paddingBottom:P(12,14),paddingLeft:P(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:P(32,16),marginBottom:P(32,16),fontSize:P(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:P(8,14),paddingBottom:P(8,14),paddingLeft:P(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:P(8,14),paddingRight:P(8,14),paddingBottom:P(8,14),paddingLeft:P(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:P(20,16),lineHeight:"1.6",marginTop:P(24,20),marginBottom:P(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),hl(n,o,t)],"@layer components":{...vl(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function r(s,o){let a={},l={},u=(c,p,f)=>{let d=o.theme(`colors.${s}.${p}`,p);f["--tw-prose-"+c]=Ge(d);let g=f!=l&&o.d("colors",`${s}-${p}`,d);g&&(l["--tw-prose-"+c]=Ge(g))};for(let c in i){let p=i[c];c!="dark"&&p&&u(c,p,a)}for(let c in i.dark||{}){let p=i.dark[c];p&&(i.dark?u("invert-"+c,p,a):u(c,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function hl(n,e,t){let i={};for(let r in t)i[ml(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function ml(n,e,{e:t,h:i},r){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>r(`${o}:where(${a}):not(:where(.${t(i("not-"+n))} *))${l}`))}function vl(n){return n?typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}:void 0}function P(n,e){return`${(n/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Bs=js({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:[dl(),Za(),tl(),gl()]});function yl(n,e=!0){let t=function(){if(Xp)try{let l=sr(new CSSStyleSheet);return l.connect=u=>{let c=Hs(u);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=rr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[sr(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(u=>u.snapshot());return()=>l.forEach(u=>u())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,u,c){o[0].insert(l,u,c);let p=this.target.cssRules[u];o.forEach((f,d)=>d&&f.target.insertRule(p.cssText,u))},resume(l,u){return o[0].resume(l,u)},connect(l){let u=document.createElement("style");Hs(l).appendChild(u);let c=sr(u),{cssRules:p}=this.target;for(let f=0;f<p.length;f++)c.target.insertRule(p[f].cssText,f);o.push(c),a.set(l,c)},disconnect(l){let u=o.indexOf(a.get(l));u>=0&&o.splice(u,1)}}}(),i=Xa({...n,hash:n.hash??e},t),r=Ja(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(Hs(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var Xp=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Hs(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var z=n=>yl(Bs)(n);var ar=class extends z(U){constructor(){super();C(this,"render",()=>D`
14
4
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
15
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 -->
16
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">
17
7
  <!-- the 'open' state invites the user to open (e.g. the chat window) -->
18
8
  <div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute bottom-0 left-0 right-0 top-0 transition-[opacity,visibility]">
19
- ${this.src?P`
9
+ ${this.src?D`
20
10
  <!-- load given source -->
21
11
  <!-- scale-[1.01] fixes aliasing (white outline) -->
22
12
  <img class="block h-full w-full scale-[1.01] bg-white" src="${this.src}" />
23
- `:P`
13
+ `:D`
24
14
  <!-- if no image URL is specified, we default to our animation -->
25
15
  <!-- scale-[1.01] fixes aliasing (white outline) -->
26
16
  <img src="https://widget.molin.ai/animations/bubble.webp" class="block h-full w-full scale-[1.01]" />
@@ -35,88 +25,119 @@ var np=Object.defineProperty;var _a=n=>{throw TypeError(n)};var ip=(n,e,t)=>e in
35
25
  </svg>
36
26
  </div>
37
27
  </button>
38
- `);this.state="open",this.src=""}};k(ri,"properties",{state:{type:String},src:{type:String}});var _r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},br=n=>(...e)=>({_$litDirective$:n,values:e}),mn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this.t=e,this._$AM=t,this.i=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Qp}=Ma;var bl=()=>document.createComment(""),yn=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(bl(),r),o=i.insertBefore(bl(),r);t=new Qp(s,o,n,n.options)}else{let s=t._$AB.nextSibling,o=t._$AM,a=o!==n;if(a){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==o._$AU&&t._$AP(l)}if(s!==r||a){let l=t._$AA;for(;l!==s;){let u=l.nextSibling;i.insertBefore(l,r),l=u}}}return t},Tt=(n,e,t=n)=>(n._$AI(e,t),n),Zp={},wl=(n,e=Zp)=>n._$AH=e,xl=n=>n._$AH,wr=n=>{n._$AP?.(!1,!0);let e=n._$AA,t=n._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var kl=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},si=br(class extends mn{constructor(n){if(super(n),n.type!==_r.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let r=[],s=[],o=0;for(let a of n)r[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){let r=xl(n),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,s;let a=this.ut??=[],l=[],u,c,p=0,f=r.length-1,d=0,g=s.length-1;for(;p<=f&&d<=g;)if(r[p]===null)p++;else if(r[f]===null)f--;else if(a[p]===o[d])l[d]=Tt(r[p],s[d]),p++,d++;else if(a[f]===o[g])l[g]=Tt(r[f],s[g]),f--,g--;else if(a[p]===o[g])l[g]=Tt(r[p],s[g]),yn(n,l[g+1],r[p]),p++,g--;else if(a[f]===o[d])l[d]=Tt(r[f],s[d]),yn(n,r[p],r[f]),f--,d++;else if(u===void 0&&(u=kl(o,d,g),c=kl(a,p,f)),u.has(a[p]))if(u.has(a[f])){let m=c.get(o[d]),E=m!==void 0?r[m]:null;if(E===null){let L=yn(n,r[p]);Tt(L,s[d]),l[d]=L}else l[d]=Tt(E,s[d]),yn(n,r[p],E),r[m]=null;d++}else wr(r[f]),f--;else wr(r[p]),p++;for(;d<=g;){let m=yn(n,l[g+1]);Tt(m,s[d]),l[d++]=m}for(;p<=f;){let m=r[p++];m!==null&&wr(m)}return this.ut=o,wl(n,l),nt}});function Sl(n,e,t){return n?e(n):t?.(n)}var xr,El,kr=class kr extends z(q){constructor(){super();b(this,xr);k(this,"render",()=>!this.examples?.title&&!this.examples?.items?.length?N:P`
39
- <div class="flex h-full w-full flex-col items-stretch justify-center bg-[#FDFDFD] font-sans text-base">
40
- <!-- examples section -->
41
- <div class="m-4">
42
- ${Sl(this.examples.title,()=>P`<p class="text-md select-none text-center font-semibold text-gray-500">${this.examples.title}</p>`)}
43
- ${this.examples?.items?.length?P`
44
- <ul class="prose mt-2 select-none text-left text-gray-400">
45
- ${si(this.examples.items,t=>t,t=>P`
46
- <li class="w-full rounded-2xl bg-white px-4 py-3 text-sm outline outline-1 outline-[#eeedf1] transition-[color,outline] hover:cursor-pointer hover:outline-[#999]" @click="${()=>$(this,xr,El).call(this,t)}">
47
- <span>“${t.trim()}” →</span>
48
- </li>
49
- `)}
50
- </ul>
51
- `:N}
52
- </div>
53
-
54
- <!-- spacer for visual alignment -->
55
- <div class="h-1/9"></div>
28
+ `);this.state="open",this.src=""}};C(ar,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",ar);var lr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ur=n=>(...e)=>({_$litDirective$:n,values:e}),yn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this.t=e,this._$AM=t,this.i=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Jp}=Ra;var _l=()=>document.createComment(""),_n=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(_l(),r),o=i.insertBefore(_l(),r);t=new Jp(s,o,n,n.options)}else{let s=t._$AB.nextSibling,o=t._$AM,a=o!==n;if(a){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==o._$AU&&t._$AP(l)}if(s!==r||a){let l=t._$AA;for(;l!==s;){let u=l.nextSibling;i.insertBefore(l,r),l=u}}}return t},Rt=(n,e,t=n)=>(n._$AI(e,t),n),Yp={},bl=(n,e=Yp)=>n._$AH=e,wl=n=>n._$AH,cr=n=>{n._$AP?.(!1,!0);let e=n._$AA,t=n._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var xl=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},ti=ur(class extends yn{constructor(n){if(super(n),n.type!==lr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let r=[],s=[],o=0;for(let a of n)r[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){let r=wl(n),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,s;let a=this.ut??=[],l=[],u,c,p=0,f=r.length-1,d=0,g=s.length-1;for(;p<=f&&d<=g;)if(r[p]===null)p++;else if(r[f]===null)f--;else if(a[p]===o[d])l[d]=Rt(r[p],s[d]),p++,d++;else if(a[f]===o[g])l[g]=Rt(r[f],s[g]),f--,g--;else if(a[p]===o[g])l[g]=Rt(r[p],s[g]),_n(n,l[g+1],r[p]),p++,g--;else if(a[f]===o[d])l[d]=Rt(r[f],s[d]),_n(n,r[p],r[f]),f--,d++;else if(u===void 0&&(u=xl(o,d,g),c=xl(a,p,f)),u.has(a[p]))if(u.has(a[f])){let m=c.get(o[d]),E=m!==void 0?r[m]:null;if(E===null){let L=_n(n,r[p]);Rt(L,s[d]),l[d]=L}else l[d]=Rt(E,s[d]),_n(n,r[p],E),r[m]=null;d++}else cr(r[f]),f--;else cr(r[p]),p++;for(;d<=g;){let m=_n(n,l[g+1]);Rt(m,s[d]),l[d++]=m}for(;p<=f;){let m=r[p++];m!==null&&cr(m)}return this.ut=o,bl(n,l),nt}});function kl(n,e,t){return n?e(n):t?.(n)}var pr,Sl,fr=class fr extends z(U){constructor(){super();b(this,pr);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?N:D`
29
+ <div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pb-2 pt-6">
30
+ ${kl(this.examples.title,()=>D`
31
+ <h2 class="mt-14 max-w-[18rem] px-2 pb-2 pt-9 text-left text-3xl font-bold leading-tight tracking-tight">
32
+ <span>${this.examples.title}</span>
33
+ <svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
34
+ <path
35
+ fill="#D2D2D2"
36
+ d="M23.503 12.319c.298-.925 1.605-.925 1.903 0L29.751 25.8a1 1 0 0 0 .695.66l14.515 3.852c.99.263.99 1.67 0 1.933l-14.515 3.852a1 1 0 0 0-.695.66l-4.345 13.483c-.297.924-1.605.924-1.903 0l-4.345-13.483a1 1 0 0 0-.695-.66L3.949 32.246c-.992-.263-.992-1.67 0-1.933l14.514-3.852a1 1 0 0 0 .695-.66l4.345-13.482ZM45.279 2.115c.134-.492.831-.492.965 0l1.688 6.206a.5.5 0 0 0 .373.357l6.642 1.488c.521.117.521.86 0 .976l-6.642 1.488a.5.5 0 0 0-.373.357l-1.688 6.206c-.134.492-.831.492-.965 0l-1.688-6.206a.5.5 0 0 0-.373-.357l-6.642-1.488c-.521-.117-.521-.86 0-.976l6.642-1.488a.5.5 0 0 0 .373-.357l1.688-6.206ZM45.279 42.077c.134-.492.831-.492.965 0l1.688 6.206a.5.5 0 0 0 .373.357l6.642 1.488c.521.117.521.86 0 .976l-6.642 1.488a.5.5 0 0 0-.373.357l-1.688 6.206c-.134.492-.831.492-.965 0l-1.688-6.206a.5.5 0 0 0-.373-.357l-6.642-1.488c-.521-.117-.521-.86 0-.976l6.642-1.488a.5.5 0 0 0 .373-.357l1.688-6.206Z" />
37
+ </svg>
38
+ </h2>
39
+ `)}
40
+ ${this.examples?.items?.length?D`
41
+ <ul class="mt-auto flex select-none flex-wrap justify-end gap-2.5 text-sm/6 text-black">
42
+ ${ti(this.examples.items,t=>t,t=>D`
43
+ <li class="border-1 hover:bg-[${this.color}]/[0.08] border-gray my-auto inline-block cursor-pointer rounded-2xl px-4 py-2 transition-all duration-200 hover:-translate-y-0.5 hover:opacity-80 hover:shadow" @click="${()=>$(this,pr,Sl).call(this,t)}">
44
+ <span>${t.trim()}</span>
45
+ </li>
46
+ `)}
47
+ </ul>
48
+ `:N}
56
49
  </div>
57
- `);this.examples={title:"",items:[]}}};xr=new WeakSet,El=function(t){this.dispatchEvent(new kr.ExampleClickEvent({example:t}))},k(kr,"properties",{examples:{type:Object}});var _n=kr,eo;_n.ExampleClickEvent=(eo=class extends CustomEvent{constructor(e,t={}){super(_n.ExampleClickEvent.type,{detail:e,...t})}},k(eo,"type","mw:example-click"),eo);var bn,$l,Cl,oi=class oi extends z(q){constructor(){super();b(this,bn);k(this,"render",()=>P`
58
- <div class="flex items-center justify-between space-x-4 bg-white p-4 font-sans text-lg">
59
- <mw-pulse-dot class="contents" position="bottom-right" color="green-500">
60
- <div class="h-10 w-10 overflow-hidden rounded">
61
- <!-- when injected from the dashboard, it's a base64 string data:image format -->
62
- <img class="h-full w-full bg-white object-cover" src="${this.content.logoUrl}" alt="Logo" />
50
+ `}};pr=new WeakSet,Sl=function(t){this.dispatchEvent(new fr.ExampleClickEvent({example:t}))},C(fr,"properties",{examples:{type:Object},color:{type:String}});var ni=fr,zs;ni.ExampleClickEvent=(zs=class extends CustomEvent{constructor(e,t={}){super(ni.ExampleClickEvent.type,{detail:e,...t})}},C(zs,"type","mw:example-click"),zs);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",ni);var wn,El,$l,bn=class bn extends z(U){constructor(){super();b(this,wn);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return D`
51
+ <div class="relative h-12">
52
+ <div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
53
+
54
+ <div class="absolute inset-0 h-12 overflow-hidden rounded-full">
55
+ <svg class="text-[${this.content.color}]/80 absolute left-1/2 -translate-x-1/2" width="1000" height="48" viewBox="0 0 1000 48" fill="none" xmlns="http://www.w3.org/2000/svg">
56
+ <path d="M0 0V48H448C459.674 47.8029 468.846 37.4168 476.669 28.559L476.764 28.4508C482.429 22.0372 490.665 18 499.833 18C509.002 18 517.239 22.0372 522.903 28.4508L522.998 28.559C530.895 37.5009 540.167 48 552 48H1000V0H0Z" fill="currentColor" />
57
+ </svg>
63
58
  </div>
64
- </mw-pulse-dot>
65
59
 
66
- <div class="flex flex-grow flex-col items-start justify-center">
67
- <!-- nbsp adds whitespace even if the title is empty so the chatbot doesn't jump when in design mode -->
68
- <h1 class="font-semibold text-gray-800">${this.content.title}&nbsp;</h1>
69
- <!-- design idea: <p class="text-sm text-gray-600"><code class="rounded bg-gray-500 px-[2px] text-xs text-white">AI</code> Bot</p> -->
70
- <p class="${this.content.status==="Still learning"?`text-[${this.content.color}]`:"text-green-500"} select-none text-sm">${this.content.status}</p>
60
+ <div class="absolute inset-0 px-4 py-3">
61
+ <!-- title + buttons -->
62
+ <!-- h-6 keeps the same height as the right buttons to stop the text jitter when they become visible -->
63
+ <div class="z-10 flex h-6 items-center gap-3">
64
+ <!-- TODO: line-clamp-2 -->
65
+ <h1 class="text-md line-clamp-2 max-w-[40%] truncate font-semibold leading-tight tracking-tight text-white">${this.content.title}</h1>
66
+
67
+ <!-- spacer to push other elements to the sides -->
68
+ <div class="flex-grow"></div>
69
+
70
+ <!-- new chat btn -->
71
+ <button @click=${$(this,wn,El)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
72
+ <!-- svg icon of a bubble with a plus -->
73
+ <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
74
+ <path
75
+ fill="#fff"
76
+ fill-rule="evenodd"
77
+ d="M36.201 17.62c0 10.996-6.18 17.181-17.17 17.181-3.236 0-6.055-.536-8.422-1.574l-8.084 2.697c-1.136.379-2.206-.722-1.797-1.848l2.823-7.77c-1.113-2.42-1.69-5.33-1.69-8.687C1.862 6.623 8.044.438 19.032.438c10.99 0 17.17 6.185 17.17 17.181Zm-15.88-8.653a1.355 1.355 0 0 0-2.71 0v7.897H9.716a1.355 1.355 0 1 0 0 2.71h7.897v7.896a1.355 1.355 0 1 0 2.71 0v-7.896h7.896a1.355 1.355 0 1 0 0-2.71h-7.896V8.967Z"
78
+ clip-rule="evenodd" />
79
+ </svg>
80
+ </button>
81
+
82
+ <!-- close chat btn -->
83
+ <button @click=${$(this,wn,$l)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
84
+ <!-- svg icon of an X -->
85
+ <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">
86
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
87
+ </svg>
88
+ </button>
89
+ </div>
90
+
91
+ <!-- logo -->
92
+ <div class="absolute left-1/2 top-1/2 z-10 -mt-0.5 -translate-x-1/2">
93
+ <!-- when injected from the dashboard, it's a base64 string data:image format -->
94
+ <img class="inline-block h-[52px] w-[52px] rounded-full bg-white object-cover" src="${this.content.logoUrl}" alt="Logo" />
95
+ </div>
96
+ </div>
71
97
  </div>
98
+ `}};wn=new WeakSet,El=function(){this.dispatchEvent(new bn.NewChatClickEvent)},$l=function(){this.dispatchEvent(new bn.CloseClickEvent)},C(bn,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),C(bn,"styles",ht`
99
+ /* blurred background */
72
100
 
73
- <div class="flex-grow"></div>
101
+ .gradient-blur {
102
+ /* blur gradient */
103
+ mask-image: linear-gradient(to bottom, white 70%, transparent);
104
+ -webkit-mask-image: linear-gradient(to bottom, white 70%, transparent);
105
+ backdrop-filter: blur(2px);
74
106
 
75
- <button @click="${$(this,bn,$l)}" class="${this.showNewChat?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50">
76
- <!-- -->
77
- <p class="inline-flex h-6 w-6 items-center justify-center">
78
- <span class="whitespace-pre text-[11px] font-medium leading-[15px]">${this.content.newChatTitle||`NEW
79
- CHAT`}</span>
80
- </p>
81
- </button>
107
+ /* bg-color gradient */
108
+ background-image: linear-gradient(to bottom, white 20%, transparent);
109
+ }
110
+ `);var Kt=bn,Ws;Kt.NewChatClickEvent=(Ws=class extends CustomEvent{constructor(e={}){super(Kt.NewChatClickEvent.type,{...e})}},C(Ws,"type","mw:new-chat-click"),Ws);var Vs;Kt.CloseClickEvent=(Vs=class extends CustomEvent{constructor(e={}){super(Kt.CloseClickEvent.type,{...e})}},C(Vs,"type","mw:close-click"),Vs);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Kt);var Gs={maxHeight:120,initialHeight:32,paddingY:12},$e,Ks,Cl,Il,Al,Tl,Qs,xn=class xn extends z(U){constructor(){super();b(this,$e);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return D`
111
+ <form @submit="${$(this,$e,Al)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
112
+ <textarea name="input" @input="${$(this,$e,Tl)}" @keydown="${$(this,$e,Il)}" autofocus ?disabled="${this.disabled}" placeholder="${this.placeholder}" class="box-content h-[${Gs.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${Gs.paddingY}px] text-base text-gray-800 outline-none"></textarea>
82
113
 
83
- <button @click="${$(this,bn,Cl)}" class="${this.showClose?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50 sm:hidden">
84
- <!-- x -->
85
- <span class="inline-block h-6 w-6 leading-6">✕</span>
86
- </button>
87
- </div>
88
- `);this.content={logoUrl:"",title:"",status:"",color:"",newChatTitle:""},this.showNewChat=!1,this.showClose=!1}};bn=new WeakSet,$l=function(){this.dispatchEvent(new oi.NewChatClickEvent)},Cl=function(){this.dispatchEvent(new oi.CloseClickEvent)},k(oi,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}});var Rt=oi,to;Rt.NewChatClickEvent=(to=class extends CustomEvent{constructor(e={}){super(Rt.NewChatClickEvent.type,{...e})}},k(to,"type","mw:new-chat-click"),to);var no;Rt.CloseClickEvent=(no=class extends CustomEvent{constructor(e={}){super(Rt.CloseClickEvent.type,{...e})}},k(no,"type","mw:close-click"),no);var Xe,Il,Al,Tl,Rl,Pl,wn=class wn extends z(q){constructor(){super();b(this,Xe);k(this,"render",()=>P`
89
- <form class="flex items-center space-x-4 border-t bg-white px-4 font-sans text-base" @submit="${$(this,Xe,Rl)}">
90
- <!-- text input -->
91
- <textarea name="input" @input="${$(this,Xe,Pl)}" @keydown="${$(this,Xe,Tl)}" class="my-2 block w-full flex-1 resize-none rounded bg-white py-2 text-[16px] text-gray-800 outline-none transition-colors disabled:bg-white" placeholder="${this.placeholder}" autofocus ?disabled="${this.disabled}"></textarea>
92
-
93
- <!-- send/cancel button -->
94
- <div class="py-2">
95
- <button type="submit" class="hover:bg-[${this.color}]/80 inline-flex h-8 w-8 select-none items-center justify-center rounded-full bg-[${this.color}] text-white transition-colors" ?disabled="${this.disabled}">
96
- ${this.streaming?P`
114
+ <button type="submit" ?disabled="${this.disabled}" class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
115
+ ${this.streaming?D`
97
116
  <!-- x -->
98
- <svg class="h-4 w-4 fill-current" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
99
- <path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" />
117
+ <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">
118
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
100
119
  </svg>
101
- `:P`
120
+ `:D`
102
121
  <!-- airplane -->
103
- <svg class="h-4 w-4 fill-current" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
104
- <path d="m4.01 6.03 7.51 3.22-7.52-1 .01-2.22m7.5 8.72L4 17.97v-2.22l7.51-1M2.01 3 2 10l15 2-15 2 .01 7L23 12 2.01 3z" />
122
+ <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 35 34">
123
+ <path stroke="#312E30" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M33 16.99a1.07 1.07 0 0 0-.589-.955L5.107 2.22a2.162 2.162 0 0 0-2.515.447 2.141 2.141 0 0 0-.318 2.524L9.537 16.99 2.274 28.808a2.138 2.138 0 0 0 .318 2.524 2.157 2.157 0 0 0 2.515.447l27.304-13.832A1.075 1.075 0 0 0 33 16.99Zm0 0H9.53" />
105
124
  </svg>
106
125
  `}
107
126
  </button>
108
- </div>
109
- </form>
110
- `);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message...",this.color=""}};Xe=new WeakSet,Il=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Al=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Tl=function(t){ef(t)&&(t.preventDefault(),this.streaming||h(this,Xe,Al)?.click())},Rl=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new wn.CancelEvent);return}let i=h(this,Xe,Il);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new wn.SubmitEvent(i.value))&&(i.value="")},Pl=function(t){this.dispatchEvent(new wn.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""}))},k(wn,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String},color:{type:String}});var ct=wn,io;ct.ChangeEvent=(io=class extends CustomEvent{constructor(e,t={}){super(ct.ChangeEvent.type,{detail:e,...t})}},k(io,"type","mw:change"),io);var ro;ct.SubmitEvent=(ro=class extends CustomEvent{constructor(e,t={}){super(ct.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},k(ro,"type","mw:submit"),ro);var so;ct.CancelEvent=(so=class extends CustomEvent{constructor(e={}){super(ct.CancelEvent.type,{...e})}},k(so,"type","mw:cancel"),so);function ef(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}var ai=class extends z(q){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl=""}render(){switch(this.side){case"user":return P`
127
+ </form>
128
+ <slot>
129
+ <div class="h-5 w-full"></div>
130
+ </slot>
131
+ `}};$e=new WeakSet,Ks=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Cl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Il=function(t){Kp(t)&&(t.preventDefault(),this.streaming||h(this,$e,Cl)?.click())},Al=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new xn.CancelEvent);return}let i=h(this,$e,Ks);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new xn.SubmitEvent(i.value))&&(i.value=""),$(this,$e,Qs).call(this)},Tl=function(t){this.dispatchEvent(new xn.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),$(this,$e,Qs).call(this)},Qs=function(){let t=h(this,$e,Ks);if(!t)return;let{maxHeight:i,initialHeight:r,paddingY:s}=Gs;t.style.height=`${r}px`;let o=t.scrollHeight,a=s*2,l=Math.min(o-a,i);t.style.height=`${l}px`},C(xn,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var mt=xn,Xs;mt.ChangeEvent=(Xs=class extends CustomEvent{constructor(e,t={}){super(mt.ChangeEvent.type,{detail:e,...t})}},C(Xs,"type","mw:change"),Xs);var Js;mt.SubmitEvent=(Js=class extends CustomEvent{constructor(e,t={}){super(mt.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},C(Js,"type","mw:submit"),Js);var Ys;mt.CancelEvent=(Ys=class extends CustomEvent{constructor(e={}){super(mt.CancelEvent.type,{...e})}},C(Ys,"type","mw:cancel"),Ys);function Kp(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",mt);var dr=class extends z(U){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let e="rounded-2xl";switch(!0){case(this.side==="user"&&this.position==="single"):e="rounded-2xl";break;case(this.side==="user"&&["single-current","first"].includes(this.position)):e="rounded-2xl rounded-br-[4px]";break;case(this.side==="user"&&["middle","last-current"].includes(this.position)):e="rounded-2xl rounded-r-[4px]";break;case(this.side==="user"&&this.position==="last"):e="rounded-2xl rounded-tr-[4px]";break;case(["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)):e="rounded-2xl";break;case(["support","assistant"].includes(this.side)&&this.position==="first"):e="rounded-2xl rounded-bl-[4px]";break;case(["support","assistant"].includes(this.side)&&this.position==="middle"):e="rounded-2xl rounded-l-[4px]";break;case(["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)):e="rounded-2xl rounded-tl-[4px]";break;default:e="rounded-2xl";break}switch(this.side){case"user":return D`
111
132
  <div class="ml-20 flex justify-end font-sans text-base">
112
133
  <div class="max-w-full">
113
134
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
114
- <div class="rounded-xl border border-[${this.color}] bg-[${this.color}] px-4 py-3 text-left text-white">
135
+ <div class="${e} border border-[${this.color}] bg-[${this.color}] px-4 py-3 text-left text-white">
115
136
  <slot></slot>
116
137
  </div>
117
138
 
118
139
  <!-- render status (if any) -->
119
- ${this.status==="sent"?P`
140
+ ${this.status==="sent"?D`
120
141
  <!-- tick mark -->
121
142
  <svg class="ml-auto h-4 w-4 text-[${this.color}]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
122
143
  <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
@@ -124,97 +145,108 @@ CHAT`}</span>
124
145
  `:N}
125
146
  </div>
126
147
  </div>
127
- `;case"assistant":case"support":return P`
148
+ `;case"assistant":case"support":return D`
128
149
  <div class="mr-8 flex justify-start font-sans text-base">
129
150
  <div class="flex max-w-full space-x-2">
130
151
  <!--
131
152
  mt-[9px] because the message is 50px tall, the icon is 32px tall, we want to center it
132
153
  -->
133
- <div class="mt-[9px] h-8 w-8 flex-shrink-0 flex-grow-0 overflow-hidden rounded-full">
154
+ <div class="mt-[9px] h-6 w-6 flex-shrink-0 flex-grow-0 overflow-hidden rounded-full">
134
155
  <img class="h-full w-full bg-white object-cover" src="${this.logoUrl}" alt="Logo" />
135
156
  </div>
136
157
 
137
158
  <!--
138
159
  min-h-[50px] because when we start streaming we sometimes start with an empty paragraph
139
160
  -->
140
- <div class="min-h-[50px] max-w-full overflow-hidden rounded-xl border bg-white px-4 py-3 text-left text-gray-800">
161
+ <div class="${e} min-h-[50px] max-w-full overflow-hidden border border-gray-100 bg-gray-50 px-4 py-3 text-left text-gray-800">
141
162
  <slot></slot>
142
163
  </div>
143
164
  </div>
144
165
  </div>
145
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};k(ai,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"}});var li,Le,rt,ui,oo,Sr=class{constructor(e,t){b(this,ui);b(this,li);b(this,Le);b(this,rt);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");R(this,li,e),h(this,li).addController(this),R(this,Le,t)}connect(e){R(this,Le,e),R(this,rt,$(this,ui,oo).call(this))}hostConnected(){setTimeout(()=>{R(this,rt,$(this,ui,oo).call(this))},0)}hostDisconnected(){h(this,rt)?.close(1e3,"lit_host_disconnected"),R(this,rt,void 0)}send(e){h(this,rt)?.send(e)}close(e,t){h(this,rt)?.close(e,t)}render(e={}){switch(h(this,rt)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}get isConnected(){return h(this,rt)?.readyState===WebSocket.OPEN}};li=new WeakMap,Le=new WeakMap,rt=new WeakMap,ui=new WeakSet,oo=function(){let e=new WebSocket(h(this,Le).url());return h(this,Le).onClose&&(e.onclose=h(this,Le).onClose),h(this,Le).onOpen&&(e.onopen=h(this,Le).onOpen),h(this,Le).onError&&(e.onerror=h(this,Le).onError),h(this,Le).onMessage&&(e.onmessage=h(this,Le).onMessage),e};var Fl="664df22d-d461-42d6-801e-f70247e2cd7c",me,ye,st,xn,kn,we,Zt,Ol,Dl,Ml,Ll,Er=class{constructor(e,t){b(this,we);b(this,me);b(this,ye);b(this,st);k(this,"isStreaming",!1);k(this,"typingIndicator");k(this,"ranOutOfCredits",!1);k(this,"messages",[]);k(this,"conversationId","");b(this,xn,0);b(this,kn);k(this,"isLiveMode",!1);R(this,me,e),R(this,ye,t),R(this,st,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return $(this,we,Zt).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return $(this,we,Zt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return $(this,we,Zt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return $(this,we,Zt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){$(this,we,Zt).call(this,{type:"RELOAD_CONFIG"})}close(){h(this,st).close(1e3,"closed by user")}retry(){clearTimeout(h(this,kn)),R(this,kn,setTimeout(()=>{h(this,ye).onReconnect?.(),R(this,st,this.initWS())},1e3*h(this,xn))),ba(this,xn)._++}initWS(){return new Sr(h(this,me),{url:()=>h(this,ye).url(this.conversationId,{}),onOpen:e=>$(this,we,Ol).call(this,e),onMessage:e=>$(this,we,Dl).call(this,JSON.parse(e.data)),onError:e=>$(this,we,Ml).call(this,e),onClose:e=>$(this,we,Ll).call(this,e)})}hostConnected(){this.conversationId=h(this,ye).restoreConversationState?.()?.conversationId||"",this.messages=h(this,ye).restoreConversationState?.()?.messages||[]}reset(){$(this,we,Zt).call(this,{type:"NEW_CHAT"}),h(this,ye).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,h(this,me).requestUpdate()}hostDisconnected(){clearTimeout(h(this,kn))}reconnectSocket(){h(this,st).close(1e3,"destroy"),R(this,st,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};me=new WeakMap,ye=new WeakMap,st=new WeakMap,xn=new WeakMap,kn=new WeakMap,we=new WeakSet,Zt=function(e,{expectStreaming:t=!1}={}){return h(this,st).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,h(this,me).requestUpdate()),h(this,st).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Ol=function(e){R(this,xn,0)},Dl=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,i,r)=>i===r.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,h(this,me).requestUpdate(),h(this,ye).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),h(this,me).requestUpdate(),h(this,ye).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,h(this,me).requestUpdate(),h(this,ye).onMessageDone?.(e,t),h(this,ye).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,h(this,me).requestUpdate();break}case"ERROR":{h(this,ye).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,h(this,ye).onConnect?.(e.conversationId),h(this,ye).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,h(this,me).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},h(this,me).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,h(this,me).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Fl)||this.messages.push({id:Fl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,h(this,me).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),h(this,me).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Ml=function(e){console.error("onError",e),h(this,ye).onError?.(e)},Ll=function(e){h(this,me).isConnected&&!h(this,st).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,h(this,me).requestUpdate(),h(this,ye).onClose?.()};var ci,Sn,Pt,en,Cr,Nl,$r=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,Cr);b(this,ci);b(this,Sn);b(this,Pt);b(this,en,!1);k(this,"timeoutMs");R(this,ci,e),R(this,Sn,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return h(this,en)}hostDisconnected(){clearTimeout(h(this,Pt)),R(this,Pt,void 0)}onInput(e){if(h(this,ci).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(h(this,Pt)),R(this,Pt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),h(this,en)||$(this,Cr,Nl).call(this)}}typingStopped(){clearTimeout(h(this,Pt)),R(this,en,!1),h(this,Sn).typingStopped()}};ci=new WeakMap,Sn=new WeakMap,Pt=new WeakMap,en=new WeakMap,Cr=new WeakSet,Nl=function(){R(this,en,!0),h(this,Sn).typingStarted()};function jl(n,e){let t=new Map;for(let i of n){let r=e(i);t.has(r)||t.set(r,[]),(t.get(r)||[]).push(i)}return t}function ql(n,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(n);return`${n.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var ao;function tf(n){return{lang:n?.lang??ao?.lang,message:n?.message,abortEarly:n?.abortEarly??ao?.abortEarly,abortPipeEarly:n?.abortPipeEarly??ao?.abortPipeEarly}}var nf;function rf(n){return nf?.get(n)}var sf;function of(n){return sf?.get(n)}var af;function lf(n,e){return af?.get(n)?.get(e)}function En(n){let e=typeof n;return e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e==="object"||e==="function"?(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null":e}function Ft(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??En(s),l={kind:n.kind,type:n.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:n.requirement,path:r?.path,issues:r?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=n.kind==="schema",c=r?.message??n.message??lf(n.reference,l.lang)??(u?of(l.lang):null)??i.message??rf(l.lang);c&&(l.message=typeof c=="function"?c(l):c),u&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}function uf(n,e){let t=[...new Set(n)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var cf=class extends Error{constructor(e){super(e[0].message);k(this,"issues");this.name="ValiError",this.issues=e}};function lo(n,e){return{kind:"validation",type:"max_value",reference:lo,async:!1,expects:`<=${n instanceof Date?n.toJSON():En(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&Ft(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():En(t.value)}),t}}}function uo(n,e){return{kind:"validation",type:"min_value",reference:uo,async:!1,expects:`>=${n instanceof Date?n.toJSON():En(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&Ft(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():En(t.value)}),t}}}function pf(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function mt(n,e){return{kind:"schema",type:"array",reference:mt,expects:"Array",async:!1,item:n,message:e,_run(t,i){let r=t.value;if(Array.isArray(r)){t.typed=!0,t.value=[];for(let s=0;s<r.length;s++){let o=r[s],a=this.item._run({typed:!1,value:o},i);if(a.issues){let l={type:"array",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else Ft(this,"type",t,i);return t}}}function $e(n){return{kind:"schema",type:"boolean",reference:$e,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:Ft(this,"type",e,t),e}}}function Be(n){return{kind:"schema",type:"number",reference:Be,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ft(this,"type",e,t),e}}}function re(n,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:n,message:e,_run(t,i){let r=t.value;if(r&&typeof r=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=r[s],a=this.entries[s]._run({typed:!1,value:o},i);if(a.issues){let l={type:"object",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||s in r)&&(t.value[s]=a.value)}}else Ft(this,"type",t,i);return t}}}function I(n,...e){let t={kind:"schema",type:"optional",reference:I,expects:`(${n.expects} | undefined)`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=pf(this,i,r)),i.value===void 0)?(i.typed=!0,i):this.wrapped._run(i,r)}};return 0 in e&&(t.default=e[0]),t}function $n(n,e){return{kind:"schema",type:"picklist",reference:$n,expects:uf(n.map(En),"|"),async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:Ft(this,"type",t,i),t}}}function j(n){return{kind:"schema",type:"string",reference:j,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:Ft(this,"type",e,t),e}}}function Ul(n,e,t){let i=n._run({typed:!1,value:e},tf(t));if(i.issues)throw new cf(i.issues);return i.value}function Bl(...n){return{...n[0],pipe:n,_run(e,t){for(let i of n)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=i._run(e,t))}return e}}}var mg=re({wsApiUrl:j(),url:j(),logoUrl:I(j()),title:j(),status:j(),color:j(),showStillLearningBanner:I($e()),allowedOrigins:I(mt(j())),input:re({placeholder:j()}),bubble:re({imageUrl:I(j()),position:re({bottom:I(j()),right:I(j()),left:I(j())}),mobilePosition:I(re({bottom:I(j()),right:I(j()),left:I(j())}))}),examples:re({title:j(),items:mt(j())}),instructions:re({items:mt(j())}),popup:I(re({mobileEnabled:I($e()),desktopEnabled:I($e()),delayMs:I(Be()),text:I(j()),mobileTitleText:I(j()),mobileButtonText:I(j())})),tryItOut:I(re({mobileEnabled:I($e()),desktopEnabled:I($e()),text:I(j())})),contactDetails:I(re({email:I(j()),phone:I(j()),socialMedia:I(re({facebook:I(j()),instagram:I(j()),twitter:I(j())}))})),neverShowStillLearningBanner:I($e()),hidden:I($e()),newChatTitle:I(j()),webhookURL:I(j()),automatedResponse:I(re({enabled:I($e()),text:I(j()),latencyThresholdMs:I(Be())})),removePoweredBy:I($e()),claimable:I($e()),feed:I(j()),scraper:I($n(["netkazan","jateknet","grandopet","insportline","partocean","google-rev1"])),platform:I($n(["shopify","shoprenter","unas","scraper"])),workingHours:I(re({dailyAvailability:mt(re({dayOfWeek:Bl(Be(),uo(0),lo(6)),startTime:j(),endTime:j(),isActive:$e()})),userTimeZone:I(j())})),planOverrides:I(re({maxProducts:I(Be()),conversations:I(Be()),faqs:I(re({max:I(Be()),questionLength:I(Be()),answerLength:I(Be())}))})),omitGeneralGuidelines:I($e()),forceStripe:I($e()),products:I(re({blocklistUrls:I(mt(j()))})),autoRefresh:I(re({enabled:I($e()),intervalMins:I(Be())})),lang:I(j())});var pi=class extends mn{constructor(e){if(super(e),this.it=N,e.type!==_r.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===N||e==null)return this._t=void 0,this.it=e;if(e===nt)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:[]}}};pi.directiveName="unsafeHTML",pi.resultType=1;var zl=br(pi);var ff="\xB7 \xB7 \xB7",df=re({conversationId:I(j()),messages:I(mt(re({id:j(),timestamp:Be(),role:$n(["user","assistant","support"]),content:j(),content_html:I(j())})))}),se,Ir,fi,ae,Wl,Vl,Gl,Xl,Jl,Yl,Kl,po,Ar=class Ar extends z(q){constructor(){super();b(this,se);b(this,fi,new $r(this,{typingStarted:()=>h(this,ae).sendUserTypingStart(),typingStopped:()=>h(this,ae).sendUserTypingStop()}));b(this,ae,new Er(this,{url:(t,{resume:i}={})=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("resume",i?"1":""),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"&&h(this,se,po)?.scrollTo(0,h(this,se,po).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,i)=>{i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(h(this,se,Ir))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(h(this,se,Ir),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(h(this,se,Ir))||"{}"),i=Ul(df,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return h(this,ae).conversationId}get messages(){return h(this,ae).messages}render(){let t=jl(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return P`
146
- <div class="mx-auto flex h-full w-full flex-col bg-white font-sans text-base">
147
- <mw-header
148
- class="z-10 border-b"
149
- .content="${{logoUrl:this.config.logoUrl,title:this.config.title,status:this.config.status,color:this.config.color,newChatTitle:this.config.newChatTitle}}"
150
- ?show-new-chat="${!h(this,ae).isLiveMode&&this.messages.length>0}"
151
- ?show-close="${this.showClose}"
152
- @mw:new-chat-click="${$(this,se,Yl)}"
153
- @mw:close-click="${$(this,se,Kl)}">
154
- </mw-header>
155
-
156
- <!-- used by the dashboard to inject content -->
157
- <slot name="banner"></slot>
158
-
159
- <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
160
- <div id="scrollable-content" class="flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto bg-[#FDFDFD] pt-4">
161
- ${this.config?.showStillLearningBanner?P`
162
- <div class="flex justify-center">
163
- <div class="mb-2 flex w-1/2 items-center justify-center rounded-full bg-black p-3">
164
- <!-- (i) symbol -->
165
- <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6">
166
- <path
167
- fill-rule="evenodd"
168
- clip-rule="evenodd"
169
- d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z"
170
- fill="white" />
171
- </svg>
166
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};C(dr,"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",dr);var ii,Ne,rt,ri,Zs,hr=class{constructor(e,t){b(this,ri);b(this,ii);b(this,Ne);b(this,rt);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");S(this,ii,e),h(this,ii).addController(this),S(this,Ne,t)}connect(e){S(this,Ne,e),S(this,rt,$(this,ri,Zs).call(this))}hostConnected(){setTimeout(()=>{S(this,rt,$(this,ri,Zs).call(this))},0)}hostDisconnected(){h(this,rt)?.close(1e3,"lit_host_disconnected"),S(this,rt,void 0)}send(e){h(this,rt)?.send(e)}close(e,t){h(this,rt)?.close(e,t)}render(e={}){switch(h(this,rt)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}get isConnected(){return h(this,rt)?.readyState===WebSocket.OPEN}};ii=new WeakMap,Ne=new WeakMap,rt=new WeakMap,ri=new WeakSet,Zs=function(){let e=new WebSocket(h(this,Ne).url());return h(this,Ne).onClose&&(e.onclose=h(this,Ne).onClose),h(this,Ne).onOpen&&(e.onopen=h(this,Ne).onOpen),h(this,Ne).onError&&(e.onerror=h(this,Ne).onError),h(this,Ne).onMessage&&(e.onmessage=h(this,Ne).onMessage),e};var Rl="664df22d-d461-42d6-801e-f70247e2cd7c",me,ye,st,kn,Sn,we,Qt,Pl,Ol,Fl,Ml,vr=class{constructor(e,t){b(this,we);b(this,me);b(this,ye);b(this,st);C(this,"isStreaming",!1);C(this,"typingIndicator");C(this,"ranOutOfCredits",!1);C(this,"messages",[]);C(this,"conversationId","");b(this,kn,0);b(this,Sn);C(this,"isLiveMode",!1);S(this,me,e),S(this,ye,t),S(this,st,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return $(this,we,Qt).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return $(this,we,Qt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return $(this,we,Qt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return $(this,we,Qt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){$(this,we,Qt).call(this,{type:"RELOAD_CONFIG"})}close(){h(this,st).close(1e3,"closed by user")}retry(){clearTimeout(h(this,Sn)),S(this,Sn,setTimeout(()=>{h(this,ye).onReconnect?.(),S(this,st,this.initWS())},1e3*h(this,kn))),va(this,kn)._++}initWS(){return new hr(h(this,me),{url:()=>h(this,ye).url(this.conversationId,{}),onOpen:e=>$(this,we,Pl).call(this,e),onMessage:e=>$(this,we,Ol).call(this,JSON.parse(e.data)),onError:e=>$(this,we,Fl).call(this,e),onClose:e=>$(this,we,Ml).call(this,e)})}hostConnected(){this.conversationId=h(this,ye).restoreConversationState?.()?.conversationId||"",this.messages=h(this,ye).restoreConversationState?.()?.messages||[]}reset(){$(this,we,Qt).call(this,{type:"NEW_CHAT"}),h(this,ye).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,h(this,me).requestUpdate()}hostDisconnected(){clearTimeout(h(this,Sn))}reconnectSocket(){h(this,st).close(1e3,"destroy"),S(this,st,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};me=new WeakMap,ye=new WeakMap,st=new WeakMap,kn=new WeakMap,Sn=new WeakMap,we=new WeakSet,Qt=function(e,{expectStreaming:t=!1}={}){return h(this,st).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,h(this,me).requestUpdate()),h(this,st).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Pl=function(e){S(this,kn,0)},Ol=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,i,r)=>i===r.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,h(this,me).requestUpdate(),h(this,ye).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),h(this,me).requestUpdate(),h(this,ye).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,h(this,me).requestUpdate(),h(this,ye).onMessageDone?.(e,t),h(this,ye).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,h(this,me).requestUpdate();break}case"ERROR":{h(this,ye).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,h(this,ye).onConnect?.(e.conversationId),h(this,ye).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,h(this,me).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},h(this,me).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,h(this,me).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Rl)||this.messages.push({id:Rl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,h(this,me).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),h(this,me).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Fl=function(e){console.error("onError",e),h(this,ye).onError?.(e)},Ml=function(e){h(this,me).isConnected&&!h(this,st).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,h(this,me).requestUpdate(),h(this,ye).onClose?.()};var si,En,Pt,Zt,mr,Dl,gr=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,mr);b(this,si);b(this,En);b(this,Pt);b(this,Zt,!1);C(this,"timeoutMs");S(this,si,e),S(this,En,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return h(this,Zt)}hostDisconnected(){clearTimeout(h(this,Pt)),S(this,Pt,void 0)}onInput(e){if(h(this,si).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(h(this,Pt)),S(this,Pt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),h(this,Zt)||$(this,mr,Dl).call(this)}}typingStopped(){clearTimeout(h(this,Pt)),S(this,Zt,!1),h(this,En).typingStopped()}};si=new WeakMap,En=new WeakMap,Pt=new WeakMap,Zt=new WeakMap,mr=new WeakSet,Dl=function(){S(this,Zt,!0),h(this,En).typingStarted()};function Ll(n,e){let t=new Map;for(let i of n){let r=e(i);t.has(r)||t.set(r,[]),(t.get(r)||[]).push(i)}return t}function Nl(n,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(n);return`${n.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var eo;function Qp(n){return{lang:n?.lang??eo?.lang,message:n?.message,abortEarly:n?.abortEarly??eo?.abortEarly,abortPipeEarly:n?.abortPipeEarly??eo?.abortPipeEarly}}var Zp;function ef(n){return Zp?.get(n)}var tf;function nf(n){return tf?.get(n)}var rf;function sf(n,e){return rf?.get(n)?.get(e)}function $n(n){let e=typeof n;return e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e==="object"||e==="function"?(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null":e}function Ot(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??$n(s),l={kind:n.kind,type:n.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:n.requirement,path:r?.path,issues:r?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=n.kind==="schema",c=r?.message??n.message??sf(n.reference,l.lang)??(u?nf(l.lang):null)??i.message??ef(l.lang);c&&(l.message=typeof c=="function"?c(l):c),u&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}function of(n,e){let t=[...new Set(n)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var af=class extends Error{constructor(e){super(e[0].message);C(this,"issues");this.name="ValiError",this.issues=e}};function to(n,e){return{kind:"validation",type:"max_value",reference:to,async:!1,expects:`<=${n instanceof Date?n.toJSON():$n(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&Ot(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():$n(t.value)}),t}}}function no(n,e){return{kind:"validation",type:"min_value",reference:no,async:!1,expects:`>=${n instanceof Date?n.toJSON():$n(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&Ot(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():$n(t.value)}),t}}}function lf(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function yt(n,e){return{kind:"schema",type:"array",reference:yt,expects:"Array",async:!1,item:n,message:e,_run(t,i){let r=t.value;if(Array.isArray(r)){t.typed=!0,t.value=[];for(let s=0;s<r.length;s++){let o=r[s],a=this.item._run({typed:!1,value:o},i);if(a.issues){let l={type:"array",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else Ot(this,"type",t,i);return t}}}function Ce(n){return{kind:"schema",type:"boolean",reference:Ce,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:Ot(this,"type",e,t),e}}}function He(n){return{kind:"schema",type:"number",reference:He,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ot(this,"type",e,t),e}}}function re(n,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:n,message:e,_run(t,i){let r=t.value;if(r&&typeof r=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=r[s],a=this.entries[s]._run({typed:!1,value:o},i);if(a.issues){let l={type:"object",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||s in r)&&(t.value[s]=a.value)}}else Ot(this,"type",t,i);return t}}}function A(n,...e){let t={kind:"schema",type:"optional",reference:A,expects:`(${n.expects} | undefined)`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=lf(this,i,r)),i.value===void 0)?(i.typed=!0,i):this.wrapped._run(i,r)}};return 0 in e&&(t.default=e[0]),t}function Cn(n,e){return{kind:"schema",type:"picklist",reference:Cn,expects:of(n.map($n),"|"),async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:Ot(this,"type",t,i),t}}}function j(n){return{kind:"schema",type:"string",reference:j,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:Ot(this,"type",e,t),e}}}function jl(n,e,t){let i=n._run({typed:!1,value:e},Qp(t));if(i.issues)throw new af(i.issues);return i.value}function ql(...n){return{...n[0],pipe:n,_run(e,t){for(let i of n)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=i._run(e,t))}return e}}}var Qv=re({wsApiUrl:j(),url:j(),logoUrl:A(j()),title:j(),status:j(),color:j(),showStillLearningBanner:A(Ce()),allowedOrigins:A(yt(j())),input:re({placeholder:j()}),bubble:re({imageUrl:A(j()),position:re({bottom:A(j()),right:A(j()),left:A(j())}),mobilePosition:A(re({bottom:A(j()),right:A(j()),left:A(j())}))}),examples:re({title:j(),items:yt(j())}),instructions:re({items:yt(j())}),popup:A(re({mobileEnabled:A(Ce()),desktopEnabled:A(Ce()),delayMs:A(He()),text:A(j()),mobileTitleText:A(j()),mobileButtonText:A(j())})),tryItOut:A(re({mobileEnabled:A(Ce()),desktopEnabled:A(Ce()),text:A(j())})),contactDetails:A(re({email:A(j()),phone:A(j()),socialMedia:A(re({facebook:A(j()),instagram:A(j()),twitter:A(j())}))})),neverShowStillLearningBanner:A(Ce()),hidden:A(Ce()),newChatTitle:A(j()),webhookURL:A(j()),automatedResponse:A(re({enabled:A(Ce()),text:A(j()),latencyThresholdMs:A(He())})),removePoweredBy:A(Ce()),claimable:A(Ce()),feed:A(j()),scraper:A(Cn(["netkazan","jateknet","grandopet","insportline","partocean","google-rev1"])),platform:A(Cn(["shopify","shoprenter","unas","scraper"])),workingHours:A(re({dailyAvailability:yt(re({dayOfWeek:ql(He(),no(0),to(6)),startTime:j(),endTime:j(),isActive:Ce()})),userTimeZone:A(j())})),planOverrides:A(re({maxProducts:A(He()),conversations:A(He()),faqs:A(re({max:A(He()),questionLength:A(He()),answerLength:A(He())}))})),omitGeneralGuidelines:A(Ce()),forceStripe:A(Ce()),products:A(re({blocklistUrls:A(yt(j()))})),autoRefresh:A(re({enabled:A(Ce()),intervalMins:A(He())})),lang:A(j())});var oi=class extends yn{constructor(e){if(super(e),this.it=N,e.type!==lr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===N||e==null)return this._t=void 0,this.it=e;if(e===nt)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:[]}}};oi.directiveName="unsafeHTML",oi.resultType=1;var Bl=ur(oi);var uf="\xB7 \xB7 \xB7",cf=re({conversationId:A(j()),messages:A(yt(re({id:j(),timestamp:He(),role:Cn(["user","assistant","support"]),content:j(),content_html:A(j())})))}),se,yr,li,ae,ot,Hl,zl,Wl,Vl,Gl,Xl,Jl,ro,_r=class _r extends z(U){constructor(){super();b(this,se);b(this,li,new gr(this,{typingStarted:()=>h(this,ae).sendUserTypingStart(),typingStopped:()=>h(this,ae).sendUserTypingStop()}));b(this,ae,new vr(this,{url:(t,{resume:i}={})=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("resume",i?"1":""),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"&&h(this,se,ro)?.scrollTo(0,h(this,se,ro).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,i)=>{i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(h(this,se,yr))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(h(this,se,yr),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(h(this,se,yr))||"{}"),i=jl(cf,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));b(this,ot,"single");this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return h(this,ae).conversationId}get messages(){return h(this,ae).messages}render(){console.assert(this.config,"config is required");let t=Ll(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return D`
167
+ <div class="relative mx-auto h-full font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:p-1.5 sm:before:rounded-[36px]">
168
+ <div 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]">
169
+ <mw-chat-header
170
+ class="absolute left-1.5 right-1.5 top-1.5"
171
+ .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
172
+ ?show-new-chat="${!h(this,ae).isLiveMode&&this.messages.length>0}"
173
+ ?show-close="${this.showClose}"
174
+ @mw:new-chat-click="${$(this,se,Xl)}"
175
+ @mw:close-click="${$(this,se,Jl)}">
176
+ </mw-chat-header>
177
+
178
+ <!-- used by the dashboard to inject content -->
179
+ <div class="absolute inset-x-0 top-20">
180
+ <slot name="banner"> </slot>
181
+ </div>
172
182
 
173
- <span class="ml-2 text-sm text-white">I'm still learning!</span>
183
+ <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
184
+ <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto bg-[#FDFDFD]">
185
+ ${this.config?.showStillLearningBanner?D`
186
+ <div class="flex justify-center">
187
+ <div class="mb-2 flex max-w-[70%] select-none items-center justify-center rounded-full bg-black px-3 py-2">
188
+ <!-- (i) symbol -->
189
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
190
+ <path
191
+ fill-rule="evenodd"
192
+ clip-rule="evenodd"
193
+ d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z"
194
+ fill="white" />
195
+ </svg>
196
+
197
+ <span class="ml-1 text-xs text-white">I'm still learning!</span>
198
+ </div>
174
199
  </div>
175
- </div>
176
- `:P`
177
- <!-- this makes the chat stick to bottom when the banner is hidden -->
178
- <div class="flex p-1"></div>
179
- `}
180
-
181
- <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
182
- <div>
183
- ${si(Array.from(t),([i])=>i,([i,r])=>P`
184
- <div class="my-2 text-center text-xs text-gray-500">${ql(new Date(Number(i)),window.navigator.language)}</div>
185
- ${si(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,u=h(this,ae).isLiveMode&&s.role==="user"&&s.id===h(this,ae).lastMsg?.id?"sent":"";return P`
186
- <div class="${l?"mb-[2px]":"mb-3"} mx-4 flex-row">
187
- <mw-chat-message color="${this.config.color}" status="${u}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" @click="${$(this,se,Wl)}">
188
- <div class="prose break-words text-inherit">
189
- ${s.content===ff?P`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?zl(s.content_html):P`<p>${s.content}</p>`}
190
- </div>
191
- </mw-chat-message>
200
+ `:D`
201
+ <!-- this makes the chat stick to bottom when the banner is hidden -->
202
+ <div class="flex p-1"></div>
203
+ `}
204
+
205
+ <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
206
+ <div>
207
+ ${ti(Array.from(t),([i])=>i,([i,r])=>D`
208
+ <div class="my-2 text-center text-xs text-gray-500">${Nl(new Date(Number(i)),window.navigator.language)}</div>
209
+ ${ti(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,c=(o>0?r[o-1]:void 0)?.role===s.role,f=(r.length>0?r[r.length-1]:void 0)?.id===s.id;switch(!0){case(f&&!c&&!l):S(this,ot,"single-current");break;case(!c&&!l):S(this,ot,"single");break;case(!c&&l):S(this,ot,"first");break;case(f&&c&&!l):S(this,ot,"last-current");break;case(c&&!l):S(this,ot,"last");break;case(c&&l):S(this,ot,"middle");break;default:S(this,ot,"single")}let d=h(this,ae).isLiveMode&&s.role==="user"&&s.id===h(this,ae).lastMsg?.id?"sent":"";return D`
210
+ <div class="${l?"mb-[2px]":"mb-3"} mx-2 flex-row">
211
+ <mw-chat-message color="${this.config.color}" status="${d}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" position=${h(this,ot)} @click="${$(this,se,Hl)}">
212
+ <div class="prose break-words text-inherit">
213
+ ${s.content===uf?D`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?Bl(s.content_html):D`<p>${s.content}</p>`}
214
+ </div>
215
+ </mw-chat-message>
216
+ </div>
217
+ `})}
218
+ `)}
219
+
220
+ <!-- show typing indicator if the non-user side is typing -->
221
+ ${["assistant","support"].includes(h(this,ae)?.typingIndicator?.role??"")&&h(this,ae)?.typingIndicator?.role?D`
222
+ <mw-chat-message class="mx-2 mb-3 block" color="${this.config.color}" logo="${h(this,ae)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}" side="${h(this,ae).typingIndicator.role}">
223
+ <div class="prose break-words text-inherit">
224
+ <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>
192
225
  </div>
193
- `})}
194
- `)}
195
-
196
- <!-- show typing indicator if the non-user side is typing -->
197
- ${["assistant","support"].includes(h(this,ae)?.typingIndicator?.role??"")&&h(this,ae)?.typingIndicator?.role?P`
198
- <mw-chat-message class="mx-4 mb-4 block" color="${this.config.color}" logo="${h(this,ae)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}" side="${h(this,ae).typingIndicator.role}">
199
- <div class="prose break-words text-inherit">
200
- <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>
201
- </div>
202
- </mw-chat-message>
203
- `:N}
226
+ </mw-chat-message>
227
+ `:N}
228
+ </div>
229
+
230
+ <mw-chat-background
231
+ class="max-w-sm flex-grow max-md:mx-auto"
232
+ .examples="${this.messages.length>0?[]:this.config.examples}"
233
+ color="${this.config.color}"
234
+ @mw:example-click="${$(this,se,zl)}"></mw-chat-background>
204
235
  </div>
205
236
 
206
- <mw-background
207
- class="mx-auto max-w-sm flex-grow"
208
- .examples="${this.messages.length>0?[]:this.config.examples}"
209
- @mw:example-click="${$(this,se,Vl)}"></mw-background>
210
- </div>
237
+ <div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
238
+ <mw-chat-input @mw:change="${$(this,se,Vl)}" @mw:submit="${$(this,se,Wl)}" @mw:cancel="${$(this,se,Gl)}" placeholder="${this.config.input?.placeholder}" ?disabled="${h(this,ae).ranOutOfCredits}" ?streaming="${h(this,ae)?.isStreaming??!0}"> </mw-chat-input>
211
239
 
212
- <div class="flex-shrink-0 flex-grow-0 space-y-2 pb-2">
213
- <mw-chat-input @mw:change="${$(this,se,Xl)}" @mw:submit="${$(this,se,Gl)}" @mw:cancel="${$(this,se,Jl)}" placeholder="${this.config.input?.placeholder}" color="${this.config.color}" ?disabled="${h(this,ae).ranOutOfCredits}" ?streaming="${h(this,ae)?.isStreaming??!0}"></mw-chat-input>
214
- ${this.config.removePoweredBy?N:P`<mw-powered-by></mw-powered-by>`}
240
+ ${this.config.removePoweredBy?N:D`
241
+ <!-- spacing between input box and powered-by or bottom -->
242
+ <div class="h-4">
243
+ <mw-powered-by></mw-powered-by>
244
+ </div>
245
+ `}
246
+ </div>
215
247
  </div>
216
248
  </div>
217
- `}reloadConfig(){h(this,ae).reloadConfig(),this.requestUpdate()}};se=new WeakSet,Ir=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},fi=new WeakMap,ae=new WeakMap,Wl=function(t){let i=t.target;if(i instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}window.open(i.href,i.target)}},Vl=function(t){let i=t.detail.example;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},Gl=function(t){let i=t.detail;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}h(this,fi).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},Xl=function(t){h(this,fi).onInput(t.detail.full)},Jl=function(){h(this,ae)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Yl=function(){h(this,ae).reset()},Kl=function(){this.dispatchEvent(new Ar.CloseClickEvent)},po=function(){return this.renderRoot.querySelector("#scrollable-content")},k(Ar,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var Cn=Ar,co;Cn.CloseClickEvent=(co=class extends CustomEvent{constructor(e={}){super(Cn.CloseClickEvent.type,{...e})}},k(co,"type","mw:close-click"),co);var Tr=class extends z(q){constructor(){super(...arguments);k(this,"render",()=>P`
249
+ `}reloadConfig(){h(this,ae).reloadConfig(),this.requestUpdate()}};se=new WeakSet,yr=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},li=new WeakMap,ae=new WeakMap,ot=new WeakMap,Hl=function(t){let i=t.target;if(i instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}window.open(i.href,i.target)}},zl=function(t){let i=t.detail.example;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},Wl=function(t){let i=t.detail;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}h(this,li).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},Vl=function(t){h(this,li).onInput(t.detail.full)},Gl=function(){h(this,ae)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Xl=function(){h(this,ae).reset()},Jl=function(){this.dispatchEvent(new _r.CloseClickEvent)},ro=function(){return this.renderRoot.querySelector("#scrollable-content")},C(_r,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var ai=_r,io;ai.CloseClickEvent=(io=class extends CustomEvent{constructor(e={}){super(ai.CloseClickEvent.type,{...e})}},C(io,"type","mw:close-click"),io);customElements.get("mw-chat")||customElements.define("mw-chat",ai);var so=class extends z(U){constructor(){super(...arguments);C(this,"render",()=>D`
218
250
  <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">
219
251
  <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
220
252
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -226,29 +258,29 @@ CHAT`}</span>
226
258
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
227
259
  </circle>
228
260
  </svg>
229
- `)}};var In,Ql,Zl,di=class di extends z(q){constructor(){super();b(this,In);k(this,"render",()=>P`
261
+ `)}};customElements.get("mw-loading")||customElements.define("mw-loading",so);var In,Yl,Kl,ui=class ui extends z(U){constructor(){super();b(this,In);C(this,"render",()=>D`
230
262
  <!-- wrapper -->
231
263
  <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">
232
264
  <!-- close button -->
233
- <button 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" @click="${$(this,In,Ql)}" aria-label="Close">×</button>
265
+ <button 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" @click="${$(this,In,Yl)}" aria-label="Close">×</button>
234
266
 
235
267
  <!-- content -->
236
- <div class="p-4 text-left text-gray-800" @click="${$(this,In,Zl)}">
268
+ <div class="p-4 text-left text-gray-800" @click="${$(this,In,Kl)}">
237
269
  <p>${this.text}</p>
238
270
  </div>
239
271
  </div>
240
- `);this.text="Hello there. How can we help?"}};In=new WeakSet,Ql=function(){this.dispatchEvent(new di.CloseEvent)},Zl=function(){this.dispatchEvent(new di.ClickEvent)},k(di,"properties",{text:{type:String}});var Ot=di,fo;Ot.CloseEvent=(fo=class extends CustomEvent{constructor(e={}){super(Ot.CloseEvent.type,{...e})}},k(fo,"type","mw:close"),fo);var ho;Ot.ClickEvent=(ho=class extends CustomEvent{constructor(e={}){super(Ot.ClickEvent.type,{...e})}},k(ho,"type","mw:click"),ho);var An,eu,tu,hi=class hi extends z(q){constructor(){super();b(this,An);k(this,"render",()=>P`
272
+ `);this.text="Hello there. How can we help?"}};In=new WeakSet,Yl=function(){this.dispatchEvent(new ui.CloseEvent)},Kl=function(){this.dispatchEvent(new ui.ClickEvent)},C(ui,"properties",{text:{type:String}});var en=ui,oo;en.CloseEvent=(oo=class extends CustomEvent{constructor(e={}){super(en.CloseEvent.type,{...e})}},C(oo,"type","mw:close"),oo);var ao;en.ClickEvent=(ao=class extends CustomEvent{constructor(e={}){super(en.ClickEvent.type,{...e})}},C(ao,"type","mw:click"),ao);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",en);var An,Ql,Zl,ci=class ci extends z(U){constructor(){super();b(this,An);C(this,"render",()=>D`
241
273
  <!-- wrapper -->
242
274
  <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">
243
275
  <!-- close button -->
244
- <button 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" @click="${$(this,An,eu)}" aria-label="Close">×</button>
276
+ <button 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" @click="${$(this,An,Ql)}" aria-label="Close">×</button>
245
277
 
246
278
  <!-- content -->
247
- <div class="p-4 text-gray-800" @click="${$(this,An,tu)}">
279
+ <div class="p-4 text-gray-800" @click="${$(this,An,Zl)}">
248
280
  <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
249
281
  <p class="py-2.5 text-left">${this.text}</p>
250
282
  <div class="h-4"></div>
251
- ${this.button&&this.color?P`
283
+ ${this.button&&this.color?D`
252
284
  <!-- only visible if button text and color are given -->
253
285
  <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>
254
286
  `:N}
@@ -257,57 +289,53 @@ CHAT`}</span>
257
289
  <!-- can append any other content -->
258
290
  <slot name="footer"></slot>
259
291
  </div>
260
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};An=new WeakSet,eu=function(){this.dispatchEvent(new hi.CloseEvent)},tu=function(){this.dispatchEvent(new hi.ClickEvent)},k(hi,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Dt=hi,vo;Dt.CloseEvent=(vo=class extends CustomEvent{constructor(e={}){super(Dt.CloseEvent.type,{...e})}},k(vo,"type","mw:close"),vo);var go;Dt.ClickEvent=(go=class extends CustomEvent{constructor(e={}){super(Dt.ClickEvent.type,{...e})}},k(go,"type","mw:click"),go);var Tn,vi,tn,Rr=class{constructor(e,t){b(this,Tn);b(this,vi,!1);b(this,tn,()=>{h(this,vi)||(h(this,Tn).userFirstInteracted?.(),R(this,vi,!0)),h(this,Tn).userInteracted?.()});R(this,Tn,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",h(this,tn)),window.addEventListener("keydown",h(this,tn))}stopListening(){window.removeEventListener("click",h(this,tn)),window.removeEventListener("keydown",h(this,tn))}};Tn=new WeakMap,vi=new WeakMap,tn=new WeakMap;var hf=24*60*60*1e3,Rn,He,nn,gi,rn,mi,Fr,nu,Pr=class{constructor(e,t,i=Date){b(this,Fr);b(this,Rn);b(this,He);b(this,nn);b(this,gi);b(this,rn,!1);b(this,mi,!1);R(this,Rn,e),R(this,He,t),R(this,nn,i),e.addController(this)}get showing(){return h(this,rn)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!h(this,rn)&&(R(this,rn,!0),h(this,Rn).requestUpdate(),e)){h(this,He).playPopupSound();let t=h(this,He).getPersistedState();h(this,He).setPersistedState({...t,playedSoundOnce:!0})}}hide(){R(this,mi,!0),this.abortAutoShowTimer(),R(this,rn,!1),h(this,Rn).requestUpdate()}abortAutoShowTimer(){clearTimeout(h(this,gi))}onCloseClick(){let e=h(this,He).getPersistedState();h(this,He).setPersistedState({...e,userDismissedAt:h(this,nn).now()}),this.hide()}onContentClick(){let e=h(this,He).getPersistedState();h(this,He).setPersistedState({...e,userDismissedAt:h(this,nn).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),h(this,mi)||R(this,gi,setTimeout(()=>$(this,Fr,nu).call(this),h(this,He).getDelayMs()))}};Rn=new WeakMap,He=new WeakMap,nn=new WeakMap,gi=new WeakMap,rn=new WeakMap,mi=new WeakMap,Fr=new WeakSet,nu=function(){let e=h(this,He).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&h(this,nn).now()-e.userDismissedAt<hf||this.show({sound:!t})};var Mt,_o,yt,Or,yo,Dr=class Dr extends z(q){constructor(){super();b(this,yt);b(this,Mt,new Pr(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));b(this,_o,new Rr(this,h(this,Mt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=h(this,Mt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return P`
292
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};An=new WeakSet,Ql=function(){this.dispatchEvent(new ci.CloseEvent)},Zl=function(){this.dispatchEvent(new ci.ClickEvent)},C(ci,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var tn=ci,lo;tn.CloseEvent=(lo=class extends CustomEvent{constructor(e={}){super(tn.CloseEvent.type,{...e})}},C(lo,"type","mw:close"),lo);var uo;tn.ClickEvent=(uo=class extends CustomEvent{constructor(e={}){super(tn.ClickEvent.type,{...e})}},C(uo,"type","mw:click"),uo);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",tn);var Tn,pi,nn,br=class{constructor(e,t){b(this,Tn);b(this,pi,!1);b(this,nn,()=>{h(this,pi)||(h(this,Tn).userFirstInteracted?.(),S(this,pi,!0)),h(this,Tn).userInteracted?.()});S(this,Tn,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",h(this,nn)),window.addEventListener("keydown",h(this,nn))}stopListening(){window.removeEventListener("click",h(this,nn)),window.removeEventListener("keydown",h(this,nn))}};Tn=new WeakMap,pi=new WeakMap,nn=new WeakMap;var pf=24*60*60*1e3,Rn,ze,rn,fi,sn,di,xr,eu,wr=class{constructor(e,t,i=Date){b(this,xr);b(this,Rn);b(this,ze);b(this,rn);b(this,fi);b(this,sn,!1);b(this,di,!1);S(this,Rn,e),S(this,ze,t),S(this,rn,i),e.addController(this)}get showing(){return h(this,sn)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!h(this,sn)&&(S(this,sn,!0),h(this,Rn).requestUpdate(),e)){h(this,ze).playPopupSound();let t=h(this,ze).getPersistedState();h(this,ze).setPersistedState({...t,playedSoundOnce:!0})}}hide(){S(this,di,!0),this.abortAutoShowTimer(),S(this,sn,!1),h(this,Rn).requestUpdate()}abortAutoShowTimer(){clearTimeout(h(this,fi))}onCloseClick(){let e=h(this,ze).getPersistedState();h(this,ze).setPersistedState({...e,userDismissedAt:h(this,rn).now()}),this.hide()}onContentClick(){let e=h(this,ze).getPersistedState();h(this,ze).setPersistedState({...e,userDismissedAt:h(this,rn).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),h(this,di)||S(this,fi,setTimeout(()=>$(this,xr,eu).call(this),h(this,ze).getDelayMs()))}};Rn=new WeakMap,ze=new WeakMap,rn=new WeakMap,fi=new WeakMap,sn=new WeakMap,di=new WeakMap,xr=new WeakSet,eu=function(){let e=h(this,ze).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&h(this,rn).now()-e.userDismissedAt<pf||this.show({sound:!t})};var Ft,fo,_t,kr,po,Sr=class Sr extends z(U){constructor(){super();b(this,_t);b(this,Ft,new wr(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));b(this,fo,new br(this,h(this,Ft)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=h(this,Ft).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return D`
261
293
  <!-- mobile shadow backdrop -->
262
- <div @click="${$(this,yt,Or)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
294
+ <div @click="${$(this,_t,kr)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
263
295
 
264
296
  <!-- mobile overlay -->
265
297
  <div class="${t} fixed bottom-0 left-0 right-0 z-[2147483647] sm:hidden">
266
- <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${$(this,yt,yo)}" @mw:close="${$(this,yt,Or)}">
267
- ${i.mobile.poweredBy?P`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:N}
298
+ <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${$(this,_t,po)}" @mw:close="${$(this,_t,kr)}">
299
+ ${i.mobile.poweredBy?D`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:N}
268
300
  </mw-popup-mobile>
269
301
  </div>
270
302
 
271
303
  <!-- desktop -->
272
304
  <div class="${t} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
273
- <mw-popup-desktop text="${i.desktop.text}" @mw:click="${$(this,yt,yo)}" @mw:close="${$(this,yt,Or)}"></mw-popup-desktop>
305
+ <mw-popup-desktop text="${i.desktop.text}" @mw:click="${$(this,_t,po)}" @mw:close="${$(this,_t,kr)}"></mw-popup-desktop>
274
306
  </div>
275
- `}hide(){h(this,Mt).hide()}};Mt=new WeakMap,_o=new WeakMap,yt=new WeakSet,Or=function(){h(this,Mt).onCloseClick()},yo=function(){this.dispatchEvent(new Dr.ClickEvent),h(this,Mt).onContentClick()},k(Dr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Pn=Dr,mo;Pn.ClickEvent=(mo=class extends CustomEvent{constructor(e={}){super(Pn.ClickEvent.type,{...e})}},k(mo,"type","mw:click"),mo);var vf="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",yi=class extends z(q){constructor(){super(...arguments);k(this,"render",()=>P`
276
- <p class="m-0 flex items-center justify-center space-x-1 bg-white font-sans text-xs text-gray-400">
277
- <span class="pointer-events-none select-none">Powered by</span>
278
- <a class="inline-flex items-center space-x-1 text-gray-600 underline" href="${vf}" target="_blank">
279
- <!-- molin logo icon -->
280
- <svg class="h-4 w-4 text-gray-600" width="1600" height="1600" viewBox="0 0 1600 1600" fill="none" xmlns="http://www.w3.org/2000/svg">
281
- <g clip-path="url(#clip0_1347_2815)">
282
- <path
283
- fill-rule="evenodd"
284
- clip-rule="evenodd"
285
- d="M800 1600C1241.83 1600 1600 1241.83 1600 800C1600 358.172 1241.83 0 800 0C358.172 0 0 358.172 0 800C0 1241.83 358.172 1600 800 1600ZM1053.93 1204.94C1004.11 1233.7 944.905 1241.5 889.338 1226.61C833.772 1211.72 786.395 1175.37 757.632 1125.55C757.546 1125.4 757.46 1125.25 757.375 1125.1C757.312 1124.99 757.248 1124.88 757.185 1124.77L757.051 1124.53C756.97 1124.4 756.89 1124.26 756.81 1124.12C756.729 1123.98 756.648 1123.85 756.567 1123.71L520.274 714.434C516.674 706.633 512.851 698.527 508.828 690.171V690.175C500.263 672.388 490.791 653.467 480.628 633.946C430.934 538.484 383.555 464.79 374.805 469.345C366.054 473.901 399.245 554.98 448.939 650.442C470.289 691.455 491.212 728.45 508.828 756.948V793.508H508.83V1010.2V1226.89C451.303 1226.89 396.132 1204.06 355.455 1163.43C314.777 1122.79 291.925 1067.67 291.925 1010.2C291.925 1009.83 291.925 1009.45 291.927 1009.08C291.924 1008.71 291.922 1008.34 291.922 1007.97V471.125C291.922 423.461 322.67 382.979 365.413 368.431C406.508 353.902 452.128 352.113 494.791 363.544C550.357 378.433 597.734 414.786 626.497 464.606C626.705 464.966 626.911 465.326 627.117 465.687C627.194 465.819 627.272 465.951 627.349 466.083C627.42 466.205 627.49 466.326 627.561 466.448L837.024 829.249L837.025 829.249L945.478 1017.09L1053.93 1204.94ZM813.776 363.545C758.21 348.656 699.004 356.451 649.184 385.214L757.637 573.06L758.402 574.384C758.5 574.557 758.599 574.729 758.698 574.901L1075.55 1123.71C1075.71 1123.98 1075.87 1124.26 1076.03 1124.53L1076.16 1124.76C1076.31 1125.02 1076.46 1125.28 1076.62 1125.55C1105.38 1175.37 1152.75 1211.72 1208.32 1226.61C1263.89 1241.5 1323.09 1233.7 1372.91 1204.94L1264.46 1017.09L1156.01 829.249L1156.01 829.249L946.544 466.448C946.416 466.227 946.288 466.006 946.158 465.785C946.074 465.637 945.99 465.489 945.905 465.341C945.765 465.096 945.624 464.852 945.483 464.607C916.719 414.787 869.343 378.434 813.776 363.545Z"
286
- fill="currentColor" />
287
- </g>
307
+ `}hide(){h(this,Ft).hide()}};Ft=new WeakMap,fo=new WeakMap,_t=new WeakSet,kr=function(){h(this,Ft).onCloseClick()},po=function(){this.dispatchEvent(new Sr.ClickEvent),h(this,Ft).onContentClick()},C(Sr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var hi=Sr,co;hi.ClickEvent=(co=class extends CustomEvent{constructor(e={}){super(hi.ClickEvent.type,{...e})}},C(co,"type","mw:click"),co);customElements.get("mw-popup")||customElements.define("mw-popup",hi);var ff="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",ho=class extends z(U){constructor(){super(...arguments);C(this,"render",()=>D`
308
+ <p class="flex items-center justify-center whitespace-nowrap text-xs">
309
+ <span>Powered by</span>
310
+
311
+ <a href="${ff}" target="_blank" class="inline-flex items-center underline">
312
+ <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
313
+ <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
314
+ <path
315
+ fill-rule="evenodd"
316
+ clip-rule="evenodd"
317
+ 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"
318
+ fill="url(#paint0_linear_1_17)" />
288
319
  <defs>
289
- <clipPath id="clip0_1347_2815">
290
- <rect width="1600" height="1600" fill="white" />
291
- </clipPath>
320
+ <linearGradient id="paint0_linear_1_17" x1="4.08333" y1="10.1653" x2="16.3099" y2="10.1653" gradientUnits="userSpaceOnUse">
321
+ <stop offset="0.197917" stop-color="#E4FF1A" />
322
+ <stop offset="0.822917" stop-color="#21F4F0" />
323
+ </linearGradient>
292
324
  </defs>
293
325
  </svg>
294
326
 
295
327
  <span>Molin AI</span>
296
328
  </a>
297
329
  </p>
298
- `)}};k(yi,"styles",ht`
299
- :host {
300
- display: block;
301
- }
302
- `);var Mr,iu,_i=class extends z(q){constructor(){super();b(this,Mr);k(this,"render",()=>P`
330
+ `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",ho);var $r,tu,Er=class extends z(U){constructor(){super();b(this,$r);C(this,"render",()=>D`
303
331
  <span class="relative inline-flex">
304
332
  <slot></slot>
305
- <span class="${h(this,Mr,iu)} pointer-events-none absolute flex h-3 w-3">
333
+ <span class="${h(this,$r,tu)} pointer-events-none absolute z-10 flex h-3 w-3">
306
334
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
307
335
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
308
336
  </span>
309
337
  </span>
310
- `);this.color="sky-500",this.position="top-right"}};Mr=new WeakSet,iu=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}`)}},k(_i,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});var bi=class extends z(q){constructor(){super();k(this,"render",()=>P`
338
+ `);this.color="sky-500",this.position="top-right"}};$r=new WeakSet,tu=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}`)}},C(Er,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Er);var Cr=class extends z(U){constructor(){super();C(this,"render",()=>D`
311
339
  <div class="${this.positionClasses} fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base">
312
340
  <p class="text-md mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
313
341
 
@@ -320,58 +348,57 @@ CHAT`}</span>
320
348
  stroke-linecap="round"></path>
321
349
  </svg>
322
350
  </div>
323
- `);this.positionClasses="",this.text="Try it out"}};k(bi,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.define("mw-background",_n);customElements.define("mw-bubble",ri);customElements.define("mw-chat",Cn);customElements.define("mw-chat-input",ct);customElements.define("mw-chat-message",ai);customElements.define("mw-header",Rt);customElements.define("mw-loading",Tr);customElements.define("mw-popup",Pn);customElements.define("mw-powered-by",yi);customElements.define("mw-pulse-dot",_i);customElements.define("mw-try-it-out",bi);customElements.define("mw-upsell-banner",ii);customElements.define("mw-popup-desktop",Ot);customElements.define("mw-popup-mobile",Dt);window.__INIT_MOLIN_SHOP_AI=function(e){if(gf(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 gf(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function ru(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var sn,wi,Lt,on,Nr,su,Lr=class{constructor(e,t,i){b(this,Nr);b(this,sn);b(this,wi);b(this,Lt);b(this,on);k(this,"isLoading",!1);k(this,"data");R(this,sn,e),R(this,wi,t),R(this,Lt,i),e.addController(this)}fetch(){if(this.isLoading)return;h(this,on)?.abort();let e=new AbortController;R(this,on,e),this.isLoading=!0,this.data=void 0,h(this,sn).requestUpdate(),(async()=>{let t=$(this,Nr,su).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 h(this,Lt)?.transform=="function"?await h(this,Lt).transform(t):t,h(this,sn).requestUpdate()}).catch(t=>{h(this,Lt)?.onError?.(t),this.isLoading=!1,this.data=void 0,h(this,sn).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||h(this,Lt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){h(this,on)?.abort(),R(this,on,void 0)}};sn=new WeakMap,wi=new WeakMap,Lt=new WeakMap,on=new WeakMap,Nr=new WeakSet,su=function(){let e=h(this,wi);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var pt,xi,Fn,On,Nt=class{constructor(e,t){b(this,pt);b(this,xi);b(this,Fn);b(this,On);R(this,pt,e),R(this,xi,t),e.addController(this)}get data(){return h(this,On)||h(this,Fn)?.data}hostConnected(){if(h(this,Fn)||h(this,On))return;let e=ru();e&&e.widgetId===h(this,pt).widgetId?R(this,On,e.config):R(this,Fn,new Lr(h(this,pt),()=>{if(h(this,pt).cdn&&h(this,pt).widgetId)return`${h(this,pt).cdn}/config?w=${h(this,pt).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:h(this,xi)?.onError}))}};pt=new WeakMap,xi=new WeakMap,Fn=new WeakMap,On=new WeakMap;function ou(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function S(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ou(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ou(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Di(n){return Di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Di(n)}function W(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function au(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function V(n,e,t){return e&&au(n.prototype,e),t&&au(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function y(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mf(n,e){if(n==null)return{};var t,i,r=function(o,a){if(o==null)return{};var l,u,c={},p=Object.keys(o);for(u=0;u<p.length;u++)l=p[u],a.indexOf(l)>=0||(c[l]=o[l]);return c}(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Te(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,i){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,o,a=[],l=!0,u=!1;try{for(r=r.call(t);!(l=(s=r.next()).done)&&(a.push(s.value),!i||a.length!==i);l=!0);}catch(c){u=!0,o=c}finally{try{l||r.return==null||r.return()}finally{if(u)throw o}}return a}}(n,e)||ta(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
324
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function St(n){return function(e){if(Array.isArray(e))return Ao(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||ta(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
325
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ta(n,e){if(n){if(typeof n=="string")return Ao(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ao(n,e):void 0}}function Ao(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function et(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=ta(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
326
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}var Ye={DEBUG:!1,LIB_VERSION:"1.161.3"},yf=Array.isArray,tc=Object.prototype,nc=tc.hasOwnProperty,ps=tc.toString,de=yf||function(n){return ps.call(n)==="[object Array]"},Qe=function(n){return typeof n=="function"},he=function(n){return n===Object(n)&&!de(n)},Xr=function(n){if(he(n)){for(var e in n)if(nc.call(n,e))return!1;return!0}return!1},O=function(n){return n===void 0},Ce=function(n){return ps.call(n)=="[object String]"},lu=function(n){return Ce(n)&&n.trim().length===0},$t=function(n){return n===null},Pe=function(n){return O(n)||$t(n)},Ke=function(n){return ps.call(n)=="[object Number]"},un=function(n){return ps.call(n)==="[object Boolean]"},_f=function(n){return n instanceof FormData},v=typeof window<"u"?window:void 0,je=typeof globalThis<"u"?globalThis:v,ic=Array.prototype,uu=ic.forEach,cu=ic.indexOf,lt=je?.navigator,A=je?.document,Ne=je?.location,To=je?.fetch,Ro=je!=null&&je.XMLHttpRequest&&"withCredentials"in new je.XMLHttpRequest?je.XMLHttpRequest:void 0,pu=je?.AbortController,_e=lt?.userAgent,te=v??{},fu="[PostHog.js]",_={_log:function(n){if(v&&(Ye.DEBUG||te.POSTHOG_DEBUG)&&!O(v.console)&&v.console){for(var e=("__rrweb_original__"in v.console[n])?v.console[n].__rrweb_original__:v.console[n],t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.apply(void 0,[fu].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];_._log.apply(_,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];_._log.apply(_,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];_._log.apply(_,["error"].concat(e))},critical:function(){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];(n=console).error.apply(n,[fu].concat(t))},uninitializedWarning:function(n){_.error("You must initialize PostHog before calling ".concat(n))}},Qr={},fs=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Nn(n,e,t){if(de(n)){if(uu&&n.forEach===uu)n.forEach(e,t);else if("length"in n&&n.length===+n.length){for(var i=0,r=n.length;i<r;i++)if(i in n&&e.call(t,n[i],i)===Qr)return}}}function Q(n,e,t){if(!Pe(n)){if(de(n))return Nn(n,e,t);if(_f(n)){var i,r=et(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===Qr)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(nc.call(n,o)&&e.call(t,n[o],o)===Qr)return}}var Re=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Nn(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function B(n,e){return n.indexOf(e)!==-1}function Jr(n){for(var e=Object.keys(n),t=e.length,i=new Array(t);t--;)i[t]=[e[t],n[e[t]]];return i}var rc=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},du=function(n){try{return n()}catch{return}},bf=function(n){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.apply(this,t)}catch(r){_.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_.critical(r)}}},Po=function(n){var e={};return Q(n,function(t,i){Ce(t)&&t.length>0&&(e[i]=t)}),e},Fo=function(n){return n.replace(/^\$/,"")};function wf(n,e){return t=n,i=function(s){return Ce(s)&&!$t(e)?s.slice(0,e):s},r=new Set,function s(o,a){return o!==Object(o)?i?i(o,a):o:r.has(o)?void 0:(r.add(o),de(o)?(l=[],Nn(o,function(u){l.push(s(u))})):(l={},Q(o,function(u,c){r.has(u)||(l[c]=s(u,c))})),l);var l}(t);var t,i,r}var at,xf=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
351
+ `);this.positionClasses="",this.text="Try it out"}};C(Cr,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Cr);window.__INIT_MOLIN_SHOP_AI=function(e){if(df(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 df(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function nu(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var on,vi,Mt,an,Ar,iu,Ir=class{constructor(e,t,i){b(this,Ar);b(this,on);b(this,vi);b(this,Mt);b(this,an);C(this,"isLoading",!1);C(this,"data");S(this,on,e),S(this,vi,t),S(this,Mt,i),e.addController(this)}fetch(){if(this.isLoading)return;h(this,an)?.abort();let e=new AbortController;S(this,an,e),this.isLoading=!0,this.data=void 0,h(this,on).requestUpdate(),(async()=>{let t=$(this,Ar,iu).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 h(this,Mt)?.transform=="function"?await h(this,Mt).transform(t):t,h(this,on).requestUpdate()}).catch(t=>{h(this,Mt)?.onError?.(t),this.isLoading=!1,this.data=void 0,h(this,on).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||h(this,Mt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){h(this,an)?.abort(),S(this,an,void 0)}};on=new WeakMap,vi=new WeakMap,Mt=new WeakMap,an=new WeakMap,Ar=new WeakSet,iu=function(){let e=h(this,vi);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var pt,gi,Pn,On,Dt=class{constructor(e,t){b(this,pt);b(this,gi);b(this,Pn);b(this,On);S(this,pt,e),S(this,gi,t),e.addController(this)}get data(){return h(this,On)||h(this,Pn)?.data}hostConnected(){if(h(this,Pn)||h(this,On))return;let e=nu();e&&e.widgetId===h(this,pt).widgetId?S(this,On,e.config):S(this,Pn,new Ir(h(this,pt),()=>{if(h(this,pt).cdn&&h(this,pt).widgetId)return`${h(this,pt).cdn}/config?w=${h(this,pt).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:h(this,gi)?.onError}))}};pt=new WeakMap,gi=new WeakMap,Pn=new WeakMap,On=new WeakMap;function ru(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function k(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ru(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ru(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ai(n){return Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ai(n)}function W(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function su(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function V(n,e,t){return e&&su(n.prototype,e),t&&su(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function y(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hf(n,e){if(n==null)return{};var t,i,r=function(o,a){if(o==null)return{};var l,u,c={},p=Object.keys(o);for(u=0;u<p.length;u++)l=p[u],a.indexOf(l)>=0||(c[l]=o[l]);return c}(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Re(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,i){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,o,a=[],l=!0,u=!1;try{for(r=r.call(t);!(l=(s=r.next()).done)&&(a.push(s.value),!i||a.length!==i);l=!0);}catch(c){u=!0,o=c}finally{try{l||r.return==null||r.return()}finally{if(u)throw o}}return a}}(n,e)||Yo(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
352
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Et(n){return function(e){if(Array.isArray(e))return So(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||Yo(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
353
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Yo(n,e){if(n){if(typeof n=="string")return So(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?So(n,e):void 0}}function So(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function et(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Yo(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
354
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}var Ye={DEBUG:!1,LIB_VERSION:"1.161.3"},vf=Array.isArray,Zu=Object.prototype,ec=Zu.hasOwnProperty,ns=Zu.toString,de=vf||function(n){return ns.call(n)==="[object Array]"},Qe=function(n){return typeof n=="function"},he=function(n){return n===Object(n)&&!de(n)},jr=function(n){if(he(n)){for(var e in n)if(ec.call(n,e))return!1;return!0}return!1},O=function(n){return n===void 0},Ie=function(n){return ns.call(n)=="[object String]"},ou=function(n){return Ie(n)&&n.trim().length===0},Ct=function(n){return n===null},Oe=function(n){return O(n)||Ct(n)},Ke=function(n){return ns.call(n)=="[object Number]"},cn=function(n){return ns.call(n)==="[object Boolean]"},gf=function(n){return n instanceof FormData},v=typeof window<"u"?window:void 0,qe=typeof globalThis<"u"?globalThis:v,tc=Array.prototype,au=tc.forEach,lu=tc.indexOf,ut=qe?.navigator,T=qe?.document,je=qe?.location,Eo=qe?.fetch,$o=qe!=null&&qe.XMLHttpRequest&&"withCredentials"in new qe.XMLHttpRequest?qe.XMLHttpRequest:void 0,uu=qe?.AbortController,_e=ut?.userAgent,te=v??{},cu="[PostHog.js]",_={_log:function(n){if(v&&(Ye.DEBUG||te.POSTHOG_DEBUG)&&!O(v.console)&&v.console){for(var e=("__rrweb_original__"in v.console[n])?v.console[n].__rrweb_original__:v.console[n],t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.apply(void 0,[cu].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];_._log.apply(_,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];_._log.apply(_,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];_._log.apply(_,["error"].concat(e))},critical:function(){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];(n=console).error.apply(n,[cu].concat(t))},uninitializedWarning:function(n){_.error("You must initialize PostHog before calling ".concat(n))}},Hr={},is=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Ln(n,e,t){if(de(n)){if(au&&n.forEach===au)n.forEach(e,t);else if("length"in n&&n.length===+n.length){for(var i=0,r=n.length;i<r;i++)if(i in n&&e.call(t,n[i],i)===Hr)return}}}function Q(n,e,t){if(!Oe(n)){if(de(n))return Ln(n,e,t);if(gf(n)){var i,r=et(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===Hr)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(ec.call(n,o)&&e.call(t,n[o],o)===Hr)return}}var Pe=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Ln(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function B(n,e){return n.indexOf(e)!==-1}function qr(n){for(var e=Object.keys(n),t=e.length,i=new Array(t);t--;)i[t]=[e[t],n[e[t]]];return i}var nc=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},pu=function(n){try{return n()}catch{return}},mf=function(n){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.apply(this,t)}catch(r){_.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_.critical(r)}}},Co=function(n){var e={};return Q(n,function(t,i){Ie(t)&&t.length>0&&(e[i]=t)}),e},Io=function(n){return n.replace(/^\$/,"")};function yf(n,e){return t=n,i=function(s){return Ie(s)&&!Ct(e)?s.slice(0,e):s},r=new Set,function s(o,a){return o!==Object(o)?i?i(o,a):o:r.has(o)?void 0:(r.add(o),de(o)?(l=[],Ln(o,function(u){l.push(s(u))})):(l={},Q(o,function(u,c){r.has(u)||(l[c]=s(u,c))})),l);var l}(t);var t,i,r}var lt,_f=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
327
355
  `).replace(/\r/g,`
328
- `)).length,r=0;r<i;r++){var o=n.charCodeAt(r),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),$t(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},kt=function(){function n(e){return e&&(e.preventDefault=n.preventDefault,e.stopPropagation=n.stopPropagation),e}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,r,s){if(e)if(e.addEventListener&&!r)e.addEventListener(t,i,!!s);else{var o="on"+t,a=e[o];e[o]=function(l,u,c){return function(p){if(p=p||n(v?.event)){var f,d=!0;Qe(c)&&(f=c(p));var g=u.call(l,p);return f!==!1&&g!==!1||(d=!1),d}}}(e,i,a)}else _.error("No valid element provided to register_event")}}();function sc(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return n[t]}(function(n){n.GZipJS="gzip-js",n.Base64="base64"})(at||(at={}));var oc="$people_distinct_id",Ci="__alias",Ii="__timers",hu="$autocapture_disabled_server_side",Oo="$heatmaps_enabled_server_side",vu="$exception_capture_enabled_server_side",gu="$exception_capture_endpoint_suffix",mu="$web_vitals_enabled_server_side",yu="$web_vitals_allowed_metrics",Do="$session_recording_enabled_server_side",_u="$console_log_recording_enabled_server_side",bu="$session_recording_network_payload_capture",wu="$session_recording_canvas_recording",xu="$replay_sample_rate",ku="$replay_minimum_duration",Zr="$sesid",Ti="$session_is_sampled",Mn="$enabled_feature_flags",Mo="$early_access_features",Ln="$stored_person_properties",qt="$stored_group_properties",Lo="$surveys",jr="$surveys_activated",es="$flag_call_reported",wt="$user_state",No="$client_session_props",jo="$capture_rate_limit",qo="$initial_campaign_params",Uo="$initial_referrer_info",Su="$initial_person_info",ts="$epp",Bo="__POSTHOG_TOOLBAR__",kf=[oc,Ci,"__cmpns",Ii,Do,Oo,Zr,Mn,wt,Mo,qt,Ln,Lo,es,No,jo,qo,Uo,ts],bo="$active_feature_flags",qr="$override_feature_flags",Eu="$feature_flag_payloads",$u=function(n){var e,t={},i=et(Jr(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Te(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},Sf=function(){function n(e){W(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return V(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Mn),t=this.instance.get_property(qr);if(!t)return e||{};for(var i=Re({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(_.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Eu)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,i=this.instance.get_property(Ln),r=this.instance.get_property(qt),s={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,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:s,compression:this.instance.config.disable_compression?void 0:at.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var a;e.setReloadingPaused(!1);var l=!0;o.statusCode===200&&(e.$anon_distinct_id=void 0,l=!1),e.receivedFeatureFlags((a=o.json)!==null&&a!==void 0?a:{},l),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,r=this.getFlagVariants()[e],s="".concat(r),o=this.instance.get_property(es)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(de(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(y({},es,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}_.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(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);_.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();(function(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s.featureFlags,p=s.featureFlagPayloads;if(c)if(de(c)){var f,d={};if(c)for(var g=0;g<c.length;g++)d[c[g]]=!0;o&&o.register((y(f={},bo,c),y(f,Mn,d),f))}else{var m=c,E=p;s.errorsWhileComputingFlags&&(m=S(S({},l),m),E=S(S({},u),E)),o&&o.register((y(a={},bo,Object.keys($u(m))),y(a,Mn,m||{}),y(a,Eu,E||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return _.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(qr);else if(de(e)){for(var i={},r=0;r<e.length;r++)i[e[r]]=!0;this.instance.persistence.register(y({},qr,i))}else this.instance.persistence.register(y({},qr,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),r=i.flags,s=i.flagVariants;e(r,s)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,r,s=y({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=S(S({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},bo,Object.keys($u(o))),y(r,Mn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(Mo);if(r&&!i)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:function(s){var o;if(s.json){var a=s.json.earlyAccessFeatures;return(o=t.instance.persistence)===null||o===void 0||o.register(y({},Mo,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(i){return t[i]}),flagVariants:Object.keys(t).filter(function(i){return t[i]}).reduce(function(i,r){return i[r]=t[r],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(i,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Ln)||{};this.instance.register(y({},Ln,S(S({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Ln)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(qt)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=S(S({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},qt,S(S({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(qt)||{};this.instance.register(y({},qt,S(S({},t),{},y({},e,{}))))}else this.instance.unregister(qt)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return Ke(n)&&isFinite(n)&&Math.floor(n)===n});var Cu="0123456789abcdef",Ef=function(){function n(e){if(W(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return V(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Cu.charAt(this.bytes[t]>>>4)+Cu.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}},{key:"clone",value:function(){return new n(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new n(s)}}]),n}(),$f=function(){function n(){W(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new Cf)}return V(n,[{key:"generate",value:function(){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}},{key:"generateOrAbort",value:function(){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 Ef.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),n}(),ac=function(n){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<n.length;e++)n[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};v&&!O(v.crypto)&&crypto.getRandomValues&&(ac=function(n){return crypto.getRandomValues(n)});var Iu,Cf=function(){function n(){W(this,n),y(this,"buffer",new Uint32Array(8)),y(this,"cursor",1/0)}return V(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(ac(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),Bt=function(){return If().toString()},If=function(){return(Iu||(Iu=new $f)).generate()},Af="Thu, 01 Jan 1970 00:00:00 GMT",ki="",Tf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Rf(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:A;if(ki)return ki;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Bt(),u=new RegExp("(^|;)\\s*"+l+"=1");!ki&&a--;){var c=o.slice(a).join("."),p=l+"=1;domain=."+c;s.cookie=p,u.test(s.cookie)&&(s.cookie=p+";expires="+Af,ki=c)}return ki}(n);if(!t){var i=function(r){var s=r.match(Tf);return s?s[0]:""}(n);i!==t&&_.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var xe,Et={is_supported:function(){return!!A},error:function(n){_.error("cookieStore error: "+n)},get:function(n){if(A){try{for(var e=n+"=",t=A.cookie.split(";").filter(function(s){return s.length}),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},parse:function(n){var e;try{e=JSON.parse(Et.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(A)try{var s="",o="",a=Rf(A.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),s="; expires="+l.toUTCString()}r&&(o="; secure");var u=n+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&_.warn("cookieStore warning: large cookie, len="+u.length),A.cookie=u,u}catch{return}},remove:function(n,e){try{Et.set(n,"",-1,e)}catch{return}}},wo=null,fe={is_supported:function(){if(!$t(wo))return wo;var n=!0;if(O(v))n=!1;else try{var e="__mplssupport__";fe.set(e,"xyz"),fe.get(e)!=='"xyz"'&&(n=!1),fe.remove(e)}catch{n=!1}return n||_.error("localStorage unsupported; falling back to cookie store"),wo=n,n},error:function(n){_.error("localStorage error: "+n)},get:function(n){try{return v?.localStorage.getItem(n)}catch(e){fe.error(e)}return null},parse:function(n){try{return JSON.parse(fe.get(n))||{}}catch{}return null},set:function(n,e){try{v?.localStorage.setItem(n,JSON.stringify(e))}catch(t){fe.error(t)}},remove:function(n){try{v?.localStorage.removeItem(n)}catch(e){fe.error(e)}}},Pf=["distinct_id",Zr,Ti,ts],Ur=S(S({},fe),{},{parse:function(n){try{var e={};try{e=Et.parse(n)||{}}catch{}var t=Re(e,JSON.parse(fe.get(n)||"{}"));return fe.set(n,t),t}catch{}return null},set:function(n,e,t,i,r,s){try{fe.set(n,e,void 0,void 0,s);var o={};Pf.forEach(function(a){e[a]&&(o[a]=e[a])}),Object.keys(o).length&&Et.set(n,o,t,i,r,s)}catch(a){fe.error(a)}},remove:function(n,e){try{v?.localStorage.removeItem(n),Et.remove(n,e)}catch(t){fe.error(t)}}}),Br={},Ff={is_supported:function(){return!0},error:function(n){_.error("memoryStorage error: "+n)},get:function(n){return Br[n]||null},parse:function(n){return Br[n]||null},set:function(n,e){Br[n]=e},remove:function(n){delete Br[n]}},an=null,ke={is_supported:function(){if(!$t(an))return an;if(an=!0,O(v))an=!1;else try{var n="__support__";ke.set(n,"xyz"),ke.get(n)!=='"xyz"'&&(an=!1),ke.remove(n)}catch{an=!1}return an},error:function(n){_.error("sessionStorage error: ",n)},get:function(n){try{return v?.sessionStorage.getItem(n)}catch(e){ke.error(e)}return null},parse:function(n){try{return JSON.parse(ke.get(n))||null}catch{}return null},set:function(n,e){try{v?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){ke.error(t)}},remove:function(n){try{v?.sessionStorage.removeItem(n)}catch(e){ke.error(e)}}},Of=["localhost","127.0.0.1"],Ri=function(n){var e=A?.createElement("a");return O(e)?null:(e.href=n,e)},ns=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},Df=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Q(n,function(s,o){O(s)||O(o)||o==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(s)?s.name:s.toString()),t=encodeURIComponent(o),r[r.length]=t+"="+e)}),r.join(i)},Au=function(n,e){for(var t,i=((n.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){t=s;break}}if(!de(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{_.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},is=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Ze="Mobile",rs="iOS",ft="Android",Mi="Tablet",lc=ft+" "+Mi,uc="iPad",cc="Apple",pc=cc+" Watch",Li="Safari",Bn="BlackBerry",fc="Samsung",dc=fc+"Browser",hc=fc+" Internet",Ht="Chrome",Mf=Ht+" OS",vc=Ht+" "+rs,na="Internet Explorer",gc=na+" "+Ze,ia="Opera",Lf=ia+" Mini",ra="Edge",mc="Microsoft "+ra,jn="Firefox",yc=jn+" "+rs,Ni="Nintendo",ji="PlayStation",qn="Xbox",_c=ft+" "+Ze,bc=Ze+" "+Li,Ai="Windows",Ho=Ai+" Phone",Tu="Nokia",zo="Ouya",wc="Generic",Nf=wc+" "+Ze.toLowerCase(),xc=wc+" "+Mi.toLowerCase(),Wo="Konqueror",Ae="(\\d+(\\.\\d+)?)",xo=new RegExp("Version/"+Ae),jf=new RegExp(qn,"i"),qf=new RegExp(ji+" \\w+","i"),Uf=new RegExp(Ni+" \\w+","i"),sa=new RegExp(Bn+"|PlayBook|BB10","i"),Bf={"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"},Hf=function(n,e){return e&&B(e,cc)||function(t){return B(t,Li)&&!B(t,Ht)&&!B(t,ft)}(n)},Ru=function(n,e){return e=e||"",B(n," OPR/")&&B(n,"Mini")?Lf:B(n," OPR/")?ia:sa.test(n)?Bn:B(n,"IE"+Ze)||B(n,"WPDesktop")?gc:B(n,dc)?hc:B(n,ra)||B(n,"Edg/")?mc:B(n,"FBIOS")?"Facebook "+Ze:B(n,"UCWEB")||B(n,"UCBrowser")?"UC Browser":B(n,"CriOS")?vc:B(n,"CrMo")?Ht:B(n,ft)&&B(n,Li)?_c:B(n,Ht)?Ht:B(n,"FxiOS")?yc:B(n.toLowerCase(),Wo.toLowerCase())?Wo:Hf(n,e)?B(n,Ze)?bc:Li:B(n,jn)?jn:B(n,"MSIE")||B(n,"Trident/")?na:B(n,"Gecko")?jn:""},zf=(y(xe={},gc,[new RegExp("rv:"+Ae)]),y(xe,mc,[new RegExp(ra+"?\\/"+Ae)]),y(xe,Ht,[new RegExp("("+Ht+"|CrMo)\\/"+Ae)]),y(xe,vc,[new RegExp("CriOS\\/"+Ae)]),y(xe,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Ae)]),y(xe,Li,[xo]),y(xe,bc,[xo]),y(xe,ia,[new RegExp("(Opera|OPR)\\/"+Ae)]),y(xe,jn,[new RegExp(jn+"\\/"+Ae)]),y(xe,yc,[new RegExp("FxiOS\\/"+Ae)]),y(xe,Wo,[new RegExp("Konqueror[:/]?"+Ae,"i")]),y(xe,Bn,[new RegExp(Bn+" "+Ae),xo]),y(xe,_c,[new RegExp("android\\s"+Ae,"i")]),y(xe,hc,[new RegExp(dc+"\\/"+Ae)]),y(xe,na,[new RegExp("(rv:|MSIE )"+Ae)]),y(xe,"Mozilla",[new RegExp("rv:"+Ae)]),xe),Pu=[[new RegExp(qn+"; "+qn+" (.*?)[);]","i"),function(n){return[qn,n&&n[1]||""]}],[new RegExp(Ni,"i"),[Ni,""]],[new RegExp(ji,"i"),[ji,""]],[sa,[Bn,""]],[new RegExp(Ai,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ho,""];if(new RegExp(Ze).test(e)&&!/IEMobile\b/.test(e))return[Ai+" "+Ze,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=Bf[i]||"";return/arm/i.test(e)&&(r="RT"),[Ai,r]}return[Ai,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[rs,e.join(".")]}return[rs,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=O(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+ft+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ft+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[ft,e.join(".")]}return[ft,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(n){var e=["Mac OS X",""];if(n&&n[1]){var t=[n[1],n[2],n[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Mf,""]],[/Linux|debian/i,["Linux",""]]],Fu=function(n){return Uf.test(n)?Ni:qf.test(n)?ji:jf.test(n)?qn:new RegExp(zo,"i").test(n)?zo:new RegExp("("+Ho+"|WPDesktop)","i").test(n)?Ho:/iPad/.test(n)?uc:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?pc:sa.test(n)?Bn:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(Tu,"i").test(n)?Tu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(Ze).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?ft:lc:ft:new RegExp("(pda|"+Ze+")","i").test(n)?Nf:new RegExp(Mi,"i").test(n)&&!new RegExp(Mi+" pc","i").test(n)?xc:""},Hr="https?://(.*)",Wf=["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"],be={campaignParams:function(n){return A?this._campaignParamsFromUrl(A.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=Wf.concat(e||[]),i={};return Q(t,function(r){var s=Au(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Hr+"google.([^/?]*)")===0?"google":n.search(Hr+"bing.com")===0?"bing":n.search(Hr+"yahoo.com")===0?"yahoo":n.search(Hr+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=be._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!$t(e)){i.$search_engine=e;var r=A?Au(A.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=A?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:Ru,browserVersion:function(n,e){var t=Ru(n,e),i=zf[t];if(O(i))return null;for(var r=0;r<i.length;r++){var s=i[r],o=n.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(var e=0;e<Pu.length;e++){var t=Te(Pu[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(Qe(r)?r(s,n):r);if(o)return o}return["",""]},device:Fu,deviceType:function(n){var e=Fu(n);return e===uc||e===lc||e==="Kobo"||e==="Kindle Fire"||e===xc?Mi:e===Ni||e===qn||e===ji||e===zo?"Console":e===pc?"Wearable":e?Ze:"Desktop"},referrer:function(){return A?.referrer||"$direct"},referringDomain:function(){var n;return A!=null&&A.referrer&&((n=Ri(A.referrer))===null||n===void 0?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:Ne?.href}},initialPersonPropsFromInfo:function(n){var e,t=n.r,i=n.u,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Ri(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=Ri(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,Q(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+Fo(a)]=o})}return t&&Q(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+Fo(a)]=o}),r},properties:function(){if(!_e)return{};var n=Te(be.os(_e),2),e=n[0],t=n[1];return Re(Po({$os:e,$os_version:t,$browser:be.browser(_e,navigator.vendor),$device:be.device(_e),$device_type:be.deviceType(_e)}),{$current_url:Ne?.href,$host:Ne?.host,$pathname:Ne?.pathname,$raw_user_agent:_e.length>1e3?_e.substring(0,997)+"...":_e,$browser_version:be.browserVersion(_e,navigator.vendor),$browser_language:be.browserLanguage(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:Ye.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:rc()/1e3})},people_properties:function(){if(!_e)return{};var n=Te(be.os(_e),2),e=n[0],t=n[1];return Re(Po({$os:e,$os_version:t,$browser:be.browser(_e,navigator.vendor)}),{$browser_version:be.browserVersion(_e,navigator.vendor)})}},Vf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ko=function(){function n(e){W(this,n),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(t){var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"}(e),this.storage=this.buildStorage(e),this.load(),e.debug&&_.info("Persistence loaded",e.persistence,S({},this.props)),this.update_config(e,e),this.save()}return V(n,[{key:"buildStorage",value:function(e){Vf.indexOf(e.persistence.toLowerCase())===-1&&(_.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"&&Ur.is_supported()?Ur:t==="sessionstorage"&&ke.is_supported()?ke:t==="memory"?Ff:t==="cookie"?Et:Ur.is_supported()?Ur:Et}},{key:"properties",value:function(){var e={};return Q(this.props,function(t,i){if(i===Mn&&he(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else a=i,l=!1,($t(o=kf)?l:cu&&o.indexOf===cu?o.indexOf(a)!=-1:(Q(o,function(u){if(l||(l=u===a))return Qr}),l))||(e[i]=t);var o,a,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Re({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,i){var r=this;if(he(e)){O(t)&&(t="None"),this.expire_days=O(i)?this.default_expiry:i;var s=!1;if(Q(e,function(o,a){r.props.hasOwnProperty(a)&&r.props[a]!==t||(r.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(he(e)){this.expire_days=O(t)?this.default_expiry:t;var r=!1;if(Q(e,function(s,o){e.hasOwnProperty(o)&&i.props[o]!==s&&(i.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(be.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(be.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once(be.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[qo]||this.props[Uo]||this.register_once(y({},Su,be.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Po({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Q([Uo,qo],function(s){var o=e.props[s];o&&Q(o,function(a,l){t["$initial_"+Fo(l)]=a})});var i=this.props[Su];if(i){var r=be.initialPersonPropsFromInfo(i);Re(t,r)}return t}},{key:"safe_merge",value:function(e){return Q(this.props,function(t,i){i in e||(e[i]=t)}),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.buildStorage(e),r=this.props;this.clear(),this.storage=i,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var i=this.props[Ii]||{};i[e]=t,this.props[Ii]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Ii]||{})[e];return O(t)||(delete this.props[Ii][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),n}();function Vo(n){return JSON.stringify(n,(e=[],function(t,i){if(he(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i})).length;var e}var Gf=2,Xf=4;function Go(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(n.size>=e&&n.data.length>1){var t=Math.floor(n.data.length/2),i=n.data.slice(0,t),r=n.data.slice(t);return[Go({size:Vo(i),data:i,sessionId:n.sessionId,windowId:n.windowId}),Go({size:Vo(r),data:r,sessionId:n.sessionId,windowId:n.windowId})].flatMap(function(s){return s})}return[n]}var Yr=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(Yr||{}),bt=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(bt||{});function oa(n){return n?fs(n).split(/\s+/):[]}function Ou(n){var e=v?.location.href;return!!(e&&n&&n.some(function(t){return e.match(t)}))}function ss(n){var e="";switch(Di(n.className)){case"string":e=n.className;break;case"object":e=(n.className&&"baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return oa(e)}function kc(n){return Pe(n)?null:fs(n).split(/(\s+)/).filter(function(e){return Un(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function os(n){var e="";return Jo(n)&&!Cc(n)&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;Sc(t)&&t.textContent&&(e+=(i=kc(t.textContent))!==null&&i!==void 0?i:"")}),fs(e)}function aa(n){return!!n&&n.nodeType===1}function zt(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function Sc(n){return!!n&&n.nodeType===3}function Ec(n){return!!n&&n.nodeType===11}var Xo=["a","button","form","input","select","textarea","label"];function $c(n){var e=n.parentNode;return!(!e||!aa(e))&&e}function Jf(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!v||!n||zt(n,"html")||!aa(n)||t!=null&&t.url_allowlist&&!Ou(t.url_allowlist)||t!=null&&t.url_ignorelist&&Ou(t.url_ignorelist))return!1;if(t!=null&&t.dom_event_allowlist){var s=t.dom_event_allowlist;if(s&&!s.some(function(d){return e.type===d}))return!1}for(var o=!1,a=[n],l=!0,u=n;u.parentNode&&!zt(u,"body");)if(Ec(u.parentNode))a.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=$c(u)))break;if(i||Xo.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var c=v.getComputedStyle(l);c&&c.getPropertyValue("cursor")==="pointer"&&(o=!0)}a.push(l),u=l}if(!function(d,g){var m=g?.element_allowlist;if(O(m))return!0;var E,L=et(d);try{var C=function(){var D=E.value;if(m.some(function(U){return D.tagName.toLowerCase()===U}))return{v:!0}};for(L.s();!(E=L.n()).done;){var M=C();if(Di(M)==="object")return M.v}}catch(D){L.e(D)}finally{L.f()}return!1}(a,t)||!function(d,g){var m=g?.css_selector_allowlist;if(O(m))return!0;var E,L=et(d);try{var C=function(){var D=E.value;if(m.some(function(U){return D.matches(U)}))return{v:!0}};for(L.s();!(E=L.n()).done;){var M=C();if(Di(M)==="object")return M.v}}catch(D){L.e(D)}finally{L.f()}return!1}(a,t))return!1;var p=v.getComputedStyle(n);if(p&&p.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var f=n.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return o?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Xo.indexOf(f)>-1||n.getAttribute("contenteditable")==="true")}}function Jo(n){for(var e=n;e.parentNode&&!zt(e,"body");e=e.parentNode){var t=ss(e);if(B(t,"ph-sensitive")||B(t,"ph-no-capture"))return!1}if(B(ss(n),"ph-include"))return!0;var i=n.type||"";if(Ce(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Ce(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function Cc(n){return!!(zt(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||zt(n,"select")||zt(n,"textarea")||n.getAttribute("contenteditable")==="true")}var Ic="(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})",Yf=new RegExp("^(?:".concat(Ic,")$")),Kf=new RegExp(Ic),Ac="\\d{3}-?\\d{2}-?\\d{4}",Qf=new RegExp("^(".concat(Ac,")$")),Zf=new RegExp("(".concat(Ac,")"));function Un(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Pe(n)||Ce(n)&&(n=fs(n),(e?Yf:Kf).test((n||"").replace(/[- ]/g,""))||(e?Qf:Zf).test(n)))}function Du(n){var e=os(n);return Un(e="".concat(e," ").concat(Tc(n)).trim())?e:""}function Tc(n){var e="";return n&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=os(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(Tc(t)).trim())}catch(s){_.error(s)}}),e}function ed(n){return function(e){var t=e.map(function(i){var r,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class){i.attr_class.sort();var a,l=et(i.attr_class);try{for(l.s();!(a=l.n()).done;){var u=a.value;o+=".".concat(u.replace(/"/g,""))}}catch(f){l.e(f)}finally{l.f()}}var c=S(S(S(S({},i.text?{text:i.text}:{}),{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),p={};return Jr(c).sort(function(f,d){var g=Te(f,1)[0],m=Te(d,1)[0];return g.localeCompare(m)}).forEach(function(f){var d=Te(f,2),g=d[0],m=d[1];return p[Mu(g.toString())]=Mu(m.toString())}),o+=":",o+=Jr(c).map(function(f){var d=Te(f,2),g=d[0],m=d[1];return"".concat(g,'="').concat(m,'"')}).join("")});return t.join(";")}(function(e){return e.map(function(t){var i,r,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:td(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Jr(t).filter(function(o){return Te(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Te(o,2),l=a[0],u=a[1];return s.attributes[l]=u}),s})}(n))}function Mu(n){return n.replace(/"|\\"/g,'\\"')}function td(n){var e=n.attr__class;return e?de(e)?e:oa(e):void 0}var Yo="[SessionRecording]",Ko="redacted",zr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(n){return n},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},nd=["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"],id=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],rd=["/s/","/e/","/i/"];function Lu(n,e,t,i){if(Pe(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Ce(r)&&(r=parseInt(r)),r>t?Yo+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function Nu(n,e){if(Pe(n))return n;var t=n;return Un(t,!1)||(t=Yo+" "+e+" body "+Ko),Q(id,function(i){var r,s;(r=t)!==null&&r!==void 0&&r.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=Yo+" "+e+" body "+Ko+" as might contain: "+i)}),t}var xt,sd=function(n,e){var t,i,r,s={payloadSizeLimitBytes:zr.payloadSizeLimitBytes,performanceEntryTypeToObserve:St(zr.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(St(e.payloadHostDenyList||[]),St(zr.payloadHostDenyList))},o=n.session_recording.recordHeaders!==!1&&e.recordHeaders,a=n.session_recording.recordBody!==!1&&e.recordBody,l=n.capture_performance!==!1&&e.recordPerformance,u=(t=s,r=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=Lu(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=Lu(f.responseBody,f.responseHeaders,r,"Response")),f}),c=function(f){return u(function(m){var E=Ri(m.name);if(!(E&&E.pathname&&rd.some(function(L){return E.pathname.indexOf(L)===0})))return m}((g=(d=f).requestHeaders,Pe(g)||Q(Object.keys(g??{}),function(m){nd.includes(m.toLowerCase())&&(g[m]=Ko)}),d)));var d,g},p=Qe(n.session_recording.maskNetworkRequestFn);return p&&Qe(n.session_recording.maskCapturedNetworkRequestFn)&&_.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(n.session_recording.maskCapturedNetworkRequestFn=function(f){var d=n.session_recording.maskNetworkRequestFn({url:f.name});return S(S({},f),{},{name:d?.url})}),s.maskRequestFn=Qe(n.session_recording.maskCapturedNetworkRequestFn)?function(f){var d,g,m,E=c(f);return E&&(d=(g=(m=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,E))!==null&&d!==void 0?d:void 0}:function(f){return function(d){if(!O(d))return d.requestBody=Nu(d.requestBody,"Request"),d.responseBody=Nu(d.responseBody,"Response"),d}(c(f))},S(S(S({},zr),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},od=V(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};W(this,n),y(this,"bucketSize",100),y(this,"refillRate",10),y(this,"mutationBuckets",{}),y(this,"loggedTracker",{}),y(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(o){r.mutationBuckets[o]=r.mutationBuckets[o]+r.refillRate,r.mutationBuckets[o]>=r.bucketSize&&delete r.mutationBuckets[o]})}),y(this,"getNodeOrRelevantParent",function(o){var a=r.rrweb.mirror.getNode(o);if(a?.nodeName!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[r.rrweb.mirror.getId(l),l]}return[o,a]}),y(this,"numberOfChanges",function(o){var a,l,u,c,p,f,d,g;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((u=(c=o.attributes)===null||c===void 0?void 0:c.length)!==null&&u!==void 0?u:0)+((p=(f=o.texts)===null||f===void 0?void 0:f.length)!==null&&p!==void 0?p:0)+((d=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&d!==void 0?d:0)}),y(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var a=o.data,l=r.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(c){var p,f,d,g=Te(r.getNodeOrRelevantParent(c.id),2),m=g[0],E=g[1];return r.mutationBuckets[m]===0?!1:(r.mutationBuckets[m]=(p=r.mutationBuckets[m])!==null&&p!==void 0?p:r.bucketSize,r.mutationBuckets[m]=Math.max(r.mutationBuckets[m]-1,0),r.mutationBuckets[m]===0&&(r.loggedTracker[m]||(r.loggedTracker[m]=!0,(f=(d=r.options).onBlockedNode)===null||f===void 0||f.call(d,m,E))),c)}));var u=r.numberOfChanges(a);return u!==0||l===u?o:void 0}),this.rrweb=e,this.options=s,this.refillRate=(t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),ad=3e5,ld=[bt.MouseMove,bt.MouseInteraction,bt.Scroll,bt.ViewportResize,bt.Input,bt.TouchMove,bt.MediaInteraction,bt.Drag],ju=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Je="[SessionRecording]",ud=function(){function n(e){var t=this;if(W(this,n),y(this,"queuedRRWebEvents",[]),y(this,"isIdle",!1),y(this,"_linkedFlagSeen",!1),y(this,"_lastActivityTimestamp",Date.now()),y(this,"_linkedFlag",null),y(this,"_removePageViewCaptureHook",void 0),y(this,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_onBeforeUnload",function(){t._flushBuffer()}),y(this,"_onOffline",function(){t._tryAddCustomEvent("browser offline",{})}),y(this,"_onOnline",function(){t._tryAddCustomEvent("browser online",{})}),y(this,"_onVisibilityChange",function(){if(A!=null&&A.visibilityState){var o="window "+A.visibilityState;t._tryAddCustomEvent(o,{})}}),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw _.error(Je+" started without valid sessionManager"),new Error(Je+" started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,s=i.windowId;this.sessionId=r,this.windowId=s,this.buffer=this.clearBuffer(),this._setupSampling()}return V(n,[{key:"rrwebRecord",get:function(){var e;return te==null||(e=te.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Je+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.full_snapshot_interval_millis)||ad}},{key:"isSampled",get:function(){var e=this.instance.get_property(Ti);return un(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((t=this.buffer)===null||t===void 0?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Do),t=!this.instance.config.disable_session_recording;return v&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(_u),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(wu);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(bu),r={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=r?.recordHeaders||i?.recordHeaders,o=r?.recordBody||i?.recordBody,a=he(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,l=!!(un(a)?a:i?.capturePerformance);return s||o||l?{recordHeaders:s,recordBody:o,recordPerformance:l}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(xu);return Ke(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(ku);return Ke(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Pe(this._linkedFlag)||this._linkedFlagSeen?un(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){var e=this;this.isRecordingEnabled?(this._startCapture(),v?.addEventListener("beforeunload",this._onBeforeUnload),v?.addEventListener("offline",this._onOffline),v?.addEventListener("online",this._onOnline),v?.addEventListener("visibilitychange",this._onVisibilityChange),Pe(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(function(t){try{if(t==="$pageview"){var i=v?e._maskUrl(v.location.href):"";if(!i)return;e._tryAddCustomEvent("$pageview",{href:i})}}catch(r){_.error("Could not add $pageview to rrweb session",r)}})),_.info(Je+" started")):this.stopRecording()}},{key:"stopRecording",value:function(){var e;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,_.info(Je+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(Ke(r)){var s,o=this.isSampled,a=i||!un(o);a?s=Math.random()<r:s=o,!s&&a&&_.warn(Je+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),(t=this.instance.persistence)===null||t===void 0||t.register(y({},Ti,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},Ti,null))}}},{key:"afterDecideResponse",value:function(e){var t,i,r,s=this;if(this._persistDecideResponse(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(r=e.sessionRecording)===null||r===void 0?void 0:r.endpoint),this._setupSampling(),!Pe(this._linkedFlag)&&!this._linkedFlagSeen){var o=Ce(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Ce(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,u){var c=he(u)&&o in u,p=a?u[o]===a:c;if(p){var f={linkedFlag:o,linkedVariant:a},d="linked flag matched";_.info(Je+" "+d,f),s._tryAddCustomEvent(d,f)}s._linkedFlagSeen=p})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Ke(this.sampleRate)&&$t(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,i=function(){var r,s,o,a,l,u,c,p,f=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate,d=Pe(f)?null:parseFloat(f),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(p={},Do,!!e.sessionRecording),y(p,_u,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(p,bu,S({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(p,wu,{enabled:(l=e.sessionRecording)===null||l===void 0?void 0:l.recordCanvas,fps:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasFps,quality:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasQuality}),y(p,xu,d),y(p,ku,O(g)?null:g),p))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:rc()})}},{key:"_startCapture",value:function(){var e=this;O(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(Ye.LIB_VERSION),function(t){if(t)return _.error(Je+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&ld.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=r.windowId,o=r.sessionId,a=this.sessionId!==o,l=this.windowId!==s;this.windowId=s,this.sessionId=o,(i||[Gf,Xf].indexOf(e.type)===-1&&(l||a||O(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(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}):_.warn(Je+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(ju(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(ju(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={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,s=0,o=Object.entries(r||{});s<o.length;s++){var a=Te(o[s],2),l=a[0],u=a[1];l in i&&(l==="maskInputOptions"?i.maskInputOptions=S({password:!0},u):i[l]=u)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new od(this.rrwebRecord,{onBlockedNode:function(p,f){var d="Too many mutations on node '".concat(p,"'. Rate limiting. This could be due to SVG animations or something similar");_.info(d,{node:f}),t.log(Je+" "+d,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(S({emit:function(p){t.onRRwebEmit(p)},plugins:c},i)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(function(p){return p?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else _.error(Je+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return te.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(te.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&Qe(te.getRecordNetworkPlugin)&&(!Of.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(te.getRecordNetworkPlugin(sd(this.instance.config,this.networkPayloadCapture))):_.info(Je+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&he(e)){if(e.type===Yr.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Yr.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&he(l)&&l.type===6&&he(l.data)&&l.data.plugin==="rrweb/console@1"){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var u=[],c=0;c<l.data.payload.payload.length;c++)l.data.payload.payload[c]&&l.data.payload.payload[c].length>2e3?u.push(l.data.payload.payload[c].slice(0,2e3)+"...[truncated]"):u.push(l.data.payload.payload[c]);return l.data.payload.payload=u,a}return a}(i),s=Vo(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Yr.Custom){var o={$snapshot_bytes:s,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){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)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=St(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt<=2e3&&e._tryRRWebMethod(i)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,r={url:e};return(i=r=t.maskNetworkRequestFn(r))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=Ke(i)&&i>=0,s=Ke(t)&&r&&i<t;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Go(this.buffer).forEach(function(o){e._captureSnapshot({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId})}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,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(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}},{key:"overrideLinkedFlag",value:function(){this._linkedFlagSeen=!0}}]),n}(),cd=function(){function n(e){W(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return V(n,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ln),group_properties:this.instance.get_property(qt),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:at.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(i){return e.parseDecideResponse(i.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var i=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},i),i)_.error("Failed to fetch feature flags from PostHog.");else{if(!A||!A.body)return _.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r,s=et(e.siteApps);try{var o=function(){var a=r.value,l=a.id,u=a.url,c=t.instance.requestRouter.endpointFor("api",u);te["__$$ph_site_app_".concat(l)]=t.instance,t.instance.requestRouter.loadScript(c,function(p){if(p)return _.error("Error while initializing PostHog app with config id ".concat(l),p)})};for(s.s();!(r=s.n()).done;)o()}catch(a){s.e(a)}finally{s.f()}}else e.siteApps.length>0&&_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),pd=v!=null&&v.location?is(v.location.hash,"__posthog")||is(location.hash,"state"):null,qu="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(xt||(xt={}));var fd=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"setToolbarState",value:function(e){te.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=te.ph_toolbar_state)!==null&&e!==void 0?e:xt.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=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||!A)return!1;i=(e=i)!==null&&e!==void 0?e:v.location,s=(t=s)!==null&&t!==void 0?t:v.history;try{if(!r){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}r=v?.localStorage}var o,a=pd||is(i.hash,"__posthog")||is(i.hash,"state"),l=a?du(function(){return JSON.parse(atob(decodeURIComponent(a)))})||du(function(){return JSON.parse(decodeURIComponent(a))}):null;return l&&l.action==="ph_authorize"?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(r.getItem(qu)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(te.ph_load_toolbar||te.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(A==null||!A.getElementById(Bo));if(!v||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=S(S({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(v.localStorage.setItem(qu,JSON.stringify(S(S({},s),{},{source:void 0}))),this.getToolbarState()===xt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===xt.UNINITIALIZED){this.setToolbarState(xt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(a),function(l){if(l)return _.error("Failed to load toolbar",l),void t.setToolbarState(xt.UNINITIALIZED);t.setToolbarState(xt.LOADED),t._callLoadToolbar(s)}),kt(v,"turbolinks:load",function(){t.setToolbarState(xt.UNINITIALIZED),t.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}]),n}(),dd=function(){function n(e){W(this,n),y(this,"isPaused",!0),y(this,"queue",[]),y(this,"flushTimeoutMs",3e3),this.sendRequest=e}return V(n,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},i=Object.values(t);[].concat(St(i.filter(function(r){return r.url.indexOf("/e")===0})),St(i.filter(function(r){return r.url.indexOf("/e")!==0}))).map(function(r){e.sendRequest(S(S({},r),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),i=function(s){var o=t[s],a=new Date().getTime();o.data&&de(o.data)&&Q(o.data,function(l){l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.sendRequest(o)};for(var r in t)i(r)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Q(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;O(e[s])&&(e[s]=S(S({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),ze=Uint8Array,Fe=Uint16Array,Hn=Uint32Array,la=new ze([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]),ua=new ze([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]),Uu=new ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rc=function(n,e){for(var t=new Fe(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new Hn(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},Pc=Rc(la,2),hd=Pc[0],Qo=Pc[1];hd[28]=258,Qo[258]=28;for(Zo=Rc(ua,0)[1],as=new Fe(32768),ee=0;ee<32768;++ee)jt=(43690&ee)>>>1|(21845&ee)<<1,jt=(61680&(jt=(52428&jt)>>>2|(13107&jt)<<2))>>>4|(3855&jt)<<4,as[ee]=((65280&jt)>>>8|(255&jt)<<8)>>>1;var jt,Zo,as,ee,Pi=function(n,e,t){for(var i=n.length,r=0,s=new Fe(e);r<i;++r)++s[n[r]-1];var o,a=new Fe(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new Fe(1<<e);var l=15-e;for(r=0;r<i;++r)if(n[r])for(var u=r<<4|n[r],c=e-n[r],p=a[n[r]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)o[as[p]>>>l]=u}else for(o=new Fe(i),r=0;r<i;++r)o[r]=as[a[n[r]-1]++]>>>15-n[r];return o},pn=new ze(288);for(ee=0;ee<144;++ee)pn[ee]=8;for(ee=144;ee<256;++ee)pn[ee]=9;for(ee=256;ee<280;++ee)pn[ee]=7;for(ee=280;ee<288;++ee)pn[ee]=8;var ls=new ze(32);for(ee=0;ee<32;++ee)ls[ee]=5;var vd=Pi(pn,9,0),gd=Pi(ls,5,0),Fc=function(n){return(n/8>>0)+(7&n&&1)},Oc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof Fe?Fe:n instanceof Hn?Hn:ze)(t-e);return i.set(n.subarray(e,t)),i},_t=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},Si=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},So=function(n,e){for(var t=[],i=0;i<n.length;++i)n[i]&&t.push({s:i,f:n[i]});var r=t.length,s=t.slice();if(!r)return[new ze(0),0];if(r==1){var o=new ze(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 a=t[0],l=t[1],u=0,c=1,p=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=t[t[u].f<t[p].f?u++:p++],l=t[u!=c&&t[u].f<t[p].f?u++:p++],t[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(i=1;i<r;++i)s[i].s>f&&(f=s[i].s);var d=new Fe(f+1),g=md(t[c-1],d,0);if(g>e){i=0;var m=0,E=g-e,L=1<<E;for(s.sort(function(U,G){return d[G.s]-d[U.s]||U.f-G.f});i<r;++i){var C=s[i].s;if(!(d[C]>e))break;m+=L-(1<<g-d[C]),d[C]=e}for(m>>>=E;m>0;){var M=s[i].s;d[M]<e?m-=1<<e-d[M]++-1:++i}for(;i>=0&&m;--i){var D=s[i].s;d[D]==e&&(--d[D],++m)}g=e}return[new ze(d),g]},md=function n(e,t,i){return e.s==-1?Math.max(n(e.l,t,i+1),n(e.r,t,i+1)):t[e.s]=i},Bu=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new Fe(++e),i=0,r=n[0],s=1,o=function(l){t[i++]=l},a=1;a<=e;++a)if(n[a]==r&&a!=e)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=n[a]}return[t.subarray(0,i),e]},Ei=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},Kr=function(n,e,t){var i=t.length,r=Fc(e+2);n[r]=255&i,n[r+1]=i>>>8,n[r+2]=255^n[r],n[r+3]=255^n[r+1];for(var s=0;s<i;++s)n[r+s+4]=t[s];return 8*(r+4+i)},Hu=function(n,e,t,i,r,s,o,a,l,u,c){_t(e,c++,t),++r[256];for(var p=So(r,15),f=p[0],d=p[1],g=So(s,15),m=g[0],E=g[1],L=Bu(f),C=L[0],M=L[1],D=Bu(m),U=D[0],G=D[1],X=new Fe(19),T=0;T<C.length;++T)X[31&C[T]]++;for(T=0;T<U.length;++T)X[31&U[T]]++;for(var J=So(X,7),K=J[0],tt=J[1],ve=19;ve>4&&!K[Uu[ve-1]];--ve);var We,Y,ne,ue,Me=u+5<<3,qe=Ei(r,pn)+Ei(s,ls)+o,oe=Ei(r,f)+Ei(s,m)+o+14+3*ve+Ei(X,K)+(2*X[16]+3*X[17]+7*X[18]);if(Me<=qe&&Me<=oe)return Kr(e,c,n.subarray(l,l+u));if(_t(e,c,1+(oe<qe)),c+=2,oe<qe){We=Pi(f,d,0),Y=f,ne=Pi(m,E,0),ue=m;var Se=Pi(K,tt,0);for(_t(e,c,M-257),_t(e,c+5,G-1),_t(e,c+10,ve-4),c+=14,T=0;T<ve;++T)_t(e,c+3*T,K[Uu[T]]);c+=3*ve;for(var Ee=[C,U],ie=0;ie<2;++ie){var ge=Ee[ie];for(T=0;T<ge.length;++T){var Ie=31&ge[T];_t(e,c,Se[Ie]),c+=K[Ie],Ie>15&&(_t(e,c,ge[T]>>>5&127),c+=ge[T]>>>12)}}}else We=vd,Y=pn,ne=gd,ue=ls;for(T=0;T<a;++T)if(i[T]>255){Ie=i[T]>>>18&31,Si(e,c,We[Ie+257]),c+=Y[Ie+257],Ie>7&&(_t(e,c,i[T]>>>23&31),c+=la[Ie]);var dn=31&i[T];Si(e,c,ne[dn]),c+=ue[dn],dn>3&&(Si(e,c,i[T]>>>5&8191),c+=ua[dn])}else Si(e,c,We[i[T]]),c+=Y[i[T]];return Si(e,c,We[256]),c+Y[256]},yd=new Hn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_d=new ze(0),bd=function(){for(var n=new Hn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),wd=function(n,e,t,i,r){return function(s,o,a,l,u,c){var p=s.length,f=new ze(l+p+5*(1+Math.floor(p/7e3))+u),d=f.subarray(l,f.length-u),g=0;if(!o||p<8)for(var m=0;m<=p;m+=65535){var E=m+65535;E<p?g=Kr(d,g,s.subarray(m,E)):(d[m]=c,g=Kr(d,g,s.subarray(m,p)))}else{for(var L=yd[o-1],C=L>>>13,M=8191&L,D=(1<<a)-1,U=new Fe(32768),G=new Fe(D+1),X=Math.ceil(a/3),T=2*X,J=function(ks){return(s[ks]^s[ks+1]<<X^s[ks+2]<<T)&D},K=new Hn(25e3),tt=new Fe(288),ve=new Fe(32),We=0,Y=0,ne=(m=0,0),ue=0,Me=0;m<p;++m){var qe=J(m),oe=32767&m,Se=G[qe];if(U[oe]=Se,G[qe]=oe,ue<=m){var Ee=p-m;if((We>7e3||ne>24576)&&Ee>423){g=Hu(s,d,0,K,tt,ve,Y,ne,Me,m-Me,g),ne=We=Y=0,Me=m;for(var ie=0;ie<286;++ie)tt[ie]=0;for(ie=0;ie<30;++ie)ve[ie]=0}var ge=2,Ie=0,dn=M,Ct=oe-Se&32767;if(Ee>2&&qe==J(m-Ct))for(var Qc=Math.min(C,Ee)-1,Zc=Math.min(32767,m),ep=Math.min(258,Ee);Ct<=Zc&&--dn&&oe!=Se;){if(s[m+ge]==s[m+ge-Ct]){for(var It=0;It<ep&&s[m+It]==s[m+It-Ct];++It);if(It>ge){if(ge=It,Ie=Ct,It>Qc)break;var tp=Math.min(Ct,It-2),va=0;for(ie=0;ie<tp;++ie){var xs=m-Ct+ie+32768&32767,ga=xs-U[xs]+32768&32767;ga>va&&(va=ga,Se=xs)}}}Ct+=(oe=Se)-(Se=U[oe])+32768&32767}if(Ie){K[ne++]=268435456|Qo[ge]<<18|Zo[Ie];var ma=31&Qo[ge],ya=31&Zo[Ie];Y+=la[ma]+ua[ya],++tt[257+ma],++ve[ya],ue=m+ge,++We}else K[ne++]=s[m],++tt[s[m]]}}g=Hu(s,d,c,K,tt,ve,Y,ne,Me,m-Me,g),c||(g=Kr(d,g,_d))}return Oc(f,0,l+Fc(g)+u)}(n,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+e.mem,t,i,!r)},Eo=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function xd(n,e){e===void 0&&(e={});var t=function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=bd[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),i=n.length;t.p(n);var r,s=wd(n,e,10+((r=e).filename&&r.filename.length+1||0),8),o=s.length;return function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&Eo(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}}(s,e),Eo(s,o-8,t.d()),Eo(s,o-4,i),s}var kd=!!Ro||!!To,zu="text/plain",us=function(n,e){var t=Te(n.split("?"),2),i=t[0],r=t[1],s=S({},e);r?.split("&").forEach(function(a){var l=Te(a.split("="),1)[0];delete s[l]});var o=Df(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},Sd=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},$o=function(n){var e=n.data,t=n.compression;if(e){if(t===at.GZipJS){var i=xd(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new ze(s.length+(s.length>>>1)),u=0,c=function(g){l[u++]=g},p=0;p<a;++p){if(u+5>l.length){var f=new ze(u+8+(a-p<<1));f.set(l),l=f}var d=s.charCodeAt(p);d<128||o?c(d):d<2048?(c(192|d>>>6),c(128|63&d)):d>55295&&d<57344?(c(240|(d=65536+(1047552&d)|1023&s.charCodeAt(++p))>>>18),c(128|d>>>12&63),c(128|d>>>6&63),c(128|63&d)):(c(224|d>>>12),c(128|d>>>6&63),c(128|63&d))}return Oc(l,0,u)}(JSON.stringify(e)),{mtime:0});return{contentType:zu,body:new Blob([i],{type:zu})}}if(t===at.Base64){var r=function(s){var o,a,l,u,c,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,d=0,g="",m=[];if(!s)return s;s=xf(s);do o=(c=s.charCodeAt(f++)<<16|s.charCodeAt(f++)<<8|s.charCodeAt(f++))>>18&63,a=c>>12&63,l=c>>6&63,u=63&c,m[d++]=p.charAt(o)+p.charAt(a)+p.charAt(l)+p.charAt(u);while(f<s.length);switch(g=m.join(""),s.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:Sd(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Fi=[];Ro&&Fi.push({transport:"XHR",method:function(n){var e,t=new Ro;t.open(n.method||"GET",n.url,!0);var i=(e=$o(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;Q(n.headers,function(o,a){t.setRequestHeader(a,o)}),r&&t.setRequestHeader("Content-Type",r),n.timeout&&(t.timeout=n.timeout),t.withCredentials=!0,t.onreadystatechange=function(){if(t.readyState===4){var o,a={statusCode:t.status,text:t.responseText};if(t.status===200)try{a.json=JSON.parse(t.responseText)}catch{}(o=n.callback)===null||o===void 0||o.call(n,a)}},t.send(s)}}),To&&Fi.push({transport:"fetch",method:function(n){var e,t,i=(e=$o(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;Q(n.headers,function(c,p){o.append(p,c)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(pu){var u=new pu;l={signal:u.signal,timeout:setTimeout(function(){return u.abort()},n.timeout)}}To(a,{method:n?.method||"GET",headers:o,keepalive:n.method==="POST",body:s,signal:(t=l)===null||t===void 0?void 0:t.signal}).then(function(c){return c.text().then(function(p){var f,d={statusCode:c.status,text:p};if(c.status===200)try{d.json=JSON.parse(p)}catch(g){_.error(g)}(f=n.callback)===null||f===void 0||f.call(n,d)})}).catch(function(c){var p;_.error(c),(p=n.callback)===null||p===void 0||p.call(n,{statusCode:0,text:c})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),lt!=null&&lt.sendBeacon&&Fi.push({transport:"sendBeacon",method:function(n){var e=us(n.url,{beacon:"1"});try{var t,i=(t=$o(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;lt.sendBeacon(e,o)}catch{}}});var Ed=["retriesPerformedSoFar"],cn,$d=function(){function n(e){var t=this;W(this,n),y(this,"isPolling",!1),y(this,"pollIntervalMs",3e3),y(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!O(v)&&"onLine"in v.navigator&&(this.areWeOnline=v.navigator.onLine,v.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),v.addEventListener("offline",function(){t.areWeOnline=!1}))}return V(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=mf(e,Ed);Ke(i)&&i>0&&(r.url=us(r.url,{retry_count:i})),this.instance._send_request(S(S({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(S({retriesPerformedSoFar:i},r)):(o=r.callback)===null||o===void 0||o.call(r,s)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(t),r=Date.now()+i;this.queue.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),_.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],i=this.queue.filter(function(a){return a.retryAt<e||(t.push(a),!1)});if(this.queue=t,i.length>0){var r,s=et(i);try{for(s.s();!(r=s.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(a){s.e(a)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=et(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(S(S({},i),{},{transport:"sendBeacon"}))}catch(r){_.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),Wr=1800,Cd=function(){function n(e,t,i,r){var s;W(this,n),y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||Bt,this._windowIdGenerator=r||Bt;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Wr;if(Ke(a)?a>Wr?_.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&_.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(_.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Wr),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),Wr),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var l=ke.parse(this._window_id_storage_key),u=ke.parse(this._primary_window_exists_storage_key);l&&!u?this._windowId=l:ke.remove(this._window_id_storage_key),ke.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var c=function(p){var f=p.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(p){_.error("Invalid sessionID in bootstrap",p)}this._listenToReloadWindow()}return V(n,[{key:"onSessionId",value:function(e){var t=this;return O(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&ke.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ke.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?ke.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(y({},Zr,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Zr];return de(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;v?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&ke.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){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(),i=Te(this._getSessionId(),3),r=i[0],s=i[1],o=i[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!s,p=!e&&Math.abs(t-r)>this._sessionTimeoutMs;c||p||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),_.info("[SessionId] new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=r===0||!e||l?t:r,d=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,f,d),u&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:d}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(cn||(cn={}));var Wu="i.posthog.com",Id=function(){function n(e){W(this,n),y(this,"_regionCache",{}),this.instance=e}return V(n,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(Wu),".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=cn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=cn.EU:this._regionCache[this.apiHost]=cn.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(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===cn.CUSTOM)return this.apiHost+t;var i=Wu+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return _.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var i=e[0]==="/"?this.endpointFor("assets",e):e,r=function(){if(!A)return t("document not found");var s=A.createElement("script");s.type="text/javascript",s.src=i,s.onload=function(l){return t(void 0,l)},s.onerror=function(l){return t(l)};var o,a=A.querySelectorAll("body > script");a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(s,a[0]):A.body.appendChild(s)};A!=null&&A.body?r():A?.addEventListener("DOMContentLoaded",r)}}]),n}(),Dc="posthog-js";function Mc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.organization,i=e.projectId,r=e.prefix,s=e.severityAllowList,o=s===void 0?["error"]:s;return function(a){var l,u,c,p,f;if(!(o==="*"||o.includes(a.level))||!n.__loaded)return a;a.tags||(a.tags={});var d=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=d,n.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));var g=((l=a.exception)===null||l===void 0?void 0:l.values)||[],m={$exception_message:((u=g[0])===null||u===void 0?void 0:u.value)||a.message,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:d,$exception_level:a.level,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((p=g[0])===null||p===void 0?void 0:p.value)||a.message,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:a.tags,$level:a.level};return t&&i&&(m.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.exceptions.sendExceptionEvent(m),a}}var Ad=V(function n(e,t,i,r,s){W(this,n),this.name=Dc,this.setupOnce=function(o){o(Mc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function Td(n,e){var t=n.config.segment;if(!t)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var o=function(l){var u=function(){return l.anonymousId()||Bt()};i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(wt,"identified")),r()},a=s.user();"then"in a&&Qe(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||_.warn("This browser does not have Promise support, and can not use the segment integration");var r=function(s,o){var a;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||(_.info("Segment integration does not have a userId set, resetting PostHog"),i.reset()),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(_.info("Segment integration has a userId set, identifying with PostHog"),i.identify(s.event.userId));var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{},new Date);return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return r(s,s.event.event)},page:function(s){return r(s,"$pageview")},identify:function(s){return r(s,"$identify")},screen:function(s){return r(s,"$screen")}}}(n)).then(function(){e()})})}var Vu,cs,ot,Rd=function(){function n(e){W(this,n),this._instance=e}return V(n,[{key:"doPageView",value:function(e){var t,i=this._previousPageViewProperties(e);return this._currentPath=(t=v?.location.pathname)!==null&&t!==void 0?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,i}},{key:"doPageLeave",value:function(e){return this._previousPageViewProperties(e)}},{key:"_previousPageViewProperties",value:function(e){var t=this._currentPath,i=this._prevPageviewTimestamp,r=this._instance.scrollManager.getContext();if(!i)return{};var s={};if(r){var o=r.maxScrollHeight,a=r.lastScrollY,l=r.maxScrollY,u=r.maxContentHeight,c=r.lastContentY,p=r.maxContentY;O(o)||O(a)||O(l)||O(u)||O(c)||O(p)||(o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),p=Math.ceil(p),s={$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:o<=1?1:Vr(a/o,0,1),$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:o<=1?1:Vr(l/o,0,1),$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:u<=1?1:Vr(c/u,0,1),$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:u<=1?1:Vr(p/u,0,1)})}return t&&(s.$prev_pageview_pathname=t),i&&(s.$prev_pageview_duration=(e.getTime()-i.getTime())/1e3),s}}]),n}();function Vr(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(Vu||(Vu={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(cs||(cs={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(ot||(ot={}));var Lc=function(){function n(){W(this,n),y(this,"events",{}),this.events={}}return V(n,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(r){return r!==t})}}},{key:"emit",value:function(e,t){var i,r=et(this.events[e]||[]);try{for(r.s();!(i=r.n()).done;)(0,i.value)(t)}catch(a){r.e(a)}finally{r.f()}var s,o=et(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),Pd=function(){function n(e){var t=this;W(this,n),y(this,"_debugEventEmitter",new Lc),y(this,"checkStep",function(i,r){return t.checkStepEvent(i,r)&&t.checkStepUrl(i,r)&&t.checkStepElement(i,r)}),y(this,"checkStepEvent",function(i,r){return r==null||!r.event||i?.event===r?.event}),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}return V(n,[{key:"init",value:function(){var e,t=this;if(!O((e=this.instance)===null||e===void 0?void 0:e._addCaptureHook)){var i;(i=this.instance)===null||i===void 0||i._addCaptureHook(function(r,s){t.on(r,s)})}}},{key:"register",value:function(e){var t,i,r=this;if(!O((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(function(a){var l,u;(l=r.actionRegistry)===null||l===void 0||l.add(a),(u=a.steps)===null||u===void 0||u.forEach(function(c){var p;(p=r.actionEvents)===null||p===void 0||p.add(c?.event||"")})}),(i=this.instance)!==null&&i!==void 0&&i.autocapture)){var s,o=new Set;e.forEach(function(a){var l;(l=a.steps)===null||l===void 0||l.forEach(function(u){u!=null&&u.selector&&o.add(u?.selector)})}),(s=this.instance)===null||s===void 0||s.autocapture.setElementSelectors(o)}}},{key:"on",value:function(e,t){var i,r=this;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((i=this.actionRegistry)===null||i===void 0?void 0:i.size)>0&&this.actionRegistry.forEach(function(s){r.checkAction(t,s)&&r._debugEventEmitter.emit("actionCaptured",s.name)})}},{key:"_addActionHook",value:function(e){this.onAction("actionCaptured",function(t){return e(t)})}},{key:"checkAction",value:function(e,t){if(t?.steps==null)return!1;var i,r=et(t.steps);try{for(r.s();!(i=r.n()).done;){var s=i.value;if(this.checkStep(e,s))return!0}}catch(o){r.e(o)}finally{r.f()}return!1}},{key:"onAction",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"checkStepUrl",value:function(e,t){if(t!=null&&t.url){var i,r=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!r||typeof r!="string"||!n.matchString(r,t?.url,t?.url_matching||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.getElementsList(e).some(function(s){return!(t!=null&&t.href&&!n.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!n.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!n.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))}))return!1;if(t!=null&&t.selector){var i,r=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(!r||!r.includes(t?.selector))return!1}return!0}},{key:"getElementsList",value:function(e){return e?.properties.$elements==null?[]:e?.properties.$elements}}],[{key:"matchString",value:function(e,t,i){switch(i){case"regex":return!!v&&ns(e,t);case"exact":return t===e;case"contains":var r=n.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return ns(e,r);default:return!1}}},{key:"escapeStringRegexp",value:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),n}(),ea=function(){function n(e){W(this,n),this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return V(n,[{key:"register",value:function(e){var t;O((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:"setupActionBasedSurveys",value:function(e){var t=this,i=e.filter(function(r){var s,o,a,l;return((s=r.conditions)===null||s===void 0?void 0:s.actions)&&((o=r.conditions)===null||o===void 0||(a=o.actions)===null||a===void 0||(l=a.values)===null||l===void 0?void 0:l.length)>0});i.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new Pd(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(function(r){t.onAction(r)})),i.forEach(function(r){var s,o,a,l,u,c,p,f,d,g;r.conditions&&(s=r.conditions)!==null&&s!==void 0&&s.actions&&(o=r.conditions)!==null&&o!==void 0&&(a=o.actions)!==null&&a!==void 0&&a.values&&((l=r.conditions)===null||l===void 0||(u=l.actions)===null||u===void 0||(c=u.values)===null||c===void 0?void 0:c.length)>0&&((p=t.actionMatcher)===null||p===void 0||p.register(r.conditions.actions.values),(f=r.conditions)===null||f===void 0||(d=f.actions)===null||d===void 0||(g=d.values)===null||g===void 0||g.forEach(function(m){if(m&&m.name){var E=t.actionToSurveys.get(m.name);E&&E.push(r.id),t.actionToSurveys.set(m.name,E||[r.id])}}))}))}},{key:"setupEventBasedSurveys",value:function(e){var t,i=this;e.filter(function(r){var s,o,a,l;return((s=r.conditions)===null||s===void 0?void 0:s.events)&&((o=r.conditions)===null||o===void 0||(a=o.events)===null||a===void 0||(l=a.values)===null||l===void 0?void 0:l.length)>0}).length!==0&&((t=this.instance)===null||t===void 0||t._addCaptureHook(function(r,s){i.onEvent(r,s)}),e.forEach(function(r){var s,o,a;(s=r.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(a=o.values)===null||a===void 0||a.forEach(function(l){if(l&&l.name){var u=i.eventToSurveys.get(l.name);u&&u.push(r.id),i.eventToSurveys.set(l.name,u||[r.id])}})}))}},{key:"onEvent",value:function(e,t){var i,r,s=((i=this.instance)===null||i===void 0||(r=i.persistence)===null||r===void 0?void 0:r.props[jr])||[];if(n.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,a=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(a){var l=s.indexOf(a);l>=0&&(s.splice(l,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(e)||[]))}},{key:"onAction",value:function(e){var t,i,r=((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0?void 0:i.props[jr])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}},{key:"_updateActivatedSurveys",value:function(e){var t,i;(t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register(y({},jr,St(new Set(e))))}},{key:"getSurveys",value:function(){var e,t,i=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[jr];return i||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),n}();y(ea,"SURVEY_SHOWN_EVENT_NAME","survey shown");var $i="[Surveys]",Fd={icontains:function(n){return!!v&&v.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!v&&v.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!v&&ns(v.location.href,n)},not_regex:function(n){return!!v&&!ns(v.location.href,n)},exact:function(n){return v?.location.href===n},is_not:function(n){return v?.location.href!==n}},Od=function(){function n(e){W(this,n),this.instance=e,this._surveyEventReceiver=null}return V(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=te?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new ea(this.instance)),this.instance.requestRouter.loadScript("/static/surveys.js",function(i){if(i)return _.error($i,"Could not load surveys script",i);e._surveyManager=te.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new ea(this.instance));var r=this.instance.get_property(Lo);if(r&&!i)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:function(s){var o;if(s.statusCode!==200||!s.json)return e([]);var a,l=s.json.surveys||[],u=l.filter(function(c){var p,f,d,g,m,E,L,C,M,D,U,G;return((p=c.conditions)===null||p===void 0?void 0:p.events)&&((f=c.conditions)===null||f===void 0||(d=f.events)===null||d===void 0?void 0:d.values)&&((g=c.conditions)===null||g===void 0||(m=g.events)===null||m===void 0||(E=m.values)===null||E===void 0?void 0:E.length)>0||((L=c.conditions)===null||L===void 0?void 0:L.actions)&&((C=c.conditions)===null||C===void 0||(M=C.actions)===null||M===void 0?void 0:M.values)&&((D=c.conditions)===null||D===void 0||(U=D.actions)===null||U===void 0||(G=U.values)===null||G===void 0?void 0:G.length)>0});return u.length>0&&((a=t._surveyEventReceiver)===null||a===void 0||a.register(u)),(o=t.instance.persistence)===null||o===void 0||o.register(y({},Lo,l)),e(l)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(r){var s,o=r.filter(function(u){return!(!u.start_date||u.end_date)}).filter(function(u){var c,p,f,d;if(!u.conditions)return!0;var g=(c=u.conditions)===null||c===void 0||!c.url||Fd[(p=(f=u.conditions)===null||f===void 0?void 0:f.urlMatchType)!==null&&p!==void 0?p:"icontains"](u.conditions.url),m=(d=u.conditions)===null||d===void 0||!d.selector||A?.querySelector(u.conditions.selector);return g&&m}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(u){var c,p,f,d,g,m,E,L,C,M;if(!u.linked_flag_key&&!u.targeting_flag_key&&!u.internal_targeting_flag_key)return!0;var D=!u.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(u.linked_flag_key),U=!u.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.targeting_flag_key),G=((c=u.conditions)===null||c===void 0?void 0:c.events)&&((p=u.conditions)===null||p===void 0||(f=p.events)===null||f===void 0?void 0:f.values)&&((d=u.conditions)===null||d===void 0||(g=d.events)===null||g===void 0?void 0:g.values.length)>0,X=((m=u.conditions)===null||m===void 0?void 0:m.actions)&&((E=u.conditions)===null||E===void 0||(L=E.actions)===null||L===void 0?void 0:L.values)&&((C=u.conditions)===null||C===void 0||(M=C.actions)===null||M===void 0?void 0:M.values.length)>0,T=!G&&!X||a?.includes(u.id),J=t._canActivateRepeatedly(u),K=!(u.internal_targeting_flag_key&&!J)||t.instance.featureFlags.isFeatureEnabled(u.internal_targeting_flag_key);return D&&U&&K&&T});return e(l)},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var r,s=e.questions[t],o=t+1;if((r=s.branching)===null||r===void 0||!r.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===cs.SingleChoice){var a,l,u=s.choices.indexOf("".concat(i));if((a=s.branching)!==null&&a!==void 0&&(l=a.responseValues)!==null&&l!==void 0&&l.hasOwnProperty(u)){var c=s.branching.responseValues[u];return Number.isInteger(c)?c:c===ot.End?ot.End:o}}else if(s.type===cs.Rating){var p,f;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var d=function(m,E){if(E===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(E===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(E===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, 10")}(i,s.scale);if((p=s.branching)!==null&&p!==void 0&&(f=p.responseValues)!==null&&f!==void 0&&f.hasOwnProperty(d)){var g=s.branching.responseValues[d];return Number.isInteger(g)?g:g===ot.End?ot.End:o}}return o}return _.warn($i,"Falling back to next question index due to unexpected branching type"),o}},{key:"_canActivateRepeatedly",value:function(e){var t;return Pe((t=te.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(_.warn($i,"canActivateRepeatedly is not defined, must init before calling"),!1):te.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:"canRenderSurvey",value:function(e){var t=this;Pe(this._surveyManager)?_.warn($i,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(function(i){var r=i.filter(function(s){return s.id===e})[0];t._surveyManager.canRenderSurvey(r)})}},{key:"renderSurvey",value:function(e,t){var i=this;Pe(this._surveyManager)?_.warn($i,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(function(r){var s=r.filter(function(o){return o.id===e})[0];i._surveyManager.renderSurvey(s,A?.querySelector(t))})}}]),n}(),Dd=function(){function n(e){var t,i,r=this;W(this,n),y(this,"serverLimits",{}),y(this,"lastEventRateLimited",!1),y(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(a){_.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void _.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:o})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return V(n,[{key:"clientRateLimitContext",value:function(){var e,t,i,r=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(jo))!==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 a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||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=a,(i=this.instance.persistence)===null||i===void 0||i.set_property(jo,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}]),n}(),Md=function(){return S({initialPathName:Ne?.pathname||"",referringDomain:be.referringDomain()},be.campaignParams())},Ld=function(){function n(e,t,i){var r=this;W(this,n),y(this,"_onSessionIdCallback",function(s){var o=r._getStoredProps();if(!o||o.sessionId!==s){var a={sessionId:s,props:r._sessionSourceParamGenerator()};r._persistence.register(y({},No,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||Md,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return V(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[No]}},{key:"getSessionProps",value:function(){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}:{}}}]),n}(),Nd=["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;"],Gu=function(n,e){if(!n)return!1;var t=n.toLowerCase();return Nd.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},Nc=function(){function n(){W(this,n),this.clicks=[]}return V(n,[{key:"isRageClick",value:function(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}]),n}();function Xu(n){var e;return n.id===Bo||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+Bo))}var jd=function(){function n(e){var t,i=this;W(this,n),y(this,"rageclicks",new Nc),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),y(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Oo]),v?.addEventListener("beforeunload",function(){i.flush()})}return V(n,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return he(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){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}},{key:"startIfEnabled",value:function(){if(this.isEnabled){if(this._initialized)return;_.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e;clearInterval((e=this._flushInterval)!==null&&e!==void 0?e:void 0),this.getAndClearBuffer()}}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},Oo,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;v&&A&&(kt(A,"click",function(t){return e._onClick(t||v?.event)},!1,!0),kt(A,"mousemove",function(t){return e._onMouseMove(t||v?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,l,u){for(var c=a;c&&!zt(c,"body");){if(c===u)return!1;if(B(l,v?.getComputedStyle(c).position))return!0;c=$c(c)}return!1}(e.target,["fixed","sticky"],s);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!Xu(e.target)){var i=this._getProperties(e,"click");(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(S(S({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;Xu(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(v){var t=v.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}},{key:"flush",value:function(){this.buffer&&!Xr(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),n}(),qd=function(){function n(e){var t=this;W(this,n),y(this,"_updateScrollData",function(){var i,r,s,o;t.context||(t.context={});var a=t.scrollElement(),l=t.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=l+(a?.clientHeight||0),p=a?.scrollHeight||0;t.context.lastScrollY=Math.ceil(l),t.context.maxScrollY=Math.max(l,(i=t.context.maxScrollY)!==null&&i!==void 0?i:0),t.context.maxScrollHeight=Math.max(u,(r=t.context.maxScrollHeight)!==null&&r!==void 0?r:0),t.context.lastContentY=c,t.context.maxContentY=Math.max(c,(s=t.context.maxContentY)!==null&&s!==void 0?s:0),t.context.maxContentHeight=Math.max(p,(o=t.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=e}return V(n,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){v?.addEventListener("scroll",this._updateScrollData,!0),v?.addEventListener("scrollend",this._updateScrollData,!0),v?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return v?.document.documentElement;var e,t=et(de(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var i=e.value,r=v?.document.querySelector(i);if(r)return r}}catch(s){t.e(s)}finally{t.f()}}},{key:"scrollY",value:function(){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}},{key:"scrollX",value:function(){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}}]),n}(),Co="$copy_autocapture";function Io(n,e){return e.length>n?e.slice(0,n)+"...":e}var Ut,Ud=function(){function n(e){W(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new Nc),y(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}return V(n,[{key:"config",get:function(){var e,t,i=he(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)===null||e===void 0?void 0:e.map(function(r){return new RegExp(r)}),i.url_ignorelist=(t=i.url_ignorelist)===null||t===void 0?void 0:t.map(function(r){return new RegExp(r)}),i}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(v&&A){var t=function(r){r=r||v?.event;try{e._captureEvent(r)}catch(s){_.error("Failed to capture event",s)}},i=function(r){r=r||v?.event,e._captureEvent(r,Co)};kt(A,"submit",t,!1,!0),kt(A,"change",t,!1,!0),kt(A,"click",t,!1,!0),this.config.capture_copied_text&&(kt(A,"copy",i,!1,!0),kt(A,"cut",i,!1,!0))}}else _.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(y({},hu,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(e){this._elementSelectors=e}},{key:"getElementSelectors",value:function(e){var t,i=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(function(r){var s=A?.querySelectorAll(r);s?.forEach(function(o){e===o&&i.push(r)})}),i}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[hu],r=this._isDisabledServerSide;if($t(r)&&!un(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!aa(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Jo(e))return{};var t={};return Q(e.attributes,function(i){if(i.name&&i.name.indexOf("data-ph-capture-attribute")===0){var r=i.name.replace("data-ph-capture-attribute-",""),s=i.value;r&&s&&Un(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Xo.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=Io(1024,Du(e)):o.$el_text=Io(1024,os(e)));var a=ss(e);a.length>0&&(o.classes=a.filter(function(f){return f!==""}));var l=(r=this.config)===null||r===void 0?void 0:r.element_attribute_ignorelist;Q(e.attributes,function(f){var d;if((!Cc(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(l==null||!l.includes(f.name))&&!t&&Un(f.value)&&(d=f.name,!Ce(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=oa(g).join(" ")),o["attr__"+f.name]=Io(1024,g)}});for(var u=1,c=1,p=e;p=this._previousElementSibling(p);)u++,p.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return O(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);Sc(s)&&(s=s.parentNode||null),i==="$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 o=i===Co;if(s&&Jf(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,u=[s],c=s;c.parentNode&&!zt(c,"body");)Ec(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var p,f,d=[],g={},m=!1;if(Q(u,function(J){var K=Jo(J);J.tagName.toLowerCase()==="a"&&(p=J.getAttribute("href"),p=K&&Un(p)&&p),B(ss(J),"ph-no-capture")&&(m=!0),d.push(t._getPropertiesFromElement(J,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var tt=t._getAugmentPropertiesFromElement(J);Re(g,tt)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?d[0].$el_text=Du(s):d[0].$el_text=os(s)),p){var E,L;d[0].attr__href=p;var C=(E=Ri(p))===null||E===void 0?void 0:E.host,M=v==null||(L=v.location)===null||L===void 0?void 0:L.host;C&&M&&C!==M&&(f=p)}if(m)return!1;var D=Re(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:ed(d)}:{$elements:d},(a=d[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=d[0])===null||l===void 0?void 0:l.$el_text}:{},f&&e.type==="click"?{$external_click_url:f}:{},g),U=this.getElementSelectors(s);if(U&&U.length>0&&(D.$element_selectors=U),i===Co){var G,X=kc(v==null||(G=v.getSelection())===null||G===void 0?void 0:G.toString()),T=e.type||"clipboard";if(!X)return!1;D.$selected_content=X,D.$copy_type=T}return this.instance.capture(i,D),!0}}}},{key:"isBrowserSupported",value:function(){return Qe(A?.querySelectorAll)}}]),n}(),Bd=function(){function n(e){var t=this;W(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){O(t._restoreXHRPatch)&&te.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),O(t._restoreFetchPatch)&&te.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return V(n,[{key:"_loadScript",value:function(e){te.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(Ye.LIB_VERSION),function(t){if(t)return _.error("[TRACING-HEADERS] failed to load script",t);e()})}},{key:"startIfEnabledOrStop",value:function(){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)}}]),n}();(function(n){n[n.PENDING=-1]="PENDING",n[n.DENIED=0]="DENIED",n[n.GRANTED=1]="GRANTED"})(Ut||(Ut={}));var Hd=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Ut.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Ut.DENIED||this.consent===Ut.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return e==="1"?Ut.GRANTED:e==="0"?Ut.DENIED:Ut.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?fe:Et;var t=e==="localStorage"?Et: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}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!sc([lt?.doNotTrack,lt?.msDoNotTrack,te.doNotTrack],function(e){return B([!0,1,"1","yes"],e)})}}]),n}(),Gr="[Exception Autocapture]",zd=function(){function n(e){var t,i=this;W(this,n),y(this,"originalOnUnhandledRejectionHandler",void 0),y(this,"startCapturing",function(){if(v&&i.isEnabled&&!i.hasHandlers&&!i.isCapturing){var r=v.posthogErrorWrappingFunctions.wrapOnError,s=v.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(r&&s)try{i.unwrapOnError=r(i.captureException.bind(i)),i.unwrapUnhandledRejection=s(i.captureException.bind(i))}catch(o){_.error(Gr+" failed to start",o),i.stopCapturing()}else _.error(Gr+" failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[vu]),this.startIfEnabled()}return V(n,[{key:"isEnabled",get:function(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}},{key:"isCapturing",get:function(){var e;return!(v==null||(e=v.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(_.info(Gr+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript("/static/exception-autocapture.js?v=".concat(Ye.LIB_VERSION),function(t){if(t)return _.error(Gr+" failed to load script",t);e()})}},{key:"stopCapturing",value:function(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register(y({},vu,this.remoteEnabled)),this.startIfEnabled()}},{key:"captureException",value:function(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)}}]),n}(),Ju=9e5,ln="[Web Vitals]",Wd=function(){function n(e){var t,i=this;W(this,n),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),y(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),y(this,"_flushToCapture",function(){clearTimeout(i._delayedFlushTimer),i.buffer.metrics.length!==0&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce(function(r,s){var o;return S(S({},r),{},(y(o={},"$web_vitals_".concat(s.name,"_event"),S({},s)),y(o,"$web_vitals_".concat(s.name,"_value"),s.value),o))},{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),y(this,"_addToBuffer",function(r){var s,o=(s=i.instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0);if(O(o))_.error(ln+"Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=i._currentURL();O(a)||(Pe(r?.name)||Pe(r?.value)?_.error(ln+"Invalid metric received",r):i._maxAllowedValue&&r.value>=i._maxAllowedValue?_.error(ln+"Ignoring metric with value >= "+i._maxAllowedValue,r):(i.buffer.url!==a&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,8e3)),O(i.buffer.url)&&(i.buffer.url=a),i.buffer.firstMetricTimestamp=O(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,i.buffer.metrics.push(S(S({},r),{},{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),i.buffer.metrics.length===i.allowedMetrics.length&&i._flushToCapture()))}}),y(this,"_startCapturing",function(){var r,s,o,a,l=te.__PosthogExtensions__;if(!O(l)){var u=l.postHogWebVitalsCallbacks;r=u.onLCP,s=u.onCLS,o=u.onFCP,a=u.onINP}r&&s&&o&&a?(i.allowedMetrics.indexOf("LCP")>-1&&r(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("CLS")>-1&&s(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("FCP")>-1&&o(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("INP")>-1&&a(i._addToBuffer.bind(i)),i._initialized=!0):_.error(ln+"web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[mu]),this.startIfEnabled()}return V(n,[{key:"allowedMetrics",get:function(){var e,t,i=he(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(i)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[yu])||["CLS","FCP","INP","LCP"]:i}},{key:"_maxAllowedValue",get:function(){var e=he(this.instance.config.capture_performance)&&Ke(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Ju;return 0<e&&e<=6e4?Ju:e}},{key:"isEnabled",get:function(){var e=he(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return un(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(_.info(ln+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=he(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=he(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register(y({},mu,t)),this.instance.persistence.register(y({},yu,i))),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){var t;(t=te.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript("/static/web-vitals.js?v=".concat(Ye.LIB_VERSION),function(i){i?_.error(ln+" failed to load script",i):e()})}},{key:"_currentURL",value:function(){var e=v?v.location.href:void 0;return e||_.error(ln+"Could not determine current URL"),e}}]),n}(),Yu="/e/",Vd=function(){function n(e){var t;W(this,n),this.instance=e,this._endpointSuffix=((t=this.instance.persistence)===null||t===void 0?void 0:t.props[gu])||Yu}return V(n,[{key:"endpoint",get:function(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this._endpointSuffix=he(t)&&t.endpoint||Yu,this.instance.persistence&&this.instance.persistence.register(y({},gu,this._endpointSuffix))}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}]),n}(),Oi={},Ku=function(){},Dn="posthog",jc=!kd&&_e?.indexOf("MSIE")===-1&&_e?.indexOf("Mozilla")===-1,Qu=function(){var n,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=A?.location,t=e?.hostname,!!Ce(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Ku,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Ne&&Ce(Ne?.search)&&Ne.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(n=v.location)===null||n===void 0?void 0:n.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:function(i){var r="Bad HTTP status: "+i.statusCode+" "+i.text;_.error(r)},get_device_id:function(i){return i},_onCapture:Ku,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},Zu=function(n){var e={};O(n.process_person)||(e.person_profiles=n.process_person),O(n.xhr_headers)||(e.request_headers=n.xhr_headers),O(n.cookie_name)||(e.persistence_name=n.cookie_name),O(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Re({},e,n);return de(n.property_blacklist)&&(O(n.property_denylist)?t.property_denylist=n.property_blacklist:de(n.property_denylist)?t.property_denylist=[].concat(St(n.property_blacklist),St(n.property_denylist)):_.error("Invalid value for property_denylist config: "+n.property_denylist)),t},Gd=function(){function n(){W(this,n),y(this,"__forceAllowLocalhost",!1)}return V(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){_.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),qc=function(){function n(){var e=this;W(this,n),y(this,"webPerformance",new Gd),y(this,"version",Ye.LIB_VERSION),y(this,"_internalEventEmitter",new Lc),this.config=Qu(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ad,this.sentryIntegration=function(t){return function(i,r){var s=Mc(i,r);return{name:Dc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this.featureFlags=new Sf(this),this.toolbar=new fd(this),this.scrollManager=new qd(this),this.pageViewManager=new Rd(this),this.surveys=new Od(this),this.exceptions=new Vd(this),this.rateLimiter=new Dd(this),this.requestRouter=new Id(this),this.consent=new Hd(this),this.people={set:function(t,i,r){var s=Ce(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Ce(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return _.info("send",t)})}return V(n,[{key:"init",value:function(e,t,i){if(i&&i!==Dn){var r,s=(r=Oi[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),Oi[i]=s,Oi[Dn][i]=s,s}return this._init(e,t,i)}},{key:"_init",value:function(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(O(e)||lu(e))return _.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 _.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Re({},Qu(),Zu(s),{name:o,token:e})),this.config.on_xhr_error&&_.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:at.GZipJS,this.persistence=new ko(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new ko(S(S({},this.config),{},{persistence:"sessionStorage"}));var a=S({},this.persistence.props),l=S({},this.sessionPersistence.props);if(this._requestQueue=new dd(function(C){return r._send_retriable_request(C)}),this._retryQueue=new $d(this),this.__request_queue=[],this.sessionManager=new Cd(this.config,this.persistence),this.sessionPropsManager=new Ld(this.sessionManager,this.persistence),new Bd(this).startIfEnabledOrStop(),this.sessionRecording=new ud(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Ud(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new jd(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Wd(this),this.exceptionObserver=new zd(this),this.exceptionObserver.startIfEnabled(),Ye.DEBUG=Ye.DEBUG||this.config.debug,Ye.DEBUG&&_.info("Starting in debug mode",{this:this,config:s,thisC:S({},this.config),p:a,s:l}),this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var u,c,p=this.config.get_device_id(Bt()),f=(u=s.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?p:s.bootstrap.distinctID;this.persistence.set_property(wt,(c=s.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var d,g,m=Object.keys(((d=s.bootstrap)===null||d===void 0?void 0:d.featureFlags)||{}).filter(function(C){var M,D;return!((M=s.bootstrap)===null||M===void 0||(D=M.featureFlags)===null||D===void 0||!D[C])}).reduce(function(C,M){var D,U;return C[M]=((D=s.bootstrap)===null||D===void 0||(U=D.featureFlags)===null||U===void 0?void 0:U[M])||!1,C},{}),E=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(function(C){return m[C]}).reduce(function(C,M){var D,U,G,X;return(D=s.bootstrap)!==null&&D!==void 0&&(U=D.featureFlagPayloads)!==null&&U!==void 0&&U[M]&&(C[M]=(G=s.bootstrap)===null||G===void 0||(X=G.featureFlagPayloads)===null||X===void 0?void 0:X[M]),C},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:E})}if(!this.get_distinct_id()){var L=this.config.get_device_id(Bt());this.register_once({distinct_id:L,$device_id:L},""),this.persistence.set_property(wt,"anonymous")}return v==null||(i=v.addEventListener)===null||i===void 0||i.call(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?Td(this,function(){return r._loaded()}):this._loaded(),Qe(this.config._onCapture)&&this.on("eventCaptured",function(C){return r.config._onCapture(C.event,C)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o,a,l,u;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=B(e.supportedCompression,at.GZipJS)?at.GZipJS:B(e.supportedCompression,at.Base64)?at.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(i=this.sessionRecording)===null||i===void 0||i.afterDecideResponse(e),(r=this.autocapture)===null||r===void 0||r.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.afterDecideResponse(e),(l=this.exceptions)===null||l===void 0||l.afterDecideResponse(e),(u=this.exceptionObserver)===null||u===void 0||u.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(i){_.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){e.consent.isOptedIn()&&e._captureInitialPageview()},1),t||(new cd(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Nn(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){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"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(jc?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=us(e.url,{ip:this.config.ip?1:0}),e.headers=S({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=S({},i);a.timeout=a.timeout||6e4,a.url=us(a.url,{_:new Date().getTime().toString(),ver:Ye.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",u=(s=(o=sc(Fi,function(c){return c.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Fi[0].method;if(!u)throw new Error("No available transport method");u(a)}(S(S({},e),{},{callback:function(i){var r,s,o;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&((s=(o=t.config).on_request_error)===null||s===void 0||s.call(o,i)),(r=e.callback)===null||r===void 0||r.call(e,i)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,i=this,r=[],s=[],o=[];Nn(e,function(l){l&&(t=l[0],de(t)?o.push(l):Qe(l)?l.call(i):de(l)&&t==="alias"?r.push(l):de(l)&&t.indexOf("capture")!==-1&&Qe(i[t])?o.push(l):s.push(l))});var a=function(l,u){Nn(l,function(c){if(de(c[0])){var p=u;Q(c,function(f){p=p[f[0]].apply(p,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};a(r,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){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}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!O(e)&&Ce(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=i?.timestamp||o,l={uuid:Bt(),event:e,properties:this._calculate_event_properties(e,t||{},a)};s&&(l.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(l.$set=i?.$set);var u=this._calculate_set_once_properties(i?.$set_once);u&&(l.$set_once=u),(l=wf(l,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,O(i?.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=o);var c=S(S({},l.properties.$set),l.$set);Xr(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit("eventCaptured",l);var p={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),l}_.critical("This capture call is ignored due to client rate limiting.")}}else _.error("No event name provided to posthog.capture")}else _.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=S({},t);if(s.token=this.config.token,e==="$snapshot"){var o=S(S({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ce(s.distinct_id)&&!Ke(s.distinct_id)||lu(s.distinct_id))&&_.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var a=be.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),u=l.sessionId,c=l.windowId;s.$session_id=u,s.$window_id=c}if(this.requestRouter.region===cn.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 p=this.sessionPropsManager.getSessionProps();s=Re(s,p)}if(!this.config.disable_scroll_properties){var f={};e==="$pageview"?f=this.pageViewManager.doPageView(i):e==="$pageleave"&&(f=this.pageViewManager.doPageLeave(i)),s=Re(s,f)}if(e==="$pageview"&&A&&(s.title=A.title),!O(r)){var d=i.getTime()-r;s.$duration=parseFloat((d/1e3).toFixed(3))}_e&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Re({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),de(this.config.property_denylist)?Q(this.config.property_denylist,function(m){delete s[m]}):_.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;return g&&(s=g(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Re({},this.persistence.get_initial_props(),e||{});return Xr(t)?void 0:t}},{key:"register",value:function(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,t,i)}},{key:"register_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}},{key:"unregister",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(y({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"renderSurvey",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:"canRenderSurvey",value:function(e){this.surveys.canRenderSurvey(e)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return _.uninitializedWarning("posthog.identify");if(Ke(e)&&(e=e.toString(),_.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()))_.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 r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(Ci)&&(this.unregister(Ci),this.register({distinct_id:e}));var o=(this.persistence.get_property(wt)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(wt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(es))}}else _.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:S(S({},r),{},y({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(y({},e,i))),r[e]===t||i||this.reloadFeatureFlags()}}else _.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,i,r,s;if(_.info("reset"),!this.__loaded)return _.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(r=this.persistence)===null||r===void 0||r.set_property(wt,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(Bt());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionId,r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(e!=null&&e.withTimestamp&&r){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);s+="?t=".concat(l)}return s}},{key:"alias",value:function(e,t){return e===this.get_property(oc)?(_.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(Ci,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(_.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,i,r,s,o=S({},this.config);he(e)&&(Re(this.config,Zu(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new ko(S(S({},this.config),{},{persistence:"sessionStorage"})),fe.is_supported()&&fe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Ye.DEBUG=!0,_.info("set_config",{config:e,oldConfig:o,newConfig:S({},this.config)})),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){var t,i=un(e)&&e;if(i||e!=null&&e.sampling){var r,s,o=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId();(s=this.persistence)===null||s===void 0||s.register(y({},Ti,!0)),_.info("Session recording started with sampling override for session: ",o?.sessionId)}(i||e!=null&&e.linked_flag)&&((t=this.sessionRecording)===null||t===void 0||t.overrideLinkedFlag(),_.info("Session recording started with linked_flags override")),this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"captureException",value:function(e,t){var i=Qe(te.parseErrorAsProperties)?te.parseErrorAsProperties([e.message,void 0,void 0,void 0,e]):S({$exception_type:e.name,$exception_message:e.message,$exception_level:"error"},t);this.exceptions.sendExceptionEvent(i)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Dn;return t!==Dn&&(t=Dn+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(wt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(wt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Xr(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[Ci])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[ts]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(_.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(ts,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,r,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==a&&((i=this.persistence)===null||i===void 0||i.set_disabled(a)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(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()}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"_is_bot",value:function(){return lt?function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&Gu(i,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some(function(s){return Gu(s?.brand,t)}))return!0}catch{}return!!e.webdriver}(lt,this.config.custom_blocked_useragents):void 0}},{key:"_captureInitialPageview",value:function(){A&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:A.title},{send_instantly:!0}))}},{key:"debug",value:function(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}))}}]),n}();(function(n,e){for(var t=0;t<e.length;t++)n.prototype[e[t]]=bf(n.prototype[e[t]])})(qc,["identify"]);var ec,Uc=(ec=Oi[Dn]=new qc,function(){function n(){n.done||(n.done=!0,jc=!1,Q(Oi,function(e){e._dom_loaded()}))}A!=null&&A.addEventListener&&(A.readyState==="complete"?n():A.addEventListener("DOMContentLoaded",n,!1)),v&&kt(v,"load",n,!0)}(),ec);var Bc=Uc.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(n,e){if(!Bc)throw new Error("Failed to initialize PostHog");Bc.capture(n,e)}var hs,Bi,vs,Wt,zc,ds,qi=class qi extends z(q){constructor(){super();b(this,Wt);b(this,hs,new Nt(this,{onError:console.error}));b(this,Bi);b(this,vs,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Oe("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>Oe("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>Oe("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>Oe("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>Oe("ShopAssistant: user clicked link",t),onUserSentInput:t=>Oe("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return h(this,Bi)||h(this,hs).data}render(){return this.config?P`
356
+ `)).length,r=0;r<i;r++){var o=n.charCodeAt(r),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Ct(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},St=function(){function n(e){return e&&(e.preventDefault=n.preventDefault,e.stopPropagation=n.stopPropagation),e}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,r,s){if(e)if(e.addEventListener&&!r)e.addEventListener(t,i,!!s);else{var o="on"+t,a=e[o];e[o]=function(l,u,c){return function(p){if(p=p||n(v?.event)){var f,d=!0;Qe(c)&&(f=c(p));var g=u.call(l,p);return f!==!1&&g!==!1||(d=!1),d}}}(e,i,a)}else _.error("No valid element provided to register_event")}}();function ic(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return n[t]}(function(n){n.GZipJS="gzip-js",n.Base64="base64"})(lt||(lt={}));var rc="$people_distinct_id",wi="__alias",xi="__timers",fu="$autocapture_disabled_server_side",Ao="$heatmaps_enabled_server_side",du="$exception_capture_enabled_server_side",hu="$exception_capture_endpoint_suffix",vu="$web_vitals_enabled_server_side",gu="$web_vitals_allowed_metrics",To="$session_recording_enabled_server_side",mu="$console_log_recording_enabled_server_side",yu="$session_recording_network_payload_capture",_u="$session_recording_canvas_recording",bu="$replay_sample_rate",wu="$replay_minimum_duration",zr="$sesid",Si="$session_is_sampled",Mn="$enabled_feature_flags",Ro="$early_access_features",Dn="$stored_person_properties",Nt="$stored_group_properties",Po="$surveys",Tr="$surveys_activated",Wr="$flag_call_reported",xt="$user_state",Oo="$client_session_props",Fo="$capture_rate_limit",Mo="$initial_campaign_params",Do="$initial_referrer_info",xu="$initial_person_info",Vr="$epp",Lo="__POSTHOG_TOOLBAR__",bf=[rc,wi,"__cmpns",xi,To,Ao,zr,Mn,xt,Ro,Nt,Dn,Po,Wr,Oo,Fo,Mo,Do,Vr],vo="$active_feature_flags",Rr="$override_feature_flags",ku="$feature_flag_payloads",Su=function(n){var e,t={},i=et(qr(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Re(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},wf=function(){function n(e){W(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return V(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Mn),t=this.instance.get_property(Rr);if(!t)return e||{};for(var i=Pe({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(_.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ku)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,i=this.instance.get_property(Dn),r=this.instance.get_property(Nt),s={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,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:s,compression:this.instance.config.disable_compression?void 0:lt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var a;e.setReloadingPaused(!1);var l=!0;o.statusCode===200&&(e.$anon_distinct_id=void 0,l=!1),e.receivedFeatureFlags((a=o.json)!==null&&a!==void 0?a:{},l),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,r=this.getFlagVariants()[e],s="".concat(r),o=this.instance.get_property(Wr)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(de(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(y({},Wr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}_.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(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);_.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();(function(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s.featureFlags,p=s.featureFlagPayloads;if(c)if(de(c)){var f,d={};if(c)for(var g=0;g<c.length;g++)d[c[g]]=!0;o&&o.register((y(f={},vo,c),y(f,Mn,d),f))}else{var m=c,E=p;s.errorsWhileComputingFlags&&(m=k(k({},l),m),E=k(k({},u),E)),o&&o.register((y(a={},vo,Object.keys(Su(m))),y(a,Mn,m||{}),y(a,ku,E||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return _.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(Rr);else if(de(e)){for(var i={},r=0;r<e.length;r++)i[e[r]]=!0;this.instance.persistence.register(y({},Rr,i))}else this.instance.persistence.register(y({},Rr,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),r=i.flags,s=i.flagVariants;e(r,s)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,r,s=y({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=k(k({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},vo,Object.keys(Su(o))),y(r,Mn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(Ro);if(r&&!i)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:function(s){var o;if(s.json){var a=s.json.earlyAccessFeatures;return(o=t.instance.persistence)===null||o===void 0||o.register(y({},Ro,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(i){return t[i]}),flagVariants:Object.keys(t).filter(function(i){return t[i]}).reduce(function(i,r){return i[r]=t[r],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(i,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Dn)||{};this.instance.register(y({},Dn,k(k({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Dn)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Nt)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=k(k({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},Nt,k(k({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Nt)||{};this.instance.register(y({},Nt,k(k({},t),{},y({},e,{}))))}else this.instance.unregister(Nt)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return Ke(n)&&isFinite(n)&&Math.floor(n)===n});var Eu="0123456789abcdef",xf=function(){function n(e){if(W(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return V(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Eu.charAt(this.bytes[t]>>>4)+Eu.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}},{key:"clone",value:function(){return new n(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new n(s)}}]),n}(),kf=function(){function n(){W(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new Sf)}return V(n,[{key:"generate",value:function(){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}},{key:"generateOrAbort",value:function(){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 xf.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),n}(),sc=function(n){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<n.length;e++)n[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};v&&!O(v.crypto)&&crypto.getRandomValues&&(sc=function(n){return crypto.getRandomValues(n)});var $u,Sf=function(){function n(){W(this,n),y(this,"buffer",new Uint32Array(8)),y(this,"cursor",1/0)}return V(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(sc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),qt=function(){return Ef().toString()},Ef=function(){return($u||($u=new kf)).generate()},$f="Thu, 01 Jan 1970 00:00:00 GMT",mi="",Cf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function If(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T;if(mi)return mi;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+qt(),u=new RegExp("(^|;)\\s*"+l+"=1");!mi&&a--;){var c=o.slice(a).join("."),p=l+"=1;domain=."+c;s.cookie=p,u.test(s.cookie)&&(s.cookie=p+";expires="+$f,mi=c)}return mi}(n);if(!t){var i=function(r){var s=r.match(Cf);return s?s[0]:""}(n);i!==t&&_.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var xe,$t={is_supported:function(){return!!T},error:function(n){_.error("cookieStore error: "+n)},get:function(n){if(T){try{for(var e=n+"=",t=T.cookie.split(";").filter(function(s){return s.length}),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},parse:function(n){var e;try{e=JSON.parse($t.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(T)try{var s="",o="",a=If(T.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),s="; expires="+l.toUTCString()}r&&(o="; secure");var u=n+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&_.warn("cookieStore warning: large cookie, len="+u.length),T.cookie=u,u}catch{return}},remove:function(n,e){try{$t.set(n,"",-1,e)}catch{return}}},go=null,fe={is_supported:function(){if(!Ct(go))return go;var n=!0;if(O(v))n=!1;else try{var e="__mplssupport__";fe.set(e,"xyz"),fe.get(e)!=='"xyz"'&&(n=!1),fe.remove(e)}catch{n=!1}return n||_.error("localStorage unsupported; falling back to cookie store"),go=n,n},error:function(n){_.error("localStorage error: "+n)},get:function(n){try{return v?.localStorage.getItem(n)}catch(e){fe.error(e)}return null},parse:function(n){try{return JSON.parse(fe.get(n))||{}}catch{}return null},set:function(n,e){try{v?.localStorage.setItem(n,JSON.stringify(e))}catch(t){fe.error(t)}},remove:function(n){try{v?.localStorage.removeItem(n)}catch(e){fe.error(e)}}},Af=["distinct_id",zr,Si,Vr],Pr=k(k({},fe),{},{parse:function(n){try{var e={};try{e=$t.parse(n)||{}}catch{}var t=Pe(e,JSON.parse(fe.get(n)||"{}"));return fe.set(n,t),t}catch{}return null},set:function(n,e,t,i,r,s){try{fe.set(n,e,void 0,void 0,s);var o={};Af.forEach(function(a){e[a]&&(o[a]=e[a])}),Object.keys(o).length&&$t.set(n,o,t,i,r,s)}catch(a){fe.error(a)}},remove:function(n,e){try{v?.localStorage.removeItem(n),$t.remove(n,e)}catch(t){fe.error(t)}}}),Or={},Tf={is_supported:function(){return!0},error:function(n){_.error("memoryStorage error: "+n)},get:function(n){return Or[n]||null},parse:function(n){return Or[n]||null},set:function(n,e){Or[n]=e},remove:function(n){delete Or[n]}},ln=null,ke={is_supported:function(){if(!Ct(ln))return ln;if(ln=!0,O(v))ln=!1;else try{var n="__support__";ke.set(n,"xyz"),ke.get(n)!=='"xyz"'&&(ln=!1),ke.remove(n)}catch{ln=!1}return ln},error:function(n){_.error("sessionStorage error: ",n)},get:function(n){try{return v?.sessionStorage.getItem(n)}catch(e){ke.error(e)}return null},parse:function(n){try{return JSON.parse(ke.get(n))||null}catch{}return null},set:function(n,e){try{v?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){ke.error(t)}},remove:function(n){try{v?.sessionStorage.removeItem(n)}catch(e){ke.error(e)}}},Rf=["localhost","127.0.0.1"],Ei=function(n){var e=T?.createElement("a");return O(e)?null:(e.href=n,e)},Gr=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},Pf=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Q(n,function(s,o){O(s)||O(o)||o==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(s)?s.name:s.toString()),t=encodeURIComponent(o),r[r.length]=t+"="+e)}),r.join(i)},Cu=function(n,e){for(var t,i=((n.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){t=s;break}}if(!de(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{_.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Xr=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Ze="Mobile",Jr="iOS",ft="Android",Ti="Tablet",oc=ft+" "+Ti,ac="iPad",lc="Apple",uc=lc+" Watch",Ri="Safari",Un="BlackBerry",cc="Samsung",pc=cc+"Browser",fc=cc+" Internet",Ut="Chrome",Of=Ut+" OS",dc=Ut+" "+Jr,Ko="Internet Explorer",hc=Ko+" "+Ze,Qo="Opera",Ff=Qo+" Mini",Zo="Edge",vc="Microsoft "+Zo,Nn="Firefox",gc=Nn+" "+Jr,Pi="Nintendo",Oi="PlayStation",jn="Xbox",mc=ft+" "+Ze,yc=Ze+" "+Ri,ki="Windows",No=ki+" Phone",Iu="Nokia",jo="Ouya",_c="Generic",Mf=_c+" "+Ze.toLowerCase(),bc=_c+" "+Ti.toLowerCase(),qo="Konqueror",Te="(\\d+(\\.\\d+)?)",mo=new RegExp("Version/"+Te),Df=new RegExp(jn,"i"),Lf=new RegExp(Oi+" \\w+","i"),Nf=new RegExp(Pi+" \\w+","i"),ea=new RegExp(Un+"|PlayBook|BB10","i"),jf={"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"},qf=function(n,e){return e&&B(e,lc)||function(t){return B(t,Ri)&&!B(t,Ut)&&!B(t,ft)}(n)},Au=function(n,e){return e=e||"",B(n," OPR/")&&B(n,"Mini")?Ff:B(n," OPR/")?Qo:ea.test(n)?Un:B(n,"IE"+Ze)||B(n,"WPDesktop")?hc:B(n,pc)?fc:B(n,Zo)||B(n,"Edg/")?vc:B(n,"FBIOS")?"Facebook "+Ze:B(n,"UCWEB")||B(n,"UCBrowser")?"UC Browser":B(n,"CriOS")?dc:B(n,"CrMo")?Ut:B(n,ft)&&B(n,Ri)?mc:B(n,Ut)?Ut:B(n,"FxiOS")?gc:B(n.toLowerCase(),qo.toLowerCase())?qo:qf(n,e)?B(n,Ze)?yc:Ri:B(n,Nn)?Nn:B(n,"MSIE")||B(n,"Trident/")?Ko:B(n,"Gecko")?Nn:""},Uf=(y(xe={},hc,[new RegExp("rv:"+Te)]),y(xe,vc,[new RegExp(Zo+"?\\/"+Te)]),y(xe,Ut,[new RegExp("("+Ut+"|CrMo)\\/"+Te)]),y(xe,dc,[new RegExp("CriOS\\/"+Te)]),y(xe,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Te)]),y(xe,Ri,[mo]),y(xe,yc,[mo]),y(xe,Qo,[new RegExp("(Opera|OPR)\\/"+Te)]),y(xe,Nn,[new RegExp(Nn+"\\/"+Te)]),y(xe,gc,[new RegExp("FxiOS\\/"+Te)]),y(xe,qo,[new RegExp("Konqueror[:/]?"+Te,"i")]),y(xe,Un,[new RegExp(Un+" "+Te),mo]),y(xe,mc,[new RegExp("android\\s"+Te,"i")]),y(xe,fc,[new RegExp(pc+"\\/"+Te)]),y(xe,Ko,[new RegExp("(rv:|MSIE )"+Te)]),y(xe,"Mozilla",[new RegExp("rv:"+Te)]),xe),Tu=[[new RegExp(jn+"; "+jn+" (.*?)[);]","i"),function(n){return[jn,n&&n[1]||""]}],[new RegExp(Pi,"i"),[Pi,""]],[new RegExp(Oi,"i"),[Oi,""]],[ea,[Un,""]],[new RegExp(ki,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[No,""];if(new RegExp(Ze).test(e)&&!/IEMobile\b/.test(e))return[ki+" "+Ze,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=jf[i]||"";return/arm/i.test(e)&&(r="RT"),[ki,r]}return[ki,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[Jr,e.join(".")]}return[Jr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=O(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+ft+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ft+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[ft,e.join(".")]}return[ft,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(n){var e=["Mac OS X",""];if(n&&n[1]){var t=[n[1],n[2],n[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Of,""]],[/Linux|debian/i,["Linux",""]]],Ru=function(n){return Nf.test(n)?Pi:Lf.test(n)?Oi:Df.test(n)?jn:new RegExp(jo,"i").test(n)?jo:new RegExp("("+No+"|WPDesktop)","i").test(n)?No:/iPad/.test(n)?ac:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?uc:ea.test(n)?Un:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(Iu,"i").test(n)?Iu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(Ze).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?ft:oc:ft:new RegExp("(pda|"+Ze+")","i").test(n)?Mf:new RegExp(Ti,"i").test(n)&&!new RegExp(Ti+" pc","i").test(n)?bc:""},Fr="https?://(.*)",Bf=["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"],be={campaignParams:function(n){return T?this._campaignParamsFromUrl(T.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=Bf.concat(e||[]),i={};return Q(t,function(r){var s=Cu(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Fr+"google.([^/?]*)")===0?"google":n.search(Fr+"bing.com")===0?"bing":n.search(Fr+"yahoo.com")===0?"yahoo":n.search(Fr+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=be._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!Ct(e)){i.$search_engine=e;var r=T?Cu(T.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=T?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:Au,browserVersion:function(n,e){var t=Au(n,e),i=Uf[t];if(O(i))return null;for(var r=0;r<i.length;r++){var s=i[r],o=n.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(var e=0;e<Tu.length;e++){var t=Re(Tu[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(Qe(r)?r(s,n):r);if(o)return o}return["",""]},device:Ru,deviceType:function(n){var e=Ru(n);return e===ac||e===oc||e==="Kobo"||e==="Kindle Fire"||e===bc?Ti:e===Pi||e===jn||e===Oi||e===jo?"Console":e===uc?"Wearable":e?Ze:"Desktop"},referrer:function(){return T?.referrer||"$direct"},referringDomain:function(){var n;return T!=null&&T.referrer&&((n=Ei(T.referrer))===null||n===void 0?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:je?.href}},initialPersonPropsFromInfo:function(n){var e,t=n.r,i=n.u,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Ei(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=Ei(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,Q(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+Io(a)]=o})}return t&&Q(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+Io(a)]=o}),r},properties:function(){if(!_e)return{};var n=Re(be.os(_e),2),e=n[0],t=n[1];return Pe(Co({$os:e,$os_version:t,$browser:be.browser(_e,navigator.vendor),$device:be.device(_e),$device_type:be.deviceType(_e)}),{$current_url:je?.href,$host:je?.host,$pathname:je?.pathname,$raw_user_agent:_e.length>1e3?_e.substring(0,997)+"...":_e,$browser_version:be.browserVersion(_e,navigator.vendor),$browser_language:be.browserLanguage(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:Ye.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:nc()/1e3})},people_properties:function(){if(!_e)return{};var n=Re(be.os(_e),2),e=n[0],t=n[1];return Pe(Co({$os:e,$os_version:t,$browser:be.browser(_e,navigator.vendor)}),{$browser_version:be.browserVersion(_e,navigator.vendor)})}},Hf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],yo=function(){function n(e){W(this,n),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(t){var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"}(e),this.storage=this.buildStorage(e),this.load(),e.debug&&_.info("Persistence loaded",e.persistence,k({},this.props)),this.update_config(e,e),this.save()}return V(n,[{key:"buildStorage",value:function(e){Hf.indexOf(e.persistence.toLowerCase())===-1&&(_.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"&&Pr.is_supported()?Pr:t==="sessionstorage"&&ke.is_supported()?ke:t==="memory"?Tf:t==="cookie"?$t:Pr.is_supported()?Pr:$t}},{key:"properties",value:function(){var e={};return Q(this.props,function(t,i){if(i===Mn&&he(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else a=i,l=!1,(Ct(o=bf)?l:lu&&o.indexOf===lu?o.indexOf(a)!=-1:(Q(o,function(u){if(l||(l=u===a))return Hr}),l))||(e[i]=t);var o,a,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Pe({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,i){var r=this;if(he(e)){O(t)&&(t="None"),this.expire_days=O(i)?this.default_expiry:i;var s=!1;if(Q(e,function(o,a){r.props.hasOwnProperty(a)&&r.props[a]!==t||(r.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(he(e)){this.expire_days=O(t)?this.default_expiry:t;var r=!1;if(Q(e,function(s,o){e.hasOwnProperty(o)&&i.props[o]!==s&&(i.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(be.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(be.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once(be.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[Mo]||this.props[Do]||this.register_once(y({},xu,be.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Co({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Q([Do,Mo],function(s){var o=e.props[s];o&&Q(o,function(a,l){t["$initial_"+Io(l)]=a})});var i=this.props[xu];if(i){var r=be.initialPersonPropsFromInfo(i);Pe(t,r)}return t}},{key:"safe_merge",value:function(e){return Q(this.props,function(t,i){i in e||(e[i]=t)}),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.buildStorage(e),r=this.props;this.clear(),this.storage=i,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var i=this.props[xi]||{};i[e]=t,this.props[xi]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[xi]||{})[e];return O(t)||(delete this.props[xi][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),n}();function Uo(n){return JSON.stringify(n,(e=[],function(t,i){if(he(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i})).length;var e}var zf=2,Wf=4;function Bo(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(n.size>=e&&n.data.length>1){var t=Math.floor(n.data.length/2),i=n.data.slice(0,t),r=n.data.slice(t);return[Bo({size:Uo(i),data:i,sessionId:n.sessionId,windowId:n.windowId}),Bo({size:Uo(r),data:r,sessionId:n.sessionId,windowId:n.windowId})].flatMap(function(s){return s})}return[n]}var Ur=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(Ur||{}),wt=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(wt||{});function ta(n){return n?is(n).split(/\s+/):[]}function Pu(n){var e=v?.location.href;return!!(e&&n&&n.some(function(t){return e.match(t)}))}function Yr(n){var e="";switch(Ai(n.className)){case"string":e=n.className;break;case"object":e=(n.className&&"baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return ta(e)}function wc(n){return Oe(n)?null:is(n).split(/(\s+)/).filter(function(e){return qn(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Kr(n){var e="";return zo(n)&&!Ec(n)&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;xc(t)&&t.textContent&&(e+=(i=wc(t.textContent))!==null&&i!==void 0?i:"")}),is(e)}function na(n){return!!n&&n.nodeType===1}function Bt(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function xc(n){return!!n&&n.nodeType===3}function kc(n){return!!n&&n.nodeType===11}var Ho=["a","button","form","input","select","textarea","label"];function Sc(n){var e=n.parentNode;return!(!e||!na(e))&&e}function Vf(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!v||!n||Bt(n,"html")||!na(n)||t!=null&&t.url_allowlist&&!Pu(t.url_allowlist)||t!=null&&t.url_ignorelist&&Pu(t.url_ignorelist))return!1;if(t!=null&&t.dom_event_allowlist){var s=t.dom_event_allowlist;if(s&&!s.some(function(d){return e.type===d}))return!1}for(var o=!1,a=[n],l=!0,u=n;u.parentNode&&!Bt(u,"body");)if(kc(u.parentNode))a.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=Sc(u)))break;if(i||Ho.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var c=v.getComputedStyle(l);c&&c.getPropertyValue("cursor")==="pointer"&&(o=!0)}a.push(l),u=l}if(!function(d,g){var m=g?.element_allowlist;if(O(m))return!0;var E,L=et(d);try{var I=function(){var F=E.value;if(m.some(function(q){return F.tagName.toLowerCase()===q}))return{v:!0}};for(L.s();!(E=L.n()).done;){var M=I();if(Ai(M)==="object")return M.v}}catch(F){L.e(F)}finally{L.f()}return!1}(a,t)||!function(d,g){var m=g?.css_selector_allowlist;if(O(m))return!0;var E,L=et(d);try{var I=function(){var F=E.value;if(m.some(function(q){return F.matches(q)}))return{v:!0}};for(L.s();!(E=L.n()).done;){var M=I();if(Ai(M)==="object")return M.v}}catch(F){L.e(F)}finally{L.f()}return!1}(a,t))return!1;var p=v.getComputedStyle(n);if(p&&p.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var f=n.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return o?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Ho.indexOf(f)>-1||n.getAttribute("contenteditable")==="true")}}function zo(n){for(var e=n;e.parentNode&&!Bt(e,"body");e=e.parentNode){var t=Yr(e);if(B(t,"ph-sensitive")||B(t,"ph-no-capture"))return!1}if(B(Yr(n),"ph-include"))return!0;var i=n.type||"";if(Ie(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Ie(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function Ec(n){return!!(Bt(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||Bt(n,"select")||Bt(n,"textarea")||n.getAttribute("contenteditable")==="true")}var $c="(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})",Gf=new RegExp("^(?:".concat($c,")$")),Xf=new RegExp($c),Cc="\\d{3}-?\\d{2}-?\\d{4}",Jf=new RegExp("^(".concat(Cc,")$")),Yf=new RegExp("(".concat(Cc,")"));function qn(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Oe(n)||Ie(n)&&(n=is(n),(e?Gf:Xf).test((n||"").replace(/[- ]/g,""))||(e?Jf:Yf).test(n)))}function Ou(n){var e=Kr(n);return qn(e="".concat(e," ").concat(Ic(n)).trim())?e:""}function Ic(n){var e="";return n&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=Kr(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(Ic(t)).trim())}catch(s){_.error(s)}}),e}function Kf(n){return function(e){var t=e.map(function(i){var r,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class){i.attr_class.sort();var a,l=et(i.attr_class);try{for(l.s();!(a=l.n()).done;){var u=a.value;o+=".".concat(u.replace(/"/g,""))}}catch(f){l.e(f)}finally{l.f()}}var c=k(k(k(k({},i.text?{text:i.text}:{}),{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),p={};return qr(c).sort(function(f,d){var g=Re(f,1)[0],m=Re(d,1)[0];return g.localeCompare(m)}).forEach(function(f){var d=Re(f,2),g=d[0],m=d[1];return p[Fu(g.toString())]=Fu(m.toString())}),o+=":",o+=qr(c).map(function(f){var d=Re(f,2),g=d[0],m=d[1];return"".concat(g,'="').concat(m,'"')}).join("")});return t.join(";")}(function(e){return e.map(function(t){var i,r,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:Qf(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return qr(t).filter(function(o){return Re(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Re(o,2),l=a[0],u=a[1];return s.attributes[l]=u}),s})}(n))}function Fu(n){return n.replace(/"|\\"/g,'\\"')}function Qf(n){var e=n.attr__class;return e?de(e)?e:ta(e):void 0}var Wo="[SessionRecording]",Vo="redacted",Mr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(n){return n},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},Zf=["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"],ed=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],td=["/s/","/e/","/i/"];function Mu(n,e,t,i){if(Oe(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Ie(r)&&(r=parseInt(r)),r>t?Wo+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function Du(n,e){if(Oe(n))return n;var t=n;return qn(t,!1)||(t=Wo+" "+e+" body "+Vo),Q(ed,function(i){var r,s;(r=t)!==null&&r!==void 0&&r.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=Wo+" "+e+" body "+Vo+" as might contain: "+i)}),t}var kt,nd=function(n,e){var t,i,r,s={payloadSizeLimitBytes:Mr.payloadSizeLimitBytes,performanceEntryTypeToObserve:Et(Mr.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(Et(e.payloadHostDenyList||[]),Et(Mr.payloadHostDenyList))},o=n.session_recording.recordHeaders!==!1&&e.recordHeaders,a=n.session_recording.recordBody!==!1&&e.recordBody,l=n.capture_performance!==!1&&e.recordPerformance,u=(t=s,r=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=Mu(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=Mu(f.responseBody,f.responseHeaders,r,"Response")),f}),c=function(f){return u(function(m){var E=Ei(m.name);if(!(E&&E.pathname&&td.some(function(L){return E.pathname.indexOf(L)===0})))return m}((g=(d=f).requestHeaders,Oe(g)||Q(Object.keys(g??{}),function(m){Zf.includes(m.toLowerCase())&&(g[m]=Vo)}),d)));var d,g},p=Qe(n.session_recording.maskNetworkRequestFn);return p&&Qe(n.session_recording.maskCapturedNetworkRequestFn)&&_.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(n.session_recording.maskCapturedNetworkRequestFn=function(f){var d=n.session_recording.maskNetworkRequestFn({url:f.name});return k(k({},f),{},{name:d?.url})}),s.maskRequestFn=Qe(n.session_recording.maskCapturedNetworkRequestFn)?function(f){var d,g,m,E=c(f);return E&&(d=(g=(m=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,E))!==null&&d!==void 0?d:void 0}:function(f){return function(d){if(!O(d))return d.requestBody=Du(d.requestBody,"Request"),d.responseBody=Du(d.responseBody,"Response"),d}(c(f))},k(k(k({},Mr),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},id=V(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};W(this,n),y(this,"bucketSize",100),y(this,"refillRate",10),y(this,"mutationBuckets",{}),y(this,"loggedTracker",{}),y(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(o){r.mutationBuckets[o]=r.mutationBuckets[o]+r.refillRate,r.mutationBuckets[o]>=r.bucketSize&&delete r.mutationBuckets[o]})}),y(this,"getNodeOrRelevantParent",function(o){var a=r.rrweb.mirror.getNode(o);if(a?.nodeName!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[r.rrweb.mirror.getId(l),l]}return[o,a]}),y(this,"numberOfChanges",function(o){var a,l,u,c,p,f,d,g;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((u=(c=o.attributes)===null||c===void 0?void 0:c.length)!==null&&u!==void 0?u:0)+((p=(f=o.texts)===null||f===void 0?void 0:f.length)!==null&&p!==void 0?p:0)+((d=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&d!==void 0?d:0)}),y(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var a=o.data,l=r.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(c){var p,f,d,g=Re(r.getNodeOrRelevantParent(c.id),2),m=g[0],E=g[1];return r.mutationBuckets[m]===0?!1:(r.mutationBuckets[m]=(p=r.mutationBuckets[m])!==null&&p!==void 0?p:r.bucketSize,r.mutationBuckets[m]=Math.max(r.mutationBuckets[m]-1,0),r.mutationBuckets[m]===0&&(r.loggedTracker[m]||(r.loggedTracker[m]=!0,(f=(d=r.options).onBlockedNode)===null||f===void 0||f.call(d,m,E))),c)}));var u=r.numberOfChanges(a);return u!==0||l===u?o:void 0}),this.rrweb=e,this.options=s,this.refillRate=(t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),rd=3e5,sd=[wt.MouseMove,wt.MouseInteraction,wt.Scroll,wt.ViewportResize,wt.Input,wt.TouchMove,wt.MediaInteraction,wt.Drag],Lu=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Je="[SessionRecording]",od=function(){function n(e){var t=this;if(W(this,n),y(this,"queuedRRWebEvents",[]),y(this,"isIdle",!1),y(this,"_linkedFlagSeen",!1),y(this,"_lastActivityTimestamp",Date.now()),y(this,"_linkedFlag",null),y(this,"_removePageViewCaptureHook",void 0),y(this,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_onBeforeUnload",function(){t._flushBuffer()}),y(this,"_onOffline",function(){t._tryAddCustomEvent("browser offline",{})}),y(this,"_onOnline",function(){t._tryAddCustomEvent("browser online",{})}),y(this,"_onVisibilityChange",function(){if(T!=null&&T.visibilityState){var o="window "+T.visibilityState;t._tryAddCustomEvent(o,{})}}),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw _.error(Je+" started without valid sessionManager"),new Error(Je+" started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,s=i.windowId;this.sessionId=r,this.windowId=s,this.buffer=this.clearBuffer(),this._setupSampling()}return V(n,[{key:"rrwebRecord",get:function(){var e;return te==null||(e=te.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Je+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.full_snapshot_interval_millis)||rd}},{key:"isSampled",get:function(){var e=this.instance.get_property(Si);return cn(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((t=this.buffer)===null||t===void 0?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(To),t=!this.instance.config.disable_session_recording;return v&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(mu),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(_u);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(yu),r={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=r?.recordHeaders||i?.recordHeaders,o=r?.recordBody||i?.recordBody,a=he(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,l=!!(cn(a)?a:i?.capturePerformance);return s||o||l?{recordHeaders:s,recordBody:o,recordPerformance:l}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(bu);return Ke(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(wu);return Ke(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Oe(this._linkedFlag)||this._linkedFlagSeen?cn(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){var e=this;this.isRecordingEnabled?(this._startCapture(),v?.addEventListener("beforeunload",this._onBeforeUnload),v?.addEventListener("offline",this._onOffline),v?.addEventListener("online",this._onOnline),v?.addEventListener("visibilitychange",this._onVisibilityChange),Oe(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(function(t){try{if(t==="$pageview"){var i=v?e._maskUrl(v.location.href):"";if(!i)return;e._tryAddCustomEvent("$pageview",{href:i})}}catch(r){_.error("Could not add $pageview to rrweb session",r)}})),_.info(Je+" started")):this.stopRecording()}},{key:"stopRecording",value:function(){var e;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,_.info(Je+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(Ke(r)){var s,o=this.isSampled,a=i||!cn(o);a?s=Math.random()<r:s=o,!s&&a&&_.warn(Je+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),(t=this.instance.persistence)===null||t===void 0||t.register(y({},Si,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},Si,null))}}},{key:"afterDecideResponse",value:function(e){var t,i,r,s=this;if(this._persistDecideResponse(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(r=e.sessionRecording)===null||r===void 0?void 0:r.endpoint),this._setupSampling(),!Oe(this._linkedFlag)&&!this._linkedFlagSeen){var o=Ie(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Ie(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,u){var c=he(u)&&o in u,p=a?u[o]===a:c;if(p){var f={linkedFlag:o,linkedVariant:a},d="linked flag matched";_.info(Je+" "+d,f),s._tryAddCustomEvent(d,f)}s._linkedFlagSeen=p})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Ke(this.sampleRate)&&Ct(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,i=function(){var r,s,o,a,l,u,c,p,f=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate,d=Oe(f)?null:parseFloat(f),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(p={},To,!!e.sessionRecording),y(p,mu,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(p,yu,k({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(p,_u,{enabled:(l=e.sessionRecording)===null||l===void 0?void 0:l.recordCanvas,fps:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasFps,quality:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasQuality}),y(p,bu,d),y(p,wu,O(g)?null:g),p))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:nc()})}},{key:"_startCapture",value:function(){var e=this;O(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(Ye.LIB_VERSION),function(t){if(t)return _.error(Je+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&sd.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=r.windowId,o=r.sessionId,a=this.sessionId!==o,l=this.windowId!==s;this.windowId=s,this.sessionId=o,(i||[zf,Wf].indexOf(e.type)===-1&&(l||a||O(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(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}):_.warn(Je+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(Lu(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Lu(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={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,s=0,o=Object.entries(r||{});s<o.length;s++){var a=Re(o[s],2),l=a[0],u=a[1];l in i&&(l==="maskInputOptions"?i.maskInputOptions=k({password:!0},u):i[l]=u)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new id(this.rrwebRecord,{onBlockedNode:function(p,f){var d="Too many mutations on node '".concat(p,"'. Rate limiting. This could be due to SVG animations or something similar");_.info(d,{node:f}),t.log(Je+" "+d,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(k({emit:function(p){t.onRRwebEmit(p)},plugins:c},i)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(function(p){return p?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else _.error(Je+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return te.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(te.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&Qe(te.getRecordNetworkPlugin)&&(!Rf.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(te.getRecordNetworkPlugin(nd(this.instance.config,this.networkPayloadCapture))):_.info(Je+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&he(e)){if(e.type===Ur.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Ur.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&he(l)&&l.type===6&&he(l.data)&&l.data.plugin==="rrweb/console@1"){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var u=[],c=0;c<l.data.payload.payload.length;c++)l.data.payload.payload[c]&&l.data.payload.payload[c].length>2e3?u.push(l.data.payload.payload[c].slice(0,2e3)+"...[truncated]"):u.push(l.data.payload.payload[c]);return l.data.payload.payload=u,a}return a}(i),s=Uo(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Ur.Custom){var o={$snapshot_bytes:s,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){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)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=Et(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt<=2e3&&e._tryRRWebMethod(i)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,r={url:e};return(i=r=t.maskNetworkRequestFn(r))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=Ke(i)&&i>=0,s=Ke(t)&&r&&i<t;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Bo(this.buffer).forEach(function(o){e._captureSnapshot({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId})}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,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(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}},{key:"overrideLinkedFlag",value:function(){this._linkedFlagSeen=!0}}]),n}(),ad=function(){function n(e){W(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return V(n,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Dn),group_properties:this.instance.get_property(Nt),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:function(i){return e.parseDecideResponse(i.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var i=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},i),i)_.error("Failed to fetch feature flags from PostHog.");else{if(!T||!T.body)return _.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r,s=et(e.siteApps);try{var o=function(){var a=r.value,l=a.id,u=a.url,c=t.instance.requestRouter.endpointFor("api",u);te["__$$ph_site_app_".concat(l)]=t.instance,t.instance.requestRouter.loadScript(c,function(p){if(p)return _.error("Error while initializing PostHog app with config id ".concat(l),p)})};for(s.s();!(r=s.n()).done;)o()}catch(a){s.e(a)}finally{s.f()}}else e.siteApps.length>0&&_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),ld=v!=null&&v.location?Xr(v.location.hash,"__posthog")||Xr(location.hash,"state"):null,Nu="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(kt||(kt={}));var ud=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"setToolbarState",value:function(e){te.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=te.ph_toolbar_state)!==null&&e!==void 0?e:kt.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=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||!T)return!1;i=(e=i)!==null&&e!==void 0?e:v.location,s=(t=s)!==null&&t!==void 0?t:v.history;try{if(!r){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}r=v?.localStorage}var o,a=ld||Xr(i.hash,"__posthog")||Xr(i.hash,"state"),l=a?pu(function(){return JSON.parse(atob(decodeURIComponent(a)))})||pu(function(){return JSON.parse(decodeURIComponent(a))}):null;return l&&l.action==="ph_authorize"?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(r.getItem(Nu)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(te.ph_load_toolbar||te.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(T==null||!T.getElementById(Lo));if(!v||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=k(k({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(v.localStorage.setItem(Nu,JSON.stringify(k(k({},s),{},{source:void 0}))),this.getToolbarState()===kt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===kt.UNINITIALIZED){this.setToolbarState(kt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(a),function(l){if(l)return _.error("Failed to load toolbar",l),void t.setToolbarState(kt.UNINITIALIZED);t.setToolbarState(kt.LOADED),t._callLoadToolbar(s)}),St(v,"turbolinks:load",function(){t.setToolbarState(kt.UNINITIALIZED),t.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}]),n}(),cd=function(){function n(e){W(this,n),y(this,"isPaused",!0),y(this,"queue",[]),y(this,"flushTimeoutMs",3e3),this.sendRequest=e}return V(n,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},i=Object.values(t);[].concat(Et(i.filter(function(r){return r.url.indexOf("/e")===0})),Et(i.filter(function(r){return r.url.indexOf("/e")!==0}))).map(function(r){e.sendRequest(k(k({},r),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),i=function(s){var o=t[s],a=new Date().getTime();o.data&&de(o.data)&&Q(o.data,function(l){l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.sendRequest(o)};for(var r in t)i(r)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Q(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;O(e[s])&&(e[s]=k(k({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),We=Uint8Array,Fe=Uint16Array,Bn=Uint32Array,ia=new We([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]),ra=new We([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]),ju=new We([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ac=function(n,e){for(var t=new Fe(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new Bn(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},Tc=Ac(ia,2),pd=Tc[0],Go=Tc[1];pd[28]=258,Go[258]=28;for(Xo=Ac(ra,0)[1],Qr=new Fe(32768),ee=0;ee<32768;++ee)Lt=(43690&ee)>>>1|(21845&ee)<<1,Lt=(61680&(Lt=(52428&Lt)>>>2|(13107&Lt)<<2))>>>4|(3855&Lt)<<4,Qr[ee]=((65280&Lt)>>>8|(255&Lt)<<8)>>>1;var Lt,Xo,Qr,ee,$i=function(n,e,t){for(var i=n.length,r=0,s=new Fe(e);r<i;++r)++s[n[r]-1];var o,a=new Fe(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new Fe(1<<e);var l=15-e;for(r=0;r<i;++r)if(n[r])for(var u=r<<4|n[r],c=e-n[r],p=a[n[r]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)o[Qr[p]>>>l]=u}else for(o=new Fe(i),r=0;r<i;++r)o[r]=Qr[a[n[r]-1]++]>>>15-n[r];return o},fn=new We(288);for(ee=0;ee<144;++ee)fn[ee]=8;for(ee=144;ee<256;++ee)fn[ee]=9;for(ee=256;ee<280;++ee)fn[ee]=7;for(ee=280;ee<288;++ee)fn[ee]=8;var Zr=new We(32);for(ee=0;ee<32;++ee)Zr[ee]=5;var fd=$i(fn,9,0),dd=$i(Zr,5,0),Rc=function(n){return(n/8>>0)+(7&n&&1)},Pc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof Fe?Fe:n instanceof Bn?Bn:We)(t-e);return i.set(n.subarray(e,t)),i},bt=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},yi=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},_o=function(n,e){for(var t=[],i=0;i<n.length;++i)n[i]&&t.push({s:i,f:n[i]});var r=t.length,s=t.slice();if(!r)return[new We(0),0];if(r==1){var o=new We(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(q,G){return q.f-G.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],u=0,c=1,p=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=t[t[u].f<t[p].f?u++:p++],l=t[u!=c&&t[u].f<t[p].f?u++:p++],t[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(i=1;i<r;++i)s[i].s>f&&(f=s[i].s);var d=new Fe(f+1),g=hd(t[c-1],d,0);if(g>e){i=0;var m=0,E=g-e,L=1<<E;for(s.sort(function(q,G){return d[G.s]-d[q.s]||q.f-G.f});i<r;++i){var I=s[i].s;if(!(d[I]>e))break;m+=L-(1<<g-d[I]),d[I]=e}for(m>>>=E;m>0;){var M=s[i].s;d[M]<e?m-=1<<e-d[M]++-1:++i}for(;i>=0&&m;--i){var F=s[i].s;d[F]==e&&(--d[F],++m)}g=e}return[new We(d),g]},hd=function n(e,t,i){return e.s==-1?Math.max(n(e.l,t,i+1),n(e.r,t,i+1)):t[e.s]=i},qu=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new Fe(++e),i=0,r=n[0],s=1,o=function(l){t[i++]=l},a=1;a<=e;++a)if(n[a]==r&&a!=e)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=n[a]}return[t.subarray(0,i),e]},_i=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},Br=function(n,e,t){var i=t.length,r=Rc(e+2);n[r]=255&i,n[r+1]=i>>>8,n[r+2]=255^n[r],n[r+3]=255^n[r+1];for(var s=0;s<i;++s)n[r+s+4]=t[s];return 8*(r+4+i)},Uu=function(n,e,t,i,r,s,o,a,l,u,c){bt(e,c++,t),++r[256];for(var p=_o(r,15),f=p[0],d=p[1],g=_o(s,15),m=g[0],E=g[1],L=qu(f),I=L[0],M=L[1],F=qu(m),q=F[0],G=F[1],X=new Fe(19),R=0;R<I.length;++R)X[31&I[R]]++;for(R=0;R<q.length;++R)X[31&q[R]]++;for(var J=_o(X,7),K=J[0],tt=J[1],ve=19;ve>4&&!K[ju[ve-1]];--ve);var Ve,Y,ne,ue,Le=u+5<<3,Ue=_i(r,fn)+_i(s,Zr)+o,oe=_i(r,f)+_i(s,m)+o+14+3*ve+_i(X,K)+(2*X[16]+3*X[17]+7*X[18]);if(Le<=Ue&&Le<=oe)return Br(e,c,n.subarray(l,l+u));if(bt(e,c,1+(oe<Ue)),c+=2,oe<Ue){Ve=$i(f,d,0),Y=f,ne=$i(m,E,0),ue=m;var Se=$i(K,tt,0);for(bt(e,c,M-257),bt(e,c+5,G-1),bt(e,c+10,ve-4),c+=14,R=0;R<ve;++R)bt(e,c+3*R,K[ju[R]]);c+=3*ve;for(var Ee=[I,q],ie=0;ie<2;++ie){var ge=Ee[ie];for(R=0;R<ge.length;++R){var Ae=31&ge[R];bt(e,c,Se[Ae]),c+=K[Ae],Ae>15&&(bt(e,c,ge[R]>>>5&127),c+=ge[R]>>>12)}}}else Ve=fd,Y=fn,ne=dd,ue=Zr;for(R=0;R<a;++R)if(i[R]>255){Ae=i[R]>>>18&31,yi(e,c,Ve[Ae+257]),c+=Y[Ae+257],Ae>7&&(bt(e,c,i[R]>>>23&31),c+=ia[Ae]);var hn=31&i[R];yi(e,c,ne[hn]),c+=ue[hn],hn>3&&(yi(e,c,i[R]>>>5&8191),c+=ra[hn])}else yi(e,c,Ve[i[R]]),c+=Y[i[R]];return yi(e,c,Ve[256]),c+Y[256]},vd=new Bn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),gd=new We(0),md=function(){for(var n=new Bn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),yd=function(n,e,t,i,r){return function(s,o,a,l,u,c){var p=s.length,f=new We(l+p+5*(1+Math.floor(p/7e3))+u),d=f.subarray(l,f.length-u),g=0;if(!o||p<8)for(var m=0;m<=p;m+=65535){var E=m+65535;E<p?g=Br(d,g,s.subarray(m,E)):(d[m]=c,g=Br(d,g,s.subarray(m,p)))}else{for(var L=vd[o-1],I=L>>>13,M=8191&L,F=(1<<a)-1,q=new Fe(32768),G=new Fe(F+1),X=Math.ceil(a/3),R=2*X,J=function(hs){return(s[hs]^s[hs+1]<<X^s[hs+2]<<R)&F},K=new Bn(25e3),tt=new Fe(288),ve=new Fe(32),Ve=0,Y=0,ne=(m=0,0),ue=0,Le=0;m<p;++m){var Ue=J(m),oe=32767&m,Se=G[Ue];if(q[oe]=Se,G[Ue]=oe,ue<=m){var Ee=p-m;if((Ve>7e3||ne>24576)&&Ee>423){g=Uu(s,d,0,K,tt,ve,Y,ne,Le,m-Le,g),ne=Ve=Y=0,Le=m;for(var ie=0;ie<286;++ie)tt[ie]=0;for(ie=0;ie<30;++ie)ve[ie]=0}var ge=2,Ae=0,hn=M,It=oe-Se&32767;if(Ee>2&&Ue==J(m-It))for(var Yc=Math.min(I,Ee)-1,Kc=Math.min(32767,m),Qc=Math.min(258,Ee);It<=Kc&&--hn&&oe!=Se;){if(s[m+ge]==s[m+ge-It]){for(var At=0;At<Qc&&s[m+At]==s[m+At-It];++At);if(At>ge){if(ge=At,Ae=It,At>Yc)break;var Zc=Math.min(It,At-2),ca=0;for(ie=0;ie<Zc;++ie){var ds=m-It+ie+32768&32767,pa=ds-q[ds]+32768&32767;pa>ca&&(ca=pa,Se=ds)}}}It+=(oe=Se)-(Se=q[oe])+32768&32767}if(Ae){K[ne++]=268435456|Go[ge]<<18|Xo[Ae];var fa=31&Go[ge],da=31&Xo[Ae];Y+=ia[fa]+ra[da],++tt[257+fa],++ve[da],ue=m+ge,++Ve}else K[ne++]=s[m],++tt[s[m]]}}g=Uu(s,d,c,K,tt,ve,Y,ne,Le,m-Le,g),c||(g=Br(d,g,gd))}return Pc(f,0,l+Rc(g)+u)}(n,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+e.mem,t,i,!r)},bo=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function _d(n,e){e===void 0&&(e={});var t=function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=md[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),i=n.length;t.p(n);var r,s=yd(n,e,10+((r=e).filename&&r.filename.length+1||0),8),o=s.length;return function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&bo(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}}(s,e),bo(s,o-8,t.d()),bo(s,o-4,i),s}var bd=!!$o||!!Eo,Bu="text/plain",es=function(n,e){var t=Re(n.split("?"),2),i=t[0],r=t[1],s=k({},e);r?.split("&").forEach(function(a){var l=Re(a.split("="),1)[0];delete s[l]});var o=Pf(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},wd=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},wo=function(n){var e=n.data,t=n.compression;if(e){if(t===lt.GZipJS){var i=_d(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new We(s.length+(s.length>>>1)),u=0,c=function(g){l[u++]=g},p=0;p<a;++p){if(u+5>l.length){var f=new We(u+8+(a-p<<1));f.set(l),l=f}var d=s.charCodeAt(p);d<128||o?c(d):d<2048?(c(192|d>>>6),c(128|63&d)):d>55295&&d<57344?(c(240|(d=65536+(1047552&d)|1023&s.charCodeAt(++p))>>>18),c(128|d>>>12&63),c(128|d>>>6&63),c(128|63&d)):(c(224|d>>>12),c(128|d>>>6&63),c(128|63&d))}return Pc(l,0,u)}(JSON.stringify(e)),{mtime:0});return{contentType:Bu,body:new Blob([i],{type:Bu})}}if(t===lt.Base64){var r=function(s){var o,a,l,u,c,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,d=0,g="",m=[];if(!s)return s;s=_f(s);do o=(c=s.charCodeAt(f++)<<16|s.charCodeAt(f++)<<8|s.charCodeAt(f++))>>18&63,a=c>>12&63,l=c>>6&63,u=63&c,m[d++]=p.charAt(o)+p.charAt(a)+p.charAt(l)+p.charAt(u);while(f<s.length);switch(g=m.join(""),s.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:wd(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Ci=[];$o&&Ci.push({transport:"XHR",method:function(n){var e,t=new $o;t.open(n.method||"GET",n.url,!0);var i=(e=wo(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;Q(n.headers,function(o,a){t.setRequestHeader(a,o)}),r&&t.setRequestHeader("Content-Type",r),n.timeout&&(t.timeout=n.timeout),t.withCredentials=!0,t.onreadystatechange=function(){if(t.readyState===4){var o,a={statusCode:t.status,text:t.responseText};if(t.status===200)try{a.json=JSON.parse(t.responseText)}catch{}(o=n.callback)===null||o===void 0||o.call(n,a)}},t.send(s)}}),Eo&&Ci.push({transport:"fetch",method:function(n){var e,t,i=(e=wo(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;Q(n.headers,function(c,p){o.append(p,c)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(uu){var u=new uu;l={signal:u.signal,timeout:setTimeout(function(){return u.abort()},n.timeout)}}Eo(a,{method:n?.method||"GET",headers:o,keepalive:n.method==="POST",body:s,signal:(t=l)===null||t===void 0?void 0:t.signal}).then(function(c){return c.text().then(function(p){var f,d={statusCode:c.status,text:p};if(c.status===200)try{d.json=JSON.parse(p)}catch(g){_.error(g)}(f=n.callback)===null||f===void 0||f.call(n,d)})}).catch(function(c){var p;_.error(c),(p=n.callback)===null||p===void 0||p.call(n,{statusCode:0,text:c})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),ut!=null&&ut.sendBeacon&&Ci.push({transport:"sendBeacon",method:function(n){var e=es(n.url,{beacon:"1"});try{var t,i=(t=wo(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;ut.sendBeacon(e,o)}catch{}}});var xd=["retriesPerformedSoFar"],pn,kd=function(){function n(e){var t=this;W(this,n),y(this,"isPolling",!1),y(this,"pollIntervalMs",3e3),y(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!O(v)&&"onLine"in v.navigator&&(this.areWeOnline=v.navigator.onLine,v.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),v.addEventListener("offline",function(){t.areWeOnline=!1}))}return V(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=hf(e,xd);Ke(i)&&i>0&&(r.url=es(r.url,{retry_count:i})),this.instance._send_request(k(k({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(k({retriesPerformedSoFar:i},r)):(o=r.callback)===null||o===void 0||o.call(r,s)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(t),r=Date.now()+i;this.queue.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),_.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],i=this.queue.filter(function(a){return a.retryAt<e||(t.push(a),!1)});if(this.queue=t,i.length>0){var r,s=et(i);try{for(s.s();!(r=s.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(a){s.e(a)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=et(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(k(k({},i),{},{transport:"sendBeacon"}))}catch(r){_.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),Dr=1800,Sd=function(){function n(e,t,i,r){var s;W(this,n),y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||qt,this._windowIdGenerator=r||qt;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Dr;if(Ke(a)?a>Dr?_.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&_.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(_.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Dr),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),Dr),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var l=ke.parse(this._window_id_storage_key),u=ke.parse(this._primary_window_exists_storage_key);l&&!u?this._windowId=l:ke.remove(this._window_id_storage_key),ke.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var c=function(p){var f=p.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(p){_.error("Invalid sessionID in bootstrap",p)}this._listenToReloadWindow()}return V(n,[{key:"onSessionId",value:function(e){var t=this;return O(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&ke.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ke.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?ke.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(y({},zr,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[zr];return de(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;v?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&ke.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){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(),i=Re(this._getSessionId(),3),r=i[0],s=i[1],o=i[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!s,p=!e&&Math.abs(t-r)>this._sessionTimeoutMs;c||p||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),_.info("[SessionId] new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=r===0||!e||l?t:r,d=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,f,d),u&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:d}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(pn||(pn={}));var Hu="i.posthog.com",Ed=function(){function n(e){W(this,n),y(this,"_regionCache",{}),this.instance=e}return V(n,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(Hu),".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=pn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=pn.EU:this._regionCache[this.apiHost]=pn.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(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===pn.CUSTOM)return this.apiHost+t;var i=Hu+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return _.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var i=e[0]==="/"?this.endpointFor("assets",e):e,r=function(){if(!T)return t("document not found");var s=T.createElement("script");s.type="text/javascript",s.src=i,s.onload=function(l){return t(void 0,l)},s.onerror=function(l){return t(l)};var o,a=T.querySelectorAll("body > script");a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(s,a[0]):T.body.appendChild(s)};T!=null&&T.body?r():T?.addEventListener("DOMContentLoaded",r)}}]),n}(),Oc="posthog-js";function Fc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.organization,i=e.projectId,r=e.prefix,s=e.severityAllowList,o=s===void 0?["error"]:s;return function(a){var l,u,c,p,f;if(!(o==="*"||o.includes(a.level))||!n.__loaded)return a;a.tags||(a.tags={});var d=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=d,n.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));var g=((l=a.exception)===null||l===void 0?void 0:l.values)||[],m={$exception_message:((u=g[0])===null||u===void 0?void 0:u.value)||a.message,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:d,$exception_level:a.level,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((p=g[0])===null||p===void 0?void 0:p.value)||a.message,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:a.tags,$level:a.level};return t&&i&&(m.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.exceptions.sendExceptionEvent(m),a}}var $d=V(function n(e,t,i,r,s){W(this,n),this.name=Oc,this.setupOnce=function(o){o(Fc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function Cd(n,e){var t=n.config.segment;if(!t)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var o=function(l){var u=function(){return l.anonymousId()||qt()};i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(xt,"identified")),r()},a=s.user();"then"in a&&Qe(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||_.warn("This browser does not have Promise support, and can not use the segment integration");var r=function(s,o){var a;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||(_.info("Segment integration does not have a userId set, resetting PostHog"),i.reset()),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(_.info("Segment integration has a userId set, identifying with PostHog"),i.identify(s.event.userId));var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{},new Date);return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return r(s,s.event.event)},page:function(s){return r(s,"$pageview")},identify:function(s){return r(s,"$identify")},screen:function(s){return r(s,"$screen")}}}(n)).then(function(){e()})})}var zu,ts,at,Id=function(){function n(e){W(this,n),this._instance=e}return V(n,[{key:"doPageView",value:function(e){var t,i=this._previousPageViewProperties(e);return this._currentPath=(t=v?.location.pathname)!==null&&t!==void 0?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,i}},{key:"doPageLeave",value:function(e){return this._previousPageViewProperties(e)}},{key:"_previousPageViewProperties",value:function(e){var t=this._currentPath,i=this._prevPageviewTimestamp,r=this._instance.scrollManager.getContext();if(!i)return{};var s={};if(r){var o=r.maxScrollHeight,a=r.lastScrollY,l=r.maxScrollY,u=r.maxContentHeight,c=r.lastContentY,p=r.maxContentY;O(o)||O(a)||O(l)||O(u)||O(c)||O(p)||(o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),p=Math.ceil(p),s={$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:o<=1?1:Lr(a/o,0,1),$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:o<=1?1:Lr(l/o,0,1),$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:u<=1?1:Lr(c/u,0,1),$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:u<=1?1:Lr(p/u,0,1)})}return t&&(s.$prev_pageview_pathname=t),i&&(s.$prev_pageview_duration=(e.getTime()-i.getTime())/1e3),s}}]),n}();function Lr(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(zu||(zu={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(ts||(ts={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(at||(at={}));var Mc=function(){function n(){W(this,n),y(this,"events",{}),this.events={}}return V(n,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(r){return r!==t})}}},{key:"emit",value:function(e,t){var i,r=et(this.events[e]||[]);try{for(r.s();!(i=r.n()).done;)(0,i.value)(t)}catch(a){r.e(a)}finally{r.f()}var s,o=et(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),Ad=function(){function n(e){var t=this;W(this,n),y(this,"_debugEventEmitter",new Mc),y(this,"checkStep",function(i,r){return t.checkStepEvent(i,r)&&t.checkStepUrl(i,r)&&t.checkStepElement(i,r)}),y(this,"checkStepEvent",function(i,r){return r==null||!r.event||i?.event===r?.event}),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}return V(n,[{key:"init",value:function(){var e,t=this;if(!O((e=this.instance)===null||e===void 0?void 0:e._addCaptureHook)){var i;(i=this.instance)===null||i===void 0||i._addCaptureHook(function(r,s){t.on(r,s)})}}},{key:"register",value:function(e){var t,i,r=this;if(!O((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(function(a){var l,u;(l=r.actionRegistry)===null||l===void 0||l.add(a),(u=a.steps)===null||u===void 0||u.forEach(function(c){var p;(p=r.actionEvents)===null||p===void 0||p.add(c?.event||"")})}),(i=this.instance)!==null&&i!==void 0&&i.autocapture)){var s,o=new Set;e.forEach(function(a){var l;(l=a.steps)===null||l===void 0||l.forEach(function(u){u!=null&&u.selector&&o.add(u?.selector)})}),(s=this.instance)===null||s===void 0||s.autocapture.setElementSelectors(o)}}},{key:"on",value:function(e,t){var i,r=this;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((i=this.actionRegistry)===null||i===void 0?void 0:i.size)>0&&this.actionRegistry.forEach(function(s){r.checkAction(t,s)&&r._debugEventEmitter.emit("actionCaptured",s.name)})}},{key:"_addActionHook",value:function(e){this.onAction("actionCaptured",function(t){return e(t)})}},{key:"checkAction",value:function(e,t){if(t?.steps==null)return!1;var i,r=et(t.steps);try{for(r.s();!(i=r.n()).done;){var s=i.value;if(this.checkStep(e,s))return!0}}catch(o){r.e(o)}finally{r.f()}return!1}},{key:"onAction",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"checkStepUrl",value:function(e,t){if(t!=null&&t.url){var i,r=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!r||typeof r!="string"||!n.matchString(r,t?.url,t?.url_matching||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.getElementsList(e).some(function(s){return!(t!=null&&t.href&&!n.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!n.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!n.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))}))return!1;if(t!=null&&t.selector){var i,r=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(!r||!r.includes(t?.selector))return!1}return!0}},{key:"getElementsList",value:function(e){return e?.properties.$elements==null?[]:e?.properties.$elements}}],[{key:"matchString",value:function(e,t,i){switch(i){case"regex":return!!v&&Gr(e,t);case"exact":return t===e;case"contains":var r=n.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Gr(e,r);default:return!1}}},{key:"escapeStringRegexp",value:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),n}(),Jo=function(){function n(e){W(this,n),this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return V(n,[{key:"register",value:function(e){var t;O((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:"setupActionBasedSurveys",value:function(e){var t=this,i=e.filter(function(r){var s,o,a,l;return((s=r.conditions)===null||s===void 0?void 0:s.actions)&&((o=r.conditions)===null||o===void 0||(a=o.actions)===null||a===void 0||(l=a.values)===null||l===void 0?void 0:l.length)>0});i.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new Ad(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(function(r){t.onAction(r)})),i.forEach(function(r){var s,o,a,l,u,c,p,f,d,g;r.conditions&&(s=r.conditions)!==null&&s!==void 0&&s.actions&&(o=r.conditions)!==null&&o!==void 0&&(a=o.actions)!==null&&a!==void 0&&a.values&&((l=r.conditions)===null||l===void 0||(u=l.actions)===null||u===void 0||(c=u.values)===null||c===void 0?void 0:c.length)>0&&((p=t.actionMatcher)===null||p===void 0||p.register(r.conditions.actions.values),(f=r.conditions)===null||f===void 0||(d=f.actions)===null||d===void 0||(g=d.values)===null||g===void 0||g.forEach(function(m){if(m&&m.name){var E=t.actionToSurveys.get(m.name);E&&E.push(r.id),t.actionToSurveys.set(m.name,E||[r.id])}}))}))}},{key:"setupEventBasedSurveys",value:function(e){var t,i=this;e.filter(function(r){var s,o,a,l;return((s=r.conditions)===null||s===void 0?void 0:s.events)&&((o=r.conditions)===null||o===void 0||(a=o.events)===null||a===void 0||(l=a.values)===null||l===void 0?void 0:l.length)>0}).length!==0&&((t=this.instance)===null||t===void 0||t._addCaptureHook(function(r,s){i.onEvent(r,s)}),e.forEach(function(r){var s,o,a;(s=r.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(a=o.values)===null||a===void 0||a.forEach(function(l){if(l&&l.name){var u=i.eventToSurveys.get(l.name);u&&u.push(r.id),i.eventToSurveys.set(l.name,u||[r.id])}})}))}},{key:"onEvent",value:function(e,t){var i,r,s=((i=this.instance)===null||i===void 0||(r=i.persistence)===null||r===void 0?void 0:r.props[Tr])||[];if(n.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,a=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(a){var l=s.indexOf(a);l>=0&&(s.splice(l,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(e)||[]))}},{key:"onAction",value:function(e){var t,i,r=((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0?void 0:i.props[Tr])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}},{key:"_updateActivatedSurveys",value:function(e){var t,i;(t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register(y({},Tr,Et(new Set(e))))}},{key:"getSurveys",value:function(){var e,t,i=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[Tr];return i||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),n}();y(Jo,"SURVEY_SHOWN_EVENT_NAME","survey shown");var bi="[Surveys]",Td={icontains:function(n){return!!v&&v.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!v&&v.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!v&&Gr(v.location.href,n)},not_regex:function(n){return!!v&&!Gr(v.location.href,n)},exact:function(n){return v?.location.href===n},is_not:function(n){return v?.location.href!==n}},Rd=function(){function n(e){W(this,n),this.instance=e,this._surveyEventReceiver=null}return V(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=te?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Jo(this.instance)),this.instance.requestRouter.loadScript("/static/surveys.js",function(i){if(i)return _.error(bi,"Could not load surveys script",i);e._surveyManager=te.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Jo(this.instance));var r=this.instance.get_property(Po);if(r&&!i)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:function(s){var o;if(s.statusCode!==200||!s.json)return e([]);var a,l=s.json.surveys||[],u=l.filter(function(c){var p,f,d,g,m,E,L,I,M,F,q,G;return((p=c.conditions)===null||p===void 0?void 0:p.events)&&((f=c.conditions)===null||f===void 0||(d=f.events)===null||d===void 0?void 0:d.values)&&((g=c.conditions)===null||g===void 0||(m=g.events)===null||m===void 0||(E=m.values)===null||E===void 0?void 0:E.length)>0||((L=c.conditions)===null||L===void 0?void 0:L.actions)&&((I=c.conditions)===null||I===void 0||(M=I.actions)===null||M===void 0?void 0:M.values)&&((F=c.conditions)===null||F===void 0||(q=F.actions)===null||q===void 0||(G=q.values)===null||G===void 0?void 0:G.length)>0});return u.length>0&&((a=t._surveyEventReceiver)===null||a===void 0||a.register(u)),(o=t.instance.persistence)===null||o===void 0||o.register(y({},Po,l)),e(l)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(r){var s,o=r.filter(function(u){return!(!u.start_date||u.end_date)}).filter(function(u){var c,p,f,d;if(!u.conditions)return!0;var g=(c=u.conditions)===null||c===void 0||!c.url||Td[(p=(f=u.conditions)===null||f===void 0?void 0:f.urlMatchType)!==null&&p!==void 0?p:"icontains"](u.conditions.url),m=(d=u.conditions)===null||d===void 0||!d.selector||T?.querySelector(u.conditions.selector);return g&&m}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(u){var c,p,f,d,g,m,E,L,I,M;if(!u.linked_flag_key&&!u.targeting_flag_key&&!u.internal_targeting_flag_key)return!0;var F=!u.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(u.linked_flag_key),q=!u.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.targeting_flag_key),G=((c=u.conditions)===null||c===void 0?void 0:c.events)&&((p=u.conditions)===null||p===void 0||(f=p.events)===null||f===void 0?void 0:f.values)&&((d=u.conditions)===null||d===void 0||(g=d.events)===null||g===void 0?void 0:g.values.length)>0,X=((m=u.conditions)===null||m===void 0?void 0:m.actions)&&((E=u.conditions)===null||E===void 0||(L=E.actions)===null||L===void 0?void 0:L.values)&&((I=u.conditions)===null||I===void 0||(M=I.actions)===null||M===void 0?void 0:M.values.length)>0,R=!G&&!X||a?.includes(u.id),J=t._canActivateRepeatedly(u),K=!(u.internal_targeting_flag_key&&!J)||t.instance.featureFlags.isFeatureEnabled(u.internal_targeting_flag_key);return F&&q&&K&&R});return e(l)},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var r,s=e.questions[t],o=t+1;if((r=s.branching)===null||r===void 0||!r.type)return t===e.questions.length-1?at.End:o;if(s.branching.type===at.End)return at.End;if(s.branching.type===at.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===at.ResponseBased){if(s.type===ts.SingleChoice){var a,l,u=s.choices.indexOf("".concat(i));if((a=s.branching)!==null&&a!==void 0&&(l=a.responseValues)!==null&&l!==void 0&&l.hasOwnProperty(u)){var c=s.branching.responseValues[u];return Number.isInteger(c)?c:c===at.End?at.End:o}}else if(s.type===ts.Rating){var p,f;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var d=function(m,E){if(E===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(E===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(E===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, 10")}(i,s.scale);if((p=s.branching)!==null&&p!==void 0&&(f=p.responseValues)!==null&&f!==void 0&&f.hasOwnProperty(d)){var g=s.branching.responseValues[d];return Number.isInteger(g)?g:g===at.End?at.End:o}}return o}return _.warn(bi,"Falling back to next question index due to unexpected branching type"),o}},{key:"_canActivateRepeatedly",value:function(e){var t;return Oe((t=te.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(_.warn(bi,"canActivateRepeatedly is not defined, must init before calling"),!1):te.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:"canRenderSurvey",value:function(e){var t=this;Oe(this._surveyManager)?_.warn(bi,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(function(i){var r=i.filter(function(s){return s.id===e})[0];t._surveyManager.canRenderSurvey(r)})}},{key:"renderSurvey",value:function(e,t){var i=this;Oe(this._surveyManager)?_.warn(bi,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(function(r){var s=r.filter(function(o){return o.id===e})[0];i._surveyManager.renderSurvey(s,T?.querySelector(t))})}}]),n}(),Pd=function(){function n(e){var t,i,r=this;W(this,n),y(this,"serverLimits",{}),y(this,"lastEventRateLimited",!1),y(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(a){_.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void _.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:o})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return V(n,[{key:"clientRateLimitContext",value:function(){var e,t,i,r=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(Fo))!==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 a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||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=a,(i=this.instance.persistence)===null||i===void 0||i.set_property(Fo,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}]),n}(),Od=function(){return k({initialPathName:je?.pathname||"",referringDomain:be.referringDomain()},be.campaignParams())},Fd=function(){function n(e,t,i){var r=this;W(this,n),y(this,"_onSessionIdCallback",function(s){var o=r._getStoredProps();if(!o||o.sessionId!==s){var a={sessionId:s,props:r._sessionSourceParamGenerator()};r._persistence.register(y({},Oo,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||Od,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return V(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[Oo]}},{key:"getSessionProps",value:function(){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}:{}}}]),n}(),Md=["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;"],Wu=function(n,e){if(!n)return!1;var t=n.toLowerCase();return Md.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},Dc=function(){function n(){W(this,n),this.clicks=[]}return V(n,[{key:"isRageClick",value:function(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}]),n}();function Vu(n){var e;return n.id===Lo||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+Lo))}var Dd=function(){function n(e){var t,i=this;W(this,n),y(this,"rageclicks",new Dc),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),y(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Ao]),v?.addEventListener("beforeunload",function(){i.flush()})}return V(n,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return he(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){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}},{key:"startIfEnabled",value:function(){if(this.isEnabled){if(this._initialized)return;_.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e;clearInterval((e=this._flushInterval)!==null&&e!==void 0?e:void 0),this.getAndClearBuffer()}}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},Ao,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;v&&T&&(St(T,"click",function(t){return e._onClick(t||v?.event)},!1,!0),St(T,"mousemove",function(t){return e._onMouseMove(t||v?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,l,u){for(var c=a;c&&!Bt(c,"body");){if(c===u)return!1;if(B(l,v?.getComputedStyle(c).position))return!0;c=Sc(c)}return!1}(e.target,["fixed","sticky"],s);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!Vu(e.target)){var i=this._getProperties(e,"click");(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(k(k({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;Vu(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(v){var t=v.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}},{key:"flush",value:function(){this.buffer&&!jr(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),n}(),Ld=function(){function n(e){var t=this;W(this,n),y(this,"_updateScrollData",function(){var i,r,s,o;t.context||(t.context={});var a=t.scrollElement(),l=t.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=l+(a?.clientHeight||0),p=a?.scrollHeight||0;t.context.lastScrollY=Math.ceil(l),t.context.maxScrollY=Math.max(l,(i=t.context.maxScrollY)!==null&&i!==void 0?i:0),t.context.maxScrollHeight=Math.max(u,(r=t.context.maxScrollHeight)!==null&&r!==void 0?r:0),t.context.lastContentY=c,t.context.maxContentY=Math.max(c,(s=t.context.maxContentY)!==null&&s!==void 0?s:0),t.context.maxContentHeight=Math.max(p,(o=t.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=e}return V(n,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){v?.addEventListener("scroll",this._updateScrollData,!0),v?.addEventListener("scrollend",this._updateScrollData,!0),v?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return v?.document.documentElement;var e,t=et(de(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var i=e.value,r=v?.document.querySelector(i);if(r)return r}}catch(s){t.e(s)}finally{t.f()}}},{key:"scrollY",value:function(){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}},{key:"scrollX",value:function(){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}}]),n}(),xo="$copy_autocapture";function ko(n,e){return e.length>n?e.slice(0,n)+"...":e}var jt,Nd=function(){function n(e){W(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new Dc),y(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}return V(n,[{key:"config",get:function(){var e,t,i=he(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)===null||e===void 0?void 0:e.map(function(r){return new RegExp(r)}),i.url_ignorelist=(t=i.url_ignorelist)===null||t===void 0?void 0:t.map(function(r){return new RegExp(r)}),i}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(v&&T){var t=function(r){r=r||v?.event;try{e._captureEvent(r)}catch(s){_.error("Failed to capture event",s)}},i=function(r){r=r||v?.event,e._captureEvent(r,xo)};St(T,"submit",t,!1,!0),St(T,"change",t,!1,!0),St(T,"click",t,!1,!0),this.config.capture_copied_text&&(St(T,"copy",i,!1,!0),St(T,"cut",i,!1,!0))}}else _.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(y({},fu,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(e){this._elementSelectors=e}},{key:"getElementSelectors",value:function(e){var t,i=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(function(r){var s=T?.querySelectorAll(r);s?.forEach(function(o){e===o&&i.push(r)})}),i}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[fu],r=this._isDisabledServerSide;if(Ct(r)&&!cn(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!na(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!zo(e))return{};var t={};return Q(e.attributes,function(i){if(i.name&&i.name.indexOf("data-ph-capture-attribute")===0){var r=i.name.replace("data-ph-capture-attribute-",""),s=i.value;r&&s&&qn(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Ho.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=ko(1024,Ou(e)):o.$el_text=ko(1024,Kr(e)));var a=Yr(e);a.length>0&&(o.classes=a.filter(function(f){return f!==""}));var l=(r=this.config)===null||r===void 0?void 0:r.element_attribute_ignorelist;Q(e.attributes,function(f){var d;if((!Ec(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(l==null||!l.includes(f.name))&&!t&&qn(f.value)&&(d=f.name,!Ie(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=ta(g).join(" ")),o["attr__"+f.name]=ko(1024,g)}});for(var u=1,c=1,p=e;p=this._previousElementSibling(p);)u++,p.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return O(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);xc(s)&&(s=s.parentNode||null),i==="$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 o=i===xo;if(s&&Vf(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,u=[s],c=s;c.parentNode&&!Bt(c,"body");)kc(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var p,f,d=[],g={},m=!1;if(Q(u,function(J){var K=zo(J);J.tagName.toLowerCase()==="a"&&(p=J.getAttribute("href"),p=K&&qn(p)&&p),B(Yr(J),"ph-no-capture")&&(m=!0),d.push(t._getPropertiesFromElement(J,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var tt=t._getAugmentPropertiesFromElement(J);Pe(g,tt)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?d[0].$el_text=Ou(s):d[0].$el_text=Kr(s)),p){var E,L;d[0].attr__href=p;var I=(E=Ei(p))===null||E===void 0?void 0:E.host,M=v==null||(L=v.location)===null||L===void 0?void 0:L.host;I&&M&&I!==M&&(f=p)}if(m)return!1;var F=Pe(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:Kf(d)}:{$elements:d},(a=d[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=d[0])===null||l===void 0?void 0:l.$el_text}:{},f&&e.type==="click"?{$external_click_url:f}:{},g),q=this.getElementSelectors(s);if(q&&q.length>0&&(F.$element_selectors=q),i===xo){var G,X=wc(v==null||(G=v.getSelection())===null||G===void 0?void 0:G.toString()),R=e.type||"clipboard";if(!X)return!1;F.$selected_content=X,F.$copy_type=R}return this.instance.capture(i,F),!0}}}},{key:"isBrowserSupported",value:function(){return Qe(T?.querySelectorAll)}}]),n}(),jd=function(){function n(e){var t=this;W(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){O(t._restoreXHRPatch)&&te.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),O(t._restoreFetchPatch)&&te.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return V(n,[{key:"_loadScript",value:function(e){te.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(Ye.LIB_VERSION),function(t){if(t)return _.error("[TRACING-HEADERS] failed to load script",t);e()})}},{key:"startIfEnabledOrStop",value:function(){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)}}]),n}();(function(n){n[n.PENDING=-1]="PENDING",n[n.DENIED=0]="DENIED",n[n.GRANTED=1]="GRANTED"})(jt||(jt={}));var qd=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?jt.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===jt.DENIED||this.consent===jt.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return e==="1"?jt.GRANTED:e==="0"?jt.DENIED:jt.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?fe:$t;var t=e==="localStorage"?$t: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}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!ic([ut?.doNotTrack,ut?.msDoNotTrack,te.doNotTrack],function(e){return B([!0,1,"1","yes"],e)})}}]),n}(),Nr="[Exception Autocapture]",Ud=function(){function n(e){var t,i=this;W(this,n),y(this,"originalOnUnhandledRejectionHandler",void 0),y(this,"startCapturing",function(){if(v&&i.isEnabled&&!i.hasHandlers&&!i.isCapturing){var r=v.posthogErrorWrappingFunctions.wrapOnError,s=v.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(r&&s)try{i.unwrapOnError=r(i.captureException.bind(i)),i.unwrapUnhandledRejection=s(i.captureException.bind(i))}catch(o){_.error(Nr+" failed to start",o),i.stopCapturing()}else _.error(Nr+" failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[du]),this.startIfEnabled()}return V(n,[{key:"isEnabled",get:function(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}},{key:"isCapturing",get:function(){var e;return!(v==null||(e=v.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(_.info(Nr+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript("/static/exception-autocapture.js?v=".concat(Ye.LIB_VERSION),function(t){if(t)return _.error(Nr+" failed to load script",t);e()})}},{key:"stopCapturing",value:function(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register(y({},du,this.remoteEnabled)),this.startIfEnabled()}},{key:"captureException",value:function(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)}}]),n}(),Gu=9e5,un="[Web Vitals]",Bd=function(){function n(e){var t,i=this;W(this,n),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),y(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),y(this,"_flushToCapture",function(){clearTimeout(i._delayedFlushTimer),i.buffer.metrics.length!==0&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce(function(r,s){var o;return k(k({},r),{},(y(o={},"$web_vitals_".concat(s.name,"_event"),k({},s)),y(o,"$web_vitals_".concat(s.name,"_value"),s.value),o))},{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),y(this,"_addToBuffer",function(r){var s,o=(s=i.instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0);if(O(o))_.error(un+"Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=i._currentURL();O(a)||(Oe(r?.name)||Oe(r?.value)?_.error(un+"Invalid metric received",r):i._maxAllowedValue&&r.value>=i._maxAllowedValue?_.error(un+"Ignoring metric with value >= "+i._maxAllowedValue,r):(i.buffer.url!==a&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,8e3)),O(i.buffer.url)&&(i.buffer.url=a),i.buffer.firstMetricTimestamp=O(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,i.buffer.metrics.push(k(k({},r),{},{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),i.buffer.metrics.length===i.allowedMetrics.length&&i._flushToCapture()))}}),y(this,"_startCapturing",function(){var r,s,o,a,l=te.__PosthogExtensions__;if(!O(l)){var u=l.postHogWebVitalsCallbacks;r=u.onLCP,s=u.onCLS,o=u.onFCP,a=u.onINP}r&&s&&o&&a?(i.allowedMetrics.indexOf("LCP")>-1&&r(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("CLS")>-1&&s(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("FCP")>-1&&o(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("INP")>-1&&a(i._addToBuffer.bind(i)),i._initialized=!0):_.error(un+"web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[vu]),this.startIfEnabled()}return V(n,[{key:"allowedMetrics",get:function(){var e,t,i=he(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(i)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[gu])||["CLS","FCP","INP","LCP"]:i}},{key:"_maxAllowedValue",get:function(){var e=he(this.instance.config.capture_performance)&&Ke(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Gu;return 0<e&&e<=6e4?Gu:e}},{key:"isEnabled",get:function(){var e=he(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return cn(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(_.info(un+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=he(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=he(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register(y({},vu,t)),this.instance.persistence.register(y({},gu,i))),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){var t;(t=te.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript("/static/web-vitals.js?v=".concat(Ye.LIB_VERSION),function(i){i?_.error(un+" failed to load script",i):e()})}},{key:"_currentURL",value:function(){var e=v?v.location.href:void 0;return e||_.error(un+"Could not determine current URL"),e}}]),n}(),Xu="/e/",Hd=function(){function n(e){var t;W(this,n),this.instance=e,this._endpointSuffix=((t=this.instance.persistence)===null||t===void 0?void 0:t.props[hu])||Xu}return V(n,[{key:"endpoint",get:function(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this._endpointSuffix=he(t)&&t.endpoint||Xu,this.instance.persistence&&this.instance.persistence.register(y({},hu,this._endpointSuffix))}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}]),n}(),Ii={},Ju=function(){},Fn="posthog",Lc=!bd&&_e?.indexOf("MSIE")===-1&&_e?.indexOf("Mozilla")===-1,Yu=function(){var n,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=T?.location,t=e?.hostname,!!Ie(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Ju,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:je&&Ie(je?.search)&&je.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(n=v.location)===null||n===void 0?void 0:n.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:function(i){var r="Bad HTTP status: "+i.statusCode+" "+i.text;_.error(r)},get_device_id:function(i){return i},_onCapture:Ju,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},Ku=function(n){var e={};O(n.process_person)||(e.person_profiles=n.process_person),O(n.xhr_headers)||(e.request_headers=n.xhr_headers),O(n.cookie_name)||(e.persistence_name=n.cookie_name),O(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Pe({},e,n);return de(n.property_blacklist)&&(O(n.property_denylist)?t.property_denylist=n.property_blacklist:de(n.property_denylist)?t.property_denylist=[].concat(Et(n.property_blacklist),Et(n.property_denylist)):_.error("Invalid value for property_denylist config: "+n.property_denylist)),t},zd=function(){function n(){W(this,n),y(this,"__forceAllowLocalhost",!1)}return V(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){_.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),Nc=function(){function n(){var e=this;W(this,n),y(this,"webPerformance",new zd),y(this,"version",Ye.LIB_VERSION),y(this,"_internalEventEmitter",new Mc),this.config=Yu(),this.decideEndpointWasHit=!1,this.SentryIntegration=$d,this.sentryIntegration=function(t){return function(i,r){var s=Fc(i,r);return{name:Oc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this.featureFlags=new wf(this),this.toolbar=new ud(this),this.scrollManager=new Ld(this),this.pageViewManager=new Id(this),this.surveys=new Rd(this),this.exceptions=new Hd(this),this.rateLimiter=new Pd(this),this.requestRouter=new Ed(this),this.consent=new qd(this),this.people={set:function(t,i,r){var s=Ie(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Ie(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return _.info("send",t)})}return V(n,[{key:"init",value:function(e,t,i){if(i&&i!==Fn){var r,s=(r=Ii[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),Ii[i]=s,Ii[Fn][i]=s,s}return this._init(e,t,i)}},{key:"_init",value:function(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(O(e)||ou(e))return _.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 _.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Pe({},Yu(),Ku(s),{name:o,token:e})),this.config.on_xhr_error&&_.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:lt.GZipJS,this.persistence=new yo(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new yo(k(k({},this.config),{},{persistence:"sessionStorage"}));var a=k({},this.persistence.props),l=k({},this.sessionPersistence.props);if(this._requestQueue=new cd(function(I){return r._send_retriable_request(I)}),this._retryQueue=new kd(this),this.__request_queue=[],this.sessionManager=new Sd(this.config,this.persistence),this.sessionPropsManager=new Fd(this.sessionManager,this.persistence),new jd(this).startIfEnabledOrStop(),this.sessionRecording=new od(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Nd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Dd(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Bd(this),this.exceptionObserver=new Ud(this),this.exceptionObserver.startIfEnabled(),Ye.DEBUG=Ye.DEBUG||this.config.debug,Ye.DEBUG&&_.info("Starting in debug mode",{this:this,config:s,thisC:k({},this.config),p:a,s:l}),this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var u,c,p=this.config.get_device_id(qt()),f=(u=s.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?p:s.bootstrap.distinctID;this.persistence.set_property(xt,(c=s.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var d,g,m=Object.keys(((d=s.bootstrap)===null||d===void 0?void 0:d.featureFlags)||{}).filter(function(I){var M,F;return!((M=s.bootstrap)===null||M===void 0||(F=M.featureFlags)===null||F===void 0||!F[I])}).reduce(function(I,M){var F,q;return I[M]=((F=s.bootstrap)===null||F===void 0||(q=F.featureFlags)===null||q===void 0?void 0:q[M])||!1,I},{}),E=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(function(I){return m[I]}).reduce(function(I,M){var F,q,G,X;return(F=s.bootstrap)!==null&&F!==void 0&&(q=F.featureFlagPayloads)!==null&&q!==void 0&&q[M]&&(I[M]=(G=s.bootstrap)===null||G===void 0||(X=G.featureFlagPayloads)===null||X===void 0?void 0:X[M]),I},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:E})}if(!this.get_distinct_id()){var L=this.config.get_device_id(qt());this.register_once({distinct_id:L,$device_id:L},""),this.persistence.set_property(xt,"anonymous")}return v==null||(i=v.addEventListener)===null||i===void 0||i.call(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?Cd(this,function(){return r._loaded()}):this._loaded(),Qe(this.config._onCapture)&&this.on("eventCaptured",function(I){return r.config._onCapture(I.event,I)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o,a,l,u;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=B(e.supportedCompression,lt.GZipJS)?lt.GZipJS:B(e.supportedCompression,lt.Base64)?lt.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(i=this.sessionRecording)===null||i===void 0||i.afterDecideResponse(e),(r=this.autocapture)===null||r===void 0||r.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.afterDecideResponse(e),(l=this.exceptions)===null||l===void 0||l.afterDecideResponse(e),(u=this.exceptionObserver)===null||u===void 0||u.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(i){_.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){e.consent.isOptedIn()&&e._captureInitialPageview()},1),t||(new ad(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Ln(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){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"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(Lc?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=es(e.url,{ip:this.config.ip?1:0}),e.headers=k({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=k({},i);a.timeout=a.timeout||6e4,a.url=es(a.url,{_:new Date().getTime().toString(),ver:Ye.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",u=(s=(o=ic(Ci,function(c){return c.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Ci[0].method;if(!u)throw new Error("No available transport method");u(a)}(k(k({},e),{},{callback:function(i){var r,s,o;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&((s=(o=t.config).on_request_error)===null||s===void 0||s.call(o,i)),(r=e.callback)===null||r===void 0||r.call(e,i)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,i=this,r=[],s=[],o=[];Ln(e,function(l){l&&(t=l[0],de(t)?o.push(l):Qe(l)?l.call(i):de(l)&&t==="alias"?r.push(l):de(l)&&t.indexOf("capture")!==-1&&Qe(i[t])?o.push(l):s.push(l))});var a=function(l,u){Ln(l,function(c){if(de(c[0])){var p=u;Q(c,function(f){p=p[f[0]].apply(p,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};a(r,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){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}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!O(e)&&Ie(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=i?.timestamp||o,l={uuid:qt(),event:e,properties:this._calculate_event_properties(e,t||{},a)};s&&(l.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(l.$set=i?.$set);var u=this._calculate_set_once_properties(i?.$set_once);u&&(l.$set_once=u),(l=yf(l,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,O(i?.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=o);var c=k(k({},l.properties.$set),l.$set);jr(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit("eventCaptured",l);var p={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),l}_.critical("This capture call is ignored due to client rate limiting.")}}else _.error("No event name provided to posthog.capture")}else _.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=k({},t);if(s.token=this.config.token,e==="$snapshot"){var o=k(k({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ie(s.distinct_id)&&!Ke(s.distinct_id)||ou(s.distinct_id))&&_.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var a=be.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),u=l.sessionId,c=l.windowId;s.$session_id=u,s.$window_id=c}if(this.requestRouter.region===pn.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 p=this.sessionPropsManager.getSessionProps();s=Pe(s,p)}if(!this.config.disable_scroll_properties){var f={};e==="$pageview"?f=this.pageViewManager.doPageView(i):e==="$pageleave"&&(f=this.pageViewManager.doPageLeave(i)),s=Pe(s,f)}if(e==="$pageview"&&T&&(s.title=T.title),!O(r)){var d=i.getTime()-r;s.$duration=parseFloat((d/1e3).toFixed(3))}_e&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Pe({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),de(this.config.property_denylist)?Q(this.config.property_denylist,function(m){delete s[m]}):_.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;return g&&(s=g(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Pe({},this.persistence.get_initial_props(),e||{});return jr(t)?void 0:t}},{key:"register",value:function(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,t,i)}},{key:"register_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}},{key:"unregister",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(y({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"renderSurvey",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:"canRenderSurvey",value:function(e){this.surveys.canRenderSurvey(e)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return _.uninitializedWarning("posthog.identify");if(Ke(e)&&(e=e.toString(),_.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()))_.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 r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(wi)&&(this.unregister(wi),this.register({distinct_id:e}));var o=(this.persistence.get_property(xt)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(xt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Wr))}}else _.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:k(k({},r),{},y({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(y({},e,i))),r[e]===t||i||this.reloadFeatureFlags()}}else _.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,i,r,s;if(_.info("reset"),!this.__loaded)return _.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(r=this.persistence)===null||r===void 0||r.set_property(xt,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(qt());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionId,r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(e!=null&&e.withTimestamp&&r){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);s+="?t=".concat(l)}return s}},{key:"alias",value:function(e,t){return e===this.get_property(rc)?(_.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(wi,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(_.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,i,r,s,o=k({},this.config);he(e)&&(Pe(this.config,Ku(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new yo(k(k({},this.config),{},{persistence:"sessionStorage"})),fe.is_supported()&&fe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Ye.DEBUG=!0,_.info("set_config",{config:e,oldConfig:o,newConfig:k({},this.config)})),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){var t,i=cn(e)&&e;if(i||e!=null&&e.sampling){var r,s,o=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId();(s=this.persistence)===null||s===void 0||s.register(y({},Si,!0)),_.info("Session recording started with sampling override for session: ",o?.sessionId)}(i||e!=null&&e.linked_flag)&&((t=this.sessionRecording)===null||t===void 0||t.overrideLinkedFlag(),_.info("Session recording started with linked_flags override")),this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"captureException",value:function(e,t){var i=Qe(te.parseErrorAsProperties)?te.parseErrorAsProperties([e.message,void 0,void 0,void 0,e]):k({$exception_type:e.name,$exception_message:e.message,$exception_level:"error"},t);this.exceptions.sendExceptionEvent(i)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Fn;return t!==Fn&&(t=Fn+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(xt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(xt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&jr(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[wi])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[Vr]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(_.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Vr,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,r,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==a&&((i=this.persistence)===null||i===void 0||i.set_disabled(a)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(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()}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"_is_bot",value:function(){return ut?function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&Wu(i,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some(function(s){return Wu(s?.brand,t)}))return!0}catch{}return!!e.webdriver}(ut,this.config.custom_blocked_useragents):void 0}},{key:"_captureInitialPageview",value:function(){T&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:T.title},{send_instantly:!0}))}},{key:"debug",value:function(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}))}}]),n}();(function(n,e){for(var t=0;t<e.length;t++)n.prototype[e[t]]=mf(n.prototype[e[t]])})(Nc,["identify"]);var Qu,jc=(Qu=Ii[Fn]=new Nc,function(){function n(){n.done||(n.done=!0,Lc=!1,Q(Ii,function(e){e._dom_loaded()}))}T!=null&&T.addEventListener&&(T.readyState==="complete"?n():T.addEventListener("DOMContentLoaded",n,!1)),v&&St(v,"load",n,!0)}(),Qu);var qc=jc.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 Me(n,e){if(!qc)throw new Error("Failed to initialize PostHog");qc.capture(n,e)}var ss,Di,os,Ht,Bc,rs,Fi=class Fi extends z(U){constructor(){super();b(this,Ht);b(this,ss,new Dt(this,{onError:console.error}));b(this,Di);b(this,os,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Me("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>Me("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>Me("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>Me("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>Me("ShopAssistant: user clicked link",t),onUserSentInput:t=>Me("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return h(this,Di)||h(this,ss).data}render(){return this.config?D`
329
357
  <!-- embed our chat component forwarding props -->
330
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,vs)}" ?show-close="${this.showClose}" @mw:close-click="${$(this,Wt,zc)}">
358
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,os)}" ?show-close="${this.showClose}" @mw:close-click="${$(this,Ht,Bc)}">
331
359
  <slot name="banner" slot="banner"></slot>
332
360
  </mw-chat>
333
- `:N}injectConfig(t){R(this,Bi,t),this.requestUpdate()}reloadConfig(){h(this,Wt,ds)?.reloadConfig()}get conversationId(){return h(this,Wt,ds)?.conversationId??""}get messages(){return h(this,Wt,ds)?.messages??[]}};hs=new WeakMap,Bi=new WeakMap,vs=new WeakMap,Wt=new WeakSet,zc=function(){this.dispatchEvent(new qi.CloseClickEvent)},ds=function(){return this.renderRoot.querySelector("mw-chat")},k(qi,"styles",ht`
361
+ `:N}injectConfig(t){S(this,Di,t),this.requestUpdate()}reloadConfig(){h(this,Ht,rs)?.reloadConfig()}get conversationId(){return h(this,Ht,rs)?.conversationId??""}get messages(){return h(this,Ht,rs)?.messages??[]}};ss=new WeakMap,Di=new WeakMap,os=new WeakMap,Ht=new WeakSet,Bc=function(){this.dispatchEvent(new Fi.CloseClickEvent)},rs=function(){return this.renderRoot.querySelector("mw-chat")},C(Fi,"styles",ht`
334
362
  :host {
335
363
  all: initial; /* reset all properties that can pierce the shadow DOM */
336
364
  }
337
- `),k(qi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var Ui=qi;customElements.define("molin-shop-ai-chat",Ui);var ca;Ui.CloseClickEvent=(ca=class extends CustomEvent{constructor(e={}){super(Ui.CloseClickEvent.type,{...e})}},k(ca,"type","mw:close-click"),ca);var Wc=n=>n??N;var gs,Hi=class extends z(q){constructor(){super();b(this,gs,new Nt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return h(this,gs).data}render(){return this.config?P`
365
+ `),C(Fi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var Mi=Fi;customElements.define("molin-shop-ai-chat",Mi);var sa;Mi.CloseClickEvent=(sa=class extends CustomEvent{constructor(e={}){super(Mi.CloseClickEvent.type,{...e})}},C(sa,"type","mw:close-click"),sa);var Hc=n=>n??N;var as,Li=class extends z(U){constructor(){super();b(this,as,new Dt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return h(this,as).data}render(){return this.config?D`
338
366
  <!-- embed our bubble component forwarding props -->
339
367
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
340
- <mw-bubble state="${this.state}" src="${Wc(this.config?.bubble?.imageUrl)}"></mw-bubble>
341
- `:N}};gs=new WeakMap,k(Hi,"styles",ht`
368
+ <mw-bubble state="${this.state}" src="${Hc(this.config?.bubble?.imageUrl)}"></mw-bubble>
369
+ `:N}};as=new WeakMap,C(Li,"styles",ht`
342
370
  :host {
343
371
  all: initial; /* reset all properties that can pierce the shadow DOM */
344
372
  }
345
- `),k(Hi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Hi);var ys,zn,Wn,fn,zi,Wi,ms=class{constructor(e,t,i,r=window.history){b(this,ys);b(this,zn);b(this,Wn);b(this,fn);b(this,zi,!1);b(this,Wi,()=>{h(this,zn).test(window.location.pathname)&&h(this,Wn).navigated()});R(this,ys,e),R(this,zn,t),R(this,Wn,i),R(this,fn,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",h(this,Wi));let e=h(this,fn).pushState;h(this,fn).pushState=(...t)=>{if(e.call(h(this,fn),...t),!h(this,zi))try{let i=new URL(t[2],window.location.origin);h(this,zn).test(i.pathname)&&h(this,Wn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",h(this,Wi)),R(this,zi,!0)}};ys=new WeakMap,zn=new WeakMap,Wn=new WeakMap,fn=new WeakMap,zi=new WeakMap,Wi=new WeakMap;function Vc({min:n,max:e}){return Math.floor(Math.random()*(e-n+1))+n*1e3}var Vt,dt,fa,Vi,pa=class{constructor(e=window.localStorage){b(this,dt);b(this,Vt);R(this,Vt,e)}setex(e,t,i){return h(this,Vt).setItem(e,$(this,dt,Vi).call(this,{value:$(this,dt,Vi).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return h(this,Vt).setItem(e,$(this,dt,Vi).call(this,{value:$(this,dt,Vi).call(this,t)})||"")}get(e){let t=h(this,Vt).getItem(e);if(!t)return;let i=$(this,dt,fa).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){h(this,Vt).removeItem(e);return}return $(this,dt,fa).call(this,i.value)}}};Vt=new WeakMap,dt=new WeakSet,fa=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Vi=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var da=new pa;function _s(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var Gc="molin-shop-ai-widget-open",bs,Ji,ha,De,ws,le,Xi,Xc,Jc,Yc,Kc,Vn,Gi=class extends z(q){constructor(){super();b(this,le);b(this,bs,new Nt(this,{onError:console.error}));b(this,Ji);b(this,ha,new ms(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=h(this,le,Xc);t&&Oe("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,De,!1);b(this,ws,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Oe("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>Oe("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>Oe("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>Oe("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>Oe("ShopAssistant: user clicked link",t),onUserSentInput:t=>Oe("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return h(this,Ji)||h(this,bs).data}render(){if(!this.config)return N;let t=this.config.bubble.position;"left"in t&&"right"in t&&delete t.right;let i=[_s(this.config.bubble.position),_s(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),r=_s(this.config.bubble.position),s={bottom:"72px"},o=Object.entries(this.config.bubble.position).filter(([l,u])=>u).map(([l,u])=>{let c=`sm:${l}-[calc(${[s[l],u].filter(p=>!!p).join("+")})]`;return l==="left"&&(c+=" sm:right-auto"),l==="right"&&(c+=" sm:left-auto"),c}).join(" "),a=o;return this.config.hidden?N:P`
346
- <mw-bubble class="${i} fixed z-[2147483647]" @click="${$(this,le,Yc)}" state="${h(this,De)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
373
+ `),C(Li,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Li);var us,Hn,zn,dn,Ni,ji,ls=class{constructor(e,t,i,r=window.history){b(this,us);b(this,Hn);b(this,zn);b(this,dn);b(this,Ni,!1);b(this,ji,()=>{h(this,Hn).test(window.location.pathname)&&h(this,zn).navigated()});S(this,us,e),S(this,Hn,t),S(this,zn,i),S(this,dn,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",h(this,ji));let e=h(this,dn).pushState;h(this,dn).pushState=(...t)=>{if(e.call(h(this,dn),...t),!h(this,Ni))try{let i=new URL(t[2],window.location.origin);h(this,Hn).test(i.pathname)&&h(this,zn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",h(this,ji)),S(this,Ni,!0)}};us=new WeakMap,Hn=new WeakMap,zn=new WeakMap,dn=new WeakMap,Ni=new WeakMap,ji=new WeakMap;function zc({min:n,max:e}){return Math.floor(Math.random()*(e-n+1))+n*1e3}var zt,dt,aa,qi,oa=class{constructor(e=window.localStorage){b(this,dt);b(this,zt);S(this,zt,e)}setex(e,t,i){return h(this,zt).setItem(e,$(this,dt,qi).call(this,{value:$(this,dt,qi).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return h(this,zt).setItem(e,$(this,dt,qi).call(this,{value:$(this,dt,qi).call(this,t)})||"")}get(e){let t=h(this,zt).getItem(e);if(!t)return;let i=$(this,dt,aa).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){h(this,zt).removeItem(e);return}return $(this,dt,aa).call(this,i.value)}}};zt=new WeakMap,dt=new WeakSet,aa=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},qi=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var la=new oa;function cs(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var Wc="molin-shop-ai-widget-open",ps,Hi,ua,De,fs,le,Bi,Vc,Gc,Xc,Jc,Wn,Ui=class extends z(U){constructor(){super();b(this,le);b(this,ps,new Dt(this,{onError:console.error}));b(this,Hi);b(this,ua,new ls(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=h(this,le,Vc);t&&Me("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,De,!1);b(this,fs,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Me("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>Me("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>Me("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>Me("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>Me("ShopAssistant: user clicked link",t),onUserSentInput:t=>Me("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return h(this,Hi)||h(this,ps).data}render(){if(!this.config)return N;let t=this.config.bubble.position;"left"in t&&"right"in t&&delete t.right;let i=[cs(this.config.bubble.position),cs(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),r=cs(this.config.bubble.position),s=Object.entries(this.config.bubble.position).filter(([a,l])=>l).map(([a,l])=>{let u=`sm:${a}-[${l}]`;return a==="left"&&(u+=" sm:right-auto"),a==="right"&&(u+=" sm:left-auto"),u}).join(" "),o=s;return this.config.hidden?N:D`
374
+ <mw-bubble class="${i} fixed z-[2147483647]" @click="${$(this,le,Xc)}" state="${h(this,De)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
347
375
 
348
376
  <!-- only load the component if enabled on any platform -->
349
- ${this.isPopupEnabled?P`
377
+ ${this.isPopupEnabled?D`
350
378
  <mw-popup
351
- position="${a}"
352
- delay="${this.config.popup?.delayMs||Vc({min:2,max:5})}"
379
+ position="${o}"
380
+ delay="${this.config.popup?.delayMs||zc({min:2,max:5})}"
353
381
  sound="https://molin.ai/sounds/widget/popup.aac"
354
382
  .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}}}"
355
- @mw:click="${$(this,le,Jc)}"></mw-popup>
383
+ @mw:click="${$(this,le,Gc)}"></mw-popup>
356
384
  `:N}
357
385
 
358
386
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
359
- ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?P`<mw-try-it-out class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}" position="${r}" text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:N}
387
+ ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?D`<mw-try-it-out class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}" position="${r}" text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:N}
360
388
 
361
389
  <!-- 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. -->
362
- ${this._dialogAlreadyShown?P`
363
- <div
364
- class="${h(this,De)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${o} fixed inset-0 z-[2147483647] overflow-hidden bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:h-4/5 sm:max-h-[800px] sm:w-[calc(100dvh*0.45)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-2xl 2xl:max-w-[420px]">
365
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,ws)}" ?show-close="${!0}" @mw:close-click="${$(this,le,Kc)}">
390
+ ${this._dialogAlreadyShown?D`
391
+ <div class="${h(this,De)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${s} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all 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-[2.25rem] 2xl:max-w-[420px]">
392
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,fs)}" ?show-close="${!0}" @mw:close-click="${$(this,le,Jc)}">
366
393
  <slot name="banner" slot="banner"></slot>
367
394
  </mw-chat>
368
395
  </div>
369
396
  `:N}
370
- `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){h(this,De)&&h(this,le,Xi)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&da.get(Gc)?.isOpen&&this.openChat()}openChat(){h(this,De)||(R(this,De,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,le,Vn).call(this,!0),h(this,le,Xi)?.hide())}closeChat(){h(this,De)&&(R(this,De,!1),this.requestUpdate(),$(this,le,Vn).call(this,!1),h(this,le,Xi)?.hide())}injectConfig(t){R(this,Ji,t),this.requestUpdate()}};bs=new WeakMap,Ji=new WeakMap,ha=new WeakMap,De=new WeakMap,ws=new WeakMap,le=new WeakSet,Xi=function(){return this.renderRoot.querySelector("mw-popup")},Xc=function(){return this.renderRoot.querySelector("mw-chat")},Jc=function(){R(this,De,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,le,Vn).call(this,!0)},Yc=function(){R(this,De,!h(this,De)),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,le,Vn).call(this,h(this,De)),h(this,le,Xi)?.hide()},Kc=function(){R(this,De,!1),this.requestUpdate(),$(this,le,Vn).call(this,!1)},Vn=function(t){da.set(Gc,{isOpen:t})},k(Gi,"styles",ht`
397
+ `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){h(this,De)&&h(this,le,Bi)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&la.get(Wc)?.isOpen&&this.openChat()}openChat(){h(this,De)||(S(this,De,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,le,Wn).call(this,!0),h(this,le,Bi)?.hide())}closeChat(){h(this,De)&&(S(this,De,!1),this.requestUpdate(),$(this,le,Wn).call(this,!1),h(this,le,Bi)?.hide())}injectConfig(t){S(this,Hi,t),this.requestUpdate()}};ps=new WeakMap,Hi=new WeakMap,ua=new WeakMap,De=new WeakMap,fs=new WeakMap,le=new WeakSet,Bi=function(){return this.renderRoot.querySelector("mw-popup")},Vc=function(){return this.renderRoot.querySelector("mw-chat")},Gc=function(){S(this,De,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,le,Wn).call(this,!0)},Xc=function(){S(this,De,!h(this,De)),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,le,Wn).call(this,h(this,De)),h(this,le,Bi)?.hide()},Jc=function(){S(this,De,!1),this.requestUpdate(),$(this,le,Wn).call(this,!1)},Wn=function(t){la.set(Wc,{isOpen:t})},C(Ui,"styles",ht`
371
398
  :host {
372
399
  all: initial; /* reset all properties that can pierce the shadow DOM */
373
400
  }
374
- `),k(Gi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",Gi);
401
+ `),C(Ui,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",Ui);
375
402
  /*! Bundled license information:
376
403
 
377
404
  @lit/reactive-element/css-tag.js: