@smarttalks.ai/widget 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.cjs CHANGED
@@ -1,10 +1,10 @@
1
- (function(qt){typeof define=="function"&&define.amd?define(qt):qt()})(function(){"use strict";function qt(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),so(o.value)&&!ta(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function Js(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=so(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=ea(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Zs(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Qs(e,t){const n=qt(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?oo(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&io(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&io(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),n}function oo(e){if(e)try{return JSON.parse(e)}catch{return e}}function io(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function ea(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function so(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function ta(e){return Object.prototype.toString.call(e)==="[object Function]"}function na(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let zn;function ra(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Qs(this,t);const o=Zs(this.props),i=this.Component,s=zn;try{zn=this,this.__initialized=!0,na(i)?new i(o,{element:this}):i(o,{element:this})}finally{zn=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?oo(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function oa(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{if(!e)throw new Error("tag is required to register a Component");let a=i.get(e);return a?(a.prototype.Component=s,a):(a=ra(r,Js(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const F={context:void 0,registry:void 0};function Ot(e){F.context=e}const ia=(e,t)=>e===t,me=Symbol("solid-proxy"),Vn=Symbol("solid-track"),Wt={equals:ia};let ao=go;const Me=1,Gt=2,lo={owned:null,cleanups:null,context:null,owner:null},Un={};var q=null;let jn=null,sa=null,G=null,ne=null,De=null,Yt=0;function Le(e,t){const n=G,r=q,o=e.length===0,i=t===void 0?r:t,s=o?lo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>W(()=>Qt(s)));q=s,G=null;try{return Ie(a,!0)}finally{G=n,q=r}}function _(e,t){t=t?Object.assign({},Wt,t):Wt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),ho(n,o));return[fo.bind(n),r]}function Hn(e,t,n){const r=Xt(e,t,!0,Me);st(r)}function Q(e,t,n){const r=Xt(e,t,!1,Me);st(r)}function M(e,t,n){ao=fa;const r=Xt(e,t,!1,Me);(!n||!n.render)&&(r.user=!0),De?De.push(r):st(r)}function O(e,t,n){n=n?Object.assign({},Wt,n):Wt;const r=Xt(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,st(r),fo.bind(r)}function aa(e){return e&&typeof e=="object"&&"then"in e}function co(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=Un,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&O(r);const h=new Set,[m,f]=(i.storage||_)(i.initialValue),[g,y]=_(void 0),[w,b]=_(void 0,{equals:!1}),[v,x]=_(u?"ready":"unresolved");if(F.context){l=`${F.context.id}${F.context.count++}`;let C;i.ssrLoadFrom==="initial"?a=i.initialValue:F.load&&(C=F.load(l))&&(a=C)}function P(C,K,I,D){return s===C&&(s=null,D!==void 0&&(u=!0),(C===a||K===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(D,{value:K})),a=Un,S(K,I)),K}function S(C,K){Ie(()=>{K===void 0&&f(()=>C),x(K!==void 0?"errored":u?"ready":"unresolved"),y(K);for(const I of h.keys())I.decrement();h.clear()},!1)}function k(){const C=ca,K=m(),I=g();if(I!==void 0&&!s)throw I;return G&&!G.user&&C&&Hn(()=>{w(),s&&(C.resolved||h.has(C)||(C.increment(),h.add(C)))}),K}function R(C=!0){if(C!==!1&&c)return;c=!1;const K=d?d():r;if(K==null||K===!1){P(s,W(m));return}const I=a!==Un?a:W(()=>o(K,{value:m(),refetching:C}));return aa(I)?(s=I,"value"in I?(I.status==="success"?P(s,I.value,void 0,K):P(s,void 0,void 0,K),I):(c=!0,queueMicrotask(()=>c=!1),Ie(()=>{x(u?"refreshing":"pending"),b()},!1),I.then(D=>P(I,D,void 0,K),D=>P(I,void 0,mo(D),K)))):(P(s,I,void 0,K),I)}return Object.defineProperties(k,{state:{get:()=>v()},error:{get:()=>g()},loading:{get(){const C=v();return C==="pending"||C==="refreshing"}},latest:{get(){if(!u)return k();const C=g();if(C&&!s)throw C;return m()}}}),d?Hn(()=>R(!1)):R(!1),[k,{refetch:R,mutate:f}]}function Se(e){return Ie(e,!1)}function W(e){if(G===null)return e();const t=G;G=null;try{return e()}finally{G=t}}function Je(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=W(()=>t(a,o,s));return o=a,l}}function _t(e){M(()=>W(e))}function B(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function qn(){return G}function uo(){return q}function la(e,t){const n=q,r=G;q=e,G=null;try{return Ie(t,!0)}catch(o){Gn(o)}finally{q=n,G=r}}function se(e,t){const n=Symbol("context");return{id:n,Provider:ha(n),defaultValue:e}}function ue(e){return q&&q.context&&q.context[e.id]!==void 0?q.context[e.id]:e.defaultValue}function Wn(e){const t=O(e),n=O(()=>Yn(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let ca;function fo(){if(this.sources&&this.state)if(this.state===Me)st(this);else{const e=ne;ne=null,Ie(()=>Zt(this),!1),ne=e}if(G){const e=this.observers?this.observers.length:0;G.sources?(G.sources.push(this),G.sourceSlots.push(e)):(G.sources=[this],G.sourceSlots=[e]),this.observers?(this.observers.push(G),this.observerSlots.push(G.sources.length-1)):(this.observers=[G],this.observerSlots=[G.sources.length-1])}return this.value}function ho(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ie(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=jn&&jn.running;s&&jn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?ne.push(i):De.push(i),i.observers&&po(i)),s||(i.state=Me)}if(ne.length>1e6)throw ne=[],new Error},!1)),t}function st(e){if(!e.fn)return;Qt(e);const t=Yt;ua(e,e.value,t)}function ua(e,t,n){let r;const o=q,i=G;G=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Me,e.owned&&e.owned.forEach(Qt),e.owned=null),e.updatedAt=n+1,Gn(s)}finally{G=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ho(e,r):e.value=r,e.updatedAt=n)}function Xt(e,t,n,r=Me,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==lo&&(q.owned?q.owned.push(i):q.owned=[i]),i}function Jt(e){if(e.state===0)return;if(e.state===Gt)return Zt(e);if(e.suspense&&W(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Yt);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Me)st(e);else if(e.state===Gt){const r=ne;ne=null,Ie(()=>Zt(e,t[0]),!1),ne=r}}function Ie(e,t){if(ne)return e();let n=!1;t||(ne=[]),De?n=!0:De=[],Yt++;try{const r=e();return da(n),r}catch(r){n||(De=null),ne=null,Gn(r)}}function da(e){if(ne&&(go(ne),ne=null),e)return;const t=De;De=null,t.length&&Ie(()=>ao(t),!1)}function go(e){for(let t=0;t<e.length;t++)Jt(e[t])}function fa(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jt(r)}if(F.context){if(F.count){F.effects||(F.effects=[]),F.effects.push(...e.slice(0,n));return}else F.effects&&(e=[...F.effects,...e],n+=F.effects.length,delete F.effects);Ot()}for(t=0;t<n;t++)Jt(e[t])}function Zt(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Me?r!==t&&(!r.updatedAt||r.updatedAt<Yt)&&Jt(r):o===Gt&&Zt(r,t)}}}function po(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Gt,n.pure?ne.push(n):De.push(n),n.observers&&po(n))}}function Qt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Qt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function mo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Gn(e,t=q){throw mo(e)}function Yn(e){if(typeof e=="function"&&!e.length)return Yn(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Yn(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function ha(e,t){return function(r){let o;return Q(()=>o=W(()=>(q.context={...q.context,[e]:r.value},Wn(()=>r.children))),void 0),o}}const ga=Symbol("fallback");function yo(e){for(let t=0;t<e.length;t++)e[t]()}function pa(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return B(()=>yo(i)),()=>{let l=e()||[],c,u;return l[Vn],W(()=>{let h=l.length,m,f,g,y,w,b,v,x,P;if(h===0)s!==0&&(yo(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ga],o[0]=Le(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=Le(d);s=h}else{for(g=new Array(h),y=new Array(h),a&&(w=new Array(h)),b=0,v=Math.min(s,h);b<v&&r[b]===l[b];b++);for(v=s-1,x=h-1;v>=b&&x>=b&&r[v]===l[x];v--,x--)g[x]=o[v],y[x]=i[v],a&&(w[x]=a[v]);for(m=new Map,f=new Array(x+1),u=x;u>=b;u--)P=l[u],c=m.get(P),f[u]=c===void 0?-1:c,m.set(P,u);for(c=b;c<=v;c++)P=r[c],u=m.get(P),u!==void 0&&u!==-1?(g[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=f[u],m.set(P,u)):i[c]();for(u=b;u<h;u++)u in g?(o[u]=g[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=Le(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[m,f]=_(u);return a[u]=f,t(l[u],m)}return t(l[u])}}}function p(e,t){return W(()=>e(t||{}))}function en(){return!0}const Xn={get(e,t,n){return t===me?n:e.get(t)},has(e,t){return t===me?!0:e.has(t)},set:en,deleteProperty:en,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:en,deleteProperty:en}},ownKeys(e){return e.keys()}};function Jn(e){return(e=typeof e=="function"?e():e)?e:{}}function ma(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function T(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&me in a,e[s]=typeof a=="function"?(t=!0,O(a)):a}if(t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Jn(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Jn(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Jn(e[a])));return[...new Set(s)]}},Xn);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:ma.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const h=n[u];h&&(d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function H(e,...t){if(me in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Xn));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},Xn)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function ya(e){let t,n;const r=o=>{const i=F.context;if(i){const[a,l]=_();F.count||(F.count=0),F.count++,(n||(n=e())).then(c=>{Ot(i),F.count--,l(()=>c.default),Ot()}),t=a}else if(!t){const[a]=co(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return O(()=>(s=t())&&W(()=>{if(!i)return s(o);const a=F.context;Ot(i);const l=s(o);return Ot(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}let ba=0;function Ce(){const e=F.context;return e?`${e.id}${e.count++}`:`cl-${ba++}`}const bo=e=>`Stale read from <${e}>.`;function at(e){const t="fallback"in e&&{fallback:()=>e.fallback};return O(pa(()=>e.each,e.children,t||void 0))}function J(e){const t=e.keyed,n=O(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return O(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?W(()=>o(t?r:()=>{if(!W(n))throw bo("Show");return e.when})):o}return e.fallback},void 0,void 0)}function wo(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=Wn(()=>e.children),o=O(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return O(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?W(()=>l(t?s:()=>{if(W(o)[0]!==i)throw bo("Match");return a.when})):l},void 0,void 0)}function Pt(e){return e}const wa=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],va=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...wa]),xa=new Set(["innerHTML","textContent","innerText","children"]),Sa=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Ea=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ka(e,t){const n=Ea[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Ca=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Oa=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),_a={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Pa(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,m;for(;++d<o&&d<i&&!((m=c.get(t[d]))==null||m!==u+h);)h++;if(h>u-a){const f=t[s];for(;a<u;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const vo="_$DX_DELEGATE";function L(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>W(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Aa(e,t=window.document){const n=t[vo]||(t[vo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,$a))}}function ae(e,t,n){F.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Ta(e,t,n,r){F.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Ze(e,t){F.context||(t==null?e.removeAttribute("class"):e.className=t)}function Ma(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function Da(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Eo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Eo(e,a,!0),n[a]=l)}return n}function xo(e,t,n){if(!t)return n?ae(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Qe(e,t={},n,r){const o={};return r||Q(()=>o.children=lt(e,t.children,o.children)),Q(()=>t.ref&&t.ref(e)),Q(()=>La(e,t,n,!0,o,!0)),o}function So(e,t,n){return W(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return lt(e,t,r,n);Q(o=>lt(e,t(),o,n),r)}function La(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=ko(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||lt(e,t.children);continue}const a=t[s];o[s]=ko(e,s,a,o[s],n,i)}}function Ia(e){let t,n;return!F.context||!(t=F.registry.get(n=Fa()))?e():(F.completed&&F.completed.add(t),F.registry.delete(n),t)}function Ra(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Eo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function ko(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return xo(e,n,r);if(t==="classList")return Da(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=Ca.has(d);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(h||n)&&(Ma(e,d,n,h),h&&Aa([d]))}else if(t.slice(0,5)==="attr:")ae(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=xa.has(t))||!o&&((c=ka(t,e.tagName))||(a=va.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(F.context)return n;t==="class"||t==="className"?Ze(e,n):s&&!a&&!l?e[Ra(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&_a[t.split(":")[0]];d?Ta(e,d,t,n):ae(e,Sa[t]||t,n)}return n}function $a(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),F.registry&&!F.done&&(F.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function lt(e,t,n,r,o){if(F.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(F.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=ct(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(F.context)return n;n=ct(e,n,r)}else{if(i==="function")return Q(()=>{let a=t();for(;typeof a=="function";)a=a();n=lt(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Zn(a,t,n,o))return Q(()=>n=lt(e,a,n,r,!0)),()=>n;if(F.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=ct(e,n,r),s)return n}else l?n.length===0?Co(e,a,r):Pa(e,n,a):(n&&ct(e),Co(e,a));n=a}else if(t.nodeType){if(F.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=ct(e,n,r,t);ct(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Zn(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Zn(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Zn(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function Co(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ct(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Fa(){const e=F.context;return`${e.id}${e.count++}`}const Na=!1,Ka="http://www.w3.org/2000/svg";function Oo(e,t=!1){return t?document.createElementNS(Ka,e):document.createElement(e)}function _o(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=uo();let i,s=!!F.context;return M(()=>{s&&(uo().user=s=!1),i||(i=la(o,()=>O(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=_(!1),u=()=>c(!0);Le(d=>A(a,()=>l()?d():i(),null)),B(u)}else{const l=Oo(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),B(()=>a.removeChild(l))}},void 0,{render:!s}),n}function tn(e){const[t,n]=H(e,["component"]),r=O(()=>t.component);return O(()=>{const o=r();switch(typeof o){case"function":return W(()=>o(n));case"string":const i=Oa.has(o),s=F.context?Ia():Oo(o,i);return Qe(s,n,i),s}})}function Ba(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=_(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function za(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Va(e){return(t,n)=>{const{element:r}=n;return Le(o=>{const i=Ba(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},za(r))}}function Ua(e,t,n){return arguments.length===2&&(n=t,t={}),oa(e,t)(Va(n))}const ja='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance: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{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-5{left:1.25rem}.left-9{left:2.25rem}.right-5{right:1.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[98\\%\\]{width:98%}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--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(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[Po,Qn]=_(!1),Ao=[],Ha=e=>Ao.push(e),To=()=>{Ao.forEach(e=>e())},qa=()=>{Qn(!Po()),To()},Wa=()=>{Qn(!1)},Ga=()=>{Qn(!0),To()},Mo=()=>({bubble:Po,show:Ga,hide:Wa,toggle:qa,onOpen:Ha}),er=Symbol("store-raw"),ut=Symbol("store-node"),Re=Symbol("store-has"),Do=Symbol("store-self");function Lo(e){let t=e[me];if(!t&&(Object.defineProperty(e,me,{value:t=new Proxy(e,Ja)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function nn(e){let t;return e!=null&&typeof e=="object"&&(e[me]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function At(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[er])return n;if(!nn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=At(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=At(o,t))!==o&&(e[i]=r))}return e}function rn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Tt(e,t,n){if(e[t])return e[t];const[r,o]=_(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ya(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===me||t===ut||(delete n.value,delete n.writable,n.get=()=>e[me][t]),n}function Io(e){qn()&&Tt(rn(e,ut),Do)()}function Xa(e){return Io(e),Reflect.ownKeys(e)}const Ja={get(e,t,n){if(t===er)return e;if(t===me)return n;if(t===Vn)return Io(e),n;const r=rn(e,ut),o=r[t];let i=o?o():e[t];if(t===ut||t===Re||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);qn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Tt(r,t,i)())}return nn(i)?Lo(i):i},has(e,t){return t===er||t===me||t===Vn||t===ut||t===Re||t==="__proto__"?!0:(qn()&&Tt(rn(e,Re),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Xa,getOwnPropertyDescriptor:Ya};function on(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Re]&&e[Re][t]&&o!==void 0&&e[Re][t].$()):(e[t]=n,e[Re]&&e[Re][t]&&o===void 0&&e[Re][t].$());let s=rn(e,ut),a;if((a=Tt(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Tt(s,"length",i))&&a.$(e.length)}(a=s[Do])&&a.$()}function Ro(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];on(e,o,t[o])}}function Za(e,t){if(typeof t=="function"&&(t=t(e)),t=At(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&on(e,n,o)}on(e,"length",r)}else Ro(e,t)}function Mt(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Mt(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Mt(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let d=l;d<=c;d+=u)Mt(e,[d].concat(t),n);return}else if(t.length>1){Mt(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=At(i),r===void 0||nn(o)&&nn(i)&&!Array.isArray(i)?Ro(o,i):on(e,r,i))}function Qa(...[e,t]){const n=At(e||{}),r=Array.isArray(n),o=Lo(n);function i(...s){Se(()=>{r&&s.length===1?Za(n,s[0]):Mt(n,s)})}return[o,i]}function $o(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Fo(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function No(e,t,n){return Le(()=>{const r=Fo(e),[o,i]=Qa(r?JSON.parse(r):t);return M(()=>$o(e,JSON.stringify(o),n)),[o,i]})}function el(e,t,n){return Le(()=>{const r=Fo(e),[o,i]=_(r?JSON.parse(r):t);return M(()=>$o(e,JSON.stringify(o()),n)),[o,i]})}el("lang","en");function Ko(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ko(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ko(e))&&(r&&(r+=" "),r+=t);return r}const tr="-";function nl(e){const t=ol(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(tr);return a[0]===""&&a.length!==1&&a.shift(),Bo(a,t)||rl(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Bo(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Bo(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(tr);return t.validators.find(({validator:s})=>s(i))?.classGroupId}const zo=/^\[(.+)\]$/;function rl(e){if(zo.test(e)){const t=zo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function ol(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sl(Object.entries(e.classGroups),n).forEach(([i,s])=>{nr(s,r,i,t)}),r}function nr(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Vo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(il(o)){nr(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{nr(s,Vo(t,i),n,r)})})}function Vo(e,t){let n=e;return t.split(tr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function il(e){return e.isThemeGetter}function sl(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function al(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const Uo="!";function ll(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===r&&(n||s.slice(g,g+o)===t)){a.push(s.slice(c,g)),c=g+o;continue}if(y==="/"){u=g;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),h=d.startsWith(Uo),m=h?d.substring(1):d,f=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:f}}}function cl(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function ul(e){return{cache:al(e.cacheSize),splitModifiers:ll(e),...nl(e)}}const dl=/\s+/;function fl(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(dl).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),h=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};h=!1}const m=cl(a).join(":");return{isTailwindClass:!0,modifierId:l?m+Uo:m,classGroupId:d,originalClassName:s,hasPostfixModifier:h}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function hl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=jo(t))&&(r&&(r+=" "),r+=n);return r}function jo(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=jo(e[r]))&&(n&&(n+=" "),n+=t);return n}function gl(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=ul(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=fl(l,n);return o(l,u),u}return function(){return i(hl.apply(null,arguments))}}function Y(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Ho=/^\[(?:([a-z-]+):)?(.+)\]$/i,pl=/^\d+\/\d+$/,ml=new Set(["px","full","screen"]),yl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vl=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function $e(e){return et(e)||ml.has(e)||pl.test(e)}function Ve(e){return dt(e,"length",Al)}function et(e){return!!e&&!Number.isNaN(Number(e))}function sn(e){return dt(e,"number",et)}function Dt(e){return!!e&&Number.isInteger(Number(e))}function Sl(e){return e.endsWith("%")&&et(e.slice(0,-1))}function N(e){return Ho.test(e)}function Ue(e){return yl.test(e)}const El=new Set(["length","size","percentage"]);function kl(e){return dt(e,El,qo)}function Cl(e){return dt(e,"position",qo)}const Ol=new Set(["image","url"]);function _l(e){return dt(e,Ol,Ml)}function Pl(e){return dt(e,"",Tl)}function Lt(){return!0}function dt(e,t,n){const r=Ho.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Al(e){return bl.test(e)&&!wl.test(e)}function qo(){return!1}function Tl(e){return vl.test(e)}function Ml(e){return xl.test(e)}function Dl(){const e=Y("colors"),t=Y("spacing"),n=Y("blur"),r=Y("brightness"),o=Y("borderColor"),i=Y("borderRadius"),s=Y("borderSpacing"),a=Y("borderWidth"),l=Y("contrast"),c=Y("grayscale"),u=Y("hueRotate"),d=Y("invert"),h=Y("gap"),m=Y("gradientColorStops"),f=Y("gradientColorStopPositions"),g=Y("inset"),y=Y("margin"),w=Y("opacity"),b=Y("padding"),v=Y("saturate"),x=Y("scale"),P=Y("sepia"),S=Y("skew"),k=Y("space"),R=Y("translate"),C=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",N,t],D=()=>[N,t],oe=()=>["",$e,Ve],X=()=>["auto",et,N],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],ie=()=>["start","end","center","between","around","evenly","stretch"],ze=()=>["","0",N],Kn=()=>["auto","avoid","all","avoid-page","page","left","right","column"],it=()=>[et,sn],Ct=()=>[et,N];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[$e,Ve],blur:["none","",Ue,N],brightness:it(),borderColor:[e],borderRadius:["none","","full",Ue,N],borderSpacing:D(),borderWidth:oe(),contrast:it(),grayscale:ze(),hueRotate:Ct(),invert:ze(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Sl,Ve],inset:I(),margin:I(),opacity:it(),padding:D(),saturate:it(),scale:it(),sepia:ze(),skew:Ct(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[Ue]}],"break-after":[{"break-after":Kn()}],"break-before":[{"break-before":Kn()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...te(),N]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dt,N]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ze()}],shrink:[{shrink:ze()}],order:[{order:["first","last","none",Dt,N]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Dt,N]},N]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Dt,N]},N]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[Ue]},Ue]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ue,Ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sn]}],"font-family":[{font:[Lt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",et,sn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$e,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$e,Ve]}],"underline-offset":[{"underline-offset":["auto",$e,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...te(),Cl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_l]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[$e,N]}],"outline-w":[{outline:[$e,Ve]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[$e,Ve]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ue,Pl]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":U()}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ue,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Ct()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ct()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Dt,N]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$e,Ve,sn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Ll=gl(Dl);function je(...e){return Ll(tl(e))}function Il(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",an(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",an(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",an(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",an(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function an(e){let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Rl(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function $l(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function ln(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Fl={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function ft(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Fl[n][e]}const rr="https://heimdall.smarttalks.ai/api",Nl="wss://heimdall.smarttalks.ai";function Kl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function Bl(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const zl=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${rr}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();return i.type==="flow"?Kl(i):i.type==="entity"?Bl(i):(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),i._id=n,i)},[Wo,Vl]=_(""),[ht]=Le(()=>co(Wo,zl)),Ul=()=>{if(ht()?.type==="chat")return ht()},jl=()=>{if(ht()?.type==="form")return ht()};Le(()=>M(()=>Il(ht())));const ee=()=>({widgetId:Wo,setWidgetId:Vl,widget:ht,chatWidget:Ul,formWidget:jl});function Go(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Go(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Hl(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Go(e))&&(r&&(r+=" "),r+=t);return r}const Yo=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Xo=Hl,ql=(e,t)=>n=>{var r;if(t?.variants==null)return Xo(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],d=i?.[c];if(u===null)return null;const h=Yo(u)||Yo(d);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...m}=u;return Object.entries(m).every(f=>{let[g,y]=f;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,d,h]:c},[]);return Xo(e,s,l,n?.class,n?.className)};var Wl=L("<button>");const Gl=ql("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ye=e=>{const[,t]=H(e,["variant","size","class"]);return(()=>{var n=Wl();return Qe(n,T({get class(){return je(Gl({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Yl=L('<img alt="widget logo">');const Jo=e=>{const[,t]=H(e,["class","src"]);return(()=>{var n=Yl();return Qe(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return je("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Xl=L('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const Jl=()=>{const{chatWidget:e}=ee();return(()=>{var t=Xl(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,p(Jo,{get src(){return e()?.avatar}}),n),A(r,()=>e()?.title??"Izi"),A(o,()=>e()?.subtitle??"SmartTalks.ai"),t})()};var Zl=L("<svg stroke-width=0>");function le(e,t){const n=T(e.a,t),[r,o]=H(n,["src"]),[i,s]=_(""),a=O(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return M(()=>s(a())),B(()=>{s("")}),(()=>{var l=Zl();return Qe(l,T({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),A(l,()=>Na),l})()}function Ql(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function ec(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function tc(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function nc(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}function rc(e){return(...t)=>{for(const n of e)n&&n(...t)}}var E=e=>typeof e=="function"&&!e.length?e():e,Zo=e=>Array.isArray(e)?e:e?[e]:[];function oc(e,...t){return typeof e=="function"?e(...t):e}var ic=B;function sc(e,t,n,r){return e.addEventListener(t,n,r),ic(e.removeEventListener.bind(e,t,n,r))}function ac(e,t,n,r){const o=()=>{Zo(E(e)).forEach(i=>{i&&Zo(E(t)).forEach(s=>sc(i,s,n,r))})};typeof e=="function"?M(o):Q(o)}var Qo={equals:!1};function lc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function cc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var or=e=>typeof e=="function"&&!e.length?e():e;function cn(){return!0}var uc={get(e,t,n){return t===me?n:e.get(t)},has(e,t){return e.has(t)},set:cn,deleteProperty:cn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:cn,deleteProperty:cn}},ownKeys(e){return e.keys()}},dc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ei(e){const t={};let n;for(;n=dc.exec(e);)t[n[1]]=n[2];return t}function fc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ei(e)}else typeof t=="string"&&(t=ei(t));return{...e,...t}}var ir=(e,t,n)=>{let r;for(const o of e){const i=or(o)[t];r?i&&(r=n(r,i)):r=i}return r};function hc(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?cc:lc,o={};for(const s of n){const a=or(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],u=l.toLowerCase(),d=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=T(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ir(n,"style",fc);if(s==="ref"){const a=[];for(const l of n){const c=or(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?ir(n,s,(a,l)=>`${a} ${l}`):s==="classList"?ir(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},uc)}function tt(...e){return rc(e)}function gc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function sr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pc(e){return typeof e=="number"}function mc(e){return Array.isArray(e)}function gt(e){return Object.prototype.toString.call(e)==="[object String]"}function yc(e){return typeof e=="function"}function ti(e){return t=>`${e()}-${t}`}function Oe(e,t){return e?e===t||e.contains(t):!1}function It(e,t=!1){const{activeElement:n}=Fe(e);if(!n?.nodeName)return null;if(ni(n)&&n.contentDocument)return It(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Fe(n).getElementById(r);if(o)return o}}return n}function Fe(e){return e?e.ownerDocument||e:document}function ni(e){return e.tagName==="IFRAME"}var ri=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ri||{});function ar(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function un(){return ar(/^Mac/i)}function bc(){return ar(/^iPhone/i)}function wc(){return ar(/^iPad/i)||un()&&navigator.maxTouchPoints>1}function vc(){return bc()||wc()}function xc(){return un()||vc()}function de(e,t){return t&&(yc(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function be(e){return t=>{for(const n of e)de(t,n)}}function Sc(e){return un()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function ce(e){if(e)if(Ec())e.focus({preventScroll:!0});else{const t=kc(e);e.focus(),Cc(t)}}var dn=null;function Ec(){if(dn==null){dn=!1;try{document.createElement("div").focus({get preventScroll(){return dn=!0,!0}})}catch{}}return dn}function kc(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Cc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var oi=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Oc=[...oi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],lr=oi.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",_c=Oc.join(':not([hidden]):not([tabindex="-1"]),');function ii(e,t){const r=Array.from(e.querySelectorAll(lr)).filter(si);return t&&si(e)&&r.unshift(e),r.forEach((o,i)=>{if(ni(o)&&o.contentDocument){const s=o.contentDocument.body,a=ii(s,!1);r.splice(i,1,...a)}}),r}function si(e){return ai(e)&&!Pc(e)}function ai(e){return e.matches(lr)&&cr(e)}function Pc(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function cr(e,t){return e.nodeName!=="#comment"&&Ac(e)&&Tc(e,t)&&(!e.parentElement||cr(e.parentElement,e))}function Ac(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Tc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Mc(e,t){return t.some(n=>n.contains(e))}function Dc(e,t,n){const r=t?.tabbable?_c:lr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&cr(i)&&(!n||Mc(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function li(e){for(;e&&!Lc(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function Lc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Ic(){}function Rc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[d,h]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],f=(u-h)*(n-c)-(c-d)*(r-u);if(h<u){if(r>=h&&r<u){if(f===0)return!0;f>0&&(r===h?r>m&&(o=!o):o=!o)}}else if(u<h){if(r>u&&r<=h){if(f===0)return!0;f<0&&(r===h?r<m&&(o=!o):o=!o)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function _e(e,t){return T(e,t)}var Rt=new Map,ci=new Set;function ui(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Rt.get(n.target);r||(r=new Set,Rt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Rt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Rt.delete(n.target)),Rt.size===0)){for(const o of ci)o();ci.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?ui():document.addEventListener("DOMContentLoaded",ui));function ur(e,t){const n=di(e,t,"left"),r=di(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function di(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function $c(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=li(e);for(;e&&o&&e!==n&&o!==n;)ur(o,e),e=o,o=li(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}var Fc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function dr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=gt(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=gt(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(gt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return gt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(gt(l)||pc(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=dr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
1
+ (function(qt){typeof define=="function"&&define.amd?define(qt):qt()})(function(){"use strict";function qt(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),ao(o.value)&&!ta(o.value)&&!Array.isArray(o.value)&&(n[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(n[r].value=o.value.slice(0)),n},{})}function Js(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=ao(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=ea(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Zs(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Qs(e,t){const n=qt(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s&&(i.value=i.parse?io(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&so(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(l){const c=i.value;i.value=l,i.reflect&&so(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,l,c)},enumerable:!0,configurable:!0})}),n}function io(e){if(e)try{return JSON.parse(e)}catch{return e}}function so(e,t,n,r){if(n==null||n===!1)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function ea(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function ao(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function ta(e){return Object.prototype.toString.call(e)==="[object Function]"}function na(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let Un;function ra(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(o=>t[o].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=Qs(this,t);const o=Zs(this.props),i=this.Component,s=Un;try{Un=this,this.__initialized=!0,na(i)?new i(o,{element:this}):i(o,{element:this})}finally{Un=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let o=null;for(;o=this.__releaseCallbacks.pop();)o(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(o,i,s){if(this.__initialized&&!this.__updating[o]&&(o=this.lookupProp(o),o in t)){if(s==null&&!this[o])return;this[o]=t[o].parse?io(s):s}}lookupProp(o){if(t)return n.find(i=>o===i||o===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(o){this.__releaseCallbacks.push(o)}addPropertyChangedCallback(o){this.__propertyChangedCallbacks.push(o)}}}function oa(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{if(!e)throw new Error("tag is required to register a Component");let a=i.get(e);return a?(a.prototype.Component=s,a):(a=ra(r,Js(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const F={context:void 0,registry:void 0};function Ot(e){F.context=e}const ia=(e,t)=>e===t,me=Symbol("solid-proxy"),jn=Symbol("solid-track"),Wt={equals:ia};let lo=po;const Me=1,Gt=2,co={owned:null,cleanups:null,context:null,owner:null},Hn={};var q=null;let qn=null,sa=null,G=null,ne=null,De=null,Yt=0;function Le(e,t){const n=G,r=q,o=e.length===0,i=t===void 0?r:t,s=o?co:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>W(()=>Qt(s)));q=s,G=null;try{return Ie(a,!0)}finally{G=n,q=r}}function P(e,t){t=t?Object.assign({},Wt,t):Wt;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),go(n,o));return[ho.bind(n),r]}function Wn(e,t,n){const r=Xt(e,t,!0,Me);it(r)}function Q(e,t,n){const r=Xt(e,t,!1,Me);it(r)}function M(e,t,n){lo=fa;const r=Xt(e,t,!1,Me);(!n||!n.render)&&(r.user=!0),De?De.push(r):it(r)}function O(e,t,n){n=n?Object.assign({},Wt,n):Wt;const r=Xt(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,it(r),ho.bind(r)}function aa(e){return e&&typeof e=="object"&&"then"in e}function uo(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=Hn,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&O(r);const h=new Set,[m,f]=(i.storage||P)(i.initialValue),[g,y]=P(void 0),[w,b]=P(void 0,{equals:!1}),[v,x]=P(u?"ready":"unresolved");if(F.context){l=`${F.context.id}${F.context.count++}`;let C;i.ssrLoadFrom==="initial"?a=i.initialValue:F.load&&(C=F.load(l))&&(a=C)}function _(C,K,I,D){return s===C&&(s=null,D!==void 0&&(u=!0),(C===a||K===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(D,{value:K})),a=Hn,S(K,I)),K}function S(C,K){Ie(()=>{K===void 0&&f(()=>C),x(K!==void 0?"errored":u?"ready":"unresolved"),y(K);for(const I of h.keys())I.decrement();h.clear()},!1)}function k(){const C=ca,K=m(),I=g();if(I!==void 0&&!s)throw I;return G&&!G.user&&C&&Wn(()=>{w(),s&&(C.resolved||h.has(C)||(C.increment(),h.add(C)))}),K}function R(C=!0){if(C!==!1&&c)return;c=!1;const K=d?d():r;if(K==null||K===!1){_(s,W(m));return}const I=a!==Hn?a:W(()=>o(K,{value:m(),refetching:C}));return aa(I)?(s=I,"value"in I?(I.status==="success"?_(s,I.value,void 0,K):_(s,void 0,void 0,K),I):(c=!0,queueMicrotask(()=>c=!1),Ie(()=>{x(u?"refreshing":"pending"),b()},!1),I.then(D=>_(I,D,void 0,K),D=>_(I,void 0,yo(D),K)))):(_(s,I,void 0,K),I)}return Object.defineProperties(k,{state:{get:()=>v()},error:{get:()=>g()},loading:{get(){const C=v();return C==="pending"||C==="refreshing"}},latest:{get(){if(!u)return k();const C=g();if(C&&!s)throw C;return m()}}}),d?Wn(()=>R(!1)):R(!1),[k,{refetch:R,mutate:f}]}function Se(e){return Ie(e,!1)}function W(e){if(G===null)return e();const t=G;G=null;try{return e()}finally{G=t}}function Je(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=W(()=>t(a,o,s));return o=a,l}}function Pt(e){M(()=>W(e))}function B(e){return q===null||(q.cleanups===null?q.cleanups=[e]:q.cleanups.push(e)),e}function Gn(){return G}function fo(){return q}function la(e,t){const n=q,r=G;q=e,G=null;try{return Ie(t,!0)}catch(o){Xn(o)}finally{q=n,G=r}}function se(e,t){const n=Symbol("context");return{id:n,Provider:ha(n),defaultValue:e}}function ue(e){return q&&q.context&&q.context[e.id]!==void 0?q.context[e.id]:e.defaultValue}function Yn(e){const t=O(e),n=O(()=>Jn(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let ca;function ho(){if(this.sources&&this.state)if(this.state===Me)it(this);else{const e=ne;ne=null,Ie(()=>Zt(this),!1),ne=e}if(G){const e=this.observers?this.observers.length:0;G.sources?(G.sources.push(this),G.sourceSlots.push(e)):(G.sources=[this],G.sourceSlots=[e]),this.observers?(this.observers.push(G),this.observerSlots.push(G.sources.length-1)):(this.observers=[G],this.observerSlots=[G.sources.length-1])}return this.value}function go(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ie(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=qn&&qn.running;s&&qn.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?ne.push(i):De.push(i),i.observers&&mo(i)),s||(i.state=Me)}if(ne.length>1e6)throw ne=[],new Error},!1)),t}function it(e){if(!e.fn)return;Qt(e);const t=Yt;ua(e,e.value,t)}function ua(e,t,n){let r;const o=q,i=G;G=q=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Me,e.owned&&e.owned.forEach(Qt),e.owned=null),e.updatedAt=n+1,Xn(s)}finally{G=i,q=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?go(e,r):e.value=r,e.updatedAt=n)}function Xt(e,t,n,r=Me,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:q,context:q?q.context:null,pure:n};return q===null||q!==co&&(q.owned?q.owned.push(i):q.owned=[i]),i}function Jt(e){if(e.state===0)return;if(e.state===Gt)return Zt(e);if(e.suspense&&W(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Yt);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Me)it(e);else if(e.state===Gt){const r=ne;ne=null,Ie(()=>Zt(e,t[0]),!1),ne=r}}function Ie(e,t){if(ne)return e();let n=!1;t||(ne=[]),De?n=!0:De=[],Yt++;try{const r=e();return da(n),r}catch(r){n||(De=null),ne=null,Xn(r)}}function da(e){if(ne&&(po(ne),ne=null),e)return;const t=De;De=null,t.length&&Ie(()=>lo(t),!1)}function po(e){for(let t=0;t<e.length;t++)Jt(e[t])}function fa(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jt(r)}if(F.context){if(F.count){F.effects||(F.effects=[]),F.effects.push(...e.slice(0,n));return}else F.effects&&(e=[...F.effects,...e],n+=F.effects.length,delete F.effects);Ot()}for(t=0;t<n;t++)Jt(e[t])}function Zt(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===Me?r!==t&&(!r.updatedAt||r.updatedAt<Yt)&&Jt(r):o===Gt&&Zt(r,t)}}}function mo(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Gt,n.pure?ne.push(n):De.push(n),n.observers&&mo(n))}}function Qt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Qt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function yo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Xn(e,t=q){throw yo(e)}function Jn(e){if(typeof e=="function"&&!e.length)return Jn(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Jn(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function ha(e,t){return function(r){let o;return Q(()=>o=W(()=>(q.context={...q.context,[e]:r.value},Yn(()=>r.children))),void 0),o}}const ga=Symbol("fallback");function bo(e){for(let t=0;t<e.length;t++)e[t]()}function pa(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return B(()=>bo(i)),()=>{let l=e()||[],c,u;return l[jn],W(()=>{let h=l.length,m,f,g,y,w,b,v,x,_;if(h===0)s!==0&&(bo(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[ga],o[0]=Le(S=>(i[0]=S,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=Le(d);s=h}else{for(g=new Array(h),y=new Array(h),a&&(w=new Array(h)),b=0,v=Math.min(s,h);b<v&&r[b]===l[b];b++);for(v=s-1,x=h-1;v>=b&&x>=b&&r[v]===l[x];v--,x--)g[x]=o[v],y[x]=i[v],a&&(w[x]=a[v]);for(m=new Map,f=new Array(x+1),u=x;u>=b;u--)_=l[u],c=m.get(_),f[u]=c===void 0?-1:c,m.set(_,u);for(c=b;c<=v;c++)_=r[c],u=m.get(_),u!==void 0&&u!==-1?(g[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=f[u],m.set(_,u)):i[c]();for(u=b;u<h;u++)u in g?(o[u]=g[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=Le(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[m,f]=P(u);return a[u]=f,t(l[u],m)}return t(l[u])}}}function p(e,t){return W(()=>e(t||{}))}function en(){return!0}const Zn={get(e,t,n){return t===me?n:e.get(t)},has(e,t){return t===me?!0:e.has(t)},set:en,deleteProperty:en,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:en,deleteProperty:en}},ownKeys(e){return e.keys()}};function Qn(e){return(e=typeof e=="function"?e():e)?e:{}}function ma(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function T(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&me in a,e[s]=typeof a=="function"?(t=!0,O(a)):a}if(t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Qn(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Qn(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Qn(e[a])));return[...new Set(s)]}},Zn);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:ma.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const h=n[u];h&&(d.get?h.push(d.get.bind(a)):d.value!==void 0&&h.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function H(e,...t){if(me in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Zn));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},Zn)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function ya(e){let t,n;const r=o=>{const i=F.context;if(i){const[a,l]=P();F.count||(F.count=0),F.count++,(n||(n=e())).then(c=>{Ot(i),F.count--,l(()=>c.default),Ot()}),t=a}else if(!t){const[a]=uo(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return O(()=>(s=t())&&W(()=>{if(!i)return s(o);const a=F.context;Ot(i);const l=s(o);return Ot(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}let ba=0;function Ce(){const e=F.context;return e?`${e.id}${e.count++}`:`cl-${ba++}`}const wo=e=>`Stale read from <${e}>.`;function st(e){const t="fallback"in e&&{fallback:()=>e.fallback};return O(pa(()=>e.each,e.children,t||void 0))}function J(e){const t=e.keyed,n=O(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return O(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?W(()=>o(t?r:()=>{if(!W(n))throw wo("Show");return e.when})):o}return e.fallback},void 0,void 0)}function vo(e){let t=!1;const n=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=Yn(()=>e.children),o=O(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return O(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?W(()=>l(t?s:()=>{if(W(o)[0]!==i)throw wo("Match");return a.when})):l},void 0,void 0)}function _t(e){return e}const wa=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],va=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...wa]),xa=new Set(["innerHTML","textContent","innerText","children"]),Sa=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Ea=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ka(e,t){const n=Ea[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Ca=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Oa=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Pa={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function _a(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,m;for(;++d<o&&d<i&&!((m=c.get(t[d]))==null||m!==u+h);)h++;if(h>u-a){const f=t[s];for(;a<u;)e.insertBefore(n[a++],f)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const xo="_$DX_DELEGATE";function L(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>W(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Aa(e,t=window.document){const n=t[xo]||(t[xo]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,$a))}}function ae(e,t,n){F.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Ta(e,t,n,r){F.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function at(e,t){F.context||(t==null?e.removeAttribute("class"):e.className=t)}function Ma(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function Da(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Eo(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Eo(e,a,!0),n[a]=l)}return n}function tn(e,t,n){if(!t)return n?ae(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Ze(e,t={},n,r){const o={};return r||Q(()=>o.children=lt(e,t.children,o.children)),Q(()=>t.ref&&t.ref(e)),Q(()=>La(e,t,n,!0,o,!0)),o}function So(e,t,n){return W(()=>e(t,n))}function A(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return lt(e,t,r,n);Q(o=>lt(e,t(),o,n),r)}function La(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=ko(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||lt(e,t.children);continue}const a=t[s];o[s]=ko(e,s,a,o[s],n,i)}}function Ia(e){let t,n;return!F.context||!(t=F.registry.get(n=Fa()))?e():(F.completed&&F.completed.add(t),F.registry.delete(n),t)}function Ra(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Eo(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function ko(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return tn(e,n,r);if(t==="classList")return Da(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=Ca.has(d);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(d,m)}(h||n)&&(Ma(e,d,n,h),h&&Aa([d]))}else if(t.slice(0,5)==="attr:")ae(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=xa.has(t))||!o&&((c=ka(t,e.tagName))||(a=va.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(F.context)return n;t==="class"||t==="className"?at(e,n):s&&!a&&!l?e[Ra(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&Pa[t.split(":")[0]];d?Ta(e,d,t,n):ae(e,Sa[t]||t,n)}return n}function $a(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),F.registry&&!F.done&&(F.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function lt(e,t,n,r,o){if(F.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(F.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=ct(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(F.context)return n;n=ct(e,n,r)}else{if(i==="function")return Q(()=>{let a=t();for(;typeof a=="function";)a=a();n=lt(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(er(a,t,n,o))return Q(()=>n=lt(e,a,n,r,!0)),()=>n;if(F.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=ct(e,n,r),s)return n}else l?n.length===0?Co(e,a,r):_a(e,n,a):(n&&ct(e),Co(e,a));n=a}else if(t.nodeType){if(F.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=ct(e,n,r,t);ct(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function er(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=er(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=er(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function Co(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ct(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Fa(){const e=F.context;return`${e.id}${e.count++}`}const Na=!1,Ka="http://www.w3.org/2000/svg";function Oo(e,t=!1){return t?document.createElementNS(Ka,e):document.createElement(e)}function Po(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=fo();let i,s=!!F.context;return M(()=>{s&&(fo().user=s=!1),i||(i=la(o,()=>O(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=P(!1),u=()=>c(!0);Le(d=>A(a,()=>l()?d():i(),null)),B(u)}else{const l=Oo(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),A(c,i),a.appendChild(l),e.ref&&e.ref(l),B(()=>a.removeChild(l))}},void 0,{render:!s}),n}function nn(e){const[t,n]=H(e,["component"]),r=O(()=>t.component);return O(()=>{const o=r();switch(typeof o){case"function":return W(()=>o(n));case"string":const i=Oa.has(o),s=F.context?Ia():Oo(o,i);return Ze(s,n,i),s}})}function Ba(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=P(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function za(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Va(e){return(t,n)=>{const{element:r}=n;return Le(o=>{const i=Ba(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return A(r.renderRoot,s)},za(r))}}function Ua(e,t,n){return arguments.length===2&&(n=t,t={}),oa(e,t)(Va(n))}const ja='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance: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{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--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-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--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-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-9{left:2.25rem}.right-9{right:2.25rem}.z-50{z-index:50}.m-0{margin:0}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-\\[-1rem\\]{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-2{width:.5rem;height:.5rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\\[85vh\\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[80\\%\\]{max-height:80%}.max-h-full{max-height:100%}.min-h-16{min-height:4rem}.w-11\\/12{width:91.666667%}.w-4{width:1rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\\[100px\\]{width:100px}.w-\\[90vw\\]{width:90vw}.w-\\[98\\%\\]{width:98%}.w-\\[calc\\(var\\(--reference-width\\)-\\(0\\.75rem\\*2\\)\\)\\]{width:calc(var(--reference-width) - (.75rem * 2))}.w-full{width:100%}.min-w-\\[8rem\\]{min-width:8rem}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-\\[var\\(--kb-menu-content-transform-origin\\)\\]{transform-origin:var(--kb-menu-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes content-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.96)}}.animate-content-hide{animation:content-hide .2s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.place-self-start{place-self:start}.place-self-end{place-self:end}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-nowrap{text-wrap:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-xl{border-top-left-radius:calc(var(--radius) + 4px);border-bottom-left-radius:calc(var(--radius) + 4px)}.rounded-r-xl{border-top-right-radius:calc(var(--radius) + 4px);border-bottom-right-radius:calc(var(--radius) + 4px)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-xl{border-top-left-radius:calc(var(--radius) + 4px)}.rounded-tr-xl{border-top-right-radius:calc(var(--radius) + 4px)}.border{border-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-black\\/50{background-color:#00000080}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-200\\/40{background-color:#e2e8f066}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/40{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-300{transition-delay:.3s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-80{--tw-enter-opacity: .8}.duration-300{animation-duration:.3s}.delay-150{animation-delay:.15s}.delay-300{animation-delay:.3s}#smarttalks-widget{--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 346.8 77.2% 49.8%;--radius: .5rem}@media (max-width: 640px){.container{padding-left:1rem;padding-right:1rem}}::-webkit-scrollbar{width:.5rem;height:.4rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:var(--radius);--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-x-0:after{content:var(--tw-content);left:0;right:0}.after\\:top-full:after{content:var(--tw-content);top:100%}.after\\:h-\\[50\\%\\]:after{content:var(--tw-content);height:50%}.after\\:bg-inherit:after{content:var(--tw-content);background-color:inherit}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-accent\\/10:hover{background-color:hsl(var(--accent) / .1)}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-primary:hover{--tw-shadow-color: hsl(var(--primary));--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-50:hover{--tw-brightness: brightness(.5);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--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(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[1\\.5px\\]:focus-visible{--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(1.5px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-\\[\\[data-range-end\\]\\]\\:rounded-r-md:has([data-range-end]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-range-start\\]\\]\\:rounded-l-md:has([data-range-start]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:bg-accent:has([data-in-range]){background-color:hsl(var(--accent))}.has-\\[\\[data-outside-range\\]\\[data-in-range\\]\\]\\:bg-accent\\/50:has([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.has-\\[\\[data-in-range\\]\\]\\:first-of-type\\:rounded-l-md:first-of-type:has([data-in-range]){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.has-\\[\\[data-in-range\\]\\]\\:last-of-type\\:rounded-r-md:last-of-type:has([data-in-range]){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes content-show{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.data-\\[expanded\\]\\:animate-content-show[data-expanded]{animation:content-show .2s ease-out}.data-\\[selected\\]\\:bg-primary[data-selected]{background-color:hsl(var(--primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open],.data-\\[today\\]\\:bg-accent[data-today]{background-color:hsl(var(--accent))}.data-\\[disabled\\]\\:text-muted-foreground[data-disabled],.data-\\[outside-range\\]\\:text-muted-foreground[data-outside-range]{color:hsl(var(--muted-foreground))}.data-\\[selected\\]\\:text-primary-foreground[data-selected]{color:hsl(var(--primary-foreground))}.data-\\[today\\]\\:text-accent-foreground[data-today]{color:hsl(var(--accent-foreground))}.data-\\[disabled\\]\\:opacity-50[data-disabled],.data-\\[outside-range\\]\\:opacity-50[data-outside-range]{opacity:.5}.data-\\[selected\\]\\:opacity-100[data-selected]{opacity:1}.data-\\[transitioning\\]\\:transition-colors[data-transitioning]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:transition-transform[data-transitioning]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{transition-duration:.3s}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[transitioning\\]\\:duration-300[data-transitioning]{animation-duration:.3s}.data-\\[selected\\]\\:hover\\:bg-primary:hover[data-selected]{background-color:hsl(var(--primary))}.data-\\[selected\\]\\:hover\\:text-primary-foreground:hover[data-selected]{color:hsl(var(--primary-foreground))}@media (min-width: 640px){.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[min\\(100vw\\,400px\\)\\]{width:min(100vw,400px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:bg-accent\\/50:is([data-outside-range][data-in-range]){background-color:hsl(var(--accent) / .5)}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:text-muted-foreground:is([data-outside-range][data-in-range]){color:hsl(var(--muted-foreground))}.\\[\\&\\:is\\(\\[data-outside-range\\]\\[data-in-range\\]\\)\\]\\:opacity-30:is([data-outside-range][data-in-range]){opacity:.3}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:bg-primary:is([data-today][data-selected]){background-color:hsl(var(--primary))}.\\[\\&\\:is\\(\\[data-today\\]\\[data-selected\\]\\)\\]\\:text-primary-foreground:is([data-today][data-selected]){color:hsl(var(--primary-foreground))}',[_o,tr]=P(!1),Ao=[],Ha=e=>Ao.push(e),To=()=>{Ao.forEach(e=>e())},qa=()=>{tr(!_o()),To()},Wa=()=>{tr(!1)},Ga=()=>{tr(!0),To()},Mo=()=>({bubble:_o,show:Ga,hide:Wa,toggle:qa,onOpen:Ha}),nr=Symbol("store-raw"),ut=Symbol("store-node"),Re=Symbol("store-has"),Do=Symbol("store-self");function Lo(e){let t=e[me];if(!t&&(Object.defineProperty(e,me,{value:t=new Proxy(e,Ja)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function rn(e){let t;return e!=null&&typeof e=="object"&&(e[me]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function At(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[nr])return n;if(!rn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=At(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=At(o,t))!==o&&(e[i]=r))}return e}function on(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Tt(e,t,n){if(e[t])return e[t];const[r,o]=P(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ya(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===me||t===ut||(delete n.value,delete n.writable,n.get=()=>e[me][t]),n}function Io(e){Gn()&&Tt(on(e,ut),Do)()}function Xa(e){return Io(e),Reflect.ownKeys(e)}const Ja={get(e,t,n){if(t===nr)return e;if(t===me)return n;if(t===jn)return Io(e),n;const r=on(e,ut),o=r[t];let i=o?o():e[t];if(t===ut||t===Re||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Gn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Tt(r,t,i)())}return rn(i)?Lo(i):i},has(e,t){return t===nr||t===me||t===jn||t===ut||t===Re||t==="__proto__"?!0:(Gn()&&Tt(on(e,Re),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Xa,getOwnPropertyDescriptor:Ya};function sn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Re]&&e[Re][t]&&o!==void 0&&e[Re][t].$()):(e[t]=n,e[Re]&&e[Re][t]&&o===void 0&&e[Re][t].$());let s=on(e,ut),a;if((a=Tt(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Tt(s,"length",i))&&a.$(e.length)}(a=s[Do])&&a.$()}function Ro(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];sn(e,o,t[o])}}function Za(e,t){if(typeof t=="function"&&(t=t(e)),t=At(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&sn(e,n,o)}sn(e,"length",r)}else Ro(e,t)}function Mt(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Mt(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Mt(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let d=l;d<=c;d+=u)Mt(e,[d].concat(t),n);return}else if(t.length>1){Mt(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=At(i),r===void 0||rn(o)&&rn(i)&&!Array.isArray(i)?Ro(o,i):sn(e,r,i))}function Qa(...[e,t]){const n=At(e||{}),r=Array.isArray(n),o=Lo(n);function i(...s){Se(()=>{r&&s.length===1?Za(n,s[0]):Mt(n,s)})}return[o,i]}function $o(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Fo(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),r=new Date;return n.ttl!==0&&r.getTime()>n.ttl?(localStorage.removeItem(e),null):n.value}function No(e,t,n){return Le(()=>{const r=Fo(e),[o,i]=Qa(r?JSON.parse(r):t);return M(()=>$o(e,JSON.stringify(o),n)),[o,i]})}function el(e,t,n){return Le(()=>{const r=Fo(e),[o,i]=P(r?JSON.parse(r):t);return M(()=>$o(e,JSON.stringify(o()),n)),[o,i]})}el("lang","en");function Ko(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ko(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ko(e))&&(r&&(r+=" "),r+=t);return r}const rr="-";function nl(e){const t=ol(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(rr);return a[0]===""&&a.length!==1&&a.shift(),Bo(a,t)||rl(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function Bo(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Bo(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(rr);return t.validators.find(({validator:s})=>s(i))?.classGroupId}const zo=/^\[(.+)\]$/;function rl(e){if(zo.test(e)){const t=zo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function ol(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sl(Object.entries(e.classGroups),n).forEach(([i,s])=>{or(s,r,i,t)}),r}function or(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Vo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(il(o)){or(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{or(s,Vo(t,i),n,r)})})}function Vo(e,t){let n=e;return t.split(rr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function il(e){return e.isThemeGetter}function sl(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function al(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const Uo="!";function ll(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===r&&(n||s.slice(g,g+o)===t)){a.push(s.slice(c,g)),c=g+o;continue}if(y==="/"){u=g;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),h=d.startsWith(Uo),m=h?d.substring(1):d,f=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:f}}}function cl(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function ul(e){return{cache:al(e.cacheSize),splitModifiers:ll(e),...nl(e)}}const dl=/\s+/;function fl(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(dl).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),h=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};h=!1}const m=cl(a).join(":");return{isTailwindClass:!0,modifierId:l?m+Uo:m,classGroupId:d,originalClassName:s,hasPostfixModifier:h}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function hl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=jo(t))&&(r&&(r+=" "),r+=n);return r}function jo(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=jo(e[r]))&&(n&&(n+=" "),n+=t);return n}function gl(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=ul(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=fl(l,n);return o(l,u),u}return function(){return i(hl.apply(null,arguments))}}function Y(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Ho=/^\[(?:([a-z-]+):)?(.+)\]$/i,pl=/^\d+\/\d+$/,ml=new Set(["px","full","screen"]),yl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vl=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function $e(e){return Qe(e)||ml.has(e)||pl.test(e)}function Ve(e){return dt(e,"length",Al)}function Qe(e){return!!e&&!Number.isNaN(Number(e))}function an(e){return dt(e,"number",Qe)}function Dt(e){return!!e&&Number.isInteger(Number(e))}function Sl(e){return e.endsWith("%")&&Qe(e.slice(0,-1))}function N(e){return Ho.test(e)}function Ue(e){return yl.test(e)}const El=new Set(["length","size","percentage"]);function kl(e){return dt(e,El,qo)}function Cl(e){return dt(e,"position",qo)}const Ol=new Set(["image","url"]);function Pl(e){return dt(e,Ol,Ml)}function _l(e){return dt(e,"",Tl)}function Lt(){return!0}function dt(e,t,n){const r=Ho.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Al(e){return bl.test(e)&&!wl.test(e)}function qo(){return!1}function Tl(e){return vl.test(e)}function Ml(e){return xl.test(e)}function Dl(){const e=Y("colors"),t=Y("spacing"),n=Y("blur"),r=Y("brightness"),o=Y("borderColor"),i=Y("borderRadius"),s=Y("borderSpacing"),a=Y("borderWidth"),l=Y("contrast"),c=Y("grayscale"),u=Y("hueRotate"),d=Y("invert"),h=Y("gap"),m=Y("gradientColorStops"),f=Y("gradientColorStopPositions"),g=Y("inset"),y=Y("margin"),w=Y("opacity"),b=Y("padding"),v=Y("saturate"),x=Y("scale"),_=Y("sepia"),S=Y("skew"),k=Y("space"),R=Y("translate"),C=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",N,t],D=()=>[N,t],oe=()=>["",$e,Ve],X=()=>["auto",Qe,N],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],ie=()=>["start","end","center","between","around","evenly","stretch"],ze=()=>["","0",N],zn=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ot=()=>[Qe,an],Ct=()=>[Qe,N];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[$e,Ve],blur:["none","",Ue,N],brightness:ot(),borderColor:[e],borderRadius:["none","","full",Ue,N],borderSpacing:D(),borderWidth:oe(),contrast:ot(),grayscale:ze(),hueRotate:Ct(),invert:ze(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Sl,Ve],inset:I(),margin:I(),opacity:ot(),padding:D(),saturate:ot(),scale:ot(),sepia:ze(),skew:Ct(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[Ue]}],"break-after":[{"break-after":zn()}],"break-before":[{"break-before":zn()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...te(),N]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dt,N]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ze()}],shrink:[{shrink:ze()}],order:[{order:["first","last","none",Dt,N]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Dt,N]},N]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Dt,N]},N]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[Ue]},Ue]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ue,Ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",an]}],"font-family":[{font:[Lt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",Qe,an]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$e,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$e,Ve]}],"underline-offset":[{"underline-offset":["auto",$e,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...te(),Cl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Pl]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[$e,N]}],"outline-w":[{outline:[$e,Ve]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[$e,Ve]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ue,_l]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":U()}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ue,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:Ct()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:Ct()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Dt,N]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$e,Ve,an]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Ll=gl(Dl);function je(...e){return Ll(tl(e))}function Il(e){try{if(!e)return;const t=document.querySelector(":root");if(!t)throw new Error("could not find root layer");console.log("loading theme for",e.title),e.style.primary&&t.style.setProperty("--primary",ln(e.style.primary)),e.style.primaryForeground&&t.style.setProperty("--primary-foreground",ln(e.style.primaryForeground)),e.style.background&&t.style.setProperty("--background",ln(e.style.background)),e.style.foreground&&t.style.setProperty("--foreground",ln(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function ln(e){e.length>=8&&(e=e.substring(0,7));let t=0,n=0,r=0;e.length==4?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),t/=255,n/=255,r/=255;let o=Math.min(t,n,r),i=Math.max(t,n,r),s=i-o,a=0,l=0,c=0;return s==0?a=0:i==t?a=(n-r)/s%6:i==n?a=(r-t)/s+2:a=(t-n)/s+4,a=Math.round(a*60),a<0&&(a+=360),c=(i+o)/2,l=s==0?0:s/(1-Math.abs(2*c-1)),l=+(l*100).toFixed(1),c=+(c*100).toFixed(1),a+","+l+"%,"+c+"%"}function Rl(e){if(e.includes("<a")||e.includes("</a>")||e.includes('href="')||e.includes('target="_blank"'))return e;const t=/(https?\:\/\/)(www\.)?[^\s]+\.[^\s\<]+/g;return e.replace(t,n=>{let r=n;return n.includes("<br>")?n:(r.startsWith("http")||(r="http://"+n),`<a class="underline" href="${r}" target="_blank">${n}</a>`)})}function $l(e){return e&&e.replace(/\n/gm,"<br>").replace(/(?:\*)([^*]*)(?:\*)/gm,"<strong>$1</strong>").replace(/(?:_)([^_]*)(?:_)/gm,"<i>$1</i>").replace(/(?:~)([^~]*)(?:~)/gm,"<strike>$1</strike>").replace(/(?:```)([^```]*)(?:```)/gm,"<tt>$1</tt>")}function cn(){const e=document.querySelector("smarttalks-widget");let t;if(e?t=e.shadowRoot?.getElementById("smarttalks-widget"):t=document.getElementById("smarttalks-widget"),!t)throw new Error("could not find widget element");return t}const Fl={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar"}};function ft(e){const t=navigator.language?.toLowerCase();let n="en";return(t==="pt-br"||t.includes("pt"))&&(n="pt"),(t==="es-es"||t.includes("es"))&&(n="es"),Fl[n][e]}const un="https://heimdall.smarttalks.ai/api",Nl="wss://heimdall.smarttalks.ai";function Kl(e){return{type:"chat",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"standard",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,chat:{flowId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"},showSettings:!1}}function Bl(e){return{type:"form",_id:e._id,accountId:e.accountId,fullscreen:e.settings.fullScreen,mode:"static",dismissable:e.settings.closeButton,avatar:e.settings.avatar,title:e.settings.title,subtitle:e.settings.subtitle,balloonMessage:e.settings.balloonMessage,openDelay:e.settings.automatedOpen?2e3:0,form:{formId:e.typeId},style:{width:+e.settings.style.width.replace("px",""),height:+e.settings.style.height.replace("px",""),position:"right",primary:e.settings.style.headerBackground,primaryForeground:e.settings.style.color,background:"#FAFAFA",foreground:"#000000"}}}const zl=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${un}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Kl(i);if(i.type==="entity")return Bl(i);if(i.type==="chat"&&r.includes("showSettings")&&(i.showSettings=!0),(r.includes("right")||r.includes("left"))&&(i.style.position=r.includes("right")?"right":"left"),r.some(s=>s.includes("margin"))){const s=r.find(a=>a.includes("margin"));s&&(i.style.margin=Number(s.split("=")[1]??"5"))}if(r.some(s=>s.includes("mode"))){const s=r.find(a=>a.includes("mode"))?.split("=")[1];(s==="popup"||s==="static"||s==="standard")&&(i.mode=s)}return window.addEventListener("message",s=>{const a=s.data;a.from&&a.from==="smarttalkswidget"&&a.command==="registerContactData"&&a.contactData&&Object.keys(a.contactData).length&&fetch(`${un}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.contactData)}).catch(console.error)}),i._id=n,i},[Wo,Vl]=P(""),[ht]=Le(()=>uo(Wo,zl)),Ul=()=>{if(ht()?.type==="chat")return ht()},jl=()=>{if(ht()?.type==="form")return ht()};Le(()=>M(()=>Il(ht())));const ee=()=>({widgetId:Wo,setWidgetId:Vl,widget:ht,chatWidget:Ul,formWidget:jl});function Go(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Go(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Hl(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Go(e))&&(r&&(r+=" "),r+=t);return r}const Yo=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Xo=Hl,ql=(e,t)=>n=>{var r;if(t?.variants==null)return Xo(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],d=i?.[c];if(u===null)return null;const h=Yo(u)||Yo(d);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...m}=u;return Object.entries(m).every(f=>{let[g,y]=f;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,d,h]:c},[]);return Xo(e,s,l,n?.class,n?.className)};var Wl=L("<button>");const Gl=ql("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ye=e=>{const[,t]=H(e,["variant","size","class"]);return(()=>{var n=Wl();return Ze(n,T({get class(){return je(Gl({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Yl=L('<img alt="widget logo">');const Jo=e=>{const[,t]=H(e,["class","src"]);return(()=>{var n=Yl();return Ze(n,T({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return je("size-12 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Xl=L('<div class="flex space-x-4"><div class="flex flex-col"><span class="font-bold md:text-lg"></span><span class="text-xs md:text-sm truncate">');const Jl=()=>{const{chatWidget:e}=ee();return(()=>{var t=Xl(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,p(Jo,{get src(){return e()?.avatar}}),n),A(r,()=>e()?.title??"Izi"),A(o,()=>e()?.subtitle??"SmartTalks.ai"),t})()};var Zl=L("<svg stroke-width=0>");function le(e,t){const n=T(e.a,t),[r,o]=H(n,["src"]),[i,s]=P(""),a=O(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return M(()=>s(a())),B(()=>{s("")}),(()=>{var l=Zl();return Ze(l,T({get stroke(){return e.a?.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),A(l,()=>Na),l})()}function Ql(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.75 8a4.5 4.5 0 0 1-8.61 1.834l-1.391.565A6.001 6.001 0 0 0 14.25 8 6 6 0 0 0 3.5 4.334V2.5H2v4l.75.75h3.5v-1.5H4.352A4.5 4.5 0 0 1 12.75 8z" clip-rule="evenodd"/>'},e)}function ec(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" clip-rule="evenodd"/>'},e)}function tc(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M13.917 7A6.002 6.002 0 0 0 2.083 7H1.071a7.002 7.002 0 0 1 13.858 0h-1.012z" clip-rule="evenodd"/>'},e)}function nc(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="m1 1.91.78-.41L15 7.449v.95L1.78 14.33 1 13.91 2.583 8 1 1.91ZM3.612 8.5 2.33 13.13 13.5 7.9 2.33 2.839l1.282 4.6L9 7.5v1H3.612Z"/>'},e)}function rc(e){return(...t)=>{for(const n of e)n&&n(...t)}}var E=e=>typeof e=="function"&&!e.length?e():e,Zo=e=>Array.isArray(e)?e:e?[e]:[];function oc(e,...t){return typeof e=="function"?e(...t):e}var ic=B;function sc(e,t,n,r){return e.addEventListener(t,n,r),ic(e.removeEventListener.bind(e,t,n,r))}function ac(e,t,n,r){const o=()=>{Zo(E(e)).forEach(i=>{i&&Zo(E(t)).forEach(s=>sc(i,s,n,r))})};typeof e=="function"?M(o):Q(o)}var Qo={equals:!1};function lc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function cc(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}var ir=e=>typeof e=="function"&&!e.length?e():e;function dn(){return!0}var uc={get(e,t,n){return t===me?n:e.get(t)},has(e,t){return e.has(t)},set:dn,deleteProperty:dn,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:dn,deleteProperty:dn}},ownKeys(e){return e.keys()}},dc=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ei(e){const t={};let n;for(;n=dc.exec(e);)t[n[1]]=n[2];return t}function fc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ei(e)}else typeof t=="string"&&(t=ei(t));return{...e,...t}}var sr=(e,t,n)=>{let r;for(const o of e){const i=ir(o)[t];r?i&&(r=n(r,i)):r=i}return r};function hc(...e){const t=Array.isArray(e[0]),n=t?e[0]:e;if(n.length===1)return n[0];const r=t&&e[1]?.reverseEventHandlers?cc:lc,o={};for(const s of n){const a=ir(s);for(const l in a)if(l[0]==="o"&&l[1]==="n"&&l[2]){const c=a[l],u=l.toLowerCase(),d=typeof c=="function"?c:Array.isArray(c)?c.length===1?c[0]:c[0].bind(void 0,c[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=T(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return sr(n,"style",fc);if(s==="ref"){const a=[];for(const l of n){const c=ir(l)[s];typeof c=="function"&&a.push(c)}return r(a)}if(s[0]==="o"&&s[1]==="n"&&s[2]){const a=o[s.toLowerCase()];return a?r(a):Reflect.get(i,s)}return s==="class"||s==="className"?sr(n,s,(a,l)=>`${a} ${l}`):s==="classList"?sr(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},uc)}function et(...e){return rc(e)}function gc(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ar(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pc(e){return typeof e=="number"}function mc(e){return Array.isArray(e)}function gt(e){return Object.prototype.toString.call(e)==="[object String]"}function yc(e){return typeof e=="function"}function ti(e){return t=>`${e()}-${t}`}function Oe(e,t){return e?e===t||e.contains(t):!1}function It(e,t=!1){const{activeElement:n}=Fe(e);if(!n?.nodeName)return null;if(ni(n)&&n.contentDocument)return It(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Fe(n).getElementById(r);if(o)return o}}return n}function Fe(e){return e?e.ownerDocument||e:document}function ni(e){return e.tagName==="IFRAME"}var ri=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ri||{});function lr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function fn(){return lr(/^Mac/i)}function bc(){return lr(/^iPhone/i)}function wc(){return lr(/^iPad/i)||fn()&&navigator.maxTouchPoints>1}function vc(){return bc()||wc()}function xc(){return fn()||vc()}function de(e,t){return t&&(yc(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function be(e){return t=>{for(const n of e)de(t,n)}}function Sc(e){return fn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function ce(e){if(e)if(Ec())e.focus({preventScroll:!0});else{const t=kc(e);e.focus(),Cc(t)}}var hn=null;function Ec(){if(hn==null){hn=!1;try{document.createElement("div").focus({get preventScroll(){return hn=!0,!0}})}catch{}}return hn}function kc(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Cc(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var oi=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Oc=[...oi,'[tabindex]:not([tabindex="-1"]):not([disabled])'],cr=oi.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",Pc=Oc.join(':not([hidden]):not([tabindex="-1"]),');function ii(e,t){const r=Array.from(e.querySelectorAll(cr)).filter(si);return t&&si(e)&&r.unshift(e),r.forEach((o,i)=>{if(ni(o)&&o.contentDocument){const s=o.contentDocument.body,a=ii(s,!1);r.splice(i,1,...a)}}),r}function si(e){return ai(e)&&!_c(e)}function ai(e){return e.matches(cr)&&ur(e)}function _c(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function ur(e,t){return e.nodeName!=="#comment"&&Ac(e)&&Tc(e,t)&&(!e.parentElement||ur(e.parentElement,e))}function Ac(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function Tc(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Mc(e,t){return t.some(n=>n.contains(e))}function Dc(e,t,n){const r=t?.tabbable?Pc:cr,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&ur(i)&&(!n||Mc(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function li(e){for(;e&&!Lc(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function Lc(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Ic(){}function Rc(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[d,h]=t[l],[,m]=t[l===0?s-1:l-1]||[0,0],f=(u-h)*(n-c)-(c-d)*(r-u);if(h<u){if(r>=h&&r<u){if(f===0)return!0;f>0&&(r===h?r>m&&(o=!o):o=!o)}}else if(u<h){if(r>u&&r<=h){if(f===0)return!0;f<0&&(r===h?r<m&&(o=!o):o=!o)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function Pe(e,t){return T(e,t)}var Rt=new Map,ci=new Set;function ui(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Rt.get(n.target);r||(r=new Set,Rt.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Rt.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Rt.delete(n.target)),Rt.size===0)){for(const o of ci)o();ci.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?ui():document.addEventListener("DOMContentLoaded",ui));function dr(e,t){const n=di(e,t,"left"),r=di(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function di(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function $c(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=li(e);for(;e&&o&&e!==n&&o!==n;)dr(o,e),e=o,o=li(e)}else{const{left:o,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=e.getBoundingClientRect();(Math.abs(o-s)>1||Math.abs(i-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}var Fc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function fr(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=gt(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=gt(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(gt(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return gt(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(gt(l)||pc(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=fr({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}/*!
2
2
  * Portions of this file are based on code from react-spectrum.
3
3
  * Apache License Version 2.0, Copyright 2020 Adobe.
4
4
  *
5
5
  * Credits to the React Spectrum team:
6
6
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/collections/src/useCollection.ts
7
- */function Nc(e,t=[]){const n=dr({dataSource:E(e.dataSource),getKey:E(e.getKey),getTextValue:E(e.getTextValue),getDisabled:E(e.getDisabled),getSectionChildren:E(e.getSectionChildren)}),[r,o]=_(e.factory(n));return M(Je([()=>E(e.dataSource),()=>E(e.getKey),()=>E(e.getTextValue),()=>E(e.getDisabled),()=>E(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,u])=>{const d=dr({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>u(d))},{defer:!0})),r}function fr(e){const[t,n]=_(e.defaultValue?.()),r=O(()=>e.value?.()!==void 0),o=O(()=>r()?e.value?.():t());return[o,s=>{W(()=>{const a=oc(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Kc(e){const[t,n]=fr(e);return[()=>t()??!1,n]}function Bc(e){const[t,n]=fr(e);return[()=>t()??[],n]}function fi(e={}){const[t,n]=Kc({value:()=>E(e.open),defaultValue:()=>!!E(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function zc(e){const t=n=>{n.key===ri.Escape&&e.onEscapeKeyDown?.(n)};M(()=>{if(E(e.isDisabled))return;const n=e.ownerDocument?.()??Fe();n.addEventListener("keydown",t),B(()=>{n.removeEventListener("keydown",t)})})}/*!
7
+ */function Nc(e,t=[]){const n=fr({dataSource:E(e.dataSource),getKey:E(e.getKey),getTextValue:E(e.getTextValue),getDisabled:E(e.getDisabled),getSectionChildren:E(e.getSectionChildren)}),[r,o]=P(e.factory(n));return M(Je([()=>E(e.dataSource),()=>E(e.getKey),()=>E(e.getTextValue),()=>E(e.getDisabled),()=>E(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,u])=>{const d=fr({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>u(d))},{defer:!0})),r}function hr(e){const[t,n]=P(e.defaultValue?.()),r=O(()=>e.value?.()!==void 0),o=O(()=>r()?e.value?.():t());return[o,s=>{W(()=>{const a=oc(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function Kc(e){const[t,n]=hr(e);return[()=>t()??!1,n]}function Bc(e){const[t,n]=hr(e);return[()=>t()??[],n]}function fi(e={}){const[t,n]=Kc({value:()=>E(e.open),defaultValue:()=>!!E(e.defaultOpen),onChange:s=>e.onOpenChange?.(s)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}function zc(e){const t=n=>{n.key===ri.Escape&&e.onEscapeKeyDown?.(n)};M(()=>{if(E(e.isDisabled))return;const n=e.ownerDocument?.()??Fe();n.addEventListener("keydown",t),B(()=>{n.removeEventListener("keydown",t)})})}/*!
8
8
  * Portions of this file are based on code from radix-ui-primitives.
9
9
  * MIT Licensed, Copyright (c) 2022 WorkOS.
10
10
  *
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * Credits to the Chakra UI team:
18
18
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/dismissable/src/layer-stack.ts
19
- */const fn="data-kb-top-layer";let hi,hr=!1;const Ne=[];function $t(e){return Ne.findIndex(t=>t.node===e)}function Vc(e){return Ne[$t(e)]}function Uc(e){return Ne[Ne.length-1].node===e}function gi(){return Ne.filter(e=>e.isPointerBlocking)}function jc(){return[...gi()].slice(-1)[0]}function gr(){return gi().length>0}function pi(e){const t=$t(jc()?.node);return $t(e)<t}function Hc(e){Ne.push(e)}function qc(e){const t=$t(e);t<0||Ne.splice(t,1)}function Wc(){for(const{node:e}of Ne)e.style.pointerEvents=pi(e)?"none":"auto"}function Gc(e){if(gr()&&!hr){const t=Fe(e);hi=document.body.style.pointerEvents,t.body.style.pointerEvents="none",hr=!0}}function Yc(e){if(gr())return;const t=Fe(e);t.body.style.pointerEvents=hi,t.body.style.length===0&&t.body.removeAttribute("style"),hr=!1}const fe={layers:Ne,isTopMostLayer:Uc,hasPointerBlockingLayer:gr,isBelowPointerBlockingLayer:pi,addLayer:Hc,removeLayer:qc,indexOf:$t,find:Vc,assignPointerEventToLayers:Wc,disableBodyPointerEvents:Gc,restoreBodyPointerEvents:Yc};/*!
19
+ */const gn="data-kb-top-layer";let hi,gr=!1;const Ne=[];function $t(e){return Ne.findIndex(t=>t.node===e)}function Vc(e){return Ne[$t(e)]}function Uc(e){return Ne[Ne.length-1].node===e}function gi(){return Ne.filter(e=>e.isPointerBlocking)}function jc(){return[...gi()].slice(-1)[0]}function pr(){return gi().length>0}function pi(e){const t=$t(jc()?.node);return $t(e)<t}function Hc(e){Ne.push(e)}function qc(e){const t=$t(e);t<0||Ne.splice(t,1)}function Wc(){for(const{node:e}of Ne)e.style.pointerEvents=pi(e)?"none":"auto"}function Gc(e){if(pr()&&!gr){const t=Fe(e);hi=document.body.style.pointerEvents,t.body.style.pointerEvents="none",gr=!0}}function Yc(e){if(pr())return;const t=Fe(e);t.body.style.pointerEvents=hi,t.body.style.length===0&&t.body.removeAttribute("style"),gr=!1}const fe={layers:Ne,isTopMostLayer:Uc,hasPointerBlockingLayer:pr,isBelowPointerBlockingLayer:pi,addLayer:Hc,removeLayer:qc,indexOf:$t,find:Vc,assignPointerEventToLayers:Wc,disableBodyPointerEvents:Gc,restoreBodyPointerEvents:Yc};/*!
20
20
  * Portions of this file are based on code from radix-ui-primitives.
21
21
  * MIT Licensed, Copyright (c) 2022 WorkOS.
22
22
  *
@@ -29,7 +29,7 @@
29
29
  * Credits to the Chakra UI team:
30
30
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-on-child-unmount.ts
31
31
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-containment.ts
32
- */const pr="focusScope.autoFocusOnMount",mr="focusScope.autoFocusOnUnmount",mi={bubbles:!1,cancelable:!0},yi={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=sr(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=sr(this.stack,e),this.active()?.resume()}};function Xc(e,t){const[n,r]=_(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=f=>e.onMountAutoFocus?.(f),a=f=>e.onUnmountAutoFocus?.(f),l=()=>Fe(t()),c=()=>{const f=l().createElement("span");return f.setAttribute("data-focus-trap",""),f.tabIndex=0,Object.assign(f.style,Fc),f},u=()=>{const f=t();return f?ii(f,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},d=()=>{const f=u();return f.length>0?f[0]:null},h=()=>{const f=u();return f.length>0?f[f.length-1]:null},m=()=>{const f=t();if(!f)return!1;const g=It(f);return!g||Oe(f,g)?!1:ai(g)};M(()=>{const f=t();if(!f)return;yi.add(o);const g=It(f);if(!Oe(f,g)){const w=new CustomEvent(pr,mi);f.addEventListener(pr,s),f.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{ce(d()),It(f)===g&&ce(f)},0)}B(()=>{f.removeEventListener(pr,s),setTimeout(()=>{const w=new CustomEvent(mr,mi);m()&&w.preventDefault(),f.addEventListener(mr,a),f.dispatchEvent(w),w.defaultPrevented||ce(g??l().body),f.removeEventListener(mr,a),yi.remove(o)},0)})}),M(()=>{const f=t();if(!f||!E(e.trapFocus)||n())return;const g=w=>{const b=w.target;b?.closest(`[${fn}]`)||(Oe(f,b)?i=b:ce(i))},y=w=>{const v=w.relatedTarget??It(f);v?.closest(`[${fn}]`)||Oe(f,v)||ce(i)};l().addEventListener("focusin",g),l().addEventListener("focusout",y),B(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",y)})}),M(()=>{const f=t();if(!f||!E(e.trapFocus)||n())return;const g=c();f.insertAdjacentElement("afterbegin",g);const y=c();f.insertAdjacentElement("beforeend",y);function w(v){const x=d(),P=h();v.relatedTarget===x?ce(P):ce(x)}g.addEventListener("focusin",w),y.addEventListener("focusin",w);const b=new MutationObserver(v=>{for(const x of v)x.previousSibling===y&&(y.remove(),f.insertAdjacentElement("beforeend",y)),x.nextSibling===g&&(g.remove(),f.insertAdjacentElement("afterbegin",g))});b.observe(f,{childList:!0,subtree:!1}),B(()=>{g.removeEventListener("focusin",w),y.removeEventListener("focusin",w),g.remove(),y.remove(),b.disconnect()})})}/*!
32
+ */const mr="focusScope.autoFocusOnMount",yr="focusScope.autoFocusOnUnmount",mi={bubbles:!1,cancelable:!0},yi={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=ar(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=ar(this.stack,e),this.active()?.resume()}};function Xc(e,t){const[n,r]=P(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=f=>e.onMountAutoFocus?.(f),a=f=>e.onUnmountAutoFocus?.(f),l=()=>Fe(t()),c=()=>{const f=l().createElement("span");return f.setAttribute("data-focus-trap",""),f.tabIndex=0,Object.assign(f.style,Fc),f},u=()=>{const f=t();return f?ii(f,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},d=()=>{const f=u();return f.length>0?f[0]:null},h=()=>{const f=u();return f.length>0?f[f.length-1]:null},m=()=>{const f=t();if(!f)return!1;const g=It(f);return!g||Oe(f,g)?!1:ai(g)};M(()=>{const f=t();if(!f)return;yi.add(o);const g=It(f);if(!Oe(f,g)){const w=new CustomEvent(mr,mi);f.addEventListener(mr,s),f.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{ce(d()),It(f)===g&&ce(f)},0)}B(()=>{f.removeEventListener(mr,s),setTimeout(()=>{const w=new CustomEvent(yr,mi);m()&&w.preventDefault(),f.addEventListener(yr,a),f.dispatchEvent(w),w.defaultPrevented||ce(g??l().body),f.removeEventListener(yr,a),yi.remove(o)},0)})}),M(()=>{const f=t();if(!f||!E(e.trapFocus)||n())return;const g=w=>{const b=w.target;b?.closest(`[${gn}]`)||(Oe(f,b)?i=b:ce(i))},y=w=>{const v=w.relatedTarget??It(f);v?.closest(`[${gn}]`)||Oe(f,v)||ce(i)};l().addEventListener("focusin",g),l().addEventListener("focusout",y),B(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",y)})}),M(()=>{const f=t();if(!f||!E(e.trapFocus)||n())return;const g=c();f.insertAdjacentElement("afterbegin",g);const y=c();f.insertAdjacentElement("beforeend",y);function w(v){const x=d(),_=h();v.relatedTarget===x?ce(_):ce(x)}g.addEventListener("focusin",w),y.addEventListener("focusin",w);const b=new MutationObserver(v=>{for(const x of v)x.previousSibling===y&&(y.remove(),f.insertAdjacentElement("beforeend",y)),x.nextSibling===g&&(g.remove(),f.insertAdjacentElement("afterbegin",g))});b.observe(f,{childList:!0,subtree:!1}),B(()=>{g.removeEventListener("focusin",w),y.removeEventListener("focusin",w),g.remove(),y.remove(),b.disconnect()})})}/*!
33
33
  * Portions of this file are based on code from react-spectrum.
34
34
  * Apache License Version 2.0, Copyright 2020 Adobe.
35
35
  *
@@ -41,7 +41,7 @@
41
41
  *
42
42
  * Credits to the React Spectrum team:
43
43
  * https://github.com/adobe/react-spectrum/blob/810579b671791f1593108f62cdc1893de3a220e3/packages/@react-aria/overlays/src/ariaHideOutside.ts
44
- */function Zc(e){M(()=>{E(e.isDisabled)||B(Qc(E(e.targets),E(e.root)))})}const Ft=new WeakMap,we=[];function Qc(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const h of l.querySelectorAll(`[${Jc}], [${fn}]`))n.add(h);const c=h=>{if(n.has(h)||h.parentElement&&r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const m of n)if(h.contains(m))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&i(l),d!==NodeFilter.FILTER_REJECT){let h=u.nextNode();for(;h!=null;)i(h),h=u.nextNode()}},i=l=>{const c=Ft.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Ft.set(l,c+1))};we.length&&we[we.length-1].disconnect(),o(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return we.push(a),()=>{s.disconnect();for(const l of r){const c=Ft.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Ft.delete(l)):Ft.set(l,c-1)}a===we[we.length-1]?(we.pop(),we.length&&we[we.length-1].observe()):we.splice(we.indexOf(a),1)}}/*!
44
+ */function Zc(e){M(()=>{E(e.isDisabled)||B(Qc(E(e.targets),E(e.root)))})}const Ft=new WeakMap,we=[];function Qc(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const h of l.querySelectorAll(`[${Jc}], [${gn}]`))n.add(h);const c=h=>{if(n.has(h)||h.parentElement&&r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const m of n)if(h.contains(m))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&i(l),d!==NodeFilter.FILTER_REJECT){let h=u.nextNode();for(;h!=null;)i(h),h=u.nextNode()}},i=l=>{const c=Ft.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Ft.set(l,c+1))};we.length&&we[we.length-1].disconnect(),o(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return we.push(a),()=>{s.disconnect();for(const l of r){const c=Ft.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Ft.delete(l)):Ft.set(l,c-1)}a===we[we.length-1]?(we.pop(),we.length&&we[we.length-1].observe()):we.splice(we.indexOf(a),1)}}/*!
45
45
  * Portions of this file are based on code from radix-ui-primitives.
46
46
  * MIT Licensed, Copyright (c) 2022 WorkOS.
47
47
  *
@@ -53,20 +53,20 @@
53
53
  *
54
54
  * Credits to the Chakra UI team:
55
55
  * https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/interact-outside/src/index.ts
56
- */const bi="interactOutside.pointerDownOutside",wi="interactOutside.focusOutside";function eu(e,t){let n,r=Ic;const o=()=>Fe(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const h=d.target;return!(h instanceof HTMLElement)||h.closest(`[${fn}]`)||!Oe(o(),h)||Oe(t(),h)?!1:!e.shouldExcludeElement?.(h)},c=d=>{function h(){const m=t(),f=d.target;if(!m||!f||!l(d))return;const g=be([i,a]);f.addEventListener(bi,g,{once:!0});const y=new CustomEvent(bi,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||Sc(d)&&d.button===0}});f.dispatchEvent(y)}d.pointerType==="touch"?(o().removeEventListener("click",h),r=h,o().addEventListener("click",h,{once:!0})):h()},u=d=>{const h=t(),m=d.target;if(!h||!m||!l(d))return;const f=be([s,a]);m.addEventListener(wi,f,{once:!0});const g=new CustomEvent(wi,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});m.dispatchEvent(g)};M(()=>{E(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),B(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)}))})}/*!
56
+ */const bi="interactOutside.pointerDownOutside",wi="interactOutside.focusOutside";function eu(e,t){let n,r=Ic;const o=()=>Fe(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const h=d.target;return!(h instanceof HTMLElement)||h.closest(`[${gn}]`)||!Oe(o(),h)||Oe(t(),h)?!1:!e.shouldExcludeElement?.(h)},c=d=>{function h(){const m=t(),f=d.target;if(!m||!f||!l(d))return;const g=be([i,a]);f.addEventListener(bi,g,{once:!0});const y=new CustomEvent(bi,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||Sc(d)&&d.button===0}});f.dispatchEvent(y)}d.pointerType==="touch"?(o().removeEventListener("click",h),r=h,o().addEventListener("click",h,{once:!0})):h()},u=d=>{const h=t(),m=d.target;if(!h||!m||!l(d))return;const f=be([s,a]);m.addEventListener(wi,f,{once:!0});const g=new CustomEvent(wi,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});m.dispatchEvent(g)};M(()=>{E(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),B(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)}))})}/*!
57
57
  * Portions of this file are based on code from radix-ui-primitives.
58
58
  * MIT Licensed, Copyright (c) 2022 WorkOS.
59
59
  *
60
60
  * Credits to the Radix UI team:
61
61
  * https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
62
62
  * https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
63
- */function tu(e){const[t,n]=_();let r={},o=e(),i="none";const[s,a]=nu(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M(Je(s,l=>{const c=hn(r);i=l==="mounted"?c:"none"})),M(Je(e,l=>{if(o===l)return;const c=hn(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),M(Je(t,l=>{if(l){const c=d=>{const m=hn(r).includes(d.animationName);d.target===l&&m&&a("ANIMATION_END")},u=d=>{d.target===l&&(i=hn(r))};l.addEventListener("animationstart",u),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),B(()=>{l.removeEventListener("animationstart",u),l.removeEventListener("animationcancel",c),l.removeEventListener("animationend",c)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:l=>{l&&(r=getComputedStyle(l)),n(l)}}}function hn(e){return e?.animationName||"none"}function nu(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=_(e);return[r,s=>{o(a=>n(a,s))}]}function gn(e){return t=>(e(t),()=>e(void 0))}/*!
63
+ */function tu(e){const[t,n]=P();let r={},o=e(),i="none";const[s,a]=nu(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M(Je(s,l=>{const c=pn(r);i=l==="mounted"?c:"none"})),M(Je(e,l=>{if(o===l)return;const c=pn(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),M(Je(t,l=>{if(l){const c=d=>{const m=pn(r).includes(d.animationName);d.target===l&&m&&a("ANIMATION_END")},u=d=>{d.target===l&&(i=pn(r))};l.addEventListener("animationstart",u),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),B(()=>{l.removeEventListener("animationstart",u),l.removeEventListener("animationcancel",c),l.removeEventListener("animationend",c)})}else a("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(s()),setRef:l=>{l&&(r=getComputedStyle(l)),n(l)}}}function pn(e){return e?.animationName||"none"}function nu(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=P(e);return[r,s=>{o(a=>n(a,s))}]}function mn(e){return t=>(e(t),()=>e(void 0))}/*!
64
64
  * Portions of this file are based on code from ariakit.
65
65
  * MIT Licensed, Copyright (c) Diego Haz.
66
66
  *
67
67
  * Credits to the ariakit team:
68
68
  * https://github.com/ariakit/ariakit/blob/8a13899ff807bbf39f3d89d2d5964042ba4d5287/packages/ariakit-react-utils/src/hooks.ts
69
- */function ru(e,t){const[n,r]=_(vi(t?.()));return M(()=>{r(e()?.tagName.toLowerCase()||vi(t?.()))}),n}function vi(e){return gt(e)?e:void 0}function pn(e){const[t,n]=H(e,["asChild","as","children"]);if(!t.asChild)return p(tn,T({get component(){return t.as}},n,{get children(){return t.children}}));const r=Wn(()=>t.children);if(xi(r())){const o=Si(n,r()?.props??{});return p(tn,o)}if(mc(r())){const o=r().find(xi);if(o){const i=()=>p(at,{get each(){return r()},children:a=>p(J,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Si(n,o?.props??{});return p(tn,T(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const ou=Symbol("$$KobalteAsComponent");function xi(e){return e?.[ou]===!0}function Si(e,t){return hc([e,t],{reverseEventHandlers:!0})}/*!
69
+ */function ru(e,t){const[n,r]=P(vi(t?.()));return M(()=>{r(e()?.tagName.toLowerCase()||vi(t?.()))}),n}function vi(e){return gt(e)?e:void 0}function yn(e){const[t,n]=H(e,["asChild","as","children"]);if(!t.asChild)return p(nn,T({get component(){return t.as}},n,{get children(){return t.children}}));const r=Yn(()=>t.children);if(xi(r())){const o=Si(n,r()?.props??{});return p(nn,o)}if(mc(r())){const o=r().find(xi);if(o){const i=()=>p(st,{get each(){return r()},children:a=>p(J,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Si(n,o?.props??{});return p(nn,T(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const ou=Symbol("$$KobalteAsComponent");function xi(e){return e?.[ou]===!0}function Si(e,t){return hc([e,t],{reverseEventHandlers:!0})}/*!
70
70
  * Portions of this file are based on code from react-spectrum.
71
71
  * Apache License Version 2.0, Copyright 2020 Adobe.
72
72
  *
@@ -78,13 +78,13 @@
78
78
  *
79
79
  * Credits to the React Spectrum team:
80
80
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
81
- */function Ei(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:lu(e)}}let yr=Ei();const Nt=new Set;function ki(){yr=Ei();for(const e of Nt)e(yr)}function cu(){const[e,t]=_(yr),n=O(()=>e());return _t(()=>{Nt.size===0&&window.addEventListener("languagechange",ki),Nt.add(t),B(()=>{Nt.delete(t),Nt.size===0&&window.removeEventListener("languagechange",ki)})}),{locale:()=>n().locale,direction:()=>n().direction}}const uu=se();function br(){const e=cu();return ue(uu)||e}/*!
81
+ */function Ei(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:lu(e)}}let br=Ei();const Nt=new Set;function ki(){br=Ei();for(const e of Nt)e(br)}function cu(){const[e,t]=P(br),n=O(()=>e());return Pt(()=>{Nt.size===0&&window.addEventListener("languagechange",ki),Nt.add(t),B(()=>{Nt.delete(t),Nt.size===0&&window.removeEventListener("languagechange",ki)})}),{locale:()=>n().locale,direction:()=>n().direction}}const uu=se();function wr(){const e=cu();return ue(uu)||e}/*!
82
82
  * Portions of this file are based on code from react-spectrum.
83
83
  * Apache License Version 2.0, Copyright 2020 Adobe.
84
84
  *
85
85
  * Credits to the React Spectrum team:
86
86
  * https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
87
- */const wr=new Map;function du(e){const{locale:t}=br(),n=O(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return O(()=>{const r=n();let o;return wr.has(r)&&(o=wr.get(r)),o||(o=new Intl.Collator(t(),e),wr.set(r,o)),o})}/*!
87
+ */const vr=new Map;function du(e){const{locale:t}=wr(),n=O(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return O(()=>{const r=n();let o;return vr.has(r)&&(o=vr.get(r)),o||(o=new Intl.Collator(t(),e),vr.set(r,o)),o})}/*!
88
88
  * Portions of this file are based on code from react-spectrum.
89
89
  * Apache License Version 2.0, Copyright 2020 Adobe.
90
90
  *
@@ -92,37 +92,37 @@
92
92
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
93
93
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
94
94
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
95
- */class Ee extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Ee?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function fu(e){const[t,n]=fr(e);return[()=>t()??new Ee,n]}/*!
95
+ */class Ee extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof Ee?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function fu(e){const[t,n]=hr(e);return[()=>t()??new Ee,n]}/*!
96
96
  * Portions of this file are based on code from react-spectrum.
97
97
  * Apache License Version 2.0, Copyright 2020 Adobe.
98
98
  *
99
99
  * Credits to the React Spectrum team:
100
100
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
101
- */function Ci(e){return xc()?e.altKey:e.ctrlKey}function pt(e){return un()?e.metaKey:e.ctrlKey}function Oi(e){return new Ee(e)}function hu(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
101
+ */function Ci(e){return xc()?e.altKey:e.ctrlKey}function pt(e){return fn()?e.metaKey:e.ctrlKey}function Oi(e){return new Ee(e)}function hu(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}/*!
102
102
  * Portions of this file are based on code from react-spectrum.
103
103
  * Apache License Version 2.0, Copyright 2020 Adobe.
104
104
  *
105
105
  * Credits to the React Spectrum team:
106
106
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
107
- */function gu(e){const t=_e({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=_(!1),[o,i]=_(),s=O(()=>{const g=E(t.selectedKeys);return g!=null?Oi(g):g}),a=O(()=>{const g=E(t.defaultSelectedKeys);return g!=null?Oi(g):new Ee}),[l,c]=fu({value:s,defaultValue:a,onChange:g=>t.onSelectionChange?.(g)}),[u,d]=_(E(t.selectionBehavior)),h=()=>E(t.selectionMode),m=()=>E(t.disallowEmptySelection)??!1,f=g=>{(E(t.allowDuplicateSelectionEvents)||!hu(g,l()))&&c(g)};return M(()=>{const g=l();E(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof g=="object"&&g.size===0&&d("replace")}),M(()=>{d(E(t.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:m,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:f}}/*!
107
+ */function gu(e){const t=Pe({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=P(!1),[o,i]=P(),s=O(()=>{const g=E(t.selectedKeys);return g!=null?Oi(g):g}),a=O(()=>{const g=E(t.defaultSelectedKeys);return g!=null?Oi(g):new Ee}),[l,c]=fu({value:s,defaultValue:a,onChange:g=>t.onSelectionChange?.(g)}),[u,d]=P(E(t.selectionBehavior)),h=()=>E(t.selectionMode),m=()=>E(t.disallowEmptySelection)??!1,f=g=>{(E(t.allowDuplicateSelectionEvents)||!hu(g,l()))&&c(g)};return M(()=>{const g=l();E(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof g=="object"&&g.size===0&&d("replace")}),M(()=>{d(E(t.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:m,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:f}}/*!
108
108
  * Portions of this file are based on code from react-spectrum.
109
109
  * Apache License Version 2.0, Copyright 2020 Adobe.
110
110
  *
111
111
  * Credits to the React Spectrum team:
112
112
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
113
- */function pu(e){const[t,n]=_(""),[r,o]=_(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(E(e.isDisabled))return;const a=E(e.keyboardDelegate),l=E(e.selectionManager);if(!a.getKeyForSearch)return;const c=mu(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(h=>h+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&yu(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function mu(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function yu(e){return e.split("").every(t=>t===e[0])}/*!
113
+ */function pu(e){const[t,n]=P(""),[r,o]=P(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(E(e.isDisabled))return;const a=E(e.keyboardDelegate),l=E(e.selectionManager);if(!a.getKeyForSearch)return;const c=mu(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(h=>h+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&yu(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),e.onTypeSelect?.(d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function mu(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function yu(e){return e.split("").every(t=>t===e[0])}/*!
114
114
  * Portions of this file are based on code from react-spectrum.
115
115
  * Apache License Version 2.0, Copyright 2020 Adobe.
116
116
  *
117
117
  * Credits to the React Spectrum team:
118
118
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
119
- */function bu(e,t,n){const o=T({selectOnFocus:()=>E(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>n?.()??t(),{direction:s}=br();let a={top:0,left:0};ac(()=>E(o.isVirtualized)?void 0:i(),"scroll",()=>{const g=i();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=pu({isDisabled:()=>E(o.disallowTypeAhead),keyboardDelegate:()=>E(o.keyboardDelegate),selectionManager:()=>E(o.selectionManager)}),c=g=>{de(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const y=t();if(!y?.contains(g.target))return;const w=E(o.selectionManager),b=E(o.selectOnFocus),v=k=>{k!=null&&(w.setFocusedKey(k),g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&!Ci(g)&&w.replaceSelection(k))},x=E(o.keyboardDelegate),P=E(o.shouldFocusWrap),S=w.focusedKey();switch(g.key){case"ArrowDown":{if(x.getKeyBelow){g.preventDefault();let k;S!=null?k=x.getKeyBelow(S):k=x.getFirstKey?.(),k==null&&P&&(k=x.getFirstKey?.(S)),v(k)}break}case"ArrowUp":{if(x.getKeyAbove){g.preventDefault();let k;S!=null?k=x.getKeyAbove(S):k=x.getLastKey?.(),k==null&&P&&(k=x.getLastKey?.(S)),v(k)}break}case"ArrowLeft":{if(x.getKeyLeftOf){g.preventDefault();const k=s()==="rtl";let R;S!=null?R=x.getKeyLeftOf(S):R=k?x.getFirstKey?.():x.getLastKey?.(),v(R)}break}case"ArrowRight":{if(x.getKeyRightOf){g.preventDefault();const k=s()==="rtl";let R;S!=null?R=x.getKeyRightOf(S):R=k?x.getLastKey?.():x.getFirstKey?.(),v(R)}break}case"Home":if(x.getFirstKey){g.preventDefault();const k=x.getFirstKey(S,pt(g));k!=null&&(w.setFocusedKey(k),pt(g)&&g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&w.replaceSelection(k))}break;case"End":if(x.getLastKey){g.preventDefault();const k=x.getLastKey(S,pt(g));k!=null&&(w.setFocusedKey(k),pt(g)&&g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&w.replaceSelection(k))}break;case"PageDown":if(x.getKeyPageBelow&&S!=null){g.preventDefault();const k=x.getKeyPageBelow(S);v(k)}break;case"PageUp":if(x.getKeyPageAbove&&S!=null){g.preventDefault();const k=x.getKeyPageAbove(S);v(k)}break;case"a":pt(g)&&w.selectionMode()==="multiple"&&E(o.disallowSelectAll)!==!0&&(g.preventDefault(),w.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),E(o.disallowEmptySelection)||w.clearSelection());break;case"Tab":if(!E(o.allowsTabNavigation)){if(g.shiftKey)y.focus();else{const k=Dc(y,{tabbable:!0});let R,C;do C=k.lastChild(),C&&(R=C);while(C);R&&!R.contains(document.activeElement)&&ce(R)}break}}},u=g=>{const y=E(o.selectionManager),w=E(o.keyboardDelegate),b=E(o.selectOnFocus);if(y.isFocused()){g.currentTarget.contains(g.target)||y.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(y.setFocused(!0),y.focusedKey()==null){const v=P=>{P!=null&&(y.setFocusedKey(P),b&&y.replaceSelection(P))},x=g.relatedTarget;x&&g.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?v(y.lastSelectedKey()??w.getLastKey?.()):v(y.firstSelectedKey()??w.getFirstKey?.())}else if(!E(o.isVirtualized)){const v=i();if(v){v.scrollTop=a.top,v.scrollLeft=a.left;const x=v.querySelector(`[data-key="${y.focusedKey()}"]`);x&&(ce(x),ur(v,x))}}}},d=g=>{const y=E(o.selectionManager);g.currentTarget.contains(g.relatedTarget)||y.setFocused(!1)},h=g=>{i()===g.target&&g.preventDefault()},m=()=>{const g=E(o.autoFocus);if(!g)return;const y=E(o.selectionManager),w=E(o.keyboardDelegate);let b;g==="first"&&(b=w.getFirstKey?.()),g==="last"&&(b=w.getLastKey?.());const v=y.selectedKeys();v.size&&(b=v.values().next().value),y.setFocused(!0),y.setFocusedKey(b);const x=t();x&&b==null&&!E(o.shouldUseVirtualFocus)&&ce(x)};return _t(()=>{o.deferAutoFocus?setTimeout(m,0):m()}),M(Je([i,()=>E(o.isVirtualized),()=>E(o.selectionManager).focusedKey()],g=>{const[y,w,b]=g;if(w)b&&o.scrollToKey?.(b);else if(b&&y){const v=y.querySelector(`[data-key="${b}"]`);v&&ur(y,v)}})),{tabIndex:O(()=>{if(!E(o.shouldUseVirtualFocus))return E(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:u,onFocusOut:d}}/*!
119
+ */function bu(e,t,n){const o=T({selectOnFocus:()=>E(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>n?.()??t(),{direction:s}=wr();let a={top:0,left:0};ac(()=>E(o.isVirtualized)?void 0:i(),"scroll",()=>{const g=i();g&&(a={top:g.scrollTop,left:g.scrollLeft})});const{typeSelectHandlers:l}=pu({isDisabled:()=>E(o.disallowTypeAhead),keyboardDelegate:()=>E(o.keyboardDelegate),selectionManager:()=>E(o.selectionManager)}),c=g=>{de(g,l.onKeyDown),g.altKey&&g.key==="Tab"&&g.preventDefault();const y=t();if(!y?.contains(g.target))return;const w=E(o.selectionManager),b=E(o.selectOnFocus),v=k=>{k!=null&&(w.setFocusedKey(k),g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&!Ci(g)&&w.replaceSelection(k))},x=E(o.keyboardDelegate),_=E(o.shouldFocusWrap),S=w.focusedKey();switch(g.key){case"ArrowDown":{if(x.getKeyBelow){g.preventDefault();let k;S!=null?k=x.getKeyBelow(S):k=x.getFirstKey?.(),k==null&&_&&(k=x.getFirstKey?.(S)),v(k)}break}case"ArrowUp":{if(x.getKeyAbove){g.preventDefault();let k;S!=null?k=x.getKeyAbove(S):k=x.getLastKey?.(),k==null&&_&&(k=x.getLastKey?.(S)),v(k)}break}case"ArrowLeft":{if(x.getKeyLeftOf){g.preventDefault();const k=s()==="rtl";let R;S!=null?R=x.getKeyLeftOf(S):R=k?x.getFirstKey?.():x.getLastKey?.(),v(R)}break}case"ArrowRight":{if(x.getKeyRightOf){g.preventDefault();const k=s()==="rtl";let R;S!=null?R=x.getKeyRightOf(S):R=k?x.getLastKey?.():x.getFirstKey?.(),v(R)}break}case"Home":if(x.getFirstKey){g.preventDefault();const k=x.getFirstKey(S,pt(g));k!=null&&(w.setFocusedKey(k),pt(g)&&g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&w.replaceSelection(k))}break;case"End":if(x.getLastKey){g.preventDefault();const k=x.getLastKey(S,pt(g));k!=null&&(w.setFocusedKey(k),pt(g)&&g.shiftKey&&w.selectionMode()==="multiple"?w.extendSelection(k):b&&w.replaceSelection(k))}break;case"PageDown":if(x.getKeyPageBelow&&S!=null){g.preventDefault();const k=x.getKeyPageBelow(S);v(k)}break;case"PageUp":if(x.getKeyPageAbove&&S!=null){g.preventDefault();const k=x.getKeyPageAbove(S);v(k)}break;case"a":pt(g)&&w.selectionMode()==="multiple"&&E(o.disallowSelectAll)!==!0&&(g.preventDefault(),w.selectAll());break;case"Escape":g.defaultPrevented||(g.preventDefault(),E(o.disallowEmptySelection)||w.clearSelection());break;case"Tab":if(!E(o.allowsTabNavigation)){if(g.shiftKey)y.focus();else{const k=Dc(y,{tabbable:!0});let R,C;do C=k.lastChild(),C&&(R=C);while(C);R&&!R.contains(document.activeElement)&&ce(R)}break}}},u=g=>{const y=E(o.selectionManager),w=E(o.keyboardDelegate),b=E(o.selectOnFocus);if(y.isFocused()){g.currentTarget.contains(g.target)||y.setFocused(!1);return}if(g.currentTarget.contains(g.target)){if(y.setFocused(!0),y.focusedKey()==null){const v=_=>{_!=null&&(y.setFocusedKey(_),b&&y.replaceSelection(_))},x=g.relatedTarget;x&&g.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?v(y.lastSelectedKey()??w.getLastKey?.()):v(y.firstSelectedKey()??w.getFirstKey?.())}else if(!E(o.isVirtualized)){const v=i();if(v){v.scrollTop=a.top,v.scrollLeft=a.left;const x=v.querySelector(`[data-key="${y.focusedKey()}"]`);x&&(ce(x),dr(v,x))}}}},d=g=>{const y=E(o.selectionManager);g.currentTarget.contains(g.relatedTarget)||y.setFocused(!1)},h=g=>{i()===g.target&&g.preventDefault()},m=()=>{const g=E(o.autoFocus);if(!g)return;const y=E(o.selectionManager),w=E(o.keyboardDelegate);let b;g==="first"&&(b=w.getFirstKey?.()),g==="last"&&(b=w.getLastKey?.());const v=y.selectedKeys();v.size&&(b=v.values().next().value),y.setFocused(!0),y.setFocusedKey(b);const x=t();x&&b==null&&!E(o.shouldUseVirtualFocus)&&ce(x)};return Pt(()=>{o.deferAutoFocus?setTimeout(m,0):m()}),M(Je([i,()=>E(o.isVirtualized),()=>E(o.selectionManager).focusedKey()],g=>{const[y,w,b]=g;if(w)b&&o.scrollToKey?.(b);else if(b&&y){const v=y.querySelector(`[data-key="${b}"]`);v&&dr(y,v)}})),{tabIndex:O(()=>{if(!E(o.shouldUseVirtualFocus))return E(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:u,onFocusOut:d}}/*!
120
120
  * Portions of this file are based on code from react-spectrum.
121
121
  * Apache License Version 2.0, Copyright 2020 Adobe.
122
122
  *
123
123
  * Credits to the React Spectrum team:
124
124
  * https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
125
- */function wu(e,t){const n=()=>E(e.selectionManager),r=()=>E(e.key),o=()=>E(e.shouldUseVirtualFocus),i=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||pt(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>E(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!E(e.shouldSelectOnPressUp)&&i(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&E(e.shouldSelectOnPressUp)&&E(e.allowsDifferentPressOrigin)&&i(b)},h=b=>{l()&&(E(e.shouldSelectOnPressUp)&&!E(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(b)},m=b=>{!l()||!["Enter"," "].includes(b.key)||(Ci(b)?n().toggleSelection(r()):i(b))},f=b=>{a()&&b.preventDefault()},g=b=>{const v=t();o()||a()||!v||b.target===v&&n().setFocusedKey(r())},y=O(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),w=O(()=>E(e.virtualized)?void 0:r());return M(Je([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([b,v,x,P,S])=>{b&&v===P&&S&&!x&&document.activeElement!==b&&(e.focus?e.focus():ce(b))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:y,dataKey:w,onPointerDown:u,onPointerUp:d,onClick:h,onKeyDown:m,onMouseDown:f,onFocus:g}}/*!
125
+ */function wu(e,t){const n=()=>E(e.selectionManager),r=()=>E(e.key),o=()=>E(e.shouldUseVirtualFocus),i=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||pt(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>E(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!E(e.shouldSelectOnPressUp)&&i(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&E(e.shouldSelectOnPressUp)&&E(e.allowsDifferentPressOrigin)&&i(b)},h=b=>{l()&&(E(e.shouldSelectOnPressUp)&&!E(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(b)},m=b=>{!l()||!["Enter"," "].includes(b.key)||(Ci(b)?n().toggleSelection(r()):i(b))},f=b=>{a()&&b.preventDefault()},g=b=>{const v=t();o()||a()||!v||b.target===v&&n().setFocusedKey(r())},y=O(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),w=O(()=>E(e.virtualized)?void 0:r());return M(Je([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([b,v,x,_,S])=>{b&&v===_&&S&&!x&&document.activeElement!==b&&(e.focus?e.focus():ce(b))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:y,dataKey:w,onPointerDown:u,onPointerUp:d,onClick:h,onKeyDown:m,onMouseDown:f,onFocus:g}}/*!
126
126
  * Portions of this file are based on code from react-spectrum.
127
127
  * Apache License Version 2.0, Copyright 2020 Adobe.
128
128
  *
@@ -134,13 +134,13 @@
134
134
  *
135
135
  * Credits to the React Spectrum team:
136
136
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
137
- */class _i{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
137
+ */class Pi{keyMap=new Map;iterable;firstKey;lastKey;constructor(t){this.iterable=t;for(const o of t)this.keyMap.set(o.key,o);if(this.keyMap.size===0)return;let n,r=0;for(const[o,i]of this.keyMap)n?(n.nextKey=o,i.prevKey=n.key):(this.firstKey=o,i.prevKey=void 0),i.type==="item"&&(i.index=r++),n=i,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){return this.keyMap.get(t)?.prevKey}getKeyAfter(t){return this.keyMap.get(t)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}}/*!
138
138
  * Portions of this file are based on code from react-spectrum.
139
139
  * Apache License Version 2.0, Copyright 2020 Adobe.
140
140
  *
141
141
  * Credits to the React Spectrum team:
142
142
  * https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
143
- */function xu(e){const t=gu(e),r=Nc({dataSource:()=>E(e.dataSource),getKey:()=>E(e.getKey),getTextValue:()=>E(e.getTextValue),getDisabled:()=>E(e.getDisabled),getSectionChildren:()=>E(e.getSectionChildren),factory:i=>e.filter?new _i(e.filter(i)):new _i(i)},[()=>e.filter]),o=new vu(r,t);return Hn(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
143
+ */function xu(e){const t=gu(e),r=Nc({dataSource:()=>E(e.dataSource),getKey:()=>E(e.getKey),getTextValue:()=>E(e.getTextValue),getDisabled:()=>E(e.getDisabled),getSectionChildren:()=>E(e.getSectionChildren),factory:i=>e.filter?new Pi(e.filter(i)):new Pi(i)},[()=>e.filter]),o=new vu(r,t);return Wn(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}/*!
144
144
  * Portions of this file are based on code from react-spectrum.
145
145
  * Apache License Version 2.0, Copyright 2020 Adobe.
146
146
  *
@@ -158,13 +158,13 @@
158
158
  *
159
159
  * Credits to the ariakit team:
160
160
  * https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
161
- */const ku=["button","color","file","image","reset","submit"];function Cu(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?ku.indexOf(e.type)!==-1:!1}function Ou(e){let t;const n=_e({type:"button"},e),[r,o]=H(n,["ref","type","disabled"]),i=ru(()=>t,()=>"button"),s=O(()=>{const c=i();return c==null?!1:Cu({tagName:c,type:r.type})}),a=O(()=>i()==="input"),l=O(()=>i()==="a"&&t?.getAttribute("href")!=null);return p(pn,T({as:"button",ref(c){var u=tt(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const Pi=se();function Ai(){return ue(Pi)}function _u(){const e=Ai();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
161
+ */const ku=["button","color","file","image","reset","submit"];function Cu(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?ku.indexOf(e.type)!==-1:!1}function Ou(e){let t;const n=Pe({type:"button"},e),[r,o]=H(n,["ref","type","disabled"]),i=ru(()=>t,()=>"button"),s=O(()=>{const c=i();return c==null?!1:Cu({tagName:c,type:r.type})}),a=O(()=>i()==="input"),l=O(()=>i()==="a"&&t?.getAttribute("href")!=null);return p(yn,T({as:"button",ref(c){var u=et(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}const _i=se();function Ai(){return ue(_i)}function Pu(){const e=Ai();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}/*!
162
162
  * Portions of this file are based on code from ariakit.
163
163
  * MIT Licensed, Copyright (c) Diego Haz.
164
164
  *
165
165
  * Credits to the Ariakit team:
166
166
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
167
- */function Ti(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Pu(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&Ti(o,n))return r+1}return 0}function Au(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),l=s.ref();return a===l||!a||!l?0:Ti(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Mi(e,t){const n=Au(e);e!==n&&t(n)}function Tu(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Fe(r).body}function Mu(e,t){M(()=>{const n=setTimeout(()=>{Mi(e(),t)});B(()=>clearTimeout(n))})}function Du(e,t){if(typeof IntersectionObserver!="function"){Mu(e,t);return}let n=[];M(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Mi(e(),t)},o=Tu(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}B(()=>i.disconnect())})}/*!
167
+ */function Ti(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function _u(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=e[r]?.ref();if(o&&Ti(o,n))return r+1}return 0}function Au(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),l=s.ref();return a===l||!a||!l?0:Ti(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function Mi(e,t){const n=Au(e);e!==n&&t(n)}function Tu(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Fe(r).body}function Mu(e,t){M(()=>{const n=setTimeout(()=>{Mi(e(),t)});B(()=>clearTimeout(n))})}function Du(e,t){if(typeof IntersectionObserver!="function"){Mu(e,t);return}let n=[];M(()=>{const r=()=>{const s=!!n.length;n=e(),s&&Mi(e(),t)},o=Tu(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}B(()=>i.disconnect())})}/*!
168
168
  * Portions of this file are based on code from ariakit.
169
169
  * MIT Licensed, Copyright (c) Diego Haz.
170
170
  *
@@ -172,10 +172,10 @@
172
172
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection.tsx
173
173
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-state.ts
174
174
  * https://github.com/ariakit/ariakit/blob/da142672eddefa99365773ced72171facc06fdcb/packages/ariakit/src/collection/collection-item.ts
175
- */function Lu(e={}){const[t,n]=Bc({value:()=>E(e.items),onChange:i=>e.onItemsChange?.(i)});Du(t,n);const r=i=>(n(s=>{const a=Pu(s,i);return gc(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>p(Pi.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Iu(e){const t=_u(),n=_e({shouldRegisterItem:!0},e);M(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());B(r)})}var z=e=>typeof e=="function"?e():e,Di=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),mn=new Map,Ru=e=>{M(()=>{const t=z(e.style)??{},n=z(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=mn.get(e.key);o?o.activeCount++:mn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);B(()=>{const i=mn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}mn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},vr=Ru,$u=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Fu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Li=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,u]=$u(o,t),d=u-l-r*c;(c!==0||d!==0)&&Fu(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o.parentElement}while(o&&!a);return[i,s]},[Ii,Ri]=_([]),Nu=e=>Ii().indexOf(e)===Ii().length-1,Ku=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!1},e),n=Ce();let r=[0,0],o=null,i=null;M(()=>{z(t.enabled)&&(Ri(c=>[...c,n]),B(()=>{Ri(c=>c.filter(u=>u!==n))}))}),M(()=>{if(!z(t.enabled)||!z(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(vr({key:"prevent-scroll-overflow",element:c,style:{overflow:"hidden"}}),z(t.preventScrollbarShift)){const d={},h=[];u>0&&(z(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,h.push({key:"--scrollbar-width",value:`${u}px`}));const m=window.scrollY,f=window.scrollX;vr({key:"prevent-scroll-scrollbar",element:c,style:d,properties:h,cleanup:()=>{u>0&&window.scrollTo(f,m)}})}}),M(()=>{!Nu(n)||!z(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),B(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=$i(c),o=null,i=null},a=c=>{const u=c.target,d=z(t.element),h=Bu(c),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=m==="x"?h[0]:h[1],g=Fi(u,m,f,d);let y;d&&d.contains(u)?y=!g:y=g,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=z(t.element),d=c.target;let h;if(c.touches.length===2)h=!z(t.allowPinchZoom);else{if(o==null||i===null){const m=$i(c).map((g,y)=>r[y]-g),f=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=f,i=f==="x"?m[0]:m[1]}if(d.type==="range")h=!1;else{const m=Fi(d,o,i,u);u&&u.contains(d)?h=!m:h=m}}h&&c.cancelable&&c.preventDefault()}},Bu=e=>[e.deltaX,e.deltaY],$i=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Fi=(e,t,n,r)=>{const o=r&&r.contains(e),[i,s]=Li(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},zu=Ku,Ni=zu;const Ki=se();function Vu(){return ue(Ki)}function Uu(e){let t;const n=Vu(),[r,o]=H(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const h=n?.registerNestedLayer(d);return()=>{i.delete(d),h?.()}};eu({shouldExcludeElement:d=>t?r.excludedElements?.some(h=>Oe(h(),d))||[...i].some(h=>Oe(h,d)):!1,onPointerDownOutside:d=>{!t||fe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!fe.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),zc({ownerDocument:()=>Fe(t),onEscapeKeyDown:d=>{!t||!fe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),_t(()=>{if(!t)return;fe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);fe.assignPointerEventToLayers(),fe.disableBodyPointerEvents(t),B(()=>{t&&(fe.removeLayer(t),d?.(),fe.assignPointerEventToLayers(),fe.restoreBodyPointerEvents(t))})}),M(Je([()=>t,()=>r.disableOutsidePointerEvents],([d,h])=>{if(!d)return;const m=fe.find(d);m&&m.isPointerBlocking!==h&&(m.isPointerBlocking=h,fe.assignPointerEventToLayers()),h&&fe.disableBodyPointerEvents(d),B(()=>{fe.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return p(Ki.Provider,{value:u,get children(){return p(pn,T({as:"div",ref(d){var h=tt(m=>t=m,r.ref);typeof h=="function"&&h(d)}},o))}})}const Bi=se();function ju(){const e=ue(Bi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function Hu(e){const t=ju(),[n,r]=H(e,["ref","style"]);return p(pn,T({as:"div",ref(o){var i=tt(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const qu=["top","right","bottom","left"],He=Math.min,he=Math.max,yn=Math.round,bn=Math.floor,qe=e=>({x:e,y:e}),Wu={left:"right",right:"left",bottom:"top",top:"bottom"},Gu={start:"end",end:"start"};function xr(e,t,n){return he(e,He(t,n))}function nt(e,t){return typeof e=="function"?e(t):e}function We(e){return e.split("-")[0]}function mt(e){return e.split("-")[1]}function zi(e){return e==="x"?"y":"x"}function Sr(e){return e==="y"?"height":"width"}function Kt(e){return["top","bottom"].includes(We(e))?"y":"x"}function Er(e){return zi(Kt(e))}function Yu(e,t,n){n===void 0&&(n=!1);const r=mt(e),o=Er(e),i=Sr(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wn(s)),[s,wn(s)]}function Xu(e){const t=wn(e);return[kr(e),t,kr(t)]}function kr(e){return e.replace(/start|end/g,t=>Gu[t])}function Ju(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Zu(e,t,n,r){const o=mt(e);let i=Ju(We(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(kr)))),i}function wn(e){return e.replace(/left|right|bottom|top/g,t=>Wu[t])}function Qu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vi(e){return typeof e!="number"?Qu(e):{top:e,right:e,bottom:e,left:e}}function vn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ui(e,t,n){let{reference:r,floating:o}=e;const i=Kt(t),s=Er(t),a=Sr(s),l=We(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-o.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(mt(t)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const ed=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ui(c,r,l),h=r,m={},f=0;for(let g=0;g<a.length;g++){const{name:y,fn:w}=a[g],{x:b,y:v,data:x,reset:P}=await w({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=b??u,d=v??d,m={...m,[y]:{...m[y],...x}},P&&f<=50&&(f++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(c=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:u,y:d}=Ui(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:m}};async function Bt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=nt(t,e),f=Vi(m),y=a[h?d==="floating"?"reference":"floating":d],w=vn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...s.floating,x:r,y:o}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},P=vn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:v,strategy:l}):b);return{top:(w.top-P.top+f.top)/x.y,bottom:(P.bottom-w.bottom+f.bottom)/x.y,left:(w.left-P.left+f.left)/x.x,right:(P.right-w.right+f.right)/x.x}}const td=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=nt(e,t)||{};if(c==null)return{};const d=Vi(u),h={x:n,y:r},m=Er(o),f=Sr(m),g=await s.getDimensions(c),y=m==="y",w=y?"top":"left",b=y?"bottom":"right",v=y?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[m]-h[m]-i.floating[f],P=h[m]-i.reference[m],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=S?S[v]:0;(!k||!await(s.isElement==null?void 0:s.isElement(S)))&&(k=a.floating[v]||i.floating[f]);const R=x/2-P/2,C=k/2-g[f]/2-1,K=He(d[w],C),I=He(d[b],C),D=K,oe=k-g[f]-I,X=k/2-g[f]/2+R,te=xr(D,X,oe),$=!l.arrow&&mt(o)!=null&&X!==te&&i.reference[f]/2-(X<D?K:I)-g[f]/2<0,U=$?X<D?X-D:X-oe:0;return{[m]:h[m]+U,data:{[m]:te,centerOffset:X-te-U,...$&&{alignmentOffset:U}},reset:$}}}),nd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...y}=nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=We(o),b=We(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=h||(b||!g?[wn(a)]:Xu(a));!h&&f!=="none"&&x.push(...Zu(a,g,f,v));const P=[a,...x],S=await Bt(t,y),k=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(S[w]),d){const D=Yu(o,s,v);k.push(S[D[0]],S[D[1]])}if(R=[...R,{placement:o,overflows:k}],!k.every(D=>D<=0)){var C,K;const D=(((C=i.flip)==null?void 0:C.index)||0)+1,oe=P[D];if(oe)return{data:{index:D,overflows:R},reset:{placement:oe}};let X=(K=R.filter(te=>te.overflows[0]<=0).sort((te,$)=>te.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!X)switch(m){case"bestFit":{var I;const te=(I=R.map($=>[$.placement,$.overflows.filter(U=>U>0).reduce((U,ie)=>U+ie,0)]).sort(($,U)=>$[1]-U[1])[0])==null?void 0:I[0];te&&(X=te);break}case"initialPlacement":X=a;break}if(o!==X)return{reset:{placement:X}}}return{}}}};function ji(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hi(e){return qu.some(t=>e[t]>=0)}const rd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=nt(e,t);switch(r){case"referenceHidden":{const i=await Bt(t,{...o,elementContext:"reference"}),s=ji(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Hi(s)}}}case"escaped":{const i=await Bt(t,{...o,altBoundary:!0}),s=ji(i,n.floating);return{data:{escapedOffsets:s,escaped:Hi(s)}}}default:return{}}}}};async function od(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=We(n),a=mt(n),l=Kt(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=nt(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const id=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await od(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},sd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:w,y:b}=y;return{x:w,y:b}}},...l}=nt(e,t),c={x:n,y:r},u=await Bt(t,l),d=Kt(We(o)),h=zi(d);let m=c[h],f=c[d];if(i){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=m+u[y],v=m-u[w];m=xr(b,m,v)}if(s){const y=d==="y"?"top":"left",w=d==="y"?"bottom":"right",b=f+u[y],v=f-u[w];f=xr(b,f,v)}const g=a.fn({...t,[h]:m,[d]:f});return{...g,data:{x:g.x-n,y:g.y-r}}}}},ad=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=nt(e,t),l=await Bt(t,a),c=We(n),u=mt(n),d=Kt(n)==="y",{width:h,height:m}=r.floating;let f,g;c==="top"||c==="bottom"?(f=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,f=u==="end"?"top":"bottom");const y=m-l[f],w=h-l[g],b=!t.middlewareData.shift;let v=y,x=w;if(d){const S=h-l.left-l.right;x=u||b?He(w,S):S}else{const S=m-l.top-l.bottom;v=u||b?He(y,S):S}if(b&&!u){const S=he(l.left,0),k=he(l.right,0),R=he(l.top,0),C=he(l.bottom,0);d?x=h-2*(S!==0||k!==0?S+k:he(l.left,l.right)):v=m-2*(R!==0||C!==0?R+C:he(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:v});const P=await o.getDimensions(i.floating);return h!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function Ge(e){return qi(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ke(e){var t;return(t=(qi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qi(e){return e instanceof Node||e instanceof ge(e).Node}function Be(e){return e instanceof Element||e instanceof ge(e).Element}function Pe(e){return e instanceof HTMLElement||e instanceof ge(e).HTMLElement}function Wi(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}function zt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ld(e){return["table","td","th"].includes(Ge(e))}function Cr(e){const t=Or(),n=ve(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function cd(e){let t=yt(e);for(;Pe(t)&&!xn(t);){if(Cr(t))return t;t=yt(t)}return null}function Or(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function xn(e){return["html","body","#document"].includes(Ge(e))}function ve(e){return ge(e).getComputedStyle(e)}function Sn(e){return Be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function yt(e){if(Ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wi(e)&&e.host||Ke(e);return Wi(t)?t.host:t}function Gi(e){const t=yt(e);return xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&zt(t)?t:Gi(t)}function Vt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Gi(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ge(o);return i?t.concat(s,s.visualViewport||[],zt(o)?o:[],s.frameElement&&n?Vt(s.frameElement):[]):t.concat(o,Vt(o,[],n))}function Yi(e){const t=ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pe(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=yn(n)!==i||yn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function _r(e){return Be(e)?e:e.contextElement}function bt(e){const t=_r(e);if(!Pe(t))return qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Yi(t);let s=(i?yn(n.width):n.width)/r,a=(i?yn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ud=qe(0);function Xi(e){const t=ge(e);return!Or()||!t.visualViewport?ud:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=_r(e);let s=qe(1);t&&(r?Be(r)&&(s=bt(r)):s=bt(e));const a=dd(i,n,r)?Xi(i):qe(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=ge(i),m=r&&Be(r)?ge(r):r;let f=h,g=f.frameElement;for(;g&&r&&m!==f;){const y=bt(g),w=g.getBoundingClientRect(),b=ve(g),v=w.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,x=w.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=v,c+=x,f=ge(g),g=f.frameElement}}return vn({width:u,height:d,x:l,y:c})}const fd=[":popover-open",":modal"];function Ji(e){return fd.some(t=>{try{return e.matches(t)}catch{return!1}})}function hd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ke(r),a=t?Ji(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=qe(1);const u=qe(0),d=Pe(r);if((d||!d&&!i)&&((Ge(r)!=="body"||zt(s))&&(l=Sn(r)),Pe(r))){const h=rt(r);c=bt(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function gd(e){return Array.from(e.getClientRects())}function Zi(e){return rt(Ke(e)).left+Sn(e).scrollLeft}function pd(e){const t=Ke(e),n=Sn(e),r=e.ownerDocument.body,o=he(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=he(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Zi(e);const a=-n.scrollTop;return ve(r).direction==="rtl"&&(s+=he(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function md(e,t){const n=ge(e),r=Ke(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Or();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function yd(e,t){const n=rt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pe(e)?bt(e):qe(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Qi(e,t,n){let r;if(t==="viewport")r=md(e,n);else if(t==="document")r=pd(Ke(e));else if(Be(t))r=yd(t,n);else{const o=Xi(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return vn(r)}function es(e,t){const n=yt(e);return n===t||!Be(n)||xn(n)?!1:ve(n).position==="fixed"||es(n,t)}function bd(e,t){const n=t.get(e);if(n)return n;let r=Vt(e,[],!1).filter(a=>Be(a)&&Ge(a)!=="body"),o=null;const i=ve(e).position==="fixed";let s=i?yt(e):e;for(;Be(s)&&!xn(s);){const a=ve(s),l=Cr(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zt(s)&&!l&&es(e,s))?r=r.filter(u=>u!==s):o=a,s=yt(s)}return t.set(e,r),r}function wd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?bd(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Qi(t,u,o);return c.top=he(d.top,c.top),c.right=He(d.right,c.right),c.bottom=He(d.bottom,c.bottom),c.left=he(d.left,c.left),c},Qi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vd(e){const{width:t,height:n}=Yi(e);return{width:t,height:n}}function xd(e,t,n){const r=Pe(t),o=Ke(t),i=n==="fixed",s=rt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=qe(0);if(r||!r&&!i)if((Ge(t)!=="body"||zt(o))&&(a=Sn(t)),r){const d=rt(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Zi(o));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function ts(e,t){return!Pe(e)||ve(e).position==="fixed"?null:t?t(e):e.offsetParent}function ns(e,t){const n=ge(e);if(!Pe(e)||Ji(e))return n;let r=ts(e,t);for(;r&&ld(r)&&ve(r).position==="static";)r=ts(r,t);return r&&(Ge(r)==="html"||Ge(r)==="body"&&ve(r).position==="static"&&!Cr(r))?n:r||cd(e)||n}const Sd=async function(e){const t=this.getOffsetParent||ns,n=this.getDimensions;return{reference:xd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Ed(e){return ve(e).direction==="rtl"}const rs={convertOffsetParentRelativeRectToViewportRelativeRect:hd,getDocumentElement:Ke,getClippingRect:wd,getOffsetParent:ns,getElementRects:Sd,getClientRects:gd,getDimensions:vd,getScale:bt,isElement:Be,isRTL:Ed};function kd(e,t){let n=null,r;const o=Ke(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const m=bn(u),f=bn(o.clientWidth-(c+d)),g=bn(o.clientHeight-(u+h)),y=bn(c),b={rootMargin:-m+"px "+-f+"px "+-g+"px "+-y+"px",threshold:he(0,He(1,l))||1};let v=!0;function x(P){const S=P[0].intersectionRatio;if(S!==l){if(!v)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function Cd(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_r(e),u=o||i?[...c?Vt(c):[],...Vt(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&a?kd(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?rt(e):null;l&&y();function y(){const w=rt(e);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&n(),g=w,f=requestAnimationFrame(y)}return n(),()=>{var w;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(w=m)==null||w.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const Od=sd,_d=nd,Pd=ad,Ad=rd,Td=td,Md=(e,t,n)=>{const r=new Map,o={platform:rs,...n},i={...o.platform,_c:r};return ed(e,t,{...o,platform:i})};function os(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function Dd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?os(r):e?e.getBoundingClientRect():os()}}}function Ld(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const Id={top:"bottom",right:"left",bottom:"top",left:"right"};function Rd(e,t){const[n,r]=e.split("-"),o=Id[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function $d(e){const t=_e({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=_(),[o,i]=_(),[s,a]=_(t.placement),l=()=>Dd(t.anchorRef(),t.getAnchorRect),{direction:c}=br();async function u(){const h=l(),m=n(),f=o();if(!h||!m)return;const g=(f?.clientHeight||0)/2,y=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const w=[id(({placement:S})=>{const k=!!S.split("-")[1];return{mainAxis:y,crossAxis:k?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const S=typeof t.flip=="string"?t.flip.split(" "):void 0;if(S!==void 0&&!S.every(Ld))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(_d({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&w.push(Od({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(Pd({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:k,rects:R}){const C=Math.round(R.reference.width);S=Math.floor(S),k=Math.floor(k),m.style.setProperty("--kb-popper-anchor-width",`${C}px`),m.style.setProperty("--kb-popper-content-available-width",`${S}px`),m.style.setProperty("--kb-popper-content-available-height",`${k}px`),t.sameWidth&&(m.style.width=`${C}px`),t.fitViewport&&(m.style.maxWidth=`${S}px`,m.style.maxHeight=`${k}px`)}})),t.hideWhenDetached&&w.push(Ad({padding:t.detachedPadding})),f&&w.push(Td({element:f,padding:t.arrowPadding}));const b=await Md(h,m,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...rs,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",Rd(b.placement,c()));const v=Math.round(b.x),x=Math.round(b.y);let P;if(t.hideWhenDetached&&(P=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${v}px, ${x}px, 0)`,visibility:P}),f&&b.middlewareData.arrow){const{x:S,y:k}=b.middlewareData.arrow,R=b.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:k!=null?`${k}px`:"",[R]:"100%"})}}M(()=>{const h=l(),m=n();if(!h||!m)return;const f=Cd(h,m,u,{elementResize:typeof ResizeObserver=="function"});B(f)}),M(()=>{const h=n(),m=t.contentRef();!h||!m||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(m).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return p(Bi.Provider,{value:d,get children(){return t.children}})}const is=se();function ss(){return ue(is)}function wt(){const e=ss();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const as=se();function vt(){const e=ue(as);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
175
+ */function Lu(e={}){const[t,n]=Bc({value:()=>E(e.items),onChange:i=>e.onItemsChange?.(i)});Du(t,n);const r=i=>(n(s=>{const a=_u(s,i);return gc(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>p(_i.Provider,{value:{registerItem:r},get children(){return i.children}})}}function Iu(e){const t=Pu(),n=Pe({shouldRegisterItem:!0},e);M(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());B(r)})}var z=e=>typeof e=="function"?e():e,Di=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),bn=new Map,Ru=e=>{M(()=>{const t=z(e.style)??{},n=z(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=bn.get(e.key);o?o.activeCount++:bn.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);B(()=>{const i=bn.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}bn.delete(e.key);for(const[s,a]of Object.entries(i.originalStyles))e.element.style[s]=a;for(const s of i.properties)e.element.style.removeProperty(s);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},xr=Ru,$u=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Fu=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Li=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,u]=$u(o,t),d=u-l-r*c;(c!==0||d!==0)&&Fu(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o.parentElement}while(o&&!a);return[i,s]},[Ii,Ri]=P([]),Nu=e=>Ii().indexOf(e)===Ii().length-1,Ku=e=>{const t=T({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!1},e),n=Ce();let r=[0,0],o=null,i=null;M(()=>{z(t.enabled)&&(Ri(c=>[...c,n]),B(()=>{Ri(c=>c.filter(u=>u!==n))}))}),M(()=>{if(!z(t.enabled)||!z(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(xr({key:"prevent-scroll-overflow",element:c,style:{overflow:"hidden"}}),z(t.preventScrollbarShift)){const d={},h=[];u>0&&(z(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,h.push({key:"--scrollbar-width",value:`${u}px`}));const m=window.scrollY,f=window.scrollX;xr({key:"prevent-scroll-scrollbar",element:c,style:d,properties:h,cleanup:()=>{u>0&&window.scrollTo(f,m)}})}}),M(()=>{!Nu(n)||!z(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),B(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=$i(c),o=null,i=null},a=c=>{const u=c.target,d=z(t.element),h=Bu(c),m=Math.abs(h[0])>Math.abs(h[1])?"x":"y",f=m==="x"?h[0]:h[1],g=Fi(u,m,f,d);let y;d&&d.contains(u)?y=!g:y=g,y&&c.cancelable&&c.preventDefault()},l=c=>{const u=z(t.element),d=c.target;let h;if(c.touches.length===2)h=!z(t.allowPinchZoom);else{if(o==null||i===null){const m=$i(c).map((g,y)=>r[y]-g),f=Math.abs(m[0])>Math.abs(m[1])?"x":"y";o=f,i=f==="x"?m[0]:m[1]}if(d.type==="range")h=!1;else{const m=Fi(d,o,i,u);u&&u.contains(d)?h=!m:h=m}}h&&c.cancelable&&c.preventDefault()}},Bu=e=>[e.deltaX,e.deltaY],$i=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Fi=(e,t,n,r)=>{const o=r&&r.contains(e),[i,s]=Li(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},zu=Ku,Ni=zu;const Ki=se();function Vu(){return ue(Ki)}function Uu(e){let t;const n=Vu(),[r,o]=H(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const h=n?.registerNestedLayer(d);return()=>{i.delete(d),h?.()}};eu({shouldExcludeElement:d=>t?r.excludedElements?.some(h=>Oe(h(),d))||[...i].some(h=>Oe(h,d)):!1,onPointerDownOutside:d=>{!t||fe.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!fe.isTopMostLayer(t)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>t),zc({ownerDocument:()=>Fe(t),onEscapeKeyDown:d=>{!t||!fe.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Pt(()=>{if(!t)return;fe.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);fe.assignPointerEventToLayers(),fe.disableBodyPointerEvents(t),B(()=>{t&&(fe.removeLayer(t),d?.(),fe.assignPointerEventToLayers(),fe.restoreBodyPointerEvents(t))})}),M(Je([()=>t,()=>r.disableOutsidePointerEvents],([d,h])=>{if(!d)return;const m=fe.find(d);m&&m.isPointerBlocking!==h&&(m.isPointerBlocking=h,fe.assignPointerEventToLayers()),h&&fe.disableBodyPointerEvents(d),B(()=>{fe.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return p(Ki.Provider,{value:u,get children(){return p(yn,T({as:"div",ref(d){var h=et(m=>t=m,r.ref);typeof h=="function"&&h(d)}},o))}})}const Bi=se();function ju(){const e=ue(Bi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function Hu(e){const t=ju(),[n,r]=H(e,["ref","style"]);return p(yn,T({as:"div",ref(o){var i=et(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},r))}const qu=["top","right","bottom","left"],He=Math.min,he=Math.max,wn=Math.round,vn=Math.floor,qe=e=>({x:e,y:e}),Wu={left:"right",right:"left",bottom:"top",top:"bottom"},Gu={start:"end",end:"start"};function Sr(e,t,n){return he(e,He(t,n))}function tt(e,t){return typeof e=="function"?e(t):e}function We(e){return e.split("-")[0]}function mt(e){return e.split("-")[1]}function zi(e){return e==="x"?"y":"x"}function Er(e){return e==="y"?"height":"width"}function Kt(e){return["top","bottom"].includes(We(e))?"y":"x"}function kr(e){return zi(Kt(e))}function Yu(e,t,n){n===void 0&&(n=!1);const r=mt(e),o=kr(e),i=Er(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=xn(s)),[s,xn(s)]}function Xu(e){const t=xn(e);return[Cr(e),t,Cr(t)]}function Cr(e){return e.replace(/start|end/g,t=>Gu[t])}function Ju(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Zu(e,t,n,r){const o=mt(e);let i=Ju(We(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Cr)))),i}function xn(e){return e.replace(/left|right|bottom|top/g,t=>Wu[t])}function Qu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vi(e){return typeof e!="number"?Qu(e):{top:e,right:e,bottom:e,left:e}}function Sn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ui(e,t,n){let{reference:r,floating:o}=e;const i=Kt(t),s=kr(t),a=Er(s),l=We(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-o.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(mt(t)){case"start":m[s]-=h*(n&&c?-1:1);break;case"end":m[s]+=h*(n&&c?-1:1);break}return m}const ed=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ui(c,r,l),h=r,m={},f=0;for(let g=0;g<a.length;g++){const{name:y,fn:w}=a[g],{x:b,y:v,data:x,reset:_}=await w({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=b??u,d=v??d,m={...m,[y]:{...m[y],...x}},_&&f<=50&&(f++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(c=_.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:u,y:d}=Ui(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:m}};async function Bt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=tt(t,e),f=Vi(m),y=a[h?d==="floating"?"reference":"floating":d],w=Sn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...s.floating,x:r,y:o}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},_=Sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:v,strategy:l}):b);return{top:(w.top-_.top+f.top)/x.y,bottom:(_.bottom-w.bottom+f.bottom)/x.y,left:(w.left-_.left+f.left)/x.x,right:(_.right-w.right+f.right)/x.x}}const td=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=tt(e,t)||{};if(c==null)return{};const d=Vi(u),h={x:n,y:r},m=kr(o),f=Er(m),g=await s.getDimensions(c),y=m==="y",w=y?"top":"left",b=y?"bottom":"right",v=y?"clientHeight":"clientWidth",x=i.reference[f]+i.reference[m]-h[m]-i.floating[f],_=h[m]-i.reference[m],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=S?S[v]:0;(!k||!await(s.isElement==null?void 0:s.isElement(S)))&&(k=a.floating[v]||i.floating[f]);const R=x/2-_/2,C=k/2-g[f]/2-1,K=He(d[w],C),I=He(d[b],C),D=K,oe=k-g[f]-I,X=k/2-g[f]/2+R,te=Sr(D,X,oe),$=!l.arrow&&mt(o)!=null&&X!==te&&i.reference[f]/2-(X<D?K:I)-g[f]/2<0,U=$?X<D?X-D:X-oe:0;return{[m]:h[m]+U,data:{[m]:te,centerOffset:X-te-U,...$&&{alignmentOffset:U}},reset:$}}}),nd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...y}=tt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=We(o),b=We(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=h||(b||!g?[xn(a)]:Xu(a));!h&&f!=="none"&&x.push(...Zu(a,g,f,v));const _=[a,...x],S=await Bt(t,y),k=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(S[w]),d){const D=Yu(o,s,v);k.push(S[D[0]],S[D[1]])}if(R=[...R,{placement:o,overflows:k}],!k.every(D=>D<=0)){var C,K;const D=(((C=i.flip)==null?void 0:C.index)||0)+1,oe=_[D];if(oe)return{data:{index:D,overflows:R},reset:{placement:oe}};let X=(K=R.filter(te=>te.overflows[0]<=0).sort((te,$)=>te.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!X)switch(m){case"bestFit":{var I;const te=(I=R.map($=>[$.placement,$.overflows.filter(U=>U>0).reduce((U,ie)=>U+ie,0)]).sort(($,U)=>$[1]-U[1])[0])==null?void 0:I[0];te&&(X=te);break}case"initialPlacement":X=a;break}if(o!==X)return{reset:{placement:X}}}return{}}}};function ji(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hi(e){return qu.some(t=>e[t]>=0)}const rd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=tt(e,t);switch(r){case"referenceHidden":{const i=await Bt(t,{...o,elementContext:"reference"}),s=ji(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Hi(s)}}}case"escaped":{const i=await Bt(t,{...o,altBoundary:!0}),s=ji(i,n.floating);return{data:{escapedOffsets:s,escaped:Hi(s)}}}default:return{}}}}};async function od(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=We(n),a=mt(n),l=Kt(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=tt(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const id=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await od(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},sd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:w,y:b}=y;return{x:w,y:b}}},...l}=tt(e,t),c={x:n,y:r},u=await Bt(t,l),d=Kt(We(o)),h=zi(d);let m=c[h],f=c[d];if(i){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=m+u[y],v=m-u[w];m=Sr(b,m,v)}if(s){const y=d==="y"?"top":"left",w=d==="y"?"bottom":"right",b=f+u[y],v=f-u[w];f=Sr(b,f,v)}const g=a.fn({...t,[h]:m,[d]:f});return{...g,data:{x:g.x-n,y:g.y-r}}}}},ad=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=tt(e,t),l=await Bt(t,a),c=We(n),u=mt(n),d=Kt(n)==="y",{width:h,height:m}=r.floating;let f,g;c==="top"||c==="bottom"?(f=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,f=u==="end"?"top":"bottom");const y=m-l[f],w=h-l[g],b=!t.middlewareData.shift;let v=y,x=w;if(d){const S=h-l.left-l.right;x=u||b?He(w,S):S}else{const S=m-l.top-l.bottom;v=u||b?He(y,S):S}if(b&&!u){const S=he(l.left,0),k=he(l.right,0),R=he(l.top,0),C=he(l.bottom,0);d?x=h-2*(S!==0||k!==0?S+k:he(l.left,l.right)):v=m-2*(R!==0||C!==0?R+C:he(l.top,l.bottom))}await s({...t,availableWidth:x,availableHeight:v});const _=await o.getDimensions(i.floating);return h!==_.width||m!==_.height?{reset:{rects:!0}}:{}}}};function Ge(e){return qi(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ke(e){var t;return(t=(qi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qi(e){return e instanceof Node||e instanceof ge(e).Node}function Be(e){return e instanceof Element||e instanceof ge(e).Element}function _e(e){return e instanceof HTMLElement||e instanceof ge(e).HTMLElement}function Wi(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}function zt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ld(e){return["table","td","th"].includes(Ge(e))}function Or(e){const t=Pr(),n=ve(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function cd(e){let t=yt(e);for(;_e(t)&&!En(t);){if(Or(t))return t;t=yt(t)}return null}function Pr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function En(e){return["html","body","#document"].includes(Ge(e))}function ve(e){return ge(e).getComputedStyle(e)}function kn(e){return Be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function yt(e){if(Ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wi(e)&&e.host||Ke(e);return Wi(t)?t.host:t}function Gi(e){const t=yt(e);return En(t)?e.ownerDocument?e.ownerDocument.body:e.body:_e(t)&&zt(t)?t:Gi(t)}function Vt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Gi(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ge(o);return i?t.concat(s,s.visualViewport||[],zt(o)?o:[],s.frameElement&&n?Vt(s.frameElement):[]):t.concat(o,Vt(o,[],n))}function Yi(e){const t=ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=_e(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=wn(n)!==i||wn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function _r(e){return Be(e)?e:e.contextElement}function bt(e){const t=_r(e);if(!_e(t))return qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Yi(t);let s=(i?wn(n.width):n.width)/r,a=(i?wn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ud=qe(0);function Xi(e){const t=ge(e);return!Pr()||!t.visualViewport?ud:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function nt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=_r(e);let s=qe(1);t&&(r?Be(r)&&(s=bt(r)):s=bt(e));const a=dd(i,n,r)?Xi(i):qe(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const h=ge(i),m=r&&Be(r)?ge(r):r;let f=h,g=f.frameElement;for(;g&&r&&m!==f;){const y=bt(g),w=g.getBoundingClientRect(),b=ve(g),v=w.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,x=w.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=v,c+=x,f=ge(g),g=f.frameElement}}return Sn({width:u,height:d,x:l,y:c})}const fd=[":popover-open",":modal"];function Ji(e){return fd.some(t=>{try{return e.matches(t)}catch{return!1}})}function hd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ke(r),a=t?Ji(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=qe(1);const u=qe(0),d=_e(r);if((d||!d&&!i)&&((Ge(r)!=="body"||zt(s))&&(l=kn(r)),_e(r))){const h=nt(r);c=bt(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function gd(e){return Array.from(e.getClientRects())}function Zi(e){return nt(Ke(e)).left+kn(e).scrollLeft}function pd(e){const t=Ke(e),n=kn(e),r=e.ownerDocument.body,o=he(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=he(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Zi(e);const a=-n.scrollTop;return ve(r).direction==="rtl"&&(s+=he(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function md(e,t){const n=ge(e),r=Ke(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Pr();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function yd(e,t){const n=nt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=_e(e)?bt(e):qe(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Qi(e,t,n){let r;if(t==="viewport")r=md(e,n);else if(t==="document")r=pd(Ke(e));else if(Be(t))r=yd(t,n);else{const o=Xi(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Sn(r)}function es(e,t){const n=yt(e);return n===t||!Be(n)||En(n)?!1:ve(n).position==="fixed"||es(n,t)}function bd(e,t){const n=t.get(e);if(n)return n;let r=Vt(e,[],!1).filter(a=>Be(a)&&Ge(a)!=="body"),o=null;const i=ve(e).position==="fixed";let s=i?yt(e):e;for(;Be(s)&&!En(s);){const a=ve(s),l=Or(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zt(s)&&!l&&es(e,s))?r=r.filter(u=>u!==s):o=a,s=yt(s)}return t.set(e,r),r}function wd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?bd(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Qi(t,u,o);return c.top=he(d.top,c.top),c.right=He(d.right,c.right),c.bottom=He(d.bottom,c.bottom),c.left=he(d.left,c.left),c},Qi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vd(e){const{width:t,height:n}=Yi(e);return{width:t,height:n}}function xd(e,t,n){const r=_e(t),o=Ke(t),i=n==="fixed",s=nt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=qe(0);if(r||!r&&!i)if((Ge(t)!=="body"||zt(o))&&(a=kn(t)),r){const d=nt(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Zi(o));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function ts(e,t){return!_e(e)||ve(e).position==="fixed"?null:t?t(e):e.offsetParent}function ns(e,t){const n=ge(e);if(!_e(e)||Ji(e))return n;let r=ts(e,t);for(;r&&ld(r)&&ve(r).position==="static";)r=ts(r,t);return r&&(Ge(r)==="html"||Ge(r)==="body"&&ve(r).position==="static"&&!Or(r))?n:r||cd(e)||n}const Sd=async function(e){const t=this.getOffsetParent||ns,n=this.getDimensions;return{reference:xd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function Ed(e){return ve(e).direction==="rtl"}const rs={convertOffsetParentRelativeRectToViewportRelativeRect:hd,getDocumentElement:Ke,getClippingRect:wd,getOffsetParent:ns,getElementRects:Sd,getClientRects:gd,getDimensions:vd,getScale:bt,isElement:Be,isRTL:Ed};function kd(e,t){let n=null,r;const o=Ke(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const m=vn(u),f=vn(o.clientWidth-(c+d)),g=vn(o.clientHeight-(u+h)),y=vn(c),b={rootMargin:-m+"px "+-f+"px "+-g+"px "+-y+"px",threshold:he(0,He(1,l))||1};let v=!0;function x(_){const S=_[0].intersectionRatio;if(S!==l){if(!v)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(x,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return s(!0),i}function Cd(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_r(e),u=o||i?[...c?Vt(c):[],...Vt(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=c&&a?kd(c,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(w=>{let[b]=w;b&&b.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?nt(e):null;l&&y();function y(){const w=nt(e);g&&(w.x!==g.x||w.y!==g.y||w.width!==g.width||w.height!==g.height)&&n(),g=w,f=requestAnimationFrame(y)}return n(),()=>{var w;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d?.(),(w=m)==null||w.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const Od=sd,Pd=nd,_d=ad,Ad=rd,Td=td,Md=(e,t,n)=>{const r=new Map,o={platform:rs,...n},i={...o.platform,_c:r};return ed(e,t,{...o,platform:i})};function os(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function Dd(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?os(r):e?e.getBoundingClientRect():os()}}}function Ld(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const Id={top:"bottom",right:"left",bottom:"top",left:"right"};function Rd(e,t){const[n,r]=e.split("-"),o=Id[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function $d(e){const t=Pe({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=P(),[o,i]=P(),[s,a]=P(t.placement),l=()=>Dd(t.anchorRef(),t.getAnchorRect),{direction:c}=wr();async function u(){const h=l(),m=n(),f=o();if(!h||!m)return;const g=(f?.clientHeight||0)/2,y=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;m.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),h.getBoundingClientRect();const w=[id(({placement:S})=>{const k=!!S.split("-")[1];return{mainAxis:y,crossAxis:k?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const S=typeof t.flip=="string"?t.flip.split(" "):void 0;if(S!==void 0&&!S.every(Ld))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(Pd({padding:t.overflowPadding,fallbackPlacements:S}))}(t.slide||t.overlap)&&w.push(Od({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(_d({padding:t.overflowPadding,apply({availableWidth:S,availableHeight:k,rects:R}){const C=Math.round(R.reference.width);S=Math.floor(S),k=Math.floor(k),m.style.setProperty("--kb-popper-anchor-width",`${C}px`),m.style.setProperty("--kb-popper-content-available-width",`${S}px`),m.style.setProperty("--kb-popper-content-available-height",`${k}px`),t.sameWidth&&(m.style.width=`${C}px`),t.fitViewport&&(m.style.maxWidth=`${S}px`,m.style.maxHeight=`${k}px`)}})),t.hideWhenDetached&&w.push(Ad({padding:t.detachedPadding})),f&&w.push(Td({element:f,padding:t.arrowPadding}));const b=await Md(h,m,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...rs,isRTL:()=>c()==="rtl"}});if(a(b.placement),t.onCurrentPlacementChange?.(b.placement),!m)return;m.style.setProperty("--kb-popper-content-transform-origin",Rd(b.placement,c()));const v=Math.round(b.x),x=Math.round(b.y);let _;if(t.hideWhenDetached&&(_=b.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(m.style,{top:"0",left:"0",transform:`translate3d(${v}px, ${x}px, 0)`,visibility:_}),f&&b.middlewareData.arrow){const{x:S,y:k}=b.middlewareData.arrow,R=b.placement.split("-")[0];Object.assign(f.style,{left:S!=null?`${S}px`:"",top:k!=null?`${k}px`:"",[R]:"100%"})}}M(()=>{const h=l(),m=n();if(!h||!m)return;const f=Cd(h,m,u,{elementResize:typeof ResizeObserver=="function"});B(f)}),M(()=>{const h=n(),m=t.contentRef();!h||!m||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(m).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return p(Bi.Provider,{value:d,get children(){return t.children}})}const is=se();function ss(){return ue(is)}function wt(){const e=ss();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const as=se();function vt(){const e=ue(as);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
176
176
  * Portions of this file are based on code from radix-ui-primitives.
177
177
  * MIT Licensed, Copyright (c) 2022 WorkOS.
178
178
  *
179
179
  * Credits to the Radix UI team:
180
180
  * https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/menu/src/Menu.tsx
181
- */function Fd(e,t){return t?Rc([e.clientX,e.clientY],t):!1}function Nd(e){const t=vt(),n=Ai(),r=ss(),o=_e({placement:"bottom-start"},e),[i,s]=H(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=_(),[h,m]=_(),[f,g]=_(),[y,w]=_(),[b,v]=_(!0),[x,P]=_(s.placement),[S,k]=_([]),[R,C]=_([]),{DomCollectionProvider:K}=Lu({items:R,onItemsChange:C}),I=fi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:j=>i.onOpenChange?.(j)}),D=tu(()=>t.forceMount()||I.isOpen()),oe=xu({selectionMode:"none",dataSource:R}),X=j=>{v(j),I.open()},te=(j=!1)=>{I.close(),j&&r&&r.close(!0)},$=j=>{v(j),I.toggle()},U=()=>{const j=y();j&&(ce(j),oe.selectionManager().setFocused(!0),oe.selectionManager().setFocusedKey(void 0))},ie=j=>{k(ro=>[...ro,j]);const Bn=r?.registerNestedMenu(j);return()=>{k(ro=>sr(ro,j)),Bn?.()}},ze=j=>c===l?.side&&Fd(j,l?.area),Kn=j=>{ze(j)&&j.preventDefault()},it=j=>{ze(j)||U()},Ct=j=>{ze(j)&&j.preventDefault()};Zc({isDisabled:()=>!(r==null&&I.isOpen()&&t.isModal()),targets:()=>[y(),...S()].filter(Boolean)}),M(()=>{const j=y();if(!j||!r)return;const Bn=r.registerNestedMenu(j);B(()=>{Bn()})});const Jp={dataset:O(()=>({"data-expanded":I.isOpen()?"":void 0,"data-closed":I.isOpen()?void 0:""})),isOpen:I.isOpen,contentPresence:D,nestedMenus:S,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>oe,parentMenuContext:()=>r,triggerRef:f,contentRef:y,triggerId:u,contentId:h,setTriggerRef:g,setContentRef:w,open:X,close:te,toggle:$,focusContent:U,onItemEnter:Kn,onItemLeave:it,onTriggerLeave:Ct,setPointerDir:j=>c=j,setPointerGraceTimeoutId:j=>a=j,setPointerGraceIntent:j=>l=j,registerNestedMenu:ie,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:gn(d),registerContentId:gn(m)};return p(K,{get children(){return p(is.Provider,{value:Jp,get children(){return p($d,T({anchorRef:f,contentRef:y,onCurrentPlacementChange:P},s))}})}})}const Kd=se();function Bd(e){let t;const n=vt(),r=wt(),o=_e({id:n.generateId(`item-${Ce()}`)},e),[i,s]=H(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=_(),[c,u]=_(),[d,h]=_(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Iu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const w=wu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=C=>{de(C,i.onPointerMove),C.pointerType==="mouse"&&(i.disabled?r.onItemLeave(C):(r.onItemEnter(C),C.defaultPrevented||(ce(C.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},v=C=>{de(C,i.onPointerLeave),C.pointerType==="mouse"&&r.onItemLeave(C)},x=C=>{de(C,i.onPointerUp),!i.disabled&&C.button===0&&y()},P=C=>{if(de(C,i.onKeyDown),!C.repeat&&!i.disabled)switch(C.key){case"Enter":case" ":y();break}},S=O(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=O(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),R={isChecked:()=>i.checked,dataset:k,setLabelRef:h,generateId:ti(()=>s.id),registerLabel:gn(l),registerDescription:gn(u)};return p(Kd.Provider,{value:R,get children(){return p(pn,T({as:"div",ref(C){var K=tt(I=>t=I,i.ref);typeof K=="function"&&K(C)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return w.dataKey()},get onPointerDown(){return be([i.onPointerDown,w.onPointerDown])},get onPointerUp(){return be([x,w.onPointerUp])},get onClick(){return be([i.onClick,w.onClick])},get onKeyDown(){return be([P,w.onKeyDown])},get onMouseDown(){return be([i.onMouseDown,w.onMouseDown])},get onFocus(){return be([i.onFocus,w.onFocus])},onPointerMove:b,onPointerLeave:v},k,s))}})}const zd=se();function ls(){return ue(zd)}function Vd(e){let t;const n=vt(),r=wt(),o=ls(),i=_e({id:n.generateId(`content-${Ce()}`)},e),[s,a]=H(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=Eu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Xc({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Oe(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case"ArrowRight":y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=y=>{s.onEscapeKeyDown?.(y),o?.setAutoFocusMenu(!1),r.close(!0)},m=y=>{s.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},f=y=>{de(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=y=>{if(de(y,s.onPointerMove),y.pointerType!=="mouse")return;const w=y.target,b=l!==y.clientX;Oe(y.currentTarget,w)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return M(()=>B(r.registerContentId(s.id))),p(J,{get when(){return r.contentPresence.isPresent()},get children(){return p(Hu,{get children(){return p(Uu,T({ref(y){var w=tt(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof w=="function"&&w(y)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return O(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return be([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return be([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return be([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return be([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Ud(e){let t;const n=vt(),r=wt(),[o,i]=H(e,["ref"]);return Ni({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),p(Vd,T({ref(s){var a=tt(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function jd(e){return p(Bd,T({role:"menuitem",closeOnSelect:!0},e))}function Hd(e){const t=wt();return p(J,{get when(){return t.contentPresence.isPresent()},get children(){return p(_o,e)}})}function qd(e){const t=`menu-${Ce()}`,n=_e({id:t,modal:!0},e),[r,o]=H(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=fi({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ti(()=>r.id),value:()=>r.value};return p(as.Provider,{value:s,get children(){return p(Nd,T({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Wd(e){const t=vt(),n=wt(),r=ls(),o=_e({id:t.generateId("trigger")},e),[i,s]=H(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,M(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),M(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),M(()=>{n.isOpen()&&r.setValue(a)}),B(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{de(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},u=f=>{de(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},d=f=>{if(de(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),$c(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{de(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{de(f,i.onFocus),r!==void 0&&r.setValue(a)};return M(()=>B(n.registerTriggerId(i.id))),p(Ou,T({ref(f){var g=tt(n.setTriggerRef,i.ref);typeof g=="function"&&g(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return O(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:h,onClick:u,onKeyDown:d,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Gd(e){const t=vt(),n=wt(),[r,o]=H(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return p(Ud,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||ce(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function Yd(e){const t=`dropdownmenu-${Ce()}`,n=_e({id:t},e);return p(qd,n)}function Xd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-left",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6"/>'},e)}function Jd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-right",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6"/>'},e)}function Zd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function Qd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function ef(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const tf=e=>p(Yd,T({gutter:4},e)),nf=Wd,rf=e=>{const[,t]=H(e,["class"]);return p(Hd,{get mount(){return ln()},get children(){return p(Gd,T({get class(){return je("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},of=e=>{const[,t]=H(e,["class"]);return p(jd,T({get class(){return je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function sf(e){return e.type==="buttons"&&e.buttons.options.length>3?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function af(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function lf(e,t,n){const r=`${rr}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function cf(e,t,n){if(!e||!t||!n)return;const r=`${rr}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const Ae=Object.create(null);Ae.open="0",Ae.close="1",Ae.ping="2",Ae.pong="3",Ae.message="4",Ae.upgrade="5",Ae.noop="6";const En=Object.create(null);Object.keys(Ae).forEach(e=>{En[Ae[e]]=e});const Pr={type:"error",data:"parser error"},cs=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",us=typeof ArrayBuffer=="function",ds=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ar=({type:e,data:t},n,r)=>cs&&t instanceof Blob?n?r(t):fs(t,r):us&&(t instanceof ArrayBuffer||ds(t))?n?r(t):fs(new Blob([t]),r):r(Ae[e]+(t||"")),fs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function hs(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Tr;function uf(e,t){if(cs&&e.data instanceof Blob)return e.data.arrayBuffer().then(hs).then(t);if(us&&(e.data instanceof ArrayBuffer||ds(e.data)))return t(hs(e.data));Ar(e,!1,n=>{Tr||(Tr=new TextEncoder),t(Tr.encode(n))})}const gs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ut=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<gs.length;e++)Ut[gs.charCodeAt(e)]=e;const df=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)i=Ut[e.charCodeAt(r)],s=Ut[e.charCodeAt(r+1)],a=Ut[e.charCodeAt(r+2)],l=Ut[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|l&63;return c},ff=typeof ArrayBuffer=="function",Mr=(e,t)=>{if(typeof e!="string")return{type:"message",data:ps(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:hf(e.substring(1),t)}:En[n]?e.length>1?{type:En[n],data:e.substring(1)}:{type:En[n]}:Pr},hf=(e,t)=>{if(ff){const n=df(e);return ps(n,t)}else return{base64:!0,data:e}},ps=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ms="",gf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Ar(i,!1,a=>{r[s]=a,++o===n&&t(r.join(ms))})})},pf=(e,t)=>{const n=e.split(ms),r=[];for(let o=0;o<n.length;o++){const i=Mr(n[o],t);if(r.push(i),i.type==="error")break}return r};function mf(){return new TransformStream({transform(e,t){uf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Dr;function kn(e){return e.reduce((t,n)=>t+n.length,0)}function Cn(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function yf(e,t){Dr||(Dr=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(kn(n)<1)break;const l=Cn(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(kn(n)<2)break;const l=Cn(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(kn(n)<8)break;const l=Cn(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Pr);break}o=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(kn(n)<o)break;const l=Cn(n,o);a.enqueue(Mr(i?l:Dr.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Pr);break}}}})}const ys=4;function Z(e){if(e)return bf(e)}function bf(e){for(var t in Z.prototype)e[t]=Z.prototype[t];return e}Z.prototype.on=Z.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Z.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Z.prototype.off=Z.prototype.removeListener=Z.prototype.removeAllListeners=Z.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this},Z.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},Z.prototype.emitReserved=Z.prototype.emit,Z.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Z.prototype.hasListeners=function(e){return!!this.listeners(e).length};const On=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),xe=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),wf="arraybuffer";function Zp(){}function bs(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const vf=xe.setTimeout,xf=xe.clearTimeout;function _n(e,t){t.useNativeTimers?(e.setTimeoutFn=vf.bind(xe),e.clearTimeoutFn=xf.bind(xe)):(e.setTimeoutFn=xe.setTimeout.bind(xe),e.clearTimeoutFn=xe.clearTimeout.bind(xe))}const Sf=1.33;function Ef(e){return typeof e=="string"?kf(e):Math.ceil((e.byteLength||e.size)*Sf)}function kf(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ws(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Cf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Of(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class _f extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Lr extends Z{constructor(t){super(),this.writable=!1,_n(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new _f(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Mr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Cf(t);return n.length?"?"+n:""}}class Pf extends Lr{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};pf(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,gf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ws()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let vs=!1;try{vs=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Af=vs;function Tf(){}class Mf extends Pf{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Te extends Z{constructor(t,n,r){super(),this.createRequest=t,_n(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=bs(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Te.requestsCount++,Te.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Tf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Te.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Te.requestsCount=0,Te.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",xs);else if(typeof addEventListener=="function"){const e="onpagehide"in xe?"pagehide":"unload";addEventListener(e,xs,!1)}}function xs(){for(let e in Te.requests)Te.requests.hasOwnProperty(e)&&Te.requests[e].abort()}const Df=function(){const e=Ss({xdomain:!1});return e&&e.responseType!==null}();class Lf extends Mf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Df&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Te(Ss,this.uri(),t)}}function Ss(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Af))return new XMLHttpRequest}catch{}if(!t)try{return new xe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Es=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class If extends Lr{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Es?{}:bs(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;Ar(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&On(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ws()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ir=xe.WebSocket||xe.MozWebSocket;class Rf extends If{createSocket(t,n,r){return Es?new Ir(t,n,r):n?new Ir(t,n):new Ir(t)}doWrite(t,n){this.ws.send(n)}}class $f extends Lr{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=yf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=mf();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&On(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Ff={websocket:Rf,webtransport:$f,polling:Lf},Nf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Kf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Rr(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=Nf.exec(e||""),i={},s=14;for(;s--;)i[Kf[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Bf(i,i.path),i.queryKey=zf(i,i.query),i}function Bf(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function zf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const $r=typeof addEventListener=="function"&&typeof removeEventListener=="function",Pn=[];$r&&addEventListener("offline",()=>{Pn.forEach(e=>e())},!1);class Ye extends Z{constructor(t,n){if(super(),this.binaryType=wf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Rr(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Rr(n.host).host);_n(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Of(this.opts.query)),$r&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Pn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ys,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ye.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ye.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=Ef(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,On(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ye.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),$r&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Pn.indexOf(this._offlineEventListener);r!==-1&&Pn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ye.protocol=ys;class Vf extends Ye{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ye.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ye.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Uf=class extends Vf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Ff[o]).filter(o=>!!o)),super(t,r)}};function jf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Rr(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const Hf=typeof ArrayBuffer=="function",qf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ks=Object.prototype.toString,Wf=typeof Blob=="function"||typeof Blob<"u"&&ks.call(Blob)==="[object BlobConstructor]",Gf=typeof File=="function"||typeof File<"u"&&ks.call(File)==="[object FileConstructor]";function Fr(e){return Hf&&(e instanceof ArrayBuffer||qf(e))||Wf&&e instanceof Blob||Gf&&e instanceof File}function An(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(An(e[n]))return!0;return!1}if(Fr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return An(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&An(e[n]))return!0;return!1}function Yf(e){const t=[],n=e.data,r=e;return r.data=Nr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Nr(e,t){if(!e)return e;if(Fr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Nr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Nr(e[r],t));return n}return e}function Xf(e,t){return e.data=Kr(e.data,t),delete e.attachments,e}function Kr(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Kr(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Kr(e[n],t));return e}const Jf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Zf=5;var V;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(V||(V={}));class Qf{constructor(t){this.replacer=t}encode(t){return(t.type===V.EVENT||t.type===V.ACK)&&An(t)?this.encodeAsBinary({type:t.type===V.EVENT?V.BINARY_EVENT:V.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===V.BINARY_EVENT||t.type===V.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Yf(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Cs(e){return Object.prototype.toString.call(e)==="[object Object]"}class Br extends Z{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===V.BINARY_EVENT;r||n.type===V.BINARY_ACK?(n.type=r?V.EVENT:V.ACK,this.reconstructor=new eh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Fr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(V[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===V.BINARY_EVENT||r.type===V.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Br.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case V.CONNECT:return Cs(n);case V.DISCONNECT:return n===void 0;case V.CONNECT_ERROR:return typeof n=="string"||Cs(n);case V.EVENT:case V.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Jf.indexOf(n[0])===-1);case V.ACK:case V.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eh{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Xf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const th=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Br,Encoder:Qf,get PacketType(){return V},protocol:Zf},Symbol.toStringTag,{value:"Module"}));function ke(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Os extends Z{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ke(t,"open",this.onopen.bind(this)),ke(t,"packet",this.onpacket.bind(this)),ke(t,"error",this.onerror.bind(this)),ke(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(nh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:V.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:V.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case V.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case V.EVENT:case V.BINARY_EVENT:this.onevent(t);break;case V.ACK:case V.BINARY_ACK:this.onack(t);break;case V.DISCONNECT:this.ondisconnect();break;case V.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:V.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:V.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function xt(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}xt.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},xt.prototype.reset=function(){this.attempts=0},xt.prototype.setMin=function(e){this.ms=e},xt.prototype.setMax=function(e){this.max=e},xt.prototype.setJitter=function(e){this.jitter=e};class zr extends Z{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,_n(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new xt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||th;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Uf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=ke(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=ke(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ke(t,"ping",this.onping.bind(this)),ke(t,"data",this.ondata.bind(this)),ke(t,"error",this.onerror.bind(this)),ke(t,"close",this.onclose.bind(this)),ke(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){On(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Os(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const jt={};function Tn(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=jf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=jt[o]&&i in jt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new zr(r,t):(jt[o]||(jt[o]=new zr(r,t)),l=jt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Tn,{Manager:zr,Socket:Os,io:Tn,connect:Tn});class ot{static instance;constructor(){}static init(){return ot.instance||(ot.instance=Tn(Nl,{path:"/ws",withCredentials:!0}),ot.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),ot.instance}static on(t,n){ot.instance||this.init().on(t,n)}}const _s=1e3*60*60*24,[Mn,Ps]=No("smarttalks-widget-messages",{},_s),As=()=>{const{widgetId:e}=ee();return Mn[e()]??[]},rh=e=>{const{widgetId:t}=ee();Ps({...Mn,[t()]:[...Mn[t()]??[],e]})},oh=()=>{const{widgetId:e}=ee();Ps({...Mn,[e()]:[]})},[Ts,ih]=No("smarttalks-widget-conversationinfo",{},_s),Ms=()=>{const{widgetId:e}=ee();return Ts[e()]??{}},Ds=e=>{const{widgetId:t}=ee();ih({...Ts,[t()]:e})},[sh,Vr]=_(!1),[ah,Ls]=_(!1),Is=[],Rs=()=>{Is.forEach(e=>e())},lh=e=>Is.push(e),Ur=e=>{const t=sf(e);if(rh(t),t.type==="media"){setTimeout(Rs,200);return}Rs()},ch=(e,t)=>{const{chatWidget:n}=ee(),r=Ms();e.trim()&&(Ur({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ot.on("message",o=>{(o.contactId!==r.contactId||o.interactionId!==r.interactionId)&&Ds({contactId:o.contactId,interactionId:o.interactionId});for(const i of o.messages)Ur(i);Vr(!1),af(o.debug)}),Vr(!0),lf(e,t,n()?._id).catch(o=>{console.error(o),Vr(!1)}))},uh=()=>{const{chatWidget:e}=ee(),t=Ms();Ls(!0),oh(),cf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ds({}),Ls(!1),dh()})},dh=()=>{const{chatWidget:e}=ee();if(As().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Ur({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Xe=()=>({getMessages:As,pushMessage:ch,clearMessages:uh,onMessage:lh,typing:sh,loading:ah});var fh=L("<span>");const hh=()=>{const{clearMessages:e}=Xe();_(!1);const[t,n]=_(!1);return p(tf,{get open(){return t()},onOpenChange:n,get children(){return[p(nf,{get children(){return p(ye,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return p(ec,{size:20})}})}}),p(rf,{get children(){return p(of,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[p(Ql,{size:14}),(()=>{var r=fh();return A(r,()=>ft("restart")),r})()]}})}})]}})};function gh(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function ph(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function mh(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var yh=L('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const jr=()=>{const{chatWidget:e}=ee(),[t,n]=_(!1),r=()=>{const i=ln();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=ln();i&&(i.style.display="none")}};return(()=>{var i=yh(),s=i.firstChild;return A(i,p(Jl,{}),s),A(s,p(ye,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return p(J,{get when(){return t()},get fallback(){return p(ph,{size:16})},get children(){return p(gh,{size:16})}})}}),null),A(s,p(J,{get when(){return e()?.showSettings},get children(){return p(hh,{})}}),null),A(s,p(J,{get when(){return e()?.mode==="popup"},get children(){return p(ye,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return p(mh,{size:16})}})}}),null),i})()};var bh=L("<span>");const $s=({createdAt:e,anchor:t="end"})=>(()=>{var n=bh();return Ze(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var wh=L('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const vh=({children:e,createdAt:t})=>(()=>{var n=wh(),r=n.firstChild;return A(r,e),A(n,p($s,{createdAt:t,anchor:"start"}),null),n})();var xh=L("<span>");const St=e=>{const[,t]=H(e,["class","children"]);let n=e.children?.toString();return n&&(n=Rl($l(n))),(()=>{var r=xh();return r.innerHTML=n,Qe(r,T({get class(){return je("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Sh=L('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const Eh=({options:e,text:t})=>{let n;const{pushMessage:r}=Xe(),[o,i]=_(!1),s=(l=!0)=>{if(n){const c=n.clientWidth/2;n.scrollTo({left:n.scrollLeft+(l?c:-c),behavior:"smooth"})}},a=(l,c)=>{i(!0),r(l,c)};return(()=>{var l=Sh(),c=l.firstChild,u=c.firstChild;A(l,p(St,{get children(){return t?.trim()}}),c),A(c,p(J,{get when(){return e.length>1},get children(){return p(ye,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return p(Xd,{size:20})}})}}),u);var d=n;return typeof d=="function"?So(d,u):n=u,A(u,p(at,{each:e,children:h=>p(ye,{variant:"outline",get disabled(){return o()},class:"px-2 py-0 snap-center text-nowrap",onClick:()=>a(h.label,h.value),get children(){return h.label?.trim()}})})),A(c,p(J,{get when(){return e.length>1},get children(){return p(ye,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return p(Jd,{size:20})}})}}),null),Q(()=>Ze(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var kh=L('<div class="flex flex-col"><span>'),Ch=L("<a target=_blank><img><span></span><span>");const Oh=({options:e,text:t})=>(()=>{var n=kh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,p(at,{each:e,children:o=>(()=>{var i=Ch(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),Q(c=>{var u=o.url,d=o.image;return u!==c.e&&ae(i,"href",c.e=u),d!==c.t&&ae(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var _h=L("<a target=_blank>");const Ph=({url:e,text:t})=>(()=>{var n=_h();return ae(n,"href",e),A(n,()=>t?.trim()),n})();var Ah=e=>{const t=T({initialRegistered:!1},e),[n,r]=_(t.initialRegistered);return[O(()=>{if(n())return z(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Fs=Ah,Ht=e=>typeof e=="function",Th=["button","color","file","image","reset","submit"],Mh=(e,t)=>e==="button"?!0:e==="input"&&t?Th.indexOf(t)!==-1:!1;function Dh(e){const[t,n]=_(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>W(()=>{let a;return Ht(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Hr=Dh,Dn=new Map,Ln=(e,t)=>{if(Dn.has(e))return Dn.get(e);const n=se(t);return Dn.set(e,n),n},qr=e=>{const t=Dn.get(e);if(t)return ue(t)},Lh=e=>{const t=T({enabled:!0},e);M(()=>{z(t.enabled)&&(document.addEventListener("keydown",n),B(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Ih=Lh,Rh=e=>{const t=T({enabled:!0},e);M(()=>{const{body:n}=document;z(t.enabled)&&vr({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},$h=Rh,Fh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);M(()=>{if(!z(t.enabled))return;const r=z(t.strategy);document.addEventListener(r,n),B(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=z(t.element),i=z(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Nh=Fh,Kh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Ih({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Nh({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),$h({enabled:t.noOutsidePointerEvents})},Bh=Kh,Wr=se(),zh=e=>O(()=>{if(ue(Wr))return p(Ns,e);const r=Ce(),[o,i]=_([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return p(Wr.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return p(Ns,e)}})}),Ns=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=H(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ue(Wr),i=Ce();M(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Bh({dismissOnEscapeKeyDown:()=>z(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>z(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>z(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=O(()=>n.children),l=()=>{const c=a();return Ht(c)?c({get isLastLayer(){return s()}}):c};return W(()=>l())},Vh=zh,Uh=()=>{const[e,t]=_(!1);return M(()=>t(!0)),e},jh=Uh,Hh=(e,t)=>(e&&(Ht(e)?e(t):e[0](e[1],t)),t.defaultPrevented),Gr=(...e)=>e.some(t=>!!t()),qh=e=>(...t)=>{for(const n of e)n&&n(...t)},In=(...e)=>qh(e),re=e=>e?"":void 0,Wh="div",Gh=e=>{const[t,n]=H(e,["as"]),r=O(()=>t.as??Wh);return O(()=>{const i=r();switch(typeof i){case"function":return W(()=>i(n));case"string":return p(tn,T({component:i},n))}})},Yr=Gh,Yh=e=>{let t,n=!1;return()=>n?t:(n=!0,t=O(e))},Ks=Yh,Xh=e=>O(()=>z(e.element)?.tagName.toLowerCase()||e.fallback),Jh=Xh,Bs="button",Zh=e=>{const[t,n]=_(null),[r,o]=H(e,["as","ref","type"]),i=Jh({element:t,fallback:Bs}),s=O(()=>Mh(i(),r.type));return p(Yr,T({get as(){return r.as??Bs},ref(a){var l=In(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},Qh=Zh,pe=e=>typeof e=="function"?e():e,Rn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),eg='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',Xr="focusTrap.initialFocus",Jr="focusTrap.finalFocus",zs={bubbles:!1,cancelable:!0},tg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=_(null),o=O(()=>{const f=n();return f?f[0]??null:null}),i=O(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{l(pe(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(pe(t.element))};M(()=>{const f=pe(t.element);if(f&&pe(t.enabled)){s=document.activeElement,W(()=>{l(f),c(f)});const g=new MutationObserver(a);pe(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),B(()=>{pe(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),M(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),B(()=>{document.removeEventListener("keydown",h)}))}),M(()=>{const f=o();f&&(f.addEventListener("keydown",u),B(()=>{f.removeEventListener("keydown",u)}))}),M(()=>{const f=i();f&&(f.addEventListener("keydown",d),B(()=>{f.removeEventListener("keydown",d)}))});const l=f=>{r(Array.from(f.querySelectorAll(eg)))},c=f=>{const g=pe(t.initialFocusElement)??o()??f,y=t.onInitialFocus;let w;y&&(w=new CustomEvent(Xr,zs),f.addEventListener(Xr,y),f.dispatchEvent(w),f.removeEventListener(Xr,y)),w?.defaultPrevented!==!0&&Rn(()=>g.focus())},u=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},d=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},m=f=>{if(!pe(t.restoreFocus))return;const y=pe(t.finalFocusElement)??s;if(!y)return;let w;const b=t.onFinalFocus;b&&(w=new CustomEvent(Jr,zs),f.addEventListener(Jr,b),f.dispatchEvent(w),f.removeEventListener(Jr,b)),w?.defaultPrevented!==!0&&Rn(()=>y.focus())}},ng=tg,rg=ng,$n=e=>typeof e=="function"?e():e,og=e=>{const t=O(()=>{const s=$n(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=_($n(e.show)?"present":"hidden");let i="none";return M(s=>{const a=$n(e.show);return W(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),M(()=>{const s=$n(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),B(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},ig=og,Vs=ig,sg=se(),ag=e=>e?Ln(`dialog-${e}`):sg,Us=se(),lg=e=>e?Ln(`dialog-internal-${e}`):Us,Et=e=>{if(!e){const n=ue(Us);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=qr(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},cg="div",ug=e=>{const[t,n]=H(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=O(()=>Et(t.contextId)),o=()=>Gr(r().open,()=>t.forceMount,r().contentPresent),i=O(s=>s||o(),!1);return p(J,{get when(){return i()},get children(){return p(Vh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(Yr,T({ref(l){var c=In(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??cg},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return re(r().open())},get"data-closed"(){return re(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},dg=ug,fg="div",hg=e=>{const[t,n]=H(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=O(()=>Et(t.contextId)),o=()=>Gr(r().open,()=>t.forceMount,r().overlayPresent),i=O(s=>s||o(),!1);return p(J,{get when(){return i()},get children(){return(()=>{const s=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(Yr,T({get as(){return t.as??fg},ref(a){var l=In(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return re(r().open())},get"data-closed"(){return re(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return s()}}))}})})()}})},gg=hg,pg=e=>{const[t,n]=H(e,["forceMount","contextId","children"]),r=O(()=>Et(t.contextId)),o=()=>Gr(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=jh(),s=O(a=>a||o()&&i(),!1);return p(J,{get when(){return s()},get children(){return(()=>{const a=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(_o,T(n,{get children(){return a()}}))}})})()}})},mg=pg,Zr=!0,yg=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Zr),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Zr),preventScroll:()=>!!(e.modal??Zr),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ce()},e),[n,r]=Hr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Fs({value:()=>t.labelId??Ce()}),[a,l,c]=Fs({value:()=>t.descriptionId??Ce()}),[u,d]=_(null),[h,m]=_(null),[f,g]=_(null),{present:y}=Vs({show:n,element:h}),{present:w}=Vs({show:n,element:f});rg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ni({element:h,enabled:()=>y()&&z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return z(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return z(t.noOutsidePointerEvents)},get preventScroll(){return z(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return z(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return y()},get contentRef(){return h()},get overlayPresent(){return w()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},v=Ks(()=>t.children),x=()=>{const S=v()();return Ht(S)?S(b):S};return O(()=>{const S=ag(t.contextId),k=lg(t.contextId);return p(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return p(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:g,triggerRef:u,setTriggerRef:d}},get children(){return W(()=>x())}})}})})},bg=yg,wg="button",vg=e=>{const[t,n]=H(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=O(()=>Et(t.contextId));return p(Qh,T({ref(i){var s=In(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??wg},onClick:i=>{!Hh(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return re(r().open())},get"data-closed"(){return re(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},xg=vg;function Sg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=_(!1),[o,i]=_(null);let s=null;M(()=>{const c=pe(t.element),u=pe(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),B(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const u=c.target,d=[u.offsetWidth,u.offsetHeight],h=pe(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Se(()=>{i(s),r(!0)}),Rn(()=>{i(d),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d:s?Fn(h,s)!==Fn(h,d)&&(Se(()=>{i(Fn(h,s)),r(!0)}),Rn(()=>{i(Fn(h,d)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d},l=()=>{if(!n())return;const c=pe(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Se(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Fn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Eg=Sg,kg=Eg,Cg=(e,t)=>e.length>0?()=>e(W(t)):e;function Og(e,t){let n=0;const r=e.map((o,i)=>O(()=>(n=i,o()),void 0,Qo));return O(()=>r.map(o=>o())[n],void 0,t)}function js(e,t,n){let r=()=>t;const[o,i]=_(t,Qo),s=O(Cg(e,()=>r()),t);return[r=Og([o,s],n),a=>i(()=>typeof a=="function"?a(W(r)):a)]}var _g=e=>p(xg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Hs=se(),Pg=e=>e?Ln(`drawer-${e}`):Hs,Ag=e=>{if(!e){const n=ue(Hs);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=qr(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},qs=se(),Tg=e=>e?Ln(`drawer-internal-${e}`):qs,Ws=e=>{if(!e){const n=ue(qs);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=qr(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},Gs=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Nn(e,t)};const o=r[n-1]?Nn(r[n-1],t):void 0,i=r[n]?Nn(r[n],t):void 0;return{value:e,offset:Nn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Nn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},Mg=(e,t,n,r)=>{const o=Ys("upper",e,r?n:t),i=Ys("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Ys=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Dg=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},Lg=void 0,Ig=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[Lg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,U)=>{const ie=$/U;return ie<1&&ie>-1?1:ie},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=H(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=Hr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Hr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=_(),{transitioning:u,transitionSize:d}=kg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,m]=_(!1),[f,g]=js(()=>u()?"resizing":null),y=O(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[w,b]=_(!1);M(()=>{const $=o();W(()=>{w()!==$&&($?(b(!0),Di(()=>{Se(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&g(null)})):(Se(()=>{g("closing"),a(0)}),Di(()=>{parseFloat(y().transitionDuration)===0&&v()})))})});const v=()=>{Se(()=>{b(!1),g(null)})},[x,P]=_(0);M(()=>{const $=l()?.contentRef();if(!$)return;k($);const U=new ResizeObserver(S);U.observe($),B(()=>{U.disconnect()})});const S=$=>{for(const U of $)U.target===l()?.contentRef()&&k(U.target)},k=$=>{const U=W(()=>x());switch(n.side){case"top":case"bottom":if(U===$.offsetHeight)return;P($.offsetHeight);break;case"left":case"right":if(U===$.offsetWidth)return;P($.offsetWidth);break}},R=O(()=>Gs(s(),x())),[C,K]=js(()=>R().offset),I=O(()=>x()?(x()-C())/x():0),D={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return I()},get translate(){return C()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},oe=Ks(()=>n.children),X=$=>{c(Et(n.contextId));const U=oe()();if(Ht(U)){const ie=T($,D);return U(ie)}return U};return O(()=>{const $=Pg(n.contextId),U=Tg(n.contextId);return W(()=>p($.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return p(U.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:K,drawerSize:x,resolvedActiveSnapPoint:R,drawerStyles:y,setTransitionState:g,transitionSize:d,closeDrawer:v}},get children(){return p(bg,T({get open(){return w()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:ie=>X(ie)}))}})}}))})},Rg=Ig,$g=e=>{const[t,n]=H(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=O(()=>Ws(t.contextId)),c=O(()=>Et(t.contextId)),u=O(()=>l().snapPoints().map((v,x)=>Gs(v,l().drawerSize(),x,l().breakPoints()))),d=O(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),h=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"top":case"bottom":return`${v}px`}}),m=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"left":case"right":return`${v}px`}});M(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),B(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=v=>{Dg(v.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[v.clientX,v.clientY]))},g=v=>{w(v.target,v.clientX,v.clientY)},y=v=>{v.touches[0]&&w(v.target,v.touches[0].clientX,v.touches[0].clientY)},w=(v,x,P)=>{if(!r)return;if(!l().isDragging()||o===null){const R=window.getSelection();if(R&&R.toString().length>0){b();return}if(l().handleScrollableElements()){const C=[x,P].map((te,$)=>i[$]-te),K=Math.abs(C[0])>Math.abs(C[1])?"x":"y",I=K==="x"?C[0]:C[1];if(Math.abs(I)<.3)return;const D=c().contentRef(),[oe,X]=Li(v,K,D);if(I>0&&Math.abs(oe)>1||I<0&&Math.abs(X)>0){b();return}}switch(l().side()){case"top":case"bottom":o=P;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Se(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let S;switch(l().side()){case"top":S=-(o-P);break;case"bottom":S=o-P;break;case"right":S=o-x;break;case"left":S=-(o-x);break}S-=l().resolvedActiveSnapPoint().offset,S>0&&(S=l().dampFunction(S));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-S)},b=()=>{if(r=!1,!l().isDragging())return;const v=new Date,x=l().velocityFunction(-(a-l().translate()),v.getTime()-s.getTime()||1),P=l().translate()*x,S=Mg(u(),l().translate(),P,l().allowSkippingSnapPoints());Se(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Se(()=>{l().setActiveSnapPoint(S.value),S.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(S.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return p(dg,T({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:m(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Se(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return re(l().isTransitioning())},get"data-opening"(){return re(l().transitionState()==="opening")},get"data-closing"(){return re(l().transitionState()==="closing")},get"data-snapping"(){return re(l().transitionState()==="snapping")},get"data-resizing"(){return re(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Fg=$g,Ng=e=>{const[t,n]=H(e,["contextId"]),r=O(()=>Ws(t.contextId));return p(gg,T({get contextId(){return t.contextId},get"data-transitioning"(){return re(r().isTransitioning())},get"data-opening"(){return re(r().transitionState()==="opening")},get"data-closing"(){return re(r().transitionState()==="closing")},get"data-snapping"(){return re(r().transitionState()==="snapping")},get"data-resizing"(){return re(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Kg=Ng,Bg=L('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const zg=Rg,Vg=_g,Ug=mg,jg=e=>{const[,t]=H(e,["class"]),n=Ag();return p(Kg,T({get class(){return je("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},Hg=e=>{const[,t]=H(e,["class","children"]);return p(Ug,{get mount(){return ln()},get children(){return[p(jg,{}),p(Fg,T({id:"smarttalks-list-content",get class(){return je("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[Bg(),O(()=>e.children)]}}))]}})};var qg=L('<span class="font-semibold mt-2">'),Wg=L('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),Gg=L('<div class="flex flex-col space-y-2"><div>'),Yg=L('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),Xg=L('<div class="flex flex-col items-start"><span class=text-slate-500>');const Jg=({options:e,text:t,title:n})=>{const{pushMessage:r}=Xe(),[o,i]=_(!1),[s,a]=_(!1),[l,c]=_(),u=(h,m)=>{a(!1),i(!0),r(h,m)},d=h=>{const m=h.composedPath();for(const f of m)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=Gg(),m=h.firstChild;return A(h,p(St,{get children(){return t?.trim()}}),m),A(m,p(zg,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[p(Vg,{as:ye,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??ft("selectOption")}}),p(Hg,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=qg();return A(f,()=>n?.trim()??ft("selectOption")),f})(),(()=>{var f=Wg();return A(f,p(at,{each:e,children:g=>(()=>{var y=Yg(),w=y.firstChild;return A(w,()=>g.label?.trim()??""),A(y,p(at,{get each(){return g.items},children:b=>p(ye,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===b?"bg-slate-200":""}`},onClick:()=>c(b),get children(){return[(()=>{var v=Xg(),x=v.firstChild;return A(v,()=>b.label?.trim(),x),A(x,()=>b.description?.trim()),v})(),p(J,{get when(){return l()===b},get fallback(){return p(Qd,{class:"size-4 text-slate-500"})},get children(){return p(Zd,{class:"size-4 text-slate-500"})}})]}})}),null),y})()})),f})(),p(ye,{get disabled(){return o()||!l()},onClick:()=>u(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return ft("send")}})]}})]}})),Q(()=>Ze(m,o()?"opacity-50":"")),h})()};var Zg=L("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const Qg=e=>(()=>{var t=Zg(),n=t.firstChild,r=n.nextSibling;return Q(o=>{var i=e.link,s=e.link;return i!==o.e&&ae(n,"src",o.e=i),s!==o.t&&ae(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var ep=L('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const tp=e=>(()=>{var t=ep(),n=t.firstChild,r=n.firstChild;return A(n,p(ef,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(()=>ae(n,"href",e.link)),t})();var np=L('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const rp=e=>(()=>{var t=np(),n=t.firstChild,r=n.firstChild;return A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ae(n,"href",o.e=i),s!==o.t&&ae(r,"src",o.t=s),a!==o.a&&ae(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var op=L('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const ip=e=>(()=>{var t=op(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(i=>{var s=e.link,a=e.link;return s!==i.e&&ae(r,"src",i.e=s),a!==i.t&&ae(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var sp=L("<div>Media type not supported");const Xs=e=>e.type==="image"?p(rp,e):e.type==="audio"?p(Qg,e):e.type==="document"?p(tp,e):e.type==="video"?p(ip,e):sp(),Qr=({text:e})=>p(St,{get children(){return e?.trim()}});var ap=L("<div>Unknown bot message type");const lp=e=>p(vh,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Qr,{get text(){return e.text}}):e.type==="buttons"?p(Eh,T(()=>e.buttons)):e.type==="list"?p(Jg,T(()=>e.list)):e.type==="media"?p(Xs,T(()=>e.media)):e.type==="link"?p(Ph,T(()=>e.link)):e.type==="cards"?p(Oh,T(()=>e.cards)):e.type==="date"?p(Qr,{get text(){return e.text}}):ap()}});var cp=L('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const up=e=>(()=>{var t=cp(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var dp=L('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const fp=({children:e,createdAt:t})=>(()=>{var n=dp(),r=n.firstChild;return A(r,e),A(n,p($s,{createdAt:t,anchor:"end"}),null),n})();var hp=L("<div>Unknown user message type");const gp=e=>p(fp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(Qr,{get text(){return e.text}}):e.type==="media"?p(Xs,T(()=>e.media)):hp()}});var pp=L("<div>Unknown message origin");const mp=e=>e.origin==="bot"?p(lp,e):e.origin==="user"?p(gp,e):e.origin==="service"?p(up,e):pp();function yp(e){return le({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function kt(e){return le({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var bp=L('<div class="place-self-start py-1"><div class="animate-pulse bg-white flex space-x-1 shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl text-slate-400">');const wp=()=>(()=>{var e=bp(),t=e.firstChild;return A(t,p(kt,{class:"size-2 animate-bounce"}),null),A(t,p(kt,{class:"size-2 animate-bounce delay-150"}),null),A(t,p(kt,{class:"size-2 animate-bounce delay-300"}),null),e})();var vp=L('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),xp=L("<div>");const eo=()=>{let e;const{getMessages:t,onMessage:n,typing:r}=Xe(),{onOpen:o}=Mo(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return _t(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=vp(),a=e;return typeof a=="function"?So(a,s):e=s,A(s,p(at,{get each(){return t()},get fallback(){return(()=>{var l=xp();return A(l,()=>ft("emptyMessages")),l})()},children:l=>p(mp,l)}),null),A(s,p(J,{get when(){return r()},get children(){return p(wp,{})}}),null),s})()};var Sp=L("<textarea>");const Ep=e=>{const[,t]=H(e,["class"]);return(()=>{var n=Sp();return Qe(n,T({get class(){return je("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var kp=L('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const Cp=e=>(()=>{var t=kp();return Qe(t,e,!0,!0),t})();var Op=L('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const _p=()=>(()=>{var e=Op(),t=e.firstChild;return A(e,p(Cp,{height:15}),t),e})();var Pp=L('<footer class="flex-none p-4 bg-white min-h-16 flex space-x-1 mb-2">');const to=()=>{const{pushMessage:e}=Xe(),[t,n]=_(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=Pp();return A(i,p(Ep,{get placeholder(){return ft("inputPlaceholder")},get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),A(i,p(ye,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return p(nc,{size:24})}}),null),A(i,p(_p,{}),null),i})()};var Ap=L('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[98%] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Tp=L("<span class=sr-only>Close"),Mp=L("<div>"),Dp=L("<span class=sr-only>Open"),Lp=L("<span>"),Ip=L('<div class="animate-pulse flex p-1">');const Rp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o}=Mo(),{chatWidget:i}=ee(),[s,a]=_(!0);return setTimeout(()=>a(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},i()?.openDelay),(()=>{var l=Mp();return A(l,p(J,{get when(){return n()},get children(){var c=Ap();return A(c,e),c}}),null),A(l,p(J,{get when(){return n()},get fallback(){return p(ye,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,Dp(),p(J,{get when(){return i()?.balloonMessage},get children(){var c=Lp();return A(c,p(J,{get when(){return!s()},get fallback(){return(()=>{var u=Ip();return A(u,p(kt,{class:"size-2 animate-bounce"}),null),A(u,p(kt,{class:"size-2 animate-bounce delay-150"}),null),A(u,p(kt,{class:"size-2 animate-bounce delay-300"}),null),u})()},get children(){return i()?.balloonMessage}})),Q(()=>Ze(c,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(i()?.style.position==="left"?" left-9":" right-9"))),c}})]}})},get children(){return p(ye,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[p(yp,{size:30}),Tp()]}})}}),null),Q(()=>Ze(l,"max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(i()?.style.position==="left"?" left-5 items-start":" right-5 items-end"))),l})()};var $p=L('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Fp=({children:e})=>{const{chatWidget:t}=ee(),n={};return t()?.style.width&&(n.width=`min(100%, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=$p();return xo(r,n),A(r,e),r})()};var Np=L("<div id=smarttalks-widget>");const Kp=({children:e})=>{const{chatWidget:t}=ee();return(()=>{var n=Np();return A(n,e),Q(()=>Ze(n,"h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col"+(t()?.style.position==="left"?" left-5":" right-5"))),n})()};var Bp=L('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const no=()=>(()=>{var e=Bp();return A(e,p(tc,{size:45,class:"animate-spin"})),e})(),zp=()=>{const{chatWidget:e}=ee(),{loading:t}=Xe();return _t(async()=>{e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay))}),p(Rp,{get openIcon(){return p(Jo,{get src(){return e()?.avatar}})},get children(){return[p(J,{get when(){return t()},get children(){return p(no,{})}}),p(jr,{}),p(eo,{}),p(to,{})]}})},Vp=()=>{const{loading:e}=Xe();return p(Kp,{get children(){return[p(J,{get when(){return e()},get children(){return p(no,{})}}),p(jr,{}),p(eo,{}),p(to,{})]}})},Up=()=>{const{loading:e}=Xe();return p(Fp,{get children(){return[p(J,{get when(){return e()},get children(){return p(no,{})}}),p(jr,{}),p(eo,{}),p(to,{})]}})},jp=()=>{const{chatWidget:e}=ee(),t=ya(async()=>(e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay)),{default:Vp}));return p(wo,{get children(){return[p(Pt,{get when(){return e()?.mode==="standard"},get children(){return p(zp,{})}}),p(Pt,{get when(){return e()?.mode==="popup"},get children(){return p(t,{})}}),p(Pt,{get when(){return e()?.mode==="static"},get children(){return p(Up,{})}})]}})};var Hp=L("<div><div>Form");const qp=()=>{const{formWidget:e}=ee();return(()=>{var t=Hp();return t.firstChild,A(t,()=>e()?._id,null),t})()};function Wp(){const{widget:e}=ee();return p(wo,{get children(){return[p(Pt,{get when(){return e()?.type==="chat"},get children(){return p(jp,{})}}),p(Pt,{get when(){return e()?.type==="form"},get children(){return p(qp,{})}})]}})}var Gp=L("<style>"),Yp=L("<div>");const Xp=({id:e,settings:t,side:n})=>{const{setWidgetId:r}=ee(),o=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"");return r(o),[(()=>{var i=Gp();return A(i,ja),i})(),(()=>{var i=Yp();return A(i,p(Wp,{})),i})()]};(()=>{typeof window>"u"||Ua("smarttalks-widget",{id:"",settings:!1,side:void 0},Xp)})()});
181
+ */function Fd(e,t){return t?Rc([e.clientX,e.clientY],t):!1}function Nd(e){const t=vt(),n=Ai(),r=ss(),o=Pe({placement:"bottom-start"},e),[i,s]=H(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=P(),[h,m]=P(),[f,g]=P(),[y,w]=P(),[b,v]=P(!0),[x,_]=P(s.placement),[S,k]=P([]),[R,C]=P([]),{DomCollectionProvider:K}=Lu({items:R,onItemsChange:C}),I=fi({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:j=>i.onOpenChange?.(j)}),D=tu(()=>t.forceMount()||I.isOpen()),oe=xu({selectionMode:"none",dataSource:R}),X=j=>{v(j),I.open()},te=(j=!1)=>{I.close(),j&&r&&r.close(!0)},$=j=>{v(j),I.toggle()},U=()=>{const j=y();j&&(ce(j),oe.selectionManager().setFocused(!0),oe.selectionManager().setFocusedKey(void 0))},ie=j=>{k(oo=>[...oo,j]);const Vn=r?.registerNestedMenu(j);return()=>{k(oo=>ar(oo,j)),Vn?.()}},ze=j=>c===l?.side&&Fd(j,l?.area),zn=j=>{ze(j)&&j.preventDefault()},ot=j=>{ze(j)||U()},Ct=j=>{ze(j)&&j.preventDefault()};Zc({isDisabled:()=>!(r==null&&I.isOpen()&&t.isModal()),targets:()=>[y(),...S()].filter(Boolean)}),M(()=>{const j=y();if(!j||!r)return;const Vn=r.registerNestedMenu(j);B(()=>{Vn()})});const Zp={dataset:O(()=>({"data-expanded":I.isOpen()?"":void 0,"data-closed":I.isOpen()?void 0:""})),isOpen:I.isOpen,contentPresence:D,nestedMenus:S,currentPlacement:x,pointerGraceTimeoutId:()=>a,autoFocus:b,listState:()=>oe,parentMenuContext:()=>r,triggerRef:f,contentRef:y,triggerId:u,contentId:h,setTriggerRef:g,setContentRef:w,open:X,close:te,toggle:$,focusContent:U,onItemEnter:zn,onItemLeave:ot,onTriggerLeave:Ct,setPointerDir:j=>c=j,setPointerGraceTimeoutId:j=>a=j,setPointerGraceIntent:j=>l=j,registerNestedMenu:ie,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:mn(d),registerContentId:mn(m)};return p(K,{get children(){return p(is.Provider,{value:Zp,get children(){return p($d,T({anchorRef:f,contentRef:y,onCurrentPlacementChange:_},s))}})}})}const Kd=se();function Bd(e){let t;const n=vt(),r=wt(),o=Pe({id:n.generateId(`item-${Ce()}`)},e),[i,s]=H(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=P(),[c,u]=P(),[d,h]=P(),m=()=>r.listState().selectionManager(),f=()=>s.id,g=()=>m().focusedKey()===f(),y=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};Iu({getItem:()=>({ref:()=>t,type:"item",key:f(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const w=wu({key:f,selectionManager:m,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),b=C=>{de(C,i.onPointerMove),C.pointerType==="mouse"&&(i.disabled?r.onItemLeave(C):(r.onItemEnter(C),C.defaultPrevented||(ce(C.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f()))))},v=C=>{de(C,i.onPointerLeave),C.pointerType==="mouse"&&r.onItemLeave(C)},x=C=>{de(C,i.onPointerUp),!i.disabled&&C.button===0&&y()},_=C=>{if(de(C,i.onKeyDown),!C.repeat&&!i.disabled)switch(C.key){case"Enter":case" ":y();break}},S=O(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),k=O(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),R={isChecked:()=>i.checked,dataset:k,setLabelRef:h,generateId:ti(()=>s.id),registerLabel:mn(l),registerDescription:mn(u)};return p(Kd.Provider,{value:R,get children(){return p(yn,T({as:"div",ref(C){var K=et(I=>t=I,i.ref);typeof K=="function"&&K(C)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return S()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return w.dataKey()},get onPointerDown(){return be([i.onPointerDown,w.onPointerDown])},get onPointerUp(){return be([x,w.onPointerUp])},get onClick(){return be([i.onClick,w.onClick])},get onKeyDown(){return be([_,w.onKeyDown])},get onMouseDown(){return be([i.onMouseDown,w.onMouseDown])},get onFocus(){return be([i.onFocus,w.onFocus])},onPointerMove:b,onPointerLeave:v},k,s))}})}const zd=se();function ls(){return ue(zd)}function Vd(e){let t;const n=vt(),r=wt(),o=ls(),i=Pe({id:n.generateId(`content-${Ce()}`)},e),[s,a]=H(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let l=0;const c=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=Eu({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Xc({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:y=>{o===void 0&&s.onOpenAutoFocus?.(y)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=y=>{if(Oe(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case"ArrowRight":y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},h=y=>{s.onEscapeKeyDown?.(y),o?.setAutoFocusMenu(!1),r.close(!0)},m=y=>{s.onFocusOutside?.(y),n.isModal()&&y.preventDefault()},f=y=>{de(y,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=y=>{if(de(y,s.onPointerMove),y.pointerType!=="mouse")return;const w=y.target,b=l!==y.clientX;Oe(y.currentTarget,w)&&b&&(r.setPointerDir(y.clientX>l?"right":"left"),l=y.clientX)};return M(()=>B(r.registerContentId(s.id))),p(J,{get when(){return r.contentPresence.isPresent()},get children(){return p(Hu,{get children(){return p(Uu,T({ref(y){var w=et(b=>{r.setContentRef(b),r.contentPresence.setRef(b),t=b},s.ref);typeof w=="function"&&w(y)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return O(()=>!!c())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return{"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...s.style}},get"aria-labelledby"(){return r.triggerId()},onEscapeKeyDown:h,onFocusOutside:m,get onDismiss(){return r.close},get onKeyDown(){return be([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return be([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return be([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return be([s.onFocusOut,u.onFocusOut])},onPointerEnter:f,onPointerMove:g},()=>r.dataset(),a))}})}})}function Ud(e){let t;const n=vt(),r=wt(),[o,i]=H(e,["ref"]);return Ni({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),p(Vd,T({ref(s){var a=et(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function jd(e){return p(Bd,T({role:"menuitem",closeOnSelect:!0},e))}function Hd(e){const t=wt();return p(J,{get when(){return t.contentPresence.isPresent()},get children(){return p(Po,e)}})}function qd(e){const t=`menu-${Ce()}`,n=Pe({id:t,modal:!0},e),[r,o]=H(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=fi({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:a=>r.onOpenChange?.(a)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:ti(()=>r.id),value:()=>r.value};return p(as.Provider,{value:s,get children(){return p(Nd,T({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Wd(e){const t=vt(),n=wt(),r=ls(),o=Pe({id:t.generateId("trigger")},e),[i,s]=H(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,M(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),M(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),M(()=>{n.isOpen()&&r.setValue(a)}),B(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const l=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},c=f=>{de(f,i.onPointerDown),f.currentTarget.dataset.pointerType=f.pointerType,!i.disabled&&f.pointerType!=="touch"&&f.button===0&&l()},u=f=>{de(f,i.onClick),i.disabled||f.currentTarget.dataset.pointerType==="touch"&&l()},d=f=>{if(de(f,i.onKeyDown),!i.disabled)switch(f.key){case"Enter":case" ":case"ArrowDown":f.stopPropagation(),f.preventDefault(),$c(f.currentTarget),n.toggle("first");break;case"ArrowUp":f.stopPropagation(),f.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;f.stopPropagation(),f.preventDefault(),r.previousMenu();break}},h=f=>{de(f,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},m=f=>{de(f,i.onFocus),r!==void 0&&r.setValue(a)};return M(()=>B(n.registerTriggerId(i.id))),p(Ou,T({ref(f){var g=et(n.setTriggerRef,i.ref);typeof g=="function"&&g(f)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return O(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return a!==void 0&&r?.value()===a?!0:void 0},get tabIndex(){return r!==void 0?r.value()===a||r.lastValue()===a?0:-1:void 0},onPointerDown:c,onMouseOver:h,onClick:u,onKeyDown:d,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Gd(e){const t=vt(),n=wt(),[r,o]=H(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return p(Ud,T({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||ce(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function Yd(e){const t=`dropdownmenu-${Ce()}`,n=Pe({id:t},e);return p(qd,n)}function Xd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-left",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6"/>'},e)}function Jd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-chevron-right",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6"/>'},e)}function Zd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle-check-filled",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor"/>'},e)}function Qd(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"/>'},e)}function ef(e){return le({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-download",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},c:'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"/><path d="M12 17v-6"/><path d="M9.5 14.5l2.5 2.5l2.5 -2.5"/>'},e)}const tf=e=>p(Yd,T({gutter:4},e)),nf=Wd,rf=e=>{const[,t]=H(e,["class"]);return p(Hd,{get mount(){return cn()},get children(){return p(Gd,T({get class(){return je("z-50 min-w-[8rem] origin-[var(--kb-menu-content-transform-origin)] animate-content-hide overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[expanded]:animate-content-show",e.class)}},t))}})},of=e=>{const[,t]=H(e,["class"]);return p(jd,T({get class(){return je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e.class)}},t))};function sf(e){return e.type==="buttons"&&e.buttons.options.length>3?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function af(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function lf(e,t,n){const r=`${un}/v1/messages`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channelId:n,postback:t,type:"text",text:e})};await fetch(r,o)}async function cf(e,t,n){if(!e||!t||!n)return;const r=`${un}/v1/widget/${e}/restart`,o={credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:t,interactionId:n})};await fetch(r,o)}const Ae=Object.create(null);Ae.open="0",Ae.close="1",Ae.ping="2",Ae.pong="3",Ae.message="4",Ae.upgrade="5",Ae.noop="6";const Cn=Object.create(null);Object.keys(Ae).forEach(e=>{Cn[Ae[e]]=e});const Ar={type:"error",data:"parser error"},cs=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",us=typeof ArrayBuffer=="function",ds=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Tr=({type:e,data:t},n,r)=>cs&&t instanceof Blob?n?r(t):fs(t,r):us&&(t instanceof ArrayBuffer||ds(t))?n?r(t):fs(new Blob([t]),r):r(Ae[e]+(t||"")),fs=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function hs(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Mr;function uf(e,t){if(cs&&e.data instanceof Blob)return e.data.arrayBuffer().then(hs).then(t);if(us&&(e.data instanceof ArrayBuffer||ds(e.data)))return t(hs(e.data));Tr(e,!1,n=>{Mr||(Mr=new TextEncoder),t(Mr.encode(n))})}const gs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ut=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<gs.length;e++)Ut[gs.charCodeAt(e)]=e;const df=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)i=Ut[e.charCodeAt(r)],s=Ut[e.charCodeAt(r+1)],a=Ut[e.charCodeAt(r+2)],l=Ut[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|l&63;return c},ff=typeof ArrayBuffer=="function",Dr=(e,t)=>{if(typeof e!="string")return{type:"message",data:ps(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:hf(e.substring(1),t)}:Cn[n]?e.length>1?{type:Cn[n],data:e.substring(1)}:{type:Cn[n]}:Ar},hf=(e,t)=>{if(ff){const n=df(e);return ps(n,t)}else return{base64:!0,data:e}},ps=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ms="",gf=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Tr(i,!1,a=>{r[s]=a,++o===n&&t(r.join(ms))})})},pf=(e,t)=>{const n=e.split(ms),r=[];for(let o=0;o<n.length;o++){const i=Dr(n[o],t);if(r.push(i),i.type==="error")break}return r};function mf(){return new TransformStream({transform(e,t){uf(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Lr;function On(e){return e.reduce((t,n)=>t+n.length,0)}function Pn(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function yf(e,t){Lr||(Lr=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(On(n)<1)break;const l=Pn(n,1);i=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(On(n)<2)break;const l=Pn(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(On(n)<8)break;const l=Pn(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Ar);break}o=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(On(n)<o)break;const l=Pn(n,o);a.enqueue(Dr(i?l:Lr.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(Ar);break}}}})}const ys=4;function Z(e){if(e)return bf(e)}function bf(e){for(var t in Z.prototype)e[t]=Z.prototype[t];return e}Z.prototype.on=Z.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Z.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Z.prototype.off=Z.prototype.removeListener=Z.prototype.removeAllListeners=Z.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this},Z.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},Z.prototype.emitReserved=Z.prototype.emit,Z.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Z.prototype.hasListeners=function(e){return!!this.listeners(e).length};const _n=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),xe=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),wf="arraybuffer";function Qp(){}function bs(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const vf=xe.setTimeout,xf=xe.clearTimeout;function An(e,t){t.useNativeTimers?(e.setTimeoutFn=vf.bind(xe),e.clearTimeoutFn=xf.bind(xe)):(e.setTimeoutFn=xe.setTimeout.bind(xe),e.clearTimeoutFn=xe.clearTimeout.bind(xe))}const Sf=1.33;function Ef(e){return typeof e=="string"?kf(e):Math.ceil((e.byteLength||e.size)*Sf)}function kf(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ws(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Cf(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Of(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class Pf extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Ir extends Z{constructor(t){super(),this.writable=!1,An(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Pf(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Dr(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Cf(t);return n.length?"?"+n:""}}class _f extends Ir{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};pf(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,gf(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ws()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let vs=!1;try{vs=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Af=vs;function Tf(){}class Mf extends _f{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Te extends Z{constructor(t,n,r){super(),this.createRequest=t,An(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=bs(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Te.requestsCount++,Te.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Tf,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Te.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Te.requestsCount=0,Te.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",xs);else if(typeof addEventListener=="function"){const e="onpagehide"in xe?"pagehide":"unload";addEventListener(e,xs,!1)}}function xs(){for(let e in Te.requests)Te.requests.hasOwnProperty(e)&&Te.requests[e].abort()}const Df=function(){const e=Ss({xdomain:!1});return e&&e.responseType!==null}();class Lf extends Mf{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Df&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Te(Ss,this.uri(),t)}}function Ss(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Af))return new XMLHttpRequest}catch{}if(!t)try{return new xe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Es=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class If extends Ir{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Es?{}:bs(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;Tr(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ws()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Rr=xe.WebSocket||xe.MozWebSocket;class Rf extends If{createSocket(t,n,r){return Es?new Rr(t,n,r):n?new Rr(t,n):new Rr(t)}doWrite(t,n){this.ws.send(n)}}class $f extends Ir{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=yf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=mf();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this._writer.write(r).then(()=>{o&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Ff={websocket:Rf,webtransport:$f,polling:Lf},Nf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Kf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function $r(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=Nf.exec(e||""),i={},s=14;for(;s--;)i[Kf[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Bf(i,i.path),i.queryKey=zf(i,i.query),i}function Bf(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function zf(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Fr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Tn=[];Fr&&addEventListener("offline",()=>{Tn.forEach(e=>e())},!1);class Ye extends Z{constructor(t,n){if(super(),this.binaryType=wf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=$r(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=$r(n.host).host);An(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Of(this.opts.query)),Fr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Tn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ys,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ye.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ye.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=Ef(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,_n(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ye.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Fr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Tn.indexOf(this._offlineEventListener);r!==-1&&Tn.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ye.protocol=ys;class Vf extends Ye{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ye.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ye.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Uf=class extends Vf{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Ff[o]).filter(o=>!!o)),super(t,r)}};function jf(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=$r(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const Hf=typeof ArrayBuffer=="function",qf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ks=Object.prototype.toString,Wf=typeof Blob=="function"||typeof Blob<"u"&&ks.call(Blob)==="[object BlobConstructor]",Gf=typeof File=="function"||typeof File<"u"&&ks.call(File)==="[object FileConstructor]";function Nr(e){return Hf&&(e instanceof ArrayBuffer||qf(e))||Wf&&e instanceof Blob||Gf&&e instanceof File}function Mn(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Mn(e[n]))return!0;return!1}if(Nr(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mn(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mn(e[n]))return!0;return!1}function Yf(e){const t=[],n=e.data,r=e;return r.data=Kr(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Kr(e,t){if(!e)return e;if(Nr(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Kr(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Kr(e[r],t));return n}return e}function Xf(e,t){return e.data=Br(e.data,t),delete e.attachments,e}function Br(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Br(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Br(e[n],t));return e}const Jf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Zf=5;var V;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(V||(V={}));class Qf{constructor(t){this.replacer=t}encode(t){return(t.type===V.EVENT||t.type===V.ACK)&&Mn(t)?this.encodeAsBinary({type:t.type===V.EVENT?V.BINARY_EVENT:V.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===V.BINARY_EVENT||t.type===V.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Yf(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function Cs(e){return Object.prototype.toString.call(e)==="[object Object]"}class zr extends Z{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===V.BINARY_EVENT;r||n.type===V.BINARY_ACK?(n.type=r?V.EVENT:V.ACK,this.reconstructor=new eh(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Nr(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(V[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===V.BINARY_EVENT||r.type===V.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(zr.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case V.CONNECT:return Cs(n);case V.DISCONNECT:return n===void 0;case V.CONNECT_ERROR:return typeof n=="string"||Cs(n);case V.EVENT:case V.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Jf.indexOf(n[0])===-1);case V.ACK:case V.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eh{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Xf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const th=Object.freeze(Object.defineProperty({__proto__:null,Decoder:zr,Encoder:Qf,get PacketType(){return V},protocol:Zf},Symbol.toStringTag,{value:"Module"}));function ke(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Os extends Z{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ke(t,"open",this.onopen.bind(this)),ke(t,"packet",this.onpacket.bind(this)),ke(t,"error",this.onerror.bind(this)),ke(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,o,i;if(nh.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:V.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},o),s=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(s,a)=>s?o(s):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:V.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case V.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case V.EVENT:case V.BINARY_EVENT:this.onevent(t);break;case V.ACK:case V.BINARY_ACK:this.onack(t);break;case V.DISCONNECT:this.ondisconnect();break;case V.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:V.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:V.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function xt(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}xt.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},xt.prototype.reset=function(){this.attempts=0},xt.prototype.setMin=function(e){this.ms=e},xt.prototype.setMax=function(e){this.max=e},xt.prototype.setJitter=function(e){this.jitter=e};class Vr extends Z{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,An(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new xt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||th;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Uf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=ke(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=ke(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ke(t,"ping",this.onping.bind(this)),ke(t,"data",this.ondata.bind(this)),ke(t,"error",this.onerror.bind(this)),ke(t,"close",this.onclose.bind(this)),ke(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){_n(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Os(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const jt={};function Dn(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=jf(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=jt[o]&&i in jt[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Vr(r,t):(jt[o]||(jt[o]=new Vr(r,t)),l=jt[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Dn,{Manager:Vr,Socket:Os,io:Dn,connect:Dn});class rt{static instance;constructor(){}static init(){return rt.instance||(rt.instance=Dn(Nl,{path:"/ws",withCredentials:!0}),rt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!")})),rt.instance}static on(t,n){rt.instance||this.init().on(t,n)}}const Ps=1e3*60*60*24,[Ln,_s]=No("smarttalks-widget-messages",{},Ps),As=()=>{const{widgetId:e}=ee();return Ln[e()]??[]},rh=e=>{const{widgetId:t}=ee();_s({...Ln,[t()]:[...Ln[t()]??[],e]})},oh=()=>{const{widgetId:e}=ee();_s({...Ln,[e()]:[]})},[Ts,ih]=No("smarttalks-widget-conversationinfo",{},Ps),Ms=()=>{const{widgetId:e}=ee();return Ts[e()]??{}},Ds=e=>{const{widgetId:t}=ee();ih({...Ts,[t()]:e})},[sh,Ur]=P(!1),[ah,Ls]=P(!1),Is=[],Rs=()=>{Is.forEach(e=>e())},lh=e=>Is.push(e),jr=e=>{const t=sf(e);if(rh(t),t.type==="media"){setTimeout(Rs,200);return}Rs()},ch=(e,t)=>{const{chatWidget:n}=ee(),r=Ms();e.trim()&&(jr({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),rt.on("message",o=>{(o.contactId!==r.contactId||o.interactionId!==r.interactionId)&&Ds({contactId:o.contactId,interactionId:o.interactionId});for(const i of o.messages)jr(i);Ur(!1),af(o.debug)}),Ur(!0),lf(e,t,n()?._id).catch(o=>{console.error(o),Ur(!1)}))},uh=()=>{const{chatWidget:e}=ee(),t=Ms();Ls(!0),oh(),cf(e()?._id,t.contactId,t.interactionId).finally(()=>{Ds({}),Ls(!1),dh()})},dh=()=>{const{chatWidget:e}=ee();if(As().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&jr({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Xe=()=>({getMessages:As,pushMessage:ch,clearMessages:uh,onMessage:lh,typing:sh,loading:ah});var fh=L("<span>");const hh=()=>{const{clearMessages:e}=Xe();P(!1);const[t,n]=P(!1);return p(tf,{get open(){return t()},onOpenChange:n,get children(){return[p(nf,{get children(){return p(ye,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return p(ec,{size:20})}})}}),p(rf,{get children(){return p(of,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[p(Ql,{size:14}),(()=>{var r=fh();return A(r,()=>ft("restart")),r})()]}})}})]}})};function gh(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>'},e)}function ph(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>'},e)}function mh(e){return le({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>'},e)}var yh=L('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4"><div class="flex items-center gap-0.5">');const Hr=()=>{const{chatWidget:e}=ee(),[t,n]=P(!1),r=()=>{const i=cn();i&&(t()?document.exitFullscreen():i.requestFullscreen(),n(!t()))};document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||n(!1)});const o=()=>{if(e()?.mode==="popup"){const i=cn();i&&(i.style.display="none")}};return(()=>{var i=yh(),s=i.firstChild;return A(i,p(Jl,{}),s),A(s,p(ye,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:r,get children(){return p(J,{get when(){return t()},get fallback(){return p(ph,{size:16})},get children(){return p(gh,{size:16})}})}}),null),A(s,p(J,{get when(){return e()?.showSettings},get children(){return p(hh,{})}}),null),A(s,p(J,{get when(){return e()?.mode==="popup"},get children(){return p(ye,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:o,get children(){return p(mh,{size:16})}})}}),null),i})()};var bh=L("<span>");const $s=({createdAt:e,anchor:t="end"})=>(()=>{var n=bh();return at(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),A(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var wh=L('<div class="place-self-start py-1 flex flex-col"><div class="bg-white shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl">');const vh=({children:e,createdAt:t})=>(()=>{var n=wh(),r=n.firstChild;return A(r,e),A(n,p($s,{createdAt:t,anchor:"start"}),null),n})();var xh=L("<span>");const St=e=>{const[,t]=H(e,["class","children"]);let n=e.children?.toString();return n&&(n=Rl($l(n))),(()=>{var r=xh();return r.innerHTML=n,Ze(r,T({get class(){return je("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Sh=L('<div class="flex flex-col space-y-2"><div><div class="flex space-x-2 py-2 overflow-x-auto snap-x">');const Eh=({options:e,text:t})=>{let n;const{pushMessage:r}=Xe(),[o,i]=P(!1),s=(l=!0)=>{if(n){const c=n.clientWidth/2;n.scrollTo({left:n.scrollLeft+(l?c:-c),behavior:"smooth"})}},a=(l,c)=>{i(!0),r(l,c)};return(()=>{var l=Sh(),c=l.firstChild,u=c.firstChild;A(l,p(St,{get children(){return t?.trim()}}),c),A(c,p(J,{get when(){return e.length>1},get children(){return p(ye,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(!1),get children(){return p(Xd,{size:20})}})}}),u);var d=n;return typeof d=="function"?So(d,u):n=u,A(u,p(st,{each:e,children:h=>p(ye,{variant:"outline",get disabled(){return o()},class:"px-2 py-0 snap-center text-nowrap",onClick:()=>a(h.label,h.value),get children(){return h.label?.trim()}})})),A(c,p(J,{get when(){return e.length>1},get children(){return p(ye,{class:"p-1 text-slate-400",variant:"ghost",onClick:()=>s(),get children(){return p(Jd,{size:20})}})}}),null),Q(()=>at(c,`flex items-center justify-center max-w-64 mx-[-1rem] ${o()&&"opacity-50"}`)),l})()};var kh=L('<div class="flex flex-col"><span>'),Ch=L("<a target=_blank><img><span></span><span>");const Oh=({options:e,text:t})=>(()=>{var n=kh(),r=n.firstChild;return A(r,()=>t?.trim()),A(n,p(st,{each:e,children:o=>(()=>{var i=Ch(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return A(a,()=>o.title?.trim()),A(l,()=>o.description?.trim()),Q(c=>{var u=o.url,d=o.image;return u!==c.e&&ae(i,"href",c.e=u),d!==c.t&&ae(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var Ph=L("<a target=_blank>");const _h=({url:e,text:t})=>(()=>{var n=Ph();return ae(n,"href",e),A(n,()=>t?.trim()),n})();var Ah=e=>{const t=T({initialRegistered:!1},e),[n,r]=P(t.initialRegistered);return[O(()=>{if(n())return z(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Fs=Ah,Ht=e=>typeof e=="function",Th=["button","color","file","image","reset","submit"],Mh=(e,t)=>e==="button"?!0:e==="input"&&t?Th.indexOf(t)!==-1:!1;function Dh(e){const[t,n]=P(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>W(()=>{let a;return Ht(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var qr=Dh,In=new Map,Rn=(e,t)=>{if(In.has(e))return In.get(e);const n=se(t);return In.set(e,n),n},Wr=e=>{const t=In.get(e);if(t)return ue(t)},Lh=e=>{const t=T({enabled:!0},e);M(()=>{z(t.enabled)&&(document.addEventListener("keydown",n),B(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Ih=Lh,Rh=e=>{const t=T({enabled:!0},e);M(()=>{const{body:n}=document;z(t.enabled)&&xr({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},$h=Rh,Fh=e=>{const t=T({enabled:!0,strategy:"pointerup"},e);M(()=>{if(!z(t.enabled))return;const r=z(t.strategy);document.addEventListener(r,n),B(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=z(t.element),i=z(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Nh=Fh,Kh=e=>{const t=T({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Ih({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Nh({enabled:t.dismissOnOutsidePointer,strategy:t.closeOnOutsidePointerStrategy,ignore:t.dismissOnOutsidePointerIgnore,onPointer:n=>{if(t.onOutsidePointer?.(n),!n.defaultPrevented){const r=n.button===0&&n.ctrlKey===!0;if(n.button===2||r)return;t.onDismiss("pointerOutside")}},element:t.element}),$h({enabled:t.noOutsidePointerEvents})},Bh=Kh,Gr=se(),zh=e=>O(()=>{if(ue(Gr))return p(Ns,e);const r=Ce(),[o,i]=P([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return p(Gr.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return p(Ns,e)}})}),Ns=e=>{const t=T({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=H(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=ue(Gr),i=Ce();M(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Bh({dismissOnEscapeKeyDown:()=>z(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>z(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>z(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=O(()=>n.children),l=()=>{const c=a();return Ht(c)?c({get isLastLayer(){return s()}}):c};return W(()=>l())},Vh=zh,Uh=()=>{const[e,t]=P(!1);return M(()=>t(!0)),e},jh=Uh,Hh=(e,t)=>(e&&(Ht(e)?e(t):e[0](e[1],t)),t.defaultPrevented),Yr=(...e)=>e.some(t=>!!t()),qh=e=>(...t)=>{for(const n of e)n&&n(...t)},$n=(...e)=>qh(e),re=e=>e?"":void 0,Wh="div",Gh=e=>{const[t,n]=H(e,["as"]),r=O(()=>t.as??Wh);return O(()=>{const i=r();switch(typeof i){case"function":return W(()=>i(n));case"string":return p(nn,T({component:i},n))}})},Xr=Gh,Yh=e=>{let t,n=!1;return()=>n?t:(n=!0,t=O(e))},Ks=Yh,Xh=e=>O(()=>z(e.element)?.tagName.toLowerCase()||e.fallback),Jh=Xh,Bs="button",Zh=e=>{const[t,n]=P(null),[r,o]=H(e,["as","ref","type"]),i=Jh({element:t,fallback:Bs}),s=O(()=>Mh(i(),r.type));return p(Xr,T({get as(){return r.as??Bs},ref(a){var l=$n(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},Qh=Zh,pe=e=>typeof e=="function"?e():e,Fn=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),eg='a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',Jr="focusTrap.initialFocus",Zr="focusTrap.finalFocus",zs={bubbles:!1,cancelable:!0},tg=e=>{const t=T({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=P(null),o=O(()=>{const f=n();return f?f[0]??null:null}),i=O(()=>{const f=n();return f?f[f.length-1]??null:null});let s=null;const a=()=>{l(pe(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(pe(t.element))};M(()=>{const f=pe(t.element);if(f&&pe(t.enabled)){s=document.activeElement,W(()=>{l(f),c(f)});const g=new MutationObserver(a);pe(t.observeChanges)&&g.observe(f,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),B(()=>{pe(t.observeChanges)&&g.disconnect(),r(null),m(f)})}}),M(()=>{const f=n();f===null||f.length!==0||(document.addEventListener("keydown",h),B(()=>{document.removeEventListener("keydown",h)}))}),M(()=>{const f=o();f&&(f.addEventListener("keydown",u),B(()=>{f.removeEventListener("keydown",u)}))}),M(()=>{const f=i();f&&(f.addEventListener("keydown",d),B(()=>{f.removeEventListener("keydown",d)}))});const l=f=>{r(Array.from(f.querySelectorAll(eg)))},c=f=>{const g=pe(t.initialFocusElement)??o()??f,y=t.onInitialFocus;let w;y&&(w=new CustomEvent(Jr,zs),f.addEventListener(Jr,y),f.dispatchEvent(w),f.removeEventListener(Jr,y)),w?.defaultPrevented!==!0&&Fn(()=>g.focus())},u=f=>{f.key==="Tab"&&f.shiftKey&&(f.preventDefault(),i().focus())},d=f=>{f.key==="Tab"&&!f.shiftKey&&(f.preventDefault(),o().focus())},h=f=>{f.key==="Tab"&&f.preventDefault()},m=f=>{if(!pe(t.restoreFocus))return;const y=pe(t.finalFocusElement)??s;if(!y)return;let w;const b=t.onFinalFocus;b&&(w=new CustomEvent(Zr,zs),f.addEventListener(Zr,b),f.dispatchEvent(w),f.removeEventListener(Zr,b)),w?.defaultPrevented!==!0&&Fn(()=>y.focus())}},ng=tg,rg=ng,Nn=e=>typeof e=="function"?e():e,og=e=>{const t=O(()=>{const s=Nn(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=P(Nn(e.show)?"present":"hidden");let i="none";return M(s=>{const a=Nn(e.show);return W(()=>{if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),M(()=>{const s=Nn(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),B(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},ig=og,Vs=ig,sg=se(),ag=e=>e?Rn(`dialog-${e}`):sg,Us=se(),lg=e=>e?Rn(`dialog-internal-${e}`):Us,Et=e=>{if(!e){const n=ue(Us);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=Wr(`dialog-internal-${e}`);if(!t)throw new Error(`[corvu]: Dialog context with id "${e}" not found. Make sure to wrap Dialog components in <Dialog.Root contextId="${e}">`);return t},cg="div",ug=e=>{const[t,n]=H(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=O(()=>Et(t.contextId)),o=()=>Yr(r().open,()=>t.forceMount,r().contentPresent),i=O(s=>s||o(),!1);return p(J,{get when(){return i()},get children(){return p(Vh,{get element(){return r().contentRef},get enabled(){return r().open()||r().contentPresent()},onDismiss:()=>r().setOpen(!1),get dismissOnEscapeKeyDown(){return r().closeOnEscapeKeyDown},get dismissOnOutsidePointer(){return r().closeOnOutsidePointer},get dismissOnOutsidePointerStrategy(){return r().closeOnOutsidePointerStrategy},get dismissOnOutsidePointerIgnore(){return r().triggerRef},get noOutsidePointerEvents(){return r().noOutsidePointerEvents},get onEscapeKeyDown(){return r().onEscapeKeyDown},get onOutsidePointer(){return r().onOutsidePointer},children:s=>{const a=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(Xr,T({ref(l){var c=$n(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??cg},get role(){return r().role()},get id(){return r().dialogId()},get"aria-labelledby"(){return r().labelId()},get"aria-describedby"(){return r().descriptionId()},get"aria-modal"(){return r().modal()?"true":"false"},get"data-open"(){return re(r().open())},get"data-closed"(){return re(!r().open())},get"data-corvu-dialog-content"(){return t.hasOwnProperty("data-corvu-dialog-content")?t["data-corvu-dialog-content"]:""},tabIndex:"-1",get style(){return{"pointer-events":s.isLastLayer?"auto":void 0,...t.style}}},n,{get children(){return a()}}))}})}})}})},dg=ug,fg="div",hg=e=>{const[t,n]=H(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=O(()=>Et(t.contextId)),o=()=>Yr(r().open,()=>t.forceMount,r().overlayPresent),i=O(s=>s||o(),!1);return p(J,{get when(){return i()},get children(){return(()=>{const s=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(Xr,T({get as(){return t.as??fg},ref(a){var l=$n(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return re(r().open())},get"data-closed"(){return re(!r().open())},get"data-corvu-dialog-overlay"(){return t.hasOwnProperty("data-corvu-dialog-overlay")?t["data-corvu-dialog-overlay"]:""},tabIndex:"-1",get style(){return{"pointer-events":"auto",...t.style}}},n,{get children(){return s()}}))}})})()}})},gg=hg,pg=e=>{const[t,n]=H(e,["forceMount","contextId","children"]),r=O(()=>Et(t.contextId)),o=()=>Yr(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=jh(),s=O(a=>a||o()&&i(),!1);return p(J,{get when(){return s()},get children(){return(()=>{const a=O(()=>t.children);return p(J,{get when(){return o()},get children(){return p(Po,T(n,{get children(){return a()}}))}})})()}})},mg=pg,Qr=!0,yg=e=>{const t=T({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??Qr),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??Qr),preventScroll:()=>!!(e.modal??Qr),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ce()},e),[n,r]=qr({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Fs({value:()=>t.labelId??Ce()}),[a,l,c]=Fs({value:()=>t.descriptionId??Ce()}),[u,d]=P(null),[h,m]=P(null),[f,g]=P(null),{present:y}=Vs({show:n,element:h}),{present:w}=Vs({show:n,element:f});rg({element:h,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Ni({element:h,enabled:()=>y()&&z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const b={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return z(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return z(t.noOutsidePointerEvents)},get preventScroll(){return z(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return z(t.preventScrollbarShift)},get preventScrollbarShiftMode(){return t.preventScrollbarShiftMode},get allowPinchZoom(){return t.allowPinchZoom},get trapFocus(){return t.trapFocus},get restoreFocus(){return t.restoreFocus},get initialFocusEl(){return t.initialFocusEl},get finalFocusEl(){return t.finalFocusEl},get contentPresent(){return y()},get contentRef(){return h()},get overlayPresent(){return w()},get overlayRef(){return f()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},v=Ks(()=>t.children),x=()=>{const S=v()();return Ht(S)?S(b):S};return O(()=>{const S=ag(t.contextId),k=lg(t.contextId);return p(S.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return p(k.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>z(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>z(t.noOutsidePointerEvents),preventScroll:()=>z(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>z(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:y,contentRef:h,overlayPresent:w,overlayRef:f,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:m,setOverlayRef:g,triggerRef:u,setTriggerRef:d}},get children(){return W(()=>x())}})}})})},bg=yg,wg="button",vg=e=>{const[t,n]=H(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=O(()=>Et(t.contextId));return p(Qh,T({ref(i){var s=$n(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??wg},onClick:i=>{!Hh(t.onClick,i)&&r().setOpen(s=>!s)},"aria-haspopup":"dialog",get"aria-expanded"(){return r().open()?"true":"false"},get"aria-controls"(){return r().dialogId()},get"data-open"(){return re(r().open())},get"data-closed"(){return re(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},xg=vg;function Sg(e){const t=T({enabled:!0,dimension:"both"},e),[n,r]=P(!1),[o,i]=P(null);let s=null;M(()=>{const c=pe(t.element),u=pe(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),B(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const u=c.target,d=[u.offsetWidth,u.offsetHeight],h=pe(t.dimension);h==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Se(()=>{i(s),r(!0)}),Fn(()=>{i(d),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d:s?Kn(h,s)!==Kn(h,d)&&(Se(()=>{i(Kn(h,s)),r(!0)}),Fn(()=>{i(Kn(h,d)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d},l=()=>{if(!n())return;const c=pe(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Se(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Kn=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},Eg=Sg,kg=Eg,Cg=(e,t)=>e.length>0?()=>e(W(t)):e;function Og(e,t){let n=0;const r=e.map((o,i)=>O(()=>(n=i,o()),void 0,Qo));return O(()=>r.map(o=>o())[n],void 0,t)}function js(e,t,n){let r=()=>t;const[o,i]=P(t,Qo),s=O(Cg(e,()=>r()),t);return[r=Og([o,s],n),a=>i(()=>typeof a=="function"?a(W(r)):a)]}var Pg=e=>p(xg,T({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),Hs=se(),_g=e=>e?Rn(`drawer-${e}`):Hs,Ag=e=>{if(!e){const n=ue(Hs);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Wr(`drawer-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},qs=se(),Tg=e=>e?Rn(`drawer-internal-${e}`):qs,Ws=e=>{if(!e){const n=ue(qs);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Wr(`drawer-internal-${e}`);if(!t)throw new Error(`[corvu]: Drawer context with id "${e}" not found. Make sure to wrap Drawer components in <Drawer.Root contextId="${e}">`);return t},Gs=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Bn(e,t)};const o=r[n-1]?Bn(r[n-1],t):void 0,i=r[n]?Bn(r[n],t):void 0;return{value:e,offset:Bn(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Bn=(e,t)=>{if(typeof e=="number")return t-e*t;if(!e.endsWith("px"))throw new Error(`[corvu] Snap and break points must be a number or a string ending with 'px'. Got ${e}`);return t-parseInt(e,10)},Mg=(e,t,n,r)=>{const o=Ys("upper",e,r?n:t),i=Ys("lower",e,r?n:t);return o?i?i.upperBreakPoint===void 0||o.lowerBreakPoint===void 0?Math.abs(i.offset-n)<Math.abs(o.offset-n)?i:o:n<o.lowerBreakPoint?i:o:o:i},Ys=(e,t,n)=>t.reduce((r,o)=>e=="upper"&&o.offset>=n&&(!r||o.offset<r.offset)||e=="lower"&&o.offset<=n&&(!r||o.offset>r.offset)?o:r,void 0),Dg=(e,t)=>{let n=e,r=!1;do{if(n.hasAttribute("data-corvu-no-drag")||n.type==="range")return!1;n===(t??document.documentElement)?r=!0:n=n.parentElement}while(n&&!r);return!0},Lg=void 0,Ig=e=>{const t=T({initialOpen:!1,snapPoints:[0,1],breakPoints:[Lg],defaultSnapPoint:1,side:"bottom",dampFunction:$=>6*Math.log($+1),velocityFunction:($,U)=>{const ie=$/U;return ie<1&&ie>-1?1:ie},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=H(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=qr({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=qr({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=P(),{transitioning:u,transitionSize:d}=kg({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[h,m]=P(!1),[f,g]=js(()=>u()?"resizing":null),y=O(()=>{const $=l()?.contentRef();if($)return getComputedStyle($)}),[w,b]=P(!1);M(()=>{const $=o();W(()=>{w()!==$&&($?(b(!0),Di(()=>{Se(()=>{g("opening"),a(n.defaultSnapPoint)}),parseFloat(y().transitionDuration)===0&&g(null)})):(Se(()=>{g("closing"),a(0)}),Di(()=>{parseFloat(y().transitionDuration)===0&&v()})))})});const v=()=>{Se(()=>{b(!1),g(null)})},[x,_]=P(0);M(()=>{const $=l()?.contentRef();if(!$)return;k($);const U=new ResizeObserver(S);U.observe($),B(()=>{U.disconnect()})});const S=$=>{for(const U of $)U.target===l()?.contentRef()&&k(U.target)},k=$=>{const U=W(()=>x());switch(n.side){case"top":case"bottom":if(U===$.offsetHeight)return;_($.offsetHeight);break;case"left":case"right":if(U===$.offsetWidth)return;_($.offsetWidth);break}},R=O(()=>Gs(s(),x())),[C,K]=js(()=>R().offset),I=O(()=>x()?(x()-C())/x():0),D={get snapPoints(){return n.snapPoints},get breakPoints(){return n.breakPoints},get defaultSnapPoint(){return n.defaultSnapPoint},get activeSnapPoint(){return s()},setActiveSnapPoint:a,get side(){return n.side},get isDragging(){return h()},get isTransitioning(){return f()!==null},get transitionState(){return f()},get openPercentage(){return I()},get translate(){return C()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},oe=Ks(()=>n.children),X=$=>{c(Et(n.contextId));const U=oe()();if(Ht(U)){const ie=T($,D);return U(ie)}return U};return O(()=>{const $=_g(n.contextId),U=Tg(n.contextId);return W(()=>p($.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return p(U.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:h,isTransitioning:()=>f()!==null,transitionState:f,openPercentage:I,translate:C,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:m,setTranslate:K,drawerSize:x,resolvedActiveSnapPoint:R,drawerStyles:y,setTransitionState:g,transitionSize:d,closeDrawer:v}},get children(){return p(bg,T({get open(){return w()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!h()&&n.closeOnOutsidePointer}},r,{children:ie=>X(ie)}))}})}}))})},Rg=Ig,$g=e=>{const[t,n]=H(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=O(()=>Ws(t.contextId)),c=O(()=>Et(t.contextId)),u=O(()=>l().snapPoints().map((v,x)=>Gs(v,l().drawerSize(),x,l().breakPoints()))),d=O(()=>{switch(l().side()){case"top":return`translate3d(0, ${-l().translate()}px, 0)`;case"bottom":return`translate3d(0, ${l().translate()}px, 0)`;case"right":return`translate3d(${l().translate()}px, 0, 0)`;case"left":return`translate3d(${-l().translate()}px, 0, 0)`}}),h=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"top":case"bottom":return`${v}px`}}),m=O(()=>{const v=l().transitionSize();if(v)switch(l().side()){case"left":case"right":return`${v}px`}});M(()=>{c().open()&&(document.addEventListener("pointermove",g),document.addEventListener("touchmove",y),document.addEventListener("pointerup",b),document.addEventListener("touchend",b),B(()=>{document.removeEventListener("pointermove",g),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",b),document.removeEventListener("touchend",b)}))});const f=v=>{Dg(v.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[v.clientX,v.clientY]))},g=v=>{w(v.target,v.clientX,v.clientY)},y=v=>{v.touches[0]&&w(v.target,v.touches[0].clientX,v.touches[0].clientY)},w=(v,x,_)=>{if(!r)return;if(!l().isDragging()||o===null){const R=window.getSelection();if(R&&R.toString().length>0){b();return}if(l().handleScrollableElements()){const C=[x,_].map((te,$)=>i[$]-te),K=Math.abs(C[0])>Math.abs(C[1])?"x":"y",I=K==="x"?C[0]:C[1];if(Math.abs(I)<.3)return;const D=c().contentRef(),[oe,X]=Li(v,K,D);if(I>0&&Math.abs(oe)>1||I<0&&Math.abs(X)>0){b();return}}switch(l().side()){case"top":case"bottom":o=_;break;case"right":case"left":o=x}s=new Date,a=l().translate(),Se(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let S;switch(l().side()){case"top":S=-(o-_);break;case"bottom":S=o-_;break;case"right":S=o-x;break;case"left":S=-(o-x);break}S-=l().resolvedActiveSnapPoint().offset,S>0&&(S=l().dampFunction(S));const k=new Date;k.getTime()-s.getTime()>l().velocityCacheReset()&&(s=k,a=l().translate()),l().setTranslate(-S)},b=()=>{if(r=!1,!l().isDragging())return;const v=new Date,x=l().velocityFunction(-(a-l().translate()),v.getTime()-s.getTime()||1),_=l().translate()*x,S=Mg(u(),l().translate(),_,l().allowSkippingSnapPoints());Se(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Se(()=>{l().setActiveSnapPoint(S.value),S.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(S.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return p(dg,T({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:h(),width:m(),...t.style}},onPointerDown:f,onTransitionEnd:()=>{Se(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return re(l().isTransitioning())},get"data-opening"(){return re(l().transitionState()==="opening")},get"data-closing"(){return re(l().transitionState()==="closing")},get"data-snapping"(){return re(l().transitionState()==="snapping")},get"data-resizing"(){return re(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},Fg=$g,Ng=e=>{const[t,n]=H(e,["contextId"]),r=O(()=>Ws(t.contextId));return p(gg,T({get contextId(){return t.contextId},get"data-transitioning"(){return re(r().isTransitioning())},get"data-opening"(){return re(r().transitionState()==="opening")},get"data-closing"(){return re(r().transitionState()==="closing")},get"data-snapping"(){return re(r().transitionState()==="snapping")},get"data-resizing"(){return re(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Kg=Ng,Bg=L('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const zg=Rg,Vg=Pg,Ug=mg,jg=e=>{const[,t]=H(e,["class"]),n=Ag();return p(Kg,T({get class(){return je("absolute inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",e.class)},get style(){return{"background-color":`rgb(0 0 0 / ${.6*n.openPercentage()})`}}},t))},Hg=e=>{const[,t]=H(e,["class","children"]);return p(Ug,{get mount(){return cn()},get children(){return[p(jg,{}),p(Fg,T({id:"smarttalks-list-content",get class(){return je("absolute inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[80%] flex-col rounded-t-[10px] border bg-background after:top-full after:h-[50%] after:bg-inherit md:select-none transition-transform duration-300",e.class)}},t,{get children(){return[Bg(),O(()=>e.children)]}}))]}})};var qg=L('<span class="font-semibold mt-2">'),Wg=L('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),Gg=L('<div class="flex flex-col space-y-2"><div>'),Yg=L('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),Xg=L('<div class="flex flex-col items-start"><span class=text-slate-500>');const Jg=({options:e,text:t,title:n})=>{const{pushMessage:r}=Xe(),[o,i]=P(!1),[s,a]=P(!1),[l,c]=P(),u=(h,m)=>{a(!1),i(!0),r(h,m)},d=h=>{const m=h.composedPath();for(const f of m)if(f.id==="smarttalks-list-content"){h.preventDefault();return}};return(()=>{var h=Gg(),m=h.firstChild;return A(h,p(St,{get children(){return t?.trim()}}),m),A(m,p(zg,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[p(Vg,{as:ye,variant:"outline",class:"w-full text-nowrap",get children(){return n?.trim()??ft("selectOption")}}),p(Hg,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var f=qg();return A(f,()=>n?.trim()??ft("selectOption")),f})(),(()=>{var f=Wg();return A(f,p(st,{each:e,children:g=>(()=>{var y=Yg(),w=y.firstChild;return A(w,()=>g.label?.trim()??""),A(y,p(st,{get each(){return g.items},children:b=>p(ye,{variant:"outline",get disabled(){return o()},get class(){return`py-6 flex justify-between hover:bg-slate-200 ${l()===b?"bg-slate-200":""}`},onClick:()=>c(b),get children(){return[(()=>{var v=Xg(),x=v.firstChild;return A(v,()=>b.label?.trim(),x),A(x,()=>b.description?.trim()),v})(),p(J,{get when(){return l()===b},get fallback(){return p(Qd,{class:"size-4 text-slate-500"})},get children(){return p(Zd,{class:"size-4 text-slate-500"})}})]}})}),null),y})()})),f})(),p(ye,{get disabled(){return o()||!l()},onClick:()=>u(l().label,l().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return ft("send")}})]}})]}})),Q(()=>at(m,o()?"opacity-50":"")),h})()};var Zg=L("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const Qg=e=>(()=>{var t=Zg(),n=t.firstChild,r=n.nextSibling;return Q(o=>{var i=e.link,s=e.link;return i!==o.e&&ae(n,"src",o.e=i),s!==o.t&&ae(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var ep=L('<div class="flex flex-col space-y-2"><a class="self-center hover:brightness-75 transition-all duration-300 flex flex-col items-center justify-between bg-slate-200 rounded-md px-1 py-1 space-y-2 text-slate-700"target=_blank><span class="font-semibold text-sm">');const tp=e=>(()=>{var t=ep(),n=t.firstChild,r=n.firstChild;return A(n,p(ef,{class:"size-10"}),r),A(r,()=>e.filename?.trim()),A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(()=>ae(n,"href",e.link)),t})();var np=L('<div class="flex flex-col space-y-2"><a class="object-contain hover:brightness-50 transition-all duration-300"target=_blank><img class="w-full h-auto rounded-md">');const rp=e=>(()=>{var t=np(),n=t.firstChild,r=n.firstChild;return A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&ae(n,"href",o.e=i),s!==o.t&&ae(r,"src",o.t=s),a!==o.a&&ae(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var op=L('<div class="flex flex-col space-y-2"><video controls preload=auto class="size-full rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const ip=e=>(()=>{var t=op(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return A(t,p(St,{get children(){return e.text?.trim()}}),null),Q(i=>{var s=e.link,a=e.link;return s!==i.e&&ae(r,"src",i.e=s),a!==i.t&&ae(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var sp=L("<div>Media type not supported");const Xs=e=>e.type==="image"?p(rp,e):e.type==="audio"?p(Qg,e):e.type==="document"?p(tp,e):e.type==="video"?p(ip,e):sp(),eo=({text:e})=>p(St,{get children(){return e?.trim()}});var ap=L("<div>Unknown bot message type");const lp=e=>p(vh,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(eo,{get text(){return e.text}}):e.type==="buttons"?p(Eh,T(()=>e.buttons)):e.type==="list"?p(Jg,T(()=>e.list)):e.type==="media"?p(Xs,T(()=>e.media)):e.type==="link"?p(_h,T(()=>e.link)):e.type==="cards"?p(Oh,T(()=>e.cards)):e.type==="date"?p(eo,{get text(){return e.text}}):ap()}});var cp=L('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const up=e=>(()=>{var t=cp(),n=t.firstChild;return A(n,()=>e.text?.trim()),t})();var dp=L('<div class="place-self-end py-1 flex flex-col"><div class="bg-primary shadow-primary/40 shadow-md py-2 px-4 rounded-l-xl rounded-tr-xl text-primary-foreground">');const fp=({children:e,createdAt:t})=>(()=>{var n=dp(),r=n.firstChild;return A(r,e),A(n,p($s,{createdAt:t,anchor:"end"}),null),n})();var hp=L("<div>Unknown user message type");const gp=e=>p(fp,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?p(eo,{get text(){return e.text}}):e.type==="media"?p(Xs,T(()=>e.media)):hp()}});var pp=L("<div>Unknown message origin");const mp=e=>e.origin==="bot"?p(lp,e):e.origin==="user"?p(gp,e):e.origin==="service"?p(up,e):pp();function yp(e){return le({a:{viewBox:"0 0 512 512"},c:'<path d="m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34Z"/>'},e)}function kt(e){return le({a:{viewBox:"0 0 512 512"},c:'<path d="M256 464c-114.69 0-208-93.31-208-208S141.31 48 256 48s208 93.31 208 208-93.31 208-208 208Z"/>'},e)}var bp=L('<div class="place-self-start py-1"><div class="animate-pulse bg-white flex space-x-1 shadow-md py-2 px-4 rounded-r-xl rounded-tl-xl text-slate-400">');const wp=()=>(()=>{var e=bp(),t=e.firstChild;return A(t,p(kt,{class:"size-2 animate-bounce"}),null),A(t,p(kt,{class:"size-2 animate-bounce delay-150"}),null),A(t,p(kt,{class:"size-2 animate-bounce delay-300"}),null),e})();var vp=L('<main class="flex-grow p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative">'),xp=L("<div>");const to=()=>{let e;const{getMessages:t,onMessage:n,typing:r}=Xe(),{onOpen:o}=Mo(),i=(s=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},s)};return Pt(()=>{i(200)}),n(i),o(()=>i(200)),(()=>{var s=vp(),a=e;return typeof a=="function"?So(a,s):e=s,A(s,p(st,{get each(){return t()},get fallback(){return(()=>{var l=xp();return A(l,()=>ft("emptyMessages")),l})()},children:l=>p(mp,l)}),null),A(s,p(J,{get when(){return r()},get children(){return p(wp,{})}}),null),s})()};var Sp=L("<textarea>");const Ep=e=>{const[,t]=H(e,["class"]);return(()=>{var n=Sp();return Ze(n,T({get class(){return je("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class)}},t),!1,!1),n})()};var kp=L('<svg viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M50.3241 0H21.6759C9.69907 0 0 9.68892 0 21.6519V50.3481C0 62.3111 9.69907 72 21.6759 72H67.9815C70.2546 72 72 70.1845 72 67.9105V21.6519C72 9.68892 62.3009 0 50.3241 0Z"fill=#212431></path><path d="M28.9868 56.1046H24.7249C21.9596 56.1046 19.7217 53.8671 19.7217 51.1129V45.9126C19.7217 44.244 18.3676 42.8929 16.6952 42.8929H13.6924C11.8108 42.8929 10.2857 41.3712 10.2857 39.494V37.0622C10.2857 35.185 11.8108 33.6633 13.6924 33.6633H25.3758C27.3713 33.6633 28.9868 35.275 28.9868 37.2613V56.1046Z"fill=white></path><path d="M61.7142 26.3227C61.7142 28.1782 60.2059 29.6992 58.3661 29.6992H46.2955V56.1042H37.629C34.9627 56.1042 32.8054 53.9238 32.8054 51.2395V36.1839C32.8054 32.6002 29.9243 29.6992 26.3755 29.6992H20.1791C18.3393 29.6992 16.8311 28.1782 16.8311 26.3227V19.2729C16.8311 17.408 18.33 15.8964 20.1791 15.8964H58.3661C60.2153 15.8964 61.7142 17.408 61.7142 19.2729V26.3227Z"fill=white>');const Cp=e=>(()=>{var t=kp();return Ze(t,e,!0,!0),t})();var Op=L('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-0 pb-1"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const Pp=()=>(()=>{var e=Op(),t=e.firstChild;return A(e,p(Cp,{height:15}),t),e})();var _p=L('<footer class="flex-none p-4 bg-white min-h-16 flex space-x-1 mb-2">');const no=()=>{const{pushMessage:e}=Xe(),[t,n]=P(""),r=()=>{e(t()),n("")},o=i=>{i.key==="Enter"&&!i.shiftKey&&r()};return(()=>{var i=_p();return A(i,p(Ep,{get placeholder(){return ft("inputPlaceholder")},get value(){return t()},onInput:s=>n(s.currentTarget.value),onkeyup:o,class:"focus-visible:ring-primary h-10",style:"resize: none;",autofocus:!0}),null),A(i,p(ye,{variant:"outline",class:"p-2","aria-label":"Send",type:"button",onClick:r,get children(){return p(nc,{size:24})}}),null),A(i,p(Pp,{}),null),i})()};var Ap=L('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[98%] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),Tp=L("<span class=sr-only>Close"),Mp=L("<div>"),Dp=L("<span class=sr-only>Open"),Lp=L("<span>"),Ip=L('<div class="animate-pulse flex p-1">');const Rp=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o}=Mo(),{chatWidget:i}=ee(),[s,a]=P(!0);setTimeout(()=>a(!1),2e3),i()?.openDelay&&setTimeout(()=>{o()},i()?.openDelay);const l=()=>(i()?.style.margin??5)/4,c=()=>i()?.style.position==="left"?{left:`${l()}rem`}:{right:`${l()}rem`};return(()=>{var u=Mp();return A(u,p(J,{get when(){return n()},get children(){var d=Ap();return A(d,e),d}}),null),A(u,p(J,{get when(){return n()},get fallback(){return p(ye,{onclick:r,class:"rounded-full py-6 px-0 hover:shadow-primary shadow-md border border-primary transition-shadow duration-300","aria-label":"Open",type:"button",get children(){return[t,Dp(),p(J,{get when(){return i()?.balloonMessage},get children(){var d=Lp();return A(d,p(J,{get when(){return!s()},get fallback(){return(()=>{var h=Ip();return A(h,p(kt,{class:"size-2 animate-bounce"}),null),A(h,p(kt,{class:"size-2 animate-bounce delay-150"}),null),A(h,p(kt,{class:"size-2 animate-bounce delay-300"}),null),h})()},get children(){return i()?.balloonMessage}})),Q(()=>at(d,"absolute -top-2 bg-primary text-primary-foreground px-1 py-0.5 pointer-events-none rounded truncate"+(i()?.style.position==="left"?" left-9":" right-9"))),d}})]}})},get children(){return p(ye,{onclick:r,class:"rounded-full py-6 px-2 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[p(yp,{size:30}),Tp()]}})}}),null),Q(d=>{var h="max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2"+(i()?.style.position==="left"?" items-start":" items-end"),m=c();return h!==d.e&&at(u,d.e=h),d.t=tn(u,m,d.t),d},{e:void 0,t:void 0}),u})()};var $p=L('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const Fp=({children:e})=>{const{chatWidget:t}=ee(),n={};return t()?.style.width&&(n.width=`min(100%, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=$p();return tn(r,n),A(r,e),r})()};var Np=L('<div id=smarttalks-widget class="h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,400px)] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 rounded-md shadow-xl overflow-hidden bg-background text-foreground flex flex-col">');const Kp=({children:e})=>{const{chatWidget:t}=ee(),n=()=>(t()?.style.margin??5)/4,r=()=>t()?.style.position==="left"?{left:`${n()}rem`}:{right:`${n()}rem`};return(()=>{var o=Np();return A(o,e),Q(i=>tn(o,r(),i)),o})()};var Bp=L('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const ro=()=>(()=>{var e=Bp();return A(e,p(tc,{size:45,class:"animate-spin"})),e})(),zp=()=>{const{chatWidget:e}=ee(),{loading:t}=Xe();return Pt(async()=>{e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay))}),p(Rp,{get openIcon(){return p(Jo,{get src(){return e()?.avatar}})},get children(){return[p(J,{get when(){return t()},get children(){return p(ro,{})}}),p(Hr,{}),p(to,{}),p(no,{})]}})},Vp=()=>{const{loading:e}=Xe();return p(Kp,{get children(){return[p(J,{get when(){return e()},get children(){return p(ro,{})}}),p(Hr,{}),p(to,{}),p(no,{})]}})},Up=()=>{const{loading:e}=Xe();return p(Fp,{get children(){return[p(J,{get when(){return e()},get children(){return p(ro,{})}}),p(Hr,{}),p(to,{}),p(no,{})]}})},jp=()=>{const{chatWidget:e}=ee(),t=ya(async()=>(e()?.openDelay&&await new Promise(n=>setTimeout(n,e()?.openDelay)),{default:Vp}));return p(vo,{get children(){return[p(_t,{get when(){return e()?.mode==="standard"},get children(){return p(zp,{})}}),p(_t,{get when(){return e()?.mode==="popup"},get children(){return p(t,{})}}),p(_t,{get when(){return e()?.mode==="static"},get children(){return p(Up,{})}})]}})};var Hp=L("<div><div>Form");const qp=()=>{const{formWidget:e}=ee();return(()=>{var t=Hp();return t.firstChild,A(t,()=>e()?._id,null),t})()};function Wp(){const{widget:e}=ee();return p(vo,{get children(){return[p(_t,{get when(){return e()?.type==="chat"},get children(){return p(jp,{})}}),p(_t,{get when(){return e()?.type==="form"},get children(){return p(qp,{})}})]}})}var Gp=L("<style>"),Yp=L("<div>");const Xp=({id:e,settings:t,side:n,margin:r,mode:o})=>{const{setWidgetId:i}=ee(),s=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");return i(s),[(()=>{var a=Gp();return A(a,ja),a})(),(()=>{var a=Yp();return A(a,p(Wp,{})),a})()]},Jp={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||Ua("smarttalks-widget",Jp,Xp)})(),typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{window.postMessage({from:"smarttalkswidget",command:"registerContactData",contactData:e})}})});