@molin.ai/shop-ai 0.6.23 → 0.6.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- var Mc=Object.defineProperty;var ta=n=>{throw TypeError(n)};var Dc=(n,e,t)=>e in n?Mc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var S=(n,e,t)=>Dc(n,typeof e!="symbol"?e+"":e,t),us=(n,e,t)=>e.has(n)||ta("Cannot "+t);var h=(n,e,t)=>(us(n,e,"read from private field"),t?t.call(n):e.get(n)),b=(n,e,t)=>e.has(n)?ta("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,i)=>(us(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),R=(n,e,t)=>(us(n,e,"access private method"),t);var na=(n,e,t,i)=>({set _(r){$(n,e,r,t)},get _(){return h(n,e,i)}});function _s(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function Lc(n,e=","){return n.map(_s).join(e)}var ua=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Li(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 Ni(n,e="@media "){return e+J(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function J(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function ia(n){return n}function Ui(){}var ce={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function ca(n){return n.match(/[-=:;]/g)?.length||0}function ds(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(ca(n),15)<<18}var jc=["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 bs({n,i:e,v:t=[]},i,r,s){n&&(n=_s({n,i:e,v:t})),s=[...J(s)];for(let a of t){let l=i.theme("screens",a);for(let u of J(l&&Ni(l)||i.v(a))){var o;s.push(u),r|=l?67108864|ds(u):a=="dark"?1073741824:u[0]=="@"?ds(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~jc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var pa=new Map;function gs(n){if(n.d){let e=[],t=cs(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?cs(i,s=>cs(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):ps(s,o)}return ps(o,s)})):i,"&"),i=>ps(i,n.n?"."+ua(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function cs(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function ps(n,e){return n.replace(/&/g,e)}var ra=new Intl.Collator("en",{numeric:!0});function fa(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||ra.compare(sa(n.n),sa(e.n))||ra.compare(oa(n.n),oa(e.n))}function sa(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function oa(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function fs(n,e){return Math.round(parseInt(n,16)*e)}function He(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(${[fs(n.substr(1,s),o),fs(n.substr(1+s,s),o),fs(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function da(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:u=[],i:c},p){let f=[],d="",g=0,v=0;for(let E in o||{}){var k,L;let F=o[E];if(E[0]=="@"){if(!F)continue;if(E[1]=="a"){f.push(...xs(a,l,qi(""+F),p,l,u,c,!0));continue}if(E[1]=="l"){for(let U of J(F))f.push(...s(U,{n:a,p:(k=ce[E[7]],l&~ce.o|k),r:E[7]=="d"?[]:u,i:c},p));continue}if(E[1]=="i"){f.push(...J(F).map(U=>({p:-1,o:0,r:[],d:E+" "+U})));continue}if(E[1]=="k"){f.push({p:ce.d,o:0,r:[E],d:s(F,{p:ce.d},p).map(gs).join("")});continue}if(E[1]=="f"){f.push(...J(F).map(U=>({p:ce.d,o:0,r:[E],d:s(U,{p:ce.d},p).map(gs).join("")})));continue}}if(typeof F!="object"||Array.isArray(F))E=="label"&&F?a=F+Li(JSON.stringify([l,c,o])):(F||F===0)&&(E=E.replace(/[A-Z]/g,U=>"-"+U.toLowerCase()),v+=1,g=Math.max(g,(L=E)[0]=="-"?0:ca(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?";":"")+J(F).map(U=>p.s(E,ws(""+U,p.theme)+(c?" !important":""))).join(";"));else if(E[0]=="@"||E.includes("&")){let U=l;E[0]=="@"&&(E=E.replace(/\bscreen\(([^)]+)\)/g,(G,Q)=>{let K=p.theme("screens",Q);return K?(U|=67108864,Ni(K,"")):G}),U|=ds(E)),f.push(...s(F,{n:a,p:U,r:[...u,E],i:c},p))}else f.push(...s(F,{p:l,r:[...u,E]},p))}return f.unshift({n:a,p:l,o:Math.max(0,15-v)+1.5*Math.min(g||15,15),r:u,d}),f.sort(ha)}(n,bs(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)?He(a):""+J(a).filter(l=>Object(l)!==l)})}function ga(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 ji(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,v){let k=pa.get(g.n);return k?k(g,v):v.r(g.n,g.v[0]=="dark")}(l,u);return d?typeof d=="string"?({r:p,p:c}=bs(l,u,c,p),ga(ji(qi(d),u,c,p,l.i),l.n)):Array.isArray(d)?d.map(g=>{var v,k;return{o:0,...g,r:[...J(p),...J(g.r)],p:(v=c,k=g.p??c,v&~ce.o|k)}}):da(d,l,u,c,p):[{c:_s(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(fa(s,a),0,a);return s}function xs(n,e,t,i,r,s,o,a){return ga((a?t.flatMap(l=>ji([l],i,r,s,o)):ji(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 qc(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:u,i:c}=bs(s,o,e);return t&&xs(a,e,t,o,l,u,c,i)},pa.set(n,r),n}function hs(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(Nc),i:r}))}}function Nc(n,e,t){return t.indexOf(n)==e}var aa=new Map;function qi(n){let e=aa.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&&hs(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,hs([...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);hs([...t,qc(p.length>1?p.slice(0,-1)+Li(JSON.stringify([p,f])):p+"("+Lc(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),aa.set(n,e=i[0])}return e}function _(n,e,t){return[n,ms(e,t)]}function ms(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):vs(t,1)}):t=>n||{[t[1]]:vs(t,2)}}function vs(n,e,t=n.slice(e).find(Boolean)||n.$$||n.input){return n.input[0]=="-"?`calc(${t} * -1)`:t}function w(n,e,t,i){return[n,ks(e,t,i)]}function ks(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=ma(n||r[1]),a=s.theme(o,r.$$)??it(r.$$,o,s);if(a!=null)return r._=vs(r,0,a),i(r,s,o)}}function pe(n,e={},t){return[n,Uc(e,t)]}function Uc(n={},e){return(t,i)=>{let{section:r=ma(t[0]).replace("-","")+"Color"}=n,[s,o]=Bc(t.$$);if(!s)return;let a=i.theme(r,s)||it(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&&it(o,u,i),d=e||(({_:v})=>{let k=Un(c,v);return p?{[p]:k}:k});t._={value:He(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:v=>He(a,v),opacityVariable:l||void 0,opacityValue:f||void 0};let g=d(t,i);if(!t.dark){let v=i.d(r,s,a);v&&v!==a&&(t._={value:He(v,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:k=>He(v,k),opacityVariable:l||void 0,opacityValue:f||void 0},g={"&":g,[i.v("dark")]:d(t,i)})}return g}}function Bc(n){return(n.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Un(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 it(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=ln(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 ma(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function ln(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>ln(t)+i+ln(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 Bn({presets:n=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:J(e.variants),rules:J(e.rules),ignorelist:J(e.ignorelist),hash:void 0,stringify:(i,r)=>i+":"+r,finalize:[]};for(let i of J([...n,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&J(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,...J(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...J(l)],rules:[...t.rules,...J(u)],ignorelist:[...t.ignorelist,...J(c)],hash:p,stringify:f,finalize:[...t.finalize,...J(d)]}}return t}function la(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 zc(n){var e;return ys(n[0],typeof(e=n[1])=="function"?e:()=>e)}function Hc(n){var e,t;return Array.isArray(n)?ys(n[0],ms(n[1],n[2])):ys(n,ms(e,t))}function ys(n,e){return va(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 va(n,e){let t=J(n).map(Wc);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function Wc(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function ya(n,e){let t=Bn(n),i=function({theme:l,darkMode:u,darkColor:c=Ui,variants:p,rules:f,hash:d,stringify:g,ignorelist:v,finalize:k}){let L=new Map,E=new Map,F=new Map,U=new Map,G=va(v,(I,oe)=>oe.test(I));p.push(["dark",Array.isArray(u)||u=="class"?`${J(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let Q=typeof d=="function"?I=>d(I,Li):d?Li:ia;Q!==ia&&k.push(I=>({...I,n:I.n&&Q(I.n),d:I.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(oe,ee)=>"--"+Q(ee).replace("#",""))}));let K={theme:function({extend:I={},...oe}){let ee={},ct={get colors(){return me("colors")},theme:me,negative(){return{}},breakpoints(V){let Z={};for(let ae in V)typeof V[ae]=="string"&&(Z["screen-"+ae]=V[ae]);return Z}};return me;function me(V,Z,ae,Fe){if(V){if({1:V,2:Fe}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(V)||[,V],/[.[]/.test(V)){let Se=[];V.replace(/\[([^\]]+)\]|([^.[]+)/g,(te,ve,Ce=ve)=>Se.push(Ce)),V=Se.shift(),ae=Z,Z=Se.join("-")}let ie=ee[V]||Object.assign(Object.assign(ee[V]={},ze(oe,V)),ze(I,V));if(Z==null)return ie;Z||(Z="DEFAULT");let ke=ie[Z]??Z.split("-").reduce((Se,te)=>Se?.[te],ie)??ae;return Fe?He(ke,{opacityValue:ws(Fe,me)}):ke}let je={};for(let ie of[...Object.keys(oe),...Object.keys(I)])je[ie]=me(ie);return je}function ze(V,Z){let ae=V[Z];return typeof ae=="function"&&(ae=ae(ct)),ae&&/color|fill|stroke/i.test(Z)?function Fe(je,ie=[]){let ke={};for(let Se in je){let te=je[Se],ve=[...ie,Se];ke[ve.join("-")]=te,Se=="DEFAULT"&&(ve=ie,ke[ie.join("-")]=te),typeof te=="object"&&Object.assign(ke,Fe(te,ve))}return ke}(ae):ae}}(l),e:ua,h:Q,s(I,oe){return g(I,oe,K)},d(I,oe,ee){return c(I,oe,K,ee)},v(I){return L.has(I)||L.set(I,la(I,p,E,zc,K)||"&:"+I),L.get(I)},r(I,oe){let ee=JSON.stringify([I,oe]);return F.has(ee)||F.set(ee,!G(I,K)&&la(I,f,U,Hc,K,oe)),F.get(ee)},f(I){return k.reduce((oe,ee)=>ee(oe,K),I)}};return K}(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=gs(u);if(c&&!o.has(c)){o.add(c);let p=fa(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 J(t.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?xs("",ce.b,qi(p),i,ce.b,[],!1,!0):da(p,{},i,ce.b)).forEach(a);u=""+u;let c=r.get(u);if(!c){let p=new Set;for(let f of ji(qi(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 Gc(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function _a(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&&Gc(o,s=n(o))&&r.setAttribute("class",s)}}function Vc(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 Bi(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:Vc(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:Ui}}var Xc=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 ba(n){return Xc.get(n)}function wa(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 xa(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 Jc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function zi(){return({stringify:n})=>({stringify(e,t,i){let r="",s=ba(e);s&&(r+=n(s,t,i)+";");let o=wa(e),a=xa(e,t);for(let l of Jc)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 Hi(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",ks("lineClamp",({_:n})=>ka(n))],["line-clamp-(\\d+)",({1:n})=>ka(n)]]}}function ka(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var Hn={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...qe(4,"rem",4,.5,.5),...qe(12,"rem",4,5),14:"3.5rem",...qe(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:B("blur"),backdropBrightness:B("brightness"),backdropContrast:B("contrast"),backdropGrayscale:B("grayscale"),backdropHueRotate:B("hueRotate"),backdropInvert:B("invert"),backdropOpacity:B("opacity"),backdropSaturate:B("saturate"),backdropSepia:B("sepia"),backgroundColor:B("colors"),backgroundImage:{none:"none"},backgroundOpacity:B("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...qe(200,"",100,0,50),...qe(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:B("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:B("spacing"),borderWidth:{DEFAULT:"1px",...We(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:B("colors"),caretColor:B("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...qe(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:B("borderColor"),divideOpacity:B("borderOpacity"),divideWidth:B("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:B("spacing"),gradientColorStops:B("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:{...qe(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:{...qe(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:B("spacing"),placeholderColor:B("colors"),placeholderOpacity:B("opacity"),outlineColor:B("colors"),outlineOffset:We(8,"px"),outlineWidth:We(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:B("colors"),ringOffsetWidth:We(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...We(8,"px")},rotate:{...We(2,"deg"),...We(12,"deg",3),...We(180,"deg",45)},saturate:qe(200,"",100,0,50),scale:{...qe(150,"",100,0,50),...qe(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:B("spacing"),scrollPadding:B("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...We(2,"deg"),...We(12,"deg",3)},space:B("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:qe(2),textColor:B("colors"),textDecorationColor:B("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...We(8,"px")},textUnderlineOffset:{auto:"auto",...We(8,"px")},textIndent:B("spacing"),textOpacity:B("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:B("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:{...qe(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 We(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function qe(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function B(n){return({theme:e})=>e(n)}var Sa={"*,::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, ${Hn.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, ${Hn.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 Ta=[_("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:it(`[${e}]`,"",t)}}})),_("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),w("aspect-","aspectRatio"),_("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[Ni(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}}}),w("content-","content",({_:n})=>({"--tw-content":n,content:"var(--tw-content)"})),_("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),_("box-(border|content)","boxSizing",({1:n})=>n+"-box"),_("hidden",{display:"none"}),_("table-(auto|fixed)","tableLayout"),_(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",_("isolate","isolation"),_("object-(contain|cover|fill|none|scale-down)","objectFit"),w("object-","objectPosition"),_("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Wi),_("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),_("(static|fixed|absolute|relative|sticky)","position"),w("-?inset(-[xy])?(?:$|-)","inset",({1:n,_:e})=>({top:n!="-x"&&e,right:n!="-y"&&e,bottom:n!="-x"&&e,left:n!="-y"&&e})),w("-?(top|bottom|left|right)(?:$|-)","inset"),_("(visible|collapse)","visibility"),_("invisible",{visibility:"hidden"}),w("-?z-","zIndex"),_("flex-((row|col)(-reverse)?)","flexDirection",Ea),_("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),w("(flex-(?:grow|shrink))(?:$|-)"),w("(flex)-"),w("grow(?:$|-)","flexGrow"),w("shrink(?:$|-)","flexShrink"),w("basis-","flexBasis"),w("-?(order)-"),"-?(order)-(\\d+)",w("grid-cols-","gridTemplateColumns"),_("grid-cols-(\\d+)","gridTemplateColumns",Ia),w("col-","gridColumn"),_("col-(span)-(\\d+)","gridColumn",Aa),w("col-start-","gridColumnStart"),_("col-start-(auto|\\d+)","gridColumnStart"),w("col-end-","gridColumnEnd"),_("col-end-(auto|\\d+)","gridColumnEnd"),w("grid-rows-","gridTemplateRows"),_("grid-rows-(\\d+)","gridTemplateRows",Ia),w("row-","gridRow"),_("row-(span)-(\\d+)","gridRow",Aa),w("row-start-","gridRowStart"),_("row-start-(auto|\\d+)","gridRowStart"),w("row-end-","gridRowEnd"),_("row-end-(auto|\\d+)","gridRowEnd"),_("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>Wi(Ea(n))),_("grid-flow-(dense)","gridAutoFlow"),w("auto-cols-","gridAutoColumns"),w("auto-rows-","gridAutoRows"),w("gap-x(?:$|-)","gap","columnGap"),w("gap-y(?:$|-)","gap","rowGap"),w("gap(?:$|-)","gap"),"(justify-(?:items|self))-",_("justify-","justifyContent",$a),_("(content|items|self)-",n=>({["align-"+n[1]]:$a(n)})),_("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),w("p([xytrbl])?(?:$|-)","padding",un("padding")),w("-?m([xytrbl])?(?:$|-)","margin",un("margin")),w("-?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))`}})),_("space-(x|y)-reverse",({1:n})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"1"}})),w("w-","width"),w("min-w-","minWidth"),w("max-w-","maxWidth"),w("h-","height"),w("min-h-","minHeight"),w("max-h-","maxHeight"),w("font-","fontWeight"),w("font-","fontFamily",({_:n})=>typeof(n=J(n))[1]=="string"?{fontFamily:Je(n)}:{fontFamily:Je(n[0]),...n[1]}),_("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),_("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),_("italic","fontStyle"),_("not-italic",{fontStyle:"normal"}),_("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1: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)",...xt({"--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,/*!*/ /*!*/)"})}),w("tracking-","letterSpacing"),w("leading-","lineHeight"),_("list-(inside|outside)","listStylePosition"),w("list-","listStyleType"),_("list-","listStyleType"),w("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),pe("placeholder-",{property:"color",selector:"&::placeholder"}),_("text-(left|center|right|justify|start|end)","textAlign"),_("text-(ellipsis|clip)","textOverflow"),w("text-opacity-","textOpacity","--tw-text-opacity"),pe("text-",{property:"color"}),w("text-","fontSize",({_:n})=>typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}),w("indent-","textIndent"),_("(overline|underline|line-through)","textDecorationLine"),_("no-underline",{textDecorationLine:"none"}),w("underline-offset-","textUnderlineOffset"),pe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),w("decoration-","textDecorationThickness"),_("decoration-","textDecorationStyle"),_("(uppercase|lowercase|capitalize)","textTransform"),_("normal-case",{textTransform:"none"}),_("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),_("align-","verticalAlign"),_("whitespace-","whiteSpace"),_("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),_("break-words",{overflowWrap:"break-word"}),_("break-all",{wordBreak:"break-all"}),_("break-keep",{wordBreak:"keep-all"}),pe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),pe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),_("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${Ut(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"}),_("bg-(fixed|local|scroll)","backgroundAttachment"),_("bg-origin-(border|padding|content)","backgroundOrigin",({1:n})=>n+"-box"),_(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),_("bg-blend-","backgroundBlendMode"),_("bg-clip-(border|padding|content|text)","backgroundClip",({1:n})=>n+(n=="text"?"":"-box")),w("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),pe("bg-",{section:"backgroundColor"}),w("bg-","backgroundImage"),w("bg-","backgroundPosition"),_("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Wi),w("bg-","backgroundSize"),w("rounded(?:$|-)","borderRadius"),w("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-${Ut(t[0])}-radius`]:e,[`border-${Ut(t[1])}-radius`]:e}}),_("border-(collapse|separate)","borderCollapse"),w("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),_("border-(solid|dashed|dotted|double|none)","borderStyle"),w("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...xt({"--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"},un("border","Color")),pe("border-"),w("border-([xytrbl])(?:$|-)","borderWidth",un("border","Width")),w("border(?:$|-)","borderWidth"),w("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),_("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),_("divide-([xy]-reverse)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+n]:"1"}})),w("divide-([xy])(?:$|-)","divideWidth",({1:n,_:e})=>{let t={x:"lr",y:"tb"}[n];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${n}-reverse`]:"0",[`border-${Ut(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${Ut(t[1])}Width`]:`calc(${e} * var(--tw-divide-${n}-reverse))`}}}),pe("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),w("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),pe("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),w("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),_("ring-inset",{"--tw-ring-inset":"inset"}),pe("ring-",{property:"--tw-ring-color"}),w("ring(?:$|-)","ringWidth",({_:n},{theme:e})=>({...xt({"--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":He(e("ringOffsetColor","","#fff")),"--tw-ring-color":He(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)"})),w("shadow(?:$|-)","boxShadow",({_:n})=>({...xt({"--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":Je(n),"--tw-shadow-colored":Je(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)"})),w("(opacity)-"),_("mix-blend-","mixBlendMode"),...Ca(),...Ca("backdrop-"),w("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:Je(n),transitionTimingFunction:n._=="none"?void 0:Je(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:Je(e("transitionDuration",""))})),w("duration(?:$|-)","transitionDuration","transitionDuration",Je),w("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Je),w("delay(?:$|-)","transitionDelay","transitionDelay",Je),w("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=Je(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)",_("transform",Es),_("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":Ra(n=="gpu")})),w("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...Es()})),w("-?(rotate)-","rotate",Ss),w("-?(translate-[xy])-","translate",Ss),w("-?(skew-[xy])-","skew",Ss),_("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Wi),"(appearance)-",w("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",w("(cursor)-"),"(cursor)-",_("snap-(none)","scroll-snap-type"),_("snap-(x|y|both)",({1:n})=>({...xt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" var(--tw-scroll-snap-strictness)"})),_("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),_("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),_("snap-(normal|always)","scroll-snap-stop"),_("scroll-(auto|smooth)","scroll-behavior"),w("scroll-p([xytrbl])?(?:$|-)","padding",un("scroll-padding")),w("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",un("scroll-margin")),_("touch-(auto|none|manipulation)","touch-action"),_("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,2:e,3:t})=>({...xt({"--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)"})),_("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),_("outline",{outlineStyle:"solid"}),_("outline-(dashed|dotted|double)","outlineStyle"),w("-?(outline-offset)-"),pe("outline-",{opacityVariable:!1,opacitySection:"opacity"}),w("outline-","outlineWidth"),"(pointer-events)-",w("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:n})=>({x:"horizontal",y:"vertical"})[n]||n||"both"],_("select-(none|text|all|auto)","userSelect"),pe("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),pe("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),w("stroke-","strokeWidth"),_("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),_("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Wi(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function Ea(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function Ut(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 Je(n){return n&&""+(n._||n)}function $a({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function un(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...Un(n+"-"+Ut(r[0])+e,i),...Un(n+"-"+Ut(r[1])+e,i)}:Un(n+e,i)}}function Ca(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={...xt(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,_(`${n}filter`,t),...e.map(i=>w(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:J(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function Ss({1:n,_:e}){return{["--tw-"+n]:e,...Es()}}function Es(){return{...xt({"--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":Ra()}),transform:"var(--tw-transform)"}}function Ra(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 Aa({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function Ia({1:n}){return`repeat(${n},minmax(0,1fr))`}function xt(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var Pa=[["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)||it(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=ln(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)||it(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)||it(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=it(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&ln(n).replace(/[}]+$/,"").split("{")]];function Oa({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:Sa,theme:{...Hn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:Pa,rules:Ta,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 Yc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Kc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Qc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Zc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},ep={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},tp={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},np={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},ip={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},rp={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},sp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},op={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},ap={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},lp={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"},cp={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},pp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},fp={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"},dp={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"},mp={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},vp={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Fa={__proto__:null,slate:Yc,gray:Kc,zinc:Qc,neutral:Zc,stone:ep,red:tp,orange:np,amber:ip,yellow:rp,lime:sp,green:op,emerald:ap,teal:lp,cyan:up,sky:cp,blue:pp,indigo:fp,violet:hp,purple:dp,fuchsia:gp,pink:mp,rose:vp};function Gi({disablePreflight:n}={}){return Oa({colors:Fa,disablePreflight:n})}function Vi({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)=>La(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=Da(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[Ma(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"}}),Ma(n,o,t)],"@layer components":{...Da(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]=He(d);let g=f!=l&&o.d("colors",`${s}-${p}`,d);g&&(l["--tw-prose-"+c]=He(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 Ma(n,e,t){let i={};for(let r in t)i[La(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function La(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 Da(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 $s=Bn({darkMode:"class",theme:{extend:{fontFamily:{display:["Space Grotesk","sans-serif"],sans:["Open Sans","sans-serif"],serif:["Roboto Slab","serif"],mono:["Roboto Mono","monospace"]},colors:{primary:{50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"},secondary:{50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},tertiary:{50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"}}}},presets:[Gi(),zi(),Hi(),Vi()],hash:!1});function Xi(n,e=!0){let t=function(){if(yp)try{let l=Bi(new CSSStyleSheet);return l.connect=u=>{let c=Cs(u);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=Ui,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Bi(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");Cs(l).appendChild(u);let c=Bi(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=ya({...n,hash:n.hash??e},t),r=_a(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(Cs(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 Cs(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var As=n=>Xi($s)(n);var Ji=globalThis,Yi=Ji.ShadowRoot&&(Ji.ShadyCSS===void 0||Ji.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Is=Symbol(),ja=new WeakMap,Wn=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Is)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(Yi&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=ja.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ja.set(t,e))}return e}toString(){return this.cssText}},qa=n=>new Wn(typeof n=="string"?n:n+"",void 0,Is),Ts=(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 Wn(t,n,Is)},Rs=(n,e)=>{if(Yi)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=Ji.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},Ki=Yi?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return qa(t)})(n):n;var{is:_p,defineProperty:bp,getOwnPropertyDescriptor:wp,getOwnPropertyNames:xp,getOwnPropertySymbols:kp,getPrototypeOf:Sp}=Object,Qi=globalThis,Na=Qi.trustedTypes,Ep=Na?Na.emptyScript:"",$p=Qi.reactiveElementPolyfillSupport,Gn=(n,e)=>n,Ps={toAttribute(n,e){switch(e){case Boolean:n=n?Ep: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)=>!_p(n,e),Ua={attribute:!0,type:String,converter:Ps,reflect:!1,hasChanged:Ba};Symbol.metadata??=Symbol("metadata"),Qi.litPropertyMetadata??=new WeakMap;var pt=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=Ua){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&&bp(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=wp(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)??Ua}static _$Ei(){if(this.hasOwnProperty(Gn("elementProperties")))return;let e=Sp(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=[...xp(t),...kp(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(Ki(r))}else e!==void 0&&t.push(Ki(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 Rs(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:Ps).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:Ps;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){}};pt.elementStyles=[],pt.shadowRootOptions={mode:"open"},pt[Gn("elementProperties")]=new Map,pt[Gn("finalized")]=new Map,$p?.({ReactiveElement:pt}),(Qi.reactiveElementVersions??=[]).push("2.0.4");var Fs=globalThis,Zi=Fs.trustedTypes,za=Zi?Zi.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ms="$lit$",ft=`lit$${Math.random().toFixed(9).slice(2)}$`,Ds="?"+ft,Cp=`<${Ds}>`,Ht=document,Xn=()=>Ht.createComment(""),Jn=n=>n===null||typeof n!="object"&&typeof n!="function",Ja=Array.isArray,Ya=n=>Ja(n)||typeof n?.[Symbol.iterator]=="function",Os=`[
2
- \f\r]`,Vn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ha=/-->/g,Wa=/>/g,Bt=RegExp(`>|${Os}(?:([^\\s"'>=/]+)(${Os}*=${Os}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ga=/'/g,Va=/"/g,Ka=/^(?:script|style|textarea|title)$/i,Qa=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),O=Qa(1),gd=Qa(2),Ye=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),Xa=new WeakMap,zt=Ht.createTreeWalker(Ht,129);function Za(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return za!==void 0?za.createHTML(e):e}var el=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":"",o=Vn;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===Vn?c[1]==="!--"?o=Ha:c[1]!==void 0?o=Wa:c[2]!==void 0?(Ka.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Bt):c[3]!==void 0&&(o=Bt):o===Bt?c[0]===">"?(o=r??Vn,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Bt:c[3]==='"'?Va:Ga):o===Va||o===Ga?o=Bt:o===Ha||o===Wa?o=Vn:(o=Bt,r=void 0);let d=o===Bt&&n[a+1].startsWith("/>")?" ":"";s+=o===Vn?l+Cp:p>=0?(i.push(u),l.slice(0,p)+Ms+l.slice(p)+ft+d):l+ft+(p===-2?a:d)}return[Za(n,s+(n[t]||"<?>")+(e===2?"</svg>":"")),i]},Yn=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]=el(e,t);if(this.el=n.createElement(u,i),zt.currentNode=this.el.content,t===2){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=zt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(Ms)){let f=c[o++],d=r.getAttribute(p).split(ft),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:g[2],strings:d,ctor:g[1]==="."?tr:g[1]==="?"?nr:g[1]==="@"?ir:Gt}),r.removeAttribute(p)}else p.startsWith(ft)&&(l.push({type:6,index:s}),r.removeAttribute(p));if(Ka.test(r.tagName)){let p=r.textContent.split(ft),f=p.length-1;if(f>0){r.textContent=Zi?Zi.emptyScript:"";for(let d=0;d<f;d++)r.append(p[d],Xn()),zt.nextNode(),l.push({type:2,index:++s});r.append(p[f],Xn())}}}else if(r.nodeType===8)if(r.data===Ds)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(ft,p+1))!==-1;)l.push({type:7,index:s}),p+=ft.length-1}s++}}static createElement(e,t){let i=Ht.createElement("template");return i.innerHTML=e,i}};function Wt(n,e,t=n,i){if(e===Ye)return e;let r=i!==void 0?t._$Co?.[i]:t._$Cl,s=Jn(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._$Co??=[])[i]=r:t._$Cl=r),r!==void 0&&(e=Wt(n,r._$AS(n,e.values),r,i)),e}var er=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??Ht).importNode(t,!0);zt.currentNode=r;let s=zt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new cn(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new rr(s,this,e)),this._$AV.push(u),l=i[++a]}o!==l?.index&&(s=zt.nextNode(),o++)}return zt.currentNode=Ht,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++}},cn=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=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=Wt(this,e,t),Jn(e)?e===D||e==null||e===""?(this._$AH!==D&&this._$AR(),this._$AH=D):e!==this._$AH&&e!==Ye&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ya(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==D&&Jn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ht.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=Yn.createElement(Za(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new er(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Xa.get(e.strings);return t===void 0&&Xa.set(e.strings,t=new Yn(e)),t}k(e){Ja(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.S(Xn()),this.S(Xn()),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._$Cv=e,this._$AP?.(e))}},Gt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=D,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=D}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Wt(this,e,t,0),o=!Jn(e)||e!==this._$AH&&e!==Ye,o&&(this._$AH=e);else{let a=e,l,u;for(e=s[0],l=0;l<s.length-1;l++)u=Wt(this,a[i+l],t,l),u===Ye&&(u=this._$AH[l]),o||=!Jn(u)||u!==this._$AH[l],u===D?e=D:e!==D&&(e+=(u??"")+s[l+1]),this._$AH[l]=u}o&&!r&&this.j(e)}j(e){e===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},tr=class extends Gt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===D?void 0:e}},nr=class extends Gt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==D)}},ir=class extends Gt{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Wt(this,e,t,0)??D)===Ye)return;let i=this._$AH,r=e===D&&i!==D||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==D&&(i===D||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)}},rr=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){Wt(this,e)}},tl={P:Ms,A:ft,C:Ds,M:1,L:el,R:er,D:Ya,V:Wt,I:cn,H:Gt,N:nr,U:ir,B:tr,F:rr},Ap=Fs.litHtmlPolyfillSupport;Ap?.(Yn,cn),(Fs.litHtmlVersions??=[]).push("3.1.4");var nl=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new cn(e.insertBefore(Xn(),s),s,void 0,t??{})}return r._$AI(n),r};var j=class extends pt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=nl(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ye}};j._$litElement$=!0,j.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:j});var Ip=globalThis.litElementPolyfillSupport;Ip?.({LitElement:j});(globalThis.litElementVersions??=[]).push("4.0.6");var Tp="Free",sr,il,Kn=class extends As(j){constructor(){super();b(this,sr);this.planConfigs}render(){return O`
1
+ var Fc=Object.defineProperty;var ia=n=>{throw TypeError(n)};var Mc=(n,e,t)=>e in n?Fc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var S=(n,e,t)=>Mc(n,typeof e!="symbol"?e+"":e,t),ps=(n,e,t)=>e.has(n)||ia("Cannot "+t);var d=(n,e,t)=>(ps(n,e,"read from private field"),t?t.call(n):e.get(n)),b=(n,e,t)=>e.has(n)?ia("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),A=(n,e,t,i)=>(ps(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),R=(n,e,t)=>(ps(n,e,"access private method"),t);var ra=(n,e,t,i)=>({set _(r){A(n,e,r,t)},get _(){return d(n,e,i)}});function ws(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function Dc(n,e=","){return n.map(ws).join(e)}var pa=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function qi(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 zi(n,e="@media "){return e+K(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function K(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function sa(n){return n}function Hi(){}var ce={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function fa(n){return n.match(/[-=:;]/g)?.length||0}function vs(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(fa(n),15)<<18}var Lc=["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 xs({n,i:e,v:t=[]},i,r,s){n&&(n=ws({n,i:e,v:t})),s=[...K(s)];for(let a of t){let l=i.theme("screens",a);for(let u of K(l&&zi(l)||i.v(a))){var o;s.push(u),r|=l?67108864|vs(u):a=="dark"?1073741824:u[0]=="@"?vs(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~Lc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var ha=new Map;function ms(n){if(n.d){let e=[],t=fs(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?fs(i,s=>fs(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):hs(s,o)}return hs(o,s)})):i,"&"),i=>hs(i,n.n?"."+pa(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function fs(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function hs(n,e){return n.replace(/&/g,e)}var oa=new Intl.Collator("en",{numeric:!0});function da(n,e){for(var t=0,i=n.length;t<i;){let r=i+t>>1;0>=ga(n[r],e)?t=r+1:i=r}return i}function ga(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||oa.compare(aa(n.n),aa(e.n))||oa.compare(la(n.n),la(e.n))}function aa(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function la(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function ds(n,e){return Math.round(parseInt(n,16)*e)}function He(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(${[ds(n.substr(1,s),o),ds(n.substr(1+s,s),o),ds(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function va(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:u=[],i:c},p){let f=[],h="",g=0,v=0;for(let $ in o||{}){var w,D;let M=o[$];if($[0]=="@"){if(!M)continue;if($[1]=="a"){f.push(...Ss(a,l,Bi(""+M),p,l,u,c,!0));continue}if($[1]=="l"){for(let q of K(M))f.push(...s(q,{n:a,p:(w=ce[$[7]],l&~ce.o|w),r:$[7]=="d"?[]:u,i:c},p));continue}if($[1]=="i"){f.push(...K(M).map(q=>({p:-1,o:0,r:[],d:$+" "+q})));continue}if($[1]=="k"){f.push({p:ce.d,o:0,r:[$],d:s(M,{p:ce.d},p).map(ms).join("")});continue}if($[1]=="f"){f.push(...K(M).map(q=>({p:ce.d,o:0,r:[$],d:s(q,{p:ce.d},p).map(ms).join("")})));continue}}if(typeof M!="object"||Array.isArray(M))$=="label"&&M?a=M+qi(JSON.stringify([l,c,o])):(M||M===0)&&($=$.replace(/[A-Z]/g,q=>"-"+q.toLowerCase()),v+=1,g=Math.max(g,(D=$)[0]=="-"?0:fa(D)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(D)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+K(M).map(q=>p.s($,ks(""+q,p.theme)+(c?" !important":""))).join(";"));else if($[0]=="@"||$.includes("&")){let q=l;$[0]=="@"&&($=$.replace(/\bscreen\(([^)]+)\)/g,(H,X)=>{let J=p.theme("screens",X);return J?(q|=67108864,zi(J,"")):H}),q|=vs($)),f.push(...s(M,{n:a,p:q,r:[...u,$],i:c},p))}else f.push(...s(M,{p:l,r:[...u,$]},p))}return f.unshift({n:a,p:l,o:Math.max(0,15-v)+1.5*Math.min(g||15,15),r:u,d:h}),f.sort(ga)}(n,xs(e,t,i,r),t)}function ks(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)?He(a):""+K(a).filter(l=>Object(l)!==l)})}function ma(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 Ui(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 h=function(g,v){let w=ha.get(g.n);return w?w(g,v):v.r(g.n,g.v[0]=="dark")}(l,u);return h?typeof h=="string"?({r:p,p:c}=xs(l,u,c,p),ma(Ui(Bi(h),u,c,p,l.i),l.n)):Array.isArray(h)?h.map(g=>{var v,w;return{o:0,...g,r:[...K(p),...K(g.r)],p:(v=c,w=g.p??c,v&~ce.o|w)}}):va(h,l,u,c,p):[{c:ws(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(da(s,a),0,a);return s}function Ss(n,e,t,i,r,s,o,a){return ma((a?t.flatMap(l=>Ui([l],i,r,s,o)):Ui(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 jc(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:u,i:c}=xs(s,o,e);return t&&Ss(a,e,t,o,l,u,c,i)},ha.set(n,r),n}function gs(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(Nc),i:r}))}}function Nc(n,e,t){return t.indexOf(n)==e}var ua=new Map;function Bi(n){let e=ua.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&&gs(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,gs([...t,"#"],i);let{v:h}=i[0].pop();for(let g of f)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);gs([...t,jc(p.length>1?p.slice(0,-1)+qi(JSON.stringify([p,f])):p+"("+Dc(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),ua.set(n,e=i[0])}return e}function _(n,e,t){return[n,ys(e,t)]}function ys(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):_s(t,1)}):t=>n||{[t[1]]:_s(t,2)}}function _s(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,Es(e,t,i)]}function Es(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=ya(n||r[1]),a=s.theme(o,r.$$)??st(r.$$,o,s);if(a!=null)return r._=_s(r,0,a),i(r,s,o)}}function pe(n,e={},t){return[n,qc(e,t)]}function qc(n={},e){return(t,i)=>{let{section:r=ya(t[0]).replace("-","")+"Color"}=n,[s,o]=Uc(t.$$);if(!s)return;let a=i.theme(r,s)||st(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&&st(o,u,i),h=e||(({_:v})=>{let w=zn(c,v);return p?{[p]:w}:w});t._={value:He(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:v=>He(a,v),opacityVariable:l||void 0,opacityValue:f||void 0};let g=h(t,i);if(!t.dark){let v=i.d(r,s,a);v&&v!==a&&(t._={value:He(v,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:w=>He(v,w),opacityVariable:l||void 0,opacityValue:f||void 0},g={"&":g,[i.v("dark")]:h(t,i)})}return g}}function Uc(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 st(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=cn(ks(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 ya(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function cn(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>cn(t)+i+cn(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 Hn({presets:n=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:K(e.variants),rules:K(e.rules),ignorelist:K(e.ignorelist),hash:void 0,stringify:(i,r)=>i+":"+r,finalize:[]};for(let i of K([...n,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&K(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:h}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&r!==!1&&[...t.preflight,...K(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...K(l)],rules:[...t.rules,...K(u)],ignorelist:[...t.ignorelist,...K(c)],hash:p,stringify:f,finalize:[...t.finalize,...K(h)]}}return t}function ca(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 Bc(n){var e;return bs(n[0],typeof(e=n[1])=="function"?e:()=>e)}function zc(n){var e,t;return Array.isArray(n)?bs(n[0],ys(n[1],n[2])):bs(n,ys(e,t))}function bs(n,e){return _a(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 _a(n,e){let t=K(n).map(Hc);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function Hc(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function ba(n,e){let t=Hn(n),i=function({theme:l,darkMode:u,darkColor:c=Hi,variants:p,rules:f,hash:h,stringify:g,ignorelist:v,finalize:w}){let D=new Map,$=new Map,M=new Map,q=new Map,H=_a(v,(E,ie)=>ie.test(E));p.push(["dark",Array.isArray(u)||u=="class"?`${K(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let X=typeof h=="function"?E=>h(E,qi):h?qi:sa;X!==sa&&w.push(E=>({...E,n:E.n&&X(E.n),d:E.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(ie,Z)=>"--"+X(Z).replace("#",""))}));let J={theme:function({extend:E={},...ie}){let Z={},pt={get colors(){return ve("colors")},theme:ve,negative(){return{}},breakpoints(G){let ee={};for(let le in G)typeof G[le]=="string"&&(ee["screen-"+le]=G[le]);return ee}};return ve;function ve(G,ee,le,Fe){if(G){if({1:G,2:Fe}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(G)||[,G],/[.[]/.test(G)){let Ee=[];G.replace(/\[([^\]]+)\]|([^.[]+)/g,(te,me,Ce=me)=>Ee.push(Ce)),G=Ee.shift(),le=ee,ee=Ee.join("-")}let re=Z[G]||Object.assign(Object.assign(Z[G]={},ze(ie,G)),ze(E,G));if(ee==null)return re;ee||(ee="DEFAULT");let Se=re[ee]??ee.split("-").reduce((Ee,te)=>Ee?.[te],re)??le;return Fe?He(Se,{opacityValue:ks(Fe,ve)}):Se}let je={};for(let re of[...Object.keys(ie),...Object.keys(E)])je[re]=ve(re);return je}function ze(G,ee){let le=G[ee];return typeof le=="function"&&(le=le(pt)),le&&/color|fill|stroke/i.test(ee)?function Fe(je,re=[]){let Se={};for(let Ee in je){let te=je[Ee],me=[...re,Ee];Se[me.join("-")]=te,Ee=="DEFAULT"&&(me=re,Se[re.join("-")]=te),typeof te=="object"&&Object.assign(Se,Fe(te,me))}return Se}(le):le}}(l),e:pa,h:X,s(E,ie){return g(E,ie,J)},d(E,ie,Z){return c(E,ie,J,Z)},v(E){return D.has(E)||D.set(E,ca(E,p,$,Bc,J)||"&:"+E),D.get(E)},r(E,ie){let Z=JSON.stringify([E,ie]);return M.has(Z)||M.set(Z,!H(E,J)&&ca(E,f,q,zc,J,ie)),M.get(Z)},f(E){return w.reduce((ie,Z)=>Z(ie,J),E)}};return J}(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=ms(u);if(c&&!o.has(c)){o.add(c);let p=da(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 K(t.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?Ss("",ce.b,Bi(p),i,ce.b,[],!1,!0):va(p,{},i,ce.b)).forEach(a);u=""+u;let c=r.get(u);if(!c){let p=new Set;for(let f of Ui(Bi(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 Wc(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function wa(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&&Wc(o,s=n(o))&&r.setAttribute("class",s)}}function Vc(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 Wi(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:Vc(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:Hi}}var Gc=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 xa(n){return Gc.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 Sa(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 Xc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Vi(){return({stringify:n})=>({stringify(e,t,i){let r="",s=xa(e);s&&(r+=n(s,t,i)+";");let o=ka(e),a=Sa(e,t);for(let l of Xc)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 Gi(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Es("lineClamp",({_:n})=>Ea(n))],["line-clamp-(\\d+)",({1:n})=>Ea(n)]]}}function Ea(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var Vn={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",...Ne(4,"rem",4,.5,.5),...Ne(12,"rem",4,5),14:"3.5rem",...Ne(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:B("blur"),backdropBrightness:B("brightness"),backdropContrast:B("contrast"),backdropGrayscale:B("grayscale"),backdropHueRotate:B("hueRotate"),backdropInvert:B("invert"),backdropOpacity:B("opacity"),backdropSaturate:B("saturate"),backdropSepia:B("sepia"),backgroundColor:B("colors"),backgroundImage:{none:"none"},backgroundOpacity:B("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:{...Ne(200,"",100,0,50),...Ne(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:B("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:B("spacing"),borderWidth:{DEFAULT:"1px",...We(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:B("colors"),caretColor:B("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...Ne(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:B("borderColor"),divideOpacity:B("borderOpacity"),divideWidth:B("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"),...Wn(2,6),...Wn(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:B("spacing"),gradientColorStops:B("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"),...Wn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:n})=>({...n("spacing"),...Wn(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:{...Ne(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:{...Ne(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:B("spacing"),placeholderColor:B("colors"),placeholderOpacity:B("opacity"),outlineColor:B("colors"),outlineOffset:We(8,"px"),outlineWidth:We(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:B("colors"),ringOffsetWidth:We(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...We(8,"px")},rotate:{...We(2,"deg"),...We(12,"deg",3),...We(180,"deg",45)},saturate:Ne(200,"",100,0,50),scale:{...Ne(150,"",100,0,50),...Ne(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:B("spacing"),scrollPadding:B("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...We(2,"deg"),...We(12,"deg",3)},space:B("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:Ne(2),textColor:B("colors"),textDecorationColor:B("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...We(8,"px")},textUnderlineOffset:{auto:"auto",...We(8,"px")},textIndent:B("spacing"),textOpacity:B("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:B("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"),...Wn(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:{...Ne(50,"",1,0,10),auto:"auto"}};function Wn(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 We(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function Ne(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function B(n){return({theme:e})=>e(n)}var $a={"*,::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, ${Vn.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, ${Vn.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 Pa=[_("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:st(`[${e}]`,"",t)}}})),_("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),x("aspect-","aspectRatio"),_("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[zi(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)"})),_("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),_("box-(border|content)","boxSizing",({1:n})=>n+"-box"),_("hidden",{display:"none"}),_("table-(auto|fixed)","tableLayout"),_(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",_("isolate","isolation"),_("object-(contain|cover|fill|none|scale-down)","objectFit"),x("object-","objectPosition"),_("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Xi),_("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),_("(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"),_("(visible|collapse)","visibility"),_("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),_("flex-((row|col)(-reverse)?)","flexDirection",Ca),_("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"),_("grid-cols-(\\d+)","gridTemplateColumns",Ra),x("col-","gridColumn"),_("col-(span)-(\\d+)","gridColumn",Ta),x("col-start-","gridColumnStart"),_("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),_("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),_("grid-rows-(\\d+)","gridTemplateRows",Ra),x("row-","gridRow"),_("row-(span)-(\\d+)","gridRow",Ta),x("row-start-","gridRowStart"),_("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),_("row-end-(auto|\\d+)","gridRowEnd"),_("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>Xi(Ca(n))),_("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))-",_("justify-","justifyContent",Aa),_("(content|items|self)-",n=>({["align-"+n[1]]:Aa(n)})),_("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),x("p([xytrbl])?(?:$|-)","padding",pn("padding")),x("-?m([xytrbl])?(?:$|-)","margin",pn("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))`}})),_("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=K(n))[1]=="string"?{fontFamily:Ye(n)}:{fontFamily:Ye(n[0]),...n[1]}),_("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),_("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),_("italic","fontStyle"),_("not-italic",{fontStyle:"normal"}),_("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1: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)",...kt({"--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"),_("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),_("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),pe("placeholder-",{property:"color",selector:"&::placeholder"}),_("text-(left|center|right|justify|start|end)","textAlign"),_("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"),_("(overline|underline|line-through)","textDecorationLine"),_("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),pe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("decoration-","textDecorationThickness"),_("decoration-","textDecorationStyle"),_("(uppercase|lowercase|capitalize)","textTransform"),_("normal-case",{textTransform:"none"}),_("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),_("align-","verticalAlign"),_("whitespace-","whiteSpace"),_("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),_("break-words",{overflowWrap:"break-word"}),_("break-all",{wordBreak:"break-all"}),_("break-keep",{wordBreak:"keep-all"}),pe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),pe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),_("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${zt(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"}),_("bg-(fixed|local|scroll)","backgroundAttachment"),_("bg-origin-(border|padding|content)","backgroundOrigin",({1:n})=>n+"-box"),_(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),_("bg-blend-","backgroundBlendMode"),_("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"),_("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Xi),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-${zt(t[0])}-radius`]:e,[`border-${zt(t[1])}-radius`]:e}}),_("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),_("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...kt({"--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"},pn("border","Color")),pe("border-"),x("border-([xytrbl])(?:$|-)","borderWidth",pn("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),_("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),_("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-${zt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${zt(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"),_("ring-inset",{"--tw-ring-inset":"inset"}),pe("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:n},{theme:e})=>({...kt({"--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":He(e("ringOffsetColor","","#fff")),"--tw-ring-color":He(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})=>({...kt({"--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":Ye(n),"--tw-shadow-colored":Ye(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)-"),_("mix-blend-","mixBlendMode"),...Ia(),...Ia("backdrop-"),x("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:Ye(n),transitionTimingFunction:n._=="none"?void 0:Ye(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:Ye(e("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",Ye),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ye),x("delay(?:$|-)","transitionDelay","transitionDelay",Ye),x("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=Ye(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)",_("transform",Cs),_("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":Oa(n=="gpu")})),x("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...Cs()})),x("-?(rotate)-","rotate",$s),x("-?(translate-[xy])-","translate",$s),x("-?(skew-[xy])-","skew",$s),_("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Xi),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",_("snap-(none)","scroll-snap-type"),_("snap-(x|y|both)",({1:n})=>({...kt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" var(--tw-scroll-snap-strictness)"})),_("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),_("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),_("snap-(normal|always)","scroll-snap-stop"),_("scroll-(auto|smooth)","scroll-behavior"),x("scroll-p([xytrbl])?(?:$|-)","padding",pn("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",pn("scroll-margin")),_("touch-(auto|none|manipulation)","touch-action"),_("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,2:e,3:t})=>({...kt({"--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)"})),_("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),_("outline",{outlineStyle:"solid"}),_("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"],_("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"),_("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),_("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Xi(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function Ca(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function zt(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 Ye(n){return n&&""+(n._||n)}function Aa({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function pn(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...zn(n+"-"+zt(r[0])+e,i),...zn(n+"-"+zt(r[1])+e,i)}:zn(n+e,i)}}function Ia(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={...kt(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,_(`${n}filter`,t),...e.map(i=>x(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:K(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function $s({1:n,_:e}){return{["--tw-"+n]:e,...Cs()}}function Cs(){return{...kt({"--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":Oa()}),transform:"var(--tw-transform)"}}function Oa(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 Ta({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function Ra({1:n}){return`repeat(${n},minmax(0,1fr))`}function kt(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var Fa=[["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)||st(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=cn(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)||st(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)||st(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=st(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&cn(n).replace(/[}]+$/,"").split("{")]];function Ma({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:$a,theme:{...Vn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:Fa,rules:Pa,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 Jc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Yc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Kc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Qc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Zc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},ep={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},tp={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},np={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},ip={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},rp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},sp={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},op={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},ap={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},lp={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},up={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},cp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},pp={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},fp={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},hp={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},dp={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},gp={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},vp={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Da={__proto__:null,slate:Jc,gray:Yc,zinc:Kc,neutral:Qc,stone:Zc,red:ep,orange:tp,amber:np,yellow:ip,lime:rp,green:sp,emerald:op,teal:ap,cyan:lp,sky:up,blue:cp,indigo:pp,violet:fp,purple:hp,fuchsia:dp,pink:gp,rose:vp};function Ji({disablePreflight:n}={}){return Ma({colors:Da,disablePreflight:n})}function Yi({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)=>Na(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=ja(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[La(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"}}),La(n,o,t)],"@layer components":{...ja(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 h=o.theme(`colors.${s}.${p}`,p);f["--tw-prose-"+c]=He(h);let g=f!=l&&o.d("colors",`${s}-${p}`,h);g&&(l["--tw-prose-"+c]=He(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 La(n,e,t){let i={};for(let r in t)i[Na(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function Na(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 ja(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 As=Hn({darkMode:"class",theme:{extend:{fontFamily:{display:["Space Grotesk","sans-serif"],sans:["Open Sans","sans-serif"],serif:["Roboto Slab","serif"],mono:["Roboto Mono","monospace"]},colors:{primary:{50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"},secondary:{50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},tertiary:{50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"}}}},presets:[Ji(),Vi(),Gi(),Yi()],hash:!1});function Ki(n,e=!0){let t=function(){if(mp)try{let l=Wi(new CSSStyleSheet);return l.connect=u=>{let c=Is(u);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=Hi,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Wi(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,h)=>h&&f.target.insertRule(p.cssText,u))},resume(l,u){return o[0].resume(l,u)},connect(l){let u=document.createElement("style");Is(l).appendChild(u);let c=Wi(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=ba({...n,hash:n.hash??e},t),r=wa(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(Is(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var mp=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Is(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var Ts=n=>Ki(As)(n);var Qi=globalThis,Zi=Qi.ShadowRoot&&(Qi.ShadyCSS===void 0||Qi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rs=Symbol(),qa=new WeakMap,Gn=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Rs)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(Zi&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=qa.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&qa.set(t,e))}return e}toString(){return this.cssText}},Ua=n=>new Gn(typeof n=="string"?n:n+"",void 0,Rs),Ps=(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,Rs)},Os=(n,e)=>{if(Zi)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=Qi.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},er=Zi?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return Ua(t)})(n):n;var{is:yp,defineProperty:_p,getOwnPropertyDescriptor:bp,getOwnPropertyNames:wp,getOwnPropertySymbols:xp,getPrototypeOf:kp}=Object,tr=globalThis,Ba=tr.trustedTypes,Sp=Ba?Ba.emptyScript:"",Ep=tr.reactiveElementPolyfillSupport,Xn=(n,e)=>n,Fs={toAttribute(n,e){switch(e){case Boolean:n=n?Sp: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}},Ha=(n,e)=>!yp(n,e),za={attribute:!0,type:String,converter:Fs,reflect:!1,hasChanged:Ha};Symbol.metadata??=Symbol("metadata"),tr.litPropertyMetadata??=new WeakMap;var ft=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=za){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&&_p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=bp(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)??za}static _$Ei(){if(this.hasOwnProperty(Xn("elementProperties")))return;let e=kp(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=[...wp(t),...xp(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(er(r))}else e!==void 0&&t.push(er(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 Os(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:Fs).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:Fs;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??Ha)(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){}};ft.elementStyles=[],ft.shadowRootOptions={mode:"open"},ft[Xn("elementProperties")]=new Map,ft[Xn("finalized")]=new Map,Ep?.({ReactiveElement:ft}),(tr.reactiveElementVersions??=[]).push("2.0.4");var Ds=globalThis,nr=Ds.trustedTypes,Wa=nr?nr.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ls="$lit$",ht=`lit$${Math.random().toFixed(9).slice(2)}$`,js="?"+ht,$p=`<${js}>`,Vt=document,Yn=()=>Vt.createComment(""),Kn=n=>n===null||typeof n!="object"&&typeof n!="function",Ka=Array.isArray,Qa=n=>Ka(n)||typeof n?.[Symbol.iterator]=="function",Ms=`[
2
+ \f\r]`,Jn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Va=/-->/g,Ga=/>/g,Ht=RegExp(`>|${Ms}(?:([^\\s"'>=/]+)(${Ms}*=${Ms}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Xa=/'/g,Ja=/"/g,Za=/^(?:script|style|textarea|title)$/i,el=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),O=el(1),gd=el(2),Ke=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),Ya=new WeakMap,Wt=Vt.createTreeWalker(Vt,129);function tl(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wa!==void 0?Wa.createHTML(e):e}var nl=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":"",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=Va:c[1]!==void 0?o=Ga:c[2]!==void 0?(Za.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Ht):c[3]!==void 0&&(o=Ht):o===Ht?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?Ht:c[3]==='"'?Ja:Xa):o===Ja||o===Xa?o=Ht:o===Va||o===Ga?o=Jn:(o=Ht,r=void 0);let h=o===Ht&&n[a+1].startsWith("/>")?" ":"";s+=o===Jn?l+$p:p>=0?(i.push(u),l.slice(0,p)+Ls+l.slice(p)+ht+h):l+ht+(p===-2?a:h)}return[tl(n,s+(n[t]||"<?>")+(e===2?"</svg>":"")),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]=nl(e,t);if(this.el=n.createElement(u,i),Wt.currentNode=this.el.content,t===2){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Wt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(Ls)){let f=c[o++],h=r.getAttribute(p).split(ht),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?rr:g[1]==="?"?sr:g[1]==="@"?or:Xt}),r.removeAttribute(p)}else p.startsWith(ht)&&(l.push({type:6,index:s}),r.removeAttribute(p));if(Za.test(r.tagName)){let p=r.textContent.split(ht),f=p.length-1;if(f>0){r.textContent=nr?nr.emptyScript:"";for(let h=0;h<f;h++)r.append(p[h],Yn()),Wt.nextNode(),l.push({type:2,index:++s});r.append(p[f],Yn())}}}else if(r.nodeType===8)if(r.data===js)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(ht,p+1))!==-1;)l.push({type:7,index:s}),p+=ht.length-1}s++}}static createElement(e,t){let i=Vt.createElement("template");return i.innerHTML=e,i}};function Gt(n,e,t=n,i){if(e===Ke)return e;let r=i!==void 0?t._$Co?.[i]:t._$Cl,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._$Co??=[])[i]=r:t._$Cl=r),r!==void 0&&(e=Gt(n,r._$AS(n,e.values),r,i)),e}var ir=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??Vt).importNode(t,!0);Wt.currentNode=r;let s=Wt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new fn(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new ar(s,this,e)),this._$AV.push(u),l=i[++a]}o!==l?.index&&(s=Wt.nextNode(),o++)}return Wt.currentNode=Vt,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++}},fn=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=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=Gt(this,e,t),Kn(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==Ke&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Qa(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==L&&Kn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Vt.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(tl(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new ir(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Ya.get(e.strings);return t===void 0&&Ya.set(e.strings,t=new Qn(e)),t}k(e){Ka(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.S(Yn()),this.S(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._$Cv=e,this._$AP?.(e))}},Xt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=L,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=L}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Gt(this,e,t,0),o=!Kn(e)||e!==this._$AH&&e!==Ke,o&&(this._$AH=e);else{let a=e,l,u;for(e=s[0],l=0;l<s.length-1;l++)u=Gt(this,a[i+l],t,l),u===Ke&&(u=this._$AH[l]),o||=!Kn(u)||u!==this._$AH[l],u===L?e=L:e!==L&&(e+=(u??"")+s[l+1]),this._$AH[l]=u}o&&!r&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},rr=class extends Xt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}},sr=class extends Xt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}},or=class extends Xt{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Gt(this,e,t,0)??L)===Ke)return;let i=this._$AH,r=e===L&&i!==L||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==L&&(i===L||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)}},ar=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){Gt(this,e)}},il={P:Ls,A:ht,C:js,M:1,L:nl,R:ir,D:Qa,V:Gt,I:fn,H:Xt,N:sr,U:or,B:rr,F:ar},Cp=Ds.litHtmlPolyfillSupport;Cp?.(Qn,fn),(Ds.litHtmlVersions??=[]).push("3.1.4");var rl=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new fn(e.insertBefore(Yn(),s),s,void 0,t??{})}return r._$AI(n),r};var N=class extends ft{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=rl(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ke}};N._$litElement$=!0,N.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:N});var Ap=globalThis.litElementPolyfillSupport;Ap?.({LitElement:N});(globalThis.litElementVersions??=[]).push("4.0.6");var Ip="Free",lr,sl,Zn=class extends Ts(N){constructor(){super();b(this,lr);this.planConfigs}render(){return O`
4
4
  <a href="/pricing-plans" target="_blank" class="text-sm text-white">
5
5
  <div class="flex m-3 px-3 py-2 bg-tertiary-500 flex-row rounded-xl items-start">
6
6
  <p class="flex-grow">Upgrade your <span class="font-bold text-[#b9e901]">${this.planConfigs?.title}</span> plan to add more than <span class="font-bold text-[#b9e901]">${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!==Tp?"Upgrade":"Try Free"}</span>
8
- <button type="button" @click="${R(this,sr,il)}" class="ml-1 h-6 rounded-full transition-colors bg-tertiary-500 hover:bg-tertiary-700" aria-label="Close">
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!==Ip?"Upgrade":"Try Free"}</span>
8
+ <button type="button" @click="${R(this,lr,sl)}" class="ml-1 h-6 rounded-full transition-colors bg-tertiary-500 hover:bg-tertiary-700" aria-label="Close">
9
9
  <span class="inline-block h-6 w-6 leading-6">✕</span>
10
10
  </button>
11
11
  </div>
12
12
  </a>
13
- `}firstUpdated(){this.planConfigs.slug==="scale"&&(this.style.display="none")}};sr=new WeakSet,il=function(t){t.preventDefault(),this.style.display="none"},S(Kn,"properties",{planConfigs:{type:Object,attribute:"plan-configs"}});var Ls=Bn({darkMode:"class",theme:{extend:{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"]},fontFamily:{sans:["system-ui","Roboto","Helvetica","Arial","sans-serif"],serif:["ui-serif","Georgia","Cambria","serif"],mono:["ui-monospace","Menlo","Monaco","monospace"]}}},presets:[Gi(),zi(),Hi(),Vi()],hash:!1});var z=n=>Xi(Ls)(n);var Qn=class extends z(j){constructor(){super();S(this,"render",()=>O`
13
+ `}firstUpdated(){this.planConfigs.slug==="scale"&&(this.style.display="none")}};lr=new WeakSet,sl=function(t){t.preventDefault(),this.style.display="none"},S(Zn,"properties",{planConfigs:{type:Object,attribute:"plan-configs"}});var Ns=Hn({darkMode:"class",theme:{extend:{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"]},fontFamily:{sans:["system-ui","Roboto","Helvetica","Arial","sans-serif"],serif:["ui-serif","Georgia","Cambria","serif"],mono:["ui-monospace","Menlo","Monaco","monospace"]}}},presets:[Ji(),Vi(),Gi(),Yi()],hash:!1});var z=n=>Ki(Ns)(n);var ei=class extends z(N){constructor(){super();S(this,"render",()=>O`
14
14
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
15
15
  <!-- 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
16
  <button class="leading-0 bg-slate-800 relative inline-block h-14 w-14 rounded-full overflow-hidden shadow-xl transition-transform hover:scale-105 active:scale-90 text-sm text-white">
@@ -35,26 +35,26 @@ var Mc=Object.defineProperty;var ta=n=>{throw TypeError(n)};var Dc=(n,e,t)=>e in
35
35
  </svg>
36
36
  </div>
37
37
  </button>
38
- `);this.state="open",this.src=""}};S(Qn,"properties",{state:{type:String},src:{type:String}});var or={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ar=n=>(...e)=>({_$litDirective$:n,values:e}),pn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Rp}=tl;var rl=()=>document.createComment(""),fn=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(rl(),r),o=i.insertBefore(rl(),r);t=new Rp(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},kt=(n,e,t=n)=>(n._$AI(e,t),n),Pp={},sl=(n,e=Pp)=>n._$AH=e,ol=n=>n._$AH,lr=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 al=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},Zn=ar(class extends pn{constructor(n){if(super(n),n.type!==or.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=ol(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]=kt(r[p],s[d]),p++,d++;else if(a[f]===o[g])l[g]=kt(r[f],s[g]),f--,g--;else if(a[p]===o[g])l[g]=kt(r[p],s[g]),fn(n,l[g+1],r[p]),p++,g--;else if(a[f]===o[d])l[d]=kt(r[f],s[d]),fn(n,r[p],r[f]),f--,d++;else if(u===void 0&&(u=al(o,d,g),c=al(a,p,f)),u.has(a[p]))if(u.has(a[f])){let v=c.get(o[d]),k=v!==void 0?r[v]:null;if(k===null){let L=fn(n,r[p]);kt(L,s[d]),l[d]=L}else l[d]=kt(k,s[d]),fn(n,r[p],k),r[v]=null;d++}else lr(r[f]),f--;else lr(r[p]),p++;for(;d<=g;){let v=fn(n,l[g+1]);kt(v,s[d]),l[d++]=v}for(;p<=f;){let v=r[p++];v!==null&&lr(v)}return this.ut=o,sl(n,l),Ye}});function ll(n,e,t){return n?e(n):t?.(n)}var ur,ul,cr=class cr extends z(j){constructor(){super();b(this,ur);S(this,"render",()=>!this.examples?.title&&!this.examples?.items?.length?D:O`
38
+ `);this.state="open",this.src=""}};S(ei,"properties",{state:{type:String},src:{type:String}});var ur={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},cr=n=>(...e)=>({_$litDirective$:n,values:e}),hn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Tp}=il;var ol=()=>document.createComment(""),dn=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(ol(),r),o=i.insertBefore(ol(),r);t=new Tp(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},St=(n,e,t=n)=>(n._$AI(e,t),n),Rp={},al=(n,e=Rp)=>n._$AH=e,ll=n=>n._$AH,pr=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 ul=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},ti=cr(class extends hn{constructor(n){if(super(n),n.type!==ur.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=ll(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,h=0,g=s.length-1;for(;p<=f&&h<=g;)if(r[p]===null)p++;else if(r[f]===null)f--;else if(a[p]===o[h])l[h]=St(r[p],s[h]),p++,h++;else if(a[f]===o[g])l[g]=St(r[f],s[g]),f--,g--;else if(a[p]===o[g])l[g]=St(r[p],s[g]),dn(n,l[g+1],r[p]),p++,g--;else if(a[f]===o[h])l[h]=St(r[f],s[h]),dn(n,r[p],r[f]),f--,h++;else if(u===void 0&&(u=ul(o,h,g),c=ul(a,p,f)),u.has(a[p]))if(u.has(a[f])){let v=c.get(o[h]),w=v!==void 0?r[v]:null;if(w===null){let D=dn(n,r[p]);St(D,s[h]),l[h]=D}else l[h]=St(w,s[h]),dn(n,r[p],w),r[v]=null;h++}else pr(r[f]),f--;else pr(r[p]),p++;for(;h<=g;){let v=dn(n,l[g+1]);St(v,s[h]),l[h++]=v}for(;p<=f;){let v=r[p++];v!==null&&pr(v)}return this.ut=o,al(n,l),Ke}});function cl(n,e,t){return n?e(n):t?.(n)}var fr,pl,hr=class hr extends z(N){constructor(){super();b(this,fr);S(this,"render",()=>!this.examples?.title&&!this.examples?.items?.length?L:O`
39
39
  <div class="h-full w-full flex flex-col font-sans text-base bg-[#FDFDFD] items-stretch justify-center">
40
40
  <!-- examples section -->
41
41
  <div class="m-4">
42
- ${ll(this.examples.title,()=>O`<p class="text-md text-center text-gray-500 font-semibold select-none">${this.examples.title}</p>`)}
42
+ ${cl(this.examples.title,()=>O`<p class="text-md text-center text-gray-500 font-semibold select-none">${this.examples.title}</p>`)}
43
43
  ${this.examples?.items?.length?O`
44
44
  <ul class="prose mt-2 text-left text-gray-400 select-none">
45
- ${Zn(this.examples.items,t=>t,t=>O`
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="${()=>R(this,ur,ul).call(this,t)}">
45
+ ${ti(this.examples.items,t=>t,t=>O`
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="${()=>R(this,fr,pl).call(this,t)}">
47
47
  <span>“${t.trim()}” →</span>
48
48
  </li>
49
49
  `)}
50
50
  </ul>
51
- `:D}
51
+ `:L}
52
52
  </div>
53
53
 
54
54
  <!-- spacer for visual alignment -->
55
55
  <div class="h-1/9"></div>
56
56
  </div>
57
- `);this.examples={title:"",items:[]}}};ur=new WeakSet,ul=function(t){this.dispatchEvent(new cr.ExampleClickEvent({example:t}))},S(cr,"properties",{examples:{type:Object}});var hn=cr,js;hn.ExampleClickEvent=(js=class extends CustomEvent{constructor(e,t={}){super(hn.ExampleClickEvent.type,{detail:e,...t})}},S(js,"type","mw:example-click"),js);var dn,cl,pl,ei=class ei extends z(j){constructor(){super();b(this,dn);S(this,"render",()=>O`
57
+ `);this.examples={title:"",items:[]}}};fr=new WeakSet,pl=function(t){this.dispatchEvent(new hr.ExampleClickEvent({example:t}))},S(hr,"properties",{examples:{type:Object}});var gn=hr,qs;gn.ExampleClickEvent=(qs=class extends CustomEvent{constructor(e,t={}){super(gn.ExampleClickEvent.type,{detail:e,...t})}},S(qs,"type","mw:example-click"),qs);var vn,fl,hl,ni=class ni extends z(N){constructor(){super();b(this,vn);S(this,"render",()=>O`
58
58
  <div class="flex items-center justify-between space-x-4 p-4 text-lg bg-white font-sans">
59
59
  <mw-pulse-dot class="contents" position="bottom-right" color="green-500">
60
60
  <div class="h-10 w-10 overflow-hidden rounded">
@@ -72,7 +72,7 @@ var Mc=Object.defineProperty;var ta=n=>{throw TypeError(n)};var Dc=(n,e,t)=>e in
72
72
 
73
73
  <div class="flex-grow"></div>
74
74
 
75
- <button @click=${R(this,dn,cl)} 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">
75
+ <button @click=${R(this,vn,fl)} 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
76
  <!-- -->
77
77
  <p class="inline-flex h-6 w-6 items-center justify-center">
78
78
  <span class="whitespace-pre text-[11px] font-medium leading-[15px]">${this.content.newChatTitle||`NEW
@@ -80,15 +80,15 @@ CHAT`}</span>
80
80
  </p>
81
81
  </button>
82
82
 
83
- <button @click=${R(this,dn,pl)} 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">
83
+ <button @click=${R(this,vn,hl)} 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
84
  <!-- x -->
85
85
  <span class="inline-block h-6 w-6 leading-6">✕</span>
86
86
  </button>
87
87
  </div>
88
- `);this.content={logoUrl:"",title:"",status:"",color:"",newChatTitle:""},this.showNewChat=!1,this.showClose=!1}};dn=new WeakSet,cl=function(){this.dispatchEvent(new ei.NewChatClickEvent)},pl=function(){this.dispatchEvent(new ei.CloseClickEvent)},S(ei,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}});var St=ei,qs;St.NewChatClickEvent=(qs=class extends CustomEvent{constructor(e={}){super(St.NewChatClickEvent.type,{...e})}},S(qs,"type","mw:new-chat-click"),qs);var Ns;St.CloseClickEvent=(Ns=class extends CustomEvent{constructor(e={}){super(St.CloseClickEvent.type,{...e})}},S(Ns,"type","mw:close-click"),Ns);var Ge,fl,hl,dl,gl,ml,gn=class gn extends z(j){constructor(){super();b(this,Ge);S(this,"render",()=>O`
89
- <form class="flex items-center space-x-4 border-t font-sans text-base bg-white px-4" @submit="${R(this,Ge,gl)}">
88
+ `);this.content={logoUrl:"",title:"",status:"",color:"",newChatTitle:""},this.showNewChat=!1,this.showClose=!1}};vn=new WeakSet,fl=function(){this.dispatchEvent(new ni.NewChatClickEvent)},hl=function(){this.dispatchEvent(new ni.CloseClickEvent)},S(ni,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}});var Et=ni,Us;Et.NewChatClickEvent=(Us=class extends CustomEvent{constructor(e={}){super(Et.NewChatClickEvent.type,{...e})}},S(Us,"type","mw:new-chat-click"),Us);var Bs;Et.CloseClickEvent=(Bs=class extends CustomEvent{constructor(e={}){super(Et.CloseClickEvent.type,{...e})}},S(Bs,"type","mw:close-click"),Bs);var Ve,dl,gl,vl,ml,yl,mn=class mn extends z(N){constructor(){super();b(this,Ve);S(this,"render",()=>O`
89
+ <form class="flex items-center space-x-4 border-t font-sans text-base bg-white px-4" @submit="${R(this,Ve,ml)}">
90
90
  <!-- text input -->
91
- <textarea name="input" @input="${R(this,Ge,ml)}" @keydown="${R(this,Ge,dl)}" class="bg-white disabled:bg-white my-2 block w-full flex-1 resize-none rounded py-2 text-[16px] text-gray-800 outline-none transition-colors" placeholder="${this.placeholder}" autofocus ?disabled="${this.disabled}"></textarea>
91
+ <textarea name="input" @input="${R(this,Ve,yl)}" @keydown="${R(this,Ve,vl)}" class="bg-white disabled:bg-white my-2 block w-full flex-1 resize-none rounded py-2 text-[16px] text-gray-800 outline-none transition-colors" placeholder="${this.placeholder}" autofocus ?disabled="${this.disabled}"></textarea>
92
92
 
93
93
  <!-- send/cancel button -->
94
94
  <div class="py-2">
@@ -107,7 +107,7 @@ CHAT`}</span>
107
107
  </button>
108
108
  </div>
109
109
  </form>
110
- `);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message...",this.color=""}};Ge=new WeakSet,fl=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},hl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},dl=function(t){Op(t)&&(t.preventDefault(),this.streaming||h(this,Ge,hl)?.click())},gl=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new gn.CancelEvent);return}let i=h(this,Ge,fl);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new gn.SubmitEvent(i.value))&&(i.value="")},ml=function(t){this.dispatchEvent(new gn.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""}))},S(gn,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String},color:{type:String}});var rt=gn,Us;rt.ChangeEvent=(Us=class extends CustomEvent{constructor(e,t={}){super(rt.ChangeEvent.type,{detail:e,...t})}},S(Us,"type","mw:change"),Us);var Bs;rt.SubmitEvent=(Bs=class extends CustomEvent{constructor(e,t={}){super(rt.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},S(Bs,"type","mw:submit"),Bs);var zs;rt.CancelEvent=(zs=class extends CustomEvent{constructor(e={}){super(rt.CancelEvent.type,{...e})}},S(zs,"type","mw:cancel"),zs);function Op(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}var ti=class extends z(j){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl=""}render(){switch(this.side){case"user":return O`
110
+ `);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message...",this.color=""}};Ve=new WeakSet,dl=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},gl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},vl=function(t){Pp(t)&&(t.preventDefault(),this.streaming||d(this,Ve,gl)?.click())},ml=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new mn.CancelEvent);return}let i=d(this,Ve,dl);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new mn.SubmitEvent(i.value))&&(i.value="")},yl=function(t){this.dispatchEvent(new mn.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""}))},S(mn,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String},color:{type:String}});var ot=mn,zs;ot.ChangeEvent=(zs=class extends CustomEvent{constructor(e,t={}){super(ot.ChangeEvent.type,{detail:e,...t})}},S(zs,"type","mw:change"),zs);var Hs;ot.SubmitEvent=(Hs=class extends CustomEvent{constructor(e,t={}){super(ot.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},S(Hs,"type","mw:submit"),Hs);var Ws;ot.CancelEvent=(Ws=class extends CustomEvent{constructor(e={}){super(ot.CancelEvent.type,{...e})}},S(Ws,"type","mw:cancel"),Ws);function Pp(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}var ii=class extends z(N){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl=""}render(){switch(this.side){case"user":return O`
111
111
  <div class="ml-20 flex justify-end font-sans text-base">
112
112
  <div class="max-w-full">
113
113
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -121,7 +121,7 @@ CHAT`}</span>
121
121
  <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
122
  <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
123
123
  </svg>
124
- `:D}
124
+ `:L}
125
125
  </div>
126
126
  </div>
127
127
  `;case"assistant":case"support":return O`
@@ -142,15 +142,15 @@ CHAT`}</span>
142
142
  </div>
143
143
  </div>
144
144
  </div>
145
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};S(ti,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"}});var ni=class extends pn{constructor(e){if(super(e),this.it=D,e.type!==or.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===D||e==null)return this._t=void 0,this.it=e;if(e===Ye)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:[]}}};ni.directiveName="unsafeHTML",ni.resultType=1;var vl=ar(ni);var Hs;function Fp(n){return{lang:n?.lang??Hs?.lang,message:n?.message,abortEarly:n?.abortEarly??Hs?.abortEarly,abortPipeEarly:n?.abortPipeEarly??Hs?.abortPipeEarly}}var Mp;function Dp(n){return Mp?.get(n)}var Lp;function jp(n){return Lp?.get(n)}var qp;function Np(n,e){return qp?.get(n)?.get(e)}function mn(n){let e=typeof n;return e==="object"&&(e=(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null"),e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e}function Et(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??mn(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??Np(n.reference,l.lang)??(u?jp(l.lang):null)??i.message??Dp(l.lang);c&&(l.message=typeof c=="function"?c(l):c),u&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}var Up=class extends Error{constructor(e){super(e[0].message);S(this,"issues");this.name="ValiError",this.issues=e}};function Ws(n,e){return{kind:"validation",type:"max_value",reference:Ws,async:!1,expects:`<=${n instanceof Date?n.toJSON():mn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&Et(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():mn(t.value)}),t}}}function Gs(n,e){return{kind:"validation",type:"min_value",reference:Gs,async:!1,expects:`>=${n instanceof Date?n.toJSON():mn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&Et(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():mn(t.value)}),t}}}function Bp(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function vn(n,e){return{kind:"schema",type:"array",reference:vn,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 Et(this,"type",t,i);return t}}}function Ee(n){return{kind:"schema",type:"boolean",reference:Ee,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:Et(this,"type",e,t),e}}}function st(n){return{kind:"schema",type:"number",reference:st,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Et(this,"type",e,t),e}}}function le(n,e){return{kind:"schema",type:"object",reference:le,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 Et(this,"type",t,i);return t}}}function T(n,...e){let t={kind:"schema",type:"optional",reference:T,expects:`${n.expects} | undefined`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=Bp(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 pr(n,e){return{kind:"schema",type:"picklist",reference:pr,expects:n.map(mn).join(" | ")||"never",async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:Et(this,"type",t,i),t}}}function q(n){return{kind:"schema",type:"string",reference:q,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:Et(this,"type",e,t),e}}}function yl(n,e,t){let i=n._run({typed:!1,value:e},Fp(t));if(i.issues)throw new Up(i.issues);return i.value}function _l(...n){return{...n[0],pipe:n,_run(e,t){for(let i=0;i<n.length;i++){if(e.issues&&(n[i].kind==="schema"||n[i].kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n[i]._run(e,t))}return e}}}var ii,Me,Ke,ri,Vs,fr=class{constructor(e,t){b(this,ri);b(this,ii);b(this,Me);b(this,Ke);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");$(this,ii,e),h(this,ii).addController(this),$(this,Me,t)}connect(e){$(this,Me,e),$(this,Ke,R(this,ri,Vs).call(this))}hostConnected(){setTimeout(()=>{$(this,Ke,R(this,ri,Vs).call(this))},0)}hostDisconnected(){h(this,Ke)?.close(1e3,"lit_host_disconnected"),$(this,Ke,void 0)}send(e){h(this,Ke)?.send(e)}close(e,t){h(this,Ke)?.close(e,t)}render(e={}){switch(h(this,Ke)?.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,Ke)?.readyState===WebSocket.OPEN}};ii=new WeakMap,Me=new WeakMap,Ke=new WeakMap,ri=new WeakSet,Vs=function(){let e=new WebSocket(h(this,Me).url());return h(this,Me).onClose&&(e.onclose=h(this,Me).onClose),h(this,Me).onOpen&&(e.onopen=h(this,Me).onOpen),h(this,Me).onError&&(e.onerror=h(this,Me).onError),h(this,Me).onMessage&&(e.onmessage=h(this,Me).onMessage),e};var wl="664df22d-d461-42d6-801e-f70247e2cd7c",ye,$e,Qe,yn,_n,be,Vt,xl,kl,Sl,El,hr=class{constructor(e,t){b(this,be);b(this,ye);b(this,$e);b(this,Qe);S(this,"isStreaming",!1);S(this,"typingIndicator");S(this,"ranOutOfCredits",!1);S(this,"messages",[]);S(this,"conversationId","");b(this,yn,0);b(this,_n);S(this,"isLiveMode",!1);$(this,ye,e),$(this,$e,t),$(this,Qe,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return R(this,be,Vt).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return R(this,be,Vt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return R(this,be,Vt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return R(this,be,Vt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){R(this,be,Vt).call(this,{type:"RELOAD_CONFIG"})}close(){h(this,Qe).close(1e3,"closed by user")}retry(){clearTimeout(h(this,_n)),$(this,_n,setTimeout(()=>{h(this,$e).onReconnect?.(),$(this,Qe,this.initWS())},1e3*h(this,yn))),na(this,yn)._++}initWS(){return new fr(h(this,ye),{url:()=>h(this,$e).url(this.conversationId,{}),onOpen:e=>R(this,be,xl).call(this,e),onMessage:e=>R(this,be,kl).call(this,JSON.parse(e.data)),onError:e=>R(this,be,Sl).call(this,e),onClose:e=>R(this,be,El).call(this,e)})}hostConnected(){this.conversationId=h(this,$e).restoreConversationState?.()?.conversationId||""}reset(){R(this,be,Vt).call(this,{type:"NEW_CHAT"}),h(this,$e).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,h(this,ye).requestUpdate()}hostDisconnected(){clearTimeout(h(this,_n))}reconnectSocket(){h(this,Qe).close(1e3,"destroy"),$(this,Qe,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};ye=new WeakMap,$e=new WeakMap,Qe=new WeakMap,yn=new WeakMap,_n=new WeakMap,be=new WeakSet,Vt=function(e,{expectStreaming:t=!1}={}){return h(this,Qe).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,h(this,ye).requestUpdate()),h(this,Qe).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},xl=function(e){$(this,yn,0)},kl=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,ye).requestUpdate(),h(this,$e).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,ye).requestUpdate(),h(this,$e).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(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,ye).requestUpdate(),h(this,$e).onMessageDone?.(e,t);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,h(this,ye).requestUpdate();break}case"ERROR":{h(this,$e).onMessageError?.(e);break}case"CONNECTED":{e.messages&&(this.messages=e.messages),this.conversationId=e.conversationId,h(this,$e).onConnect?.(e.conversationId),h(this,$e).persistConversationState?.(e.conversationId),this.isLiveMode=e.metadata?.isLiveMode,h(this,ye).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},h(this,ye).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,h(this,ye).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===wl)||this.messages.push({id:wl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,h(this,ye).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),h(this,ye).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Sl=function(e){console.error("onError",e),h(this,$e).onError?.(e)},El=function(e){h(this,ye).isConnected&&!h(this,Qe).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,h(this,ye).requestUpdate(),h(this,$e).onClose?.()};var si,bn,$t,Xt,gr,$l,dr=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,gr);b(this,si);b(this,bn);b(this,$t);b(this,Xt,!1);S(this,"timeoutMs");$(this,si,e),$(this,bn,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return h(this,Xt)}hostDisconnected(){clearTimeout(h(this,$t)),$(this,$t,void 0)}onInput(e){if(h(this,si).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(h(this,$t)),$(this,$t,setTimeout(()=>this.typingStopped(),this.timeoutMs)),h(this,Xt)||R(this,gr,$l).call(this)}}typingStopped(){clearTimeout(h(this,$t)),$(this,Xt,!1),h(this,bn).typingStopped()}};si=new WeakMap,bn=new WeakMap,$t=new WeakMap,Xt=new WeakMap,gr=new WeakSet,$l=function(){$(this,Xt,!0),h(this,bn).typingStarted()};function Cl(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 Al(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 Qg=le({wsApiUrl:q(),url:q(),logoUrl:T(q()),title:q(),status:q(),color:q(),showStillLearningBanner:T(Ee()),allowedOrigins:T(vn(q())),input:le({placeholder:q()}),bubble:le({imageUrl:T(q()),position:le({bottom:T(q()),right:T(q()),left:T(q())}),mobilePosition:T(le({bottom:T(q()),right:T(q()),left:T(q())}))}),examples:le({title:q(),items:vn(q())}),instructions:le({items:vn(q())}),popup:T(le({mobileEnabled:T(Ee()),desktopEnabled:T(Ee()),delayMs:T(st()),text:T(q()),mobileTitleText:T(q()),mobileButtonText:T(q())})),tryItOut:T(le({mobileEnabled:T(Ee()),desktopEnabled:T(Ee()),text:T(q())})),contactDetails:T(le({email:T(q()),phone:T(q()),socialMedia:T(le({facebook:T(q()),instagram:T(q()),twitter:T(q())}))})),neverShowStillLearningBanner:T(Ee()),hidden:T(Ee()),newChatTitle:T(q()),webhookURL:T(q()),automatedResponse:T(le({enabled:T(Ee()),text:T(q()),latencyThresholdMs:T(st())})),manual:T(Ee()),removePoweredBy:T(Ee()),claimable:T(Ee()),feed:T(q()),scraper:T(pr(["netkazan","jateknet","grandopet","insportline","partocean"])),platform:T(pr(["shopify","shoprenter","unas","scraper"])),workingHours:T(le({dailyAvailability:vn(le({dayOfWeek:_l(st(),Gs(0),Ws(6)),startTime:q(),endTime:q(),isActive:Ee()})),userTimeZone:T(q())})),planOverrides:T(le({maxProducts:T(st()),conversations:T(st()),faqs:T(le({max:T(st()),questionLength:T(st()),answerLength:T(st())}))})),omitGeneralGuidelines:T(Ee()),forceStripe:T(Ee())});var zp="\xB7 \xB7 \xB7",Hp=le({conversationId:T(q())}),ne,mr,oi,re,Il,Tl,Rl,Pl,Ol,Fl,Ml,Js,vr=class vr extends z(j){constructor(){super();b(this,ne);b(this,oi,new dr(this,{typingStarted:()=>h(this,re).sendUserTypingStart(),typingStopped:()=>h(this,re).sendUserTypingStop()}));b(this,re,new hr(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,ne,Js)?.scrollTo(0,h(this,ne,Js).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,ne,mr))},onConnect:t=>{},persistConversationState:t=>{localStorage.setItem(h(this,ne,mr),JSON.stringify({conversationId:t}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(h(this,ne,mr))||"{}");return{conversationId:yl(Hp,t).conversationId||""}}catch(t){return console.error(t),{conversationId:""}}}}));this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return h(this,re).conversationId}get messages(){return h(this,re).messages}render(){let t=Cl(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return O`
145
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};S(ii,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"}});var ri=class extends hn{constructor(e){if(super(e),this.it=L,e.type!==ur.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||e==null)return this._t=void 0,this.it=e;if(e===Ke)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};ri.directiveName="unsafeHTML",ri.resultType=1;var _l=cr(ri);var Vs;function Op(n){return{lang:n?.lang??Vs?.lang,message:n?.message,abortEarly:n?.abortEarly??Vs?.abortEarly,abortPipeEarly:n?.abortPipeEarly??Vs?.abortPipeEarly}}var Fp;function Mp(n){return Fp?.get(n)}var Dp;function Lp(n){return Dp?.get(n)}var jp;function Np(n,e){return jp?.get(n)?.get(e)}function yn(n){let e=typeof n;return e==="object"&&(e=(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null"),e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e}function $t(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??yn(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??Np(n.reference,l.lang)??(u?Lp(l.lang):null)??i.message??Mp(l.lang);c&&(l.message=typeof c=="function"?c(l):c),u&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}var qp=class extends Error{constructor(e){super(e[0].message);S(this,"issues");this.name="ValiError",this.issues=e}};function Gs(n,e){return{kind:"validation",type:"max_value",reference:Gs,async:!1,expects:`<=${n instanceof Date?n.toJSON():yn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&$t(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():yn(t.value)}),t}}}function Xs(n,e){return{kind:"validation",type:"min_value",reference:Xs,async:!1,expects:`>=${n instanceof Date?n.toJSON():yn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&$t(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():yn(t.value)}),t}}}function Up(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function Ct(n,e){return{kind:"schema",type:"array",reference:Ct,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 $t(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:$t(this,"type",e,t),e}}}function Ge(n){return{kind:"schema",type:"number",reference:Ge,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:$t(this,"type",e,t),e}}}function se(n,e){return{kind:"schema",type:"object",reference:se,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 $t(this,"type",t,i);return t}}}function C(n,...e){let t={kind:"schema",type:"optional",reference:C,expects:`${n.expects} | undefined`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=Up(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:n.map(yn).join(" | ")||"never",async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:$t(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:$t(this,"type",e,t),e}}}function bl(n,e,t){let i=n._run({typed:!1,value:e},Op(t));if(i.issues)throw new qp(i.issues);return i.value}function wl(...n){return{...n[0],pipe:n,_run(e,t){for(let i=0;i<n.length;i++){if(e.issues&&(n[i].kind==="schema"||n[i].kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n[i]._run(e,t))}return e}}}var si,Me,Qe,oi,Js,dr=class{constructor(e,t){b(this,oi);b(this,si);b(this,Me);b(this,Qe);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");A(this,si,e),d(this,si).addController(this),A(this,Me,t)}connect(e){A(this,Me,e),A(this,Qe,R(this,oi,Js).call(this))}hostConnected(){setTimeout(()=>{A(this,Qe,R(this,oi,Js).call(this))},0)}hostDisconnected(){d(this,Qe)?.close(1e3,"lit_host_disconnected"),A(this,Qe,void 0)}send(e){d(this,Qe)?.send(e)}close(e,t){d(this,Qe)?.close(e,t)}render(e={}){switch(d(this,Qe)?.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 d(this,Qe)?.readyState===WebSocket.OPEN}};si=new WeakMap,Me=new WeakMap,Qe=new WeakMap,oi=new WeakSet,Js=function(){let e=new WebSocket(d(this,Me).url());return d(this,Me).onClose&&(e.onclose=d(this,Me).onClose),d(this,Me).onOpen&&(e.onopen=d(this,Me).onOpen),d(this,Me).onError&&(e.onerror=d(this,Me).onError),d(this,Me).onMessage&&(e.onmessage=d(this,Me).onMessage),e};var kl="664df22d-d461-42d6-801e-f70247e2cd7c",ye,_e,Ze,bn,wn,we,Jt,Sl,El,$l,Cl,gr=class{constructor(e,t){b(this,we);b(this,ye);b(this,_e);b(this,Ze);S(this,"isStreaming",!1);S(this,"typingIndicator");S(this,"ranOutOfCredits",!1);S(this,"messages",[]);S(this,"conversationId","");b(this,bn,0);b(this,wn);S(this,"isLiveMode",!1);A(this,ye,e),A(this,_e,t),A(this,Ze,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return R(this,we,Jt).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return R(this,we,Jt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return R(this,we,Jt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return R(this,we,Jt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){R(this,we,Jt).call(this,{type:"RELOAD_CONFIG"})}close(){d(this,Ze).close(1e3,"closed by user")}retry(){clearTimeout(d(this,wn)),A(this,wn,setTimeout(()=>{d(this,_e).onReconnect?.(),A(this,Ze,this.initWS())},1e3*d(this,bn))),ra(this,bn)._++}initWS(){return new dr(d(this,ye),{url:()=>d(this,_e).url(this.conversationId,{}),onOpen:e=>R(this,we,Sl).call(this,e),onMessage:e=>R(this,we,El).call(this,JSON.parse(e.data)),onError:e=>R(this,we,$l).call(this,e),onClose:e=>R(this,we,Cl).call(this,e)})}hostConnected(){this.conversationId=d(this,_e).restoreConversationState?.()?.conversationId||"",this.messages=d(this,_e).restoreConversationState?.()?.messages||[]}reset(){R(this,we,Jt).call(this,{type:"NEW_CHAT"}),d(this,_e).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,d(this,ye).requestUpdate()}hostDisconnected(){clearTimeout(d(this,wn))}reconnectSocket(){d(this,Ze).close(1e3,"destroy"),A(this,Ze,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};ye=new WeakMap,_e=new WeakMap,Ze=new WeakMap,bn=new WeakMap,wn=new WeakMap,we=new WeakSet,Jt=function(e,{expectStreaming:t=!1}={}){return d(this,Ze).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,d(this,ye).requestUpdate()),d(this,Ze).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Sl=function(e){A(this,bn,0)},El=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,d(this,ye).requestUpdate(),d(this,_e).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),d(this,ye).requestUpdate(),d(this,_e).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(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,d(this,ye).requestUpdate(),d(this,_e).onMessageDone?.(e,t),d(this,_e).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,d(this,ye).requestUpdate();break}case"ERROR":{d(this,_e).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,d(this,_e).onConnect?.(e.conversationId),d(this,_e).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,d(this,ye).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},d(this,ye).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,d(this,ye).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===kl)||this.messages.push({id:kl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,d(this,ye).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),d(this,ye).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},$l=function(e){console.error("onError",e),d(this,_e).onError?.(e)},Cl=function(e){d(this,ye).isConnected&&!d(this,Ze).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,d(this,ye).requestUpdate(),d(this,_e).onClose?.()};var ai,xn,At,Yt,mr,Al,vr=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,mr);b(this,ai);b(this,xn);b(this,At);b(this,Yt,!1);S(this,"timeoutMs");A(this,ai,e),A(this,xn,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return d(this,Yt)}hostDisconnected(){clearTimeout(d(this,At)),A(this,At,void 0)}onInput(e){if(d(this,ai).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(d(this,At)),A(this,At,setTimeout(()=>this.typingStopped(),this.timeoutMs)),d(this,Yt)||R(this,mr,Al).call(this)}}typingStopped(){clearTimeout(d(this,At)),A(this,Yt,!1),d(this,xn).typingStopped()}};ai=new WeakMap,xn=new WeakMap,At=new WeakMap,Yt=new WeakMap,mr=new WeakSet,Al=function(){A(this,Yt,!0),d(this,xn).typingStarted()};function Il(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 Tl(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 Qg=se({wsApiUrl:j(),url:j(),logoUrl:C(j()),title:j(),status:j(),color:j(),showStillLearningBanner:C($e()),allowedOrigins:C(Ct(j())),input:se({placeholder:j()}),bubble:se({imageUrl:C(j()),position:se({bottom:C(j()),right:C(j()),left:C(j())}),mobilePosition:C(se({bottom:C(j()),right:C(j()),left:C(j())}))}),examples:se({title:j(),items:Ct(j())}),instructions:se({items:Ct(j())}),popup:C(se({mobileEnabled:C($e()),desktopEnabled:C($e()),delayMs:C(Ge()),text:C(j()),mobileTitleText:C(j()),mobileButtonText:C(j())})),tryItOut:C(se({mobileEnabled:C($e()),desktopEnabled:C($e()),text:C(j())})),contactDetails:C(se({email:C(j()),phone:C(j()),socialMedia:C(se({facebook:C(j()),instagram:C(j()),twitter:C(j())}))})),neverShowStillLearningBanner:C($e()),hidden:C($e()),newChatTitle:C(j()),webhookURL:C(j()),automatedResponse:C(se({enabled:C($e()),text:C(j()),latencyThresholdMs:C(Ge())})),manual:C($e()),removePoweredBy:C($e()),claimable:C($e()),feed:C(j()),scraper:C(_n(["netkazan","jateknet","grandopet","insportline","partocean"])),platform:C(_n(["shopify","shoprenter","unas","scraper"])),workingHours:C(se({dailyAvailability:Ct(se({dayOfWeek:wl(Ge(),Xs(0),Gs(6)),startTime:j(),endTime:j(),isActive:$e()})),userTimeZone:C(j())})),planOverrides:C(se({maxProducts:C(Ge()),conversations:C(Ge()),faqs:C(se({max:C(Ge()),questionLength:C(Ge()),answerLength:C(Ge())}))})),omitGeneralGuidelines:C($e()),forceStripe:C($e())});var Bp="\xB7 \xB7 \xB7",zp=se({conversationId:C(j()),messages:C(Ct(se({id:j(),timestamp:Ge(),role:_n(["user","assistant","support"]),content:j(),content_html:C(j())})))}),ne,yr,li,oe,Rl,Pl,Ol,Fl,Ml,Dl,Ll,Ks,_r=class _r extends z(N){constructor(){super();b(this,ne);b(this,li,new vr(this,{typingStarted:()=>d(this,oe).sendUserTypingStart(),typingStopped:()=>d(this,oe).sendUserTypingStop()}));b(this,oe,new gr(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"&&d(this,ne,Ks)?.scrollTo(0,d(this,ne,Ks).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(d(this,ne,yr))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(d(this,ne,yr),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(d(this,ne,yr))||"{}"),i=bl(zp,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 d(this,oe).conversationId}get messages(){return d(this,oe).messages}render(){let t=Il(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return O`
146
146
  <div class="mx-auto flex h-full w-full flex-col bg-white font-sans text-base">
147
147
  <mw-header
148
148
  class="z-10 border-b"
149
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,re).isLiveMode&&this.messages.length>0}"
150
+ ?show-new-chat="${!d(this,oe).isLiveMode&&this.messages.length>0}"
151
151
  ?show-close="${this.showClose}"
152
- @mw:new-chat-click="${R(this,ne,Fl)}"
153
- @mw:close-click="${R(this,ne,Ml)}">
152
+ @mw:new-chat-click="${R(this,ne,Dl)}"
153
+ @mw:close-click="${R(this,ne,Ll)}">
154
154
  </mw-header>
155
155
 
156
156
  <!-- used by the dashboard to inject content -->
@@ -176,13 +176,13 @@ CHAT`}</span>
176
176
 
177
177
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
178
178
  <div>
179
- ${Zn(Array.from(t),([i])=>i,([i,r])=>O`
180
- <div class="my-2 text-center text-xs text-gray-500">${Al(new Date(Number(i)),window.navigator.language)}</div>
181
- ${Zn(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,u=h(this,re).isLiveMode&&s.role==="user"&&s.id===h(this,re).lastMsg?.id?"sent":"";return O`
179
+ ${ti(Array.from(t),([i])=>i,([i,r])=>O`
180
+ <div class="my-2 text-center text-xs text-gray-500">${Tl(new Date(Number(i)),window.navigator.language)}</div>
181
+ ${ti(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,u=d(this,oe).isLiveMode&&s.role==="user"&&s.id===d(this,oe).lastMsg?.id?"sent":"";return O`
182
182
  <div class="${l?"mb-[2px]":"mb-3"} mx-4 flex-row">
183
- <mw-chat-message color="${this.config.color}" status="${u}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" @click="${R(this,ne,Il)}">
183
+ <mw-chat-message color="${this.config.color}" status="${u}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" @click="${R(this,ne,Rl)}">
184
184
  <div class="prose break-words text-inherit">
185
- ${s.content===zp?O`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?vl(s.content_html):O`<p>${s.content}</p>`}
185
+ ${s.content===Bp?O`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?_l(s.content_html):O`<p>${s.content}</p>`}
186
186
  </div>
187
187
  </mw-chat-message>
188
188
  </div>
@@ -190,27 +190,27 @@ CHAT`}</span>
190
190
  `)}
191
191
 
192
192
  <!-- show typing indicator if the non-user side is typing -->
193
- ${["assistant","support"].includes(h(this,re)?.typingIndicator?.role??"")&&h(this,re)?.typingIndicator?.role?O`
194
- <mw-chat-message class="mx-4 mb-4 block" color="${this.config.color}" logo="${h(this,re)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}" side="${h(this,re).typingIndicator.role}">
193
+ ${["assistant","support"].includes(d(this,oe)?.typingIndicator?.role??"")&&d(this,oe)?.typingIndicator?.role?O`
194
+ <mw-chat-message class="mx-4 mb-4 block" color="${this.config.color}" logo="${d(this,oe)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}" side="${d(this,oe).typingIndicator.role}">
195
195
  <div class="prose break-words text-inherit">
196
196
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>
197
197
  </div>
198
198
  </mw-chat-message>
199
- `:D}
199
+ `:L}
200
200
  </div>
201
201
 
202
202
  <mw-background
203
203
  class="mx-auto max-w-sm flex-grow"
204
204
  .examples="${this.messages.length>0?[]:this.config.examples}"
205
- @mw:example-click="${R(this,ne,Tl)}"></mw-background>
205
+ @mw:example-click="${R(this,ne,Pl)}"></mw-background>
206
206
  </div>
207
207
 
208
208
  <div class="flex-shrink-0 flex-grow-0 space-y-2 pb-2">
209
- <mw-chat-input @mw:change="${R(this,ne,Pl)}" @mw:submit="${R(this,ne,Rl)}" @mw:cancel="${R(this,ne,Ol)}" placeholder="${this.config.input?.placeholder}" color="${this.config.color}" ?disabled="${h(this,re).ranOutOfCredits}" ?streaming="${h(this,re)?.isStreaming??!0}"></mw-chat-input>
210
- ${this.config.removePoweredBy?D:O`<mw-powered-by></mw-powered-by>`}
209
+ <mw-chat-input @mw:change="${R(this,ne,Fl)}" @mw:submit="${R(this,ne,Ol)}" @mw:cancel="${R(this,ne,Ml)}" placeholder="${this.config.input?.placeholder}" color="${this.config.color}" ?disabled="${d(this,oe).ranOutOfCredits}" ?streaming="${d(this,oe)?.isStreaming??!0}"></mw-chat-input>
210
+ ${this.config.removePoweredBy?L:O`<mw-powered-by></mw-powered-by>`}
211
211
  </div>
212
212
  </div>
213
- `}reloadConfig(){h(this,re).reloadConfig(),this.requestUpdate()}};ne=new WeakSet,mr=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},oi=new WeakMap,re=new WeakMap,Il=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)}},Tl=function(t){let i=t.detail.example;if(!h(this,re)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},Rl=function(t){let i=t.detail;if(!h(this,re)?.sendUserInput(i)){t.preventDefault();return}h(this,oi).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},Pl=function(t){h(this,oi).onInput(t.detail.full)},Ol=function(){h(this,re)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Fl=function(){h(this,re).reset()},Ml=function(){this.dispatchEvent(new vr.CloseClickEvent)},Js=function(){return this.renderRoot.querySelector("#scrollable-content")},S(vr,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var wn=vr,Xs;wn.CloseClickEvent=(Xs=class extends CustomEvent{constructor(e={}){super(wn.CloseClickEvent.type,{...e})}},S(Xs,"type","mw:close-click"),Xs);var yr=class extends z(j){constructor(){super(...arguments);S(this,"render",()=>O`
213
+ `}reloadConfig(){d(this,oe).reloadConfig(),this.requestUpdate()}};ne=new WeakSet,yr=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},li=new WeakMap,oe=new WeakMap,Rl=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)}},Pl=function(t){let i=t.detail.example;if(!d(this,oe)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},Ol=function(t){let i=t.detail;if(!d(this,oe)?.sendUserInput(i)){t.preventDefault();return}d(this,li).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},Fl=function(t){d(this,li).onInput(t.detail.full)},Ml=function(){d(this,oe)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Dl=function(){d(this,oe).reset()},Ll=function(){this.dispatchEvent(new _r.CloseClickEvent)},Ks=function(){return this.renderRoot.querySelector("#scrollable-content")},S(_r,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var kn=_r,Ys;kn.CloseClickEvent=(Ys=class extends CustomEvent{constructor(e={}){super(kn.CloseClickEvent.type,{...e})}},S(Ys,"type","mw:close-click"),Ys);var br=class extends z(N){constructor(){super(...arguments);S(this,"render",()=>O`
214
214
  <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">
215
215
  <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
216
216
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -222,56 +222,56 @@ CHAT`}</span>
222
222
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
223
223
  </circle>
224
224
  </svg>
225
- `)}};var xn,Dl,Ll,ai=class ai extends z(j){constructor(){super();b(this,xn);S(this,"render",()=>O`
225
+ `)}};var Sn,jl,Nl,ui=class ui extends z(N){constructor(){super();b(this,Sn);S(this,"render",()=>O`
226
226
  <!-- wrapper -->
227
227
  <div class="group relative z-[2147483647] rounded-t-2xl bg-white font-sans text-base leading-normal shadow-2xl select-none w-[300px] rounded-2xl cursor-pointer">
228
228
  <!-- close button -->
229
- <button class="absolute pb-[2px] -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full text-gray-700 bg-gray-300 bg-opacity-50 text-center duration-300 ease-in-out opacity-0 shadow transition-opacity group-hover:opacity-100" @click="${R(this,xn,Dl)}" aria-label="Close">×</button>
229
+ <button class="absolute pb-[2px] -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full text-gray-700 bg-gray-300 bg-opacity-50 text-center duration-300 ease-in-out opacity-0 shadow transition-opacity group-hover:opacity-100" @click="${R(this,Sn,jl)}" aria-label="Close">×</button>
230
230
 
231
231
  <!-- content -->
232
- <div class="p-4 text-left text-gray-800" @click="${R(this,xn,Ll)}">
232
+ <div class="p-4 text-left text-gray-800" @click="${R(this,Sn,Nl)}">
233
233
  <p>${this.text}</p>
234
234
  </div>
235
235
  </div>
236
- `);this.text="Hello there. How can we help?"}};xn=new WeakSet,Dl=function(){this.dispatchEvent(new ai.CloseEvent)},Ll=function(){this.dispatchEvent(new ai.ClickEvent)},S(ai,"properties",{text:{type:String}});var Ct=ai,Ys;Ct.CloseEvent=(Ys=class extends CustomEvent{constructor(e={}){super(Ct.CloseEvent.type,{...e})}},S(Ys,"type","mw:close"),Ys);var Ks;Ct.ClickEvent=(Ks=class extends CustomEvent{constructor(e={}){super(Ct.ClickEvent.type,{...e})}},S(Ks,"type","mw:click"),Ks);var kn,jl,ql,li=class li extends z(j){constructor(){super();b(this,kn);S(this,"render",()=>O`
236
+ `);this.text="Hello there. How can we help?"}};Sn=new WeakSet,jl=function(){this.dispatchEvent(new ui.CloseEvent)},Nl=function(){this.dispatchEvent(new ui.ClickEvent)},S(ui,"properties",{text:{type:String}});var It=ui,Qs;It.CloseEvent=(Qs=class extends CustomEvent{constructor(e={}){super(It.CloseEvent.type,{...e})}},S(Qs,"type","mw:close"),Qs);var Zs;It.ClickEvent=(Zs=class extends CustomEvent{constructor(e={}){super(It.ClickEvent.type,{...e})}},S(Zs,"type","mw:click"),Zs);var En,ql,Ul,ci=class ci extends z(N){constructor(){super();b(this,En);S(this,"render",()=>O`
237
237
  <!-- wrapper -->
238
238
  <div class="group relative z-[2147483647] rounded-t-2xl text-left bg-white font-sans text-base text-[16px] leading-normal shadow-2xl select-none text-gray-800 transition-all">
239
239
  <!-- close button -->
240
- <button class="absolute pb-[2px] top-[28px] right-4 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 text-center shadow-none duration-300 ease-in-out focus:outline-none" @click="${R(this,kn,jl)}" aria-label="Close">×</button>
240
+ <button class="absolute pb-[2px] top-[28px] right-4 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 text-center shadow-none duration-300 ease-in-out focus:outline-none" @click="${R(this,En,ql)}" aria-label="Close">×</button>
241
241
 
242
242
  <!-- content -->
243
- <div class="p-4 text-gray-800" @click="${R(this,kn,ql)}">
243
+ <div class="p-4 text-gray-800" @click="${R(this,En,Ul)}">
244
244
  <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
245
245
  <p class="py-2.5 text-left">${this.text}</p>
246
246
  <div class="h-4"></div>
247
247
  ${this.button&&this.color?O`
248
248
  <!-- only visible if button text and color are given -->
249
249
  <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>
250
- `:D}
250
+ `:L}
251
251
  </div>
252
252
 
253
253
  <!-- can append any other content -->
254
254
  <slot name="footer"></slot>
255
255
  </div>
256
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};kn=new WeakSet,jl=function(){this.dispatchEvent(new li.CloseEvent)},ql=function(){this.dispatchEvent(new li.ClickEvent)},S(li,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var At=li,Qs;At.CloseEvent=(Qs=class extends CustomEvent{constructor(e={}){super(At.CloseEvent.type,{...e})}},S(Qs,"type","mw:close"),Qs);var Zs;At.ClickEvent=(Zs=class extends CustomEvent{constructor(e={}){super(At.ClickEvent.type,{...e})}},S(Zs,"type","mw:click"),Zs);var Sn,ui,Jt,_r=class{constructor(e,t){b(this,Sn);b(this,ui,!1);b(this,Jt,()=>{h(this,ui)||(h(this,Sn).userFirstInteracted?.(),$(this,ui,!0)),h(this,Sn).userInteracted?.()});$(this,Sn,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",h(this,Jt)),window.addEventListener("keydown",h(this,Jt))}stopListening(){window.removeEventListener("click",h(this,Jt)),window.removeEventListener("keydown",h(this,Jt))}};Sn=new WeakMap,ui=new WeakMap,Jt=new WeakMap;var Wp=2*60*60*1e3,En,Ne,Yt,ci,Kt,pi,wr,Nl,br=class{constructor(e,t,i=Date){b(this,wr);b(this,En);b(this,Ne);b(this,Yt);b(this,ci);b(this,Kt,!1);b(this,pi,!1);$(this,En,e),$(this,Ne,t),$(this,Yt,i),e.addController(this)}get showing(){return h(this,Kt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!h(this,Kt)&&($(this,Kt,!0),h(this,En).requestUpdate(),e)){h(this,Ne).playPopupSound();let t=h(this,Ne).getPersistedState();h(this,Ne).setPersistedState({...t,playedSoundOnce:!0})}}hide(){$(this,pi,!0),this.abortAutoShowTimer(),$(this,Kt,!1),h(this,En).requestUpdate()}abortAutoShowTimer(){clearTimeout(h(this,ci))}onCloseClick(){let e=h(this,Ne).getPersistedState();h(this,Ne).setPersistedState({...e,userDismissedAt:h(this,Yt).now()}),this.hide()}onContentClick(){let e=h(this,Ne).getPersistedState();h(this,Ne).setPersistedState({...e,userDismissedAt:h(this,Yt).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),h(this,pi)||$(this,ci,setTimeout(()=>R(this,wr,Nl).call(this),h(this,Ne).delayMs()))}};En=new WeakMap,Ne=new WeakMap,Yt=new WeakMap,ci=new WeakMap,Kt=new WeakMap,pi=new WeakMap,wr=new WeakSet,Nl=function(){let e=h(this,Ne).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&h(this,Yt).now()-e.userDismissedAt<Wp||this.show({sound:!t})};var It,io,Tt,to,no,xr=class xr extends z(j){constructor(){super();b(this,Tt);b(this,It,new br(this,{delayMs:()=>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,io,new _r(this,h(this,It)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=h(this,It).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return O`
256
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};En=new WeakSet,ql=function(){this.dispatchEvent(new ci.CloseEvent)},Ul=function(){this.dispatchEvent(new ci.ClickEvent)},S(ci,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Tt=ci,eo;Tt.CloseEvent=(eo=class extends CustomEvent{constructor(e={}){super(Tt.CloseEvent.type,{...e})}},S(eo,"type","mw:close"),eo);var to;Tt.ClickEvent=(to=class extends CustomEvent{constructor(e={}){super(Tt.ClickEvent.type,{...e})}},S(to,"type","mw:click"),to);var $n,pi,Kt,wr=class{constructor(e,t){b(this,$n);b(this,pi,!1);b(this,Kt,()=>{d(this,pi)||(d(this,$n).userFirstInteracted?.(),A(this,pi,!0)),d(this,$n).userInteracted?.()});A(this,$n,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",d(this,Kt)),window.addEventListener("keydown",d(this,Kt))}stopListening(){window.removeEventListener("click",d(this,Kt)),window.removeEventListener("keydown",d(this,Kt))}};$n=new WeakMap,pi=new WeakMap,Kt=new WeakMap;var Hp=2*60*60*1e3,Cn,qe,Qt,fi,Zt,hi,kr,Bl,xr=class{constructor(e,t,i=Date){b(this,kr);b(this,Cn);b(this,qe);b(this,Qt);b(this,fi);b(this,Zt,!1);b(this,hi,!1);A(this,Cn,e),A(this,qe,t),A(this,Qt,i),e.addController(this)}get showing(){return d(this,Zt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!d(this,Zt)&&(A(this,Zt,!0),d(this,Cn).requestUpdate(),e)){d(this,qe).playPopupSound();let t=d(this,qe).getPersistedState();d(this,qe).setPersistedState({...t,playedSoundOnce:!0})}}hide(){A(this,hi,!0),this.abortAutoShowTimer(),A(this,Zt,!1),d(this,Cn).requestUpdate()}abortAutoShowTimer(){clearTimeout(d(this,fi))}onCloseClick(){let e=d(this,qe).getPersistedState();d(this,qe).setPersistedState({...e,userDismissedAt:d(this,Qt).now()}),this.hide()}onContentClick(){let e=d(this,qe).getPersistedState();d(this,qe).setPersistedState({...e,userDismissedAt:d(this,Qt).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),d(this,hi)||A(this,fi,setTimeout(()=>R(this,kr,Bl).call(this),d(this,qe).delayMs()))}};Cn=new WeakMap,qe=new WeakMap,Qt=new WeakMap,fi=new WeakMap,Zt=new WeakMap,hi=new WeakMap,kr=new WeakSet,Bl=function(){let e=d(this,qe).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&d(this,Qt).now()-e.userDismissedAt<Hp||this.show({sound:!t})};var Rt,so,Pt,io,ro,Sr=class Sr extends z(N){constructor(){super();b(this,Pt);b(this,Rt,new xr(this,{delayMs:()=>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,so,new wr(this,d(this,Rt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=d(this,Rt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return O`
257
257
  <!-- mobile shadow backdrop -->
258
258
  <div class="sm:hidden ${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility]"></div>
259
259
 
260
260
  <!-- mobile overlay -->
261
261
  <div class="sm:hidden ${t} fixed bottom-0 z-[2147483647] left-0 right-0">
262
- <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${R(this,Tt,no)}" @mw:close="${R(this,Tt,to)}">
263
- ${i.mobile.poweredBy?O`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:D}
262
+ <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${R(this,Pt,ro)}" @mw:close="${R(this,Pt,io)}">
263
+ ${i.mobile.poweredBy?O`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:L}
264
264
  </mw-popup-mobile>
265
265
  </div>
266
266
 
267
267
  <!-- desktop -->
268
268
  <div class="max-sm:hidden ${t} ${this.positionClasses} z-[2147483647] fixed transition-[opacity,translate,visibility]">
269
- <mw-popup-desktop text="${i.desktop.text}" @mw:click="${R(this,Tt,no)}" @mw:close="${R(this,Tt,to)}"></mw-popup-desktop>
269
+ <mw-popup-desktop text="${i.desktop.text}" @mw:click="${R(this,Pt,ro)}" @mw:close="${R(this,Pt,io)}"></mw-popup-desktop>
270
270
  </div>
271
- `}hide(){h(this,It).hide()}};It=new WeakMap,io=new WeakMap,Tt=new WeakSet,to=function(){h(this,It).onCloseClick()},no=function(){this.dispatchEvent(new xr.ClickEvent),h(this,It).onContentClick()},S(xr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var $n=xr,eo;$n.ClickEvent=(eo=class extends CustomEvent{constructor(e={}){super($n.ClickEvent.type,{...e})}},S(eo,"type","mw:click"),eo);var Gp="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",fi=class extends z(j){constructor(){super(...arguments);S(this,"render",()=>O`
271
+ `}hide(){d(this,Rt).hide()}};Rt=new WeakMap,so=new WeakMap,Pt=new WeakSet,io=function(){d(this,Rt).onCloseClick()},ro=function(){this.dispatchEvent(new Sr.ClickEvent),d(this,Rt).onContentClick()},S(Sr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var An=Sr,no;An.ClickEvent=(no=class extends CustomEvent{constructor(e={}){super(An.ClickEvent.type,{...e})}},S(no,"type","mw:click"),no);var Wp="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",di=class extends z(N){constructor(){super(...arguments);S(this,"render",()=>O`
272
272
  <p class="flex items-center justify-center bg-white m-0 space-x-1 text-xs font-sans text-gray-400">
273
273
  <span class="pointer-events-none select-none">Powered by</span>
274
- <a class="inline-flex items-center space-x-1 text-gray-600 underline" href="${Gp}" target="_blank">
274
+ <a class="inline-flex items-center space-x-1 text-gray-600 underline" href="${Wp}" target="_blank">
275
275
  <!-- molin logo icon -->
276
276
  <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">
277
277
  <g clip-path="url(#clip0_1347_2815)">
@@ -287,19 +287,19 @@ CHAT`}</span>
287
287
  <span>Molin AI</span>
288
288
  </a>
289
289
  </p>
290
- `)}};S(fi,"styles",Ts`
290
+ `)}};S(di,"styles",Ps`
291
291
  :host {
292
292
  display: block;
293
293
  }
294
- `);var kr,Ul,hi=class extends z(j){constructor(){super();b(this,kr);S(this,"render",()=>O`
294
+ `);var Er,zl,gi=class extends z(N){constructor(){super();b(this,Er);S(this,"render",()=>O`
295
295
  <span class="relative inline-flex">
296
296
  <slot></slot>
297
- <span class="${h(this,kr,Ul)} pointer-events-none absolute flex h-3 w-3">
297
+ <span class="${d(this,Er,zl)} pointer-events-none absolute flex h-3 w-3">
298
298
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
299
299
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
300
300
  </span>
301
301
  </span>
302
- `);this.color="sky-500",this.position="top-right"}};kr=new WeakSet,Ul=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}`)}},S(hi,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});var di=class extends z(j){constructor(){super();S(this,"render",()=>O`
302
+ `);this.color="sky-500",this.position="top-right"}};Er=new WeakSet,zl=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}`)}},S(gi,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});var vi=class extends z(N){constructor(){super();S(this,"render",()=>O`
303
303
  <div class="fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base ${this.positionClasses}">
304
304
  <p class="text-md mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
305
305
 
@@ -308,22 +308,22 @@ CHAT`}</span>
308
308
  <path d="M1.41089 1.17749C13.4657 11.874 23.3966 26.992 30.4581 41.4117C31.9751 44.5093 33.1523 47.7224 34.4136 50.9242C34.6288 51.4705 35.4719 52.2988 34.8747 51.5309C33.1064 49.2574 28.9356 48.4966 26.3813 47.9151C23.973 47.3669 17.1432 44.725 19.1984 46.0951C22.9606 48.6033 26.6842 51.3163 30.5552 53.7391C32.8502 55.1756 34.9449 57.9465 37.0101 55.8018C41.8322 50.7943 47.8486 46.2228 53.4629 42.1397" stroke="#303132" stroke-width="2" stroke-linecap="round"></path>
309
309
  </svg>
310
310
  </div>
311
- `);this.positionClasses="",this.text="Try it out"}};S(di,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.define("mw-background",hn);customElements.define("mw-bubble",Qn);customElements.define("mw-chat",wn);customElements.define("mw-chat-input",rt);customElements.define("mw-chat-message",ti);customElements.define("mw-header",St);customElements.define("mw-loading",yr);customElements.define("mw-popup",$n);customElements.define("mw-powered-by",fi);customElements.define("mw-pulse-dot",hi);customElements.define("mw-try-it-out",di);customElements.define("mw-upsell-banner",Kn);customElements.define("mw-popup-desktop",Ct);customElements.define("mw-popup-mobile",At);window.__INIT_MOLIN_SHOP_AI=function(e){if(Vp(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 Vp(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function Bl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Qt,gi,Rt,Zt,Er,zl,Sr=class{constructor(e,t,i){b(this,Er);b(this,Qt);b(this,gi);b(this,Rt);b(this,Zt);S(this,"isLoading",!1);S(this,"data");$(this,Qt,e),$(this,gi,t),$(this,Rt,i),e.addController(this)}fetch(){if(this.isLoading)return;h(this,Zt)?.abort();let e=new AbortController;$(this,Zt,e),this.isLoading=!0,this.data=void 0,h(this,Qt).requestUpdate(),(async()=>{let t=R(this,Er,zl).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,Rt)?.transform=="function"?await h(this,Rt).transform(t):t,h(this,Qt).requestUpdate()}).catch(t=>{h(this,Rt)?.onError?.(t),this.isLoading=!1,this.data=void 0,h(this,Qt).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||h(this,Rt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){h(this,Zt)?.abort(),$(this,Zt,void 0)}};Qt=new WeakMap,gi=new WeakMap,Rt=new WeakMap,Zt=new WeakMap,Er=new WeakSet,zl=function(){let e=h(this,gi);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ot,mi,Cn,An,Pt=class{constructor(e,t){b(this,ot);b(this,mi);b(this,Cn);b(this,An);$(this,ot,e),$(this,mi,t),e.addController(this)}get data(){return h(this,An)||h(this,Cn)?.data}hostConnected(){if(h(this,Cn)||h(this,An))return;let e=Bl();e&&e.widgetId===h(this,ot).widgetId?$(this,An,e.config):$(this,Cn,new Sr(h(this,ot),()=>{if(h(this,ot).cdn&&h(this,ot).widgetId)return`${h(this,ot).cdn}/config?w=${h(this,ot).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:h(this,mi)?.onError}))}};ot=new WeakMap,mi=new WeakMap,Cn=new WeakMap,An=new WeakMap;function Hl(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 C(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hl(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hl(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ci(n){return Ci=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},Ci(n)}function H(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Wl(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 W(n,e,t){return e&&Wl(n.prototype,e),t&&Wl(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 Xp(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 Ie(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)||No(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function rn(n){return function(e){if(Array.isArray(e))return vo(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||No(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
313
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function No(n,e){if(n){if(typeof n=="string")return vo(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)?vo(n,e):void 0}}function vo(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 nt(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=No(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.
314
- 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 Dt={DEBUG:!1,LIB_VERSION:"1.139.2"},Jp=Array.isArray,Du=Object.prototype,Lu=Du.hasOwnProperty,Vr=Du.toString,de=Jp||function(n){return Vr.call(n)==="[object Array]"},tt=function(n){return typeof n=="function"},et=function(n){return n===Object(n)&&!de(n)},ro=function(n){if(et(n)){for(var e in n)if(Lu.call(n,e))return!1;return!0}return!1},M=function(n){return n===void 0},Re=function(n){return Vr.call(n)=="[object String]"},_t=function(n){return n===null},lt=function(n){return M(n)||_t(n)},at=function(n){return Vr.call(n)=="[object Number]"},Pr=function(n){return Vr.call(n)==="[object Boolean]"},Yp=function(n){return n instanceof FormData},m=typeof window<"u"?window:void 0,Le=typeof globalThis<"u"?globalThis:m,ju=Array.prototype,Gl=ju.forEach,Vl=ju.indexOf,vt=Le?.navigator,A=Le?.document,De=Le?.location,yo=Le?.fetch,_o=Le!=null&&Le.XMLHttpRequest&&"withCredentials"in new Le.XMLHttpRequest?Le.XMLHttpRequest:void 0,Xl=Le?.AbortController,se=vt?.userAgent,he=m??{},Jl="[PostHog.js]",x={_log:function(n){if(m&&(Dt.DEBUG||he.POSTHOG_DEBUG)&&!M(m.console)&&m.console){for(var e=("__rrweb_original__"in m.console[n])?m.console[n].__rrweb_original__:m.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,[Jl].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];x._log.apply(x,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];x._log.apply(x,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];x._log.apply(x,["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,[Jl].concat(t))},uninitializedWarning:function(n){x.error("You must initialize PostHog before calling ".concat(n))}},Dr={},Xr=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Pn(n,e,t){if(de(n)){if(Gl&&n.forEach===Gl)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)===Dr)return}}}function X(n,e,t){if(!lt(n)){if(de(n))return Pn(n,e,t);if(Yp(n)){var i,r=nt(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===Dr)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(Lu.call(n,o)&&e.call(t,n[o],o)===Dr)return}}var Te=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 Pn(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function N(n,e){return n.indexOf(e)!==-1}function Or(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 qu=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Yl=function(n){try{return n()}catch{return}},Kp=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){x.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),x.critical(r)}}},bo=function(n){var e={};return X(n,function(t,i){Re(t)&&t.length>0&&(e[i]=t)}),e},wo=function(n){return n.replace(/^\$/,"")};function Qp(n,e){return t=n,i=function(s){return Re(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=[],Pn(o,function(u){l.push(s(u))})):(l={},X(o,function(u,c){r.has(u)||(l[c]=s(u,c))})),l);var l}(t);var t,i,r}var Ze,Zp=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
311
+ `);this.positionClasses="",this.text="Try it out"}};S(vi,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.define("mw-background",gn);customElements.define("mw-bubble",ei);customElements.define("mw-chat",kn);customElements.define("mw-chat-input",ot);customElements.define("mw-chat-message",ii);customElements.define("mw-header",Et);customElements.define("mw-loading",br);customElements.define("mw-popup",An);customElements.define("mw-powered-by",di);customElements.define("mw-pulse-dot",gi);customElements.define("mw-try-it-out",vi);customElements.define("mw-upsell-banner",Zn);customElements.define("mw-popup-desktop",It);customElements.define("mw-popup-mobile",Tt);window.__INIT_MOLIN_SHOP_AI=function(e){if(Vp(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 Vp(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function Hl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var en,mi,Ot,tn,Cr,Wl,$r=class{constructor(e,t,i){b(this,Cr);b(this,en);b(this,mi);b(this,Ot);b(this,tn);S(this,"isLoading",!1);S(this,"data");A(this,en,e),A(this,mi,t),A(this,Ot,i),e.addController(this)}fetch(){if(this.isLoading)return;d(this,tn)?.abort();let e=new AbortController;A(this,tn,e),this.isLoading=!0,this.data=void 0,d(this,en).requestUpdate(),(async()=>{let t=R(this,Cr,Wl).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 d(this,Ot)?.transform=="function"?await d(this,Ot).transform(t):t,d(this,en).requestUpdate()}).catch(t=>{d(this,Ot)?.onError?.(t),this.isLoading=!1,this.data=void 0,d(this,en).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||d(this,Ot)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){d(this,tn)?.abort(),A(this,tn,void 0)}};en=new WeakMap,mi=new WeakMap,Ot=new WeakMap,tn=new WeakMap,Cr=new WeakSet,Wl=function(){let e=d(this,mi);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var at,yi,In,Tn,Ft=class{constructor(e,t){b(this,at);b(this,yi);b(this,In);b(this,Tn);A(this,at,e),A(this,yi,t),e.addController(this)}get data(){return d(this,Tn)||d(this,In)?.data}hostConnected(){if(d(this,In)||d(this,Tn))return;let e=Hl();e&&e.widgetId===d(this,at).widgetId?A(this,Tn,e.config):A(this,In,new $r(d(this,at),()=>{if(d(this,at).cdn&&d(this,at).widgetId)return`${d(this,at).cdn}/config?w=${d(this,at).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:d(this,yi)?.onError}))}};at=new WeakMap,yi=new WeakMap,In=new WeakMap,Tn=new WeakMap;function Vl(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 I(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vl(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vl(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ti(n){return Ti=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},Ti(n)}function W(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Gl(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&&Gl(n.prototype,e),t&&Gl(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 Gp(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 Ie(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)||Bo(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function on(n){return function(e){if(Array.isArray(e))return _o(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||Bo(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
313
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Bo(n,e){if(n){if(typeof n=="string")return _o(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)?_o(n,e):void 0}}function _o(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 rt(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Bo(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.
314
+ 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 jt={DEBUG:!1,LIB_VERSION:"1.140.0"},Xp=Array.isArray,Du=Object.prototype,Lu=Du.hasOwnProperty,Jr=Du.toString,de=Xp||function(n){return Jr.call(n)==="[object Array]"},it=function(n){return typeof n=="function"},nt=function(n){return n===Object(n)&&!de(n)},oo=function(n){if(nt(n)){for(var e in n)if(Lu.call(n,e))return!1;return!0}return!1},F=function(n){return n===void 0},Re=function(n){return Jr.call(n)=="[object String]"},bt=function(n){return n===null},ut=function(n){return F(n)||bt(n)},lt=function(n){return Jr.call(n)=="[object Number]"},Fr=function(n){return Jr.call(n)==="[object Boolean]"},Jp=function(n){return n instanceof FormData},m=typeof window<"u"?window:void 0,Le=typeof globalThis<"u"?globalThis:m,ju=Array.prototype,Xl=ju.forEach,Jl=ju.indexOf,yt=Le?.navigator,T=Le?.document,De=Le?.location,bo=Le?.fetch,wo=Le!=null&&Le.XMLHttpRequest&&"withCredentials"in new Le.XMLHttpRequest?Le.XMLHttpRequest:void 0,Yl=Le?.AbortController,ae=yt?.userAgent,he=m??{},Kl="[PostHog.js]",k={_log:function(n){if(m&&(jt.DEBUG||he.POSTHOG_DEBUG)&&!F(m.console)&&m.console){for(var e=("__rrweb_original__"in m.console[n])?m.console[n].__rrweb_original__:m.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,[Kl].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["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,[Kl].concat(t))},uninitializedWarning:function(n){k.error("You must initialize PostHog before calling ".concat(n))}},Lr={},Yr=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Fn(n,e,t){if(de(n)){if(Xl&&n.forEach===Xl)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)===Lr)return}}}function Y(n,e,t){if(!ut(n)){if(de(n))return Fn(n,e,t);if(Jp(n)){var i,r=rt(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===Lr)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(Lu.call(n,o)&&e.call(t,n[o],o)===Lr)return}}var Te=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 Fn(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function U(n,e){return n.indexOf(e)!==-1}function Mr(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 Nu=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Ql=function(n){try{return n()}catch{return}},Yp=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){k.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),k.critical(r)}}},xo=function(n){var e={};return Y(n,function(t,i){Re(t)&&t.length>0&&(e[i]=t)}),e},ko=function(n){return n.replace(/^\$/,"")};function Kp(n,e){return t=n,i=function(s){return Re(s)&&!bt(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=[],Fn(o,function(u){l.push(s(u))})):(l={},Y(o,function(u,c){r.has(u)||(l[c]=s(u,c))})),l);var l}(t);var t,i,r}var tt,Qp=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
315
315
  `).replace(/\r/g,`
316
- `)).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},mt=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(m?.event)){var f,d=!0;tt(c)&&(f=c(p));var g=u.call(l,p);return f!==!1&&g!==!1||(d=!1),d}}}(e,i,a)}else x.error("No valid element provided to register_event")}}();function Dn(n,e){var t=function(){if(!A)return e("document not found");var i=A.createElement("script");i.type="text/javascript",i.src=n,i.onload=function(o){return e(void 0,o)},i.onerror=function(o){return e(o)};var r,s=A.querySelectorAll("body > script");s.length>0?(r=s[0].parentNode)===null||r===void 0||r.insertBefore(i,s[0]):A.body.appendChild(i)};A!=null&&A.body?t():A?.addEventListener("DOMContentLoaded",t)}function Nu(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"})(Ze||(Ze={}));var Uu="$people_distinct_id",bi="__alias",wi="__timers",Kl="$autocapture_disabled_server_side",xo="$heatmaps_enabled_server_side",ko="$session_recording_enabled_server_side",Ql="$console_log_recording_enabled_server_side",Zl="$session_recording_network_payload_capture",eu="$session_recording_canvas_recording",tu="$replay_sample_rate",nu="$replay_minimum_duration",Lr="$sesid",ki="$session_is_sampled",Tn="$enabled_feature_flags",So="$early_access_features",Rn="$stored_person_properties",Ft="$stored_group_properties",Eo="$surveys",so="$surveys_activated",jr="$flag_call_reported",dt="$user_state",$o="$client_session_props",Co="$capture_rate_limit",Ao="$initial_campaign_params",Io="$initial_referrer_info",iu="$initial_person_info",qr="$epp",To="__POSTHOG_TOOLBAR__",ef=[Uu,bi,"__cmpns",wi,ko,xo,Lr,Tn,dt,So,Ft,Rn,Eo,jr,$o,Co,Ao,Io,qr],oo="$active_feature_flags",$r="$override_feature_flags",ru="$feature_flag_payloads",su=function(n){var e,t={},i=nt(Or(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Ie(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},tf=function(){function n(e){H(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return W(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Tn),t=this.instance.get_property($r);if(!t)return e||{};for(var i=Te({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(x.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ru)||{}}},{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(Rn),r=this.instance.get_property(Ft),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:Ze.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(jr)||{};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({},jr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}x.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);x.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={},oo,c),y(f,Tn,d),f))}else{var v=c,k=p;s.errorsWhileComputingFlags&&(v=C(C({},l),v),k=C(C({},u),k)),o&&o.register((y(a={},oo,Object.keys(su(v))),y(a,Tn,v||{}),y(a,ru,k||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return x.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister($r);else if(de(e)){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register(y({},$r,t))}else this.instance.persistence.register(y({},$r,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=C(C({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},oo,Object.keys(su(o))),y(r,Tn,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(So);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({},So,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(Rn)||{};this.instance.register(y({},Rn,C(C({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Rn)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Ft)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=C(C({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},Ft,C(C({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Ft)||{};this.instance.register(y({},Ft,C(C({},t),{},y({},e,{}))))}else this.instance.unregister(Ft)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return at(n)&&isFinite(n)&&Math.floor(n)===n});var ou="0123456789abcdef",nf=function(){function n(e){if(H(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return W(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+ou.charAt(this.bytes[t]>>>4)+ou.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}(),rf=function(){function n(){H(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new sf)}return W(n,[{key:"generate",value:function(){var e=this.generateOrAbort();if(M(e)){this.timestamp=0;var t=this.generateOrAbort();if(M(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 nf.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}(),Bu=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};m&&!M(m.crypto)&&crypto.getRandomValues&&(Bu=function(n){return crypto.getRandomValues(n)});var au,sf=function(){function n(){H(this,n),y(this,"buffer",new Uint32Array(8)),y(this,"cursor",1/0)}return W(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Bu(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),Lt=function(){return of().toString()},of=function(){return(au||(au=new rf)).generate()},af="Thu, 01 Jan 1970 00:00:00 GMT",vi="",lf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function uf(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:A;if(vi)return vi;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Lt(),u=new RegExp("(^|;)\\s*"+l+"=1");!vi&&a--;){var c=o.slice(a).join("."),p=l+"=1;domain=."+c;s.cookie=p,u.test(s.cookie)&&(s.cookie=p+";expires="+af,vi=c)}return vi}(n);if(!t){var i=function(r){var s=r.match(lf);return s?s[0]:""}(n);i!==t&&x.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var we,yt={is_supported:function(){return!!A},error:function(n){x.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(yt.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(A)try{var s="",o="",a=uf(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&&x.warn("cookieStore warning: large cookie, len="+u.length),A.cookie=u,u}catch{return}},remove:function(n,e){try{yt.set(n,"",-1,e)}catch{return}}},ao=null,fe={is_supported:function(){if(!_t(ao))return ao;var n=!0;if(M(m))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||x.error("localStorage unsupported; falling back to cookie store"),ao=n,n},error:function(n){x.error("localStorage error: "+n)},get:function(n){try{return m?.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{m?.localStorage.setItem(n,JSON.stringify(e))}catch(t){fe.error(t)}},remove:function(n){try{m?.localStorage.removeItem(n)}catch(e){fe.error(e)}}},cf=["distinct_id",Lr,ki,qr],Cr=C(C({},fe),{},{parse:function(n){try{var e={};try{e=yt.parse(n)||{}}catch{}var t=Te(e,JSON.parse(fe.get(n)||"{}"));return fe.set(n,t),t}catch{}return null},set:function(n,e,t,i,r){try{fe.set(n,e);var s={};cf.forEach(function(o){e[o]&&(s[o]=e[o])}),Object.keys(s).length&&yt.set(n,s,t,i,r)}catch(o){fe.error(o)}},remove:function(n,e){try{m?.localStorage.removeItem(n),yt.remove(n,e)}catch(t){fe.error(t)}}}),Ar={},pf={is_supported:function(){return!0},error:function(n){x.error("memoryStorage error: "+n)},get:function(n){return Ar[n]||null},parse:function(n){return Ar[n]||null},set:function(n,e){Ar[n]=e},remove:function(n){delete Ar[n]}},en=null,xe={is_supported:function(){if(!_t(en))return en;if(en=!0,M(m))en=!1;else try{var n="__support__";xe.set(n,"xyz"),xe.get(n)!=='"xyz"'&&(en=!1),xe.remove(n)}catch{en=!1}return en},error:function(n){x.error("sessionStorage error: ",n)},get:function(n){try{return m?.sessionStorage.getItem(n)}catch(e){xe.error(e)}return null},parse:function(n){try{return JSON.parse(xe.get(n))||null}catch{}return null},set:function(n,e){try{m?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){xe.error(t)}},remove:function(n){try{m?.sessionStorage.removeItem(n)}catch(e){xe.error(e)}}},ff=["localhost","127.0.0.1"],Fr=function(n){var e=A?.createElement("a");return M(e)?null:(e.href=n,e)},lu=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},hf=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return X(n,function(s,o){M(s)||M(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)},uu=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{x.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Nr=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Xe="Mobile",Ur="iOS",ut="Android",Ai="Tablet",zu=ut+" "+Ai,Hu="iPad",Wu="Apple",Gu=Wu+" Watch",Ii="Safari",Ln="BlackBerry",Vu="Samsung",Xu=Vu+"Browser",Ju=Vu+" Internet",jt="Chrome",df=jt+" OS",Yu=jt+" "+Ur,Uo="Internet Explorer",Ku=Uo+" "+Xe,Bo="Opera",gf=Bo+" Mini",zo="Edge",Qu="Microsoft "+zo,On="Firefox",Zu=On+" "+Ur,Ti="Nintendo",Ri="PlayStation",Fn="Xbox",ec=ut+" "+Xe,tc=Xe+" "+Ii,xi="Windows",Ro=xi+" Phone",cu="Nokia",Po="Ouya",nc="Generic",mf=nc+" "+Xe.toLowerCase(),ic=nc+" "+Ai.toLowerCase(),Oo="Konqueror",Ae="(\\d+(\\.\\d+)?)",lo=new RegExp("Version/"+Ae),vf=new RegExp(Fn,"i"),yf=new RegExp(Ri+" \\w+","i"),_f=new RegExp(Ti+" \\w+","i"),Ho=new RegExp(Ln+"|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"},wf=function(n,e){return e&&N(e,Wu)||function(t){return N(t,Ii)&&!N(t,jt)&&!N(t,ut)}(n)},pu=function(n,e){return e=e||"",N(n," OPR/")&&N(n,"Mini")?gf:N(n," OPR/")?Bo:Ho.test(n)?Ln:N(n,"IE"+Xe)||N(n,"WPDesktop")?Ku:N(n,Xu)?Ju:N(n,zo)||N(n,"Edg/")?Qu:N(n,"FBIOS")?"Facebook "+Xe:N(n,"UCWEB")||N(n,"UCBrowser")?"UC Browser":N(n,"CriOS")?Yu:N(n,"CrMo")?jt:N(n,ut)&&N(n,Ii)?ec:N(n,jt)?jt:N(n,"FxiOS")?Zu:N(n.toLowerCase(),Oo.toLowerCase())?Oo:wf(n,e)?N(n,Xe)?tc:Ii:N(n,On)?On:N(n,"MSIE")||N(n,"Trident/")?Uo:N(n,"Gecko")?On:""},xf=(y(we={},Ku,[new RegExp("rv:"+Ae)]),y(we,Qu,[new RegExp(zo+"?\\/"+Ae)]),y(we,jt,[new RegExp("("+jt+"|CrMo)\\/"+Ae)]),y(we,Yu,[new RegExp("CriOS\\/"+Ae)]),y(we,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Ae)]),y(we,Ii,[lo]),y(we,tc,[lo]),y(we,Bo,[new RegExp("(Opera|OPR)\\/"+Ae)]),y(we,On,[new RegExp(On+"\\/"+Ae)]),y(we,Zu,[new RegExp("FxiOS\\/"+Ae)]),y(we,Oo,[new RegExp("Konqueror[:/]?"+Ae,"i")]),y(we,Ln,[new RegExp(Ln+" "+Ae),lo]),y(we,ec,[new RegExp("android\\s"+Ae,"i")]),y(we,Ju,[new RegExp(Xu+"\\/"+Ae)]),y(we,Uo,[new RegExp("(rv:|MSIE )"+Ae)]),y(we,"Mozilla",[new RegExp("rv:"+Ae)]),we),fu=[[new RegExp(Fn+"; "+Fn+" (.*?)[);]","i"),function(n){return[Fn,n&&n[1]||""]}],[new RegExp(Ti,"i"),[Ti,""]],[new RegExp(Ri,"i"),[Ri,""]],[Ho,[Ln,""]],[new RegExp(xi,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ro,""];if(new RegExp(Xe).test(e)&&!/IEMobile\b/.test(e))return[xi+" "+Xe,""];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"),[xi,r]}return[xi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[Ur,e.join(".")]}return[Ur,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=M(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+ut+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ut+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[ut,e.join(".")]}return[ut,""]}],[/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/,[df,""]],[/Linux|debian/i,["Linux",""]]],hu=function(n){return _f.test(n)?Ti:yf.test(n)?Ri:vf.test(n)?Fn:new RegExp(Po,"i").test(n)?Po:new RegExp("("+Ro+"|WPDesktop)","i").test(n)?Ro:/iPad/.test(n)?Hu:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?Gu:Ho.test(n)?Ln:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(cu,"i").test(n)?cu:/(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(Xe).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)?ut:zu:ut:new RegExp("(pda|"+Xe+")","i").test(n)?mf:new RegExp(Ai,"i").test(n)&&!new RegExp(Ai+" pc","i").test(n)?ic:""},Ir="https?://(.*)",kf=["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"],_e={campaignParams:function(n){return A?this._campaignParamsFromUrl(A.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=kf.concat(e||[]),i={};return X(t,function(r){var s=uu(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Ir+"google.([^/?]*)")===0?"google":n.search(Ir+"bing.com")===0?"bing":n.search(Ir+"yahoo.com")===0?"yahoo":n.search(Ir+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=_e._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!_t(e)){i.$search_engine=e;var r=A?uu(A.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=A?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:pu,browserVersion:function(n,e){var t=pu(n,e),i=xf[t];if(M(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<fu.length;e++){var t=Ie(fu[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(tt(r)?r(s,n):r);if(o)return o}return["",""]},device:hu,deviceType:function(n){var e=hu(n);return e===Hu||e===zu||e==="Kobo"||e==="Kindle Fire"||e===ic?Ai:e===Ti||e===Fn||e===Ri||e===Po?"Console":e===Gu?"Wearable":e?Xe:"Desktop"},referrer:function(){return A?.referrer||"$direct"},referringDomain:function(){var n;return A!=null&&A.referrer&&((n=Fr(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:De?.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=Fr(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=Fr(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,X(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+wo(a)]=o})}return t&&X(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+wo(a)]=o}),r},properties:function(){if(!se)return{};var n=Ie(_e.os(se),2),e=n[0],t=n[1];return Te(bo({$os:e,$os_version:t,$browser:_e.browser(se,navigator.vendor),$device:_e.device(se),$device_type:_e.deviceType(se)}),{$current_url:De?.href,$host:De?.host,$pathname:De?.pathname,$raw_user_agent:se.length>1e3?se.substring(0,997)+"...":se,$browser_version:_e.browserVersion(se,navigator.vendor),$browser_language:_e.browserLanguage(),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:"web",$lib_version:Dt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:qu()/1e3})},people_properties:function(){if(!se)return{};var n=Ie(_e.os(se),2),e=n[0],t=n[1];return Te(bo({$os:e,$os_version:t,$browser:_e.browser(se,navigator.vendor)}),{$browser_version:_e.browserVersion(se,navigator.vendor)})}},Sf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],uo=function(){function n(e){H(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(),this.update_config(e,e),this.save()}return W(n,[{key:"buildStorage",value:function(e){Sf.indexOf(e.persistence.toLowerCase())===-1&&(x.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"&&Cr.is_supported()?Cr:t==="sessionstorage"&&xe.is_supported()?xe:t==="memory"?pf:t==="cookie"?yt:Cr.is_supported()?Cr:yt}},{key:"properties",value:function(){var e={};return X(this.props,function(t,i){if(i===Tn&&et(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=ef)?l:Vl&&o.indexOf===Vl?o.indexOf(a)!=-1:(X(o,function(u){if(l||(l=u===a))return Dr}),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=Te({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{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(et(e)){M(t)&&(t="None"),this.expire_days=M(i)?this.default_expiry:i;var s=!1;if(X(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(et(e)){this.expire_days=M(t)?this.default_expiry:t;var r=!1;if(X(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(_e.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(_e.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(_e.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[Ao]||this.props[Io]||this.register_once(y({},iu,_e.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return bo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};X([Io,Ao],function(s){var o=e.props[s];o&&X(o,function(a,l){t["$initial_"+wo(l)]=a})});var i=this.props[iu];if(i){var r=_e.initialPersonPropsFromInfo(i);Te(t,r)}return t}},{key:"safe_merge",value:function(e){return X(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[wi]||{};i[e]=t,this.props[wi]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[wi]||{})[e];return M(t)||(delete this.props[wi][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}(),Ef=2,$f=4,nn=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}(nn||{}),Ue=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}(Ue||{});function Wo(n){return n?Xr(n).split(/\s+/):[]}function Br(n){var e="";switch(Ci(n.className)){case"string":e=n.className;break;case"object":e=("baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return Wo(e)}function rc(n){return lt(n)?null:Xr(n).split(/(\s+)/).filter(function(e){return Mn(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function zr(n){var e="";return Mo(n)&&!lc(n)&&n.childNodes&&n.childNodes.length&&X(n.childNodes,function(t){var i;sc(t)&&t.textContent&&(e+=(i=rc(t.textContent))!==null&&i!==void 0?i:"")}),Xr(e)}function Go(n){return!!n&&n.nodeType===1}function qt(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function sc(n){return!!n&&n.nodeType===3}function oc(n){return!!n&&n.nodeType===11}var Fo=["a","button","form","input","select","textarea","label"];function ac(n){var e=n.parentNode;return!(!e||!Go(e))&&e}function Cf(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(!m||!n||qt(n,"html")||!Go(n))return!1;if(t!=null&&t.url_allowlist){var s=m.location.href,o=t.url_allowlist;if(o&&!o.some(function(v){return s.match(v)}))return!1}if(t!=null&&t.dom_event_allowlist){var a=t.dom_event_allowlist;if(a&&!a.some(function(v){return e.type===v}))return!1}for(var l=!1,u=[n],c=!0,p=n;p.parentNode&&!qt(p,"body");)if(oc(p.parentNode))u.push(p.parentNode.host),p=p.parentNode.host;else{if(!(c=ac(p)))break;if(i||Fo.indexOf(c.tagName.toLowerCase())>-1)l=!0;else{var f=m.getComputedStyle(c);f&&f.getPropertyValue("cursor")==="pointer"&&(l=!0)}u.push(c),p=c}if(!function(v,k){var L=k?.element_allowlist;if(M(L))return!0;var E,F=nt(v);try{var U=function(){var Q=E.value;if(L.some(function(K){return Q.tagName.toLowerCase()===K}))return{v:!0}};for(F.s();!(E=F.n()).done;){var G=U();if(Ci(G)==="object")return G.v}}catch(Q){F.e(Q)}finally{F.f()}return!1}(u,t)||!function(v,k){var L=k?.css_selector_allowlist;if(M(L))return!0;var E,F=nt(v);try{var U=function(){var Q=E.value;if(L.some(function(K){return Q.matches(K)}))return{v:!0}};for(F.s();!(E=F.n()).done;){var G=U();if(Ci(G)==="object")return G.v}}catch(Q){F.e(Q)}finally{F.f()}return!1}(u,t))return!1;var d=m.getComputedStyle(n);if(d&&d.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=n.tagName.toLowerCase();switch(g){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 l?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Fo.indexOf(g)>-1||n.getAttribute("contenteditable")==="true")}}function Mo(n){for(var e=n;e.parentNode&&!qt(e,"body");e=e.parentNode){var t=Br(e);if(N(t,"ph-sensitive")||N(t,"ph-no-capture"))return!1}if(N(Br(n),"ph-include"))return!0;var i=n.type||"";if(Re(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Re(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 lc(n){return!!(qt(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||qt(n,"select")||qt(n,"textarea")||n.getAttribute("contenteditable")==="true")}var uc="(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})",Af=new RegExp("^(?:".concat(uc,")$")),If=new RegExp(uc),cc="\\d{3}-?\\d{2}-?\\d{4}",Tf=new RegExp("^(".concat(cc,")$")),Rf=new RegExp("(".concat(cc,")"));function Mn(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(lt(n)||Re(n)&&(n=Xr(n),(e?Af:If).test((n||"").replace(/[- ]/g,""))||(e?Tf:Rf).test(n)))}function du(n){var e=zr(n);return Mn(e="".concat(e," ").concat(pc(n)).trim())?e:""}function pc(n){var e="";return n&&n.childNodes&&n.childNodes.length&&X(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=zr(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(pc(t)).trim())}catch(s){x.error(s)}}),e}function Pf(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=nt(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=C(C(C(C({},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 Or(c).sort(function(f,d){var g=Ie(f,1)[0],v=Ie(d,1)[0];return g.localeCompare(v)}).forEach(function(f){var d=Ie(f,2),g=d[0],v=d[1];return p[gu(g.toString())]=gu(v.toString())}),o+=":",o+=Or(c).map(function(f){var d=Ie(f,2),g=d[0],v=d[1];return"".concat(g,'="').concat(v,'"')}).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:Of(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Or(t).filter(function(o){return Ie(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Ie(o,2),l=a[0],u=a[1];return s.attributes[l]=u}),s})}(n))}function gu(n){return n.replace(/"|\\"/g,'\\"')}function Of(n){var e=n.attr__class;return e?de(e)?e:Wo(e):void 0}var Do="[SessionRecording]",Lo="redacted",co={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},Ff=["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"],Mf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Df=["/s/","/e/","/i/"];function mu(n,e,t,i){if(lt(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Re(r)&&(r=parseInt(r)),r>t?Do+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function vu(n,e){if(lt(n))return n;var t=n;return Mn(t,!1)||(t=Do+" "+e+" body "+Lo),X(Mf,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=Do+" "+e+" body "+Lo+" as might contain: "+i)}),t}var Lf=function(n,e){var t,i,r,s={payloadSizeLimitBytes:co.payloadSizeLimitBytes,performanceEntryTypeToObserve:rn(co.performanceEntryTypeToObserve)},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(v){var k=Fr(v.name);if(!(k&&k.pathname&&Df.some(function(L){return k.pathname.indexOf(L)===0})))return v}((g=(d=f).requestHeaders,lt(g)||X(Object.keys(g??{}),function(v){Ff.includes(v.toLowerCase())&&(g[v]=Lo)}),d)));var d,g},p=tt(n.session_recording.maskNetworkRequestFn);return p&&tt(n.session_recording.maskCapturedNetworkRequestFn)&&x.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 C(C({},f),{},{name:d?.url})}),s.maskRequestFn=tt(n.session_recording.maskCapturedNetworkRequestFn)?function(f){var d,g,v,k=c(f);return k&&(d=(g=(v=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(v,k))!==null&&d!==void 0?d:void 0}:function(f){return function(d){if(!M(d))return d.requestBody=vu(d.requestBody,"Request"),d.responseBody=vu(d.responseBody,"Response"),d}(c(f))},C(C(C({},co),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},jf=W(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};H(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=Ie(r.getNodeOrRelevantParent(c.id),2),v=g[0],k=g[1];return r.mutationBuckets[v]===0?!1:(r.mutationBuckets[v]=(p=r.mutationBuckets[v])!==null&&p!==void 0?p:r.bucketSize,r.mutationBuckets[v]=Math.max(r.mutationBuckets[v]-1,0),r.mutationBuckets[v]===0&&(r.loggedTracker[v]||(r.loggedTracker[v]=!0,(f=(d=r.options).onBlockedNode)===null||f===void 0||f.call(d,v,k))),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)}),fc=3e5,yu=fc,qf=[Ue.MouseMove,Ue.MouseInteraction,Ue.Scroll,Ue.ViewportResize,Ue.Input,Ue.TouchMove,Ue.MediaInteraction,Ue.Drag],Nf=[Ue.StyleSheetRule,Ue.StyleDeclaration,Ue.AdoptedStyleSheet,Ue.Font],Uf=[nn.Custom,nn.Meta,nn.FullSnapshot],_u=function(){function n(e,t){H(this,n),this.size=0,this.data=[],this.sessionId=e,this.windowId=t}return W(n,[{key:"mostRecentSnapshotTimestamp",get:function(){return this.data.length?this.data[this.data.length-1].timestamp:null}},{key:"add",value:function(e){this.size+=e.$snapshot_bytes,this.data.push(e.$snapshot_data)}}]),n}(),bu=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Ve="[SessionRecording]";function Bf(n){return JSON.stringify(n,(e=[],function(t,i){if(et(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 gt,zf=function(){function n(e){var t=this;if(H(this,n),y(this,"queuedRRWebEvents",[]),y(this,"isIdle",!1),y(this,"_linkedFlagSeen",!1),y(this,"_lastActivityTimestamp",Date.now()),y(this,"_linkedFlag",null),y(this,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,m?.addEventListener("beforeunload",function(){t._flushBuffer()}),m?.addEventListener("offline",function(){t._tryAddCustomEvent("browser offline",{})}),m?.addEventListener("online",function(){t._tryAddCustomEvent("browser online",{})}),m?.addEventListener("visibilitychange",function(){if(A!=null&&A.visibilityState){var o="window "+A.visibilityState;t._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw x.error(Ve+" started without valid sessionManager"),new Error(Ve+" 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=new _u(this.sessionId,this.windowId),this._setupSampling()}return W(n,[{key:"rrwebRecord",get:function(){var e;return he==null||(e=he.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(Ve+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){var e=this.instance.get_property(ki);return Pr(e)?e:null}},{key:"sessionDuration",get:function(){var e=this.buffer.mostRecentSnapshotTimestamp,t=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return e?e-t:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(ko),t=!this.instance.config.disable_session_recording;return m&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Ql),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(eu);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(Zl),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=this.instance.config.capture_performance||i?.capturePerformance;return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(tu);return at(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(nu);return at(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?lt(this._linkedFlag)||this._linkedFlagSeen?Pr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),x.info(Ve+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,x.info(Ve+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(at(r)){var s,o=this.isSampled,a=i||!Pr(o);a?s=Math.random()<r:s=o,!s&&a&&x.warn(Ve+" 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({},ki,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},ki,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(),!lt(this._linkedFlag)){var o=Re(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Re(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,u){var c=et(u)&&o in u,p=a?u[o]===a:c;if(p){var f={linkedFlag:o,linkedVariant:a},d="linked flag matched";x.info(Ve+" "+d,f),s._tryAddCustomEvent(d,f)}s._linkedFlagSeen=p})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;at(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=lt(f)?null:parseFloat(f),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(p={},ko,!!e.sessionRecording),y(p,Ql,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(p,Zl,C({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(p,eu,{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,tu,d),y(p,nu,M(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:qu()})}},{key:"_startCapture",value:function(){var e=this;M(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():Dn(this.instance.requestRouter.endpointFor("assets","/static/recorder.js?v=".concat(Dt.LIB_VERSION)),function(t){if(t)return x.error(Ve+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&qf.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>yu&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:yu}),clearTimeout(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||[Ef,$f].indexOf(e.type)===-1&&(l||a||M(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}):x.warn(Ve+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(bu(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(bu(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:{},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=Ie(o[s],2),l=a[0],u=a[1];l in i&&(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 jf(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");x.info(d,{node:f}),t.log(Ve+" "+d,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(C({emit:function(p){t.onRRwebEmit(p)},plugins:c},i)),this.instance._addCaptureHook(function(p){try{if(p==="$pageview"){var f=m?t._maskUrl(m.location.href):"";if(!f)return;t._tryAddCustomEvent("$pageview",{href:f}),t._tryTakeFullSnapshot()}}catch(d){x.error("Could not add $pageview to rrweb session",d)}}),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 x.error(Ve+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},fc)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return he.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(he.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&tt(he.getRecordNetworkPlugin)&&(!ff.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(he.getRecordNetworkPlugin(Lf(this.instance.config,this.networkPayloadCapture))):x.info(Ve+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&et(e)){if(e.type===nn.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===nn.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&et(l)&&l.type===6&&et(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=Bf(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||function(a){var l=a.type===nn.IncrementalSnapshot&&!lt(a.data.source)&&Nf.includes(a.data.source);return Uf.includes(a.type)||l}(r)){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&&m){var e=this._maskUrl(m.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=rn(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:i.enqueuedAt,attempt:i.attempt,queueLength:t.length}):e._tryRRWebMethod(i)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:i.enqueuedAt,attempt:i.attempt,queueLength:t.length})})}}},{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(){this.buffer=new _u(this.sessionId,this.windowId)}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=at(i)&&i>=0,s=at(t)&&r&&i<t;this.status==="buffering"||s?this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.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.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&this._flushBuffer(),this.buffer.add(e),this.flushBufferTimer||(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",_noHeatmaps:!0})}}]),n}(),Hf=function(){function n(e){H(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return W(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(Rn),group_properties:this.instance.get_property(Ft),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:Ze.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)x.error("Failed to fetch feature flags from PostHog.");else{if(!A||!A.body)return x.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);this.instance._afterDecideResponse(e);var r=m?.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&M(r)&&Dn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),function(l){if(l)return x.error("Could not load exception autocapture script",l);m.extendPostHogWithExceptionAutocapture(t.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var s,o=nt(e.siteApps);try{var a=function(){var l=s.value,u=l.id,c=l.url,p=t.instance.requestRouter.endpointFor("api",c);he["__$$ph_site_app_".concat(u)]=t.instance,Dn(p,function(f){f&&x.error("Error while initializing PostHog app with config id ".concat(u),f)})};for(o.s();!(s=o.n()).done;)a()}catch(l){o.e(l)}finally{o.f()}}else e.siteApps.length>0&&x.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),Wf=m!=null&&m.location?Nr(m.location.hash,"__posthog")||Nr(location.hash,"state"):null,wu="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(gt||(gt={}));var Gf=function(){function n(e){H(this,n),this.instance=e}return W(n,[{key:"setToolbarState",value:function(e){he.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=he.ph_toolbar_state)!==null&&e!==void 0?e:gt.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(!m||!A)return!1;i=(e=i)!==null&&e!==void 0?e:m.location,s=(t=s)!==null&&t!==void 0?t:m.history;try{if(!r){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}r=m?.localStorage}var o,a=Wf||Nr(i.hash,"__posthog")||Nr(i.hash,"state"),l=a?Yl(function(){return JSON.parse(atob(decodeURIComponent(a)))})||Yl(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(wu)||"{}")).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){(he.ph_load_toolbar||he.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(A==null||!A.getElementById(To));if(!m||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=C(C({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(m.localStorage.setItem(wu,JSON.stringify(C(C({},s),{},{source:void 0}))),this.getToolbarState()===gt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===gt.UNINITIALIZED){this.setToolbarState(gt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;Dn(this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(a)),function(l){if(l)return x.error("Failed to load toolbar",l),void t.setToolbarState(gt.UNINITIALIZED);t.setToolbarState(gt.LOADED),t._callLoadToolbar(s)}),mt(m,"turbolinks:load",function(){t.setToolbarState(gt.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}(),Vf=function(){function n(e){H(this,n),y(this,"isPaused",!0),y(this,"queue",[]),y(this,"flushTimeoutMs",3e3),this.sendRequest=e}return W(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(rn(i.filter(function(r){return r.url.indexOf("/e")===0})),rn(i.filter(function(r){return r.url.indexOf("/e")!==0}))).map(function(r){e.sendRequest(C(C({},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)&&X(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 X(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;M(e[s])&&(e[s]=C(C({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),Be=Uint8Array,Pe=Uint16Array,jn=Uint32Array,Vo=new Be([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]),Xo=new Be([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]),xu=new Be([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hc=function(n,e){for(var t=new Pe(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new jn(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]},dc=hc(Vo,2),Xf=dc[0],jo=dc[1];Xf[28]=258,jo[258]=28;for(qo=hc(Xo,0)[1],Hr=new Pe(32768),Y=0;Y<32768;++Y)Ot=(43690&Y)>>>1|(21845&Y)<<1,Ot=(61680&(Ot=(52428&Ot)>>>2|(13107&Ot)<<2))>>>4|(3855&Ot)<<4,Hr[Y]=((65280&Ot)>>>8|(255&Ot)<<8)>>>1;var Ot,qo,Hr,Y,Si=function(n,e,t){for(var i=n.length,r=0,s=new Pe(e);r<i;++r)++s[n[r]-1];var o,a=new Pe(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new Pe(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[Hr[p]>>>l]=u}else for(o=new Pe(i),r=0;r<i;++r)o[r]=Hr[a[n[r]-1]++]>>>15-n[r];return o},sn=new Be(288);for(Y=0;Y<144;++Y)sn[Y]=8;for(Y=144;Y<256;++Y)sn[Y]=9;for(Y=256;Y<280;++Y)sn[Y]=7;for(Y=280;Y<288;++Y)sn[Y]=8;var Wr=new Be(32);for(Y=0;Y<32;++Y)Wr[Y]=5;var Jf=Si(sn,9,0),Yf=Si(Wr,5,0),gc=function(n){return(n/8>>0)+(7&n&&1)},mc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof Pe?Pe:n instanceof jn?jn:Be)(t-e);return i.set(n.subarray(e,t)),i},ht=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},po=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 Be(0),0];if(r==1){var o=new Be(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(G,Q){return G.f-Q.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 Pe(f+1),g=Kf(t[c-1],d,0);if(g>e){i=0;var v=0,k=g-e,L=1<<k;for(s.sort(function(G,Q){return d[Q.s]-d[G.s]||G.f-Q.f});i<r;++i){var E=s[i].s;if(!(d[E]>e))break;v+=L-(1<<g-d[E]),d[E]=e}for(v>>>=k;v>0;){var F=s[i].s;d[F]<e?v-=1<<e-d[F]++-1:++i}for(;i>=0&&v;--i){var U=s[i].s;d[U]==e&&(--d[U],++v)}g=e}return[new Be(d),g]},Kf=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},ku=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new Pe(++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},Mr=function(n,e,t){var i=t.length,r=gc(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)},Su=function(n,e,t,i,r,s,o,a,l,u,c){ht(e,c++,t),++r[256];for(var p=po(r,15),f=p[0],d=p[1],g=po(s,15),v=g[0],k=g[1],L=ku(f),E=L[0],F=L[1],U=ku(v),G=U[0],Q=U[1],K=new Pe(19),I=0;I<E.length;++I)K[31&E[I]]++;for(I=0;I<G.length;++I)K[31&G[I]]++;for(var oe=po(K,7),ee=oe[0],ct=oe[1],me=19;me>4&&!ee[xu[me-1]];--me);var ze,V,Z,ae,Fe=u+5<<3,je=_i(r,sn)+_i(s,Wr)+o,ie=_i(r,f)+_i(s,v)+o+14+3*me+_i(K,ee)+(2*K[16]+3*K[17]+7*K[18]);if(Fe<=je&&Fe<=ie)return Mr(e,c,n.subarray(l,l+u));if(ht(e,c,1+(ie<je)),c+=2,ie<je){ze=Si(f,d,0),V=f,Z=Si(v,k,0),ae=v;var ke=Si(ee,ct,0);for(ht(e,c,F-257),ht(e,c+5,Q-1),ht(e,c+10,me-4),c+=14,I=0;I<me;++I)ht(e,c+3*I,ee[xu[I]]);c+=3*me;for(var Se=[E,G],te=0;te<2;++te){var ve=Se[te];for(I=0;I<ve.length;++I){var Ce=31&ve[I];ht(e,c,ke[Ce]),c+=ee[Ce],Ce>15&&(ht(e,c,ve[I]>>>5&127),c+=ve[I]>>>12)}}}else ze=Jf,V=sn,Z=Yf,ae=Wr;for(I=0;I<a;++I)if(i[I]>255){Ce=i[I]>>>18&31,yi(e,c,ze[Ce+257]),c+=V[Ce+257],Ce>7&&(ht(e,c,i[I]>>>23&31),c+=Vo[Ce]);var an=31&i[I];yi(e,c,Z[an]),c+=ae[an],an>3&&(yi(e,c,i[I]>>>5&8191),c+=Xo[an])}else yi(e,c,ze[i[I]]),c+=V[i[I]];return yi(e,c,ze[256]),c+V[256]},Qf=new jn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zf=new Be(0),eh=function(){for(var n=new jn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),th=function(n,e,t,i,r){return function(s,o,a,l,u,c){var p=s.length,f=new Be(l+p+5*(1+Math.floor(p/7e3))+u),d=f.subarray(l,f.length-u),g=0;if(!o||p<8)for(var v=0;v<=p;v+=65535){var k=v+65535;k<p?g=Mr(d,g,s.subarray(v,k)):(d[v]=c,g=Mr(d,g,s.subarray(v,p)))}else{for(var L=Qf[o-1],E=L>>>13,F=8191&L,U=(1<<a)-1,G=new Pe(32768),Q=new Pe(U+1),K=Math.ceil(a/3),I=2*K,oe=function(ls){return(s[ls]^s[ls+1]<<K^s[ls+2]<<I)&U},ee=new jn(25e3),ct=new Pe(288),me=new Pe(32),ze=0,V=0,Z=(v=0,0),ae=0,Fe=0;v<p;++v){var je=oe(v),ie=32767&v,ke=Q[je];if(G[ie]=ke,Q[je]=ie,ae<=v){var Se=p-v;if((ze>7e3||Z>24576)&&Se>423){g=Su(s,d,0,ee,ct,me,V,Z,Fe,v-Fe,g),Z=ze=V=0,Fe=v;for(var te=0;te<286;++te)ct[te]=0;for(te=0;te<30;++te)me[te]=0}var ve=2,Ce=0,an=F,bt=ie-ke&32767;if(Se>2&&je==oe(v-bt))for(var Rc=Math.min(E,Se)-1,Pc=Math.min(32767,v),Oc=Math.min(258,Se);bt<=Pc&&--an&&ie!=ke;){if(s[v+ve]==s[v+ve-bt]){for(var wt=0;wt<Oc&&s[v+wt]==s[v+wt-bt];++wt);if(wt>ve){if(ve=wt,Ce=bt,wt>Rc)break;var Fc=Math.min(bt,wt-2),Ko=0;for(te=0;te<Fc;++te){var as=v-bt+te+32768&32767,Qo=as-G[as]+32768&32767;Qo>Ko&&(Ko=Qo,ke=as)}}}bt+=(ie=ke)-(ke=G[ie])+32768&32767}if(Ce){ee[Z++]=268435456|jo[ve]<<18|qo[Ce];var Zo=31&jo[ve],ea=31&qo[Ce];V+=Vo[Zo]+Xo[ea],++ct[257+Zo],++me[ea],ae=v+ve,++ze}else ee[Z++]=s[v],++ct[s[v]]}}g=Su(s,d,c,ee,ct,me,V,Z,Fe,v-Fe,g),c||(g=Mr(d,g,Zf))}return mc(f,0,l+gc(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)},fo=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function nh(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=eh[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),i=n.length;t.p(n);var r,s=th(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&&fo(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),fo(s,o-8,t.d()),fo(s,o-4,i),s}var ih=!!_o||!!yo,Eu="text/plain",Gr=function(n,e){var t=Ie(n.split("?"),2),i=t[0],r=t[1],s=C({},e);r?.split("&").forEach(function(a){var l=Ie(a.split("="),1)[0];delete s[l]});var o=hf(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},rh=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},ho=function(n){var e=n.data,t=n.compression;if(e){if(t===Ze.GZipJS){var i=nh(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new Be(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 Be(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 mc(l,0,u)}(JSON.stringify(e)),{mtime:0});return{contentType:Eu,body:new Blob([i],{type:Eu})}}if(t===Ze.Base64){var r=function(s){var o,a,l,u,c,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,d=0,g="",v=[];if(!s)return s;s=Zp(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,v[d++]=p.charAt(o)+p.charAt(a)+p.charAt(l)+p.charAt(u);while(f<s.length);switch(g=v.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:rh(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Ei=[];_o&&Ei.push({transport:"XHR",method:function(n){var e,t=new _o;t.open(n.method||"GET",n.url,!0);var i=(e=ho(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;X(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)}}),yo&&Ei.push({transport:"fetch",method:function(n){var e,t,i=(e=ho(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;X(o,function(c,p){o.append(p,c)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(Xl){var u=new Xl;l={signal:u.signal,timeout:setTimeout(function(){return u.abort()},n.timeout)}}yo(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){x.error(g)}(f=n.callback)===null||f===void 0||f.call(n,d)})}).catch(function(c){var p;x.error(c),(p=n.callback)===null||p===void 0||p.call(n,{statusCode:0,text:c})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),vt!=null&&vt.sendBeacon&&Ei.push({transport:"sendBeacon",method:function(n){var e=Gr(n.url,{beacon:"1"});try{var t,i=(t=ho(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;vt.sendBeacon(e,o)}catch{}}});var sh=["retriesPerformedSoFar"],tn,oh=function(){function n(e){var t=this;H(this,n),y(this,"isPolling",!1),y(this,"pollIntervalMs",3e3),y(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!M(m)&&"onLine"in m.navigator&&(this.areWeOnline=m.navigator.onLine,m.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),m.addEventListener("offline",function(){t.areWeOnline=!1}))}return W(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=Xp(e,sh);at(i)&&i>0&&(r.url=Gr(r.url,{retry_count:i})),this.instance._send_request(C(C({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(C({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)"),x.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=nt(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=nt(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(C(C({},i),{},{transport:"sendBeacon"}))}catch(r){x.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),Tr=1800,ah=function(){function n(e,t,i,r){H(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||Lt,this._windowIdGenerator=r||Lt;var s=e.persistence_name||e.token,o=e.session_idle_timeout_seconds||Tr;if(at(o)?o>Tr?x.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):o<60&&x.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(x.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),o=Tr),this._sessionTimeoutMs=1e3*Math.min(Math.max(o,60),Tr),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var a=xe.parse(this._window_id_storage_key),l=xe.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:xe.remove(this._window_id_storage_key),xe.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return W(n,[{key:"onSessionId",value:function(e){var t=this;return M(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&&xe.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&xe.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?xe.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({},Lr,[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[Lr];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;m?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&xe.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=Ie(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(),x.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"})(tn||(tn={}));var $u="i.posthog.com",lh=function(){function n(e){H(this,n),y(this,"_regionCache",{}),this.instance=e}return W(n,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return 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]=tn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=tn.EU:this._regionCache[this.apiHost]=tn.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||this.apiHost.replace(".".concat($u),".posthog.com"))+t;if(this.region===tn.CUSTOM)return this.apiHost+t;var i=$u+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}}]),n}(),vc="posthog-js";function yc(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)||[],v={$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,$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&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.capture("$exception",v),a}}var uh=W(function n(e,t,i,r,s){H(this,n),this.name=vc,this.setupOnce=function(o){o(yc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function ch(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()||Lt()};i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(dt,"identified")),r()},a=s.user();"then"in a&&tt(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||x.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()||i.reset(),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(i.register({distinct_id:s.event.userId}),i.reloadFeatureFlags());var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{});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 ph=function(){function n(e){H(this,n),this._instance=e}return W(n,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=(e=m?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var i=t.maxScrollHeight,r=t.lastScrollY,s=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,l=t.maxContentY;return M(i)||M(r)||M(s)||M(o)||M(a)||M(l)?{}:(i=Math.ceil(i),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:i<=1?1:Rr(r/i,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:i<=1?1:Rr(s/i,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Rr(a/o,0,1),$prev_pageview_max_content:l,$prev_pageview_max_content_percentage:o<=1?1:Rr(l/o,0,1)})}}]),n}();function Rr(n,e,t){return Math.max(e,Math.min(n,t))}var Cu=function(){function n(e){H(this,n),this.persistence=e,this.eventRegistry=new Map}return W(n,[{key:"register",value:function(e){var t=this;e.forEach(function(i){var r,s,o,a,l;(r=i.conditions)!==null&&r!==void 0&&r.events&&(s=i.conditions)!==null&&s!==void 0&&(o=s.events)!==null&&o!==void 0&&o.values&&((a=i.conditions)===null||a===void 0?void 0:a.events.values.length)>0&&t.eventRegistry.set(i.id,(l=i.conditions)===null||l===void 0?void 0:l.events.values.map(function(u){return u.name}))})}},{key:"on",value:function(e){var t,i=[];this.eventRegistry.forEach(function(o,a){o.includes(e)&&i.push(a)});var r=(t=this.persistence)===null||t===void 0?void 0:t.props[so],s=(r||[]).concat(i);this._saveSurveysToStorage(s)}},{key:"getSurveys",value:function(){var e,t=(e=this.persistence)===null||e===void 0?void 0:e.props[so];return t||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.register(y({},so,rn(new Set(e))))}}]),n}(),fh={icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!m&&lu(m.location.href,n)},not_regex:function(n){return!!m&&!lu(m.location.href,n)},exact:function(n){return m?.location.href===n},is_not:function(n){return m?.location.href!==n}},hh=function(){function n(e){H(this,n),this.instance=e,this._surveyEventReceiver=null}return W(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=he?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Cu(this.instance.persistence)),Dn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),function(i){if(i)return x.error("Could not load surveys script",i);he.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 Cu(this.instance.persistence));var r=this.instance.get_property(Eo);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=s.json.surveys||[],l=a.filter(function(c){var p,f,d,g,v,k;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||(v=g.events)===null||v===void 0||(k=v.values)===null||k===void 0?void 0:k.length)>0});if(l.length>0&&!M(t.instance._addCaptureHook)){var u;(u=t._surveyEventReceiver)===null||u===void 0||u.register(l),t.instance._addCaptureHook(function(c){var p;(p=t._surveyEventReceiver)===null||p===void 0||p.on(c)})}return(o=t.instance.persistence)===null||o===void 0||o.register(y({},Eo,a)),e(a)}})}},{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||fh[(p=(f=u.conditions)===null||f===void 0?void 0:f.urlMatchType)!==null&&p!==void 0?p:"icontains"](u.conditions.url),v=(d=u.conditions)===null||d===void 0||!d.selector||A?.querySelector(u.conditions.selector);return g&&v}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(u){var c,p,f,d,g;if(!u.linked_flag_key&&!u.targeting_flag_key&&!u.internal_targeting_flag_key)return!0;var v=!u.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(u.linked_flag_key),k=!u.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.targeting_flag_key),L=!u.internal_targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.internal_targeting_flag_key),E=!(!((c=u.conditions)===null||c===void 0)&&c.events&&(!((p=u.conditions)===null||p===void 0||(f=p.events)===null||f===void 0)&&f.values)&&((d=u.conditions)===null||d===void 0||(g=d.events)===null||g===void 0?void 0:g.values.length)>0)||a?.includes(u.id);return v&&k&&L&&E});return e(l)},i)}}]),n}(),dh=function(){function n(e){var t,i,r=this;H(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){x.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void x.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 W(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(Co))!==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(Co,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}(),gh=function(){return C({initialPathName:De?.pathname||"",referringDomain:_e.referringDomain()},_e.campaignParams())},mh=function(){function n(e,t,i){var r=this;H(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({},$o,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||gh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return W(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[$o]}},{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}(),vh=["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","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Au=function(n,e){if(!n)return!1;var t=n.toLowerCase();return vh.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},_c=function(){function n(){H(this,n),this.clicks=[]}return W(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 Iu(n){var e;return n.id===To||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+To))}var yh=function(){function n(e){var t;H(this,n),y(this,"rageclicks",new _c),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[xo])}return W(n,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(x.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return M(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},xo,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;m&&A&&(mt(A,"click",function(t){return e._onClick(t||m?.event)},!1,!0),mt(A,"mousemove",function(t){return e._onMouseMove(t||m?.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&&!qt(c,"body");){if(c===u)return!1;if(N(l,m?.getComputedStyle(c).position))return!0;c=ac(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(!Iu(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(C(C({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;Iu(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(m){var t=m.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),n}(),_h=function(){function n(e){var t=this;H(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 W(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(){m?.addEventListener("scroll",this._updateScrollData,!0),m?.addEventListener("scrollend",this._updateScrollData,!0),m?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return m?.document.documentElement;var e,t=nt(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=m?.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 m&&(m.scrollY||m.pageYOffset||m.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 m&&(m.scrollX||m.pageXOffset||m.document.documentElement.scrollLeft)||0}}]),n}(),bh=function(){function n(){H(this,n),y(this,"events",{}),this.events={}}return W(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=nt(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=nt(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),go="$copy_autocapture";function mo(n,e){return e.length>n?e.slice(0,n)+"...":e}var Mt,wh=function(){function n(e){H(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new _c),y(this,"_elementsChainAsString",!1),this.instance=e}return W(n,[{key:"config",get:function(){var e,t=et(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(e=t.url_allowlist)===null||e===void 0?void 0:e.map(function(i){return new RegExp(i)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(m&&A){var t=function(r){r=r||m?.event;try{e._captureEvent(r)}catch(s){x.error("Failed to capture event",s)}},i=function(r){r=r||m?.event,e._captureEvent(r,go)};mt(A,"submit",t,!1,!0),mt(A,"change",t,!1,!0),mt(A,"click",t,!1,!0),this.config.capture_copied_text&&(mt(A,"copy",i,!1,!0),mt(A,"cut",i,!1,!0))}}else x.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({},Kl,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Kl],r=this._isDisabledServerSide;if(_t(r)&&!Pr(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&&!Go(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Mo(e))return{};var t={};return X(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&&Mn(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Fo.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=mo(1024,du(e)):o.$el_text=mo(1024,zr(e)));var a=Br(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;X(e.attributes,function(f){var d;if((!lc(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(l==null||!l.includes(f.name))&&!t&&Mn(f.value)&&(d=f.name,!Re(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=Wo(g).join(" ")),o["attr__"+f.name]=mo(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 M(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===go;if(s&&Cf(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,u=[s],c=s;c.parentNode&&!qt(c,"body");)oc(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var p,f=[],d={},g=!1;if(X(u,function(F){var U=Mo(F);F.tagName.toLowerCase()==="a"&&(p=F.getAttribute("href"),p=U&&Mn(p)&&p),N(Br(F),"ph-no-capture")&&(g=!0),f.push(t._getPropertiesFromElement(F,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var G=t._getAugmentPropertiesFromElement(F);Te(d,G)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?f[0].$el_text=du(s):f[0].$el_text=zr(s)),p&&(f[0].attr__href=p),g)return!1;var v=Te(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:Pf(f)}:{$elements:f},(a=f[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=f[0])===null||l===void 0?void 0:l.$el_text}:{},d);if(i===go){var k,L=rc(m==null||(k=m.getSelection())===null||k===void 0?void 0:k.toString()),E=e.type||"clipboard";if(!L)return!1;v.$selected_content=L,v.$copy_type=E}return this.instance.capture(i,v),!0}}}},{key:"isBrowserSupported",value:function(){return tt(A?.querySelectorAll)}}]),n}(),xh=function(){function n(e){var t=this;H(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){M(t._restoreXHRPatch)&&he.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),M(t._restoreFetchPatch)&&he.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return W(n,[{key:"_loadScript",value:function(e){he.postHogTracingHeadersPatchFns&&e(),Dn(this.instance.requestRouter.endpointFor("assets","/static/tracing-headers.js?v=".concat(Dt.LIB_VERSION)),function(t){t&&x.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"})(Mt||(Mt={}));var kh=function(){function n(e){H(this,n),this.instance=e}return W(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Mt.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Mt.DENIED||this.consent===Mt.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"?Mt.GRANTED:e==="0"?Mt.DENIED:Mt.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?fe:yt;var t=e==="localStorage"?yt: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&&!!Nu([vt?.doNotTrack,vt?.msDoNotTrack,he.doNotTrack],function(e){return N([!0,1,"1","yes"],e)})}}]),n}(),$i={},Tu=function(){},In="posthog",bc=!ih&&se?.indexOf("MSIE")===-1&&se?.indexOf("Mozilla")===-1,Ru=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,!!Re(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Tu,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:De&&Re(De?.search)&&De.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(m==null||(n=m.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;x.error(r)},get_device_id:function(i){return i},_onCapture:Tu,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},Pu=function(n){var e={};M(n.process_person)||(e.person_profiles=n.process_person),M(n.xhr_headers)||(e.request_headers=n.xhr_headers),M(n.cookie_name)||(e.persistence_name=n.cookie_name),M(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Te({},e,n);return de(n.property_blacklist)&&(M(n.property_denylist)?t.property_denylist=n.property_blacklist:de(n.property_denylist)?t.property_denylist=[].concat(rn(n.property_blacklist),rn(n.property_denylist)):x.error("Invalid value for property_denylist config: "+n.property_denylist)),t},Sh=function(){function n(){H(this,n),y(this,"__forceAllowLocalhost",!1)}return W(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){x.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),wc=function(){function n(){var e=this;H(this,n),y(this,"webPerformance",new Sh),y(this,"_debugEventEmitter",new bh),this.config=Ru(),this.decideEndpointWasHit=!1,this.SentryIntegration=uh,this.sentryIntegration=function(t){return function(i,r){var s=yc(i,r);return{name:vc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new tf(this),this.toolbar=new Gf(this),this.scrollManager=new _h(this),this.pageViewManager=new ph(this),this.surveys=new hh(this),this.rateLimiter=new dh(this),this.requestRouter=new lh(this),this.consent=new kh(this),this.people={set:function(t,i,r){var s=Re(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Re(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return x.info("send",t)})}return W(n,[{key:"init",value:function(e,t,i){if(i&&i!==In){var r,s=(r=$i[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),$i[i]=s,$i[In][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(M(e)||function(k){return Re(k)&&k.trim().length===0}(e))return x.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 x.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Te({},Ru(),Pu(s),{name:o,token:e})),this.compression=s.disable_compression?void 0:Ze.Base64,this.persistence=new uo(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new uo(C(C({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new Vf(function(k){return r._send_retriable_request(k)}),this._retryQueue=new oh(this),this.__request_queue=[],this.sessionManager=new ah(this.config,this.persistence),this.sessionPropsManager=new mh(this.sessionManager,this.persistence),new xh(this).startIfEnabledOrStop(),this.sessionRecording=new zf(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new wh(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new yh(this),this.heatmaps.startIfEnabled(),Dt.DEBUG=Dt.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,l,u=this.config.get_device_id(Lt()),c=(a=s.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?u:s.bootstrap.distinctID;this.persistence.set_property(dt,(l=s.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var p,f,d=Object.keys(((p=s.bootstrap)===null||p===void 0?void 0:p.featureFlags)||{}).filter(function(k){var L,E;return!((L=s.bootstrap)===null||L===void 0||(E=L.featureFlags)===null||E===void 0||!E[k])}).reduce(function(k,L){var E,F;return k[L]=((E=s.bootstrap)===null||E===void 0||(F=E.featureFlags)===null||F===void 0?void 0:F[L])||!1,k},{}),g=Object.keys(((f=s.bootstrap)===null||f===void 0?void 0:f.featureFlagPayloads)||{}).filter(function(k){return d[k]}).reduce(function(k,L){var E,F,U,G;return(E=s.bootstrap)!==null&&E!==void 0&&(F=E.featureFlagPayloads)!==null&&F!==void 0&&F[L]&&(k[L]=(U=s.bootstrap)===null||U===void 0||(G=U.featureFlagPayloads)===null||G===void 0?void 0:G[L]),k},{});this.featureFlags.receivedFeatureFlags({featureFlags:d,featureFlagPayloads:g})}if(!this.get_distinct_id()){var v=this.config.get_device_id(Lt());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(dt,"anonymous")}return m==null||(i=m.addEventListener)===null||i===void 0||i.call(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?ch(this,function(){return r._loaded()}):this._loaded(),tt(this.config._onCapture)&&this.on("eventCaptured",function(k){return r.config._onCapture(k.event,k)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=N(e.supportedCompression,Ze.GZipJS)?Ze.GZipJS:N(e.supportedCompression,Ze.Base64)?Ze.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)}},{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){x.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){A&&e.capture("$pageview",{title:A.title},{send_instantly:!0})},1),t||(new Hf(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()||Pn(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&&(bc?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Gr(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=C({},i);a.timeout=a.timeout||6e4,a.url=Gr(a.url,{_:new Date().getTime().toString(),ver:Dt.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",u=(s=(o=Nu(Ei,function(c){return c.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Ei[0].method;if(!u)throw new Error("No available transport method");u(a)}(C(C({},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=[];Pn(e,function(l){l&&(t=l[0],de(t)?o.push(l):tt(l)?l.call(i):de(l)&&t==="alias"?r.push(l):de(l)&&t.indexOf("capture")!==-1&&tt(i[t])?o.push(l):s.push(l))});var a=function(l,u){Pn(l,function(c){if(de(c[0])){var p=u;X(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))return x.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!M(e)&&Re(e)){if(!se||this.config.opt_out_useragent_filter||!Au(se,this.config.custom_blocked_useragents)){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={uuid:Lt(),event:e,properties:this._calculate_event_properties(e,t||{},i)};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(o.$set=i?.$set);var a=this._calculate_set_once_properties(i?.$set_once);a&&(o.$set_once=a),(o=Qp(o,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i?.timestamp||new Date,M(i?.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var l=C(C({},o.properties.$set),o.$set);ro(l)||this.setPersonPropertiesForFlags(l),this._debugEventEmitter.emit("eventCaptured",o);var u={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,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(u):this._requestQueue.enqueue(u),o}x.critical("This capture call is ignored due to client rate limiting.")}}else x.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=C({},t);if(s.token=this.config.token,e==="$snapshot"){var o=C(C({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,s}var a=_e.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===tn.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=Te(s,p)}if(!this.config.disable_scroll_properties){var f={};e==="$pageview"?f=this.pageViewManager.doPageView():e==="$pageleave"&&(f=this.pageViewManager.doPageLeave()),s=Te(s,f)}if(e==="$pageview"&&A&&(s.title=A.title),!M(r)){var d=new Date().getTime()-r;s.$duration=parseFloat((d/1e3).toFixed(3))}if(se&&this.config.opt_out_useragent_filter&&(s.$browser_type=Au(se,this.config.custom_blocked_useragents)?"bot":"browser"),(s=Te({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),i==null||!i._noHeatmaps){var g,v=(g=this.heatmaps)===null||g===void 0?void 0:g.getAndClearBuffer();v&&(s.$heatmap_data=v)}de(this.config.property_denylist)?X(this.config.property_denylist,function(L){delete s[L]}):x.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;return k&&(s=k(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=Te({},this.persistence.get_initial_props(),e||{});return ro(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._debugEventEmitter.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:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return x.uninitializedWarning("posthog.identify");if(at(e)&&(e=e.toString(),x.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()))x.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(bi)&&(this.unregister(bi),this.register({distinct_id:e}));var o=(this.persistence.get_property(dt)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(dt,"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(jr))}}else x.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:C(C({},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 x.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(!this.__loaded)return x.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(dt,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(Lt());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(Uu)?(x.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(M(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(bi,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(x.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=C({},this.config);et(e)&&(Te(this.config,Pu(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new uo(C(C({},this.config),{},{persistence:"sessionStorage"})),fe.is_supported()&&fe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Dt.DEBUG=!0),(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){if(e!=null&&e.sampling){var t,i,r=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId();(i=this.persistence)===null||i===void 0||i.register(y({},ki,!0)),x.info("Session recording started with sampling override for session: ",r?.sessionId)}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:"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:In;return t!==In&&(t=In+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(dt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(dt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ro(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[bi])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[qr]))}},{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"?(x.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(qr,!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(),this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0})}},{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:"debug",value:function(e){e===!1?(m?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(m?.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]]=Kp(n.prototype[e[t]])})(wc,["identify"]);var Ou,Fu;(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(Ou||(Ou={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(Fu||(Fu={}));var Mu,xc=(Mu=$i[In]=new wc,function(){function n(){n.done||(n.done=!0,bc=!1,X($i,function(e){e._dom_loaded()}))}A!=null&&A.addEventListener&&(A.readyState==="complete"?n():A.addEventListener("DOMContentLoaded",n,!1)),m&&mt(m,"load",n,!0)}(),Mu);var kc=xc.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 ue(n,e){if(!kc)throw new Error("Failed to initialize PostHog");kc.capture(n,e)}var Yr,Oi,Kr,Nt,Ec,Jr,Qr=class Qr extends z(j){constructor(){super();b(this,Nt);b(this,Yr,new Pt(this,{onError:console.error}));b(this,Oi);b(this,Kr,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>ue("ShopAssistant: user clicked link",t),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return h(this,Oi)||h(this,Yr).data}render(){return this.config?O`
316
+ `)).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),bt(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},mt=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(m?.event)){var f,h=!0;it(c)&&(f=c(p));var g=u.call(l,p);return f!==!1&&g!==!1||(h=!1),h}}}(e,i,a)}else k.error("No valid element provided to register_event")}}();function jn(n,e){var t=function(){if(!T)return e("document not found");var i=T.createElement("script");i.type="text/javascript",i.src=n,i.onload=function(o){return e(void 0,o)},i.onerror=function(o){return e(o)};var r,s=T.querySelectorAll("body > script");s.length>0?(r=s[0].parentNode)===null||r===void 0||r.insertBefore(i,s[0]):T.body.appendChild(i)};T!=null&&T.body?t():T?.addEventListener("DOMContentLoaded",t)}function qu(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"})(tt||(tt={}));var Uu="$people_distinct_id",xi="__alias",ki="__timers",Zl="$autocapture_disabled_server_side",So="$heatmaps_enabled_server_side",Eo="$session_recording_enabled_server_side",eu="$console_log_recording_enabled_server_side",tu="$session_recording_network_payload_capture",nu="$session_recording_canvas_recording",iu="$replay_sample_rate",ru="$replay_minimum_duration",jr="$sesid",Ei="$session_is_sampled",Pn="$enabled_feature_flags",$o="$early_access_features",On="$stored_person_properties",Dt="$stored_group_properties",Co="$surveys",ao="$surveys_activated",Nr="$flag_call_reported",gt="$user_state",Ao="$client_session_props",Io="$capture_rate_limit",To="$initial_campaign_params",Ro="$initial_referrer_info",su="$initial_person_info",qr="$epp",Po="__POSTHOG_TOOLBAR__",Zp=[Uu,xi,"__cmpns",ki,Eo,So,jr,Pn,gt,$o,Dt,On,Co,Nr,Ao,Io,To,Ro,qr],lo="$active_feature_flags",Ar="$override_feature_flags",ou="$feature_flag_payloads",au=function(n){var e,t={},i=rt(Mr(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Ie(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},ef=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(Pn),t=this.instance.get_property(Ar);if(!t)return e||{};for(var i=Te({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(k.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ou)||{}}},{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(On),r=this.instance.get_property(Dt),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:tt.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(Nr)||{};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({},Nr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}k.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);k.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,h={};if(c)for(var g=0;g<c.length;g++)h[c[g]]=!0;o&&o.register((y(f={},lo,c),y(f,Pn,h),f))}else{var v=c,w=p;s.errorsWhileComputingFlags&&(v=I(I({},l),v),w=I(I({},u),w)),o&&o.register((y(a={},lo,Object.keys(au(v))),y(a,Pn,v||{}),y(a,ou,w||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return k.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Ar);else if(de(e)){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register(y({},Ar,t))}else this.instance.persistence.register(y({},Ar,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=I(I({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},lo,Object.keys(au(o))),y(r,Pn,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($o);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({},$o,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(On)||{};this.instance.register(y({},On,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(On)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Dt)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=I(I({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},Dt,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Dt)||{};this.instance.register(y({},Dt,I(I({},t),{},y({},e,{}))))}else this.instance.unregister(Dt)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return lt(n)&&isFinite(n)&&Math.floor(n)===n});var lu="0123456789abcdef",tf=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+lu.charAt(this.bytes[t]>>>4)+lu.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}(),nf=function(){function n(){W(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new rf)}return V(n,[{key:"generate",value:function(){var e=this.generateOrAbort();if(F(e)){this.timestamp=0;var t=this.generateOrAbort();if(F(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{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 tf.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}(),Bu=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};m&&!F(m.crypto)&&crypto.getRandomValues&&(Bu=function(n){return crypto.getRandomValues(n)});var uu,rf=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&&(Bu(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),Nt=function(){return sf().toString()},sf=function(){return(uu||(uu=new nf)).generate()},of="Thu, 01 Jan 1970 00:00:00 GMT",_i="",af=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function lf(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T;if(_i)return _i;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Nt(),u=new RegExp("(^|;)\\s*"+l+"=1");!_i&&a--;){var c=o.slice(a).join("."),p=l+"=1;domain=."+c;s.cookie=p,u.test(s.cookie)&&(s.cookie=p+";expires="+of,_i=c)}return _i}(n);if(!t){var i=function(r){var s=r.match(af);return s?s[0]:""}(n);i!==t&&k.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){k.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=lf(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&&k.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}}},uo=null,fe={is_supported:function(){if(!bt(uo))return uo;var n=!0;if(F(m))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||k.error("localStorage unsupported; falling back to cookie store"),uo=n,n},error:function(n){k.error("localStorage error: "+n)},get:function(n){try{return m?.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{m?.localStorage.setItem(n,JSON.stringify(e))}catch(t){fe.error(t)}},remove:function(n){try{m?.localStorage.removeItem(n)}catch(e){fe.error(e)}}},uf=["distinct_id",jr,Ei,qr],Ir=I(I({},fe),{},{parse:function(n){try{var e={};try{e=_t.parse(n)||{}}catch{}var t=Te(e,JSON.parse(fe.get(n)||"{}"));return fe.set(n,t),t}catch{}return null},set:function(n,e,t,i,r){try{fe.set(n,e);var s={};uf.forEach(function(o){e[o]&&(s[o]=e[o])}),Object.keys(s).length&&_t.set(n,s,t,i,r)}catch(o){fe.error(o)}},remove:function(n,e){try{m?.localStorage.removeItem(n),_t.remove(n,e)}catch(t){fe.error(t)}}}),Tr={},cf={is_supported:function(){return!0},error:function(n){k.error("memoryStorage error: "+n)},get:function(n){return Tr[n]||null},parse:function(n){return Tr[n]||null},set:function(n,e){Tr[n]=e},remove:function(n){delete Tr[n]}},nn=null,ke={is_supported:function(){if(!bt(nn))return nn;if(nn=!0,F(m))nn=!1;else try{var n="__support__";ke.set(n,"xyz"),ke.get(n)!=='"xyz"'&&(nn=!1),ke.remove(n)}catch{nn=!1}return nn},error:function(n){k.error("sessionStorage error: ",n)},get:function(n){try{return m?.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{m?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){ke.error(t)}},remove:function(n){try{m?.sessionStorage.removeItem(n)}catch(e){ke.error(e)}}},pf=["localhost","127.0.0.1"],$i=function(n){var e=T?.createElement("a");return F(e)?null:(e.href=n,e)},cu=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},ff=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Y(n,function(s,o){F(s)||F(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)},pu=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{k.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ur=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Je="Mobile",Br="iOS",ct="Android",Ri="Tablet",zu=ct+" "+Ri,Hu="iPad",Wu="Apple",Vu=Wu+" Watch",Pi="Safari",Nn="BlackBerry",Gu="Samsung",Xu=Gu+"Browser",Ju=Gu+" Internet",qt="Chrome",hf=qt+" OS",Yu=qt+" "+Br,zo="Internet Explorer",Ku=zo+" "+Je,Ho="Opera",df=Ho+" Mini",Wo="Edge",Qu="Microsoft "+Wo,Mn="Firefox",Zu=Mn+" "+Br,Oi="Nintendo",Fi="PlayStation",Dn="Xbox",ec=ct+" "+Je,tc=Je+" "+Pi,Si="Windows",Oo=Si+" Phone",fu="Nokia",Fo="Ouya",nc="Generic",gf=nc+" "+Je.toLowerCase(),ic=nc+" "+Ri.toLowerCase(),Mo="Konqueror",Ae="(\\d+(\\.\\d+)?)",co=new RegExp("Version/"+Ae),vf=new RegExp(Dn,"i"),mf=new RegExp(Fi+" \\w+","i"),yf=new RegExp(Oi+" \\w+","i"),Vo=new RegExp(Nn+"|PlayBook|BB10","i"),_f={"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"},bf=function(n,e){return e&&U(e,Wu)||function(t){return U(t,Pi)&&!U(t,qt)&&!U(t,ct)}(n)},hu=function(n,e){return e=e||"",U(n," OPR/")&&U(n,"Mini")?df:U(n," OPR/")?Ho:Vo.test(n)?Nn:U(n,"IE"+Je)||U(n,"WPDesktop")?Ku:U(n,Xu)?Ju:U(n,Wo)||U(n,"Edg/")?Qu:U(n,"FBIOS")?"Facebook "+Je:U(n,"UCWEB")||U(n,"UCBrowser")?"UC Browser":U(n,"CriOS")?Yu:U(n,"CrMo")?qt:U(n,ct)&&U(n,Pi)?ec:U(n,qt)?qt:U(n,"FxiOS")?Zu:U(n.toLowerCase(),Mo.toLowerCase())?Mo:bf(n,e)?U(n,Je)?tc:Pi:U(n,Mn)?Mn:U(n,"MSIE")||U(n,"Trident/")?zo:U(n,"Gecko")?Mn:""},wf=(y(xe={},Ku,[new RegExp("rv:"+Ae)]),y(xe,Qu,[new RegExp(Wo+"?\\/"+Ae)]),y(xe,qt,[new RegExp("("+qt+"|CrMo)\\/"+Ae)]),y(xe,Yu,[new RegExp("CriOS\\/"+Ae)]),y(xe,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Ae)]),y(xe,Pi,[co]),y(xe,tc,[co]),y(xe,Ho,[new RegExp("(Opera|OPR)\\/"+Ae)]),y(xe,Mn,[new RegExp(Mn+"\\/"+Ae)]),y(xe,Zu,[new RegExp("FxiOS\\/"+Ae)]),y(xe,Mo,[new RegExp("Konqueror[:/]?"+Ae,"i")]),y(xe,Nn,[new RegExp(Nn+" "+Ae),co]),y(xe,ec,[new RegExp("android\\s"+Ae,"i")]),y(xe,Ju,[new RegExp(Xu+"\\/"+Ae)]),y(xe,zo,[new RegExp("(rv:|MSIE )"+Ae)]),y(xe,"Mozilla",[new RegExp("rv:"+Ae)]),xe),du=[[new RegExp(Dn+"; "+Dn+" (.*?)[);]","i"),function(n){return[Dn,n&&n[1]||""]}],[new RegExp(Oi,"i"),[Oi,""]],[new RegExp(Fi,"i"),[Fi,""]],[Vo,[Nn,""]],[new RegExp(Si,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Oo,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return[Si+" "+Je,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=_f[i]||"";return/arm/i.test(e)&&(r="RT"),[Si,r]}return[Si,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[Br,e.join(".")]}return[Br,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=F(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+ct+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ct+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[ct,e.join(".")]}return[ct,""]}],[/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/,[hf,""]],[/Linux|debian/i,["Linux",""]]],gu=function(n){return yf.test(n)?Oi:mf.test(n)?Fi:vf.test(n)?Dn:new RegExp(Fo,"i").test(n)?Fo:new RegExp("("+Oo+"|WPDesktop)","i").test(n)?Oo:/iPad/.test(n)?Hu:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?Vu:Vo.test(n)?Nn:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(fu,"i").test(n)?fu:/(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(Je).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)?ct:zu:ct:new RegExp("(pda|"+Je+")","i").test(n)?gf:new RegExp(Ri,"i").test(n)&&!new RegExp(Ri+" pc","i").test(n)?ic:""},Rr="https?://(.*)",xf=["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"],be={campaignParams:function(n){return T?this._campaignParamsFromUrl(T.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=xf.concat(e||[]),i={};return Y(t,function(r){var s=pu(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Rr+"google.([^/?]*)")===0?"google":n.search(Rr+"bing.com")===0?"bing":n.search(Rr+"yahoo.com")===0?"yahoo":n.search(Rr+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=be._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!bt(e)){i.$search_engine=e;var r=T?pu(T.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=T?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:hu,browserVersion:function(n,e){var t=hu(n,e),i=wf[t];if(F(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<du.length;e++){var t=Ie(du[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(it(r)?r(s,n):r);if(o)return o}return["",""]},device:gu,deviceType:function(n){var e=gu(n);return e===Hu||e===zu||e==="Kobo"||e==="Kindle Fire"||e===ic?Ri:e===Oi||e===Dn||e===Fi||e===Fo?"Console":e===Vu?"Wearable":e?Je:"Desktop"},referrer:function(){return T?.referrer||"$direct"},referringDomain:function(){var n;return T!=null&&T.referrer&&((n=$i(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:De?.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=$i(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=$i(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,Y(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+ko(a)]=o})}return t&&Y(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+ko(a)]=o}),r},properties:function(){if(!ae)return{};var n=Ie(be.os(ae),2),e=n[0],t=n[1];return Te(xo({$os:e,$os_version:t,$browser:be.browser(ae,navigator.vendor),$device:be.device(ae),$device_type:be.deviceType(ae)}),{$current_url:De?.href,$host:De?.host,$pathname:De?.pathname,$raw_user_agent:ae.length>1e3?ae.substring(0,997)+"...":ae,$browser_version:be.browserVersion(ae,navigator.vendor),$browser_language:be.browserLanguage(),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:"web",$lib_version:jt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Nu()/1e3})},people_properties:function(){if(!ae)return{};var n=Ie(be.os(ae),2),e=n[0],t=n[1];return Te(xo({$os:e,$os_version:t,$browser:be.browser(ae,navigator.vendor)}),{$browser_version:be.browserVersion(ae,navigator.vendor)})}},kf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],po=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(),this.update_config(e,e),this.save()}return V(n,[{key:"buildStorage",value:function(e){kf.indexOf(e.persistence.toLowerCase())===-1&&(k.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"&&Ir.is_supported()?Ir:t==="sessionstorage"&&ke.is_supported()?ke:t==="memory"?cf:t==="cookie"?_t:Ir.is_supported()?Ir:_t}},{key:"properties",value:function(){var e={};return Y(this.props,function(t,i){if(i===Pn&&nt(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,(bt(o=Zp)?l:Jl&&o.indexOf===Jl?o.indexOf(a)!=-1:(Y(o,function(u){if(l||(l=u===a))return Lr}),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=Te({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{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(nt(e)){F(t)&&(t="None"),this.expire_days=F(i)?this.default_expiry:i;var s=!1;if(Y(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(nt(e)){this.expire_days=F(t)?this.default_expiry:t;var r=!1;if(Y(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(be.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[To]||this.props[Ro]||this.register_once(y({},su,be.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return xo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Y([Ro,To],function(s){var o=e.props[s];o&&Y(o,function(a,l){t["$initial_"+ko(l)]=a})});var i=this.props[su];if(i){var r=be.initialPersonPropsFromInfo(i);Te(t,r)}return t}},{key:"safe_merge",value:function(e){return Y(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[ki]||{};i[e]=t,this.props[ki]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ki]||{})[e];return F(t)||(delete this.props[ki][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}(),Sf=2,Ef=4,sn=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}(sn||{}),Ue=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}(Ue||{});function Go(n){return n?Yr(n).split(/\s+/):[]}function zr(n){var e="";switch(Ti(n.className)){case"string":e=n.className;break;case"object":e=("baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return Go(e)}function rc(n){return ut(n)?null:Yr(n).split(/(\s+)/).filter(function(e){return Ln(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Hr(n){var e="";return Lo(n)&&!lc(n)&&n.childNodes&&n.childNodes.length&&Y(n.childNodes,function(t){var i;sc(t)&&t.textContent&&(e+=(i=rc(t.textContent))!==null&&i!==void 0?i:"")}),Yr(e)}function Xo(n){return!!n&&n.nodeType===1}function Ut(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function sc(n){return!!n&&n.nodeType===3}function oc(n){return!!n&&n.nodeType===11}var Do=["a","button","form","input","select","textarea","label"];function ac(n){var e=n.parentNode;return!(!e||!Xo(e))&&e}function $f(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(!m||!n||Ut(n,"html")||!Xo(n))return!1;if(t!=null&&t.url_allowlist){var s=m.location.href,o=t.url_allowlist;if(o&&!o.some(function(v){return s.match(v)}))return!1}if(t!=null&&t.dom_event_allowlist){var a=t.dom_event_allowlist;if(a&&!a.some(function(v){return e.type===v}))return!1}for(var l=!1,u=[n],c=!0,p=n;p.parentNode&&!Ut(p,"body");)if(oc(p.parentNode))u.push(p.parentNode.host),p=p.parentNode.host;else{if(!(c=ac(p)))break;if(i||Do.indexOf(c.tagName.toLowerCase())>-1)l=!0;else{var f=m.getComputedStyle(c);f&&f.getPropertyValue("cursor")==="pointer"&&(l=!0)}u.push(c),p=c}if(!function(v,w){var D=w?.element_allowlist;if(F(D))return!0;var $,M=rt(v);try{var q=function(){var X=$.value;if(D.some(function(J){return X.tagName.toLowerCase()===J}))return{v:!0}};for(M.s();!($=M.n()).done;){var H=q();if(Ti(H)==="object")return H.v}}catch(X){M.e(X)}finally{M.f()}return!1}(u,t)||!function(v,w){var D=w?.css_selector_allowlist;if(F(D))return!0;var $,M=rt(v);try{var q=function(){var X=$.value;if(D.some(function(J){return X.matches(J)}))return{v:!0}};for(M.s();!($=M.n()).done;){var H=q();if(Ti(H)==="object")return H.v}}catch(X){M.e(X)}finally{M.f()}return!1}(u,t))return!1;var h=m.getComputedStyle(n);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=n.tagName.toLowerCase();switch(g){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 l?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Do.indexOf(g)>-1||n.getAttribute("contenteditable")==="true")}}function Lo(n){for(var e=n;e.parentNode&&!Ut(e,"body");e=e.parentNode){var t=zr(e);if(U(t,"ph-sensitive")||U(t,"ph-no-capture"))return!1}if(U(zr(n),"ph-include"))return!0;var i=n.type||"";if(Re(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Re(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 lc(n){return!!(Ut(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||Ut(n,"select")||Ut(n,"textarea")||n.getAttribute("contenteditable")==="true")}var uc="(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})",Cf=new RegExp("^(?:".concat(uc,")$")),Af=new RegExp(uc),cc="\\d{3}-?\\d{2}-?\\d{4}",If=new RegExp("^(".concat(cc,")$")),Tf=new RegExp("(".concat(cc,")"));function Ln(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(ut(n)||Re(n)&&(n=Yr(n),(e?Cf:Af).test((n||"").replace(/[- ]/g,""))||(e?If:Tf).test(n)))}function vu(n){var e=Hr(n);return Ln(e="".concat(e," ").concat(pc(n)).trim())?e:""}function pc(n){var e="";return n&&n.childNodes&&n.childNodes.length&&Y(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=Hr(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(pc(t)).trim())}catch(s){k.error(s)}}),e}function Rf(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=rt(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=I(I(I(I({},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 Mr(c).sort(function(f,h){var g=Ie(f,1)[0],v=Ie(h,1)[0];return g.localeCompare(v)}).forEach(function(f){var h=Ie(f,2),g=h[0],v=h[1];return p[mu(g.toString())]=mu(v.toString())}),o+=":",o+=Mr(c).map(function(f){var h=Ie(f,2),g=h[0],v=h[1];return"".concat(g,'="').concat(v,'"')}).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:Pf(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Mr(t).filter(function(o){return Ie(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Ie(o,2),l=a[0],u=a[1];return s.attributes[l]=u}),s})}(n))}function mu(n){return n.replace(/"|\\"/g,'\\"')}function Pf(n){var e=n.attr__class;return e?de(e)?e:Go(e):void 0}var jo="[SessionRecording]",No="redacted",fo={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},Of=["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"],Ff=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Mf=["/s/","/e/","/i/"];function yu(n,e,t,i){if(ut(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Re(r)&&(r=parseInt(r)),r>t?jo+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function _u(n,e){if(ut(n))return n;var t=n;return Ln(t,!1)||(t=jo+" "+e+" body "+No),Y(Ff,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=jo+" "+e+" body "+No+" as might contain: "+i)}),t}var Df=function(n,e){var t,i,r,s={payloadSizeLimitBytes:fo.payloadSizeLimitBytes,performanceEntryTypeToObserve:on(fo.performanceEntryTypeToObserve)},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=yu(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=yu(f.responseBody,f.responseHeaders,r,"Response")),f}),c=function(f){return u(function(v){var w=$i(v.name);if(!(w&&w.pathname&&Mf.some(function(D){return w.pathname.indexOf(D)===0})))return v}((g=(h=f).requestHeaders,ut(g)||Y(Object.keys(g??{}),function(v){Of.includes(v.toLowerCase())&&(g[v]=No)}),h)));var h,g},p=it(n.session_recording.maskNetworkRequestFn);return p&&it(n.session_recording.maskCapturedNetworkRequestFn)&&k.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(n.session_recording.maskCapturedNetworkRequestFn=function(f){var h=n.session_recording.maskNetworkRequestFn({url:f.name});return I(I({},f),{},{name:h?.url})}),s.maskRequestFn=it(n.session_recording.maskCapturedNetworkRequestFn)?function(f){var h,g,v,w=c(f);return w&&(h=(g=(v=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(v,w))!==null&&h!==void 0?h:void 0}:function(f){return function(h){if(!F(h))return h.requestBody=_u(h.requestBody,"Request"),h.responseBody=_u(h.responseBody,"Response"),h}(c(f))},I(I(I({},fo),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Lf=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,h,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)+((h=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&h!==void 0?h: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,h,g=Ie(r.getNodeOrRelevantParent(c.id),2),v=g[0],w=g[1];return r.mutationBuckets[v]===0?!1:(r.mutationBuckets[v]=(p=r.mutationBuckets[v])!==null&&p!==void 0?p:r.bucketSize,r.mutationBuckets[v]=Math.max(r.mutationBuckets[v]-1,0),r.mutationBuckets[v]===0&&(r.loggedTracker[v]||(r.loggedTracker[v]=!0,(f=(h=r.options).onBlockedNode)===null||f===void 0||f.call(h,v,w))),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)}),jf=3e5,Nf=[Ue.MouseMove,Ue.MouseInteraction,Ue.Scroll,Ue.ViewportResize,Ue.Input,Ue.TouchMove,Ue.MediaInteraction,Ue.Drag],qf=[Ue.StyleSheetRule,Ue.StyleDeclaration,Ue.AdoptedStyleSheet,Ue.Font],Uf=[sn.Custom,sn.Meta,sn.FullSnapshot],bu=function(){function n(e,t){W(this,n),this.size=0,this.data=[],this.sessionId=e,this.windowId=t}return V(n,[{key:"mostRecentSnapshotTimestamp",get:function(){return this.data.length?this.data[this.data.length-1].timestamp:null}},{key:"add",value:function(e){this.size+=e.$snapshot_bytes,this.data.push(e.$snapshot_data)}}]),n}(),wu=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Xe="[SessionRecording]";function Bf(n){return JSON.stringify(n,(e=[],function(t,i){if(nt(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 vt,zf=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,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,m?.addEventListener("beforeunload",function(){t._flushBuffer()}),m?.addEventListener("offline",function(){t._tryAddCustomEvent("browser offline",{})}),m?.addEventListener("online",function(){t._tryAddCustomEvent("browser online",{})}),m?.addEventListener("visibilitychange",function(){if(T!=null&&T.visibilityState){var o="window "+T.visibilityState;t._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw k.error(Xe+" started without valid sessionManager"),new Error(Xe+" 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=new bu(this.sessionId,this.windowId),this._setupSampling()}return V(n,[{key:"rrwebRecord",get:function(){var e;return he==null||(e=he.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(Xe+" started without valid sessionManager. This is a bug.");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)||jf}},{key:"isSampled",get:function(){var e=this.instance.get_property(Ei);return Fr(e)?e:null}},{key:"sessionDuration",get:function(){var e=this.buffer.mostRecentSnapshotTimestamp,t=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return e?e-t:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Eo),t=!this.instance.config.disable_session_recording;return m&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(eu),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(nu);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(tu),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=this.instance.config.capture_performance||i?.capturePerformance;return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(iu);return lt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(ru);return lt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?ut(this._linkedFlag)||this._linkedFlagSeen?Fr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),k.info(Xe+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,k.info(Xe+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(lt(r)){var s,o=this.isSampled,a=i||!Fr(o);a?s=Math.random()<r:s=o,!s&&a&&k.warn(Xe+" 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({},Ei,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},Ei,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(),!ut(this._linkedFlag)){var o=Re(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Re(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,u){var c=nt(u)&&o in u,p=a?u[o]===a:c;if(p){var f={linkedFlag:o,linkedVariant:a},h="linked flag matched";k.info(Xe+" "+h,f),s._tryAddCustomEvent(h,f)}s._linkedFlagSeen=p})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;lt(this.sampleRate)&&bt(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,h=ut(f)?null:parseFloat(f),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(p={},Eo,!!e.sessionRecording),y(p,eu,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(p,tu,I({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(p,nu,{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,iu,h),y(p,ru,F(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:Nu()})}},{key:"_startCapture",value:function(){var e=this;F(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():jn(this.instance.requestRouter.endpointFor("assets","/static/recorder.js?v=".concat(jt.LIB_VERSION)),function(t){if(t)return k.error(Xe+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&Nf.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,clearTimeout(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||[Sf,Ef].indexOf(e.type)===-1&&(l||a||F(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}):k.warn(Xe+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(wu(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(wu(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:{},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=Ie(o[s],2),l=a[0],u=a[1];l in i&&(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 Lf(this.rrwebRecord,{onBlockedNode:function(p,f){var h="Too many mutations on node '".concat(p,"'. Rate limiting. This could be due to SVG animations or something similar");k.info(h,{node:f}),t.log(Xe+" "+h,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(I({emit:function(p){t.onRRwebEmit(p)},plugins:c},i)),this.instance._addCaptureHook(function(p){try{if(p==="$pageview"){var f=m?t._maskUrl(m.location.href):"";if(!f)return;t._tryAddCustomEvent("$pageview",{href:f}),t._tryTakeFullSnapshot()}}catch(h){k.error("Could not add $pageview to rrweb session",h)}}),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 k.error(Xe+"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 he.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(he.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&it(he.getRecordNetworkPlugin)&&(!pf.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(he.getRecordNetworkPlugin(Df(this.instance.config,this.networkPayloadCapture))):k.info(Xe+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&nt(e)){if(e.type===sn.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===sn.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&nt(l)&&l.type===6&&nt(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=Bf(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||function(a){var l=a.type===sn.IncrementalSnapshot&&!ut(a.data.source)&&qf.includes(a.data.source);return Uf.includes(a.type)||l}(r)){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&&m){var e=this._maskUrl(m.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=on(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(){this.buffer=new bu(this.sessionId,this.windowId)}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=lt(i)&&i>=0,s=lt(t)&&r&&i<t;this.status==="buffering"||s?this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.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.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&this._flushBuffer(),this.buffer.add(e),this.flushBufferTimer||(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",_noHeatmaps:!0})}}]),n}(),Hf=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(On),group_properties:this.instance.get_property(Dt),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:tt.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)k.error("Failed to fetch feature flags from PostHog.");else{if(!T||!T.body)return k.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);this.instance._afterDecideResponse(e);var r=m?.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&F(r)&&jn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),function(l){if(l)return k.error("Could not load exception autocapture script",l);m.extendPostHogWithExceptionAutocapture(t.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var s,o=rt(e.siteApps);try{var a=function(){var l=s.value,u=l.id,c=l.url,p=t.instance.requestRouter.endpointFor("api",c);he["__$$ph_site_app_".concat(u)]=t.instance,jn(p,function(f){f&&k.error("Error while initializing PostHog app with config id ".concat(u),f)})};for(o.s();!(s=o.n()).done;)a()}catch(l){o.e(l)}finally{o.f()}}else e.siteApps.length>0&&k.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),Wf=m!=null&&m.location?Ur(m.location.hash,"__posthog")||Ur(location.hash,"state"):null,xu="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(vt||(vt={}));var Vf=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"setToolbarState",value:function(e){he.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=he.ph_toolbar_state)!==null&&e!==void 0?e:vt.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(!m||!T)return!1;i=(e=i)!==null&&e!==void 0?e:m.location,s=(t=s)!==null&&t!==void 0?t:m.history;try{if(!r){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}r=m?.localStorage}var o,a=Wf||Ur(i.hash,"__posthog")||Ur(i.hash,"state"),l=a?Ql(function(){return JSON.parse(atob(decodeURIComponent(a)))})||Ql(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(xu)||"{}")).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){(he.ph_load_toolbar||he.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(T==null||!T.getElementById(Po));if(!m||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=I(I({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(m.localStorage.setItem(xu,JSON.stringify(I(I({},s),{},{source:void 0}))),this.getToolbarState()===vt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===vt.UNINITIALIZED){this.setToolbarState(vt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;jn(this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(a)),function(l){if(l)return k.error("Failed to load toolbar",l),void t.setToolbarState(vt.UNINITIALIZED);t.setToolbarState(vt.LOADED),t._callLoadToolbar(s)}),mt(m,"turbolinks:load",function(){t.setToolbarState(vt.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}(),Gf=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(on(i.filter(function(r){return r.url.indexOf("/e")===0})),on(i.filter(function(r){return r.url.indexOf("/e")!==0}))).map(function(r){e.sendRequest(I(I({},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)&&Y(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 Y(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;F(e[s])&&(e[s]=I(I({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),Be=Uint8Array,Pe=Uint16Array,qn=Uint32Array,Jo=new Be([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]),Yo=new Be([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]),ku=new Be([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fc=function(n,e){for(var t=new Pe(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new qn(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]},hc=fc(Jo,2),Xf=hc[0],qo=hc[1];Xf[28]=258,qo[258]=28;for(Uo=fc(Yo,0)[1],Wr=new Pe(32768),Q=0;Q<32768;++Q)Mt=(43690&Q)>>>1|(21845&Q)<<1,Mt=(61680&(Mt=(52428&Mt)>>>2|(13107&Mt)<<2))>>>4|(3855&Mt)<<4,Wr[Q]=((65280&Mt)>>>8|(255&Mt)<<8)>>>1;var Mt,Uo,Wr,Q,Ci=function(n,e,t){for(var i=n.length,r=0,s=new Pe(e);r<i;++r)++s[n[r]-1];var o,a=new Pe(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new Pe(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[Wr[p]>>>l]=u}else for(o=new Pe(i),r=0;r<i;++r)o[r]=Wr[a[n[r]-1]++]>>>15-n[r];return o},an=new Be(288);for(Q=0;Q<144;++Q)an[Q]=8;for(Q=144;Q<256;++Q)an[Q]=9;for(Q=256;Q<280;++Q)an[Q]=7;for(Q=280;Q<288;++Q)an[Q]=8;var Vr=new Be(32);for(Q=0;Q<32;++Q)Vr[Q]=5;var Jf=Ci(an,9,0),Yf=Ci(Vr,5,0),dc=function(n){return(n/8>>0)+(7&n&&1)},gc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof Pe?Pe:n instanceof qn?qn:Be)(t-e);return i.set(n.subarray(e,t)),i},dt=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},bi=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},ho=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 Be(0),0];if(r==1){var o=new Be(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(H,X){return H.f-X.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 h=new Pe(f+1),g=Kf(t[c-1],h,0);if(g>e){i=0;var v=0,w=g-e,D=1<<w;for(s.sort(function(H,X){return h[X.s]-h[H.s]||H.f-X.f});i<r;++i){var $=s[i].s;if(!(h[$]>e))break;v+=D-(1<<g-h[$]),h[$]=e}for(v>>>=w;v>0;){var M=s[i].s;h[M]<e?v-=1<<e-h[M]++-1:++i}for(;i>=0&&v;--i){var q=s[i].s;h[q]==e&&(--h[q],++v)}g=e}return[new Be(h),g]},Kf=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},Su=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new Pe(++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]},wi=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},Dr=function(n,e,t){var i=t.length,r=dc(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)},Eu=function(n,e,t,i,r,s,o,a,l,u,c){dt(e,c++,t),++r[256];for(var p=ho(r,15),f=p[0],h=p[1],g=ho(s,15),v=g[0],w=g[1],D=Su(f),$=D[0],M=D[1],q=Su(v),H=q[0],X=q[1],J=new Pe(19),E=0;E<$.length;++E)J[31&$[E]]++;for(E=0;E<H.length;++E)J[31&H[E]]++;for(var ie=ho(J,7),Z=ie[0],pt=ie[1],ve=19;ve>4&&!Z[ku[ve-1]];--ve);var ze,G,ee,le,Fe=u+5<<3,je=wi(r,an)+wi(s,Vr)+o,re=wi(r,f)+wi(s,v)+o+14+3*ve+wi(J,Z)+(2*J[16]+3*J[17]+7*J[18]);if(Fe<=je&&Fe<=re)return Dr(e,c,n.subarray(l,l+u));if(dt(e,c,1+(re<je)),c+=2,re<je){ze=Ci(f,h,0),G=f,ee=Ci(v,w,0),le=v;var Se=Ci(Z,pt,0);for(dt(e,c,M-257),dt(e,c+5,X-1),dt(e,c+10,ve-4),c+=14,E=0;E<ve;++E)dt(e,c+3*E,Z[ku[E]]);c+=3*ve;for(var Ee=[$,H],te=0;te<2;++te){var me=Ee[te];for(E=0;E<me.length;++E){var Ce=31&me[E];dt(e,c,Se[Ce]),c+=Z[Ce],Ce>15&&(dt(e,c,me[E]>>>5&127),c+=me[E]>>>12)}}}else ze=Jf,G=an,ee=Yf,le=Vr;for(E=0;E<a;++E)if(i[E]>255){Ce=i[E]>>>18&31,bi(e,c,ze[Ce+257]),c+=G[Ce+257],Ce>7&&(dt(e,c,i[E]>>>23&31),c+=Jo[Ce]);var un=31&i[E];bi(e,c,ee[un]),c+=le[un],un>3&&(bi(e,c,i[E]>>>5&8191),c+=Yo[un])}else bi(e,c,ze[i[E]]),c+=G[i[E]];return bi(e,c,ze[256]),c+G[256]},Qf=new qn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zf=new Be(0),eh=function(){for(var n=new qn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),th=function(n,e,t,i,r){return function(s,o,a,l,u,c){var p=s.length,f=new Be(l+p+5*(1+Math.floor(p/7e3))+u),h=f.subarray(l,f.length-u),g=0;if(!o||p<8)for(var v=0;v<=p;v+=65535){var w=v+65535;w<p?g=Dr(h,g,s.subarray(v,w)):(h[v]=c,g=Dr(h,g,s.subarray(v,p)))}else{for(var D=Qf[o-1],$=D>>>13,M=8191&D,q=(1<<a)-1,H=new Pe(32768),X=new Pe(q+1),J=Math.ceil(a/3),E=2*J,ie=function(cs){return(s[cs]^s[cs+1]<<J^s[cs+2]<<E)&q},Z=new qn(25e3),pt=new Pe(288),ve=new Pe(32),ze=0,G=0,ee=(v=0,0),le=0,Fe=0;v<p;++v){var je=ie(v),re=32767&v,Se=X[je];if(H[re]=Se,X[je]=re,le<=v){var Ee=p-v;if((ze>7e3||ee>24576)&&Ee>423){g=Eu(s,h,0,Z,pt,ve,G,ee,Fe,v-Fe,g),ee=ze=G=0,Fe=v;for(var te=0;te<286;++te)pt[te]=0;for(te=0;te<30;++te)ve[te]=0}var me=2,Ce=0,un=M,wt=re-Se&32767;if(Ee>2&&je==ie(v-wt))for(var Tc=Math.min($,Ee)-1,Rc=Math.min(32767,v),Pc=Math.min(258,Ee);wt<=Rc&&--un&&re!=Se;){if(s[v+me]==s[v+me-wt]){for(var xt=0;xt<Pc&&s[v+xt]==s[v+xt-wt];++xt);if(xt>me){if(me=xt,Ce=wt,xt>Tc)break;var Oc=Math.min(wt,xt-2),Zo=0;for(te=0;te<Oc;++te){var us=v-wt+te+32768&32767,ea=us-H[us]+32768&32767;ea>Zo&&(Zo=ea,Se=us)}}}wt+=(re=Se)-(Se=H[re])+32768&32767}if(Ce){Z[ee++]=268435456|qo[me]<<18|Uo[Ce];var ta=31&qo[me],na=31&Uo[Ce];G+=Jo[ta]+Yo[na],++pt[257+ta],++ve[na],le=v+me,++ze}else Z[ee++]=s[v],++pt[s[v]]}}g=Eu(s,h,c,Z,pt,ve,G,ee,Fe,v-Fe,g),c||(g=Dr(h,g,Zf))}return gc(f,0,l+dc(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)},go=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function nh(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=eh[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),i=n.length;t.p(n);var r,s=th(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&&go(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),go(s,o-8,t.d()),go(s,o-4,i),s}var ih=!!wo||!!bo,$u="text/plain",Gr=function(n,e){var t=Ie(n.split("?"),2),i=t[0],r=t[1],s=I({},e);r?.split("&").forEach(function(a){var l=Ie(a.split("="),1)[0];delete s[l]});var o=ff(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},rh=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},vo=function(n){var e=n.data,t=n.compression;if(e){if(t===tt.GZipJS){var i=nh(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new Be(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 Be(u+8+(a-p<<1));f.set(l),l=f}var h=s.charCodeAt(p);h<128||o?c(h):h<2048?(c(192|h>>>6),c(128|63&h)):h>55295&&h<57344?(c(240|(h=65536+(1047552&h)|1023&s.charCodeAt(++p))>>>18),c(128|h>>>12&63),c(128|h>>>6&63),c(128|63&h)):(c(224|h>>>12),c(128|h>>>6&63),c(128|63&h))}return gc(l,0,u)}(JSON.stringify(e)),{mtime:0});return{contentType:$u,body:new Blob([i],{type:$u})}}if(t===tt.Base64){var r=function(s){var o,a,l,u,c,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,h=0,g="",v=[];if(!s)return s;s=Qp(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,v[h++]=p.charAt(o)+p.charAt(a)+p.charAt(l)+p.charAt(u);while(f<s.length);switch(g=v.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:rh(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Ai=[];wo&&Ai.push({transport:"XHR",method:function(n){var e,t=new wo;t.open(n.method||"GET",n.url,!0);var i=(e=vo(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;Y(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)}}),bo&&Ai.push({transport:"fetch",method:function(n){var e,t,i=(e=vo(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;Y(o,function(c,p){o.append(p,c)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(Yl){var u=new Yl;l={signal:u.signal,timeout:setTimeout(function(){return u.abort()},n.timeout)}}bo(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,h={statusCode:c.status,text:p};if(c.status===200)try{h.json=JSON.parse(p)}catch(g){k.error(g)}(f=n.callback)===null||f===void 0||f.call(n,h)})}).catch(function(c){var p;k.error(c),(p=n.callback)===null||p===void 0||p.call(n,{statusCode:0,text:c})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),yt!=null&&yt.sendBeacon&&Ai.push({transport:"sendBeacon",method:function(n){var e=Gr(n.url,{beacon:"1"});try{var t,i=(t=vo(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;yt.sendBeacon(e,o)}catch{}}});var sh=["retriesPerformedSoFar"],rn,oh=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,!F(m)&&"onLine"in m.navigator&&(this.areWeOnline=m.navigator.onLine,m.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),m.addEventListener("offline",function(){t.areWeOnline=!1}))}return V(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=Gp(e,sh);lt(i)&&i>0&&(r.url=Gr(r.url,{retry_count:i})),this.instance._send_request(I(I({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(I({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)"),k.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=rt(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=rt(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(I(I({},i),{},{transport:"sendBeacon"}))}catch(r){k.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),Pr=1800,ah=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||Nt,this._windowIdGenerator=r||Nt;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Pr;if(lt(a)?a>Pr?k.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&k.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(k.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Pr),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),Pr),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){k.error("Invalid sessionID in bootstrap",p)}this._listenToReloadWindow()}return V(n,[{key:"onSessionId",value:function(e){var t=this;return F(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({},jr,[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[jr];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;m?.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=Ie(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(),k.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,h=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,f,h),u&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:h}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(rn||(rn={}));var Cu="i.posthog.com",lh=function(){function n(e){W(this,n),y(this,"_regionCache",{}),this.instance=e}return V(n,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return 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]=rn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=rn.EU:this._regionCache[this.apiHost]=rn.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||this.apiHost.replace(".".concat(Cu),".posthog.com"))+t;if(this.region===rn.CUSTOM)return this.apiHost+t;var i=Cu+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}}]),n}(),vc="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 h=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=h,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)||[],v={$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:h,$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&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.capture("$exception",v),a}}var uh=V(function n(e,t,i,r,s){W(this,n),this.name=vc,this.setupOnce=function(o){o(mc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function ch(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()||Nt()};i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(gt,"identified")),r()},a=s.user();"then"in a&&it(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||k.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()||i.reset(),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(i.register({distinct_id:s.event.userId}),i.reloadFeatureFlags());var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{});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 Au,Xr,et,ph=function(){function n(e){W(this,n),this._instance=e}return V(n,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=(e=m?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var i=t.maxScrollHeight,r=t.lastScrollY,s=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,l=t.maxContentY;return F(i)||F(r)||F(s)||F(o)||F(a)||F(l)?{}:(i=Math.ceil(i),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:i<=1?1:Or(r/i,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:i<=1?1:Or(s/i,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Or(a/o,0,1),$prev_pageview_max_content:l,$prev_pageview_max_content_percentage:o<=1?1:Or(l/o,0,1)})}}]),n}();function Or(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(Au||(Au={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(Xr||(Xr={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(et||(et={}));var Iu=function(){function n(e){W(this,n),this.persistence=e,this.eventRegistry=new Map}return V(n,[{key:"register",value:function(e){var t=this;e.forEach(function(i){var r,s,o,a,l;(r=i.conditions)!==null&&r!==void 0&&r.events&&(s=i.conditions)!==null&&s!==void 0&&(o=s.events)!==null&&o!==void 0&&o.values&&((a=i.conditions)===null||a===void 0?void 0:a.events.values.length)>0&&t.eventRegistry.set(i.id,(l=i.conditions)===null||l===void 0?void 0:l.events.values.map(function(u){return u.name}))})}},{key:"on",value:function(e){var t,i=[];this.eventRegistry.forEach(function(o,a){o.includes(e)&&i.push(a)});var r=(t=this.persistence)===null||t===void 0?void 0:t.props[ao],s=(r||[]).concat(i);this._saveSurveysToStorage(s)}},{key:"getSurveys",value:function(){var e,t=(e=this.persistence)===null||e===void 0?void 0:e.props[ao];return t||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.register(y({},ao,on(new Set(e))))}}]),n}(),fh={icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!m&&cu(m.location.href,n)},not_regex:function(n){return!!m&&!cu(m.location.href,n)},exact:function(n){return m?.location.href===n},is_not:function(n){return m?.location.href!==n}},hh=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=he?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Iu(this.instance.persistence)),jn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),function(i){if(i)return k.error("Could not load surveys script",i);he.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 Iu(this.instance.persistence));var r=this.instance.get_property(Co);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=s.json.surveys||[],l=a.filter(function(c){var p,f,h,g,v,w;return((p=c.conditions)===null||p===void 0?void 0:p.events)&&((f=c.conditions)===null||f===void 0||(h=f.events)===null||h===void 0?void 0:h.values)&&((g=c.conditions)===null||g===void 0||(v=g.events)===null||v===void 0||(w=v.values)===null||w===void 0?void 0:w.length)>0});if(l.length>0&&!F(t.instance._addCaptureHook)){var u;(u=t._surveyEventReceiver)===null||u===void 0||u.register(l),t.instance._addCaptureHook(function(c){var p;(p=t._surveyEventReceiver)===null||p===void 0||p.on(c)})}return(o=t.instance.persistence)===null||o===void 0||o.register(y({},Co,a)),e(a)}})}},{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,h;if(!u.conditions)return!0;var g=(c=u.conditions)===null||c===void 0||!c.url||fh[(p=(f=u.conditions)===null||f===void 0?void 0:f.urlMatchType)!==null&&p!==void 0?p:"icontains"](u.conditions.url),v=(h=u.conditions)===null||h===void 0||!h.selector||T?.querySelector(u.conditions.selector);return g&&v}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(u){var c,p,f,h,g;if(!u.linked_flag_key&&!u.targeting_flag_key&&!u.internal_targeting_flag_key)return!0;var v=!u.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(u.linked_flag_key),w=!u.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.targeting_flag_key),D=!u.internal_targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.internal_targeting_flag_key),$=!(!((c=u.conditions)===null||c===void 0)&&c.events&&(!((p=u.conditions)===null||p===void 0||(f=p.events)===null||f===void 0)&&f.values)&&((h=u.conditions)===null||h===void 0||(g=h.events)===null||g===void 0?void 0:g.values.length)>0)||a?.includes(u.id);return v&&w&&D&&$});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?et.End:o;if(s.branching.type===et.End)return et.End;if(s.branching.type===et.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===et.ResponseBased){if(s.type===Xr.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===et.End?et.End:o}}else if(s.type===Xr.Rating){var p,f;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(v,w){if(w===3){if(v<1||v>3)throw new Error("The response must be in range 1-3");return v===1?"negative":v===2?"neutral":"positive"}if(w===5){if(v<1||v>5)throw new Error("The response must be in range 1-5");return v<=2?"negative":v===3?"neutral":"positive"}if(w===10){if(v<0||v>10)throw new Error("The response must be in range 0-10");return v<=6?"detractors":v<=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(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===et.End?et.End:o}}return o}return console.warn("Falling back to next question index due to unexpected branching type"),o}}]),n}(),dh=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){k.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void k.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(Io))!==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(Io,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}(),gh=function(){return I({initialPathName:De?.pathname||"",referringDomain:be.referringDomain()},be.campaignParams())},vh=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({},Ao,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||gh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return V(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[Ao]}},{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}(),mh=["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","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Tu=function(n,e){if(!n)return!1;var t=n.toLowerCase();return mh.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},yc=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 Ru(n){var e;return n.id===Po||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+Po))}var yh=function(){function n(e){var t;W(this,n),y(this,"rageclicks",new yc),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[So])}return V(n,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(k.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return F(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},So,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;m&&T&&(mt(T,"click",function(t){return e._onClick(t||m?.event)},!1,!0),mt(T,"mousemove",function(t){return e._onMouseMove(t||m?.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&&!Ut(c,"body");){if(c===u)return!1;if(U(l,m?.getComputedStyle(c).position))return!0;c=ac(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(!Ru(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(I(I({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;Ru(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(m){var t=m.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),n}(),_h=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(){m?.addEventListener("scroll",this._updateScrollData,!0),m?.addEventListener("scrollend",this._updateScrollData,!0),m?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return m?.document.documentElement;var e,t=rt(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=m?.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 m&&(m.scrollY||m.pageYOffset||m.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 m&&(m.scrollX||m.pageXOffset||m.document.documentElement.scrollLeft)||0}}]),n}(),bh=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=rt(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=rt(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),mo="$copy_autocapture";function yo(n,e){return e.length>n?e.slice(0,n)+"...":e}var Lt,wh=function(){function n(e){W(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new yc),y(this,"_elementsChainAsString",!1),this.instance=e}return V(n,[{key:"config",get:function(){var e,t=nt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(e=t.url_allowlist)===null||e===void 0?void 0:e.map(function(i){return new RegExp(i)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(m&&T){var t=function(r){r=r||m?.event;try{e._captureEvent(r)}catch(s){k.error("Failed to capture event",s)}},i=function(r){r=r||m?.event,e._captureEvent(r,mo)};mt(T,"submit",t,!1,!0),mt(T,"change",t,!1,!0),mt(T,"click",t,!1,!0),this.config.capture_copied_text&&(mt(T,"copy",i,!1,!0),mt(T,"cut",i,!1,!0))}}else k.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({},Zl,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Zl],r=this._isDisabledServerSide;if(bt(r)&&!Fr(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&&!Xo(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Lo(e))return{};var t={};return Y(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&&Ln(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Do.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=yo(1024,vu(e)):o.$el_text=yo(1024,Hr(e)));var a=zr(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;Y(e.attributes,function(f){var h;if((!lc(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(l==null||!l.includes(f.name))&&!t&&Ln(f.value)&&(h=f.name,!Re(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=Go(g).join(" ")),o["attr__"+f.name]=yo(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 F(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===mo;if(s&&$f(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,u=[s],c=s;c.parentNode&&!Ut(c,"body");)oc(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var p,f,h=[],g={},v=!1;if(Y(u,function(E){var ie=Lo(E);E.tagName.toLowerCase()==="a"&&(p=E.getAttribute("href"),p=ie&&Ln(p)&&p),U(zr(E),"ph-no-capture")&&(v=!0),h.push(t._getPropertiesFromElement(E,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var Z=t._getAugmentPropertiesFromElement(E);Te(g,Z)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?h[0].$el_text=vu(s):h[0].$el_text=Hr(s)),p){var w,D;h[0].attr__href=p;var $=(w=$i(p))===null||w===void 0?void 0:w.host,M=m==null||(D=m.location)===null||D===void 0?void 0:D.host;$&&M&&$!==M&&(f=p)}if(v)return!1;var q=Te(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:Rf(h)}:{$elements:h},(a=h[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=h[0])===null||l===void 0?void 0:l.$el_text}:{},f&&e.type==="click"?{$external_click_url:f}:{},g);if(i===mo){var H,X=rc(m==null||(H=m.getSelection())===null||H===void 0?void 0:H.toString()),J=e.type||"clipboard";if(!X)return!1;q.$selected_content=X,q.$copy_type=J}return this.instance.capture(i,q),!0}}}},{key:"isBrowserSupported",value:function(){return it(T?.querySelectorAll)}}]),n}(),xh=function(){function n(e){var t=this;W(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){F(t._restoreXHRPatch)&&he.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),F(t._restoreFetchPatch)&&he.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return V(n,[{key:"_loadScript",value:function(e){he.postHogTracingHeadersPatchFns&&e(),jn(this.instance.requestRouter.endpointFor("assets","/static/tracing-headers.js?v=".concat(jt.LIB_VERSION)),function(t){t&&k.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"})(Lt||(Lt={}));var kh=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()?Lt.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Lt.DENIED||this.consent===Lt.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"?Lt.GRANTED:e==="0"?Lt.DENIED:Lt.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&&!!qu([yt?.doNotTrack,yt?.msDoNotTrack,he.doNotTrack],function(e){return U([!0,1,"1","yes"],e)})}}]),n}(),Ii={},Pu=function(){},Rn="posthog",_c=!ih&&ae?.indexOf("MSIE")===-1&&ae?.indexOf("Mozilla")===-1,Ou=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,!!Re(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Pu,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:De&&Re(De?.search)&&De.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(m==null||(n=m.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;k.error(r)},get_device_id:function(i){return i},_onCapture:Pu,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},Fu=function(n){var e={};F(n.process_person)||(e.person_profiles=n.process_person),F(n.xhr_headers)||(e.request_headers=n.xhr_headers),F(n.cookie_name)||(e.persistence_name=n.cookie_name),F(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Te({},e,n);return de(n.property_blacklist)&&(F(n.property_denylist)?t.property_denylist=n.property_blacklist:de(n.property_denylist)?t.property_denylist=[].concat(on(n.property_blacklist),on(n.property_denylist)):k.error("Invalid value for property_denylist config: "+n.property_denylist)),t},Sh=function(){function n(){W(this,n),y(this,"__forceAllowLocalhost",!1)}return V(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){k.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),bc=function(){function n(){var e=this;W(this,n),y(this,"webPerformance",new Sh),y(this,"_debugEventEmitter",new bh),this.config=Ou(),this.decideEndpointWasHit=!1,this.SentryIntegration=uh,this.sentryIntegration=function(t){return function(i,r){var s=mc(i,r);return{name:vc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new ef(this),this.toolbar=new Vf(this),this.scrollManager=new _h(this),this.pageViewManager=new ph(this),this.surveys=new hh(this),this.rateLimiter=new dh(this),this.requestRouter=new lh(this),this.consent=new kh(this),this.people={set:function(t,i,r){var s=Re(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Re(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return k.info("send",t)})}return V(n,[{key:"init",value:function(e,t,i){if(i&&i!==Rn){var r,s=(r=Ii[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),Ii[i]=s,Ii[Rn][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(F(e)||function(w){return Re(w)&&w.trim().length===0}(e))return k.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 k.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Te({},Ou(),Fu(s),{name:o,token:e})),this.compression=s.disable_compression?void 0:tt.Base64,this.persistence=new po(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new po(I(I({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new Gf(function(w){return r._send_retriable_request(w)}),this._retryQueue=new oh(this),this.__request_queue=[],this.sessionManager=new ah(this.config,this.persistence),this.sessionPropsManager=new vh(this.sessionManager,this.persistence),new xh(this).startIfEnabledOrStop(),this.sessionRecording=new zf(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new wh(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new yh(this),this.heatmaps.startIfEnabled(),jt.DEBUG=jt.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,l,u=this.config.get_device_id(Nt()),c=(a=s.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?u:s.bootstrap.distinctID;this.persistence.set_property(gt,(l=s.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var p,f,h=Object.keys(((p=s.bootstrap)===null||p===void 0?void 0:p.featureFlags)||{}).filter(function(w){var D,$;return!((D=s.bootstrap)===null||D===void 0||($=D.featureFlags)===null||$===void 0||!$[w])}).reduce(function(w,D){var $,M;return w[D]=(($=s.bootstrap)===null||$===void 0||(M=$.featureFlags)===null||M===void 0?void 0:M[D])||!1,w},{}),g=Object.keys(((f=s.bootstrap)===null||f===void 0?void 0:f.featureFlagPayloads)||{}).filter(function(w){return h[w]}).reduce(function(w,D){var $,M,q,H;return($=s.bootstrap)!==null&&$!==void 0&&(M=$.featureFlagPayloads)!==null&&M!==void 0&&M[D]&&(w[D]=(q=s.bootstrap)===null||q===void 0||(H=q.featureFlagPayloads)===null||H===void 0?void 0:H[D]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:g})}if(!this.get_distinct_id()){var v=this.config.get_device_id(Nt());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(gt,"anonymous")}return m==null||(i=m.addEventListener)===null||i===void 0||i.call(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?ch(this,function(){return r._loaded()}):this._loaded(),it(this.config._onCapture)&&this.on("eventCaptured",function(w){return r.config._onCapture(w.event,w)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=U(e.supportedCompression,tt.GZipJS)?tt.GZipJS:U(e.supportedCompression,tt.Base64)?tt.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)}},{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){k.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){T&&e.capture("$pageview",{title:T.title},{send_instantly:!0})},1),t||(new Hf(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()||Fn(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&&(_c?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Gr(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=I({},i);a.timeout=a.timeout||6e4,a.url=Gr(a.url,{_:new Date().getTime().toString(),ver:jt.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",u=(s=(o=qu(Ai,function(c){return c.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Ai[0].method;if(!u)throw new Error("No available transport method");u(a)}(I(I({},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=[];Fn(e,function(l){l&&(t=l[0],de(t)?o.push(l):it(l)?l.call(i):de(l)&&t==="alias"?r.push(l):de(l)&&t.indexOf("capture")!==-1&&it(i[t])?o.push(l):s.push(l))});var a=function(l,u){Fn(l,function(c){if(de(c[0])){var p=u;Y(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))return k.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!F(e)&&Re(e)){if(!ae||this.config.opt_out_useragent_filter||!Tu(ae,this.config.custom_blocked_useragents)){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={uuid:Nt(),event:e,properties:this._calculate_event_properties(e,t||{},i)};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(o.$set=i?.$set);var a=this._calculate_set_once_properties(i?.$set_once);a&&(o.$set_once=a),(o=Kp(o,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i?.timestamp||new Date,F(i?.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var l=I(I({},o.properties.$set),o.$set);oo(l)||this.setPersonPropertiesForFlags(l),this._debugEventEmitter.emit("eventCaptured",o);var u={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,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(u):this._requestQueue.enqueue(u),o}k.critical("This capture call is ignored due to client rate limiting.")}}else k.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=I({},t);if(s.token=this.config.token,e==="$snapshot"){var o=I(I({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,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===rn.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=Te(s,p)}if(!this.config.disable_scroll_properties){var f={};e==="$pageview"?f=this.pageViewManager.doPageView():e==="$pageleave"&&(f=this.pageViewManager.doPageLeave()),s=Te(s,f)}if(e==="$pageview"&&T&&(s.title=T.title),!F(r)){var h=new Date().getTime()-r;s.$duration=parseFloat((h/1e3).toFixed(3))}if(ae&&this.config.opt_out_useragent_filter&&(s.$browser_type=Tu(ae,this.config.custom_blocked_useragents)?"bot":"browser"),(s=Te({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),i==null||!i._noHeatmaps){var g,v=(g=this.heatmaps)===null||g===void 0?void 0:g.getAndClearBuffer();v&&(s.$heatmap_data=v)}de(this.config.property_denylist)?Y(this.config.property_denylist,function(D){delete s[D]}):k.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var w=this.config.sanitize_properties;return w&&(s=w(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=Te({},this.persistence.get_initial_props(),e||{});return oo(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._debugEventEmitter.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:"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 k.uninitializedWarning("posthog.identify");if(lt(e)&&(e=e.toString(),k.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()))k.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(xi)&&(this.unregister(xi),this.register({distinct_id:e}));var o=(this.persistence.get_property(gt)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(gt,"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(Nr))}}else k.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:I(I({},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 k.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(!this.__loaded)return k.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(gt,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(Nt());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(Uu)?(k.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(xi,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(k.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=I({},this.config);nt(e)&&(Te(this.config,Fu(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new po(I(I({},this.config),{},{persistence:"sessionStorage"})),fe.is_supported()&&fe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(jt.DEBUG=!0),(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){if(e!=null&&e.sampling){var t,i,r=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId();(i=this.persistence)===null||i===void 0||i.register(y({},Ei,!0)),k.info("Session recording started with sampling override for session: ",r?.sessionId)}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:"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:Rn;return t!==Rn&&(t=Rn+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(gt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(gt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&oo(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[xi])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[qr]))}},{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"?(k.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(qr,!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(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0})}},{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:"debug",value:function(e){e===!1?(m?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(m?.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]]=Yp(n.prototype[e[t]])})(bc,["identify"]);var Mu,wc=(Mu=Ii[Rn]=new bc,function(){function n(){n.done||(n.done=!0,_c=!1,Y(Ii,function(e){e._dom_loaded()}))}T!=null&&T.addEventListener&&(T.readyState==="complete"?n():T.addEventListener("DOMContentLoaded",n,!1)),m&&mt(m,"load",n,!0)}(),Mu);var xc=wc.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 ue(n,e){if(!xc)throw new Error("Failed to initialize PostHog");xc.capture(n,e)}var Qr,Di,Zr,Bt,Sc,Kr,es=class es extends z(N){constructor(){super();b(this,Bt);b(this,Qr,new Ft(this,{onError:console.error}));b(this,Di);b(this,Zr,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>ue("ShopAssistant: user clicked link",t),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return d(this,Di)||d(this,Qr).data}render(){return this.config?O`
317
317
  <!-- embed our chat component forwarding props -->
318
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,Kr)}" ?show-close="${this.showClose}" @mw:close-click="${R(this,Nt,Ec)}">
318
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${d(this,Zr)}" ?show-close="${this.showClose}" @mw:close-click="${R(this,Bt,Sc)}">
319
319
  <slot name="banner" slot="banner"></slot>
320
320
  </mw-chat>
321
- `:D}injectConfig(t){$(this,Oi,t),this.requestUpdate()}reloadConfig(){h(this,Nt,Jr)?.reloadConfig()}get conversationId(){return h(this,Nt,Jr)?.conversationId??""}get messages(){return h(this,Nt,Jr)?.messages??[]}};Yr=new WeakMap,Oi=new WeakMap,Kr=new WeakMap,Nt=new WeakSet,Ec=function(){this.dispatchEvent(new Qr.CloseClickEvent)},Jr=function(){return this.renderRoot.querySelector("mw-chat")||null},S(Qr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var Pi=Qr;customElements.define("molin-shop-ai-chat",Pi);var Jo;Pi.CloseClickEvent=(Jo=class extends CustomEvent{constructor(e={}){super(Pi.CloseClickEvent.type,{...e})}},S(Jo,"type","mw:close-click"),Jo);var $c=n=>n??D;var es,Zr=class extends z(j){constructor(){super();b(this,es,new Pt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return h(this,es).data}render(){return this.config?O`
321
+ `:L}injectConfig(t){A(this,Di,t),this.requestUpdate()}reloadConfig(){d(this,Bt,Kr)?.reloadConfig()}get conversationId(){return d(this,Bt,Kr)?.conversationId??""}get messages(){return d(this,Bt,Kr)?.messages??[]}};Qr=new WeakMap,Di=new WeakMap,Zr=new WeakMap,Bt=new WeakSet,Sc=function(){this.dispatchEvent(new es.CloseClickEvent)},Kr=function(){return this.renderRoot.querySelector("mw-chat")||null},S(es,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var Mi=es;customElements.define("molin-shop-ai-chat",Mi);var Ko;Mi.CloseClickEvent=(Ko=class extends CustomEvent{constructor(e={}){super(Mi.CloseClickEvent.type,{...e})}},S(Ko,"type","mw:close-click"),Ko);var Ec=n=>n??L;var ns,ts=class extends z(N){constructor(){super();b(this,ns,new Ft(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return d(this,ns).data}render(){return this.config?O`
322
322
  <!-- embed our bubble component forwarding props -->
323
323
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
324
- <mw-bubble state="${this.state}" src="${$c(this.config?.bubble?.imageUrl)}"></mw-bubble>
325
- `:D}};es=new WeakMap,S(Zr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Zr);var ns,qn,Nn,on,Fi,Mi,ts=class{constructor(e,t,i,r=window.history){b(this,ns);b(this,qn);b(this,Nn);b(this,on);b(this,Fi,!1);b(this,Mi,()=>{h(this,qn).test(window.location.pathname)&&h(this,Nn).navigated()});$(this,ns,e),$(this,qn,t),$(this,Nn,i),$(this,on,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",h(this,Mi));let e=h(this,on).pushState;h(this,on).pushState=(...t)=>{if(e.call(h(this,on),...t),!h(this,Fi))try{let i=new URL(t[2],window.location.origin);h(this,qn).test(i.pathname)&&h(this,Nn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",h(this,Mi)),$(this,Fi,!0)}};ns=new WeakMap,qn=new WeakMap,Nn=new WeakMap,on=new WeakMap,Fi=new WeakMap,Mi=new WeakMap;function is(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var ss,Yo,ge,os,Oe,Di,Cc,Ac,Ic,Tc,rs=class extends z(j){constructor(){super();b(this,Oe);b(this,ss,new Pt(this,{onError:console.error}));b(this,Yo,new ts(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=h(this,Oe,Cc);t&&ue("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,ge,!1);b(this,os,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>ue("ShopAssistant: user clicked link",t),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return h(this,ss).data}render(){if(!this.config)return D;let t=[is(this.config.bubble.position),is(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),i=is(this.config.bubble.position),r={bottom:"72px"},s=Object.entries(this.config.bubble.position).filter(([a,l])=>l).map(([a,l])=>{let u=`sm:${a}-[calc(${[r[a],l].filter(c=>!!c).join("+")})]`;return a==="left"&&(u+=" sm:right-auto"),a==="right"&&(u+=" sm:left-auto"),u}).join(" "),o=s;return this.config.hidden?D:O`
326
- <mw-bubble class="${t} fixed z-[2147483647]" @click=${R(this,Oe,Ic)} state="${h(this,ge)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
324
+ <mw-bubble state="${this.state}" src="${Ec(this.config?.bubble?.imageUrl)}"></mw-bubble>
325
+ `:L}};ns=new WeakMap,S(ts,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",ts);var rs,Un,Bn,ln,Li,ji,is=class{constructor(e,t,i,r=window.history){b(this,rs);b(this,Un);b(this,Bn);b(this,ln);b(this,Li,!1);b(this,ji,()=>{d(this,Un).test(window.location.pathname)&&d(this,Bn).navigated()});A(this,rs,e),A(this,Un,t),A(this,Bn,i),A(this,ln,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",d(this,ji));let e=d(this,ln).pushState;d(this,ln).pushState=(...t)=>{if(e.call(d(this,ln),...t),!d(this,Li))try{let i=new URL(t[2],window.location.origin);d(this,Un).test(i.pathname)&&d(this,Bn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",d(this,ji)),A(this,Li,!0)}};rs=new WeakMap,Un=new WeakMap,Bn=new WeakMap,ln=new WeakMap,Li=new WeakMap,ji=new WeakMap;function ss(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var as,Qo,ge,ls,Oe,Ni,$c,Cc,Ac,Ic,os=class extends z(N){constructor(){super();b(this,Oe);b(this,as,new Ft(this,{onError:console.error}));b(this,Qo,new is(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=d(this,Oe,$c);t&&ue("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,ge,!1);b(this,ls,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>ue("ShopAssistant: user clicked link",t),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return d(this,as).data}render(){if(!this.config)return L;let t=[ss(this.config.bubble.position),ss(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),i=ss(this.config.bubble.position),r={bottom:"72px"},s=Object.entries(this.config.bubble.position).filter(([a,l])=>l).map(([a,l])=>{let u=`sm:${a}-[calc(${[r[a],l].filter(c=>!!c).join("+")})]`;return a==="left"&&(u+=" sm:right-auto"),a==="right"&&(u+=" sm:left-auto"),u}).join(" "),o=s;return this.config.hidden?L:O`
326
+ <mw-bubble class="${t} fixed z-[2147483647]" @click=${R(this,Oe,Ac)} state="${d(this,ge)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
327
327
 
328
328
  <!-- only load the component if enabled on any platform -->
329
329
  ${this.isPopupEnabled?O`<mw-popup
@@ -331,20 +331,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
331
331
  delay="${this.config.popup?.delayMs||0}"
332
332
  sound="https://molin.ai/sounds/widget/popup.aac"
333
333
  .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}}}"
334
- @mw:click="${R(this,Oe,Ac)}"></mw-popup>`:D}
334
+ @mw:click="${R(this,Oe,Cc)}"></mw-popup>`:L}
335
335
 
336
336
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
337
- ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?O`<mw-try-it-out class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}" position="${i}" text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:D}
337
+ ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?O`<mw-try-it-out class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}" position="${i}" text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:L}
338
338
 
339
339
  <!-- 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. -->
340
340
  ${this._dialogAlreadyShown?O`
341
- <div class="${h(this,ge)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${s} 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]">
342
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,os)}" ?show-close="${!0}" @mw:close-click="${R(this,Oe,Tc)}">
341
+ <div class="${d(this,ge)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${s} 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]">
342
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${d(this,ls)}" ?show-close="${!0}" @mw:close-click="${R(this,Oe,Ic)}">
343
343
  <slot name="banner" slot="banner"></slot>
344
344
  </mw-chat>
345
345
  </div>
346
- `:D}
347
- `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){h(this,ge)&&h(this,Oe,Di)?.hide()}openChat(){h(this,ge)||($(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),h(this,Oe,Di)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,ge)?"open":"close"}))}closeChat(){h(this,ge)&&($(this,ge,!1),this.requestUpdate(),h(this,Oe,Di)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,ge)?"open":"close"}))}};ss=new WeakMap,Yo=new WeakMap,ge=new WeakMap,os=new WeakMap,Oe=new WeakSet,Di=function(){return this.renderRoot.querySelector("mw-popup")||null},Cc=function(){return this.renderRoot.querySelector("mw-chat")||null},Ac=function(){$(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:h(this,ge)?"open":"close"})},Ic=function(){$(this,ge,!h(this,ge)),this._dialogAlreadyShown=!0,this.requestUpdate(),h(this,Oe,Di)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:h(this,ge)?"open":"close"})},Tc=function(){$(this,ge,!1),this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:h(this,ge)?"open":"close"})},S(rs,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",rs);
346
+ `:L}
347
+ `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){d(this,ge)&&d(this,Oe,Ni)?.hide()}openChat(){d(this,ge)||(A(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),d(this,Oe,Ni)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:d(this,ge)?"open":"close"}))}closeChat(){d(this,ge)&&(A(this,ge,!1),this.requestUpdate(),d(this,Oe,Ni)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:d(this,ge)?"open":"close"}))}};as=new WeakMap,Qo=new WeakMap,ge=new WeakMap,ls=new WeakMap,Oe=new WeakSet,Ni=function(){return this.renderRoot.querySelector("mw-popup")||null},$c=function(){return this.renderRoot.querySelector("mw-chat")||null},Cc=function(){A(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:d(this,ge)?"open":"close"})},Ac=function(){A(this,ge,!d(this,ge)),this._dialogAlreadyShown=!0,this.requestUpdate(),d(this,Oe,Ni)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:d(this,ge)?"open":"close"})},Ic=function(){A(this,ge,!1),this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:d(this,ge)?"open":"close"})},S(os,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",os);
348
348
  /*! Bundled license information:
349
349
 
350
350
  @lit/reactive-element/css-tag.js: